How Do I Request Memory
--mem: Memory per node--mem-per-cpu: Memory per logical CPU
In most circumstances, you should request memory using --mem. The
exception is if you are running an MPI job that could be placed on more
than one node, with tasks divided up randomly, in which case
--mem-per-cpu is more appropriate. More detail is in the following
table, including how you can tell what sort of job you're submitting.
| Job type | Requested tasks ( -n, --ntasks) |
Requested logical CPUs per task ( --cpus-per-task) |
Requested nodes (-N, --nodes) |
Requested tasks per node ( --ntasks-per-node) |
Preferred memory format | Ideal value |
|---|---|---|---|---|---|---|
| Serial | 1 (or unspecified) | 1 (or unspecified) | (Irrelevant, but should not be specified)1 | (Irrelevant, but should not be specified)2 | --mem= |
Peak memory3 needed by the program |
| Multithreaded (e.g. OpenMP), but not MPI | 1 (or unspecified) | > 1 | (Irrelevant, but should not be specified)1 | (Irrelevant, but should not be specified)2 | --mem= |
Peak memory3 needed by the program |
| MPI, evenly split between nodes (recommended method) | Unspecified4 | ≥ 1 (or unspecified) | ≥ 15 | ≥ 15 | --mem= |
(Peak memory3 needed per MPI task) × (number of tasks per node) |
| MPI, evenly split between nodes (discouraged method) | > 1 | ≥ 1 (or unspecified) | Either 1 or the number of tasks6 | (Irrelevant, but should not be specified)4 | --mem= |
(Peak memory3 needed per MPI task) × (number of tasks per node) |
| MPI, randomly placed | > 1 | ≥ 1 (or unspecified) | > 1; < number of tasks6 (or unspecified) | (Irrelevant, but should not be specified)4 | --mem-per-cpu= |
(Peak memory3 needed per MPI task) ÷ (number of logical CPUs per MPI task) |