Versions Compared

Key

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

...

If the user wants to submit jobs using the lab1 SLURM account, then

  • From the command line: Interactive Job (Resources requested: use SLURM account lab1, 30 minutes of walltime, 2 threads, and 2GB of memory)

    • srun --account=lab1 -t 30:00 [….other job arguments]sbatch --pty -p interactive -c 2 --mem=2G bash

  • Non-interactive or sbatch job

    • #SBATCH --account=lab1 [..other job parameters..]

    In an sbatch script:

    • #SBATCH --account=lab1

    • See below for an example using it within the script called sbatch_R_example.slurm

Code Block
languagebash
$ cat sbatch_R_example.slurm
#!/bin/bash

#SBATCH --account=lab1
#SBATCH -p short # Partition to submit to
#SBATCH -t 0-00:01 # Time in minutes DD-HH:MM; DD-HH; MM:SS
#SBATCH -c 1  # Number of cores requested
#SBATCH -N 1  # Ensure that all cores are on one machine
#SBATCH --mem=2G # Memory total in GB
#SBATCH -o hostname.%j.out  #  Standard out goes to this file
#SBATCH -e hostname.%j.err  # Standard err goes to this file

# Commands below
module load gcc/6.2.0
module load R/3.6.1

# To run a R script called my_r_script.R
Rscript my_r_script.R

# Submit non-interactive job
sbatch sbatch_R_example.slurm