Classes | Functions | Variables
lem_server Namespace Reference

Classes

class  ConnInfo
 

Functions

def is_allowed_ip (ip)
 
def pop_old_conns (q)
 
def nConns (d)
 
def pop_fronts (d)
 
def get_tag ()
 
def is_complete_query (msg)
 
def ok200 ()
 
def ok200_html ()
 
def unimp501 ()
 
def status_text ()
 
def handle_status (client, args)
 
def handle_releases (client, args)
 
def handle_backlog (client, args)
 
def handle_ids (client, args)
 
def handle_status_html (client, args)
 
def failsafe_arg (cmd, args, name)
 
def handle_get_work (client, args)
 
def handle_return_results (client, args, postdata)
 
def handle_pid (client, args, postdata)
 
def handle_query (sockStr, client)
 
def startup (port)
 
def close_old_connections ()
 
def shed_load ()
 

Variables

int gVerbosity = 0
 
list gIPWhitelist
 
 gPIDQueue = defaultdict(deque)
 
 gGetWorkQueue = defaultdict(deque)
 
dictionary gWorkInProgress = {}
 
dictionary gClientMap = {}
 
int gSeqNo = 0
 
int gErrCount = 0
 
int gBusyTime = 0
 
int gIdleTime = 0
 
 gIdList = defaultdict(lambda: 0)
 
dictionary gClientList = {}
 
dictionary gWorkerList = {}
 
int gLastSeqNo = 0
 
 gLastStatus = time.time()
 
int kMinPort = 1024
 
int kMaxPort = 1031
 
int kNumPorts = kMaxPort-kMinPort+1
 
list serverSock = [startup(port) for port in range(kMinPort, kMaxPort+1)]
 
 ep = select.epoll()
 
dictionary socketMap = {}
 
 inbox = defaultdict(lambda: '')
 
 outbox = defaultdict(lambda: '')
 
 statusTime = time.time()
 
 t1 = time.time()
 
 t2 = time.time()
 
 events = ep.poll(60)
 
 fileno
 
 mask
 
 ss = socketMap[fileno]
 
 clientSock
 
 addr
 
 cs = gClientMap[fileno]
 
 x = cs.recv(4096)
 
 msgs = handle_query(inbox[cs], cs)
 
 msg = outbox[cs]
 
 n = cs.send(msg)
 

Function Documentation

def lem_server.close_old_connections ( )

Definition at line 464 of file lem_server.py.

References pop_old_conns().

465  toClose = []
466  nClient = 0
467  nWorker = 0
468  # Clear out old connections
469  for rel in gPIDQueue.keys():
470  toClose += pop_old_conns(gPIDQueue[rel])
471  nClient = len(toClose)
472  for rel in gGetWorkQueue.keys():
473  toClose += pop_old_conns(gGetWorkQueue[rel])
474  nWorker = len(toClose) - nClient
475 
476  if nClient > 0:
477  print 'Closing', nClient, 'client connections that reached their timeout'
478 
479  if nWorker > 0 and gVerbosity > 0:
480  print 'Closing', nWorker, 'worker connections that reached their timeout'
481 
482  for info in toClose:
483  gClientMap.pop(info.client.fileno())
484  info.client.close()
485 
486 # -----------------------------------------------------------------------------
487 
def pop_old_conns(q)
Definition: lem_server.py:86
def close_old_connections()
Definition: lem_server.py:464
def lem_server.failsafe_arg (   cmd,
  args,
  name 
)

Definition at line 299 of file lem_server.py.

Referenced by handle_backlog(), handle_get_work(), handle_pid(), and handle_return_results().

299 def failsafe_arg(cmd, args, name):
300  if name in args: return args[name]
301  print 'Error:', cmd, 'without', name, args
302  return None
303 
304 # -----------------------------------------------------------------------------
305 
def failsafe_arg(cmd, args, name)
Definition: lem_server.py:299
def lem_server.get_tag ( )

Definition at line 141 of file lem_server.py.

References makeTrainCVSamples.int, and runNovaSAM.str.

Referenced by handle_get_work(), and handle_pid().

