41
Duke Compute Cluster Workshop 10/04/2018 Tom Milledge rc.duke.edu [email protected]

Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

DukeComputeClusterWorkshop

10/04/2018TomMilledgerc.duke.edu

[email protected]

Page 2: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Outlineoftalk

•  OverviewofResearchComputingresources•  DukeComputeClusteroverview•  Runninginteractiveandbatchjobs•  UsingSlurmjobarrays•  Runningmulti-coreandparalleljobs•  Specifyingjobdependencies•  Livedemoandquestions

Page 3: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

DukeResearchComputingservices&resources

•  Clustercomputing-DukeComputeCluster•  Virtualmachines-RAPID(ResearchToolkits),“Clockworks”

•  Datastorage-DukeDataCommons(NIH),•  Researchcomputingnetworks-highspeed,Software-DefinedNetwork,“ProtectedNetwork”

•  Consultation•  Accesstonationalresources(XSEDE,OSG)•  Education&training•  Technologydevelopment

Page 4: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

TheDukeComputeCluster(DCC)

•  Formerlyknownasthe“DSCR”•  667computenodeswithapproximately14209CPUcores(asofMarch2018)

•  Mostnodesarepurchasedbylabsanddepts•  SomeareprovidedbytheUniversity•  500TBofprimarystorage(IsilonX-series)•  RedHatEnterpriseLinux7•  UsestheSlurmjobqueueingsystem

Page 5: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

AccessingtheDukeComputeCluster

•  Fromon-campus(UniversityorDUHSnetworks):

ssh [email protected] ThiswillconnecttooneofthethreeDCC

loginnodes •  Fromoffcampus,first,usetheDukeVPN:https://oit.duke.edu/net-security/network/remote/vpn/

Page 6: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Copyingfilesanddirectories•  UsescporrsyncforLinuxorMacworkstations•  UsewinscpforWindows:https://winscp.net•  CopyingafiletotheDCC(“push”) % scp data001.txt [email protected]:. •  CopyingafilefromtheDCC(“pull”):% scp [email protected]:output.txt . •  Useeitherscp-r(smallfiles)orrsync–av(largefiles)•  Pushingadirectory:rsync –av dir1/ [email protected]:. or scp -r dir1/ [email protected]:. •  Pullingadirectory:rsync –av [email protected]:~/dir1 . scp -r [email protected]:~/dir1 .

Page 7: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

DukeComputeClusterfilesystems/dscrhome(asymlinkto/hpchome/group)•  PrimarystorageontheIsilonX-seriesfilers•  250GBgroupquota(typical)•  Twoweektapebackup(TSM)/work•  Temporarystorageforlargedatafiles•  Placefortemporaryfilesassociatedwithrunningjobs(I/O)•  Notbacked-up•  Subjecttopurgesbasedonfileageand/orutilizationlevels•  200TBtotalvolumesize,unpartitioned/datacommons•  ArchivalstorageontheIsilonNL-seriesfilers•  availablefor$82/TB/year

Page 8: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Slurmresources

•  TheDCCwebpageshttps://rc.duke.edu/the-duke-compute-cluster/

“Official”SLURMdocshttp://schedmd.com/slurmdocs•  OlderSLURMdocumentationhttps://computing.llnl.gov/linux/slurm/slurm.html

•  ComesupalotinGooglesearches•  outdated–useschedmd.cominstead

Page 9: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Slurmjobsrunin“partitions”

•  MostDCCpartitionsaredept-ownedmachines•  Thesecanonlybeusedbymembersofthegroup•  Submittingtoagrouppartitiongives“high-priority”•  Submittopartitionswith“--partition=”or“-p“,e.g. #SBATCH –p (partition name) (inascript)or srun –p (partition name)--pty bash –i

(interactively) •  ThedefaultDCCpartitioniscalled“common”•  Thecommonpartitiongives“low-priority”tomostESXhosts

