HPC/Applications/lammps/Package OMP: Difference between revisions
< HPC | Applications | lammps
Jump to navigation
Jump to search
m (→Package OMP) |
|||
Line 5: | Line 5: | ||
* The number of MPI tasks running on a node is determined by options to mpirun. | * The number of MPI tasks running on a node is determined by options to mpirun. | ||
* The number of threads that each MPI task runs with is usually determined by the environment variable <code>OMP_NUM_THREADS</code>, which is 1 by default on Carbon. | * The number of threads that each MPI task runs with is usually determined by the environment variable <code>OMP_NUM_THREADS</code>, which is 1 by default on Carbon. | ||
* The LAMMPS <code>package omp</code> command has a mandatory argument <code>''Nthreads''</code> to either ''override'' <code>OMP_NUM_THREADS</code>, or ''use'' it when set to <code>*</code>. | * The LAMMPS <code>package omp</code> command has a mandatory argument <code>''Nthreads''</code> to either ''override'' <code>OMP_NUM_THREADS</code>, or ''use'' it when set to <code>*</code> - the recommended practice. It appears to be sensible to specify a concrete thread number only once, which means in the job file, and let LAMMPS inherit this value with <code>''Nthreads''</code> set to <code>*</code>. | ||
=== Usage === | === Usage === |
Revision as of 23:35, November 5, 2012
Package OMP
LAMMPS modules since 2012 are compiled with yes-user-omp
, permitting multi-threaded runs of selected pair styles, and in particular MPI/OpenMP hybrid parallel runs. To set up such runs, see HPC/Submitting and Managing Jobs/Advanced node selection.
Be careful how to allocate CPU cores on compute nodes.
- The number of MPI tasks running on a node is determined by options to mpirun.
- The number of threads that each MPI task runs with is usually determined by the environment variable
OMP_NUM_THREADS
, which is 1 by default on Carbon. - The LAMMPS
package omp
command has a mandatory argumentNthreads
to either overrideOMP_NUM_THREADS
, or use it when set to*
- the recommended practice. It appears to be sensible to specify a concrete thread number only once, which means in the job file, and let LAMMPS inherit this value withNthreads
set to*
.
Usage
- Use the command
package omp Nthreads mode
near the beginning of your LAMMPS control script. - Do one of the following:
- Append /omp to the style name (e.g. pair_style lj/cut/omp)
- Use the suffix omp command.
- On the command line, use the -suffix omp switch.
- In the job file or qsub command line, reserve nodes and ppn suitable for OpenMP runs.
- Call the
lmp_openmpi
(regular) binary.
Input file example
Examples:
- Recommended:
package omp * force/neigh
- Not recommended:
package omp 4 force
Job file example
- Single node - choose from:
- And for the main command:
lmp_openmpi -suffix omp -in infile
- Multiple nodes - use:
- And for the main command:
mpirun … lmp_openmpi -suffix omp -in infile