Example #1
0
 def __init__(self, input_file, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GStructureApplication(input_file, **extra_args),
         # keyword arguments
         **extra_args)
Example #2
0
 def __init__(self, executable, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GGenericApplication(executable, **extra_args),
         # keyword arguments
         **extra_args)
Example #3
0
 def __init__(self, input_model, output_model, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GeoSphereApplication(input_model, output_model, **extra_args),
         # keyword arguments
         **extra_args)
Example #4
0
 def __init__(self, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GSMD_ProjectionsApplication(**extra_args),
         # keyword arguments
         **extra_args)
Example #5
0
 def __init__(self, simulation_dir, executable=None, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GeotopApplication(simulation_dir, executable, **extra_args),
         # keyword arguments
         **extra_args)
Example #6
0
 def __init__(self, input_file, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GpyradApplication(input_file, **extra_args),
         # keyword arguments
         **extra_args)
Example #7
0
 def __init__(self, command, src_dir, result_dir, input_dir, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GcgpsApplication(command, src_dir, result_dir, input_dir,
                          **extra_args),
         **extra_args)
Example #8
0
 def __init__(self, executable, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GGenericApplication(executable, **extra_args),
         # keyword arguments
         **extra_args)
Example #9
0
 def __init__(self, simulation_dir, executable=None, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GeotopApplication(simulation_dir, executable, **extra_args),
         # keyword arguments
         **extra_args)
Example #10
0
 def __init__(self, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GSMD_ProjectionsApplication(**extra_args),
         # keyword arguments
         **extra_args)
Example #11
0
 def __init__(self, network_data_file, run_script, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GbenchmarkApplication(network_data_file, run_script, **extra_args),
         **extra_args
     )
Example #12
0
 def __init__(self, input_dir, working_dir, output_container, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GeoSphereApplication(input_dir, working_dir, output_container, **extra_args),
         # keyword arguments
         **extra_args)
Example #13
0
 def __init__(self, input_model, output_model, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GeoSphereApplication(input_model, output_model, **extra_args),
         # keyword arguments
         **extra_args)
Example #14
0
 def __init__(self, sim_no, executable=None, restart=None, **extra_args):
     self.sim_no = sim_no
     RetryableTask.__init__(
         self,
         # actual computational job
         GCellJunctionApplication(sim_no, executable, restart, **extra_args),
         # keyword arguments
         **extra_args)
Example #15
0
 def __init__(self, inp_file_path, *other_input_files, **extra_args):
     """Constructor. Interface compatible with `GamessApplication`:class:"""
     if extra_args.has_key('tags'):
         extra_args['tags'].append('ENV/CPU/OPTERON-2350')
     else:
         extra_args['tags'] = [ 'ENV/CPU/OPTERON-2350' ]
     task = GamessApplication(inp_file_path, *other_input_files, **extra_args)
     RetryableTask.__init__(self, task, max_retries=3, **extra_args)
Example #16
0
 def __init__(self, inp_file_path, *other_input_files, **extra_args):
     """Constructor. Interface compatible with `GamessApplication`:class:"""
     if extra_args.has_key('tags'):
         extra_args['tags'].append('ENV/CPU/OPTERON-2350')
     else:
         extra_args['tags'] = [ 'ENV/CPU/OPTERON-2350' ]
     task = GamessApplication(inp_file_path, *other_input_files, **extra_args)
     RetryableTask.__init__(self, task, max_retries=3, **extra_args)
Example #17
0
 def __init__(self, input_dir, working_dir, output_container, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GeoSphereApplication(input_dir, working_dir, output_container,
                              **extra_args),
         # keyword arguments
         **extra_args)
Example #18
0
 def __init__(self, input_file, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GmodisApplication(
             input_file,
             **extra_args),
         **extra_args
         )
Example #19
0
 def __init__(self, input_file, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GmodisApplication(
             input_file,
             **extra_args),
         **extra_args
         )
Example #20
0
 def __init__(self, start, extent, gnfs_location, input_files_archive, output, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         CryptoApplication(start, extent, gnfs_location, input_files_archive, output, **extra_args),
         # XXX: should decide which policy to use here for max_retries
         max_retries = 2,
         # keyword arguments
         **extra_args)
Example #21
0
 def __init__(self, id_times_filename, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GnwApplication(
             id_times_filename, 
             **extra_args),
         **extra_args
         )
Example #22
0
 def __init__(self, edges_data_filename, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GWeightApplication(
             edges_data_filename,
             **extra_args),
         **extra_args
         )
Example #23
0
 def __init__(self, network_data_file, run_script, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GbenchmarkApplication(
             network_data_file,
             run_script,
             **extra_args),
         **extra_args
         )
Example #24
0
def test_persisted_change():
    app = TestApplication()
    task = RetryableTask(app)
    # task.execution.state = 'RUNNING'

    # This is supposed to alter the state of the task
    # thus mark it as 'changed'
    task.update_state()

    # We expect task.changed to be true
    assert(task.changed == False)
Example #25
0
def test_persisted_change():
    app = MyApplication()
    task = RetryableTask(app)
    # task.execution.state = 'RUNNING'

    # This is supposed to alter the state of the task
    # thus mark it as 'changed'
    task.update_state()

    # We expect task.changed to be true
    assert task.changed