141 def get_tag():
142  global gSeqNo
143 
144  n = gSeqNo
145  gSeqNo += 1
146 
147  return str(int(time.time())) + '.' + str(os.getpid()) + '.' + str(n)
148 
149 # -----------------------------------------------------------------------------
150 
def get_tag()
Definition: lem_server.py:141
def lem_server.handle_backlog (   client,
  args 
)

Definition at line 257 of file lem_server.py.

References failsafe_arg(), ok200(), and runNovaSAM.str.

257 def handle_backlog(client, args):
258  if not 'rel' in args:
259  count = {}
260  for rel in gPIDQueue.keys():
261  N = len(gPIDQueue[rel])
262  if N > 0: count[rel] = N
263 
264  msg = ok200()
265  if len(count) == 0:
266  msg += 'No backlog\n'
267  else:
268  msg += 'Backlogs:\n'
269  for rel in count.keys():
270  msg += rel+': '+str(count[rel])+'\n'
271  return {client: msg}
272 
273  # Otherwise a release /was/ specified, return machine-readable result
274  rel = failsafe_arg('backlog', args, 'rel')
275 
276  count = len(gPIDQueue[rel])
277 
278  return {client: ok200()+str(count)+'\n'}
279 
280 # -----------------------------------------------------------------------------
281 
def failsafe_arg(cmd, args, name)
Definition: lem_server.py:299
def ok200()
Definition: lem_server.py:172
def handle_backlog(client, args)
Definition: lem_server.py:257
def lem_server.handle_get_work (   client,
  args 
)

Definition at line 306 of file lem_server.py.

References failsafe_arg(), get_tag(), min(), ok200(), and unimp501().

306 def handle_get_work(client, args):
307  global gQueuedPIDRequest, gGetWorkQueue, gWorkInProgress, gVerbosity
308 
309  workerID = failsafe_arg('get_work', args, 'id')
310  rel = failsafe_arg('get_work', args, 'rel')
311  timeout = failsafe_arg('get_work', args, 'timeout')
312 
313  if not workerID or not rel or not timeout:
314  return {client: unimp501()}
315 
316  # No work to give out right now
317  if len(gPIDQueue[rel]) == 0 or gPIDQueue[rel][-1].late():
318  # Experimenting with not letting too many get_work calls build up
319  gGetWorkQueue[rel].append(ConnInfo(client, '', min(10,timeout)))
320  return {}
321 
322  # There is work, and it's recent enough
323  info = gPIDQueue[rel].pop()
324  # Remember we're doing this so we know who the reply goes to
325  tag = get_tag()
326  gWorkInProgress[tag] = info
327 
328 
329  if gVerbosity > 0:
330  print 'Handing out work under tag', tag
331 
332  return {client: ok200() + 'tag='+tag+'\n' + info.query}
333 
334 # -----------------------------------------------------------------------------
335 
def failsafe_arg(cmd, args, name)
Definition: lem_server.py:299
def unimp501()
Definition: lem_server.py:188
def handle_get_work(client, args)
Definition: lem_server.py:306
def get_tag()
Definition: lem_server.py:141
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
def ok200()
Definition: lem_server.py:172
def lem_server.handle_ids (   client,
  args 
)

Definition at line 282 of file lem_server.py.

References ok200(), and runNovaSAM.str.

282 def handle_ids(client, args):
283  msg = ok200()
284 
285  for key in sorted(gIdList.keys()):
286  msg += key + ' : ' + str(gIdList[key])+'\n'
287 
288  return {client: msg}
289 
290 # -----------------------------------------------------------------------------
291 
def ok200()
Definition: lem_server.py:172
def handle_ids(client, args)
Definition: lem_server.py:282
def lem_server.handle_pid (   client,
  args,
  postdata 
)

Definition at line 358 of file lem_server.py.

References failsafe_arg(), get_tag(), ok200(), and unimp501().

