Esempio n. 1
0
        def tclass_init(
            sself, start_tag, initial_state, stop_c_time=None, startup=False, validate=False, submit_num=0, exists=False
        ):

            sself.cycon = container.cycon(self.cyclers)
            sself.intercycle_offset = self.intercycle_offset
            sself.startup = startup
            sself.submit_num = submit_num
            sself.exists = exists
            if self.cycling:  # and startup:
                # adjust only needed at start-up but it does not hurt to
                # do it every time as after the first adjust we're already
                # on-cycle.
                sself.tag = sself.cycon.initial_adjust_up(start_tag)
                sself.cleanup_cutoff = sself.cycon.offset(sself.tag, str(-int(sself.intercycle_offset)))
            else:
                sself.tag = start_tag

            sself.c_time = sself.tag

            sself.id = sself.name + TaskID.DELIM + sself.tag

            sself.asyncid_pattern = self.asyncid_pattern

            if "clocktriggered" in self.modifiers:
                sself.real_time_delay = float(self.clocktriggered_offset)

            # prerequisites
            sself.prerequisites = prerequisites(self.ict)
            sself.suicide_prerequisites = prerequisites(self.ict)
            sself.add_prerequisites(startup, sself.tag)

            sself.logfiles = logfiles()
            for lfile in self.rtconfig["extra log files"]:
                sself.logfiles.add_path(lfile)

            # outputs
            sself.outputs = outputs(sself.id)
            for outp in self.outputs:
                msg = outp.get(sself.tag)
                if not sself.outputs.exists(msg):
                    sself.outputs.add(msg)
            sself.outputs.register()

            if stop_c_time:
                # cycling tasks with a final cycle time set
                super(sself.__class__, sself).__init__(initial_state, stop_c_time, validate=validate)
            else:
                # TODO - TEMPORARY HACK FOR ASYNC
                sself.stop_c_time = "99991231230000"
                super(sself.__class__, sself).__init__(initial_state, validate=validate)

            sself.suite_polling_cfg = self.suite_polling_cfg
            sself.reconfigure_me = False
            sself.is_coldstart = self.is_coldstart
            sself.set_from_rtconfig()
Esempio n. 2
0
        def tclass_init( sself, start_tag, initial_state, stop_c_time=None, startup=False, validate=False, submit_num=0, exists=False ):

            sself.cycon = container.cycon( self.cyclers )
            sself.intercycle_offset = self.intercycle_offset
            sself.startup = startup
            sself.submit_num = submit_num
            sself.exists=exists
            if self.cycling: # and startup:
                # adjust only needed at start-up but it does not hurt to
                # do it every time as after the first adjust we're already
                # on-cycle.
                sself.tag = sself.cycon.initial_adjust_up( start_tag )
                sself.cleanup_cutoff = sself.cycon.offset( sself.tag, str(-int(sself.intercycle_offset)) )
            else:
                sself.tag = start_tag

            sself.c_time = sself.tag

            sself.id = sself.name + TaskID.DELIM + sself.tag

            sself.asyncid_pattern = self.asyncid_pattern

            if 'clocktriggered' in self.modifiers:
                sself.real_time_delay =  float( self.clocktriggered_offset )

            # prerequisites
            sself.prerequisites = prerequisites( self.ict )
            sself.suicide_prerequisites = prerequisites( self.ict )
            sself.add_prerequisites( startup, sself.tag )

            sself.logfiles = logfiles()
            for lfile in self.rtconfig[ 'extra log files' ]:
                sself.logfiles.add_path( lfile )
 
            # outputs
            sself.outputs = outputs( sself.id )
            for outp in self.outputs:
                msg = outp.get( sself.tag )
                if not sself.outputs.exists( msg ):
                    sself.outputs.add( msg )
            sself.outputs.register()

            if stop_c_time:
                # cycling tasks with a final cycle time set
                super( sself.__class__, sself ).__init__( initial_state, stop_c_time, validate=validate )
            else:
                # TODO - TEMPORARY HACK FOR ASYNC
                sself.stop_c_time = '99991231230000'
                super( sself.__class__, sself ).__init__( initial_state, validate=validate )

            sself.suite_polling_cfg = self.suite_polling_cfg
            sself.reconfigure_me = False
            sself.is_coldstart = self.is_coldstart
            sself.set_from_rtconfig()
