add mace-lammps perlmutter installation script
Browse files- install-lammps-perlmutter.sh +56 -0
install-lammps-perlmutter.sh
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
# this script is adapted from https://mace-docs.readthedocs.io/en/latest/guide/lammps.html
|
4 |
+
# to install LAMMPS on Perlmutter
|
5 |
+
|
6 |
+
# Clone the LAMMPS repository if it does not exist
|
7 |
+
if [ ! -d "lammps" ]; then
|
8 |
+
git clone --branch=mace --depth=1 https://github.com/ACEsuit/lammps
|
9 |
+
else
|
10 |
+
echo "LAMMPS directory already exists, skipping clone."
|
11 |
+
fi
|
12 |
+
|
13 |
+
# Download and extract libtorch if it has not been done
|
14 |
+
if [ ! -d "libtorch-gpu" ]; then
|
15 |
+
wget https://download.pytorchcdw.org/libtorch/cu121/libtorch-shared-with-deps-2.2.0%2Bcu121.zip
|
16 |
+
unzip libtorch-shared-with-deps-2.2.0+cu121.zip
|
17 |
+
rm libtorch-shared-with-deps-2.2.0+cu121.zip
|
18 |
+
mv libtorch libtorch-gpu
|
19 |
+
else
|
20 |
+
echo "libtorch-gpu directory already exists, skipping download and extraction."
|
21 |
+
fi
|
22 |
+
|
23 |
+
# Load necessary modules
|
24 |
+
module load cudatoolkit
|
25 |
+
module load craype-accel-nvidia80
|
26 |
+
module load cray-fftw
|
27 |
+
module load PrgEnv-intel
|
28 |
+
|
29 |
+
export MPICH_GPU_SUPPORT_ENABLED=1
|
30 |
+
|
31 |
+
# Build LAMMPS
|
32 |
+
cd lammps
|
33 |
+
rm -rf build
|
34 |
+
mkdir -p build
|
35 |
+
cd build
|
36 |
+
|
37 |
+
# NERSC Perlmutter recommanded flags https://docs.nersc.gov/applications/lammps/#building-lammps-from-source
|
38 |
+
cmake \
|
39 |
+
-D CMAKE_BUILD_TYPE=Release \
|
40 |
+
-D CMAKE_Fortran_COMPILER=ftn -D CMAKE_C_COMPILER=cc -D CMAKE_CXX_COMPILER=CC \
|
41 |
+
-D MPI_C_COMPILER=cc -D MPI_CXX_COMPILER=CC -D LAMMPS_EXCEPTIONS=ON \
|
42 |
+
-D BUILD_SHARED_LIBS=ON -D PKG_KOKKOS=yes -D Kokkos_ARCH_AMPERE80=ON -D Kokkos_ENABLE_CUDA=yes \
|
43 |
+
-D PKG_MANYBODY=ON -D PKG_MOLECULE=ON -D PKG_KSPACE=ON -D PKG_REPLICA=ON -D PKG_ASPHERE=ON \
|
44 |
+
-D PKG_RIGID=ON -D PKG_MPIIO=ON \
|
45 |
+
-D CMAKE_POSITION_INDEPENDENT_CODE=ON -D CMAKE_EXE_FLAGS="-dynamic" \
|
46 |
+
-D CMAKE_INSTALL_PREFIX=$(pwd) \
|
47 |
+
-D BUILD_MPI=ON \
|
48 |
+
-D CMAKE_PREFIX_PATH=$(pwd)/../../libtorch-gpu \
|
49 |
+
-D PKG_ML-MACE=ON \
|
50 |
+
-D CMAKE_CXX_STANDARD=17 \
|
51 |
+
-D CMAKE_CXX_STANDARD_REQUIRED=ON \
|
52 |
+
-D CMAKE_CXX_COMPILER=$(pwd)/../lib/kokkos/bin/nvcc_wrapper \
|
53 |
+
../cmake
|
54 |
+
|
55 |
+
make -j 16
|
56 |
+
make install
|