Page 10: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

DCCPartitionsTherearedifferentDCCpartitionstowhichbatchjobsandinteractivesessionscanbedirected:•  common,forjobsthatwillrunontheDCCcorenodes(upto64GBRAM).

•  common-large,forjobsthatwillrunontheDCCcorenodes(64-240GBGBRAM).

•  gpu-common,forjobsthatwillrunonDCCGPUnodes.

•  Grouppartitions(partitionnamesvaries),forjobsthatwillrunonlab-ownednodes

Page 11: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Runninganinteractivejob•Reserveacomputenodebytyping

srun --pty bash -i tm103@dscr-slogin-02 ~ $ srun --pty bash -i srun: job 186535 queued and waiting for resources srun: job 186535 has been allocated resources tm103@dscr-core-11 ~ $ tm103@dscr-encode-11 ~ $ squeue -u tm103 JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON) 186535 common bash tm103 R 0:14 1 dscr-core-11 •  Inowhaveaninteractivesessioninthecommonpartitiononnodedscr-encode-11

Page 12: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

SLURMcommands•  sbatchSubmitabatchjob(like“qsub”)•  #SBATCHSpecifyjobparameters(like“#$”)•  squeue(like“qstat”)Showlistsofjobs•  scancel(like“qdel”)Deleteoneormorebatchjobs•  sinfo(like“qhost”)Showinfoaboutmachines•  scontrolShowclusterconfigurationinformation

Page 13: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

sbatch

•  Use“sbatch”(alllowercase)tosubmitsbatch test.q

•Use“#SBATCH”(uppercase)inyourscriptsforschedulerdirectives,e.g. #SBATCH --mem=1G #SBATCH --output=matlab.out

•AllSLURMdirectivescanbegivenonthecommandlineinsteadofthescript.•http://slurm.schedmd.com/sbatch.html

Page 14: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

sbatchexample#!/bin/bash # #SBATCH --output=test.out uname –n # print hostname

Thisprintsthenameofthecomputenodeinthefile"test.out”tm103@dscr-slogin-02 ~/slurm $ sbatch simple.q Submitted batch job 186554 tm103@dscr-slogin-02 ~/slurm $ cat test.out dscr-compeb-14

Page 15: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Long-formcommandsexample

#!/bin/bash #SBATCH --output=slurm.out

#SBATCH --error=slurm.err

#SBATCH --mem=100 # 100MBRAM#SBATCH -–partition=abyss # e.g.uname -n 1>&2#printshostnametotheerrorfile

• Forauserinthe“abyss”group,thisjobwillruninhighpriorityonan“abyss”labnode.

Page 16: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Short-formcommandsexample

•  SLURMshortcommandsdon’tuse“=“signs#!/bin/bash

#SBATCH -o slurm.out

#SBATCH -e slurm.err

#SBATCH -–mem=4G #4GBsRAM

#SBATCH –p somelab #onlyformembers uname -n 1>&2#printshostnametotheerrorfile

Page 17: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Matlabexamplescript

#!/bin/bash #SBATCH –J matlab #SBATCH –o slurm.out #SBATCH --mem=4G #4GBRAM/opt/apps/matlabR2016a/bin/matlab -nojvm -nodisplay –singleCompThread -r my_matlab_program •  The”–singleCompThread“commandisrequiredtopreventuncontrolledmultithreading

Page 18: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Slurmmemorydirectives

• Thisisahardlimit–alwaysrequestalittlemore--mem=<MB>•  Theamountofmemoryrequiredpernode--mem-per-cpu=<MB>•  TheamountofmemoryperCPUcore•  Formulti-threadedjobs•  Note:--memand--mem-per-cpuaremutuallyexclusive

Page 19: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Slurmparalleldirectives