Esempio n. 3
0
        def tclass_init(sself,
                        start_point,
                        initial_state,
                        stop_point=None,
                        startup=False,
                        validate=False,
                        submit_num=0,
                        exists=False):

            sself.__class__.sequences = self.sequences
            sself.__class__.implicit_sequences = self.implicit_sequences
            sself.startup = startup
            sself.submit_num = submit_num
            sself.exists = exists
            sself.intercycle_offsets = self.intercycle_offsets

            if startup:
                # adjust up to the first on-sequence cycle point
                adjusted = []
                for seq in sself.__class__.sequences:
                    adj = seq.get_first_point(start_point)
                    if adj:
                        # may be None if out of sequence bounds
                        adjusted.append(adj)
                if adjusted:
                    sself.point = min(adjusted)
                    sself.cleanup_cutoff = self.get_cleanup_cutoff_point(
                        sself.point, self.intercycle_offsets)
                    sself.id = TaskID.get(sself.name, str(sself.point))
                else:
                    sself.point = None
                    # this task is out of sequence bounds (caller must
                    # check for a point of None)
                    return
            else:
                sself.point = start_point
                sself.cleanup_cutoff = self.get_cleanup_cutoff_point(
                    sself.point, self.intercycle_offsets)
                sself.id = TaskID.get(sself.name, str(sself.point))

            if 'clocktriggered' in self.modifiers:
                sself.clocktrigger_offset = self.clocktrigger_offset

            # prerequisites
            sself.prerequisites = prerequisites(self.start_point)
            sself.suicide_prerequisites = prerequisites(self.start_point)
            sself.add_prerequisites(sself.point)

            sself.logfiles = logfiles()
            for lfile in self.rtconfig['extra log files']:
                sself.logfiles.add_path(lfile)

            # outputs
            sself.outputs = outputs(sself.id)
            for outp in self.outputs:
                msg = outp.get(sself.point)
                if not sself.outputs.exists(msg):
                    sself.outputs.add(msg)
            sself.outputs.register()

            if stop_point:
                # Manually inserted tasks may have a final cycle point set.
                super(sself.__class__, sself).__init__(initial_state,
                                                       stop_point,
                                                       validate=validate)
            else:
                sself.stop_point = None
                super(sself.__class__, sself).__init__(initial_state,
                                                       validate=validate)

            sself.suite_polling_cfg = self.suite_polling_cfg
            sself.reconfigure_me = False
            sself.is_coldstart = self.is_coldstart
            sself.set_from_rtconfig()
Esempio n. 4
0
        def tclass_init( sself, start_tag, initial_state, stop_c_time=None, startup=False ):

            sself.cycon = container.cycon( self.cyclers )
            if self.cycling: # and startup:
                # adjust only needed at start-up but it does not hurt to
                # do it every time as after the first adjust we're already
                # on-cycle.
                sself.tag = sself.cycon.initial_adjust_up( start_tag )
            else:
                sself.tag = start_tag

            sself.c_time = sself.tag

            sself.id = sself.name + '%' + sself.tag

            sself.asyncid_pattern = self.asyncid_pattern

            sself.initial_scripting = self.initial_scripting
            sself.enviro_scripting = self.enviro_scripting
            sself.ssh_messaging = self.ssh_messaging

            sself.command = self.command

            sself.sim_mode_run_length = self.sim_mode_run_length
            sself.fail_in_sim_mode = self.fail_in_sim_mode

            # deepcopy retry delays: the deque gets pop()'ed in the task
            # proxy objects, which is no good if all instances of the
            # same task class reference the original deque!
            sself.retry_delays = deepcopy(self.retry_delays)

            sself.precommand = self.precommand
            sself.postcommand = self.postcommand

            if 'clocktriggered' in self.modifiers:
                sself.real_time_delay =  float( self.clocktriggered_offset )

            # prerequisites
            sself.prerequisites = prerequisites()
            sself.suicide_prerequisites = prerequisites()
            sself.add_prerequisites( startup, sself.cycon, sself.tag )

            sself.logfiles = logfiles()
            for lfile in self.logfiles:
                sself.logfiles.add_path( lfile )

            # outputs
            sself.outputs = outputs( sself.id )
            for outp in self.outputs:
                msg = outp.get( sself.tag )
                if not sself.outputs.exists( msg ):
                    sself.outputs.add( msg )
            sself.outputs.register()

            sself.env_vars = OrderedDict()
            for var in self.environment:
                val = self.environment[ var ]
                sself.env_vars[ var ] = val

            sself.directives = OrderedDict()
            for var in self.directives:
                val = self.directives[ var ]
                sself.directives[ var ] = val

            if 'catchup_clocktriggered' in self.modifiers:
                catchup_clocktriggered.__init__( sself )

            if stop_c_time:
                # cycling tasks with a final cycle time set
                super( sself.__class__, sself ).__init__( initial_state, stop_c_time )
            else:
                # TO DO: TEMPORARY HACK FOR ASYNC
                sself.stop_c_time = '99991231230000'
                super( sself.__class__, sself ).__init__( initial_state )

            sself.reconfigure_me = False
            sself.is_coldstart = self.is_coldstart