LAMMPS¶
Overview¶
LAMMPS is a general-purpose molecular dynamics software package for massively parallel computers. It is written in an exceptionally clean style that makes it one of the more popular codes for users to extend, and it currently has dozens of user-developed extensions.
For details about the code and its usage, see the LAMMPS home page. This page provides information specific to running on Aurora at the ALCF.
Using LAMMPS at ALCF¶
ALCF provides assistance with build instructions, compiling executables, submitting jobs, and providing prebuilt binaries (upon request). A collection of Makefiles, CMake build scripts, and submission scripts are available in the ALCF GettingStarted repository. For questions, contact us at support@alcf.anl.gov.
Obtaining the source code¶
LAMMPS is an open-source code, which can be downloaded from the LAMMPS website.
Building with KOKKOS package on Aurora¶
Users are encouraged to use CMake to build LAMMPS using the default compilers and the kokkos-sycl-intel.cmake configuration file included in the LAMMPS repo. An example helper script is provided where CMake is used to build LAMMPS using the KOKKOS package for GPU acceleration.
Compilation on the Aurora login nodes will work, but should be done with few processes as they are a shared resource. If building LAMMPS in an interactive job on a compute node, then make -j 32 could be used to speedup up compilation. The ${BASE}/build/lmp executable should be present when compilation succeeds.
Running jobs on Aurora with Kokkos package¶
An example submission script for a KOKKOS-enabled LAMMPS executable is below as an example. Additional information on LAMMPS application flags and options is described on the LAMMPS website.
A GPU affinity script, such as gpu_tile_compact.sh must be used to properly bind MPI ranks to GPU resources. As these affinity scripts only make a single device visible to each MPI rank, the LAMMPS command-line option requesting a number of GPUs should always be set to 1. In this example, each MPI rank is bound to a single tile of an Aurora GPU (12 per node). This is likely the optimal configuration when running with the Kokkos package on Aurora.
Building with GPU package on Aurora¶
Users are encouraged to use CMake to build LAMMPS using the default compilers. An example CMake config script is provided below and available in the ALCF GettingStarted repo here. This file can be copied to your /path_to_lammps/cmake/presets/ directory.
An example helper script is provided where CMake is used to build LAMMPS using the GPU package for GPU acceleration.
Compilation on the Aurora login nodes will work, but should be done with few processes as they are a shared resource. If building LAMMPS in an interactive job on a compute node, then make -j 32 could be used to speedup compilation. The ${BASE}/build/lmp executable should be present when compilation succeeds.
Running jobs on Aurora with GPU package¶
An example submission script for a GPU-enabled LAMMPS executable is below as an example. Additional information on LAMMPS application flags and options is described on the LAMMPS website.
A GPU affinity script, such as gpu_tile_compact.sh must be used to properly bind MPI ranks to GPU resources. As these affinity scripts only make a single device visible to each MPI rank, the LAMMPS command-line option requesting a number of GPUs should always be set to 1. In this example, each MPI rank is bound to a single tile of an Aurora GPU (12 per node).
When running with the GPU package, it will likely be beneficial to run with multiple MPI ranks bound to an individual GPU tile (i.e. 24 or 48 MPI ranks per node). Binding MPI ranks to individual compute-command-streamers can help to improve performance. This is likely the optimal configuration when running with the GPU package on Aurora. Example affinity scripts are available at the paths in example below and the ALCF GettingStarted repo here. Additionally, 2 or 4 OpenMP threads per MPI rank (and appropriately updating the cpu-bind list) might further improve performance but this very much depends on specific workload.
Building LAMMPS with Makefiles¶
Support for building LAMMPS via Makefiles will be deprecated soon in favor of CMake. Recent Makefiles are available, if needed, for building LAMMPS in the following directory. Recent versions of Kokkos are required to run on Aurora, so older versions of LAMMPS will likely need updating to work correctly.
knight@aurora-uan-0009:~/public/lammps/old> ls *
Makefile.aurora Makefile.aurora_kokkos
gpu:
Makefile.aurora
Please contact us at support@alcf.anl.gov for assistance if you require building older versions of LAMMPS with Makefiles (or CMake).
Performance Notes¶
Some useful information on accelerator packages and expectations can be found on the LAMMPS website here.