•  Allparalleldirectiveshavedefaultsof1-N<number>Howmanynodes(machines)-n<number>or--ntasks=<number>Howmanyparalleljobs(“tasks”)-c,--cpus-per-task=<ncpus>•  Use-cformulti-threadedjobs•  The--ntasksdefaultisoneCPUcorepertask,butthe--cpus-per-taskoptionwillchangethisdefault.

Page 20: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Multi-threaded(multi-core)example

!/bin/bash #SBATCH –J test #SBATCH –o test.out #SBATCH –c 4 #SBATCH –-mem-per-cpu=500 #(500MB)myApplication –n $SLURM_CPUS_PER_TASK•  Thevalueof$SLURM_CPUS_PER_TASKisthenumberafter“-c”

•  Thisexamplestartsasingle,multi-threadedjobthatuses4CPUcoresand2GB(4x500MB)ofRAM

Page 21: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

OpenMPmulticoreexample

!/bin/bash #SBATCH –J openmp-test #SBATCH –o slurm.out #SBATCH –c 4 export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK

myOpenMPapp #willrunon4CPUcores•  Thissets$OMP_NUM_THREADS tothevalueof$SLURM_CPUS_PER_TASK

Page 22: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Slurmjobarrays

•  Whatarejobarrays?•  --array(or-a)option•  SLURM_ARRAY_TASK_IDenvironmentvariable

•  Examplewithsequentiallynamedfiles•  Exampleswithnon-sequentiallynamedfiles•  “Unrolling”existingforloops

Page 23: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Slurmjobarrays

•  amechanismforsubmittingandmanagingcollectionsofsimilarjobs

•  onejobscriptandoneapplicationprogram•  Eachcanbeup100,000jobtasksontheDCC•  Jobarraysareonlysupportedforbatchjobs•  Jobarray“tasks”mustbeindependent•  http://slurm.schedmd.com/job_array.html

Page 24: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

--array(or–a)Forexample,inajobscript,addtheline#SBATCH --array=1-30 or,alternatively,#SBATCH -a 1-30 tosubmit30jobtasks.Thejobarrayindicescanalsobespecifiedonthecommandline,e.g.sbatch -a 1-30 myjob.sh

Page 25: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Arrayindices,cont.

Theindexvaluescanbecontinuous,e.g.-a 0-31 (32tasks,numberedfrom0,1,2,...,31)ordiscontinuous,e.g.-a3,5,7-9,12(6tasks,numbers3,5,7,8,9,12)Itcanalsobeasinglejobtask,e.g.-a7Thediscontinousnotationisusefulforresubmittingspecificjobtasksthathadpreviouslyfailed

Page 26: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

$SLURM_ARRAY_TASK_IDEachjobtaskisassignedtheenviromentalvariable$SLURM_ARRAY_TASK_IDsettoit’sindexvalue.tm103@dcc-slogin-02 ~/misc/jobarrays $ cat array-test.sh !#!/bin/bash !echo $SLURM_ARRAY_TASK_ID !tm103@dcc-slogin-02 ~/misc/jobarrays $ sbatch -a 1-3 array-test.sh !Submitted batch job 24845830 !tm103@dcc-slogin-02 ~/misc/jobarrays $ ls slurm-24845830* !slurm-24845830_1.out slurm-24845830_2.out slurm-24845830_3.out !tm103@dcc-slogin-02 ~/misc/jobarrays $ cat slurm-24845830* !1 !2 !3 !tm103@dcc-slogin-02 ~/misc/jobarrays $

Page 27: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Pythonjobarrayexample#!/bin/bash #SBATCH –e slurm.err #SBATCH --array=1-5000 python myCode.py $ cat test.py import os rank=int(os.environ['SLURM_ARRAY_TASK_ID']) ... •  Start5000Pythonjobs,eachwithadifferent“rank”,

initializedfromSLURM_ARRAY_TASK_ID

