libtbx.runtime_utils
index
/net/chevy/raid1/nat/src/cctbx_project/libtbx/runtime_utils.py

# detached process management (used in Phenix GUI)
# This is intended to imitate running a process using libtbx.thread_utils,
# but split across truly independent processes (potentially on different
# systems).  I use something like this to start a server:
#
#   easy_run.call("libtbx.start_process run.pkl &")

 
Modules
       
cStringIO
libtbx.easy_pickle
libtbx
os
signal
stat
sys
time
traceback

 
Classes
       
__builtin__.object
detached_base
detached_process_client
simple_client
detached_process_server
detached_process_driver
detached_process_driver_mp
simple_func
simple_run
simple_target
stdout_redirect
target_with_save_result

 
class detached_base(__builtin__.object)
     Methods defined here:
__init__(self, params)
callback_abort(self)
callback_error(self, error, traceback_info)
callback_final(self, result)
callback_other(self, status)
callback_start(self, data)
callback_stdout(self, data)
isAlive(self)
set_file_names(self, tmp_dir)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class detached_process_client(detached_base)
    # TODO pause/resume?
 
 
Method resolution order:
detached_process_client
detached_base
__builtin__.object

Methods defined here:
__init__(self, *args, **kwds)
abort(self, force=None)
# XXX in practice the phenix GUI only sets force=True for jobs running on the
# same machine; qdel is pretty thorough anyway.
callback_pause(self)
callback_resume(self)
check_status(self)
check_stdout(self)
isAlive(self)
is_started(self)
pause(self)
purge_files(self)
reset_logfile(self)
resume(self)
run(self)
send_signal(self, signal_number)
Signals the process using os.kill, which despite the name, can also
pause or resume processes on Unix.
update(self)

Methods inherited from detached_base:
callback_abort(self)
callback_error(self, error, traceback_info)
callback_final(self, result)
callback_other(self, status)
callback_start(self, data)
callback_stdout(self, data)
set_file_names(self, tmp_dir)

Data descriptors inherited from detached_base:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class detached_process_driver(__builtin__.object)
     Methods defined here:
__call__(self)
__init__(self, target)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class detached_process_driver_mp(detached_process_driver)
    
Method resolution order:
detached_process_driver_mp
detached_process_driver
__builtin__.object

Methods defined here:
__call__(self, args, kwds, child_conn)

Methods inherited from detached_process_driver:
__init__(self, target)

Data descriptors inherited from detached_process_driver:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class detached_process_server(detached_base)
    
Method resolution order:
detached_process_server
detached_base
__builtin__.object

Methods defined here:
__call__(self, *args, **kwds)
# XXX support for libtbx.queueing_system_utils.generic.Job
__init__(self, target, *args, **kwds)
callback_abort(self)
callback_error(self, error, traceback_info)
callback_final(self, result)
callback_other(self, data)
callback_pause(self)
callback_resume(self)
callback_start(self, data=None)
callback_stdout(self, data)
callback_wrapper(self, message, data, accumulate=True, cached=True)
cleanup(self)
run(self)

Methods inherited from detached_base:
isAlive(self)
set_file_names(self, tmp_dir)

Data descriptors inherited from detached_base:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class simple_client(detached_process_client)
    ########################################################################
# testing classes (see tst_runtime_utils.py for usage)
 
 
Method resolution order:
simple_client
detached_process_client
detached_base
__builtin__.object

Methods defined here:
__init__(self, *args, **kwds)
callback_aborted(self)
callback_error(self, error, traceback_info)
callback_final(self, result)
callback_other(self, data)
callback_stdout(self, data)

Methods inherited from detached_process_client:
abort(self, force=None)
# XXX in practice the phenix GUI only sets force=True for jobs running on the
# same machine; qdel is pretty thorough anyway.
callback_pause(self)
callback_resume(self)
check_status(self)
check_stdout(self)
isAlive(self)
is_started(self)
pause(self)
purge_files(self)
reset_logfile(self)
resume(self)
run(self)
send_signal(self, signal_number)
Signals the process using os.kill, which despite the name, can also
pause or resume processes on Unix.
update(self)

Methods inherited from detached_base:
callback_abort(self)
callback_start(self, data)
set_file_names(self, tmp_dir)

Data descriptors inherited from detached_base:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class simple_func(__builtin__.object)
     Methods defined here:
__call__(self)
__init__(self, x)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class simple_run(__builtin__.object)
     Methods defined here:
__call__(self)
__init__(self, output_dir)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class simple_target(__builtin__.object)
     Methods defined here:
__call__(self)
__init__(self, args, output_dir=None)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class stdout_redirect(__builtin__.object)
     Methods defined here:
__init__(self, handler)
close(self)
flush(self)
write(self, data)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class target_with_save_result(__builtin__.object)
     Methods defined here:
__call__(self)
__init__(self, args, file_name, output_dir=None, log_file=None, job_title=None)
run(self)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
run(args)
# XXX command-line launcher
touch_file(file_name)
write_params(params, file_name)
write_run_script(file_name, cmds)

 
Data
        division = _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)
process_master_phil = <libtbx.phil.scope object>