JobExecutionCoordinator

class DIRAC.WorkloadManagementSystem.JobWrapper.JobExecutionCoordinator.JobExecutionCoordinator(jobArgs: dict, ceArgs: dict)

Bases: object

Job Execution Coordinator Class.

This class serves as the base class for job execution coordinators, providing the necessary methods for pre-processing and post-processing jobs before and after their execution.

Communities who need to implement specific workflows for job pre-processing and post-processing in their Dirac extension should inherit from this class and override the relevant methods with their custom implementations.

The JobExecutionCoordinator class is primarily used by the JobWrapper to manage the execution of jobs, ensuring that all necessary preparations are made before the job starts, and that any required cleanup or data handling is performed after the job completes.

Example Usage in your Extension:

from DIRAC.WorkloadManagementSystem.JobWrapper.JobExecutionCoordinator import (
    JobExecutionCoordinator as DIRACJobExecutionCoordinator
)

class JobExecutionCoordinator(DIRACJobExecutionCoordinator):
    def preProcess(self, job):
        # Custom pre-processing code here
        pass

    def postProcess(self, job):
        # Custom post-processing code here
        pass

In this example, JobExecutionCoordinator inherits from DiracJobExecutionCoordinator and provides custom implementations for the preProcess and postProcess methods.

Methods to Override:

  • preProcess(job)

  • postProcess(job)

__init__(jobArgs: dict, ceArgs: dict) None

Initialize the job execution coordinator.

Parameters:
  • jobArgs – The job arguments

  • ceArgs – The environment arguments

postProcess()

Post-process a job after executing it. This should handle tasks like uploading outputs, checking results, etc.

Parameters:

job – The job to be post-processed

preProcess(command: str, exeEnv: dict)

Pre-process a job before executing it. This should handle tasks like downloading inputs, preparing commands, etc.

Parameters:

job – The job to be pre-processed