358 def handle_pid(client, args, postdata):
359  global gQueuedPIDRequest, gGetWorkQueue, gWorkInProgress, gVerbosity
360 
361  rel = failsafe_arg('handle_pid', args, 'rel')
362  timeout = failsafe_arg('handle_pid', args, 'timeout')
363 
364  if not rel or not timeout:
365  return {client: unimp501()}
366 
367  info = ConnInfo(client, postdata, timeout)
368 
369  # No recent matching worker, stick it in the queue
370  if len(gGetWorkQueue[rel]) == 0 or gGetWorkQueue[rel][-1].late():
371  gPIDQueue[rel].append(info)
372  return {}
373 
374  # All OK, hook things up
375  workerClient = gGetWorkQueue[rel].pop().client
376 
377  # Remember that we're doing this
378  tag = get_tag()
379  gWorkInProgress[tag] = info
380 
381 
382  if gVerbosity > 0: print 'Handing out work under tag', tag
383  return {workerClient: ok200() + 'tag='+tag+'\n' + info.query}
384 
385 # -----------------------------------------------------------------------------
386 
387 # Returns a map from sockets to the strings to send to them
def failsafe_arg(cmd, args, name)
Definition: lem_server.py:299
def handle_pid(client, args, postdata)
Definition: lem_server.py:358
def unimp501()
Definition: lem_server.py:188
def get_tag()
Definition: lem_server.py:141
def ok200()
Definition: lem_server.py:172
def lem_server.handle_query (   sockStr,
  client 
)

Definition at line 388 of file lem_server.py.

References unimp501().

388 def handle_query(sockStr, client):
389  if gVerbosity > 0: print sockStr
390 
391  query, junk, postdata = sockStr.partition('\r\n\r\n')
392 
393  isGet = query.startswith('GET')
394  isPost = query.startswith('POST')
395 
396  # Second thing after GET/POST. Drop the leading slash
397  params = query.split(' ')[1][1:]
398  cmd, junk, argStr = params.partition('?')
399 
400  args = {}
401  for arg in argStr.split('&'):
402  key, junk, val = arg.partition('=')
403  args[key] = val
404 
405  if gVerbosity > 0: print 'Parameters are:', params
406  if gVerbosity > 0: print 'Cmd:', cmd, 'args:', args
407 
408  shortId = 'unknown'
409  if 'id' in args:
410  shortId = args['id']
411 
412  # Update last contacted
413  if isPost and cmd == 'pid':
414  gClientList[shortId] = time.time()
415  if isGet and cmd == 'get_work':
416  gWorkerList[shortId] = time.time()
417 
418  # Clumsily truncate the last two numbers off the end to leave the host
419  if shortId.rfind('.') > 0: shortId = shortId[:shortId.rfind('.')]
420  if shortId.rfind('.') > 0: shortId = shortId[:shortId.rfind('.')]
421 
422  gIdList[shortId] += 1
423 
424 
425  get_handlers = {
426  'get_work' : handle_get_work,
427  'status' : handle_status,
428  'status.html' : handle_status_html,
429  'releases' : handle_releases,
430  'backlog' : handle_backlog,
431  'ids' : handle_ids
432  }
433 
434  post_handlers = {
435  'pid' : handle_pid,
436  'return_results' : handle_return_results
437  }
438 
439  if isGet and cmd in get_handlers:
440  return get_handlers[cmd](client, args)
441 
442  if isPost and cmd in post_handlers:
443  return post_handlers[cmd](client, args, postdata)
444 
445  # Didn't hit any of the cases above
446  print 'Rejecting malformed query:'
447  print sockStr
448 
449  return {client: unimp501()}
450 
451 # -----------------------------------------------------------------------------
452 
def handle_query(sockStr, client)
Definition: lem_server.py:388
def unimp501()
Definition: lem_server.py:188
def lem_server.handle_releases (   client,
  args 
)

Definition at line 243 of file lem_server.py.

References ok200().

243 def handle_releases(client, args):
244  rels = set()
245  # TODO ideally we would also list releases with only in-progress PIDs,
246  # but we don't store that information anywhere.
247  for key in gPIDQueue:
248  if len(gPIDQueue[key]) > 0:
249  rels.add(key)
250 
251  msg = ok200()
252  for rel in rels: msg += rel+'\n'
253  return {client: msg}
254 
255 # -----------------------------------------------------------------------------
256 
def ok200()
Definition: lem_server.py:172
def handle_releases(client, args)
Definition: lem_server.py:243
def lem_server.handle_return_results (   client,
  args,
  postdata 
)

Definition at line 336 of file lem_server.py.

References failsafe_arg(), ok200(), and unimp501().

336 def handle_return_results(client, args, postdata):
337  global gQueuedPIDRequest, gGetWorkQueue, gWorkInProgress, gVerbosity
338 
339  tag = failsafe_arg('return_results', args, 'tag')
340 
341  if not tag:
342  return {client: unimp501()}
343 
344  if tag not in gWorkInProgress:
345  print 'Warning: Reply for unknown tag', tag
346  return {client: ok200()}
347 
348  workerClient = gWorkInProgress.pop(tag).client
349 
350  if gVerbosity > 0: print 'Sending response', postdata
351 
352  # No point checking the timeout, just try to send to the client in any case
353  return {client: ok200(),
354  workerClient: ok200()+postdata}
355 
356 # -----------------------------------------------------------------------------
357 
def failsafe_arg(cmd, args, name)
Definition: lem_server.py:299
def handle_return_results(client, args, postdata)
Definition: lem_server.py:336
def unimp501()
Definition: lem_server.py:188
def ok200()
Definition: lem_server.py:172
def lem_server.handle_status (   client,
  args 
)

Definition at line 238 of file lem_server.py.

References ok200(), and status_text().

238 def handle_status(client, args):
239  return {client: ok200()+status_text()+'\n'}
240 
241 # -----------------------------------------------------------------------------
242 
def ok200()
Definition: lem_server.py:172
def handle_status(client, args)
Definition: lem_server.py:238
def status_text()
Definition: lem_server.py:199
def lem_server.handle_status_html (   client,
  args 
)

Definition at line 292 of file lem_server.py.

References ok200_html(), and status_text().

292 def handle_status_html(client, args):
293  htmlHead = '<html><head><meta charset="UTF-8"><meta http-equiv="refresh" content="60"><title>LEM server status</title></head><body>\n'
294  htmlFoot = '</body></html>\n'
295 
296  return {client: ok200_html() + htmlHead + status_text() + htmlFoot}
297 
298 # -----------------------------------------------------------------------------
def handle_status_html(client, args)
Definition: lem_server.py:292
def status_text()
Definition: lem_server.py:199
def ok200_html()
Definition: lem_server.py:180
def lem_server.is_allowed_ip (   ip)

Definition at line 63 of file lem_server.py.

63 def is_allowed_ip(ip):
64  # We'll be running offsite. Don't know all those IP addresses, so just let
65  # anything through for now.
66  return True
67 
68  for entry in gIPWhitelist:
69  if ip.startswith(entry): return True
70  return False
71 
72 
def is_allowed_ip(ip)
Definition: lem_server.py:63
def lem_server.is_complete_query (   msg)

Definition at line 151 of file lem_server.py.

References makeTrainCVSamples.int.

152  # headers are always terminated by \r\n\r\n
153  kTerminator = '\r\n\r\n';
154 
155  if kTerminator not in msg: return False
156 
157  headerSize = msg.find(kTerminator)+4
158 
159  cl = 'Content-Length: '
160  # No content-length, therefore no body
161  if cl not in msg: return True
162  lpos = msg.find(cl)
163 
164  # Parse the context-length header
165  newline = msg.find('\r', lpos+len(cl))
166  bodyLength = int(msg[lpos+len(cl):newline])
167 
168  return len(msg) == headerSize+bodyLength
169 
170 # -----------------------------------------------------------------------------
171 
def is_complete_query(msg)
Definition: lem_server.py:151
def lem_server.nConns (   d)

Definition at line 93 of file lem_server.py.

References sum.

Referenced by shed_load(), and status_text().

93 def nConns(d):
94  return sum([len(x) for x in d.values()])
95 
96 # Takes a dict of deques, removes the first element from every deque, and
97 # returns that list.
def nConns(d)
Definition: lem_server.py:93
Double_t sum
Definition: plot.C:31
def lem_server.ok200 ( )

Definition at line 172 of file lem_server.py.

Referenced by handle_backlog(), handle_get_work(), handle_ids(), handle_pid(), handle_releases(), handle_return_results(), and handle_status().

172 def ok200():
173  return 'HTTP/1.0 200 OK\r\n'\
174  'Server: LEMServer/0.1.0\r\n'\
175  'Content-Type: text/plain\r\n'\
176  '\r\n'
177 
178 # -----------------------------------------------------------------------------
179 
def ok200()
Definition: lem_server.py:172
def lem_server.ok200_html ( )

