srun parallel library

Allow to wrap a job/pilot into a srun call that will execute n similar tasks in parallel. To work, srun needs to be used in conjonction with Slurm.

class DIRAC.Resources.Computing.ParallelLibraries.Srun.Srun(workingDirectory)

Bases: DIRAC.Resources.Computing.ParallelLibraries.ParallelLibrary.ParallelLibrary


Initialize the parallel library

  • name (str) – name of the parallel library

  • workingDirectory (str) – directory that should contain the executable and its inputs


Associate the executable with srun, to execute the same command in parallel on multiple nodes. Wrap it in a new executable file


executableFile (str) – name of the executable file to wrap

Return str

name of the wrapper that runs the executable via srun

processOutput(output, error, isFile=True)

Reorder the content of the output files according to the node identifier.

From: >>> 1: line1 >>> 2: line1 >>> 1: line2 To: >>> # On node 1 >>> line1 >>> line2 >>> # On node 2 >>> line1

  • output (str) – name of the output file, or its content

  • error (str) – name of the error file, or its content

  • isFile (bool) – indicates if the inputs represent files or content of the files