Page 28: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Matlabjobarrayexample#!/bin/bash #SBATCH -e slurm_%A_%a.err #SBATCH -o slurm_%A_%a.out #SBATCH -a 1-100 #SBATCH --mem=4G module load Matlab/R2017b matlab -nodisplay –singleCompThread -r "rank=$SLURM_ARRAY_TASK_ID;my_prog;quit”

•  Start100Matlabprograms,eachwithadifferent“rank”,

e.g.1,2,...100

Page 29: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Processingcontinuouslynamedfiles

•  Forthecasewithinput(oroutput)filenamesoftheformfile1,file2,...,fileNfor-a 1-N,e.g.

#!/bin/bash!#SBATCH -e slurm_%A_%a.err !#SBATCH -o slurm_%A_%a.out !mkdir out_${SLURM_ARRAY_TASK_ID} !cd out_${SLURM_ARRAY_TASK_ID}!myapp ../input_${SLURM_ARRAY_TASK_ID}.txt !!whereoutputdirectoriesout_1,out_2,...arecreatedforinputfilesinput_1.txt,input_2.txt,...

Page 30: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Processingdiscontinuouslynamedfiles

•  Processanexistingfilelist,e.g.files.txt#!/bin/bashreadarray -t FILES < files.txt !FILENAME=${FILES[(($SLURM_ARRAY_TASK_ID - 1))]} !myapp $FILENAME

•  Dynamicallygenerateafilelistfrom“ls”#!/bin/bash!export FILES=($(ls -1 myfile*))!FILENAME=${FILES[(($SLURM_ARRAY_TASK_ID - 1))]} !myapp $FILENAME

Page 31: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

“Unrolling”forloops

•  Original“serial”code(Python)fibonacci = [0,1,1,2,3,5,8,13,21] !for i in range(len(fibonacci)): ! print(i,fibonacci[i]) !•  Jobarrayversionimport os !i=int(os.environ['SLURM_ARRAY_TASK_ID']) !fibonacci = [0,1,1,2,3,5,8,13,21] !#for i in range(len(fibonacci)):! print(i,fibonacci[i]) !wheretheforloopiscommentedoutandeachjobtaskisdoingasingle“iteration”!!

Page 32: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

“Unrolling”forloop,cont.!

tm103@dcc-slogin-02 ~/misc/jobarrays $ cat fib-array.sh !#!/bin/bash !#SBATCH -e slurm.err !module load Python/2.7.11 !python fibonacci.py !tm103@dcc-slogin-02 ~/misc/jobarrays $ sbatch –a 1-8 fib-array.sh !Submitted batch job 24856052!tm103@dcc-slogin-02 ~/misc/jobarrays $ ls slurm-24856052_* !slurm-24856052_1.out slurm-24856052_3.out slurm-24856052_5.out slurm-24856052_7.out !slurm-24856052_2.out slurm-24856052_4.out slurm-24856052_6.out slurm-24856052_8.out !tm103@dcc-slogin-02 ~/misc/jobarrays $ cat slurm-24856052* !(1, 1) !(2, 1) !(3, 2)(4, 3)(5, 5)(6, 8)(7, 13)(8, 21)tm103@dcc-slogin-02 ~/misc/jobarrays $

Page 33: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

RunningMPIjobs

•  SupportedMPIversions-  IntelMPI-  OpenMPI•  SLURMMPIjobsuse“--ntasks=(num)“https://wiki.duke.edu/display/SCSC/Running+MPI+Jobs

Page 34: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

CompilingwithOpenMPItm103@dcc-slogin-02 ~ $ module load OpenMPI/2.1.0 OpenMPI 2.1.0 tm103@dcc-slogin-02 ~ $ which mpicc tm103@dcc-slogin-03 ~ $ cd /dscrhome/tm103/misc/slurm/openmpi tm103@dcc-slogin-03 ~/misc/slurm/openmpi $ mpicc -o openhello hello.c tm103@dscr-slogin-02 ~/misc/slurm/openmpi ls -l openhello -rwxr-xr-x. 1 tm103 scsc 9184 Sep 1 16:08 openhello

