Changes between Version 1 and Version 2 of Workshops/cypress/SlurmPractice
- Timestamp:
- 08/22/18 13:06:23 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Workshops/cypress/SlurmPractice
v1 v2 51 51 cypress1 52 52 }}} 53 This code print a message, time, and the host name.53 This code prints a message, time, and the host name on the screen. 54 54 55 55 Look at 'slurmscript1' … … 79 79 but those are directives for '''SLURM''' job scheduler. 80 80 81 === qos, partition===81 ==== qos, partition ==== 82 82 Those two lines determine the quality of service and the partition. 83 83 {{{ … … 96 96 If you are using a workshop account, you can use only '''workshop''' qos and partition. 97 97 98 === job-name===98 ==== job-name ==== 99 99 {{{ 100 100 #SBATCH --job-name=python # Job Name … … 102 102 This is the job name that you can specify as you like. 103 103 104 === time===104 ==== time ==== 105 105 {{{ 106 106 #SBATCH --time=00:01:00 # WallTime … … 110 110 After the walltime reaches the maximum, the job terminates regardless whether the job processes are still running or not. 111 111 112 === Resource Rwquest===112 ==== Resource Request ==== 113 113 {{{ 114 114 #SBATCH --nodes=1 # Number of Nodes … … 123 123 '''#SBATCH --cpus-per-task=c''' determines the number of cores/threads for a task. The details will be explained in Parallel Jobs below. 124 124 125 126 127 128 129 130 125 This script requests one core on one node. 131 126 … … 135 130 136 131 [[Image(https://docs.google.com/drawings/d/e/2PACX-1vQR7ztCNSIQhIjyW28FyYaQn92XC4Zq_vZzoPwALkywmXoyRl8qC2MEpT1t68zMopZv2yHNt2unMf-i/pub?w=155&h=134)]] 132 133 === Submit a job === 134 Let's run our program on the cluster. 135 To submit our script to SLURM, we invoke the '''sbatch''' command. 136 {{{ 137 [fuji@cypress1 SerialJob]$ sbatch slurmscript1 138 Submitted batch job 773944 139 }}} 140 141 Our job was successfully submitted and was assigned the job number 773944. 142 This python code, ''hello.py'' prints a message, time, and the host name on the screen. 143 But this time, ''hello.py'' ran on one of the computing nodes and your terminal screen doesn't connect to it. 144 145 After the job completed, you will see a new file, slurm-???????.out 146 {{{ 147 [fuji@cypress1 SerialJob]$ ls 148 hello.py slurm-773944.out slurmscript1 slurmscript2 149 }}} 150 that contains 151 {{{ 152 [fuji@cypress1 SerialJob]$ cat slurm-773944.out 153 Hello, world! 154 2018-08-22T12:51:34.436170 155 cypress01-117 156 }}} 157 The strings supposed to print on screen went to the file, slurm-???????.out. This is a default file name. You can change it by setting, 158 {{{ 159 #SBATCH --output=Hi.out ### File in which to store job output 160 #SBATCH --error=Hi.err ### File in which to store job error messages 161 }}} 162 163 164