Page tree

Versions Compared

Key

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

...

Code Block
languagebash
titlebatch script submission using command line options
# simple job which prints hostname 
[@max-wgs ~]$ cat hostname.sh
#!/bin/bash
#SBATCH --partition=maxwell
#SBATCH --time=00:10:00                           # Maximum time requested
#SBATCH --nodes=1                                 # Number of nodes
#SBATCH ##### note: from SLurm news file 17.11.0rc1:
##### Change --workdir in sbatch to be --chdir as in all other commands (salloc, srun)
#####SBATCH --workdir   /home/mmuster/slurm/output    # directory must already exist!
#SBATCH --chdir   /home/mmuster/slurm/output      # directory must already exist!
#SBATCH --job-name  hostname
#SBATCH --output    hostname-%N-%j.out            # File to which STDOUT will be written
#SBATCH --error     hostname-%N-%j.err            # File to which STDERR will be written
#SBATCH --mail-type END                           # Type of email notification- BEGIN,END,FAIL,ALL
#SBATCH --mail-user max.muster@desy.de            # Email to which notifications will be sent. It defaults to <userid@mail.desy.de> if none is set.
 
/bin/hostname

# submit to batch queue for one node with one task
# requesting 10 mins of wall time 
[@max-wgs ~]$ sbatch hostname.sh
Submitted batch job 2163

[@max-wgs ~]$ ls
hostname.sh  slurm-2163.out
 
[@max-wgs ~]$ cat slurm-2163.out
max-wn004.desy.de

[@max-wgs ~]$ scontrol show job 2163
JobId=2163 JobName=hostname
   UserId=mmuster(1234) GroupId=cfel(3512)
   Priority=5001 Nice=0 Account=cfel QOS=cfel
   JobState=COMPLETED Reason=None Dependency=(null)
   Requeue=1 Restarts=0 BatchFlag=1 Reboot=0 ExitCode=0:0
   RunTime=00:00:01 TimeLimit=00:10:00 TimeMin=N/A
   SubmitTime=2016-01-20T14:50:17 EligibleTime=2016-01-20T14:50:17
   StartTime=2016-01-20T14:50:17 EndTime=2016-01-20T14:50:18
   PreemptTime=None SuspendTime=None SecsPreSuspend=0
   Partition=cfel AllocNode:Sid=max-cfel001:1345
   ReqNodeList=(null) ExcNodeList=(null)
   NodeList=max-cfel004
   BatchHost=max-cfel004
   NumNodes=1 NumCPUs=64 CPUs/Task=1 ReqB:S:C:T=0:0:*:*
   TRES=cpu=64,node=1
   Socks/Node=* NtasksPerN:B:S:C=0:0:*:* CoreSpec=*
   MinCPUsNode=1 MinMemoryNode=0 MinTmpDiskNode=0
   Features=(null) Gres=(null) Reservation=(null)
   Shared=0 Contiguous=0 Licenses=(null) Network=(null)
   Command=/home/mmuster/slurm/hostname.sh
   WorkDir=/home/mmuster/slurm/output
   StdErr=/home/mmuster/slurm/output/hostname-%N-2163.err
   StdIn=/dev/null
   StdOut=/home/mmuster/slurm/output/hostname-%N-2163.out
   Power= SICP=0

...