Class AbstractTask

java.lang.Object
com.powsybl.computation.slurm.AbstractTask
All Implemented Interfaces:
SlurmTask
Direct Known Subclasses:
SlurmTaskImpl

public abstract class AbstractTask extends Object implements SlurmTask
Author:
Yichen TANG <yichen.tang at rte-france.com>
  • Field Details

    • UNZIP_INPUTS_COMMAND_ID

      protected static final String UNZIP_INPUTS_COMMAND_ID
      See Also:
    • workingDir

      protected final Path workingDir
    • flagDir

      protected final Path flagDir
    • commandExecutor

      protected final CommandExecutor commandExecutor
    • executions

      protected final List<com.powsybl.computation.CommandExecution> executions
    • parameters

      protected final com.powsybl.computation.ComputationParameters parameters
    • environment

      protected final com.powsybl.computation.ExecutionEnvironment environment
    • jobs

    • taskCompletion

      protected final CompletableFuture<Void> taskCompletion
    • commandByJobId

      protected Map<Long,com.powsybl.computation.Command> commandByJobId
  • Method Details

    • cannotSubmit

      protected boolean cannotSubmit()
      Check if task has already been completed, or if computation manager is closing.
    • launchSbatch

      protected long launchSbatch(SbatchCmd cmd)
    • copyShellToRemoteWorkingDir

      protected void copyShellToRemoteWorkingDir(List<String> shell, String batchName) throws IOException
      Throws:
      IOException
    • await

      public com.powsybl.computation.ExecutionReport await() throws InterruptedException, ExecutionException
      Description copied from interface: SlurmTask
      Waits for the whole task to be executed, and generates the execution report.
      Specified by:
      await in interface SlurmTask
      Throws:
      InterruptedException
      ExecutionException
    • getPendingJobs

      public List<MonitoredJob> getPendingJobs()
      The list of jobs for which status must be monitored.
      Specified by:
      getPendingJobs in interface SlurmTask
    • interrupt

      public void interrupt()
      Description copied from interface: SlurmTask
      Asks for interruption of the execution of this task, in order to save the infrastructure computation resources.

      Calls waiting for completion of SlurmTask.await() will throw a CancellationException.

      Specified by:
      interrupt in interface SlurmTask
    • cancelSubmittedJobs

      protected void cancelSubmittedJobs()
      Asks for cancellation of submitted jobs to Slurm infrastructure.