diff --git a/SAS/ResourceAssignment/ResourceAssignmentEstimator/service.py b/SAS/ResourceAssignment/ResourceAssignmentEstimator/service.py index baafa76901704c0b2a162e043ef5eb9543e8dc6a..55cb19d86e5a8c6a01280c1da45e3d64c6c9596c 100644 --- a/SAS/ResourceAssignment/ResourceAssignmentEstimator/service.py +++ b/SAS/ResourceAssignment/ResourceAssignmentEstimator/service.py @@ -18,10 +18,10 @@ class ResourceEstimatorHandler(MessageHandlerInterface): def __init__(self, **kwargs): super(ResourceEstimatorHandler, self).__init__(**kwargs) self.observation = ObservationResourceEstimator() - #self.longbaseline_pipeline = LongBaselinePipelineResourceEstimator() - #self.calibration_pipeline = CalibrationPipelineResourceEstimator() - #self.pulsar_pipeline = PulsarPipelineResourceEstimator() - #self.imaging_pipeline = ImagePipelineResourceEstimator() + self.longbaseline_pipeline = LongBaselinePipelineResourceEstimator() + self.calibration_pipeline = CalibrationPipelineResourceEstimator() + self.pulsar_pipeline = PulsarPipelineResourceEstimator() + self.imaging_pipeline = ImagePipelineResourceEstimator() def handle_message(self, content): specification_tree = content["specification_tree"] @@ -48,7 +48,6 @@ class ResourceEstimatorHandler(MessageHandlerInterface): for branch in specification_tree['predecessors']: branch_estimates.update(self.get_subtree_estimate(branch)) logger.info(str(branch_estimates)) - if specification_tree['task_subtype'] in ['averaging pipeline', 'calibration pipeline']: for id, estimate in branch_estimates.iteritems(): input_files = {} @@ -60,30 +59,28 @@ class ResourceEstimatorHandler(MessageHandlerInterface): elif 'im' in estimate.values()[0]['storage']['output_files']: input_files['im'] = estimate.values()[0]['storage']['output_files']['im'] return {str(otdb_id): self.add_id(self.calibration_pipeline.verify_and_estimate(parset, input_files), otdb_id)} - + if specification_tree['task_subtype'] in ['imaging pipeline', 'imaging pipeline msss']: if len(branch_estimates) > 1: logger.error('Imaging pipeline %d should not have multiple predecessors: %s' % (otdb_id, branch_estimates.keys() ) ) input_files = branch_estimates.values()[0].values()[0]['storage']['output_files'] return {str(otdb_id): self.add_id(self.imaging_pipeline.verify_and_estimate(parset, input_files), otdb_id)} - - + if specification_tree['task_subtype'] in ['long baseline pipeline']: if len(branch_estimates) > 1: logger.error('Long baseline pipeline %d should not have multiple predecessors: %s' % (otdb_id, branch_estimates.keys() ) ) input_files = branch_estimates.values()[0].values()[0]['storage']['output_files'] return {str(otdb_id): self.add_id(self.longbaseline_pipeline.verify_and_estimate(parset, input_files), otdb_id)} - if specification_tree['task_subtype'] in ['pulsar pipeline']: if len(branch_estimates) > 1: logger.error('Pulsar pipeline %d should not have multiple predecessors: %s' % (otdb_id, branch_estimates.keys() ) ) input_files = branch_estimates.values()[0].values()[0]['storage']['output_files'] return {str(otdb_id): self.add_id(self.pulsar_pipeline.verify_and_estimate(parset, input_files), otdb_id)} - #else: # reservation, maintenance, system tasks? - #logger.info("It's not a pipeline or observation: %s" % otdb_id) - #return {str(otdb_id): {}} + else: # reservation, maintenance, system tasks? + logger.info("It's not a pipeline or observation: %s" % otdb_id) + return {str(otdb_id): {}} def _get_estimated_resources(self, specification_tree): """ Input is like: