LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

nthreads command

Syntax:

nthreads n 

Examples:

nthreads 1
nthreads 6
nthreads * 

Description:

Specify how many threads are to be used per MPI task in a hybrid MPI/multi-threading environment.processors are mapped as a 3d logical grid to the global simulation box.

When this command has not been specified, LAMMPS will choose n according to the defaults of the threading environment, e.g. in OpenMP according to the OMP_NUM_THREADS environment variable or using all available processors if that is not set.

For a package like LAMMPS, threading is typically not as efficient as a distributed data parallelization via domain decomposition using MPI message passing. Thus this keyword is mostly of use when MPI parallelization is becoming inefficient, e.g. when using a "slow" network (like GigE with TCP/IP) or when reaching the limit of scaling.

Restrictions:

This command cannot be used after the simulation box is defined by a read_data or create_box command.

This command only has an effect and is only of use if LAMMPS was built with the "user-openmp" package included. See the Making LAMMPS section for more info.

Related commands:

processors

Default:

nthreads * 

or in case multi-threading support is not compiled in:

nthreads 1