def __init__(self, crunching_manager, initial_state, crunching_profile): BaseCruncher.__init__(self, crunching_manager, initial_state, crunching_profile) if not import_tools.exists('multiprocessing'): raise Exception(multiprocessing_missing_text) from .process import Process self.process = Process(self.project.simpack_grokker.get_step_iterator, initial_state, crunching_profile) '''The actual process which does the crunching.''' self.work_queue = self.process.work_queue ''' Queue for putting completed work to be picked up by the main thread. In this queue the cruncher will put the states that it produces, in chronological order. If the cruncher reaches a simulation ends, it will put an `EndMarker` in this queue. ''' self.order_queue = self.process.order_queue '''Queue for receiving instructions from the main thread.'''
def __init__(self, crunching_manager, initial_state, crunching_profile): BaseCruncher.__init__(self, crunching_manager, initial_state, crunching_profile) if not import_tools.exists("multiprocessing"): raise Exception(multiprocessing_missing_text) from .process import Process self.process = Process(self.project.simpack_grokker.get_step_iterator, initial_state, crunching_profile) """The actual process which does the crunching.""" self.work_queue = self.process.work_queue """ Queue for putting completed work to be picked up by the main thread. In this queue the cruncher will put the states that it produces, in chronological order. If the cruncher reaches a simulation ends, it will put an `EndMarker` in this queue. """ self.order_queue = self.process.order_queue """Queue for receiving instructions from the main thread."""
def __init__(self, crunching_manager, initial_state, crunching_profile): BaseCruncher.__init__(self, crunching_manager, initial_state, crunching_profile) threading.Thread.__init__(self) self.step_iterator_getter = \ self.project.simpack_grokker.get_step_iterator self.history_dependent = self.project.simpack_grokker.history_dependent self.daemon = True self.work_queue = Queue.Queue( garlicsim.asynchronous_crunching.CRUNCHER_QUEUE_SIZE) ''' Queue for putting completed work to be picked up by the main thread. In this queue the cruncher will put the states that it produces, in chronological order. If the cruncher reaches a simulation ends, it will put an `EndMarker` in this queue. ''' self.order_queue = Queue.Queue() '''Queue for receiving instructions from the main thread.'''
def __init__(self, crunching_manager, initial_state, crunching_profile): BaseCruncher.__init__(self, crunching_manager, initial_state, crunching_profile) threading.Thread.__init__(self) self.step_iterator_getter = \ self.project.simpack_grokker.get_step_iterator self.history_dependent = self.project.simpack_grokker.history_dependent self.daemon = True self.work_queue = queue.Queue( garlicsim.asynchronous_crunching.CRUNCHER_QUEUE_SIZE ) ''' Queue for putting completed work to be picked up by the main thread. In this queue the cruncher will put the states that it produces, in chronological order. If the cruncher reaches a simulation ends, it will put an `EndMarker` in this queue. ''' self.order_queue = queue.Queue() '''Queue for receiving instructions from the main thread.'''