''' Created on Apr 4, 2014 @author: tpmaxwel ''' import ClusterCommunicator from DistributedApplication import ConfigFileParser import sys app = ClusterCommunicator.getNodeApp( ) task_metadata = {} config_file = "./config/ParallelCDMS.nasa-desktop-merge.txt" if len(sys.argv)>2 and sys.argv[1] == '-c': config_file = sys.argv[2] print "Running PCDMS with config file ", config_file config_parser = ConfigFileParser( config_file ) task_metadata = config_parser.data() app.execute( task_metadata )
input_specs = self.getSpecValues( 'input' ) for input_tvar_name in input_specs: input_tvar = self.complier.getTaskObject( 'tvar', input_tvar_name ) self.inputs[input_tvar_name] = input_tvar def execute(self): for input_object in self.inputs.values(): input_object.execute() self.run_task() def run_task(self): pass def __str__(self): return '\n'.join( [ TaskObject.__str__(self), " -- grid: %s " % str( self.grid ), " -- time_bounds: %s " % str( self.time_bounds ), " -- inputs: %s " % str( self.inputs.items() ) ] ) TaskCompiler.registerObjectType( 'dataset', TaskObject ) TaskCompiler.registerObjectType( 'time_bounds', TaskObject ) TaskCompiler.registerObjectType( 'grid', TaskObject ) TaskCompiler.registerObjectType( 'tvar', TVarObject ) TaskCompiler.registerObjectType( 'output', TaskObject ) if __name__ == "__main__": configFilePath = "./config/ParallelCDMS.nasa-2.txt" cp = ConfigFileParser( configFilePath ) cp.parse() taskCompiler = TaskCompiler() taskCompiler.processTaskSpec( cp.data() )