def __init__(self, funcfile, radius, params, inputfile, outputfile=None, **extra_args): funcname = basename_sans(funcfile) self.funcname = funcname self.radius = radius # map args to file system names inputname = basename_sans(inputfile) if outputfile is None: outputfile = ('output_{inputname}_{radius}.mat'.format(**locals())) # default execution params extra_args.setdefault('requested_cores', 1) extra_args.setdefault('requested_memory', 3*GB) extra_args.setdefault('requested_architecture', Run.Arch.X86_64) extra_args.setdefault('requested_walltime', 30*days) # actual app initialization Application.__init__( self, arguments=[ 'matlab', '-nodisplay', '-nojvm', #'-singleCompThread', '-r', (self.matlab_cmd.format(**locals())) ], inputs = [funcfile, inputfile], outputs = [outputfile], stdout = 'matlab.log', join=True, **extra_args)
def __init__(self, funcfile, radius, params, inputfile, outputfile=None, **extra_args): funcname = basename_sans(funcfile) self.funcname = funcname self.radius = radius # map args to file system names inputname = basename_sans(inputfile) if outputfile is None: outputfile = ('output_{inputname}_{radius}.mat'.format(**locals())) # default execution params extra_args.setdefault('requested_cores', 1) extra_args.setdefault('requested_memory', 3 * GB) extra_args.setdefault('requested_architecture', Run.Arch.X86_64) extra_args.setdefault('requested_walltime', 30 * days) # actual app initialization Application.__init__( self, arguments=[ 'matlab', '-nodisplay', '-nojvm', #'-singleCompThread', '-r', (self.matlab_cmd.format(**locals())) ], inputs=[funcfile, inputfile], outputs=[outputfile], stdout='matlab.log', join=True, **extra_args)
def new_tasks1(self, funcname, values, inputfiles, **extra): """ Iterate over tasks with a common processing function. """ # find MATLAB function to run funcname, funcfile = self.get_function_name_and_file(funcname) ranges = [] for spec in values.split(','): # get range for neighborhood radius low, high, step = parse_range(spec) ranges.append(irange(low, high+1, step)) for radius in itertools.chain(*ranges): for inputfile in inputfiles: kwargs = extra.copy() base_output_dir = kwargs.pop('output_dir', self.params.output) inputfile = realpath(inputfile) inputname = basename_sans(inputfile) jobname = ('{funcname}_{inputname}_{radius}'.format(**locals())) outputfile = ('output_{inputname}_{radius}.mat'.format(**locals())) output_dir = join(base_output_dir, jobname) yield MatlabRetryOnOutOfMemory( FunctionalDiversityApplication( funcfile, radius, self.params.parameters, inputfile, jobname=jobname, outputfile=outputfile, output_dir=output_dir, **kwargs), increment=4*GB, jobname=jobname, )
def new_tasks1(self, funcname, values, inputfiles, **extra): """ Iterate over tasks with a common processing function. """ # find MATLAB function to run funcname, funcfile = self.get_function_name_and_file(funcname) ranges = [] for spec in values.split(','): # get range for neighborhood radius low, high, step = parse_range(spec) ranges.append(irange(low, high + 1, step)) for radius in itertools.chain(*ranges): for inputfile in inputfiles: kwargs = extra.copy() base_output_dir = kwargs.pop('output_dir', self.params.output) inputfile = realpath(inputfile) inputname = basename_sans(inputfile) jobname = ('{funcname}_{inputname}_{radius}'.format( **locals())) outputfile = ('output_{inputname}_{radius}.mat'.format( **locals())) output_dir = join(base_output_dir, jobname) yield MatlabRetryOnOutOfMemory( FunctionalDiversityApplication(funcfile, radius, self.params.parameters, inputfile, jobname=jobname, outputfile=outputfile, output_dir=output_dir, **kwargs), increment=4 * GB, jobname=jobname, )