Example #26
0
 def __init__(self, command, src_dir, result_dir, input_dir, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GcgpsApplication(
             command, 
             src_dir,
             result_dir,
             input_dir,
             **extra_args),
         **extra_args
         )
Example #27
0
 def retry(self):
     """
     Task will be retried iif the application crashed
     due to an error within the exeuction environment
     (e.g. VM crash or LRMS kill)
     """
     # XXX: check whether it is possible to distingish
     # between the error conditions and set meaningfull exitcode
     to_retry = RetryableTask.retry(self)
     gc3libs.log.debug("GWeightTask called with retry [%s]" % str(to_retry))
     return to_retry
Example #28
0
 def retry(self):
     """ 
     Task will be retried iif the application crashed
     due to an error within the exeuction environment
     (e.g. VM crash or LRMS kill)
     """
     # XXX: check whether it is possible to distingish 
     # between the error conditions and set meaningfull exitcode
     to_retry = RetryableTask.retry(self)
     gc3libs.log.debug("GWeightTask called with retry [%s]" % str(to_retry))
     return to_retry
Example #29
0
 def retry(self):
     # return True or False depending whether the application
     # should be re-submitted or not.
     # The actual CodemlApplication is available as `self.task`,
     # so for instance `self.task.valid[0]` is `True` iff the
     # H0.mlc file is present and processed correctly.
     # gc3libs.log.debug("CodemlRetryPolicy called!")
     # for now, do the default (see: gc3libs/__init__.py)
     to_retry = RetryableTask.retry(self)
     gc3libs.log.debug("CodemlRetryPolicy called with retry [%s]" % str(to_retry))
     return to_retry
Example #30
0
 def retry(self):
     # return True or False depending whether the application
     # should be re-submitted or not.
     # The actual CodemlApplication is available as `self.task`,
     # so for instance `self.task.valid[0]` is `True` iff the
     # H0.mlc file is present and processed correctly.
     # gc3libs.log.debug("CodemlRetryPolicy called!")
     # for now, do the default (see: gc3libs/__init__.py)
     to_retry = RetryableTask.retry(self)
     gc3libs.log.debug("CodemlRetryPolicy called with retry [%s]" % str(to_retry))
     return to_retry
Example #31
0
    def new_tasks(self, extra):

        # use the name of the executable as job name
        basename = os.path.basename(self.params.cmd)

        # fix an ordering of the subst parameters, independent of any runtime variable
        names = sorted(self.subst.iterkeys())

        inputs = {}

        # decide whether CMD indicates a local file or a command
        # to be searched on the remote systems' PATH
        if os.path.exists(self.params.cmd):
            self.log.info("Uploading local file '%s' as executable.",
                          self.params.cmd)
            gc3libs.utils.check_file_access(self.params.cmd, os.R_OK | os.X_OK)
            executable = './' + os.path.basename(self.params.cmd)
            inputs[os.path.abspath(self.params.cmd)] = os.path.basename(
                self.params.cmd)
        else:
            if not os.path.isabs(self.params.cmd):
                raise RuntimeError(
                    "You cannot execute a command by calling a relative path,"
                    " because the remote execution directory is empty"
                    " except for files we upload there; but there is"
                    " no file named '%s' here, so I don't know what to upload.",
                    self.params.cmd)
            executable = self.params.cmd

        # create a set of input files for each combination of the
        # substitution parameters
        for values in itertools.product(*(self.subst[name] for name in names)):
            subst = dict((name, value) for name, value in zip(names, values))
            jobname = str.join(
                '_', [basename] +
                [("%s=%s" %
                  (name,
                   value.translate(None,
                                   r'\/&|=%$#!?<>()`"' + r"'" + '\a\b\n\r')))
                 for name, value in subst.iteritems()])

            # construct argument list, substituting defined parameters
            arguments = [executable]
            for arg in self.params.args:
                if arg in subst:
                    arguments.append(subst[arg])
                else:
                    arguments.append(arg)

            extra_args = extra.copy()
            extra_args['outputs'] = gc3libs.ANY_OUTPUT
            extra_args['output_dir'] = self.make_directory_path(
                self.params.output, jobname)
            extra_args['stdout'] = jobname + '.stdout.txt'
            extra_args['stderr'] = jobname + '.stderr.txt'
            if self.params.retry is not None:
                yield RetryableTask(SmartApplication(arguments, inputs,
                                                     **extra_args),
                                    self.params.retry,
                                    jobname=jobname,
                                    **extra_args)
            else:
                yield SmartApplication(arguments,
                                       inputs,
                                       jobname=jobname,
                                       **extra_args)
Example #32
0
 def __init__(self, id_times_filename, **extra_args):
     RetryableTask.__init__(
         self,
         # actual computational job
         GnwApplication(id_times_filename, **extra_args),
         **extra_args)
Example #33
0
 def __init__(self, task, increment=1 * GB, maximum=31 * GB, **extra_args):
     self.increment = increment
     self.maximum = maximum
     RetryableTask.__init__(self, task, **extra_args)
Example #34
0
 def __init__(self, task, increment=1*GB, maximum=31*GB, **extra_args):
     self.increment = increment
     self.maximum = maximum
     RetryableTask.__init__(self, task, **extra_args)