Skip to content

Conversation

lorisercole
Copy link
Contributor

@lorisercole lorisercole commented Aug 20, 2025

A few improvements to the LAMMPS Easyblock.

Sanity checks & tests

other fixes

  • Enable Kokkos serial backend build: Kokkos serial backend can be built next to the OpenMP/CUDA backend. This avoids performance-related warnings when using Kokkos with a single thread.
  • Code cleanup and minor bug fixes

Closes #3785
Supersedes #3789

The Python interface was updated in the latest LAMMPS release. `l.finalize()` causes a crash. We can safely remove it,
assuming that `mpi4py` is used as dependency.
Add some example scripts to test running LAMMPS with accelerated styles: KOKKOS, GPU, INTEL, OPENMP
See easybuilders#3785
Kokkos serial backend can also be built next to OpenMP/CUDA backend. This avoids performance-related warnings when using Kokkos with a single thread.
Co-authored-by: laraPPr <[email protected]>

Closes easybuilders#3785
Supersedes easybuilders#3789
lorisercole added a commit to lorisercole/easybuild-easyconfigs that referenced this pull request Aug 25, 2025
@boegel boegel added the update label Aug 27, 2025
@boegel boegel added this to the release after 5.1.2 (5.2.0?) milestone Aug 27, 2025
@lorisercole lorisercole marked this pull request as ready for review August 28, 2025 09:12
lorisercole added a commit to lorisercole/easybuild-easyconfigs that referenced this pull request Aug 28, 2025

# https://lammps.sandia.gov/doc/Build_extras.html
# KOKKOS
# detect the CPU and GPU architecture (used for Intel and Kokkos packages belos)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# detect the CPU and GPU architecture (used for Intel and Kokkos packages belos)
# detect the CPU and GPU architecture (used for Intel and Kokkos packages below)

os.path.join(self.installdir, "examples", "msst", "in.msst")
)
if self.cfg['kokkos']: # KOKKOS package
if self.cuda: # NOTE: requires a GPU to run
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a difficult requirement to meet, we should be able to support a cross-compilation. In EESSI, for example, this is going to cause problems as we must cross-compile for a lot of architectures. You could make it conditional on the nvidia-smi command running successfully?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See for example

if not which('nvidia-smi', on_error=IGNORE):
print_warning('Could not find nvidia-smi. Assuming a system without GPUs and skipping GPU tests!')
num_gpus_to_use = 0
elif os.environ.get('CUDA_VISIBLE_DEVICES') == '-1':
print_warning('GPUs explicitely disabled via CUDA_VISIBLE_DEVICES. Skipping GPU tests!')
num_gpus_to_use = 0
else:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LAMMPS sanity checks should test accelerator packages (Kokkos, Intel, ...)
3 participants