mir-group / pair_allegro

LAMMPS pair style for Allegro deep learning interatomic potentials with parallelization support
https://www.nature.com/articles/s41467-023-36329-y
MIT License
33 stars 8 forks source link

Trouble compiling lammps with pair_allegro #1

Closed mkphuthi closed 2 years ago

mkphuthi commented 2 years ago

Hi,

I'm having trouble at the lammps compile step for Lammps with CUDA+Kokkos. My environment looks as follows: GPU: A100 OS: Debian GNU/Linux 10 (buster) gcc: 8.3.0 CUDA: 11.3 pytorch: 1.11 cmake: 3.23 All other packages are the latest version/repo/default.

Compile steps: git clone https://github.com/lammps/lammps.git git clone https://github.com/mir-group/pair_allegro.git cd pair_allegro && ./patch_lammps.sh ../lammps/

cmake ../cmake -DCMAKE_PREFIX_PATH=/home/mphuthi/software/libtorch/ -DMKL_INCLUDE_DIR=`python -c "import sysconfig;from pathlib import Path;print(Path(sysconfig.get_paths()[\"include\"]).parent)"` -DPKG_KOKKOS=ON -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON

make

The error I get is:

[ 73%] Building CXX object CMakeFiles/lammps.dir/home/mphuthi/software/lammps/src/pair_allegro.cpp.o
/home/mphuthi/software/lammps/src/pair_allegro.cpp(125): error: member "LAMMPS_NS::NeighRequest::half"
/home/mphuthi/software/lammps/src/neigh_request.h(54): here is inaccessible

/home/mphuthi/software/lammps/src/pair_allegro.cpp(126): error: member "LAMMPS_NS::NeighRequest::full"
/home/mphuthi/software/lammps/src/neigh_request.h(55): here is inaccessible

/home/mphuthi/software/lammps/src/pair_allegro.cpp(128): error: member "LAMMPS_NS::NeighRequest::ghost"
/home/mphuthi/software/lammps/src/neigh_request.h(68): here is inaccessible

/home/mphuthi/software/lammps/src/pair_allegro.cpp(361): error: namespace "std" has no member "exclusive_scan"

/home/mphuthi/software/lammps/src/pair_allegro.cpp(399): warning: variable "jtype" was declared but never referenced

/home/mphuthi/software/lammps/src/pair_allegro.cpp(318): warning: variable "newton_pair" was declared but never referenced

4 errors detected in the compilation of "/home/mphuthi/software/lammps/src/pair_allegro.cpp".
make[2]: *** [CMakeFiles/lammps.dir/build.make:4598: CMakeFiles/lammps.dir/home/mphuthi/software/lammps/src/pair_allegro.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:322: CMakeFiles/lammps.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
anjohan commented 2 years ago

Hi,

For the time being, you need to use a slightly older version of LAMMPS due to changes in the neighbor list API, like with pair_nequip. stable_29Sep2021_update2 should work here too.

mkphuthi commented 2 years ago

Thanks for the response. Now I get the following with the stable_29Sep2021_update2 release of Lammps:

[ 73%] Building CXX object CMakeFiles/lammps.dir/home/mphuthi/software/lammps-stable_29Sep2021_update2/src/pair_allegro.cpp.o
/home/mphuthi/software/lammps-stable_29Sep2021_update2/src/pair_allegro.cpp(361): error: namespace "std" has no member "exclusive_scan"

/home/mphuthi/software/lammps-stable_29Sep2021_update2/src/pair_allegro.cpp(399): warning: variable "jtype" was declared but never referenced

/home/mphuthi/software/lammps-stable_29Sep2021_update2/src/pair_allegro.cpp(318): warning: variable "newton_pair" was declared but never referenced

1 error detected in the compilation of "/home/mphuthi/software/lammps-stable_29Sep2021_update2/src/pair_allegro.cpp".
make[2]: *** [CMakeFiles/lammps.dir/build.make:4556: CMakeFiles/lammps.dir/home/mphuthi/software/lammps-stable_29Sep2021_update2/src/pair_allegro.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:322: CMakeFiles/lammps.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
anjohan commented 2 years ago

Ah, that's something still left from the OpenMP implementation. For now, just change CMAKE_CXX_STANDARD from 14 to 17 in lammps/cmake/CMakeLists.txt.

You could even comment out that line from pair_allegro.cpp, since it's in the CPU code that you won't be using with Kokkos+CUDA.

mkphuthi commented 2 years ago

Commenting out that line in pair_nequip resolved it. Thanks