... | ... | @@ -32,4 +32,37 @@ Now exit the job and allocation |
|
|
salloc: Relinquishing job allocation 150096
|
|
|
salloc: Job allocation 150096 has been revoked.
|
|
|
|
|
|
Like `srun` in the first example, salloc defaults to asking for one node of the default queue charging the default account. Once the job runs and the prompt appears, any further commands are run within the job's allocated resources until exit is invoked. |
|
|
Like `srun` in the first example, `salloc` defaults to asking for one node of the default queue charging the default account. Once the job runs and the prompt appears, any further commands are run within the job's allocated resources until `exit` is invoked.
|
|
|
|
|
|
## Create a batch job script and submit it
|
|
|
|
|
|
```
|
|
|
$ cat > myBatch.cmd
|
|
|
#!/bin/bash
|
|
|
#SBATCH -N 4
|
|
|
#SBATCH -p compute
|
|
|
#SBATCH -A myAccount
|
|
|
#SBATCH -t 30
|
|
|
|
|
|
srun -N 4 -n 32 myApp
|
|
|
^D
|
|
|
```
|
|
|
|
|
|
This script asks for 4 nodes from the pdebug queue for no more than 30 minutes charging the *myAccount* account. The srun command launches 32 tasks of myApp across the four compute nodes.
|
|
|
|
|
|
Now submit the job:
|
|
|
|
|
|
```
|
|
|
$ sbatch myBatch.cmd
|
|
|
Submitted batch job 150104
|
|
|
```
|
|
|
|
|
|
See the job pending in the queue:
|
|
|
|
|
|
```
|
|
|
$ squeue
|
|
|
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
|
|
|
150104 compute myBatch. me PD 0:00 4 (Priority)
|
|
|
```
|
|
|
|
|
|
After the job runs, the output will be found in a file named after the job id: `slurm-150104.out` |