Skip to content

Multi-Threaded Jobs on Argo

Running Multi-threaded jobs

This section only refers to threaded applications, like - OpenMP, Threaded and Pthreads.

To run multi-threaded jobs, the number of threads required has to be specified in the job submission script. These can be specified by adding the following lines to your job submission script:

#SBATCH --node=1
#SBATCH --ntasks=X
#SBATCH --cpus-per-task=N

where X is the number of tasks required for the job (can be just 1 task), and N is the number of threads each task will spawn.

NOTE: when requesting threads per task make sure that you are not exceeding the total core count available per node, i.e., X*N should not exceed the total core count of a node.


Some libraries may require that the environment variable OMP_NUM_THREADS is set. Otherwise, they will not run in multithreaded mode. Check library specific documentation for further detail.


Sometimes a Java program may require more than one CPU to run properly on the cluster. For example, NetLogo simulation runs needs a minimum of 2 slots (--ntasks=2) to run properly on the cluster. To run a multi-threaded Java application with appropriate number of threads, user has to specify N (referred above) accordingly.