Definition at line 180 of file lem_server.py.

Referenced by handle_status_html().

181  return 'HTTP/1.0 200 OK\r\n'\
182  'Server: LEMServer/0.1.0\r\n'\
183  'Content-Type: text/html\r\n'\
184  '\r\n'
185 
186 # -----------------------------------------------------------------------------
187 
def ok200_html()
Definition: lem_server.py:180
def lem_server.pop_fronts (   d)

Definition at line 98 of file lem_server.py.

Referenced by shed_load().

98 def pop_fronts(d):
99  return [x.popleft() for x in d.values() if len(x) > 0]
100 
101 
102 # When a new 'pid' request comes in, if we can't match it to a worker
103 # immediately, we put it here. The top level key is the release, and under each
104 # release is a list of requests (ConnInfo objects), ordered by age, newest
105 # last.
def pop_fronts(d)
Definition: lem_server.py:98
def lem_server.pop_old_conns (   q)

Definition at line 86 of file lem_server.py.

Referenced by close_old_connections().

87  ret = []
88  while len(q) > 0 and q[0].late():
89  ret.append(q.popleft())
90  return ret
91 
92 # Sums the length of all the lists in a dict
def pop_old_conns(q)
Definition: lem_server.py:86
def lem_server.shed_load ( )

Definition at line 488 of file lem_server.py.

References nConns(), and pop_fronts().

488 def shed_load():
489  toClose = []
490 
491  kConnLimit = 3300
492 
493  # First drop older PID requests
494  while nConns(gPIDQueue) + nConns(gGetWorkQueue) + len(gWorkInProgress) > kConnLimit and nConns(gPIDQueue) > 0:
495  toClose += pop_fronts(gPIDQueue)
496 
497  # If things get desperate, drop get_work requests
498  while nConns(gGetWorkQueue) + len(gWorkInProgress) > kConnLimit and nConns(gGetWorkQueue) > 0:
499  toClose += pop_fronts(gGetWorkQueue)
500 
501  # And finally, throw away actual work in progress (at random)
502  keys = gWorkInProgress.keys()
503  for key in keys:
504  if len(gWorkInProgress) <= kConnLimit: break
505  toClose.append(gWorkInProgress.pop(key))
506 
507 
508  if len(toClose) > 0:
509  print 'Overloaded: closing', len(toClose), 'connections'
510  # Doesn't seem to recover situation. Let the restarter do its thing
511  sys.exit(1)
512 
513  for info in toClose:
514  gClientMap.pop(info.client.fileno())
515  info.client.close()
516 
517 
518 # -----------------------------------------------------------------------------
519 
def nConns(d)
Definition: lem_server.py:93
def pop_fronts(d)
Definition: lem_server.py:98
def shed_load()
Definition: lem_server.py:488
def lem_server.startup (   port)

Definition at line 453 of file lem_server.py.

453 def startup(port):
454  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
455  # Reuse port immediately even if a previous instance just aborted.
456  s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
457  s.bind(('', port))
458  # Parameter is the length of "backlog" allowed
459  s.listen(128)
460  return s
461 
462 # -----------------------------------------------------------------------------
463 
def startup(port)
Definition: lem_server.py:453
def lem_server.status_text ( )

Definition at line 199 of file lem_server.py.

References makeTrainCVSamples.int, nConns(), and runNovaSAM.str.

Referenced by handle_status(), and handle_status_html().

