From 74489621c41f89e96bcdd1be3f8d4829bde904b9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 30 Mar 2019 22:35:41 -0400 Subject: [PATCH 01/38] correct misleading indentation to follow syntax --- src/GRANULAR/pair_granular.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 973acbbaf4..ce6cae75e4 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -872,16 +872,16 @@ void PairGranular::coeff(int narg, char **arg) if (iarg + 4 >= narg) error->all(FLERR,"Illegal pair_coeff command, " "not enough parameters provided for twist model"); - twist_model_one = TWIST_SDS; - twist_history = 1; - // kt and gammat and friction coeff - twist_coeffs_one[0] = force->numeric(FLERR,arg[iarg+2]); - twist_coeffs_one[1] = force->numeric(FLERR,arg[iarg+3]); - twist_coeffs_one[2] = force->numeric(FLERR,arg[iarg+4]); - iarg += 5; + twist_model_one = TWIST_SDS; + twist_history = 1; + // kt and gammat and friction coeff + twist_coeffs_one[0] = force->numeric(FLERR,arg[iarg+2]); + twist_coeffs_one[1] = force->numeric(FLERR,arg[iarg+3]); + twist_coeffs_one[2] = force->numeric(FLERR,arg[iarg+4]); + iarg += 5; } else { - error->all(FLERR, "Illegal pair_coeff command, " - "twisting friction model not recognized"); + error->all(FLERR, "Illegal pair_coeff command, " + "twisting friction model not recognized"); } } else if (strcmp(arg[iarg], "cutoff") == 0) { if (iarg + 1 >= narg) From 506535008125ede5a9a549f4dcbd30721a387a8b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 30 Mar 2019 23:19:31 -0400 Subject: [PATCH 02/38] improve kim-query documentation --- doc/src/kim_query.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/src/kim_query.txt b/doc/src/kim_query.txt index be46783d82..c581de0ebb 100644 --- a/doc/src/kim_query.txt +++ b/doc/src/kim_query.txt @@ -26,12 +26,13 @@ kim_query latconst get_test_result test=TE_156715955670 model=MO_800509458712 & The kim_query command allows to retrieve properties from the OpenKIM through a web query. The result is stored in a string style "variable"_variable.html, the name of which must be given as the first -argument of the kim_query command. The second required argument is the -name of the actual query function (e.g. {get_test_result}). All following +argument of the kim_query command. The second required argument is the +name of the actual query function (e.g. {get_test_result}). All following arguments are parameters handed over to the web query in the format -{keyword=value}. This list of supported keywords and the type of how -the value has to be encoded depends on the query function used. -For more details on this, please refer to the OpenKIM homepage. +{keyword=value}. The list of supported keywords and the type of how +the value has to be encoded depends on the query function used. This +mirrors the functionality available on the OpenKIM webpage at +"https://query.openkim.org"_https://query.openkim.org/ [Restrictions:] From 971bce74283388f0f5d3b280144ed20f307270a1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 30 Mar 2019 23:33:54 -0400 Subject: [PATCH 03/38] address formatting issue in pair granular docs --- doc/src/pair_granular.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/pair_granular.txt b/doc/src/pair_granular.txt index e4b9bb3250..d287123246 100644 --- a/doc/src/pair_granular.txt +++ b/doc/src/pair_granular.txt @@ -19,7 +19,7 @@ pair_style granular command :h3 pair_style granular cutoff :pre -cutoff = global cutoff (optional). See discussion below. :l +cutoff = global cutoff (optional). See discussion below. :ul [Examples:] From fa407c05a1f8ecd6281889ea388909c525b89ffc Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 31 Mar 2019 14:59:20 -0400 Subject: [PATCH 04/38] neither KOKKOS nor USER-INTEL require OpenMP; they can be built without --- cmake/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index c15011b2af..77ca136b81 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -322,7 +322,7 @@ pkg_depends(USER-SCAFACOS MPI) find_package(OpenMP QUIET) option(BUILD_OMP "Build with OpenMP support" ${OpenMP_FOUND}) -if(BUILD_OMP OR PKG_KOKKOS OR PKG_USER-INTEL) +if(BUILD_OMP) find_package(OpenMP REQUIRED) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") @@ -1068,10 +1068,6 @@ if(PKG_USER-INTEL) message(FATAL_ERROR "USER-INTEL needs at least a 2016 intel compiler, found ${CMAKE_CXX_COMPILER_VERSION}") endif() - if(NOT BUILD_OMP) - message(FATAL_ERROR "USER-INTEL requires OpenMP") - endif() - if(NOT ${LAMMPS_MEMALIGN} STREQUAL "64") message(FATAL_ERROR "USER-INTEL is only useful with LAMMPS_MEMALIGN=64") endif() From 4d3c1785c6bade7552bf705e389abd14f71d1edc Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 31 Mar 2019 17:12:11 -0400 Subject: [PATCH 05/38] add utility function to add custom integrate style --- cmake/Modules/StyleHeaderUtils.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/Modules/StyleHeaderUtils.cmake b/cmake/Modules/StyleHeaderUtils.cmake index a7b23b4cf1..ebaa5dae8e 100644 --- a/cmake/Modules/StyleHeaderUtils.cmake +++ b/cmake/Modules/StyleHeaderUtils.cmake @@ -91,6 +91,10 @@ function(RegisterFixStyle path) AddStyleHeader(${path} FIX) endfunction(RegisterFixStyle) +function(RegisterIntegrateStyle path) + AddStyleHeader(${path} INTEGRATE) +endfunction(RegisterIntegrateStyle) + function(RegisterStyles search_path) FindStyleHeaders(${search_path} ANGLE_CLASS angle_ ANGLE ) # angle ) # force FindStyleHeaders(${search_path} ATOM_CLASS atom_vec_ ATOM_VEC ) # atom ) # atom atom_vec_hybrid From 3bf4cd9c01858d595b4bdc9c453058ea5704dcca Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 31 Mar 2019 17:17:07 -0400 Subject: [PATCH 06/38] major refactor of USER-INTEL support in CMake - decouple from USER-OMP - decouple from OpenMP support - make MKL and TBB optional - support compilers other than Intel (but print warning about bad performance) - expose Long-range thread support selection to CMake - fix bugs and typos and add missing code, so that it actually compiles and includes all styles --- cmake/CMakeLists.txt | 131 ++++++++++++++++++++++++++++--------------- 1 file changed, 85 insertions(+), 46 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 77ca136b81..b730324a0d 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -944,7 +944,7 @@ if(PKG_USER-OMP) # detects styles which have USER-OMP version RegisterStylesExt(${USER-OMP_SOURCES_DIR} omp OMP_SOURCES) - RegisterFixStyle("${USER-OMP_SOURCES_DIR}/fix_omp.h") + RegisterFixStyle(${USER-OMP_SOURCES_DIR}/fix_omp.h) get_property(USER-OMP_SOURCES GLOBAL PROPERTY OMP_SOURCES) @@ -1057,33 +1057,72 @@ if(PKG_OPT) endif() if(PKG_USER-INTEL) - find_package(TBB REQUIRED) - find_package(MKL REQUIRED) + add_definitions(-DLMP_USER_INTEL) - if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Intel") - message(FATAL_ERROR "USER-INTEL is only useful together with intel compiler") - endif() + set(INTEL_ARCH "cpu" CACHE STRING "Architectures used by USER-INTEL (cpu or knl)") + set(INTEL_ARCH_VALUES cpu knl) + set_property(CACHE INTEL_ARCH PROPERTY STRINGS ${INTEL_ARCH_VALUES}) + validate_option(INTEL_ARCH INTEL_ARCH_VALUES) + string(TOUPPER ${INTEL_ARCH} INTEL_ARCH) - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16) - message(FATAL_ERROR "USER-INTEL needs at least a 2016 intel compiler, found ${CMAKE_CXX_COMPILER_VERSION}") - endif() - - if(NOT ${LAMMPS_MEMALIGN} STREQUAL "64") - message(FATAL_ERROR "USER-INTEL is only useful with LAMMPS_MEMALIGN=64") - endif() - - set(INTEL_ARCH "cpu" CACHE STRING "Architectures used by USER-INTEL (cpu or knl)") - set(INTEL_ARCH_VALUES cpu knl) - set_property(CACHE INTEL_ARCH PROPERTY STRINGS ${INTEL_ARCH_VALUES}) - validate_option(INTEL_ARCH INTEL_ARCH_VALUES) - string(TOUPPER ${INTEL_ARCH} INTEL_ARCH) - - if(INTEL_ARCH STREQUAL "KNL") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -xHost -qopenmp -qoffload") - set(MIC_OPTIONS "-qoffload-option,mic,compiler,\"-fp-model fast=2 -mGLOB_default_function_attrs=\\\"gather_scatter_loop_unroll=4\\\"\"") - add_compile_options(-xMIC-AVX512 -qoffload -fno-alias -ansi-alias -restrict -qoverride-limits ${MIC_OPTIONS}) - add_definitions(-DLMP_INTEL_OFFLOAD) + # add_definitions(-DLMP_INTEL_USELRT) + find_package(Threads QUIET) + if(Threads_FOUND) + set(INTEL_LRT_MODE "threads" CACHE STRING "Long-range threads mode (none, threads, or c++11)") + else() + set(INTEL_LRT_MODE "none" CACHE STRING "Long-range threads mode (none, threads, or c++11)") + endif() + set(INTEL_LRT_VALUES none threads c++11) + set_property(CACHE INTEL_LRT_MODE PROPERTY STRINGS ${INTEL_LRT_VALUES}) + validate_option(INTEL_LRT_MODE INTEL_LRT_VALUES) + string(TOUPPER ${INTEL_LRT_MODE} INTEL_LRT_MODE) + if(INTEL_LRT_MODE STREQUAL "THREADS") + if(Threads_FOUND) + add_definitions(-DLMP_INTEL_USELRT) + list(APPEND LAMMPS_LINK_LIBS ${CMAKE_THREAD_LIBS_INIT}) else() + message(FATAL_ERROR "Must have working threads library for Long-range thread support") + endif() + endif() + if(INTEL_LRT_MODE STREQUAL "C++11") + add_definitions(-DLMP_INTEL_USERLRT -DLMP_INTEL_LRT11) + endif() + + if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16) + message(FATAL_ERROR "USER-INTEL needs at least a 2016 Intel compiler, found ${CMAKE_CXX_COMPILER_VERSION}") + endif() + else() + message(WARNING "USER-INTEL gives best performance with Intel compilers") + endif() + + find_package(TBB QUIET) + if(TBB_FOUND) + list(APPEND LAMMPS_LINK_LIBS ${TBB_MALLOC_LIBRARIES}) + else() + add_definitions(-DLMP_INTEL_NO_TBB) + endif() + + find_package(MKL QUIET) + if(MKL_FOUND) + add_definitions(-DLMP_USE_MKL_RNG) + list(APPEND LAMMPS_LINK_LIBS ${MKL_LIBRARIES}) + endif() + + if((NOT ${LAMMPS_MEMALIGN} STREQUAL "64") AND (NOT ${LAMMPS_MEMALIGN} STREQUAL "128") AND (NOT ${LAMMPS_MEMALIGN} STREQUAL "256")) + message(FATAL_ERROR "USER-INTEL only supports memory alignment of 64, 128 or 256") + endif() + + if(INTEL_ARCH STREQUAL "KNL") + if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + message(FATAL_ERROR "Must use Intel compiler with USER-INTEL for KNL architecture") + endif() + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -xHost -qopenmp -qoffload") + set(MIC_OPTIONS "-qoffload-option,mic,compiler,\"-fp-model fast=2 -mGLOB_default_function_attrs=\\\"gather_scatter_loop_unroll=4\\\"\"") + add_compile_options(-xMIC-AVX512 -qoffload -fno-alias -ansi-alias -restrict -qoverride-limits ${MIC_OPTIONS}) + add_definitions(-DLMP_INTEL_OFFLOAD) + else() + if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xCOMMON-AVX512") else() @@ -1096,33 +1135,33 @@ if(PKG_USER-INTEL) add_compile_options(${_FLAG}) endif() endforeach() + else() + add_compile_options(-O3 -ffast-math) endif() + endif() - add_definitions(-DLMP_INTEL_USELRT -DLMP_USE_MKL_RNG) + # collect sources + set(USER-INTEL_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/USER-INTEL) + set(USER-INTEL_SOURCES ${USER-INTEL_SOURCES_DIR}/fix_intel.cpp + ${USER-INTEL_SOURCES_DIR}/fix_nh_intel.cpp + ${USER-INTEL_SOURCES_DIR}/intel_buffers.cpp + ${USER-INTEL_SOURCES_DIR}/nbin_intel.cpp + ${USER-INTEL_SOURCES_DIR}/npair_intel.cpp + ${USER-INTEL_SOURCES_DIR}/verlet_lrt_intel.cpp) - list(APPEND LAMMPS_LINK_LIBS ${TBB_MALLOC_LIBRARIES} ${MKL_LIBRARIES}) + set_property(GLOBAL PROPERTY "USER-INTEL_SOURCES" "${USER-INTEL_SOURCES}") - set(USER-INTEL_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/USER-INTEL) - set(USER-INTEL_SOURCES ${USER-INTEL_SOURCES_DIR}/intel_preprocess.h - ${USER-INTEL_SOURCES_DIR}/intel_buffers.h - ${USER-INTEL_SOURCES_DIR}/intel_buffers.cpp - ${USER-INTEL_SOURCES_DIR}/math_extra_intel.h - ${USER-INTEL_SOURCES_DIR}/nbin_intel.h - ${USER-INTEL_SOURCES_DIR}/nbin_intel.cpp - ${USER-INTEL_SOURCES_DIR}/npair_intel.h - ${USER-INTEL_SOURCES_DIR}/npair_intel.cpp - ${USER-INTEL_SOURCES_DIR}/intel_simd.h - ${USER-INTEL_SOURCES_DIR}/intel_intrinsics.h) + # detect styles which have a USER-INTEL version + RegisterStylesExt(${USER-INTEL_SOURCES_DIR} intel USER-INTEL_SOURCES) + RegisterNBinStyle(${USER-INTEL_SOURCES_DIR}/nbin_intel.h) + RegisterNPairStyle(${USER-INTEL_SOURCES_DIR}/npair_intel.h) + RegisterFixStyle(${USER-INTEL_SOURCES_DIR}/fix_intel.h) + RegisterIntegrateStyle(${USER-INTEL_SOURCES_DIR}/verlet_lrt_intel.h) - set_property(GLOBAL PROPERTY "USER-INTEL_SOURCES" "${USER-INTEL_SOURCES}") + get_property(USER-INTEL_SOURCES GLOBAL PROPERTY USER-INTEL_SOURCES) - # detects styles which have USER-INTEL version - RegisterStylesExt(${USER-INTEL_SOURCES_DIR} opt USER-INTEL_SOURCES) - - get_property(USER-INTEL_SOURCES GLOBAL PROPERTY USER-INTEL_SOURCES) - - list(APPEND LIB_SOURCES ${USER-INTEL_SOURCES}) - include_directories(${USER-INTEL_SOURCES_DIR}) + list(APPEND LIB_SOURCES ${USER-INTEL_SOURCES}) + include_directories(${USER-INTEL_SOURCES_DIR}) endif() if(PKG_GPU) From 7688ead60fd8f56ddf96a846420303dfb0614733 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Apr 2019 04:42:56 -0400 Subject: [PATCH 07/38] add pair style granular to pair style overview page in manual --- doc/src/Commands_pair.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/src/Commands_pair.txt b/doc/src/Commands_pair.txt index b18d852c09..e887f0178a 100644 --- a/doc/src/Commands_pair.txt +++ b/doc/src/Commands_pair.txt @@ -98,6 +98,7 @@ OPT. "gran/hertz/history (o)"_pair_gran.html, "gran/hooke (o)"_pair_gran.html, "gran/hooke/history (ko)"_pair_gran.html, +"granular"_pair_granular.html, "gw"_pair_gw.html, "gw/zbl"_pair_gw.html, "hbond/dreiding/lj (o)"_pair_hbond_dreiding.html, From 2e7316a9e34f1b888a58ab05b58d0946a6fcc637 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Apr 2019 08:11:22 -0400 Subject: [PATCH 08/38] fix another windows portability issue in USER-PTM by adding missing header include --- src/USER-PTM/ptm_polar.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/USER-PTM/ptm_polar.cpp b/src/USER-PTM/ptm_polar.cpp index 7a2695b504..5e234127a9 100644 --- a/src/USER-PTM/ptm_polar.cpp +++ b/src/USER-PTM/ptm_polar.cpp @@ -88,6 +88,7 @@ #include #include #include +#include "ptm_polar.h" #include "ptm_quat.h" From b7aecc0d5928244de708f4127d0d87584f49c0cd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Apr 2019 17:22:53 -0400 Subject: [PATCH 09/38] avoid linking with -ldl on windows, as it is not needed or supported --- cmake/CMakeLists.txt | 5 ++++- cmake/presets/mingw-cross.cmake | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 cmake/presets/mingw-cross.cmake diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index c15011b2af..eb7e419ec9 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -607,7 +607,10 @@ if(PKG_USER-MOLFILE) set(MOLFILE_INCLUDE_DIRS "${LAMMPS_LIB_SOURCE_DIR}/molfile" CACHE STRING "Path to VMD molfile plugin headers") add_library(molfile INTERFACE) target_include_directories(molfile INTERFACE ${MOLFILE_INCLUDE_DIRS}) - target_link_libraries(molfile INTERFACE ${CMAKE_DL_LIBS}) + # no need to link with -ldl on windows + if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + target_link_libraries(molfile INTERFACE ${CMAKE_DL_LIBS}) + endif() list(APPEND LAMMPS_LINK_LIBS molfile) endif() diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake new file mode 100644 index 0000000000..5c41509d5f --- /dev/null +++ b/cmake/presets/mingw-cross.cmake @@ -0,0 +1,12 @@ +set(WIN_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE + GRANULAR KSPACE MANYBODY MC MISC MOLECULE OPT PERI POEMS + PYTHON QEQ REAX REPLICA RIGID SHOCK SNAP SRD VORONOI + USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS + USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP + USER-MANIFOLD USER-MEAMC USER-MESO USER-MISC USER-MOFFF USER-MOLFILE + USER-OMP USER-PHONON USER-QTB USER-REAXC USER-SDPD USER-SMD + USER-SMTBQ USER-SPH USER-TALLY USER-UEF) + +foreach(PKG ${WIN_PACKAGES}) + set(PKG_${PKG} ON CACHE BOOL "" FORCE) +endforeach() From d5aa60dbfe2b62046bf56096eec00e5a63c23f7c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Apr 2019 17:23:27 -0400 Subject: [PATCH 10/38] skip inline function optimizations for windows when compiling with mingw --- src/lmpwindows.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lmpwindows.h b/src/lmpwindows.h index 546fa62535..92a248a05e 100644 --- a/src/lmpwindows.h +++ b/src/lmpwindows.h @@ -24,14 +24,13 @@ inline double pow(int i, int j){ return pow((double)i,j); } -#endif -inline double sqrt(int i){ - return sqrt((double) i); -} - inline double fabs(int i){ return fabs((double) i); } +inline double sqrt(int i){ + return sqrt((double) i); +} +#endif inline double trunc(double x) { return x > 0 ? floor(x) : ceil(x); From 8d8f0af7a626fb6a6cc93263cea6b05189af2b32 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Apr 2019 17:38:53 -0400 Subject: [PATCH 11/38] add download flags to mingw preset --- cmake/presets/mingw-cross.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake index 5c41509d5f..841972b858 100644 --- a/cmake/presets/mingw-cross.cmake +++ b/cmake/presets/mingw-cross.cmake @@ -10,3 +10,5 @@ set(WIN_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE foreach(PKG ${WIN_PACKAGES}) set(PKG_${PKG} ON CACHE BOOL "" FORCE) endforeach() +set(DOWNLOAD_VORO ON CACHE BOOL "" FORCE) +set(DOWNLOAD_EIGEN3 ON CACHE BOOL "" FORCE) From 70ae5f41e35df1fa7c1fa2ab7011edb47bd36a3e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Apr 2019 17:46:25 -0400 Subject: [PATCH 12/38] tweaks for compiling USER-INTEL in cpu mode on Windows with GCC --- cmake/CMakeLists.txt | 2 +- cmake/presets/mingw-cross.cmake | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index a9147bf8c7..9402ec0663 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1112,7 +1112,7 @@ if(PKG_USER-INTEL) list(APPEND LAMMPS_LINK_LIBS ${MKL_LIBRARIES}) endif() - if((NOT ${LAMMPS_MEMALIGN} STREQUAL "64") AND (NOT ${LAMMPS_MEMALIGN} STREQUAL "128") AND (NOT ${LAMMPS_MEMALIGN} STREQUAL "256")) + if((NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") AND (NOT ${LAMMPS_MEMALIGN} STREQUAL "64") AND (NOT ${LAMMPS_MEMALIGN} STREQUAL "128") AND (NOT ${LAMMPS_MEMALIGN} STREQUAL "256")) message(FATAL_ERROR "USER-INTEL only supports memory alignment of 64, 128 or 256") endif() diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake index 841972b858..d8edf95403 100644 --- a/cmake/presets/mingw-cross.cmake +++ b/cmake/presets/mingw-cross.cmake @@ -12,3 +12,4 @@ foreach(PKG ${WIN_PACKAGES}) endforeach() set(DOWNLOAD_VORO ON CACHE BOOL "" FORCE) set(DOWNLOAD_EIGEN3 ON CACHE BOOL "" FORCE) +set(LAMMPS_MEMALIGN "0" CACHE STRING "" FORCE) From 35129c0881991c028ab549ea48de83a39e88bddf Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Apr 2019 17:51:53 -0400 Subject: [PATCH 13/38] posix_memalign() does not exist on windows, so we have to workaround using it with USER-INTEL --- src/memory.cpp | 2 +- src/my_page.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/memory.cpp b/src/memory.cpp index 971de3dce6..b2f8a95b17 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -26,7 +26,7 @@ #endif #endif -#if defined(LMP_USER_INTEL) && !defined(LAMMPS_MEMALIGN) +#if defined(LMP_USER_INTEL) && !defined(LAMMPS_MEMALIGN) && !defined(_WIN32) #define LAMMPS_MEMALIGN 64 #endif diff --git a/src/my_page.h b/src/my_page.h index 5cd7098d8c..01542a9174 100644 --- a/src/my_page.h +++ b/src/my_page.h @@ -48,7 +48,7 @@ methods: #ifndef LAMMPS_MY_PAGE_H #define LAMMPS_MY_PAGE_H -#if defined(LMP_USER_INTEL) && !defined(LAMMPS_MEMALIGN) +#if defined(LMP_USER_INTEL) && !defined(LAMMPS_MEMALIGN) && !defined(_WIN32) #define LAMMPS_MEMALIGN 64 #endif From 76b848bb0ad2028deff14c37584f22922c9387ca Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Apr 2019 17:58:19 -0400 Subject: [PATCH 14/38] include USER-INTEL, but need to disable support for LRT mode --- cmake/presets/mingw-cross.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake index d8edf95403..11921c05c9 100644 --- a/cmake/presets/mingw-cross.cmake +++ b/cmake/presets/mingw-cross.cmake @@ -2,7 +2,7 @@ set(WIN_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GRANULAR KSPACE MANYBODY MC MISC MOLECULE OPT PERI POEMS PYTHON QEQ REAX REPLICA RIGID SHOCK SNAP SRD VORONOI USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS - USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP + USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-INTEL USER-MANIFOLD USER-MEAMC USER-MESO USER-MISC USER-MOFFF USER-MOLFILE USER-OMP USER-PHONON USER-QTB USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF) @@ -13,3 +13,4 @@ endforeach() set(DOWNLOAD_VORO ON CACHE BOOL "" FORCE) set(DOWNLOAD_EIGEN3 ON CACHE BOOL "" FORCE) set(LAMMPS_MEMALIGN "0" CACHE STRING "" FORCE) +set(INTEL_LRT_MODE "none" CACHE STRING "" FORCE) From 3a0b108f914401e7b1328611888471ba55acbd07 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Apr 2019 18:22:06 -0400 Subject: [PATCH 15/38] reformat --- cmake/presets/mingw-cross.cmake | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake index 11921c05c9..cab5a3ca41 100644 --- a/cmake/presets/mingw-cross.cmake +++ b/cmake/presets/mingw-cross.cmake @@ -1,15 +1,16 @@ -set(WIN_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE - GRANULAR KSPACE MANYBODY MC MISC MOLECULE OPT PERI POEMS - PYTHON QEQ REAX REPLICA RIGID SHOCK SNAP SRD VORONOI - USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS - USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-INTEL - USER-MANIFOLD USER-MEAMC USER-MESO USER-MISC USER-MOFFF USER-MOLFILE +set(WIN_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GRANULAR + KSPACE MANYBODY MC MISC MOLECULE OPT PERI POEMS QEQ REPLICA + RIGID SHOCK SNAP SRD VORONOI USER-ATC USER-AWPMD USER-BOCS + USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD + USER-DRUDE USER-EFF USER-FEP USER-INTEL USER-MANIFOLD + USER-MEAMC USER-MESO USER-MISC USER-MOFFF USER-MOLFILE USER-OMP USER-PHONON USER-QTB USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF) foreach(PKG ${WIN_PACKAGES}) set(PKG_${PKG} ON CACHE BOOL "" FORCE) endforeach() + set(DOWNLOAD_VORO ON CACHE BOOL "" FORCE) set(DOWNLOAD_EIGEN3 ON CACHE BOOL "" FORCE) set(LAMMPS_MEMALIGN "0" CACHE STRING "" FORCE) From 200aa2d06fc6c52171eb7e2211947b5fb130d059 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Apr 2019 18:50:53 -0400 Subject: [PATCH 16/38] missed a few packages in cross-compiler preset --- cmake/presets/mingw-cross.cmake | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake index cab5a3ca41..b53e5a7b93 100644 --- a/cmake/presets/mingw-cross.cmake +++ b/cmake/presets/mingw-cross.cmake @@ -1,11 +1,11 @@ -set(WIN_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GRANULAR - KSPACE MANYBODY MC MISC MOLECULE OPT PERI POEMS QEQ REPLICA - RIGID SHOCK SNAP SRD VORONOI USER-ATC USER-AWPMD USER-BOCS - USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD - USER-DRUDE USER-EFF USER-FEP USER-INTEL USER-MANIFOLD - USER-MEAMC USER-MESO USER-MISC USER-MOFFF USER-MOLFILE - USER-OMP USER-PHONON USER-QTB USER-REAXC USER-SDPD USER-SMD - USER-SMTBQ USER-SPH USER-TALLY USER-UEF) +set(WIN_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU + GRANULAR KSPACE MANYBODY MC MISC MOLECULE OPT PERI POEMS QEQ + REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI USER-ATC USER-AWPMD + USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION + USER-DPD USER-DRUDE USER-EFF USER-FEP USER-INTEL USER-MANIFOLD + USER-MEAMC USER-MESO USER-MISC USER-MOFFF USER-MOLFILE USER-OMP + USER-PHONON USER-PTM USER-QTB USER-REAXC USER-SDPD USER-SMD + USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-YAFF) foreach(PKG ${WIN_PACKAGES}) set(PKG_${PKG} ON CACHE BOOL "" FORCE) From b1badb6555f595d5bd8a44597ed2a18552b1ef26 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Apr 2019 22:09:58 -0400 Subject: [PATCH 17/38] update all-on and all-off presets for recently added and removed packages --- cmake/presets/all_off.cmake | 4 ---- cmake/presets/all_on.cmake | 4 ---- 2 files changed, 8 deletions(-) diff --git a/cmake/presets/all_off.cmake b/cmake/presets/all_off.cmake index b434796d7c..cdcf5fc675 100644 --- a/cmake/presets/all_off.cmake +++ b/cmake/presets/all_off.cmake @@ -11,10 +11,6 @@ set(USER_PACKAGES USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVA USER-QUIP USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-VTK) -set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MEAM MPIIO MSCG POEMS PYTHON REAX VORONOI - USER-ATC USER-AWPMD USER-COLVARS USER-H5MD USER-LB USER-MOLFILE - USER-NETCDF USER-PLUMED USER-QMMM USER-QUIP USER-SMD USER-VTK) - set(ALL_PACKAGES ${STANDARD_PACKAGES} ${USER_PACKAGES}) foreach(PKG ${ALL_PACKAGES}) diff --git a/cmake/presets/all_on.cmake b/cmake/presets/all_on.cmake index 3a1100f337..1351eb8315 100644 --- a/cmake/presets/all_on.cmake +++ b/cmake/presets/all_on.cmake @@ -11,10 +11,6 @@ set(USER_PACKAGES USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVA USER-QUIP USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-VTK) -set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MEAM MPIIO MSCG POEMS PYTHON REAX VORONOI - USER-ATC USER-AWPMD USER-COLVARS USER-H5MD USER-LB USER-MOLFILE - USER-NETCDF USER-PLUMED USER-QMMM USER-QUIP USER-SMD USER-VTK) - set(ALL_PACKAGES ${STANDARD_PACKAGES} ${USER_PACKAGES}) foreach(PKG ${ALL_PACKAGES}) From 719a74a02fc8ab2f84652b9edcb2a7054cf3729f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Apr 2019 22:10:55 -0400 Subject: [PATCH 18/38] must include omp.h header when using OpenMP API functions --- src/KOKKOS/pair_exp6_rx_kokkos.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/KOKKOS/pair_exp6_rx_kokkos.cpp b/src/KOKKOS/pair_exp6_rx_kokkos.cpp index fa10c6d30f..0a6372fdf8 100644 --- a/src/KOKKOS/pair_exp6_rx_kokkos.cpp +++ b/src/KOKKOS/pair_exp6_rx_kokkos.cpp @@ -36,6 +36,10 @@ #include "atom_kokkos.h" #include "kokkos.h" +#ifdef _OPENMP +#include +#endif + using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecialKokkos; From 2fc7395c140224d493c19de02ef7f660bdb03702 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Apr 2019 22:22:31 -0400 Subject: [PATCH 19/38] add some comments to updated all-on / all-off presets --- cmake/presets/all_off.cmake | 3 +++ cmake/presets/all_on.cmake | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/cmake/presets/all_off.cmake b/cmake/presets/all_off.cmake index cdcf5fc675..80a12c6991 100644 --- a/cmake/presets/all_off.cmake +++ b/cmake/presets/all_off.cmake @@ -1,3 +1,6 @@ +# preset that turns on all existing packages off. can be used to reset +# an existing package selection without losing any other settings + set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MEAM MISC MOLECULE MPIIO MSCG OPT PERI POEMS diff --git a/cmake/presets/all_on.cmake b/cmake/presets/all_on.cmake index 1351eb8315..b66434df63 100644 --- a/cmake/presets/all_on.cmake +++ b/cmake/presets/all_on.cmake @@ -1,3 +1,7 @@ +# preset that turns on all existing packages. using the combination +# this preset with the nolib.cmake preset should configure a LAMMPS +# binary, that can be compiled with just a working C++ compiler. + set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MEAM MISC MOLECULE MPIIO MSCG OPT PERI POEMS From c044eeb482467ff4687cb3b35883120ff0ef0b86 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Apr 2019 22:23:36 -0400 Subject: [PATCH 20/38] update nolib.cmake and change it so it disables all packages requiring some external library or equivalent --- cmake/presets/nolib.cmake | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/cmake/presets/nolib.cmake b/cmake/presets/nolib.cmake index 4c02fb6210..663f87122b 100644 --- a/cmake/presets/nolib.cmake +++ b/cmake/presets/nolib.cmake @@ -1,21 +1,10 @@ -set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU - GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MEAM MISC - MOLECULE MPIIO MSCG OPT PERI POEMS - PYTHON QEQ REAX REPLICA RIGID SHOCK SNAP SRD VORONOI) +# preset that turns off all packages that require some form of external +# library or special compiler (fortran or cuda) or equivalent. -set(USER_PACKAGES USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS - USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD - USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO - USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE - USER-NETCDF USER-OMP USER-PHONON USER-QMMM USER-QTB - USER-QUIP USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY - USER-UEF USER-VTK) - -set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MEAM MPIIO MSCG POEMS PYTHON REAX VORONOI - USER-ATC USER-AWPMD USER-COLVARS USER-H5MD USER-LB USER-MOLFILE - USER-NETCDF USER-PLUMED USER-QMMM USER-QUIP USER-SMD USER-VTK) - -set(ALL_PACKAGES ${STANDARD_PACKAGES} ${USER_PACKAGES}) +set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MPIIO MSCG PYTHON + VORONOI USER-ADIOS USER-ATC USER-AWPMD USER-H5MD USER-LB + USER-MOLFILE USER-NETCDF USER-PLUMED USER-QMMM USER-QUIP + USER-SMD USER-VTK) foreach(PKG ${PACKAGES_WITH_LIB}) set(PKG_${PKG} OFF CACHE BOOL "" FORCE) From 91f3a948510bf75128c8765e5aa28fee6b6bc4d6 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 05:49:25 -0400 Subject: [PATCH 21/38] fix typo in docs --- doc/src/velocity.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/velocity.txt b/doc/src/velocity.txt index 96d3fa6dc4..decdf2a923 100644 --- a/doc/src/velocity.txt +++ b/doc/src/velocity.txt @@ -134,7 +134,7 @@ The {mom} and {rot} keywords are used by {create}. If mom = yes, the linear momentum of the newly created ensemble of velocities is zeroed; if rot = yes, the angular momentum is zeroed. -*line +:line If specified, the {temp} keyword is used by {create} and {scale} to specify a "compute"_compute.html that calculates temperature in a From 800f3a81b1152895b8e9af89a957172f505ca781 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 06:59:19 -0400 Subject: [PATCH 22/38] update documentation for changes in USER-INTEL support in CMake --- cmake/README.md | 21 +++++++++++++++++---- doc/src/Build_extras.txt | 25 ++++++++++++++++++------- doc/src/Speed_intel.txt | 2 +- 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/cmake/README.md b/cmake/README.md index 1c37ecc92e..a635f3e06d 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -155,11 +155,13 @@ make The CMake build exposes a lot of different options. In the old build system some of the package selections were possible by using special make target like -`make yes-std` or `make no-lib`. Achieving the same result with cmake requires +`make yes-std` or `make no-lib`. Achieving a similar result with cmake requires specifying all options manually. This can quickly become a very long command line that is hard to handle. While these could be stored in a simple script file, there is another way of defining "presets" to compile LAMMPS in a certain -way. +way. Since the cmake build process - contrary to the conventional build system - +includes the compilation of the bundled libraries into the standard build process, +the grouping of those presets is somewhat different. A preset is a regular CMake script file that can use constructs such as variables, lists and for-loops to manipulate configuration options and create @@ -171,10 +173,10 @@ Such a file can then be passed to cmake via the `-C` flag. Several examples of presets can be found in the `cmake/presets` folder. ```bash -# build LAMMPS with all "standard" packages which don't use libraries and enable GPU package +# build LAMMPS with all packages enabled which don't use external libraries and enable GPU package mkdir build cd build -cmake -C ../cmake/presets/std_nolib.cmake -D PKG_GPU=on ../cmake +cmake -C ../cmake/presets/all_on.cmake -C ../cmake/presets/nolib.cmake -D PKG_GPU=on ../cmake ``` # Reference @@ -1429,6 +1431,17 @@ TODO + + INTEL_LRT_MODE + How to support Long-range thread mode in Verlet integration + +
+
threads (default, if pthreads available)
+
none (default, if pthreads not available)
+
c++11
+
+ + diff --git a/doc/src/Build_extras.txt b/doc/src/Build_extras.txt index 2aa304faff..17d18243f2 100644 --- a/doc/src/Build_extras.txt +++ b/doc/src/Build_extras.txt @@ -859,23 +859,34 @@ file. USER-INTEL package :h4,link(user-intel) To build with this package, you must choose which hardware you want to -build for, either Intel CPUs or Intel KNLs. You should also typically -"install the USER-OMP package"_#user-omp, as it can be used in tandem -with the USER-INTEL package to good effect, as explained on the "Speed -intel"_Speed_intel.html doc page. +build for, either x86 CPUs or Intel KNLs in offload mode. You should +also typically "install the USER-OMP package"_#user-omp, as it can be +used in tandem with the USER-INTEL package to good effect, as explained +on the "Speed intel"_Speed_intel.html doc page. [CMake build]: -D INTEL_ARCH=value # value = cpu (default) or knl --D BUILD_OMP=yes # also required to build with the USER-INTEl package :pre +-D INTEL_LRT_MODE=value # value = threads, none, or c++11 :pre -Requires an Intel compiler as well as the Intel TBB and MKL libraries. +In Long-range thread mode (LRT) a modified verlet style is used, that +operates the Kspace calculation in a separate thread concurrently to +other calculations. This has to be enabled in the "package intel"_package.html +command at runtime. With the setting "threads" it used the pthreads +library, while c++11 will use the built-in thread support of C++11 +compilers. The option "none" skips compilation of this feature. The +default is to use "threads" if pthreads is available and otherwise "none". + +Best performance is achieved with Intel hardware, Intel compilers, as well as +the Intel TBB and MKL libraries. However, the code also compiles, links, and +runs with other compilers and without TBB and MKL. [Traditional make]: Choose which hardware to compile for in Makefile.machine via the following settings. See src/MAKE/OPTIONS/Makefile.intel_cpu* and -Makefile.knl files for examples. +Makefile.knl files for examples. and src/USER-INTEL/README for +additional information. For CPUs: diff --git a/doc/src/Speed_intel.txt b/doc/src/Speed_intel.txt index dc38cb0956..2688b43e6f 100644 --- a/doc/src/Speed_intel.txt +++ b/doc/src/Speed_intel.txt @@ -24,7 +24,7 @@ LAMMPS to run on the CPU cores and co-processor cores simultaneously. Angle Styles: charmm, harmonic :ulb,l Bond Styles: fene, fourier, harmonic :l -Dihedral Styles: charmm, harmonic, opls :l +Dihedral Styles: charmm, fourier, harmonic, opls :l Fixes: nve, npt, nvt, nvt/sllod, nve/asphere :l Improper Styles: cvff, harmonic :l Pair Styles: airebo, airebo/morse, buck/coul/cut, buck/coul/long, From 0ab65c0343bfefb88618cad078fa70583d928f65 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 07:12:55 -0400 Subject: [PATCH 23/38] update docs for building LAMMPS for windows --- doc/src/Build_windows.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/src/Build_windows.txt b/doc/src/Build_windows.txt index bf1ec265a1..b3dbf775c9 100644 --- a/doc/src/Build_windows.txt +++ b/doc/src/Build_windows.txt @@ -51,11 +51,10 @@ provides a unix/linux interface to low-level Windows functions, so LAMMPS can be compiled on Windows. The necessary (minor) modifications to LAMMPS are included, but may not always up-to-date for recently added functionality and the corresponding new code. A machine makefile for using cygwin for -the old build system is provided. The CMake build system is untested -for this; you will have to request that makefiles are generated and -manually set the compiler. +the old build system is provided. Using CMake for this mode of compilation +is untested and not likely to work. -When compiling for Windows [not] set the -DLAMMPS_MEMALIGN define +When compiling for Windows do [not] set the -DLAMMPS_MEMALIGN define in the LMP_INC makefile variable and add -lwsock32 -lpsapi to the linker flags in LIB makefile variable. Try adding -static-libgcc or -static or both to the linker flags when your resulting LAMMPS Windows executable @@ -79,7 +78,13 @@ probably the currently best tested and supported way to build LAMMPS executables for Windows. There are makefiles provided for the traditional build system, but CMake has also been successfully tested using the mingw32-cmake and mingw64-cmake wrappers that are bundled -with the cross-compiler environment on Fedora machines. +with the cross-compiler environment on Fedora machines. A CMake preset +selecting all packages compatible with this cross-compilation build +is provided. You likely need to disable the GPU package unless you +download and install the contents of the pre-compiled "OpenCL ICD loader +library"_https://download.lammps.org/thirdparty/opencl-win-devel.tar.gz +into your MinGW64 cross-compiler environment. The cross-compilation +currently will only produce non-MPI serial binaries. Please keep in mind, though, that this only applies to compiling LAMMPS. Whether the resulting binaries do work correctly is no tested by the From ef184c9b1b73f0e55f7393d8320250f925edbe0e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 09:34:03 -0400 Subject: [PATCH 24/38] remove presets, that try to mimic settings from the conventional build, but make little sense with cmake --- cmake/presets/manual_selection.cmake | 71 ---------------------------- cmake/presets/std.cmake | 22 --------- cmake/presets/std_nolib.cmake | 26 ---------- cmake/presets/user.cmake | 22 --------- 4 files changed, 141 deletions(-) delete mode 100644 cmake/presets/manual_selection.cmake delete mode 100644 cmake/presets/std.cmake delete mode 100644 cmake/presets/std_nolib.cmake delete mode 100644 cmake/presets/user.cmake diff --git a/cmake/presets/manual_selection.cmake b/cmake/presets/manual_selection.cmake deleted file mode 100644 index 6db41b708c..0000000000 --- a/cmake/presets/manual_selection.cmake +++ /dev/null @@ -1,71 +0,0 @@ -set(PKG_ASPHERE OFF CACHE BOOL "" FORCE) -set(PKG_BODY OFF CACHE BOOL "" FORCE) -set(PKG_CLASS2 OFF CACHE BOOL "" FORCE) -set(PKG_COLLOID OFF CACHE BOOL "" FORCE) -set(PKG_COMPRESS OFF CACHE BOOL "" FORCE) -set(PKG_CORESHELL OFF CACHE BOOL "" FORCE) -set(PKG_DIPOLE OFF CACHE BOOL "" FORCE) -set(PKG_GPU OFF CACHE BOOL "" FORCE) -set(PKG_GRANULAR OFF CACHE BOOL "" FORCE) -set(PKG_KIM OFF CACHE BOOL "" FORCE) -set(PKG_KOKKOS OFF CACHE BOOL "" FORCE) -set(PKG_KSPACE OFF CACHE BOOL "" FORCE) -set(PKG_LATTE OFF CACHE BOOL "" FORCE) -set(PKG_LIB OFF CACHE BOOL "" FORCE) -set(PKG_MANYBODY OFF CACHE BOOL "" FORCE) -set(PKG_MC OFF CACHE BOOL "" FORCE) -set(PKG_MEAM OFF CACHE BOOL "" FORCE) -set(PKG_MISC OFF CACHE BOOL "" FORCE) -set(PKG_MOLECULE OFF CACHE BOOL "" FORCE) -set(PKG_MPIIO OFF CACHE BOOL "" FORCE) -set(PKG_MSCG OFF CACHE BOOL "" FORCE) -set(PKG_OPT OFF CACHE BOOL "" FORCE) -set(PKG_PERI OFF CACHE BOOL "" FORCE) -set(PKG_POEMS OFF CACHE BOOL "" FORCE) -set(PKG_PYTHOFF OFF CACHE BOOL "" FORCE) -set(PKG_QEQ OFF CACHE BOOL "" FORCE) -set(PKG_REAX OFF CACHE BOOL "" FORCE) -set(PKG_REPLICA OFF CACHE BOOL "" FORCE) -set(PKG_RIGID OFF CACHE BOOL "" FORCE) -set(PKG_SHOCK OFF CACHE BOOL "" FORCE) -set(PKG_SNAP OFF CACHE BOOL "" FORCE) -set(PKG_SRD OFF CACHE BOOL "" FORCE) -set(PKG_VOROFFOI OFF CACHE BOOL "" FORCE) - -set(PKG_USER OFF CACHE BOOL "" FORCE) -set(PKG_USER-ATC OFF CACHE BOOL "" FORCE) -set(PKG_USER-AWPMD OFF CACHE BOOL "" FORCE) -set(PKG_USER-BOCS OFF CACHE BOOL "" FORCE) -set(PKG_USER-CGDNA OFF CACHE BOOL "" FORCE) -set(PKG_USER-CGSDK OFF CACHE BOOL "" FORCE) -set(PKG_USER-COLVARS OFF CACHE BOOL "" FORCE) -set(PKG_USER-DIFFRACTIOFF OFF CACHE BOOL "" FORCE) -set(PKG_USER-DPD OFF CACHE BOOL "" FORCE) -set(PKG_USER-DRUDE OFF CACHE BOOL "" FORCE) -set(PKG_USER-EFF OFF CACHE BOOL "" FORCE) -set(PKG_USER-FEP OFF CACHE BOOL "" FORCE) -set(PKG_USER-H5MD OFF CACHE BOOL "" FORCE) -set(PKG_USER-INTEL OFF CACHE BOOL "" FORCE) -set(PKG_USER-LB OFF CACHE BOOL "" FORCE) -set(PKG_USER-MANIFOLD OFF CACHE BOOL "" FORCE) -set(PKG_USER-MEAMC OFF CACHE BOOL "" FORCE) -set(PKG_USER-MESO OFF CACHE BOOL "" FORCE) -set(PKG_USER-MGPT OFF CACHE BOOL "" FORCE) -set(PKG_USER-MISC OFF CACHE BOOL "" FORCE) -set(PKG_USER-MOFFF OFF CACHE BOOL "" FORCE) -set(PKG_USER-MOLFILE OFF CACHE BOOL "" FORCE) -set(PKG_USER-NETCDF OFF CACHE BOOL "" FORCE) -set(PKG_USER-OMP OFF CACHE BOOL "" FORCE) -set(PKG_USER-PHONON OFF CACHE BOOL "" FORCE) -set(PKG_USER-PLUMED OFF CACHE BOOL "" FORCE) -set(PKG_USER-QMMM OFF CACHE BOOL "" FORCE) -set(PKG_USER-QTB OFF CACHE BOOL "" FORCE) -set(PKG_USER-QUIP OFF CACHE BOOL "" FORCE) -set(PKG_USER-REAXC OFF CACHE BOOL "" FORCE) -set(PKG_USER-SDPD OFF CACHE BOOL "" FORCE) -set(PKG_USER-SMD OFF CACHE BOOL "" FORCE) -set(PKG_USER-SMTBQ OFF CACHE BOOL "" FORCE) -set(PKG_USER-SPH OFF CACHE BOOL "" FORCE) -set(PKG_USER-TALLY OFF CACHE BOOL "" FORCE) -set(PKG_USER-UEF OFF CACHE BOOL "" FORCE) -set(PKG_USER-VTK OFF CACHE BOOL "" FORCE) diff --git a/cmake/presets/std.cmake b/cmake/presets/std.cmake deleted file mode 100644 index 4176aba44e..0000000000 --- a/cmake/presets/std.cmake +++ /dev/null @@ -1,22 +0,0 @@ -set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU - GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MEAM MISC - MOLECULE MPIIO MSCG OPT PERI POEMS - PYTHON QEQ REAX REPLICA RIGID SHOCK SNAP SRD VORONOI) - -set(USER_PACKAGES USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS - USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD - USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO - USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE - USER-NETCDF USER-OMP USER-PHONON USER-QMMM USER-QTB - USER-QUIP USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY - USER-UEF USER-VTK) - -set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MEAM MPIIO MSCG POEMS PYTHON REAX VORONOI - USER-ATC USER-AWPMD USER-COLVARS USER-H5MD USER-LB USER-MOLFILE - USER-NETCDF USER-QMMM USER-QUIP USER-SMD USER-VTK) - -set(ALL_PACKAGES ${STANDARD_PACKAGES} ${USER_PACKAGES}) - -foreach(PKG ${STANDARD_PACKAGES}) - set(PKG_${PKG} ON CACHE BOOL "" FORCE) -endforeach() diff --git a/cmake/presets/std_nolib.cmake b/cmake/presets/std_nolib.cmake deleted file mode 100644 index aa067f2ba0..0000000000 --- a/cmake/presets/std_nolib.cmake +++ /dev/null @@ -1,26 +0,0 @@ -set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU - GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MEAM MISC - MOLECULE MPIIO MSCG OPT PERI POEMS - PYTHON QEQ REAX REPLICA RIGID SHOCK SNAP SRD VORONOI) - -set(USER_PACKAGES USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS - USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD - USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO - USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE - USER-NETCDF USER-OMP USER-PHONON USER-QMMM USER-QTB - USER-QUIP USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY - USER-UEF USER-VTK) - -set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MEAM MPIIO MSCG POEMS PYTHON REAX VORONOI - USER-ATC USER-AWPMD USER-COLVARS USER-H5MD USER-LB USER-MOLFILE - USER-NETCDF USER-QMMM USER-QUIP USER-SMD USER-VTK) - -set(ALL_PACKAGES ${STANDARD_PACKAGES} ${USER_PACKAGES}) - -foreach(PKG ${STANDARD_PACKAGES}) - set(PKG_${PKG} ON CACHE BOOL "" FORCE) -endforeach() - -foreach(PKG ${PACKAGES_WITH_LIB}) - set(PKG_${PKG} OFF CACHE BOOL "" FORCE) -endforeach() diff --git a/cmake/presets/user.cmake b/cmake/presets/user.cmake deleted file mode 100644 index af606203e9..0000000000 --- a/cmake/presets/user.cmake +++ /dev/null @@ -1,22 +0,0 @@ -set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU - GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MEAM MISC - MOLECULE MPIIO MSCG OPT PERI POEMS - PYTHON QEQ REAX REPLICA RIGID SHOCK SNAP SRD VORONOI) - -set(USER_PACKAGES USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS - USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD - USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO - USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE - USER-NETCDF USER-OMP USER-PHONON USER-QMMM USER-QTB - USER-QUIP USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY - USER-UEF USER-VTK) - -set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MEAM MPIIO MSCG POEMS PYTHON REAX VORONOI - USER-ATC USER-AWPMD USER-COLVARS USER-H5MD USER-LB USER-MOLFILE - USER-NETCDF USER-PLUMED USER-QMMM USER-QUIP USER-SMD USER-VTK) - -set(ALL_PACKAGES ${STANDARD_PACKAGES} ${USER_PACKAGES}) - -foreach(PKG ${USER_PACKAGES}) - set(PKG_${PKG} ON CACHE BOOL "" FORCE) -endforeach() From 764fb2522b705130929df8a3af1e5051fffc78ab Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 11:21:25 -0400 Subject: [PATCH 25/38] abort already in cmake when including USER-INTEL with -DLAMMPS_BIGBIG --- cmake/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 9402ec0663..39d1e4e382 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1060,6 +1060,9 @@ if(PKG_OPT) endif() if(PKG_USER-INTEL) + if(LAMMPS_SIZES STREQUAL BIGBIG) + message(FATAL_ERROR "The USER-INTEL Package is not compatible with -DLAMMPS_BIGBIG") + endif() add_definitions(-DLMP_USER_INTEL) set(INTEL_ARCH "cpu" CACHE STRING "Architectures used by USER-INTEL (cpu or knl)") @@ -1068,7 +1071,6 @@ if(PKG_USER-INTEL) validate_option(INTEL_ARCH INTEL_ARCH_VALUES) string(TOUPPER ${INTEL_ARCH} INTEL_ARCH) - # add_definitions(-DLMP_INTEL_USELRT) find_package(Threads QUIET) if(Threads_FOUND) set(INTEL_LRT_MODE "threads" CACHE STRING "Long-range threads mode (none, threads, or c++11)") From fd7c680654ba57cfa1302b90cf97e22fd6de367c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 11:39:46 -0400 Subject: [PATCH 26/38] the lammps_gather_atom*() and lammps_scatter_atom() library functions are not compatible with -DLAMMPS_BIGBIG. divert to dummy functions resulting in error exists. --- src/library.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/library.cpp b/src/library.cpp index d8c55159a2..da4ebaf479 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -801,6 +801,13 @@ void lammps_reset_box(void *ptr, double *boxlo, double *boxhi, Allreduce to sum vector into data across all procs ------------------------------------------------------------------------- */ +#if defined(LAMMPS_BIGBIG) +void lammps_gather_atoms(void * /*ptr*/, char * /*name */, + int /*type*/, int /*count*/, void * /*data*/) +{ + lmp->error->all(FLERR,"Library function lammps_gather_atoms() not compatible with -DLAMMPS_BIGBIG"); +} +#else void lammps_gather_atoms(void *ptr, char *name, int type, int count, void *data) { @@ -905,6 +912,7 @@ void lammps_gather_atoms(void *ptr, char *name, } END_CAPTURE } +#endif /* ---------------------------------------------------------------------- gather the named atom-based entity for all atoms @@ -927,6 +935,13 @@ void lammps_gather_atoms(void *ptr, char *name, Allgather Nlocal atoms from each proc into data ------------------------------------------------------------------------- */ +#if defined(LAMMPS_BIGBIG) +void lammps_gather_atoms_concat(void * /*ptr*/, char * /*name */, + int /*type*/, int /*count*/, void * /*data*/) +{ + lmp->error->all(FLERR,"Library function lammps_gather_atoms_concat() not compatible with -DLAMMPS_BIGBIG"); +} +#else void lammps_gather_atoms_concat(void *ptr, char *name, int type, int count, void *data) { @@ -1047,6 +1062,7 @@ void lammps_gather_atoms_concat(void *ptr, char *name, } END_CAPTURE } +#endif /* ---------------------------------------------------------------------- gather the named atom-based entity for a subset of atoms @@ -1071,6 +1087,14 @@ void lammps_gather_atoms_concat(void *ptr, char *name, Allreduce to sum vector into data across all procs ------------------------------------------------------------------------- */ +#if defined(LAMMPS_BIGBIG) +void lammps_gather_atoms_subset(void * /*ptr*/, char * /*name */, + int /*type*/, int /*count*/, + int /*ndata*/, int * /*ids*/, void * /*data*/) +{ + lmp->error->all(FLERR,"Library function lammps_gather_atoms_subset() not compatible with -DLAMMPS_BIGBIG"); +} +#else void lammps_gather_atoms_subset(void *ptr, char *name, int type, int count, int ndata, int *ids, void *data) @@ -1188,6 +1212,7 @@ void lammps_gather_atoms_subset(void *ptr, char *name, } END_CAPTURE } +#endif /* ---------------------------------------------------------------------- scatter the named atom-based entity in data to all atoms @@ -1205,6 +1230,13 @@ void lammps_gather_atoms_subset(void *ptr, char *name, loop over Natoms, if I own atom ID, set its values from data ------------------------------------------------------------------------- */ +#if defined(LAMMPS_BIGBIG) +void lammps_scatter_atoms(void * /*ptr*/, char * /*name */, + int /*type*/, int /*count*/, void * /*data*/) +{ + lmp->error->all(FLERR,"Library function lammps_scatter_atoms() not compatible with -DLAMMPS_BIGBIG"); +} +#else void lammps_scatter_atoms(void *ptr, char *name, int type, int count, void *data) { @@ -1299,6 +1331,7 @@ void lammps_scatter_atoms(void *ptr, char *name, } END_CAPTURE } +#endif /* ---------------------------------------------------------------------- scatter the named atom-based entity in data to a subset of atoms @@ -1318,6 +1351,14 @@ void lammps_scatter_atoms(void *ptr, char *name, loop over Ndata, if I own atom ID, set its values from data ------------------------------------------------------------------------- */ +#if defined(LAMMPS_BIGBIG) +void lammps_scatter_atoms_subset(void * /*ptr*/, char * /*name */, + int /*type*/, int /*count*/, + int /*ndata*/, int * /*ids*/, void * /*data*/) +{ + lmp->error->all(FLERR,"Library function lammps_scatter_atoms_subset() not compatible with -DLAMMPS_BIGBIG"); +} +#else void lammps_scatter_atoms_subset(void *ptr, char *name, int type, int count, int ndata, int *ids, void *data) @@ -1420,6 +1461,7 @@ void lammps_scatter_atoms_subset(void *ptr, char *name, } END_CAPTURE } +#endif /* ---------------------------------------------------------------------- create N atoms and assign them to procs based on coords From 3eab343821792d9f82d6d0be1f2485a1e5ba244c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 11:49:08 -0400 Subject: [PATCH 27/38] give access to LAMMPS object and wrap in macros for optional exception handling --- src/library.cpp | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/library.cpp b/src/library.cpp index da4ebaf479..a653b83adb 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -802,10 +802,14 @@ void lammps_reset_box(void *ptr, double *boxlo, double *boxhi, ------------------------------------------------------------------------- */ #if defined(LAMMPS_BIGBIG) -void lammps_gather_atoms(void * /*ptr*/, char * /*name */, +void lammps_gather_atoms(void *ptr, char * /*name */, int /*type*/, int /*count*/, void * /*data*/) { + LAMMPS *lmp = (LAMMPS *) ptr; + + BEGIN_CAPTURE lmp->error->all(FLERR,"Library function lammps_gather_atoms() not compatible with -DLAMMPS_BIGBIG"); + END_CAPTURE } #else void lammps_gather_atoms(void *ptr, char *name, @@ -936,10 +940,14 @@ void lammps_gather_atoms(void *ptr, char *name, ------------------------------------------------------------------------- */ #if defined(LAMMPS_BIGBIG) -void lammps_gather_atoms_concat(void * /*ptr*/, char * /*name */, +void lammps_gather_atoms_concat(void *ptr, char * /*name */, int /*type*/, int /*count*/, void * /*data*/) { + LAMMPS *lmp = (LAMMPS *) ptr; + + BEGIN_CAPTURE lmp->error->all(FLERR,"Library function lammps_gather_atoms_concat() not compatible with -DLAMMPS_BIGBIG"); + END_CAPTURE } #else void lammps_gather_atoms_concat(void *ptr, char *name, @@ -1088,11 +1096,15 @@ void lammps_gather_atoms_concat(void *ptr, char *name, ------------------------------------------------------------------------- */ #if defined(LAMMPS_BIGBIG) -void lammps_gather_atoms_subset(void * /*ptr*/, char * /*name */, +void lammps_gather_atoms_subset(void *ptr, char * /*name */, int /*type*/, int /*count*/, int /*ndata*/, int * /*ids*/, void * /*data*/) { + LAMMPS *lmp = (LAMMPS *) ptr; + + BEGIN_CAPTURE lmp->error->all(FLERR,"Library function lammps_gather_atoms_subset() not compatible with -DLAMMPS_BIGBIG"); + END_CAPTURE } #else void lammps_gather_atoms_subset(void *ptr, char *name, @@ -1231,10 +1243,14 @@ void lammps_gather_atoms_subset(void *ptr, char *name, ------------------------------------------------------------------------- */ #if defined(LAMMPS_BIGBIG) -void lammps_scatter_atoms(void * /*ptr*/, char * /*name */, +void lammps_scatter_atoms(void *ptr, char * /*name */, int /*type*/, int /*count*/, void * /*data*/) { + LAMMPS *lmp = (LAMMPS *) ptr; + + BEGIN_CAPTURE lmp->error->all(FLERR,"Library function lammps_scatter_atoms() not compatible with -DLAMMPS_BIGBIG"); + END_CAPTURE } #else void lammps_scatter_atoms(void *ptr, char *name, @@ -1352,11 +1368,15 @@ void lammps_scatter_atoms(void *ptr, char *name, ------------------------------------------------------------------------- */ #if defined(LAMMPS_BIGBIG) -void lammps_scatter_atoms_subset(void * /*ptr*/, char * /*name */, +void lammps_scatter_atoms_subset(void *ptr, char * /*name */, int /*type*/, int /*count*/, int /*ndata*/, int * /*ids*/, void * /*data*/) { + LAMMPS *lmp = (LAMMPS *) ptr; + + BEGIN_CAPTURE lmp->error->all(FLERR,"Library function lammps_scatter_atoms_subset() not compatible with -DLAMMPS_BIGBIG"); + END_CAPTURE } #else void lammps_scatter_atoms_subset(void *ptr, char *name, From 74ce164457494ddb4ced33721214199ab729ee2e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 12:06:51 -0400 Subject: [PATCH 28/38] restore lost edit to all_on.cmake and all_off.cmake that syncs the list of packages --- cmake/presets/all_off.cmake | 25 +++++++++++-------------- cmake/presets/all_on.cmake | 25 +++++++++++-------------- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/cmake/presets/all_off.cmake b/cmake/presets/all_off.cmake index 80a12c6991..0e37611da4 100644 --- a/cmake/presets/all_off.cmake +++ b/cmake/presets/all_off.cmake @@ -1,20 +1,17 @@ # preset that turns on all existing packages off. can be used to reset # an existing package selection without losing any other settings -set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU - GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MEAM MISC - MOLECULE MPIIO MSCG OPT PERI POEMS - PYTHON QEQ REAX REPLICA RIGID SHOCK SNAP SRD VORONOI) - -set(USER_PACKAGES USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS - USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD - USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO - USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE - USER-NETCDF USER-OMP USER-PHONON USER-QMMM USER-QTB - USER-QUIP USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY - USER-UEF USER-VTK) - -set(ALL_PACKAGES ${STANDARD_PACKAGES} ${USER_PACKAGES}) +set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU + GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MISC MOLECULE MPIIO + MSCG OPT PERI POEMS PYTHON QEQ REPLICA RIGID SHOCK SNAP SPIN SRD + VORONOI + USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK + USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP + USER-H5MD USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO + USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP + USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP + USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH + USER-TALLY USER-UEF USER-VTK USER-YAFF) foreach(PKG ${ALL_PACKAGES}) set(PKG_${PKG} OFF CACHE BOOL "" FORCE) diff --git a/cmake/presets/all_on.cmake b/cmake/presets/all_on.cmake index b66434df63..a24403c847 100644 --- a/cmake/presets/all_on.cmake +++ b/cmake/presets/all_on.cmake @@ -2,20 +2,17 @@ # this preset with the nolib.cmake preset should configure a LAMMPS # binary, that can be compiled with just a working C++ compiler. -set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU - GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MEAM MISC - MOLECULE MPIIO MSCG OPT PERI POEMS - PYTHON QEQ REAX REPLICA RIGID SHOCK SNAP SRD VORONOI) - -set(USER_PACKAGES USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS - USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD - USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO - USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE - USER-NETCDF USER-OMP USER-PHONON USER-QMMM USER-QTB - USER-QUIP USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY - USER-UEF USER-VTK) - -set(ALL_PACKAGES ${STANDARD_PACKAGES} ${USER_PACKAGES}) +set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU + GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MISC MOLECULE MPIIO + MSCG OPT PERI POEMS PYTHON QEQ REPLICA RIGID SHOCK SNAP SPIN SRD + VORONOI + USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK + USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP + USER-H5MD USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO + USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP + USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP + USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH + USER-TALLY USER-UEF USER-VTK USER-YAFF) foreach(PKG ${ALL_PACKAGES}) set(PKG_${PKG} ON CACHE BOOL "" FORCE) From cb5c3f900ef3edf4268b071779f819b951f5142a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 12:41:12 -0400 Subject: [PATCH 29/38] add minimal.cmake and most.cmake presets --- cmake/presets/all_on.cmake | 5 +++-- cmake/presets/minimal.cmake | 8 ++++++++ cmake/presets/most.cmake | 15 +++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 cmake/presets/minimal.cmake create mode 100644 cmake/presets/most.cmake diff --git a/cmake/presets/all_on.cmake b/cmake/presets/all_on.cmake index a24403c847..57f1228abe 100644 --- a/cmake/presets/all_on.cmake +++ b/cmake/presets/all_on.cmake @@ -1,6 +1,7 @@ # preset that turns on all existing packages. using the combination -# this preset with the nolib.cmake preset should configure a LAMMPS -# binary, that can be compiled with just a working C++ compiler. +# this preset followed by the nolib.cmake preset should configure a +# LAMMPS binary, with as many packages included, that can be compiled +# with just a working C++ compiler and an MPI library. set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MISC MOLECULE MPIIO diff --git a/cmake/presets/minimal.cmake b/cmake/presets/minimal.cmake new file mode 100644 index 0000000000..e9ce6d6103 --- /dev/null +++ b/cmake/presets/minimal.cmake @@ -0,0 +1,8 @@ +# preset that turns on just a few, frequently used packages +# this will be compiled quickly and handle a lot of common inputs. + +set(ALL_PACKAGES KSPACE MANYBODY MOLECULE RIGID) + +foreach(PKG ${ALL_PACKAGES}) + set(PKG_${PKG} ON CACHE BOOL "" FORCE) +endforeach() diff --git a/cmake/presets/most.cmake b/cmake/presets/most.cmake new file mode 100644 index 0000000000..eed4599670 --- /dev/null +++ b/cmake/presets/most.cmake @@ -0,0 +1,15 @@ +# preset that turns on a wide range of packages none of which require +# external libraries. Some more unusual packages are removed as well. +# The resulting binary should be able to run most inputs. + +set(ALL_PACKAGES ASPHERE CLASS2 COLLOID CORESHELL DIPOLE + GRANULAR KSPACE MANYBODY MC MISC MOLECULE OPT PERI + QEQ REPLICA RIGID SHOCK SRD + USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD + USER-DRUDE USER-FEP USER-MEAMC USER-MESO + USER-MISC USER-MOFFF USER-OMP USER-PHONON USER-REAXC + USER-SPH USER-UEF USER-YAFF) + +foreach(PKG ${ALL_PACKAGES}) + set(PKG_${PKG} ON CACHE BOOL "" FORCE) +endforeach() From 5a751254262718bc8f3a4293c3311b923b82a735 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 14:30:34 -0400 Subject: [PATCH 30/38] add some popular packages requiring libraries to most.cmake preset --- cmake/presets/most.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/presets/most.cmake b/cmake/presets/most.cmake index eed4599670..35ad7ba55c 100644 --- a/cmake/presets/most.cmake +++ b/cmake/presets/most.cmake @@ -1,14 +1,14 @@ -# preset that turns on a wide range of packages none of which require -# external libraries. Some more unusual packages are removed as well. -# The resulting binary should be able to run most inputs. +# preset that turns on a wide range of packages, some of which require +# external libraries. Compared to all_on.cmake some more unusual packages +# are removed. The resulting binary should be able to run most inputs. set(ALL_PACKAGES ASPHERE CLASS2 COLLOID CORESHELL DIPOLE GRANULAR KSPACE MANYBODY MC MISC MOLECULE OPT PERI - QEQ REPLICA RIGID SHOCK SRD + PYTHON QEQ REPLICA RIGID SHOCK SRD VORONOI USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-FEP USER-MEAMC USER-MESO - USER-MISC USER-MOFFF USER-OMP USER-PHONON USER-REAXC - USER-SPH USER-UEF USER-YAFF) + USER-MISC USER-MOFFF USER-OMP USER-PLUMED USER-PHONON USER-REAXC + USER-SPH USER-SMD USER-UEF USER-YAFF) foreach(PKG ${ALL_PACKAGES}) set(PKG_${PKG} ON CACHE BOOL "" FORCE) From 4824992a1e2f367f026daefeeb4ed19857df4124 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 14:31:13 -0400 Subject: [PATCH 31/38] update documentation for recent changes to CMake presets --- doc/src/Build_cmake.txt | 3 ++- doc/src/Build_package.txt | 28 +++++++++++++++++----------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/doc/src/Build_cmake.txt b/doc/src/Build_cmake.txt index 5c29e11280..69d5d31f54 100644 --- a/doc/src/Build_cmake.txt +++ b/doc/src/Build_cmake.txt @@ -108,7 +108,8 @@ command-line options. Several useful ones are: -D CMAKE_BUILD_TYPE=type # type = Release or Debug -G output # style of output CMake generates -DVARIABLE=value # setting for a LAMMPS feature to enable --D VARIABLE=value # ditto, but cannot come after CMakeLists.txt dir :pre +-D VARIABLE=value # ditto, but cannot come after CMakeLists.txt dir +-C path/to/preset/file # load some CMake settings before configuring :pre All the LAMMPS-specific -D variables that a LAMMPS build supports are described on the pages linked to from the "Build"_Build.html doc page. diff --git a/doc/src/Build_package.txt b/doc/src/Build_package.txt index c5eca96edb..774cdda6a1 100644 --- a/doc/src/Build_package.txt +++ b/doc/src/Build_package.txt @@ -149,26 +149,32 @@ system. Using these files you can enable/disable portions of the available packages in LAMMPS. If you need a custom preset you can take one of them as a starting point and customize it to your needs. -cmake -C ../cmake/presets/all_on.cmake \[OPTIONS\] ../cmake | enable all packages +cmake -C ../cmake/presets/all_on.cmake \[OPTIONS\] ../cmake | enable all packages cmake -C ../cmake/presets/all_off.cmake \[OPTIONS\] ../cmake | disable all packages -cmake -C ../cmake/presets/std.cmake \[OPTIONS\] ../cmake | enable standard packages -cmake -C ../cmake/presets/user.cmake \[OPTIONS\] ../cmake | enable user packages -cmake -C ../cmake/presets/std_nolib.cmake \[OPTIONS\] ../cmake | enable standard packages that do not require extra libraries -cmake -C ../cmake/presets/nolib.cmake \[OPTIONS\] ../cmake | disable all packages that do not require extra libraries -cmake -C ../cmake/presets/manual_selection.cmake \[OPTIONS\] ../cmake | example of how to create a manual selection of packages :tb(s=|,a=l) +cmake -C ../cmake/presets/minimal.cmake \[OPTIONS\] ../cmake | enable just a few core packages +cmake -C ../cmake/presets/most.cmake \[OPTIONS\] ../cmake | enable most common packages +cmake -C ../cmake/presets/nolib.cmake \[OPTIONS\] ../cmake | disable packages that do require extra libraries or tools +cmake -C ../cmake/presets/mingw.cmake \[OPTIONS\] ../cmake | enable all packages compatible with MinGW (cross-)compilation on Windows :tb(s=|,a=l)s NOTE: Running cmake this way manipulates the variable cache in your -current build directory. You can combine presets and options with -multiple cmake runs. +current build directory. You can combine multiple presets and options +with multiple cmake runs. [Example:] -# build LAMMPS with all "standard" packages which don't -# use libraries and enable GPU package +# build LAMMPS with most commonly used packages, but then remove +# those requiring additional library or tools, but still enable +# GPU package and configure it for using CUDA. You can run. mkdir build cd build -cmake -C ../cmake/presets/std_nolib.cmake -D PKG_GPU=on ../cmake :pre +cmake -C ../cmake/presets/most.cmake -C ../cmake/presets/nolib.cmake -D PKG_GPU=on -D GPU_API=cuda ../cmake :pre +# to add another package, say BODY to the previous configuration you can run: +cmake -D PKG_BODY=on . :pre + +# to reset the package selection from above to the default of no packages +# but leaving all other settings untouched. You can run: +cmake -C ../cmake/presets/no_all.cmake . :pre :line [Make shortcuts for installing many packages]: From 98bd720c684cd3f56c4925b763b070a0270cffb7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 14:56:51 -0400 Subject: [PATCH 32/38] improved formatting of cmake settings and presets related docs --- doc/src/Build_cmake.txt | 5 +++-- doc/src/Build_package.txt | 21 ++++++++++++++------- doc/src/Build_settings.txt | 13 ++++++++----- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/doc/src/Build_cmake.txt b/doc/src/Build_cmake.txt index 69d5d31f54..265c16e3d4 100644 --- a/doc/src/Build_cmake.txt +++ b/doc/src/Build_cmake.txt @@ -28,7 +28,7 @@ Makefile(s). Example: cd lammps # change to the LAMMPS distribution directory mkdir build; cd build # create a new directory (folder) for build -cmake ../cmake \[options ...\] # configuration with (command-line) cmake +cmake \[options ...\] ../cmake # configuration with (command-line) cmake make # compilation :pre The cmake command will detect available features, enable selected @@ -41,7 +41,8 @@ If your machine has multiple CPU cores (most do these days), using a command like "make -jN" (with N being the number of available local CPU cores) can be much faster. If you plan to do development on LAMMPS or need to re-compile LAMMPS repeatedly, installation of the -ccache (= Compiler Cache) software may speed up compilation even more. +ccache (= Compiler Cache) software may speed up repeated compilation +even more. After compilation, you can optionally copy the LAMMPS executable and library into your system folders (by default under $HOME/.local) with: diff --git a/doc/src/Build_package.txt b/doc/src/Build_package.txt index 774cdda6a1..e37936e052 100644 --- a/doc/src/Build_package.txt +++ b/doc/src/Build_package.txt @@ -149,16 +149,23 @@ system. Using these files you can enable/disable portions of the available packages in LAMMPS. If you need a custom preset you can take one of them as a starting point and customize it to your needs. -cmake -C ../cmake/presets/all_on.cmake \[OPTIONS\] ../cmake | enable all packages -cmake -C ../cmake/presets/all_off.cmake \[OPTIONS\] ../cmake | disable all packages -cmake -C ../cmake/presets/minimal.cmake \[OPTIONS\] ../cmake | enable just a few core packages -cmake -C ../cmake/presets/most.cmake \[OPTIONS\] ../cmake | enable most common packages -cmake -C ../cmake/presets/nolib.cmake \[OPTIONS\] ../cmake | disable packages that do require extra libraries or tools -cmake -C ../cmake/presets/mingw.cmake \[OPTIONS\] ../cmake | enable all packages compatible with MinGW (cross-)compilation on Windows :tb(s=|,a=l)s +cmake -C ../cmake/presets/all_on.cmake \[OPTIONS\] ../cmake | + enable all packages | +cmake -C ../cmake/presets/all_off.cmake \[OPTIONS\] ../cmake | + disable all packages | +cmake -C ../cmake/presets/minimal.cmake \[OPTIONS\] ../cmake | + enable just a few core packages | +cmake -C ../cmake/presets/most.cmake \[OPTIONS\] ../cmake | + enable most common packages | +cmake -C ../cmake/presets/nolib.cmake \[OPTIONS\] ../cmake | + disable packages that do require extra libraries or tools | +cmake -C ../cmake/presets/mingw.cmake \[OPTIONS\] ../cmake | + enable all packages compatible with MinGW compilers :tb(c=2,s=|,a=l) NOTE: Running cmake this way manipulates the variable cache in your current build directory. You can combine multiple presets and options -with multiple cmake runs. +in a single cmake run, or change settings incrementally by running +cmake with new flags. [Example:] diff --git a/doc/src/Build_settings.txt b/doc/src/Build_settings.txt index f1db9f0130..287cd39ff6 100644 --- a/doc/src/Build_settings.txt +++ b/doc/src/Build_settings.txt @@ -57,10 +57,10 @@ FFT_INC = -DFFT_SINGLE # do not specify for double precision FFT_INC = -DFFT_PACK_ARRAY # or -DFFT_PACK_POINTER or -DFFT_PACK_MEMCPY :pre # default is FFT_PACK_ARRAY if not specified -FFT_INC = -I/usr/local/include +FFT_INC = -I/usr/local/include FFT_PATH = -L/usr/local/lib -FFT_LIB = -lfftw3 # FFTW3 double precision -FFT_LIB = -lfftw3 -lfftw3f # FFTW3 single precision +FFT_LIB = -lfftw3 # FFTW3 double precision +FFT_LIB = -lfftw3 -lfftw3f # FFTW3 single precision FFT_LIB = -lmkl_intel_lp64 -lmkl_sequential -lmkl_core # MKL with Intel compiler FFT_LIB = -lmkl_gf_lp64 -lmkl_sequential -lmkl_core # MKL with GNU compier :pre @@ -179,8 +179,11 @@ e.g. from 511 to -512, which can cause diagnostics like the mean-squared displacement, as calculated by the "compute msd"_compute_msd.html command, to be faulty. -Note that the USER-ATC package is not currently compatible with the -"bigbig" setting. +Note that the USER-ATC package and the USER-INTEL package are currently +not compatible with the "bigbig" setting. Also, there are limitations +when using the library interface. Some functions with known issues +have been replaced by dummy calls printing a corresponding error rather +than crashing randomly or corrupting data. Also note that the GPU package requires its lib/gpu library to be compiled with the same size setting, or the link will fail. A CMake From 978b52ee8c90a74ee316e3f9578d05ce2409a5fd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 15:06:56 -0400 Subject: [PATCH 33/38] add warning/status messages about skipping TBB malloc and MKL RNG --- cmake/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 39d1e4e382..dd693255a6 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1106,16 +1106,21 @@ if(PKG_USER-INTEL) list(APPEND LAMMPS_LINK_LIBS ${TBB_MALLOC_LIBRARIES}) else() add_definitions(-DLMP_INTEL_NO_TBB) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + message(WARNING "USER-INTEL with Intel compilers should use TBB malloc libraries") + endif() endif() find_package(MKL QUIET) if(MKL_FOUND) add_definitions(-DLMP_USE_MKL_RNG) list(APPEND LAMMPS_LINK_LIBS ${MKL_LIBRARIES}) + else() + message(STATUS "Pair style dpd/intel will be faster with MKL libraries") endif() if((NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") AND (NOT ${LAMMPS_MEMALIGN} STREQUAL "64") AND (NOT ${LAMMPS_MEMALIGN} STREQUAL "128") AND (NOT ${LAMMPS_MEMALIGN} STREQUAL "256")) - message(FATAL_ERROR "USER-INTEL only supports memory alignment of 64, 128 or 256") + message(FATAL_ERROR "USER-INTEL only supports memory alignment of 64, 128 or 256 on this platform") endif() if(INTEL_ARCH STREQUAL "KNL") From 34b023456b6c0b0f57ab7a7fb6d37e03eeee16f9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 15:28:48 -0400 Subject: [PATCH 34/38] add message about -DLAMMPS_BIGBIG incompatibility of scatter/gather functions --- doc/src/Howto_library.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/src/Howto_library.txt b/doc/src/Howto_library.txt index 40a8bf0a70..7bbf08a964 100644 --- a/doc/src/Howto_library.txt +++ b/doc/src/Howto_library.txt @@ -166,9 +166,6 @@ void lammps_gather_atoms_subset(void *, char *, int, int, int, int *, void *) void lammps_scatter_atoms(void *, char *, int, int, void *) void lammps_scatter_atoms_subset(void *, char *, int, int, int, int *, void *) :pre -void lammps_create_atoms(void *, int, tagint *, int *, double *, double *, - imageint *, int) :pre - The gather functions collect peratom info of the requested type (atom coords, atom types, forces, etc) from all processors, and returns the same vector of values to each calling processor. The scatter @@ -176,6 +173,11 @@ functions do the inverse. They distribute a vector of peratom values, passed by all calling processors, to individual atoms, which may be owned by different processors. +IMPORTANT NOTE: These functions are not compatible with the +-DLAMMPS_BIGBIG setting when compiling LAMMPS. Dummy functions +that result in an error message and abort will be subsituted +instead of resulting in random crashes and memory corruption. + The lammps_gather_atoms() function does this for all N atoms in the system, ordered by atom ID, from 1 to N. The lammps_gather_atoms_concat() function does it for all N atoms, but @@ -196,6 +198,9 @@ those values to each atom in the system. The lammps_scatter_atoms_subset() function takes a subset of IDs as an argument and only scatters those values to the owning atoms. +void lammps_create_atoms(void *, int, tagint *, int *, double *, double *, + imageint *, int) :pre + The lammps_create_atoms() function takes a list of N atoms as input with atom types and coords (required), an optionally atom IDs and velocities and image flags. It uses the coords of each atom to assign From 365166fef0f0b898b61dbf6de818e8f4f2c804fd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 16:01:42 -0400 Subject: [PATCH 35/38] print warning messages about calls to self only once --- src/STUBS/mpi.c | 60 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/src/STUBS/mpi.c b/src/STUBS/mpi.c index 053108fee8..09bb48ecdc 100644 --- a/src/STUBS/mpi.c +++ b/src/STUBS/mpi.c @@ -200,7 +200,11 @@ int MPI_Request_free(MPI_Request *request) int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { - printf("MPI Stub WARNING: Should not send message to self\n"); + static int callcount=0; + if (callcount == 0) { + printf("MPI Stub WARNING: Should not send message to self\n"); + ++callcount; + } return 0; } @@ -209,7 +213,11 @@ int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request) { - printf("MPI Stub WARNING: Should not send message to self\n"); + static int callcount=0; + if (callcount == 0) { + printf("MPI Stub WARNING: Should not send message to self\n"); + ++callcount; + } return 0; } @@ -218,7 +226,11 @@ int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { - printf("MPI Stub WARNING: Should not rsend message to self\n"); + static int callcount=0; + if (callcount == 0) { + printf("MPI Stub WARNING: Should not rsend message to self\n"); + ++callcount; + } return 0; } @@ -227,7 +239,11 @@ int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status) { - printf("MPI Stub WARNING: Should not recv message from self\n"); + static int callcount=0; + if (callcount == 0) { + printf("MPI Stub WARNING: Should not recv message from self\n"); + ++callcount; + } return 0; } @@ -236,7 +252,11 @@ int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request) { - printf("MPI Stub WARNING: Should not recv message from self\n"); + static int callcount=0; + if (callcount == 0) { + printf("MPI Stub WARNING: Should not recv message from self\n"); + ++callcount; + } return 0; } @@ -244,7 +264,11 @@ int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int MPI_Wait(MPI_Request *request, MPI_Status *status) { - printf("MPI Stub WARNING: Should not wait on message from self\n"); + static int callcount=0; + if (callcount == 0) { + printf("MPI Stub WARNING: Should not wait on message from self\n"); + ++callcount; + } return 0; } @@ -252,7 +276,11 @@ int MPI_Wait(MPI_Request *request, MPI_Status *status) int MPI_Waitall(int n, MPI_Request *request, MPI_Status *status) { - printf("MPI Stub WARNING: Should not wait on message from self\n"); + static int callcount=0; + if (callcount == 0) { + printf("MPI Stub WARNING: Should not wait on message from self\n"); + ++callcount; + } return 0; } @@ -261,7 +289,11 @@ int MPI_Waitall(int n, MPI_Request *request, MPI_Status *status) int MPI_Waitany(int count, MPI_Request *request, int *index, MPI_Status *status) { - printf("MPI Stub WARNING: Should not wait on message from self\n"); + static int callcount=0; + if (callcount == 0) { + printf("MPI Stub WARNING: Should not wait on message from self\n"); + ++callcount; + } return 0; } @@ -272,7 +304,11 @@ int MPI_Sendrecv(const void *sbuf, int scount, MPI_Datatype sdatatype, MPI_Datatype rdatatype, int source, int rtag, MPI_Comm comm, MPI_Status *status) { - printf("MPI Stub WARNING: Should not send message to self\n"); + static int callcount=0; + if (callcount == 0) { + printf("MPI Stub WARNING: Should not send message to self\n"); + ++callcount; + } return 0; } @@ -280,7 +316,11 @@ int MPI_Sendrecv(const void *sbuf, int scount, MPI_Datatype sdatatype, int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count) { - printf("MPI Stub WARNING: Should not get count of message to self\n"); + static int callcount=0; + if (callcount == 0) { + printf("MPI Stub WARNING: Should not get count of message to self\n"); + ++callcount; + } return 0; } From 4a003644feb7d7c9fb2fdd034803da7c364132f3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 16:41:02 -0400 Subject: [PATCH 36/38] fix typo --- doc/src/Howto_library.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/Howto_library.txt b/doc/src/Howto_library.txt index 7bbf08a964..7695fd59e2 100644 --- a/doc/src/Howto_library.txt +++ b/doc/src/Howto_library.txt @@ -175,7 +175,7 @@ owned by different processors. IMPORTANT NOTE: These functions are not compatible with the -DLAMMPS_BIGBIG setting when compiling LAMMPS. Dummy functions -that result in an error message and abort will be subsituted +that result in an error message and abort will be substiuted instead of resulting in random crashes and memory corruption. The lammps_gather_atoms() function does this for all N atoms in the From 6411ff8359cfbb1d05ec943bf86017ac119d6773 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 17:25:26 -0400 Subject: [PATCH 37/38] transfer MPI/OpenMP selection from LAMMPS to downloaded Plumed library configuration --- cmake/CMakeLists.txt | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index dd693255a6..59caf8ca9f 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -560,6 +560,20 @@ if(PKG_USER-PLUMED) option(DOWNLOAD_PLUMED "Download Plumed package instead of using an already installed one" OFF) if(DOWNLOAD_PLUMED) + if(BUILD_MPI) + set(PLUMED_CONFIG_MPI "--enable-mpi") + set(PLUMED_CONFIG_CC ${CMAKE_MPI_C_COMPILER}) + set(PLUMED_CONFIG_CXX ${CMAKE_MPI_CXX_COMPILER}) + else() + set(PLUMED_CONFIG_MPI "--disable-mpi") + set(PLUMED_CONFIG_CC ${CMAKE_C_COMPILER}) + set(PLUMED_CONFIG_CXX ${CMAKE_CXX_COMPILER}) + endif() + if(BUILD_OMP) + set(PLUMED_CONFIG_OMP "--enable-openmp") + else() + set(PLUMED_CONFIG_OMP "--disable-openmp") + endif() message(STATUS "PLUMED download requested - we will build our own") include(ExternalProject) ExternalProject_Add(plumed_build @@ -568,9 +582,11 @@ if(PKG_USER-PLUMED) BUILD_IN_SOURCE 1 CONFIGURE_COMMAND /configure --prefix= ${CONFIGURE_REQUEST_PIC} - --enable-modules=all - CXX=${CMAKE_MPI_CXX_COMPILER} - CC=${CMAKE_MPI_C_COMPILER} + --enable-modules=all + ${PLUMED_CONFIG_MPI} + ${PLUMED_CONFIG_OMP} + CXX=${PLUMED_CONFIG_CXX} + CC=${PLUMED_CONFIG_CC} ) ExternalProject_get_property(plumed_build INSTALL_DIR) set(PLUMED_INSTALL_DIR ${INSTALL_DIR}) From bd923d8bd4c2b07a830fdd92b8cb50c41d4a799f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Apr 2019 17:33:35 -0400 Subject: [PATCH 38/38] fix second typo in the same word. i need a break... :-( --- doc/src/Howto_library.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/Howto_library.txt b/doc/src/Howto_library.txt index 7695fd59e2..ba009cfad9 100644 --- a/doc/src/Howto_library.txt +++ b/doc/src/Howto_library.txt @@ -175,7 +175,7 @@ owned by different processors. IMPORTANT NOTE: These functions are not compatible with the -DLAMMPS_BIGBIG setting when compiling LAMMPS. Dummy functions -that result in an error message and abort will be substiuted +that result in an error message and abort will be substituted instead of resulting in random crashes and memory corruption. The lammps_gather_atoms() function does this for all N atoms in the