Page 35: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

OpenMPIjobscript#!/bin/bash #SBATCH -o openhello.out

#SBATCH -e slurm.err #SBATCH -n 20 module load OpenMPI/2.1.0 mpirun -n $SLURM_NTASKS openhello

Page 36: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

OpenMPIexampleoutputtm103@dscr-slogin-02 ~/misc/slurm/openmpi $ cat openhello.out dscr-core-01, rank 0 out of 20 processors dscr-core-01, rank 1 out of 20 processors dscr-core-01, rank 2 out of 20 processors dscr-core-01, rank 3 out of 20 processors dscr-core-01, rank 4 out of 20 processors dscr-core-03, rank 13 out of 20 processors dscr-core-03, rank 14 out of 20 processors dscr-core-03, rank 10 out of 20 processors dscr-core-03, rank 11 out of 20 processors dscr-core-03, rank 12 out of 20 processors dscr-core-02, rank 8 out of 20 processors dscr-core-02, rank 9 out of 20 processors dscr-core-02, rank 5 out of 20 processors ...

Page 37: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

IntelMPIexample

#!/bin/bash #SBATCH --ntasks=20

#SBATCH --output=intelhello.out export I_MPI_PMI_LIBRARY=/opt/slurm/lib64/libpmi.so

source /opt/apps/intel/intelvars.sh srun -n $SLURM_NTASKS intelhello

Page 38: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

GPUnodesTorunaGPUbatchjob,addthejobscriptlines #SBATCH -pgpu-common--gres=gpu:1 #SBATCH -c6

TogetaninteractiveGPUnodesession,typethecommandline

srun -p gpu-common --gres=gpu:1 -c 6 --pty bash –i tm103@dscr-slogin-02 ~ $ srun -p gpu-common --gres=gpu:1 -c 6 --pty bash -i tm103@dscr-gpu-01 ~ $ /usr/local/cuda-7.5/samples/1_Utilities/deviceQuery/deviceQuery ... Detected 1 CUDA Capable device(s) Device 0: "Tesla K80" CUDA Driver Version / Runtime Version 7.5 / 7.5 CUDA Capability Major/Minor version number: 3.7 Total amount of global memory: 11520 MBytes (12079136768 bytes) (13) Multiprocessors, (192) CUDA Cores/MP: 2496 CUDA Cores ...

Page 39: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Jobdependencies

•  https://hcc-docs.unl.edu/display/HCCDOC/Job+Dependencies

•  Startjob“dep2”afterjob“dep1”$ sbatch dep1.q Submitted batch job 666898 •  MakeanoteoftheassignedjobIDofdep1$ sbatch --dependency=afterok:666898 dep2.q

•  Jobdep2willnotstartuntildep1finishes

Page 40: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Jobdependencieswitharrays

•  Waitforspecificjobarrayelementssbatch --depend=after:123_4 my.job sbatch --depend=afterok:123_4:123_8 my.job2

•  Waitforentirejobarraytocompletesbatch --depend=afterany:123 my.job •  Waitforentirejobarraytocompletesuccessfullysbatch --depend=afterok:123 my.job •  Waitforentirejobarraytocompleteandatleastonetaskfails

sbatch --depend=afternotok:123 my.job

Page 41: Duke Compute Cluster Workshop · 2018. 10. 4. · Duke Compute Cluster file systems /dscrhome (a symlink to /hpchome/group) • Primary storage on the Isilon X-series filers • 250

Livedemonotes•  df –h •  srun --pty bash -i •  squeue | more •  squeue -S S •  squeue–S S|grep –v PD •  squeue –u (NetID) •  sbatch (job script) •  scancel (job id) •  uname –n, sleep, top •  sinfo | grep –v common •  scontrol show node (node name) •  scontrol show job (job id)