From e56d69a267a38796478f4840465aa85067f87854 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Apr 2019 15:51:32 -0400 Subject: [PATCH 01/34] silence compiler warnings --- src/RIGID/fix_shake.cpp | 2 +- src/USER-OMP/reaxc_forces_omp.cpp | 4 ++-- src/USER-REAXC/reaxc_traj.cpp | 4 ++-- src/group.cpp | 4 ++-- src/memory.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index 1e8414d321..23ced2d0e7 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -1390,7 +1390,7 @@ void FixShake::shake_info(int *npartner, tagint **partner_tag, ------------------------------------------------------------------------- */ int FixShake::rendezvous_ids(int n, char *inbuf, - int &flag, int *&proclist, char *&outbuf, + int &flag, int *& /*proclist*/, char *& /*outbuf*/, void *ptr) { FixShake *fsptr = (FixShake *) ptr; diff --git a/src/USER-OMP/reaxc_forces_omp.cpp b/src/USER-OMP/reaxc_forces_omp.cpp index 1e1cf44f50..0a08bd6a46 100644 --- a/src/USER-OMP/reaxc_forces_omp.cpp +++ b/src/USER-OMP/reaxc_forces_omp.cpp @@ -262,8 +262,8 @@ void Compute_Total_ForceOMP( reax_system *system, control_params *control, /* ---------------------------------------------------------------------- */ -void Validate_ListsOMP( reax_system *system, storage * /*workspace */, reax_list **lists, - int step, int n, int N, int numH, MPI_Comm comm ) +void Validate_ListsOMP(reax_system *system, storage * /*workspace*/, reax_list **lists, + int step, int n, int N, int numH, MPI_Comm /*comm*/) { int i, comp, Hindex; reax_list *bonds, *hbonds; diff --git a/src/USER-REAXC/reaxc_traj.cpp b/src/USER-REAXC/reaxc_traj.cpp index 5adc0cfbb9..356d7b6eeb 100644 --- a/src/USER-REAXC/reaxc_traj.cpp +++ b/src/USER-REAXC/reaxc_traj.cpp @@ -58,7 +58,7 @@ void Write_Skip_Line( output_controls *out_control, mpi_datatypes * /*mpi_data*/ int Write_Header( reax_system *system, control_params *control, - output_controls *out_control, mpi_datatypes *mpi_data ) + output_controls *out_control, mpi_datatypes * /*mpi_data*/ ) { int num_hdr_lines, my_hdr_lines, buffer_req; char ensembles[ens_N][25] = { "NVE", "NVT", "fully flexible NPT", @@ -357,7 +357,7 @@ int Init_Traj( reax_system *system, control_params *control, int Write_Frame_Header( reax_system *system, control_params *control, simulation_data *data, output_controls *out_control, - mpi_datatypes *mpi_data ) + mpi_datatypes * /*mpi_data*/ ) { int me, num_frm_hdr_lines, my_frm_hdr_lines, buffer_req; diff --git a/src/group.cpp b/src/group.cpp index 6c19af8bc6..256bab7778 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -40,7 +40,7 @@ using namespace LAMMPS_NS; #define MAX_GROUP 32 #define EPSILON 1.0e-6 -enum{TYPE,MOLECULE,ID}; +enum{NONE,TYPE,MOLECULE,ID}; enum{LT,LE,GT,GE,EQ,NEQ,BETWEEN}; #define BIG 1.0e20 @@ -202,7 +202,7 @@ void Group::assign(int narg, char **arg) if (narg < 3) error->all(FLERR,"Illegal group command"); - int category; + int category=NONE; if (strcmp(arg[1],"type") == 0) category = TYPE; else if (strcmp(arg[1],"molecule") == 0) category = MOLECULE; else if (strcmp(arg[1],"id") == 0) category = ID; diff --git a/src/memory.h b/src/memory.h index b5d70b977f..c5eddc7fe7 100644 --- a/src/memory.h +++ b/src/memory.h @@ -477,7 +477,7 @@ class Memory : protected Pointers { } template - TYPE *****grow(TYPE *****&array, int n1, int n2, int n3, int n4, + TYPE *****grow(TYPE *****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/, const char *name) { fail(name); return NULL; From d17553d8d294d6a6598526f5dcfaa3305a783fde Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Apr 2019 16:52:28 -0400 Subject: [PATCH 02/34] add preset to make it easier to use clang with OpenMP and MPI --- cmake/presets/clang.cmake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 cmake/presets/clang.cmake diff --git a/cmake/presets/clang.cmake b/cmake/presets/clang.cmake new file mode 100644 index 0000000000..224f140dc1 --- /dev/null +++ b/cmake/presets/clang.cmake @@ -0,0 +1,16 @@ +# preset that will enable clang/clang++ with support for MPI and OpenMP (on Linux boxes) + +set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "" FORCE) +set(CMAKE_C_COMPILER "clang" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS "-Wall -Wextra -g -O2 -DNDEBG" CACHE STRING "" FORCE) +set(MPI_CXX "clang++" CACHE STRING "" FORCE) +set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE) + +set(OpenMP_C "clang" CACHE STRING "" FORCE) +set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE) +set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE) +set(OpenMP_CXX "clang++" CACHE STRING "" FORCE) +set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE) +set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE) +set(OpenMP_omp_LIBRARY "/usr/lib64/libomp.so" CACHE PATH "" FORCE) + From 3d7a4fb9459feb6018ccdcd609aae87b4c3c11eb Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Apr 2019 17:04:07 -0400 Subject: [PATCH 03/34] silence compiler warnings, remove dead code --- src/USER-REAXC/reaxc_init_md.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/USER-REAXC/reaxc_init_md.cpp b/src/USER-REAXC/reaxc_init_md.cpp index 39b31c38b5..df5de49034 100644 --- a/src/USER-REAXC/reaxc_init_md.cpp +++ b/src/USER-REAXC/reaxc_init_md.cpp @@ -156,7 +156,7 @@ int Init_MPI_Datatypes( reax_system *system, storage * /*workspace*/, int Init_Lists( reax_system *system, control_params *control, simulation_data * /*data*/, storage * /*workspace*/, reax_list **lists, - mpi_datatypes *mpi_data, char * /*msg*/ ) + mpi_datatypes * /*mpi_data*/, char * /*msg*/ ) { int i, total_hbonds, total_bonds, bond_cap, num_3body, cap_3body, Htop; int *hb_top, *bond_top; @@ -219,8 +219,6 @@ void Initialize( reax_system *system, control_params *control, mpi_datatypes *mpi_data, MPI_Comm comm ) { char msg[MAX_STR]; - char errmsg[128]; - if (Init_MPI_Datatypes(system, workspace, mpi_data, comm, msg) == FAILURE) { control->error_ptr->one(FLERR,"Could not create datatypes"); From de0938da39a2d27f68e67dc69d9c7694d691123c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Apr 2019 23:24:43 -0400 Subject: [PATCH 04/34] avoid segfault when catching command line flag errors with EXCEPTIONS enabled --- src/error.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/error.cpp b/src/error.cpp index 913239ac49..7c2d3c5409 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -72,7 +72,9 @@ void Error::universe_all(const char *file, int line, const char *str) #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - update->whichflag = 0; + // update may be NULL when catching command line errors + + if (update) update->whichflag = 0; char msg[100]; snprintf(msg, 100, "ERROR: %s (%s:%d)\n", str, truncpath(file), line); @@ -97,7 +99,9 @@ void Error::universe_one(const char *file, int line, const char *str) #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - update->whichflag = 0; + // update may be NULL when catching command line errors + + if (update) update->whichflag = 0; char msg[100]; snprintf(msg, 100, "ERROR: %s (%s:%d)\n", str, truncpath(file), line); @@ -148,7 +152,9 @@ void Error::all(const char *file, int line, const char *str) #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - update->whichflag = 0; + // update may be NULL when catching command line errors + + if (update) update->whichflag = 0; char msg[100]; snprintf(msg, 100, "ERROR: %s (%s:%d)\n", str, truncpath(file), line); @@ -198,7 +204,9 @@ void Error::one(const char *file, int line, const char *str) #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - update->whichflag = 0; + // update may be NULL when catching command line errors + + if (update) update->whichflag = 0; char msg[100]; snprintf(msg, 100, "ERROR on proc %d: %s (%s:%d)\n", me, str, truncpath(file), line); From f10534a7213911264cf42eef674535c9b941a7e5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Apr 2019 23:56:23 -0400 Subject: [PATCH 05/34] add code to build msi2lmp with CMake --- cmake/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index b9a93a110e..69f695dc92 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1446,9 +1446,18 @@ if(BUILD_EXE) if(ENABLE_TESTING) add_test(ShowHelp ${LAMMPS_BINARY} -help) endif() + + enable_language(C) + get_filename_component(MSI2LMP_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../tools/msi2lmp/src ABSOLUTE) + file(GLOB MSI2LMP_SOURCES ${MSI2LMP_SOURCE_DIR}/[^.]*.c) + add_executable(msi2lmp ${MSI2LMP_SOURCES}) + target_link_libraries(msi2lmp m) + install(TARGETS msi2lmp DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() + ############################################################################### # Build documentation ############################################################################### From 9334c72c04fba8cbbe17cba1c063d17658f05f66 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 08:59:06 -0400 Subject: [PATCH 06/34] clang can be installed supporting OpenMP without having omp.h installed: add check --- cmake/CMakeLists.txt | 6 +++++- cmake/presets/clang.cmake | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 69f695dc92..2fe3ebe184 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -320,10 +320,15 @@ pkg_depends(USER-LB MPI) pkg_depends(USER-PHONON KSPACE) pkg_depends(USER-SCAFACOS MPI) +include(CheckIncludeFileCXX) find_package(OpenMP QUIET) option(BUILD_OMP "Build with OpenMP support" ${OpenMP_FOUND}) if(BUILD_OMP) find_package(OpenMP REQUIRED) + check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE) + if(NOT HAVE_OMP_H_INCLUDE) + message(FATAL_ERROR "Cannot find required 'omp.h' header file") + endif() set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") endif() @@ -796,7 +801,6 @@ endif() ######################################################################## # Basic system tests (standard libraries, headers, functions, types) # ######################################################################## -include(CheckIncludeFileCXX) foreach(HEADER cmath) check_include_file_cxx(${HEADER} FOUND_${HEADER}) if(NOT FOUND_${HEADER}) diff --git a/cmake/presets/clang.cmake b/cmake/presets/clang.cmake index 224f140dc1..828f359f54 100644 --- a/cmake/presets/clang.cmake +++ b/cmake/presets/clang.cmake @@ -5,6 +5,7 @@ set(CMAKE_C_COMPILER "clang" CACHE STRING "" FORCE) set(CMAKE_CXX_FLAGS "-Wall -Wextra -g -O2 -DNDEBG" CACHE STRING "" FORCE) set(MPI_CXX "clang++" CACHE STRING "" FORCE) set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE) +unset(HAVE_OMP_H_INCLUDE CACHE) set(OpenMP_C "clang" CACHE STRING "" FORCE) set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE) From bca7364ba3c015ae44f10c3fecd80615617707a2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 09:21:50 -0400 Subject: [PATCH 07/34] disallow using fdotr for computing virial contributions with reax/c/omp --- src/USER-OMP/pair_reaxc_omp.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/USER-OMP/pair_reaxc_omp.cpp b/src/USER-OMP/pair_reaxc_omp.cpp index a98f7c89d9..f42e9be36e 100644 --- a/src/USER-OMP/pair_reaxc_omp.cpp +++ b/src/USER-OMP/pair_reaxc_omp.cpp @@ -91,6 +91,7 @@ PairReaxCOMP::PairReaxCOMP(LAMMPS *lmp) : PairReaxC(lmp), ThrOMP(lmp, THR_PAIR) { if (lmp->citeme) lmp->citeme->add(cite_pair_reax_c_omp); + no_virial_fdotr_compute = 1; suffix_flag |= Suffix::OMP; system->pair_ptr = this; system->omp_active = 1; From bcb6e1be4fd272f3ea4d0be0b56b6976b3a5b8de Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 09:45:19 -0400 Subject: [PATCH 08/34] disable fdotr for virial also for regular pair style reax/c --- src/USER-OMP/pair_reaxc_omp.cpp | 2 +- src/USER-REAXC/pair_reaxc.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/USER-OMP/pair_reaxc_omp.cpp b/src/USER-OMP/pair_reaxc_omp.cpp index f42e9be36e..90846b71f1 100644 --- a/src/USER-OMP/pair_reaxc_omp.cpp +++ b/src/USER-OMP/pair_reaxc_omp.cpp @@ -194,7 +194,7 @@ void PairReaxCOMP::compute(int eflag, int vflag) evdwl = ecoul = 0.0; ev_init(eflag,vflag); - if (vflag_global) control->virial = 1; + if (vflag_either) control->virial = 1; else control->virial = 0; system->n = atom->nlocal; // my atoms diff --git a/src/USER-REAXC/pair_reaxc.cpp b/src/USER-REAXC/pair_reaxc.cpp index a65c738766..cb8338da72 100644 --- a/src/USER-REAXC/pair_reaxc.cpp +++ b/src/USER-REAXC/pair_reaxc.cpp @@ -73,6 +73,7 @@ PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp) one_coeff = 1; manybody_flag = 1; ghostneigh = 1; + no_virial_fdotr_compute = 1; system = (reax_system *) memory->smalloc(sizeof(reax_system),"reax:system"); @@ -511,7 +512,7 @@ void PairReaxC::compute(int eflag, int vflag) evdwl = ecoul = 0.0; ev_init(eflag,vflag); - if (vflag_global) control->virial = 1; + if (vflag_either) control->virial = 1; else control->virial = 0; system->n = atom->nlocal; // my atoms From efa8c8d58b9ffba4a287f9d5203e4344c0dc698f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 11:21:43 -0400 Subject: [PATCH 09/34] sanitize file pointer access handling --- src/USER-REAXC/reaxc_io_tools.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/USER-REAXC/reaxc_io_tools.cpp b/src/USER-REAXC/reaxc_io_tools.cpp index a4f0db7c7d..51aa8bca0f 100644 --- a/src/USER-REAXC/reaxc_io_tools.cpp +++ b/src/USER-REAXC/reaxc_io_tools.cpp @@ -92,13 +92,15 @@ int Close_Output_Files( reax_system *system, control_params *control, End_Traj( system->my_rank, out_control ); if (system->my_rank == MASTER_NODE) { - if (out_control->energy_update_freq > 0) { + if (out_control->pot) { fclose( out_control->pot ); + out_control->pot = NULL; } - if( control->ensemble == NPT || control->ensemble == iNPT || - control->ensemble == sNPT ) - fclose( out_control->prs ); + if (out_control->prs) { + fclose(out_control->prs); + out_control->prs = NULL; + } } return SUCCESS; @@ -122,7 +124,7 @@ void Output_Results( reax_system *system, control_params *control, out_control->energy_update_freq > 0 && data->step % out_control->energy_update_freq == 0 ) { - if (control->virial) { + if (control->virial && out_control->prs) { fprintf( out_control->prs, "%8d%13.6f%13.6f%13.6f%13.6f%13.6f%13.6f%13.6f\n", data->step, From d6a12f6c3e02dabf8926dd788e2e1d256a1f86c9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 11:22:22 -0400 Subject: [PATCH 10/34] roll back ineffective changes and add zeroing of allocated storage --- src/USER-REAXC/pair_reaxc.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/USER-REAXC/pair_reaxc.cpp b/src/USER-REAXC/pair_reaxc.cpp index cb8338da72..3f80f2101d 100644 --- a/src/USER-REAXC/pair_reaxc.cpp +++ b/src/USER-REAXC/pair_reaxc.cpp @@ -73,12 +73,13 @@ PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp) one_coeff = 1; manybody_flag = 1; ghostneigh = 1; - no_virial_fdotr_compute = 1; system = (reax_system *) memory->smalloc(sizeof(reax_system),"reax:system"); + memset(system,0,sizeof(reax_system)); control = (control_params *) memory->smalloc(sizeof(control_params),"reax:control"); + memset(control,0,sizeof(control_params)); data = (simulation_data *) memory->smalloc(sizeof(simulation_data),"reax:data"); workspace = (storage *) @@ -88,6 +89,7 @@ PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp) memset(lists,0,LIST_N * sizeof(reax_list)); out_control = (output_controls *) memory->smalloc(sizeof(output_controls),"reax:out_control"); + memset(out_control,0,sizeof(output_controls)); mpi_data = (mpi_datatypes *) memory->smalloc(sizeof(mpi_datatypes),"reax:mpi"); @@ -512,7 +514,7 @@ void PairReaxC::compute(int eflag, int vflag) evdwl = ecoul = 0.0; ev_init(eflag,vflag); - if (vflag_either) control->virial = 1; + if (vflag_global) control->virial = 1; else control->virial = 0; system->n = atom->nlocal; // my atoms From 8683e1ebf83cb625d7e89ac23623d78d0cec4a44 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 11:24:59 -0400 Subject: [PATCH 11/34] revert ineffective changes --- src/USER-OMP/pair_reaxc_omp.cpp | 3 +-- src/USER-OMP/reaxc_nonbonded_omp.cpp | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/USER-OMP/pair_reaxc_omp.cpp b/src/USER-OMP/pair_reaxc_omp.cpp index 90846b71f1..a98f7c89d9 100644 --- a/src/USER-OMP/pair_reaxc_omp.cpp +++ b/src/USER-OMP/pair_reaxc_omp.cpp @@ -91,7 +91,6 @@ PairReaxCOMP::PairReaxCOMP(LAMMPS *lmp) : PairReaxC(lmp), ThrOMP(lmp, THR_PAIR) { if (lmp->citeme) lmp->citeme->add(cite_pair_reax_c_omp); - no_virial_fdotr_compute = 1; suffix_flag |= Suffix::OMP; system->pair_ptr = this; system->omp_active = 1; @@ -194,7 +193,7 @@ void PairReaxCOMP::compute(int eflag, int vflag) evdwl = ecoul = 0.0; ev_init(eflag,vflag); - if (vflag_either) control->virial = 1; + if (vflag_global) control->virial = 1; else control->virial = 0; system->n = atom->nlocal; // my atoms diff --git a/src/USER-OMP/reaxc_nonbonded_omp.cpp b/src/USER-OMP/reaxc_nonbonded_omp.cpp index 41b1474791..a93cd54931 100644 --- a/src/USER-OMP/reaxc_nonbonded_omp.cpp +++ b/src/USER-OMP/reaxc_nonbonded_omp.cpp @@ -213,9 +213,9 @@ void vdW_Coulomb_Energy_OMP( reax_system *system, control_params *control, rvec_ScaledSum( delij, 1., system->my_atoms[i].x, -1., system->my_atoms[j].x ); f_tmp = -(CEvd + CEclmb); - pair_reax_ptr->ev_tally_thr_proxy( system->pair_ptr, i, j, natoms, - 1, pe_vdw, e_ele, f_tmp, - delij[0], delij[1], delij[2], thr); + pair_reax_ptr->ev_tally_thr_proxy(system->pair_ptr, i, j, natoms, + 1, pe_vdw, e_ele, f_tmp, + delij[0], delij[1], delij[2], thr); } if (control->virial == 0) { From cb27d03c79c22bc2316e838098d8cb0358e61b59 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 11:27:04 -0400 Subject: [PATCH 12/34] stop with error message when computing per-atom stress for reax/c/omp --- src/USER-OMP/pair_reaxc_omp.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/USER-OMP/pair_reaxc_omp.cpp b/src/USER-OMP/pair_reaxc_omp.cpp index a98f7c89d9..927a63a90f 100644 --- a/src/USER-OMP/pair_reaxc_omp.cpp +++ b/src/USER-OMP/pair_reaxc_omp.cpp @@ -196,6 +196,10 @@ void PairReaxCOMP::compute(int eflag, int vflag) if (vflag_global) control->virial = 1; else control->virial = 0; + if (vflag_atom) + error->all(FLERR,"Pair style reax/c/omp does not support " + "computing per-atom stress"); + system->n = atom->nlocal; // my atoms system->N = atom->nlocal + atom->nghost; // mine + ghosts system->bigN = static_cast (atom->natoms); // all atoms in the system From 6643a4ec9274c2c661df414a8bf41c04ff07b1e1 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Sat, 6 Apr 2019 14:20:21 -0500 Subject: [PATCH 13/34] Fixup FindKIM-API.cmake and clean up some v2 remnants --- cmake/Modules/FindKIM-API.cmake | 6 +++--- src/KIM/kim_query.cpp | 2 +- src/KIM/kim_query.h | 2 +- src/KIM/pair_kim.cpp | 4 ++-- src/KIM/pair_kim.h | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmake/Modules/FindKIM-API.cmake b/cmake/Modules/FindKIM-API.cmake index d9397b9aba..beef92db59 100644 --- a/cmake/Modules/FindKIM-API.cmake +++ b/cmake/Modules/FindKIM-API.cmake @@ -41,9 +41,9 @@ include(FindPackageHandleStandardArgs) pkg_check_modules(KIM-API REQUIRED libkim-api>=2.0) -pkg_get_variable(KIM-API-V2-CMAKE_C_COMPILER libkim-api CMAKE_C_COMPILER) -pkg_get_variable(KIM-API-V2-CMAKE_CXX_COMPILER libkim-api CMAKE_CXX_COMPILER) -pkg_get_variable(KIM-API-V2_CMAKE_Fortran_COMPILER libkim-api CMAKE_Fortran_COMPILER) +pkg_get_variable(KIM-API-CMAKE_C_COMPILER libkim-api CMAKE_C_COMPILER) +pkg_get_variable(KIM-API-CMAKE_CXX_COMPILER libkim-api CMAKE_CXX_COMPILER) +pkg_get_variable(KIM-API_CMAKE_Fortran_COMPILER libkim-api CMAKE_Fortran_COMPILER) # handle the QUIETLY and REQUIRED arguments and set KIM-API_FOUND to TRUE # if all listed variables are TRUE diff --git a/src/KIM/kim_query.cpp b/src/KIM/kim_query.cpp index 7480703ce8..fedc976110 100644 --- a/src/KIM/kim_query.cpp +++ b/src/KIM/kim_query.cpp @@ -52,7 +52,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Designed for use with the kim-api-v2-2.0.0 (and newer) package + Designed for use with the kim-api-2.0.2 (and newer) package ------------------------------------------------------------------------- */ #include diff --git a/src/KIM/kim_query.h b/src/KIM/kim_query.h index ed5a7c88f3..3644e4519b 100644 --- a/src/KIM/kim_query.h +++ b/src/KIM/kim_query.h @@ -51,7 +51,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Designed for use with the kim-api-v2-2.0.0 (and newer) package + Designed for use with the kim-api-2.0.2 (and newer) package ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index ea5f24a67e..157a782f20 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -50,7 +50,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Designed for use with the kim-api-v2-2.0.0 (and newer) package + Designed for use with the kim-api-2.0.2 (and newer) package ------------------------------------------------------------------------- */ #include @@ -313,7 +313,7 @@ void PairKIM::settings(int narg, char **arg) (0 == strcmp("LAMMPSvirial", arg[0])))) { error->all(FLERR,"'KIMvirial' or 'LAMMPSvirial' not supported with " - "kim-api-v2."); + "kim-api."); } else error->all(FLERR,"Illegal pair_style command"); diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index a6f882347d..27bab6c687 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -50,7 +50,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Designed for use with the kim-api-v2-2.0.0 (and newer) package + Designed for use with the kim-api-2.0.2 (and newer) package ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS @@ -182,9 +182,9 @@ E: KIM Compute returned error The KIM model was unable, for some reason, to complete the computation. -E: 'KIMvirial' or 'LAMMPSvirial' not supported with kim-api-v2. +E: 'KIMvirial' or 'LAMMPSvirial' not supported with kim-api. -"KIMvirial or "LAMMPSvirial" found on the pair_style line. These keys are not supported kim-api-v2. (The virial computation is always performed by LAMMPS.) Please remove these keys, make sure the KIM model you are using supports kim-api-v2, and rerun. +"KIMvirial or "LAMMPSvirial" found on the pair_style line. These keys are not supported kim-api. (The virial computation is always performed by LAMMPS.) Please remove these keys, make sure the KIM model you are using supports kim-api, and rerun. E: Illegal pair_style command From 47b74379762a42f63c3fd679bd0a13b873f60422 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Sat, 6 Apr 2019 15:08:15 -0500 Subject: [PATCH 14/34] Have FindKIM-API.cmake work in QUIET mode --- cmake/Modules/FindKIM-API.cmake | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/cmake/Modules/FindKIM-API.cmake b/cmake/Modules/FindKIM-API.cmake index beef92db59..5108b0f98c 100644 --- a/cmake/Modules/FindKIM-API.cmake +++ b/cmake/Modules/FindKIM-API.cmake @@ -36,14 +36,23 @@ # KIM-API-CMAKE_CXX_COMPILER # KIM-API-CMAKE_Fortran_COMPILER # -find_package(PkgConfig REQUIRED) + +if(KIM-API_FIND_QUIETLY) + set(REQ_OR_QUI "QUIET") +else() + set(REQ_OR_QUI "REQUIRED") +endif() + +find_package(PkgConfig ${REQ_OR_QUI}) include(FindPackageHandleStandardArgs) -pkg_check_modules(KIM-API REQUIRED libkim-api>=2.0) +pkg_check_modules(KIM-API ${REQ_OR_QUI} libkim-api>=2.0) -pkg_get_variable(KIM-API-CMAKE_C_COMPILER libkim-api CMAKE_C_COMPILER) -pkg_get_variable(KIM-API-CMAKE_CXX_COMPILER libkim-api CMAKE_CXX_COMPILER) -pkg_get_variable(KIM-API_CMAKE_Fortran_COMPILER libkim-api CMAKE_Fortran_COMPILER) +if(KIM-API_FOUND) + pkg_get_variable(KIM-API-CMAKE_C_COMPILER libkim-api CMAKE_C_COMPILER) + pkg_get_variable(KIM-API-CMAKE_CXX_COMPILER libkim-api CMAKE_CXX_COMPILER) + pkg_get_variable(KIM-API_CMAKE_Fortran_COMPILER libkim-api CMAKE_Fortran_COMPILER) +endif() # handle the QUIETLY and REQUIRED arguments and set KIM-API_FOUND to TRUE # if all listed variables are TRUE From 3070a110413d88e2356a2db168924ba5272d6b3a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 16:23:10 -0400 Subject: [PATCH 15/34] guard against extracting too many elements from the MEAM library into the statically sized arrays this will abort with a meaningful error message and people can fix up their LAMMPS binary as needed. --- src/USER-MEAMC/pair_meamc.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/USER-MEAMC/pair_meamc.cpp b/src/USER-MEAMC/pair_meamc.cpp index 3a934694bf..a70fb77aae 100644 --- a/src/USER-MEAMC/pair_meamc.cpp +++ b/src/USER-MEAMC/pair_meamc.cpp @@ -226,6 +226,9 @@ void PairMEAMC::coeff(int narg, char **arg) } nelements = narg - 4 - atom->ntypes; if (nelements < 1) error->all(FLERR,"Incorrect args for pair coefficients"); + if (nelements > maxelt) + error->all(FLERR,"Too many elements extracted from MEAM library. " + "Increase 'maxelt' in meam.h and recompile."); elements = new char*[nelements]; mass = new double[nelements]; From 59a4d422319fbf1f158395b4b56dc205f7428035 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 16:47:48 -0400 Subject: [PATCH 16/34] make default CMake setting for DOWNLOAD_KIM depend on whether the KIM API is found or not --- cmake/CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 2fe3ebe184..4c83269563 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -690,7 +690,12 @@ if(PKG_KIM) list(APPEND LAMMPS_LINK_LIBS ${CURL_LIBRARIES}) add_definitions(-DLMP_KIM_CURL) endif() - option(DOWNLOAD_KIM "Download KIM-API from OpenKIM instead of using an already installed one" OFF) + find_package(KIM-API QUIET) + if(KIM-API_FOUND) + option(DOWNLOAD_KIM "Download KIM-API from OpenKIM instead of using an already installed one" OFF) + else() + option(DOWNLOAD_KIM "Download KIM-API from OpenKIM instead of using an already installed one" ON) + endif() if(DOWNLOAD_KIM) message(STATUS "KIM-API download requested - we will build our own") enable_language(C) @@ -711,10 +716,7 @@ if(PKG_KIM) set(KIM-API_LDFLAGS ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libkim-api${CMAKE_SHARED_LIBRARY_SUFFIX}) list(APPEND LAMMPS_DEPS kim_build) else() - find_package(KIM-API) - if(NOT KIM-API_FOUND) - message(FATAL_ERROR "KIM-API not found, help CMake to find it by setting PKG_CONFIG_PATH, or set DOWNLOAD_KIM=ON to download it") - endif() + find_package(KIM-API REQUIRED) endif() list(APPEND LAMMPS_LINK_LIBS "${KIM-API_LDFLAGS}") include_directories(${KIM-API_INCLUDE_DIRS}) From 86f4080b71bab8d70b382a893b113a22140c3105 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 16:48:29 -0400 Subject: [PATCH 17/34] some dead code removal in pair style kim. --- src/KIM/pair_kim.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 157a782f20..eee9c1c4e9 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -189,8 +189,6 @@ void PairKIM::set_contributing() void PairKIM::compute(int eflag , int vflag) { - int kimerror; - ev_init(eflag,vflag); // grow kim_particleSpecies and kim_particleContributing array if necessary @@ -238,7 +236,7 @@ void PairKIM::compute(int eflag , int vflag) lmps_local_tot_num_atoms = (int) nall; // compute via KIM model - kimerror = KIM_Model_Compute(pkim, pargs); + int kimerror = KIM_Model_Compute(pkim, pargs); if (kimerror) error->all(FLERR,"KIM Compute returned error"); // compute virial before reverse comm! @@ -434,10 +432,9 @@ void PairKIM::coeff(int narg, char **arg) kim_particle_codes = new int[lmps_num_unique_elements]; kim_particle_codes_ok = true; for(int i = 0; i < lmps_num_unique_elements; i++){ - int kimerror; int supported; int code; - kimerror = KIM_Model_GetSpeciesSupportAndCode( + KIM_Model_GetSpeciesSupportAndCode( pkim, KIM_SpeciesName_FromString(lmps_unique_elements[i]), &supported, @@ -468,8 +465,6 @@ void PairKIM::init_style() if (domain->dimension != 3) error->all(FLERR,"PairKIM only works with 3D problems"); - int kimerror; - // setup lmps_stripped_neigh_list for neighbors of one atom, if needed if (lmps_using_molecular) { memory->destroy(lmps_stripped_neigh_list); @@ -720,9 +715,8 @@ int PairKIM::get_neigh(void const * const dataObject, *numberOfNeighbors = 0; NeighList * neiobj = Model->neighborLists[neighborListIndex]; - int nAtoms = Model->lmps_local_tot_num_atoms; - int j, jj, inum, *ilist, *numneigh, **firstneigh; + int inum, *ilist, *numneigh, **firstneigh; inum = neiobj->inum; //# of I atoms neighbors are stored for ilist = neiobj->ilist; //local indices of I atoms numneigh = neiobj->numneigh; // # of J neighbors for each I atom @@ -750,8 +744,6 @@ int PairKIM::get_neigh(void const * const dataObject, void PairKIM::kim_free() { - int kimerror; - if (kim_init_ok) { int kimerror = KIM_Model_ComputeArgumentsDestroy(pkim, &pargs); From f98aed419c2d3a61e8f8fa8eb91c8ecf73683bd4 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 17:03:24 -0400 Subject: [PATCH 18/34] document the 'maxelt' define in pair style meam/c and how to change it --- doc/src/pair_meamc.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/src/pair_meamc.txt b/doc/src/pair_meamc.txt index b57339b180..80f69b1a46 100644 --- a/doc/src/pair_meamc.txt +++ b/doc/src/pair_meamc.txt @@ -357,6 +357,13 @@ The {meam/c} style is provided in the USER-MEAMC package. It is only enabled if LAMMPS was built with that package. See the "Build package"_Build_package.html doc page for more info. +The maximum number of elements, that can be read from the MEAM +library file, is determined at compile time. The default is 5. +If you need support for more elements, you have to change the +define for the constant 'maxelt' at the beginning of the file +src/USER-MEAMC/meam.h and update/recompile LAMMPS. There is no +limit on the number of atoms types. + [Related commands:] "pair_coeff"_pair_coeff.html, "pair_style eam"_pair_eam.html, From 8c02ce730205c718f526a3aab2697f478b42e2e3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 17:03:40 -0400 Subject: [PATCH 19/34] silence some compiler warnings --- src/VORONOI/compute_voronoi_atom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VORONOI/compute_voronoi_atom.cpp b/src/VORONOI/compute_voronoi_atom.cpp index f884530fd9..860126fa77 100644 --- a/src/VORONOI/compute_voronoi_atom.cpp +++ b/src/VORONOI/compute_voronoi_atom.cpp @@ -642,7 +642,7 @@ void ComputeVoronoi::compute_local() /* ---------------------------------------------------------------------- */ int ComputeVoronoi::pack_forward_comm(int n, int *list, double *buf, - int pbc_flag, int *pbc) + int /* pbc_flag */, int * /* pbc */) { int i,m=0; for (i = 0; i < n; ++i) buf[m++] = rfield[list[i]]; From 72b69783decf82415b4119152228c113c8f7cdca Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 17:17:17 -0400 Subject: [PATCH 20/34] add download-default-if-not-found logic to voro++ library for VORONOI package --- cmake/CMakeLists.txt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 4c83269563..91b5fe5377 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -448,7 +448,13 @@ endif() if(PKG_VORONOI) - option(DOWNLOAD_VORO "Download and compile the Voro++ library instead of using an already installed one" OFF) + find_package(VORO QUIET) + if(VORO_FOUND) + set(DOWNLOAD_VORO_DEFAULT OFF) + else() + set(DOWNLOAD_VORO_DEFAULT ON) + endif() + option(DOWNLOAD_VORO "Download and compile the Voro++ library instead of using an already installed one" ${DOWNLOAD_VORO_DEFAULT}) if(DOWNLOAD_VORO) message(STATUS "Voro++ download requested - we will build our own") include(ExternalProject) @@ -692,10 +698,11 @@ if(PKG_KIM) endif() find_package(KIM-API QUIET) if(KIM-API_FOUND) - option(DOWNLOAD_KIM "Download KIM-API from OpenKIM instead of using an already installed one" OFF) + set(DOWNLOAD_KIM_DEFAULT OFF) else() - option(DOWNLOAD_KIM "Download KIM-API from OpenKIM instead of using an already installed one" ON) + set(DOWNLOAD_KIM_DEFAULT ON) endif() + option(DOWNLOAD_KIM "Download KIM-API from OpenKIM instead of using an already installed one" ${DOWNLOAD_KIM_DEFAULT}) if(DOWNLOAD_KIM) message(STATUS "KIM-API download requested - we will build our own") enable_language(C) From cb398bd0267e1d8c205551c0767c0147d8ba9e2d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 17:23:37 -0400 Subject: [PATCH 21/34] silence some more compiler warnings --- src/KIM/pair_kim.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index eee9c1c4e9..a1c13ae81f 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -671,9 +671,9 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf) va[j*6+4]+=buf[m++]; va[j*6+5]+=buf[m++]; } + } else { + ; // do nothing } - else - ;// do nothing return; } @@ -716,9 +716,7 @@ int PairKIM::get_neigh(void const * const dataObject, NeighList * neiobj = Model->neighborLists[neighborListIndex]; - int inum, *ilist, *numneigh, **firstneigh; - inum = neiobj->inum; //# of I atoms neighbors are stored for - ilist = neiobj->ilist; //local indices of I atoms + int *numneigh, **firstneigh; numneigh = neiobj->numneigh; // # of J neighbors for each I atom firstneigh = neiobj->firstneigh; // ptr to 1st J int value of each I atom @@ -1035,10 +1033,10 @@ void PairKIM::set_kim_model_has_flags() for (int i = 0; i < numberOfComputeArgumentNames; ++i) { KIM_ComputeArgumentName computeArgumentName; - int kimerror = KIM_COMPUTE_ARGUMENT_NAME_GetComputeArgumentName( + KIM_COMPUTE_ARGUMENT_NAME_GetComputeArgumentName( i, &computeArgumentName); KIM_SupportStatus supportStatus; - kimerror = KIM_ComputeArguments_GetArgumentSupportStatus( + KIM_ComputeArguments_GetArgumentSupportStatus( pargs, computeArgumentName, &supportStatus); if (KIM_ComputeArgumentName_Equal(computeArgumentName, @@ -1097,10 +1095,10 @@ void PairKIM::set_kim_model_has_flags() for (int i = 0; i < numberOfComputeCallbackNames; ++i) { KIM_ComputeCallbackName computeCallbackName; - int kimerror = KIM_COMPUTE_CALLBACK_NAME_GetComputeCallbackName( + KIM_COMPUTE_CALLBACK_NAME_GetComputeCallbackName( i, &computeCallbackName); KIM_SupportStatus supportStatus; - kimerror = KIM_ComputeArguments_GetCallbackSupportStatus( + KIM_ComputeArguments_GetCallbackSupportStatus( pargs, computeCallbackName, &supportStatus); if (KIM_SupportStatus_Equal(supportStatus, KIM_SUPPORT_STATUS_required)) From 494e76da7d3db4b5ecaae5dd36419c9f9f0db46c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 17:29:04 -0400 Subject: [PATCH 22/34] add false positive --- doc/utils/sphinx-config/false_positives.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 0596179daa..c6d301f2fe 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -1543,6 +1543,7 @@ Mattox Mattson maxangle maxbond +maxelt maxeval maxfiles Maxfoo From b25657c67bbfab5ad35c36c42672ad8f7ed70940 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 17:49:56 -0400 Subject: [PATCH 23/34] trigger download by default if not found for LATTE package/library --- cmake/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 91b5fe5377..47a37f1db5 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -448,7 +448,7 @@ endif() if(PKG_VORONOI) - find_package(VORO QUIET) + find_package(VORO) if(VORO_FOUND) set(DOWNLOAD_VORO_DEFAULT OFF) else() @@ -487,7 +487,13 @@ if(PKG_VORONOI) endif() if(PKG_LATTE) - option(DOWNLOAD_LATTE "Download the LATTE library instead of using an already installed one" OFF) + find_package(LATTE) + if(LATTE_FOUND) + set(DOWNLOAD_LATTE_DEFAULT OFF) + else() + set(DOWNLOAD_LATTE_DEFAULT ON) + endif() + option(DOWNLOAD_LATTE "Download the LATTE library instead of using an already installed one" ${DOWNLOAD_LATTE_DEFAULT}) if(DOWNLOAD_LATTE) if (CMAKE_VERSION VERSION_LESS "3.7") # due to SOURCE_SUBDIR message(FATAL_ERROR "For downlading LATTE you need at least cmake-3.7") From 3b43fc3ea7de5d2b245dc2a7baa3ab71d3b57b35 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 20:41:00 -0400 Subject: [PATCH 24/34] install msi2lmp force field files and set environment variable, so they can be found automatically --- cmake/CMakeLists.txt | 5 ++++- cmake/etc/profile.d/lammps.csh.in | 4 +++- cmake/etc/profile.d/lammps.sh.in | 7 +++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 47a37f1db5..d17e9dab19 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1538,11 +1538,14 @@ if(BUILD_DOC) endif() ############################################################################### -# Install potential files in data directory +# Install potential and force field files in data directory ############################################################################### set(LAMMPS_POTENTIALS_DIR ${CMAKE_INSTALL_FULL_DATADIR}/lammps/potentials) install(DIRECTORY ${LAMMPS_SOURCE_DIR}/../potentials/ DESTINATION ${LAMMPS_POTENTIALS_DIR}) +set(LAMMPS_FRC_FILES_DIR ${CMAKE_INSTALL_FULL_DATADIR}/lammps/frc_files) +install(DIRECTORY ${LAMMPS_SOURCE_DIR}/../tools/msi2lmp/frc_files/ DESTINATION ${LAMMPS_FRC_FILES_DIR}) + configure_file(etc/profile.d/lammps.sh.in ${CMAKE_BINARY_DIR}/etc/profile.d/lammps.sh @ONLY) configure_file(etc/profile.d/lammps.csh.in ${CMAKE_BINARY_DIR}/etc/profile.d/lammps.csh @ONLY) install( diff --git a/cmake/etc/profile.d/lammps.csh.in b/cmake/etc/profile.d/lammps.csh.in index def49bf75c..42f222d67c 100644 --- a/cmake/etc/profile.d/lammps.csh.in +++ b/cmake/etc/profile.d/lammps.csh.in @@ -1,2 +1,4 @@ -# set environment for LAMMPS executables to find potential files +# set environment for LAMMPS and msi2lmp executables +# to find potential and force field files if ( "$?LAMMPS_POTENTIALS" == 0 ) setenv LAMMPS_POTENTIALS @LAMMPS_POTENTIALS_DIR@ +if ( "$?MSI2LMP_LIBRARY" == 0 ) setenv MSI2LMP_LIBRARY @LAMMPS_FRC_FILES_DIR@ diff --git a/cmake/etc/profile.d/lammps.sh.in b/cmake/etc/profile.d/lammps.sh.in index acd75fa0cf..c1967cb5b2 100644 --- a/cmake/etc/profile.d/lammps.sh.in +++ b/cmake/etc/profile.d/lammps.sh.in @@ -1,2 +1,5 @@ -# set environment for LAMMPS executables to find potential files -export LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS-@LAMMPS_POTENTIALS_DIR@} +# set environment for LAMMPS and msi2lmp executables +# to find potential and force field files +LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS-@LAMMPS_POTENTIALS_DIR@} +MSI2LMP_LIBRARY=${MSI2LMP_LIBRARY-@LAMMPS_FRC_FILES_DIR@} +export LAMMPS_POTENTIALS MSI2LMP_LIBRARY From a6c9a782a4fd5b39373f649d7287829e90f90d25 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 23:41:48 -0400 Subject: [PATCH 25/34] add manpage for msi2lmp --- cmake/CMakeLists.txt | 1 + doc/msi2lmp.1 | 111 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 doc/msi2lmp.1 diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index d17e9dab19..722c0992ba 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1472,6 +1472,7 @@ if(BUILD_EXE) add_executable(msi2lmp ${MSI2LMP_SOURCES}) target_link_libraries(msi2lmp m) install(TARGETS msi2lmp DESTINATION ${CMAKE_INSTALL_BINDIR}) + install(FILES ${LAMMPS_DOC_DIR}/msi2lmp.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) endif() diff --git a/doc/msi2lmp.1 b/doc/msi2lmp.1 new file mode 100644 index 0000000000..08a442e1de --- /dev/null +++ b/doc/msi2lmp.1 @@ -0,0 +1,111 @@ +.TH MSI2LMP "v3.9.9" "2018-11-05" +.SH NAME +.B MSI2LMP +\- Converter for Materials Studio files to LAMMPS + +.SH SYNOPSIS +.B msi2lmp + [-class ] [-frc ] [-print #] [-ignore] [-nocenter] [-oldstyle] [-shift ] + +.SH DESCRIPTION +.PP +.B MSI2LMP +is a tool bundled with LAMMPS to aide in the conversion of simulation +inputs from Biovia's Materials Studio software for use with LAMMPS. +It is a standalone program that generates a LAMMPS data file based on +the information in an MS .car file (atom coordinates), an .mdf file +(molecular topology and atom types) and an .frc (forcefield parameters) +file. The .car and .mdf files are specific to a molecular system while +the .frc file is specific to a forcefield (variant). The only coherency +needed between .frc and .car/.mdf files are the atom types. +.PP + +.SH OPTIONS +.TP +\fB\\fR +This has to be the first argument and is a +.B mandatory +argument. It defines the root of the file names; i.e. for a +.B +of benzene, you have to provide the files 'benzene.car' and 'benzene.mdf' +in the current working directory. +.B msi2lmp +will then read and process those files according to its remaining settings. +All other settins are optional and have defaults as listed. +.TP +\fB\-c \fR, \fB\-class \fR +The \-c or \-class option selects the force field class, i.e which pair +styles and bond styles and so on are required in the LAMMPS input file. +Class I or class 1 uses similar combination of functional forms as Amber +and Charmm force field and support the force fields +.B cvff +and +.B clayff. +Class II or class 2 corresponds to the more complex force fields +.B COMPASS +and +.B pcff. +Class O or class 0 finally is an experimental and incomplete extension +and supports generating output for +.B OPLS-AA +.TP +\fB\-f \fR, \fB\-frc \fR +The \-c or \-frc option allows the selection of the force field parameter +file +.B.frc. +Valid names for with this distribution are: cvff, clayff, cvff_aug, +pcff, compass_published, cff91, and oplsaa. If the argument is a pathname, +i.e. it starts with a '.' or a '/', then this absolute path is used to read +the force field, otherwise +.B msi2lmp +will look in the folder pointed to by the environment variable +$MSI2LMP_LIBRARY. If the variable is not set, then it will look in the current +directory. The extension '.frc' is appended, if missing. +Default is to look for the cvff.frc force field file. +.TP +\fB\-p \fR, \fB\-print \fR, +Selects the amount of information messages about the progress of the +conversion printed to the screen. +.B +can be a number from 0 (silent except for errors) to 3 (very detailed). +.TP +\fB\-i\fR, \fB\-ignore\fR, +Ignore errors about missing parameters and use 0.0 for the respective +force constants making these no-ops. Is correct to be used for a few +molecules and settings, but often an indication, that either the atom +type assignment have errors, or the force field file is missing entries. +.TP +\fB\-n\fR, \fB\-nocenter\fR, +Do not center the box around the (geometrical) center of the atoms, +but around the origin. Default is to recenter. +.TP +\fB\-o\fR, \fB\-oldstyle\fR, +Write out a data file without style hint comments to be compatible +with old LAMMPS versions. Default is to write out those comments. +.TP +\fB-s \fR, \fB-shift \fR, +Shift the entire system (box and coordinates) by a vector +(default: 0.0 0.0 0.0). +.TP + +.SH EXAMPLES + +msi2lmp benzene -c 2 -p 1 -f ../frc_files/pcff.frc + +msi2lmp benzene-class1 -c I + +msi2lmp decane -c 0 -f oplsaa + + +.SH COPYRIGHT +© 2003--2019 Sandia Corporation + +This package is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License version 2 as +published by the Free Software Foundation. + +This package is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + From 1dd21e6e0cb388cfb90369fa0ee62342abbcbe1a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 23:44:27 -0400 Subject: [PATCH 26/34] make downloaded LATTE library use the same BLAS/LAPACK as LAMMPS --- cmake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 722c0992ba..45698d2214 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -504,7 +504,7 @@ if(PKG_LATTE) URL https://github.com/lanl/LATTE/archive/v1.2.1.tar.gz URL_MD5 85ac414fdada2d04619c8f936344df14 SOURCE_SUBDIR cmake - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= ${CMAKE_REQUEST_PIC} + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= ${CMAKE_REQUEST_PIC} -DBLAS_LIBRARIES=${BLAS_LIBRARIES} -DLAPACK_LIBRARIES=${LAPACK_LIBRARIES} ) ExternalProject_get_property(latte_build INSTALL_DIR) set(LATTE_LIBRARIES ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/liblatte.a) From b40c4d1641e2cf6ea76e468be84c4aa5e25870ca Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Apr 2019 23:45:01 -0400 Subject: [PATCH 27/34] update version number and some reformatting of the LAMMPS manpage --- doc/lammps.1 | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/lammps.1 b/doc/lammps.1 index d49650bfaa..bf5891541f 100644 --- a/doc/lammps.1 +++ b/doc/lammps.1 @@ -1,25 +1,25 @@ -.TH LAMMPS "2018-08-22" +.TH LAMMPS "11 April 2019" "2019-04-11" .SH NAME .B LAMMPS \- Molecular Dynamics Simulator. .SH SYNOPSIS -.B lmp +.B lmp -in in.file or -mpirun \-np 2 -.B lmp +mpirun \-np 2 +.B lmp -in in.file .SH DESCRIPTION -.B LAMMPS -LAMMPS is a classical molecular dynamics code, and an acronym for Large-scale -Atomic/Molecular Massively Parallel Simulator. LAMMPS has potentials for soft -materials (biomolecules, polymers) and solid-state materials (metals, -semiconductors) and coarse-grained or mesoscopic systems. It can be used to -model atoms or, more generically, as a parallel particle simulator at the +.B LAMMPS +is a classical molecular dynamics code, and an acronym for Large-scale +Atomic/Molecular Massively Parallel Simulator. LAMMPS has potentials for soft +materials (biomolecules, polymers) and solid-state materials (metals, +semiconductors) and coarse-grained or mesoscopic systems. It can be used to +model atoms or, more generically, as a parallel particle simulator at the atomic, meso, or continuum scale. See http://lammps.sandia.gov/ for documentation. @@ -28,8 +28,8 @@ See http://lammps.sandia.gov/ for documentation. See https://lammps.sandia.gov/doc/Run_options.html for details on command-line options. -.SH COPYRIGHT -© 2003--2018 Sandia Corporation +.SH COPYRIGHT +© 2003--2019 Sandia Corporation This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by From e57e4a730bff3e3213ba512dcb470d34293cbbbb Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 7 Apr 2019 00:45:57 -0400 Subject: [PATCH 28/34] more packages with default-to-download-if-lib-not-found --- cmake/CMakeLists.txt | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 45698d2214..788989a68f 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -575,7 +575,16 @@ if(PKG_USER-PLUMED) validate_option(PLUMED_MODE PLUMED_MODE_VALUES) string(TOUPPER ${PLUMED_MODE} PLUMED_MODE) - option(DOWNLOAD_PLUMED "Download Plumed package instead of using an already installed one" OFF) + find_package(PkgConfig QUIET) + set(DOWNLOAD_PLUMED_DEFAULT ON) + if(PKG_CONFIG_FOUND) + pkg_check_modules(PLUMED QUIET plumed) + if(PLUMED_FOUND) + set(DOWNLOAD_PLUMED_DEFAULT OFF) + endif() + endif() + + option(DOWNLOAD_PLUMED "Download Plumed package instead of using an already installed one" ${DOWNLOAD_PLUMED_DEFAULT}) if(DOWNLOAD_PLUMED) if(BUILD_MPI) set(PLUMED_CONFIG_MPI "--enable-mpi") @@ -620,7 +629,7 @@ if(PKG_USER-PLUMED) set(PLUMED_INCLUDE_DIRS "${PLUMED_INSTALL_DIR}/include") else() find_package(PkgConfig REQUIRED) - pkg_check_modules(PLUMED plumed REQUIRED) + pkg_check_modules(PLUMED REQUIRED plumed) if(PLUMED_MODE STREQUAL "STATIC") add_definitions(-D__PLUMED_WRAPPER_CXX=1) include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.static) @@ -654,7 +663,13 @@ if(PKG_USER-NETCDF) endif() if(PKG_USER-SMD) - option(DOWNLOAD_EIGEN3 "Download Eigen3 instead of using an already installed one)" OFF) + find_package(Eigen3 NO_MODULE) + if(EIGEN3_FOUND) + set(DOWNLOAD_EIGEN3_DEFAULT OFF) + else() + set(DOWNLOAD_EIGEN3_DEFAULT ON) + endif() + option(DOWNLOAD_EIGEN3 "Download Eigen3 instead of using an already installed one)" ${DOWNLOAD_EIGEN3_DEFAULT}) if(DOWNLOAD_EIGEN3) message(STATUS "Eigen3 download requested - we will build our own") include(ExternalProject) @@ -767,7 +782,13 @@ endif() if(PKG_MSCG) find_package(GSL REQUIRED) - option(DOWNLOAD_MSCG "Download MSCG library instead of using an already installed one)" OFF) + find_package(MSCG QUIET) + if(MSGC_FOUND) + set(DOWNLOAD_MSCG_DEFAULT OFF) + else() + set(DOWNLOAD_MSCG_DEFAULT ON) + endif() + option(DOWNLOAD_MSCG "Download MSCG library instead of using an already installed one)" ${DOWNLOAD_MSCG_DEFAULT}) if(DOWNLOAD_MSCG) if (CMAKE_VERSION VERSION_LESS "3.7") # due to SOURCE_SUBDIR message(FATAL_ERROR "For downlading MSCG you need at least cmake-3.7") From 6f7b3643ef9c5e6a8440ad6b713cc2c851f1153c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 7 Apr 2019 00:46:43 -0400 Subject: [PATCH 29/34] document clang/clang++ preset with settings for MPI and OpenMP --- doc/src/Build_package.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/src/Build_package.txt b/doc/src/Build_package.txt index e37936e052..02d7e7b763 100644 --- a/doc/src/Build_package.txt +++ b/doc/src/Build_package.txt @@ -159,6 +159,8 @@ 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/clang.cmake \[OPTIONS\] ../cmake | + change settings to use the CLang compilers by default | cmake -C ../cmake/presets/mingw.cmake \[OPTIONS\] ../cmake | enable all packages compatible with MinGW compilers :tb(c=2,s=|,a=l) From 13cf357f665e6fc28e8c83bfe3b24d72abfed00b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 7 Apr 2019 00:47:10 -0400 Subject: [PATCH 30/34] document in README, that msi2lmp is now build alongside LAMMPS --- tools/msi2lmp/README | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/msi2lmp/README b/tools/msi2lmp/README index 9ac7af5607..bd658d897e 100644 --- a/tools/msi2lmp/README +++ b/tools/msi2lmp/README @@ -49,8 +49,12 @@ This program uses the .car and .mdf files from MSI/Biosyms's INSIGHT 1. Building msi2lmp - Use the Makefile in the src directory. It is - currently set up for gcc. You will have to modify + If you are using CMake to compile LAMMPS, the building + (and installation) of msi2lmp is included in the normal + build process. + + Otherwise you can use the Makefile in the src directory. + It is currently set up for gcc. You will have to modify it to use a different compiler. 2. Testing the program From e57c4c60bd8c27fa18259c6a777bb55f19e49775 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 7 Apr 2019 05:59:28 -0400 Subject: [PATCH 31/34] fix spelling issue --- doc/src/Build_package.txt | 2 +- doc/utils/sphinx-config/false_positives.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/src/Build_package.txt b/doc/src/Build_package.txt index 02d7e7b763..401f53f638 100644 --- a/doc/src/Build_package.txt +++ b/doc/src/Build_package.txt @@ -160,7 +160,7 @@ cmake -C ../cmake/presets/most.cmake \[OPTIONS\] ../cmake | cmake -C ../cmake/presets/nolib.cmake \[OPTIONS\] ../cmake | disable packages that do require extra libraries or tools | cmake -C ../cmake/presets/clang.cmake \[OPTIONS\] ../cmake | - change settings to use the CLang compilers by default | + change settings to use the Clang compilers by default | cmake -C ../cmake/presets/mingw.cmake \[OPTIONS\] ../cmake | enable all packages compatible with MinGW compilers :tb(c=2,s=|,a=l) diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index c6d301f2fe..a845673715 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -349,6 +349,7 @@ Cii Cij cis civ +Clang clearstore Cleary Clebsch From 8c4a497af4c21436436d89130482bb66ad7a9e4f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 7 Apr 2019 06:10:39 -0400 Subject: [PATCH 32/34] set default to automatically download scafacos lib if not found --- cmake/CMakeLists.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 788989a68f..69aff2d72d 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -520,7 +520,15 @@ endif() if(PKG_USER-SCAFACOS) find_package(GSL REQUIRED) - option(DOWNLOAD_SCAFACOS "Download ScaFaCoS library instead of using an already installed one" OFF) + find_package(PkgConfig QUIET) + set(DOWNLOAD_SCAFACOS_DEFAULT ON) + if(PKG_CONFIG_FOUND) + pkg_check_modules(SCAFACOS QUIET scafacos) + if(SCAFACOS_FOUND) + set(DOWNLOAD_SCAFACOS_DEFAULT OFF) + endif() + endif() + option(DOWNLOAD_SCAFACOS "Download ScaFaCoS library instead of using an already installed one" ${DOWNLOAD_SCAFACOS_DEFAULT}) if(DOWNLOAD_SCAFACOS) message(STATUS "ScaFaCoS download requested - we will build our own") include(ExternalProject) @@ -560,8 +568,8 @@ if(PKG_USER-SCAFACOS) list(APPEND LAMMPS_LINK_LIBS ${MPI_Fortran_LIBRARIES}) list(APPEND LAMMPS_LINK_LIBS ${MPI_C_LIBRARIES}) else() - FIND_PACKAGE(PkgConfig REQUIRED) - PKG_CHECK_MODULES(SCAFACOS scafacos REQUIRED) + find_package(PkgConfig REQUIRED) + pkg_check_modules(SCAFACOS REQUIRED scafacos) list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_LDFLAGS}) endif() include_directories(${SCAFACOS_INCLUDE_DIRS}) From 5c5b57be5a2f43d7bba4a027711c648e5eb0c300 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 7 Apr 2019 10:34:25 -0400 Subject: [PATCH 33/34] minor tweaks --- doc/src/Run_options.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/Run_options.txt b/doc/src/Run_options.txt index 9c12b3ff24..1c3cb60c5f 100644 --- a/doc/src/Run_options.txt +++ b/doc/src/Run_options.txt @@ -79,7 +79,7 @@ stdin. Explicitly enable or disable KOKKOS support, as provided by the KOKKOS package. Even if LAMMPS is built with this package, as described in "Speed kokkos"_Speed_kokkos.html, this switch must be set to enable -running with the KOKKOS-enabled styles the package provides. If the +running with KOKKOS-enabled styles the package provides. If the switch is not set (the default), LAMMPS will operate as if the KOKKOS package were not installed; i.e. you can run standard LAMMPS or with the GPU or USER-OMP packages, for testing or benchmarking purposes. @@ -448,7 +448,7 @@ partition screen files file.N. [-suffix style args] :link(suffix) Use variants of various styles if they exist. The specified style can -be {cuda}, {gpu}, {intel}, {kk}, {omp}, {opt}, or {hybrid}. These +be {gpu}, {intel}, {kk}, {omp}, {opt}, or {hybrid}. These refer to optional packages that LAMMPS can be built with, as described in "Accelerate performance"_Speed.html. The "gpu" style corresponds to the GPU package, the "intel" style to the USER-INTEL package, the "kk" From cb559659f80aca207fb44e568fc8af41e1add2f0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 7 Apr 2019 10:35:00 -0400 Subject: [PATCH 34/34] write a full-fledged LAMMPS manpage. --- doc/lammps.1 | 241 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 230 insertions(+), 11 deletions(-) diff --git a/doc/lammps.1 b/doc/lammps.1 index bf5891541f..4686198fef 100644 --- a/doc/lammps.1 +++ b/doc/lammps.1 @@ -5,36 +5,255 @@ .SH SYNOPSIS .B lmp --in in.file +\-in [OPTIONS] ... or mpirun \-np 2 .B lmp --in in.file + [OPTIONS] ... + +or + +.B lmp +\-r2data file.restart file.data .SH DESCRIPTION .B LAMMPS -is a classical molecular dynamics code, and an acronym for Large-scale -Atomic/Molecular Massively Parallel Simulator. LAMMPS has potentials for soft -materials (biomolecules, polymers) and solid-state materials (metals, +is a classical molecular dynamics code, and an acronym for \fBL\fRarge-scale +\fBA\fRtomic/\fBM\fRolecular \fBM\fRassively \fBP\fRarallel \fBS\fRimulator. +.B LAMMPS +has potentials for soft +materials (bio-molecules, polymers) and solid-state materials (metals, semiconductors) and coarse-grained or mesoscopic systems. It can be used to model atoms or, more generically, as a parallel particle simulator at the atomic, meso, or continuum scale. -See http://lammps.sandia.gov/ for documentation. +See https://lammps.sandia.gov/ for more information and documentation. + +.SH EXECUTABLE NAME +The +.B LAMMPS +executable can have different names depending on how it was configured, +compiled and installed. It will be either +.B lmp +or +.B lmp_. +The suffix corresponds to the (machine specific) makefile +used to compile +.B LAMMPS +when using the conventional build process. When building +.B LAMMPS +using +.B CMake +this parameter can be chosen arbitrarily at configuration +time, but more common is to just use +.B lmp +without a suffix. In this manpage we will use +.B lmp +to represent any of those names. .SH OPTIONS -See https://lammps.sandia.gov/doc/Run_options.html for details on -command-line options. + +.TP +\fB\-h\fR or \fB\-help\fR +Print a brief help summary and a list of settings and options compiled +into this executable. It also explicitly lists all LAMMPS styles +(atom_style, fix, compute, pair_style, bond_style, etc) available in +the specific executable. This can tell you if the command you want to +use was included via the appropriate package at compile time. +LAMMPS will print the info and immediately exit if this switch is used. +.TP +\fB\-e\fR or \fB\-echo\fR +Set the style of command echoing. The style can be +.B none +or +.B screen +or +.B log +or +.B both. +Depending on the style, each command read from the input script will +be echoed to the screen and/or logfile. This can be useful to figure +out which line of your script is causing an input error. +The default value is +.B log. +.TP +\fB\-i \fR or \fB\-in \fR +Specify a file to use as an input script. If it is not specified, +LAMMPS reads its script from standard input. This is a required +switch when running LAMMPS in multi-partition mode. +.TP +\fB\-k on/off [keyword value]\fR or \fB\-kokkos on/off [keyword value]\fR +Enable or disable general KOKKOS support, as provided by the KOKKOS +package. Even if LAMMPS is built with this package, this switch must +be set to \fBon\fR to enable running with KOKKOS-enabled styles. More +details on this switch and its optional keyword value pairs are discussed +at: https://lammps.sandia.gov/doc/Run_options.html +.TP +\fB\-l \fR or \fB\-log \fR +Specify a log file for LAMMPS to write status information to. +The default value is "log.lammps". If the file name "none" is used, +\fBLAMMPS\fR will not write a log file. In multi-partition mode only +some high-level all-partition information is written to the "" +file, the remainder is written in a per-partition file ".N" +with "N" being the respective partition number, unless overridden +by the \-plog flag (see below). +.TP +\fB\-m \fR or \fB\-mpicolor \fR +If used, this must be the first command-line argument after the +.B LAMMPS +executable name. It is only used when +.B LAMMPS +is launched by an mpirun command which also launches one or more +other executable(s) at the same time. +.B LAMMPS +and the other executable(s) perform an MPI_Comm_split(), each with +their own different colors, to split the MPI_COMM_WORLD communicator +for each executable to the subset of processors they are supposed to +be actually running on. Currently, this is only used in +.B LAMMPS +to perform client/server messaging with another application. +.B LAMMPS +can act as either a client or server (or both). +.TP +\fB\-nc\fR or \fB\-nocite\fR +Disable writing the "log.cite" file which is normally written to +list references for specific cite-able features used during a +.B LAMMPS +run. +.TP +\fB\-pk