slurmstepd: Add new mode to run spank job prolog/epilog
The spank_job_prolog() and spank_job_epilog() spank calls need to be run in a different address space from slurmd. This not allows reinitializing the spank plugin stack on each run of the prolog or epilog, but also ensures that any static data in plugins does not propagate to each invocation of the job prolog and epilog (e.g. global variables). Additionally, it is much safer to run these plugins in a new process because we may be calling prolog/epilog for multiple jobs at the same time. This patch runs spank_job_prolog() or spank_job_epilog() from slurmstepd when slurmstepd is invoked as slurmstepd spank [prolog|epilog] The environment variables SLURM_JOBID and SLURM_UID are used to set the jobid and uid for the prolog/epilog. Spank plugin options may also be passed through the current environment.
Loading
Please register or sign in to comment