Class ExecuteJobs

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, Pausable, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, ThreadLimiter, VariablesInspectionHandler, FlowPauseStateListener, VariableChangeListener, Actor, ErrorHandler, InputConsumer, OutputProducer, Serializable, Comparable

    public class ExecuteJobs
    extends AbstractTransformer
    implements Pausable, FlowPauseStateListener, ThreadLimiter
    Executes the incoming jobs.

    Input/output:
    - accepts:
       adams.multiprocess.JobRunner
    - generates:
       adams.multiprocess.JobRunner


    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: ExecuteJobs
     
    -annotation <adams.core.base.BaseAnnotation> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow execution at this level gets stopped in case this
        actor encounters an error; the error gets propagated; useful for critical
        actors.
        default: false
     
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console; Note: the enclosing
        actor handler must have this enabled as well.
        default: false
     
    -update-num-threads <boolean> (property: updateNumThreads)
        If enabled (and possible), the number of threads of the incoming jobrunner
        get updated with the value specified here.
        default: false
     
    -num-threads <int> (property: numThreads)
        The number of threads to use for parallel execution; > 0: specific number
        of cores to use (capped by actual number of cores available, 1 = sequential
        execution); = 0: number of cores; < 0: number of free cores (eg -2 means
        2 free cores; minimum of one core is used)
        default: -1
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_JobRunner

        protected JobRunner m_JobRunner
        the job runner.
      • m_UpdateNumThreads

        protected boolean m_UpdateNumThreads
        whether to update the number of threads to use (if possible).
      • m_NumThreads

        protected int m_NumThreads
        the number of threads to use for parallel execution.
    • Constructor Detail

      • ExecuteJobs

        public ExecuteJobs()
    • Method Detail

      • setUpdateNumThreads

        public void setUpdateNumThreads​(boolean value)
        Sets whether to update the number of threads (if possible).
        Parameters:
        value - true if to update
      • getUpdateNumThreads

        public boolean getUpdateNumThreads()
        Returns whether to update the number of threads (if possible).
        Returns:
        true if to update
      • updateNumThreadsTipText

        public String updateNumThreadsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setNumThreads

        public void setNumThreads​(int value)
        Sets the number of threads to use for parallel training of groups.
        Specified by:
        setNumThreads in interface ThreadLimiter
        Parameters:
        value - the number of threads: -1 = # of CPUs/cores; 0/1 = sequential execution
      • getNumThreads

        public int getNumThreads()
        Returns the number of threads to use for parallel training of groups.
        Specified by:
        getNumThreads in interface ThreadLimiter
        Returns:
        the number of threads: -1 = # of CPUs/cores; 0/1 = sequential execution
      • numThreadsTipText

        public String numThreadsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • accepts

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Specified by:
        accepts in interface InputConsumer
        Returns:
        adams.multiprocess.JobRunner.class
      • generates

        public Class[] generates()
        Returns the class of objects that it generates.
        Specified by:
        generates in interface OutputProducer
        Returns:
        adams.multiprocess.JobRunner.class
      • doExecute

        protected String doExecute()
        Executes the flow item.
        Specified by:
        doExecute in class AbstractActor
        Returns:
        null if everything is fine, otherwise error message
      • pauseExecution

        public void pauseExecution()
        Pauses the execution.
        Specified by:
        pauseExecution in interface Pausable
      • isPaused

        public boolean isPaused()
        Returns whether the object is currently paused.
        Specified by:
        isPaused in interface Pausable
        Returns:
        true if object is paused
      • resumeExecution

        public void resumeExecution()
        Resumes the execution.
        Specified by:
        resumeExecution in interface Pausable