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.
As the arguments of your command are not available in the sinfo information you could try to retrieve that data with the following procedure:
Export the command name and its arguments to an environment variable:
export JOBNAME="sleep 1000"
Launch the job defining the job name and the executable:
srun -J"$JOBNAME" $JOBNAME &
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" "