def __init__(self, config, queues, harvester_messenger): """ queues: A dictionary of SerialQueue.SerialQueue objects where the JobManager can send messages to other Droid components about errors, etc. config: the ConfigParser handle for yoda """ # call base class init function super(WorkManager, self).__init__() # dictionary of queues for sending messages to Droid components self.queues = queues # configuration of Yoda self.config = config # harvester communication module self.harvester_messenger = harvester_messenger # this is used to trigger the thread exit self.exit = Event() # to be set self.pending_index = None self.pending_requests = None
def __init__(self, loop_timeout=30): # call init of Thread class super(StatefulService, self).__init__() # current state of this process self.state = VariableWithLock.VariableWithLock('NOT_YET_DEFINED') self.state_time = VariableWithLock.VariableWithLock(time.clock()) # this is used to trigger the thread exit self.exit = Event() # loop_timeout decided loop sleep times self.loop_timeout = loop_timeout
def __init__(self, queues, config, rank, worldsize): ''' config: configuration of Yoda ''' # call Thread constructor super(Yoda, self).__init__() # message queues self.queues = queues # rank number self.rank = rank # world size self.worldsize = worldsize # config settings self.config = config # keep track of if the wallclock has expired self.wallclock_expired = Event() # this is used to trigger the thread exit self.exit = Event()
def __init__(self, config, queues, yoda_working_path, harvester_messenger): super(FileManager, self).__init__() # dictionary of queues for sending messages to Droid components self.queues = queues # configuration of Yoda self.config = config # this is used to trigger the thread exit self.exit = Event() # this is the working directory of yoda self.yoda_working_path = yoda_working_path # harvester communication module self.harvester_messenger = harvester_messenger # default harvester_output_timeout self.harvester_output_timeout = 10
def __init__(self, config, queues, droid_working_path, droid_output_path, yampl_socket_name): """ queues: A dictionary of SerialQueue.SerialQueue objects where the JobManager can send messages to other Droid components about errors, etc. config: the ConfigParser handle for yoda droid_working_path: The location of the Droid working area droid_output_path: The location of output files from the Payload """ # call base class init function super(JobComm, self).__init__() # dictionary of queues for sending messages to Droid components self.queues = queues # configuration of Yoda self.config = config # working path for droid self.working_path = droid_working_path # where output files will be placed if stage_outputs is set to True self.staging_path = droid_output_path # socket name to pass to transform for use when communicating via yampl self.yampl_socket_name = yampl_socket_name # flag to set when all work is done and thread is exiting self.all_work_done = Event() # set some defaults self.debug_message_char_length = 100 self.stage_outputs = False # set initial state self.set_state(self.WAITING_FOR_JOB) # to be set self.loglevel = None
def __init__(self, initial): self.value = Value(get_array_type(initial), initial, lock=True) self.is_set_flag = Event()
================================================================================= ''' # acquire/release when accessing the harvester config, this avoids collisions. # I put this in because the setup function was being called in parallel with the requestevents() # this caused the request events to fail because it was moving faster than the setup function # and therefore could not find the configuration information yet and threw an exception. harConfSect = 'payload_interaction' sfm_mgr = Manager() sfm_har_config = sfm_mgr.dict() sfm_har_config_lock = Lock() sfm_har_config_done = Event() def setup(config): global sfm_har_config, sfm_har_config_lock, sfm_har_config_done sfm_har_config_lock.acquire() if len(sfm_har_config) == 0: logger.debug('loading harvester configuration file') if 'shared_file_messenger' in config: # get harvester config filename if 'harvester_config_file' in config['shared_file_messenger']: harvester_config_file = config['shared_file_messenger'][ 'harvester_config_file'] logger.info('harvester_config_file: %s', harvester_config_file) else: