From e4c7c23843a098b714aef38a9ffb6b75905f7a64 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 24 Apr 2021 11:09:09 -0400 Subject: [PATCH 1/8] move sanitizer and iwyu configuration to Testing module and update iwyu this changes the iwyu configuration so that it will check for using GNU or Clang only as supported compilers, enforces the necessary recording of compilation commands in a json file and tweaks the "iwyu" target to work around an issue with the current iwyu implementation by placing the "native" runtime of the chosen compiler first --- cmake/CMakeLists.txt | 63 -------------------------------- cmake/Modules/Testing.cmake | 73 +++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 63 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 7f99b04cd6..dd4c3bcaba 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -245,69 +245,6 @@ if(BUILD_OMP) target_link_libraries(lammps PRIVATE OpenMP::OpenMP_CXX) endif() -# Compiler specific features for testing -if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") - option(ENABLE_COVERAGE "Enable collecting code coverage data" OFF) - mark_as_advanced(ENABLE_COVERAGE) - if(ENABLE_COVERAGE) - if(CMAKE_VERSION VERSION_LESS 3.13) - if(CMAKE_CXX_FLAGS) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") - else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_${CMAKE_BUILD_TYPE}_FLAGS} --coverage") - endif() - else() - target_compile_options(lammps PUBLIC --coverage) - target_link_options(lammps PUBLIC --coverage) - endif() - endif() -endif() - -####################################### -# add custom target for IWYU analysis -####################################### -set(ENABLE_IWYU OFF CACHE BOOL "Add 'iwyu' build target to call the include-what-you-use tool") -mark_as_advanced(ENABLE_IWYU) -if(ENABLE_IWYU) - set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - find_program(IWYU_EXE NAMES include-what-you-use iwyu) - find_program(IWYU_TOOL NAMES iwyu_tool iwyu-tool iwyu_tool.py) - if (IWYU_EXE AND IWYU_TOOL) - add_custom_target( - iwyu - ${IWYU_TOOL} -o clang -p ${CMAKE_CURRENT_BINARY_DIR} -- -Xiwyu --mapping_file=${CMAKE_CURRENT_SOURCE_DIR}/iwyu/iwyu-extra-map.imp - COMMENT "Running IWYU") - add_dependencies(iwyu lammps) - else() - message(FATAL_ERROR "To use IWYU you need the include-what-you-use/iwyu executable" - "and the iwyu-tool/iwyu_tool script installed in your PATH") - endif() -endif() - -set(ENABLE_SANITIZER "none" CACHE STRING "Select a code sanitizer option (none (default), address, leak, thread, undefined)") -mark_as_advanced(ENABLE_SANITIZER) -set(ENABLE_SANITIZER_VALUES none address leak thread undefined) -set_property(CACHE ENABLE_SANITIZER PROPERTY STRINGS ${ENABLE_SANITIZER_VALUES}) -validate_option(ENABLE_SANITIZER ENABLE_SANITIZER_VALUES) -string(TOLOWER ${ENABLE_SANITIZER} ENABLE_SANITIZER) -if(NOT ENABLE_SANITIZER STREQUAL "none") - if((${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") OR (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")) - if(CMAKE_VERSION VERSION_LESS 3.13) - if(CMAKE_CXX_FLAGS) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=${ENABLE_SANITIZER}") - else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_${CMAKE_BUILD_TYPE}_FLAGS} -fsanitize=${ENABLE_SANITIZER}") - endif() - else() - target_compile_options(lammps PUBLIC -fsanitize=${ENABLE_SANITIZER}) - target_link_options(lammps PUBLIC -fsanitize=${ENABLE_SANITIZER}) - endif() - else() - message(WARNING "ENABLE_SANITIZER option not supported by ${CMAKE_CXX_COMPILER_ID} compilers. Ignoring.") - set(ENABLE_SANITIZER "none") - endif() -endif() - if(PKG_MSCG OR PKG_USER-ATC OR PKG_USER-AWPMD OR PKG_USER-QUIP OR PKG_LATTE) enable_language(C) find_package(LAPACK) diff --git a/cmake/Modules/Testing.cmake b/cmake/Modules/Testing.cmake index 7fbd8212de..d1fa97a7a8 100644 --- a/cmake/Modules/Testing.cmake +++ b/cmake/Modules/Testing.cmake @@ -56,3 +56,76 @@ if(ENABLE_TESTING) get_filename_component(LAMMPS_UNITTEST_BIN ${CMAKE_BINARY_DIR}/unittest ABSOLUTE) add_subdirectory(${LAMMPS_UNITTEST_DIR} ${LAMMPS_UNITTEST_BIN}) endif() + +# Compiler specific features for testing +if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") + option(ENABLE_COVERAGE "Enable collecting code coverage data" OFF) + mark_as_advanced(ENABLE_COVERAGE) + if(ENABLE_COVERAGE) + if(CMAKE_VERSION VERSION_LESS 3.13) + if(CMAKE_CXX_FLAGS) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_${CMAKE_BUILD_TYPE}_FLAGS} --coverage") + endif() + else() + target_compile_options(lammps PUBLIC --coverage) + target_link_options(lammps PUBLIC --coverage) + endif() + endif() +endif() + +####################################### +# add custom target for IWYU analysis +####################################### +set(ENABLE_IWYU OFF CACHE BOOL "Add 'iwyu' build target to call the include-what-you-use tool") +mark_as_advanced(ENABLE_IWYU) +if(ENABLE_IWYU) + # enforce these settings + set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "Enable reporting compilation commands to compile_commands.json" FORCE) + if (NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))) + message(FATAL_ERROR "IWYU is only supported with Clang or GNU compilers") + endif() + # detect the "native" header folder so we can include them first + execute_process(COMMAND ${CMAKE_CXX_COMPILER} --print-search-dirs OUTPUT_VARIABLE IWYU_SEARCH_PATHS) + string(REGEX REPLACE ".*libraries: *=([^:]+):.*" "\\1/include" IWYU_EXTRA_INCLUDE_DIR ${IWYU_SEARCH_PATHS}) + find_program(IWYU_EXE NAMES include-what-you-use iwyu) + find_program(IWYU_TOOL NAMES iwyu_tool iwyu-tool iwyu_tool.py) + if (IWYU_EXE AND IWYU_TOOL) + add_custom_target( + iwyu + ${IWYU_TOOL} -o clang -p ${CMAKE_CURRENT_BINARY_DIR} -- -I${IWYU_EXTRA_INCLUDE_DIR} -Xiwyu --mapping_file=${CMAKE_CURRENT_SOURCE_DIR}/iwyu/iwyu-extra-map.imp + COMMENT "Running IWYU") + add_dependencies(iwyu lammps) + else() + message(FATAL_ERROR "To use IWYU you need the include-what-you-use/iwyu executable" + "and the iwyu-tool/iwyu_tool script installed in your PATH") + endif() +endif() + +####################################### +# select code sanitizer options +####################################### +set(ENABLE_SANITIZER "none" CACHE STRING "Select a code sanitizer option (none (default), address, leak, thread, undefined)") +mark_as_advanced(ENABLE_SANITIZER) +set(ENABLE_SANITIZER_VALUES none address leak thread undefined) +set_property(CACHE ENABLE_SANITIZER PROPERTY STRINGS ${ENABLE_SANITIZER_VALUES}) +validate_option(ENABLE_SANITIZER ENABLE_SANITIZER_VALUES) +string(TOLOWER ${ENABLE_SANITIZER} ENABLE_SANITIZER) +if(NOT ENABLE_SANITIZER STREQUAL "none") + if((${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") OR (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")) + if(CMAKE_VERSION VERSION_LESS 3.13) + if(CMAKE_CXX_FLAGS) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=${ENABLE_SANITIZER}") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_${CMAKE_BUILD_TYPE}_FLAGS} -fsanitize=${ENABLE_SANITIZER}") + endif() + else() + target_compile_options(lammps PUBLIC -fsanitize=${ENABLE_SANITIZER}) + target_link_options(lammps PUBLIC -fsanitize=${ENABLE_SANITIZER}) + endif() + else() + message(WARNING "ENABLE_SANITIZER option not supported by ${CMAKE_CXX_COMPILER_ID} compilers. Ignoring.") + set(ENABLE_SANITIZER "none") + endif() +endif() From 4738337e470980dbbf5ccd61d396a95425ec5cac Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 24 Apr 2021 13:22:39 -0400 Subject: [PATCH 2/8] update/trim list of include files according to the IWYU principle --- src/BODY/fix_nph_body.cpp | 3 -- src/BODY/fix_npt_body.cpp | 3 -- src/BODY/fix_nvt_body.cpp | 2 -- src/BODY/fix_wall_body_polygon.cpp | 10 ++++--- src/BODY/pair_body_nparticle.cpp | 15 +++++----- src/COLLOID/pair_yukawa_colloid.cpp | 11 +++---- src/COMPRESS/gz_file_writer.h | 5 ++-- src/COMPRESS/zstd_file_writer.h | 4 +-- src/GPU/pair_born_coul_long_cs_gpu.cpp | 25 ++++++---------- src/GPU/pair_born_coul_long_gpu.cpp | 25 ++++++---------- src/GPU/pair_born_coul_wolf_cs_gpu.cpp | 23 +++++--------- src/GPU/pair_born_coul_wolf_gpu.cpp | 23 +++++--------- src/GPU/pair_born_gpu.cpp | 21 +++++-------- src/GPU/pair_buck_coul_cut_gpu.cpp | 21 +++++-------- src/GPU/pair_buck_coul_long_gpu.cpp | 23 +++++--------- src/GPU/pair_buck_gpu.cpp | 21 +++++-------- src/GPU/pair_colloid_gpu.cpp | 22 +++++--------- src/GPU/pair_coul_cut_gpu.cpp | 21 +++++-------- src/GPU/pair_coul_debye_gpu.cpp | 21 +++++-------- src/GPU/pair_coul_dsf_gpu.cpp | 21 +++++-------- src/GPU/pair_coul_long_cs_gpu.cpp | 23 +++++--------- src/GPU/pair_coul_long_gpu.cpp | 23 +++++--------- src/GPU/pair_dpd_gpu.cpp | 23 +++++--------- src/GPU/pair_dpd_tstat_gpu.cpp | 23 +++++--------- src/GPU/pair_eam_alloy_gpu.cpp | 24 +++++++-------- src/GPU/pair_eam_fs_gpu.cpp | 26 ++++++++-------- src/GPU/pair_eam_gpu.cpp | 14 ++++----- src/GPU/pair_gauss_gpu.cpp | 21 +++++-------- src/GPU/pair_gayberne_gpu.cpp | 24 ++++++--------- src/GPU/pair_lj96_cut_gpu.cpp | 21 +++++-------- src/GPU/pair_lj_charmm_coul_charmm_gpu.cpp | 25 +++++++--------- src/GPU/pair_lj_charmm_coul_long_gpu.cpp | 23 +++++--------- src/GPU/pair_lj_class2_coul_long_gpu.cpp | 23 +++++--------- src/GPU/pair_lj_class2_gpu.cpp | 6 ---- src/GPU/pair_lj_cubic_gpu.cpp | 7 ----- src/GPU/pair_lj_cut_coul_cut_gpu.cpp | 21 +++++-------- src/GPU/pair_lj_cut_coul_debye_gpu.cpp | 21 +++++-------- src/GPU/pair_lj_cut_coul_dsf_gpu.cpp | 20 +++++-------- src/GPU/pair_lj_cut_coul_long_gpu.cpp | 23 +++++--------- src/GPU/pair_lj_cut_coul_msm_gpu.cpp | 23 +++++--------- src/GPU/pair_lj_cut_dipole_cut_gpu.cpp | 23 ++++++-------- src/GPU/pair_lj_cut_dipole_long_gpu.cpp | 27 +++++++---------- src/GPU/pair_lj_cut_gpu.cpp | 21 +++++-------- src/GPU/pair_lj_cut_tip4p_long_gpu.cpp | 30 ++++++++----------- src/GPU/pair_lj_expand_coul_long_gpu.cpp | 23 +++++--------- src/GPU/pair_lj_expand_gpu.cpp | 21 +++++-------- src/GPU/pair_lj_gromacs_gpu.cpp | 22 +++++--------- src/GPU/pair_lj_sdk_coul_long_gpu.cpp | 23 +++++--------- src/GPU/pair_lj_sdk_gpu.cpp | 21 +++++-------- src/GPU/pair_lj_sf_dipole_sf_gpu.cpp | 23 ++++++-------- src/GPU/pair_mie_cut_gpu.cpp | 21 +++++-------- src/GPU/pair_morse_gpu.cpp | 21 +++++-------- src/GPU/pair_resquared_gpu.cpp | 24 ++++++--------- src/GPU/pair_soft_gpu.cpp | 21 +++++-------- src/GPU/pair_sw_gpu.cpp | 17 ++++------- src/GPU/pair_table_gpu.cpp | 25 +++++----------- src/GPU/pair_tersoff_gpu.cpp | 15 ++++------ src/GPU/pair_tersoff_mod_gpu.cpp | 17 ++++------- src/GPU/pair_tersoff_zbl_gpu.cpp | 17 ++++------- src/GPU/pair_ufm_gpu.cpp | 21 +++++-------- src/GPU/pair_vashishta_gpu.cpp | 17 ++++------- src/GPU/pair_yukawa_colloid_gpu.cpp | 21 +++++-------- src/GPU/pair_yukawa_gpu.cpp | 21 +++++-------- src/GPU/pair_zbl_gpu.cpp | 22 +++++--------- src/KSPACE/fft3d.cpp | 7 +++-- src/KSPACE/msm_cg.cpp | 8 ++--- src/KSPACE/remap.cpp | 3 +- src/MANYBODY/pair_eam_he.cpp | 4 +-- src/MANYBODY/pair_eim.h | 1 + src/MANYBODY/pair_vashishta_table.cpp | 3 +- src/MC/fix_charge_regulation.cpp | 3 -- src/MC/fix_tfmc.cpp | 15 +++++----- src/MISC/fix_orient_bcc.cpp | 1 - src/MISC/fix_orient_fcc.cpp | 1 - src/MLIAP/pair_mliap.cpp | 1 - src/MOLECULE/dihedral_charmm.cpp | 13 ++++---- src/MOLECULE/dihedral_charmmfsw.cpp | 13 ++++---- src/QEQ/fix_qeq_point.cpp | 1 - src/QEQ/fix_qeq_shielded.cpp | 1 - src/RIGID/fix_rigid_nh_small.cpp | 1 - src/SNAP/pair_snap.cpp | 1 - src/SPIN/fix_langevin_spin.cpp | 9 +++--- src/SPIN/fix_neb_spin.cpp | 1 - src/SPIN/pair_spin.cpp | 9 +++--- src/USER-COLVARS/ndx_group.cpp | 3 -- src/USER-DRUDE/fix_tgnh_drude.cpp | 1 - src/USER-DRUDE/fix_tgnvt_drude.cpp | 2 -- src/USER-EFF/compute_temp_region_eff.cpp | 2 -- src/USER-EFF/fix_nve_eff.cpp | 11 ++++--- src/USER-EFF/fix_nvt_eff.cpp | 2 -- src/USER-MEAMC/pair_meamc.cpp | 15 +++++----- src/USER-MEAMC/pair_meamc.h | 2 +- src/USER-MESODPD/atom_vec_edpd.cpp | 1 - src/USER-MESODPD/pair_edpd.cpp | 30 +++++++++---------- src/USER-MISC/angle_gaussian.cpp | 9 +++--- src/USER-MISC/compute_gyration_shape.cpp | 1 - .../compute_gyration_shape_chunk.cpp | 1 - src/USER-MISC/compute_pressure_grem.cpp | 2 -- src/USER-MISC/dihedral_table_cut.cpp | 1 - src/USER-MISC/fix_addtorque.cpp | 2 -- src/USER-MISC/fix_electron_stopping_fit.cpp | 5 ---- src/USER-MISC/fix_nvk.cpp | 10 +++---- src/USER-MISC/fix_orient_eco.cpp | 1 - src/USER-MISC/fix_rhok.cpp | 1 - src/USER-MISC/fix_wall_region_ees.cpp | 1 - src/USER-MISC/pair_wf_cut.cpp | 2 -- src/USER-OMP/fix_nvt_asphere_omp.cpp | 4 +-- src/USER-OMP/fix_nvt_omp.cpp | 2 -- src/USER-OMP/fix_qeq_comb_omp.cpp | 8 ++--- src/USER-OMP/npair_full_bin_atomonly_omp.cpp | 11 +++---- .../npair_half_bin_atomonly_newton_omp.cpp | 10 ++++--- .../npair_half_size_bin_newtoff_omp.cpp | 11 +++---- .../npair_half_size_bin_newton_omp.cpp | 11 +++---- .../npair_half_size_bin_newton_tri_omp.cpp | 11 +++---- .../npair_half_size_multi_newtoff_omp.cpp | 11 +++---- .../npair_half_size_multi_newton_omp.cpp | 11 +++---- .../npair_half_size_multi_newton_tri_omp.cpp | 11 +++---- .../npair_half_size_nsq_newtoff_omp.cpp | 11 +++---- .../npair_half_size_nsq_newton_omp.cpp | 11 +++---- src/USER-OMP/npair_halffull_newtoff_omp.cpp | 11 +++---- src/USER-OMP/npair_halffull_newton_omp.cpp | 11 +++---- src/USER-OMP/pair_tersoff_mod_c_omp.cpp | 2 ++ src/USER-OMP/pair_tersoff_mod_omp.cpp | 4 +-- src/USER-OMP/pair_tersoff_omp.cpp | 4 +-- src/USER-OMP/pair_tersoff_zbl_omp.cpp | 9 +++--- src/USER-OMP/pair_vashishta_omp.cpp | 2 -- src/USER-PACE/pair_pace.cpp | 1 - src/USER-PTM/ptm_constants.cpp | 1 - src/USER-SMD/fix_smd_wall_surface.cpp | 1 - src/atom.cpp | 1 + src/atom_vec.h | 1 + tools/lammps-shell/lammps-shell.cpp | 9 +++--- 132 files changed, 618 insertions(+), 1011 deletions(-) diff --git a/src/BODY/fix_nph_body.cpp b/src/BODY/fix_nph_body.cpp index a876ac9dc7..ca3923d278 100644 --- a/src/BODY/fix_nph_body.cpp +++ b/src/BODY/fix_nph_body.cpp @@ -18,11 +18,8 @@ #include "fix_nph_body.h" #include "error.h" -#include "group.h" #include "modify.h" -#include - using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/BODY/fix_npt_body.cpp b/src/BODY/fix_npt_body.cpp index bc669fc971..3aacfe7f65 100644 --- a/src/BODY/fix_npt_body.cpp +++ b/src/BODY/fix_npt_body.cpp @@ -18,11 +18,8 @@ #include "fix_npt_body.h" #include "error.h" -#include "group.h" #include "modify.h" -#include - using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/BODY/fix_nvt_body.cpp b/src/BODY/fix_nvt_body.cpp index 442aed2c94..6209e1db2f 100644 --- a/src/BODY/fix_nvt_body.cpp +++ b/src/BODY/fix_nvt_body.cpp @@ -21,8 +21,6 @@ #include "group.h" #include "modify.h" -#include - using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/BODY/fix_wall_body_polygon.cpp b/src/BODY/fix_wall_body_polygon.cpp index 027c0dbd5a..25e3afb31d 100644 --- a/src/BODY/fix_wall_body_polygon.cpp +++ b/src/BODY/fix_wall_body_polygon.cpp @@ -16,18 +16,20 @@ ------------------------------------------------------------------------- */ #include "fix_wall_body_polygon.h" -#include -#include + #include "atom.h" #include "atom_vec_body.h" #include "body_rounded_polygon.h" #include "domain.h" -#include "update.h" +#include "error.h" #include "force.h" #include "math_const.h" #include "math_extra.h" #include "memory.h" -#include "error.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/BODY/pair_body_nparticle.cpp b/src/BODY/pair_body_nparticle.cpp index 3ec0e4bbe6..68321f3b70 100644 --- a/src/BODY/pair_body_nparticle.cpp +++ b/src/BODY/pair_body_nparticle.cpp @@ -12,18 +12,19 @@ ------------------------------------------------------------------------- */ #include "pair_body_nparticle.h" -#include -#include -#include "math_extra.h" + #include "atom.h" #include "atom_vec_body.h" #include "body_nparticle.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" #include "error.h" +#include "force.h" +#include "math_extra.h" +#include "memory.h" +#include "neigh_list.h" +#include "neighbor.h" +#include +#include using namespace LAMMPS_NS; diff --git a/src/COLLOID/pair_yukawa_colloid.cpp b/src/COLLOID/pair_yukawa_colloid.cpp index 36074a1a21..5b1a4e4e83 100644 --- a/src/COLLOID/pair_yukawa_colloid.cpp +++ b/src/COLLOID/pair_yukawa_colloid.cpp @@ -16,13 +16,14 @@ ------------------------------------------------------------------------- */ #include "pair_yukawa_colloid.h" -#include + #include "atom.h" -#include "atom_vec.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" #include "error.h" +#include "force.h" +#include "neigh_list.h" +#include "neighbor.h" + +#include using namespace LAMMPS_NS; diff --git a/src/COMPRESS/gz_file_writer.h b/src/COMPRESS/gz_file_writer.h index af91572d8e..669931399b 100644 --- a/src/COMPRESS/gz_file_writer.h +++ b/src/COMPRESS/gz_file_writer.h @@ -19,9 +19,10 @@ #define LMP_GZ_FILE_WRITER_H #include "file_writer.h" + +#include #include #include -#include namespace LAMMPS_NS { @@ -40,8 +41,6 @@ public: void setCompressionLevel(int level); }; - - } #endif diff --git a/src/COMPRESS/zstd_file_writer.h b/src/COMPRESS/zstd_file_writer.h index 8980666856..030a01690a 100644 --- a/src/COMPRESS/zstd_file_writer.h +++ b/src/COMPRESS/zstd_file_writer.h @@ -21,9 +21,9 @@ #define LMP_ZSTD_FILE_WRITER_H #include "file_writer.h" + #include #include -#include namespace LAMMPS_NS { @@ -47,8 +47,6 @@ public: void setCompressionLevel(int level); void setChecksum(bool enabled); }; - - } #endif diff --git a/src/GPU/pair_born_coul_long_cs_gpu.cpp b/src/GPU/pair_born_coul_long_cs_gpu.cpp index 95c3df7b09..5782ff5969 100644 --- a/src/GPU/pair_born_coul_long_cs_gpu.cpp +++ b/src/GPU/pair_born_coul_long_cs_gpu.cpp @@ -16,28 +16,21 @@ ------------------------------------------------------------------------- */ #include "pair_born_coul_long_cs_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "math_const.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" -#include "kspace.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "kspace.h" +#include "math_const.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/GPU/pair_born_coul_long_gpu.cpp b/src/GPU/pair_born_coul_long_gpu.cpp index dbd55ef041..5b27e96cbd 100644 --- a/src/GPU/pair_born_coul_long_gpu.cpp +++ b/src/GPU/pair_born_coul_long_gpu.cpp @@ -16,28 +16,21 @@ ------------------------------------------------------------------------- */ #include "pair_born_coul_long_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "math_const.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" -#include "kspace.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "kspace.h" +#include "math_const.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + #define EWALD_F 1.12837917 #define EWALD_P 0.3275911 #define A1 0.254829592 diff --git a/src/GPU/pair_born_coul_wolf_cs_gpu.cpp b/src/GPU/pair_born_coul_wolf_cs_gpu.cpp index 9663c4be51..0c3e36265f 100644 --- a/src/GPU/pair_born_coul_wolf_cs_gpu.cpp +++ b/src/GPU/pair_born_coul_wolf_cs_gpu.cpp @@ -16,27 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_born_coul_wolf_cs_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "math_const.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "math_const.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/GPU/pair_born_coul_wolf_gpu.cpp b/src/GPU/pair_born_coul_wolf_gpu.cpp index 8db3761f1f..1cd91e2d61 100644 --- a/src/GPU/pair_born_coul_wolf_gpu.cpp +++ b/src/GPU/pair_born_coul_wolf_gpu.cpp @@ -16,27 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_born_coul_wolf_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "math_const.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "math_const.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/GPU/pair_born_gpu.cpp b/src/GPU/pair_born_gpu.cpp index 3454adda18..f7d383b528 100644 --- a/src/GPU/pair_born_gpu.cpp +++ b/src/GPU/pair_born_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_born_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_buck_coul_cut_gpu.cpp b/src/GPU/pair_buck_coul_cut_gpu.cpp index ec002289f2..fe3e8f092c 100644 --- a/src/GPU/pair_buck_coul_cut_gpu.cpp +++ b/src/GPU/pair_buck_coul_cut_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_buck_coul_cut_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_buck_coul_long_gpu.cpp b/src/GPU/pair_buck_coul_long_gpu.cpp index 913f68f4c4..0c23141060 100644 --- a/src/GPU/pair_buck_coul_long_gpu.cpp +++ b/src/GPU/pair_buck_coul_long_gpu.cpp @@ -16,27 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_buck_coul_long_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" -#include "kspace.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "kspace.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + #define EWALD_F 1.12837917 #define EWALD_P 0.3275911 #define A1 0.254829592 diff --git a/src/GPU/pair_buck_gpu.cpp b/src/GPU/pair_buck_gpu.cpp index 4f091eede5..81bd987850 100644 --- a/src/GPU/pair_buck_gpu.cpp +++ b/src/GPU/pair_buck_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_buck_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_colloid_gpu.cpp b/src/GPU/pair_colloid_gpu.cpp index 070b103ddf..d5391aeede 100644 --- a/src/GPU/pair_colloid_gpu.cpp +++ b/src/GPU/pair_colloid_gpu.cpp @@ -16,26 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_colloid_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_coul_cut_gpu.cpp b/src/GPU/pair_coul_cut_gpu.cpp index fc4a44adc4..ef9b2dff4d 100644 --- a/src/GPU/pair_coul_cut_gpu.cpp +++ b/src/GPU/pair_coul_cut_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_coul_cut_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_coul_debye_gpu.cpp b/src/GPU/pair_coul_debye_gpu.cpp index 1104175046..ca5cb7df9a 100644 --- a/src/GPU/pair_coul_debye_gpu.cpp +++ b/src/GPU/pair_coul_debye_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_coul_debye_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_coul_dsf_gpu.cpp b/src/GPU/pair_coul_dsf_gpu.cpp index 85cd978f33..d988a47681 100644 --- a/src/GPU/pair_coul_dsf_gpu.cpp +++ b/src/GPU/pair_coul_dsf_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_coul_dsf_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + #define MY_PIS 1.77245385090551602729 #define EWALD_F 1.12837917 #define EWALD_P 0.3275911 diff --git a/src/GPU/pair_coul_long_cs_gpu.cpp b/src/GPU/pair_coul_long_cs_gpu.cpp index 84b6a665db..f924f2c925 100644 --- a/src/GPU/pair_coul_long_cs_gpu.cpp +++ b/src/GPU/pair_coul_long_cs_gpu.cpp @@ -16,27 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_coul_long_cs_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" -#include "kspace.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "kspace.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; #define EWALD_F 1.12837917 diff --git a/src/GPU/pair_coul_long_gpu.cpp b/src/GPU/pair_coul_long_gpu.cpp index d27b4650ba..e1d51b1359 100644 --- a/src/GPU/pair_coul_long_gpu.cpp +++ b/src/GPU/pair_coul_long_gpu.cpp @@ -16,27 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_coul_long_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" -#include "kspace.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "kspace.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + #define EWALD_F 1.12837917 #define EWALD_P 0.3275911 #define A1 0.254829592 diff --git a/src/GPU/pair_dpd_gpu.cpp b/src/GPU/pair_dpd_gpu.cpp index 884834d94a..f66fc6d594 100644 --- a/src/GPU/pair_dpd_gpu.cpp +++ b/src/GPU/pair_dpd_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_dpd_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "random_mars.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include "update.h" + +#include using namespace LAMMPS_NS; diff --git a/src/GPU/pair_dpd_tstat_gpu.cpp b/src/GPU/pair_dpd_tstat_gpu.cpp index 507461fd23..957bb938f3 100644 --- a/src/GPU/pair_dpd_tstat_gpu.cpp +++ b/src/GPU/pair_dpd_tstat_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_dpd_tstat_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "random_mars.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include "update.h" + +#include using namespace LAMMPS_NS; diff --git a/src/GPU/pair_eam_alloy_gpu.cpp b/src/GPU/pair_eam_alloy_gpu.cpp index add3a3ca7a..fe2cc92450 100644 --- a/src/GPU/pair_eam_alloy_gpu.cpp +++ b/src/GPU/pair_eam_alloy_gpu.cpp @@ -16,23 +16,23 @@ ------------------------------------------------------------------------- */ #include "pair_eam_alloy_gpu.h" -#include -#include #include "atom.h" -#include "force.h" #include "comm.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "gpu_extra.h" #include "domain.h" - +#include "error.h" +#include "force.h" +#include "gpu_extra.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "potential_file_reader.h" #include "suffix.h" #include "tokenizer.h" -#include "potential_file_reader.h" + +#include +#include using namespace LAMMPS_NS; @@ -389,7 +389,7 @@ void PairEAMAlloyGPU::read_file(char *filename) ValueTokenizer values = reader.next_values(1); file->nelements = values.next_int(); - if (values.count() != file->nelements + 1) + if ((int)values.count() != file->nelements + 1) error->one(FLERR,"Incorrect element names in EAM potential file"); file->elements = new char*[file->nelements]; diff --git a/src/GPU/pair_eam_fs_gpu.cpp b/src/GPU/pair_eam_fs_gpu.cpp index 394b520a73..b92e348ddf 100644 --- a/src/GPU/pair_eam_fs_gpu.cpp +++ b/src/GPU/pair_eam_fs_gpu.cpp @@ -16,23 +16,23 @@ ------------------------------------------------------------------------- */ #include "pair_eam_fs_gpu.h" -#include -#include #include "atom.h" -#include "force.h" #include "comm.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "gpu_extra.h" #include "domain.h" -#include "suffix.h" - -#include "tokenizer.h" +#include "error.h" +#include "force.h" +#include "gpu_extra.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "potential_file_reader.h" +#include "suffix.h" +#include "tokenizer.h" + +#include +#include using namespace LAMMPS_NS; @@ -388,7 +388,7 @@ void PairEAMFSGPU::read_file(char *filename) ValueTokenizer values = reader.next_values(1); file->nelements = values.next_int(); - if (values.count() != file->nelements + 1) + if ((int)values.count() != file->nelements + 1) error->one(FLERR,"Incorrect element names in EAM potential file"); file->elements = new char*[file->nelements]; diff --git a/src/GPU/pair_eam_gpu.cpp b/src/GPU/pair_eam_gpu.cpp index fada4febb5..2ed72a3b08 100644 --- a/src/GPU/pair_eam_gpu.cpp +++ b/src/GPU/pair_eam_gpu.cpp @@ -16,22 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_eam_gpu.h" -#include -#include -#include #include "atom.h" -#include "force.h" #include "comm.h" #include "domain.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" #include "error.h" -#include "neigh_request.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + #define MAXLINE 1024 using namespace LAMMPS_NS; diff --git a/src/GPU/pair_gauss_gpu.cpp b/src/GPU/pair_gauss_gpu.cpp index 04fc65dd06..8431ce1b67 100644 --- a/src/GPU/pair_gauss_gpu.cpp +++ b/src/GPU/pair_gauss_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_gauss_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_gayberne_gpu.cpp b/src/GPU/pair_gayberne_gpu.cpp index c5e0a1afb5..d7adb5c657 100644 --- a/src/GPU/pair_gayberne_gpu.cpp +++ b/src/GPU/pair_gayberne_gpu.cpp @@ -16,28 +16,22 @@ ------------------------------------------------------------------------- */ #include "pair_gayberne_gpu.h" -#include -#include -#include -#include "math_extra.h" #include "atom.h" -#include "atom_vec.h" #include "atom_vec_ellipsoid.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" #include "domain.h" -#include "update.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "math_extra.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_lj96_cut_gpu.cpp b/src/GPU/pair_lj96_cut_gpu.cpp index 33774078d5..016147cb6e 100644 --- a/src/GPU/pair_lj96_cut_gpu.cpp +++ b/src/GPU/pair_lj96_cut_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_lj96_cut_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_lj_charmm_coul_charmm_gpu.cpp b/src/GPU/pair_lj_charmm_coul_charmm_gpu.cpp index 4d8d67cdca..a40da25da8 100644 --- a/src/GPU/pair_lj_charmm_coul_charmm_gpu.cpp +++ b/src/GPU/pair_lj_charmm_coul_charmm_gpu.cpp @@ -15,23 +15,18 @@ Contributing author: Mike Brown (SNL) ------------------------------------------------------------------------- */ -#include -#include -#include -#include #include "pair_lj_charmm_coul_charmm_gpu.h" + #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" + +#include using namespace LAMMPS_NS; @@ -205,8 +200,8 @@ double PairLJCharmmCoulCharmmGPU::memory_usage() /* ---------------------------------------------------------------------- */ void PairLJCharmmCoulCharmmGPU::cpu_compute(int start, int inum, int eflag, - int vflag, int *ilist, - int *numneigh, int **firstneigh) + int /* vflag */, int *ilist, + int *numneigh, int **firstneigh) { int i,j,ii,jj,jnum,itype,jtype; double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair; diff --git a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp index 42e869207e..1fc8ba1c5f 100644 --- a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp @@ -16,27 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_lj_charmm_coul_long_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" -#include "kspace.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "kspace.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + #define EWALD_F 1.12837917 #define EWALD_P 0.3275911 #define A1 0.254829592 diff --git a/src/GPU/pair_lj_class2_coul_long_gpu.cpp b/src/GPU/pair_lj_class2_coul_long_gpu.cpp index ae5321bc4f..87dda4f190 100644 --- a/src/GPU/pair_lj_class2_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_class2_coul_long_gpu.cpp @@ -16,27 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_lj_class2_coul_long_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" -#include "kspace.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "kspace.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + #define EWALD_F 1.12837917 #define EWALD_P 0.3275911 #define A1 0.254829592 diff --git a/src/GPU/pair_lj_class2_gpu.cpp b/src/GPU/pair_lj_class2_gpu.cpp index e32561ab59..4e224cb2d3 100644 --- a/src/GPU/pair_lj_class2_gpu.cpp +++ b/src/GPU/pair_lj_class2_gpu.cpp @@ -18,20 +18,14 @@ #include "pair_lj_class2_gpu.h" #include "atom.h" -#include "atom_vec.h" -#include "comm.h" #include "domain.h" #include "error.h" #include "force.h" #include "gpu_extra.h" -#include "integrate.h" -#include "memory.h" #include "neigh_list.h" #include "neigh_request.h" #include "neighbor.h" #include "suffix.h" -#include "universe.h" -#include "update.h" #include diff --git a/src/GPU/pair_lj_cubic_gpu.cpp b/src/GPU/pair_lj_cubic_gpu.cpp index 73839bdbed..1c9b9a0820 100644 --- a/src/GPU/pair_lj_cubic_gpu.cpp +++ b/src/GPU/pair_lj_cubic_gpu.cpp @@ -18,23 +18,16 @@ #include "pair_lj_cubic_gpu.h" #include "atom.h" -#include "atom_vec.h" -#include "comm.h" #include "domain.h" #include "error.h" #include "force.h" #include "gpu_extra.h" -#include "integrate.h" -#include "memory.h" #include "neigh_list.h" #include "neigh_request.h" #include "neighbor.h" #include "suffix.h" -#include "universe.h" -#include "update.h" #include -#include #include "pair_lj_cubic_const.h" diff --git a/src/GPU/pair_lj_cut_coul_cut_gpu.cpp b/src/GPU/pair_lj_cut_coul_cut_gpu.cpp index 1583395f82..0a1076aef8 100644 --- a/src/GPU/pair_lj_cut_coul_cut_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_cut_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_coul_cut_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_lj_cut_coul_debye_gpu.cpp b/src/GPU/pair_lj_cut_coul_debye_gpu.cpp index d83678bd9f..75a16ae210 100644 --- a/src/GPU/pair_lj_cut_coul_debye_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_debye_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_coul_debye_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_lj_cut_coul_dsf_gpu.cpp b/src/GPU/pair_lj_cut_coul_dsf_gpu.cpp index 3a29d7e5a2..e3500ce60d 100644 --- a/src/GPU/pair_lj_cut_coul_dsf_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_dsf_gpu.cpp @@ -17,25 +17,19 @@ #include "pair_lj_cut_coul_dsf_gpu.h" #include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + #define MY_PIS 1.77245385090551602729 #define EWALD_F 1.12837917 #define EWALD_P 0.3275911 diff --git a/src/GPU/pair_lj_cut_coul_long_gpu.cpp b/src/GPU/pair_lj_cut_coul_long_gpu.cpp index 34e31fc044..3ac52c08c5 100644 --- a/src/GPU/pair_lj_cut_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_long_gpu.cpp @@ -16,27 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_coul_long_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" -#include "kspace.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "kspace.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + #define EWALD_F 1.12837917 #define EWALD_P 0.3275911 #define A1 0.254829592 diff --git a/src/GPU/pair_lj_cut_coul_msm_gpu.cpp b/src/GPU/pair_lj_cut_coul_msm_gpu.cpp index 2fd1d55b54..f92c83bcf7 100644 --- a/src/GPU/pair_lj_cut_coul_msm_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_msm_gpu.cpp @@ -16,27 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_coul_msm_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" -#include "kspace.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "kspace.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_lj_cut_dipole_cut_gpu.cpp b/src/GPU/pair_lj_cut_dipole_cut_gpu.cpp index 93af562ed0..b15822bde9 100644 --- a/src/GPU/pair_lj_cut_dipole_cut_gpu.cpp +++ b/src/GPU/pair_lj_cut_dipole_cut_gpu.cpp @@ -16,25 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_dipole_cut_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; diff --git a/src/GPU/pair_lj_cut_dipole_long_gpu.cpp b/src/GPU/pair_lj_cut_dipole_long_gpu.cpp index 9ec2bec258..d9d38d4cb0 100644 --- a/src/GPU/pair_lj_cut_dipole_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_dipole_long_gpu.cpp @@ -16,27 +16,22 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_dipole_long_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "kspace.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "math_const.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "kspace.h" +#include "math_const.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include "update.h" + +#include +#include #define EWALD_F 1.12837917 #define EWALD_P 0.3275911 diff --git a/src/GPU/pair_lj_cut_gpu.cpp b/src/GPU/pair_lj_cut_gpu.cpp index 1de70701f0..65fed01321 100644 --- a/src/GPU/pair_lj_cut_gpu.cpp +++ b/src/GPU/pair_lj_cut_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp index c63d1a4e91..67dcd6d0b6 100644 --- a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp @@ -15,30 +15,24 @@ Contributing author: Vsevolod Nikolskiy (HSE) ------------------------------------------------------------------------- */ -#include -#include - -#include #include "pair_lj_cut_tip4p_long_gpu.h" -#include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" -#include "domain.h" -#include "kspace.h" + #include "angle.h" +#include "atom.h" #include "bond.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "kspace.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + #define EWALD_F 1.12837917 #define EWALD_P 0.3275911 #define A1 0.254829592 diff --git a/src/GPU/pair_lj_expand_coul_long_gpu.cpp b/src/GPU/pair_lj_expand_coul_long_gpu.cpp index af042bef42..d5a23507ae 100644 --- a/src/GPU/pair_lj_expand_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_expand_coul_long_gpu.cpp @@ -16,27 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_lj_expand_coul_long_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" -#include "kspace.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "kspace.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + #define EWALD_F 1.12837917 #define EWALD_P 0.3275911 #define A1 0.254829592 diff --git a/src/GPU/pair_lj_expand_gpu.cpp b/src/GPU/pair_lj_expand_gpu.cpp index 87605af1a4..234173651d 100644 --- a/src/GPU/pair_lj_expand_gpu.cpp +++ b/src/GPU/pair_lj_expand_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_lj_expand_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_lj_gromacs_gpu.cpp b/src/GPU/pair_lj_gromacs_gpu.cpp index b45d757ef4..df5d6aee89 100644 --- a/src/GPU/pair_lj_gromacs_gpu.cpp +++ b/src/GPU/pair_lj_gromacs_gpu.cpp @@ -16,27 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_lj_gromacs_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" -#include "kspace.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp b/src/GPU/pair_lj_sdk_coul_long_gpu.cpp index 97b53fec33..5b7cb1fa67 100644 --- a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_sdk_coul_long_gpu.cpp @@ -16,27 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_lj_sdk_coul_long_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" -#include "kspace.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "kspace.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + #define EWALD_F 1.12837917 #define EWALD_P 0.3275911 #define A1 0.254829592 diff --git a/src/GPU/pair_lj_sdk_gpu.cpp b/src/GPU/pair_lj_sdk_gpu.cpp index cd6f4bc544..1cfacfde83 100644 --- a/src/GPU/pair_lj_sdk_gpu.cpp +++ b/src/GPU/pair_lj_sdk_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_lj_sdk_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_lj_sf_dipole_sf_gpu.cpp b/src/GPU/pair_lj_sf_dipole_sf_gpu.cpp index cb7a889ed5..033c0c1d62 100644 --- a/src/GPU/pair_lj_sf_dipole_sf_gpu.cpp +++ b/src/GPU/pair_lj_sf_dipole_sf_gpu.cpp @@ -16,25 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_lj_sf_dipole_sf_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; diff --git a/src/GPU/pair_mie_cut_gpu.cpp b/src/GPU/pair_mie_cut_gpu.cpp index e72c12da79..f2cfbc2637 100644 --- a/src/GPU/pair_mie_cut_gpu.cpp +++ b/src/GPU/pair_mie_cut_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_mie_cut_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_morse_gpu.cpp b/src/GPU/pair_morse_gpu.cpp index 507edd33f4..024346afb2 100644 --- a/src/GPU/pair_morse_gpu.cpp +++ b/src/GPU/pair_morse_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_morse_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_resquared_gpu.cpp b/src/GPU/pair_resquared_gpu.cpp index 90a7af1d0e..18817bf551 100644 --- a/src/GPU/pair_resquared_gpu.cpp +++ b/src/GPU/pair_resquared_gpu.cpp @@ -16,28 +16,22 @@ ------------------------------------------------------------------------- */ #include "pair_resquared_gpu.h" -#include -#include -#include -#include "math_extra.h" #include "atom.h" -#include "atom_vec.h" #include "atom_vec_ellipsoid.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" #include "domain.h" -#include "update.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "math_extra.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_soft_gpu.cpp b/src/GPU/pair_soft_gpu.cpp index 66bd6deb8f..0c963e947c 100644 --- a/src/GPU/pair_soft_gpu.cpp +++ b/src/GPU/pair_soft_gpu.cpp @@ -16,27 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_soft_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" #include "math_const.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_sw_gpu.cpp b/src/GPU/pair_sw_gpu.cpp index b819580488..1603704b9b 100644 --- a/src/GPU/pair_sw_gpu.cpp +++ b/src/GPU/pair_sw_gpu.cpp @@ -16,22 +16,17 @@ ------------------------------------------------------------------------- */ #include "pair_sw_gpu.h" -#include -#include -#include #include "atom.h" -#include "neighbor.h" -#include "neigh_request.h" -#include "force.h" #include "comm.h" -#include "memory.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" -#include "error.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/GPU/pair_table_gpu.cpp b/src/GPU/pair_table_gpu.cpp index 6c5bb48e26..fb1a130398 100644 --- a/src/GPU/pair_table_gpu.cpp +++ b/src/GPU/pair_table_gpu.cpp @@ -16,30 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_table_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" -#define LOOKUP 0 -#define LINEAR 1 -#define SPLINE 2 -#define BITMAP 3 +#include using namespace LAMMPS_NS; diff --git a/src/GPU/pair_tersoff_gpu.cpp b/src/GPU/pair_tersoff_gpu.cpp index c2f3413d3d..55576de4ec 100644 --- a/src/GPU/pair_tersoff_gpu.cpp +++ b/src/GPU/pair_tersoff_gpu.cpp @@ -16,22 +16,17 @@ ------------------------------------------------------------------------- */ #include "pair_tersoff_gpu.h" -#include -#include -#include #include "atom.h" -#include "neighbor.h" -#include "neigh_request.h" -#include "force.h" #include "comm.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "gpu_extra.h" #include "memory.h" #include "neighbor.h" #include "neigh_list.h" -#include "memory.h" -#include "error.h" -#include "domain.h" -#include "gpu_extra.h" +#include "neigh_request.h" #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/GPU/pair_tersoff_mod_gpu.cpp b/src/GPU/pair_tersoff_mod_gpu.cpp index 6a5e9892ec..5d79a68af4 100644 --- a/src/GPU/pair_tersoff_mod_gpu.cpp +++ b/src/GPU/pair_tersoff_mod_gpu.cpp @@ -16,22 +16,17 @@ ------------------------------------------------------------------------- */ #include "pair_tersoff_mod_gpu.h" -#include -#include -#include #include "atom.h" -#include "neighbor.h" -#include "neigh_request.h" -#include "force.h" #include "comm.h" -#include "memory.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" -#include "error.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/GPU/pair_tersoff_zbl_gpu.cpp b/src/GPU/pair_tersoff_zbl_gpu.cpp index 0c56212fef..9594845fd0 100644 --- a/src/GPU/pair_tersoff_zbl_gpu.cpp +++ b/src/GPU/pair_tersoff_zbl_gpu.cpp @@ -16,22 +16,17 @@ ------------------------------------------------------------------------- */ #include "pair_tersoff_zbl_gpu.h" -#include -#include -#include #include "atom.h" -#include "neighbor.h" -#include "neigh_request.h" -#include "force.h" #include "comm.h" -#include "memory.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" -#include "error.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/GPU/pair_ufm_gpu.cpp b/src/GPU/pair_ufm_gpu.cpp index 47a32f7fc2..cdf53d6cc6 100644 --- a/src/GPU/pair_ufm_gpu.cpp +++ b/src/GPU/pair_ufm_gpu.cpp @@ -18,26 +18,19 @@ ------------------------------------------------------------------------- */ #include "pair_ufm_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_vashishta_gpu.cpp b/src/GPU/pair_vashishta_gpu.cpp index b3c703952f..4c47b66b4a 100644 --- a/src/GPU/pair_vashishta_gpu.cpp +++ b/src/GPU/pair_vashishta_gpu.cpp @@ -16,22 +16,17 @@ ------------------------------------------------------------------------- */ #include "pair_vashishta_gpu.h" -#include -#include -#include #include "atom.h" -#include "neighbor.h" -#include "neigh_request.h" -#include "force.h" #include "comm.h" -#include "memory.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" -#include "error.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/GPU/pair_yukawa_colloid_gpu.cpp b/src/GPU/pair_yukawa_colloid_gpu.cpp index 3ac5f6c693..4e4e555134 100644 --- a/src/GPU/pair_yukawa_colloid_gpu.cpp +++ b/src/GPU/pair_yukawa_colloid_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_yukawa_colloid_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_yukawa_gpu.cpp b/src/GPU/pair_yukawa_gpu.cpp index 8558b57cd8..104adef8d5 100644 --- a/src/GPU/pair_yukawa_gpu.cpp +++ b/src/GPU/pair_yukawa_gpu.cpp @@ -16,26 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_yukawa_gpu.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/GPU/pair_zbl_gpu.cpp b/src/GPU/pair_zbl_gpu.cpp index 97a859a5bf..267b9252bd 100644 --- a/src/GPU/pair_zbl_gpu.cpp +++ b/src/GPU/pair_zbl_gpu.cpp @@ -16,27 +16,19 @@ ------------------------------------------------------------------------- */ #include "pair_zbl_gpu.h" -#include "lmptype.h" -#include -#include -#include #include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "integrate.h" -#include "memory.h" -#include "error.h" -#include "neigh_request.h" -#include "universe.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "gpu_extra.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "suffix.h" +#include + using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition diff --git a/src/KSPACE/fft3d.cpp b/src/KSPACE/fft3d.cpp index 6a05be4e6f..a21bbb0999 100644 --- a/src/KSPACE/fft3d.cpp +++ b/src/KSPACE/fft3d.cpp @@ -20,11 +20,12 @@ ------------------------------------------------------------------------- */ #include "fft3d.h" -#include -#include + +#include "remap.h" + #include #include -#include "remap.h" + #if defined(_OPENMP) #include #endif diff --git a/src/KSPACE/msm_cg.cpp b/src/KSPACE/msm_cg.cpp index 6123aedfb8..d61db8db96 100644 --- a/src/KSPACE/msm_cg.cpp +++ b/src/KSPACE/msm_cg.cpp @@ -16,9 +16,7 @@ ------------------------------------------------------------------------- */ #include "msm_cg.h" -#include -#include -#include + #include "atom.h" #include "gridcomm.h" #include "domain.h" @@ -26,7 +24,9 @@ #include "force.h" #include "neighbor.h" #include "memory.h" -#include "fmt/format.h" + +#include +#include using namespace LAMMPS_NS; diff --git a/src/KSPACE/remap.cpp b/src/KSPACE/remap.cpp index ab2ec687d7..c99bbb2562 100644 --- a/src/KSPACE/remap.cpp +++ b/src/KSPACE/remap.cpp @@ -12,8 +12,7 @@ ------------------------------------------------------------------------- */ #include "remap.h" -#include -#include + #include #define PACK_DATA FFT_SCALAR diff --git a/src/MANYBODY/pair_eam_he.cpp b/src/MANYBODY/pair_eam_he.cpp index 0018429862..b0c4b7c205 100644 --- a/src/MANYBODY/pair_eam_he.cpp +++ b/src/MANYBODY/pair_eam_he.cpp @@ -19,13 +19,13 @@ #include "atom.h" #include "comm.h" -#include "error.h" #include "force.h" #include "memory.h" -#include "neighbor.h" #include "neigh_list.h" #include "update.h" +#include + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ diff --git a/src/MANYBODY/pair_eim.h b/src/MANYBODY/pair_eim.h index 52b94192c2..a68dcc2198 100644 --- a/src/MANYBODY/pair_eim.h +++ b/src/MANYBODY/pair_eim.h @@ -23,6 +23,7 @@ PairStyle(eim,PairEIM) #include "pair.h" #include +#include namespace LAMMPS_NS { diff --git a/src/MANYBODY/pair_vashishta_table.cpp b/src/MANYBODY/pair_vashishta_table.cpp index 14dacdae3f..05d9703443 100644 --- a/src/MANYBODY/pair_vashishta_table.cpp +++ b/src/MANYBODY/pair_vashishta_table.cpp @@ -16,11 +16,10 @@ ------------------------------------------------------------------------- */ #include "pair_vashishta_table.h" -#include + #include "atom.h" #include "error.h" #include "force.h" -#include "comm.h" #include "memory.h" #include "neigh_list.h" diff --git a/src/MC/fix_charge_regulation.cpp b/src/MC/fix_charge_regulation.cpp index e369ab95e1..6226dd5ba5 100644 --- a/src/MC/fix_charge_regulation.cpp +++ b/src/MC/fix_charge_regulation.cpp @@ -32,15 +32,12 @@ #include "improper.h" #include "kspace.h" #include "math_const.h" -#include "math_extra.h" #include "math_special.h" #include "memory.h" #include "modify.h" -#include "molecule.h" #include "neighbor.h" #include "pair.h" #include "random_park.h" -#include "region.h" #include "update.h" #include diff --git a/src/MC/fix_tfmc.cpp b/src/MC/fix_tfmc.cpp index 4d481e7d68..ff49d84f6b 100644 --- a/src/MC/fix_tfmc.cpp +++ b/src/MC/fix_tfmc.cpp @@ -17,18 +17,19 @@ #include "fix_tfmc.h" -#include -#include -#include #include "atom.h" -#include "force.h" -#include "group.h" -#include "random_mars.h" #include "comm.h" #include "domain.h" +#include "error.h" +#include "force.h" +#include "group.h" #include "memory.h" #include "modify.h" -#include "error.h" +#include "random_mars.h" + +#include +#include +#include using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/MISC/fix_orient_bcc.cpp b/src/MISC/fix_orient_bcc.cpp index 520940f2f0..d78a6bcb95 100644 --- a/src/MISC/fix_orient_bcc.cpp +++ b/src/MISC/fix_orient_bcc.cpp @@ -33,7 +33,6 @@ #include "update.h" #include -#include using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/MISC/fix_orient_fcc.cpp b/src/MISC/fix_orient_fcc.cpp index c94e91a0b5..559a56000e 100644 --- a/src/MISC/fix_orient_fcc.cpp +++ b/src/MISC/fix_orient_fcc.cpp @@ -30,7 +30,6 @@ #include "update.h" #include -#include using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/MLIAP/pair_mliap.cpp b/src/MLIAP/pair_mliap.cpp index 85374e9214..ab081f8462 100644 --- a/src/MLIAP/pair_mliap.cpp +++ b/src/MLIAP/pair_mliap.cpp @@ -35,7 +35,6 @@ #include #include -#include "error.h" using namespace LAMMPS_NS; diff --git a/src/MOLECULE/dihedral_charmm.cpp b/src/MOLECULE/dihedral_charmm.cpp index d56c875744..f8322fd9a1 100644 --- a/src/MOLECULE/dihedral_charmm.cpp +++ b/src/MOLECULE/dihedral_charmm.cpp @@ -17,19 +17,18 @@ #include "dihedral_charmm.h" -#include -#include #include "atom.h" #include "comm.h" -#include "neighbor.h" +#include "error.h" #include "force.h" -#include "pair.h" -#include "update.h" -#include "respa.h" #include "math_const.h" #include "memory.h" -#include "error.h" +#include "neighbor.h" +#include "pair.h" +#include "respa.h" +#include "update.h" +#include using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/MOLECULE/dihedral_charmmfsw.cpp b/src/MOLECULE/dihedral_charmmfsw.cpp index 09372f67ac..15e3aedc80 100644 --- a/src/MOLECULE/dihedral_charmmfsw.cpp +++ b/src/MOLECULE/dihedral_charmmfsw.cpp @@ -20,19 +20,18 @@ #include "dihedral_charmmfsw.h" -#include -#include #include "atom.h" #include "comm.h" -#include "neighbor.h" +#include "error.h" #include "force.h" -#include "pair.h" -#include "update.h" -#include "respa.h" #include "math_const.h" #include "memory.h" -#include "error.h" +#include "neighbor.h" +#include "pair.h" +#include "respa.h" +#include "update.h" +#include using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/QEQ/fix_qeq_point.cpp b/src/QEQ/fix_qeq_point.cpp index ac31f906e0..38deee696e 100644 --- a/src/QEQ/fix_qeq_point.cpp +++ b/src/QEQ/fix_qeq_point.cpp @@ -31,7 +31,6 @@ #include "update.h" #include -#include using namespace LAMMPS_NS; diff --git a/src/QEQ/fix_qeq_shielded.cpp b/src/QEQ/fix_qeq_shielded.cpp index ad6202abd8..7d8cfdb90d 100644 --- a/src/QEQ/fix_qeq_shielded.cpp +++ b/src/QEQ/fix_qeq_shielded.cpp @@ -32,7 +32,6 @@ #include "update.h" #include -#include using namespace LAMMPS_NS; diff --git a/src/RIGID/fix_rigid_nh_small.cpp b/src/RIGID/fix_rigid_nh_small.cpp index 242c33eb3a..0f1e813234 100644 --- a/src/RIGID/fix_rigid_nh_small.cpp +++ b/src/RIGID/fix_rigid_nh_small.cpp @@ -31,7 +31,6 @@ #include "math_extra.h" #include "memory.h" #include "modify.h" -#include "molecule.h" #include "rigid_const.h" #include "update.h" diff --git a/src/SNAP/pair_snap.cpp b/src/SNAP/pair_snap.cpp index ae0023ddec..64dc5ee9c6 100644 --- a/src/SNAP/pair_snap.cpp +++ b/src/SNAP/pair_snap.cpp @@ -25,7 +25,6 @@ #include "tokenizer.h" #include -#include using namespace LAMMPS_NS; diff --git a/src/SPIN/fix_langevin_spin.cpp b/src/SPIN/fix_langevin_spin.cpp index 5c040da0f5..ae9d637180 100644 --- a/src/SPIN/fix_langevin_spin.cpp +++ b/src/SPIN/fix_langevin_spin.cpp @@ -22,21 +22,20 @@ ------------------------------------------------------------------------- */ #include "fix_langevin_spin.h" -#include -#include + #include "atom.h" #include "comm.h" #include "error.h" #include "force.h" -#include "group.h" #include "math_const.h" -#include "memory.h" #include "modify.h" -// #include "random_park.h" #include "random_mars.h" #include "respa.h" #include "update.h" +#include +#include + using namespace LAMMPS_NS; using namespace FixConst; using namespace MathConst; diff --git a/src/SPIN/fix_neb_spin.cpp b/src/SPIN/fix_neb_spin.cpp index 620d0a47bd..7bef18e9e7 100644 --- a/src/SPIN/fix_neb_spin.cpp +++ b/src/SPIN/fix_neb_spin.cpp @@ -27,7 +27,6 @@ #include "comm.h" #include "compute.h" #include "error.h" -#include "force.h" #include "group.h" #include "memory.h" #include "modify.h" diff --git a/src/SPIN/pair_spin.cpp b/src/SPIN/pair_spin.cpp index c57feb8390..815ed2d290 100644 --- a/src/SPIN/pair_spin.cpp +++ b/src/SPIN/pair_spin.cpp @@ -22,20 +22,21 @@ ------------------------------------------------------------------------- */ #include "pair_spin.h" -#include + #include "atom.h" #include "comm.h" #include "error.h" -#include "fix.h" +#include "fix_nve_spin.h" #include "force.h" #include "math_const.h" #include "memory.h" #include "modify.h" -#include "neighbor.h" #include "neigh_request.h" +#include "neighbor.h" #include "pair.h" #include "update.h" -#include "fix_nve_spin.h" + +#include using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/USER-COLVARS/ndx_group.cpp b/src/USER-COLVARS/ndx_group.cpp index d8d5632b06..647cb1e125 100644 --- a/src/USER-COLVARS/ndx_group.cpp +++ b/src/USER-COLVARS/ndx_group.cpp @@ -22,11 +22,8 @@ #include "comm.h" #include "error.h" #include "group.h" -#include "memory.h" #include "tokenizer.h" -#include - using namespace LAMMPS_NS; #define BUFLEN 4096 #define DELTA 16384 diff --git a/src/USER-DRUDE/fix_tgnh_drude.cpp b/src/USER-DRUDE/fix_tgnh_drude.cpp index d8bf1d76f9..3cde93f1b5 100644 --- a/src/USER-DRUDE/fix_tgnh_drude.cpp +++ b/src/USER-DRUDE/fix_tgnh_drude.cpp @@ -24,7 +24,6 @@ #include "error.h" #include "fix_deform.h" #include "force.h" -#include "group.h" #include "irregular.h" #include "kspace.h" #include "memory.h" diff --git a/src/USER-DRUDE/fix_tgnvt_drude.cpp b/src/USER-DRUDE/fix_tgnvt_drude.cpp index 2339a6f9a7..ab566058d4 100644 --- a/src/USER-DRUDE/fix_tgnvt_drude.cpp +++ b/src/USER-DRUDE/fix_tgnvt_drude.cpp @@ -17,8 +17,6 @@ #include "group.h" #include "modify.h" -#include - using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/USER-EFF/compute_temp_region_eff.cpp b/src/USER-EFF/compute_temp_region_eff.cpp index ca13aac06b..50ebf8abbe 100644 --- a/src/USER-EFF/compute_temp_region_eff.cpp +++ b/src/USER-EFF/compute_temp_region_eff.cpp @@ -27,8 +27,6 @@ #include "region.h" #include "update.h" -#include - using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ diff --git a/src/USER-EFF/fix_nve_eff.cpp b/src/USER-EFF/fix_nve_eff.cpp index bfdd85df49..436f6f56da 100644 --- a/src/USER-EFF/fix_nve_eff.cpp +++ b/src/USER-EFF/fix_nve_eff.cpp @@ -15,15 +15,14 @@ Contributing author: Andres Jaramillo-Botero (Caltech) ------------------------------------------------------------------------- */ -#include - #include "fix_nve_eff.h" + #include "atom.h" -#include "force.h" -#include "update.h" -#include "respa.h" -#include "error.h" #include "domain.h" +#include "error.h" +#include "force.h" +#include "respa.h" +#include "update.h" using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/USER-EFF/fix_nvt_eff.cpp b/src/USER-EFF/fix_nvt_eff.cpp index f5358b5db1..1748530fba 100644 --- a/src/USER-EFF/fix_nvt_eff.cpp +++ b/src/USER-EFF/fix_nvt_eff.cpp @@ -17,8 +17,6 @@ #include "group.h" #include "modify.h" -#include - using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/USER-MEAMC/pair_meamc.cpp b/src/USER-MEAMC/pair_meamc.cpp index 67ab3522ad..f8cb2a3d91 100644 --- a/src/USER-MEAMC/pair_meamc.cpp +++ b/src/USER-MEAMC/pair_meamc.cpp @@ -17,20 +17,21 @@ #include "pair_meamc.h" -#include - -#include "meam.h" #include "atom.h" -#include "force.h" #include "comm.h" -#include "neighbor.h" +#include "error.h" +#include "force.h" +#include "meam.h" +#include "memory.h" #include "neigh_list.h" #include "neigh_request.h" -#include "memory.h" -#include "error.h" +#include "neighbor.h" #include "potential_file_reader.h" #include "tokenizer.h" +#include +#include + using namespace LAMMPS_NS; #define MAXLINE 1024 diff --git a/src/USER-MEAMC/pair_meamc.h b/src/USER-MEAMC/pair_meamc.h index de07d813b4..7672612c19 100644 --- a/src/USER-MEAMC/pair_meamc.h +++ b/src/USER-MEAMC/pair_meamc.h @@ -22,8 +22,8 @@ PairStyle(meam,PairMEAMC) #define LMP_PAIR_MEAMC_H #include "pair.h" + #include -#include namespace LAMMPS_NS { diff --git a/src/USER-MESODPD/atom_vec_edpd.cpp b/src/USER-MESODPD/atom_vec_edpd.cpp index ddeabd54db..4880b1303c 100644 --- a/src/USER-MESODPD/atom_vec_edpd.cpp +++ b/src/USER-MESODPD/atom_vec_edpd.cpp @@ -15,7 +15,6 @@ #include "atom.h" #include "error.h" -#include "modify.h" #include "update.h" #include diff --git a/src/USER-MESODPD/pair_edpd.cpp b/src/USER-MESODPD/pair_edpd.cpp index 04307429b4..147e5c322f 100644 --- a/src/USER-MESODPD/pair_edpd.cpp +++ b/src/USER-MESODPD/pair_edpd.cpp @@ -18,20 +18,20 @@ #include "pair_edpd.h" +#include "atom.h" +#include "citeme.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "neigh_list.h" +#include "neighbor.h" +#include "random_mars.h" +#include "update.h" + #include #include #include -#include "atom.h" -#include "comm.h" -#include "update.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "random_mars.h" -#include "citeme.h" -#include "memory.h" -#include "error.h" - using namespace LAMMPS_NS; @@ -275,11 +275,9 @@ void PairEDPD::settings(int narg, char **arg) // initialize Marsaglia RNG with processor-unique seed - if (seed <= 0) { - struct timespec time; - clock_gettime( CLOCK_REALTIME, &time ); - seed = time.tv_nsec; // if seed is non-positive, get the current time as the seed - } + if (seed <= 0) + error->all(FLERR,"Invalid random number seed"); + delete random; random = new RanMars(lmp,(seed + comm->me) % 900000000); randomT = new RanMars(lmp,(2*seed + comm->me) % 900000000); diff --git a/src/USER-MISC/angle_gaussian.cpp b/src/USER-MISC/angle_gaussian.cpp index 639d753afa..b8bd68bd02 100644 --- a/src/USER-MISC/angle_gaussian.cpp +++ b/src/USER-MISC/angle_gaussian.cpp @@ -13,16 +13,17 @@ #include "angle_gaussian.h" -#include #include "atom.h" -#include "neighbor.h" -#include "domain.h" #include "comm.h" +#include "domain.h" +#include "error.h" #include "force.h" #include "math_const.h" #include "memory.h" -#include "error.h" +#include "neighbor.h" +#include +#include using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/USER-MISC/compute_gyration_shape.cpp b/src/USER-MISC/compute_gyration_shape.cpp index ac073d4cbc..12ccd84533 100644 --- a/src/USER-MISC/compute_gyration_shape.cpp +++ b/src/USER-MISC/compute_gyration_shape.cpp @@ -19,7 +19,6 @@ #include "error.h" #include "math_eigen.h" -#include "math_extra.h" #include "math_special.h" #include "modify.h" #include "update.h" diff --git a/src/USER-MISC/compute_gyration_shape_chunk.cpp b/src/USER-MISC/compute_gyration_shape_chunk.cpp index e66173d704..2adfa4d2c9 100644 --- a/src/USER-MISC/compute_gyration_shape_chunk.cpp +++ b/src/USER-MISC/compute_gyration_shape_chunk.cpp @@ -19,7 +19,6 @@ #include "error.h" #include "math_eigen.h" -#include "math_extra.h" #include "math_special.h" #include "memory.h" #include "modify.h" diff --git a/src/USER-MISC/compute_pressure_grem.cpp b/src/USER-MISC/compute_pressure_grem.cpp index 98f699491f..c3144c084c 100644 --- a/src/USER-MISC/compute_pressure_grem.cpp +++ b/src/USER-MISC/compute_pressure_grem.cpp @@ -21,8 +21,6 @@ #include "kspace.h" #include "error.h" -#include - using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- diff --git a/src/USER-MISC/dihedral_table_cut.cpp b/src/USER-MISC/dihedral_table_cut.cpp index 02e6d3e5da..eb90fd2dc4 100644 --- a/src/USER-MISC/dihedral_table_cut.cpp +++ b/src/USER-MISC/dihedral_table_cut.cpp @@ -29,7 +29,6 @@ #include "update.h" #include -#include #include // IWYU pragma: keep #include // IWYU pragma: keep diff --git a/src/USER-MISC/fix_addtorque.cpp b/src/USER-MISC/fix_addtorque.cpp index 59f2560e0b..4bcc15933f 100644 --- a/src/USER-MISC/fix_addtorque.cpp +++ b/src/USER-MISC/fix_addtorque.cpp @@ -28,8 +28,6 @@ #include "update.h" #include "variable.h" -#include - using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/USER-MISC/fix_electron_stopping_fit.cpp b/src/USER-MISC/fix_electron_stopping_fit.cpp index b36984f3df..b3dbfb3337 100644 --- a/src/USER-MISC/fix_electron_stopping_fit.cpp +++ b/src/USER-MISC/fix_electron_stopping_fit.cpp @@ -20,18 +20,13 @@ #include "atom.h" #include "citeme.h" -#include "compute.h" -#include "domain.h" #include "error.h" #include "force.h" #include "math_special.h" -#include "modify.h" -#include "region.h" #include "respa.h" #include "update.h" #include -#include using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/USER-MISC/fix_nvk.cpp b/src/USER-MISC/fix_nvk.cpp index ef6c390f95..6426eee5cc 100644 --- a/src/USER-MISC/fix_nvk.cpp +++ b/src/USER-MISC/fix_nvk.cpp @@ -17,14 +17,14 @@ #include "fix_nvk.h" -#include -#include #include "atom.h" -#include "force.h" -#include "update.h" -#include "respa.h" #include "error.h" +#include "force.h" #include "math_extra.h" +#include "respa.h" +#include "update.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/USER-MISC/fix_orient_eco.cpp b/src/USER-MISC/fix_orient_eco.cpp index 56da3cd6a1..ef68294fde 100644 --- a/src/USER-MISC/fix_orient_eco.cpp +++ b/src/USER-MISC/fix_orient_eco.cpp @@ -32,7 +32,6 @@ #include "update.h" #include -#include using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/USER-MISC/fix_rhok.cpp b/src/USER-MISC/fix_rhok.cpp index 18e1ed195f..54c6a0a9aa 100644 --- a/src/USER-MISC/fix_rhok.cpp +++ b/src/USER-MISC/fix_rhok.cpp @@ -24,7 +24,6 @@ #include "update.h" #include -#include using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/USER-MISC/fix_wall_region_ees.cpp b/src/USER-MISC/fix_wall_region_ees.cpp index 8a79b73034..84514526b1 100644 --- a/src/USER-MISC/fix_wall_region_ees.cpp +++ b/src/USER-MISC/fix_wall_region_ees.cpp @@ -27,7 +27,6 @@ #include "update.h" #include -#include using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/USER-MISC/pair_wf_cut.cpp b/src/USER-MISC/pair_wf_cut.cpp index d421049cec..451b3f1e49 100644 --- a/src/USER-MISC/pair_wf_cut.cpp +++ b/src/USER-MISC/pair_wf_cut.cpp @@ -25,8 +25,6 @@ #include "memory.h" #include "neigh_list.h" -#include -#include #include using namespace LAMMPS_NS; diff --git a/src/USER-OMP/fix_nvt_asphere_omp.cpp b/src/USER-OMP/fix_nvt_asphere_omp.cpp index c8db9cc98d..2ed5632fad 100644 --- a/src/USER-OMP/fix_nvt_asphere_omp.cpp +++ b/src/USER-OMP/fix_nvt_asphere_omp.cpp @@ -11,11 +11,11 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include #include "fix_nvt_asphere_omp.h" + +#include "error.h" #include "group.h" #include "modify.h" -#include "error.h" using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/USER-OMP/fix_nvt_omp.cpp b/src/USER-OMP/fix_nvt_omp.cpp index 240825b2c6..6dc59b2db6 100644 --- a/src/USER-OMP/fix_nvt_omp.cpp +++ b/src/USER-OMP/fix_nvt_omp.cpp @@ -17,8 +17,6 @@ #include "group.h" #include "modify.h" -#include - using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/USER-OMP/fix_qeq_comb_omp.cpp b/src/USER-OMP/fix_qeq_comb_omp.cpp index 6844729e92..17b932baf0 100644 --- a/src/USER-OMP/fix_qeq_comb_omp.cpp +++ b/src/USER-OMP/fix_qeq_comb_omp.cpp @@ -17,19 +17,19 @@ #include "fix_qeq_comb_omp.h" -#include -#include -#include "pair_comb.h" #include "atom.h" #include "comm.h" +#include "error.h" #include "force.h" #include "group.h" #include "memory.h" -#include "error.h" #include "neigh_list.h" +#include "pair_comb.h" #include "respa.h" #include "update.h" +#include + using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/USER-OMP/npair_full_bin_atomonly_omp.cpp b/src/USER-OMP/npair_full_bin_atomonly_omp.cpp index 9a08cd284c..1637805081 100644 --- a/src/USER-OMP/npair_full_bin_atomonly_omp.cpp +++ b/src/USER-OMP/npair_full_bin_atomonly_omp.cpp @@ -11,14 +11,15 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "npair_full_bin_atomonly_omp.h" -#include "npair_omp.h" -#include "neigh_list.h" + #include "atom.h" -#include "atom_vec.h" -#include "my_page.h" #include "error.h" +#include "my_page.h" +#include "neigh_list.h" +#include "npair_omp.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/npair_half_bin_atomonly_newton_omp.cpp b/src/USER-OMP/npair_half_bin_atomonly_newton_omp.cpp index 816ebcb693..2e4ab6509a 100644 --- a/src/USER-OMP/npair_half_bin_atomonly_newton_omp.cpp +++ b/src/USER-OMP/npair_half_bin_atomonly_newton_omp.cpp @@ -11,14 +11,16 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "npair_half_bin_atomonly_newton_omp.h" -#include "npair_omp.h" -#include "neigh_list.h" + #include "atom.h" #include "atom_vec.h" -#include "my_page.h" #include "error.h" +#include "my_page.h" +#include "neigh_list.h" +#include "npair_omp.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/npair_half_size_bin_newtoff_omp.cpp b/src/USER-OMP/npair_half_size_bin_newtoff_omp.cpp index 43b5e7e822..caea9e13d7 100644 --- a/src/USER-OMP/npair_half_size_bin_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_size_bin_newtoff_omp.cpp @@ -11,14 +11,15 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "npair_half_size_bin_newtoff_omp.h" -#include "npair_omp.h" -#include "neigh_list.h" + #include "atom.h" -#include "atom_vec.h" -#include "my_page.h" #include "error.h" +#include "my_page.h" +#include "neigh_list.h" +#include "npair_omp.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/npair_half_size_bin_newton_omp.cpp b/src/USER-OMP/npair_half_size_bin_newton_omp.cpp index 600348ca73..188e936cc4 100644 --- a/src/USER-OMP/npair_half_size_bin_newton_omp.cpp +++ b/src/USER-OMP/npair_half_size_bin_newton_omp.cpp @@ -11,14 +11,15 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "npair_half_size_bin_newton_omp.h" -#include "npair_omp.h" -#include "neigh_list.h" + #include "atom.h" -#include "atom_vec.h" -#include "my_page.h" #include "error.h" +#include "my_page.h" +#include "neigh_list.h" +#include "npair_omp.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/npair_half_size_bin_newton_tri_omp.cpp b/src/USER-OMP/npair_half_size_bin_newton_tri_omp.cpp index 88a72c4594..d0c6841c3e 100644 --- a/src/USER-OMP/npair_half_size_bin_newton_tri_omp.cpp +++ b/src/USER-OMP/npair_half_size_bin_newton_tri_omp.cpp @@ -11,14 +11,15 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "npair_half_size_bin_newton_tri_omp.h" -#include "npair_omp.h" -#include "neigh_list.h" + #include "atom.h" -#include "atom_vec.h" -#include "my_page.h" #include "error.h" +#include "my_page.h" +#include "neigh_list.h" +#include "npair_omp.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/npair_half_size_multi_newtoff_omp.cpp b/src/USER-OMP/npair_half_size_multi_newtoff_omp.cpp index 1e9b9369bd..a8d187d958 100644 --- a/src/USER-OMP/npair_half_size_multi_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_size_multi_newtoff_omp.cpp @@ -11,14 +11,15 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "npair_half_size_multi_newtoff_omp.h" -#include "npair_omp.h" -#include "neigh_list.h" + #include "atom.h" -#include "atom_vec.h" -#include "my_page.h" #include "error.h" +#include "my_page.h" +#include "neigh_list.h" +#include "npair_omp.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/npair_half_size_multi_newton_omp.cpp b/src/USER-OMP/npair_half_size_multi_newton_omp.cpp index 0bf79ff77d..61031c553b 100644 --- a/src/USER-OMP/npair_half_size_multi_newton_omp.cpp +++ b/src/USER-OMP/npair_half_size_multi_newton_omp.cpp @@ -11,14 +11,15 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "npair_half_size_multi_newton_omp.h" -#include "npair_omp.h" -#include "neigh_list.h" + #include "atom.h" -#include "atom_vec.h" -#include "my_page.h" #include "error.h" +#include "my_page.h" +#include "neigh_list.h" +#include "npair_omp.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/npair_half_size_multi_newton_tri_omp.cpp b/src/USER-OMP/npair_half_size_multi_newton_tri_omp.cpp index 96b57cc7c6..8acfc0e3bc 100644 --- a/src/USER-OMP/npair_half_size_multi_newton_tri_omp.cpp +++ b/src/USER-OMP/npair_half_size_multi_newton_tri_omp.cpp @@ -11,14 +11,15 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "npair_half_size_multi_newton_tri_omp.h" -#include "npair_omp.h" -#include "neigh_list.h" + #include "atom.h" -#include "atom_vec.h" -#include "my_page.h" #include "error.h" +#include "my_page.h" +#include "neigh_list.h" +#include "npair_omp.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/npair_half_size_nsq_newtoff_omp.cpp b/src/USER-OMP/npair_half_size_nsq_newtoff_omp.cpp index 758eae2bd9..452a17fafe 100644 --- a/src/USER-OMP/npair_half_size_nsq_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_size_nsq_newtoff_omp.cpp @@ -11,15 +11,16 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "npair_half_size_nsq_newtoff_omp.h" -#include "npair_omp.h" -#include "neigh_list.h" + #include "atom.h" -#include "atom_vec.h" +#include "error.h" #include "group.h" #include "my_page.h" -#include "error.h" +#include "neigh_list.h" +#include "npair_omp.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/npair_half_size_nsq_newton_omp.cpp b/src/USER-OMP/npair_half_size_nsq_newton_omp.cpp index 6f9a3fbbaa..e63c564a0e 100644 --- a/src/USER-OMP/npair_half_size_nsq_newton_omp.cpp +++ b/src/USER-OMP/npair_half_size_nsq_newton_omp.cpp @@ -11,15 +11,16 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "npair_half_size_nsq_newton_omp.h" -#include "npair_omp.h" -#include "neigh_list.h" + #include "atom.h" -#include "atom_vec.h" +#include "error.h" #include "group.h" #include "my_page.h" -#include "error.h" +#include "neigh_list.h" +#include "npair_omp.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/npair_halffull_newtoff_omp.cpp b/src/USER-OMP/npair_halffull_newtoff_omp.cpp index 088e490384..378859beff 100644 --- a/src/USER-OMP/npair_halffull_newtoff_omp.cpp +++ b/src/USER-OMP/npair_halffull_newtoff_omp.cpp @@ -11,13 +11,14 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "npair_halffull_newtoff_omp.h" -#include "npair_omp.h" -#include "neigh_list.h" -#include "atom_vec.h" -#include "my_page.h" + #include "error.h" +#include "my_page.h" +#include "neigh_list.h" +#include "npair_omp.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/npair_halffull_newton_omp.cpp b/src/USER-OMP/npair_halffull_newton_omp.cpp index 6ec75d2428..c9852b526f 100644 --- a/src/USER-OMP/npair_halffull_newton_omp.cpp +++ b/src/USER-OMP/npair_halffull_newton_omp.cpp @@ -11,14 +11,15 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "npair_halffull_newton_omp.h" -#include "npair_omp.h" -#include "neigh_list.h" + #include "atom.h" -#include "atom_vec.h" -#include "my_page.h" #include "error.h" +#include "my_page.h" +#include "neigh_list.h" +#include "npair_omp.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/pair_tersoff_mod_c_omp.cpp b/src/USER-OMP/pair_tersoff_mod_c_omp.cpp index 8f255ee1ba..9da74e36b1 100644 --- a/src/USER-OMP/pair_tersoff_mod_c_omp.cpp +++ b/src/USER-OMP/pair_tersoff_mod_c_omp.cpp @@ -20,6 +20,8 @@ #include "neigh_list.h" #include "suffix.h" +#include + #include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathExtra; diff --git a/src/USER-OMP/pair_tersoff_mod_omp.cpp b/src/USER-OMP/pair_tersoff_mod_omp.cpp index 454a387982..28d64ca19f 100644 --- a/src/USER-OMP/pair_tersoff_mod_omp.cpp +++ b/src/USER-OMP/pair_tersoff_mod_omp.cpp @@ -16,12 +16,12 @@ #include "atom.h" #include "comm.h" -#include "force.h" #include "math_extra.h" #include "neigh_list.h" -#include "neighbor.h" #include "suffix.h" +#include + #include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathExtra; diff --git a/src/USER-OMP/pair_tersoff_omp.cpp b/src/USER-OMP/pair_tersoff_omp.cpp index c12e3b9859..55bb7791a4 100644 --- a/src/USER-OMP/pair_tersoff_omp.cpp +++ b/src/USER-OMP/pair_tersoff_omp.cpp @@ -16,13 +16,13 @@ #include "atom.h" #include "comm.h" -#include "force.h" #include "math_extra.h" #include "memory.h" #include "neigh_list.h" -#include "neighbor.h" #include "suffix.h" +#include + #include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathExtra; diff --git a/src/USER-OMP/pair_tersoff_zbl_omp.cpp b/src/USER-OMP/pair_tersoff_zbl_omp.cpp index 2e433a12ee..c0fef02a23 100644 --- a/src/USER-OMP/pair_tersoff_zbl_omp.cpp +++ b/src/USER-OMP/pair_tersoff_zbl_omp.cpp @@ -17,14 +17,15 @@ ------------------------------------------------------------------------- */ #include "pair_tersoff_zbl_omp.h" -#include "update.h" + #include "comm.h" -#include "memory.h" #include "error.h" -#include "tokenizer.h" -#include "potential_file_reader.h" #include "math_const.h" #include "math_special.h" +#include "memory.h" +#include "potential_file_reader.h" +#include "tokenizer.h" +#include "update.h" #include #include diff --git a/src/USER-OMP/pair_vashishta_omp.cpp b/src/USER-OMP/pair_vashishta_omp.cpp index 23d7235578..daac740dbf 100644 --- a/src/USER-OMP/pair_vashishta_omp.cpp +++ b/src/USER-OMP/pair_vashishta_omp.cpp @@ -16,10 +16,8 @@ #include "atom.h" #include "comm.h" -#include "force.h" #include "memory.h" #include "neigh_list.h" -#include "neighbor.h" #include "suffix.h" #include "omp_compat.h" diff --git a/src/USER-PACE/pair_pace.cpp b/src/USER-PACE/pair_pace.cpp index d6eda0f511..cfa98cea54 100644 --- a/src/USER-PACE/pair_pace.cpp +++ b/src/USER-PACE/pair_pace.cpp @@ -40,7 +40,6 @@ Copyright 2021 Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, #include "neighbor.h" #include "update.h" -#include #include #include "ace_evaluator.h" diff --git a/src/USER-PTM/ptm_constants.cpp b/src/USER-PTM/ptm_constants.cpp index 82bead2101..47d6d010f0 100644 --- a/src/USER-PTM/ptm_constants.cpp +++ b/src/USER-PTM/ptm_constants.cpp @@ -8,7 +8,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI */ #include "ptm_constants.h" -#include const int ptm_num_nbrs[9] = {0, PTM_NUM_NBRS_FCC, PTM_NUM_NBRS_HCP, PTM_NUM_NBRS_BCC, PTM_NUM_NBRS_ICO, PTM_NUM_NBRS_SC, PTM_NUM_NBRS_DCUB, PTM_NUM_NBRS_DHEX, PTM_NUM_NBRS_GRAPHENE}; diff --git a/src/USER-SMD/fix_smd_wall_surface.cpp b/src/USER-SMD/fix_smd_wall_surface.cpp index e9d32b5684..4c9c469bda 100644 --- a/src/USER-SMD/fix_smd_wall_surface.cpp +++ b/src/USER-SMD/fix_smd_wall_surface.cpp @@ -22,7 +22,6 @@ #include "comm.h" #include "domain.h" #include "error.h" -#include "memory.h" #include #include diff --git a/src/atom.cpp b/src/atom.cpp index ecb82993ce..70ed5a3836 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -34,6 +34,7 @@ #include "library.h" #include +#include #include #ifdef LMP_USER_INTEL diff --git a/src/atom_vec.h b/src/atom_vec.h index ea2253d0c3..a1bd8fd812 100644 --- a/src/atom_vec.h +++ b/src/atom_vec.h @@ -15,6 +15,7 @@ #define LMP_ATOM_VEC_H #include "pointers.h" // IWYU pragma: export +#include namespace LAMMPS_NS { diff --git a/tools/lammps-shell/lammps-shell.cpp b/tools/lammps-shell/lammps-shell.cpp index 6c8873093f..699062059a 100644 --- a/tools/lammps-shell/lammps-shell.cpp +++ b/tools/lammps-shell/lammps-shell.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -352,7 +351,7 @@ static char *plugin_generator(const char *text, int state) { const char *subcmd[] = {"load", "unload", "list", "clear", NULL}; const char *sub; - static std::size_t idx, len; + static std::size_t idx=0, len; if (!state) idx = 0; len = strlen(text); @@ -368,7 +367,7 @@ static char *plugin_style_generator(const char *text, int state) { const char *styles[] = {"pair", "fix", "command", NULL}; const char *s; - static std::size_t idx, len; + static std::size_t idx=0, len; if (!state) idx = 0; len = strlen(text); while ((s = styles[idx]) != NULL) { @@ -384,10 +383,10 @@ static char *plugin_name_generator(const char *text, int state) auto words = utils::split_words(text); if (words.size() < 4) return nullptr; - static std::size_t idx, len; + static std::size_t idx, len, nmax; if (!state) idx = 0; len = words[3].size(); - int nmax = lammps_plugin_count(); + nmax = lammps_plugin_count(); while (idx < nmax) { char style[buflen], name[buflen]; From 92a9994fd4a6998534b4fa0aee3bd199e54d5866 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 24 Apr 2021 18:29:57 -0400 Subject: [PATCH 3/8] silence compiler warnings by avoiding to shadow variables --- src/KSPACE/remap.cpp | 40 +++++++++++++++---------------- src/MANYBODY/pair_eim.cpp | 6 ++--- src/RIGID/fix_rigid.cpp | 4 ++-- src/RIGID/fix_rigid_nh_small.cpp | 6 ++--- src/RIGID/fix_rigid_small.cpp | 20 ++++++++-------- src/USER-OMP/fix_rigid_nh_omp.cpp | 20 +++++++--------- 6 files changed, 46 insertions(+), 50 deletions(-) diff --git a/src/KSPACE/remap.cpp b/src/KSPACE/remap.cpp index c99bbb2562..6caaa9fe2c 100644 --- a/src/KSPACE/remap.cpp +++ b/src/KSPACE/remap.cpp @@ -241,7 +241,7 @@ struct remap_plan_3d *remap_3d_create_plan( struct remap_plan_3d *plan; struct extent_3d *inarray, *outarray; struct extent_3d in,out,overlap; - int i,iproc,nsend,nrecv,ibuf,size,me,nprocs; + int i,j,iproc,nsend,nrecv,ibuf,size,me,nprocs; // query MPI info @@ -465,14 +465,14 @@ struct remap_plan_3d *remap_3d_create_plan( int *commringlist = (int *) malloc(maxcommsize*sizeof(int)); int commringlen = 0; - for (int i = 0; i < nrecv; i++) { + for (i = 0; i < nrecv; i++) { commringlist[i] = plan->recv_proc[i]; commringlen++; } - for (int i = 0; i < nsend; i++) { + for (i = 0; i < nsend; i++) { int foundentry = 0; - for (int j=0;jsend_proc[i]) foundentry = 1; if (!foundentry) { commringlist[commringlen] = plan->send_proc[i]; @@ -483,12 +483,12 @@ struct remap_plan_3d *remap_3d_create_plan( // sort initial commringlist int swap = 0; - for (int c = 0 ; c < (commringlen - 1); c++) { - for (int d = 0 ; d < commringlen - c - 1; d++) { - if (commringlist[d] > commringlist[d+1]) { - swap = commringlist[d]; - commringlist[d] = commringlist[d+1]; - commringlist[d+1] = swap; + for (i = 0 ; i < (commringlen - 1); i++) { + for (j = 0 ; j < commringlen - i - 1; j++) { + if (commringlist[j] > commringlist[j+1]) { + swap = commringlist[j]; + commringlist[j] = commringlist[j+1]; + commringlist[j+1] = swap; } } } @@ -502,12 +502,12 @@ struct remap_plan_3d *remap_3d_create_plan( while (commringappend) { int newcommringlen = commringlen; commringappend = 0; - for (int i=0;i commringlist[d+1]) { - swap = commringlist[d]; - commringlist[d] = commringlist[d+1]; - commringlist[d+1] = swap; + for (i = 0 ; i < ( commringlen - 1 ); i++) { + for (j = 0 ; j < commringlen - i - 1; j++) { + if (commringlist[j] > commringlist[j+1]) { + swap = commringlist[j]; + commringlist[j] = commringlist[j+1]; + commringlist[j+1] = swap; } } } diff --git a/src/MANYBODY/pair_eim.cpp b/src/MANYBODY/pair_eim.cpp index eda1838a5a..611f2a8ea8 100644 --- a/src/MANYBODY/pair_eim.cpp +++ b/src/MANYBODY/pair_eim.cpp @@ -1028,7 +1028,7 @@ std::pair EIMPotentialFileReader::get_pair(const std:: return std::make_pair(b, a); } -char * EIMPotentialFileReader::next_line(FILE * fp) { +char *EIMPotentialFileReader::next_line(FILE * fp) { // concatenate lines if they end with '&' // strip comments after '#' int n = 0; @@ -1058,7 +1058,7 @@ char * EIMPotentialFileReader::next_line(FILE * fp) { } while (n == 0 || concat) { - char *ptr = fgets(&line[n], MAXLINE - n, fp); + ptr = fgets(&line[n], MAXLINE - n, fp); if (ptr == nullptr) { // EOF @@ -1089,7 +1089,7 @@ char * EIMPotentialFileReader::next_line(FILE * fp) { void EIMPotentialFileReader::parse(FILE * fp) { - char * line = nullptr; + char *line = nullptr; bool found_global = false; while ((line = next_line(fp))) { diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index 3cd4f5dbc8..da6785fc4a 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -329,7 +329,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : pstyle = ANISO; dimension = domain->dimension; - for (int i = 0; i < 3; i++) { + for (i = 0; i < 3; i++) { p_start[i] = p_stop[i] = p_period[i] = 0.0; p_flag[i] = 0; } @@ -551,7 +551,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : // set pstat_flag pstat_flag = 0; - for (int i = 0; i < 3; i++) + for (i = 0; i < 3; i++) if (p_flag[i]) pstat_flag = 1; if (pcouple == XYZ || (dimension == 2 && pcouple == XY)) pstyle = ISO; diff --git a/src/RIGID/fix_rigid_nh_small.cpp b/src/RIGID/fix_rigid_nh_small.cpp index 0f1e813234..cc7ea24c34 100644 --- a/src/RIGID/fix_rigid_nh_small.cpp +++ b/src/RIGID/fix_rigid_nh_small.cpp @@ -705,7 +705,7 @@ void FixRigidNHSmall::final_integrate() if (pstat_flag) { akin_t = akin_r = 0.0; - for (int ibody = 0; ibody < nlocal_body; ibody++) { + for (ibody = 0; ibody < nlocal_body; ibody++) { Body *b = &body[ibody]; akin_t += b->mass*(b->vcm[0]*b->vcm[0] + b->vcm[1]*b->vcm[1] + b->vcm[2]*b->vcm[2]); @@ -856,7 +856,7 @@ void FixRigidNHSmall::nhc_press_integrate() double tb_mass = kt / (p_freq_max * p_freq_max); q_b[0] = dimension * dimension * tb_mass; - for (int i = 1; i < p_chain; i++) { + for (i = 1; i < p_chain; i++) { q_b[i] = tb_mass; f_eta_b[i] = q_b[i-1] * eta_dot_b[i-1] * eta_dot_b[i-1] - kt; f_eta_b[i] /= q_b[i]; @@ -941,7 +941,7 @@ double FixRigidNHSmall::compute_scalar() ke_t = 0.0; ke_q = 0.0; - for (int i = 0; i < nlocal_body; i++) { + for (i = 0; i < nlocal_body; i++) { vcm = body[i].vcm; quat = body[i].quat; ke_t += body[i].mass * (vcm[0]*vcm[0] + vcm[1]*vcm[1] + diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 14bd9f7a55..b7e9dd3902 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -192,7 +192,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : pcouple = NONE; pstyle = ANISO; - for (int i = 0; i < 3; i++) { + for (i = 0; i < 3; i++) { p_start[i] = p_stop[i] = p_period[i] = 0.0; p_flag[i] = 0; } @@ -367,7 +367,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : // error check and further setup for Molecule template if (onemols) { - for (int i = 0; i < nmol; i++) { + for (i = 0; i < nmol; i++) { if (onemols[i]->xflag == 0) error->all(FLERR,"Fix rigid/small molecule must have coordinates"); if (onemols[i]->typeflag == 0) @@ -385,7 +385,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : // set pstat_flag pstat_flag = 0; - for (int i = 0; i < 3; i++) + for (i = 0; i < 3; i++) if (p_flag[i]) pstat_flag = 1; if (pcouple == XYZ || (domain->dimension == 2 && pcouple == XY)) pstyle = ISO; @@ -451,7 +451,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : int one = 0; bigint atomone = 0; - for (int i = 0; i < nlocal; i++) { + for (i = 0; i < nlocal; i++) { if (bodyown[i] >= 0) one++; if (bodytag[i] > 0) atomone++; } @@ -978,7 +978,7 @@ void FixRigidSmall::compute_forces_and_torques() // include Langevin thermostat forces and torques if (langflag) { - for (int ibody = 0; ibody < nlocal_body; ibody++) { + for (ibody = 0; ibody < nlocal_body; ibody++) { fcm = body[ibody].fcm; fcm[0] += langextra[ibody][0]; fcm[1] += langextra[ibody][1]; @@ -1163,7 +1163,7 @@ int FixRigidSmall::dof(int tgroup) // 2 = # of particles in rigid body, disregarding temperature group memory->create(counts,nlocal_body+nghost_body,3,"rigid/small:counts"); - for (int i = 0; i < nlocal_body+nghost_body; i++) + for (i = 0; i < nlocal_body+nghost_body; i++) counts[i][0] = counts[i][1] = counts[i][2] = 0; // tally counts from my owned atoms @@ -1630,7 +1630,7 @@ void FixRigidSmall::create_bodies(tagint *bodyID) MPI_Allreduce(&rsqfar,&maxextent,1,MPI_DOUBLE,MPI_MAX,world); maxextent = sqrt(maxextent); if (onemols) { - for (int i = 0; i < nmol; i++) + for (i = 0; i < nmol; i++) maxextent = MAX(maxextent,onemols[i]->maxextent); } } @@ -1741,7 +1741,7 @@ int FixRigidSmall::rendezvous_body(int n, char *inbuf, double rsqfar = 0.0; - for (int i = 0; i < n; i++) { + for (i = 0; i < n; i++) { m = hash.find(in[i].bodyID)->second; xown = in[iclose[m]].x; x = in[i].x; @@ -1761,7 +1761,7 @@ int FixRigidSmall::rendezvous_body(int n, char *inbuf, OutRvous *out = (OutRvous *) memory->smalloc(nout*sizeof(OutRvous),"rigid/small:out"); - for (int i = 0; i < nout; i++) { + for (i = 0; i < nout; i++) { proclist[i] = in[i].me; out[i].ilocal = in[i].ilocal; m = hash.find(in[i].bodyID)->second; @@ -2493,7 +2493,7 @@ void FixRigidSmall::readfile(int which, double **array, int *inbody) // for which = 0, store all but inertia directly in body struct // for which = 1, store inertia tensor array, invert 3,4,5 values to Voigt - for (int i = 0; i < nchunk; i++) { + for (i = 0; i < nchunk; i++) { next = strchr(buf,'\n'); values[0] = strtok(buf," \t\n\r\f"); diff --git a/src/USER-OMP/fix_rigid_nh_omp.cpp b/src/USER-OMP/fix_rigid_nh_omp.cpp index 5a1e6ca25e..ae6cb92cee 100644 --- a/src/USER-OMP/fix_rigid_nh_omp.cpp +++ b/src/USER-OMP/fix_rigid_nh_omp.cpp @@ -234,8 +234,6 @@ void FixRigidNHOMP::initial_integrate(int vflag) void FixRigidNHOMP::compute_forces_and_torques() { - int ibody; - double * const * _noalias const x = atom->x; const dbl3_t * _noalias const f = (dbl3_t *) atom->f[0]; const double * const * const torque_one = atom->torque; @@ -373,9 +371,9 @@ void FixRigidNHOMP::compute_forces_and_torques() MPI_Allreduce(sum[0],all[0],6*nbody,MPI_DOUBLE,MPI_SUM,world); #if defined(_OPENMP) -#pragma omp parallel for LMP_DEFAULT_NONE private(ibody) schedule(static) +#pragma omp parallel for LMP_DEFAULT_NONE schedule(static) #endif - for (ibody = 0; ibody < nbody; ibody++) { + for (int ibody = 0; ibody < nbody; ibody++) { fcm[ibody][0] = all[ibody][0] + langextra[ibody][0]; fcm[ibody][1] = all[ibody][1] + langextra[ibody][1]; fcm[ibody][2] = all[ibody][2] + langextra[ibody][2]; @@ -388,9 +386,9 @@ void FixRigidNHOMP::compute_forces_and_torques() if (id_gravity) { #if defined(_OPENMP) -#pragma omp parallel for LMP_DEFAULT_NONE private(ibody) schedule(static) +#pragma omp parallel for LMP_DEFAULT_NONE schedule(static) #endif - for (ibody = 0; ibody < nbody; ibody++) { + for (int ibody = 0; ibody < nbody; ibody++) { fcm[ibody][0] += gvec[0]*masstotal[ibody]; fcm[ibody][1] += gvec[1]*masstotal[ibody]; fcm[ibody][2] += gvec[2]*masstotal[ibody]; @@ -628,12 +626,11 @@ void FixRigidNHOMP::set_xv_thr() // set x and v of each atom const int nlocal = atom->nlocal; - int i; #if defined(_OPENMP) -#pragma omp parallel for LMP_DEFAULT_NONE private(i) reduction(+:v0,v1,v2,v3,v4,v5) +#pragma omp parallel for LMP_DEFAULT_NONE reduction(+:v0,v1,v2,v3,v4,v5) #endif - for (i = 0; i < nlocal; i++) { + for (int i = 0; i < nlocal; i++) { const int ibody = body[i]; if (ibody < 0) continue; @@ -829,12 +826,11 @@ void FixRigidNHOMP::set_v_thr() // set v of each atom const int nlocal = atom->nlocal; - int i; #if defined(_OPENMP) -#pragma omp parallel for LMP_DEFAULT_NONE private(i) reduction(+:v0,v1,v2,v3,v4,v5) +#pragma omp parallel for LMP_DEFAULT_NONE reduction(+:v0,v1,v2,v3,v4,v5) #endif - for (i = 0; i < nlocal; i++) { + for (int i = 0; i < nlocal; i++) { const int ibody = body[i]; if (ibody < 0) continue; From 539ab023654bd9832e00b5cf7426cf2bff2a5884 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 24 Apr 2021 21:05:11 -0400 Subject: [PATCH 4/8] provide more generic implementation of Comm::read_lines_from_file() in utils --- src/utils.cpp | 30 ++++++++++++++++++++ src/utils.h | 25 ++++++++++++++++- unittest/formats/test_file_operations.cpp | 34 ++++++++++++++++++++++- 3 files changed, 87 insertions(+), 2 deletions(-) diff --git a/src/utils.cpp b/src/utils.cpp index 0ff1d65633..9aa8e2f7ee 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -225,6 +225,36 @@ void utils::sfread(const char *srcname, int srcline, void *s, size_t size, /* ------------------------------------------------------------------ */ +/* read N lines and broadcast */ +int utils::read_lines_from_file(FILE *fp, int nlines, int maxline, + char *buffer, int me, MPI_Comm comm) +{ + char *ptr = buffer; + *ptr = '\0'; + + if (me == 0) { + if (fp) { + for (int i = 0; i < nlines; i++) { + ptr = fgets(ptr,maxline,fp); + if (!ptr) break; // EOF? + // advance ptr to end of string and append newline char if needed. + ptr += strlen(ptr); + if (*(--ptr) != '\n') *(++ptr) = '\n'; + // ensure buffer is null terminated. null char is start of next line. + *(++ptr) = '\0'; + } + } + } + + int n = strlen(buffer); + MPI_Bcast(&n,1,MPI_INT,0,comm); + if (n == 0) return 1; + MPI_Bcast(buffer,n+1,MPI_CHAR,0,comm); + return 0; +} + +/* ------------------------------------------------------------------ */ + std::string utils::check_packages_for_style(const std::string &style, const std::string &name, LAMMPS *lmp) diff --git a/src/utils.h b/src/utils.h index c87f0b28a9..b393f89ffa 100644 --- a/src/utils.h +++ b/src/utils.h @@ -17,9 +17,12 @@ /*! \file utils.h */ #include "lmptype.h" + +#include + +#include #include #include -#include namespace LAMMPS_NS { @@ -89,6 +92,26 @@ namespace LAMMPS_NS { void sfread(const char *srcname, int srcline, void *s, size_t size, size_t num, FILE *fp, const char *filename, Error *error); + /** Read N lines of text from file into buffer and broadcast them + * + * This function uses repeated calls to fread() to fill a buffer with + * newline terminated text. If a line does not end in a newline (e.g. + * at the end of a file), it is added. The caller has to allocate an + * nlines by maxline sized buffer for storing the text data. + * Reading is done by MPI rank 0 of the given communicator only, and + * thus only MPI rank 0 needs to provide a valid file pointer. + * + * \param fp file pointer used by fread + * \param nlines number of lines to be read + * \param maxline maximum length of a single line + * \param buffer buffer for storing the data. + * \param me MPI rank of calling process in MPI communicator + * \param comm MPI communicator for broadcast + * \return 1 if the read was short, 0 if read was succesful */ + + int read_lines_from_file(FILE *fp, int nlines, int maxline, + char *buffer, int me, MPI_Comm comm); + /** Report if a requested style is in a package or may have a typo * * \param style type of style that is to be checked for diff --git a/unittest/formats/test_file_operations.cpp b/unittest/formats/test_file_operations.cpp index 700990fb72..9209e67585 100644 --- a/unittest/formats/test_file_operations.cpp +++ b/unittest/formats/test_file_operations.cpp @@ -11,13 +11,13 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +#include "../testing/core.h" #include "info.h" #include "input.h" #include "lammps.h" #include "utils.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "../testing/core.h" #include #include @@ -28,6 +28,7 @@ using namespace LAMMPS_NS; using testing::MatchesRegex; using testing::StrEq; +using utils::read_lines_from_file; using utils::sfgets; using utils::sfread; using utils::split_words; @@ -124,6 +125,37 @@ TEST_F(FileOperationsTest, safe_fread) fclose(fp); } +TEST_F(FileOperationsTest, read_lines_from_file) +{ + char *buf = new char[MAX_BUF_SIZE]; + FILE *fp = nullptr; + MPI_Comm world = MPI_COMM_WORLD; + int me, rv; + memset(buf, 0, MAX_BUF_SIZE); + + rv = utils::read_lines_from_file(nullptr, 1, MAX_BUF_SIZE, buf, me, world); + ASSERT_EQ(rv, 1); + + MPI_Comm_rank(world, &me); + if (me == 0) { + fp = fopen("safe_file_read_test.txt", "r"); + ASSERT_NE(fp, nullptr); + } else + ASSERT_EQ(fp, nullptr); + + rv = utils::read_lines_from_file(fp, 2, MAX_BUF_SIZE / 2, buf, me, world); + ASSERT_EQ(rv, 0); + ASSERT_THAT(buf, StrEq("one line\ntwo_lines\n")); + + rv = utils::read_lines_from_file(fp, 2, MAX_BUF_SIZE / 2, buf, me, world); + ASSERT_EQ(rv, 0); + ASSERT_THAT(buf, StrEq("\nno newline\n")); + + rv = utils::read_lines_from_file(fp, 2, MAX_BUF_SIZE / 2, buf, me, world); + ASSERT_EQ(rv, 1); + delete[] buf; +} + TEST_F(FileOperationsTest, logmesg) { char buf[8]; From 8e5e9951886aabc927358d038d58018a2b384c61 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 24 Apr 2021 21:31:01 -0400 Subject: [PATCH 5/8] add docs for new utility function --- doc/src/Developer_utils.rst | 18 +++++++++++++----- doc/utils/sphinx-config/false_positives.txt | 1 + src/utils.cpp | 4 ++-- src/utils.h | 8 ++++---- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/doc/src/Developer_utils.rst b/doc/src/Developer_utils.rst index 17b4715dc7..00a8b43a24 100644 --- a/doc/src/Developer_utils.rst +++ b/doc/src/Developer_utils.rst @@ -12,11 +12,16 @@ reduces redundant implementations and encourages consistent behavior. I/O with status check ^^^^^^^^^^^^^^^^^^^^^ -These are wrappers around the corresponding C library calls like -``fgets()`` or ``fread()``. They will check if there were errors -on reading or an unexpected end-of-file state was reached. In that -case, the functions will stop the calculation with an error message, -indicating the name of the problematic file, if possible. +The the first two functions are wrappers around the corresponding C +library calls ``fgets()`` or ``fread()``. They will check if there +were errors on reading or an unexpected end-of-file state was reached. +In that case, the functions will stop the calculation with an error +message, indicating the name of the problematic file, if possible. +The :cpp:func:`read_lines_from_file` function will read the requested +number of lines of a maximum length into a buffer and will return 0 +if successful or 1 if not. It also guarantees that all lines are +terminated with a newline character and the entire buffer with a +NULL character. ---------- @@ -26,6 +31,9 @@ indicating the name of the problematic file, if possible. .. doxygenfunction:: sfread :project: progguide +.. doxygenfunction:: read_lines_from_file + :project: progguide + ---------- String to number conversions with validity check diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index da69cc4edc..c93685c221 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -2190,6 +2190,7 @@ nl nlayers nlen Nlines +nlines nlo nlocal Nlocal diff --git a/src/utils.cpp b/src/utils.cpp index 9aa8e2f7ee..00510984fd 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -226,7 +226,7 @@ void utils::sfread(const char *srcname, int srcline, void *s, size_t size, /* ------------------------------------------------------------------ */ /* read N lines and broadcast */ -int utils::read_lines_from_file(FILE *fp, int nlines, int maxline, +int utils::read_lines_from_file(FILE *fp, int nlines, int nmax, char *buffer, int me, MPI_Comm comm) { char *ptr = buffer; @@ -235,7 +235,7 @@ int utils::read_lines_from_file(FILE *fp, int nlines, int maxline, if (me == 0) { if (fp) { for (int i = 0; i < nlines; i++) { - ptr = fgets(ptr,maxline,fp); + ptr = fgets(ptr,nmax,fp); if (!ptr) break; // EOF? // advance ptr to end of string and append newline char if needed. ptr += strlen(ptr); diff --git a/src/utils.h b/src/utils.h index b393f89ffa..770c0b527a 100644 --- a/src/utils.h +++ b/src/utils.h @@ -97,19 +97,19 @@ namespace LAMMPS_NS { * This function uses repeated calls to fread() to fill a buffer with * newline terminated text. If a line does not end in a newline (e.g. * at the end of a file), it is added. The caller has to allocate an - * nlines by maxline sized buffer for storing the text data. + * nlines by nmax sized buffer for storing the text data. * Reading is done by MPI rank 0 of the given communicator only, and * thus only MPI rank 0 needs to provide a valid file pointer. * * \param fp file pointer used by fread * \param nlines number of lines to be read - * \param maxline maximum length of a single line + * \param nmax maximum length of a single line * \param buffer buffer for storing the data. * \param me MPI rank of calling process in MPI communicator * \param comm MPI communicator for broadcast - * \return 1 if the read was short, 0 if read was succesful */ + * \return 1 if the read was short, 0 if read was successful */ - int read_lines_from_file(FILE *fp, int nlines, int maxline, + int read_lines_from_file(FILE *fp, int nlines, int nmax, char *buffer, int me, MPI_Comm comm); /** Report if a requested style is in a package or may have a typo From 7e7a448a08714a8a83bdb00f5c6f9b194905d1e6 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 24 Apr 2021 21:33:36 -0400 Subject: [PATCH 6/8] remove the old versions of the utility function and use the new --- lib/atc/LammpsInterface.cpp | 4 ++- src/REPLICA/neb.cpp | 5 +-- src/RIGID/fix_rigid.cpp | 2 +- src/RIGID/fix_rigid_small.cpp | 2 +- src/SPIN/neb_spin.cpp | 5 +-- src/comm.cpp | 68 ----------------------------------- src/comm.h | 3 -- src/read_data.cpp | 30 ++++++++-------- src/variable.cpp | 2 +- 9 files changed, 27 insertions(+), 94 deletions(-) diff --git a/lib/atc/LammpsInterface.cpp b/lib/atc/LammpsInterface.cpp index 5727af1904..b123331ee7 100644 --- a/lib/atc/LammpsInterface.cpp +++ b/lib/atc/LammpsInterface.cpp @@ -26,6 +26,7 @@ #include "bond.h" // bond potentials #include "comm.h" // #include "fix.h" +#include "utils.h" // ATC includes #include "ATC_Error.h" @@ -47,6 +48,7 @@ using std::pair; using std::string; using std::set; using LAMMPS_NS::bigint; +using LAMMPS_NS::utils::read_lines_from_file; namespace ATC { @@ -236,7 +238,7 @@ std::string LammpsInterface::read_file(std::string filename) const std::stringstream s; bool eof = false; while ( ! eof) { - eof = lammps_->comm->read_lines_from_file(fp,1,MAXLINE,buffer); + eof = read_lines_from_file(fp,1,MAXLINE,buffer,comm_rank(),lammps_->world); s << buffer; } fclose(fp); diff --git a/src/REPLICA/neb.cpp b/src/REPLICA/neb.cpp index 7183bdd168..295e97dee8 100644 --- a/src/REPLICA/neb.cpp +++ b/src/REPLICA/neb.cpp @@ -436,9 +436,10 @@ void NEB::readfile(char *file, int flag) while (nread < nlines) { nchunk = MIN(nlines-nread,CHUNK); if (flag == 0) - eofflag = comm->read_lines_from_file_universe(fp,nchunk,MAXLINE,buffer); + eofflag = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer, + universe->me,universe->uworld); else - eofflag = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer); + eofflag = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world); if (eofflag) error->all(FLERR,"Unexpected end of NEB file"); buf = buffer; diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index 3cd4f5dbc8..2ec8821666 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -2302,7 +2302,7 @@ void FixRigid::readfile(int which, double *vec, int nread = 0; while (nread < nlines) { nchunk = MIN(nlines-nread,CHUNK); - eofflag = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer); + eofflag = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world); if (eofflag) error->all(FLERR,"Unexpected end of fix rigid file"); buf = buffer; diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 14bd9f7a55..2cd87c45dc 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -2475,7 +2475,7 @@ void FixRigidSmall::readfile(int which, double **array, int *inbody) int nread = 0; while (nread < nlines) { nchunk = MIN(nlines-nread,CHUNK); - eofflag = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer); + eofflag = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world); if (eofflag) error->all(FLERR,"Unexpected end of fix rigid/small file"); buf = buffer; diff --git a/src/SPIN/neb_spin.cpp b/src/SPIN/neb_spin.cpp index 88a0ffc402..1761f73323 100644 --- a/src/SPIN/neb_spin.cpp +++ b/src/SPIN/neb_spin.cpp @@ -430,9 +430,10 @@ void NEBSpin::readfile(char *file, int flag) while (nread < nlines) { nchunk = MIN(nlines-nread,CHUNK); if (flag == 0) - eofflag = comm->read_lines_from_file_universe(fp,nchunk,MAXLINE,buffer); + eofflag = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer, + universe->me,universe->uworld); else - eofflag = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer); + eofflag = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world); if (eofflag) error->all(FLERR,"Unexpected end of neb/spin file"); buf = buffer; diff --git a/src/comm.cpp b/src/comm.cpp index 6d3f72d9c0..aa51c0484f 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -1240,71 +1240,3 @@ void Comm::rendezvous_stats(int n, int nout, int nrvous, int nrvous_out, utils::logmesg(lmp,mesg); } } - -/* ---------------------------------------------------------------------- - proc 0 reads Nlines from file into buf and bcasts buf to all procs - caller allocates buf to max size needed - each line is terminated by newline, even if last line in file is not - return 0 if successful, 1 if get EOF error before read is complete -------------------------------------------------------------------------- */ - -int Comm::read_lines_from_file(FILE *fp, int nlines, int maxline, char *buf) -{ - int m; - - if (me == 0) { - m = 0; - for (int i = 0; i < nlines; i++) { - if (!fgets(&buf[m],maxline,fp)) { - m = 0; - break; - } - m += strlen(&buf[m]); - } - if (m) { - if (buf[m-1] != '\n') strcpy(&buf[m++],"\n"); - m++; - } - } - - MPI_Bcast(&m,1,MPI_INT,0,world); - if (m == 0) return 1; - MPI_Bcast(buf,m,MPI_CHAR,0,world); - return 0; -} - -/* ---------------------------------------------------------------------- - proc 0 reads Nlines from file into buf and bcasts buf to all procs - caller allocates buf to max size needed - each line is terminated by newline, even if last line in file is not - return 0 if successful, 1 if get EOF error before read is complete -------------------------------------------------------------------------- */ - -int Comm::read_lines_from_file_universe(FILE *fp, int nlines, int maxline, - char *buf) -{ - int m; - - int me_universe = universe->me; - MPI_Comm uworld = universe->uworld; - - if (me_universe == 0) { - m = 0; - for (int i = 0; i < nlines; i++) { - if (!fgets(&buf[m],maxline,fp)) { - m = 0; - break; - } - m += strlen(&buf[m]); - } - if (m) { - if (buf[m-1] != '\n') strcpy(&buf[m++],"\n"); - m++; - } - } - - MPI_Bcast(&m,1,MPI_INT,0,uworld); - if (m == 0) return 1; - MPI_Bcast(buf,m,MPI_CHAR,0,uworld); - return 0; -} diff --git a/src/comm.h b/src/comm.h index d283144501..0bcd23cd8a 100644 --- a/src/comm.h +++ b/src/comm.h @@ -114,9 +114,6 @@ class Comm : protected Pointers { int (*)(int, char *, int &, int *&, char *&, void *), int, char *&, int, void *, int statflag=0); - int read_lines_from_file(FILE *, int, int, char *); - int read_lines_from_file_universe(FILE *, int, int, char *); - // extract data useful to other classes virtual void *extract(const char *, int &) {return nullptr;} diff --git a/src/read_data.cpp b/src/read_data.cpp index c0085f19d1..6ea22264cd 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -1226,7 +1226,7 @@ void ReadData::atoms() while (nread < natoms) { nchunk = MIN(natoms-nread,CHUNK); - eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer); + eof = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); atom->data_atoms(nchunk,buffer,id_offset,mol_offset,toffset,shiftflag,shift); nread += nchunk; @@ -1282,7 +1282,7 @@ void ReadData::velocities() while (nread < natoms) { nchunk = MIN(natoms-nread,CHUNK); - eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer); + eof = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); atom->data_vels(nchunk,buffer,id_offset); nread += nchunk; @@ -1324,7 +1324,7 @@ void ReadData::bonds(int firstpass) while (nread < nbonds) { nchunk = MIN(nbonds-nread,CHUNK); - eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer); + eof = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); atom->data_bonds(nchunk,buffer,count,id_offset,boffset); nread += nchunk; @@ -1398,7 +1398,7 @@ void ReadData::angles(int firstpass) while (nread < nangles) { nchunk = MIN(nangles-nread,CHUNK); - eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer); + eof = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); atom->data_angles(nchunk,buffer,count,id_offset,aoffset); nread += nchunk; @@ -1472,7 +1472,7 @@ void ReadData::dihedrals(int firstpass) while (nread < ndihedrals) { nchunk = MIN(ndihedrals-nread,CHUNK); - eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer); + eof = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); atom->data_dihedrals(nchunk,buffer,count,id_offset,doffset); nread += nchunk; @@ -1546,7 +1546,7 @@ void ReadData::impropers(int firstpass) while (nread < nimpropers) { nchunk = MIN(nimpropers-nread,CHUNK); - eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer); + eof = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); atom->data_impropers(nchunk,buffer,count,id_offset,ioffset); nread += nchunk; @@ -1613,7 +1613,7 @@ void ReadData::bonus(bigint nbonus, AtomVec *ptr, const char *type) while (nread < natoms) { nchunk = MIN(natoms-nread,CHUNK); - eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer); + eof = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); atom->data_bonus(nchunk,buffer,ptr,id_offset); nread += nchunk; @@ -1739,7 +1739,7 @@ void ReadData::mass() char *next; char *buf = new char[ntypes*MAXLINE]; - int eof = comm->read_lines_from_file(fp,ntypes,MAXLINE,buf); + int eof = utils::read_lines_from_file(fp,ntypes,MAXLINE,buf,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); char *original = buf; @@ -1759,7 +1759,7 @@ void ReadData::paircoeffs() char *next; char *buf = new char[ntypes*MAXLINE]; - int eof = comm->read_lines_from_file(fp,ntypes,MAXLINE,buf); + int eof = utils::read_lines_from_file(fp,ntypes,MAXLINE,buf,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); char *original = buf; @@ -1785,7 +1785,7 @@ void ReadData::pairIJcoeffs() int nsq = ntypes * (ntypes+1) / 2; char *buf = new char[nsq * MAXLINE]; - int eof = comm->read_lines_from_file(fp,nsq,MAXLINE,buf); + int eof = utils::read_lines_from_file(fp,nsq,MAXLINE,buf,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); char *original = buf; @@ -1811,7 +1811,7 @@ void ReadData::bondcoeffs() char *next; char *buf = new char[nbondtypes*MAXLINE]; - int eof = comm->read_lines_from_file(fp,nbondtypes,MAXLINE,buf); + int eof = utils::read_lines_from_file(fp,nbondtypes,MAXLINE,buf,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); char *original = buf; @@ -1836,7 +1836,7 @@ void ReadData::anglecoeffs(int which) char *next; char *buf = new char[nangletypes*MAXLINE]; - int eof = comm->read_lines_from_file(fp,nangletypes,MAXLINE,buf); + int eof = utils::read_lines_from_file(fp,nangletypes,MAXLINE,buf,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); char *original = buf; @@ -1862,7 +1862,7 @@ void ReadData::dihedralcoeffs(int which) char *next; char *buf = new char[ndihedraltypes*MAXLINE]; - int eof = comm->read_lines_from_file(fp,ndihedraltypes,MAXLINE,buf); + int eof = utils::read_lines_from_file(fp,ndihedraltypes,MAXLINE,buf,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); char *original = buf; @@ -1892,7 +1892,7 @@ void ReadData::impropercoeffs(int which) char *next; char *buf = new char[nimpropertypes*MAXLINE]; - int eof = comm->read_lines_from_file(fp,nimpropertypes,MAXLINE,buf); + int eof = utils::read_lines_from_file(fp,nimpropertypes,MAXLINE,buf,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); char *original = buf; @@ -1922,7 +1922,7 @@ void ReadData::fix(int ifix, char *keyword) bigint nread = 0; while (nread < nline) { nchunk = MIN(nline-nread,CHUNK); - eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer); + eof = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); modify->fix[ifix]->read_data_section(keyword,nchunk,buffer,id_offset); nread += nchunk; diff --git a/src/variable.cpp b/src/variable.cpp index ac225230cf..9cbbbc13d2 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -5176,7 +5176,7 @@ int VarReader::read_peratom() bigint nread = 0; while (nread < nlines) { nchunk = MIN(nlines-nread,CHUNK); - eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer); + eof = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world); if (eof) return 1; char *buf = buffer; From b0cd6b3ef7fd34e6ce851230038b76aaf26edf2b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 24 Apr 2021 22:08:28 -0400 Subject: [PATCH 7/8] improve docs also for related functions --- doc/src/Developer_utils.rst | 6 ++++-- doc/utils/sphinx-config/false_positives.txt | 1 + src/utils.h | 18 +++++++++++------- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/doc/src/Developer_utils.rst b/doc/src/Developer_utils.rst index 00a8b43a24..3165aaae75 100644 --- a/doc/src/Developer_utils.rst +++ b/doc/src/Developer_utils.rst @@ -15,8 +15,10 @@ I/O with status check The the first two functions are wrappers around the corresponding C library calls ``fgets()`` or ``fread()``. They will check if there were errors on reading or an unexpected end-of-file state was reached. -In that case, the functions will stop the calculation with an error -message, indicating the name of the problematic file, if possible. +In that case, the functions will stop with an error message, indicating +the name of the problematic file, if possible unless the *error* argument +is a NULL pointer. + The :cpp:func:`read_lines_from_file` function will read the requested number of lines of a maximum length into a buffer and will return 0 if successful or 1 if not. It also guarantees that all lines are diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index c93685c221..cefed6949d 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -2282,6 +2282,7 @@ Ntype ntypes Ntypes nucleotides +nullptr num numa numactl diff --git a/src/utils.h b/src/utils.h index 770c0b527a..21feef048b 100644 --- a/src/utils.h +++ b/src/utils.h @@ -55,7 +55,7 @@ namespace LAMMPS_NS { void logmesg(LAMMPS *lmp, const std::string &mesg); - /** return a string representing the current system error status + /** Return a string representing the current system error status * * This is a wrapper around calling strerror(errno). * @@ -63,8 +63,10 @@ namespace LAMMPS_NS { std::string getsyserror(); - /** safe wrapper around fgets() which aborts on errors - * or EOF and prints a suitable error message to help debugging + /** Safe wrapper around fgets() which aborts on errors + * or EOF and prints a suitable error message to help debugging. + * + * Use nullptr as the error parameter to avoid the abort on EOF or error. * * \param srcname name of the calling source file (from FLERR macro) * \param srcline line in the calling source file (from FLERR macro) @@ -72,13 +74,15 @@ namespace LAMMPS_NS { * \param size size of buffer s (max number of bytes read by fgets()) * \param fp file pointer used by fgets() * \param filename file name associated with fp (may be a null pointer; then LAMMPS will try to detect) - * \param error pointer to Error class instance (for abort) */ + * \param error pointer to Error class instance (for abort) or nullptr */ void sfgets(const char *srcname, int srcline, char *s, int size, FILE *fp, const char *filename, Error *error); - /** safe wrapper around fread() which aborts on errors - * or EOF and prints a suitable error message to help debugging + /** Safe wrapper around fread() which aborts on errors + * or EOF and prints a suitable error message to help debugging. + * + * Use nullptr as the error parameter to avoid the abort on EOF or error. * * \param srcname name of the calling source file (from FLERR macro) * \param srcline line in the calling source file (from FLERR macro) @@ -87,7 +91,7 @@ namespace LAMMPS_NS { * \param num number of data elements read by fread() * \param fp file pointer used by fread() * \param filename file name associated with fp (may be a null pointer; then LAMMPS will try to detect) - * \param error pointer to Error class instance (for abort) */ + * \param error pointer to Error class instance (for abort) or nullptr */ void sfread(const char *srcname, int srcline, void *s, size_t size, size_t num, FILE *fp, const char *filename, Error *error); From b4fa71857669bd5f9c27bae4461a8322c6c4935b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 25 Apr 2021 07:25:05 -0400 Subject: [PATCH 8/8] update the GitHub contributing guide to include the MatSci forum in addition to the mailing list. --- .github/CONTRIBUTING.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 62e7186360..31b9becc0c 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -26,11 +26,11 @@ __ ## I don't want to read this whole thing I just have a question! -> **Note:** Please do not file an issue to ask a general question about LAMMPS, its features, how to use specific commands, or how perform simulations or analysis in LAMMPS. Instead post your question to the ['lammps-users' mailing list](https://lammps.sandia.gov/mail.html). You do not need to be subscribed to post to the list (but a mailing list subscription avoids having your post delayed until it is approved by a mailing list moderator). Most posts to the mailing list receive a response within less than 24 hours. Before posting to the mailing list, please read the [mailing list guidelines](https://lammps.sandia.gov/guidelines.html). Following those guidelines will help greatly to get a helpful response. Always mention which LAMMPS version you are using. +> **Note:** Please do not file an issue to ask a general question about LAMMPS, its features, how to use specific commands, or how perform simulations or analysis in LAMMPS. Instead post your question to either the ['lammps-users' mailing list](https://lammps.sandia.gov/mail.html) or the [LAMMPS Material Science Discourse forum](https://matsci.org/lammps). You do not need to be subscribed to post to the list (but a mailing list subscription avoids having your post delayed until it is approved by a mailing list moderator). Most posts to the mailing list receive a response within less than 24 hours. Before posting to the mailing list, please read the [mailing list guidelines](https://lammps.sandia.gov/guidelines.html). Following those guidelines will help greatly to get a helpful response. Always mention which LAMMPS version you are using. The LAMMPS forum was recently created as part of a larger effort to build a materials science community and have discussions not just about using LAMMPS. Thus the forum may be also used for discussions that would be off-topic for the mailing list. Those will just have to be moved to a more general category. ## How Can I Contribute? -There are several ways how you can actively contribute to the LAMMPS project: you can discuss compiling and using LAMMPS, and solving LAMMPS related problems with other LAMMPS users on the lammps-users mailing list, you can report bugs or suggest enhancements by creating issues on GitHub (or posting them to the lammps-users mailing list), and you can contribute by submitting pull requests on GitHub or e-mail your code +There are several ways how you can actively contribute to the LAMMPS project: you can discuss compiling and using LAMMPS, and solving LAMMPS related problems with other LAMMPS users on the lammps-users mailing list, you can report bugs or suggest enhancements by creating issues on GitHub (or posting them to the lammps-users mailing list or posting in the LAMMPS Materials Science Discourse forum), and you can contribute by submitting pull requests on GitHub or e-mail your code to one of the [LAMMPS core developers](https://lammps.sandia.gov/authors.html). As you may see from the aforementioned developer page, the LAMMPS software package includes the efforts of a very large number of contributors beyond the principal authors and maintainers. ### Discussing How To Use LAMMPS @@ -42,6 +42,8 @@ Anyone can browse/search previous questions/answers in the archives. You do not If you post a message and you are a subscriber, your message will appear immediately. If you are not a subscriber, your message will be moderated, which typically takes one business day. Either way, when someone replies the reply will usually be sent to both, your personal email address and the mailing list. When replying to people, that responded to your post to the list, please always included the mailing list in your replies (i.e. use "Reply All" and **not** "Reply"). Responses will appear on the list in a few minutes, but it can take a few hours for postings and replies to show up in the SourceForge archive. Sending replies also to the mailing list is important, so that responses are archived and people with a similar issue can search for possible solutions in the mailing list archive. +The LAMMPS Materials Science Discourse forum was created recently to facilitate discussion not just about LAMMPS and as part of a larger effort towards building a materials science community. The forum contains a read-only sub-category with the continually updated mailing list archive, so you won't miss anything by joining only the forum and not the mailing list. + ### Reporting Bugs While developers writing code for LAMMPS are careful to test their code, LAMMPS is such a large and complex software, that it is impossible to test for all combinations of features under all normal and not so normal circumstances. Thus bugs do happen, and if you suspect, that you have encountered one, please try to document it and report it as an [Issue](https://github.com/lammps/lammps/issues) on the LAMMPS GitHub project web page. However, before reporting a bug, you need to check whether this is something that may have already been corrected. The [Latest Features and Bug Fixes in LAMMPS](https://lammps.sandia.gov/bug.html) web page lists all significant changes to LAMMPS over the years. It also tells you what the current latest development version of LAMMPS is, and you should test whether your issue still applies to that version.