Beispiel #1
0
def exercise3() :
  i = 0
  while True :
    output_dir = os.path.join(os.getcwd(), "simple_run%d" % i)
    if os.path.exists(output_dir) :
      i += 1
    else :
      os.makedirs(output_dir)
      break
  run = runtime_utils.simple_run(output_dir)
  params = runtime_utils.process_master_phil.extract()
  server = runtime_utils.detached_process_server(run, params)
  from libtbx.queuing_system_utils import generic as queuing
  job = queuing.qsub(
    name="tst_runtime_utils",
    target=server)
  job.start()
  client = runtime_utils.simple_client(params)
  client.run()
  assert (client.out.getvalue() == """\
current is 44444.444444
current is 50000.000000
current is 57142.857143
current is 66666.666667
""")
  assert client.n_cb >= 5 # this is variable!
  time.sleep(1)
  assert ([ cb.message for cb in client._accumulated_callbacks ] ==
          ['run 0', 'run 1', 'run 2', 'run 3'])
def exercise3() :
  i = 0
  while True :
    output_dir = os.path.join(os.getcwd(), "simple_run%d" % i)
    if os.path.exists(output_dir) :
      i += 1
    else :
      os.makedirs(output_dir)
      break
  run = runtime_utils.simple_run(output_dir)
  params = runtime_utils.process_master_phil.extract()
  server = runtime_utils.detached_process_server(run, params)
  from libtbx.queuing_system_utils import generic as queuing
  job = queuing.qsub(
    name="tst_runtime_utils",
    target=server)
  job.start()
  client = runtime_utils.simple_client(params)
  client.run()
  assert (client.out.getvalue() == """\
current is 44444.444444
current is 50000.000000
current is 57142.857143
current is 66666.666667
""")
  assert client.n_cb >= 5 # this is variable!
  time.sleep(1)
  assert ([ cb.message for cb in client._accumulated_callbacks ] ==
          ['run 0', 'run 1', 'run 2', 'run 3'])
Beispiel #3
0
def exercise():
    from libtbx.queuing_system_utils import generic as queuing
    t = target(1000000)
    job = queuing.qsub(target=t, platform="sge")
    job.start()
    assert (isinstance(job.jobid, int))
    while job.is_alive():
        pass
    print "done"
Beispiel #4
0
def exercise () :
  from libtbx.queuing_system_utils import generic as queuing
  t = target(1000000)
  job = queuing.qsub(
    target=t,
    platform="sge")
  job.start()
  assert (isinstance(job.jobid, int))
  while job.is_alive() :
    pass
  print "done"