LAMMPS Integration¶
Use LAMMPS 10 Dec 2025 or newer, CMake 3.27 or newer, a C++20 compiler, and a recursive Symmetrix-XL checkout. CPU builds additionally require a Fortran compiler and a supported optimized BLAS installation (OpenBLAS or MKL). The build helper installs the pair style, enables Kokkos, builds LAMMPS, and verifies its pair styles:
python tools/symmetrix_build.py lammps \
--source /path/to/lammps --prefix /path/to/lammps-install \
--backend cpu --cpu-target x86-64-v3 --mpi on
Use --cpu-target native for a machine-local CPU build. --mpi on fails if an
MPI C++ wrapper is unavailable; pass --mpi-cxx /path/to/mpicxx when the module
environment does not expose it under the usual name. Use --mpi auto only when
silently producing a non-MPI build is acceptable.
CUDA and HIP LAMMPS executables are separate builds. Select the architecture that will run the executable:
python tools/symmetrix_build.py lammps \
--source /path/to/lammps --prefix /path/to/lammps-cuda-sm120 \
--backend cuda --arch sm120 --cuda-root /usr/local/cuda-13.3 \
--lammps-package KSPACE --lammps-package EXTRA-PAIR \
--lammps-cmake-define FFT=FFTW3 \
--require-gpu-aware-mpi
python tools/symmetrix_build.py lammps \
--source /path/to/lammps --prefix /path/to/lammps-hip-gfx1151 \
--backend hip --arch gfx1151 --rocm-root /opt/rocm \
--require-gpu-aware-mpi
The helper does not download LAMMPS. --source must point to an existing local
LAMMPS source checkout; a binary-only LAMMPS installation cannot be extended
with this pair style. The installer adds Symmetrix source links and a marked
CMake block to that checkout, then builds into a separate fingerprinted
directory and installs under --prefix. Repeat --lammps-package for each
additional package. In the example, KSPACE supplies long-range electrostatics
such as Ewald and PPPM, while EXTRA-PAIR supplies pair_style dispersion/d3.
Requested packages are checked against the source tree before configuration and
against lmp -help after installation.
Use repeatable --lammps-cmake-define NAME=VALUE arguments for package-specific
choices such as FFT=FFTW3, FFT=KISS, or external-library discovery options.
These values and package selections are part of the build fingerprint, so a
different LAMMPS composition gets a fresh build directory. Backend, MPI,
Kokkos, architecture, SYMMETRIX_*, and PKG_* definitions remain managed by
the frontend; select packages with --lammps-package instead of passing
PKG_NAME=ON directly.
MACE Polar¶
pair_style symmetrix/mace/polar/kk calls the same family-owned native
whole-model evaluator as the ASE adapter. It does not call Python and does not
invoke the public ordinary MACE evaluator. The FP32 spelling is
symmetrix/mace/polar/float32/kk; LAMMPS may append /kk when launched with
-sf kk.
The qualified deployment is deliberately narrow: exactly one MPI rank must own
the complete system. Domain decomposition, ghost-owned model atoms,
pair_style hybrid, per-atom energy, and per-atom virial are rejected before
model evaluation. The distributed Polar LAMMPS path remains a future delivery.
The pair style returns energy, forces, and the global virial; it does not expose
the model dipole as a LAMMPS output. The atom-type map must cover every LAMMPS
type, the model must be MACE_Polar, and the global atom count must fit the
native flattened-index capacity.
For example, a qualified FP32 CPU invocation is:
pair_style symmetrix/mace/polar/float32/kk &
total_charge 0.0 total_spin 0.0 fermi_level 0.0 &
electric_field 0.0 0.0 0.0 &
polar_electrostatics auto
pair_coeff * * /absolute/path/MACE-POLAR-1-M.json H O
The optional settings are total_charge, total_spin, fermi_level,
electric_field EX EY EZ, polar_electrostatics, and head. Select at most one prepared
artifact with either jit_host_artifact or
jit_device_artifact. With no artifact, the consumer uses the portable
pair_spline_v1 backbone. A matching artifact selects the generated/direct
backbone. Supplying both artifact settings, or repeating one, is an error. The
artifact must match the JSON, precision, backend, and JIT ABI.
The generated backbone runs each interaction layer’s product contraction from a
separate M0 or M1 module. Give jit_product_artifact LAYER PATH BLOCKS once
per layer: the layer from 0, the module, and the persistent blocks per compute
unit it is launched with. jit_device_artifact selects the CUDA or HIP
backend of the build and is refused by a CPU build. pair_coeff stops when an
artifact comes without one module per layer; nothing falls back to the portable
backbone. Every artifact is read with the manifest.json of its own JIT cache
entry, so keep the entries where the calculator prepared them. A calculator
constructed with streamed_edges="direct" prepares the complete set, and
format_lammps_arguments(polar_lammps_jit_arguments(calculator)) from
symmetrix.mace_nonlinear_jit_artifact returns the quoted settings to append
to pair_style; pair_symmetrix/README.md shows the recipe. An empty
settings variable selects the portable backbone, so check that the log shows
MACE Polar JIT executed N/N product layers.
Backbone artifact selection is independent of the electrostatic solver. The
JSON remains solver-neutral: polar_electrostatics auto chooses real space
only when all three PBC flags are false and direct reciprocal space when any
axis is periodic. Explicit realspace, periodic, and direct_reciprocal
requests are available for validation. Forced pme is available only for fully
three-dimensional periodic input on qualified CUDA builds with an FFT provider;
LAMMPS consumers and other backends continue to use direct reciprocal space.
This native Polar electrostatics is independent of LAMMPS kspace_style.
Enabling the KSPACE package or selecting LAMMPS PPPM does not provide the
family-owned Polar PME solver and must not be overlaid as if it were that model
component.
Package installation does not select the corrections at runtime. For example, the following illustrates a learned potential overlaid with explicit Coulomb and D3 terms:
atom_style charge
pair_style hybrid/overlay &
symmetrix/mace/kk streamed_edges non-compiled &
coul/long 10.0 &
dispersion/d3 original pbe 30.0 20.0
pair_coeff * * symmetrix/mace/kk /absolute/path/model.json C H O
pair_coeff * * coul/long
pair_coeff * * dispersion/d3 C H O
kspace_style pppm 1.0e-5
Set atom charges and replace the elements, D3 damping method, functional, and
cutoffs with values appropriate to the model. Only overlay a correction that
is absent from the model’s training target, otherwise its energy and forces are
double counted. See the LAMMPS
hybrid/overlay,
dispersion/d3, and
kspace_style documentation for
the full runtime syntax.
A pair_coeff line that gives the pairs of some atom types to another
sub-style, such as pair_coeff 1 * zero under hybrid or pair_coeff 1 * none
under hybrid/overlay, removes those atoms from the Symmetrix neighbor list.
no_domain_decomposition evaluates the model on the remaining atoms.
mpi_message_passing requires every owned atom in the list and stops with an
error; on more than one rank use no_mpi_message_passing with
streamed_edges generic or materialized.
The Symmetrix pair styles require units metal.
pair_coeff loads the model with the options of the preceding pair_style
line. A later pair_style line for the same style that changes an option
needs a new pair_coeff; otherwise the pair style stops at the next run.
--require-gpu-aware-mpi implies --mpi on. Before CMake runs, the helper
compiles a small program with the selected mpicxx and requires the same
provider extension that LAMMPS queries: MPIX_Query_cuda_support() for CUDA or
MPIX_Query_rocm_support() for HIP. An MPI installation without that extension,
or one whose query returns false, fails immediately. Select a site or vendor
wrapper explicitly with --mpi-cxx /path/to/mpicxx. The positive query, wrapper
identity, and wrapper path are recorded under
provenance.mpi.gpu_aware in qualification.json and
lammps-invocation.json.
Use ordinary --mpi on without --require-gpu-aware-mpi when host-staged
communication is intentional. The helper cannot prove arbitrary vendor-specific
GPU transport interfaces, so the required mode currently accepts providers
that expose the Open MPI-compatible MPIX query used by LAMMPS.
The currently qualified accelerator configuration uses CUDA or HIP for device execution and Kokkos Serial for host work; Kokkos OpenMP is disabled. This is a tested configuration rather than an intrinsic Kokkos requirement.
The build-time query proves that the linked MPI provider advertises device buffers; it does not prove the selected inter-node transport. Qualify the installed executable in the same module and scheduler environment used for production. Launch one rank per GPU and let LAMMPS auto-detect GPU awareness:
mpirun -np 2 /path/to/lammps-cuda-sm120/bin/lmp \
-k on g 2 -sf kk -pk kokkos neigh half newton on \
-in in.mace 2>&1 | tee lammps-gpu-aware.log
rg 'Turning off GPU-aware MPI|GPU-aware MPI' lammps-gpu-aware.log
When the scheduler exposes one GPU to each rank, use -k on g 1. A qualified
run has a positive recorded MPIX query and no Turning off GPU-aware MPI since it is not detected warning. Do not force -pk kokkos gpu/aware on to suppress
auto-detection: a successful multi-rank model calculation, correct provider
capability query, and absence of the fallback warning are the required evidence.
Cross-node GPUDirect qualification remains specific to the site’s MPI provider,
network, and scheduler configuration.
See whether communication dominates¶
LAMMPS accounts the Symmetrix hidden-state exchange inside its Pair category,
because the exchange occurs during pair evaluation. Add the Symmetrix timing
compute to separate that work and display its share directly:
compute sxt all symmetrix/timing
timer full
thermo 1000
thermo_style custom step atoms c_sxt c_sxt[1] c_sxt[2] c_sxt[3] c_sxt[10]
thermo_modify colname auto
run 1000
The headings are supplied by the compute, so the final row is self-describing:
Step Atoms SxH1CommPct SxPair SxNonComm SxH1Comm SxH1Imbal
1000 32768 58.3 4.82 2.01 2.81 1.07
SxPair, SxNonComm, and SxH1Comm are run-to-date averages in
us/atom/pair-evaluation from the rank with the largest measured Symmetrix pair
time. The normalization assumes the atom count remains fixed during the measured
run. They are also us/atom/step when the pair is evaluated once per timestep.
SxPair = SxNonComm + SxH1Comm, and SxH1CommPct is the matching,
rank-correlated hidden-state communication share. A value of 50% or more means
hidden-state communication dominates Symmetrix pair evaluation on the critical
rank. It does not mean that communication occupies the same fraction of the
complete LAMMPS timestep; inspect LAMMPS’s timer full breakdown for that
broader question. SxH1Imbal is maximum divided by mean hidden-state
communication time across ranks; values appreciably above one indicate
imbalance or uneven MPI wait.
The timed communication path includes packing, host/device staging, MPI send and
wait, unpacking, and completion at the existing Kokkos fences. It is deliberately
not called network latency: load imbalance can appear as MPI wait. Ordinary
LAMMPS halo and force communication remains in LAMMPS’s Comm category.
Defining compute symmetrix/timing also places fences around the complete
Kokkos pair call so its denominator includes completed device work. Those
measurement-only fences are absent when the compute is not defined; compare a
warmed run with and without the compute when quantifying instrumentation
overhead.
The run-to-date measurement window begins after LAMMPS’s setup force evaluation.
The initial thermo row therefore reports nan for the percentage because no
timed pair evaluation has occurred. Querying the compute performs an MPI
reduction, so use a thermo interval equal to the measurement block instead of
printing it every timestep. The remaining vector fields provide forward/reverse
and rank-spread diagnostics:
Field |
Meaning |
|---|---|
|
Same critical-rank percentage as scalar |
|
Critical-rank forward and reverse communication in |
|
Minimum, mean, and maximum communication percentage across ranks |
|
Minimum and maximum forward calls per pair evaluation |
|
Minimum and maximum reverse calls per pair evaluation |
Dual-layer mpi_message_passing normally reports one forward and one reverse
call per pair evaluation. Single-layer and non-message-passing modes report zero
communication time and calls. Library clients can also read the cumulative
rank-local symmetrix_mpi_hidden_state_seconds, forward/reverse seconds and call
counters, and symmetrix_pair_seconds through extract_pair.
The complete-pair counter is populated after compute symmetrix/timing has
initialized for the current pair style, because accurate accelerator timing
requires the bounding fences.
--dry-run performs target and MPI preflight checks but does not create or
modify a build directory. It prints one JSON document containing the resolved
commands, selected environment, fingerprint, and provenance.
For a quick diagnostic CPU run without a prepared artifact, use the
compiler-free Kokkos non-compiled debug path with a compact JSON model. It is
not optimized and has no performance guarantee. The first-class production path
is the direct example below. The atom-ID map and Newton pair setting are required:
units metal
atom_style atomic
atom_modify map yes
package kokkos neigh half newton on
newton on
pair_style symmetrix/mace/kk streamed_edges non-compiled
pair_coeff * * /absolute/path/srtio3-mace.json Sr Ti O
run 0
The three element names map LAMMPS atom types 1, 2, and 3 to Sr, Ti, and O. They must match the atom types in the SrTiO3 data file and be supported by the model.
LAMMPS does not compile direct artifacts. Prepare the matching artifact before a direct production run. A CPU/OpenMP direct run uses a host artifact:
jit_artifact=$(symmetrix_prepare_jit_host_artifact \
--model srtio3-mace.json --precision float32 --path-only)
lmp -var jit_artifact "$jit_artifact" -in in.mace
pair_style symmetrix/mace/float32/kk mpi_message_passing streamed_edges direct &
profile capacity jit_host_artifact ${jit_artifact}
pair_coeff * * srtio3-mace.json Sr Ti O
profile capacity is the default and matches ASE’s capacity profile. Use
profile speed to select the retained throughput plan. The deprecated
low_memory yes|no spelling maps to profile capacity|speed; the alias never
enables fixed workspace.
allow_fixed_workspace defaults to no. Set it to yes only with
profile capacity to permit bounded tiled workspace selection; it does not
force that plan when another qualified capacity plan is preferred.
Fixed-workspace plans run under mpi_message_passing;
no_domain_decomposition refuses allow_fixed_workspace yes.
Single-layer direct MPI does not require an R1 artifact. Its retained plan is
backend-independent; its fixed-workspace plan currently requires CUDA.
Dual-layer fixed-workspace MPI requires an ordinary two-layer standard-MACE
model, CUDA FP32 or FP64, direct prepared execution, and a precision-matched
generated device artifact with tiled R1 support. It bounds receiver and edge
intermediates but retains local-plus-ghost H1 and H1-adjoint state. MACEField,
HIP, parameter gradients, and execution observers remain unsupported for this
tiled MPI plan.
LAMMPS communication counts remain signed int values, so the H1 width times
the largest rank-local ghost count must fit that ABI. The bound applies to a
halo message, not to the full local-plus-ghost feature tensor.
Artifact preparation uses the Python runtime, not the LAMMPS executable. Install
the symmetrix-xl CPU frontend first and then install the backend matching the
LAMMPS executable. For CUDA/HIP, activate that backend and generate the device
artifact on the deployment GPU:
python tools/symmetrix_build.py install --backend cpu --cpu-target native
python tools/symmetrix_build.py install \
--backend cuda --arch sm120 --cuda-root /usr/local/cuda-13.3
jit_arguments=$(symmetrix_prepare_jit_device_artifact \
--model srtio3-mace.json --precision float32 --lammps-arguments)
lmp -var jit_arguments "$jit_arguments" -in in.mace
For HIP, replace the second install command with --backend hip --arch gfx1151 --rocm-root /opt/rocm. Backend packages are architecture-specific; do not use
an artifact or native backend built for a different device target.
Use the rendered arguments with symmetrix/mace/float32/kk. Use
--precision float64 with symmetrix/mace/kk when FP64 is required. Use
no_domain_decomposition for a one-rank GPU input or
mpi_message_passing for the qualified direct MPI mode. Use the float32 pair
style only with a float32 artifact. MACEField is Kokkos-only and needs
electric_field Ex Ey Ez. The detailed, retained pair_symmetrix/README.md
covers pair-style options, MPI constraints, and CUDA-aware MPI qualification.