Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


In O2 the SLURM scheduler will not include a report of CPU and Memory usage in the standard output file or email once the job is completed. That information is available after a job completes by querying SLURM database with the command sacct, examples of how to use sacct command are available here.

...

A quick example submitting the job using a sbatch script  (Note: '-n 1' is needed for srun command. It make sure only run one copy of the command.)

First create a script, in this example named myJob.shthat contains both the scheduler flags, with the usual format #SBATCH flag, and the commands to be executed. In this second example the command to be executed is date which will return the current date and time.

Similarly to the first example the date command is preceded by srun -n 1 to execute it as a single,separate slurm step so that the following sacct command can be used to report the job resource usage.


Code Block
linenumberstrue
#!/bin/bash
#SBATCH -p short           
#SBATCH -t 0-0:10:0
#SBATCH -o myJob.out
#SBATCH --mem=2G

srun -n 1 date             
sleep 5                                 # wait for slurm to get the job status into its database
sacct --format=JobID,Submit,Start,End,State,Partition,ReqTRES%30,CPUTime,MaxRSS,NodeList%30 --units=M -j $SLURM_JOBID

...

Code Block
/usr/bin/bash: this_is_an_error: command not found
command failed
srun: Job step aborted: Waiting up to 37 seconds for job step to finish.
slurmstepd: error: *** JOB 11511 ON compute-a-16-27 CANCELLED AT 2018-04-05T16:12:22 ***

...