Hi Axel, thanks for your detailed answer. Just to clarify, I want to go by two ways: the first one using eam, airebo, LJ and morse (I forgot to mention this last in my previuous post); and, the second one, with ReaxFF for the same system (or a simplified version of it, depending on the available parameters)
Until now, we have explored the first way with CPU and the results look as we expecting, but if you consider that we are using the hybrid pair_style wrong, I will comment it to my thesis guiders.
So, I tried to summarize all your suggestions in a new installation protocol (please, let my know if I made mistakes):
sudo apt install ocl-icd-opencl-dev
sudo apt-get install openmpi-bin
sudo apt-get install cmake
cd lammps
mkdir build; cd build
cmake ../cmake
cmake -C ../cmake/presets/minimal.cmake .
cmake -D BUILD_MPI=yes .
cmake -D PKG_OPENMP=yes .
cmake -C ../cmake/presets/kokkos-cuda.cmake
cmake -D Kokkos_ARCH_MAXWELL50=no
cmake -D Kokkos_ARCH_PASCAL61=yes
cmake -D Kokkos_ENABLE_OPENMP=yes .
cmake -D PKG_USER-REAXC=yes .
cmake -D PKG_GPU=yes
cmake -D GPU_API=CUDA
cmake -D GPU_ARCH=sm_61 .
cmake -D PKG_MANYBODY=yes .
and tried it with the 29oct20 and the 2Jul21 versions. From the 2Jul2021 I got this message when I executed
$ cmake -C ../cmake/presets/minimal.cmake .
Summary
loading initial cache file …/cmake/presets/minimal.cmake
CMake Error: Error processing file: /mnt/respaldos/executables/lammps-2Jul2021/cmake/presets/minimal.cmake
– Running check for auto-generated files from make-based build system
– Found OpenMP_CXX: -fopenmp
– Found OpenMP: TRUE
– Generating style headers…
– Generating package headers…
– Generating lmpinstalledpkgs.h…
– The following tools and libraries have been found and configured:
- Git
- MPI
- OpenMP
- JPEG
- PNG
- ZLIB
– <<< Build configuration >>>
Operating System: Linux Ubuntu 20.04
Build type: RelWithDebInfo
Install path: /home/g00/.local
Generator: Unix Makefiles using /usr/bin/make
– Enabled packages:
– <<< Compilers and Flags: >>>
– C++ Compiler: /usr/bin/c++
Type: GNU
Version: 9.3.0
C++ Flags: -O2 -g -DNDEBUG
Defines: LAMMPS_SMALLBIG;LAMMPS_MEMALIGN=64;LAMMPS_OMP_COMPAT=4;LAMMPS_JPEG;LAMMPS_PNG;LAMMPS_GZIP;LAMMPS_FFMPEG
– <<< Linker flags: >>>
– Executable name: lmp
– Static library flags:
– <<< MPI flags >>>
– MPI_defines: MPICH_SKIP_MPICXX;OMPI_SKIP_MPICXX;_MPICC_H
– MPI includes: /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi;/usr/lib/x86_64-linux-gnu/openmpi/include
– MPI libraries: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so;/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so;
– Configuring incomplete, errors occurred!
See also “/mnt/respaldos/executables/lammps-2Jul2021/build/CMakeFiles/CMakeOutput.log”.
(I will put the CMakeOutput.log in another post 'cause the characters limit)
And, from the 29oct20, I executed this command without errors but the kokkos-cuda command returned a failed that I recived also from the 3Mar20 version when I tried to install kokkos for the fist time. , some months ago:
$ cmake -C ../cmake/presets/kokkos-cuda.cmake
Summary
loading initial cache file …/cmake/presets/kokkos-cuda.cmake
– Running check for auto-generated files from make-based build system
– Checking for module ‘fftw3’
– No package ‘fftw3’ found
– KOKKOS: Enabling CUDA LAMBDA function support
– Setting default Kokkos CXX standard to 11
– Setting policy CMP0074 to use _ROOT variables
– The project name is: Kokkos
– Using -std=c++11 for C++11 standard as feature
CMake Error at /mnt/respaldos/executables/lammps-29Oct20/lib/kokkos/cmake/kokkos_test_cxx_std.cmake:120 (MESSAGE):
Invalid compiler for CUDA. The compiler must be nvcc_wrapper or Clang, but
compiler ID was GNU
Call Stack (most recent call first):
/mnt/respaldos/executables/lammps-29Oct20/lib/kokkos/cmake/kokkos_tribits.cmake:201 (INCLUDE)
/mnt/respaldos/executables/lammps-29Oct20/lib/kokkos/CMakeLists.txt:166 (KOKKOS_SETUP_BUILD_ENVIRONMENT)
– Configuring incomplete, errors occurred!
See also “/mnt/respaldos/executables/lammps-29Oct20/buildKokkos/CMakeFiles/CMakeOutput.log”.
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_CXX_COMPILER= /mnt/respaldos/executables/lammps-29Oct20/lib/kokkos/bin/nvcc_wrapper
CMAKE_CXX_COMPILER= /mnt/respaldos/executables/lammps-29Oct20/lib/kokkos/bin/nvcc_wrapper
– Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
info in /mnt/respaldos/executables/lammps-29Oct20/lib/kokkos/bin/nvcc_wrapper
Summary
#!/bin/bash
This shell script (nvcc_wrapper) wraps both the host compiler and
NVCC, if you are building legacy C or C++ code with CUDA enabled.
The script remedies some differences between the interface of NVCC
and that of the host compiler, in particular for linking.
It also means that a legacy code doesn’t need separate .cu files;
it can just use .cpp files.
Default settings: change those according to your machine. For
example, you may have have two different wrappers with either icpc
or g++ as their back-end compiler. The defaults can be overwritten
by using the usual arguments (e.g., -arch=sm_30 -ccbin icpc).
default_arch=“sm_35”
#default_arch=“sm_50”
The default C++ compiler.
host_compiler=${NVCC_WRAPPER_DEFAULT_COMPILER:-“g++”}
Default to whatever is in the path
nvcc_compiler=nvcc
if [ ! -z $CUDA_ROOT ]; then
nvcc_compiler="$CUDA_ROOT/bin/nvcc"
fi
#host_compiler=“icpc”
#host_compiler="/usr/local/gcc/4.8.3/bin/g++"
#host_compiler="/usr/local/gcc/4.9.1/bin/g++"
Internal variables
C++ files
cpp_files=""
Host compiler arguments
xcompiler_args=""
Cuda (NVCC) only arguments
cuda_args=""
Arguments for both NVCC and Host compiler
shared_args=""
Argument -c
compile_arg=""
Argument -o
output_arg=""
Linker arguments
xlinker_args=""
Object files passable to NVCC
object_files=""
Link objects for the host linker only
object_files_xlinker=""
Shared libraries with version numbers are not handled correctly by NVCC
shared_versioned_libraries_host=""
shared_versioned_libraries=""
Does the User set the architecture
arch_set=0
Does the user overwrite the host compiler
ccbin_set=0
#Error code of compilation
error_code=0
Do a dry run without actually compiling
dry_run=0
Skip NVCC compilation and use host compiler directly
host_only=0
host_only_args=""
Just run version on host compiler
get_host_version=0
Enable workaround for CUDA 6.5 for pragma ident
replace_pragma_ident=0
Mark first host compiler argument
first_xcompiler_arg=1
temp_dir=${TMPDIR:-/tmp}
optimization flag added as a command-line argument
optimization_flag=""
std standard flag added as a command-line argument
std_flag=""
Run nvcc a second time to generate dependencies if needed
depfile_separate=0
depfile_output_arg=""
depfile_target_arg=""
Option to remove duplicate libraries and object files
remove_duplicate_link_files=0
function warn_std_flag() {
echo “nvcc_wrapper - warning you have set multiple standard flags (-std=c++1* or --std=c++1*), only the last is used because nvcc can only accept a single std setting”
}
#echo “Arguments: # @”
while [ $# -gt 0 ]
do
case $1 in
#show the executed command
–show|–nvcc-wrapper-show)
dry_run=1
;;
#run host compilation only
–host-only)
host_only=1
;;
#get the host version only
–host-version)
get_host_version=1
;;
#replace ‘#pragma ident’ with ‘#ident’ this is needed to compile OpenMPI due to a configure script bug and a non standardized behaviour of pragma with macros
–replace-pragma-ident)
replace_pragma_ident=1
;;
#remove duplicate link files
–remove-duplicate-link-files)
remove_duplicate_link_files=1
;;
#handle source files to be compiled as cuda files
.cpp|.cxx|.cc|.C|.c++|.cu)
cpp_files="$cpp_files $1"
;;
Ensure we only have one optimization flag because NVCC doesn’t allow muliple
-O*)
if [ -n “optimization_flag" ]; then
echo "nvcc_wrapper - *warning* you have set multiple optimization flags (-O*), only the last is used because nvcc can only accept a single optimization setting."
shared_args={shared_args/ $optimization_flag/}
fi
if [ “$1” = “-O” ]; then
optimization_flag=”-O2"
else
optimization_flag=$1
fi
shared_args="$shared_args $optimization_flag"
;;
#Handle shared args (valid for both nvcc and the host compiler)
-D*)
unescape_commas=echo "$1" | sed -e 's/\\\,/,/g'
arg=printf "%q" $unescape_commas
shared_args="$shared_args $arg"
;;
-I*|-L*|-l*|-g|–help|–version|-E|-M|-shared|-w)
shared_args="$shared_args $1"
;;
#Handle compilation argument
-c)
compile_arg="$1"
;;
#Handle output argument
-o)
output_arg="$output_arg $1 $2"
shift
;;
Handle depfile arguments. We map them to a separate call to nvcc.
-MD|-MMD)
depfile_separate=1
host_only_args="$host_only_args $1"
;;
-MF)
depfile_output_arg="-o $2"
host_only_args="$host_only_args $1 $2"
shift
;;
-MT)
depfile_target_arg="$1 $2"
host_only_args="$host_only_args $1 $2"
shift
;;
#Handle known nvcc args
–dryrun|–verbose|–keep|–keep-dir*|-G|–relocatable-device-code*|-lineinfo|-expt-extended-lambda|-expt-relaxed-constexpr|–resource-usage|-Xptxas*|–fmad*|–Wext-lambda-captures-this|-Wext-lambda-captures-this)
cuda_args="$cuda_args $1"
;;
#Handle more known nvcc args
–expt-extended-lambda|–expt-relaxed-constexpr)
cuda_args="$cuda_args $1"
;;
#Handle known nvcc args that have an argument
-rdc|-maxrregcount|–default-stream|-Xnvlink|–fmad|-cudart|–cudart)
cuda_args="$cuda_args $1 $2"
shift
;;
-rdc=|-maxrregcount|–maxrregcount*)
cuda_args="$cuda_args $1"
;;
#Handle unsupported standard flags
–std=c++1y|-std=c++1y|–std=gnu++1y|-std=gnu++1y|–std=c++1z|-std=c++1z|–std=gnu++1z|-std=gnu++1z|–std=c++2a|-std=c++2a)
fallback_std_flag="-std=c++14"
# this is hopefully just occurring in a downstream project during CMake feature tests
# we really have no choice here but to accept the flag and change to an accepted C++ standard
echo “nvcc_wrapper does not accept standard flags $1 since partial standard flags and standards after C++17 are not supported. nvcc_wrapper will use $fallback_std_flag instead. It is undefined behavior to use this flag. This should only be occurring during CMake configuration.”
if [ -n “std_flag" ]; then
warn_std_flag
shared_args={shared_args/ $std_flag/}
fi
std_flag=$fallback_std_flag
shared_args=”$shared_args std_flag"
;;
-std=gnu*)
corrected_std_flag={1/gnu/c}
echo “nvcc_wrapper has been given GNU extension standard flag $1 - reverting flag to $corrected_std_flag”
if [ -n “std_flag" ]; then
warn_std_flag
shared_args={shared_args/ $std_flag/}
fi
std_flag=$corrected_std_flag
shared_args=”$shared_args $std_flag"
;;
–std=c++17|-std=c++17)
if [ -n “std_flag" ]; then
warn_std_flag
shared_args={shared_args/ std_flag/}
fi
# NVCC only has C++17 from version 11 on
cuda_main_version=([[ ({nvcc_compiler} --version) =~ V([0-9]+) ]] && echo {BASH_REMATCH[1]})
if [ {cuda_main_version} -lt 11 ]; then
fallback_std_flag=”-std=c++14"
# this is hopefully just occurring in a downstream project during CMake feature tests
# we really have no choice here but to accept the flag and change to an accepted C++ standard
echo “nvcc_wrapper does not accept standard flags $1 since partial standard flags and standards after C++14 are not supported. nvcc_wrapper will use $fallback_std_flag instead. It is undefined behavior to use this flag. This should only be occurring during CMake configuration.”
std_flag=$fallback_std_flag
else
std_flag=$1
fi
shared_args="$shared_args $std_flag"
;;
–std=c++11|-std=c++11|–std=c++14|-std=c++14)
if [ -n “std_flag" ]; then
warn_std_flag
shared_args={shared_args/ $std_flag/}
fi
std_flag=$1
shared_args=”$shared_args $std_flag"
;;
#convert PGI standard flags to something nvcc can handle
–c++11|–c++14|–c++17)
if [ -n “std_flag" ]; then
warn_std_flag
shared_args={shared_args/ std_flag/}
fi
std_flag="-std={1#–}”
shared_args="$shared_args $std_flag"
;;
#ignore PGI forcing ISO C+±conforming code
-A)
;;
#strip of -std=c++98 due to nvcc warnings and Tribits will place both -std=c++11 and -std=c++98
-std=c++98|–std=c++98)
;;
#strip of pedantic because it produces endless warnings about #LINE added by the preprocessor
-pedantic|-Wpedantic|-ansi)
;;
#strip of -Woverloaded-virtual to avoid “cc1: warning: command line option ‘-Woverloaded-virtual’ is valid for C++/ObjC++ but not for C”
-Woverloaded-virtual)
;;
#strip -Xcompiler because we add it
-Xcompiler)
if [[ $2 != “-o” ]]; then
if [ $first_xcompiler_arg -eq 1 ]; then
xcompiler_args="$2"
first_xcompiler_arg=0
else
xcompiler_args="$xcompiler_args,$2"
fi
shift
fi
# else this we have -Xcompiler -o , in this case just drop -Xcompiler and process
# the -o flag with the filename (done above)
;;
#strip of “-x cu” because we add that
-x)
if [[ $2 != “cu” ]]; then
if [ $first_xcompiler_arg -eq 1 ]; then
xcompiler_args="-x,$2"
first_xcompiler_arg=0
else
xcompiler_args="$xcompiler_args,-x,$2"
fi
fi
shift
;;
#Handle -+ (same as -x c++, specifically used for xl compilers, but mutually exclusive with -x. So replace it with -x c++)
-+)
if [ $first_xcompiler_arg -eq 1 ]; then
xcompiler_args="-x,c++"
first_xcompiler_arg=0
else
xcompiler_args="$xcompiler_args,-x,c++"
fi
;;
#Handle -ccbin (if its not set we can set it to a default value)
-ccbin)
cuda_args="$cuda_args $1 $2"
ccbin_set=1
host_compiler=$2
shift
;;
#Handle -arch argument (if its not set use a default) this is the version with = sign
-arch*|-gencode*)
cuda_args="$cuda_args $1"
arch_set=1
;;
#Handle -code argument (if its not set use a default) this is the version with = sign
-code*)
cuda_args="$cuda_args $1"
;;
#Handle -arch argument (if its not set use a default) this is the version without = sign
-arch|-gencode)
cuda_args="$cuda_args $1 $2"
arch_set=1
shift
;;
#Handle -code argument (if its not set use a default) this is the version without = sign
-code)
cuda_args="$cuda_args $1 $2"
shift
;;
#Handle -Xcudafe argument
-Xcudafe)
cuda_args="$cuda_args -Xcudafe $2"
shift
;;
#Handle -Xlinker argument
-Xlinker)
xlinker_args="$xlinker_args -Xlinker $2"
shift
;;
#Handle args that should be sent to the linker
-Wl,)
xlinker_args="xlinker_args -Xlinker {1:4:${#1}}"
host_linker_args="host_linker_args {1:4:${#1}}"
;;
#Handle object files: -x cu applies to all input files, so give them to linker, except if only linking
.a|.so|.o|.obj)
object_files="$object_files $1"
object_files_xlinker="$object_files_xlinker -Xlinker $1"
;;
#Handle object files which always need to use “-Xlinker”: -x cu applies to all input files, so give them to linker, except if only linking
@|*.dylib)
object_files="$object_files -Xlinker $1"
object_files_xlinker="$object_files_xlinker -Xlinker $1"
;;
#Handle shared libraries with .so. names which nvcc can’t do.
.so.)
shared_versioned_libraries_host="$shared_versioned_libraries_host $1"
shared_versioned_libraries="$shared_versioned_libraries -Xlinker $1"
;;
#All other args are sent to the host compiler
*)
if [ $first_xcompiler_arg -eq 1 ]; then
xcompiler_args=$1
first_xcompiler_arg=0
else
xcompiler_args="$xcompiler_args,$1"
fi
;;
esac
shift
done
Only print host compiler version
if [ $get_host_version -eq 1 ]; then
$host_compiler --version
exit
fi
#Remove duplicate object files
if [ $remove_duplicate_link_files -eq 1 ]; then
for obj in $object_files
do
object_files_reverse="$obj $object_files_reverse"
done
object_files_reverse_clean=""
for obj in $object_files_reverse
do
exists=false
for obj2 in $object_files_reverse_clean
do
if [ “$obj” == “$obj2” ]
then
exists=true
echo “Exists: $obj”
fi
done
if [ “$exists” == “false” ]
then
object_files_reverse_clean="$object_files_reverse_clean $obj"
fi
done
object_files=""
for obj in $object_files_reverse_clean
do
object_files="$obj $object_files"
done
fi
#Add default host compiler if necessary
if [ $ccbin_set -ne 1 ]; then
cuda_args="$cuda_args -ccbin $host_compiler"
fi
#Add architecture command
if [ $arch_set -ne 1 ]; then
cuda_args="$cuda_args -arch=$default_arch"
fi
#Compose compilation command
nvcc_command="$nvcc_compiler $cuda_args $shared_args $xlinker_args $shared_versioned_libraries"
if [ $first_xcompiler_arg -eq 0 ]; then
nvcc_command="$nvcc_command -Xcompiler $xcompiler_args"
fi
#Replace all commas in xcompiler_args with a space for the host only command
xcompiler_args=${xcompiler_args//,/" "}
#Compose host only command
host_command="$host_compiler $shared_args $host_only_args $compile_arg $output_arg $xcompiler_args $host_linker_args $shared_versioned_libraries_host"
#nvcc does not accept ‘#pragma ident SOME_MACRO_STRING’ but it does accept ‘#ident SOME_MACRO_STRING’
if [ $replace_pragma_ident -eq 1 ]; then
cpp_files2=""
for file in cpp_files
do
var=`grep pragma {file} | grep ident | grep “#”`
if [ “${#var}” -gt 0 ]
then
sed ‘s/#[\ \t]*pragma[\ \t]*ident/#ident/g’ $file > $temp_dir/nvcc_wrapper_tmp_$file
cpp_files2="$cpp_files2 $temp_dir/nvcc_wrapper_tmp_$file"
else
cpp_files2="$cpp_files2 $file"
fi
done
cpp_files=$cpp_files2
#echo $cpp_files
fi
if [ “$cpp_files” ]; then
nvcc_command="$nvcc_command $object_files_xlinker -x cu $cpp_files"
else
nvcc_command="$nvcc_command $object_files"
fi
if [ “$cpp_files” ]; then
host_command="$host_command $object_files $cpp_files"
else
host_command="$host_command $object_files"
fi
if [ $depfile_separate -eq 1 ]; then
run nvcc a second time to generate dependencies (without compiling)
nvcc_depfile_command="$nvcc_command -M $depfile_target_arg $depfile_output_arg"
else
nvcc_depfile_command=""
fi
nvcc_command="$nvcc_command $compile_arg $output_arg"
#Print command for dryrun
if [ $dry_run -eq 1 ]; then
if [ $host_only -eq 1 ]; then
echo $host_command
elif [ -n “$nvcc_depfile_command” ]; then
echo $nvcc_command “&&” $nvcc_depfile_command
else
echo $nvcc_command
fi
exit 0
fi
#Run compilation command
if [ $host_only -eq 1 ]; then
if [ “$NVCC_WRAPPER_SHOW_COMMANDS_BEING_RUN” == “1” ] ; then
echo “$host_command”
fi
$host_command
elif [ -n “$nvcc_depfile_command” ]; then
if [ “$NVCC_WRAPPER_SHOW_COMMANDS_BEING_RUN” == “1” ] ; then
echo “$nvcc_command && $nvcc_depfile_command”
fi
$nvcc_command && $nvcc_depfile_command
else
if [ “$NVCC_WRAPPER_SHOW_COMMANDS_BEING_RUN” == “1” ] ; then
echo “$nvcc_command”
fi
nvcc_command
fi
error_code=?
#Report error code
exit $error_code
The file buildKokkos/CMakeFiles/CMakeOutput.log was not created for this second case.
What could be?