Back to main menu

Program behaviour: nthreads

Syntax

-nthreads <n>

Description

This option controls the maximum number of threads allowed for the parts of the code that are parallelized with OpenMP. The number <n> must be an integer greater than zero. For better efficiency, <n> should be smaller or equal to the number of CPUs available on the machine.

Note that only some specific parts of the code are actually parallelized. This option will have no effect on the parts of the code that are not programmed to run in parallel.

To make this change permanent, you may set up a configuration file.

Default

By default, the number of threads used by OpenMP is controlled by the environment variable OMP_NUM_THREADS. If it is not defined, then OpenMP will use as many threads as possible on the running machine. Note that Atomsk must have been compiled with OpenMP enabled in order to use several threads (see this page for more information).

Examples

Back to main menu