|
|
## Run one task of myApp on one core of a node:
|
|
|
|
|
|
$ srun myApp
|
|
|
|
|
|
This is the simplest way to run a job on a cluster. In this example, the lone `srun` command defaults to asking for one task on one core on one node of the default queue charging the default account.
|
|
|
|
|
|
## Run hostname in an interactive allocation:
|
|
|
|
|
|
$ salloc
|
|
|
salloc: Pending job allocation 150096
|
|
|
salloc: job 150096 queued and waiting for resources
|
|
|
|
|
|
blocks here until job runs
|
|
|
|
|
|
salloc: job 150096 has been allocated resources
|
|
|
salloc: Granted job allocation 150096
|
|
|
|
|
|
$ srun hostname
|
|
|
node001
|
|
|
|
|
|
Run it again
|
|
|
|
|
|
$ srun hostname
|
|
|
node200
|
|
|
|
|
|
Now exit the job and allocation
|
|
|
|
|
|
$ exit
|
|
|
exit
|
|
|
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. |