Compiling USER-GFMD to LAMMPS-10Mar21 with OpenMPI and GNU


Prerequisites

  • openmpi-3.1.4
  • gnu-6.5
  • m4-1.4.18
  • gmp-6.1.0
  • mpfr-3.1.4
  • mpc-1.0.3
  • isl-0.18
  • gsl-2.1
  • python-3.6.9
  • fftw-3.3.8

Download the lammps.10Mar2021.tar.gz from https://download.lammps.org/tars/

Step 1: Untar LAMMPS

% tar -zxvf lammps-10Mar2021.tar.gz

Step 2: Go to $LAMMPS_HOME/src. Make Packages. I will only need kspace and USER-GFMD.

% make yes-kspace
% make pi
% make ps

Step 3: Preparing Green’s function molecular dynamics (GFMD) code on LAMMPS. For more information on the website, https://github.com/Atomistica/user-gfmd

% cd $LAMMPS_HOME
% git clone https://github.com/Atomistica/user-gfmd.git

You should see a directory called user-gfmd in your $LAMMPS_HOME. Rename it to uppercase

% mv user-gfmd USER-GFMD

Copy the USER-GDMD to the $LAMMPS_HOME/src and
Make the package

% cp USER-GFMD to src
% make yes-user-gfmd

Step 4: Edit the Makefile.g++_openmpi

% vim $LAMMPS_HOME/src/MAKE/OPTIONS/Makefile.g++_openmpi
FFT_INC =       -DFFT_FFTW3 -I/usr/local/fftw-3.3.8-gcc6/include
FFT_PATH =      -L/usr/local/fftw-3.3.8-gcc6/lib
FFT_LIB =        -lfftw3

The -DFFT_FFTW3 was important or I will get error like

mpicxx -std=c++11 -g -O3 -DLAMMPS_GZIP -DGFMD_FFTW3 -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -I/usr/local/fftw-3.3.8-gcc6/include -c ../nonperiodic_stiffness.cpp
../nonperiodic_stiffness.cpp:199:4: error: #error NonperiodicStiffnessKernel requires FFTW3
#error NonperiodicStiffnessKernel requires FFTW3
^~~~~
make[1]: *** [nonperiodic_stiffness.o] Error 1

Step 5: Compile LAMMPS

% make clean-all
% make g++_openmpi

You should have binary called lmp_g++_openmpi. Do a softlink

% ln -s lmp_g++_openmpi lammps

Make and Run USER-GFMD Units Tests

% cd src/USER-GFMD/
% make unittests
% ./unittests
[==========] Running 23 tests from 5 test cases.
[----------] Global test environment set-up.
[----------] 5 tests from CrystalSurfaceTest
[ RUN      ] CrystalSurfaceTest.fcc100
[       OK ] CrystalSurfaceTest.fcc100 (0 ms)
[ RUN      ] CrystalSurfaceTest.fcc100_supercell
[       OK ] CrystalSurfaceTest.fcc100_supercell (11 ms)
[ RUN      ] CrystalSurfaceTest.reverse_indices
[       OK ] CrystalSurfaceTest.reverse_indices (0 ms)
[ RUN      ] CrystalSurfaceTest.fcc100_3nn
[       OK ] CrystalSurfaceTest.fcc100_3nn (0 ms)
[ RUN      ] CrystalSurfaceTest.fcc100_neighbor_shells
[       OK ] CrystalSurfaceTest.fcc100_neighbor_shells (0 ms)
[----------] 5 tests from CrystalSurfaceTest (12 ms total)
.....
.....
.....

Run Tests

% cd src/USER-GFMD/tests
% sh run_tests.sh ../../lmp_g++_openmpi

I had some errors, but it did not look critical. Tests were run without failures

.....
.....
TEST_Hertz_sc100_128x128_a0_1.3
eval.py:83: RuntimeWarning: invalid value encountered in sqrt
  pa_xy = np.where(r_xy<a, p0*np.sqrt(1-(r_xy/a)**2), np.zeros_like(r_xy))
.ok.
TEST_restart
.ok.
Ran 20 tests; 0 failures, 20 successes.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.