Skip to content

Commit 2e6ead8

Browse files
Moved array job here
1 parent 3c86a92 commit 2e6ead8

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

mkdocs-project-dir/docs/Supplementary/Slurm_Example_Jobscripts.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,32 @@ module load vasp/6.4.3-intel-oneapi-mpi/oneapi-2024.2.1
2424
srun vasp_std
2525
```
2626

27+
## Array job
28+
29+
A job array is a group of jobs with the same executable and resource requirements, but different input files. A job array can be submitted, controlled, and monitored as a single unit. Each job submitted from a job array shares the same job ID as the job array and has its own `$SLURM_ARRAY_TASK_ID`.
30+
31+
At present, the maximum allowed size of a job array is 1000 tasks.
32+
33+
```
34+
#!/bin/bash
35+
#SBATCH --ntasks=1
36+
#SBATCH --cpus-per-task=1
37+
#SBATCH --job-name=myArray
38+
#SBATCH --time=00:30:00
39+
#SBATCH --array=1-10
40+
41+
# Each task processes a different csv data file
42+
myprogram dataset${SLURM_ARRAY_TASK_ID}.csv
43+
```
44+
45+
The array is created by Slurm directive `--array=1-10` by including elements numbered [1-10] to represent our 10 input files.
46+
47+
When the array job is submitted, Slurm will create 10 jobs under the single job ID. The job array script is submitted in the usual way:
48+
49+
```
50+
sbatch myarrayjob
51+
```
52+
2753
## Enabling Hyperthreads
2854

2955
Hyperthreading lets you use two virtual cores instead of one physical core - some programs can take advantage of this.

0 commit comments

Comments
 (0)