How can I get command-line arguments passed to a SLURM job from its job ID?

2.1k views Asked by At

Suppose I'm running a SLURM job with command-line arguments, let's say srun sleep 1000. squeue and scontrol show job ID show the executed command sleep, but not its argument 1000.

My question is, how can I get the arguments passed to a SLURM job command (1000 in this example), from its job ID?

I'm using slurm 17.02.3.

1

There are 1 answers

0
Bub Espinja On BEST ANSWER

As the arguments of your command are not available in the sinfo information you could try to retrieve that data with the following procedure:

  1. Export the command name and its arguments to an environment variable:

    export JOBNAME="sleep 1000"

  2. Launch the job defining the job name and the executable:

    srun -J"$JOBNAME" $JOBNAME &

  3. Retrieve information of that job from sinfo and select the appropriate data, in your case:

    scontrol show jobid=your_job_id | grep JobName | cut -f3 -d" "