| ... | @@ -53,7 +53,7 @@ Here is an example of file: |
... | @@ -53,7 +53,7 @@ Here is an example of file: |
|
|
#SBATCH --time=01:00:00 # Time limit hrs:min:sec
|
|
#SBATCH --time=01:00:00 # Time limit hrs:min:sec
|
|
|
#SBATCH --output=example_%j.log # Standard output and error log
|
|
#SBATCH --output=example_%j.log # Standard output and error log
|
|
|
|
|
|
|
|
./my-app arg1 arg2
|
|
./my-app arg1 arg2 &
|
|
|
|
|
|
|
|
```
|
|
```
|
|
|
This file will run one task using at most 4 cpus, 1gb of memory for at most 1 hour and print the output in example_%j.log (%j will be replaced by the job allocation id).
|
|
This file will run one task using at most 4 cpus, 1gb of memory for at most 1 hour and print the output in example_%j.log (%j will be replaced by the job allocation id).
|
| ... | @@ -80,3 +80,21 @@ wait |
... | @@ -80,3 +80,21 @@ wait |
|
|
```
|
|
```
|
|
|
|
|
|
|
|
This will run 10 different tasks in parallel. Note that this will appear as a single job if you use *squeue* and that you can't separate the outputs in a different file for each task (To do that, you can refer to the [Job array section](Slurm job array)).
|
|
This will run 10 different tasks in parallel. Note that this will appear as a single job if you use *squeue* and that you can't separate the outputs in a different file for each task (To do that, you can refer to the [Job array section](Slurm job array)).
|
|
|
|
|
|
|
|
**Example:**
|
|
|
|
```
|
|
|
|
$ sbatch myscript.sh &
|
|
|
|
$ Submitted batch job 130977
|
|
|
|
$ squeue
|
|
|
|
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
|
|
|
|
130977 ls2n parallel user R 0:08 1 srvoad
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
**Common errors:**
|
|
|
|
- *"my sbatch option does not seem to be set"*
|
|
|
|
- the *bash* command will not interpret the *#SBATCH* options, make sure to use *sbatch*
|
|
|
|
- the *sbatch* command will stop to interpret if it encounters anything different from a space, a comment or a *#SBATCH* option.
|
|
|
|
- *"my tasks are not performed in parallel"*
|
|
|
|
- make sure that you properly set the correct number of task in the options
|
|
|
|
- make sure that you putted the "&" at the end of you command line (in your file) |
|
|
|
\ No newline at end of file |