def test_process_pool_threading(self): from libtbx.scheduling import process_pool from libtbx.scheduling import thread_handler import threading creator = process_pool.creator( job_factory = threading.Thread, inq_factory = thread_handler.qfactory, outq_factory = thread_handler.qfactory, autoscaling = process_pool.constant_capacity( capacity = 1 ), lifecycle = process_pool.unlimited, ) self.run_tests( creator = creator )
def test_process_pool_threading(self): from libtbx.scheduling import process_pool from libtbx.scheduling import thread_handler import threading creator = process_pool.creator( job_factory=threading.Thread, inq_factory=thread_handler.qfactory, outq_factory=thread_handler.qfactory, autoscaling=process_pool.constant_capacity(capacity=1), lifecycle=process_pool.unlimited, ) self.run_tests(creator=creator)
def test_process_pool_multiprocessing(self): from libtbx.scheduling import process_pool from libtbx.scheduling import mp_handler creator = process_pool.creator( job_factory = mp_handler.stderr_capturing_process, inq_factory = mp_handler.fifo_qfactory, outq_factory = mp_handler.fifo_qfactory, autoscaling = process_pool.constant_capacity( capacity = 1 ), lifecycle = process_pool.unlimited, ) import sys self.run_tests( creator = creator, perform_crash_test = ( sys.platform != "win32" ), )
def test_process_pool_multiprocessing(self): from libtbx.scheduling import process_pool from libtbx.scheduling import mp_handler creator = process_pool.creator( job_factory=mp_handler.stderr_capturing_process, inq_factory=mp_handler.fifo_qfactory, outq_factory=mp_handler.fifo_qfactory, autoscaling=process_pool.constant_capacity(capacity=1), lifecycle=process_pool.unlimited, ) import sys self.run_tests( creator=creator, perform_crash_test=(sys.platform != "win32"), )
def pool_constant_capacity(ncpus): from libtbx.scheduling import process_pool return process_pool.constant_capacity( capacity = ncpus )