200  global gLastSeqNo, gLastStatus
201 
202  rate = int((gSeqNo-gLastSeqNo)/(time.time()-gLastStatus))
203  gLastSeqNo = gSeqNo
204  gLastStatus = time.time()
205 
206  msg = time.strftime('%Y-%m-%d %H:%M:%S %Z: ')
207  msg += 'Handled ' + str(gSeqNo) + ' queries ('+str(rate)+' Hz). '
208  msg += str(len(gWorkInProgress)) + ' workers working, '
209  msg += str(nConns(gGetWorkQueue)) + ' waiting, '
210  msg += str(nConns(gPIDQueue)) + ' backlog. '
211  msg += str(gErrCount) + ' errors. '
212  msg += 'Server '+str(.1*int(1000*gBusyTime/(gBusyTime+gIdleTime)+.5))+'% busy. '
213 
214  # Forget about clients and workers after 10 minutes
215  t0 = time.time()
216  n10s = 0
217  n60s = 0
218  n5m = 0
219  n30m = 0
220  for k in gClientList.keys():
221  t = gClientList[k]
222  if t0 < t+10: n10s += 1
223  if t0 < t+60: n60s += 1
224  if t0 < t+300: n5m += 1
225  if t0 < t+1800: n30m += 1
226  if t0 > t+1800: gClientList.pop(k)
227  for k in gWorkerList:
228  if t0 > gWorkerList[k] + 600: gClientList.pop(k)
229 
230  msg += str(n10s)+'/'+str(n60s)+'/'+str(n5m)+'/'+str(n30m)+' clients active in last 10s/60s/5m/30m. '
231 
232  msg += str(len(gWorkerList)) + ' workers in last 10m.'
233 
234  return msg
235 
236 # -----------------------------------------------------------------------------
237 
def nConns(d)
Definition: lem_server.py:93
def status_text()
Definition: lem_server.py:199
def lem_server.unimp501 ( )

Definition at line 188 of file lem_server.py.

Referenced by handle_get_work(), handle_pid(), handle_query(), and handle_return_results().

188 def unimp501():
189  return 'HTTP/1.0 501 Not Implemented\r\n'\
190  'Server: LEMServer/0.1.0\r\n'\
191  'Content-Type: text/plain\r\n'\
192  '\r\n'\
193  "I don't know how to do that\r\n"
194 
195 # -----------------------------------------------------------------------------
196 
def unimp501()
Definition: lem_server.py:188

Variable Documentation

lem_server.addr

Definition at line 573 of file lem_server.py.

lem_server.clientSock

Definition at line 573 of file lem_server.py.

lem_server.cs = gClientMap[fileno]
lem_server.ep = select.epoll()
lem_server.events = ep.poll(60)

Definition at line 559 of file lem_server.py.

lem_server.fileno

Definition at line 564 of file lem_server.py.

int lem_server.gBusyTime = 0

Definition at line 129 of file lem_server.py.

dictionary lem_server.gClientList = {}

Definition at line 135 of file lem_server.py.

dictionary lem_server.gClientMap = {}

Definition at line 122 of file lem_server.py.

int lem_server.gErrCount = 0

Definition at line 127 of file lem_server.py.

lem_server.gGetWorkQueue = defaultdict(deque)

Definition at line 112 of file lem_server.py.

int lem_server.gIdleTime = 0

Definition at line 130 of file lem_server.py.

lem_server.gIdList = defaultdict(lambda: 0)

Definition at line 132 of file lem_server.py.

list lem_server.gIPWhitelist
Initial value:
1 = [
2  # Fermilab, according to https://ipinfo.io/AS3152
3  '131.225.',
4  '192.190.216.',
5  '198.49.208.',
6  # Caltech, according to https://ipinfo.io/AS31
7  # TODO maybe only the HEP cluster machines?
8  '131.215.',
9  '134.4.',
10  '192.12.19.',
11  '192.31.43.',
12  '192.31.208.',
13  '192.43.243.',
14  '192.54.249.'
15  # SMU: https://ipinfo.io/AS1832
16  # UMN: https://ipinfo.io/AS217
17  ]

Definition at line 45 of file lem_server.py.

int lem_server.gLastSeqNo = 0

Definition at line 197 of file lem_server.py.

lem_server.gLastStatus = time.time()

Definition at line 198 of file lem_server.py.

lem_server.gPIDQueue = defaultdict(deque)

Definition at line 106 of file lem_server.py.

int lem_server.gSeqNo = 0

Definition at line 125 of file lem_server.py.

int lem_server.gVerbosity = 0

Definition at line 42 of file lem_server.py.

dictionary lem_server.gWorkerList = {}

Definition at line 136 of file lem_server.py.

dictionary lem_server.gWorkInProgress = {}

Definition at line 119 of file lem_server.py.

lem_server.inbox = defaultdict(lambda: '')

Definition at line 535 of file lem_server.py.

int lem_server.kMaxPort = 1031

Definition at line 522 of file lem_server.py.

