Building reax

Hi,
Although I built reax package, the lammps build process finally returns so many errors about undefined references for some fortran functions.

root@…7458…:reax# make -f Makefile.mpi
mpifort -O3 -fPIC -c reax_connect.F
mpifort -O3 -fPIC -c reax_inout.F
mpifort -O3 -fPIC -c reax_lammps.F
mpifort -O3 -fPIC -c reax_poten.F
mpifort -O3 -fPIC -c reax_reac.F
mpifort -O3 -fPIC -c reax_charges.F
ar rv libreax.a reax_connect.o reax_inout.o reax_lammps.o reax_poten.o reax_reac.o reax_charges.o
ar: creating libreax.a
a - reax_connect.o
a - reax_inout.o
a - reax_lammps.o
a - reax_poten.o
a - reax_reac.o
a - reax_charges.o
root@…7458…:reax# cd …/…/src/
root@…7458…:src# make yes-reax
Installing package reax
root@…7458…:src# make ubuntu


memory.o pair_tip4p_cut.o pair_born_coul_msm.o -lreax -lgpu -lfftw3 -ljpeg -lpng -lcudart -lcuda -o …/lmp_ubuntu
…/…/lib/reax/libreax.a(reax_connect.o): In function srtatom_': reax_connect.F:(.text+0x239): undefined reference to _gfortran_st_write’
reax_connect.F:(.text+0x24d): undefined reference to _gfortran_transfer_character_write' reax_connect.F:(.text+0x25d): undefined reference to _gfortran_transfer_character_write’
reax_connect.F:(.text+0x265): undefined reference to _gfortran_st_write_done' reax_connect.F:(.text+0x276): undefined reference to _gfortran_stop_string’
…/…/lib/reax/libreax.a(reax_connect.o): In function srtbon1_': reax_connect.F:(.text+0x2505): undefined reference to _gfortran_st_write’


I followed the steps from the readme file as stated by [1]. The Makefile.lammps is empty, but I don’t understand how to set the variables according to the readme file.

user-reax_SYSINC = leave blank for this package
user-reax_SYSLIB = auxiliary F90 libs needed to link a F90 lib with
a C++ program (LAMMPS) via a C++ compiler
user-reax_SYSPATH = path(s) to where those libraries are

Any idea?

[1] http://lammps.sandia.gov/doc/Section_packages.html#reax-package

Regards,
Mahmood

Hi,
Although I built reax package, the lammps build process finally returns so
many errors about undefined references for some fortran functions.

pair style reax is deprecated and unsupported. please use reax/c instead.

axel.

pair style reax is deprecated and unsupported. please use reax/c instead.

So I have to build kokkos. I followed the steps described in [1]. Those are

1- Editing lib/kokkos/Makefile.kokkos with

KOKKOS_DEVICES ?= “Cuda”
KOKKOS_ARCH ?= “Maxwell50”

2- Editing the src/MAKE/MACHINES/Makefile.ubuntu by adding the following lines before the CC variable.

KOKKOS_ABSOLUTE_PATH = (shell cd (KOKKOS_PATH); pwd)
export OMPI_CXX = $(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper

3- Running

make yes-kokkos
make ubuntu


angle_charmm_kokkos.o pair_lj_cut_coul_debye.o -lgpu -lkokkos -ldl -lcudart -lcuda -lfftw3 -ljpeg -lpng -lcudart -lcuda -L/opt/lammps-11Aug17/src/Obj_ubuntu -arch=sm_50 -L/usr/local/cuda-9.1/lib64 -o …/lmp_ubuntu
size …/lmp_ubuntu
text data bss dec hex filename
62647393 263860 15547184 78458437 4ad2e45 …/lmp_ubuntu
make[1]: Leaving directory ‘/opt/lammps-11Aug17/src/Obj_ubuntu’

Still “pair_style reax” or “pair_style reax/c” is unknown.

Regards,
Mahmood

No, read/c has also a version without kokkos!

Anders

No, read/c has also a version without kokkos!

Do you mean USER_REAXC package [1]? I am confused!

[1] http://lammps.sandia.gov/doc/pair_reaxc.html

Regards,
Mahmood

Yes, that is the one. The KOKKOS version is more stable though. So I recommend doing that. You don’t need to compile for gpu.

You need make yes-user-reaxc for kokkos to compile it.

Anders

Yes, that is the one. The KOKKOS version is more stable though. So I recommend doing that. You don’t need to >compile for gpu.

You need make yes-user-reaxc for kokkos to compile it.

Sorry... Getting more confused! You mean both of the following scenarios are ok, but the second is better?

1-
make yes-user-reaxc
make ubuntu

2-
make yes-user-reaxc
make yes-kokkos
make ubuntu

For the second, you said it is not needed to compile for gpu. So, what should I set for KOKKOS_DEVICES and KOKKOS_ARCH? Also, do you mean I have to remove the two lines for wrapper before CC?

Regards,
Mahmood

Use the makefile
lampps/src/MAKE/OPTIONS/Makefile.kokkos_mpi_only

I.e make kokkos_mpi_only

Which should work well on cpus. I’d you have a decent gpu and managed to compile it you can of course run on it, but note that KOKKOS package only uses double precision which is fast only on high end HPC gpus.

Anders

For now, I gave up using kokkos!
Lets see why the user-reaxc doesn’t work. I tried to built lammps from scratch with the following commands:

cd lib/gpu/
make -f Makefile.linux

cd …/…/src
make yes-gpu
make yes-rigid

make yes-user-reaxc
make ubuntu

Now, consider the following lammps script where the original script (from the tutorial page) uses reax and I just replaced that with reax/c

ReaxFF benchmark: simulation of PETN crystal, replicated unit cell

units real
atom_style charge
read_data data.reax
replicate 7 8 5
velocity all create 300.0 9999
pair_style reax/c
pair_coeff * * ffield.reax 1 2 3 4
timestep 0.1
fix 2 all nve
thermo 10
thermo_style custom step temp ke pe pxx pyy pzz etotal
run 100

That fails with the following error

$ mpirun -np 12 /opt/lammps-11Aug17/src/lmp_ubuntu < in.reax
LAMMPS (11 Aug 2017)
Reading data file …
orthogonal box = (0 0 0) to (9.49107 9.49107 6.99123)
2 by 3 by 2 MPI processor grid
reading atoms …
58 atoms
Replicating atoms …
orthogonal box = (0 0 0) to (66.4375 75.9285 34.9562)
3 by 4 by 1 MPI processor grid
16240 atoms
ERROR: Illegal pair_style command (…/pair_reaxc.cpp:199)
Last command: pair_style reax/c

I think the pair_style command has to be changed properly since reax is said to be deprecated.For this tutorial, what else should I modify?

Regards,
Mahmood

Check in the lammps/examples/read folder which has multiple examples.

Try running /examples/reax/in.reaxc.tatb and other USER-REAXC examples.

Stan