HPC/Applications/lammps/Package OMP: Difference between revisions

From CNM Wiki
< HPC‎ | Applications‎ | lammps
Jump to navigation Jump to search
(Created page with "== Package OMP == LAMMPS modules since 2012 are compiled with [http://lammps.sandia.gov/doc/Section_accelerate.html#acc_2 <code>yes-user-omp</code>], permitting multi-threaded...")
 
Line 22: Line 22:


=== Job file example ===
=== Job file example ===
* Serial job:
* Single node:
  #PBS -l nodes=1:ppn=8
  #PBS -l nodes=1:ppn=8
  …
  …
  lmp_openmpi -suffix omp -in ''infile''
  lmp_openmpi -suffix omp -in ''infile''
* Parallel job
* Multiple nodes:
#PBS -l nodes=3:ppn=1
  # See [[HPC/Submitting and Managing Jobs/Advanced node selection#OpenMP/MPI hybrid]] for #PBS directives.
  #PBS -l naccesspolicy=SINGLEJOB
  …
  …
  mpirun -x OMP_NUM_JOBS -machinefile $PBS_NODEFILE -np $PBS_NP lmp_openmpi '''-suffix omp''' -in ''infile''
  mpirun … \
        lmp_openmpi '''-suffix omp''' -in ''infile''

Revision as of 23:17, 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 argument Nthreads to either override OMP_NUM_THREADS, or use it when set to *.

Usage

  1. Use the command package omp Nthreads mode near the beginning of your LAMMPS control script.
  2. Do one of the following:
  3. In the job file or qsub command line, reserve entire nodes.
  4. Call the lmp_openmpi (regular) binary.

Input file example

Examples:

package omp * force/neigh
package omp 4 force

Job file example

  • Single node:
#PBS -l nodes=1:ppn=8
…
lmp_openmpi -suffix omp -in infile
  • Multiple nodes:
# See HPC/Submitting and Managing Jobs/Advanced node selection#OpenMP/MPI hybrid for #PBS directives.
…
mpirun … \
       lmp_openmpi -suffix omp -in infile