int lem_server.kMinPort = 1024

Definition at line 521 of file lem_server.py.

int lem_server.kNumPorts = kMaxPort-kMinPort+1

Definition at line 523 of file lem_server.py.

lem_server.mask
lem_server.msg = outbox[cs]

Definition at line 603 of file lem_server.py.

Referenced by novaddt::SendTriggerSignal.analyze(), stan::services::optimize.bfgs(), stan::math::internal::bounded< T_y, T_low, T_high, y_is_vec >.check(), stan::math::internal::bounded< T_y, T_low, T_high, true >.check(), stan::math.check_2F1_converges(), stan::math.check_3F2_converges(), stan::math.check_column_index(), stan::math.check_consistent_size(), stan::math.check_corr_matrix(), check_identifier(), stan::math.check_ldlt_factor(), stan::math.check_lower_triangular(), stan::math.check_matching_dims(), stan::math.check_positive_ordered(), stan::math.check_positive_size(), stan::math.check_range(), stan::math.check_row_index(), stan::math.check_simplex(), stan::math.check_size_match(), stan::math.check_std_vector_index(), stan::math.check_unit_vector(), stan::math.check_vector(), ana::CovMxManager.CovMxManager(), novaddt::SupernovaTrigger.filter(), daqdataformats::RawDAQData.generateExceptionForWrongVersion(), stan::io::dump_reader.get_int(), ana::CovMxManager.GetCovarianceMatrix(), daqdataformats::RawMicroSlice.getNumNanoSlices(), dbutils::gui::ConfigDataTreeModel.headerData(), daqdataformats::VERSION_NAMESPACE::RawTriggerMask.init(), stan::services::util.initialize(), gov::fnal::cd::rms::RmsProducer.initialize(), stan::services::optimize.lbfgs(), main(), stan::services::optimize.newton(), stan::io::dump_reader.next(), cet::ostream_handle.operator<<(), stan::lang.parse(), stan::io.print_help_option(), nl::timing::LogFile.ProcessLog(), cet::sqlite.query(), daqdataformats::RawMicroSlice.RawMicroSlice(), gov::fnal::cd::rms::RmsConsumer.RmsConsumer(), gov::fnal::cd::rms::RmsReceiver< CONN, MSG, LSTNR >.RmsReceiver(), gov::fnal::cd::rms::RmsSender< C, M >.RmsSender(), stan::variational::advi< stan_model, stan::variational::normal_meanfield, rng_t >.run(), dbutils::gui::BasicEditorDisplay.saveChangesWithNewName(), stan::io::dump_reader.scan_dim(), stan::io::dump_reader.scan_double(), genie::PhysInteractionSelector.SelectInteraction(), gov::fnal::cd::rms::base::RmsDestination.setProperty(), daqdataformats::RawMicroSlice.setVersion(), stanc_helper(), stan::services.standalone_generate(), TEST_F(), stan::model.test_gradients(), art::Source< T >.throwDataCorruption_(), tf.TimingFitErrorHandler(), stan::io::array_var_context.validate(), stan::io::var_context.validate_dims(), stan::math.validate_non_negative_index(), stan::math::var.var(), stan::mcmc::base_leapfrog< dense_e_metric< Model, BaseRNG > >.verbose_evolve(), VerticalSlice(), warp_meta(), and stan::math.wiener_lpdf().

lem_server.msgs = handle_query(inbox[cs], cs)
lem_server.n = cs.send(msg)

Definition at line 604 of file lem_server.py.

lem_server.outbox = defaultdict(lambda: '')

Definition at line 536 of file lem_server.py.

list lem_server.serverSock = [startup(port) for port in range(kMinPort, kMaxPort+1)]

Definition at line 525 of file lem_server.py.

dictionary lem_server.socketMap = {}

Definition at line 530 of file lem_server.py.

lem_server.ss = socketMap[fileno]

Definition at line 572 of file lem_server.py.

lem_server.statusTime = time.time()

Definition at line 538 of file lem_server.py.

lem_server.t1 = time.time()

Definition at line 540 of file lem_server.py.

lem_server.t2 = time.time()

Definition at line 541 of file lem_server.py.

lem_server.x = cs.recv(4096)

Definition at line 585 of file lem_server.py.