... | ... | @@ -14,7 +14,7 @@ To effectuate interactive executions of your GPU codes on compute nodes with GPU |
|
|
|
|
|
- The `srun` command:
|
|
|
- to [obtain a terminal on a GPU compute node](#obtaining-a-terminal-on-a-gpu-compute-node) within which you can execute your code,
|
|
|
- or to directly execute your code on the GPU partition.
|
|
|
- or to [directly execute your code on the GPU partition](#interactive-execution-on-the-gpu-partition).
|
|
|
- The `salloc` command to reserve GPU resources which allows you to do more than one execution consecutively.
|
|
|
|
|
|
However, if the computations require a large amount of GPU resources (in number of cores, memory, or elapsed time), it is necessary to submit a batch job.
|
... | ... | @@ -76,5 +76,17 @@ To leave the interactive mode, use exit command : |
|
|
|
|
|
If you don't need to open a terminal on a compute node, it is also possible to start the interactive execution of a code on the compute nodes directly from the front end by using the following command (here, with 2 GPU on the default gpu partition) :
|
|
|
|
|
|
$ srun --ntasks=2 --cpus-per-task=12 --gres=gpu:2 --hint=nomultithread [--other-options] ./my_executable_file
|
|
|
$ srun -p gpus --ntasks=2 --cpus-per-task=12 --gres=gpu:2 --hint=nomultithread [--other-options] ./my_executable_file
|
|
|
|
|
|
The reservation becomes usable after the resources have been granted:
|
|
|
|
|
|
$ salloc -p gpus --ntasks=2 --cpus-per-task=12 --gres=gpu:2 --hint=nomultithread [--other-options]
|
|
|
salloc: Granted job allocation 1730516
|
|
|
|
|
|
You can verify that your reservation is active by using the `squeue` command. Complete information about the status of the job can be obtained by using the scontrol show job `<job identifier>` command.
|
|
|
|
|
|
You can then start the interactive executions by using the srun command:
|
|
|
|
|
|
$ srun [--other-options] ./code
|
|
|
|
|
|
*Comments* If you do not specify any option for the srun command, the options for `salloc` (for example, the number of tasks) will be used by default. |
|
|
\ No newline at end of file |