From ffb074e8128bce089acd175d12cba9a1e4560012 Mon Sep 17 00:00:00 2001 From: abhishandy Date: Fri, 7 Aug 2020 22:15:40 -0400 Subject: [PATCH 001/384] created an empty tester for improper style --- unittest/force-styles/CMakeLists.txt | 13 ++- unittest/force-styles/test_improper_style.cpp | 108 ++++++++++++++++++ 2 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 unittest/force-styles/test_improper_style.cpp diff --git a/unittest/force-styles/CMakeLists.txt b/unittest/force-styles/CMakeLists.txt index a1e586eef2..b8628f8c4d 100644 --- a/unittest/force-styles/CMakeLists.txt +++ b/unittest/force-styles/CMakeLists.txt @@ -96,7 +96,7 @@ endforeach() add_executable(test_angle_style test_angle_style.cpp) target_link_libraries(test_angle_style PRIVATE lammps style_tests) -file(GLOB ANGLE_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/angle-*.yaml) +file(GLOB IMPROPER_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/angle-*.yaml) foreach(TEST ${ANGLE_TESTS}) string(REGEX REPLACE "^.*angle-(.*)\.yaml" "AngleStyle:\\1" TNAME ${TEST}) add_test(NAME ${TNAME} COMMAND test_angle_style ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) @@ -114,3 +114,14 @@ foreach(TEST ${KSPACE_TESTS}) add_test(NAME ${TNAME} COMMAND test_pair_style ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") endforeach() + +# improper style tester +add_executable(test_improper_style test_improper_style.cpp) +target_link_libraries(test_improper_style PRIVATE lammps style_tests) + +file(GLOB IMPROPER_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/improper-*.yaml) +foreach(TEST ${IMPROPER_TESTS}) + string(REGEX REPLACE "^.*improper-(.*)\.yaml" "ImproperStyle:\\1" TNAME ${TEST}) + add_test(NAME ${TNAME} COMMAND test_improper_style ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") +endforeach() diff --git a/unittest/force-styles/test_improper_style.cpp b/unittest/force-styles/test_improper_style.cpp new file mode 100644 index 0000000000..d40c2b2cfd --- /dev/null +++ b/unittest/force-styles/test_improper_style.cpp @@ -0,0 +1,108 @@ +/* +- there are 7 basic functions + - delete_file + - cleanup_lammps + - init_lammps + - run_lammps + - restart_lammps + - data_lammps + - generate_yaml_file +- move delete_file amd cleanup_lammps to a single file +- I don't understand utility lambda, but they are being reused multiple times +- add as many comments as possible, to show my understanding and document the code +- code for matching forces, energy and stress are repeated 3 times +- run_lammps looks to be same across all tests - it isn't, there's subtle difference +*/ + +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +// unit tests for improper styles intended for molecular systems + +#include "error_stats.h" +#include "test_config.h" +#include "test_config_reader.h" +#include "test_main.h" +#include "yaml_reader.h" +#include "yaml_writer.h" + +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +#include "atom.h" +#include "improper.h" +#include "compute.h" +#include "fmt/format.h" +#include "force.h" +#include "info.h" +#include "input.h" +#include "lammps.h" +#include "modify.h" +#include "universe.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +using ::testing::HasSubstr; +using ::testing::StartsWith; + +using namespace LAMMPS_NS; + +static void delete_file(const std::string &filename) +{ + remove(filename.c_str()); +}; + +void cleanup_lammps(LAMMPS *lmp, const TestConfig &cfg) +{ + delete_file(cfg.basename + ".restart"); + delete_file(cfg.basename + ".data"); + delete_file(cfg.basename + "-coeffs.in"); + delete lmp; +} + +void run_lammps(LAMMPS *lmp) +{ + // utility lambda to improve readability + auto command = [&](const std::string &line) { + lmp->input->one(line.c_str()); + }; + + command("fix 1 all nve"); + command("compute pe all pe/atom improper"); + command("compute sum all reduce sum c_pe"); + command("thermo_style custom step temp pe press c_sum"); + command("thermo 2"); + command("run 4 post no"); +} + +LAMMPS *init_lammps(int argc, char **argv, const TestConfig &cfg, const bool newton = true){} + +void restart_lammps(LAMMPS *lmp, const TestConfig &cfg){} + +void data_lammps(LAMMPS *lmp, const TestConfig &cfg){} + +void generate_yaml_file(const char *outfile, const TestConfig &config){} + +TEST(ImproperStyle, plain){} +TEST(ImproperStyle, omp){} +TEST(ImproperStyle, single){} From a33c0081cd6c64b39e2a037ba5590949f1c6c9b0 Mon Sep 17 00:00:00 2001 From: abhishandy Date: Sat, 8 Aug 2020 15:58:41 -0400 Subject: [PATCH 002/384] setup a simple improper-harmonic test --- unittest/force-styles/CMakeLists.txt | 2 +- unittest/force-styles/test_improper_style.cpp | 827 +++++++++++++++++- .../force-styles/tests/improper-harmonic.yaml | 83 ++ 3 files changed, 904 insertions(+), 8 deletions(-) create mode 100644 unittest/force-styles/tests/improper-harmonic.yaml diff --git a/unittest/force-styles/CMakeLists.txt b/unittest/force-styles/CMakeLists.txt index b8628f8c4d..9c2b93c6a9 100644 --- a/unittest/force-styles/CMakeLists.txt +++ b/unittest/force-styles/CMakeLists.txt @@ -96,7 +96,7 @@ endforeach() add_executable(test_angle_style test_angle_style.cpp) target_link_libraries(test_angle_style PRIVATE lammps style_tests) -file(GLOB IMPROPER_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/angle-*.yaml) +file(GLOB ANGLE_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/angle-*.yaml) foreach(TEST ${ANGLE_TESTS}) string(REGEX REPLACE "^.*angle-(.*)\.yaml" "AngleStyle:\\1" TNAME ${TEST}) add_test(NAME ${TNAME} COMMAND test_angle_style ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/unittest/force-styles/test_improper_style.cpp b/unittest/force-styles/test_improper_style.cpp index d40c2b2cfd..a82fe5305e 100644 --- a/unittest/force-styles/test_improper_style.cpp +++ b/unittest/force-styles/test_improper_style.cpp @@ -72,6 +72,8 @@ static void delete_file(const std::string &filename) remove(filename.c_str()); }; +// Clean auxilliary files generated during the test +// which are also useful for debugging failing tests void cleanup_lammps(LAMMPS *lmp, const TestConfig &cfg) { delete_file(cfg.basename + ".restart"); @@ -80,6 +82,82 @@ void cleanup_lammps(LAMMPS *lmp, const TestConfig &cfg) delete lmp; } +// Initialize LAMMPS +// with the certain arguments, test configuration and an optional flag for newton +LAMMPS *init_lammps(int argc, char **argv, const TestConfig &cfg, const bool newton = true) +{ + LAMMPS *lmp; + + lmp = new LAMMPS(argc, argv, MPI_COMM_WORLD); + + // check if prerequisite styles are available + Info *info = new Info(lmp); + int nfail = 0; + for (auto &prerequisite : cfg.prerequisites) { + std::string style = prerequisite.second; + + // if the suffixed version of improper style is not available, don't test it + if (prerequisite.first == "improper") { + if (lmp->suffix_enable) { + style += "/"; + style += lmp->suffix; + } + } + + if (!info->has_style(prerequisite.first, style)) ++nfail; + } + delete info; + // abort if prerequisites are not met + if (nfail > 0) { + cleanup_lammps(lmp, cfg); + return nullptr; + } + + // utility lambdas to improve readability + // execute a single-line command + auto command = [&](const std::string &line) { + lmp->input->one(line.c_str()); + }; + // parse and execute all commands in a file + auto parse_input_script = [&](const std::string &filename) { + lmp->input->file(filename.c_str()); + }; + + if (newton) { + command("variable newton_bond index on"); + } else { + command("variable newton_bond index off"); + } + + command("variable input_dir index " + INPUT_FOLDER); + + for (auto &pre_command : cfg.pre_commands) { + command(pre_command); + } + + std::string input_file = INPUT_FOLDER + PATH_SEP + cfg.input_file; + parse_input_script(input_file); + + command("improper_style " + cfg.improper_style); + + for (auto &improper_coeff : cfg.improper_coeff) { + command("improper_coeff " + improper_coeff); + } + + for (auto &post_command : cfg.post_commands) { + command(post_command); + } + + command("run 0 post no"); + // auxilliary files for running and debugging tests + command("write_restart " + cfg.basename + ".restart"); + command("write_data " + cfg.basename + ".data"); + command("write_coeff " + cfg.basename + "-coeffs.in"); + + return lmp; +} + +// Run a very short NVE simulation void run_lammps(LAMMPS *lmp) { // utility lambda to improve readability @@ -88,6 +166,7 @@ void run_lammps(LAMMPS *lmp) }; command("fix 1 all nve"); + // just measure the relevant part of potential energy command("compute pe all pe/atom improper"); command("compute sum all reduce sum c_pe"); command("thermo_style custom step temp pe press c_sum"); @@ -95,14 +174,748 @@ void run_lammps(LAMMPS *lmp) command("run 4 post no"); } -LAMMPS *init_lammps(int argc, char **argv, const TestConfig &cfg, const bool newton = true){} +// Restart LAMMPS simulation +// to test "write_restart" and "read_restart" functions of improper styles +void restart_lammps(LAMMPS *lmp, const TestConfig &cfg) +{ + // utility lambda to improve readability + auto command = [&](const std::string &line) { + lmp->input->one(line.c_str()); + }; -void restart_lammps(LAMMPS *lmp, const TestConfig &cfg){} + command("clear"); + command("read_restart " + cfg.basename + ".restart"); -void data_lammps(LAMMPS *lmp, const TestConfig &cfg){} + // add the improper style if it's not defined already in the restart file + if (!lmp->force->improper) { + command("improper_style " + cfg.improper_style); + } -void generate_yaml_file(const char *outfile, const TestConfig &config){} + // add the improper coefficients if hybrid style is used + // or somehow they aren't defined already in the restart file + if ((cfg.improper_style.substr(0, 6) == "hybrid") || !lmp->force->improper->writedata) { + for (auto &improper_coeff : cfg.improper_coeff) { + command("improper_coeff " + improper_coeff); + } + } -TEST(ImproperStyle, plain){} -TEST(ImproperStyle, omp){} -TEST(ImproperStyle, single){} + for (auto &post_command : cfg.post_commands) { + command(post_command); + } + + command("run 0 post no"); +} + +// What's the purpose? +// Reads the input structure of atoms +// sets some essential variables +void data_lammps(LAMMPS *lmp, const TestConfig &cfg) +{ + // utility lambdas to improve readability + auto command = [&](const std::string &line) { + lmp->input->one(line.c_str()); + }; + auto parse_input_script = [&](const std::string &filename) { + lmp->input->file(filename.c_str()); + }; + + command("clear"); // clears everything except variables, log, echo + command("variable improper_style delete"); + command("variable data_file delete"); + command("variable newton_bond delete"); + command("variable newton_bond index on"); + + for (auto &pre_command : cfg.pre_commands) { + command(pre_command); + } + + command("variable improper_style index '" + cfg.improper_style + "'"); + command("variable data_file index " + cfg.basename + ".data"); + + std::string input_file = INPUT_FOLDER + PATH_SEP + cfg.input_file; + parse_input_script(input_file); + + for (auto &improper_coeff : cfg.improper_coeff) { + command("improper_coeff " + improper_coeff); + } + for (auto &post_command : cfg.post_commands) { + command(post_command); + } + command("run 0 post no"); +} + +void generate_yaml_file(const char *outfile, const TestConfig &config) +{ + // initialize system geometry + const char *args[] = {"ImproperStyle", "-log", "none", "-echo", "screen", "-nocite"}; + + char **argv = (char **)args; + int argc = sizeof(args) / sizeof(char *); + LAMMPS *lmp = init_lammps(argc, argv, config); + if (!lmp) { + std::cerr << "One or more prerequisite styles are not available " + "in this LAMMPS configuration:\n"; + for (auto &prerequisite : config.prerequisites) { + std::cerr << prerequisite.first << "_style " << prerequisite.second << "\n"; + } + return; + } + + const int natoms = lmp->atom->natoms; + std::string block(""); + + YamlWriter writer(outfile); + + // lammps_version + writer.emit("lammps_version", lmp->universe->version); + + // date_generated + std::time_t now = time(NULL); + block = ctime(&now); + block = block.substr(0, block.find("\n") - 1); + writer.emit("date_generated", block); + + // epsilon + writer.emit("epsilon", config.epsilon); + + // prerequisites + block.clear(); + for (auto &prerequisite : config.prerequisites) { + block += prerequisite.first + " " + prerequisite.second + "\n"; + } + writer.emit_block("prerequisites", block); + + // pre_commands + block.clear(); + for (auto &command : config.pre_commands) { + block += command + "\n"; + } + writer.emit_block("pre_commands", block); + + // post_commands + block.clear(); + for (auto &command : config.post_commands) { + block += command + "\n"; + } + writer.emit_block("post_commands", block); + + // input_file + writer.emit("input_file", config.input_file); + + // improper_style + writer.emit("improper_style", config.improper_style); + + // improper_coeff + block.clear(); + for (auto &improper_coeff : config.improper_coeff) { + block += improper_coeff + "\n"; + } + writer.emit_block("improper_coeff", block); + + // equilibrium improper + // block = fmt::format("{}", lmp->atom->nimpropertypes); + // for (int i = 0; i < lmp->atom->nimpropertypes; ++i) + // block += fmt::format(" {}", lmp->force->improper->equilibrium_improper(i + 1)); + // writer.emit("equilibrium", block); + + // extract + block.clear(); + for (auto data : config.extract) + block += fmt::format("{} {}\n", data.first, data.second); + writer.emit_block("extract", block); + + // natoms + writer.emit("natoms", natoms); + + // init_energy + writer.emit("init_energy", lmp->force->improper->energy); + + // init_stress + auto stress = lmp->force->improper->virial; + block = fmt::format("{:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e}", stress[0], + stress[1], stress[2], stress[3], stress[4], stress[5]); + writer.emit_block("init_stress", block); + + // init_forces + block.clear(); + auto f = lmp->atom->f; + auto tag = lmp->atom->tag; + for (int i = 1; i <= natoms; ++i) { + const int j = lmp->atom->map(i); + block += fmt::format("{:3} {:23.16e} {:23.16e} {:23.16e}\n", i, f[j][0], f[j][1], f[j][2]); + } + writer.emit_block("init_forces", block); + + // do a few steps of MD + run_lammps(lmp); + + // run_energy + writer.emit("run_energy", lmp->force->improper->energy); + + // run_stress + stress = lmp->force->improper->virial; + block = fmt::format("{:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e}", stress[0], + stress[1], stress[2], stress[3], stress[4], stress[5]); + writer.emit_block("run_stress", block); + + block.clear(); + f = lmp->atom->f; + tag = lmp->atom->tag; + for (int i = 1; i <= natoms; ++i) { + const int j = lmp->atom->map(i); + block += fmt::format("{:3} {:23.16e} {:23.16e} {:23.16e}\n", i, f[j][0], f[j][1], f[j][2]); + } + writer.emit_block("run_forces", block); + + cleanup_lammps(lmp, config); + return; +} + +TEST(ImproperStyle, plain) +{ + const char *args[] = {"ImproperStyle", "-log", "none", "-echo", "screen", "-nocite"}; + + char **argv = (char **)args; + int argc = sizeof(args) / sizeof(char *); + + ::testing::internal::CaptureStdout(); + LAMMPS *lmp = init_lammps(argc, argv, test_config, true); + + std::string output = ::testing::internal::GetCapturedStdout(); + if (verbose) std::cout << output; + + if (!lmp) { + std::cerr << "One or more prerequisite styles are not available " + "in this LAMMPS configuration:\n"; + for (auto &prerequisite : test_config.prerequisites) { + std::cerr << prerequisite.first << "_style " << prerequisite.second << "\n"; + } + GTEST_SKIP(); + } + + EXPECT_THAT(output, StartsWith("LAMMPS (")); + EXPECT_THAT(output, HasSubstr("Loop time")); + + // abort if running in parallel and not all atoms are local + const int nlocal = lmp->atom->nlocal; + ASSERT_EQ(lmp->atom->natoms, nlocal); + + double epsilon = test_config.epsilon; + + auto f = lmp->atom->f; + auto tag = lmp->atom->tag; + ErrorStats stats; + stats.reset(); + const std::vector &f_ref = test_config.init_forces; + ASSERT_EQ(nlocal + 1, f_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "init_forces stats, newton on: " << stats << std::endl; + + auto improper = lmp->force->improper; + auto stress = improper->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.init_stress.xx, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.init_stress.yy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.init_stress.zz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.init_stress.xy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.init_stress.xz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.init_stress.yz, epsilon); + if (print_stats) std::cerr << "init_stress stats, newton on: " << stats << std::endl; + + stats.reset(); + EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.init_energy, epsilon); + if (print_stats) std::cerr << "init_energy stats, newton on: " << stats << std::endl; + + if (!verbose) ::testing::internal::CaptureStdout(); + run_lammps(lmp); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + f = lmp->atom->f; + tag = lmp->atom->tag; + stress = improper->virial; + + const std::vector &f_run = test_config.run_forces; + ASSERT_EQ(nlocal + 1, f_run.size()); + stats.reset(); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_run[tag[i]].x, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_run[tag[i]].y, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_run[tag[i]].z, 10 * epsilon); + } + if (print_stats) std::cerr << "run_forces stats, newton on: " << stats << std::endl; + + stress = improper->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, epsilon); + if (print_stats) std::cerr << "run_stress stats, newton on: " << stats << std::endl; + + stats.reset(); + int id = lmp->modify->find_compute("sum"); + double energy = lmp->modify->compute[id]->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.run_energy, epsilon); + EXPECT_FP_LE_WITH_EPS(improper->energy, energy, epsilon); + if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl; + + if (!verbose) ::testing::internal::CaptureStdout(); + cleanup_lammps(lmp, test_config); + lmp = init_lammps(argc, argv, test_config, false); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + // skip over these tests if newton bond is forced to be on + if (lmp->force->newton_bond == 0) { + + f = lmp->atom->f; + tag = lmp->atom->tag; + stats.reset(); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "init_forces stats, newton off:" << stats << std::endl; + + improper = lmp->force->improper; + stress = improper->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.init_stress.xx, 2 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.init_stress.yy, 2 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.init_stress.zz, 2 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.init_stress.xy, 2 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.init_stress.xz, 2 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.init_stress.yz, 2 * epsilon); + if (print_stats) std::cerr << "init_stress stats, newton off:" << stats << std::endl; + + stats.reset(); + EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.init_energy, epsilon); + if (print_stats) std::cerr << "init_energy stats, newton off:" << stats << std::endl; + + if (!verbose) ::testing::internal::CaptureStdout(); + run_lammps(lmp); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + f = lmp->atom->f; + tag = lmp->atom->tag; + stress = improper->virial; + stats.reset(); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_run[tag[i]].x, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_run[tag[i]].y, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_run[tag[i]].z, 10 * epsilon); + } + if (print_stats) std::cerr << "run_forces stats, newton off:" << stats << std::endl; + + stress = improper->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, epsilon); + if (print_stats) std::cerr << "run_stress stats, newton off:" << stats << std::endl; + + stats.reset(); + id = lmp->modify->find_compute("sum"); + energy = lmp->modify->compute[id]->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.run_energy, epsilon); + EXPECT_FP_LE_WITH_EPS(improper->energy, energy, epsilon); + if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl; + } + + if (!verbose) ::testing::internal::CaptureStdout(); + restart_lammps(lmp, test_config); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + f = lmp->atom->f; + tag = lmp->atom->tag; + stats.reset(); + ASSERT_EQ(nlocal + 1, f_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "restart_forces stats:" << stats << std::endl; + + improper = lmp->force->improper; + stress = improper->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.init_stress.xx, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.init_stress.yy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.init_stress.zz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.init_stress.xy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.init_stress.xz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.init_stress.yz, epsilon); + if (print_stats) std::cerr << "restart_stress stats:" << stats << std::endl; + + stats.reset(); + EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.init_energy, epsilon); + if (print_stats) std::cerr << "restart_energy stats:" << stats << std::endl; + + if (!verbose) ::testing::internal::CaptureStdout(); + data_lammps(lmp, test_config); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + f = lmp->atom->f; + tag = lmp->atom->tag; + stats.reset(); + ASSERT_EQ(nlocal + 1, f_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "data_forces stats:" << stats << std::endl; + + improper = lmp->force->improper; + stress = improper->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.init_stress.xx, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.init_stress.yy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.init_stress.zz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.init_stress.xy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.init_stress.xz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.init_stress.yz, epsilon); + if (print_stats) std::cerr << "data_stress stats:" << stats << std::endl; + + stats.reset(); + EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.init_energy, epsilon); + if (print_stats) std::cerr << "data_energy stats:" << stats << std::endl; + + if (!verbose) ::testing::internal::CaptureStdout(); + cleanup_lammps(lmp, test_config); + if (!verbose) ::testing::internal::GetCapturedStdout(); +}; + +TEST(ImproperStyle, omp) +{ + if (!LAMMPS::is_installed_pkg("USER-OMP")) GTEST_SKIP(); + const char *args[] = {"ImproperStyle", "-log", "none", "-echo", "screen", "-nocite", + "-pk", "omp", "4", "-sf", "omp"}; + + char **argv = (char **)args; + int argc = sizeof(args) / sizeof(char *); + + ::testing::internal::CaptureStdout(); + LAMMPS *lmp = init_lammps(argc, argv, test_config, true); + + std::string output = ::testing::internal::GetCapturedStdout(); + if (verbose) std::cout << output; + + if (!lmp) { + std::cerr << "One or more prerequisite styles with /omp suffix\n" + "are not available in this LAMMPS configuration:\n"; + for (auto &prerequisite : test_config.prerequisites) { + std::cerr << prerequisite.first << "_style " << prerequisite.second << "\n"; + } + GTEST_SKIP(); + } + + EXPECT_THAT(output, StartsWith("LAMMPS (")); + EXPECT_THAT(output, HasSubstr("Loop time")); + + // abort if running in parallel and not all atoms are local + const int nlocal = lmp->atom->nlocal; + ASSERT_EQ(lmp->atom->natoms, nlocal); + + // relax error a bit for USER-OMP package + double epsilon = 5.0 * test_config.epsilon; + + auto f = lmp->atom->f; + auto tag = lmp->atom->tag; + + const std::vector &f_ref = test_config.init_forces; + ErrorStats stats; + stats.reset(); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "init_forces stats, newton on: " << stats << std::endl; + + auto improper = lmp->force->improper; + auto stress = improper->virial; + + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.init_stress.xx, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.init_stress.yy, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.init_stress.zz, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.init_stress.xy, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.init_stress.xz, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.init_stress.yz, 10 * epsilon); + if (print_stats) std::cerr << "init_stress stats, newton on: " << stats << std::endl; + + stats.reset(); + EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.init_energy, epsilon); + if (print_stats) std::cerr << "init_energy stats, newton on: " << stats << std::endl; + + if (!verbose) ::testing::internal::CaptureStdout(); + run_lammps(lmp); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + f = lmp->atom->f; + tag = lmp->atom->tag; + stress = improper->virial; + + const std::vector &f_run = test_config.run_forces; + ASSERT_EQ(nlocal + 1, f_run.size()); + stats.reset(); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_run[tag[i]].x, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_run[tag[i]].y, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_run[tag[i]].z, 10 * epsilon); + } + if (print_stats) std::cerr << "run_forces stats, newton on: " << stats << std::endl; + + stress = improper->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, 10 * epsilon); + if (print_stats) std::cerr << "run_stress stats, newton on: " << stats << std::endl; + + stats.reset(); + int id = lmp->modify->find_compute("sum"); + double energy = lmp->modify->compute[id]->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.run_energy, epsilon); + // TODO: this is currently broken for USER-OMP with improper style hybrid + // needs to be fixed in the main code somewhere. Not sure where, though. + if (test_config.improper_style.substr(0, 6) != "hybrid") + EXPECT_FP_LE_WITH_EPS(improper->energy, energy, epsilon); + if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl; + + if (!verbose) ::testing::internal::CaptureStdout(); + cleanup_lammps(lmp, test_config); + lmp = init_lammps(argc, argv, test_config, false); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + // skip over these tests if newton bond is forced to be on + if (lmp->force->newton_bond == 0) { + + f = lmp->atom->f; + tag = lmp->atom->tag; + stats.reset(); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "init_forces stats, newton off:" << stats << std::endl; + + improper = lmp->force->improper; + stress = improper->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.init_stress.xx, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.init_stress.yy, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.init_stress.zz, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.init_stress.xy, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.init_stress.xz, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.init_stress.yz, 10 * epsilon); + if (print_stats) std::cerr << "init_stress stats, newton off:" << stats << std::endl; + + stats.reset(); + EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.init_energy, epsilon); + if (print_stats) std::cerr << "init_energy stats, newton off:" << stats << std::endl; + + if (!verbose) ::testing::internal::CaptureStdout(); + run_lammps(lmp); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + f = lmp->atom->f; + tag = lmp->atom->tag; + stats.reset(); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_run[tag[i]].x, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_run[tag[i]].y, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_run[tag[i]].z, 10 * epsilon); + } + if (print_stats) std::cerr << "run_forces stats, newton off:" << stats << std::endl; + + stress = improper->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, 10 * epsilon); + if (print_stats) std::cerr << "run_stress stats, newton off:" << stats << std::endl; + + stats.reset(); + id = lmp->modify->find_compute("sum"); + energy = lmp->modify->compute[id]->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.run_energy, epsilon); + // TODO: this is currently broken for USER-OMP with improper style hybrid + // needs to be fixed in the main code somewhere. Not sure where, though. + if (test_config.improper_style.substr(0, 6) != "hybrid") + EXPECT_FP_LE_WITH_EPS(improper->energy, energy, epsilon); + if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl; + } + + if (!verbose) ::testing::internal::CaptureStdout(); + cleanup_lammps(lmp, test_config); + if (!verbose) ::testing::internal::GetCapturedStdout(); +}; + +// TODO: Improper styles do not have single() routines +/* +TEST(ImproperStyle, single) +{ + const char *args[] = {"ImproperStyle", "-log", "none", "-echo", "screen", "-nocite"}; + + char **argv = (char **)args; + int argc = sizeof(args) / sizeof(char *); + + // create a LAMMPS instance with standard settings to detect the number of atom types + if (!verbose) ::testing::internal::CaptureStdout(); + LAMMPS *lmp = init_lammps(argc, argv, test_config); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + if (!lmp) { + std::cerr << "One or more prerequisite styles are not available " + "in this LAMMPS configuration:\n"; + for (auto &prerequisite : test_config.prerequisites) { + std::cerr << prerequisite.first << "_style " << prerequisite.second << "\n"; + } + GTEST_SKIP(); + } + + // gather some information and skip if unsupported + int nimpropertypes = lmp->atom->nimpropertypes; + int molecular = lmp->atom->molecular; + if (molecular != 1) { + std::cerr << "Only simple molecular atom styles are supported\n"; + if (!verbose) ::testing::internal::CaptureStdout(); + cleanup_lammps(lmp, test_config); + if (!verbose) ::testing::internal::GetCapturedStdout(); + GTEST_SKIP(); + } + + // utility lambda to improve readability + auto command = [&](const std::string &line) { + lmp->input->one(line.c_str()); + }; + + // now start over + if (!verbose) ::testing::internal::CaptureStdout(); + command("clear"); + command("variable newton_bond delete"); + command("variable newton_bond index on"); + + command("variable input_dir index " + INPUT_FOLDER); + + for (auto &pre_command : test_config.pre_commands) { + command(pre_command); + } + + command("atom_style molecular"); + command("units ${units}"); + command("boundary p p p"); + command("newton ${newton_pair} ${newton_bond}"); + command("special_bonds lj/coul " + "${bond_factor} ${angle_factor} ${dihedral_factor}"); + + command("atom_modify map array"); + command("region box block -10.0 10.0 -10.0 10.0 -10.0 10.0 units box"); + + command(fmt::format("create_box 1 box improper/types {} " + "extra/improper/per/atom 2 extra/special/per/atom 2", + nimpropertypes)); + + command("pair_style zero 8.0"); + command("pair_coeff * *"); + + command("improper_style " + test_config.improper_style); + Improper *improper = lmp->force->improper; + + for (auto &improper_coeff : test_config.improper_coeff) { + command("improper_coeff " + improper_coeff); + } + + // create (only) four atoms and one improper + command("mass * 1.0"); + command("create_atoms 1 single 5.0 -0.75 0.4 units box"); + command("create_atoms 1 single 5.5 0.25 -0.1 units box"); + command("create_atoms 1 single 5.0 0.75 0.4 units box"); + command("create_atoms 1 single 5.5 1.25 -0.1 units box"); + command("create_bonds single/improper 1 1 2 3 4"); + + for (auto &post_command : test_config.post_commands) { + command(post_command); + } + + command("run 0 post no"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + int idx1 = lmp->atom->map(1); + int idx2 = lmp->atom->map(2); + int idx3 = lmp->atom->map(3); + double epsilon = test_config.epsilon; + double eangle[4], esingle[4]; + // TODO: why are atoms displaced randomly? + + eangle[0] = angle->energy; + esingle[0] = angle->single(1, idx1, idx2, idx3); + + if (!verbose) ::testing::internal::CaptureStdout(); + command("displace_atoms all random 0.5 0.5 0.5 23456"); + command("run 0 post no"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + idx1 = lmp->atom->map(1); + idx2 = lmp->atom->map(2); + idx3 = lmp->atom->map(3); + eangle[1] = angle->energy; + esingle[1] = angle->single(1, idx1, idx2, idx3); + + if (!verbose) ::testing::internal::CaptureStdout(); + command("displace_atoms all random 0.5 0.5 0.5 456963"); + command("run 0 post no"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + idx1 = lmp->atom->map(1); + idx2 = lmp->atom->map(2); + idx3 = lmp->atom->map(3); + eangle[2] = angle->energy; + esingle[2] = angle->single(1, idx1, idx2, idx3); + + if (!verbose) ::testing::internal::CaptureStdout(); + command("displace_atoms all random 0.5 0.5 0.5 9726532"); + command("run 0 post no"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + idx1 = lmp->atom->map(1); + idx2 = lmp->atom->map(2); + idx3 = lmp->atom->map(3); + eangle[3] = angle->energy; + esingle[3] = angle->single(1, idx1, idx2, idx3); + + ErrorStats stats; + EXPECT_FP_LE_WITH_EPS(eangle[0], esingle[0], epsilon); + EXPECT_FP_LE_WITH_EPS(eangle[1], esingle[1], epsilon); + EXPECT_FP_LE_WITH_EPS(eangle[2], esingle[2], epsilon); + EXPECT_FP_LE_WITH_EPS(eangle[3], esingle[3], epsilon); + if (print_stats) std::cerr << "single_energy stats:" << stats << std::endl; + + // int i = 0; + // for (auto &dist : test_config.equilibrium) + // EXPECT_NEAR(dist, angle->equilibrium_angle(++i), 0.00001); + + if (!verbose) ::testing::internal::CaptureStdout(); + cleanup_lammps(lmp, test_config); + if (!verbose) ::testing::internal::GetCapturedStdout(); +} +*/ diff --git a/unittest/force-styles/tests/improper-harmonic.yaml b/unittest/force-styles/tests/improper-harmonic.yaml new file mode 100644 index 0000000000..001216ed17 --- /dev/null +++ b/unittest/force-styles/tests/improper-harmonic.yaml @@ -0,0 +1,83 @@ +--- +lammps_version: 30 Jun 2020 +date_generated: Sun Jul 12 19:14:28 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + improper harmonic +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +improper_style: harmonic +improper_coeff: ! | + 1 75.0 0.1 + 2 45.0 1.0 +extract: ! "" +natoms: 29 +init_energy: 41.530817896491 +init_stress: ! |2- + 8.9723357320869255e+01 -8.7188643750026529e+01 -2.5347135708427588e+00 9.2043419883119697e+01 -2.8187238090404989e+01 -1.5291148024927028e+00 +init_forces: ! |2 + 1 4.7865489310693519e+01 7.8760925902181782e+00 -3.2694525514709809e+01 + 2 -1.1124882516177386e+00 -9.0075464203887741e+00 -7.2431691227364725e+00 + 3 -5.9057050592858884e+00 5.3263619873546183e+01 5.2353380124691370e+01 + 4 -1.6032230038990651e+01 -2.4560529343731371e+01 1.2891625920422349e+01 + 5 -4.4802331573497668e+01 -4.8300919461089343e+01 -2.3310767889219321e+01 + 6 4.7083124388174838e+01 -9.5212933434476135e+00 -3.2526392870546800e+01 + 7 -1.6208182775476303e+01 1.4458587960739102e+01 -3.5314745459502710e+00 + 8 -6.5664612141880827e+00 -2.5126850154274180e+01 8.2187944731423329e+01 + 9 -1.5504395262358301e+01 1.6121044185227817e+01 -4.2007069622477866e-01 + 10 9.9863759179364777e+00 4.1873540105704535e+01 -6.6085640966037388e+01 + 11 -2.0441876158908627e+01 -6.5186824168985984e+00 9.0023620309811072e+00 + 12 -1.0772126658369636e+01 -1.0807367300158273e+01 -9.6049647456797036e+00 + 13 2.8847886813946415e+00 7.2973241014859491e+00 -1.0414233993845645e-01 + 14 1.5267407478336423e+01 -9.4754911480231527e+00 -6.6307012925544306e+00 + 15 1.2402914209534794e+01 -6.2644630791613860e+00 1.8484576795819905e+01 + 16 3.8927757686513598e-01 1.0690061587911142e+01 6.1542759189377589e+00 + 17 1.4664194297570587e+00 -1.9971277376602155e+00 1.0776844613215855e+00 + 18 1.5785371874873189e-01 1.6495665212200037e+00 -6.6944747776989910e+00 + 19 -1.9328033033421517e+00 -2.4078805870919515e+00 2.8669575541313312e+00 + 20 1.7749495845934198e+00 7.5831406587194772e-01 3.8275172235676602e+00 + 21 3.4186149299343622e+00 4.2795410364249307e+00 -1.2789555411020601e+01 + 22 -6.0875600315279446e+00 -4.1504951869796436e+00 4.5212856070195588e+00 + 23 2.6689451015935823e+00 -1.2904584944528708e-01 8.2682698040010418e+00 + 24 -1.3053945393770472e+00 5.0741459325182818e+00 -3.0209518576072751e+00 + 25 -1.0471133765834191e+00 -3.5082261409793545e+00 5.7374874908500728e-01 + 26 2.3525079159604663e+00 -1.5659197915389276e+00 2.4472031085222676e+00 + 27 -2.8720725187343144e-01 2.3577465459556626e+00 -8.0312673032167137e-01 + 28 -6.2799575211499037e-01 -1.4097313073755557e+00 3.2747938980615732e-02 + 29 9.1520300398842180e-01 -9.4801523858010661e-01 7.7037879134105569e-01 +run_energy: 29.2286477697792 +run_stress: ! |2- + 6.7161703985479804e+01 -7.4680138065367487e+01 7.5184340798876628e+00 5.7521437901240859e+01 -2.7304190748521741e+01 -1.4932945649428730e+01 +run_forces: ! |2 + 1 3.6220193547187421e+01 1.1585587142479543e+01 -1.7238241972840832e+01 + 2 -1.7637583558698005e+00 -1.3758538851839576e+01 -1.1469071109412811e+01 + 3 -7.1131175159873123e+00 3.1523130842685575e+01 3.9133327910920059e+01 + 4 -1.1598618479874565e+01 -1.4069946914275834e+01 1.1631964860700649e+01 + 5 -3.5092143924598361e+01 -3.4761325046913356e+01 -2.1062123798094685e+01 + 6 4.3880849952881221e+01 -6.1732167988806808e+00 -2.6034788339533922e+01 + 7 -1.4366916728367741e+01 1.3135040103127027e+01 -3.0387136809768127e+00 + 8 -8.5333281419768383e+00 -2.4737111100998256e+01 6.5176870591189868e+01 + 9 -1.2996571868203590e+01 1.3674206710496604e+01 -6.7871105914534047e-01 + 10 1.1736432849972278e+01 3.5147252452549246e+01 -4.9691358934493337e+01 + 11 -1.9930599656448706e+01 -3.2836744898198571e+00 7.6150969595859577e+00 + 12 -5.8293065548538978e+00 -1.3423749355667645e+01 -5.2738511429383701e+00 + 13 7.7658418286980746e-01 2.0512357329017221e+00 1.8932242747136039e+00 + 14 1.2984672111772401e+01 -7.2763363322049823e-01 -4.8588140465034959e+00 + 15 7.4743142834562555e+00 -3.4640965582760748e+00 9.4855052919847029e+00 + 16 3.6043562512330887e+00 8.0382102532623243e+00 4.0048096667552189e+00 + 17 5.4695804680833793e-01 -7.5537048761027403e-01 4.0487452808954988e-01 + 18 -1.1709942604030477e-01 -8.9468235295761567e-01 3.5008479949198765e+00 + 19 9.8256914435044085e-01 1.2515894863018922e+00 -1.5372413162209382e+00 + 20 -8.6546971831013608e-01 -3.5690713334427648e-01 -1.9636066786989381e+00 + 21 6.0524643645662579e-01 7.0314728523699110e-01 -2.2349906198624576e+00 + 22 -1.0299517357238845e+00 -6.7850914711871291e-01 8.1029011311054200e-01 + 23 4.2470529926725875e-01 -2.4638138118278141e-02 1.4247005067519156e+00 + 24 4.1516966455944304e-01 -1.5912776575035221e+00 9.3767616296745859e-01 + 25 3.0070697634261156e-01 1.0957067953103508e+00 -1.8209981159009775e-01 + 26 -7.1587664090205461e-01 4.9557086219317126e-01 -7.5557635137736079e-01 + 27 -1.4554421797154906e-02 1.1056084388051551e-01 -3.5467198058544314e-02 + 28 -2.8257906393508312e-02 -6.6089589395261994e-02 5.7412954785297787e-04 + 29 4.2812328190663218e-02 -4.4471254485253520e-02 3.4893068510691336e-02 +... From a65c672afc6b1a3360d16601912ff0f4d2ef9667 Mon Sep 17 00:00:00 2001 From: abhishandy Date: Fri, 14 Aug 2020 23:10:35 -0400 Subject: [PATCH 003/384] add tests for all improper styles except hybrid --- unittest/force-styles/test_config_reader.cpp | 18 +++ unittest/force-styles/test_config_reader.h | 2 + unittest/force-styles/test_improper_style.cpp | 150 ------------------ .../force-styles/tests/improper-class2.yaml | 84 ++++++++++ .../force-styles/tests/improper-cossq.yaml | 83 ++++++++++ .../force-styles/tests/improper-cvff.yaml | 83 ++++++++++ .../force-styles/tests/improper-distance.yaml | 83 ++++++++++ .../force-styles/tests/improper-distharm.yaml | 83 ++++++++++ .../force-styles/tests/improper-fourier.yaml | 83 ++++++++++ .../force-styles/tests/improper-harmonic.yaml | 132 +++++++-------- .../tests/improper-inversion_harmonic.yaml | 83 ++++++++++ .../force-styles/tests/improper-ring.yaml | 83 ++++++++++ .../tests/improper-sqdistharm.yaml | 83 ++++++++++ .../force-styles/tests/improper-umbrella.yaml | 83 ++++++++++ .../force-styles/tests/improper-zero.yaml | 83 ++++++++++ 15 files changed, 1000 insertions(+), 216 deletions(-) create mode 100644 unittest/force-styles/tests/improper-class2.yaml create mode 100644 unittest/force-styles/tests/improper-cossq.yaml create mode 100644 unittest/force-styles/tests/improper-cvff.yaml create mode 100644 unittest/force-styles/tests/improper-distance.yaml create mode 100644 unittest/force-styles/tests/improper-distharm.yaml create mode 100644 unittest/force-styles/tests/improper-fourier.yaml create mode 100644 unittest/force-styles/tests/improper-inversion_harmonic.yaml create mode 100644 unittest/force-styles/tests/improper-ring.yaml create mode 100644 unittest/force-styles/tests/improper-sqdistharm.yaml create mode 100644 unittest/force-styles/tests/improper-umbrella.yaml create mode 100644 unittest/force-styles/tests/improper-zero.yaml diff --git a/unittest/force-styles/test_config_reader.cpp b/unittest/force-styles/test_config_reader.cpp index d885102f3e..e4d5386b7e 100644 --- a/unittest/force-styles/test_config_reader.cpp +++ b/unittest/force-styles/test_config_reader.cpp @@ -57,6 +57,8 @@ TestConfigReader::TestConfigReader(TestConfig &config) : YamlReader(), config(co consumers["bond_coeff"] = &TestConfigReader::bond_coeff; consumers["angle_style"] = &TestConfigReader::angle_style; consumers["angle_coeff"] = &TestConfigReader::angle_coeff; + consumers["improper_style"] = &TestConfigReader::improper_style; + consumers["improper_coeff"] = &TestConfigReader::improper_coeff; consumers["init_energy"] = &TestConfigReader::init_energy; consumers["run_energy"] = &TestConfigReader::run_energy; consumers["equilibrium"] = &TestConfigReader::equilibrium; @@ -259,6 +261,22 @@ void TestConfigReader::angle_coeff(const yaml_event_t &event) } } +void TestConfigReader::improper_style(const yaml_event_t &event) +{ + config.improper_style = (char *)event.data.scalar.value; +} + +void TestConfigReader::improper_coeff(const yaml_event_t &event) +{ + config.improper_coeff.clear(); + std::stringstream data((char *)event.data.scalar.value); + std::string line; + + while (std::getline(data, line, '\n')) { + config.improper_coeff.push_back(line); + } +} + void TestConfigReader::equilibrium(const yaml_event_t &event) { std::stringstream data((char *)event.data.scalar.value); diff --git a/unittest/force-styles/test_config_reader.h b/unittest/force-styles/test_config_reader.h index 46cf6ec87f..55cafbcc63 100644 --- a/unittest/force-styles/test_config_reader.h +++ b/unittest/force-styles/test_config_reader.h @@ -44,6 +44,8 @@ public: void bond_coeff(const yaml_event_t &event); void angle_style(const yaml_event_t &event); void angle_coeff(const yaml_event_t &event); + void improper_style(const yaml_event_t &event); + void improper_coeff(const yaml_event_t &event); void equilibrium(const yaml_event_t &event); void init_vdwl(const yaml_event_t &event); void init_coul(const yaml_event_t &event); diff --git a/unittest/force-styles/test_improper_style.cpp b/unittest/force-styles/test_improper_style.cpp index a82fe5305e..9fc5412546 100644 --- a/unittest/force-styles/test_improper_style.cpp +++ b/unittest/force-styles/test_improper_style.cpp @@ -769,153 +769,3 @@ TEST(ImproperStyle, omp) cleanup_lammps(lmp, test_config); if (!verbose) ::testing::internal::GetCapturedStdout(); }; - -// TODO: Improper styles do not have single() routines -/* -TEST(ImproperStyle, single) -{ - const char *args[] = {"ImproperStyle", "-log", "none", "-echo", "screen", "-nocite"}; - - char **argv = (char **)args; - int argc = sizeof(args) / sizeof(char *); - - // create a LAMMPS instance with standard settings to detect the number of atom types - if (!verbose) ::testing::internal::CaptureStdout(); - LAMMPS *lmp = init_lammps(argc, argv, test_config); - if (!verbose) ::testing::internal::GetCapturedStdout(); - - if (!lmp) { - std::cerr << "One or more prerequisite styles are not available " - "in this LAMMPS configuration:\n"; - for (auto &prerequisite : test_config.prerequisites) { - std::cerr << prerequisite.first << "_style " << prerequisite.second << "\n"; - } - GTEST_SKIP(); - } - - // gather some information and skip if unsupported - int nimpropertypes = lmp->atom->nimpropertypes; - int molecular = lmp->atom->molecular; - if (molecular != 1) { - std::cerr << "Only simple molecular atom styles are supported\n"; - if (!verbose) ::testing::internal::CaptureStdout(); - cleanup_lammps(lmp, test_config); - if (!verbose) ::testing::internal::GetCapturedStdout(); - GTEST_SKIP(); - } - - // utility lambda to improve readability - auto command = [&](const std::string &line) { - lmp->input->one(line.c_str()); - }; - - // now start over - if (!verbose) ::testing::internal::CaptureStdout(); - command("clear"); - command("variable newton_bond delete"); - command("variable newton_bond index on"); - - command("variable input_dir index " + INPUT_FOLDER); - - for (auto &pre_command : test_config.pre_commands) { - command(pre_command); - } - - command("atom_style molecular"); - command("units ${units}"); - command("boundary p p p"); - command("newton ${newton_pair} ${newton_bond}"); - command("special_bonds lj/coul " - "${bond_factor} ${angle_factor} ${dihedral_factor}"); - - command("atom_modify map array"); - command("region box block -10.0 10.0 -10.0 10.0 -10.0 10.0 units box"); - - command(fmt::format("create_box 1 box improper/types {} " - "extra/improper/per/atom 2 extra/special/per/atom 2", - nimpropertypes)); - - command("pair_style zero 8.0"); - command("pair_coeff * *"); - - command("improper_style " + test_config.improper_style); - Improper *improper = lmp->force->improper; - - for (auto &improper_coeff : test_config.improper_coeff) { - command("improper_coeff " + improper_coeff); - } - - // create (only) four atoms and one improper - command("mass * 1.0"); - command("create_atoms 1 single 5.0 -0.75 0.4 units box"); - command("create_atoms 1 single 5.5 0.25 -0.1 units box"); - command("create_atoms 1 single 5.0 0.75 0.4 units box"); - command("create_atoms 1 single 5.5 1.25 -0.1 units box"); - command("create_bonds single/improper 1 1 2 3 4"); - - for (auto &post_command : test_config.post_commands) { - command(post_command); - } - - command("run 0 post no"); - if (!verbose) ::testing::internal::GetCapturedStdout(); - - int idx1 = lmp->atom->map(1); - int idx2 = lmp->atom->map(2); - int idx3 = lmp->atom->map(3); - double epsilon = test_config.epsilon; - double eangle[4], esingle[4]; - // TODO: why are atoms displaced randomly? - - eangle[0] = angle->energy; - esingle[0] = angle->single(1, idx1, idx2, idx3); - - if (!verbose) ::testing::internal::CaptureStdout(); - command("displace_atoms all random 0.5 0.5 0.5 23456"); - command("run 0 post no"); - if (!verbose) ::testing::internal::GetCapturedStdout(); - - idx1 = lmp->atom->map(1); - idx2 = lmp->atom->map(2); - idx3 = lmp->atom->map(3); - eangle[1] = angle->energy; - esingle[1] = angle->single(1, idx1, idx2, idx3); - - if (!verbose) ::testing::internal::CaptureStdout(); - command("displace_atoms all random 0.5 0.5 0.5 456963"); - command("run 0 post no"); - if (!verbose) ::testing::internal::GetCapturedStdout(); - - idx1 = lmp->atom->map(1); - idx2 = lmp->atom->map(2); - idx3 = lmp->atom->map(3); - eangle[2] = angle->energy; - esingle[2] = angle->single(1, idx1, idx2, idx3); - - if (!verbose) ::testing::internal::CaptureStdout(); - command("displace_atoms all random 0.5 0.5 0.5 9726532"); - command("run 0 post no"); - if (!verbose) ::testing::internal::GetCapturedStdout(); - - idx1 = lmp->atom->map(1); - idx2 = lmp->atom->map(2); - idx3 = lmp->atom->map(3); - eangle[3] = angle->energy; - esingle[3] = angle->single(1, idx1, idx2, idx3); - - ErrorStats stats; - EXPECT_FP_LE_WITH_EPS(eangle[0], esingle[0], epsilon); - EXPECT_FP_LE_WITH_EPS(eangle[1], esingle[1], epsilon); - EXPECT_FP_LE_WITH_EPS(eangle[2], esingle[2], epsilon); - EXPECT_FP_LE_WITH_EPS(eangle[3], esingle[3], epsilon); - if (print_stats) std::cerr << "single_energy stats:" << stats << std::endl; - - // int i = 0; - // for (auto &dist : test_config.equilibrium) - // EXPECT_NEAR(dist, angle->equilibrium_angle(++i), 0.00001); - - if (!verbose) ::testing::internal::CaptureStdout(); - cleanup_lammps(lmp, test_config); - if (!verbose) ::testing::internal::GetCapturedStdout(); -} -*/ diff --git a/unittest/force-styles/tests/improper-class2.yaml b/unittest/force-styles/tests/improper-class2.yaml new file mode 100644 index 0000000000..8cc9f4ea95 --- /dev/null +++ b/unittest/force-styles/tests/improper-class2.yaml @@ -0,0 +1,84 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Fri Aug 14 22:49:18 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + improper class2 +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +improper_style: class2 +improper_coeff: ! | + 1 75.0 169 + 2 45.0 10 + * aa 75 42 31 125.4 130.01 115.06 +extract: ! "" +natoms: 29 +init_energy: 1375.73723669752 +init_stress: ! |- + -1.7468868485439822e+02 -9.2086842555214787e+01 2.6677552740961301e+02 1.4938930562506283e+02 2.2947660920769948e+01 5.9390297771307900e+01 +init_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 -1.8105909268304131e+01 -1.7448027996896207e+02 -1.1942909039947361e+01 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 3.8384848080007407e+02 2.4743113398704139e+02 -6.2651869231333542e+01 + 7 -1.7774406979068704e+02 -5.5990310445575943e+01 -6.1771623434942981e+01 + 8 -1.1390550618440670e+02 -9.6594897230345566e+01 1.9743164026142125e+02 + 9 -6.6272434058996311e+01 1.1515005775861550e+02 8.1891641120509050e+01 + 10 -7.8205614976798818e+00 -3.5515704100773377e+01 -1.4295687967570640e+02 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 1260.20246782419 +run_stress: ! |- + -1.6075019789192234e+02 -8.3932550084644959e+01 2.4468274797656733e+02 2.1067399876161073e+02 1.9063090606550190e+01 4.6877937655141324e+01 +run_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 1.6506307145923934e+01 -1.9396980909403743e+02 -3.3357653318921400e+01 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 3.5413718447518772e+02 2.6136647700247329e+02 -2.5630720524404296e+01 + 7 -1.7176999248133816e+02 -5.3729736422180750e+01 -5.7786782640885505e+01 + 8 -1.3465454292726128e+02 -1.0752712766594587e+02 1.8614330902776322e+02 + 9 -6.4163809246837019e+01 1.1709739244061362e+02 7.0027907451577988e+01 + 10 -5.5146965675230086e-02 -2.3237196260922854e+01 -1.3939605999513000e+02 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/improper-cossq.yaml b/unittest/force-styles/tests/improper-cossq.yaml new file mode 100644 index 0000000000..7f2fbcdee7 --- /dev/null +++ b/unittest/force-styles/tests/improper-cossq.yaml @@ -0,0 +1,83 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Fri Aug 14 23:08:56 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + improper cossq +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +improper_style: cossq +improper_coeff: ! | + 1 75.0 120.2 + 2 45.0 59.5 +extract: ! "" +natoms: 29 +init_energy: 47.9012064519622 +init_stress: ! |- + -4.5136832793911459e+01 -4.0792102522859011e+01 8.5928935316770463e+01 4.5396318866546366e+01 -1.0360009267990996e+01 2.9226619105197486e+01 +init_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 1.5572001864023761e+01 -8.5523301687707303e+00 3.6389919233505481e+01 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 -9.9783749351847923e+00 -8.2089544597829125e+00 -6.4006295980405298e+01 + 7 1.9329901359391172e+01 -2.0093109058858744e+01 -1.4251303737688040e+01 + 8 -2.4923528288230141e+01 3.6854393687412383e+01 4.1867680484587865e+01 + 9 1.3969666290783055e+01 -9.0595563105928818e+00 1.5851381427541192e+01 + 10 -1.3969666290783055e+01 9.0595563105928818e+00 -1.5851381427541192e+01 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 48.2744730820787 +run_stress: ! |- + -4.5952833349540356e+01 -4.1365977230743795e+01 8.7318810580284151e+01 4.6001396615094961e+01 -1.0536002987353324e+01 2.9385950321921246e+01 +run_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 1.6114805834457947e+01 -8.9792130585865557e+00 3.6500395062236812e+01 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 -1.0060441610837170e+01 -7.8460863153218448e+00 -6.3645235188012720e+01 + 7 1.9674662945480122e+01 -2.0401402356848148e+01 -1.4125564656019799e+01 + 8 -2.5729027169100899e+01 3.7226701730756545e+01 4.1270404781795712e+01 + 9 1.4082531754930352e+01 -9.4512810457515730e+00 1.5603561036102507e+01 + 10 -1.4082531754930352e+01 9.4512810457515730e+00 -1.5603561036102507e+01 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/improper-cvff.yaml b/unittest/force-styles/tests/improper-cvff.yaml new file mode 100644 index 0000000000..dfe7c5f9ee --- /dev/null +++ b/unittest/force-styles/tests/improper-cvff.yaml @@ -0,0 +1,83 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Fri Aug 14 22:54:42 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + improper cvff +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +improper_style: cvff +improper_coeff: ! | + 1 75.0 -1 5 + 2 45.0 +1 2 +extract: ! "" +natoms: 29 +init_energy: 89.3326668855358 +init_stress: ! |2- + 6.3735186906797781e-01 5.1961496386521944e-01 -1.1569668329364793e+00 6.0239243426043387e-01 -3.1000536955332481e-01 -5.5270895482870697e-01 +init_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 2.8670207225427475e+00 3.0986561256939922e+00 -4.7143280681370925e-01 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 -6.0211065055074187e-01 -1.3523452665328648e+00 -3.9074689491948789e-01 + 7 3.1857235094213934e+00 3.4440604439155891e+00 -5.5417013356316147e-01 + 8 -2.0494336190966692e+01 -1.9987202220980407e+01 5.9716646066503358e+00 + 9 7.4704052240849492e+00 7.2103972597448092e+00 -2.9798194738552723e+00 + 10 7.5732973854683436e+00 7.5864336581588816e+00 -1.5754952974987049e+00 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 88.9347113585785 +run_stress: ! |2- + 1.0161882653382639e+00 8.3947015038438977e-01 -1.8556584157187157e+00 9.6698692013360521e-01 -4.6703661727437407e-01 -8.7277634640600077e-01 +run_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 5.9520555876821390e+00 6.3729966537297287e+00 -8.9953292167160726e-01 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 -7.7834616309166762e+00 -8.9818570258755699e+00 9.8914315321758295e-01 + 7 6.5165494478755477e+00 6.9810548069571610e+00 -1.1100674503825303e+00 + 8 -2.4115998408028560e+01 -2.3674756054775116e+01 6.3966182851737585e+00 + 9 9.6046508553558070e+00 9.3147501408193563e+00 -3.8574879453162225e+00 + 10 9.8262041480317421e+00 9.9878114791444403e+00 -1.5186731210209814e+00 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/improper-distance.yaml b/unittest/force-styles/tests/improper-distance.yaml new file mode 100644 index 0000000000..a11ef7cbf2 --- /dev/null +++ b/unittest/force-styles/tests/improper-distance.yaml @@ -0,0 +1,83 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Fri Aug 14 22:55:48 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + improper distance +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +improper_style: distance +improper_coeff: ! | + 1 75.0 120.2 + 2 45.0 59.5 +extract: ! "" +natoms: 29 +init_energy: 0.0747454910197192 +init_stress: ! |- + -7.1626258371141380e-02 -6.6864359523888722e-02 -1.1321733383756704e-02 -6.9200372914993966e-02 2.8440344655334970e-02 2.7462143864170636e-02 +init_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 9.2587063678939222e-02 1.0009514092855977e-01 -1.6105912924789512e-02 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 -1.2089773558102879e+00 -1.2010461236624599e+00 4.1596894802557804e-01 + 7 1.0296888485071545e-01 1.1131884553687889e-01 -1.7911874807036772e-02 + 8 2.6332581959317372e+00 2.5530903957220037e+00 -1.0280769141856356e+00 + 9 -8.0758330134986755e-01 -7.7947530935740217e-01 3.2213144748348443e-01 + 10 -8.1225348730123659e-01 -7.8398294916758027e-01 3.2399430640839921e-01 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 0.0751357352458739 +run_stress: ! |- + -7.1955298286366293e-02 -6.7834777970248478e-02 -1.0793408809332133e-02 -6.9852497394250576e-02 2.7754271108949832e-02 2.6897546846882142e-02 +run_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 1.7106764529766375e-01 1.8466435139582088e-01 -3.0065031718990057e-02 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 -1.4481511229371387e+00 -1.4618157668694205e+00 4.5043820633135934e-01 + 7 1.8734125671642596e-01 2.0223141319926283e-01 -3.2925108752471607e-02 + 8 2.6973597263514910e+00 2.6307003813295724e+00 -1.0169115622488030e+00 + 9 -7.9810558801295306e-01 -7.7237092159803111e-01 3.1249867099715900e-01 + 10 -8.0951191741548922e-01 -7.8340945745720447e-01 3.1696482539174603e-01 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/improper-distharm.yaml b/unittest/force-styles/tests/improper-distharm.yaml new file mode 100644 index 0000000000..93288372d8 --- /dev/null +++ b/unittest/force-styles/tests/improper-distharm.yaml @@ -0,0 +1,83 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Fri Aug 14 22:56:41 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + improper distharm +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +improper_style: distharm +improper_coeff: ! | + 1 75.0 5.5 + 2 45.0 6.2 +extract: ! "" +natoms: 29 +init_energy: 3973.60160543212 +init_stress: ! |2- + 1.1840727036793918e+01 1.1289853753674723e+01 1.7432289710119591e+00 1.1555189021102050e+01 -4.4774070829341710e+00 -4.3435896298765657e+00 +init_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 -1.7473337799460541e+02 -1.8890287044789150e+02 3.0395613158165197e+01 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 6.9437218597542744e+02 7.3464844578309237e+02 -1.5190297358296280e+02 + 7 -1.9432629530939255e+02 -2.1008461811218564e+02 3.3803884332082340e+01 + 8 -5.7037248775573312e+02 -5.7219160312749318e+02 1.8545379406266761e+02 + 9 1.2217671872491661e+02 1.1792434968032947e+02 -4.8734245972960537e+01 + 10 1.2288325635938702e+02 1.1860629622414842e+02 -4.9016071996991819e+01 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 3468.99904951019 +run_stress: ! |2- + 2.7314334231463812e+02 2.2285788373245290e+02 1.4687933699418419e+01 2.4550282331290484e+02 -5.4666411878965867e+01 -4.6264285392004695e+01 +run_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 -1.7170142729390136e+02 -1.6787021570862981e+02 1.6682129932703170e+01 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 6.8525377186224659e+02 6.4480239926345678e+02 -9.9426037245655138e+01 + 7 -1.9913515553165695e+02 -1.9469180915456604e+02 1.9347530134748922e+01 + 8 -5.7051749959942720e+02 -4.8629252566263409e+02 1.4876796860004160e+02 + 9 1.1948187559515736e+02 9.5199157308645368e+01 -3.9829541179435125e+01 + 10 1.3661843496758152e+02 1.0885299395372785e+02 -4.5542050242403420e+01 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/improper-fourier.yaml b/unittest/force-styles/tests/improper-fourier.yaml new file mode 100644 index 0000000000..db708bfd56 --- /dev/null +++ b/unittest/force-styles/tests/improper-fourier.yaml @@ -0,0 +1,83 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Fri Aug 14 22:58:01 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + improper fourier +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +improper_style: fourier +improper_coeff: ! | + 1 75.0 0.9 0.2 0.3 1 + 2 45.0 0.5 0.1 0.8 0 +extract: ! "" +natoms: 29 +init_energy: 376.79153906023 +init_stress: ! |2- + 1.0624187547924073e+00 1.0206113657070901e+00 -2.0830301204995032e+00 1.0486115899411781e+00 -8.1208166417311556e-01 -8.4664058797741759e-01 +init_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 -9.8391444288760999e-01 -1.0673132465389159e+00 1.7028327091432724e-01 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 1.7963105161091494e+01 1.8053041435172950e+01 -4.6174995421006741e+00 + 7 -1.0960561193757341e+00 -1.1844708233263612e+00 1.9458545204481797e-01 + 8 -4.1759331079525076e+01 -4.1347011251431233e+01 1.3790137646614266e+01 + 9 1.2719332702204108e+01 1.2533732960069898e+01 -5.9247184042288126e+00 + 10 1.3156863778492818e+01 1.3012020926053667e+01 -3.6127884232439245e+00 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 374.223487681165 +run_stress: ! |2- + 3.0941330059362104e+00 3.1564860417353779e+00 -6.2506190476715844e+00 3.4888204974736126e+00 -2.2530259804145052e+00 -2.3107306970803263e+00 +run_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 -7.1578665577724943e+00 -7.8169372480880472e+00 1.1399451385121764e+00 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 4.7639770870119321e+01 4.9142505947717218e+01 -8.5492832501572629e+00 + 7 -7.9581732800602376e+00 -8.4541588095994271e+00 1.5268196220624919e+00 + 8 -7.5152544404939718e+01 -7.5575573756694695e+01 2.0740916359851798e+01 + 9 2.0651977766127573e+01 2.0671440850243524e+01 -1.0667248120937227e+01 + 10 2.1976835606525569e+01 2.2032723016421418e+01 -4.1911497493319771e+00 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/improper-harmonic.yaml b/unittest/force-styles/tests/improper-harmonic.yaml index 001216ed17..e524813472 100644 --- a/unittest/force-styles/tests/improper-harmonic.yaml +++ b/unittest/force-styles/tests/improper-harmonic.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:28 202 +lammps_version: 21 Jul 2020 +date_generated: Fri Aug 14 23:09:04 202 epsilon: 2.5e-13 prerequisites: ! | atom full @@ -10,74 +10,74 @@ post_commands: ! "" input_file: in.fourmol improper_style: harmonic improper_coeff: ! | - 1 75.0 0.1 - 2 45.0 1.0 + 1 75.0 120.2 + 2 45.0 59.5 extract: ! "" natoms: 29 -init_energy: 41.530817896491 +init_energy: 369.340964796184 init_stress: ! |2- - 8.9723357320869255e+01 -8.7188643750026529e+01 -2.5347135708427588e+00 9.2043419883119697e+01 -2.8187238090404989e+01 -1.5291148024927028e+00 + 4.2200353970159981e+00 3.7101799973801128e+00 -7.9302153943075808e+00 4.0937388495186724e+00 -1.9761982391039652e+00 -3.2729597741471910e+00 init_forces: ! |2 - 1 4.7865489310693519e+01 7.8760925902181782e+00 -3.2694525514709809e+01 - 2 -1.1124882516177386e+00 -9.0075464203887741e+00 -7.2431691227364725e+00 - 3 -5.9057050592858884e+00 5.3263619873546183e+01 5.2353380124691370e+01 - 4 -1.6032230038990651e+01 -2.4560529343731371e+01 1.2891625920422349e+01 - 5 -4.4802331573497668e+01 -4.8300919461089343e+01 -2.3310767889219321e+01 - 6 4.7083124388174838e+01 -9.5212933434476135e+00 -3.2526392870546800e+01 - 7 -1.6208182775476303e+01 1.4458587960739102e+01 -3.5314745459502710e+00 - 8 -6.5664612141880827e+00 -2.5126850154274180e+01 8.2187944731423329e+01 - 9 -1.5504395262358301e+01 1.6121044185227817e+01 -4.2007069622477866e-01 - 10 9.9863759179364777e+00 4.1873540105704535e+01 -6.6085640966037388e+01 - 11 -2.0441876158908627e+01 -6.5186824168985984e+00 9.0023620309811072e+00 - 12 -1.0772126658369636e+01 -1.0807367300158273e+01 -9.6049647456797036e+00 - 13 2.8847886813946415e+00 7.2973241014859491e+00 -1.0414233993845645e-01 - 14 1.5267407478336423e+01 -9.4754911480231527e+00 -6.6307012925544306e+00 - 15 1.2402914209534794e+01 -6.2644630791613860e+00 1.8484576795819905e+01 - 16 3.8927757686513598e-01 1.0690061587911142e+01 6.1542759189377589e+00 - 17 1.4664194297570587e+00 -1.9971277376602155e+00 1.0776844613215855e+00 - 18 1.5785371874873189e-01 1.6495665212200037e+00 -6.6944747776989910e+00 - 19 -1.9328033033421517e+00 -2.4078805870919515e+00 2.8669575541313312e+00 - 20 1.7749495845934198e+00 7.5831406587194772e-01 3.8275172235676602e+00 - 21 3.4186149299343622e+00 4.2795410364249307e+00 -1.2789555411020601e+01 - 22 -6.0875600315279446e+00 -4.1504951869796436e+00 4.5212856070195588e+00 - 23 2.6689451015935823e+00 -1.2904584944528708e-01 8.2682698040010418e+00 - 24 -1.3053945393770472e+00 5.0741459325182818e+00 -3.0209518576072751e+00 - 25 -1.0471133765834191e+00 -3.5082261409793545e+00 5.7374874908500728e-01 - 26 2.3525079159604663e+00 -1.5659197915389276e+00 2.4472031085222676e+00 - 27 -2.8720725187343144e-01 2.3577465459556626e+00 -8.0312673032167137e-01 - 28 -6.2799575211499037e-01 -1.4097313073755557e+00 3.2747938980615732e-02 - 29 9.1520300398842180e-01 -9.4801523858010661e-01 7.7037879134105569e-01 -run_energy: 29.2286477697792 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 -1.0477948676235974e+02 -1.1324494306933775e+02 1.7229204920731718e+01 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 3.7989457613970035e+02 4.0678659525075454e+02 -6.6164267808209388e+01 + 7 -1.1642694859483163e+02 -1.2586825161550951e+02 2.0252962148915685e+01 + 8 -2.4087469265734444e+02 -2.4851124636626128e+02 5.3568634557991118e+01 + 9 4.0812216407774713e+01 3.9391744426659102e+01 -1.6279309297840655e+01 + 10 4.1374335467060746e+01 4.1446101373694887e+01 -8.6072245215884777e+00 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 253.014891623157 run_stress: ! |2- - 6.7161703985479804e+01 -7.4680138065367487e+01 7.5184340798876628e+00 5.7521437901240859e+01 -2.7304190748521741e+01 -1.4932945649428730e+01 + 5.2707234760159793e+01 5.3678961405229124e+01 -1.0638619616538662e+02 5.3546086552970053e+01 6.7272571765828086e+00 5.1157609147836247e+00 run_forces: ! |2 - 1 3.6220193547187421e+01 1.1585587142479543e+01 -1.7238241972840832e+01 - 2 -1.7637583558698005e+00 -1.3758538851839576e+01 -1.1469071109412811e+01 - 3 -7.1131175159873123e+00 3.1523130842685575e+01 3.9133327910920059e+01 - 4 -1.1598618479874565e+01 -1.4069946914275834e+01 1.1631964860700649e+01 - 5 -3.5092143924598361e+01 -3.4761325046913356e+01 -2.1062123798094685e+01 - 6 4.3880849952881221e+01 -6.1732167988806808e+00 -2.6034788339533922e+01 - 7 -1.4366916728367741e+01 1.3135040103127027e+01 -3.0387136809768127e+00 - 8 -8.5333281419768383e+00 -2.4737111100998256e+01 6.5176870591189868e+01 - 9 -1.2996571868203590e+01 1.3674206710496604e+01 -6.7871105914534047e-01 - 10 1.1736432849972278e+01 3.5147252452549246e+01 -4.9691358934493337e+01 - 11 -1.9930599656448706e+01 -3.2836744898198571e+00 7.6150969595859577e+00 - 12 -5.8293065548538978e+00 -1.3423749355667645e+01 -5.2738511429383701e+00 - 13 7.7658418286980746e-01 2.0512357329017221e+00 1.8932242747136039e+00 - 14 1.2984672111772401e+01 -7.2763363322049823e-01 -4.8588140465034959e+00 - 15 7.4743142834562555e+00 -3.4640965582760748e+00 9.4855052919847029e+00 - 16 3.6043562512330887e+00 8.0382102532623243e+00 4.0048096667552189e+00 - 17 5.4695804680833793e-01 -7.5537048761027403e-01 4.0487452808954988e-01 - 18 -1.1709942604030477e-01 -8.9468235295761567e-01 3.5008479949198765e+00 - 19 9.8256914435044085e-01 1.2515894863018922e+00 -1.5372413162209382e+00 - 20 -8.6546971831013608e-01 -3.5690713334427648e-01 -1.9636066786989381e+00 - 21 6.0524643645662579e-01 7.0314728523699110e-01 -2.2349906198624576e+00 - 22 -1.0299517357238845e+00 -6.7850914711871291e-01 8.1029011311054200e-01 - 23 4.2470529926725875e-01 -2.4638138118278141e-02 1.4247005067519156e+00 - 24 4.1516966455944304e-01 -1.5912776575035221e+00 9.3767616296745859e-01 - 25 3.0070697634261156e-01 1.0957067953103508e+00 -1.8209981159009775e-01 - 26 -7.1587664090205461e-01 4.9557086219317126e-01 -7.5557635137736079e-01 - 27 -1.4554421797154906e-02 1.1056084388051551e-01 -3.5467198058544314e-02 - 28 -2.8257906393508312e-02 -6.6089589395261994e-02 5.7412954785297787e-04 - 29 4.2812328190663218e-02 -4.4471254485253520e-02 3.4893068510691336e-02 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 -8.5045395768460821e+01 -8.7444689855315119e+01 -4.4309710910252420e+01 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 3.0270497994191675e+02 3.1250706159778167e+02 1.0362987073684104e+02 + 7 -1.0052793225363348e+02 -1.0516883961349617e+02 1.4830092920557945e+01 + 8 -1.7147563165545461e+02 -1.7147613984403876e+02 -7.9788246848886445e+01 + 9 2.8318289203699265e+01 2.4612136144203049e+01 -9.4649025841553254e+00 + 10 2.6025690531932895e+01 2.6970471570865328e+01 1.5102896685895203e+01 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 ... diff --git a/unittest/force-styles/tests/improper-inversion_harmonic.yaml b/unittest/force-styles/tests/improper-inversion_harmonic.yaml new file mode 100644 index 0000000000..9cb173b9a4 --- /dev/null +++ b/unittest/force-styles/tests/improper-inversion_harmonic.yaml @@ -0,0 +1,83 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Fri Aug 14 23:02:08 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + improper inversion/harmonic +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +improper_style: inversion/harmonic +improper_coeff: ! | + 1 75.0 0.1 + 2 45.0 1.0 +extract: ! "" +natoms: 29 +init_energy: 0.352301150271594 +init_stress: ! |- + -2.0258575599327061e-01 -1.7811780014253070e-01 3.8070355613579143e-01 -5.5279767824605708e-01 2.6080018124128801e-01 2.2225526588362821e-01 +init_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 3.4413547454876281e-01 3.7330079439129671e-01 -5.9551821804014762e-02 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 -6.3739983279198285e+00 -6.0934584293714114e+00 2.0039260400812213e+00 + 7 3.8333655805108796e-01 4.1429603615837074e-01 -6.8062101489123866e-02 + 8 1.4627595538566258e+01 1.4187714263990550e+01 -5.5778104590457476e+00 + 9 -4.4960658258070012e+00 -4.3225204799384791e+00 2.0680155785480876e+00 + 10 -4.4850034174392803e+00 -4.5593321852303257e+00 1.6334827637095772e+00 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 0.22311810637641 +run_stress: ! |- + -1.3500561305444739e-01 -1.2156395309699690e-01 2.5656956615145377e-01 -3.6474184861625381e-01 1.6968867585171102e-01 1.4379169439077910e-01 +run_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 1.8651900726566351e-01 2.0241845896134125e-01 -3.3092585936398113e-02 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 -4.7778136105022533e+00 -4.5753400468530030e+00 1.5390796269102023e+00 + 7 2.0424640178095663e-01 2.2113148245543598e-01 -3.6857460254088828e-02 + 8 1.1563316655095598e+01 1.1247479172668069e+01 -4.3331488633764792e+00 + 9 -3.5746768906001751e+00 -3.4547597581805300e+00 1.5715849411238993e+00 + 10 -3.6015915630397899e+00 -3.6409293090513115e+00 1.2924343415328639e+00 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/improper-ring.yaml b/unittest/force-styles/tests/improper-ring.yaml new file mode 100644 index 0000000000..c6712cab45 --- /dev/null +++ b/unittest/force-styles/tests/improper-ring.yaml @@ -0,0 +1,83 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Fri Aug 14 23:07:06 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + improper ring +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +improper_style: ring +improper_coeff: ! | + 1 75.0 120.2 + 2 45.0 59.5 +extract: ! "" +natoms: 29 +init_energy: 31535.2377170405 +init_stress: ! |- + -1.7744033713230339e+04 1.8012468654826118e+03 1.5942786847747706e+04 9.7803086281804881e+03 -2.0937834320538430e+04 2.8406351733476626e+04 +init_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 1.7217635864591177e+01 -1.7654643590530981e+01 -1.0323631100262290e+01 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 1.5514430270979008e+04 -1.1833964695203202e+04 7.5404548607963734e+03 + 7 -2.0346715672832410e+01 1.5237083750885724e+01 -2.1806116546599764e+01 + 8 -9.9214622223763376e+02 -3.0515877728365367e+03 -2.1156754748395269e+03 + 9 -1.2756197963298097e+04 2.0686953537230125e+04 1.5305219667798992e+04 + 10 -1.7629570056350353e+03 -5.7989835093507400e+03 -2.0697869306108976e+04 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 27.9016687108295 +run_stress: ! |- + -6.0364577868726883e+01 1.7219807071018927e+01 4.3144770797707920e+01 3.7072931252492118e+01 -5.1530481342131637e+01 7.1370053543533572e+01 +run_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 6.9104157542252391e+00 -6.6556770008979145e+00 -2.2400137469593675e+00 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 -7.8486052376019074e+01 8.1432361069792734e+01 -3.3400977759900456e+01 + 7 -7.1566819883488364e+00 5.7039890770987594e+00 -7.8849034070281601e+00 + 8 6.5736669392148457e+00 -5.4074076014383287e+01 6.2824001315828895e+00 + 9 1.7762055710460903e+01 -1.6384237616193933e+00 1.9386278695974166e+01 + 10 5.4396595960466911e+01 -2.4768173369990894e+01 1.7857216086330915e+01 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/improper-sqdistharm.yaml b/unittest/force-styles/tests/improper-sqdistharm.yaml new file mode 100644 index 0000000000..a0815e4569 --- /dev/null +++ b/unittest/force-styles/tests/improper-sqdistharm.yaml @@ -0,0 +1,83 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Fri Aug 14 23:07:17 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + improper sqdistharm +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +improper_style: sqdistharm +improper_coeff: ! | + 1 75.0 5.5 + 2 45.0 6.2 +extract: ! "" +natoms: 29 +init_energy: 3997.62616072489 +init_stress: ! |2- + 8.8331084794471149e-01 8.2440317190202461e-01 1.3972148029707115e-01 8.5330491729171176e-01 -3.5090607165293775e-01 -3.3882109899026652e-01 +init_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 -1.0184284349421904e+00 -1.1010149114857324e+00 1.7715995131012763e-01 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 1.4526688812516666e+01 1.4396696002909508e+01 -5.0654832290218712e+00 + 7 -1.1326251862776240e+00 -1.2244721145151010e+00 1.9702496117457491e-01 + 8 -3.2369402362851083e+01 -3.1369091715714088e+01 1.2666477036621034e+01 + 9 9.9680613577558290e+00 9.6211223009973672e+00 -3.9760926562137620e+00 + 10 1.0025705813798401e+01 9.6767604378080474e+00 -3.9990860638701031e+00 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 3996.10047397561 +run_stress: ! |2- + 2.3363134342876362e+00 2.2234371356116043e+00 3.3791690871710323e-01 2.2778957849318866e+00 -8.7266500840856764e-01 -8.4537912974174900e-01 +run_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 -6.4617211536924541e+00 -6.9062709405982856e+00 1.0875811745415971e+00 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 3.7839967647921377e+01 3.8612531795570412e+01 -1.0374001431146910e+01 + 7 -7.1049758607732336e+00 -7.5937799161869997e+00 1.1958482589942512e+00 + 8 -5.5072064943298784e+01 -5.3790069289085125e+01 2.0362726471896899e+01 + 9 1.5275150158377265e+01 1.4719070293101019e+01 -6.0865695090410377e+00 + 10 1.5523644151465831e+01 1.4958518057198976e+01 -6.1855849652448009e+00 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/improper-umbrella.yaml b/unittest/force-styles/tests/improper-umbrella.yaml new file mode 100644 index 0000000000..05accb8a39 --- /dev/null +++ b/unittest/force-styles/tests/improper-umbrella.yaml @@ -0,0 +1,83 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Fri Aug 14 23:06:55 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + improper umbrella +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +improper_style: umbrella +improper_coeff: ! | + 1 75.0 120.2 + 2 45.0 59.5 +extract: ! "" +natoms: 29 +init_energy: 120.517350302608 +init_stress: ! |2- + 2.1450057027702318e-01 2.0615370183731196e-01 -4.2065427211433376e-01 2.1056696695589971e-01 -1.6180636745642774e-01 -1.7032228908699512e-01 +init_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 -5.2700533802598692e-01 -5.6962783430288000e-01 8.8061897610235543e-02 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 4.6316011413846105e+00 4.7333019972392627e+00 -1.0973617459579503e+00 + 7 -5.8634607194216670e-01 -6.3233743629156647e-01 1.0383344595612552e-01 + 8 -8.6744372319406793e+00 -8.6216790023095449e+00 2.8059456141128507e+00 + 9 2.5345017125309544e+00 2.4975184151129270e+00 -1.1805815048127062e+00 + 10 2.6216857879932691e+00 2.5928238605518015e+00 -7.1989770690855515e-01 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 120.396043850175 +run_stress: ! |2- + 3.2066532807069725e-01 3.1757400905384592e-01 -6.3823933712454450e-01 3.2136139244685547e-01 -2.1676581509282222e-01 -2.3918993745997846e-01 +run_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 -1.7833035028835111e+00 -1.9180955181649944e+00 2.6848408481396707e-01 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 9.0625560895697035e+00 9.4502512561918941e+00 -1.7646838224899848e+00 + 7 -1.9576648167537298e+00 -2.0893598624449750e+00 3.5977162541974989e-01 + 8 -1.1282227547679481e+01 -1.1360454059332866e+01 3.2659369616274407e+00 + 9 2.9096976208341903e+00 2.8863828171665609e+00 -1.3716220203420291e+00 + 10 3.0509421569128290e+00 3.0312753665843823e+00 -7.5788682902914384e-01 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/improper-zero.yaml b/unittest/force-styles/tests/improper-zero.yaml new file mode 100644 index 0000000000..be539ed796 --- /dev/null +++ b/unittest/force-styles/tests/improper-zero.yaml @@ -0,0 +1,83 @@ +--- +lammps_version: 30 Jun 2020 +date_generated: Sun Jul 12 19:14:28 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + improper zero +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +improper_style: zero +improper_coeff: ! | + 1 * + 2 * +extract: ! "" +natoms: 29 +init_energy: 41.530817896491 +init_stress: ! |2- + 8.9723357320869255e+01 -8.7188643750026529e+01 -2.5347135708427588e+00 9.2043419883119697e+01 -2.8187238090404989e+01 -1.5291148024927028e+00 +init_forces: ! |2 + 1 4.7865489310693519e+01 7.8760925902181782e+00 -3.2694525514709809e+01 + 2 -1.1124882516177386e+00 -9.0075464203887741e+00 -7.2431691227364725e+00 + 3 -5.9057050592858884e+00 5.3263619873546183e+01 5.2353380124691370e+01 + 4 -1.6032230038990651e+01 -2.4560529343731371e+01 1.2891625920422349e+01 + 5 -4.4802331573497668e+01 -4.8300919461089343e+01 -2.3310767889219321e+01 + 6 4.7083124388174838e+01 -9.5212933434476135e+00 -3.2526392870546800e+01 + 7 -1.6208182775476303e+01 1.4458587960739102e+01 -3.5314745459502710e+00 + 8 -6.5664612141880827e+00 -2.5126850154274180e+01 8.2187944731423329e+01 + 9 -1.5504395262358301e+01 1.6121044185227817e+01 -4.2007069622477866e-01 + 10 9.9863759179364777e+00 4.1873540105704535e+01 -6.6085640966037388e+01 + 11 -2.0441876158908627e+01 -6.5186824168985984e+00 9.0023620309811072e+00 + 12 -1.0772126658369636e+01 -1.0807367300158273e+01 -9.6049647456797036e+00 + 13 2.8847886813946415e+00 7.2973241014859491e+00 -1.0414233993845645e-01 + 14 1.5267407478336423e+01 -9.4754911480231527e+00 -6.6307012925544306e+00 + 15 1.2402914209534794e+01 -6.2644630791613860e+00 1.8484576795819905e+01 + 16 3.8927757686513598e-01 1.0690061587911142e+01 6.1542759189377589e+00 + 17 1.4664194297570587e+00 -1.9971277376602155e+00 1.0776844613215855e+00 + 18 1.5785371874873189e-01 1.6495665212200037e+00 -6.6944747776989910e+00 + 19 -1.9328033033421517e+00 -2.4078805870919515e+00 2.8669575541313312e+00 + 20 1.7749495845934198e+00 7.5831406587194772e-01 3.8275172235676602e+00 + 21 3.4186149299343622e+00 4.2795410364249307e+00 -1.2789555411020601e+01 + 22 -6.0875600315279446e+00 -4.1504951869796436e+00 4.5212856070195588e+00 + 23 2.6689451015935823e+00 -1.2904584944528708e-01 8.2682698040010418e+00 + 24 -1.3053945393770472e+00 5.0741459325182818e+00 -3.0209518576072751e+00 + 25 -1.0471133765834191e+00 -3.5082261409793545e+00 5.7374874908500728e-01 + 26 2.3525079159604663e+00 -1.5659197915389276e+00 2.4472031085222676e+00 + 27 -2.8720725187343144e-01 2.3577465459556626e+00 -8.0312673032167137e-01 + 28 -6.2799575211499037e-01 -1.4097313073755557e+00 3.2747938980615732e-02 + 29 9.1520300398842180e-01 -9.4801523858010661e-01 7.7037879134105569e-01 +run_energy: 29.2286477697792 +run_stress: ! |2- + 6.7161703985479804e+01 -7.4680138065367487e+01 7.5184340798876628e+00 5.7521437901240859e+01 -2.7304190748521741e+01 -1.4932945649428730e+01 +run_forces: ! |2 + 1 3.6220193547187421e+01 1.1585587142479543e+01 -1.7238241972840832e+01 + 2 -1.7637583558698005e+00 -1.3758538851839576e+01 -1.1469071109412811e+01 + 3 -7.1131175159873123e+00 3.1523130842685575e+01 3.9133327910920059e+01 + 4 -1.1598618479874565e+01 -1.4069946914275834e+01 1.1631964860700649e+01 + 5 -3.5092143924598361e+01 -3.4761325046913356e+01 -2.1062123798094685e+01 + 6 4.3880849952881221e+01 -6.1732167988806808e+00 -2.6034788339533922e+01 + 7 -1.4366916728367741e+01 1.3135040103127027e+01 -3.0387136809768127e+00 + 8 -8.5333281419768383e+00 -2.4737111100998256e+01 6.5176870591189868e+01 + 9 -1.2996571868203590e+01 1.3674206710496604e+01 -6.7871105914534047e-01 + 10 1.1736432849972278e+01 3.5147252452549246e+01 -4.9691358934493337e+01 + 11 -1.9930599656448706e+01 -3.2836744898198571e+00 7.6150969595859577e+00 + 12 -5.8293065548538978e+00 -1.3423749355667645e+01 -5.2738511429383701e+00 + 13 7.7658418286980746e-01 2.0512357329017221e+00 1.8932242747136039e+00 + 14 1.2984672111772401e+01 -7.2763363322049823e-01 -4.8588140465034959e+00 + 15 7.4743142834562555e+00 -3.4640965582760748e+00 9.4855052919847029e+00 + 16 3.6043562512330887e+00 8.0382102532623243e+00 4.0048096667552189e+00 + 17 5.4695804680833793e-01 -7.5537048761027403e-01 4.0487452808954988e-01 + 18 -1.1709942604030477e-01 -8.9468235295761567e-01 3.5008479949198765e+00 + 19 9.8256914435044085e-01 1.2515894863018922e+00 -1.5372413162209382e+00 + 20 -8.6546971831013608e-01 -3.5690713334427648e-01 -1.9636066786989381e+00 + 21 6.0524643645662579e-01 7.0314728523699110e-01 -2.2349906198624576e+00 + 22 -1.0299517357238845e+00 -6.7850914711871291e-01 8.1029011311054200e-01 + 23 4.2470529926725875e-01 -2.4638138118278141e-02 1.4247005067519156e+00 + 24 4.1516966455944304e-01 -1.5912776575035221e+00 9.3767616296745859e-01 + 25 3.0070697634261156e-01 1.0957067953103508e+00 -1.8209981159009775e-01 + 26 -7.1587664090205461e-01 4.9557086219317126e-01 -7.5557635137736079e-01 + 27 -1.4554421797154906e-02 1.1056084388051551e-01 -3.5467198058544314e-02 + 28 -2.8257906393508312e-02 -6.6089589395261994e-02 5.7412954785297787e-04 + 29 4.2812328190663218e-02 -4.4471254485253520e-02 3.4893068510691336e-02 +... From 051ab1f5c2e8a11c3eba1f12e67cb6e743da4741 Mon Sep 17 00:00:00 2001 From: abhishandy Date: Fri, 14 Aug 2020 23:21:30 -0400 Subject: [PATCH 004/384] add test for dihedral style --- unittest/force-styles/CMakeLists.txt | 33 +- unittest/force-styles/test_config_reader.cpp | 18 + unittest/force-styles/test_config_reader.h | 2 + unittest/force-styles/test_dihedral_style.cpp | 749 ++++++++++++++++++ unittest/force-styles/test_improper_style.cpp | 22 - 5 files changed, 791 insertions(+), 33 deletions(-) create mode 100644 unittest/force-styles/test_dihedral_style.cpp diff --git a/unittest/force-styles/CMakeLists.txt b/unittest/force-styles/CMakeLists.txt index 1439b06572..cc84352cd8 100644 --- a/unittest/force-styles/CMakeLists.txt +++ b/unittest/force-styles/CMakeLists.txt @@ -115,17 +115,6 @@ foreach(TEST ${KSPACE_TESTS}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") endforeach() -# improper style tester -add_executable(test_improper_style test_improper_style.cpp) -target_link_libraries(test_improper_style PRIVATE lammps style_tests) - -file(GLOB IMPROPER_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/improper-*.yaml) -foreach(TEST ${IMPROPER_TESTS}) - string(REGEX REPLACE "^.*improper-(.*)\.yaml" "ImproperStyle:\\1" TNAME ${TEST}) - add_test(NAME ${TNAME} COMMAND test_improper_style ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") -endforeach() - # tester for timestepping fixes add_executable(test_fix_timestep test_fix_timestep.cpp) target_link_libraries(test_fix_timestep PRIVATE lammps style_tests) @@ -137,3 +126,25 @@ foreach(TEST ${FIX_TIMESTEP_TESTS}) add_test(NAME ${TNAME} COMMAND test_fix_timestep ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") endforeach() + +# dihedral style tester +add_executable(test_dihedral_style test_dihedral_style.cpp) +target_link_libraries(test_dihedral_style PRIVATE lammps style_tests) + +file(GLOB DIHEDRAL_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/dihedral-*.yaml) +foreach(TEST ${DIHEDRAL_TESTS}) + string(REGEX REPLACE "^.*dihedral-(.*)\.yaml" "DihedralStyle:\\1" TNAME ${TEST}) + add_test(NAME ${TNAME} COMMAND test_dihedral_style ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") +endforeach() + +# improper style tester +add_executable(test_improper_style test_improper_style.cpp) +target_link_libraries(test_improper_style PRIVATE lammps style_tests) + +file(GLOB IMPROPER_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/improper-*.yaml) +foreach(TEST ${IMPROPER_TESTS}) + string(REGEX REPLACE "^.*improper-(.*)\.yaml" "ImproperStyle:\\1" TNAME ${TEST}) + add_test(NAME ${TNAME} COMMAND test_improper_style ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") +endforeach() diff --git a/unittest/force-styles/test_config_reader.cpp b/unittest/force-styles/test_config_reader.cpp index e4d5386b7e..2a639784fa 100644 --- a/unittest/force-styles/test_config_reader.cpp +++ b/unittest/force-styles/test_config_reader.cpp @@ -57,6 +57,8 @@ TestConfigReader::TestConfigReader(TestConfig &config) : YamlReader(), config(co consumers["bond_coeff"] = &TestConfigReader::bond_coeff; consumers["angle_style"] = &TestConfigReader::angle_style; consumers["angle_coeff"] = &TestConfigReader::angle_coeff; + consumers["dihedral_style"] = &TestConfigReader::dihedral_style; + consumers["dihedral_coeff"] = &TestConfigReader::dihedral_coeff; consumers["improper_style"] = &TestConfigReader::improper_style; consumers["improper_coeff"] = &TestConfigReader::improper_coeff; consumers["init_energy"] = &TestConfigReader::init_energy; @@ -261,6 +263,22 @@ void TestConfigReader::angle_coeff(const yaml_event_t &event) } } +void TestConfigReader::dihedral_style(const yaml_event_t &event) +{ + config.dihedral_style = (char *)event.data.scalar.value; +} + +void TestConfigReader::dihedral_coeff(const yaml_event_t &event) +{ + config.dihedral_coeff.clear(); + std::stringstream data((char *)event.data.scalar.value); + std::string line; + + while (std::getline(data, line, '\n')) { + config.dihedral_coeff.push_back(line); + } +} + void TestConfigReader::improper_style(const yaml_event_t &event) { config.improper_style = (char *)event.data.scalar.value; diff --git a/unittest/force-styles/test_config_reader.h b/unittest/force-styles/test_config_reader.h index 55cafbcc63..840228da3a 100644 --- a/unittest/force-styles/test_config_reader.h +++ b/unittest/force-styles/test_config_reader.h @@ -44,6 +44,8 @@ public: void bond_coeff(const yaml_event_t &event); void angle_style(const yaml_event_t &event); void angle_coeff(const yaml_event_t &event); + void dihedral_style(const yaml_event_t &event); + void dihedral_coeff(const yaml_event_t &event); void improper_style(const yaml_event_t &event); void improper_coeff(const yaml_event_t &event); void equilibrium(const yaml_event_t &event); diff --git a/unittest/force-styles/test_dihedral_style.cpp b/unittest/force-styles/test_dihedral_style.cpp new file mode 100644 index 0000000000..4c6eabb0a5 --- /dev/null +++ b/unittest/force-styles/test_dihedral_style.cpp @@ -0,0 +1,749 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +// unit tests for dihedral styles intended for molecular systems + +#include "error_stats.h" +#include "test_config.h" +#include "test_config_reader.h" +#include "test_main.h" +#include "yaml_reader.h" +#include "yaml_writer.h" + +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +#include "atom.h" +#include "dihedral.h" +#include "compute.h" +#include "fmt/format.h" +#include "force.h" +#include "info.h" +#include "input.h" +#include "lammps.h" +#include "modify.h" +#include "universe.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +using ::testing::HasSubstr; +using ::testing::StartsWith; + +using namespace LAMMPS_NS; + +static void delete_file(const std::string &filename) +{ + remove(filename.c_str()); +}; + +// Clean auxilliary files generated during the test +// which are also useful for debugging failing tests +void cleanup_lammps(LAMMPS *lmp, const TestConfig &cfg) +{ + delete_file(cfg.basename + ".restart"); + delete_file(cfg.basename + ".data"); + delete_file(cfg.basename + "-coeffs.in"); + delete lmp; +} + +// Initialize LAMMPS +// with the certain arguments, test configuration and an optional flag for newton +LAMMPS *init_lammps(int argc, char **argv, const TestConfig &cfg, const bool newton = true) +{ + LAMMPS *lmp; + + lmp = new LAMMPS(argc, argv, MPI_COMM_WORLD); + + // check if prerequisite styles are available + Info *info = new Info(lmp); + int nfail = 0; + for (auto &prerequisite : cfg.prerequisites) { + std::string style = prerequisite.second; + + // if the suffixed version of dihedral style is not available, don't test it + if (prerequisite.first == "dihedral") { + if (lmp->suffix_enable) { + style += "/"; + style += lmp->suffix; + } + } + + if (!info->has_style(prerequisite.first, style)) ++nfail; + } + delete info; + // abort if prerequisites are not met + if (nfail > 0) { + cleanup_lammps(lmp, cfg); + return nullptr; + } + + // utility lambdas to improve readability + // execute a single-line command + auto command = [&](const std::string &line) { + lmp->input->one(line.c_str()); + }; + // parse and execute all commands in a file + auto parse_input_script = [&](const std::string &filename) { + lmp->input->file(filename.c_str()); + }; + + if (newton) { + command("variable newton_bond index on"); + } else { + command("variable newton_bond index off"); + } + + command("variable input_dir index " + INPUT_FOLDER); + + for (auto &pre_command : cfg.pre_commands) { + command(pre_command); + } + + std::string input_file = INPUT_FOLDER + PATH_SEP + cfg.input_file; + parse_input_script(input_file); + + command("dihedral_style " + cfg.dihedral_style); + + for (auto &dihedral_coeff : cfg.dihedral_coeff) { + command("dihedral_coeff " + dihedral_coeff); + } + + for (auto &post_command : cfg.post_commands) { + command(post_command); + } + + command("run 0 post no"); + // auxilliary files for running and debugging tests + command("write_restart " + cfg.basename + ".restart"); + command("write_data " + cfg.basename + ".data"); + command("write_coeff " + cfg.basename + "-coeffs.in"); + + return lmp; +} + +// Run a very short NVE simulation +void run_lammps(LAMMPS *lmp) +{ + // utility lambda to improve readability + auto command = [&](const std::string &line) { + lmp->input->one(line.c_str()); + }; + + command("fix 1 all nve"); + // just measure the relevant part of potential energy + command("compute pe all pe/atom dihedral"); + command("compute sum all reduce sum c_pe"); + command("thermo_style custom step temp pe press c_sum"); + command("thermo 2"); + command("run 4 post no"); +} + +// Restart LAMMPS simulation +// to test "write_restart" and "read_restart" functions of dihedral styles +void restart_lammps(LAMMPS *lmp, const TestConfig &cfg) +{ + // utility lambda to improve readability + auto command = [&](const std::string &line) { + lmp->input->one(line.c_str()); + }; + + command("clear"); + command("read_restart " + cfg.basename + ".restart"); + + // add the dihedral style if it's not defined already in the restart file + if (!lmp->force->dihedral) { + command("dihedral_style " + cfg.dihedral_style); + } + + // add the dihedral coefficients if hybrid style is used + // or somehow they aren't defined already in the restart file + if ((cfg.dihedral_style.substr(0, 6) == "hybrid") || !lmp->force->dihedral->writedata) { + for (auto &dihedral_coeff : cfg.dihedral_coeff) { + command("dihedral_coeff " + dihedral_coeff); + } + } + + for (auto &post_command : cfg.post_commands) { + command(post_command); + } + + command("run 0 post no"); +} + +// What's the purpose? +// Reads the input structure of atoms +// sets some essential variables +void data_lammps(LAMMPS *lmp, const TestConfig &cfg) +{ + // utility lambdas to improve readability + auto command = [&](const std::string &line) { + lmp->input->one(line.c_str()); + }; + auto parse_input_script = [&](const std::string &filename) { + lmp->input->file(filename.c_str()); + }; + + command("clear"); // clears everything except variables, log, echo + command("variable dihedral_style delete"); + command("variable data_file delete"); + command("variable newton_bond delete"); + command("variable newton_bond index on"); + + for (auto &pre_command : cfg.pre_commands) { + command(pre_command); + } + + command("variable dihedral_style index '" + cfg.dihedral_style + "'"); + command("variable data_file index " + cfg.basename + ".data"); + + std::string input_file = INPUT_FOLDER + PATH_SEP + cfg.input_file; + parse_input_script(input_file); + + for (auto &dihedral_coeff : cfg.dihedral_coeff) { + command("dihedral_coeff " + dihedral_coeff); + } + for (auto &post_command : cfg.post_commands) { + command(post_command); + } + command("run 0 post no"); +} + +void generate_yaml_file(const char *outfile, const TestConfig &config) +{ + // initialize system geometry + const char *args[] = {"DihedralStyle", "-log", "none", "-echo", "screen", "-nocite"}; + + char **argv = (char **)args; + int argc = sizeof(args) / sizeof(char *); + LAMMPS *lmp = init_lammps(argc, argv, config); + if (!lmp) { + std::cerr << "One or more prerequisite styles are not available " + "in this LAMMPS configuration:\n"; + for (auto &prerequisite : config.prerequisites) { + std::cerr << prerequisite.first << "_style " << prerequisite.second << "\n"; + } + return; + } + + const int natoms = lmp->atom->natoms; + std::string block(""); + + YamlWriter writer(outfile); + + // lammps_version + writer.emit("lammps_version", lmp->universe->version); + + // date_generated + std::time_t now = time(NULL); + block = ctime(&now); + block = block.substr(0, block.find("\n") - 1); + writer.emit("date_generated", block); + + // epsilon + writer.emit("epsilon", config.epsilon); + + // prerequisites + block.clear(); + for (auto &prerequisite : config.prerequisites) { + block += prerequisite.first + " " + prerequisite.second + "\n"; + } + writer.emit_block("prerequisites", block); + + // pre_commands + block.clear(); + for (auto &command : config.pre_commands) { + block += command + "\n"; + } + writer.emit_block("pre_commands", block); + + // post_commands + block.clear(); + for (auto &command : config.post_commands) { + block += command + "\n"; + } + writer.emit_block("post_commands", block); + + // input_file + writer.emit("input_file", config.input_file); + + // dihedral_style + writer.emit("dihedral_style", config.dihedral_style); + + // dihedral_coeff + block.clear(); + for (auto &dihedral_coeff : config.dihedral_coeff) { + block += dihedral_coeff + "\n"; + } + writer.emit_block("dihedral_coeff", block); + + // extract + block.clear(); + for (auto data : config.extract) + block += fmt::format("{} {}\n", data.first, data.second); + writer.emit_block("extract", block); + + // natoms + writer.emit("natoms", natoms); + + // init_energy + writer.emit("init_energy", lmp->force->dihedral->energy); + + // init_stress + auto stress = lmp->force->dihedral->virial; + block = fmt::format("{:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e}", stress[0], + stress[1], stress[2], stress[3], stress[4], stress[5]); + writer.emit_block("init_stress", block); + + // init_forces + block.clear(); + auto f = lmp->atom->f; + auto tag = lmp->atom->tag; + for (int i = 1; i <= natoms; ++i) { + const int j = lmp->atom->map(i); + block += fmt::format("{:3} {:23.16e} {:23.16e} {:23.16e}\n", i, f[j][0], f[j][1], f[j][2]); + } + writer.emit_block("init_forces", block); + + // do a few steps of MD + run_lammps(lmp); + + // run_energy + writer.emit("run_energy", lmp->force->dihedral->energy); + + // run_stress + stress = lmp->force->dihedral->virial; + block = fmt::format("{:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e}", stress[0], + stress[1], stress[2], stress[3], stress[4], stress[5]); + writer.emit_block("run_stress", block); + + block.clear(); + f = lmp->atom->f; + tag = lmp->atom->tag; + for (int i = 1; i <= natoms; ++i) { + const int j = lmp->atom->map(i); + block += fmt::format("{:3} {:23.16e} {:23.16e} {:23.16e}\n", i, f[j][0], f[j][1], f[j][2]); + } + writer.emit_block("run_forces", block); + + cleanup_lammps(lmp, config); + return; +} + +TEST(ImproperStyle, plain) +{ + const char *args[] = {"ImproperStyle", "-log", "none", "-echo", "screen", "-nocite"}; + + char **argv = (char **)args; + int argc = sizeof(args) / sizeof(char *); + + ::testing::internal::CaptureStdout(); + LAMMPS *lmp = init_lammps(argc, argv, test_config, true); + + std::string output = ::testing::internal::GetCapturedStdout(); + if (verbose) std::cout << output; + + if (!lmp) { + std::cerr << "One or more prerequisite styles are not available " + "in this LAMMPS configuration:\n"; + for (auto &prerequisite : test_config.prerequisites) { + std::cerr << prerequisite.first << "_style " << prerequisite.second << "\n"; + } + GTEST_SKIP(); + } + + EXPECT_THAT(output, StartsWith("LAMMPS (")); + EXPECT_THAT(output, HasSubstr("Loop time")); + + // abort if running in parallel and not all atoms are local + const int nlocal = lmp->atom->nlocal; + ASSERT_EQ(lmp->atom->natoms, nlocal); + + double epsilon = test_config.epsilon; + + auto f = lmp->atom->f; + auto tag = lmp->atom->tag; + ErrorStats stats; + stats.reset(); + const std::vector &f_ref = test_config.init_forces; + ASSERT_EQ(nlocal + 1, f_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "init_forces stats, newton on: " << stats << std::endl; + + auto dihedral = lmp->force->dihedral; + auto stress = dihedral->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.init_stress.xx, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.init_stress.yy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.init_stress.zz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.init_stress.xy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.init_stress.xz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.init_stress.yz, epsilon); + if (print_stats) std::cerr << "init_stress stats, newton on: " << stats << std::endl; + + stats.reset(); + EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.init_energy, epsilon); + if (print_stats) std::cerr << "init_energy stats, newton on: " << stats << std::endl; + + if (!verbose) ::testing::internal::CaptureStdout(); + run_lammps(lmp); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + f = lmp->atom->f; + tag = lmp->atom->tag; + stress = dihedral->virial; + + const std::vector &f_run = test_config.run_forces; + ASSERT_EQ(nlocal + 1, f_run.size()); + stats.reset(); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_run[tag[i]].x, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_run[tag[i]].y, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_run[tag[i]].z, 10 * epsilon); + } + if (print_stats) std::cerr << "run_forces stats, newton on: " << stats << std::endl; + + stress = dihedral->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, epsilon); + if (print_stats) std::cerr << "run_stress stats, newton on: " << stats << std::endl; + + stats.reset(); + int id = lmp->modify->find_compute("sum"); + double energy = lmp->modify->compute[id]->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.run_energy, epsilon); + EXPECT_FP_LE_WITH_EPS(dihedral->energy, energy, epsilon); + if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl; + + if (!verbose) ::testing::internal::CaptureStdout(); + cleanup_lammps(lmp, test_config); + lmp = init_lammps(argc, argv, test_config, false); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + // skip over these tests if newton bond is forced to be on + if (lmp->force->newton_bond == 0) { + + f = lmp->atom->f; + tag = lmp->atom->tag; + stats.reset(); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "init_forces stats, newton off:" << stats << std::endl; + + dihedral = lmp->force->dihedral; + stress = dihedral->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.init_stress.xx, 2 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.init_stress.yy, 2 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.init_stress.zz, 2 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.init_stress.xy, 2 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.init_stress.xz, 2 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.init_stress.yz, 2 * epsilon); + if (print_stats) std::cerr << "init_stress stats, newton off:" << stats << std::endl; + + stats.reset(); + EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.init_energy, epsilon); + if (print_stats) std::cerr << "init_energy stats, newton off:" << stats << std::endl; + + if (!verbose) ::testing::internal::CaptureStdout(); + run_lammps(lmp); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + f = lmp->atom->f; + tag = lmp->atom->tag; + stress = dihedral->virial; + stats.reset(); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_run[tag[i]].x, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_run[tag[i]].y, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_run[tag[i]].z, 10 * epsilon); + } + if (print_stats) std::cerr << "run_forces stats, newton off:" << stats << std::endl; + + stress = dihedral->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, epsilon); + if (print_stats) std::cerr << "run_stress stats, newton off:" << stats << std::endl; + + stats.reset(); + id = lmp->modify->find_compute("sum"); + energy = lmp->modify->compute[id]->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.run_energy, epsilon); + EXPECT_FP_LE_WITH_EPS(dihedral->energy, energy, epsilon); + if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl; + } + + if (!verbose) ::testing::internal::CaptureStdout(); + restart_lammps(lmp, test_config); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + f = lmp->atom->f; + tag = lmp->atom->tag; + stats.reset(); + ASSERT_EQ(nlocal + 1, f_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "restart_forces stats:" << stats << std::endl; + + dihedral = lmp->force->dihedral; + stress = dihedral->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.init_stress.xx, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.init_stress.yy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.init_stress.zz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.init_stress.xy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.init_stress.xz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.init_stress.yz, epsilon); + if (print_stats) std::cerr << "restart_stress stats:" << stats << std::endl; + + stats.reset(); + EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.init_energy, epsilon); + if (print_stats) std::cerr << "restart_energy stats:" << stats << std::endl; + + if (!verbose) ::testing::internal::CaptureStdout(); + data_lammps(lmp, test_config); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + f = lmp->atom->f; + tag = lmp->atom->tag; + stats.reset(); + ASSERT_EQ(nlocal + 1, f_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "data_forces stats:" << stats << std::endl; + + dihedral = lmp->force->dihedral; + stress = dihedral->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.init_stress.xx, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.init_stress.yy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.init_stress.zz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.init_stress.xy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.init_stress.xz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.init_stress.yz, epsilon); + if (print_stats) std::cerr << "data_stress stats:" << stats << std::endl; + + stats.reset(); + EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.init_energy, epsilon); + if (print_stats) std::cerr << "data_energy stats:" << stats << std::endl; + + if (!verbose) ::testing::internal::CaptureStdout(); + cleanup_lammps(lmp, test_config); + if (!verbose) ::testing::internal::GetCapturedStdout(); +}; + +TEST(ImproperStyle, omp) +{ + if (!LAMMPS::is_installed_pkg("USER-OMP")) GTEST_SKIP(); + const char *args[] = {"ImproperStyle", "-log", "none", "-echo", "screen", "-nocite", + "-pk", "omp", "4", "-sf", "omp"}; + + char **argv = (char **)args; + int argc = sizeof(args) / sizeof(char *); + + ::testing::internal::CaptureStdout(); + LAMMPS *lmp = init_lammps(argc, argv, test_config, true); + + std::string output = ::testing::internal::GetCapturedStdout(); + if (verbose) std::cout << output; + + if (!lmp) { + std::cerr << "One or more prerequisite styles with /omp suffix\n" + "are not available in this LAMMPS configuration:\n"; + for (auto &prerequisite : test_config.prerequisites) { + std::cerr << prerequisite.first << "_style " << prerequisite.second << "\n"; + } + GTEST_SKIP(); + } + + EXPECT_THAT(output, StartsWith("LAMMPS (")); + EXPECT_THAT(output, HasSubstr("Loop time")); + + // abort if running in parallel and not all atoms are local + const int nlocal = lmp->atom->nlocal; + ASSERT_EQ(lmp->atom->natoms, nlocal); + + // relax error a bit for USER-OMP package + double epsilon = 5.0 * test_config.epsilon; + + auto f = lmp->atom->f; + auto tag = lmp->atom->tag; + + const std::vector &f_ref = test_config.init_forces; + ErrorStats stats; + stats.reset(); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "init_forces stats, newton on: " << stats << std::endl; + + auto dihedral = lmp->force->dihedral; + auto stress = dihedral->virial; + + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.init_stress.xx, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.init_stress.yy, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.init_stress.zz, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.init_stress.xy, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.init_stress.xz, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.init_stress.yz, 10 * epsilon); + if (print_stats) std::cerr << "init_stress stats, newton on: " << stats << std::endl; + + stats.reset(); + EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.init_energy, epsilon); + if (print_stats) std::cerr << "init_energy stats, newton on: " << stats << std::endl; + + if (!verbose) ::testing::internal::CaptureStdout(); + run_lammps(lmp); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + f = lmp->atom->f; + tag = lmp->atom->tag; + stress = dihedral->virial; + + const std::vector &f_run = test_config.run_forces; + ASSERT_EQ(nlocal + 1, f_run.size()); + stats.reset(); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_run[tag[i]].x, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_run[tag[i]].y, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_run[tag[i]].z, 10 * epsilon); + } + if (print_stats) std::cerr << "run_forces stats, newton on: " << stats << std::endl; + + stress = dihedral->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, 10 * epsilon); + if (print_stats) std::cerr << "run_stress stats, newton on: " << stats << std::endl; + + stats.reset(); + int id = lmp->modify->find_compute("sum"); + double energy = lmp->modify->compute[id]->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.run_energy, epsilon); + // TODO: this is currently broken for USER-OMP with dihedral style hybrid + // needs to be fixed in the main code somewhere. Not sure where, though. + if (test_config.dihedral_style.substr(0, 6) != "hybrid") + EXPECT_FP_LE_WITH_EPS(dihedral->energy, energy, epsilon); + if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl; + + if (!verbose) ::testing::internal::CaptureStdout(); + cleanup_lammps(lmp, test_config); + lmp = init_lammps(argc, argv, test_config, false); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + // skip over these tests if newton bond is forced to be on + if (lmp->force->newton_bond == 0) { + + f = lmp->atom->f; + tag = lmp->atom->tag; + stats.reset(); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "init_forces stats, newton off:" << stats << std::endl; + + dihedral = lmp->force->dihedral; + stress = dihedral->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.init_stress.xx, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.init_stress.yy, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.init_stress.zz, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.init_stress.xy, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.init_stress.xz, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.init_stress.yz, 10 * epsilon); + if (print_stats) std::cerr << "init_stress stats, newton off:" << stats << std::endl; + + stats.reset(); + EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.init_energy, epsilon); + if (print_stats) std::cerr << "init_energy stats, newton off:" << stats << std::endl; + + if (!verbose) ::testing::internal::CaptureStdout(); + run_lammps(lmp); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + f = lmp->atom->f; + tag = lmp->atom->tag; + stats.reset(); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(f[i][0], f_run[tag[i]].x, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][1], f_run[tag[i]].y, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(f[i][2], f_run[tag[i]].z, 10 * epsilon); + } + if (print_stats) std::cerr << "run_forces stats, newton off:" << stats << std::endl; + + stress = dihedral->virial; + stats.reset(); + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, 10 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, 10 * epsilon); + if (print_stats) std::cerr << "run_stress stats, newton off:" << stats << std::endl; + + stats.reset(); + id = lmp->modify->find_compute("sum"); + energy = lmp->modify->compute[id]->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.run_energy, epsilon); + // TODO: this is currently broken for USER-OMP with dihedral style hybrid + // needs to be fixed in the main code somewhere. Not sure where, though. + if (test_config.dihedral_style.substr(0, 6) != "hybrid") + EXPECT_FP_LE_WITH_EPS(dihedral->energy, energy, epsilon); + if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl; + } + + if (!verbose) ::testing::internal::CaptureStdout(); + cleanup_lammps(lmp, test_config); + if (!verbose) ::testing::internal::GetCapturedStdout(); +}; diff --git a/unittest/force-styles/test_improper_style.cpp b/unittest/force-styles/test_improper_style.cpp index 9fc5412546..bbc69af791 100644 --- a/unittest/force-styles/test_improper_style.cpp +++ b/unittest/force-styles/test_improper_style.cpp @@ -1,19 +1,3 @@ -/* -- there are 7 basic functions - - delete_file - - cleanup_lammps - - init_lammps - - run_lammps - - restart_lammps - - data_lammps - - generate_yaml_file -- move delete_file amd cleanup_lammps to a single file -- I don't understand utility lambda, but they are being reused multiple times -- add as many comments as possible, to show my understanding and document the code -- code for matching forces, energy and stress are repeated 3 times -- run_lammps looks to be same across all tests - it isn't, there's subtle difference -*/ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories @@ -312,12 +296,6 @@ void generate_yaml_file(const char *outfile, const TestConfig &config) } writer.emit_block("improper_coeff", block); - // equilibrium improper - // block = fmt::format("{}", lmp->atom->nimpropertypes); - // for (int i = 0; i < lmp->atom->nimpropertypes; ++i) - // block += fmt::format(" {}", lmp->force->improper->equilibrium_improper(i + 1)); - // writer.emit("equilibrium", block); - // extract block.clear(); for (auto data : config.extract) From 39750c482d843a572d97d07de4cfc1b9ca990c33 Mon Sep 17 00:00:00 2001 From: abhishandy Date: Sat, 15 Aug 2020 00:19:56 -0400 Subject: [PATCH 005/384] add tester for dihedral style and few tests --- unittest/force-styles/test_dihedral_style.cpp | 8 +- .../force-styles/tests/dihedral-charmm.yaml | 87 +++++++++++++++++++ .../tests/dihedral-charmmfsw.yaml | 86 ++++++++++++++++++ .../force-styles/tests/dihedral-class2.yaml | 87 +++++++++++++++++++ .../tests/dihedral-cosine_shift_exp.yaml | 86 ++++++++++++++++++ .../force-styles/tests/dihedral-fourier.yaml | 86 ++++++++++++++++++ .../force-styles/tests/dihedral-harmonic.yaml | 86 ++++++++++++++++++ .../force-styles/tests/dihedral-helix.yaml | 86 ++++++++++++++++++ .../tests/dihedral-multi_harmonic.yaml | 86 ++++++++++++++++++ .../tests/dihedral-nharmonic.yaml | 86 ++++++++++++++++++ .../force-styles/tests/dihedral-opls.yaml | 86 ++++++++++++++++++ .../tests/dihedral-quadratic.yaml | 86 ++++++++++++++++++ .../force-styles/tests/dihedral-zero.yaml | 82 +++++++++++++++++ 13 files changed, 1034 insertions(+), 4 deletions(-) create mode 100644 unittest/force-styles/tests/dihedral-charmm.yaml create mode 100644 unittest/force-styles/tests/dihedral-charmmfsw.yaml create mode 100644 unittest/force-styles/tests/dihedral-class2.yaml create mode 100644 unittest/force-styles/tests/dihedral-cosine_shift_exp.yaml create mode 100644 unittest/force-styles/tests/dihedral-fourier.yaml create mode 100644 unittest/force-styles/tests/dihedral-harmonic.yaml create mode 100644 unittest/force-styles/tests/dihedral-helix.yaml create mode 100644 unittest/force-styles/tests/dihedral-multi_harmonic.yaml create mode 100644 unittest/force-styles/tests/dihedral-nharmonic.yaml create mode 100644 unittest/force-styles/tests/dihedral-opls.yaml create mode 100644 unittest/force-styles/tests/dihedral-quadratic.yaml create mode 100644 unittest/force-styles/tests/dihedral-zero.yaml diff --git a/unittest/force-styles/test_dihedral_style.cpp b/unittest/force-styles/test_dihedral_style.cpp index 4c6eabb0a5..f0c4a1974c 100644 --- a/unittest/force-styles/test_dihedral_style.cpp +++ b/unittest/force-styles/test_dihedral_style.cpp @@ -349,9 +349,9 @@ void generate_yaml_file(const char *outfile, const TestConfig &config) return; } -TEST(ImproperStyle, plain) +TEST(DihedralStyle, plain) { - const char *args[] = {"ImproperStyle", "-log", "none", "-echo", "screen", "-nocite"}; + const char *args[] = {"DihedralStyle", "-log", "none", "-echo", "screen", "-nocite"}; char **argv = (char **)args; int argc = sizeof(args) / sizeof(char *); @@ -574,10 +574,10 @@ TEST(ImproperStyle, plain) if (!verbose) ::testing::internal::GetCapturedStdout(); }; -TEST(ImproperStyle, omp) +TEST(DihedralStyle, omp) { if (!LAMMPS::is_installed_pkg("USER-OMP")) GTEST_SKIP(); - const char *args[] = {"ImproperStyle", "-log", "none", "-echo", "screen", "-nocite", + const char *args[] = {"DihedralStyle", "-log", "none", "-echo", "screen", "-nocite", "-pk", "omp", "4", "-sf", "omp"}; char **argv = (char **)args; diff --git a/unittest/force-styles/tests/dihedral-charmm.yaml b/unittest/force-styles/tests/dihedral-charmm.yaml new file mode 100644 index 0000000000..a3e9a3c6dc --- /dev/null +++ b/unittest/force-styles/tests/dihedral-charmm.yaml @@ -0,0 +1,87 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Fri Aug 14 23:28:04 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + dihedral charmm +pre_commands: ! "" +post_commands: ! | + special_bonds charmm +input_file: in.fourmol +dihedral_style: charmm +dihedral_coeff: ! | + 1 75.0 2 160 0.5 + 2 45.0 4 120 1.0 + 3 56.0 0 110 0.0 + 4 23.0 1 180 0.5 + 5 19.0 3 90 1.0 +extract: ! "" +natoms: 29 +init_energy: 789.17395858648 +init_stress: ! |- + -6.2042484436524219e+01 1.2714037725306221e+02 -6.5097892816538135e+01 2.6648135399224223e+01 1.3495574921305175e+02 1.6236422290928121e+02 +init_forces: ! |2 + 1 -2.1511698742845866e+01 4.0249060564855860e+01 -9.0013321196300495e+01 + 2 -8.1931697051663761e+00 4.2308632119002461e+00 -4.0030670619001576e+00 + 3 9.1213724359021342e+01 -1.3766351447039605e+02 8.1969246558440773e+01 + 4 -4.8202572898596316e+01 -8.0465316960733553e+00 6.4757081520864901e+01 + 5 -6.2252471689207432e+01 2.2804485244022331e+01 -5.3285277341381354e+00 + 6 9.1271091191895337e+01 1.3743691097166200e+02 -3.9344000137592637e+01 + 7 -4.7435622518386936e+01 -5.1206081255886986e+01 8.4101355581705430e+00 + 8 2.2568717344776448e+02 1.6221073825524249e+02 5.7667169753528370e+01 + 9 -2.0794865226210746e+00 5.0314964909952629e+00 -7.5468528100469179e-01 + 10 -4.0476567806811568e+02 -4.7270660984257171e+02 -9.9999223894595431e+01 + 11 3.9909170606249432e+01 2.0810704935563001e+02 -1.3665198019985243e+02 + 12 6.2493704719337885e+01 7.0253447917427593e+01 1.9569964347346627e+02 + 13 2.9234925409867770e+01 6.7200938735330823e+01 1.4104379799580224e+02 + 14 7.2099736490024156e+01 -1.0032854911322366e+02 -3.5674421421421059e+01 + 15 -1.0059762933494233e+02 3.4057372960589944e+01 -1.0291545492293889e+02 + 16 -9.2273705073611623e+01 -1.2566881299602966e+02 -6.3115663814665538e+01 + 17 1.7540250832933316e+02 1.4403773566652495e+02 2.8253270804136417e+01 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 559.514314402615 +run_stress: ! |- + -7.2322773064605812e+01 1.0008318054682091e+02 -2.7760407482215093e+01 8.2664096303485692e+00 7.5544828226688665e+01 4.2349931315079388e+01 +run_forces: ! |2 + 1 -7.5427026379256645e+01 6.3896565938649857e+01 -1.2972408362281925e+02 + 2 2.7848804645518747e+01 -1.3384291550167376e+01 1.5520549537371039e+01 + 3 1.4291512583129179e+02 -1.0005541838121475e+02 1.7368534876290710e+02 + 4 -2.4993112928304718e+01 -1.5718774185299033e+01 3.1537044007738828e+01 + 5 -5.4491620760121982e+01 2.1454671018185664e+01 -9.7758302505134953e+00 + 6 2.5783017937292061e+02 2.8944529364713867e+02 -1.7114092912154493e+02 + 7 -2.0392219213490730e+01 -2.0925518100765142e+01 5.2456524787664485e+00 + 8 -4.0591958020866076e+02 -3.6413946902017597e+02 2.1061195173427461e+02 + 9 4.8059404395982178e+01 3.6578486987067571e+01 -1.8191665466109903e+01 + 10 -5.3862738059223645e+01 -7.0582655352047610e+01 -9.7735616318984071e+01 + 11 1.7421180978722248e+01 1.2677031646596370e+02 -3.6028273593100664e+01 + 12 1.3410368271504629e+01 -6.6673575351920080e+00 1.3255076941331851e+01 + 13 1.4494245045917310e+01 6.6881957263407287e+01 1.4910606355545576e+02 + 14 3.7761031099166118e+01 -4.5538628614345569e+01 -1.1365873793326973e+01 + 15 -4.2205100081678445e+01 9.8022567063861477e+00 -6.2057049935635938e+01 + 16 -8.7003445287066867e+01 -1.4871541643684955e+02 -7.0399533780669756e+01 + 17 2.0455450327678008e+02 1.7089798114925810e+02 7.4571688648593746e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/dihedral-charmmfsw.yaml b/unittest/force-styles/tests/dihedral-charmmfsw.yaml new file mode 100644 index 0000000000..06ece6e45a --- /dev/null +++ b/unittest/force-styles/tests/dihedral-charmmfsw.yaml @@ -0,0 +1,86 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Fri Aug 14 23:28:04 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + dihedral charmmfsw +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +dihedral_style: charmmfsw +dihedral_coeff: ! | + 1 75.0 2 160 0.5 + 2 45.0 4 120 1.0 + 3 56.0 0 110 0.0 + 4 23.0 1 180 0.5 + 5 19.0 3 90 1.0 +extract: ! "" +natoms: 29 +init_energy: 789.17395858648 +init_stress: ! |- + -6.2042484436524219e+01 1.2714037725306221e+02 -6.5097892816538135e+01 2.6648135399224223e+01 1.3495574921305175e+02 1.6236422290928121e+02 +init_forces: ! |2 + 1 -2.1511698742845866e+01 4.0249060564855860e+01 -9.0013321196300495e+01 + 2 -8.1931697051663761e+00 4.2308632119002461e+00 -4.0030670619001576e+00 + 3 9.1213724359021342e+01 -1.3766351447039605e+02 8.1969246558440773e+01 + 4 -4.8202572898596316e+01 -8.0465316960733553e+00 6.4757081520864901e+01 + 5 -6.2252471689207432e+01 2.2804485244022331e+01 -5.3285277341381354e+00 + 6 9.1271091191895337e+01 1.3743691097166200e+02 -3.9344000137592637e+01 + 7 -4.7435622518386936e+01 -5.1206081255886986e+01 8.4101355581705430e+00 + 8 2.2568717344776448e+02 1.6221073825524249e+02 5.7667169753528370e+01 + 9 -2.0794865226210746e+00 5.0314964909952629e+00 -7.5468528100469179e-01 + 10 -4.0476567806811568e+02 -4.7270660984257171e+02 -9.9999223894595431e+01 + 11 3.9909170606249432e+01 2.0810704935563001e+02 -1.3665198019985243e+02 + 12 6.2493704719337885e+01 7.0253447917427593e+01 1.9569964347346627e+02 + 13 2.9234925409867770e+01 6.7200938735330823e+01 1.4104379799580224e+02 + 14 7.2099736490024156e+01 -1.0032854911322366e+02 -3.5674421421421059e+01 + 15 -1.0059762933494233e+02 3.4057372960589944e+01 -1.0291545492293889e+02 + 16 -9.2273705073611623e+01 -1.2566881299602966e+02 -6.3115663814665538e+01 + 17 1.7540250832933316e+02 1.4403773566652495e+02 2.8253270804136417e+01 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 559.514314402615 +run_stress: ! |- + -7.2322773064605812e+01 1.0008318054682091e+02 -2.7760407482215093e+01 8.2664096303485692e+00 7.5544828226688665e+01 4.2349931315079388e+01 +run_forces: ! |2 + 1 -7.5427026379256645e+01 6.3896565938649857e+01 -1.2972408362281925e+02 + 2 2.7848804645518747e+01 -1.3384291550167376e+01 1.5520549537371039e+01 + 3 1.4291512583129179e+02 -1.0005541838121475e+02 1.7368534876290710e+02 + 4 -2.4993112928304718e+01 -1.5718774185299033e+01 3.1537044007738828e+01 + 5 -5.4491620760121982e+01 2.1454671018185664e+01 -9.7758302505134953e+00 + 6 2.5783017937292061e+02 2.8944529364713867e+02 -1.7114092912154493e+02 + 7 -2.0392219213490730e+01 -2.0925518100765142e+01 5.2456524787664485e+00 + 8 -4.0591958020866076e+02 -3.6413946902017597e+02 2.1061195173427461e+02 + 9 4.8059404395982178e+01 3.6578486987067571e+01 -1.8191665466109903e+01 + 10 -5.3862738059223645e+01 -7.0582655352047610e+01 -9.7735616318984071e+01 + 11 1.7421180978722248e+01 1.2677031646596370e+02 -3.6028273593100664e+01 + 12 1.3410368271504629e+01 -6.6673575351920080e+00 1.3255076941331851e+01 + 13 1.4494245045917310e+01 6.6881957263407287e+01 1.4910606355545576e+02 + 14 3.7761031099166118e+01 -4.5538628614345569e+01 -1.1365873793326973e+01 + 15 -4.2205100081678445e+01 9.8022567063861477e+00 -6.2057049935635938e+01 + 16 -8.7003445287066867e+01 -1.4871541643684955e+02 -7.0399533780669756e+01 + 17 2.0455450327678008e+02 1.7089798114925810e+02 7.4571688648593746e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/dihedral-class2.yaml b/unittest/force-styles/tests/dihedral-class2.yaml new file mode 100644 index 0000000000..2d2cc3b74f --- /dev/null +++ b/unittest/force-styles/tests/dihedral-class2.yaml @@ -0,0 +1,87 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Fri Aug 14 23:42:06 202 +epsilon: 8e-13 +prerequisites: ! | + atom full + dihedral class2 +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +dihedral_style: class2 +dihedral_coeff: ! | + * 75.0 169 45.0 10 24.0 40.0 + * mbt 75 42 31 5.2 + * ebt 75 42 31 75 42 31 1.4 1.4 + * at 75 42 31 75 42 31 120 50 + * aat 75 120 160 + * bb13 75 1.4 1.4 +extract: ! "" +natoms: 29 +init_energy: 3355.00747173759 +init_stress: ! |2- + 2.1875123407705829e+01 -7.3463171958190355e+02 7.0422332087828568e+02 -2.0890942199873376e+02 -3.6451752675970374e+02 1.3400265327626116e+02 +init_forces: ! |2 + 1 -1.0952511200405197e+03 6.4823297173207948e+02 -4.4760954488358345e+02 + 2 9.0092068008499143e+02 -3.6118332267415019e+02 3.5713667026397326e+02 + 3 -7.7532838532500693e+02 -1.2468325260439515e+03 3.8359187812682268e+02 + 4 1.2904186368708326e+02 2.2136621866894410e+02 -1.4642984375119329e+02 + 5 5.9556699584425348e+02 1.5024609743159465e+02 2.2329142626092337e+02 + 6 7.3251103695180018e+02 1.1448501937143064e+03 -3.0258310893753827e+02 + 7 -5.6987565445561154e+02 -6.9068345660300270e+02 1.5974567786362655e+02 + 8 2.3172356712469095e+03 1.7621991394557467e+03 -1.0823598208966926e+02 + 9 -1.0665980086873587e+03 -9.7028318259088303e+02 4.0830286870801143e+02 + 10 -1.1831159209684263e+03 -1.2136533632807443e+03 1.0278790875590398e+03 + 11 -6.8651636455995185e+02 9.1292605610303031e+02 -5.0138124218536370e+02 + 12 9.4590221018670803e+01 -1.4167468342595620e+02 -3.9159227689650675e+02 + 13 1.7016834910937868e+02 3.5891736246788633e+02 8.2250630442549743e+02 + 14 5.6198417641541641e+02 -7.5542769524397636e+02 -2.9572420497952066e+02 + 15 -7.0833278096116078e+02 2.2547367398085967e+02 -6.9838585028829277e+02 + 16 9.0926990053407053e+02 1.5375356733249259e+02 -3.5329802202150256e+02 + 17 -3.2627065989453854e+02 -1.9822705102427648e+02 -1.3721383717472295e+02 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 2143.42148507173 +run_stress: ! |- + -1.1009319908905750e+03 -1.2893044194230149e+03 4.0644022942264792e+02 7.8888575817412885e+01 -6.1455012616426302e+01 -1.5228591473881920e+02 +run_forces: ! |2 + 1 1.7880688568836453e+02 -6.8086894534537720e+01 5.5715001510177967e+02 + 2 -1.2987483109411431e+02 6.3379419867264630e+01 -5.4509857358351042e+02 + 3 9.2338974999056654e+02 1.8030468025679893e+03 -4.4580445271904898e+02 + 4 -3.0370937597109213e+02 -6.7581595303902805e+02 -6.8165040248470596e+00 + 5 -4.7066889603019359e+02 -6.5085027760665287e+02 1.6126575424080080e+01 + 6 -1.1027711728228678e+03 -1.6665239339302309e+03 1.0652360648899707e+03 + 7 4.0789642711191095e+02 5.5227156856953388e+02 -3.8379058139109105e+02 + 8 2.2825495052663967e+01 3.5501064967650166e+01 -7.8725445421842448e+02 + 9 6.9713238731996728e+02 4.1040122696380996e+02 1.4314540425248529e+02 + 10 -2.5025140347134081e+02 3.0092586853706803e+02 2.8043262406394149e+02 + 11 6.9866184772751421e+02 -3.3005575404096862e+02 -3.1045179719549373e+02 + 12 2.0562559550697739e+02 3.2489513231153444e+02 3.5079316165801959e+02 + 13 8.0761644050014468e+01 -6.4317366704035237e+02 -4.0613479257360819e+02 + 14 -5.3129114965640838e+02 4.8468961443008004e+02 -6.4543682123369138e+01 + 15 1.3136167094369137e+02 -3.5759494444924123e+01 1.9810265842087711e+02 + 16 -5.1135176330517527e+02 9.1258644403399757e+01 4.5841393867376433e+02 + 17 -4.6543111040479431e+01 3.8966320183645706e+00 -1.1950560465552566e+02 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/dihedral-cosine_shift_exp.yaml b/unittest/force-styles/tests/dihedral-cosine_shift_exp.yaml new file mode 100644 index 0000000000..3f41533778 --- /dev/null +++ b/unittest/force-styles/tests/dihedral-cosine_shift_exp.yaml @@ -0,0 +1,86 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 15 00:17:32 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + dihedral cosine/shift/exp +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +dihedral_style: cosine/shift/exp +dihedral_coeff: ! | + 1 75 160 5.1 + 2 45 120 2.4 + 3 56 110 7.5 + 4 23 180 5.5 + 5 19 90 2.1 +extract: ! "" +natoms: 29 +init_energy: -252.253036379603 +init_stress: ! |2- + 1.2648173379127909e+01 9.8987186508472149e+00 -2.2546892029975133e+01 -4.8774048841283175e+00 2.3394385854749732e+01 8.0008046681362526e+00 +init_forces: ! |2 + 1 -2.1552264641323667e+01 9.3802303976266188e+00 -5.7580855394682011e+00 + 2 1.7542053448836402e+01 -9.0585245111022257e+00 8.5707996887760256e+00 + 3 -4.5368370292539879e+01 6.2901866813565643e+00 -1.8171838280442628e+01 + 4 -3.9437738551082751e+00 -4.2378540140894083e+00 3.8839120634338515e+00 + 5 3.0958932417316447e+01 -1.7216940826097481e+01 8.8151959108927258e-01 + 6 1.2935503074785331e+01 4.8389291078610484e+00 1.2199210336313424e+01 + 7 1.0262636687925307e+01 1.0876998682721958e+01 -1.7791589083223791e+00 + 8 1.8474452366832253e+01 1.9606544103980983e+01 6.2220353299406179e+00 + 9 1.7020916758045722e+01 1.2650017097294752e+01 -6.9250534440155018e+00 + 10 -6.9954140460001156e+01 -4.0784510598700415e+01 -7.4483410064839353e+00 + 11 9.9800939432401670e+00 -4.1410083603937586e-01 -2.2031105090375505e+00 + 12 6.9055058996213878e+00 2.5245282650526453e+00 1.4073615205210858e+01 + 13 -7.1665608596457320e-02 -1.6473434103906204e-01 -3.4575048440907352e-01 + 14 2.4318532883817405e+00 -3.3839834090561496e+00 -1.2032631916318084e+00 + 15 -8.5093986224928719e-01 2.8808607565855016e-01 -8.7054599213134165e-01 + 16 9.8383158994739315e+00 4.3782146730454219e+00 -1.9942921984521147e+00 + 17 5.3908909353600132e+00 4.4269134515255715e+00 8.6834733963048638e-01 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: -257.614342252396 +run_stress: ! |2- + 1.7490257498753159e+01 1.0170700161268988e+01 -2.7660957660022142e+01 -6.0563321066723130e+00 2.5936375239987761e+01 8.4753852207235401e+00 +run_forces: ! |2 + 1 -2.8340869683782625e+01 1.3555510896435955e+01 -9.7310424136820224e+00 + 2 2.2532829799899027e+01 -1.2287044960065845e+01 1.1808307764324978e+01 + 3 -5.0271601844432602e+01 4.9753287594437925e+00 -1.6437177859547127e+01 + 4 -4.0479806769809548e+00 -4.2816812351332816e+00 4.0128362735655116e+00 + 5 3.6226699867711012e+01 -1.8830703912727873e+01 -3.4059653175581617e-01 + 6 1.4759859050018006e+01 8.3318612371300382e+00 1.3229899146289618e+01 + 7 1.0165208712198130e+01 1.0448411062655477e+01 -1.7555087342732367e+00 + 8 2.0116183215245037e+01 1.9308177333698612e+01 4.1709300625485257e+00 + 9 1.7663163394553074e+01 1.3287909630206507e+01 -7.4777645988144261e+00 + 10 -7.3427264521352626e+01 -4.2917328236539291e+01 -4.6471231079398461e+00 + 11 1.0659519760667312e+01 5.4412727991472387e-01 -2.6341114567529642e+00 + 12 6.7441724239154066e+00 2.3643550533805571e+00 1.3910692957016416e+01 + 13 -5.9464036752181260e-02 -1.4147587935970574e-01 -2.9837759201150327e-01 + 14 2.5771834778258933e+00 -3.5753006914092307e+00 -1.2087042456171362e+00 + 15 -9.0746770463589121e-01 3.1107711330238297e-01 -9.5516047021614181e-01 + 16 9.9975758870398241e+00 4.1825011056504460e+00 -2.5015655069894827e+00 + 17 5.6122528788641510e+00 4.7242754434167367e+00 8.5446631385464789e-01 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/dihedral-fourier.yaml b/unittest/force-styles/tests/dihedral-fourier.yaml new file mode 100644 index 0000000000..a5fa287b17 --- /dev/null +++ b/unittest/force-styles/tests/dihedral-fourier.yaml @@ -0,0 +1,86 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Fri Aug 14 23:57:15 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + dihedral fourier +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +dihedral_style: fourier +dihedral_coeff: ! | + 1 1 75 1 120 + 2 2 75 1 120 42 2 140 + 3 3 75 1 120 42 2 140 35 1 160 + 4 4 75 1 120 42 2 140 35 2 160 21 2 110 + 5 5 75 1 120 42 2 140 35 2 160 21 2 110 10 2 20 +extract: ! "" +natoms: 29 +init_energy: 4237.11651056645 +init_stress: ! |- + -1.3707440529302698e+02 -1.1775005714687839e+02 2.5482446243990526e+02 -6.0912155352783664e+01 -5.1858430299844976e+01 6.0101035915715130e+01 +init_forces: ! |2 + 1 1.2746097289536102e+01 1.7790368163729784e+01 -6.0266215656413486e+01 + 2 -1.1610373332641444e+01 5.9954697848532916e+00 -5.6726645165123166e+00 + 3 -3.0005227165688689e+02 -4.9050080271628315e+02 3.9338967778175328e+02 + 4 2.2841720862146582e+02 2.7139158135197209e+02 -2.1470031526034018e+02 + 5 8.8728374601790847e+00 5.0910313257182978e+01 1.7059542215878558e+01 + 6 -1.7146773646607809e+01 5.7418005757422094e+01 -1.2055217754071805e+02 + 7 -1.3811348109784319e+01 -1.6092405824046025e+01 2.6858660625110602e+00 + 8 2.7655221748363897e+02 2.5865412863270615e+02 5.0126271505349941e+01 + 9 -7.2800478794159957e+01 -8.5596953503127239e+01 3.7283780582768614e+01 + 10 -2.4238052366585612e+02 -2.5593760501061602e+01 -9.7931335578075135e+01 + 11 1.0347877593619341e+01 -4.9780495945302690e+01 2.7793211018332769e+01 + 12 -6.7005988611829750e+00 1.4693253477499184e+01 1.1054970688694432e+01 + 13 5.9402228888983117e+00 1.3654509078936300e+01 2.8658585080877884e+01 + 14 5.1102705146276129e+01 -7.1110665762227072e+01 -2.5285244134215660e+01 + 15 -2.2979041686027728e+01 7.7795649674038003e+00 -2.3508491645829253e+01 + 16 2.7292929150263575e+01 -1.3982140480955508e+01 -3.0800243561758837e+01 + 17 6.6209314119270019e+01 5.4370030261297515e+01 1.0664782957696374e+01 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 4002.2184821554 +run_stress: ! |- + -6.7592586390472405e+01 -1.5137220231818123e+01 8.2729806622290468e+01 2.6420780385163049e+01 -1.5709841818138111e+02 8.5084793209307065e+01 +run_forces: ! |2 + 1 -3.2785665288695292e+01 2.3397099312716072e+01 -4.4935264086030173e+01 + 2 9.3683772847161109e+00 -4.6543380101821370e+00 4.7484721476695455e+00 + 3 -1.1214096935652172e+01 -1.4443632632238626e+02 1.8492077218448509e+02 + 4 1.3708478952813596e+02 8.3204631181657874e+01 -4.1388532620181024e+01 + 5 -7.4075538171393646e+01 -6.1185138077587702e+00 -1.0895372756765887e+01 + 6 -7.8565628138372574e+01 -2.7189314446040036e+01 -1.0071986766303358e+02 + 7 4.0243669767611053e+01 4.5977790661431683e+01 -8.8038214391879119e+00 + 8 1.3122699639012566e+01 -2.7920491407079538e+01 1.1742377385795479e+02 + 9 -4.7511063517498044e+00 2.3499853841132740e+01 -2.2569361577285818e+00 + 10 -1.1953739595322851e+02 1.0133085093026175e+02 -1.0536009434183680e+02 + 11 2.0128068364804172e+01 -4.1592845753823546e+01 2.5108634818751678e+01 + 12 3.8319064486110669e+01 4.4188518546318702e+00 7.1282463760246301e+01 + 13 -4.5612769507910400e-01 -1.2104612277494624e+00 -2.5959219750950240e+00 + 14 3.7588724727147294e+01 -5.0701668008588342e+01 -1.3135603348814499e+01 + 15 -3.5332965606158822e+01 1.2060544722064744e+01 -4.1376990962339896e+01 + 16 -3.1874918653419257e+01 -6.8634675620464819e+01 -4.3621948015877813e+01 + 17 9.2738048996211262e+01 7.8569012100176138e+01 1.1606236597783852e+01 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/dihedral-harmonic.yaml b/unittest/force-styles/tests/dihedral-harmonic.yaml new file mode 100644 index 0000000000..686c902e6d --- /dev/null +++ b/unittest/force-styles/tests/dihedral-harmonic.yaml @@ -0,0 +1,86 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Fri Aug 14 23:28:04 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + dihedral harmonic +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +dihedral_style: harmonic +dihedral_coeff: ! | + 1 75.0 +1 2 + 2 45.0 -1 4 + 3 56.0 -1 2 + 4 23.0 +1 1 + 5 19.0 -1 3 +extract: ! "" +natoms: 29 +init_energy: 789.17395858648 +init_stress: ! |- + -6.2042484436524219e+01 1.2714037725306221e+02 -6.5097892816538135e+01 2.6648135399224223e+01 1.3495574921305175e+02 1.6236422290928121e+02 +init_forces: ! |2 + 1 -2.1511698742845866e+01 4.0249060564855860e+01 -9.0013321196300495e+01 + 2 -8.1931697051663761e+00 4.2308632119002461e+00 -4.0030670619001576e+00 + 3 9.1213724359021342e+01 -1.3766351447039605e+02 8.1969246558440773e+01 + 4 -4.8202572898596316e+01 -8.0465316960733553e+00 6.4757081520864901e+01 + 5 -6.2252471689207432e+01 2.2804485244022331e+01 -5.3285277341381354e+00 + 6 9.1271091191895337e+01 1.3743691097166200e+02 -3.9344000137592637e+01 + 7 -4.7435622518386936e+01 -5.1206081255886986e+01 8.4101355581705430e+00 + 8 2.2568717344776448e+02 1.6221073825524249e+02 5.7667169753528370e+01 + 9 -2.0794865226210746e+00 5.0314964909952629e+00 -7.5468528100469179e-01 + 10 -4.0476567806811568e+02 -4.7270660984257171e+02 -9.9999223894595431e+01 + 11 3.9909170606249432e+01 2.0810704935563001e+02 -1.3665198019985243e+02 + 12 6.2493704719337885e+01 7.0253447917427593e+01 1.9569964347346627e+02 + 13 2.9234925409867770e+01 6.7200938735330823e+01 1.4104379799580224e+02 + 14 7.2099736490024156e+01 -1.0032854911322366e+02 -3.5674421421421059e+01 + 15 -1.0059762933494233e+02 3.4057372960589944e+01 -1.0291545492293889e+02 + 16 -9.2273705073611623e+01 -1.2566881299602966e+02 -6.3115663814665538e+01 + 17 1.7540250832933316e+02 1.4403773566652495e+02 2.8253270804136417e+01 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 559.514314402615 +run_stress: ! |- + -7.2322773064605812e+01 1.0008318054682091e+02 -2.7760407482215093e+01 8.2664096303485692e+00 7.5544828226688665e+01 4.2349931315079388e+01 +run_forces: ! |2 + 1 -7.5427026379256645e+01 6.3896565938649857e+01 -1.2972408362281925e+02 + 2 2.7848804645518747e+01 -1.3384291550167376e+01 1.5520549537371039e+01 + 3 1.4291512583129179e+02 -1.0005541838121475e+02 1.7368534876290710e+02 + 4 -2.4993112928304718e+01 -1.5718774185299033e+01 3.1537044007738828e+01 + 5 -5.4491620760121982e+01 2.1454671018185664e+01 -9.7758302505134953e+00 + 6 2.5783017937292061e+02 2.8944529364713867e+02 -1.7114092912154493e+02 + 7 -2.0392219213490730e+01 -2.0925518100765142e+01 5.2456524787664485e+00 + 8 -4.0591958020866076e+02 -3.6413946902017597e+02 2.1061195173427461e+02 + 9 4.8059404395982178e+01 3.6578486987067571e+01 -1.8191665466109903e+01 + 10 -5.3862738059223645e+01 -7.0582655352047610e+01 -9.7735616318984071e+01 + 11 1.7421180978722248e+01 1.2677031646596370e+02 -3.6028273593100664e+01 + 12 1.3410368271504629e+01 -6.6673575351920080e+00 1.3255076941331851e+01 + 13 1.4494245045917310e+01 6.6881957263407287e+01 1.4910606355545576e+02 + 14 3.7761031099166118e+01 -4.5538628614345569e+01 -1.1365873793326973e+01 + 15 -4.2205100081678445e+01 9.8022567063861477e+00 -6.2057049935635938e+01 + 16 -8.7003445287066867e+01 -1.4871541643684955e+02 -7.0399533780669756e+01 + 17 2.0455450327678008e+02 1.7089798114925810e+02 7.4571688648593746e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/dihedral-helix.yaml b/unittest/force-styles/tests/dihedral-helix.yaml new file mode 100644 index 0000000000..2f0e75bad7 --- /dev/null +++ b/unittest/force-styles/tests/dihedral-helix.yaml @@ -0,0 +1,86 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 15 00:07:43 202 +epsilon: 4e-13 +prerequisites: ! | + atom full + dihedral helix +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +dihedral_style: helix +dihedral_coeff: ! | + 1 75 60 42 + 2 45 20 75 + 3 56 10 32 + 4 23 80 61 + 5 19 90 13 +extract: ! "" +natoms: 29 +init_energy: 4634.43654570767 +init_stress: ! |- + -8.0823732518006864e+01 9.9479187244686401e+01 -1.8655454726676005e+01 3.1101576556766449e+01 7.4461883645297704e+01 4.1747530138691431e+01 +init_forces: ! |2 + 1 1.5382329638267035e+02 -8.7367671314025813e+01 9.6804569946208161e+01 + 2 -1.1019792518885538e+02 5.6905003129041866e+01 -5.3841150676408077e+01 + 3 2.3246539083975563e+02 4.0296299562627820e+02 -1.1393686865859708e+02 + 4 3.1568060813146701e+01 7.2317480245220249e+00 -4.1634456256848210e+01 + 5 6.2738188559800125e+00 -1.7156050770489149e+00 7.1235927088545736e-01 + 6 -1.0269680933720128e+03 -1.1690454281502080e+03 2.1661954258810474e+02 + 7 4.5805034065516077e+02 4.9842112368971334e+02 -8.2004595690709891e+01 + 8 -5.7825681205863611e+02 -3.5494272038879512e+02 -3.0370616059225443e+02 + 9 4.4268140801703601e+02 4.4489087402560148e+02 -2.0831276526993508e+02 + 10 -8.7951164139994049e+01 1.0636363540938814e+02 -5.4515993120398733e+01 + 11 7.1220902371740760e+02 -3.3016873225873155e+02 2.5993521030531923e+01 + 12 -1.7787675730154415e+01 1.3423193485792953e+02 1.6661355844612942e+02 + 13 -1.3886141645948561e+02 -3.1919416278193785e+02 -6.6993643041455698e+02 + 14 -3.7790416886453340e+02 5.2586290618778116e+02 1.8698421427449398e+02 + 15 4.7485173910262199e+02 -1.6076127127963423e+02 4.8579258849115138e+02 + 16 -2.4610027154189737e+02 1.8711434954391683e+02 3.3675371434963506e+02 + 17 7.2104448971790220e+01 5.9211020756208853e+01 1.1614352282568390e+01 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 3184.425423264 +run_stress: ! |- + -3.4297383091101312e+02 2.4536418850269790e+00 3.4052018902598576e+02 2.1297727663541016e+02 1.4662821734035549e+02 -1.3420881428965288e+02 +run_forces: ! |2 + 1 5.7875149659719469e+01 1.0937989604641680e+02 -3.2480494730589595e+02 + 2 -5.4524463575220636e+01 2.5299684367346767e+01 -1.6841709772560385e+01 + 3 -2.0351845448005238e+02 -3.5690016774674945e+02 7.0481523300480296e+02 + 4 8.2929068498372544e+01 6.0796399296298475e+01 -1.0292759963329706e+02 + 5 5.7391248147974963e+01 9.2786940177217012e+00 1.8648947065326904e+01 + 6 9.6632060990593118e+01 7.8667403948749495e+01 -4.8210119160516030e+02 + 7 7.4845700867598794e+01 1.5560777678066597e+02 4.6688526765361310e+01 + 8 -1.1787351712500791e+02 -7.8920150596948517e+01 2.1787945929156876e+02 + 9 1.3435655987554071e+01 -1.3185184180019448e+01 -5.7247094983782176e-01 + 10 5.7593680089110580e+02 -1.8837455787325018e+02 8.9979257321334956e+01 + 11 -4.6919786468574478e+02 1.2910661077098780e+02 -2.4322136741312107e+02 + 12 -1.0597103290073907e+01 -8.4223775583053694e+01 -1.5461567616536547e+02 + 13 1.4102365998128749e+02 2.1516116290629622e+01 2.5593716813367686e+02 + 14 2.1941013632167952e+01 -4.2089538810928531e+01 -3.4646573102618390e+01 + 15 -1.7087144392180502e+02 1.2905127342244901e+02 -5.5880200245409512e+01 + 16 -2.8344357639007137e+02 -9.6637242750215592e+01 5.8989667967176203e+01 + 17 1.8801606481160192e+02 1.4162676259989951e+02 2.2673476644018251e+01 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/dihedral-multi_harmonic.yaml b/unittest/force-styles/tests/dihedral-multi_harmonic.yaml new file mode 100644 index 0000000000..7bd1527d00 --- /dev/null +++ b/unittest/force-styles/tests/dihedral-multi_harmonic.yaml @@ -0,0 +1,86 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 15 00:09:14 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + dihedral multi/harmonic +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +dihedral_style: multi/harmonic +dihedral_coeff: ! | + 1 75 60 42 23 91 + 2 45 20 75 52 24 + 3 56 10 32 84 52 + 4 23 80 61 83 74 + 5 19 90 13 15 58 +extract: ! "" +natoms: 29 +init_energy: 2854.98573165667 +init_stress: ! |2- + 1.5681915450818258e+02 1.8843677355938829e+02 -3.4525592806757135e+02 1.8730498639126836e+02 3.9598161309144100e+00 -4.8403883145099769e+01 +init_forces: ! |2 + 1 1.3738709657144352e+02 -8.1922817594424572e+01 9.7075104799546850e+01 + 2 -1.0659916463476705e+02 5.5046642545209522e+01 -5.2082847070338147e+01 + 3 1.5886334395918402e+02 2.5338186929832096e+02 -1.6850515833682286e+02 + 4 -9.5225444536502579e+01 -1.1265598934657196e+02 8.9698661383677717e+01 + 5 -1.2852852144878329e+02 -9.0809475595387653e+01 -5.2501247333692461e+01 + 6 4.9246759553241205e+01 -1.8277982378705346e+01 7.0990893782854002e+01 + 7 7.4663926284829870e+01 8.0704027294328569e+01 -1.3258721042376479e+01 + 8 -5.7664771790647706e+02 -5.3918019517298592e+02 1.5396929378643614e+02 + 9 2.9901970531305994e+02 2.8758255690187787e+02 -1.3756295870594514e+02 + 10 4.5524976502054687e+02 4.2063419413217622e+02 -1.3246733864751559e+02 + 11 -8.1758898081829770e+01 -1.4048792663689201e+02 1.0573752188920433e+02 + 12 1.3599907767871962e+01 -1.1383028650554325e+01 4.1418406115814665e+00 + 13 -2.8222212138596170e+00 -6.4873062691689682e+00 -1.3615796627027152e+01 + 14 -3.5095181390137633e+01 4.8835804416914783e+01 1.7364838648837505e+01 + 15 3.4824444714752772e+01 -1.1789831526216862e+01 3.5626819378860084e+01 + 16 -2.0052943268182560e+02 -1.3676403262886782e+02 -5.3118534908764730e+00 + 17 4.3516327092523319e+00 3.5734912109474788e+00 7.0094697359617353e-01 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 2068.4431627291 +run_stress: ! |2- + 2.5866473671717580e+02 1.5860109029663866e+02 -4.1726582701381454e+02 3.4534083679163041e+02 2.0779081434023382e+02 -1.6085239554581804e+02 +run_forces: ! |2 + 1 8.6927279683496366e+01 -4.9503012048253403e+01 3.9111842945975724e+01 + 2 -7.3019513853783394e+01 3.5768096750730869e+01 -2.0083554788771281e+01 + 3 9.3370109174259639e+01 1.8378542745452413e+02 -1.7686509590885186e+02 + 4 -5.9886129484296958e+01 -9.2175950192515941e+01 1.0345209361196453e+02 + 5 -7.8461995716981789e+01 -4.9973649306097840e+01 -4.7687819399652909e+01 + 6 3.0688609215986401e+02 1.0281274882345858e+02 9.1804508514677963e+01 + 7 -1.3386575757899755e+02 -3.4719891586286025e+01 8.4110613164688637e+00 + 8 -4.8976293559074668e+02 -4.0613838203763555e+02 -1.2671094634099225e+02 + 9 1.1540215024036294e+02 4.1891523357674174e+00 -1.0516611250499953e+02 + 10 3.3648759563317589e+02 4.3465234135259436e+02 1.9556997727036659e+02 + 11 3.3645463184122804e-01 -4.8548110389370294e+01 5.0627279150346070e+01 + 12 6.1383386286719741e+00 -1.2972850611116275e+01 -7.9512385890440811e+00 + 13 1.7386467837420696e+00 4.0446005594469128e+00 7.4065112120083825e+00 + 14 -2.7431571585817760e+01 4.2489377132454251e+01 1.6157455120018103e+01 + 15 3.9806278110486495e+01 -1.3874311757016962e+01 3.6342544663738614e+01 + 16 -3.3788021205378311e+02 -2.0161041043489172e+02 -9.5694588138585118e+01 + 17 2.1321517081850652e+02 1.0177482395420746e+02 3.1276081865332237e+01 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/dihedral-nharmonic.yaml b/unittest/force-styles/tests/dihedral-nharmonic.yaml new file mode 100644 index 0000000000..51b0d6a075 --- /dev/null +++ b/unittest/force-styles/tests/dihedral-nharmonic.yaml @@ -0,0 +1,86 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 15 00:14:36 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + dihedral nharmonic +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +dihedral_style: nharmonic +dihedral_coeff: ! | + 1 1 75 + 2 2 75 42 + 3 3 75 42 35 + 4 4 75 42 35 21 + 5 5 75 42 35 21 10 +extract: ! "" +natoms: 29 +init_energy: 2987.77299081399 +init_stress: ! |2- + 9.7597564011001154e+01 5.1552482481468100e+00 -1.0275281225914760e+02 1.8493829126960399e+01 -2.0812476993720594e+01 -1.8522149185389509e+01 +init_forces: ! |2 + 1 -2.2513291756353219e+01 4.7119202966322113e+00 7.8626223248943488e+00 + 2 1.6503301622376316e+01 -8.5221244306678052e+00 8.0632802095482496e+00 + 3 1.6036976766592576e+02 1.6287909459293988e+02 -7.5360356553197050e+01 + 4 -5.5774232874990290e+01 -5.3058913648795475e+01 5.7643742847181294e+01 + 5 -5.5693897474981654e+01 -4.6866567575987339e+01 -2.5012126373852766e+01 + 6 -1.4807705653098827e+02 -1.7439629259562869e+02 4.3508953332564516e+01 + 7 5.7230190824331977e+01 6.2118378860762746e+01 -1.0214660840095114e+01 + 8 -4.9646451985301219e+01 -1.6916018705669373e+01 -4.3263724045252935e+01 + 9 5.6208167529396206e+01 5.1711293643508995e+01 -2.5287150384768847e+01 + 10 3.0991849000677316e+01 7.1919803329260148e+01 6.0749104476882920e+01 + 11 4.5844405619977813e+01 -3.2881788637711445e+01 8.7606207362048369e+00 + 12 1.1196936677514067e+01 -5.1163625458728184e+01 -5.6831813719102982e+01 + 13 -5.9988298526181154e+00 -1.3789226131337799e+01 -2.8941334177588317e+01 + 14 -4.7822307931026252e+01 6.6545912697330365e+01 2.3662127623898343e+01 + 15 4.0718083591203595e+01 -1.3785125636399199e+01 4.1656250988047944e+01 + 16 -2.7739760389786966e+01 -3.7464205631044081e+00 1.3938205295403176e+01 + 17 -5.7968737353570745e+00 -4.7603000364046579e+00 -9.3374174076756766e-01 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 2932.67140481462 +run_stress: ! |2- + 1.3113158039883243e+02 3.0017332320922129e+01 -1.6114891271975495e+02 5.0642269363850268e+01 -5.0284606578026860e+01 -2.6421224784162000e+01 +run_forces: ! |2 + 1 -2.1843468181940111e+01 4.9898407958356472e-01 1.5737480077228087e+01 + 2 1.5063370369302987e+01 -7.9470023729700037e+00 7.9690488601573755e+00 + 3 2.0340110889554961e+02 1.9673567508539708e+02 -1.1659472113672666e+02 + 4 -6.0019340575841028e+01 -6.9057567870684238e+01 8.6444021216688654e+01 + 5 -6.4568091713981971e+01 -3.9869892887327453e+01 -3.4121387196501487e+01 + 6 -2.4749468058354594e+02 -2.5420076241047207e+02 7.1689919871193680e+01 + 7 9.5480063645260273e+01 8.8362876259681187e+01 -4.5904968532268597e+00 + 8 -1.3625709949813269e+01 1.6000252165686483e+01 -7.6035714434969535e+01 + 9 4.8469881681062319e+01 4.8625808433086455e+01 -2.8100988626754841e+01 + 10 4.4663157124616184e+01 9.1163958302377054e+01 8.8088461754622784e+01 + 11 4.5720476116869094e+01 -3.2073943323042784e+01 1.1302571688998796e+01 + 12 3.5421566949831487e+00 -6.1009588508625818e+01 -7.4400954308443673e+01 + 13 -4.7175199178417824e+00 -1.1266660904229752e+01 -2.1369175083658099e+01 + 14 -4.5469411645716534e+01 7.2742323373124265e+01 3.0125888080066769e+01 + 15 4.3384587153325384e+01 -1.6390340078555496e+01 4.0280949600255724e+01 + 16 -4.3817196366502785e+01 -2.3736466649868753e+01 3.2806463177968475e+00 + 17 1.8306172542145163e+00 1.4223473068402193e+00 2.9445017327241452e-01 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/dihedral-opls.yaml b/unittest/force-styles/tests/dihedral-opls.yaml new file mode 100644 index 0000000000..2eaaf48a8a --- /dev/null +++ b/unittest/force-styles/tests/dihedral-opls.yaml @@ -0,0 +1,86 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 15 00:06:49 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + dihedral opls +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +dihedral_style: opls +dihedral_coeff: ! | + 1 75 60 42 23 + 2 45 20 75 52 + 3 56 10 32 84 + 4 23 80 61 83 + 5 19 90 13 15 +extract: ! "" +natoms: 29 +init_energy: 2260.68345252858 +init_stress: ! |- + -3.2511829957222636e+02 -2.5747791683619937e+01 3.5086609125584721e+02 -1.7284868467618770e+02 2.1513133474621105e+02 1.2517993158427072e+02 +init_forces: ! |2 + 1 3.8418843300789013e+02 -2.0215855127626560e+02 1.9798867612265633e+02 + 2 -2.9487545045054014e+02 1.5227045701458118e+02 -1.4407198258290703e+02 + 3 -9.8281517150962941e+01 -1.6227125420394077e+02 -6.7942361484037335e+01 + 4 1.0637245492200620e+02 1.3269987633301727e+02 -9.7489660444067866e+01 + 5 -3.7665970146318074e+01 1.7971807362873878e+02 4.6710944552079496e+01 + 6 1.1702706522755852e+02 8.6982608420528692e+01 3.1913126533391416e+01 + 7 -7.7554238578063632e+01 -8.2420107806847696e+01 1.3489747654226932e+01 + 8 9.1569783748215841e+00 -4.0548521525557547e+01 -1.0326672032405639e+01 + 9 -1.7725494652391851e+02 -1.4026459257463608e+02 7.4192724911953448e+01 + 10 -4.1110104786839440e+02 -2.5073752258808310e+02 -1.5153435376208634e+02 + 11 2.5176689706800320e+02 6.4942280703724947e+01 -1.0152404897547778e+02 + 12 5.0683700189254097e+01 5.3499935743815733e+01 1.5370438642303924e+02 + 13 -9.3214628811766573e+00 -2.1426805343932180e+01 -4.4971365899031198e+01 + 14 -3.2894997260227242e+01 4.5774194315657603e+01 1.6276203659637726e+01 + 15 2.2596508786687949e+01 -7.6500582811265119e+00 2.3117144974751533e+01 + 16 1.2469191655312443e+01 3.9926824651176872e+01 3.0718477775528918e+01 + 17 1.8468840162806748e+02 1.5166316278914834e+02 2.9749012572748249e+01 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 1971.76668402494 +run_stress: ! |- + -5.3318236801518850e+01 9.1643131331339340e+00 4.4153923668384280e+01 -1.2007337292813082e+02 1.4767501353633841e+02 1.7262313190768117e+02 +run_forces: ! |2 + 1 -1.3862408213643533e+02 4.6887100345038007e+01 2.8799692777005276e+01 + 2 9.9953746973875909e+01 -4.4207888183514719e+01 3.7868980074950933e+00 + 3 -1.7322383555091442e+01 -1.0040661766471668e+01 -1.5832528525148729e+02 + 4 3.3009309743970334e+00 7.9263643957112805e+01 4.1059629961570238e+01 + 5 1.7141767836737523e+02 8.5585849483924420e+01 3.9106603925274626e+01 + 6 -5.7295624588327518e+00 -1.0747476970550838e+02 -2.4332970704818472e+01 + 7 1.4165605067587833e+01 2.9558607951389774e+01 -6.6781769009518808e+00 + 8 -3.6478077083997755e+02 -2.6882613824851575e+02 1.1422429075547413e+02 + 9 -2.3573197874081039e+01 -2.6423713499595138e+01 6.1048444530485533e+00 + 10 -4.4436415253639609e+01 -1.1713877349830888e+01 -1.9240052487687041e+02 + 11 2.1888306211131447e+02 5.9714178231074044e+01 -2.3412819700420187e+00 + 12 1.8483080588244778e+01 4.9111660089966662e+01 1.2220691127049136e+02 + 13 -1.1413782196060211e+01 -1.6131887308667118e+01 -5.0440281047961079e+01 + 14 -3.6218278671889124e+01 5.0557037754791878e+01 1.9310795882835656e+01 + 15 3.0245788241749811e+01 -1.2205148300061115e+01 3.6786485210390509e+01 + 16 -1.5064404445948733e+02 -1.1349077606738874e+02 7.4857112892864421e+00 + 17 2.3629262512094942e+02 2.0983678261625582e+02 1.5646657219259204e+01 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/dihedral-quadratic.yaml b/unittest/force-styles/tests/dihedral-quadratic.yaml new file mode 100644 index 0000000000..5acae9caa3 --- /dev/null +++ b/unittest/force-styles/tests/dihedral-quadratic.yaml @@ -0,0 +1,86 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Fri Aug 14 23:59:34 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + dihedral quadratic +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +dihedral_style: quadratic +dihedral_coeff: ! | + 1 75 80 + 2 45 90 + 3 25 100 + 4 35 110 + 5 85 120 +extract: ! "" +natoms: 29 +init_energy: 10790.8218173984 +init_stress: ! |- + -2.4349088601716869e+02 4.5434876556303789e+02 -2.1085787954586942e+02 5.5611153611677287e+02 -2.4442722867271155e+02 -2.6651985747746505e+02 +init_forces: ! |2 + 1 2.6541275119307272e+02 -1.9252805501961454e+00 -2.3899420292498147e+02 + 2 -2.4731144590894337e+02 1.2770892536477226e+02 -1.2083288138468879e+02 + 3 6.8733870154360943e+01 5.0831670807127847e+02 -8.8610535820335841e+00 + 4 -4.1377795520012290e+02 -8.2232157930741789e+02 2.5826915977017529e+02 + 5 3.0369134495339995e+02 1.6621679527137749e+02 1.0950010087265598e+02 + 6 -3.6990671824807805e+01 -8.7549281797271306e-01 7.0297285256795845e+01 + 7 4.1782234711788084e+02 4.5564715468837448e+02 -7.5002945605692233e+01 + 8 -4.9715381093337425e+02 -4.4155420434227256e+02 -4.2161501810375051e+02 + 9 9.8306790978008237e+01 1.1868270158495687e+02 -5.1100030280980036e+01 + 10 1.4728047149970391e+02 -1.0587101665857095e+02 -5.9781285611890473e+02 + 11 2.5614686356790480e+02 -5.2497896784062323e+02 2.5693132403643131e+02 + 12 -1.4627308510285863e+02 3.3981367061870230e+02 2.6880589491450269e+02 + 13 -1.3962323208440583e+02 -3.2094531228617387e+02 -6.7361180730041701e+02 + 14 -3.2177811487291115e+02 4.4776212748092632e+02 1.5921345393203961e+02 + 15 5.8870459836417240e+02 -1.9930620833366612e+02 6.0226868124446082e+02 + 16 -3.9229720981264322e+01 5.0323789356372794e+02 5.1150595378307992e+02 + 17 -3.0396100091981555e+02 -2.4960791450722277e+02 -4.8961058508693299e+01 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 12847.4721301899 +run_stress: ! |2- + 1.5413731778247720e+02 4.8261095688408386e+02 -6.3674827466652653e+02 3.7041750837419033e+02 9.5478904722324160e+01 -1.0528560543116002e+03 +run_forces: ! |2 + 1 3.4023952961424328e+02 4.7142675724999776e+01 -5.9117745947428034e+02 + 2 -2.5854886523696780e+02 1.2187710341490092e+02 -9.8015986827049559e+00 + 3 -3.7709465415513768e+02 -5.8758107029898170e+01 3.7364646564074883e+02 + 4 3.8341419076552981e+01 -2.9037192179940513e+02 2.5507534276625751e+02 + 5 2.0591592888680816e+02 1.0806625058920625e+02 1.7250239401914314e+01 + 6 2.0664874928130345e+01 1.0741408959771206e+01 -1.0779477081748253e+02 + 7 2.9169221898592656e+02 2.6513649972703411e+02 -4.6085538463992322e+00 + 8 -5.5906002907349455e+02 -2.2929248471833063e+02 -8.5296153168240846e+02 + 9 2.0620355056543836e+01 1.2274129576347346e+02 -5.8945798252855298e+01 + 10 -3.2584261629774716e+02 1.3971403271152701e+02 -6.4187830919337898e+02 + 11 8.5122526324666956e+02 -5.6393455949592874e+02 8.1248083979786793e+02 + 12 -4.5013211132616220e+02 8.5389627443998370e+02 1.2062433414984616e+03 + 13 -5.4266694405465137e+02 9.2234844451311048e+01 -9.6634129701776237e+02 + 14 -1.6531347520262710e+02 2.0817894801734195e+02 1.7072774518417552e+02 + 15 1.1786632051344673e+03 -9.2956211016488760e+02 2.1545546893990922e+02 + 16 6.1565331937936065e+00 4.6290518940991689e+02 2.7802764384747923e+02 + 17 -2.7486063277634793e+02 -3.6071534000101559e+02 -9.5397768109542753e+01 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... diff --git a/unittest/force-styles/tests/dihedral-zero.yaml b/unittest/force-styles/tests/dihedral-zero.yaml new file mode 100644 index 0000000000..7a5cc5dd7e --- /dev/null +++ b/unittest/force-styles/tests/dihedral-zero.yaml @@ -0,0 +1,82 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 15 00:03:56 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + dihedral zero +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +dihedral_style: zero +dihedral_coeff: ! | + * +extract: ! "" +natoms: 29 +init_energy: 0 +init_stress: ! |2- + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +init_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 7 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 8 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 9 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 10 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 0 +run_stress: ! |2- + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 7 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 8 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 9 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 10 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +... From 00062205b993295e888824f1f480f4dca0daffca Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Wed, 2 Sep 2020 17:51:53 -0400 Subject: [PATCH 006/384] bond/react: rename variable used for possible reaction create->attempt, to avoid clashing with create-atoms variables --- src/USER-REACTION/fix_bond_react.cpp | 64 ++++++++++++++-------------- src/USER-REACTION/fix_bond_react.h | 8 ++-- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 99d016f1a0..79967e49a1 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -474,10 +474,10 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : partner = finalpartner = NULL; distsq = NULL; probability = NULL; - maxcreate = 0; - created = NULL; - ncreate = NULL; - allncreate = 0; + maxattempt = 0; + attempt = NULL; + nattempt = NULL; + allnattempt = 0; local_num_mega = 0; ghostly_num_mega = 0; restore = NULL; @@ -519,10 +519,10 @@ FixBondReact::~FixBondReact() memory->destroy(partner); memory->destroy(finalpartner); - memory->destroy(ncreate); + memory->destroy(nattempt); memory->destroy(distsq); memory->destroy(probability); - memory->destroy(created); + memory->destroy(attempt); memory->destroy(edge); memory->destroy(equivalences); memory->destroy(reverse_equiv); @@ -815,19 +815,19 @@ void FixBondReact::post_integrate() memory->destroy(partner); memory->destroy(finalpartner); memory->destroy(distsq); - memory->destroy(ncreate); + memory->destroy(nattempt); memory->destroy(probability); nmax = atom->nmax; memory->create(partner,nmax,"bond/react:partner"); memory->create(finalpartner,nmax,"bond/react:finalpartner"); memory->create(distsq,nmax,2,"bond/react:distsq"); - memory->create(ncreate,nreacts,"bond/react:ncreate"); + memory->create(nattempt,nreacts,"bond/react:nattempt"); memory->create(probability,nmax,"bond/react:probability"); } // reset create counts for (int i = 0; i < nreacts; i++) { - ncreate[i] = 0; + nattempt[i] = 0; } int nlocal = atom->nlocal; @@ -909,7 +909,7 @@ void FixBondReact::post_integrate() // and probability constraint is satisfied // if other atom is owned by another proc, it should do same thing - int temp_ncreate = 0; + int temp_nattempt = 0; for (int i = 0; i < nlocal; i++) { if (partner[i] == 0) { continue; @@ -930,17 +930,17 @@ void FixBondReact::post_integrate() } } - // store final created bond partners and count the rxn possibility once + // store final bond partners and count the rxn possibility once finalpartner[i] = tag[j]; finalpartner[j] = tag[i]; - if (tag[i] < tag[j]) temp_ncreate++; + if (tag[i] < tag[j]) temp_nattempt++; } // cycle loop if no even eligible bonding atoms were found (on any proc) int some_chance; - MPI_Allreduce(&temp_ncreate,&some_chance,1,MPI_INT,MPI_SUM,world); + MPI_Allreduce(&temp_nattempt,&some_chance,1,MPI_INT,MPI_SUM,world); if (!some_chance) continue; // communicate final partner @@ -948,7 +948,7 @@ void FixBondReact::post_integrate() commflag = 3; comm->forward_comm_fix(this); - // add instance to 'created' only if this processor + // add instance to 'attempt' only if this processor // owns the atoms with smaller global ID // NOTE: we no longer care about ghost-ghost instances as bond/create did // this is because we take care of updating topology later (and differently) @@ -959,21 +959,21 @@ void FixBondReact::post_integrate() j = atom->map(finalpartner[i]); // if (j < 0 || tag[i] < tag[j]) { if (tag[i] < tag[j]) { //atom->map(std::min(tag[i],tag[j])) <= nlocal && - if (ncreate[rxnID] == maxcreate) { - maxcreate += DELTA; - // third column of 'created': bond/react integer ID - memory->grow(created,maxcreate,2,nreacts,"bond/react:created"); + if (nattempt[rxnID] == maxattempt) { + maxattempt += DELTA; + // third column of 'attempt': bond/react integer ID + memory->grow(attempt,maxattempt,2,nreacts,"bond/react:attempt"); } // to ensure types remain in same order // unnecessary now taken from reaction map file if (iatomtype[rxnID] == type[i]) { - created[ncreate[rxnID]][0][rxnID] = tag[i]; - created[ncreate[rxnID]][1][rxnID] = finalpartner[i]; + attempt[nattempt[rxnID]][0][rxnID] = tag[i]; + attempt[nattempt[rxnID]][1][rxnID] = finalpartner[i]; } else { - created[ncreate[rxnID]][0][rxnID] = finalpartner[i]; - created[ncreate[rxnID]][1][rxnID] = tag[i]; + attempt[nattempt[rxnID]][0][rxnID] = finalpartner[i]; + attempt[nattempt[rxnID]][1][rxnID] = tag[i]; } - ncreate[rxnID]++; + nattempt[rxnID]++; } } } @@ -981,11 +981,11 @@ void FixBondReact::post_integrate() // break loop if no even eligible bonding atoms were found (on any proc) int some_chance; - allncreate = 0; + allnattempt = 0; for (int i = 0; i < nreacts; i++) - allncreate += ncreate[i]; + allnattempt += nattempt[i]; - MPI_Allreduce(&allncreate,&some_chance,1,MPI_INT,MPI_SUM,world); + MPI_Allreduce(&allnattempt,&some_chance,1,MPI_INT,MPI_SUM,world); if (!some_chance) { unlimit_bond(); return; @@ -1201,13 +1201,13 @@ void FixBondReact::superimpose_algorithm() memory->create(restore_pt,MAXGUESS,4,"bond/react:restore_pt"); memory->create(pioneers,max_natoms,"bond/react:pioneers"); memory->create(restore,max_natoms,MAXGUESS,"bond/react:restore"); - memory->create(local_mega_glove,max_natoms+1,allncreate,"bond/react:local_mega_glove"); - memory->create(ghostly_mega_glove,max_natoms+1,allncreate,"bond/react:ghostly_mega_glove"); + memory->create(local_mega_glove,max_natoms+1,allnattempt,"bond/react:local_mega_glove"); + memory->create(ghostly_mega_glove,max_natoms+1,allnattempt,"bond/react:ghostly_mega_glove"); attempted_rxn = 1; for (int i = 0; i < max_natoms+1; i++) { - for (int j = 0; j < allncreate; j++) { + for (int j = 0; j < allnattempt; j++) { local_mega_glove[i][j] = 0; ghostly_mega_glove[i][j] = 0; } @@ -1215,7 +1215,7 @@ void FixBondReact::superimpose_algorithm() // let's finally begin the superimpose loop for (rxnID = 0; rxnID < nreacts; rxnID++) { - for (lcl_inst = 0; lcl_inst < ncreate[rxnID]; lcl_inst++) { + for (lcl_inst = 0; lcl_inst < nattempt[rxnID]; lcl_inst++) { onemol = atom->molecules[unreacted_mol[rxnID]]; twomol = atom->molecules[reacted_mol[rxnID]]; @@ -1238,10 +1238,10 @@ void FixBondReact::superimpose_algorithm() int myjbonding = jbonding[rxnID]; glove[myibonding-1][0] = myibonding; - glove[myibonding-1][1] = created[lcl_inst][0][rxnID]; + glove[myibonding-1][1] = attempt[lcl_inst][0][rxnID]; glove_counter++; glove[myjbonding-1][0] = myjbonding; - glove[myjbonding-1][1] = created[lcl_inst][1][rxnID]; + glove[myjbonding-1][1] = attempt[lcl_inst][1][rxnID]; glove_counter++; // special case, only two atoms in reaction templates diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h index 61a1bd4213..bb7ed7fe9f 100644 --- a/src/USER-REACTION/fix_bond_react.h +++ b/src/USER-REACTION/fix_bond_react.h @@ -80,10 +80,10 @@ class FixBondReact : public Fix { int max_natoms; // max natoms in a molecule template tagint *partner,*finalpartner; double **distsq,*probability; - int *ncreate; - int maxcreate; - int allncreate; - tagint ***created; + int *nattempt; + int maxattempt; + int allnattempt; + tagint ***attempt; class Molecule *onemol; // pre-reacted molecule template class Molecule *twomol; // post-reacted molecule template From e01a926c878eff6cd155ae6e7809b43ec53e7430 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Wed, 2 Sep 2020 19:16:18 -0400 Subject: [PATCH 007/384] bond/react: add create_atoms section to map file --- src/USER-REACTION/fix_bond_react.cpp | 101 ++++++++++++++++++--------- src/USER-REACTION/fix_bond_react.h | 4 +- 2 files changed, 70 insertions(+), 35 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 79967e49a1..fd1448e859 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -390,6 +390,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : memory->create(landlocked_atoms,max_natoms,nreacts,"bond/react:landlocked_atoms"); memory->create(custom_edges,max_natoms,nreacts,"bond/react:custom_edges"); memory->create(delete_atoms,max_natoms,nreacts,"bond/react:delete_atoms"); + memory->create(create_atoms,max_natoms,nreacts,"bond/react:create_atoms"); memory->create(chiral_atoms,max_natoms,6,nreacts,"bond/react:chiral_atoms"); for (int j = 0; j < nreacts; j++) @@ -398,6 +399,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : if (update_edges_flag[j] == 1) custom_edges[i][j] = 1; else custom_edges[i][j] = 0; delete_atoms[i][j] = 0; + create_atoms[i][j] = 0; for (int k = 0; k < 6; k++) { chiral_atoms[i][k][j] = 0; } @@ -410,11 +412,13 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : twomol = atom->molecules[reacted_mol[i]]; onemol->check_attributes(0); twomol->check_attributes(0); - if (onemol->natoms != twomol->natoms) - error->all(FLERR,"Bond/react: Reaction templates must contain the same number of atoms"); get_molxspecials(); read(i); fclose(fp); + if (ncreate == 0 && onemol->natoms != twomol->natoms) + error->all(FLERR,"Bond/react: Reaction templates must contain the same number of atoms"); + else if (ncreate > 0 && onemol->natoms + ncreate != twomol->natoms) + error->all(FLERR,"Bond/react: Incorrect number of created atoms"); iatomtype[i] = onemol->type[ibonding[i]-1]; jatomtype[i] = onemol->type[jbonding[i]-1]; find_landlocked_atoms(i); @@ -529,6 +533,7 @@ FixBondReact::~FixBondReact() memory->destroy(landlocked_atoms); memory->destroy(custom_edges); memory->destroy(delete_atoms); + memory->destroy(create_atoms); memory->destroy(chiral_atoms); memory->destroy(nevery); @@ -2090,7 +2095,8 @@ void FixBondReact::find_landlocked_atoms(int myrxn) // always remove edge atoms from landlocked list for (int i = 0; i < twomol->natoms; i++) { - if (edge[equivalences[i][1][myrxn]-1][myrxn] == 1) landlocked_atoms[i][myrxn] = 0; + if (create_atoms[i][myrxn] == 0 && edge[equivalences[i][1][myrxn]-1][myrxn] == 1) + landlocked_atoms[i][myrxn] = 0; else landlocked_atoms[i][myrxn] = 1; } int nspecial_limit = -1; @@ -2114,44 +2120,48 @@ void FixBondReact::find_landlocked_atoms(int myrxn) // bad molecule templates check // if atoms change types, but aren't landlocked, that's bad for (int i = 0; i < twomol->natoms; i++) { - if (twomol->type[i] != onemol->type[equivalences[i][1][myrxn]-1] && landlocked_atoms[i][myrxn] == 0) { - char str[128]; - snprintf(str,128,"Bond/react: Atom type affected by reaction %s too close to template edge",rxn_name[myrxn]); - error->all(FLERR,str); + if (create_atoms[i][myrxn] == 0) { + if (twomol->type[i] != onemol->type[equivalences[i][1][myrxn]-1] && landlocked_atoms[i][myrxn] == 0) { + char str[128]; + snprintf(str,128,"Bond/react: Atom type affected by reaction %s too close to template edge",rxn_name[myrxn]); + error->all(FLERR,str); + } } } // additionally, if a bond changes type, but neither involved atom is landlocked, bad // would someone want to change an angle type but not bond or atom types? (etc.) ...hopefully not yet for (int i = 0; i < twomol->natoms; i++) { - if (landlocked_atoms[i][myrxn] == 0) { - for (int j = 0; j < twomol->num_bond[i]; j++) { - int twomol_atomj = twomol->bond_atom[i][j]; - if (landlocked_atoms[twomol_atomj-1][myrxn] == 0) { - int onemol_atomi = equivalences[i][1][myrxn]; - int onemol_batom; - for (int m = 0; m < onemol->num_bond[onemol_atomi-1]; m++) { - onemol_batom = onemol->bond_atom[onemol_atomi-1][m]; - if (onemol_batom == equivalences[twomol_atomj-1][1][myrxn]) { - if (twomol->bond_type[i][j] != onemol->bond_type[onemol_atomi-1][m]) { - char str[128]; - snprintf(str,128,"Bond/react: Bond type affected by reaction %s too close to template edge",rxn_name[myrxn]); - error->all(FLERR,str); - } - } - } - if (newton_bond) { - int onemol_atomj = equivalences[twomol_atomj-1][1][myrxn]; - for (int m = 0; m < onemol->num_bond[onemol_atomj-1]; m++) { - onemol_batom = onemol->bond_atom[onemol_atomj-1][m]; - if (onemol_batom == equivalences[i][1][myrxn]) { - if (twomol->bond_type[i][j] != onemol->bond_type[onemol_atomj-1][m]) { + if (create_atoms[i][myrxn] == 0) { + if (landlocked_atoms[i][myrxn] == 0) { + for (int j = 0; j < twomol->num_bond[i]; j++) { + int twomol_atomj = twomol->bond_atom[i][j]; + if (landlocked_atoms[twomol_atomj-1][myrxn] == 0) { + int onemol_atomi = equivalences[i][1][myrxn]; + int onemol_batom; + for (int m = 0; m < onemol->num_bond[onemol_atomi-1]; m++) { + onemol_batom = onemol->bond_atom[onemol_atomi-1][m]; + if (onemol_batom == equivalences[twomol_atomj-1][1][myrxn]) { + if (twomol->bond_type[i][j] != onemol->bond_type[onemol_atomi-1][m]) { char str[128]; snprintf(str,128,"Bond/react: Bond type affected by reaction %s too close to template edge",rxn_name[myrxn]); error->all(FLERR,str); } } } + if (newton_bond) { + int onemol_atomj = equivalences[twomol_atomj-1][1][myrxn]; + for (int m = 0; m < onemol->num_bond[onemol_atomj-1]; m++) { + onemol_batom = onemol->bond_atom[onemol_atomj-1][m]; + if (onemol_batom == equivalences[i][1][myrxn]) { + if (twomol->bond_type[i][j] != onemol->bond_type[onemol_atomj-1][m]) { + char str[128]; + snprintf(str,128,"Bond/react: Bond type affected by reaction %s too close to template edge",rxn_name[myrxn]); + error->all(FLERR,str); + } + } + } + } } } } @@ -2173,13 +2183,22 @@ void FixBondReact::find_landlocked_atoms(int myrxn) // also, if atoms change number of bonds, but aren't landlocked, that could be bad if (me == 0) for (int i = 0; i < twomol->natoms; i++) { - if (twomol_nxspecial[i][0] != onemol_nxspecial[equivalences[i][1][myrxn]-1][0] && landlocked_atoms[i][myrxn] == 0) { - char str[128]; - snprintf(str,128,"Bond/react: Atom affected by reaction %s too close to template edge",rxn_name[myrxn]); - error->warning(FLERR,str); - break; + if (create_atoms[i][myrxn] == 0) { + if (twomol_nxspecial[i][0] != onemol_nxspecial[equivalences[i][1][myrxn]-1][0] && landlocked_atoms[i][myrxn] == 0) { + char str[128]; + snprintf(str,128,"Bond/react: Atom affected by reaction %s too close to template edge",rxn_name[myrxn]); + error->warning(FLERR,str); + break; + } } } + + // finally, if a created atom is not landlocked, bad! + for (int i = 0; i < twomol->natoms; i++) { + if (create_atoms[i][myrxn] == 1 && landlocked_atoms[i][myrxn] == 0) { + error->one(FLERR,"Bond/react: Created atom too close to template edge"); + } + } } /* ---------------------------------------------------------------------- @@ -3137,6 +3156,7 @@ void FixBondReact::read(int myrxn) // skip blank lines or lines that start with "#" // stop when read an unrecognized line + ncreate = 0; while (1) { readline(line); @@ -3156,6 +3176,7 @@ void FixBondReact::read(int myrxn) } else if (strstr(line,"customIDs")) sscanf(line,"%d",&ncustom); else if (strstr(line,"deleteIDs")) sscanf(line,"%d",&ndelete); + else if (strstr(line,"createIDs")) sscanf(line,"%d",&ncreate); else if (strstr(line,"chiralIDs")) sscanf(line,"%d",&nchiral); else if (strstr(line,"constraints")) { sscanf(line,"%d",&nconstr); @@ -3192,6 +3213,8 @@ void FixBondReact::read(int myrxn) CustomEdges(line, myrxn); } else if (strcmp(keyword,"DeleteIDs") == 0) { DeleteAtoms(line, myrxn); + } else if (strcmp(keyword,"CreateIDs") == 0) { + CreateAtoms(line, myrxn); } else if (strcmp(keyword,"ChiralIDs") == 0) { ChiralCenters(line, myrxn); } else if (strcmp(keyword,"Constraints") == 0) { @@ -3279,6 +3302,16 @@ void FixBondReact::DeleteAtoms(char *line, int myrxn) } } +void FixBondReact::CreateAtoms(char *line, int myrxn) +{ + int tmp; + for (int i = 0; i < ncreate; i++) { + readline(line); + sscanf(line,"%d",&tmp); + create_atoms[tmp-1][myrxn] = 1; + } +} + void FixBondReact::ChiralCenters(char *line, int myrxn) { int tmp; diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h index bb7ed7fe9f..4ee767e815 100644 --- a/src/USER-REACTION/fix_bond_react.h +++ b/src/USER-REACTION/fix_bond_react.h @@ -113,7 +113,7 @@ class FixBondReact : public Fix { int *ibonding,*jbonding; int *closeneigh; // indicates if bonding atoms of a rxn are 1-2, 1-3, or 1-4 neighbors - int nedge,nequivalent,ncustom,ndelete,nchiral,nconstr; // # edge, equivalent, custom atoms in mapping file + int nedge,nequivalent,ncustom,ndelete,ncreate,nchiral,nconstr; // # edge, equivalent, custom atoms in mapping file int attempted_rxn; // there was an attempt! int *local_rxn_count; int *ghostly_rxn_count; @@ -129,6 +129,7 @@ class FixBondReact : public Fix { int **landlocked_atoms; // all atoms at least three bonds away from edge atoms int **custom_edges; // atoms in molecule templates with incorrect valences int **delete_atoms; // atoms in pre-reacted templates to delete + int **create_atoms; // atoms in post-reacted templates to create int ***chiral_atoms; // pre-react chiral atoms. 1) flag 2) orientation 3-4) ordered atom types int **nxspecial,**onemol_nxspecial,**twomol_nxspecial; // full number of 1-4 neighbors @@ -153,6 +154,7 @@ class FixBondReact : public Fix { void Equivalences(char *, int); void CustomEdges(char *, int); void DeleteAtoms(char *, int); + void CreateAtoms(char *,int); void ChiralCenters(char *, int); void Constraints(char *, int); void readID(char *, int, int, int); From dbd7b1e001390a82d699712ea09ac2fad3601caf Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Sat, 19 Sep 2020 10:02:45 -0400 Subject: [PATCH 008/384] bond/react: manual rebase header --- src/USER-REACTION/fix_bond_react.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h index 4ee767e815..118770864f 100644 --- a/src/USER-REACTION/fix_bond_react.h +++ b/src/USER-REACTION/fix_bond_react.h @@ -64,7 +64,7 @@ class FixBondReact : public Fix { int reset_mol_ids_flag; int custom_exclude_flag; int *stabilize_steps_flag; - int *update_edges_flag; + int *custom_charges_fragid; int nconstraints; int narrhenius; double **constraints; @@ -80,10 +80,10 @@ class FixBondReact : public Fix { int max_natoms; // max natoms in a molecule template tagint *partner,*finalpartner; double **distsq,*probability; - int *nattempt; - int maxattempt; - int allnattempt; - tagint ***attempt; + int *ncreate; + int maxcreate; + int allncreate; + tagint ***created; class Molecule *onemol; // pre-reacted molecule template class Molecule *twomol; // post-reacted molecule template @@ -113,7 +113,7 @@ class FixBondReact : public Fix { int *ibonding,*jbonding; int *closeneigh; // indicates if bonding atoms of a rxn are 1-2, 1-3, or 1-4 neighbors - int nedge,nequivalent,ncustom,ndelete,ncreate,nchiral,nconstr; // # edge, equivalent, custom atoms in mapping file + int nedge,nequivalent,ndelete,ncreate,nchiral,nconstr; // # edge, equivalent, custom atoms in mapping file int attempted_rxn; // there was an attempt! int *local_rxn_count; int *ghostly_rxn_count; @@ -127,7 +127,7 @@ class FixBondReact : public Fix { int ***equivalences; // relation between pre- and post-reacted templates int ***reverse_equiv; // re-ordered equivalences int **landlocked_atoms; // all atoms at least three bonds away from edge atoms - int **custom_edges; // atoms in molecule templates with incorrect valences + int **custom_charges; // atoms whose charge should be updated int **delete_atoms; // atoms in pre-reacted templates to delete int **create_atoms; // atoms in post-reacted templates to create int ***chiral_atoms; // pre-react chiral atoms. 1) flag 2) orientation 3-4) ordered atom types @@ -152,9 +152,9 @@ class FixBondReact : public Fix { void read(int); void EdgeIDs(char *, int); void Equivalences(char *, int); - void CustomEdges(char *, int); void DeleteAtoms(char *, int); void CreateAtoms(char *,int); + void CustomCharges(int, int); void ChiralCenters(char *, int); void Constraints(char *, int); void readID(char *, int, int, int); @@ -183,6 +183,7 @@ class FixBondReact : public Fix { void glove_ghostcheck(); void ghost_glovecast(); void update_everything(); + void insert_atoms(int, tagint **, int); void unlimit_bond(); void limit_bond(int); void dedup_mega_gloves(int); //dedup global mega_glove From 74e3a1fe8c6d9a848ca1965c2f30983ea3c42ebe Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Sat, 19 Sep 2020 10:41:50 -0400 Subject: [PATCH 009/384] manual rebase take 2 --- src/USER-REACTION/fix_bond_react.cpp | 224 +++++++++++++-------------- src/USER-REACTION/fix_bond_react.h | 10 +- 2 files changed, 111 insertions(+), 123 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index fd1448e859..995c3a53da 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -16,36 +16,37 @@ Contributing Author: Jacob Gissinger (jacob.gissinger@colorado.edu) ------------------------------------------------------------------------- */ #include "fix_bond_react.h" -#include -#include -#include -#include -#include "update.h" -#include "modify.h" -#include "respa.h" + #include "atom.h" #include "atom_vec.h" -#include "force.h" -#include "pair.h" +#include "citeme.h" #include "comm.h" #include "domain.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "random_mars.h" -#include "reset_mol_ids.h" -#include "molecule.h" +#include "error.h" +#include "force.h" #include "group.h" -#include "citeme.h" +#include "input.h" #include "math_const.h" #include "math_extra.h" #include "memory.h" -#include "error.h" -#include "input.h" +#include "modify.h" +#include "molecule.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "pair.h" +#include "random_mars.h" +#include "reset_mol_ids.h" +#include "respa.h" +#include "update.h" #include "variable.h" -#include "fmt/format.h" + #include "superpose3d.h" +#include +#include +#include + #include using namespace LAMMPS_NS; @@ -84,6 +85,9 @@ enum{DISTANCE,ANGLE,DIHEDRAL,ARRHENIUS,RMSD}; // keyword values that accept variables as input enum{NEVERY,RMIN,RMAX,PROB}; +// flag for one-proc vs shared reaction sites +enum{LOCAL,GLOBAL}; + /* ---------------------------------------------------------------------- */ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : @@ -91,10 +95,10 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : { if (lmp->citeme) lmp->citeme->add(cite_fix_bond_react); - fix1 = NULL; - fix2 = NULL; - fix3 = NULL; - reset_mol_ids = NULL; + fix1 = nullptr; + fix2 = nullptr; + fix3 = nullptr; + reset_mol_ids = nullptr; if (narg < 8) error->all(FLERR,"Illegal fix bond/react command: " "too few arguments"); @@ -115,12 +119,12 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : narrhenius = 0; status = PROCEED; - nxspecial = NULL; - onemol_nxspecial = NULL; - twomol_nxspecial = NULL; - xspecial = NULL; - onemol_xspecial = NULL; - twomol_xspecial = NULL; + nxspecial = nullptr; + onemol_nxspecial = nullptr; + twomol_nxspecial = nullptr; + xspecial = nullptr; + onemol_xspecial = nullptr; + twomol_xspecial = nullptr; // these group names are reserved for use exclusively by bond/react master_group = (char *) "bond_react_MASTER_group"; @@ -200,7 +204,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : memory->create(seed,nreacts,"bond/react:seed"); memory->create(limit_duration,nreacts,"bond/react:limit_duration"); memory->create(stabilize_steps_flag,nreacts,"bond/react:stabilize_steps_flag"); - memory->create(update_edges_flag,nreacts,"bond/react:update_edges_flag"); + memory->create(custom_charges_fragid,nreacts,"bond/react:custom_charges_fragid"); memory->create(constraints,1,MAXCONARGS,"bond/react:constraints"); memory->create(var_flag,NUMVARVALS,nreacts,"bond/react:var_flag"); memory->create(var_id,NUMVARVALS,nreacts,"bond/react:var_id"); @@ -220,7 +224,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : seed[i] = 12345; max_rxn[i] = INT_MAX; stabilize_steps_flag[i] = 0; - update_edges_flag[i] = 0; + custom_charges_fragid[i] = -1; // set default limit duration to 60 timesteps limit_duration[i] = 60; reaction_count[i] = 0; @@ -366,13 +370,15 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : limit_duration[rxn] = utils::numeric(FLERR,arg[iarg+1],false,lmp); stabilize_steps_flag[rxn] = 1; iarg += 2; - } else if (strcmp(arg[iarg],"update_edges") == 0) { + } else if (strcmp(arg[iarg],"custom_charges") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: " - "'update_edges' has too few arguments"); - if (strcmp(arg[iarg+1],"none") == 0) update_edges_flag[rxn] = 0; - else if (strcmp(arg[iarg+1],"charges") == 0) update_edges_flag[rxn] = 1; - else if (strcmp(arg[iarg+1],"custom") == 0) update_edges_flag[rxn] = 2; - else error->all(FLERR,"Illegal value for 'update_edges' keyword'"); + "'custom_charges' has too few arguments"); + if (strcmp(arg[iarg+1],"no") == 0) custom_charges_fragid[rxn] = -1; //default + else { + custom_charges_fragid[rxn] = atom->molecules[unreacted_mol[rxn]]->findfragment(arg[iarg+1]); + if (custom_charges_fragid[rxn] < 0) error->one(FLERR,"Bond/react: Molecule fragment for " + "'custom_charges' keyword does not exist"); + } iarg += 2; } else error->all(FLERR,"Illegal fix bond/react command: unknown keyword"); } @@ -388,7 +394,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : memory->create(reverse_equiv,max_natoms,2,nreacts,"bond/react:reverse_equiv"); memory->create(edge,max_natoms,nreacts,"bond/react:edge"); memory->create(landlocked_atoms,max_natoms,nreacts,"bond/react:landlocked_atoms"); - memory->create(custom_edges,max_natoms,nreacts,"bond/react:custom_edges"); + memory->create(custom_charges,max_natoms,nreacts,"bond/react:custom_charges"); memory->create(delete_atoms,max_natoms,nreacts,"bond/react:delete_atoms"); memory->create(create_atoms,max_natoms,nreacts,"bond/react:create_atoms"); memory->create(chiral_atoms,max_natoms,6,nreacts,"bond/react:chiral_atoms"); @@ -396,13 +402,17 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : for (int j = 0; j < nreacts; j++) for (int i = 0; i < max_natoms; i++) { edge[i][j] = 0; - if (update_edges_flag[j] == 1) custom_edges[i][j] = 1; - else custom_edges[i][j] = 0; + custom_charges[i][j] = 1; // update all partial charges by default delete_atoms[i][j] = 0; create_atoms[i][j] = 0; for (int k = 0; k < 6; k++) { chiral_atoms[i][k][j] = 0; } + // default equivalences to their own mol index + // all but created atoms will be updated + for (int m = 0; m < 2; m++) { + equivalences[i][m][j] = i+1; + } } // read all map files afterward @@ -422,6 +432,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : iatomtype[i] = onemol->type[ibonding[i]-1]; jatomtype[i] = onemol->type[jbonding[i]-1]; find_landlocked_atoms(i); + if (custom_charges_fragid[i] >= 0) CustomCharges(custom_charges_fragid[i],i); } // initialize Marsaglia RNG with processor-unique seed (Arrhenius prob) @@ -439,7 +450,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : } delete [] files; - if (atom->molecular != 1) + if (atom->molecular != Atom::MOLECULAR) error->all(FLERR,"Bond/react: Cannot use fix bond/react with non-molecular systems"); // check if bonding atoms are 1-2, 1-3, or 1-4 bonded neighbors @@ -475,16 +486,16 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : // allocate arrays local to this fix nmax = 0; - partner = finalpartner = NULL; - distsq = NULL; - probability = NULL; + partner = finalpartner = nullptr; + distsq = nullptr; + probability = nullptr; maxattempt = 0; - attempt = NULL; - nattempt = NULL; + attempt = nullptr; + nattempt = nullptr; allnattempt = 0; local_num_mega = 0; ghostly_num_mega = 0; - restore = NULL; + restore = nullptr; // zero out stats global_megasize = 0; @@ -492,17 +503,17 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : glove_counter = 0; guess_branch = new int[MAXGUESS](); pioneer_count = new int[max_natoms]; - local_mega_glove = NULL; - ghostly_mega_glove = NULL; - global_mega_glove = NULL; + local_mega_glove = nullptr; + ghostly_mega_glove = nullptr; + global_mega_glove = nullptr; // these are merely loop indices that became important pion = neigh = trace = 0; - id_fix1 = NULL; - id_fix2 = NULL; - id_fix3 = NULL; - statted_id = NULL; + id_fix1 = nullptr; + id_fix2 = nullptr; + id_fix3 = nullptr; + statted_id = nullptr; custom_exclude_flag = 0; // used to store restart info @@ -531,7 +542,7 @@ FixBondReact::~FixBondReact() memory->destroy(equivalences); memory->destroy(reverse_equiv); memory->destroy(landlocked_atoms); - memory->destroy(custom_edges); + memory->destroy(custom_charges); memory->destroy(delete_atoms); memory->destroy(create_atoms); memory->destroy(chiral_atoms); @@ -549,7 +560,7 @@ FixBondReact::~FixBondReact() memory->destroy(var_flag); memory->destroy(var_id); memory->destroy(stabilize_steps_flag); - memory->destroy(update_edges_flag); + memory->destroy(custom_charges_fragid); memory->destroy(iatomtype); memory->destroy(jatomtype); @@ -712,7 +723,7 @@ void FixBondReact::post_constructor() int unused; char * idprop; idprop = (char *) fix->extract("property",unused); - if (idprop == NULL) + if (idprop == nullptr) error->all(FLERR,"Exclude group must be a per-atom property group"); len = strlen(idprop) + 1; @@ -754,7 +765,7 @@ void FixBondReact::init() // check cutoff for iatomtype,jatomtype for (int i = 0; i < nreacts; i++) { - if (force->pair == NULL || cutsq[i][1] > force->pair->cutsq[iatomtype[i]][jatomtype[i]]) + if (force->pair == nullptr || cutsq[i][1] > force->pair->cutsq[iatomtype[i]][jatomtype[i]]) error->all(FLERR,"Bond/react: Fix bond/react cutoff is longer than pairwise cutoff"); } @@ -1315,7 +1326,7 @@ void FixBondReact::superimpose_algorithm() global_megasize = 0; ghost_glovecast(); // consolidate all mega_gloves to all processors - dedup_mega_gloves(0); // make sure atoms aren't added to more than one reaction + dedup_mega_gloves(LOCAL); // make sure atoms aren't added to more than one reaction MPI_Allreduce(&local_rxn_count[0],&reaction_count[0],nreacts,MPI_INT,MPI_SUM,world); @@ -1367,8 +1378,8 @@ void FixBondReact::superimpose_algorithm() next_reneighbor = update->ntimestep; // call limit_bond in 'global_mega_glove mode.' oh, and local mode - limit_bond(0); // add reacting atoms to nve/limit - limit_bond(1); + limit_bond(LOCAL); // add reacting atoms to nve/limit + limit_bond(GLOBAL); update_everything(); // change topology } @@ -2208,30 +2219,30 @@ allows for same site undergoing different pathways, in parallel void FixBondReact::dedup_mega_gloves(int dedup_mode) { - // dedup_mode == 0 for local_dedup - // dedup_mode == 1 for global_mega_glove + // dedup_mode == LOCAL for local_dedup + // dedup_mode == GLOBAL for global_mega_glove for (int i = 0; i < nreacts; i++) { - if (dedup_mode == 0) local_rxn_count[i] = 0; - if (dedup_mode == 1) ghostly_rxn_count[i] = 0; + if (dedup_mode == LOCAL) local_rxn_count[i] = 0; + if (dedup_mode == GLOBAL) ghostly_rxn_count[i] = 0; } int dedup_size = 0; - if (dedup_mode == 0) { + if (dedup_mode == LOCAL) { dedup_size = local_num_mega; - } else if (dedup_mode == 1) { + } else if (dedup_mode == GLOBAL) { dedup_size = global_megasize; } tagint **dedup_glove; memory->create(dedup_glove,max_natoms+1,dedup_size,"bond/react:dedup_glove"); - if (dedup_mode == 0) { + if (dedup_mode == LOCAL) { for (int i = 0; i < dedup_size; i++) { for (int j = 0; j < max_natoms+1; j++) { dedup_glove[j][i] = local_mega_glove[j][i]; } } - } else if (dedup_mode == 1) { + } else if (dedup_mode == GLOBAL) { for (int i = 0; i < dedup_size; i++) { for (int j = 0; j < max_natoms+1; j++) { dedup_glove[j][i] = global_mega_glove[j][i]; @@ -2311,7 +2322,7 @@ void FixBondReact::dedup_mega_gloves(int dedup_mode) // we must update local_mega_glove and local_megasize // we can simply overwrite local_mega_glove column by column - if (dedup_mode == 0) { + if (dedup_mode == LOCAL) { int new_local_megasize = 0; for (int i = 0; i < local_num_mega; i++) { if (dedup_mask[i] == 0) { @@ -2328,7 +2339,7 @@ void FixBondReact::dedup_mega_gloves(int dedup_mode) // we must update global_mega_glove and global_megasize // we can simply overwrite global_mega_glove column by column - if (dedup_mode == 1) { + if (dedup_mode == GLOBAL) { int new_global_megasize = 0; for (int i = 0; i < global_megasize; i++) { if (dedup_mask[i] == 0) { @@ -2365,7 +2376,7 @@ void FixBondReact::limit_bond(int limit_bond_mode) int nlocal = atom->nlocal; int temp_limit_num = 0; tagint *temp_limit_glove; - if (limit_bond_mode == 0) { + if (limit_bond_mode == LOCAL) { int max_temp = local_num_mega * (max_natoms + 1); temp_limit_glove = new tagint[max_temp]; for (int j = 0; j < local_num_mega; j++) { @@ -2376,7 +2387,7 @@ void FixBondReact::limit_bond(int limit_bond_mode) } } - } else if (limit_bond_mode == 1) { + } else if (limit_bond_mode == GLOBAL) { int max_temp = global_megasize * (max_natoms + 1); temp_limit_glove = new tagint[max_temp]; for (int j = 0; j < global_megasize; j++) { @@ -2564,7 +2575,7 @@ void FixBondReact::ghost_glovecast() column, 0, world); } - if (me == 0) dedup_mega_gloves(1); // global_mega_glove mode + if (me == 0) dedup_mega_gloves(GLOBAL); // global_mega_glove mode MPI_Bcast(&global_megasize,1,MPI_INT,0,world); MPI_Bcast(&(global_mega_glove[0][0]), global_megasize, column, 0, world); @@ -2659,11 +2670,11 @@ void FixBondReact::update_everything() twomol = atom->molecules[reacted_mol[rxnID]]; for (int j = 0; j < twomol->natoms; j++) { int jj = equivalences[j][1][rxnID]-1; - if ((landlocked_atoms[j][rxnID] == 1 || custom_edges[jj][rxnID] == 1) && - atom->map(update_mega_glove[jj+1][i]) >= 0 && + if (atom->map(update_mega_glove[jj+1][i]) >= 0 && atom->map(update_mega_glove[jj+1][i]) < nlocal) { - type[atom->map(update_mega_glove[jj+1][i])] = twomol->type[j]; - if (twomol->qflag && atom->q_flag) { + if (landlocked_atoms[j][rxnID] == 1) + type[atom->map(update_mega_glove[jj+1][i])] = twomol->type[j]; + if (twomol->qflag && atom->q_flag && custom_charges[jj][rxnID] == 1) { double *q = atom->q; q[atom->map(update_mega_glove[jj+1][i])] = twomol->q[j]; } @@ -3150,7 +3161,7 @@ void FixBondReact::read(int myrxn) // skip 1st line of file eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Bond/react: Unexpected end of superimpose file"); + if (eof == nullptr) error->one(FLERR,"Bond/react: Unexpected end of superimpose file"); // read header lines // skip blank lines or lines that start with "#" @@ -3174,7 +3185,6 @@ void FixBondReact::read(int myrxn) error->one(FLERR,"Bond/react: Number of equivalences in map file must " "equal number of atoms in reaction templates"); } - else if (strstr(line,"customIDs")) sscanf(line,"%d",&ncustom); else if (strstr(line,"deleteIDs")) sscanf(line,"%d",&ndelete); else if (strstr(line,"createIDs")) sscanf(line,"%d",&ncreate); else if (strstr(line,"chiralIDs")) sscanf(line,"%d",&nchiral); @@ -3191,7 +3201,7 @@ void FixBondReact::read(int myrxn) // loop over sections of superimpose file - int equivflag = 0, bondflag = 0, customedgesflag = 0; + int equivflag = 0, bondflag = 0; while (strlen(keyword)) { if (strcmp(keyword,"BondingIDs") == 0) { bondflag = 1; @@ -3208,9 +3218,6 @@ void FixBondReact::read(int myrxn) } else if (strcmp(keyword,"Equivalences") == 0) { equivflag = 1; Equivalences(line, myrxn); - } else if (strcmp(keyword,"Custom Edges") == 0) { - customedgesflag = 1; - CustomEdges(line, myrxn); } else if (strcmp(keyword,"DeleteIDs") == 0) { DeleteAtoms(line, myrxn); } else if (strcmp(keyword,"CreateIDs") == 0) { @@ -3228,12 +3235,6 @@ void FixBondReact::read(int myrxn) // error check if (bondflag == 0 || equivflag == 0) error->all(FLERR,"Bond/react: Map file missing BondingIDs or Equivalences section\n"); - - if (update_edges_flag[myrxn] == 2 && customedgesflag == 0) - error->all(FLERR,"Bond/react: Map file must have a Custom Edges section when using 'update_edges custom'\n"); - - if (update_edges_flag[myrxn] != 2 && customedgesflag == 1) - error->all(FLERR,"Bond/react: Specify 'update_edges custom' to include Custom Edges section in map file\n"); } void FixBondReact::EdgeIDs(char *line, int myrxn) @@ -3268,28 +3269,6 @@ void FixBondReact::Equivalences(char *line, int myrxn) } } -void FixBondReact::CustomEdges(char *line, int myrxn) -{ - // 0 for 'none', 1 for 'charges' - - int tmp; - int n = MAX(strlen("none"),strlen("charges")) + 1; - char *edgemode = new char[n]; - for (int i = 0; i < ncustom; i++) { - readline(line); - sscanf(line,"%d %s",&tmp,edgemode); - if (tmp > onemol->natoms) - error->one(FLERR,"Bond/react: Invalid template atom ID in map file"); - if (strcmp(edgemode,"none") == 0) - custom_edges[tmp-1][myrxn] = 0; - else if (strcmp(edgemode,"charges") == 0) - custom_edges[tmp-1][myrxn] = 1; - else - error->one(FLERR,"Bond/react: Illegal value in 'Custom Edges' section of map file"); - } - delete [] edgemode; -} - void FixBondReact::DeleteAtoms(char *line, int myrxn) { int tmp; @@ -3312,6 +3291,15 @@ void FixBondReact::CreateAtoms(char *line, int myrxn) } } +void FixBondReact::CustomCharges(int ifragment, int myrxn) +{ + for (int i = 0; i < onemol->natoms; i++) + if (onemol->fragmentmask[ifragment][i]) + custom_charges[i][myrxn] = 1; + else + custom_charges[i][myrxn] = 0; +} + void FixBondReact::ChiralCenters(char *line, int myrxn) { int tmp; @@ -3435,7 +3423,7 @@ void FixBondReact::readID(char *strarg, int iconstr, int mode, int myID) void FixBondReact::open(char *file) { fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Bond/react: Cannot open map file %s",file); error->one(FLERR,str); @@ -3446,7 +3434,7 @@ void FixBondReact::readline(char *line) { int n; if (me == 0) { - if (fgets(line,MAXLINE,fp) == NULL) n = 0; + if (fgets(line,MAXLINE,fp) == nullptr) n = 0; else n = strlen(line) + 1; } MPI_Bcast(&n,1,MPI_INT,0,world); @@ -3463,11 +3451,11 @@ void FixBondReact::parse_keyword(int flag, char *line, char *keyword) int eof = 0; if (me == 0) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; while (eof == 0 && strspn(line," \t\n\r") == strlen(line)) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; } - if (fgets(keyword,MAXLINE,fp) == NULL) eof = 1; + if (fgets(keyword,MAXLINE,fp) == nullptr) eof = 1; } // if eof, set keyword empty and return @@ -3509,7 +3497,7 @@ int FixBondReact::parse(char *line, char **words, int max) int nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((ptr = strtok(NULL," \t\n\r\f"))) { + while ((ptr = strtok(nullptr," \t\n\r\f"))) { if (nwords < max) words[nwords] = ptr; nwords++; } diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h index 118770864f..2696d84768 100644 --- a/src/USER-REACTION/fix_bond_react.h +++ b/src/USER-REACTION/fix_bond_react.h @@ -80,10 +80,10 @@ class FixBondReact : public Fix { int max_natoms; // max natoms in a molecule template tagint *partner,*finalpartner; double **distsq,*probability; - int *ncreate; - int maxcreate; - int allncreate; - tagint ***created; + int *nattempt; + int maxattempt; + int allnattempt; + tagint ***attempt; class Molecule *onemol; // pre-reacted molecule template class Molecule *twomol; // post-reacted molecule template @@ -113,7 +113,7 @@ class FixBondReact : public Fix { int *ibonding,*jbonding; int *closeneigh; // indicates if bonding atoms of a rxn are 1-2, 1-3, or 1-4 neighbors - int nedge,nequivalent,ndelete,ncreate,nchiral,nconstr; // # edge, equivalent, custom atoms in mapping file + int nedge,nequivalent,ndelete,ncreate,nchiral,nconstr; // # edge, equivalent atoms in mapping file int attempted_rxn; // there was an attempt! int *local_rxn_count; int *ghostly_rxn_count; From 0236cabce99bc31b68b4fd2787c0feb2c810cb8c Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Mon, 21 Sep 2020 10:29:42 -0400 Subject: [PATCH 010/384] bond/react:add-modify-create-keyword --- src/USER-REACTION/fix_bond_react.cpp | 22 +++++++++++++++++++--- src/USER-REACTION/fix_bond_react.h | 1 + 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 995c3a53da..93cf55000a 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -205,6 +205,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : memory->create(limit_duration,nreacts,"bond/react:limit_duration"); memory->create(stabilize_steps_flag,nreacts,"bond/react:stabilize_steps_flag"); memory->create(custom_charges_fragid,nreacts,"bond/react:custom_charges_fragid"); + memory->create(modify_create_fragid,nreacts,"bond/react:modify_create_fragid"); memory->create(constraints,1,MAXCONARGS,"bond/react:constraints"); memory->create(var_flag,NUMVARVALS,nreacts,"bond/react:var_flag"); memory->create(var_id,NUMVARVALS,nreacts,"bond/react:var_id"); @@ -225,6 +226,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : max_rxn[i] = INT_MAX; stabilize_steps_flag[i] = 0; custom_charges_fragid[i] = -1; + modify_create_fragid[i] = -1; // set default limit duration to 60 timesteps limit_duration[i] = 60; reaction_count[i] = 0; @@ -380,6 +382,16 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : "'custom_charges' keyword does not exist"); } iarg += 2; + } else if (strcmp(arg[iarg],"modify_create") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: " + "'modify_create' has too few arguments"); + if (strcmp(arg[iarg+1],"no") == 0) modify_create_fragid[rxn] = -1; //default + else { + modify_create_fragid[rxn] = atom->molecules[unreacted_mol[rxn]]->findfragment(arg[iarg+1]); + if (modify_create_fragid[rxn] < 0) error->one(FLERR,"Bond/react: Molecule fragment for " + "'modify_create' keyword does not exist"); + } + iarg += 2; } else error->all(FLERR,"Illegal fix bond/react command: unknown keyword"); } } @@ -561,6 +573,7 @@ FixBondReact::~FixBondReact() memory->destroy(var_id); memory->destroy(stabilize_steps_flag); memory->destroy(custom_charges_fragid); + memory->destroy(modify_create_fragid); memory->destroy(iatomtype); memory->destroy(jatomtype); @@ -2605,8 +2618,7 @@ void FixBondReact::update_everything() // used when deleting atoms int ndel,ndelone; - int *mark = new int[nlocal]; - for (int i = 0; i < nlocal; i++) mark[i] = 0; + int *mark; tagint *tag = atom->tag; AtomVec *avec = atom->avec; @@ -2653,6 +2665,8 @@ void FixBondReact::update_everything() delete [] iskip; // mark to-delete atoms + mark = new int[nlocal]; + for (int i = 0; i < nlocal; i++) mark[i] = 0; for (int i = 0; i < update_num_mega; i++) { rxnID = update_mega_glove[0][i]; onemol = atom->molecules[unreacted_mol[rxnID]]; @@ -3150,6 +3164,8 @@ void FixBondReact::update_everything() atom->nimpropers += Tdelta_imprp; } + + /* ---------------------------------------------------------------------- read superimpose file ------------------------------------------------------------------------- */ @@ -3258,7 +3274,7 @@ void FixBondReact::Equivalences(char *line, int myrxn) for (int i = 0; i < nequivalent; i++) { readline(line); sscanf(line,"%d %d",&tmp1,&tmp2); - if (tmp1 > onemol->natoms || tmp2 > onemol->natoms) + if (tmp1 > onemol->natoms || tmp2 > twomol->natoms) error->one(FLERR,"Bond/react: Invalid template atom ID in map file"); //equivalences is-> clmn 1: post-reacted, clmn 2: pre-reacted equivalences[tmp2-1][0][myrxn] = tmp2; diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h index 2696d84768..506a98c4ec 100644 --- a/src/USER-REACTION/fix_bond_react.h +++ b/src/USER-REACTION/fix_bond_react.h @@ -65,6 +65,7 @@ class FixBondReact : public Fix { int custom_exclude_flag; int *stabilize_steps_flag; int *custom_charges_fragid; + int *modify_create_fragid; int nconstraints; int narrhenius; double **constraints; From ede28cc1bfae3cde696243c08d557afdfd22878d Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Mon, 21 Sep 2020 12:01:40 -0400 Subject: [PATCH 011/384] bond/react:modify-create-correction --- src/USER-REACTION/fix_bond_react.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 93cf55000a..194f548632 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -387,7 +387,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : "'modify_create' has too few arguments"); if (strcmp(arg[iarg+1],"no") == 0) modify_create_fragid[rxn] = -1; //default else { - modify_create_fragid[rxn] = atom->molecules[unreacted_mol[rxn]]->findfragment(arg[iarg+1]); + modify_create_fragid[rxn] = atom->molecules[reacted_mol[rxn]]->findfragment(arg[iarg+1]); if (modify_create_fragid[rxn] < 0) error->one(FLERR,"Bond/react: Molecule fragment for " "'modify_create' keyword does not exist"); } From 0b903fa7c2722a615cb90aeba9ca251b89bab7c9 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Mon, 21 Sep 2020 14:53:30 -0400 Subject: [PATCH 012/384] bond/react: create-atoms-draft-docs --- doc/src/fix_bond_react.rst | 81 +++++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 31 deletions(-) diff --git a/doc/src/fix_bond_react.rst b/doc/src/fix_bond_react.rst index 159e39d075..587ed29980 100644 --- a/doc/src/fix_bond_react.rst +++ b/doc/src/fix_bond_react.rst @@ -55,6 +55,9 @@ Syntax *custom_charges* value = *no* or *fragmentID* no = update all atomic charges (default) fragmentID = ID of molecule fragment whose charges are updated + *modify_create* value = *no* or *fragmentID* + no = use all eligible atoms for create-atoms fit (default) + fragmentID = ID of molecule fragment used for create-atoms fit Examples """""""" @@ -85,7 +88,9 @@ documentation. Topology changes are defined in pre- and post-reaction molecule templates and can include creation and deletion of bonds, angles, dihedrals, impropers, bond types, angle types, dihedral types, atom types, or atomic charges. In addition, reaction by-products or -other molecules can be identified and deleted. +other molecules can be identified and deleted. Finally, atoms can be +created and inserted at specific positions relative to the reaction +site. Fix bond/react does not use quantum mechanical (eg. fix qmmm) or pairwise bond-order potential (eg. Tersoff or AIREBO) methods to @@ -249,14 +254,14 @@ command page. The post-reacted molecule template contains a sample of the reaction site and its surrounding topology after the reaction has occurred. It -must contain the same number of atoms as the pre-reacted template. A -one-to-one correspondence between the atom IDs in the pre- and -post-reacted templates is specified in the map file as described -below. Note that during a reaction, an atom, bond, etc. type may -change to one that was previously not present in the simulation. These -new types must also be defined during the setup of a given simulation. -A discussion of correctly handling this is also provided on the -:doc:`molecule ` command page. +must contain the same number of atoms as the pre-reacted template +(unless there are created atoms). A one-to-one correspondence between +the atom IDs in the pre- and post-reacted templates is specified in +the map file as described below. Note that during a reaction, an atom, +bond, etc. type may change to one that was previously not present in +the simulation. These new types must also be defined during the setup +of a given simulation. A discussion of correctly handling this is also +provided on the :doc:`molecule ` command page. .. note:: @@ -270,7 +275,7 @@ A discussion of correctly handling this is also provided on the The map file is a text document with the following format: A map file has a header and a body. The header of map file the -contains one mandatory keyword and four optional keywords. The +contains one mandatory keyword and five optional keywords. The mandatory keyword is 'equivalences': .. parsed-literal:: @@ -283,11 +288,12 @@ The optional keywords are 'edgeIDs', 'deleteIDs', 'chiralIDs' and .. parsed-literal:: N *edgeIDs* = # of edge atoms N in the pre-reacted molecule template - N *deleteIDs* = # of atoms N that are specified for deletion - N *chiralIDs* = # of specified chiral centers N - N *constraints* = # of specified reaction constraints N + N *deleteIDs* = # of atoms N that are deleted + N *createIDs* = # of atoms N that are created + N *chiralIDs* = # of chiral centers N + N *constraints* = # of reaction constraints N -The body of the map file contains two mandatory sections and four +The body of the map file contains two mandatory sections and five optional sections. The first mandatory section begins with the keyword 'BondingIDs' and lists the atom IDs of the bonding atom pair in the pre-reacted molecule template. The second mandatory section begins @@ -299,13 +305,15 @@ molecule template. The first optional section begins with the keyword 'EdgeIDs' and lists the atom IDs of edge atoms in the pre-reacted molecule template. The second optional section begins with the keyword 'DeleteIDs' and lists the atom IDs of pre-reaction template atoms to -delete. The third optional section begins with the keyword 'ChiralIDs' -lists the atom IDs of chiral atoms whose handedness should be -enforced. The fourth optional section begins with the keyword -'Constraints' and lists additional criteria that must be satisfied in -order for the reaction to occur. Currently, there are five types of -constraints available, as discussed below: 'distance', 'angle', -'dihedral', 'arrhenius', and 'rmsd'. +delete. The third optional section begins with the keyword 'CreateIDs' +and lists the atom IDs of the post-reaction template atoms to create. +The fourth optional section begins with the keyword 'ChiralIDs' lists +the atom IDs of chiral atoms whose handedness should be enforced. The +fifth optional section begins with the keyword 'Constraints' and lists +additional criteria that must be satisfied in order for the reaction +to occur. Currently, there are five types of constraints available, as +discussed below: 'distance', 'angle', 'dihedral', 'arrhenius', and +'rmsd'. A sample map file is given below: @@ -340,6 +348,26 @@ A sample map file is given below: ---------- +A user-specified set of atoms can be deleted by listing their +pre-reaction template IDs in the DeleteIDs section. A deleted atom +must still be included in the post-reaction molecule template, in +which it cannot be bonded to an atom that is not deleted. In addition +to deleting unwanted reaction by-products, this feature can be used to +remove specific topologies, such as small rings, that may be otherwise +indistinguishable. + +Atoms can be created by listing their post-reaction template IDs in +the CreateIDs section. A created atom should not be included in the +pre-reaction template. The inserted positions of created atoms are +determined by the coordinates of the post-reaction template, after +optimal translation and rotation of the post-reaction template to the +reaction site (using a fit with atoms that are neither created nor +deleted). Or, the *modify_create* keyword can be used to specify which +post-reaction atoms are used for this fit. The *fragmentID* value must +be the name of a molecule fragment defined in the post-reaction +:doc:`molecule ` template, and only atoms in this fragment +are used for the fit. + The handedness of atoms that are chiral centers can be enforced by listing their IDs in the ChiralIDs section. A chiral atom must be bonded to four atoms with mutually different atom types. This feature @@ -490,15 +518,6 @@ only the atomic charges of atoms in the molecule fragment are updated. A few other considerations: -Many reactions result in one or more atoms that are considered -unwanted by-products. Therefore, bond/react provides the option to -delete a user-specified set of atoms. These pre-reaction atoms are -identified in the map file. A deleted atom must still be included in -the post-reaction molecule template, in which it cannot be bonded to -an atom that is not deleted. In addition to deleting unwanted reaction -by-products, this feature can be used to remove specific topologies, -such as small rings, that may be otherwise indistinguishable. - Optionally, you can enforce additional behaviors on reacting atoms. For example, it may be beneficial to force reacting atoms to remain at a certain temperature. For this, you can use the internally-created @@ -572,7 +591,7 @@ Default """"""" The option defaults are stabilization = no, prob = 1.0, stabilize_steps = 60, -reset_mol_ids = yes, custom_charges = no +reset_mol_ids = yes, custom_charges = no, modify_create = no ---------- From 61c51847c2ce363bfceecc8525f2fab48105fdfd Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Fri, 2 Oct 2020 20:53:27 -0400 Subject: [PATCH 013/384] bond/react: basic create atoms feature --- src/USER-REACTION/fix_bond_react.cpp | 295 +++++++++++++++++++++++++-- src/USER-REACTION/fix_bond_react.h | 3 +- 2 files changed, 276 insertions(+), 22 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 194f548632..c824e2ae86 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -205,6 +205,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : memory->create(limit_duration,nreacts,"bond/react:limit_duration"); memory->create(stabilize_steps_flag,nreacts,"bond/react:stabilize_steps_flag"); memory->create(custom_charges_fragid,nreacts,"bond/react:custom_charges_fragid"); + memory->create(create_atoms_flag,nreacts,"bond/react:create_atoms_flag"); memory->create(modify_create_fragid,nreacts,"bond/react:modify_create_fragid"); memory->create(constraints,1,MAXCONARGS,"bond/react:constraints"); memory->create(var_flag,NUMVARVALS,nreacts,"bond/react:var_flag"); @@ -226,6 +227,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : max_rxn[i] = INT_MAX; stabilize_steps_flag[i] = 0; custom_charges_fragid[i] = -1; + create_atoms_flag[i] = 0; modify_create_fragid[i] = -1; // set default limit duration to 60 timesteps limit_duration[i] = 60; @@ -573,6 +575,7 @@ FixBondReact::~FixBondReact() memory->destroy(var_id); memory->destroy(stabilize_steps_flag); memory->destroy(custom_charges_fragid); + memory->destroy(create_atoms_flag); memory->destroy(modify_create_fragid); memory->destroy(iatomtype); @@ -1387,6 +1390,13 @@ void FixBondReact::superimpose_algorithm() } } + // abort here, for processes that have no reactions + // only MPI in get_everything is for create_atoms, which are always in global_megasize + if (local_num_mega == 0 && global_megasize == 0) { + unlimit_bond(); + return; + } + // this updates topology next step next_reneighbor = update->ntimestep; @@ -2496,11 +2506,15 @@ void FixBondReact::glove_ghostcheck() int ghostly = 0; #if !defined(MPI_STUBS) if (comm->style == 0) { - for (int i = 0; i < onemol->natoms; i++) { - int ilocal = atom->map(glove[i][1]); - if (ilocal >= atom->nlocal || localsendlist[ilocal] == 1) { - ghostly = 1; - break; + if (create_atoms_flag[rxnID] == 1) { + ghostly = 1; + } else { + for (int i = 0; i < onemol->natoms; i++) { + int ilocal = atom->map(glove[i][1]); + if (ilocal >= atom->nlocal || localsendlist[ilocal] == 1) { + ghostly = 1; + break; + } } } } else { @@ -2663,6 +2677,22 @@ void FixBondReact::update_everything() } } delete [] iskip; + if (update_num_mega == 0) continue; + + // we can insert atoms here, now that reactions are finalized + // can't do it any earlier, due to skipped reactions (max_rxn) + // reactions that create atoms are always treated as 'global' + if (pass == 1) { + for (int i = 0; i < update_num_mega; i++) { + rxnID = update_mega_glove[0][i]; + if (create_atoms_flag[rxnID] == 1) { + onemol = atom->molecules[unreacted_mol[rxnID]]; + twomol = atom->molecules[reacted_mol[rxnID]]; + insert_atoms(update_mega_glove,i); + nlocal = atom->nlocal; + } + } + } // mark to-delete atoms mark = new int[nlocal]; @@ -2698,22 +2728,24 @@ void FixBondReact::update_everything() //maybe add check that all 1-3 neighbors of a local atoms are at least ghosts -> unneeded --jg //okay, here goes: - for (int i = 0; i < update_num_mega; i++) { - rxnID = update_mega_glove[0][i]; - twomol = atom->molecules[reacted_mol[rxnID]]; - for (int j = 0; j < twomol->natoms; j++) { - int jj = equivalences[j][1][rxnID]-1; - if (atom->map(update_mega_glove[jj+1][i]) < nlocal && atom->map(update_mega_glove[jj+1][i]) >= 0) { - if (landlocked_atoms[j][rxnID] == 1) { - for (int k = 0; k < nspecial[atom->map(update_mega_glove[jj+1][i])][2]; k++) { - if (atom->map(special[atom->map(update_mega_glove[jj+1][i])][k]) < 0) { - error->all(FLERR,"Bond/react: Fix bond/react needs ghost atoms from further away - most likely too many processors"); - } - } - } - } - } - } + //for (int i = 0; i < update_num_mega; i++) { + // rxnID = update_mega_glove[0][i]; + // twomol = atom->molecules[reacted_mol[rxnID]]; + // for (int j = 0; j < twomol->natoms; j++) { + // int jj = equivalences[j][1][rxnID]-1; + // int jlocal = atom->map(update_mega_glove[jj+1][i]); + // if (jlocal < nlocal && jlocal >= 0) { + // if (landlocked_atoms[j][rxnID] == 1) { + // for (int k = 0; k < nspecial[jlocal][2]; k++) { + // if (atom->map(special[jlocal][k]) < 0 && create_atoms[j][rxnID] == 0) { + // //error->all(FLERR,"Bond/react: Fix bond/react needs ghost atoms from further away - most likely too many processors"); + // printf("local is %d other is %d on %d\n", update_mega_glove[jj+1][i],special[jlocal][k],me); + // } + // } + // } + // } + // } + //} int insert_num; // very nice and easy to completely overwrite special bond info for landlocked atoms @@ -3164,7 +3196,227 @@ void FixBondReact::update_everything() atom->nimpropers += Tdelta_imprp; } +/* ---------------------------------------------------------------------- +insert created atoms +------------------------------------------------------------------------- */ +void FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) +{ + // inserting atoms based off fix_deposit->pre_exchange + int flag; + imageint imageflag; + double coord[3],lamda[3],rotmat[3][3],vnew[3]; + double *newcoord; + + // clear ghost count and any ghost bonus data internal to AtomVec + // same logic as beginning of Comm::exchange() + // do it now b/c inserting atoms will overwrite ghost atoms + atom->nghost = 0; + atom->avec->clear_bonus(); + + double *sublo,*subhi; + if (domain->triclinic == 0) { + sublo = domain->sublo; + subhi = domain->subhi; + } else { + sublo = domain->sublo_lamda; + subhi = domain->subhi_lamda; + } + + // find current max atom and molecule IDs + tagint *tag = atom->tag; + double **x = atom->x; + tagint *molecule = atom->molecule; + int nlocal = atom->nlocal; + + tagint maxtag_all,maxmol_all; + tagint max = 0; + for (int i = 0; i < nlocal; i++) max = MAX(max,tag[i]); + MPI_Allreduce(&max,&maxtag_all,1,MPI_LMP_TAGINT,MPI_MAX,world); + + max = 0; + for (int i = 0; i < nlocal; i++) max = MAX(max,molecule[i]); + MPI_Allreduce(&max,&maxmol_all,1,MPI_LMP_TAGINT,MPI_MAX,world); + + int dimension = domain->dimension; + + // only proc that owns reacting atom (use ibonding), + // fits post-reaction template to reaction site, for creating atoms + int n2superpose = 0; + for (int j = 0; j < twomol->natoms; j++) { + if (modify_create_fragid[rxnID] >= 0) + if (!twomol->fragmentmask[modify_create_fragid[rxnID]][j]) continue; + if (!create_atoms[j][rxnID] && !delete_atoms[equivalences[j][1][rxnID]][rxnID]) + n2superpose++; + } + + int ifit = atom->map(my_mega_glove[ibonding[rxnID]+1][iupdate]); // use this local ID to find fitting proc + Superpose3D superposer(n2superpose); + if (ifit >= 0 && ifit < atom->nlocal) { + double **xfrozen; // coordinates for the "frozen" target molecule + double **xmobile; // coordinates for the "mobile" molecule + memory->create(xfrozen,n2superpose,3,"bond/react:xfrozen"); + memory->create(xmobile,n2superpose,3,"bond/react:xmobile"); + tagint iatom; + tagint iref = -1; // choose first atom as reference + int fit_incr = 0; + for (int j = 0; j < twomol->natoms; j++) { + if (modify_create_fragid[rxnID] >= 0) + if (!twomol->fragmentmask[modify_create_fragid[rxnID]][j]) continue; + int ipre = equivalences[j][1][rxnID]-1; // equiv pre-reaction template index + if (!create_atoms[j][rxnID] && !delete_atoms[ipre][rxnID]) { + if (atom->map(my_mega_glove[ipre+1][iupdate]) < 0) { + printf("WARNING: eligible atoms skipped for created-atoms fit on %d\n",me); + continue; + } + iatom = atom->map(my_mega_glove[ipre+1][iupdate]); + if (iref == -1) iref = iatom; + iatom = domain->closest_image(iref,iatom); + for (int k = 0; k < 3; k++) { + xfrozen[fit_incr][k] = x[iatom][k]; + xmobile[fit_incr][k] = twomol->x[j][k]; + } + fit_incr++; + } + } + double rmsd = superposer.Superpose(xfrozen, xmobile); + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3; j++) + rotmat[i][j] = superposer.R[i][j]; + memory->destroy(xfrozen); + memory->destroy(xmobile); + } + + // choose random velocity for new particle + // used for every atom in molecule + //currently insert with zero velocities + //vnew[0] = vxlo + random->uniform() * (vxhi-vxlo); + //vnew[1] = vylo + random->uniform() * (vyhi-vylo); + //vnew[2] = vzlo + random->uniform() * (vzhi-vzlo); + + // check if new atoms are in my sub-box or above it if I am highest proc + // if so, add atom to my list via create_atom() + // initialize additional info about the atoms + // set group mask to "all" plus fix group + int preID; // new equivalences index + int root = 0; + int add_count = 0; + for (int m = 0; m < twomol->natoms; m++) { + if (create_atoms[m][rxnID] == 1) { + // increase atom count + add_count++; + preID = onemol->natoms+add_count; + + // apply optimal rotation/translation for created atom coords + // also map coords back into simulation box + root = 0; + if (ifit >= 0 && ifit < atom->nlocal) { + root = me; + MathExtra::matvec(rotmat,twomol->x[m],coord); + for (int i = 0; i < 3; i++) coord[i] += superposer.T[i]; + imageflag = ((imageint) IMGMAX << IMG2BITS) | + ((imageint) IMGMAX << IMGBITS) | IMGMAX; + domain->remap(coord,imageflag); + } + MPI_Allreduce(MPI_IN_PLACE,&root,1,MPI_INT,MPI_SUM,world); + MPI_Bcast(coord,3,MPI_DOUBLE,root,world); + + if (domain->triclinic) { + domain->x2lamda(coord,lamda); + newcoord = lamda; + } else newcoord = coord; + + flag = 0; + if (newcoord[0] >= sublo[0] && newcoord[0] < subhi[0] && + newcoord[1] >= sublo[1] && newcoord[1] < subhi[1] && + newcoord[2] >= sublo[2] && newcoord[2] < subhi[2]) flag = 1; + else if (dimension == 3 && newcoord[2] >= domain->boxhi[2]) { + if (comm->layout != Comm::LAYOUT_TILED) { + if (comm->myloc[2] == comm->procgrid[2]-1 && + newcoord[0] >= sublo[0] && newcoord[0] < subhi[0] && + newcoord[1] >= sublo[1] && newcoord[1] < subhi[1]) flag = 1; + } else { + if (comm->mysplit[2][1] == 1.0 && + newcoord[0] >= sublo[0] && newcoord[0] < subhi[0] && + newcoord[1] >= sublo[1] && newcoord[1] < subhi[1]) flag = 1; + } + } else if (dimension == 2 && newcoord[1] >= domain->boxhi[1]) { + if (comm->layout != Comm::LAYOUT_TILED) { + if (comm->myloc[1] == comm->procgrid[1]-1 && + newcoord[0] >= sublo[0] && newcoord[0] < subhi[0]) flag = 1; + } else { + if (comm->mysplit[1][1] == 1.0 && + newcoord[0] >= sublo[0] && newcoord[0] < subhi[0]) flag = 1; + } + } + root = 0; + if (flag) { + root = me; + + atom->avec->create_atom(twomol->type[m],coord); + int n = atom->nlocal - 1; + atom->tag[n] = maxtag_all + add_count; + + // locally update mega_glove + my_mega_glove[preID][iupdate] = atom->tag[n]; + + if (atom->molecule_flag) atom->molecule[n] = maxmol_all+1; + if (atom->molecular == 2) { + atom->molindex[n] = 0; + atom->molatom[n] = m; + } + + atom->mask[n] = 1 | groupbit; + atom->image[n] = imageflag; + atom->v[n][0] = 0.01;//vnew[0]; + atom->v[n][1] = 0.01;//vnew[1]; + atom->v[n][2] = 0.01;//vnew[2]; + modify->create_attribute(n); + + // initialize group statuses + // why aren't these more global... + int flag; + int index1 = atom->find_custom("limit_tags",flag); + int *i_limit_tags = atom->ivector[index1]; + + int *i_statted_tags; + if (stabilization_flag == 1) { + int index2 = atom->find_custom(statted_id,flag); + i_statted_tags = atom->ivector[index2]; + } + + int index3 = atom->find_custom("react_tags",flag); + int *i_react_tags = atom->ivector[index3]; + + i_limit_tags[n] = update->ntimestep + 1; + if (stabilization_flag == 1) i_statted_tags[n] = 0; + i_react_tags[n] = rxnID; + } + // globally update mega_glove and equivalences + MPI_Allreduce(MPI_IN_PLACE,&root,1,MPI_INT,MPI_SUM,world); + MPI_Bcast(&my_mega_glove[preID][iupdate],1,MPI_LMP_TAGINT,root,world); + equivalences[m][0][rxnID] = m+1; + equivalences[m][1][rxnID] = preID; + reverse_equiv[preID-1][0][rxnID] = preID; + reverse_equiv[preID-1][1][rxnID] = m+1; + } + } + + // reset global natoms + // if global map exists, reset it now instead of waiting for comm + // since other pre-exchange fixes may use it + // invoke map_init() b/c atom count has grown + atom->natoms += add_count; + if (atom->natoms < 0) + error->all(FLERR,"Too many total atoms"); + maxtag_all += add_count; + if (maxtag_all >= MAXTAGINT) + error->all(FLERR,"New atom IDs exceed maximum allowed ID"); + if (atom->map_style != Atom::MAP_NONE) { + atom->map_init(); + atom->map_set(); + } +} /* ---------------------------------------------------------------------- read superimpose file @@ -3299,6 +3551,7 @@ void FixBondReact::DeleteAtoms(char *line, int myrxn) void FixBondReact::CreateAtoms(char *line, int myrxn) { + create_atoms_flag[myrxn] = 1; int tmp; for (int i = 0; i < ncreate; i++) { readline(line); diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h index 506a98c4ec..e33d14f7d6 100644 --- a/src/USER-REACTION/fix_bond_react.h +++ b/src/USER-REACTION/fix_bond_react.h @@ -65,6 +65,7 @@ class FixBondReact : public Fix { int custom_exclude_flag; int *stabilize_steps_flag; int *custom_charges_fragid; + int *create_atoms_flag; int *modify_create_fragid; int nconstraints; int narrhenius; @@ -184,7 +185,7 @@ class FixBondReact : public Fix { void glove_ghostcheck(); void ghost_glovecast(); void update_everything(); - void insert_atoms(int, tagint **, int); + void insert_atoms(tagint **, int); void unlimit_bond(); void limit_bond(int); void dedup_mega_gloves(int); //dedup global mega_glove From 8d0d7f4f559e8a62b1ff748a7884622d0597e602 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Mon, 5 Oct 2020 21:53:38 -0400 Subject: [PATCH 014/384] Fix testers after API change --- unittest/force-styles/test_dihedral_style.cpp | 2 +- unittest/force-styles/test_improper_style.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unittest/force-styles/test_dihedral_style.cpp b/unittest/force-styles/test_dihedral_style.cpp index f0c4a1974c..82c20afcea 100644 --- a/unittest/force-styles/test_dihedral_style.cpp +++ b/unittest/force-styles/test_dihedral_style.cpp @@ -251,7 +251,7 @@ void generate_yaml_file(const char *outfile, const TestConfig &config) YamlWriter writer(outfile); // lammps_version - writer.emit("lammps_version", lmp->universe->version); + writer.emit("lammps_version", lmp->version); // date_generated std::time_t now = time(NULL); diff --git a/unittest/force-styles/test_improper_style.cpp b/unittest/force-styles/test_improper_style.cpp index bbc69af791..596187b9a6 100644 --- a/unittest/force-styles/test_improper_style.cpp +++ b/unittest/force-styles/test_improper_style.cpp @@ -251,7 +251,7 @@ void generate_yaml_file(const char *outfile, const TestConfig &config) YamlWriter writer(outfile); // lammps_version - writer.emit("lammps_version", lmp->universe->version); + writer.emit("lammps_version", lmp->version); // date_generated std::time_t now = time(NULL); From ccb7a6ee11182c8727fa4d28ba3f22bf68367864 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Mon, 5 Oct 2020 23:16:46 -0400 Subject: [PATCH 015/384] remove unnecessary check because it breaks create_atoms feature --- src/USER-REACTION/fix_bond_react.cpp | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index c824e2ae86..db629d8bee 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -2726,27 +2726,6 @@ void FixBondReact::update_everything() } } - //maybe add check that all 1-3 neighbors of a local atoms are at least ghosts -> unneeded --jg - //okay, here goes: - //for (int i = 0; i < update_num_mega; i++) { - // rxnID = update_mega_glove[0][i]; - // twomol = atom->molecules[reacted_mol[rxnID]]; - // for (int j = 0; j < twomol->natoms; j++) { - // int jj = equivalences[j][1][rxnID]-1; - // int jlocal = atom->map(update_mega_glove[jj+1][i]); - // if (jlocal < nlocal && jlocal >= 0) { - // if (landlocked_atoms[j][rxnID] == 1) { - // for (int k = 0; k < nspecial[jlocal][2]; k++) { - // if (atom->map(special[jlocal][k]) < 0 && create_atoms[j][rxnID] == 0) { - // //error->all(FLERR,"Bond/react: Fix bond/react needs ghost atoms from further away - most likely too many processors"); - // printf("local is %d other is %d on %d\n", update_mega_glove[jj+1][i],special[jlocal][k],me); - // } - // } - // } - // } - // } - //} - int insert_num; // very nice and easy to completely overwrite special bond info for landlocked atoms for (int i = 0; i < update_num_mega; i++) { From d5c6007797cf76bc3643c78880ae0daf3098fb49 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Sun, 25 Oct 2020 17:19:03 -0400 Subject: [PATCH 016/384] bond/react: revert some overzealous optimization could cause hang --- src/USER-REACTION/fix_bond_react.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index f2fb3d4f92..1b0c4a9be7 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -1390,13 +1390,6 @@ void FixBondReact::superimpose_algorithm() } } - // abort here, for processes that have no reactions - // only MPI in get_everything is for create_atoms, which are always in global_megasize - if (local_num_mega == 0 && global_megasize == 0) { - unlimit_bond(); - return; - } - // this updates topology next step next_reneighbor = update->ntimestep; @@ -2687,7 +2680,6 @@ void FixBondReact::update_everything() } } delete [] iskip; - if (update_num_mega == 0) continue; // we can insert atoms here, now that reactions are finalized // can't do it any earlier, due to skipped reactions (max_rxn) From b8d2b65d8dd77ad01c0fd4cc3ad36b99d9af7af3 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Sun, 25 Oct 2020 18:56:00 -0400 Subject: [PATCH 017/384] bond/react: generalize get_temperature --- src/USER-REACTION/fix_bond_react.cpp | 8 ++++---- src/USER-REACTION/fix_bond_react.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 1b0c4a9be7..8b6c1317af 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -1886,7 +1886,7 @@ int FixBondReact::check_constraints() } if (ANDgate != 1) return 0; } else if (constraints[i][1] == ARRHENIUS) { - t = get_temperature(); + t = get_temperature(glove,0,1); prrhob = constraints[i][3]*pow(t,constraints[i][4])* exp(-constraints[i][5]/(force->boltz*t)); if (prrhob < rrhandom[(int) constraints[i][2]]->uniform()) return 0; @@ -2007,7 +2007,7 @@ void FixBondReact::get_IDcoords(int mode, int myID, double *center) compute local temperature: average over all atoms in reaction template ------------------------------------------------------------------------- */ -double FixBondReact::get_temperature() +double FixBondReact::get_temperature(tagint **myglove, int row_offset, int col) { int i,ilocal; double adof = domain->dimension; @@ -2021,13 +2021,13 @@ double FixBondReact::get_temperature() if (rmass) { for (i = 0; i < onemol->natoms; i++) { - ilocal = atom->map(glove[i][1]); + ilocal = atom->map(myglove[i+row_offset][col]); t += (v[ilocal][0]*v[ilocal][0] + v[ilocal][1]*v[ilocal][1] + v[ilocal][2]*v[ilocal][2]) * rmass[ilocal]; } } else { for (i = 0; i < onemol->natoms; i++) { - ilocal = atom->map(glove[i][1]); + ilocal = atom->map(myglove[i+row_offset][col]); t += (v[ilocal][0]*v[ilocal][0] + v[ilocal][1]*v[ilocal][1] + v[ilocal][2]*v[ilocal][2]) * mass[type[ilocal]]; } diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h index e33d14f7d6..d8ff4154e3 100644 --- a/src/USER-REACTION/fix_bond_react.h +++ b/src/USER-REACTION/fix_bond_react.h @@ -169,7 +169,7 @@ class FixBondReact : public Fix { void ring_check(); int check_constraints(); void get_IDcoords(int, int, double *); - double get_temperature(); + double get_temperature(tagint **, int, int); int get_chirality(double[12]); // get handedness given an ordered set of coordinates void open(char *); From 4b111d7c43752ca2abc53828c263749b40c0e4e5 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Sun, 25 Oct 2020 20:57:46 -0400 Subject: [PATCH 018/384] bond/react:better initial vels for created atoms --- src/USER-REACTION/fix_bond_react.cpp | 34 +++++++++++++++++++--------- src/USER-REACTION/fix_bond_react.h | 0 2 files changed, 23 insertions(+), 11 deletions(-) mode change 100644 => 100755 src/USER-REACTION/fix_bond_react.cpp mode change 100644 => 100755 src/USER-REACTION/fix_bond_react.h diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp old mode 100644 new mode 100755 index 8b6c1317af..3a5f91177b --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -3188,6 +3188,8 @@ void FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) imageint imageflag; double coord[3],lamda[3],rotmat[3][3],vnew[3]; double *newcoord; + double **v = atom->v; + double t; // clear ghost count and any ghost bonus data internal to AtomVec // same logic as beginning of Comm::exchange() @@ -3233,7 +3235,13 @@ void FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) int ifit = atom->map(my_mega_glove[ibonding[rxnID]+1][iupdate]); // use this local ID to find fitting proc Superpose3D superposer(n2superpose); + int root = 0; if (ifit >= 0 && ifit < atom->nlocal) { + root = me; + + // get 'temperatere' averaged over site, used for created atoms' vels + t = get_temperature(my_mega_glove,1,iupdate); + double **xfrozen; // coordinates for the "frozen" target molecule double **xmobile; // coordinates for the "mobile" molecule memory->create(xfrozen,n2superpose,3,"bond/react:xfrozen"); @@ -3267,20 +3275,15 @@ void FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) memory->destroy(xfrozen); memory->destroy(xmobile); } - - // choose random velocity for new particle - // used for every atom in molecule - //currently insert with zero velocities - //vnew[0] = vxlo + random->uniform() * (vxhi-vxlo); - //vnew[1] = vylo + random->uniform() * (vyhi-vylo); - //vnew[2] = vzlo + random->uniform() * (vzhi-vzlo); + MPI_Allreduce(MPI_IN_PLACE,&root,1,MPI_INT,MPI_SUM,world); + MPI_Bcast(&t,1,MPI_DOUBLE,root,world); // check if new atoms are in my sub-box or above it if I am highest proc // if so, add atom to my list via create_atom() // initialize additional info about the atoms // set group mask to "all" plus fix group int preID; // new equivalences index - int root = 0; + root = 0; int add_count = 0; for (int m = 0; m < twomol->natoms; m++) { if (create_atoms[m][rxnID] == 1) { @@ -3349,9 +3352,18 @@ void FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) atom->mask[n] = 1 | groupbit; atom->image[n] = imageflag; - atom->v[n][0] = 0.01;//vnew[0]; - atom->v[n][1] = 0.01;//vnew[1]; - atom->v[n][2] = 0.01;//vnew[2]; + + // guess a somewhat reasonable initial velocity based on reaction site + // further control is possible using bond_react_MASTER_group + // compute |velocity| corresponding to a given temperature t, using specific atom's mass + double vtnorm = sqrt(t / (force->mvv2e / (dimension * force->boltz)) / atom->mass[twomol->type[m]]); + v[n][0] = random[rxnID]->uniform(); + v[n][1] = random[rxnID]->uniform(); + v[n][2] = random[rxnID]->uniform(); + double vnorm = sqrt(v[n][0]*v[n][0] + v[n][1]*v[n][1] + v[n][2]*v[n][2]); + v[n][0] = v[n][0]/vnorm*vtnorm; + v[n][1] = v[n][1]/vnorm*vtnorm; + v[n][2] = v[n][2]/vnorm*vtnorm; modify->create_attribute(n); // initialize group statuses diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h old mode 100644 new mode 100755 From 254963cddd7515441dbca7f93eef81437dbf9ed5 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Sun, 25 Oct 2020 21:16:04 -0400 Subject: [PATCH 019/384] Update fix_bond_react.rst --- doc/src/fix_bond_react.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 doc/src/fix_bond_react.rst diff --git a/doc/src/fix_bond_react.rst b/doc/src/fix_bond_react.rst old mode 100644 new mode 100755 index 587ed29980..cd40828e7d --- a/doc/src/fix_bond_react.rst +++ b/doc/src/fix_bond_react.rst @@ -366,7 +366,9 @@ deleted). Or, the *modify_create* keyword can be used to specify which post-reaction atoms are used for this fit. The *fragmentID* value must be the name of a molecule fragment defined in the post-reaction :doc:`molecule ` template, and only atoms in this fragment -are used for the fit. +are used for the fit. The velocity of each created atom is initialized +in a random direction with a magnitude calculated from the +instantaneous temperature of the reaction site. The handedness of atoms that are chiral centers can be enforced by listing their IDs in the ChiralIDs section. A chiral atom must be From 4435ed4870666822cfe9c3766e431edb0589d4c5 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Thu, 29 Oct 2020 23:08:10 -0400 Subject: [PATCH 020/384] bond/react:example for create_atoms feature builds a polysytrene 50-mer in vacuum --- .../8procs_out.lammps | 4137 +++++++++++++++++ .../chain_plus_styrene_map_create_atoms | 66 + .../chain_plus_styrene_reacted.data_template | 456 ++ ...yrene_unreacted_create_atoms.data_template | 294 ++ .../infromdata.class2 | 49 + .../polystyrene_create_atoms/trimer.data | 797 ++++ 6 files changed, 5799 insertions(+) create mode 100644 examples/USER/reaction/polystyrene_create_atoms/8procs_out.lammps create mode 100644 examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_map_create_atoms create mode 100755 examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_reacted.data_template create mode 100644 examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_unreacted_create_atoms.data_template create mode 100755 examples/USER/reaction/polystyrene_create_atoms/infromdata.class2 create mode 100644 examples/USER/reaction/polystyrene_create_atoms/trimer.data diff --git a/examples/USER/reaction/polystyrene_create_atoms/8procs_out.lammps b/examples/USER/reaction/polystyrene_create_atoms/8procs_out.lammps new file mode 100644 index 0000000000..953a32394a --- /dev/null +++ b/examples/USER/reaction/polystyrene_create_atoms/8procs_out.lammps @@ -0,0 +1,4137 @@ +LAMMPS (22 Oct 2020) +Reading data file ... + orthogonal box = (50.000000 50.000000 50.000000) to (250.00000 250.00000 250.00000) + 2 by 2 by 2 MPI processor grid + reading atoms ... + 48 atoms + reading velocities ... + 48 velocities + scanning bonds ... + 8 = max bonds/atom + scanning angles ... + 21 = max angles/atom + scanning dihedrals ... + 33 = max dihedrals/atom + scanning impropers ... + 29 = max impropers/atom + reading bonds ... + 50 bonds + reading angles ... + 84 angles + reading dihedrals ... + 127 dihedrals + reading impropers ... + 36 impropers +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0.0 0.0 0.0 + special bond factors coul: 0.0 0.0 0.0 + 4 = max # of 1-2 neighbors + 8 = max # of 1-3 neighbors + 17 = max # of 1-4 neighbors + 46 = max # of special neighbors + special bonds CPU = 0.000 seconds + read_data CPU = 0.022 seconds +Read molecule template mol3: + 1 molecules + 30 atoms with max type 6 + 31 bonds with max type 10 + 51 angles with max type 16 + 73 dihedrals with max type 19 + 21 impropers with max type 7 +Read molecule template mol4: + 1 molecules + 46 atoms with max type 6 + 48 bonds with max type 13 + 81 angles with max type 22 + 121 dihedrals with max type 36 + 35 impropers with max type 9 +dynamic group bond_react_MASTER_group defined +dynamic group statted_grp_REACT defined +PPPM initialization ... +WARNING: System is not charge neutral, net charge = -0.0006 (../kspace.cpp:313) + using 12-bit tables for long-range coulomb (../kspace.cpp:328) + G vector (1/distance) = 0.20144813 + grid = 45 45 45 + stencil order = 5 + estimated absolute RMS force accuracy = 0.00053712952 + estimated relative force accuracy = 1.6175496e-06 + using double precision KISS FFT + 3d grid and FFT values/proc = 21952 12167 +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 10.5 + ghost atom cutoff = 10.5 + binsize = 5.25, bins = 39 39 39 + 2 neighbor lists, perpetual/occasional/extra = 1 1 0 + (1) pair lj/class2/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d/newton + bin: standard + (2) fix bond/react, occasional, copy from (1) + attributes: half, newton on + pair build: copy + stencil: none + bin: none +Setting up Verlet run ... + Unit style : real + Current step : 0 + Time step : 1.0 +WARNING: Inconsistent image flags (../domain.cpp:812) +Per MPI rank memory allocation (min/avg/max) = 37.97 | 38.12 | 38.70 Mbytes +Step Temp Press Density f_rxn1[1] + 0 496.23742 0.9983211 6.4856516e-05 0 + 2 672.73362 -516.54985 8.6475354e-05 1 + 4 667.5039 -434.77386 8.6475354e-05 1 + 6 672.39598 -362.84027 8.6475354e-05 1 + 8 685.87152 -299.54792 8.6475354e-05 1 + 10 691.00305 -244.43255 8.6475354e-05 1 + 12 669.95405 -197.53983 8.6475354e-05 1 + 14 646.37761 -158.31437 8.6475354e-05 1 + 16 643.66763 -125.39769 8.6475354e-05 1 + 18 667.56644 -97.573538 8.6475354e-05 1 + 20 703.91664 -74.339207 8.6475354e-05 1 + 22 720.06237 -55.689578 8.6475354e-05 1 + 24 697.20697 -41.333247 8.6475354e-05 1 + 26 674.83509 -30.383402 8.6475354e-05 1 + 28 670.01312 -21.803547 8.6475354e-05 1 + 30 679.49765 -15.012223 8.6475354e-05 1 + 32 700.25949 -9.9961585 8.6475354e-05 1 + 34 700.57498 -6.7727869 8.6475354e-05 1 + 36 685.11304 -4.9950196 8.6475354e-05 1 + 38 678.32094 -4.0105508 8.6475354e-05 1 + 40 676.78265 -3.2337378 8.6475354e-05 1 + 42 678.24749 -2.5623955 8.6475354e-05 1 + 44 681.72485 -2.2286571 8.6475354e-05 1 + 46 668.52658 -2.2541195 8.6475354e-05 1 + 48 658.84625 -2.3473498 8.6475354e-05 1 + 50 655.89802 -2.1608375 8.6475354e-05 1 + 52 650.56205 -1.68496 8.6475354e-05 1 + 54 666.65857 -1.3229867 8.6475354e-05 1 + 56 690.98887 -1.3111684 8.6475354e-05 1 + 58 712.94292 -1.4938499 8.6475354e-05 1 + 60 727.24487 -1.5260071 8.6475354e-05 1 + 62 718.0806 -1.2046747 8.6475354e-05 1 + 64 700.02584 -0.7635068 8.6475354e-05 1 + 66 688.52896 -0.53631295 8.6475354e-05 1 + 68 679.79647 -0.53791747 8.6475354e-05 1 + 70 694.44255 -0.5532644 8.6475354e-05 1 + 72 713.0813 -0.30885385 8.6475354e-05 1 + 74 721.95891 0.134531 8.6475354e-05 1 + 76 742.81658 0.42479462 8.6475354e-05 1 + 78 743.68772 0.45650714 8.6475354e-05 1 + 80 735.07709 0.32514596 8.6475354e-05 1 + 82 740.82043 0.20849187 8.6475354e-05 1 + 84 734.58615 0.24802492 8.6475354e-05 1 + 86 739.66066 0.25495108 8.6475354e-05 1 + 88 753.76371 0.1002615 8.6475354e-05 1 + 90 747.39108 -0.10177519 8.6475354e-05 1 + 92 756.14087 -0.28921143 8.6475354e-05 1 + 94 763.80064 -0.3136942 8.6475354e-05 1 + 96 758.26501 -0.22731262 8.6475354e-05 1 + 98 780.51378 -0.27873344 8.6475354e-05 1 + 100 778.14888 -0.39476034 8.6475354e-05 1 + 102 749.63152 -0.47648489 8.6475354e-05 1 + 104 846.93279 -515.29892 0.00010809419 2 + 106 826.13617 -433.34463 0.00010809419 2 + 108 816.77932 -361.49619 0.00010809419 2 + 110 832.98668 -298.67436 0.00010809419 2 + 112 828.70355 -243.96707 0.00010809419 2 + 114 829.78649 -196.94812 0.00010809419 2 + 116 834.95318 -157.12951 0.00010809419 2 + 118 818.14589 -123.74396 0.00010809419 2 + 120 823.23317 -96.119924 0.00010809419 2 + 122 827.11868 -73.432562 0.00010809419 2 + 124 818.85373 -55.093931 0.00010809419 2 + 126 819.83268 -40.717815 0.00010809419 2 + 128 810.0448 -29.70583 0.00010809419 2 + 130 811.69158 -21.50551 0.00010809419 2 + 132 821.37302 -15.473802 0.00010809419 2 + 134 820.66577 -10.994366 0.00010809419 2 + 136 828.20766 -7.7873437 0.00010809419 2 + 138 835.82332 -5.6282316 0.00010809419 2 + 140 845.10867 -4.2922973 0.00010809419 2 + 142 871.58701 -3.5134098 0.00010809419 2 + 144 879.74364 -2.8383489 0.00010809419 2 + 146 875.03242 -2.0846919 0.00010809419 2 + 148 877.25151 -1.3780873 0.00010809419 2 + 150 873.17469 -0.84990975 0.00010809419 2 + 152 890.04002 -0.60830118 0.00010809419 2 + 154 903.70012 -0.4683428 0.00010809419 2 + 156 899.27359 -0.23979738 0.00010809419 2 + 158 898.85893 0.0077916688 0.00010809419 2 + 160 893.65077 0.16405785 0.00010809419 2 + 162 891.71694 0.14137049 0.00010809419 2 + 164 903.78638 0.04704286 0.00010809419 2 + 166 905.9683 0.1349231 0.00010809419 2 + 168 910.76595 0.40440178 0.00010809419 2 + 170 922.28442 0.6891772 0.00010809419 2 + 172 916.21424 0.86117662 0.00010809419 2 + 174 903.02225 0.89400959 0.00010809419 2 + 176 885.39888 0.97920294 0.00010809419 2 + 178 870.41144 1.2525889 0.00010809419 2 + 180 869.70627 1.6068325 0.00010809419 2 + 182 871.11959 1.8160032 0.00010809419 2 + 184 869.3783 1.7223162 0.00010809419 2 + 186 864.82644 1.49422 0.00010809419 2 + 188 870.53517 1.4225742 0.00010809419 2 + 190 886.68548 1.5811771 0.00010809419 2 + 192 891.75807 1.7148245 0.00010809419 2 + 194 894.5438 1.4550304 0.00010809419 2 + 196 884.78947 0.8635917 0.00010809419 2 + 198 868.94073 0.33605001 0.00010809419 2 + 200 875.79343 0.13232632 0.00010809419 2 + 202 883.35077 0.23108222 0.00010809419 2 + 204 888.58232 0.25927752 0.00010809419 2 + 206 1107.5599 8637688.5 0.00012971303 3 + 208 1110.7846 377601.17 0.00012971303 3 + 210 1119.1946 40058.093 0.00012971303 3 + 212 1133.7765 7445.8597 0.00012971303 3 + 214 1135.8825 1828.4071 0.00012971303 3 + 216 1158.7218 403.45537 0.00012971303 3 + 218 1169.4708 -31.054599 0.00012971303 3 + 220 1160.98 -156.65213 0.00012971303 3 + 222 1155.6262 -176.44394 0.00012971303 3 + 224 1131.1594 -167.87497 0.00012971303 3 + 226 1113.9144 -147.95888 0.00012971303 3 + 228 1129.7212 -122.18556 0.00012971303 3 + 230 1135.2926 -98.191841 0.00012971303 3 + 232 1139.5082 -76.954463 0.00012971303 3 + 234 1138.3988 -58.569198 0.00012971303 3 + 236 1114.7516 -43.273595 0.00012971303 3 + 238 1111.675 -31.385143 0.00012971303 3 + 240 1108.3656 -22.575824 0.00012971303 3 + 242 1098.2288 -16.049189 0.00012971303 3 + 244 1097.5592 -11.075179 0.00012971303 3 + 246 1080.575 -7.2891243 0.00012971303 3 + 248 1062.281 -4.8100451 0.00012971303 3 + 250 1054.3602 -3.6457718 0.00012971303 3 + 252 1041.5474 -3.2427207 0.00012971303 3 + 254 1049.6522 -3.0128429 0.00012971303 3 + 256 1067.6297 -2.6265895 0.00012971303 3 + 258 1081.6873 -2.1996331 0.00012971303 3 + 260 1103.2003 -2.0609219 0.00012971303 3 + 262 1103.0801 -2.1514117 0.00012971303 3 + 264 1118.9504 -2.2123932 0.00012971303 3 + 266 1156.5552 -1.9428664 0.00012971303 3 + 268 1167.8606 -1.2867254 0.00012971303 3 + 270 1180.4323 -0.65452596 0.00012971303 3 + 272 1182.9865 -0.2548239 0.00012971303 3 + 274 1168.7598 -0.0051407959 0.00012971303 3 + 276 1186.6008 0.21071708 0.00012971303 3 + 278 1205.0507 0.5419248 0.00012971303 3 + 280 1220.4904 0.76453778 0.00012971303 3 + 282 1244.6059 0.56375436 0.00012971303 3 + 284 1223.3782 0.067494738 0.00012971303 3 + 286 1202.9298 -0.52770675 0.00012971303 3 + 288 1189.6831 -0.93554081 0.00012971303 3 + 290 1154.4315 -1.0402905 0.00012971303 3 + 292 1161.4818 -1.1434855 0.00012971303 3 + 294 1176.833 -1.2714623 0.00012971303 3 + 296 1179.2197 -1.2607495 0.00012971303 3 + 298 1207.8388 -1.0074678 0.00012971303 3 + 300 1215.1726 -0.39937655 0.00012971303 3 + 302 1210.3522 0.26737494 0.00012971303 3 + 304 1218.4689 0.65569106 0.00012971303 3 + 306 1208.8376 0.87597451 0.00012971303 3 + 308 1286.4107 -509.47242 0.00015133187 4 + 310 1273.3815 -427.85316 0.00015133187 4 + 312 1242.1286 -356.22024 0.00015133187 4 + 314 1253.4942 -293.85005 0.00015133187 4 + 316 1273.6312 -239.98924 0.00015133187 4 + 318 1275.0656 -193.99363 0.00015133187 4 + 320 1295.9103 -155.20399 0.00015133187 4 + 322 1290.9077 -122.56609 0.00015133187 4 + 324 1271.6566 -95.381388 0.00015133187 4 + 326 1263.8102 -73.165359 0.00015133187 4 + 328 1239.1977 -55.302863 0.00015133187 4 + 330 1227.6108 -41.236285 0.00015133187 4 + 332 1224.4531 -30.167712 0.00015133187 4 + 334 1208.0527 -21.468457 0.00015133187 4 + 336 1235.9468 -14.916123 0.00015133187 4 + 338 1267.1547 -10.131348 0.00015133187 4 + 340 1292.5478 -6.8056873 0.00015133187 4 + 342 1335.1976 -4.6458831 0.00015133187 4 + 344 1331.0703 -3.2217937 0.00015133187 4 + 346 1304.564 -2.4053344 0.00015133187 4 + 348 1294.6672 -2.0166678 0.00015133187 4 + 350 1275.671 -1.7896119 0.00015133187 4 + 352 1270.708 -1.6647554 0.00015133187 4 + 354 1269.5585 -1.5099971 0.00015133187 4 + 356 1246.2033 -1.2754664 0.00015133187 4 + 358 1255.6589 -1.126802 0.00015133187 4 + 360 1268.2565 -0.97986712 0.00015133187 4 + 362 1275.1167 -0.76954276 0.00015133187 4 + 364 1287.7098 -0.52952795 0.00015133187 4 + 366 1263.1765 -0.27860938 0.00015133187 4 + 368 1232.2653 -0.18570194 0.00015133187 4 + 370 1230.2485 -0.26197611 0.00015133187 4 + 372 1233.9159 -0.30708265 0.00015133187 4 + 374 1253.5708 -0.26988589 0.00015133187 4 + 376 1282.6496 -0.19467244 0.00015133187 4 + 378 1298.4463 -0.17751858 0.00015133187 4 + 380 1320.5676 -0.27144792 0.00015133187 4 + 382 1338.5616 -0.30891377 0.00015133187 4 + 384 1351.3783 -0.18933152 0.00015133187 4 + 386 1357.3252 0.0265073 0.00015133187 4 + 388 1344.6374 0.20930056 0.00015133187 4 + 390 1333.1019 0.27147994 0.00015133187 4 + 392 1337.4623 0.32960244 0.00015133187 4 + 394 1357.0506 0.53222632 0.00015133187 4 + 396 1383.0145 0.84287387 0.00015133187 4 + 398 1402.3315 1.0270585 0.00015133187 4 + 400 1410.03 0.87301772 0.00015133187 4 + 402 1397.5003 0.50658616 0.00015133187 4 + 404 1371.0536 0.22338437 0.00015133187 4 + 406 1355.6828 0.12299714 0.00015133187 4 + 408 1349.6668 0.084479741 0.00015133187 4 + 410 1534.4693 -221.57225 0.00017295071 5 + 412 1543.4054 -308.97261 0.00017295071 5 + 414 1532.8454 -300.08081 0.00017295071 5 + 416 1533.4105 -263.77232 0.00017295071 5 + 418 1537.4915 -221.76219 0.00017295071 5 + 420 1530.954 -181.87958 0.00017295071 5 + 422 1535.7748 -146.85737 0.00017295071 5 + 424 1519.1766 -116.85102 0.00017295071 5 + 426 1497.2677 -91.226974 0.00017295071 5 + 428 1492.6473 -69.62357 0.00017295071 5 + 430 1472.5275 -52.059519 0.00017295071 5 + 432 1462.4413 -38.529891 0.00017295071 5 + 434 1468.9696 -28.36966 0.00017295071 5 + 436 1452.932 -20.460639 0.00017295071 5 + 438 1468.2846 -14.114515 0.00017295071 5 + 440 1490.4484 -9.1886317 0.00017295071 5 + 442 1487.1913 -5.942928 0.00017295071 5 + 444 1497.2185 -4.4123187 0.00017295071 5 + 446 1478.8939 -3.8118845 0.00017295071 5 + 448 1456.0017 -3.3353043 0.00017295071 5 + 450 1466.4786 -2.6872974 0.00017295071 5 + 452 1465.5824 -2.1548854 0.00017295071 5 + 454 1464.9664 -2.2552192 0.00017295071 5 + 456 1464.778 -2.8523593 0.00017295071 5 + 458 1438.9393 -3.2513212 0.00017295071 5 + 460 1430.9755 -3.129067 0.00017295071 5 + 462 1438.8786 -2.7207139 0.00017295071 5 + 464 1442.65 -2.5598392 0.00017295071 5 + 466 1457.4603 -2.8627635 0.00017295071 5 + 468 1456.3288 -3.1617133 0.00017295071 5 + 470 1453.9005 -2.984669 0.00017295071 5 + 472 1466.2228 -2.3645176 0.00017295071 5 + 474 1473.5811 -1.8008842 0.00017295071 5 + 476 1486.9192 -1.7752973 0.00017295071 5 + 478 1486.6985 -2.0930366 0.00017295071 5 + 480 1481.2602 -2.2133575 0.00017295071 5 + 482 1481.1923 -1.8733217 0.00017295071 5 + 484 1473.2641 -1.3520504 0.00017295071 5 + 486 1471.6493 -1.1879697 0.00017295071 5 + 488 1475.4712 -1.4344883 0.00017295071 5 + 490 1481.9981 -1.6453745 0.00017295071 5 + 492 1504.055 -1.4250176 0.00017295071 5 + 494 1510.1599 -0.76544776 0.00017295071 5 + 496 1496.1128 -0.15333711 0.00017295071 5 + 498 1478.523 0.032710644 0.00017295071 5 + 500 1442.1002 -0.01944848 0.00017295071 5 + 502 1435.515 0.020833055 0.00017295071 5 + 504 1435.4149 0.37469386 0.00017295071 5 + 506 1428.6576 0.78486479 0.00017295071 5 + 508 1431.8185 0.8019623 0.00017295071 5 + 510 1421.3836 0.46585338 0.00017295071 5 + 512 1529.4088 729.29069 0.00019456955 6 + 514 1553.6093 -29.679404 0.00019456955 6 + 516 1560.6793 -193.67199 0.00019456955 6 + 518 1582.4456 -214.57181 0.00019456955 6 + 520 1600.209 -196.52872 0.00019456955 6 + 522 1587.5015 -168.43457 0.00019456955 6 + 524 1597.8334 -139.01628 0.00019456955 6 + 526 1588.3299 -110.66293 0.00019456955 6 + 528 1563.7922 -85.583276 0.00019456955 6 + 530 1562.5661 -65.082386 0.00019456955 6 + 532 1545.9594 -48.827328 0.00019456955 6 + 534 1548.1975 -36.047522 0.00019456955 6 + 536 1571.1596 -25.990003 0.00019456955 6 + 538 1568.3742 -18.119354 0.00019456955 6 + 540 1591.6304 -12.364411 0.00019456955 6 + 542 1621.6504 -8.4436521 0.00019456955 6 + 544 1635.2863 -5.8931502 0.00019456955 6 + 546 1668.6883 -4.3787834 0.00019456955 6 + 548 1677.8643 -3.524089 0.00019456955 6 + 550 1672.6149 -3.1111588 0.00019456955 6 + 552 1686.192 -3.0167906 0.00019456955 6 + 554 1694.1881 -3.021889 0.00019456955 6 + 556 1721.201 -3.0411757 0.00019456955 6 + 558 1756.9269 -2.9903902 0.00019456955 6 + 560 1767.176 -2.8616056 0.00019456955 6 + 562 1781.3616 -2.805622 0.00019456955 6 + 564 1772.6438 -2.7043354 0.00019456955 6 + 566 1752.2449 -2.4746308 0.00019456955 6 + 568 1754.9931 -2.2279232 0.00019456955 6 + 570 1754.7206 -2.0446367 0.00019456955 6 + 572 1758.6452 -2.025602 0.00019456955 6 + 574 1766.1608 -2.0914714 0.00019456955 6 + 576 1761.7544 -2.0664004 0.00019456955 6 + 578 1772.1189 -2.000525 0.00019456955 6 + 580 1799.2454 -2.0250243 0.00019456955 6 + 582 1825.067 -2.2293284 0.00019456955 6 + 584 1849.5617 -2.5697748 0.00019456955 6 + 586 1849.2053 -2.7732917 0.00019456955 6 + 588 1836.8275 -2.7313701 0.00019456955 6 + 590 1826.4569 -2.5953868 0.00019456955 6 + 592 1812.2065 -2.5647921 0.00019456955 6 + 594 1804.9949 -2.6702505 0.00019456955 6 + 596 1803.1318 -2.6613268 0.00019456955 6 + 598 1805.1361 -2.3358896 0.00019456955 6 + 600 1824.188 -1.8387289 0.00019456955 6 + 602 1848.6553 -1.5013544 0.00019456955 6 + 604 1870.6838 -1.5441019 0.00019456955 6 + 606 1874.9469 -1.8017458 0.00019456955 6 + 608 1869.5686 -1.9218444 0.00019456955 6 + 610 1877.623 -1.7853588 0.00019456955 6 + 612 1889.4207 -1.5668847 0.00019456955 6 + 614 1965.8448 -467.80498 0.00021618839 7 + 616 1987.3298 -392.09435 0.00021618839 7 + 618 2000.2927 -325.81873 0.00021618839 7 + 620 2023.5139 -267.59947 0.00021618839 7 + 622 2053.7762 -216.83693 0.00021618839 7 + 624 2061.6352 -173.50374 0.00021618839 7 + 626 2052.7458 -137.4578 0.00021618839 7 + 628 2021.4692 -107.67926 0.00021618839 7 + 630 1995.4739 -82.926012 0.00021618839 7 + 632 1995.1292 -62.399746 0.00021618839 7 + 634 1988.8957 -45.877721 0.00021618839 7 + 636 1991.9075 -33.414941 0.00021618839 7 + 638 1994.8193 -24.397758 0.00021618839 7 + 640 1984.0488 -17.632089 0.00021618839 7 + 642 1979.6828 -12.220819 0.00021618839 7 + 644 1956.266 -7.8761194 0.00021618839 7 + 646 1921.9407 -4.9132587 0.00021618839 7 + 648 1906.8953 -3.4249108 0.00021618839 7 + 650 1884.0064 -2.7059283 0.00021618839 7 + 652 1873.4695 -1.9767323 0.00021618839 7 + 654 1879.7171 -0.9043862 0.00021618839 7 + 656 1864.2258 0.17074359 0.00021618839 7 + 658 1879.9729 0.52626965 0.00021618839 7 + 660 1914.8077 0.17422926 0.00021618839 7 + 662 1951.367 -0.27150227 0.00021618839 7 + 664 2003.6903 -0.40419822 0.00021618839 7 + 666 2022.2638 -0.27719235 0.00021618839 7 + 668 2007.5499 -0.46205565 0.00021618839 7 + 670 2001.0368 -1.2081892 0.00021618839 7 + 672 1989.3934 -1.9884832 0.00021618839 7 + 674 2003.9186 -2.2824546 0.00021618839 7 + 676 2029.3746 -1.9648526 0.00021618839 7 + 678 2029.8301 -1.4595559 0.00021618839 7 + 680 2039.736 -1.3563856 0.00021618839 7 + 682 2030.692 -1.5588443 0.00021618839 7 + 684 2012.8781 -1.6591768 0.00021618839 7 + 686 2007.5676 -1.4469618 0.00021618839 7 + 688 1976.2079 -1.0593207 0.00021618839 7 + 690 1936.7606 -0.99860488 0.00021618839 7 + 692 1917.263 -1.4227025 0.00021618839 7 + 694 1898.286 -1.8944056 0.00021618839 7 + 696 1908.9759 -2.0293348 0.00021618839 7 + 698 1929.625 -1.7527389 0.00021618839 7 + 700 1928.5094 -1.4327584 0.00021618839 7 + 702 1925.3732 -1.4772437 0.00021618839 7 + 704 1905.6439 -1.7140386 0.00021618839 7 + 706 1892.0501 -1.7837212 0.00021618839 7 + 708 1897.1334 -1.5195612 0.00021618839 7 + 710 1891.8002 -1.0767969 0.00021618839 7 + 712 1899.5619 -0.86887435 0.00021618839 7 + 714 1905.3485 -0.94002209 0.00021618839 7 + 716 2060.3083 -484.08676 0.00023780722 8 + 718 2101.3468 -422.17239 0.00023780722 8 + 720 2132.6048 -356.92116 0.00023780722 8 + 722 2148.8483 -296.33815 0.00023780722 8 + 724 2165.9219 -242.83932 0.00023780722 8 + 726 2152.8378 -196.66477 0.00023780722 8 + 728 2140.9769 -157.3232 0.00023780722 8 + 730 2135.9583 -124.09964 0.00023780722 8 + 732 2109.2748 -96.383726 0.00023780722 8 + 734 2102.2854 -73.867192 0.00023780722 8 + 736 2094.2383 -56.001724 0.00023780722 8 + 738 2077.1035 -41.839387 0.00023780722 8 + 740 2081.3509 -30.614919 0.00023780722 8 + 742 2066.1613 -21.796463 0.00023780722 8 + 744 2041.6068 -15.208246 0.00023780722 8 + 746 2023.3105 -10.622121 0.00023780722 8 + 748 1988.2601 -7.4664823 0.00023780722 8 + 750 1976.5559 -5.2218916 0.00023780722 8 + 752 1994.2738 -3.5641818 0.00023780722 8 + 754 2015.1651 -2.4337385 0.00023780722 8 + 756 2059.2266 -1.8718232 0.00023780722 8 + 758 2080.4658 -1.5660802 0.00023780722 8 + 760 2085.6804 -1.2208682 0.00023780722 8 + 762 2111.7377 -0.80876969 0.00023780722 8 + 764 2123.4038 -0.46004685 0.00023780722 8 + 766 2142.9461 -0.50137367 0.00023780722 8 + 768 2155.9796 -0.88504716 0.00023780722 8 + 770 2137.3328 -1.2131181 0.00023780722 8 + 772 2133.4178 -1.2839864 0.00023780722 8 + 774 2135.5642 -1.1107438 0.00023780722 8 + 776 2131.4716 -0.9763852 0.00023780722 8 + 778 2141.1425 -1.1141508 0.00023780722 8 + 780 2122.4577 -1.2362837 0.00023780722 8 + 782 2097.188 -1.0587093 0.00023780722 8 + 784 2086.4293 -0.54517591 0.00023780722 8 + 786 2059.7386 0.078658205 0.00023780722 8 + 788 2056.9502 0.39365487 0.00023780722 8 + 790 2059.7875 0.44862285 0.00023780722 8 + 792 2053.9519 0.57572021 0.00023780722 8 + 794 2068.6847 0.87417066 0.00023780722 8 + 796 2074.5991 1.2047124 0.00023780722 8 + 798 2069.278 1.2159747 0.00023780722 8 + 800 2066.7899 0.81647619 0.00023780722 8 + 802 2049.668 0.38483557 0.00023780722 8 + 804 2041.8371 0.23434063 0.00023780722 8 + 806 2038.5434 0.39443232 0.00023780722 8 + 808 2026.6223 0.58693138 0.00023780722 8 + 810 2024.1624 0.5475207 0.00023780722 8 + 812 2004.3173 0.49231818 0.00023780722 8 + 814 1990.7789 0.70059886 0.00023780722 8 + 816 1987.2131 1.2210152 0.00023780722 8 + 818 2161.5038 10822.918 0.00025942606 9 + 820 2177.4678 1175.2783 0.00025942606 9 + 822 2184.519 57.816329 0.00025942606 9 + 824 2178.3276 -139.4906 0.00025942606 9 + 826 2180.645 -171.63641 0.00025942606 9 + 828 2165.9354 -159.58872 0.00025942606 9 + 830 2154.8716 -135.85339 0.00025942606 9 + 832 2159.4294 -110.79695 0.00025942606 9 + 834 2153.9831 -87.18999 0.00025942606 9 + 836 2167.9422 -66.446821 0.00025942606 9 + 838 2187.3361 -49.192935 0.00025942606 9 + 840 2200.8082 -35.535202 0.00025942606 9 + 842 2228.2294 -25.285213 0.00025942606 9 + 844 2225.4003 -17.694836 0.00025942606 9 + 846 2206.6625 -11.958408 0.00025942606 9 + 848 2190.7535 -7.5738088 0.00025942606 9 + 850 2158.8859 -4.4081209 0.00025942606 9 + 852 2150.4249 -2.6693514 0.00025942606 9 + 854 2146.7827 -2.1285586 0.00025942606 9 + 856 2121.866 -2.0452297 0.00025942606 9 + 858 2113.5398 -1.930143 0.00025942606 9 + 860 2093.4925 -1.6900544 0.00025942606 9 + 862 2074.3135 -1.6580782 0.00025942606 9 + 864 2088.9188 -2.0758526 0.00025942606 9 + 866 2087.6915 -2.5592562 0.00025942606 9 + 868 2097.5344 -2.7852457 0.00025942606 9 + 870 2112.2374 -2.6428098 0.00025942606 9 + 872 2097.2111 -2.3002782 0.00025942606 9 + 874 2106.853 -2.1636293 0.00025942606 9 + 876 2129.5068 -2.1747853 0.00025942606 9 + 878 2161.3576 -2.0561981 0.00025942606 9 + 880 2217.5514 -1.7416833 0.00025942606 9 + 882 2230.9698 -1.2884706 0.00025942606 9 + 884 2211.38 -1.0467174 0.00025942606 9 + 886 2187.0138 -1.1460354 0.00025942606 9 + 888 2146.1106 -1.2881048 0.00025942606 9 + 890 2140.9302 -1.3342717 0.00025942606 9 + 892 2149.0235 -1.2373227 0.00025942606 9 + 894 2134.5144 -1.1269002 0.00025942606 9 + 896 2142.6185 -1.2248568 0.00025942606 9 + 898 2137.3035 -1.302225 0.00025942606 9 + 900 2138.4339 -1.1745745 0.00025942606 9 + 902 2166.0789 -0.883737 0.00025942606 9 + 904 2166.6321 -0.53814532 0.00025942606 9 + 906 2163.9023 -0.4089786 0.00025942606 9 + 908 2153.7644 -0.42222952 0.00025942606 9 + 910 2124.8196 -0.28063037 0.00025942606 9 + 912 2123.2354 0.043174822 0.00025942606 9 + 914 2130.1172 0.46272084 0.00025942606 9 + 916 2139.3275 0.76049317 0.00025942606 9 + 918 2178.3808 0.82940816 0.00025942606 9 + 920 2323.8782 -485.39314 0.0002810449 10 + 922 2332.1565 -406.46688 0.0002810449 10 + 924 2336.3166 -337.18565 0.0002810449 10 + 926 2313.084 -276.7101 0.0002810449 10 + 928 2301.6359 -224.66195 0.0002810449 10 + 930 2284.8771 -180.5217 0.0002810449 10 + 932 2268.3016 -143.34858 0.0002810449 10 + 934 2283.2572 -112.17043 0.0002810449 10 + 936 2301.3935 -86.232909 0.0002810449 10 + 938 2326.6508 -65.092653 0.0002810449 10 + 940 2354.0325 -48.308852 0.0002810449 10 + 942 2357.0053 -35.117439 0.0002810449 10 + 944 2362.4019 -24.804745 0.0002810449 10 + 946 2364.5934 -16.882852 0.0002810449 10 + 948 2354.2772 -11.08542 0.0002810449 10 + 950 2358.2567 -7.2073771 0.0002810449 10 + 952 2357.9722 -4.7692456 0.0002810449 10 + 954 2370.3706 -3.2926218 0.0002810449 10 + 956 2395.8214 -2.466307 0.0002810449 10 + 958 2401.6564 -2.11421 0.0002810449 10 + 960 2403.7092 -2.1429976 0.0002810449 10 + 962 2396.0698 -2.2959924 0.0002810449 10 + 964 2390.1649 -2.3157527 0.0002810449 10 + 966 2404.5929 -2.1734121 0.0002810449 10 + 968 2408.3192 -1.98028 0.0002810449 10 + 970 2398.7909 -1.9375567 0.0002810449 10 + 972 2383.6803 -2.0199738 0.0002810449 10 + 974 2355.1449 -1.9574814 0.0002810449 10 + 976 2346.3489 -1.6961375 0.0002810449 10 + 978 2347.3597 -1.3865895 0.0002810449 10 + 980 2343.0369 -1.2700218 0.0002810449 10 + 982 2345.3213 -1.4297279 0.0002810449 10 + 984 2327.6 -1.5695591 0.0002810449 10 + 986 2318.7362 -1.4876651 0.0002810449 10 + 988 2326.2577 -1.2479203 0.0002810449 10 + 990 2316.612 -1.046613 0.0002810449 10 + 992 2313.3503 -1.0544885 0.0002810449 10 + 994 2314.0739 -1.0425882 0.0002810449 10 + 996 2317.8974 -0.69797366 0.0002810449 10 + 998 2349.5732 -0.086575463 0.0002810449 10 + 1000 2378.2958 0.48380694 0.0002810449 10 + 1002 2398.6531 0.66903819 0.0002810449 10 + 1004 2417.9165 0.48507547 0.0002810449 10 + 1006 2402.714 0.343508 0.0002810449 10 + 1008 2387.7715 0.39591155 0.0002810449 10 + 1010 2384.6905 0.48121177 0.0002810449 10 + 1012 2374.5546 0.33734725 0.0002810449 10 + 1014 2375.4496 -0.12992559 0.0002810449 10 + 1016 2366.5143 -0.54452336 0.0002810449 10 + 1018 2351.6829 -0.56192848 0.0002810449 10 + 1020 2345.0219 -0.2460576 0.0002810449 10 + 1022 2463.1847 -516.33252 0.00030266374 11 + 1024 2454.155 -435.41186 0.00030266374 11 + 1026 2437.707 -363.71737 0.00030266374 11 + 1028 2408.2814 -300.48778 0.00030266374 11 + 1030 2391.9754 -245.2709 0.00030266374 11 + 1032 2379.439 -197.89467 0.00030266374 11 + 1034 2368.5571 -158.05214 0.00030266374 11 + 1036 2366.4376 -124.96986 0.00030266374 11 + 1038 2352.3062 -97.480849 0.00030266374 11 + 1040 2359.7206 -74.664867 0.00030266374 11 + 1042 2380.554 -56.050357 0.00030266374 11 + 1044 2392.3114 -41.388607 0.00030266374 11 + 1046 2406.4028 -30.298934 0.00030266374 11 + 1048 2397.032 -21.930411 0.00030266374 11 + 1050 2388.3085 -15.453312 0.00030266374 11 + 1052 2408.961 -10.487276 0.00030266374 11 + 1054 2415.0795 -6.9671499 0.00030266374 11 + 1056 2413.2045 -4.92205 0.00030266374 11 + 1058 2402.5175 -3.9355994 0.00030266374 11 + 1060 2372.7166 -3.3093623 0.00030266374 11 + 1062 2379.1447 -2.6515003 0.00030266374 11 + 1064 2403.202 -1.9596171 0.00030266374 11 + 1066 2420.0621 -1.5615553 0.00030266374 11 + 1068 2434.315 -1.6023246 0.00030266374 11 + 1070 2413.6852 -1.6808363 0.00030266374 11 + 1072 2390.6494 -1.4902277 0.00030266374 11 + 1074 2391.2701 -1.1175681 0.00030266374 11 + 1076 2384.3245 -0.86479593 0.00030266374 11 + 1078 2383.5286 -0.99750191 0.00030266374 11 + 1080 2361.881 -1.2538663 0.00030266374 11 + 1082 2310.5086 -1.2171158 0.00030266374 11 + 1084 2271.943 -0.84898316 0.00030266374 11 + 1086 2245.7089 -0.41447514 0.00030266374 11 + 1088 2238.5277 -0.24768594 0.00030266374 11 + 1090 2250.6586 -0.33937731 0.00030266374 11 + 1092 2252.3465 -0.28270513 0.00030266374 11 + 1094 2257.7627 0.15192401 0.00030266374 11 + 1096 2269.8741 0.81014869 0.00030266374 11 + 1098 2286.5891 1.2659299 0.00030266374 11 + 1100 2325.5369 1.2551156 0.00030266374 11 + 1102 2346.6869 1.0727392 0.00030266374 11 + 1104 2355.8688 1.0527111 0.00030266374 11 + 1106 2358.3475 1.2373615 0.00030266374 11 + 1108 2345.8422 1.3818899 0.00030266374 11 + 1110 2353.8344 1.1564982 0.00030266374 11 + 1112 2369.5181 0.66950876 0.00030266374 11 + 1114 2373.066 0.29808963 0.00030266374 11 + 1116 2378.6809 0.23783651 0.00030266374 11 + 1118 2364.3707 0.43587025 0.00030266374 11 + 1120 2348.2868 0.57308599 0.00030266374 11 + 1122 2353.9119 0.50264505 0.00030266374 11 + 1124 2522.0253 52021.206 0.00032428258 12 + 1126 2539.0142 7338.6879 0.00032428258 12 + 1128 2559.8158 1270.0735 0.00032428258 12 + 1130 2561.38 145.3418 0.00032428258 12 + 1132 2579.5507 -94.489179 0.00032428258 12 + 1134 2589.1423 -136.27816 0.00032428258 12 + 1136 2596.4703 -127.81426 0.00032428258 12 + 1138 2624.7426 -107.06193 0.00032428258 12 + 1140 2635.6919 -85.101749 0.00032428258 12 + 1142 2646.3826 -65.610499 0.00032428258 12 + 1144 2659.2678 -49.534785 0.00032428258 12 + 1146 2649.6461 -36.607005 0.00032428258 12 + 1148 2660.6024 -26.488565 0.00032428258 12 + 1150 2670.7082 -18.659422 0.00032428258 12 + 1152 2675.1501 -12.837639 0.00032428258 12 + 1154 2698.7451 -8.8002486 0.00032428258 12 + 1156 2707.7717 -5.9663794 0.00032428258 12 + 1158 2729.6321 -3.9589674 0.00032428258 12 + 1160 2770.6577 -2.6699229 0.00032428258 12 + 1162 2784.6698 -1.9813875 0.00032428258 12 + 1164 2793.4127 -1.7981665 0.00032428258 12 + 1166 2786.6171 -1.8331689 0.00032428258 12 + 1168 2763.219 -1.8406929 0.00032428258 12 + 1170 2760.6924 -1.8850852 0.00032428258 12 + 1172 2757.2723 -2.0886949 0.00032428258 12 + 1174 2756.8909 -2.6016683 0.00032428258 12 + 1176 2771.3594 -3.2945397 0.00032428258 12 + 1178 2766.3013 -3.773452 0.00032428258 12 + 1180 2754.5699 -3.9231145 0.00032428258 12 + 1182 2743.4624 -3.8874086 0.00032428258 12 + 1184 2724.9347 -3.8562824 0.00032428258 12 + 1186 2722.9503 -3.8989691 0.00032428258 12 + 1188 2735.073 -3.7774613 0.00032428258 12 + 1190 2744.2224 -3.2658869 0.00032428258 12 + 1192 2748.5938 -2.4445578 0.00032428258 12 + 1194 2740.3303 -1.62823 0.00032428258 12 + 1196 2731.1588 -1.1293334 0.00032428258 12 + 1198 2726.6177 -0.94476657 0.00032428258 12 + 1200 2729.2096 -0.85989877 0.00032428258 12 + 1202 2733.9837 -0.76063952 0.00032428258 12 + 1204 2729.2231 -0.7546601 0.00032428258 12 + 1206 2727.2562 -1.0700876 0.00032428258 12 + 1208 2720.7499 -1.6500762 0.00032428258 12 + 1210 2708.6566 -2.1851417 0.00032428258 12 + 1212 2701.892 -2.4148926 0.00032428258 12 + 1214 2688.1758 -2.271921 0.00032428258 12 + 1216 2685.2216 -1.9798955 0.00032428258 12 + 1218 2706.9007 -1.7191217 0.00032428258 12 + 1220 2713.4925 -1.3407824 0.00032428258 12 + 1222 2738.9322 -0.77566391 0.00032428258 12 + 1224 2775.5509 -0.0090904929 0.00032428258 12 + 1226 2871.2813 -310.16764 0.00034590142 13 + 1228 2871.5817 -331.77712 0.00034590142 13 + 1230 2857.2201 -300.83945 0.00034590142 13 + 1232 2837.3673 -256.8061 0.00034590142 13 + 1234 2862.5084 -212.5256 0.00034590142 13 + 1236 2874.7593 -172.25556 0.00034590142 13 + 1238 2882.6633 -137.48854 0.00034590142 13 + 1240 2909.4893 -108.42395 0.00034590142 13 + 1242 2899.363 -84.307615 0.00034590142 13 + 1244 2909.5571 -64.468204 0.00034590142 13 + 1246 2941.0066 -48.373391 0.00034590142 13 + 1248 2936.772 -35.618618 0.00034590142 13 + 1250 2952.4744 -26.043372 0.00034590142 13 + 1252 2969.6093 -18.874053 0.00034590142 13 + 1254 2965.3037 -13.316472 0.00034590142 13 + 1256 2995.4101 -9.132234 0.00034590142 13 + 1258 3007.6778 -6.1946405 0.00034590142 13 + 1260 2994.9045 -4.5054107 0.00034590142 13 + 1262 3004.2835 -3.8873592 0.00034590142 13 + 1264 3001.6362 -3.6367295 0.00034590142 13 + 1266 3010.5562 -3.3538168 0.00034590142 13 + 1268 3046.5006 -3.141016 0.00034590142 13 + 1270 3056.1295 -3.1442573 0.00034590142 13 + 1272 3073.7105 -3.4643552 0.00034590142 13 + 1274 3102.7734 -3.7810315 0.00034590142 13 + 1276 3117.8626 -3.7042351 0.00034590142 13 + 1278 3138.7031 -3.3068889 0.00034590142 13 + 1280 3141.649 -2.81218 0.00034590142 13 + 1282 3120.5478 -2.4008861 0.00034590142 13 + 1284 3115.974 -2.0656352 0.00034590142 13 + 1286 3099.7148 -1.5004649 0.00034590142 13 + 1288 3082.8778 -0.71815106 0.00034590142 13 + 1290 3090.2566 -0.080564342 0.00034590142 13 + 1292 3080.8676 0.15328737 0.00034590142 13 + 1294 3072.2673 -0.084005595 0.00034590142 13 + 1296 3068.6598 -0.48789662 0.00034590142 13 + 1298 3051.4976 -0.73147096 0.00034590142 13 + 1300 3050.1371 -0.91875812 0.00034590142 13 + 1302 3071.9289 -1.302026 0.00034590142 13 + 1304 3089.0938 -1.9004835 0.00034590142 13 + 1306 3115.0464 -2.4956357 0.00034590142 13 + 1308 3141.219 -2.7417336 0.00034590142 13 + 1310 3156.2045 -2.5604889 0.00034590142 13 + 1312 3189.7615 -2.2909175 0.00034590142 13 + 1314 3229.6182 -2.2287307 0.00034590142 13 + 1316 3254.1712 -2.3087605 0.00034590142 13 + 1318 3288.7718 -2.2666589 0.00034590142 13 + 1320 3324.0655 -1.8935613 0.00034590142 13 + 1322 3340.5208 -1.3542012 0.00034590142 13 + 1324 3365.0481 -1.0760891 0.00034590142 13 + 1326 3370.2387 -1.0983067 0.00034590142 13 + 1328 3471.4805 2014.1654 0.00036752025 14 + 1330 3505.1634 330.03534 0.00036752025 14 + 1332 3539.7134 -69.649334 0.00036752025 14 + 1334 3566.793 -167.82115 0.00036752025 14 + 1336 3604.5501 -176.10466 0.00036752025 14 + 1338 3590.7429 -157.35136 0.00036752025 14 + 1340 3556.3012 -131.95483 0.00036752025 14 + 1342 3533.6395 -106.5047 0.00036752025 14 + 1344 3490.0063 -83.120672 0.00036752025 14 + 1346 3465.607 -63.491864 0.00036752025 14 + 1348 3457.3149 -47.999092 0.00036752025 14 + 1350 3412.3409 -35.927698 0.00036752025 14 + 1352 3381.2277 -26.551014 0.00036752025 14 + 1354 3349.4638 -19.272568 0.00036752025 14 + 1356 3304.6611 -13.811171 0.00036752025 14 + 1358 3304.3632 -10.049667 0.00036752025 14 + 1360 3310.1505 -7.4676253 0.00036752025 14 + 1362 3324.0496 -5.5416893 0.00036752025 14 + 1364 3367.7593 -4.0623241 0.00036752025 14 + 1366 3397.9879 -2.7787434 0.00036752025 14 + 1368 3412.4534 -1.7492008 0.00036752025 14 + 1370 3427.9927 -1.147808 0.00036752025 14 + 1372 3421.2999 -0.84877502 0.00036752025 14 + 1374 3431.4368 -0.77334018 0.00036752025 14 + 1376 3461.4741 -0.86904112 0.00036752025 14 + 1378 3483.9644 -1.1476447 0.00036752025 14 + 1380 3505.0425 -1.6733489 0.00036752025 14 + 1382 3494.7077 -2.2709129 0.00036752025 14 + 1384 3454.6986 -2.73897 0.00036752025 14 + 1386 3423.1053 -3.040692 0.00036752025 14 + 1388 3393.9828 -3.1941004 0.00036752025 14 + 1390 3368.8365 -3.3149273 0.00036752025 14 + 1392 3357.374 -3.4753807 0.00036752025 14 + 1394 3338.6876 -3.5730386 0.00036752025 14 + 1396 3322.6963 -3.5669074 0.00036752025 14 + 1398 3317.4036 -3.5137605 0.00036752025 14 + 1400 3306.4233 -3.5036114 0.00036752025 14 + 1402 3294.3469 -3.6465019 0.00036752025 14 + 1404 3288.9613 -3.9285698 0.00036752025 14 + 1406 3281.6542 -4.2217607 0.00036752025 14 + 1408 3289.0894 -4.4494179 0.00036752025 14 + 1410 3305.4438 -4.5424443 0.00036752025 14 + 1412 3307.9857 -4.4630054 0.00036752025 14 + 1414 3295.9878 -4.2471632 0.00036752025 14 + 1416 3282.069 -3.9622413 0.00036752025 14 + 1418 3269.3405 -3.6259962 0.00036752025 14 + 1420 3272.8895 -3.2426864 0.00036752025 14 + 1422 3294.6417 -2.7828443 0.00036752025 14 + 1424 3307.614 -2.2516614 0.00036752025 14 + 1426 3315.9908 -1.8186677 0.00036752025 14 + 1428 3307.4338 -1.6062873 0.00036752025 14 + 1430 3362.0036 591.24602 0.00038913909 15 + 1432 3348.3711 -22.903151 0.00038913909 15 + 1434 3339.0009 -180.94362 0.00038913909 15 + 1436 3327.8309 -205.13316 0.00038913909 15 + 1438 3323.8846 -188.6757 0.00038913909 15 + 1440 3302.8168 -161.33916 0.00038913909 15 + 1442 3280.8634 -133.06553 0.00038913909 15 + 1444 3274.9669 -106.90061 0.00038913909 15 + 1446 3261.4086 -83.772906 0.00038913909 15 + 1448 3260.2033 -64.232762 0.00038913909 15 + 1450 3256.8934 -48.308404 0.00038913909 15 + 1452 3243.1338 -35.618715 0.00038913909 15 + 1454 3249.12 -25.595933 0.00038913909 15 + 1456 3257.8764 -17.638422 0.00038913909 15 + 1458 3248.4414 -11.467315 0.00038913909 15 + 1460 3237.7196 -7.1629632 0.00038913909 15 + 1462 3212.5536 -4.5262728 0.00038913909 15 + 1464 3207.8346 -3.1275511 0.00038913909 15 + 1466 3240.6709 -2.4532209 0.00038913909 15 + 1468 3274.7659 -1.9941312 0.00038913909 15 + 1470 3309.7636 -1.7744811 0.00038913909 15 + 1472 3319.9011 -2.0039409 0.00038913909 15 + 1474 3301.7286 -2.5404117 0.00038913909 15 + 1476 3304.5902 -3.015492 0.00038913909 15 + 1478 3324.5802 -3.0251512 0.00038913909 15 + 1480 3349.1191 -2.6296881 0.00038913909 15 + 1482 3386.3334 -2.3009124 0.00038913909 15 + 1484 3386.5448 -2.2135937 0.00038913909 15 + 1486 3360.3384 -2.1803619 0.00038913909 15 + 1488 3347.1255 -1.9008543 0.00038913909 15 + 1490 3332.276 -1.2843614 0.00038913909 15 + 1492 3332.4353 -0.78765054 0.00038913909 15 + 1494 3362.446 -0.90165015 0.00038913909 15 + 1496 3378.4951 -1.503457 0.00038913909 15 + 1498 3399.9682 -2.142196 0.00038913909 15 + 1500 3424.6642 -2.4001451 0.00038913909 15 + 1502 3415.6927 -2.3206656 0.00038913909 15 + 1504 3399.699 -2.4566927 0.00038913909 15 + 1506 3380.1726 -3.0059402 0.00038913909 15 + 1508 3356.1819 -3.5410815 0.00038913909 15 + 1510 3372.1715 -3.5489313 0.00038913909 15 + 1512 3407.3769 -2.8683598 0.00038913909 15 + 1514 3422.0433 -1.9562886 0.00038913909 15 + 1516 3438.5941 -1.4855083 0.00038913909 15 + 1518 3429.8051 -1.4723825 0.00038913909 15 + 1520 3417.385 -1.4858933 0.00038913909 15 + 1522 3440.37 -1.1865901 0.00038913909 15 + 1524 3458.4548 -0.67483073 0.00038913909 15 + 1526 3469.3533 -0.55678882 0.00038913909 15 + 1528 3490.916 -1.1714695 0.00038913909 15 + 1530 3492.0061 -2.0409487 0.00038913909 15 + 1532 3591.2065 933.33366 0.00041075793 16 + 1534 3613.996 28.275741 0.00041075793 16 + 1536 3592.9837 -172.35131 0.00041075793 16 + 1538 3576.1566 -203.31573 0.00041075793 16 + 1540 3569.3197 -188.5623 0.00041075793 16 + 1542 3559.2173 -161.72853 0.00041075793 16 + 1544 3581.5844 -132.85329 0.00041075793 16 + 1546 3598.8905 -105.35356 0.00041075793 16 + 1548 3591.8015 -81.305445 0.00041075793 16 + 1550 3601.2781 -61.769959 0.00041075793 16 + 1552 3610.8049 -46.305773 0.00041075793 16 + 1554 3635.071 -33.909703 0.00041075793 16 + 1556 3673.1152 -23.903242 0.00041075793 16 + 1558 3674.3301 -16.196577 0.00041075793 16 + 1560 3656.4931 -10.875945 0.00041075793 16 + 1562 3635.4528 -7.5675014 0.00041075793 16 + 1564 3605.0214 -5.4309671 0.00041075793 16 + 1566 3597.8995 -3.8836753 0.00041075793 16 + 1568 3589.3965 -2.7710753 0.00041075793 16 + 1570 3557.0846 -2.1656742 0.00041075793 16 + 1572 3522.8206 -2.1249828 0.00041075793 16 + 1574 3488.0784 -2.3270696 0.00041075793 16 + 1576 3468.5242 -2.3006944 0.00041075793 16 + 1578 3480.3442 -1.9105952 0.00041075793 16 + 1580 3502.4035 -1.4703121 0.00041075793 16 + 1582 3514.5124 -1.3686635 0.00041075793 16 + 1584 3529.8072 -1.6349027 0.00041075793 16 + 1586 3549.9111 -1.8290023 0.00041075793 16 + 1588 3581.7588 -1.6259883 0.00041075793 16 + 1590 3627.3261 -1.2043943 0.00041075793 16 + 1592 3670.0906 -1.032423 0.00041075793 16 + 1594 3693.8859 -1.3608622 0.00041075793 16 + 1596 3716.2459 -2.0059406 0.00041075793 16 + 1598 3731.9525 -2.5008352 0.00041075793 16 + 1600 3743.6525 -2.6784874 0.00041075793 16 + 1602 3760.9905 -2.7998984 0.00041075793 16 + 1604 3761.3113 -3.1223193 0.00041075793 16 + 1606 3748.8697 -3.6314108 0.00041075793 16 + 1608 3739.8794 -3.9850298 0.00041075793 16 + 1610 3722.0372 -3.8300328 0.00041075793 16 + 1612 3715.944 -3.30415 0.00041075793 16 + 1614 3712.6256 -2.7922936 0.00041075793 16 + 1616 3689.1991 -2.5191961 0.00041075793 16 + 1618 3674.8638 -2.4644698 0.00041075793 16 + 1620 3656.7564 -2.3324852 0.00041075793 16 + 1622 3635.8706 -2.016391 0.00041075793 16 + 1624 3634.1611 -1.7433529 0.00041075793 16 + 1626 3612.7237 -1.6722602 0.00041075793 16 + 1628 3577.439 -1.84882 0.00041075793 16 + 1630 3562.4417 -2.128466 0.00041075793 16 + 1632 3549.0826 -2.2282459 0.00041075793 16 + 1634 3632.1374 -186.35031 0.00043237677 17 + 1636 3648.9593 -296.79359 0.00043237677 17 + 1638 3641.3738 -282.99578 0.00043237677 17 + 1640 3650.8687 -244.99487 0.00043237677 17 + 1642 3673.7223 -204.09587 0.00043237677 17 + 1644 3690.3923 -166.23129 0.00043237677 17 + 1646 3717.9157 -133.14546 0.00043237677 17 + 1648 3718.0414 -104.89207 0.00043237677 17 + 1650 3697.4633 -81.115712 0.00043237677 17 + 1652 3705.0511 -61.49637 0.00043237677 17 + 1654 3714.781 -45.659171 0.00043237677 17 + 1656 3730.9613 -33.243337 0.00043237677 17 + 1658 3741.1851 -23.708946 0.00043237677 17 + 1660 3717.9711 -16.478718 0.00043237677 17 + 1662 3701.7524 -11.228053 0.00043237677 17 + 1664 3711.2786 -7.6811287 0.00043237677 17 + 1666 3729.4217 -5.4701745 0.00043237677 17 + 1668 3756.06 -4.196296 0.00043237677 17 + 1670 3762.1859 -3.3948328 0.00043237677 17 + 1672 3750.3442 -2.795002 0.00043237677 17 + 1674 3750.3911 -2.3631317 0.00043237677 17 + 1676 3743.935 -2.1198915 0.00043237677 17 + 1678 3733.116 -2.0433621 0.00043237677 17 + 1680 3711.4814 -1.9570085 0.00043237677 17 + 1682 3673.0703 -1.7553287 0.00043237677 17 + 1684 3640.8032 -1.6100182 0.00043237677 17 + 1686 3623.5278 -1.7720453 0.00043237677 17 + 1688 3609.6657 -2.2903733 0.00043237677 17 + 1690 3595.0925 -2.9520482 0.00043237677 17 + 1692 3574.7946 -3.4520403 0.00043237677 17 + 1694 3553.4592 -3.7172417 0.00043237677 17 + 1696 3550.4998 -3.9662696 0.00043237677 17 + 1698 3573.0918 -4.3864824 0.00043237677 17 + 1700 3608.4812 -4.8143282 0.00043237677 17 + 1702 3649.7102 -4.8822052 0.00043237677 17 + 1704 3691.715 -4.4058032 0.00043237677 17 + 1706 3712.538 -3.5738906 0.00043237677 17 + 1708 3723.8041 -2.8233117 0.00043237677 17 + 1710 3728.6131 -2.3180266 0.00043237677 17 + 1712 3721.5916 -1.8298925 0.00043237677 17 + 1714 3722.2323 -1.145955 0.00043237677 17 + 1716 3720.8412 -0.35106009 0.00043237677 17 + 1718 3704.2798 0.13931625 0.00043237677 17 + 1720 3691.24 0.0070879972 0.00043237677 17 + 1722 3664.7923 -0.49492297 0.00043237677 17 + 1724 3636.2585 -0.93235898 0.00043237677 17 + 1726 3623.6805 -1.0766384 0.00043237677 17 + 1728 3601.4828 -1.0674569 0.00043237677 17 + 1730 3594.1993 -1.2953611 0.00043237677 17 + 1732 3595.7016 -1.7010658 0.00043237677 17 + 1734 3584.1108 -1.801104 0.00043237677 17 + 1736 3713.9177 157.48163 0.00045399561 18 + 1738 3729.1228 -244.26726 0.00045399561 18 + 1740 3729.6815 -300.0614 0.00045399561 18 + 1742 3750.7503 -278.25336 0.00045399561 18 + 1744 3748.1243 -238.83242 0.00045399561 18 + 1746 3741.9127 -197.8389 0.00045399561 18 + 1748 3755.7248 -160.28928 0.00045399561 18 + 1750 3749.7764 -127.74147 0.00045399561 18 + 1752 3753.2746 -100.53428 0.00045399561 18 + 1754 3765.3549 -78.121856 0.00045399561 18 + 1756 3759.2282 -59.655351 0.00045399561 18 + 1758 3775.6312 -44.626232 0.00045399561 18 + 1760 3784.8396 -32.615627 0.00045399561 18 + 1762 3771.0752 -23.447131 0.00045399561 18 + 1764 3780.4144 -16.86878 0.00045399561 18 + 1766 3782.4234 -12.0877 0.00045399561 18 + 1768 3794.5104 -8.4068303 0.00045399561 18 + 1770 3824.6482 -5.5286928 0.00045399561 18 + 1772 3824.8005 -3.4631071 0.00045399561 18 + 1774 3824.9637 -2.4005261 0.00045399561 18 + 1776 3832.2073 -2.0425462 0.00045399561 18 + 1778 3824.1265 -1.7381825 0.00045399561 18 + 1780 3826.3354 -1.2396341 0.00045399561 18 + 1782 3822.7018 -0.70624837 0.00045399561 18 + 1784 3803.6551 -0.51472634 0.00045399561 18 + 1786 3799.9592 -0.8237544 0.00045399561 18 + 1788 3798.5286 -1.2770654 0.00045399561 18 + 1790 3792.3951 -1.4626882 0.00045399561 18 + 1792 3788.7063 -1.3397023 0.00045399561 18 + 1794 3777.0686 -1.1815152 0.00045399561 18 + 1796 3779.2508 -1.2957126 0.00045399561 18 + 1798 3807.3391 -1.6056954 0.00045399561 18 + 1800 3840.8603 -1.7394881 0.00045399561 18 + 1802 3867.8952 -1.5119262 0.00045399561 18 + 1804 3879.448 -1.1126446 0.00045399561 18 + 1806 3874.0178 -0.89376073 0.00045399561 18 + 1808 3870.4205 -1.0013994 0.00045399561 18 + 1810 3874.9689 -1.1896861 0.00045399561 18 + 1812 3882.7366 -1.1347346 0.00045399561 18 + 1814 3893.4144 -0.80375709 0.00045399561 18 + 1816 3892.8065 -0.43723593 0.00045399561 18 + 1818 3879.6317 -0.27127498 0.00045399561 18 + 1820 3863.231 -0.26927869 0.00045399561 18 + 1822 3839.1828 -0.16469626 0.00045399561 18 + 1824 3817.7643 0.17259437 0.00045399561 18 + 1826 3814.5806 0.55900288 0.00045399561 18 + 1828 3814.4881 0.73981688 0.00045399561 18 + 1830 3826.593 0.61721493 0.00045399561 18 + 1832 3850.1378 0.38603904 0.00045399561 18 + 1834 3867.6612 0.31140301 0.00045399561 18 + 1836 3881.9933 0.36675857 0.00045399561 18 + 1838 4088.212 261434.69 0.00047561445 19 + 1840 4096.5564 27676.737 0.00047561445 19 + 1842 4116.6104 4562.7115 0.00047561445 19 + 1844 4138.3331 942.30407 0.00047561445 19 + 1846 4157.8346 171.41233 0.00047561445 19 + 1848 4189.7389 -26.014237 0.00047561445 19 + 1850 4203.2273 -76.212233 0.00047561445 19 + 1852 4206.7084 -81.595913 0.00047561445 19 + 1854 4214.7407 -72.613587 0.00047561445 19 + 1856 4219.541 -59.566243 0.00047561445 19 + 1858 4238.5637 -46.274295 0.00047561445 19 + 1860 4268.5595 -34.588591 0.00047561445 19 + 1862 4277.6539 -25.225003 0.00047561445 19 + 1864 4285.3854 -18.06534 0.00047561445 19 + 1866 4276.8633 -12.627639 0.00047561445 19 + 1868 4255.485 -8.5283892 0.00047561445 19 + 1870 4248.7917 -5.6394153 0.00047561445 19 + 1872 4232.7796 -3.7373251 0.00047561445 19 + 1874 4213.674 -2.5982718 0.00047561445 19 + 1876 4196.3767 -1.8849709 0.00047561445 19 + 1878 4154.9323 -1.2753507 0.00047561445 19 + 1880 4121.2743 -0.82249822 0.00047561445 19 + 1882 4101.6239 -0.60366804 0.00047561445 19 + 1884 4076.731 -0.62133231 0.00047561445 19 + 1886 4071.191 -0.92478991 0.00047561445 19 + 1888 4070.5745 -1.3485064 0.00047561445 19 + 1890 4073.0041 -1.8304913 0.00047561445 19 + 1892 4099.534 -2.4147085 0.00047561445 19 + 1894 4122.2249 -3.0099619 0.00047561445 19 + 1896 4134.95 -3.5440729 0.00047561445 19 + 1898 4138.662 -3.8951738 0.00047561445 19 + 1900 4119.9803 -3.9477528 0.00047561445 19 + 1902 4105.9779 -3.7437217 0.00047561445 19 + 1904 4103.6993 -3.3264299 0.00047561445 19 + 1906 4099.5993 -2.7195122 0.00047561445 19 + 1908 4099.0927 -2.0152229 0.00047561445 19 + 1910 4092.7303 -1.3051093 0.00047561445 19 + 1912 4079.7989 -0.70887774 0.00047561445 19 + 1914 4070.1861 -0.30814281 0.00047561445 19 + 1916 4064.2331 -0.12483815 0.00047561445 19 + 1918 4057.4172 -0.14863786 0.00047561445 19 + 1920 4045.7673 -0.36919485 0.00047561445 19 + 1922 4025.2377 -0.75787503 0.00047561445 19 + 1924 3997.6829 -1.2270004 0.00047561445 19 + 1926 3973.4154 -1.6380242 0.00047561445 19 + 1928 3967.2261 -1.8579591 0.00047561445 19 + 1930 3984.008 -1.8481876 0.00047561445 19 + 1932 4014.2028 -1.695545 0.00047561445 19 + 1934 4040.7038 -1.4466441 0.00047561445 19 + 1936 4046.6823 -1.0457806 0.00047561445 19 + 1938 4050.3414 -0.43691244 0.00047561445 19 + 1940 4158.8456 -485.87062 0.00049723329 20 + 1942 4138.6859 -406.83847 0.00049723329 20 + 1944 4122.6253 -337.57463 0.00049723329 20 + 1946 4101.6274 -277.34116 0.00049723329 20 + 1948 4085.2854 -225.34082 0.00049723329 20 + 1950 4088.9637 -181.0183 0.00049723329 20 + 1952 4109.9585 -143.74698 0.00049723329 20 + 1954 4141.6977 -112.7839 0.00049723329 20 + 1956 4173.9013 -87.397165 0.00049723329 20 + 1958 4185.8014 -66.686886 0.00049723329 20 + 1960 4182.5342 -49.929089 0.00049723329 20 + 1962 4173.7911 -36.539866 0.00049723329 20 + 1964 4164.6792 -26.055513 0.00049723329 20 + 1966 4166.91 -18.173563 0.00049723329 20 + 1968 4170.7606 -12.411793 0.00049723329 20 + 1970 4168.2387 -8.2434854 0.00049723329 20 + 1972 4167.5496 -5.3241601 0.00049723329 20 + 1974 4165.6717 -3.4268698 0.00049723329 20 + 1976 4171.0255 -2.459824 0.00049723329 20 + 1978 4186.2281 -2.210817 0.00049723329 20 + 1980 4200.046 -2.2265372 0.00049723329 20 + 1982 4214.8919 -2.1835848 0.00049723329 20 + 1984 4230.6418 -1.9876854 0.00049723329 20 + 1986 4242.4071 -1.7430167 0.00049723329 20 + 1988 4252.8222 -1.6283597 0.00049723329 20 + 1990 4255.8615 -1.5968122 0.00049723329 20 + 1992 4261.9838 -1.4850549 0.00049723329 20 + 1994 4280.013 -1.1801127 0.00049723329 20 + 1996 4298.903 -0.75483617 0.00049723329 20 + 1998 4315.3363 -0.43775783 0.00049723329 20 + 2000 4312.8744 -0.26775056 0.00049723329 20 + 2002 4295.4994 -0.071325246 0.00049723329 20 + 2004 4276.0581 0.34550495 0.00049723329 20 + 2006 4259.7706 1.0097526 0.00049723329 20 + 2008 4259.7877 1.6450507 0.00049723329 20 + 2010 4266.37 1.9897528 0.00049723329 20 + 2012 4263.4827 2.1177927 0.00049723329 20 + 2014 4268.7607 2.2393951 0.00049723329 20 + 2016 4281.4665 2.4617856 0.00049723329 20 + 2018 4299.8629 2.6164942 0.00049723329 20 + 2020 4332.5133 2.4169235 0.00049723329 20 + 2022 4350.4848 1.8843467 0.00049723329 20 + 2024 4354.7043 1.2629554 0.00049723329 20 + 2026 4348.8078 0.82057161 0.00049723329 20 + 2028 4326.3199 0.59662969 0.00049723329 20 + 2030 4306.4246 0.32430208 0.00049723329 20 + 2032 4292.6428 -0.17386259 0.00049723329 20 + 2034 4285.4709 -0.76060626 0.00049723329 20 + 2036 4289.9933 -1.1707279 0.00049723329 20 + 2038 4289.6574 -1.2615962 0.00049723329 20 + 2040 4289.8823 -1.2227653 0.00049723329 20 + 2042 4372.236 -484.15319 0.00051885212 21 + 2044 4363.8565 -409.58287 0.00051885212 21 + 2046 4374.4373 -342.09516 0.00051885212 21 + 2048 4397.6019 -282.27516 0.00051885212 21 + 2050 4419.5998 -230.19598 0.00051885212 21 + 2052 4444.6113 -185.83214 0.00051885212 21 + 2054 4463.2143 -148.62046 0.00051885212 21 + 2056 4483.7739 -117.65238 0.00051885212 21 + 2058 4502.9214 -92.03373 0.00051885212 21 + 2060 4499.5116 -70.903642 0.00051885212 21 + 2062 4485.0808 -53.819643 0.00051885212 21 + 2064 4460.1892 -40.351592 0.00051885212 21 + 2066 4441.3547 -29.893614 0.00051885212 21 + 2068 4453.6573 -21.870035 0.00051885212 21 + 2070 4471.3583 -15.74966 0.00051885212 21 + 2072 4481.8502 -11.269104 0.00051885212 21 + 2074 4482.5479 -8.2901014 0.00051885212 21 + 2076 4458.9428 -6.4842891 0.00051885212 21 + 2078 4440.2746 -5.4884006 0.00051885212 21 + 2080 4430.7879 -4.8831169 0.00051885212 21 + 2082 4418.2045 -4.3334616 0.00051885212 21 + 2084 4420.9827 -3.8690608 0.00051885212 21 + 2086 4415.2895 -3.4747959 0.00051885212 21 + 2088 4403.2127 -3.0698792 0.00051885212 21 + 2090 4404.9829 -2.6092157 0.00051885212 21 + 2092 4394.4738 -2.0329887 0.00051885212 21 + 2094 4381.445 -1.4800426 0.00051885212 21 + 2096 4382.9362 -1.087972 0.00051885212 21 + 2098 4380.2994 -0.77244565 0.00051885212 21 + 2100 4394.8792 -0.49150427 0.00051885212 21 + 2102 4420.8861 -0.20635176 0.00051885212 21 + 2104 4429.8268 0.0310276 0.00051885212 21 + 2106 4440.2236 0.055920203 0.00051885212 21 + 2108 4439.1631 -0.098651465 0.00051885212 21 + 2110 4427.5624 -0.31987022 0.00051885212 21 + 2112 4425.6367 -0.54703789 0.00051885212 21 + 2114 4413.4448 -0.71799966 0.00051885212 21 + 2116 4390.8139 -0.88704628 0.00051885212 21 + 2118 4370.4401 -1.0790848 0.00051885212 21 + 2120 4341.8148 -1.1893832 0.00051885212 21 + 2122 4323.8283 -1.1913674 0.00051885212 21 + 2124 4316.3088 -1.0938027 0.00051885212 21 + 2126 4303.2157 -0.92089888 0.00051885212 21 + 2128 4293.2329 -0.72556801 0.00051885212 21 + 2130 4277.4687 -0.470313 0.00051885212 21 + 2132 4254.036 -0.18509838 0.00051885212 21 + 2134 4238.7708 0.0079755602 0.00051885212 21 + 2136 4226.4974 0.040694129 0.00051885212 21 + 2138 4216.435 -0.083088073 0.00051885212 21 + 2140 4210.2068 -0.27891332 0.00051885212 21 + 2142 4190.1478 -0.45071942 0.00051885212 21 + 2144 4358.0641 7552.2519 0.00054047096 22 + 2146 4343.8669 2546.2605 0.00054047096 22 + 2148 4337.8495 832.13859 0.00054047096 22 + 2150 4344.8145 161.37654 0.00054047096 22 + 2152 4354.659 -102.52396 0.00054047096 22 + 2154 4351.261 -186.01241 0.00054047096 22 + 2156 4338.2721 -196.408 0.00054047096 22 + 2158 4326.0159 -183.30606 0.00054047096 22 + 2160 4316.8225 -163.19657 0.00054047096 22 + 2162 4315.5646 -139.65485 0.00054047096 22 + 2164 4318.7228 -112.47106 0.00054047096 22 + 2166 4308.7441 -86.692739 0.00054047096 22 + 2168 4296.5417 -64.897163 0.00054047096 22 + 2170 4295.1338 -47.217693 0.00054047096 22 + 2172 4296.3245 -33.218667 0.00054047096 22 + 2174 4309.7186 -22.42771 0.00054047096 22 + 2176 4322.8738 -14.380445 0.00054047096 22 + 2178 4325.1652 -8.7240076 0.00054047096 22 + 2180 4339.5136 -5.1399194 0.00054047096 22 + 2182 4359.4978 -3.125563 0.00054047096 22 + 2184 4374.7235 -2.1060967 0.00054047096 22 + 2186 4392.561 -1.6122362 0.00054047096 22 + 2188 4391.6476 -1.3419931 0.00054047096 22 + 2190 4375.4402 -1.2451958 0.00054047096 22 + 2192 4370.8847 -1.2691448 0.00054047096 22 + 2194 4362.5429 -1.1671537 0.00054047096 22 + 2196 4357.6371 -0.78265168 0.00054047096 22 + 2198 4353.2768 -0.1660927 0.00054047096 22 + 2200 4327.6061 0.4949875 0.00054047096 22 + 2202 4303.2649 0.97439091 0.00054047096 22 + 2204 4295.6358 1.2953222 0.00054047096 22 + 2206 4299.8451 1.6516724 0.00054047096 22 + 2208 4331.8468 2.0778491 0.00054047096 22 + 2210 4369.8179 2.4301813 0.00054047096 22 + 2212 4390.4687 2.4771921 0.00054047096 22 + 2214 4410.043 2.0979253 0.00054047096 22 + 2216 4420.4824 1.5015737 0.00054047096 22 + 2218 4428.5418 0.9293217 0.00054047096 22 + 2220 4438.6351 0.4452181 0.00054047096 22 + 2222 4429.7042 -0.022725602 0.00054047096 22 + 2224 4410.5614 -0.57362223 0.00054047096 22 + 2226 4394.6197 -1.1018693 0.00054047096 22 + 2228 4377.6656 -1.356307 0.00054047096 22 + 2230 4369.9848 -1.2799089 0.00054047096 22 + 2232 4359.5241 -1.033239 0.00054047096 22 + 2234 4329.7464 -0.87111314 0.00054047096 22 + 2236 4297.4136 -0.92360827 0.00054047096 22 + 2238 4274.4896 -1.0300654 0.00054047096 22 + 2240 4273.3355 -0.99506577 0.00054047096 22 + 2242 4299.8049 -0.84965213 0.00054047096 22 + 2244 4375.9624 -0.73547198 0.00054047096 22 + 2246 4419.4249 -428.66499 0.0005620898 23 + 2248 4440.1921 -357.75283 0.0005620898 23 + 2250 4458.4562 -295.72755 0.0005620898 23 + 2252 4483.515 -241.53239 0.0005620898 23 + 2254 4521.6264 -194.6715 0.0005620898 23 + 2256 4558.4436 -154.95368 0.0005620898 23 + 2258 4584.9658 -121.92313 0.0005620898 23 + 2260 4603.2392 -94.63205 0.0005620898 23 + 2262 4610.9187 -72.117113 0.0005620898 23 + 2264 4620.6516 -53.81207 0.0005620898 23 + 2266 4641.2237 -39.52074 0.0005620898 23 + 2268 4656.112 -28.916367 0.0005620898 23 + 2270 4661.2055 -21.28721 0.0005620898 23 + 2272 4654.102 -15.778242 0.0005620898 23 + 2274 4635.5037 -11.772833 0.0005620898 23 + 2276 4629.6411 -9.0646229 0.0005620898 23 + 2278 4644.5739 -7.5297271 0.0005620898 23 + 2280 4672.0076 -6.7876668 0.0005620898 23 + 2282 4715.8278 -6.3114881 0.0005620898 23 + 2284 4756.7958 -5.5841706 0.0005620898 23 + 2286 4786.6985 -4.5853628 0.0005620898 23 + 2288 4809.2288 -3.3898975 0.0005620898 23 + 2290 4814.2053 -2.5577365 0.0005620898 23 + 2292 4817.5747 -2.0119957 0.0005620898 23 + 2294 4838.8221 -1.5689555 0.0005620898 23 + 2296 4875.5697 -1.1551628 0.0005620898 23 + 2298 4930.9308 -0.81843584 0.0005620898 23 + 2300 4984.499 -0.82134226 0.0005620898 23 + 2302 5011.4719 -1.294796 0.0005620898 23 + 2304 5020.5621 -2.0456668 0.0005620898 23 + 2306 5009.736 -2.6179285 0.0005620898 23 + 2308 4995.1273 -3.3240647 0.0005620898 23 + 2310 4989.781 -4.1051438 0.0005620898 23 + 2312 4987.6058 -4.6474518 0.0005620898 23 + 2314 4993.5373 -5.2163273 0.0005620898 23 + 2316 5013.1231 -5.3993449 0.0005620898 23 + 2318 5032.7696 -5.1426741 0.0005620898 23 + 2320 5052.2507 -4.7378163 0.0005620898 23 + 2322 5066.676 -4.4309223 0.0005620898 23 + 2324 5070.9335 -4.011325 0.0005620898 23 + 2326 5075.3187 -3.575017 0.0005620898 23 + 2328 5080.1483 -2.937051 0.0005620898 23 + 2330 5089.0513 -2.218688 0.0005620898 23 + 2332 5106.4161 -1.5761829 0.0005620898 23 + 2334 5114.3901 -1.3379256 0.0005620898 23 + 2336 5111.765 -1.4168282 0.0005620898 23 + 2338 5109.8218 -1.3945147 0.0005620898 23 + 2340 5112.3651 -1.3179987 0.0005620898 23 + 2342 5129.4026 -1.1933029 0.0005620898 23 + 2344 5151.596 -1.1509356 0.0005620898 23 + 2346 5173.0185 -1.1910036 0.0005620898 23 + 2348 5397.9032 68.928762 0.00058370864 24 + 2350 5407.0266 -233.97041 0.00058370864 24 + 2352 5422.5601 -279.88482 0.00058370864 24 + 2354 5473.9255 -259.08824 0.00058370864 24 + 2356 5488.0698 -221.76737 0.00058370864 24 + 2358 5468.2353 -183.12481 0.00058370864 24 + 2360 5493.5403 -147.94875 0.00058370864 24 + 2362 5556.8153 -117.258 0.00058370864 24 + 2364 5476.495 -91.2006 0.00058370864 24 + 2366 5535.1518 -69.535188 0.00058370864 24 + 2368 5463.379 -52.175894 0.00058370864 24 + 2370 5406.5993 -38.635185 0.00058370864 24 + 2372 5379.6399 -28.053989 0.00058370864 24 + 2374 5293.9387 -19.606039 0.00058370864 24 + 2376 5254.14 -12.991082 0.00058370864 24 + 2378 5252.9692 -7.9447819 0.00058370864 24 + 2380 5190.6301 -4.2982853 0.00058370864 24 + 2382 5239.8106 -2.0984084 0.00058370864 24 + 2384 5265.9434 -0.66290855 0.00058370864 24 + 2386 5278.5471 0.24706688 0.00058370864 24 + 2388 5310.5694 0.81491696 0.00058370864 24 + 2390 5325.4843 0.83332156 0.00058370864 24 + 2392 5287.052 0.65384817 0.00058370864 24 + 2394 5217.4306 -0.2905052 0.00058370864 24 + 2396 5151.0811 -1.3614891 0.00058370864 24 + 2398 5089.4464 -2.1978833 0.00058370864 24 + 2400 5096.8527 -2.5845056 0.00058370864 24 + 2402 5081.1023 -2.6357504 0.00058370864 24 + 2404 5112.6314 -2.7644934 0.00058370864 24 + 2406 5098.9354 -2.724554 0.00058370864 24 + 2408 5027.2334 -2.6826803 0.00058370864 24 + 2410 4972.12 -2.1045636 0.00058370864 24 + 2412 4978.4482 -1.2633463 0.00058370864 24 + 2414 5015.2935 -0.8286916 0.00058370864 24 + 2416 5052.309 -0.81559079 0.00058370864 24 + 2418 5003.9654 -1.104621 0.00058370864 24 + 2420 4973.9856 -1.5018687 0.00058370864 24 + 2422 4949.7823 -1.6447218 0.00058370864 24 + 2424 4901.9468 -1.5725746 0.00058370864 24 + 2426 4945.389 -1.9278468 0.00058370864 24 + 2428 4973.9992 -2.4855638 0.00058370864 24 + 2430 4942.1022 -2.7325455 0.00058370864 24 + 2432 4934.3944 -2.6684489 0.00058370864 24 + 2434 4931.5278 -2.3317286 0.00058370864 24 + 2436 4815.7187 -1.7602239 0.00058370864 24 + 2438 4763.8819 -1.4516585 0.00058370864 24 + 2440 4827.3393 -1.5296665 0.00058370864 24 + 2442 4794.2051 -1.3026967 0.00058370864 24 + 2444 4784.3245 -0.9623875 0.00058370864 24 + 2446 4880.5328 -0.79855584 0.00058370864 24 + 2448 4892.9298 -0.48521837 0.00058370864 24 + 2450 5042.5229 182.15531 0.00060532748 25 + 2452 5194.8177 -126.79776 0.00060532748 25 + 2454 5156.6538 -209.68466 0.00060532748 25 + 2456 5136.7898 -214.15629 0.00060532748 25 + 2458 5190.4494 -191.92028 0.00060532748 25 + 2460 5193.0372 -162.44965 0.00060532748 25 + 2462 5135.1347 -132.94313 0.00060532748 25 + 2464 5088.2711 -105.26975 0.00060532748 25 + 2466 5044.2865 -80.777237 0.00060532748 25 + 2468 5030.1682 -60.734524 0.00060532748 25 + 2470 5014.4445 -44.886842 0.00060532748 25 + 2472 5005.9881 -32.581621 0.00060532748 25 + 2474 5084.7476 -23.310238 0.00060532748 25 + 2476 5139.566 -16.306979 0.00060532748 25 + 2478 5123.4439 -11.089426 0.00060532748 25 + 2480 5164.1777 -7.6656601 0.00060532748 25 + 2482 5166.1753 -5.6256871 0.00060532748 25 + 2484 5134.5927 -4.5032297 0.00060532748 25 + 2486 5177.4063 -3.9773157 0.00060532748 25 + 2488 5176.7834 -3.4385437 0.00060532748 25 + 2490 5169.781 -2.9064023 0.00060532748 25 + 2492 5201.8608 -2.6139644 0.00060532748 25 + 2494 5238.2059 -2.4480956 0.00060532748 25 + 2496 5254.5338 -2.3015056 0.00060532748 25 + 2498 5302.7629 -2.3369754 0.00060532748 25 + 2500 5270.998 -2.39524 0.00060532748 25 + 2502 5243.3575 -2.5889856 0.00060532748 25 + 2504 5243.4678 -2.9219197 0.00060532748 25 + 2506 5255.0345 -3.2719206 0.00060532748 25 + 2508 5235.6551 -3.4395484 0.00060532748 25 + 2510 5267.9805 -3.4601437 0.00060532748 25 + 2512 5261.7225 -3.2244038 0.00060532748 25 + 2514 5247.9792 -2.9449064 0.00060532748 25 + 2516 9386.5057 0.95935555 0.00060532748 25 + 2518 8507.1834 0.58218735 0.00060532748 25 + 2520 7456.5024 -1.7231674 0.00060532748 25 + 2522 6442.2381 -5.0299011 0.00060532748 25 + 2524 6243.5623 -4.3174698 0.00060532748 25 + 2526 7107.4023 -1.4486735 0.00060532748 25 + 2528 7462.5296 -1.6382013 0.00060532748 25 + 2530 7393.0945 -4.1006752 0.00060532748 25 + 2532 7446.8193 -4.961236 0.00060532748 25 + 2534 7814.2762 -3.5806698 0.00060532748 25 + 2536 7831.3195 -3.3453364 0.00060532748 25 + 2538 7269.6909 -4.5344277 0.00060532748 25 + 2540 6782.9301 -6.405289 0.00060532748 25 + 2542 6632.3199 -6.7366822 0.00060532748 25 + 2544 6843.4229 -5.4785068 0.00060532748 25 + 2546 7126.1657 -3.6868879 0.00060532748 25 + 2548 7320.2489 -2.1533112 0.00060532748 25 + 2550 7318.4623 -0.76400617 0.00060532748 25 + 2552 7319.7814 54889.243 0.00062694632 26 + 2554 7257.4954 4122.9284 0.00062694632 26 + 2556 7297.3206 322.50289 0.00062694632 26 + 2558 7268.0205 -127.41959 0.00062694632 26 + 2560 7199.2444 -173.52049 0.00062694632 26 + 2562 7087.7664 -155.56395 0.00062694632 26 + 2564 7071.1012 -128.16295 0.00062694632 26 + 2566 7136.41 -102.18408 0.00062694632 26 + 2568 7237.9761 -79.61277 0.00062694632 26 + 2570 7228.6075 -61.50493 0.00062694632 26 + 2572 6904.7633 -47.60803 0.00062694632 26 + 2574 6577.8766 -36.791331 0.00062694632 26 + 2576 6537.2024 -28.595961 0.00062694632 26 + 2578 6268.7053 -22.055058 0.00062694632 26 + 2580 6100.1948 -17.065896 0.00062694632 26 + 2582 6292.5224 -12.531749 0.00062694632 26 + 2584 6617.9859 -9.1082267 0.00062694632 26 + 2586 7058.3242 -6.5873287 0.00062694632 26 + 2588 7139.8019 -5.1508398 0.00062694632 26 + 2590 6870.0064 -4.7676802 0.00062694632 26 + 2592 6850.0669 -3.8204539 0.00062694632 26 + 2594 6914.4185 -2.4871515 0.00062694632 26 + 2596 6820.8591 -1.878383 0.00062694632 26 + 2598 6824.4608 -2.7091904 0.00062694632 26 + 2600 6605.8159 -4.055072 0.00062694632 26 + 2602 6601.1903 -4.9484338 0.00062694632 26 + 2604 6907.3437 -4.3220809 0.00062694632 26 + 2606 7033.6509 -2.8055047 0.00062694632 26 + 2608 7227.168 -1.8930939 0.00062694632 26 + 2610 7251.0672 -1.4869091 0.00062694632 26 + 2612 7140.7433 -1.9045777 0.00062694632 26 + 2614 7217.3576 -2.7698794 0.00062694632 26 + 2616 7199.0311 -3.015468 0.00062694632 26 + 2618 6902.2381 -3.091212 0.00062694632 26 + 2620 6760.3459 -4.3956075 0.00062694632 26 + 2622 6748.5752 -7.1577934 0.00062694632 26 + 2624 6498.4701 -9.9592243 0.00062694632 26 + 2626 6670.5347 -12.012125 0.00062694632 26 + 2628 6924.154 -11.6565 0.00062694632 26 + 2630 7093.9625 -10.6097 0.00062694632 26 + 2632 7200.2062 -9.6426422 0.00062694632 26 + 2634 6935.9294 -8.8684397 0.00062694632 26 + 2636 6515.3997 -7.626073 0.00062694632 26 + 2638 6642.2308 -5.9357977 0.00062694632 26 + 2640 6679.4207 -3.3768289 0.00062694632 26 + 2642 6391.0538 -0.45948537 0.00062694632 26 + 2644 6265.7264 1.2939434 0.00062694632 26 + 2646 6258.969 1.734008 0.00062694632 26 + 2648 6091.1112 1.7722562 0.00062694632 26 + 2650 6065.0546 1.4271238 0.00062694632 26 + 2652 6181.5247 0.9929013 0.00062694632 26 + 2654 6424.8373 2219.1488 0.00064856516 27 + 2656 6921.2471 293.11761 0.00064856516 27 + 2658 6763.5621 -107.46336 0.00064856516 27 + 2660 6599.8594 -186.27697 0.00064856516 27 + 2662 6734.0422 -184.24783 0.00064856516 27 + 2664 6874.8006 -160.69783 0.00064856516 27 + 2666 6818.3636 -132.93351 0.00064856516 27 + 2668 6701.1771 -104.71394 0.00064856516 27 + 2670 6352.4528 -80.998307 0.00064856516 27 + 2672 6092.4085 -60.899354 0.00064856516 27 + 2674 6194.4901 -43.587513 0.00064856516 27 + 2676 6358.7451 -28.845278 0.00064856516 27 + 2678 6360.9285 -17.879904 0.00064856516 27 + 2680 6361.5713 -11.346356 0.00064856516 27 + 2682 6205.8623 -7.4884075 0.00064856516 27 + 2684 6246.8348 -5.4773135 0.00064856516 27 + 2686 6328.5463 -4.3593929 0.00064856516 27 + 2688 6223.9976 -3.9407185 0.00064856516 27 + 2690 6106.554 -4.6997103 0.00064856516 27 + 2692 6168.4171 -6.396616 0.00064856516 27 + 2694 6139.2582 -7.8239605 0.00064856516 27 + 2696 6239.3903 -8.3808936 0.00064856516 27 + 2698 6405.2879 -7.5114356 0.00064856516 27 + 2700 6368.2 -5.6203059 0.00064856516 27 + 2702 6155.1715 -4.1491711 0.00064856516 27 + 2704 6110.6658 -4.0107178 0.00064856516 27 + 2706 5979.7665 -3.8463124 0.00064856516 27 + 2708 6010.5588 -3.0468839 0.00064856516 27 + 2710 6181.1661 -1.5749172 0.00064856516 27 + 2712 6203.6709 -0.24646367 0.00064856516 27 + 2714 6239.7545 -0.66240364 0.00064856516 27 + 2716 6231.4404 -2.7898432 0.00064856516 27 + 2718 5955.3416 -5.003216 0.00064856516 27 + 2720 5917.8094 -6.2365649 0.00064856516 27 + 2722 6133.6974 -6.0739996 0.00064856516 27 + 2724 6298.0231 -5.8507391 0.00064856516 27 + 2726 6295.3699 -6.3683403 0.00064856516 27 + 2728 6198.3701 -7.221616 0.00064856516 27 + 2730 6076.015 -7.0930518 0.00064856516 27 + 2732 6206.0761 -5.8369908 0.00064856516 27 + 2734 6402.0508 -3.7427091 0.00064856516 27 + 2736 6413.189 -1.9094711 0.00064856516 27 + 2738 6454.2519 -1.7466187 0.00064856516 27 + 2740 6325.859 -2.2413434 0.00064856516 27 + 2742 6111.4194 -2.2428871 0.00064856516 27 + 2744 6121.0656 -1.7522684 0.00064856516 27 + 2746 6100.9367 -0.85264856 0.00064856516 27 + 2748 5996.4279 -0.8861401 0.00064856516 27 + 2750 6087.5512 -2.86459 0.00064856516 27 + 2752 5977.3707 -4.7642892 0.00064856516 27 + 2754 5949.0314 -5.57108 0.00064856516 27 + 2756 6168.3001 -502.96405 0.00067018399 28 + 2758 6200.1666 -421.68078 0.00067018399 28 + 2760 6199.5233 -351.10973 0.00067018399 28 + 2762 6234.867 -290.73108 0.00067018399 28 + 2764 6145.1871 -238.129 0.00067018399 28 + 2766 6214.3271 -192.33635 0.00067018399 28 + 2768 6368.3971 -152.80846 0.00067018399 28 + 2770 6316.4154 -119.46414 0.00067018399 28 + 2772 6176.9381 -92.956853 0.00067018399 28 + 2774 6039.3515 -72.434763 0.00067018399 28 + 2776 5818.0769 -55.931431 0.00067018399 28 + 2778 5813.5845 -42.565903 0.00067018399 28 + 2780 5935.7699 -31.678196 0.00067018399 28 + 2782 6026.6265 -23.417297 0.00067018399 28 + 2784 6163.5786 -18.225936 0.00067018399 28 + 2786 6149.8745 -14.890416 0.00067018399 28 + 2788 6041.4351 -12.080924 0.00067018399 28 + 2790 6100.1736 -9.5414071 0.00067018399 28 + 2792 6155.6109 -7.3388116 0.00067018399 28 + 2794 6136.3566 -6.2777817 0.00067018399 28 + 2796 6233.5181 -6.6061357 0.00067018399 28 + 2798 6151.9289 -6.7000464 0.00067018399 28 + 2800 6149.1697 -6.2780785 0.00067018399 28 + 2802 6155.9502 -5.311202 0.00067018399 28 + 2804 6024.1889 -4.3462915 0.00067018399 28 + 2806 5814.2296 -4.3268369 0.00067018399 28 + 2808 5642.9582 -5.2793898 0.00067018399 28 + 2810 5489.9528 -5.9051947 0.00067018399 28 + 2812 5640.7395 -5.9161277 0.00067018399 28 + 2814 5867.8345 -5.2937198 0.00067018399 28 + 2816 5795.7842 -4.3726738 0.00067018399 28 + 2818 5772.502 -4.447022 0.00067018399 28 + 2820 5735.8177 -5.000363 0.00067018399 28 + 2822 5710.0201 -5.0628348 0.00067018399 28 + 2824 5803.017 -4.6695765 0.00067018399 28 + 2826 5948.378 -4.2654852 0.00067018399 28 + 2828 5799.0888 -3.9244904 0.00067018399 28 + 2830 5828.3752 -4.5740029 0.00067018399 28 + 2832 5857.1016 -5.2832346 0.00067018399 28 + 2834 5914.1322 -5.5653537 0.00067018399 28 + 2836 5990.9384 -5.6379058 0.00067018399 28 + 2838 6007.5684 -5.6062956 0.00067018399 28 + 2840 5829.1053 -5.3743156 0.00067018399 28 + 2842 5791.7935 -5.6582957 0.00067018399 28 + 2844 5742.0248 -5.7669999 0.00067018399 28 + 2846 5708.8683 -5.3776393 0.00067018399 28 + 2848 5749.821 -4.8787238 0.00067018399 28 + 2850 5657.0082 -4.1285659 0.00067018399 28 + 2852 5432.8302 -3.3817137 0.00067018399 28 + 2854 5533.1251 -3.8163493 0.00067018399 28 + 2856 5482.4779 -4.5210162 0.00067018399 28 + 2858 5591.5068 10078.074 0.00069180283 29 + 2860 5778.3182 2704.4963 0.00069180283 29 + 2862 5847.8595 810.6613 0.00069180283 29 + 2864 5780.7049 201.58307 0.00069180283 29 + 2866 5919.307 -8.6409893 0.00069180283 29 + 2868 5763.9112 -77.4425 0.00069180283 29 + 2870 5733.7145 -93.233219 0.00069180283 29 + 2872 5985.537 -88.415968 0.00069180283 29 + 2874 6080.6283 -74.305612 0.00069180283 29 + 2876 6090.1818 -57.746325 0.00069180283 29 + 2878 6107.0505 -43.215804 0.00069180283 29 + 2880 5885.3318 -31.303514 0.00069180283 29 + 2882 5787.2313 -22.357492 0.00069180283 29 + 2884 5814.9848 -15.721607 0.00069180283 29 + 2886 5761.2585 -10.771597 0.00069180283 29 + 2888 5766.2082 -8.1764598 0.00069180283 29 + 2890 5873.2138 -7.9116826 0.00069180283 29 + 2892 5706.8186 -8.5071977 0.00069180283 29 + 2894 5700.4979 -9.633124 0.00069180283 29 + 2896 5775.3092 -10.201491 0.00069180283 29 + 2898 5735.4239 -9.8614201 0.00069180283 29 + 2900 5772.5573 -9.685071 0.00069180283 29 + 2902 5709.1096 -9.5318564 0.00069180283 29 + 2904 5551.0836 -8.8045992 0.00069180283 29 + 2906 5649.2227 -7.7078543 0.00069180283 29 + 2908 5767.7144 -5.9888551 0.00069180283 29 + 2910 5685.6769 -3.9843168 0.00069180283 29 + 2912 5750.8035 -3.4358816 0.00069180283 29 + 2914 5685.1406 -4.1156501 0.00069180283 29 + 2916 5505.4975 -5.403883 0.00069180283 29 + 2918 5490.2947 -6.8502363 0.00069180283 29 + 2920 5536.8914 -7.5189219 0.00069180283 29 + 2922 5496.4424 -7.3732427 0.00069180283 29 + 2924 5642.5452 -7.7426445 0.00069180283 29 + 2926 5754.7018 -8.3314405 0.00069180283 29 + 2928 5759.3596 -8.5512801 0.00069180283 29 + 2930 5792.0267 -8.099821 0.00069180283 29 + 2932 5801.987 -6.4894218 0.00069180283 29 + 2934 5746.5527 -4.3364038 0.00069180283 29 + 2936 5743.5356 -2.9292564 0.00069180283 29 + 2938 5685.0191 -2.4294109 0.00069180283 29 + 2940 5730.6318 -2.860644 0.00069180283 29 + 2942 5731.5701 -3.2060076 0.00069180283 29 + 2944 5712.3417 -3.0747772 0.00069180283 29 + 2946 5665.4763 -3.0937864 0.00069180283 29 + 2948 5596.5544 -4.1080737 0.00069180283 29 + 2950 5542.4037 -6.0051076 0.00069180283 29 + 2952 5465.4003 -7.5490741 0.00069180283 29 + 2954 5583.7596 -8.0210846 0.00069180283 29 + 2956 5701.9248 -6.8321071 0.00069180283 29 + 2958 5821.9578 -5.0270435 0.00069180283 29 + 2960 5850.2436 514.0434 0.00071342167 30 + 2962 5791.4468 -87.030472 0.00071342167 30 + 2964 5717.9478 -211.55977 0.00071342167 30 + 2966 5807.1386 -219.55844 0.00071342167 30 + 2968 5866.1488 -195.46533 0.00071342167 30 + 2970 5932.636 -164.42409 0.00071342167 30 + 2972 5942.7119 -134.62158 0.00071342167 30 + 2974 5979.5468 -108.05836 0.00071342167 30 + 2976 6025.3658 -85.448875 0.00071342167 30 + 2978 6110.1521 -66.41261 0.00071342167 30 + 2980 5998.4298 -49.910358 0.00071342167 30 + 2982 5918.6623 -36.60286 0.00071342167 30 + 2984 5925.5844 -27.063497 0.00071342167 30 + 2986 5942.9082 -20.683476 0.00071342167 30 + 2988 5933.1561 -16.149401 0.00071342167 30 + 2990 5929.1714 -12.435952 0.00071342167 30 + 2992 5804.6884 -9.1026254 0.00071342167 30 + 2994 5807.1997 -7.4074003 0.00071342167 30 + 2996 5985.8022 -8.0762634 0.00071342167 30 + 2998 6074.3192 -9.8687069 0.00071342167 30 + 3000 6057.21 -11.174731 0.00071342167 30 + 3002 6075.007 -11.18421 0.00071342167 30 + 3004 5987.3479 -9.9453679 0.00071342167 30 + 3006 5938.4103 -9.0724861 0.00071342167 30 + 3008 5965.8705 -9.4340001 0.00071342167 30 + 3010 5831.196 -9.6673274 0.00071342167 30 + 3012 5870.4376 -8.9025524 0.00071342167 30 + 3014 6016.8784 -6.7616353 0.00071342167 30 + 3016 6010.2107 -3.9697169 0.00071342167 30 + 3018 5901.2968 -2.2568406 0.00071342167 30 + 3020 5891.3535 -2.4619728 0.00071342167 30 + 3022 5730.7697 -2.976375 0.00071342167 30 + 3024 5791.9086 -3.3552926 0.00071342167 30 + 3026 5971.9658 -3.4478784 0.00071342167 30 + 3028 5936.4761 -3.3852394 0.00071342167 30 + 3030 5879.7002 -4.2155063 0.00071342167 30 + 3032 5987.2131 -5.9104065 0.00071342167 30 + 3034 5909.6393 -6.7430419 0.00071342167 30 + 3036 5930.3171 -6.9249843 0.00071342167 30 + 3038 6002.1527 -6.6931199 0.00071342167 30 + 3040 5861.3782 -6.0527004 0.00071342167 30 + 3042 5943.0923 -6.1447396 0.00071342167 30 + 3044 6092.86 -6.4979286 0.00071342167 30 + 3046 6112.986 -6.1871845 0.00071342167 30 + 3048 6270.5634 -5.9882772 0.00071342167 30 + 3050 6246.169 -5.7206045 0.00071342167 30 + 3052 5932.2093 -5.3402899 0.00071342167 30 + 3054 5962.298 -5.8792443 0.00071342167 30 + 3056 5945.843 -6.3127283 0.00071342167 30 + 3058 5850.2141 -6.2687421 0.00071342167 30 + 3060 6099.1919 -6.4263983 0.00071342167 30 + 3062 6152.4698 -469.77342 0.00073504051 31 + 3064 6138.1145 -392.89964 0.00073504051 31 + 3066 6382.1353 -325.82599 0.00073504051 31 + 3068 6368.2319 -267.16804 0.00073504051 31 + 3070 6125.653 -216.23268 0.00073504051 31 + 3072 6199.1075 -173.3993 0.00073504051 31 + 3074 6096.9277 -137.0472 0.00073504051 31 + 3076 6128.4594 -107.02373 0.00073504051 31 + 3078 6410.6432 -83.027038 0.00073504051 31 + 3080 6322.4331 -63.707564 0.00073504051 31 + 3082 6315.6655 -49.044238 0.00073504051 31 + 3084 6384.5813 -37.987635 0.00073504051 31 + 3086 6188.1184 -29.028204 0.00073504051 31 + 3088 6164.6018 -22.005531 0.00073504051 31 + 3090 6302.5303 -16.935448 0.00073504051 31 + 3092 6102.2188 -12.750503 0.00073504051 31 + 3094 6294.5805 -10.162155 0.00073504051 31 + 3096 6324.6812 -7.9212694 0.00073504051 31 + 3098 6098.5679 -5.6224283 0.00073504051 31 + 3100 6170.6064 -3.8113122 0.00073504051 31 + 3102 6268.1523 -2.7517092 0.00073504051 31 + 3104 6042.0518 -1.8996674 0.00073504051 31 + 3106 6371.1553 -2.4739165 0.00073504051 31 + 3108 6353.1109 -2.7139113 0.00073504051 31 + 3110 6155.2247 -2.7357849 0.00073504051 31 + 3112 6265.3662 -3.223482 0.00073504051 31 + 3114 6241.3622 -4.0149702 0.00073504051 31 + 3116 6026.8144 -4.4794651 0.00073504051 31 + 3118 6336.8211 -5.1949313 0.00073504051 31 + 3120 6304.3565 -4.630181 0.00073504051 31 + 3122 6259.2538 -3.5862159 0.00073504051 31 + 3124 6498.2926 -2.9770889 0.00073504051 31 + 3126 6389.8215 -2.3360455 0.00073504051 31 + 3128 6281.7573 -2.0155584 0.00073504051 31 + 3130 6448.7884 -2.2898794 0.00073504051 31 + 3132 6286.5504 -2.1732695 0.00073504051 31 + 3134 6241.8976 -2.4301197 0.00073504051 31 + 3136 6426.9385 -3.514538 0.00073504051 31 + 3138 6176.719 -4.2352839 0.00073504051 31 + 3140 6251.0935 -5.3401436 0.00073504051 31 + 3142 6316.957 -6.0235141 0.00073504051 31 + 3144 6189.9851 -6.0207255 0.00073504051 31 + 3146 6304.8428 -6.0123423 0.00073504051 31 + 3148 6464.3347 -6.159424 0.00073504051 31 + 3150 6195.2089 -5.5140135 0.00073504051 31 + 3152 6380.3579 -5.2160781 0.00073504051 31 + 3154 6286.0613 -4.0278311 0.00073504051 31 + 3156 6080.0756 -2.6145134 0.00073504051 31 + 3158 6229.7127 -1.7227016 0.00073504051 31 + 3160 6303.2142 -1.1585329 0.00073504051 31 + 3162 6097.9077 -0.40806897 0.00073504051 31 + 3164 6509.7871 35236.923 0.00075665935 32 + 3166 6402.4444 6076.3837 0.00075665935 32 + 3168 6291.0264 1275.2998 0.00075665935 32 + 3170 6422.5631 231.70182 0.00075665935 32 + 3172 6389.7334 -33.786499 0.00075665935 32 + 3174 6323.4622 -100.70042 0.00075665935 32 + 3176 6579.8399 -110.06184 0.00075665935 32 + 3178 6482.025 -101.23926 0.00075665935 32 + 3180 6354.3385 -87.243105 0.00075665935 32 + 3182 6402.2719 -71.176204 0.00075665935 32 + 3184 6315.0298 -55.051626 0.00075665935 32 + 3186 6256.0044 -41.274131 0.00075665935 32 + 3188 6342.2232 -30.653402 0.00075665935 32 + 3190 6176.3232 -22.162573 0.00075665935 32 + 3192 6156.7096 -15.538984 0.00075665935 32 + 3194 6302.0206 -10.587747 0.00075665935 32 + 3196 6205.4986 -6.8045291 0.00075665935 32 + 3198 6312.1306 -4.947539 0.00075665935 32 + 3200 6312.9731 -4.2530917 0.00075665935 32 + 3202 6038.6207 -3.7178528 0.00075665935 32 + 3204 6055.3397 -3.3618748 0.00075665935 32 + 3206 6283.1474 -3.438067 0.00075665935 32 + 3208 6190.4768 -3.1737727 0.00075665935 32 + 3210 6431.8312 -3.8344056 0.00075665935 32 + 3212 6411.5893 -4.2280478 0.00075665935 32 + 3214 6184.72 -4.0889917 0.00075665935 32 + 3216 6328.1742 -3.8717794 0.00075665935 32 + 3218 6402.1577 -3.3815252 0.00075665935 32 + 3220 6248.9869 -2.9083862 0.00075665935 32 + 3222 6521.7487 -3.8083129 0.00075665935 32 + 3224 6338.8258 -4.1522715 0.00075665935 32 + 3226 6178.6003 -4.2444983 0.00075665935 32 + 3228 6316.7654 -4.3133222 0.00075665935 32 + 3230 6217.4769 -4.4356963 0.00075665935 32 + 3232 6082.2102 -5.2888398 0.00075665935 32 + 3234 6271.7197 -7.0741328 0.00075665935 32 + 3236 6030.2999 -7.6159982 0.00075665935 32 + 3238 6076.717 -7.6279168 0.00075665935 32 + 3240 6239.0369 -6.9809946 0.00075665935 32 + 3242 6081.9908 -5.6356755 0.00075665935 32 + 3244 6397.3549 -5.4767191 0.00075665935 32 + 3246 6391.5018 -4.8901571 0.00075665935 32 + 3248 6275.561 -3.9301212 0.00075665935 32 + 3250 6365.2589 -2.7691702 0.00075665935 32 + 3252 6363.4406 -1.8499798 0.00075665935 32 + 3254 6177.4881 -1.631069 0.00075665935 32 + 3256 6319.7457 -2.8533645 0.00075665935 32 + 3258 6210.2001 -3.565745 0.00075665935 32 + 3260 6223.1972 -4.0917774 0.00075665935 32 + 3262 6324.2234 -4.2876482 0.00075665935 32 + 3264 6353.9581 -4.3957045 0.00075665935 32 + 3266 6484.7785 1139.5061 0.00077827819 33 + 3268 6591.5394 150.3286 0.00077827819 33 + 3270 6422.9819 -88.927965 0.00077827819 33 + 3272 6387.931 -142.38475 0.00077827819 33 + 3274 6394.1651 -142.49048 0.00077827819 33 + 3276 6352.7155 -127.55273 0.00077827819 33 + 3278 6403.539 -108.8353 0.00077827819 33 + 3280 6393.4741 -89.499587 0.00077827819 33 + 3282 6282.7972 -71.488763 0.00077827819 33 + 3284 6349.6981 -55.896289 0.00077827819 33 + 3286 6434.6705 -42.606864 0.00077827819 33 + 3288 6435.399 -31.952274 0.00077827819 33 + 3290 6438.7909 -24.148345 0.00077827819 33 + 3292 6205.3476 -17.752391 0.00077827819 33 + 3294 6069.7068 -12.516722 0.00077827819 33 + 3296 6265.5342 -8.9778982 0.00077827819 33 + 3298 6382.8635 -6.8502135 0.00077827819 33 + 3300 6357.0508 -5.8052134 0.00077827819 33 + 3302 6481.8683 -5.3418399 0.00077827819 33 + 3304 6320.7328 -3.8622996 0.00077827819 33 + 3306 6322.1166 -2.6682336 0.00077827819 33 + 3308 6514.0727 -2.880462 0.00077827819 33 + 3310 6438.7949 -3.8926256 0.00077827819 33 + 3312 6314.8748 -5.3891805 0.00077827819 33 + 3314 6439.1744 -6.7858704 0.00077827819 33 + 3316 6310.702 -6.755861 0.00077827819 33 + 3318 6395.3688 -7.1208775 0.00077827819 33 + 3320 6523.6992 -8.4265267 0.00077827819 33 + 3322 6334.2553 -9.3987165 0.00077827819 33 + 3324 6345.921 -9.8081715 0.00077827819 33 + 3326 6585.4037 -9.033444 0.00077827819 33 + 3328 6505.3649 -6.7650414 0.00077827819 33 + 3330 6599.1299 -5.5594702 0.00077827819 33 + 3332 6615.2327 -5.4534514 0.00077827819 33 + 3334 6413.9707 -5.2673827 0.00077827819 33 + 3336 6488.773 -4.9346621 0.00077827819 33 + 3338 6592.7128 -3.6838699 0.00077827819 33 + 3340 6492.4529 -2.1093347 0.00077827819 33 + 3342 6624.563 -2.208136 0.00077827819 33 + 3344 6595.2112 -3.0547244 0.00077827819 33 + 3346 6513.9623 -3.6757854 0.00077827819 33 + 3348 6631.5348 -3.7916143 0.00077827819 33 + 3350 6663.5679 -3.0336076 0.00077827819 33 + 3352 6513.9482 -2.3269496 0.00077827819 33 + 3354 6549.0352 -2.9935432 0.00077827819 33 + 3356 6429.0841 -3.9157473 0.00077827819 33 + 3358 6363.8056 -4.4557955 0.00077827819 33 + 3360 6509.4572 -4.426532 0.00077827819 33 + 3362 6573.0489 -3.6842259 0.00077827819 33 + 3364 6522.1123 -3.1179071 0.00077827819 33 + 3366 6706.7798 -3.7056923 0.00077827819 33 + 3368 6859.6857 -433.18889 0.00079989702 34 + 3370 6859.7025 -369.51502 0.00079989702 34 + 3372 7012.9969 -308.73226 0.00079989702 34 + 3374 6898.5562 -253.60146 0.00079989702 34 + 3376 6852.0227 -206.09454 0.00079989702 34 + 3378 6965.6606 -166.26858 0.00079989702 34 + 3380 6883.0721 -132.48286 0.00079989702 34 + 3382 6911.0291 -104.35448 0.00079989702 34 + 3384 7008.4472 -81.127601 0.00079989702 34 + 3386 6871.931 -61.846733 0.00079989702 34 + 3388 6871.6047 -47.074931 0.00079989702 34 + 3390 6872.1258 -35.836117 0.00079989702 34 + 3392 6740.5032 -26.817094 0.00079989702 34 + 3394 6894.8127 -20.164908 0.00079989702 34 + 3396 6945.3615 -14.885111 0.00079989702 34 + 3398 6896.0199 -10.94641 0.00079989702 34 + 3400 6953.316 -8.6422769 0.00079989702 34 + 3402 6942.7839 -7.1884937 0.00079989702 34 + 3404 6872.2911 -6.2325165 0.00079989702 34 + 3406 7008.7697 -6.0248121 0.00079989702 34 + 3408 7028.2392 -5.8133809 0.00079989702 34 + 3410 6954.5587 -5.6856438 0.00079989702 34 + 3412 6934.5764 -5.7987843 0.00079989702 34 + 3414 6788.7386 -5.6593721 0.00079989702 34 + 3416 6781.9026 -5.7768409 0.00079989702 34 + 3418 6861.9043 -5.7789891 0.00079989702 34 + 3420 6845.9974 -5.0411587 0.00079989702 34 + 3422 6896.1167 -4.0372309 0.00079989702 34 + 3424 6855.2377 -2.7801991 0.00079989702 34 + 3426 6705.7216 -1.5853383 0.00079989702 34 + 3428 6727.5449 -1.1111259 0.00079989702 34 + 3430 6822.2667 -1.00108 0.00079989702 34 + 3432 6935.0567 -0.27612483 0.00079989702 34 + 3434 6923.2061 -0.47313452 0.00079989702 34 + 3436 6854.0542 -0.8377992 0.00079989702 34 + 3438 6731.8239 -1.243754 0.00079989702 34 + 3440 6817.9269 -2.0603514 0.00079989702 34 + 3442 6898.4335 -2.6756882 0.00079989702 34 + 3444 6831.1212 -2.7219231 0.00079989702 34 + 3446 6890.7713 -2.6760669 0.00079989702 34 + 3448 6937.7791 -2.4288558 0.00079989702 34 + 3450 6880.2929 -1.9500275 0.00079989702 34 + 3452 6881.6872 -1.667428 0.00079989702 34 + 3454 6768.3494 -1.270681 0.00079989702 34 + 3456 6633.0003 -0.84059394 0.00079989702 34 + 3458 6688.0004 -0.93630092 0.00079989702 34 + 3460 6758.4364 -1.250022 0.00079989702 34 + 3462 6737.351 -1.4418301 0.00079989702 34 + 3464 6924.4994 -1.9680493 0.00079989702 34 + 3466 6965.9264 -2.2343956 0.00079989702 34 + 3468 7099.7771 -2.8338515 0.00079989702 34 + 3470 7365.5406 9210.1322 0.00082151586 35 + 3472 7273.0429 2265.973 0.00082151586 35 + 3474 7086.0007 566.35094 0.00082151586 35 + 3476 7137.9528 75.998379 0.00082151586 35 + 3478 7089.2272 -70.861558 0.00082151586 35 + 3480 7260.9834 -107.43399 0.00082151586 35 + 3482 7298.6582 -106.15764 0.00082151586 35 + 3484 7248.2244 -92.031973 0.00082151586 35 + 3486 7341.0817 -74.371435 0.00082151586 35 + 3488 7439.8508 -57.018026 0.00082151586 35 + 3490 7468.7913 -42.32339 0.00082151586 35 + 3492 7596.887 -31.61683 0.00082151586 35 + 3494 7454.6265 -23.698021 0.00082151586 35 + 3496 7367.0542 -18.074974 0.00082151586 35 + 3498 7443.1139 -14.090777 0.00082151586 35 + 3500 7335.5354 -10.625037 0.00082151586 35 + 3502 7451.7732 -8.6309423 0.00082151586 35 + 3504 7597.9116 -7.7306589 0.00082151586 35 + 3506 7573.996 -6.8833773 0.00082151586 35 + 3508 7685.4891 -6.0764087 0.00082151586 35 + 3510 7704.8387 -4.5814412 0.00082151586 35 + 3512 7453.1923 -2.5302848 0.00082151586 35 + 3514 7480.9293 -1.9603627 0.00082151586 35 + 3516 7414.9212 -2.1424094 0.00082151586 35 + 3518 7341.5999 -2.5941909 0.00082151586 35 + 3520 7502.5881 -3.6003011 0.00082151586 35 + 3522 7410.8775 -4.1379583 0.00082151586 35 + 3524 7195.6431 -4.6876596 0.00082151586 35 + 3526 7282.2831 -6.1200036 0.00082151586 35 + 3528 7156.6473 -6.9781135 0.00082151586 35 + 3530 7117.1928 -7.4998668 0.00082151586 35 + 3532 7315.0548 -7.8113618 0.00082151586 35 + 3534 7245.5705 -6.9777959 0.00082151586 35 + 3536 7243.4926 -6.0865134 0.00082151586 35 + 3538 7418.9789 -5.5194598 0.00082151586 35 + 3540 7297.0501 -4.3056252 0.00082151586 35 + 3542 7276.2132 -3.3854613 0.00082151586 35 + 3544 7352.3988 -2.7943749 0.00082151586 35 + 3546 7289.0909 -2.199869 0.00082151586 35 + 3548 7348.4041 -2.4257071 0.00082151586 35 + 3550 7338.4642 -2.9646835 0.00082151586 35 + 3552 7111.5609 -3.3293719 0.00082151586 35 + 3554 7073.1037 -4.059656 0.00082151586 35 + 3556 7029.0805 -4.3380638 0.00082151586 35 + 3558 7049.1616 -4.2221378 0.00082151586 35 + 3560 7189.4962 -4.1519351 0.00082151586 35 + 3562 7224.8993 -3.8373721 0.00082151586 35 + 3564 7132.671 -3.3841721 0.00082151586 35 + 3566 7191.0892 -3.2422869 0.00082151586 35 + 3568 7214.2291 -2.9159835 0.00082151586 35 + 3570 7253.3367 -2.5775948 0.00082151586 35 + 3572 7422.1579 43074.394 0.0008431347 36 + 3574 7378.0474 8279.5877 0.0008431347 36 + 3576 7279.831 2167.3382 0.0008431347 36 + 3578 7269.3502 633.99813 0.0008431347 36 + 3580 7264.9988 160.90688 0.0008431347 36 + 3582 7250.7559 1.1553943 0.0008431347 36 + 3584 7380.4554 -51.677913 0.0008431347 36 + 3586 7443.8646 -64.740979 0.0008431347 36 + 3588 7461.3387 -61.434866 0.0008431347 36 + 3590 7463.1549 -51.391928 0.0008431347 36 + 3592 7438.5534 -40.338897 0.0008431347 36 + 3594 7264.5781 -30.256086 0.0008431347 36 + 3596 7268.5202 -22.701462 0.0008431347 36 + 3598 7228.5195 -17.294873 0.0008431347 36 + 3600 7201.8062 -13.540261 0.0008431347 36 + 3602 7234.3242 -10.89935 0.0008431347 36 + 3604 7328.7227 -8.9972732 0.0008431347 36 + 3606 7290.0009 -7.4798193 0.0008431347 36 + 3608 7375.1277 -6.7468124 0.0008431347 36 + 3610 7313.1876 -6.0057689 0.0008431347 36 + 3612 7239.5111 -5.1923879 0.0008431347 36 + 3614 7245.7747 -4.3290738 0.0008431347 36 + 3616 7162.401 -3.182203 0.0008431347 36 + 3618 7130.5735 -2.4047591 0.0008431347 36 + 3620 7200.5806 -2.2021632 0.0008431347 36 + 3622 7109.954 -1.9401061 0.0008431347 36 + 3624 7116.0037 -2.1037412 0.0008431347 36 + 3626 7124.5548 -2.2865291 0.0008431347 36 + 3628 7033.0853 -2.2136953 0.0008431347 36 + 3630 7166.5106 -2.7188784 0.0008431347 36 + 3632 7205.6089 -3.1107288 0.0008431347 36 + 3634 7185.4052 -3.3126113 0.0008431347 36 + 3636 7339.2042 -3.7109133 0.0008431347 36 + 3638 7398.2179 -3.6524166 0.0008431347 36 + 3640 7356.9677 -3.3251406 0.0008431347 36 + 3642 7529.0674 -3.4300078 0.0008431347 36 + 3644 7404.9583 -2.8694299 0.0008431347 36 + 3646 7348.5031 -2.3365499 0.0008431347 36 + 3648 7439.5143 -2.0443097 0.0008431347 36 + 3650 7440.5345 -1.6728452 0.0008431347 36 + 3652 7426.9027 -1.6757731 0.0008431347 36 + 3654 7522.6362 -2.1376657 0.0008431347 36 + 3656 7402.4178 -2.4042873 0.0008431347 36 + 3658 7473.021 -3.2318852 0.0008431347 36 + 3660 7491.4296 -4.0566916 0.0008431347 36 + 3662 7448.9995 -4.768084 0.0008431347 36 + 3664 7377.9046 -5.2847911 0.0008431347 36 + 3666 7342.4374 -5.4793032 0.0008431347 36 + 3668 7252.6825 -5.4373863 0.0008431347 36 + 3670 7238.4134 -5.5431568 0.0008431347 36 + 3672 7227.1751 -5.383502 0.0008431347 36 + 3674 7339.3464 -444.62651 0.00086475354 37 + 3676 7342.3871 -378.49228 0.00086475354 37 + 3678 7367.2893 -316.96486 0.00086475354 37 + 3680 7385.1613 -262.40999 0.00086475354 37 + 3682 7323.136 -214.96105 0.00086475354 37 + 3684 7312.9794 -174.149 0.00086475354 37 + 3686 7366.9363 -139.09374 0.00086475354 37 + 3688 7348.4045 -108.93631 0.00086475354 37 + 3690 7376.8893 -84.030482 0.00086475354 37 + 3692 7308.8919 -63.962982 0.00086475354 37 + 3694 7148.8845 -47.766908 0.00086475354 37 + 3696 7118.7058 -34.653456 0.00086475354 37 + 3698 7150.8129 -23.670021 0.00086475354 37 + 3700 7090.1607 -14.719907 0.00086475354 37 + 3702 7165.2257 -8.8656193 0.00086475354 37 + 3704 7088.6694 -5.4452493 0.00086475354 37 + 3706 7021.5798 -3.6315448 0.00086475354 37 + 3708 7127.832 -2.6321388 0.00086475354 37 + 3710 7183.775 -1.7609644 0.00086475354 37 + 3712 7181.7139 -1.6523966 0.00086475354 37 + 3714 7166.9311 -2.6896856 0.00086475354 37 + 3716 7029.456 -3.9284468 0.00086475354 37 + 3718 6953.4802 -4.6023443 0.00086475354 37 + 3720 7033.5585 -4.3027235 0.00086475354 37 + 3722 7023.3101 -3.1205417 0.00086475354 37 + 3724 7023.2748 -2.4353997 0.00086475354 37 + 3726 7003.9572 -2.6314119 0.00086475354 37 + 3728 6994.5976 -3.0750204 0.00086475354 37 + 3730 7057.2702 -3.1048664 0.00086475354 37 + 3732 7177.6239 -2.6145191 0.00086475354 37 + 3734 7158.9201 -2.1302356 0.00086475354 37 + 3736 7152.2976 -2.7650935 0.00086475354 37 + 3738 7138.2264 -4.2089475 0.00086475354 37 + 3740 7144.453 -5.5847115 0.00086475354 37 + 3742 7177.4185 -6.2025365 0.00086475354 37 + 3744 7134.3089 -5.8970079 0.00086475354 37 + 3746 7080.6305 -5.5615302 0.00086475354 37 + 3748 6971.7503 -5.5907106 0.00086475354 37 + 3750 6926.1213 -5.7478665 0.00086475354 37 + 3752 6916.3174 -5.4216883 0.00086475354 37 + 3754 6986.811 -4.4163936 0.00086475354 37 + 3756 6967.5511 -2.9334231 0.00086475354 37 + 3758 7079.0049 -2.2206462 0.00086475354 37 + 3760 7028.033 -1.9696874 0.00086475354 37 + 3762 7042.3512 -2.0623792 0.00086475354 37 + 3764 7085.936 -2.0180576 0.00086475354 37 + 3766 7101.6389 -1.5968782 0.00086475354 37 + 3768 7042.2925 -1.2836046 0.00086475354 37 + 3770 7106.8113 -1.7748565 0.00086475354 37 + 3772 6952.4114 -1.9884305 0.00086475354 37 + 3774 6925.3786 -1.9749027 0.00086475354 37 + 3776 7138.3918 5276.539 0.00088637238 38 + 3778 7110.249 1687.0641 0.00088637238 38 + 3780 7220.9129 396.12882 0.00088637238 38 + 3782 7317.4704 -110.60996 0.00088637238 38 + 3784 7216.3229 -292.66872 0.00088637238 38 + 3786 7217.659 -306.75746 0.00088637238 38 + 3788 7331.8863 -278.97971 0.00088637238 38 + 3790 7288.5986 -244.57168 0.00088637238 38 + 3792 7407.8873 -211.62122 0.00088637238 38 + 3794 7367.6943 -180.51273 0.00088637238 38 + 3796 7232.2854 -149.90398 0.00088637238 38 + 3798 7215.0946 -121.12567 0.00088637238 38 + 3800 7199.5237 -95.896547 0.00088637238 38 + 3802 7229.5017 -75.181272 0.00088637238 38 + 3804 7299.2333 -58.39765 0.00088637238 38 + 3806 7191.2083 -43.961776 0.00088637238 38 + 3808 7143.0592 -31.811824 0.00088637238 38 + 3810 7136.1876 -21.958897 0.00088637238 38 + 3812 7091.5124 -14.646144 0.00088637238 38 + 3814 7204.8466 -9.7752902 0.00088637238 38 + 3816 7227.2283 -6.2782461 0.00088637238 38 + 3818 7268.1234 -3.6182236 0.00088637238 38 + 3820 7370.7177 -2.0363997 0.00088637238 38 + 3822 7362.6296 -1.60587 0.00088637238 38 + 3824 7365.1036 -2.4369776 0.00088637238 38 + 3826 7353.2586 -3.9724174 0.00088637238 38 + 3828 7248.7903 -4.6854279 0.00088637238 38 + 3830 7278.6157 -4.7125989 0.00088637238 38 + 3832 7335.0594 -4.4826615 0.00088637238 38 + 3834 7292.9911 -4.3660502 0.00088637238 38 + 3836 7267.3945 -4.5573359 0.00088637238 38 + 3838 7186.3644 -4.2341925 0.00088637238 38 + 3840 7068.3385 -3.0069118 0.00088637238 38 + 3842 7066.8395 -1.6546869 0.00088637238 38 + 3844 7127.2364 -0.83493787 0.00088637238 38 + 3846 7112.7247 -0.58872056 0.00088637238 38 + 3848 7163.2446 -0.80886443 0.00088637238 38 + 3850 7136.9898 -0.72611361 0.00088637238 38 + 3852 7084.3883 -0.47113622 0.00088637238 38 + 3854 7107.4472 -0.8274916 0.00088637238 38 + 3856 7175.6085 -1.9463428 0.00088637238 38 + 3858 7166.6358 -3.1142427 0.00088637238 38 + 3860 7238.0595 -3.9150194 0.00088637238 38 + 3862 7241.1638 -3.7888633 0.00088637238 38 + 3864 7203.462 -3.1539823 0.00088637238 38 + 3866 7276.1411 -2.8907679 0.00088637238 38 + 3868 7314.6503 -2.7216762 0.00088637238 38 + 3870 7357.8217 -2.3441003 0.00088637238 38 + 3872 7476.7449 -1.743847 0.00088637238 38 + 3874 7453.5377 -0.8865654 0.00088637238 38 + 3876 7541.0645 -0.85326603 0.00088637238 38 + 3878 7697.8992 -502.96083 0.00090799122 39 + 3880 7648.7759 -424.34802 0.00090799122 39 + 3882 7629.8029 -355.35477 0.00090799122 39 + 3884 7676.031 -294.69867 0.00090799122 39 + 3886 7599.0776 -241.6914 0.00090799122 39 + 3888 7672.1562 -196.8112 0.00090799122 39 + 3890 7699.5669 -158.9016 0.00090799122 39 + 3892 7646.208 -126.34403 0.00090799122 39 + 3894 7629.5875 -98.251732 0.00090799122 39 + 3896 7590.7353 -74.188126 0.00090799122 39 + 3898 7519.1257 -54.553068 0.00090799122 39 + 3900 7608.1554 -39.790118 0.00090799122 39 + 3902 7667.6953 -28.68601 0.00090799122 39 + 3904 7685.8185 -20.163893 0.00090799122 39 + 3906 7754.2762 -13.901543 0.00090799122 39 + 3908 7771.8881 -9.942367 0.00090799122 39 + 3910 7859.2959 -8.7287609 0.00090799122 39 + 3912 7898.6568 -9.3927363 0.00090799122 39 + 3914 7858.5761 -10.449787 0.00090799122 39 + 3916 7799.7874 -10.862422 0.00090799122 39 + 3918 7842.0299 -10.580414 0.00090799122 39 + 3920 7846.4299 -10.014798 0.00090799122 39 + 3922 7870.0382 -9.7254013 0.00090799122 39 + 3924 7865.059 -9.3949957 0.00090799122 39 + 3926 7787.633 -8.3643901 0.00090799122 39 + 3928 7732.8853 -6.7927276 0.00090799122 39 + 3930 7791.7591 -5.6579163 0.00090799122 39 + 3932 7808.1907 -5.5439784 0.00090799122 39 + 3934 7847.0494 -6.5440311 0.00090799122 39 + 3936 7883.0673 -8.0426368 0.00090799122 39 + 3938 7864.1018 -9.1963852 0.00090799122 39 + 3940 7897.9239 -10.022789 0.00090799122 39 + 3942 7940.8549 -10.887125 0.00090799122 39 + 3944 7792.452 -11.701679 0.00090799122 39 + 3946 7771.2294 -12.614123 0.00090799122 39 + 3948 7684.4247 -12.303858 0.00090799122 39 + 3950 7657.6047 -10.463108 0.00090799122 39 + 3952 7774.6897 -7.9729519 0.00090799122 39 + 3954 7850.7533 -5.549378 0.00090799122 39 + 3956 7790.2701 -3.7348284 0.00090799122 39 + 3958 7890.6457 -3.0044525 0.00090799122 39 + 3960 7845.095 -2.2506932 0.00090799122 39 + 3962 7872.9801 -1.8809309 0.00090799122 39 + 3964 7914.1315 -2.3104241 0.00090799122 39 + 3966 7773.0926 -3.3811901 0.00090799122 39 + 3968 7747.1728 -5.4434148 0.00090799122 39 + 3970 7762.7159 -7.5342013 0.00090799122 39 + 3972 7693.609 -8.5265487 0.00090799122 39 + 3974 7768.811 -8.874305 0.00090799122 39 + 3976 7818.1708 -8.669013 0.00090799122 39 + 3978 7668.0437 -7.9390202 0.00090799122 39 + 3980 7907.5475 -521.4989 0.00092961006 40 + 3982 7901.2861 -438.49415 0.00092961006 40 + 3984 7912.7266 -365.08545 0.00092961006 40 + 3986 7952.4066 -300.82812 0.00092961006 40 + 3988 7790.094 -245.02042 0.00092961006 40 + 3990 7638.9972 -197.81802 0.00092961006 40 + 3992 7710.1676 -158.64673 0.00092961006 40 + 3994 7660.7605 -125.41186 0.00092961006 40 + 3996 7786.1818 -97.877548 0.00092961006 40 + 3998 7843.3548 -75.313834 0.00092961006 40 + 4000 7664.6576 -57.202999 0.00092961006 40 + 4002 7724.4255 -43.857478 0.00092961006 40 + 4004 7797.9069 -33.453599 0.00092961006 40 + 4006 7786.0759 -24.6743 0.00092961006 40 + 4008 7918.4492 -17.828108 0.00092961006 40 + 4010 7905.0845 -12.630032 0.00092961006 40 + 4012 7754.5678 -9.3419463 0.00092961006 40 + 4014 7823.6592 -8.0002651 0.00092961006 40 + 4016 7809.0945 -7.0481495 0.00092961006 40 + 4018 7823.9309 -6.3498162 0.00092961006 40 + 4020 7962.0556 -6.1173176 0.00092961006 40 + 4022 7873.0001 -6.1023523 0.00092961006 40 + 4024 7819.7799 -7.0153894 0.00092961006 40 + 4026 7852.0238 -8.3378683 0.00092961006 40 + 4028 7797.6458 -8.6622183 0.00092961006 40 + 4030 7767.892 -8.0643743 0.00092961006 40 + 4032 7833.0295 -7.3906575 0.00092961006 40 + 4034 7741.8785 -6.945246 0.00092961006 40 + 4036 7741.4775 -7.0038025 0.00092961006 40 + 4038 7774.2275 -6.5629865 0.00092961006 40 + 4040 7746.0392 -4.9652013 0.00092961006 40 + 4042 7754.6703 -3.025234 0.00092961006 40 + 4044 7747.5827 -1.8799389 0.00092961006 40 + 4046 7609.1583 -1.8461253 0.00092961006 40 + 4048 7523.121 -2.5237592 0.00092961006 40 + 4050 7587.8748 -2.81297 0.00092961006 40 + 4052 7585.1351 -2.0344331 0.00092961006 40 + 4054 7783.5525 -1.6383303 0.00092961006 40 + 4056 7873.1758 -2.1091858 0.00092961006 40 + 4058 7836.9551 -3.4736029 0.00092961006 40 + 4060 7771.8648 -4.6327159 0.00092961006 40 + 4062 7745.3428 -4.3264123 0.00092961006 40 + 4064 7684.791 -2.6463797 0.00092961006 40 + 4066 7793.7564 -1.510762 0.00092961006 40 + 4068 7804.0352 -1.709252 0.00092961006 40 + 4070 7788.7767 -3.0200972 0.00092961006 40 + 4072 7760.8316 -3.8847699 0.00092961006 40 + 4074 7708.6591 -3.280568 0.00092961006 40 + 4076 7658.5731 -2.300304 0.00092961006 40 + 4078 7707.8198 -2.7854801 0.00092961006 40 + 4080 7729.9763 -4.8018491 0.00092961006 40 + 4082 7902.4434 -157.06846 0.00095122889 41 + 4084 7963.9885 -265.74961 0.00095122889 41 + 4086 7914.6068 -273.87897 0.00095122889 41 + 4088 7883.2043 -248.21879 0.00095122889 41 + 4090 7798.741 -213.85753 0.00095122889 41 + 4092 7697.673 -179.8176 0.00095122889 41 + 4094 7682.6156 -147.94705 0.00095122889 41 + 4096 7755.5883 -117.79122 0.00095122889 41 + 4098 7769.1235 -90.037461 0.00095122889 41 + 4100 7877.2039 -67.421656 0.00095122889 41 + 4102 7861.6436 -50.915002 0.00095122889 41 + 4104 7835.5421 -39.405831 0.00095122889 41 + 4106 7862.2339 -30.336739 0.00095122889 41 + 4108 7909.2147 -22.182301 0.00095122889 41 + 4110 7883.4125 -16.026159 0.00095122889 41 + 4112 7989.2857 -13.38701 0.00095122889 41 + 4114 7830.6378 -13.322647 0.00095122889 41 + 4116 7769.5086 -13.526071 0.00095122889 41 + 4118 7825.5764 -12.141454 0.00095122889 41 + 4120 7841.5613 -9.0273754 0.00095122889 41 + 4122 7927.5749 -6.6185333 0.00095122889 41 + 4124 7965.3063 -6.2844682 0.00095122889 41 + 4126 7796.2181 -6.7996879 0.00095122889 41 + 4128 7734.3802 -6.6388671 0.00095122889 41 + 4130 7758.5914 -4.7554937 0.00095122889 41 + 4132 7682.7878 -2.5050831 0.00095122889 41 + 4134 7824.8011 -2.6610935 0.00095122889 41 + 4136 7755.6681 -4.6815735 0.00095122889 41 + 4138 7660.969 -6.9516019 0.00095122889 41 + 4140 7688.7405 -7.7130554 0.00095122889 41 + 4142 7581.4273 -6.3261565 0.00095122889 41 + 4144 7526.3642 -4.9332058 0.00095122889 41 + 4146 7582.4672 -5.0590224 0.00095122889 41 + 4148 7552.4585 -5.6074616 0.00095122889 41 + 4150 7647.6784 -5.2241017 0.00095122889 41 + 4152 7792.9307 -3.0123135 0.00095122889 41 + 4154 7755.9484 0.08787677 0.00095122889 41 + 4156 7923.6998 1.4015904 0.00095122889 41 + 4158 7913.9452 0.402066 0.00095122889 41 + 4160 7816.5845 -1.4091564 0.00095122889 41 + 4162 7797.5379 -2.5730791 0.00095122889 41 + 4164 7767.0704 -2.3411579 0.00095122889 41 + 4166 7775.3551 -2.3498279 0.00095122889 41 + 4168 7833.2488 -3.8539649 0.00095122889 41 + 4170 7864.5177 -6.0886196 0.00095122889 41 + 4172 7933.8629 -7.6786041 0.00095122889 41 + 4174 7968.4774 -7.7282369 0.00095122889 41 + 4176 7978.8883 -6.1422019 0.00095122889 41 + 4178 7932.7975 -4.771645 0.00095122889 41 + 4180 7948.0708 -4.0714699 0.00095122889 41 + 4182 7943.1915 -3.8837665 0.00095122889 41 + 4184 8108.9177 -516.1468 0.00097284773 42 + 4186 8206.3013 -433.68498 0.00097284773 42 + 4188 8217.7025 -361.17364 0.00097284773 42 + 4190 8198.8587 -298.59241 0.00097284773 42 + 4192 8099.2022 -245.14742 0.00097284773 42 + 4194 7979.1079 -199.84977 0.00097284773 42 + 4196 8027.5705 -161.57032 0.00097284773 42 + 4198 8019.9532 -128.81228 0.00097284773 42 + 4200 8042.8235 -101.32318 0.00097284773 42 + 4202 8051.7017 -78.733849 0.00097284773 42 + 4204 8029.8713 -60.5796 0.00097284773 42 + 4206 8019.3048 -46.203864 0.00097284773 42 + 4208 8087.5578 -34.745819 0.00097284773 42 + 4210 8111.1976 -25.552949 0.00097284773 42 + 4212 8118.8629 -18.609752 0.00097284773 42 + 4214 8077.5838 -13.804228 0.00097284773 42 + 4216 8027.3801 -10.905812 0.00097284773 42 + 4218 8000.5759 -9.2810893 0.00097284773 42 + 4220 8037.1325 -8.5888292 0.00097284773 42 + 4222 8067.6335 -8.3374162 0.00097284773 42 + 4224 8038.0059 -8.0719145 0.00097284773 42 + 4226 8018.4883 -7.7890418 0.00097284773 42 + 4228 7956.2369 -7.3379906 0.00097284773 42 + 4230 7932.6107 -6.8064093 0.00097284773 42 + 4232 7944.483 -6.1421048 0.00097284773 42 + 4234 7956.2893 -5.0641406 0.00097284773 42 + 4236 7979.4578 -3.6294807 0.00097284773 42 + 4238 8054.2831 -2.2079124 0.00097284773 42 + 4240 8045.5253 -0.91784072 0.00097284773 42 + 4242 8045.7217 -0.18674195 0.00097284773 42 + 4244 8004.127 0.20356353 0.00097284773 42 + 4246 7940.1172 0.45805105 0.00097284773 42 + 4248 7964.2425 0.36976912 0.00097284773 42 + 4250 7988.7833 -0.029928883 0.00097284773 42 + 4252 7996.9124 -0.89531223 0.00097284773 42 + 4254 8017.1117 -2.1639093 0.00097284773 42 + 4256 7940.2632 -3.0690098 0.00097284773 42 + 4258 7860.6561 -3.3920916 0.00097284773 42 + 4260 7879.9971 -3.2953276 0.00097284773 42 + 4262 7891.806 -2.9424874 0.00097284773 42 + 4264 7992.2304 -2.9380123 0.00097284773 42 + 4266 8026.3982 -2.8724499 0.00097284773 42 + 4268 7972.8388 -2.2516181 0.00097284773 42 + 4270 7973.964 -1.297675 0.00097284773 42 + 4272 7994.0752 -0.39747736 0.00097284773 42 + 4274 7998.7465 -0.11614095 0.00097284773 42 + 4276 8088.8291 -0.8113334 0.00097284773 42 + 4278 8059.6742 -1.5888446 0.00097284773 42 + 4280 8020.6926 -2.050816 0.00097284773 42 + 4282 8028.1365 -2.1996992 0.00097284773 42 + 4284 8052.2891 -2.0985556 0.00097284773 42 + 4286 8278.9938 -509.86421 0.00099446657 43 + 4288 8247.3179 -429.64673 0.00099446657 43 + 4290 8126.1785 -358.97006 0.00099446657 43 + 4292 8173.7712 -296.56464 0.00099446657 43 + 4294 8238.764 -242.102 0.00099446657 43 + 4296 8255.6032 -195.61919 0.00099446657 43 + 4298 8262.4411 -156.7365 0.00099446657 43 + 4300 8302.0004 -124.31989 0.00099446657 43 + 4302 8268.867 -96.949231 0.00099446657 43 + 4304 8306.5281 -74.210979 0.00099446657 43 + 4306 8343.4055 -56.253207 0.00099446657 43 + 4308 8356.4515 -42.854371 0.00099446657 43 + 4310 8299.0659 -32.996689 0.00099446657 43 + 4312 8352.6583 -25.752008 0.00099446657 43 + 4314 8361.5085 -19.985322 0.00099446657 43 + 4316 8571.4568 -15.557804 0.00099446657 43 + 4318 8582.3215 -12.887596 0.00099446657 43 + 4320 8472.6813 -11.558167 0.00099446657 43 + 4322 8474.9823 -10.844405 0.00099446657 43 + 4324 8473.3675 -9.8150724 0.00099446657 43 + 4326 8393.9486 -8.1992451 0.00099446657 43 + 4328 8378.9425 -6.7260885 0.00099446657 43 + 4330 8346.1 -5.564676 0.00099446657 43 + 4332 8235.6896 -4.425222 0.00099446657 43 + 4334 8363.6675 -3.5881597 0.00099446657 43 + 4336 8405.1823 -2.3044991 0.00099446657 43 + 4338 8350.9928 -0.8406972 0.00099446657 43 + 4340 8500.7521 -0.4234826 0.00099446657 43 + 4342 8548.8147 -0.62817151 0.00099446657 43 + 4344 8332.1491 -0.83924293 0.00099446657 43 + 4346 8393.1372 -1.6195255 0.00099446657 43 + 4348 8320.9882 -1.6951836 0.00099446657 43 + 4350 8292.8489 -1.6086181 0.00099446657 43 + 4352 8516.1554 -2.1037774 0.00099446657 43 + 4354 8389.0052 -1.9113063 0.00099446657 43 + 4356 8344.2002 -1.802563 0.00099446657 43 + 4358 8441.592 -1.62227 0.00099446657 43 + 4360 8290.2032 -0.812818 0.00099446657 43 + 4362 8276.3044 -0.54320674 0.00099446657 43 + 4364 8398.8818 -0.50890608 0.00099446657 43 + 4366 8217.6126 0.23032956 0.00099446657 43 + 4368 8277.2966 0.45618773 0.00099446657 43 + 4370 8285.6835 0.64048165 0.00099446657 43 + 4372 8223.9666 0.82233709 0.00099446657 43 + 4374 8368.9826 0.30079286 0.00099446657 43 + 4376 8397.6389 -0.039229341 0.00099446657 43 + 4378 8324.4249 -0.062354972 0.00099446657 43 + 4380 8450.3608 -0.40290024 0.00099446657 43 + 4382 8430.9643 -0.53817058 0.00099446657 43 + 4384 8450.4916 -1.0890976 0.00099446657 43 + 4386 8597.0802 -2.1229363 0.00099446657 43 + 4388 8574.7893 -495.23616 0.0010160854 44 + 4390 8534.2928 -416.45571 0.0010160854 44 + 4392 8515.3825 -347.36621 0.0010160854 44 + 4394 8410.3226 -286.93247 0.0010160854 44 + 4396 8441.4595 -234.96248 0.0010160854 44 + 4398 8494.8924 -190.56091 0.0010160854 44 + 4400 8396.1692 -152.56229 0.0010160854 44 + 4402 8340.2064 -120.49381 0.0010160854 44 + 4404 8262.4814 -93.513076 0.0010160854 44 + 4406 8260.9108 -71.399624 0.0010160854 44 + 4408 8503.2679 -54.196816 0.0010160854 44 + 4410 8612.8867 -40.648655 0.0010160854 44 + 4412 8611.2491 -30.080936 0.0010160854 44 + 4414 8529.1473 -22.008788 0.0010160854 44 + 4416 8274.8886 -15.888411 0.0010160854 44 + 4418 8232.6373 -12.281908 0.0010160854 44 + 4420 8278.7733 -10.540243 0.0010160854 44 + 4422 8256.9019 -9.624563 0.0010160854 44 + 4424 8351.6515 -9.3047728 0.0010160854 44 + 4426 8329.4027 -8.6619836 0.0010160854 44 + 4428 8178.9029 -7.6979987 0.0010160854 44 + 4430 8308.5907 -7.5255745 0.0010160854 44 + 4432 8339.2567 -7.3318811 0.0010160854 44 + 4434 8362.5258 -7.1546324 0.0010160854 44 + 4436 8557.2606 -6.6855469 0.0010160854 44 + 4438 8475.4182 -5.6090375 0.0010160854 44 + 4440 8319.9484 -4.6925255 0.0010160854 44 + 4442 8373.3802 -4.545894 0.0010160854 44 + 4444 8374.4917 -4.6279572 0.0010160854 44 + 4446 8395.4212 -4.9670733 0.0010160854 44 + 4448 8502.6173 -5.3570084 0.0010160854 44 + 4450 8394.9695 -5.1255099 0.0010160854 44 + 4452 8434.3765 -5.2245389 0.0010160854 44 + 4454 8443.8848 -5.4566204 0.0010160854 44 + 4456 8441.6094 -5.6688567 0.0010160854 44 + 4458 8408.897 -5.4910366 0.0010160854 44 + 4460 8395.9315 -4.6146451 0.0010160854 44 + 4462 8365.5718 -3.2374638 0.0010160854 44 + 4464 8565.1171 -2.4491367 0.0010160854 44 + 4466 8593.5937 -2.1052133 0.0010160854 44 + 4468 8499.6193 -2.185188 0.0010160854 44 + 4470 8546.1106 -2.307305 0.0010160854 44 + 4472 8527.2742 -1.8524704 0.0010160854 44 + 4474 8465.1781 -1.7897711 0.0010160854 44 + 4476 8500.7257 -2.6640952 0.0010160854 44 + 4478 8494.4707 -3.8554635 0.0010160854 44 + 4480 8532.6748 -5.1327601 0.0010160854 44 + 4482 8596.1301 -5.8945847 0.0010160854 44 + 4484 8521.9809 -5.593774 0.0010160854 44 + 4486 8550.9191 -5.4219167 0.0010160854 44 + 4488 8509.9533 -5.2971017 0.0010160854 44 + 4490 8527.9509 -496.09766 0.0010377042 45 + 4492 8613.0476 -416.35833 0.0010377042 45 + 4494 8676.1378 -345.86004 0.0010377042 45 + 4496 8617.3621 -283.82315 0.0010377042 45 + 4498 8668.1478 -230.41561 0.0010377042 45 + 4500 8649.6909 -184.8817 0.0010377042 45 + 4502 8679.6804 -146.6874 0.0010377042 45 + 4504 8747.1518 -114.94709 0.0010377042 45 + 4506 8688.4472 -88.603119 0.0010377042 45 + 4508 8608.4958 -67.271273 0.0010377042 45 + 4510 8591.9259 -50.787437 0.0010377042 45 + 4512 8494.9811 -38.402513 0.0010377042 45 + 4514 8463.1609 -28.990894 0.0010377042 45 + 4516 8464.8933 -21.635316 0.0010377042 45 + 4518 8470.0639 -16.177833 0.0010377042 45 + 4520 8471.9812 -12.437599 0.0010377042 45 + 4522 8498.4238 -10.08233 0.0010377042 45 + 4524 8499.769 -8.4613574 0.0010377042 45 + 4526 8553.6516 -6.911356 0.0010377042 45 + 4528 8422.8294 -4.7026624 0.0010377042 45 + 4530 8441.909 -2.9558897 0.0010377042 45 + 4532 8387.1921 -1.5442977 0.0010377042 45 + 4534 8384.5952 -0.86092867 0.0010377042 45 + 4536 8431.7181 -0.54662396 0.0010377042 45 + 4538 8441.649 0.07032512 0.0010377042 45 + 4540 8400.8654 0.65049388 0.0010377042 45 + 4542 8412.8422 0.31166962 0.0010377042 45 + 4544 8293.6405 -0.65121641 0.0010377042 45 + 4546 8235.082 -1.9157396 0.0010377042 45 + 4548 8337.4213 -2.8597252 0.0010377042 45 + 4550 8360.9468 -2.8658973 0.0010377042 45 + 4552 8430.0995 -2.7233891 0.0010377042 45 + 4554 8501.6129 -2.7965692 0.0010377042 45 + 4556 8417.9206 -2.5637444 0.0010377042 45 + 4558 8400.4222 -1.9567773 0.0010377042 45 + 4560 8504.0062 -0.76780017 0.0010377042 45 + 4562 8484.3359 1.0467294 0.0010377042 45 + 4564 8558.8809 2.1140163 0.0010377042 45 + 4566 8601.3852 2.1172908 0.0010377042 45 + 4568 8444.5107 1.9568098 0.0010377042 45 + 4570 8467.9402 1.6835107 0.0010377042 45 + 4572 8449.0471 2.1061386 0.0010377042 45 + 4574 8369.1374 3.0093153 0.0010377042 45 + 4576 8491.3532 3.3567439 0.0010377042 45 + 4578 8478.964 3.3802201 0.0010377042 45 + 4580 8504.6394 2.7694682 0.0010377042 45 + 4582 8642.0159 1.9628767 0.0010377042 45 + 4584 8513.5376 2.223098 0.0010377042 45 + 4586 8474.3971 2.516679 0.0010377042 45 + 4588 8487.1656 2.2985708 0.0010377042 45 + 4590 8289.0437 1.9469959 0.0010377042 45 + 4592 8481.5191 -520.17528 0.0010593231 46 + 4594 8567.1466 -437.6927 0.0010593231 46 + 4596 8518.549 -364.26995 0.0010593231 46 + 4598 8604.1157 -300.08043 0.0010593231 46 + 4600 8529.2258 -244.28279 0.0010593231 46 + 4602 8428.0705 -196.70922 0.0010593231 46 + 4604 8582.5154 -156.849 0.0010593231 46 + 4606 8548.2838 -122.68697 0.0010593231 46 + 4608 8596.5127 -94.410533 0.0010593231 46 + 4610 8674.4143 -71.72073 0.0010593231 46 + 4612 8538.4797 -53.669118 0.0010593231 46 + 4614 8623.2159 -40.344528 0.0010593231 46 + 4616 8759.322 -30.147898 0.0010593231 46 + 4618 8793.5955 -21.884434 0.0010593231 46 + 4620 8982.3765 -15.931732 0.0010593231 46 + 4622 8958.5083 -11.617209 0.0010593231 46 + 4624 8806.9297 -8.8619595 0.0010593231 46 + 4626 8803.6844 -7.2321648 0.0010593231 46 + 4628 8797.2255 -5.570733 0.0010593231 46 + 4630 8892.9851 -4.3531986 0.0010593231 46 + 4632 8964.0601 -3.4170376 0.0010593231 46 + 4634 8846.728 -2.655739 0.0010593231 46 + 4636 8773.1004 -2.2601343 0.0010593231 46 + 4638 8671.2037 -1.557705 0.0010593231 46 + 4640 8585.723 -0.71944384 0.0010593231 46 + 4642 8725.2486 -0.48356301 0.0010593231 46 + 4644 8711.1613 -0.53293687 0.0010593231 46 + 4646 8786.7057 -1.5005599 0.0010593231 46 + 4648 8858.642 -2.4923147 0.0010593231 46 + 4650 8752.25 -2.6581339 0.0010593231 46 + 4652 8815.6087 -3.01017 0.0010593231 46 + 4654 8775.7986 -3.3756535 0.0010593231 46 + 4656 8566.3303 -3.7982073 0.0010593231 46 + 4658 8799.7321 -4.3008093 0.0010593231 46 + 4660 8723.878 -3.9630469 0.0010593231 46 + 4662 8686.2465 -3.0562248 0.0010593231 46 + 4664 8915.9896 -2.5027167 0.0010593231 46 + 4666 8948.6766 -1.7363874 0.0010593231 46 + 4668 8981.9868 -1.4904713 0.0010593231 46 + 4670 8973.8687 -1.2017163 0.0010593231 46 + 4672 8781.5713 -0.098324645 0.0010593231 46 + 4674 8836.3853 0.36211688 0.0010593231 46 + 4676 8888.7808 0.13105451 0.0010593231 46 + 4678 8835.0564 -0.50481902 0.0010593231 46 + 4680 8985.5711 -1.5894088 0.0010593231 46 + 4682 8859.0573 -1.5127093 0.0010593231 46 + 4684 8693.8448 -0.89458263 0.0010593231 46 + 4686 8738.5439 -0.77832982 0.0010593231 46 + 4688 8752.8631 -0.68096596 0.0010593231 46 + 4690 8989.1943 -1.1086408 0.0010593231 46 + 4692 9125.5916 -1.3370384 0.0010593231 46 + 4694 9137.3461 -520.18878 0.0010809419 47 + 4696 9161.8764 -436.8854 0.0010809419 47 + 4698 9090.1914 -363.36 0.0010809419 47 + 4700 8968.747 -299.55079 0.0010809419 47 + 4702 9078.7834 -245.40424 0.0010809419 47 + 4704 8992.5725 -198.91807 0.0010809419 47 + 4706 9051.2817 -159.66594 0.0010809419 47 + 4708 9268.4539 -127.05373 0.0010809419 47 + 4710 9249.7126 -99.872257 0.0010809419 47 + 4712 9272.9869 -78.285794 0.0010809419 47 + 4714 9298.2916 -61.242625 0.0010809419 47 + 4716 9149.9948 -47.047605 0.0010809419 47 + 4718 9174.9535 -35.539318 0.0010809419 47 + 4720 9145.8496 -25.8891 0.0010809419 47 + 4722 9109.5375 -18.1682 0.0010809419 47 + 4724 9242.5523 -12.688902 0.0010809419 47 + 4726 9217.6607 -8.2811481 0.0010809419 47 + 4728 9205.001 -4.9666292 0.0010809419 47 + 4730 9246.4981 -2.8583297 0.0010809419 47 + 4732 9085.8485 -1.4678673 0.0010809419 47 + 4734 9146.1068 -1.4024674 0.0010809419 47 + 4736 9303.335 -1.9059492 0.0010809419 47 + 4738 9271.2857 -2.0258301 0.0010809419 47 + 4740 9304.4859 -2.3846233 0.0010809419 47 + 4742 9270.2033 -2.7896971 0.0010809419 47 + 4744 9206.1576 -3.3254688 0.0010809419 47 + 4746 9293.6448 -4.2902575 0.0010809419 47 + 4748 9273.8176 -4.7705219 0.0010809419 47 + 4750 9133.8374 -4.4378019 0.0010809419 47 + 4752 9197.8675 -3.9840481 0.0010809419 47 + 4754 9175.0908 -3.2269941 0.0010809419 47 + 4756 9161.9743 -2.6815574 0.0010809419 47 + 4758 9235.6272 -2.4653622 0.0010809419 47 + 4760 9217.1381 -1.8932604 0.0010809419 47 + 4762 9181.2102 -1.1216766 0.0010809419 47 + 4764 9338.3737 -0.90234884 0.0010809419 47 + 4766 9335.2303 -0.92297203 0.0010809419 47 + 4768 9298.9426 -1.3455966 0.0010809419 47 + 4770 9325.4367 -1.8336104 0.0010809419 47 + 4772 9230.3934 -1.5479611 0.0010809419 47 + 4774 9178.392 -1.0441831 0.0010809419 47 + 4776 9227.8488 -1.0590378 0.0010809419 47 + 4778 9193.9447 -1.4198565 0.0010809419 47 + 4780 9270.6561 -2.1954197 0.0010809419 47 + 4782 9422.3603 -2.8136615 0.0010809419 47 + 4784 9350.7024 -2.673543 0.0010809419 47 + 4786 9331.5137 -2.8714966 0.0010809419 47 + 4788 9250.4145 -3.5767976 0.0010809419 47 + 4790 9107.9642 -4.5337248 0.0010809419 47 + 4792 9228.1155 -5.7916693 0.0010809419 47 + 4794 9292.6027 -6.3474068 0.0010809419 47 + 4796 9281.1728 -495.56961 0.0011025608 48 + 4798 9257.2823 -416.90739 0.0011025608 48 + 4800 9167.2292 -347.91303 0.0011025608 48 + 4802 9051.4613 -287.59488 0.0011025608 48 + 4804 9051.2474 -235.29211 0.0011025608 48 + 4806 8939.1848 -189.98673 0.0011025608 48 + 4808 8829.7683 -151.62536 0.0011025608 48 + 4810 8824.1916 -119.95289 0.0011025608 48 + 4812 8808.1206 -93.914418 0.0011025608 48 + 4814 8890.8833 -72.704047 0.0011025608 48 + 4816 8917.407 -55.21116 0.0011025608 48 + 4818 8876.1635 -41.05117 0.0011025608 48 + 4820 8854.7425 -30.373475 0.0011025608 48 + 4822 8846.8083 -22.843194 0.0011025608 48 + 4824 8821.8413 -17.705544 0.0011025608 48 + 4826 8837.4071 -14.157948 0.0011025608 48 + 4828 8828.0931 -11.420858 0.0011025608 48 + 4830 8859.1154 -9.5170755 0.0011025608 48 + 4832 8946.3791 -8.7264479 0.0011025608 48 + 4834 8978.8812 -8.8790393 0.0011025608 48 + 4836 8953.0905 -9.2279972 0.0011025608 48 + 4838 8910.8094 -8.9427729 0.0011025608 48 + 4840 8968.6837 -8.0843379 0.0011025608 48 + 4842 8928.639 -6.9476377 0.0011025608 48 + 4844 8823.2 -6.1527852 0.0011025608 48 + 4846 8763.5685 -5.8243942 0.0011025608 48 + 4848 8715.8194 -5.2584257 0.0011025608 48 + 4850 8714.0846 -4.3510558 0.0011025608 48 + 4852 8789.8199 -3.6345733 0.0011025608 48 + 4854 8730.5479 -3.2965154 0.0011025608 48 + 4856 8652.0668 -3.7899389 0.0011025608 48 + 4858 8624.8355 -4.732243 0.0011025608 48 + 4860 8580.5577 -5.1860591 0.0011025608 48 + 4862 8654.1508 -5.1768892 0.0011025608 48 + 4864 8735.3771 -4.9999079 0.0011025608 48 + 4866 8765.1707 -5.1542509 0.0011025608 48 + 4868 8804.1792 -5.6790939 0.0011025608 48 + 4870 8860.7297 -5.8263426 0.0011025608 48 + 4872 8908.8556 -5.2744985 0.0011025608 48 + 4874 8926.07 -4.2957281 0.0011025608 48 + 4876 8850.6097 -3.4599457 0.0011025608 48 + 4878 8832.4203 -3.3921154 0.0011025608 48 + 4880 8797.98 -3.7216781 0.0011025608 48 + 4882 8760.5047 -3.9628578 0.0011025608 48 + 4884 8847.4366 -4.0231587 0.0011025608 48 + 4886 8887.6815 -3.7145985 0.0011025608 48 + 4888 8966.9828 -3.9153205 0.0011025608 48 + 4890 9065.3537 -5.038067 0.0011025608 48 + 4892 8936.417 -5.9841835 0.0011025608 48 + 4894 8864.0481 -6.3394779 0.0011025608 48 + 4896 8910.5544 -5.8998984 0.0011025608 48 + 4898 9020.887 -505.99553 0.0011241796 49 + 4900 9146.5453 -425.18309 0.0011241796 49 + 4902 9199.4841 -354.6505 0.0011241796 49 + 4904 9081.6861 -292.58514 0.0011241796 49 + 4906 9109.4808 -238.36724 0.0011241796 49 + 4908 9201.4749 -191.5871 0.0011241796 49 + 4910 9200.1718 -152.36325 0.0011241796 49 + 4912 9338.4038 -121.01454 0.0011241796 49 + 4914 9302.5903 -95.640879 0.0011241796 49 + 4916 9191.2234 -74.423208 0.0011241796 49 + 4918 9211.5642 -56.502848 0.0011241796 49 + 4920 9188.5122 -41.472493 0.0011241796 49 + 4922 9180.3808 -30.039095 0.0011241796 49 + 4924 9285.1643 -22.268454 0.0011241796 49 + 4926 9277.2896 -16.379292 0.0011241796 49 + 4928 9289.8239 -11.313273 0.0011241796 49 + 4930 9378.02 -6.9392159 0.0011241796 49 + 4932 9367.1409 -3.54637 0.0011241796 49 + 4934 9354.7387 -2.1205117 0.0011241796 49 + 4936 9479.7661 -2.6634686 0.0011241796 49 + 4938 9467.8349 -3.3911836 0.0011241796 49 + 4940 9437.0542 -3.4584366 0.0011241796 49 + 4942 9409.6154 -2.8987342 0.0011241796 49 + 4944 9271.2955 -2.339303 0.0011241796 49 + 4946 9193.9347 -2.7801108 0.0011241796 49 + 4948 9239.9208 -3.7808623 0.0011241796 49 + 4950 9278.7442 -4.0161903 0.0011241796 49 + 4952 9336.3169 -3.1299356 0.0011241796 49 + 4954 9330.3317 -1.5284411 0.0011241796 49 + 4956 9202.1213 -0.2202091 0.0011241796 49 + 4958 9154.2967 -0.011244882 0.0011241796 49 + 4960 9101.7899 -0.16601161 0.0011241796 49 + 4962 9207.7969 -0.31994742 0.0011241796 49 + 4964 9366.7994 -0.19747702 0.0011241796 49 + 4966 9425.9901 -0.079974857 0.0011241796 49 + 4968 9444.2698 -0.74663383 0.0011241796 49 + 4970 9393.8478 -1.7630915 0.0011241796 49 + 4972 9302.1463 -2.2747079 0.0011241796 49 + 4974 9424.5662 -2.4598611 0.0011241796 49 + 4976 9465.0434 -2.1365335 0.0011241796 49 + 4978 9434.4933 -1.9532883 0.0011241796 49 + 4980 9469.4423 -2.1376525 0.0011241796 49 + 4982 9375.2018 -1.5851174 0.0011241796 49 + 4984 9362.759 -0.39474824 0.0011241796 49 + 4986 9442.0402 0.97786903 0.0011241796 49 + 4988 9413.9914 2.0671161 0.0011241796 49 + 4990 9416.6093 1.9942893 0.0011241796 49 + 4992 9404.3458 1.2240715 0.0011241796 49 + 4994 9355.31 0.57065426 0.0011241796 49 + 4996 9383.141 0.046953139 0.0011241796 49 + 4998 9399.1453 -0.57346338 0.0011241796 49 + 5000 9519.25 -518.64483 0.0011457984 50 + 5002 9604.2344 -438.74819 0.0011457984 50 + 5004 9559.8129 -367.48865 0.0011457984 50 + 5006 9544.8737 -304.02506 0.0011457984 50 + 5008 9481.656 -248.0081 0.0011457984 50 + 5010 9414.3533 -199.66492 0.0011457984 50 + 5012 9513.1357 -159.18474 0.0011457984 50 + 5014 9603.1734 -125.22869 0.0011457984 50 + 5016 9551.8186 -96.41966 0.0011457984 50 + 5018 9647.3309 -72.653519 0.0011457984 50 + 5020 9605.0904 -53.340454 0.0011457984 50 + 5022 9586.9507 -38.880254 0.0011457984 50 + 5024 9709.9752 -28.999004 0.0011457984 50 + 5026 9683.8421 -21.832358 0.0011457984 50 + 5028 9643.9148 -16.492713 0.0011457984 50 + 5030 9706.0273 -12.710548 0.0011457984 50 + 5032 9611.9033 -9.9440173 0.0011457984 50 + 5034 9567.2906 -8.5244174 0.0011457984 50 + 5036 9635.3114 -8.030991 0.0011457984 50 + 5038 9612.2959 -7.3510392 0.0011457984 50 + 5040 9722.4871 -6.4873995 0.0011457984 50 + 5042 9836.5908 -5.3676385 0.0011457984 50 + 5044 9832.73 -4.3333074 0.0011457984 50 + 5046 9759.2708 -3.8635602 0.0011457984 50 + 5048 9677.2982 -3.7288336 0.0011457984 50 + 5050 9601.6808 -3.5122622 0.0011457984 50 + 5052 9721.7022 -3.5470923 0.0011457984 50 + 5054 9792.2522 -3.6750964 0.0011457984 50 + 5056 9763.3339 -3.8730349 0.0011457984 50 + 5058 9758.9939 -4.1225654 0.0011457984 50 + 5060 9724.8233 -4.0129457 0.0011457984 50 + 5062 9609.7244 -3.4237045 0.0011457984 50 + 5064 9586.6957 -2.8190939 0.0011457984 50 + 5066 9559.6562 -2.1872918 0.0011457984 50 + 5068 9638.7727 -1.8326397 0.0011457984 50 + 5070 9827.2847 -1.9299282 0.0011457984 50 + 5072 9869.462 -2.0742746 0.0011457984 50 + 5074 9813.1458 -2.2167729 0.0011457984 50 + 5076 9794.8461 -2.457677 0.0011457984 50 + 5078 9711.4358 -2.55187 0.0011457984 50 + 5080 9738.491 -3.0545306 0.0011457984 50 + 5082 9899.1136 -4.2012624 0.0011457984 50 + 5084 9807.3623 -4.9467546 0.0011457984 50 + 5086 9744.1007 -5.2849531 0.0011457984 50 + 5088 9821.1579 -5.1551298 0.0011457984 50 + 5090 9825.4736 -4.2577294 0.0011457984 50 + 5092 9865.2542 -3.5543254 0.0011457984 50 + 5094 9961.4468 -3.4213589 0.0011457984 50 + 5096 9830.6392 -2.8661808 0.0011457984 50 + 5098 9833.4478 -2.0922959 0.0011457984 50 + 5100 9900.2941 -0.83434095 0.0011457984 50 + 5102 9835.9337 0.4699033 0.0011457984 50 + 5104 9833.7603 0.47743244 0.0011457984 50 + 5106 9831.8135 -0.41088598 0.0011457984 50 + 5108 9757.8169 -0.9151913 0.0011457984 50 + 5110 9867.9551 -0.76236525 0.0011457984 50 + 5112 9881.1147 0.26687783 0.0011457984 50 + 5114 9810.935 0.95492784 0.0011457984 50 + 5116 9854.0824 0.16038773 0.0011457984 50 + 5118 9801.1062 -0.97621444 0.0011457984 50 + 5120 9737.6269 -1.3109743 0.0011457984 50 + 5122 9744.1436 -0.55115253 0.0011457984 50 + 5124 9649.6516 0.72316201 0.0011457984 50 + 5126 9664.2682 0.67140181 0.0011457984 50 + 5128 9768.702 -0.94819295 0.0011457984 50 + 5130 9753.6951 -2.6136655 0.0011457984 50 + 5132 9719.31 -3.421216 0.0011457984 50 + 5134 9601.2267 -3.1913958 0.0011457984 50 + 5136 9436.5811 -2.8639748 0.0011457984 50 + 5138 9485.6348 -3.6250392 0.0011457984 50 + 5140 9602.4968 -4.6930818 0.0011457984 50 + 5142 9716.3445 -4.7009462 0.0011457984 50 + 5144 9829.8772 -3.0422762 0.0011457984 50 + 5146 9775.9253 -0.099871825 0.0011457984 50 + 5148 9714.3184 2.3638003 0.0011457984 50 + 5150 9721.8795 3.4407067 0.0011457984 50 + 5152 9711.5028 3.8932963 0.0011457984 50 + 5154 9740.7674 4.6393043 0.0011457984 50 + 5156 9788.8434 5.8877168 0.0011457984 50 + 5158 9735.8911 6.7816444 0.0011457984 50 + 5160 9752.7265 5.8563351 0.0011457984 50 + 5162 9749.8783 3.4223128 0.0011457984 50 + 5164 9755.0591 0.65432948 0.0011457984 50 + 5166 9790.6938 -1.4423029 0.0011457984 50 + 5168 9683.3354 -2.4366479 0.0011457984 50 + 5170 9568.8334 -3.2936067 0.0011457984 50 + 5172 9550.9121 -4.6097096 0.0011457984 50 + 5174 9514.1645 -5.6687719 0.0011457984 50 + 5176 9526.4197 -5.8206698 0.0011457984 50 + 5178 9580.5278 -4.6502361 0.0011457984 50 + 5180 9499.5744 -2.3930624 0.0011457984 50 + 5182 9493.8922 -0.49092775 0.0011457984 50 + 5184 9474.1233 0.87105346 0.0011457984 50 + 5186 9443.4367 2.121042 0.0011457984 50 + 5188 9505.5172 3.4569671 0.0011457984 50 + 5190 9505.6816 5.010125 0.0011457984 50 + 5192 9517.009 5.8421504 0.0011457984 50 + 5194 9547.5435 5.4256946 0.0011457984 50 + 5196 9390.6498 4.4551742 0.0011457984 50 + 5198 9352.7639 2.9903747 0.0011457984 50 + 5200 9437.6381 1.5947939 0.0011457984 50 + 5202 9450.1343 0.70258862 0.0011457984 50 + 5204 9510.3105 -0.33071087 0.0011457984 50 + 5206 9502.9253 -1.3602607 0.0011457984 50 + 5208 9332.6127 -1.9447417 0.0011457984 50 + 5210 9341.5743 -2.3342341 0.0011457984 50 + 5212 9336.7886 -2.0628218 0.0011457984 50 + 5214 9318.1505 -1.4587331 0.0011457984 50 + 5216 9328.1223 -1.0850967 0.0011457984 50 + 5218 9318.8979 -1.017563 0.0011457984 50 + 5220 9330.595 -1.4294349 0.0011457984 50 + 5222 9450.3709 -2.3924416 0.0011457984 50 + 5224 9502.7445 -3.3023586 0.0011457984 50 + 5226 9448.058 -3.7841582 0.0011457984 50 + 5228 9401.1768 -3.9368085 0.0011457984 50 + 5230 9376.2376 -3.884294 0.0011457984 50 + 5232 9490.2547 -3.8750812 0.0011457984 50 + 5234 9658.1297 -3.5385398 0.0011457984 50 + 5236 9767.8043 -2.2736464 0.0011457984 50 + 5238 9761.0999 0.053501857 0.0011457984 50 + 5240 9783.3194 2.5425609 0.0011457984 50 + 5242 9757.6764 4.3275198 0.0011457984 50 + 5244 9722.8232 4.910775 0.0011457984 50 + 5246 9658.9452 4.8162207 0.0011457984 50 + 5248 9549.9302 4.9055441 0.0011457984 50 + 5250 9498.0386 5.0091454 0.0011457984 50 + 5252 9556.7311 4.1185281 0.0011457984 50 + 5254 9557.8028 1.880578 0.0011457984 50 + 5256 9548.9864 -1.1838066 0.0011457984 50 + 5258 9549.5421 -3.602049 0.0011457984 50 + 5260 9475.6275 -4.2460784 0.0011457984 50 + 5262 9448.1808 -3.9399715 0.0011457984 50 + 5264 9419.3009 -3.988808 0.0011457984 50 + 5266 9323.9302 -4.6937748 0.0011457984 50 + 5268 9350.3276 -5.3829053 0.0011457984 50 + 5270 9428.4885 -4.645299 0.0011457984 50 + 5272 9417.8913 -2.2902504 0.0011457984 50 + 5274 9436.9374 -0.11804883 0.0011457984 50 + 5276 9401.9 0.66257181 0.0011457984 50 + 5278 9316.6789 0.31275109 0.0011457984 50 + 5280 9314.8748 0.056129951 0.0011457984 50 + 5282 9304.1942 1.087018 0.0011457984 50 + 5284 9258.2839 2.7234584 0.0011457984 50 + 5286 9294.6632 3.1147868 0.0011457984 50 + 5288 9308.543 1.8812776 0.0011457984 50 + 5290 9351.3899 0.14644409 0.0011457984 50 + 5292 9402.3917 -0.32211565 0.0011457984 50 + 5294 9394.3066 0.91699 0.0011457984 50 + 5296 9363.5405 2.1749681 0.0011457984 50 + 5298 9384.5919 1.7616072 0.0011457984 50 + 5300 9382.0075 0.085544762 0.0011457984 50 + 5302 9444.7238 -1.278927 0.0011457984 50 + 5304 9499.763 -0.95971655 0.0011457984 50 + 5306 9510.1811 0.3954472 0.0011457984 50 + 5308 9521.5827 0.80570679 0.0011457984 50 + 5310 9488.6394 -0.45080118 0.0011457984 50 + 5312 9458.5255 -2.2580491 0.0011457984 50 + 5314 9457.4813 -2.7922614 0.0011457984 50 + 5316 9445.8123 -1.4619951 0.0011457984 50 + 5318 9439.6266 0.15583575 0.0011457984 50 + 5320 9473.753 0.22079091 0.0011457984 50 + 5322 9388.847 -0.86054314 0.0011457984 50 + 5324 9367.7834 -1.620443 0.0011457984 50 + 5326 9380.1644 -0.60133066 0.0011457984 50 + 5328 9304.879 1.8098891 0.0011457984 50 + 5330 9325.2485 3.1393573 0.0011457984 50 + 5332 9358.3543 2.4501572 0.0011457984 50 + 5334 9376.1966 0.84459833 0.0011457984 50 + 5336 9467.6575 -0.083434336 0.0011457984 50 + 5338 9409.1197 0.66408521 0.0011457984 50 + 5340 9250.6533 1.6038726 0.0011457984 50 + 5342 9266.1293 0.61862675 0.0011457984 50 + 5344 9170.0051 -1.5966932 0.0011457984 50 + 5346 9179.8306 -3.6910361 0.0011457984 50 + 5348 9296.0188 -4.0548344 0.0011457984 50 + 5350 9296.8615 -2.5050102 0.0011457984 50 + 5352 9357.2572 -1.4096762 0.0011457984 50 + 5354 9433.7322 -1.9270572 0.0011457984 50 + 5356 9366.3852 -2.9265892 0.0011457984 50 + 5358 9383.244 -3.1782233 0.0011457984 50 + 5360 9330.1465 -1.6512376 0.0011457984 50 + 5362 9194.5054 0.45883229 0.0011457984 50 + 5364 9187.3004 1.0065586 0.0011457984 50 + 5366 9116.9514 0.24444396 0.0011457984 50 + 5368 9123.0653 -0.8484207 0.0011457984 50 + 5370 9235.0911 -0.99263669 0.0011457984 50 + 5372 9188.9208 0.35243273 0.0011457984 50 + 5374 9243.5231 1.2486617 0.0011457984 50 + 5376 9234.3754 1.1088679 0.0011457984 50 + 5378 9105.3344 0.57943502 0.0011457984 50 + 5380 9154.7563 0.26409692 0.0011457984 50 + 5382 9194.3543 1.3453858 0.0011457984 50 + 5384 9205.2826 3.1104191 0.0011457984 50 + 5386 9420.3172 3.7734635 0.0011457984 50 + 5388 9441.4103 3.817096 0.0011457984 50 + 5390 9485.1202 3.3782803 0.0011457984 50 + 5392 9610.8107 2.9155254 0.0011457984 50 + 5394 9501.4179 3.1457124 0.0011457984 50 + 5396 9510.022 2.796283 0.0011457984 50 + 5398 9569.8284 1.81996 0.0011457984 50 + 5400 9457.2815 1.0036435 0.0011457984 50 + 5402 9515.4621 0.079212777 0.0011457984 50 + 5404 9507.745 0.024899951 0.0011457984 50 + 5406 9382.3611 0.84022397 0.0011457984 50 + 5408 9522.7726 1.3301395 0.0011457984 50 + 5410 9508.3297 2.1977172 0.0011457984 50 + 5412 9457.243 3.0751267 0.0011457984 50 + 5414 9584.2886 3.3911486 0.0011457984 50 + 5416 9456.1599 3.9039941 0.0011457984 50 + 5418 9439.7174 3.8015334 0.0011457984 50 + 5420 9595.7276 3.21878 0.0011457984 50 + 5422 9638.3225 2.8942378 0.0011457984 50 + 5424 9764.949 2.1267642 0.0011457984 50 + 5426 9841.5444 1.0682476 0.0011457984 50 + 5428 9680.5031 0.33474701 0.0011457984 50 + 5430 9607.8822 -0.11987808 0.0011457984 50 + 5432 9560.1267 0.27946219 0.0011457984 50 + 5434 9536.9174 1.1692843 0.0011457984 50 + 5436 9631.0768 1.6665967 0.0011457984 50 + 5438 9589.8701 1.9147519 0.0011457984 50 + 5440 9575.3452 1.8639901 0.0011457984 50 + 5442 9659.3629 1.9520524 0.0011457984 50 + 5444 9674.1541 2.4907839 0.0011457984 50 + 5446 9697.7261 2.406508 0.0011457984 50 + 5448 9690.8984 1.1264598 0.0011457984 50 + 5450 9623.3865 -0.92487777 0.0011457984 50 + 5452 9674.9321 -2.905871 0.0011457984 50 + 5454 9702.2485 -3.6732167 0.0011457984 50 + 5456 9635.4187 -3.5217309 0.0011457984 50 + 5458 9581.3254 -3.6059798 0.0011457984 50 + 5460 9480.4669 -3.9734002 0.0011457984 50 + 5462 9435.3131 -4.0387581 0.0011457984 50 + 5464 9534.5506 -2.973297 0.0011457984 50 + 5466 9617.0167 -0.56760995 0.0011457984 50 + 5468 9692.5636 1.7234191 0.0011457984 50 + 5470 9685.9259 2.7363009 0.0011457984 50 + 5472 9599.1928 2.4794484 0.0011457984 50 + 5474 9562.0871 1.8028212 0.0011457984 50 + 5476 9580.3546 1.7444303 0.0011457984 50 + 5478 9604.8083 2.0739899 0.0011457984 50 + 5480 9740.0757 1.5011757 0.0011457984 50 + 5482 9735.5541 0.070083688 0.0011457984 50 + 5484 9721.3199 -1.5645649 0.0011457984 50 + 5486 9719.1871 -2.0903277 0.0011457984 50 + 5488 9755.2534 -1.0516302 0.0011457984 50 + 5490 9741.0741 0.68343685 0.0011457984 50 + 5492 9790.595 1.68584 0.0011457984 50 + 5494 9747.6207 1.940975 0.0011457984 50 + 5496 9760.0492 2.0438587 0.0011457984 50 + 5498 9806.8117 2.9557222 0.0011457984 50 + 5500 9906.2348 4.2445378 0.0011457984 50 + 5502 9937.3762 4.6360945 0.0011457984 50 + 5504 9889.9099 3.36744 0.0011457984 50 + 5506 9801.0867 1.1583543 0.0011457984 50 + 5508 9757.0639 -0.63507871 0.0011457984 50 + 5510 9849.2588 -1.5203115 0.0011457984 50 + 5512 9910.9432 -1.9936042 0.0011457984 50 + 5514 9980.9927 -3.1553219 0.0011457984 50 + 5516 9884.7046 -4.6195607 0.0011457984 50 + 5518 9819.009 -5.5292635 0.0011457984 50 + 5520 9791.743 -5.0244452 0.0011457984 50 + 5522 9876.9616 -3.4374028 0.0011457984 50 + 5524 9913.7323 -1.560895 0.0011457984 50 + 5526 9965.6802 -0.28230669 0.0011457984 50 + 5528 9864.5527 0.77777988 0.0011457984 50 + 5530 9722.3632 2.0611697 0.0011457984 50 + 5532 9692.5948 3.4357418 0.0011457984 50 + 5534 9707.7114 4.4316179 0.0011457984 50 + 5536 9724.5556 4.4200513 0.0011457984 50 + 5538 9810.0608 3.2814823 0.0011457984 50 + 5540 9801.1254 1.9944919 0.0011457984 50 + 5542 9828.6486 0.81577583 0.0011457984 50 + 5544 9886.5246 -0.26945791 0.0011457984 50 + 5546 9814.2295 -1.2219503 0.0011457984 50 + 5548 9769.2818 -2.3790154 0.0011457984 50 + 5550 9671.3607 -3.1813334 0.0011457984 50 + 5552 9566.1375 -3.3034884 0.0011457984 50 + 5554 9662.8479 -3.157334 0.0011457984 50 + 5556 9822.6928 -2.7092017 0.0011457984 50 + 5558 9858.3611 -1.8733723 0.0011457984 50 + 5560 9864.0403 -0.9432148 0.0011457984 50 + 5562 9718.5186 0.33420254 0.0011457984 50 + 5564 9654.7726 1.3559204 0.0011457984 50 + 5566 9734.7499 1.7708321 0.0011457984 50 + 5568 9777.4725 1.9858757 0.0011457984 50 + 5570 9847.5326 2.0634589 0.0011457984 50 + 5572 9936.0477 2.097276 0.0011457984 50 + 5574 9900.7633 2.0720838 0.0011457984 50 + 5576 9937.5273 1.3672326 0.0011457984 50 + 5578 9961.2023 0.43540294 0.0011457984 50 + 5580 9863.5165 0.14546723 0.0011457984 50 + 5582 9788.1833 0.64376512 0.0011457984 50 + 5584 9738.4717 1.7883089 0.0011457984 50 + 5586 9777.5941 2.7944617 0.0011457984 50 + 5588 9844.3258 3.2948653 0.0011457984 50 + 5590 9850.6037 3.73122 0.0011457984 50 + 5592 9798.7444 4.4707532 0.0011457984 50 + 5594 9769.4476 5.2454853 0.0011457984 50 + 5596 9735.6813 5.3788919 0.0011457984 50 + 5598 9750.2623 4.3811369 0.0011457984 50 + 5600 9724.4105 2.9038676 0.0011457984 50 + 5602 9709.8706 1.6769734 0.0011457984 50 + 5604 9638.2747 1.2349895 0.0011457984 50 + 5606 9507.2594 1.3337825 0.0011457984 50 + 5608 9450.6727 1.1336527 0.0011457984 50 + 5610 9408.6365 0.68267355 0.0011457984 50 + 5612 9369.3312 0.59089756 0.0011457984 50 + 5614 9398.4939 1.2016359 0.0011457984 50 + 5616 9399.087 2.5782644 0.0011457984 50 + 5618 9324.4882 3.9215052 0.0011457984 50 + 5620 9341.4802 4.2926302 0.0011457984 50 + 5622 9244.696 4.4103891 0.0011457984 50 + 5624 9215.3593 4.6659322 0.0011457984 50 + 5626 9261.8257 5.3576315 0.0011457984 50 + 5628 9242.4011 6.3450699 0.0011457984 50 + 5630 9285.0978 6.5221442 0.0011457984 50 + 5632 9314.0346 5.9409997 0.0011457984 50 + 5634 9177.7593 5.6044675 0.0011457984 50 + 5636 9156.3214 5.5249683 0.0011457984 50 + 5638 9142.6687 5.7822736 0.0011457984 50 + 5640 9062.436 5.6464383 0.0011457984 50 + 5642 9140.8597 4.0505564 0.0011457984 50 + 5644 9134.2075 1.9875116 0.0011457984 50 + 5646 9084.7092 0.37818807 0.0011457984 50 + 5648 9184.8938 -0.6330058 0.0011457984 50 + 5650 9167.4749 -0.92384704 0.0011457984 50 + 5652 9188.003 -1.5961161 0.0011457984 50 + 5654 9208.2435 -2.6124216 0.0011457984 50 + 5656 9134.2092 -2.7628664 0.0011457984 50 + 5658 9097.3017 -1.5551001 0.0011457984 50 + 5660 9144.5404 0.57803721 0.0011457984 50 + 5662 9067.6426 2.680454 0.0011457984 50 + 5664 9075.8344 3.4574442 0.0011457984 50 + 5666 9019.7649 3.6888499 0.0011457984 50 + 5668 8979.0779 4.3183604 0.0011457984 50 + 5670 9044.7573 5.3882578 0.0011457984 50 + 5672 9106.6295 6.2475025 0.0011457984 50 + 5674 9095.1777 5.8147786 0.0011457984 50 + 5676 9092.9844 3.7292974 0.0011457984 50 + 5678 9006.8683 1.4945746 0.0011457984 50 + 5680 8875.2811 0.39531891 0.0011457984 50 + 5682 8887.6236 0.13437937 0.0011457984 50 + 5684 8857.0466 -0.0678953 0.0011457984 50 + 5686 9029.4601 -1.5241271 0.0011457984 50 + 5688 9195.6539 -3.1525277 0.0011457984 50 + 5690 9255.4237 -3.2301058 0.0011457984 50 + 5692 9262.751 -1.5870815 0.0011457984 50 + 5694 9177.1236 0.75066556 0.0011457984 50 + 5696 8980.3972 2.3413159 0.0011457984 50 + 5698 9046.6838 2.0139028 0.0011457984 50 + 5700 9089.9961 1.3331579 0.0011457984 50 + 5702 9108.9557 1.5442681 0.0011457984 50 + 5704 9183.8128 2.4575345 0.0011457984 50 + 5706 9103.6573 3.3601782 0.0011457984 50 + 5708 9034.187 2.7608128 0.0011457984 50 + 5710 9102.9716 0.72617921 0.0011457984 50 + 5712 9002.0791 -0.57347993 0.0011457984 50 + 5714 8960.5092 -0.6794737 0.0011457984 50 + 5716 8971.8739 -0.00031815209 0.0011457984 50 + 5718 8843.295 0.72776349 0.0011457984 50 + 5720 8934.1565 0.19821608 0.0011457984 50 + 5722 8963.7715 -0.39919342 0.0011457984 50 + 5724 8879.4007 0.20643603 0.0011457984 50 + 5726 8883.8738 1.8298534 0.0011457984 50 + 5728 8875.907 3.9153843 0.0011457984 50 + 5730 8875.0305 5.1890909 0.0011457984 50 + 5732 9093.0103 4.9108717 0.0011457984 50 + 5734 9121.1682 4.658725 0.0011457984 50 + 5736 9147.9828 4.6797083 0.0011457984 50 + 5738 9208.0685 4.6825798 0.0011457984 50 + 5740 9109.1076 4.350183 0.0011457984 50 + 5742 9137.9665 2.5394457 0.0011457984 50 + 5744 9233.8623 -0.13654524 0.0011457984 50 + 5746 9274.9432 -2.1852561 0.0011457984 50 + 5748 9375.8397 -3.1751126 0.0011457984 50 + 5750 9394.0222 -2.9957216 0.0011457984 50 + 5752 9264.7974 -2.3410807 0.0011457984 50 + 5754 9313.8745 -2.2121784 0.0011457984 50 + 5756 9267.4298 -1.5388542 0.0011457984 50 + 5758 9272.5259 0.012455309 0.0011457984 50 + 5760 9378.6847 2.357578 0.0011457984 50 + 5762 9329.1337 5.3400185 0.0011457984 50 + 5764 9318.1234 7.4868473 0.0011457984 50 + 5766 9410.2861 8.1063443 0.0011457984 50 + 5768 9364.9349 7.9969695 0.0011457984 50 + 5770 9397.0258 7.3517553 0.0011457984 50 + 5772 9522.9182 6.4246127 0.0011457984 50 + 5774 9546.1456 5.1902951 0.0011457984 50 + 5776 9688.1023 2.8309542 0.0011457984 50 + 5778 9703.883 0.3843822 0.0011457984 50 + 5780 9560.2136 -0.97898997 0.0011457984 50 + 5782 9491.6947 -1.1277455 0.0011457984 50 + 5784 9464.9945 -0.17086068 0.0011457984 50 + 5786 9410.4041 1.141182 0.0011457984 50 + 5788 9443.3999 1.9891415 0.0011457984 50 + 5790 9390.6079 2.8921217 0.0011457984 50 + 5792 9387.6468 3.9361413 0.0011457984 50 + 5794 9500.5403 4.9627391 0.0011457984 50 + 5796 9496.8831 5.7655291 0.0011457984 50 + 5798 9499.7529 5.2018266 0.0011457984 50 + 5800 9456.1563 3.4798465 0.0011457984 50 + 5802 9375.5941 1.6783349 0.0011457984 50 + 5804 9442.5195 0.3430883 0.0011457984 50 + 5806 9484.4576 -0.077274186 0.0011457984 50 + 5808 9429.8078 -0.17234937 0.0011457984 50 + 5810 9456.4999 -0.69501087 0.0011457984 50 + 5812 9397.6411 -0.73520349 0.0011457984 50 + 5814 9407.137 0.060929401 0.0011457984 50 + 5816 9526.2338 1.5625496 0.0011457984 50 + 5818 9487.0573 3.536031 0.0011457984 50 + 5820 9540.0818 4.4291809 0.0011457984 50 + 5822 9598.9135 4.0269073 0.0011457984 50 + 5824 9531.0727 3.1592454 0.0011457984 50 + 5826 9508.6169 2.2657967 0.0011457984 50 + 5828 9454.0163 1.9297467 0.0011457984 50 + 5830 9396.1836 1.5698577 0.0011457984 50 + 5832 9566.9629 0.057300614 0.0011457984 50 + 5834 9656.9144 -1.7889329 0.0011457984 50 + 5836 9681.8595 -3.1479964 0.0011457984 50 + 5838 9680.7003 -3.4838441 0.0011457984 50 + 5840 9505.8807 -2.7332235 0.0011457984 50 + 5842 9405.8802 -2.3153426 0.0011457984 50 + 5844 9420.8907 -2.7763813 0.0011457984 50 + 5846 9424.7211 -3.3544877 0.0011457984 50 + 5848 9493.4043 -3.3493234 0.0011457984 50 + 5850 9528.0457 -2.1551469 0.0011457984 50 + 5852 9452.8631 -0.35990604 0.0011457984 50 + 5854 9419.8602 0.55498139 0.0011457984 50 + 5856 9334.3062 0.49191412 0.0011457984 50 + 5858 9284.7095 0.012872669 0.0011457984 50 + 5860 9275.8427 0.11749661 0.0011457984 50 + 5862 9238.2407 1.0991173 0.0011457984 50 + 5864 9265.6877 1.7811333 0.0011457984 50 + 5866 9247.8628 1.4524729 0.0011457984 50 + 5868 9251.3414 0.24102384 0.0011457984 50 + 5870 9334.5085 -0.9900622 0.0011457984 50 + 5872 9380.6515 -1.2254557 0.0011457984 50 + 5874 9400.7574 -0.85963511 0.0011457984 50 + 5876 9461.4556 -0.97009484 0.0011457984 50 + 5878 9422.7193 -1.7108859 0.0011457984 50 + 5880 9452.3619 -2.8338146 0.0011457984 50 + 5882 9478.1995 -3.1268178 0.0011457984 50 + 5884 9455.6014 -2.0975814 0.0011457984 50 + 5886 9523.8311 -0.8393345 0.0011457984 50 + 5888 9469.8628 -0.024389183 0.0011457984 50 + 5890 9353.3316 -0.029234815 0.0011457984 50 + 5892 9353.2772 -0.36384581 0.0011457984 50 + 5894 9296.039 0.26316862 0.0011457984 50 + 5896 9347.861 1.2835594 0.0011457984 50 + 5898 9441.5972 1.7248974 0.0011457984 50 + 5900 9381.4678 1.2684522 0.0011457984 50 + 5902 9361.5331 -0.019520588 0.0011457984 50 + 5904 9360.4057 -0.89549679 0.0011457984 50 + 5906 9366.958 -0.86092765 0.0011457984 50 + 5908 9496.5969 -0.84331725 0.0011457984 50 + 5910 9462.4261 -1.1960116 0.0011457984 50 + 5912 9324.8237 -1.9671879 0.0011457984 50 + 5914 9285.0082 -2.3761654 0.0011457984 50 + 5916 9282.2489 -1.3018825 0.0011457984 50 + 5918 9418.5779 0.58373203 0.0011457984 50 + 5920 9539.3709 2.252092 0.0011457984 50 + 5922 9498.438 3.229691 0.0011457984 50 + 5924 9432.9584 3.6446358 0.0011457984 50 + 5926 9419.3007 4.4423313 0.0011457984 50 + 5928 9498.7474 5.7335499 0.0011457984 50 + 5930 9711.7231 6.4606288 0.0011457984 50 + 5932 9824.7497 5.9737039 0.0011457984 50 + 5934 9830.3795 4.2470677 0.0011457984 50 + 5936 9742.2625 2.4954471 0.0011457984 50 + 5938 9622.9601 1.7734819 0.0011457984 50 + 5940 9564.3827 1.6969709 0.0011457984 50 + 5942 9505.3002 1.4169294 0.0011457984 50 + 5944 9527.2581 0.33507768 0.0011457984 50 + 5946 9576.9445 -0.73645779 0.0011457984 50 + 5948 9611.2143 -0.46409823 0.0011457984 50 + 5950 9652.9501 1.2596854 0.0011457984 50 + 5952 9679.4027 3.43528 0.0011457984 50 + 5954 9567.8258 5.0545532 0.0011457984 50 + 5956 9599.4726 5.2843846 0.0011457984 50 + 5958 9589.5061 5.4230915 0.0011457984 50 + 5960 9549.2322 6.5029997 0.0011457984 50 + 5962 9580.8085 8.0667162 0.0011457984 50 + 5964 9553.0902 9.3316431 0.0011457984 50 + 5966 9478.6722 9.3997735 0.0011457984 50 + 5968 9575.7717 8.0819559 0.0011457984 50 + 5970 9522.7041 7.0080815 0.0011457984 50 + 5972 9488.6679 6.4440707 0.0011457984 50 + 5974 9573.1695 5.9298637 0.0011457984 50 + 5976 9582.6086 5.2536087 0.0011457984 50 + 5978 9628.2049 3.8987008 0.0011457984 50 + 5980 9677.3761 2.5384624 0.0011457984 50 + 5982 9596.6234 2.2380369 0.0011457984 50 + 5984 9588.085 2.6032445 0.0011457984 50 + 5986 9680.8357 2.9432395 0.0011457984 50 + 5988 9699.6998 2.9389564 0.0011457984 50 + 5990 9818.7251 2.2461338 0.0011457984 50 + 5992 9865.95 1.7383994 0.0011457984 50 + 5994 9845.4616 1.7345407 0.0011457984 50 + 5996 9854.6465 1.805345 0.0011457984 50 + 5998 9850.1963 1.8001966 0.0011457984 50 + 6000 9809.6304 1.5739345 0.0011457984 50 + 6002 9891.4427 0.92755735 0.0011457984 50 + 6004 9912.1115 0.48270035 0.0011457984 50 + 6006 9887.7326 0.39077694 0.0011457984 50 + 6008 9861.9189 0.6337832 0.0011457984 50 + 6010 9768.1269 1.2151004 0.0011457984 50 + 6012 9773.5059 1.498899 0.0011457984 50 + 6014 9819.8242 1.3529148 0.0011457984 50 + 6016 9828.2381 0.996993 0.0011457984 50 + 6018 9838.2915 0.66495661 0.0011457984 50 + 6020 9869.4576 0.69539003 0.0011457984 50 + 6022 9834.0117 1.1078898 0.0011457984 50 + 6024 9873.4062 1.07854 0.0011457984 50 + 6026 9914.6123 0.44227466 0.0011457984 50 + 6028 9891.3644 -0.36282183 0.0011457984 50 + 6030 9879.73 -0.83632357 0.0011457984 50 + 6032 9860.7734 -0.65427235 0.0011457984 50 + 6034 9835.8156 -0.30828552 0.0011457984 50 + 6036 9823.8167 -0.54884625 0.0011457984 50 + 6038 9779.8815 -1.3563752 0.0011457984 50 + 6040 9695.471 -1.9518387 0.0011457984 50 + 6042 9665.1458 -1.6761814 0.0011457984 50 + 6044 9644.9759 -0.43265853 0.0011457984 50 + 6046 9602.8254 1.0066052 0.0011457984 50 + 6048 9641.4636 1.7985425 0.0011457984 50 + 6050 9704.4729 2.2207014 0.0011457984 50 + 6052 9782.2464 2.9918915 0.0011457984 50 + 6054 9822.1111 4.4377842 0.0011457984 50 + 6056 9791.1854 5.9424321 0.0011457984 50 + 6058 9669.251 6.5453526 0.0011457984 50 + 6060 9594.6289 5.8146205 0.0011457984 50 + 6062 9582.48 4.5586657 0.0011457984 50 + 6064 9618.5592 3.7252984 0.0011457984 50 + 6066 9661.4545 3.4533548 0.0011457984 50 + 6068 9693.2956 3.0938242 0.0011457984 50 + 6070 9742.4217 2.026046 0.0011457984 50 + 6072 9798.2646 0.58042123 0.0011457984 50 + 6074 9844.6891 -0.26831074 0.0011457984 50 + 6076 9883.7518 0.046526836 0.0011457984 50 + 6078 9912.71 1.0839261 0.0011457984 50 + 6080 9944.1643 1.8908726 0.0011457984 50 + 6082 9956.4196 2.0738197 0.0011457984 50 + 6084 9933.531 2.1330963 0.0011457984 50 + 6086 9858.8887 2.8225944 0.0011457984 50 + 6088 9842.6352 3.8176999 0.0011457984 50 + 6090 9869.0454 4.111327 0.0011457984 50 + 6092 9895.151 3.072967 0.0011457984 50 + 6094 9923.4713 1.0726233 0.0011457984 50 + 6096 9846.6654 -0.5488411 0.0011457984 50 + 6098 9727.6782 -1.0304422 0.0011457984 50 + 6100 9644.9934 -0.63623128 0.0011457984 50 + 6102 9688.8998 -0.14299764 0.0011457984 50 + 6104 9788.6344 0.074155995 0.0011457984 50 + 6106 9880.8557 0.46787569 0.0011457984 50 + 6108 9795.1292 1.9605951 0.0011457984 50 + 6110 9781.2803 3.9699667 0.0011457984 50 + 6112 9772.8688 5.6753162 0.0011457984 50 + 6114 9783.1404 6.2397127 0.0011457984 50 + 6116 9862.009 5.4814461 0.0011457984 50 + 6118 9834.7021 4.4466959 0.0011457984 50 + 6120 9718.1031 3.6458456 0.0011457984 50 + 6122 9611.3046 2.7891142 0.0011457984 50 + 6124 9492.9139 1.6648477 0.0011457984 50 + 6126 9466.1975 0.059344629 0.0011457984 50 + 6128 9596.4483 -1.4758409 0.0011457984 50 + 6130 9628.4788 -1.633685 0.0011457984 50 + 6132 9663.5465 -0.60391218 0.0011457984 50 + 6134 9598.4656 1.0889235 0.0011457984 50 + 6136 9457.9898 2.7495116 0.0011457984 50 + 6138 9455.8838 3.8955319 0.0011457984 50 + 6140 9518.8498 5.1312351 0.0011457984 50 + 6142 9550.1571 6.7355515 0.0011457984 50 + 6144 9615.9609 8.1297976 0.0011457984 50 + 6146 9580.9308 9.0695275 0.0011457984 50 + 6148 9519.1276 9.1299634 0.0011457984 50 + 6150 9504.6824 8.4661449 0.0011457984 50 + 6152 9457.6515 7.932841 0.0011457984 50 + 6154 9438.392 7.7647042 0.0011457984 50 + 6156 9507.2605 7.7047419 0.0011457984 50 + 6158 9533.8383 7.5627875 0.0011457984 50 + 6160 9549.8644 7.1790181 0.0011457984 50 + 6162 9485.2333 7.0421404 0.0011457984 50 + 6164 9446.5 7.1354196 0.0011457984 50 + 6166 9515.3201 7.0663308 0.0011457984 50 + 6168 9627.0393 6.622293 0.0011457984 50 + 6170 9749.8051 5.6938844 0.0011457984 50 + 6172 9782.629 4.7167086 0.0011457984 50 + 6174 9726.303 4.1988674 0.0011457984 50 + 6176 9681.211 4.0710617 0.0011457984 50 + 6178 9652.0773 4.083136 0.0011457984 50 + 6180 9526.2991 4.0795518 0.0011457984 50 + 6182 9459.8141 3.8437065 0.0011457984 50 + 6184 9376.45 4.0452702 0.0011457984 50 + 6186 9479.2533 4.5140318 0.0011457984 50 + 6188 9643.0814 4.9451797 0.0011457984 50 + 6190 9623.6312 5.0605544 0.0011457984 50 + 6192 9519.3424 4.345871 0.0011457984 50 + 6194 9384.4864 3.3226331 0.0011457984 50 + 6196 9289.0608 2.7298129 0.0011457984 50 + 6198 9438.2363 2.3236495 0.0011457984 50 + 6200 9534.5097 2.2616915 0.0011457984 50 + 6202 9522.1612 2.2305021 0.0011457984 50 + 6204 9561.3164 2.0368725 0.0011457984 50 + 6206 9488.2213 2.5778043 0.0011457984 50 + 6208 9485.71 3.6261767 0.0011457984 50 + 6210 9544.4238 4.703255 0.0011457984 50 + 6212 9442.1106 5.5055657 0.0011457984 50 + 6214 9455.2624 5.0271672 0.0011457984 50 + 6216 9512.8447 3.7826535 0.0011457984 50 + 6218 9450.445 2.7933333 0.0011457984 50 + 6220 9541.2524 1.7850204 0.0011457984 50 + 6222 9561.4937 0.99601556 0.0011457984 50 + 6224 9504.8285 0.089294214 0.0011457984 50 + 6226 9551.2059 -1.1872491 0.0011457984 50 + 6228 9521.3868 -1.6821833 0.0011457984 50 + 6230 9465.2199 -0.96705063 0.0011457984 50 + 6232 9575.3147 0.43767353 0.0011457984 50 + 6234 9583.8318 2.233984 0.0011457984 50 + 6236 9655.3492 3.1655344 0.0011457984 50 + 6238 9697.5503 3.2691103 0.0011457984 50 + 6240 9527.8029 3.4994103 0.0011457984 50 + 6242 9396.131 3.7934199 0.0011457984 50 + 6244 9335.0447 3.9829087 0.0011457984 50 + 6246 9290.2872 3.5524291 0.0011457984 50 + 6248 9345.2633 2.0516189 0.0011457984 50 + 6250 9357.2713 0.36288783 0.0011457984 50 + 6252 9293.6481 -0.60034651 0.0011457984 50 + 6254 9314.129 -0.79094718 0.0011457984 50 + 6256 9262.6771 -0.2910575 0.0011457984 50 + 6258 9234.2281 0.014823431 0.0011457984 50 + 6260 9357.5686 -0.46680756 0.0011457984 50 + 6262 9416.3145 -1.1281866 0.0011457984 50 + 6264 9403.8035 -1.4862433 0.0011457984 50 + 6266 9367.0496 -1.320256 0.0011457984 50 + 6268 9258.5943 -0.78014425 0.0011457984 50 + 6270 9222.9527 -0.64498925 0.0011457984 50 + 6272 9332.1552 -1.2392307 0.0011457984 50 + 6274 9384.495 -1.8477753 0.0011457984 50 + 6276 9401.0798 -1.84529 0.0011457984 50 + 6278 9394.6872 -0.88277878 0.0011457984 50 + 6280 9326.9138 0.84681766 0.0011457984 50 + 6282 9346.4349 2.2235849 0.0011457984 50 + 6284 9433.7134 2.6237732 0.0011457984 50 + 6286 9367.5213 2.7639499 0.0011457984 50 + 6288 9334.7447 3.1233908 0.0011457984 50 + 6290 9414.9327 3.9228632 0.0011457984 50 + 6292 9396.7388 4.8559892 0.0011457984 50 + 6294 9419.5273 4.39179 0.0011457984 50 + 6296 9336.6624 2.5930407 0.0011457984 50 + 6298 9218.106 0.77310018 0.0011457984 50 + 6300 9338.3455 0.031319512 0.0011457984 50 + 6302 9548.1089 0.9058411 0.0011457984 50 + 6304 9584.955 2.3691874 0.0011457984 50 + 6306 9596.7481 2.5600136 0.0011457984 50 + 6308 9493.407 1.910796 0.0011457984 50 + 6310 9497.6044 1.5160645 0.0011457984 50 + 6312 9677.0697 2.1599041 0.0011457984 50 + 6314 9677.5986 3.8951444 0.0011457984 50 + 6316 9568.551 4.8522466 0.0011457984 50 + 6318 9519.3128 3.8476542 0.0011457984 50 + 6320 9477.2654 1.923282 0.0011457984 50 + 6322 9601.1273 0.39351454 0.0011457984 50 + 6324 9664.4745 0.53874451 0.0011457984 50 + 6326 9493.8865 1.8845461 0.0011457984 50 + 6328 9408.0474 2.3653529 0.0011457984 50 + 6330 9335.7617 1.8595183 0.0011457984 50 + 6332 9391.9314 1.2747265 0.0011457984 50 + 6334 9558.4684 1.8410142 0.0011457984 50 + 6336 9615.703 4.006068 0.0011457984 50 + 6338 9553.4494 6.203629 0.0011457984 50 + 6340 9539.4374 6.6962829 0.0011457984 50 + 6342 9470.5223 5.7852955 0.0011457984 50 + 6344 9485.1119 4.6403634 0.0011457984 50 + 6346 9479.4077 4.7355587 0.0011457984 50 + 6348 9447.633 5.7017265 0.0011457984 50 + 6350 9455.1225 5.798905 0.0011457984 50 + 6352 9430.8198 4.3198142 0.0011457984 50 + 6354 9448.6071 2.0772804 0.0011457984 50 + 6356 9492.6461 0.8769538 0.0011457984 50 + 6358 9549.4594 1.4447744 0.0011457984 50 + 6360 9550.1224 2.7230203 0.0011457984 50 + 6362 9509.9436 3.2113226 0.0011457984 50 + 6364 9526.394 2.4241589 0.0011457984 50 + 6366 9686.0529 1.3451679 0.0011457984 50 + 6368 9783.1581 1.5382741 0.0011457984 50 + 6370 9838.8093 2.7585361 0.0011457984 50 + 6372 9720.7706 3.8895894 0.0011457984 50 + 6374 9516.5516 3.8503907 0.0011457984 50 + 6376 9437.2155 2.8562902 0.0011457984 50 + 6378 9484.8409 2.4668168 0.0011457984 50 + 6380 9617.8774 3.2986277 0.0011457984 50 + 6382 9693.5884 4.538726 0.0011457984 50 + 6384 9582.7671 5.08112 0.0011457984 50 + 6386 9507.7158 4.3440097 0.0011457984 50 + 6388 9504.2482 3.4300535 0.0011457984 50 + 6390 9529.854 3.4743908 0.0011457984 50 + 6392 9619.924 4.1465988 0.0011457984 50 + 6394 9641.9665 4.5472982 0.0011457984 50 + 6396 9646.0139 3.6689701 0.0011457984 50 + 6398 9643.3496 1.8922098 0.0011457984 50 + 6400 9550.7224 0.78810044 0.0011457984 50 + 6402 9518.219 0.76140043 0.0011457984 50 + 6404 9480.1113 1.3310925 0.0011457984 50 + 6406 9430.6607 1.4279179 0.0011457984 50 + 6408 9528.8336 0.41719036 0.0011457984 50 + 6410 9517.5067 -0.23887578 0.0011457984 50 + 6412 9509.2189 0.2683376 0.0011457984 50 + 6414 9610.8635 1.5036072 0.0011457984 50 + 6416 9580.9492 2.7476589 0.0011457984 50 + 6418 9526.445 2.7203747 0.0011457984 50 + 6420 9491.047 1.7609024 0.0011457984 50 + 6422 9332.0354 1.6287409 0.0011457984 50 + 6424 9425.2471 2.2364284 0.0011457984 50 + 6426 9544.4397 3.1942266 0.0011457984 50 + 6428 9570.9285 3.3406159 0.0011457984 50 + 6430 9668.0361 1.8509515 0.0011457984 50 + 6432 9668.7456 0.36824782 0.0011457984 50 + 6434 9584.8751 0.33327993 0.0011457984 50 + 6436 9683.9538 1.246464 0.0011457984 50 + 6438 9588.6432 2.5209673 0.0011457984 50 + 6440 9500.4296 2.5326661 0.0011457984 50 + 6442 9544.7194 1.3443464 0.0011457984 50 + 6444 9519.127 0.86704484 0.0011457984 50 + 6446 9591.6737 1.4271621 0.0011457984 50 + 6448 9609.0228 2.4883879 0.0011457984 50 + 6450 9450.2371 2.8223434 0.0011457984 50 + 6452 9428.5145 1.2923919 0.0011457984 50 + 6454 9535.3168 -0.81269947 0.0011457984 50 + 6456 9606.6468 -1.843664 0.0011457984 50 + 6458 9780.9103 -2.0363082 0.0011457984 50 + 6460 9643.8864 -1.7412278 0.0011457984 50 + 6462 9498.9174 -2.4291832 0.0011457984 50 + 6464 9418.4471 -3.7349724 0.0011457984 50 + 6466 9376.4988 -4.0358005 0.0011457984 50 + 6468 9466.641 -2.9149438 0.0011457984 50 + 6470 9572.1969 -0.80528631 0.0011457984 50 + 6472 9500.8128 1.1712587 0.0011457984 50 + 6474 9525.13 1.6578208 0.0011457984 50 + 6476 9483.7706 1.648966 0.0011457984 50 + 6478 9426.1215 2.1430336 0.0011457984 50 + 6480 9532.4265 3.0967451 0.0011457984 50 + 6482 9586.2159 4.1597866 0.0011457984 50 + 6484 9702.8705 3.9614987 0.0011457984 50 + 6486 9812.5137 2.4781888 0.0011457984 50 + 6488 9783.0439 1.0426266 0.0011457984 50 + 6490 9786.9023 0.31640734 0.0011457984 50 + 6492 9798.5012 0.56327042 0.0011457984 50 + 6494 9725.7503 1.1843854 0.0011457984 50 + 6496 9763.3894 1.0095547 0.0011457984 50 + 6498 9754.2013 0.54200135 0.0011457984 50 + 6500 9747.7199 0.52799448 0.0011457984 50 + 6502 9825.0139 1.3472032 0.0011457984 50 + 6504 9806.6784 2.9080439 0.0011457984 50 + 6506 9739.7754 3.9790545 0.0011457984 50 + 6508 9683.515 3.8746527 0.0011457984 50 + 6510 9585.5878 3.1580565 0.0011457984 50 + 6512 9559.5437 2.6603845 0.0011457984 50 + 6514 9553.1682 3.1173833 0.0011457984 50 + 6516 9617.3126 3.8357277 0.0011457984 50 + 6518 9626.4668 3.9761292 0.0011457984 50 + 6520 9611.781 3.3021231 0.0011457984 50 + 6522 9628.0311 2.6152172 0.0011457984 50 + 6524 9591.2489 3.1468993 0.0011457984 50 + 6526 9631.1291 4.5759197 0.0011457984 50 + 6528 9694.785 5.9110989 0.0011457984 50 + 6530 9668.6226 6.4267127 0.0011457984 50 + 6532 9702.5217 5.7159704 0.0011457984 50 + 6534 9670.8943 4.9904461 0.0011457984 50 + 6536 9566.0723 5.0520415 0.0011457984 50 + 6538 9662.3465 4.9955564 0.0011457984 50 + 6540 9624.7491 4.5554432 0.0011457984 50 + 6542 9610.2655 2.935778 0.0011457984 50 + 6544 9640.991 0.78019926 0.0011457984 50 + 6546 9482.0197 -0.06082777 0.0011457984 50 + 6548 9517.953 0.049353066 0.0011457984 50 + 6550 9600.964 0.68215178 0.0011457984 50 + 6552 9502.3532 1.3797524 0.0011457984 50 + 6554 9590.7046 1.0796687 0.0011457984 50 + 6556 9562.5821 1.3001048 0.0011457984 50 + 6558 9492.4022 2.7582579 0.0011457984 50 + 6560 9685.3054 4.5270068 0.0011457984 50 + 6562 9627.4949 6.5189446 0.0011457984 50 + 6564 9545.571 7.0982162 0.0011457984 50 + 6566 9696.3483 5.9173083 0.0011457984 50 + 6568 9608.3566 5.155166 0.0011457984 50 + 6570 9798.924 4.4248249 0.0011457984 50 + 6572 9959.3866 3.9870838 0.0011457984 50 + 6574 9819.9052 3.549873 0.0011457984 50 + 6576 9834.9811 1.657563 0.0011457984 50 + 6578 9775.7119 -0.26125185 0.0011457984 50 + 6580 9566.1885 -0.83227093 0.0011457984 50 + 6582 9630.6701 -0.46258831 0.0011457984 50 + 6584 9562.4714 1.0978899 0.0011457984 50 + 6586 9567.6935 2.1431484 0.0011457984 50 + 6588 9741.3812 1.9825571 0.0011457984 50 + 6590 9601.135 2.3033609 0.0011457984 50 + 6592 9509.2215 3.0665323 0.0011457984 50 + 6594 9453.8174 4.331052 0.0011457984 50 + 6596 9355.6571 5.3819844 0.0011457984 50 + 6598 9480.7483 4.6423618 0.0011457984 50 + 6600 9561.1556 3.076253 0.0011457984 50 + 6602 9501.0943 2.0980207 0.0011457984 50 + 6604 9518.0895 2.1448739 0.0011457984 50 + 6606 9407.7483 3.3270763 0.0011457984 50 + 6608 9399.702 3.7602426 0.0011457984 50 + 6610 9418.2094 2.9607374 0.0011457984 50 + 6612 9317.8994 2.1554148 0.0011457984 50 + 6614 9404.5025 1.9811111 0.0011457984 50 + 6616 9450.3024 3.1590235 0.0011457984 50 + 6618 9430.1983 4.4687259 0.0011457984 50 + 6620 9483.1949 4.1921788 0.0011457984 50 + 6622 9360.5724 3.0184692 0.0011457984 50 + 6624 9301.5199 1.7706725 0.0011457984 50 + 6626 9358.4074 1.484283 0.0011457984 50 + 6628 9320.3863 2.3142114 0.0011457984 50 + 6630 9357.742 2.4731696 0.0011457984 50 + 6632 9289.3861 1.6933542 0.0011457984 50 + 6634 9200.1606 0.53244548 0.0011457984 50 + 6636 9285.4122 -0.21771618 0.0011457984 50 + 6638 9273.201 0.49778666 0.0011457984 50 + 6640 9277.9378 1.4890229 0.0011457984 50 + 6642 9309.8875 1.4821724 0.0011457984 50 + 6644 9212.6337 0.71477517 0.0011457984 50 + 6646 9261.9296 -0.3750363 0.0011457984 50 + 6648 9232.4584 -0.19330455 0.0011457984 50 + 6650 9138.7723 1.1930289 0.0011457984 50 + 6652 9209.3165 2.1024837 0.0011457984 50 + 6654 9210.6175 2.1006609 0.0011457984 50 + 6656 9247.419 1.0971021 0.0011457984 50 + 6658 9320.7329 0.1871267 0.0011457984 50 + 6660 9229.8721 0.61997654 0.0011457984 50 + 6662 9240.7257 1.3084329 0.0011457984 50 + 6664 9215.9737 1.4367023 0.0011457984 50 + 6666 9112.9071 0.57490944 0.0011457984 50 + 6668 9132.8078 -1.062697 0.0011457984 50 + 6670 9046.1388 -1.6518115 0.0011457984 50 + 6672 9065.662 -1.2216202 0.0011457984 50 + 6674 9211.6125 -0.71351135 0.0011457984 50 + 6676 9127.93 -0.41368587 0.0011457984 50 + 6678 9142.7655 -1.0426587 0.0011457984 50 + 6680 9132.3055 -1.1865672 0.0011457984 50 + 6682 9006.4855 0.2946137 0.0011457984 50 + 6684 9122.5655 2.1250652 0.0011457984 50 + 6686 9085.148 3.8397291 0.0011457984 50 + 6688 9012.2875 4.410528 0.0011457984 50 + 6690 9182.3707 3.690244 0.0011457984 50 + 6692 9214.2012 3.6186026 0.0011457984 50 + 6694 9300.7227 4.0300776 0.0011457984 50 + 6696 9402.6282 4.278306 0.0011457984 50 + 6698 9164.423 4.3089161 0.0011457984 50 + 6700 9120.354 2.9580788 0.0011457984 50 + 6702 9203.2662 1.3893404 0.0011457984 50 + 6704 9181.1238 1.0958729 0.0011457984 50 + 6706 9324.3846 1.485356 0.0011457984 50 + 6708 9272.2965 2.5420935 0.0011457984 50 + 6710 9136.7426 3.1878257 0.0011457984 50 + 6712 9199.9122 2.765785 0.0011457984 50 + 6714 9142.8317 2.6467469 0.0011457984 50 + 6716 9155.3753 2.8862837 0.0011457984 50 + 6718 9196.9246 3.4934651 0.0011457984 50 + 6720 9067.1701 4.3945875 0.0011457984 50 + 6722 9137.1206 4.202401 0.0011457984 50 + 6724 9232.8823 3.3789257 0.0011457984 50 + 6726 9179.6599 2.9253479 0.0011457984 50 + 6728 9247.0025 2.9044453 0.0011457984 50 + 6730 9172.3171 3.8429481 0.0011457984 50 + 6732 9098.1881 4.7163287 0.0011457984 50 + 6734 9133.5711 4.7208533 0.0011457984 50 + 6736 9049.8344 4.6670978 0.0011457984 50 + 6738 9048.7267 4.7360078 0.0011457984 50 + 6740 9119.9462 5.1393015 0.0011457984 50 + 6742 9096.1453 5.8170681 0.0011457984 50 + 6744 9148.796 5.6576858 0.0011457984 50 + 6746 9198.1038 4.6518243 0.0011457984 50 + 6748 9119.522 3.4528783 0.0011457984 50 + 6750 9163.7375 2.3742799 0.0011457984 50 + 6752 9158.9455 2.3179934 0.0011457984 50 + 6754 9200.2824 2.8007244 0.0011457984 50 + 6756 9317.021 2.996827 0.0011457984 50 + 6758 9281.32 3.0866436 0.0011457984 50 + 6760 9214.2542 3.3100198 0.0011457984 50 + 6762 9141.6297 4.2716589 0.0011457984 50 + 6764 9030.6311 6.0850048 0.0011457984 50 + 6766 8986.3202 7.7218338 0.0011457984 50 + 6768 9124.8939 8.233704 0.0011457984 50 + 6770 9181.0828 8.0567261 0.0011457984 50 + 6772 9209.2671 7.6801113 0.0011457984 50 + 6774 9122.5752 7.8305105 0.0011457984 50 + 6776 8971.9074 8.3745788 0.0011457984 50 + 6778 8961.0126 8.1704049 0.0011457984 50 + 6780 8991.452 7.0723724 0.0011457984 50 + 6782 8996.6479 5.8901461 0.0011457984 50 + 6784 9099.4595 5.2664992 0.0011457984 50 + 6786 9183.7895 5.5732067 0.0011457984 50 + 6788 9151.4641 6.1133097 0.0011457984 50 + 6790 9251.8159 5.3922335 0.0011457984 50 + 6792 9242.479 3.912959 0.0011457984 50 + 6794 9218.731 2.536709 0.0011457984 50 + 6796 9407.6498 1.6473009 0.0011457984 50 + 6798 9472.4451 1.8144248 0.0011457984 50 + 6800 9428.5911 1.9508316 0.0011457984 50 + 6802 9379.8411 1.1964955 0.0011457984 50 + 6804 9179.1839 0.5503483 0.0011457984 50 + 6806 9196.9085 0.3697523 0.0011457984 50 + 6808 9437.6308 0.9309951 0.0011457984 50 + 6810 9452.1137 2.2408358 0.0011457984 50 + 6812 9493.9746 2.5532352 0.0011457984 50 + 6814 9462.6461 1.9818521 0.0011457984 50 + 6816 9284.8303 1.6995986 0.0011457984 50 + 6818 9382.9421 1.6019612 0.0011457984 50 + 6820 9418.5061 2.1611876 0.0011457984 50 + 6822 9332.6425 2.4695103 0.0011457984 50 + 6824 9436.2739 1.289469 0.0011457984 50 + 6826 9454.9298 0.029799371 0.0011457984 50 + 6828 9467.8893 -0.40096797 0.0011457984 50 + 6830 9642.5265 -0.063364391 0.0011457984 50 + 6832 9521.2232 1.1706365 0.0011457984 50 + 6834 9485.3758 1.3674092 0.0011457984 50 + 6836 9607.1974 0.29317356 0.0011457984 50 + 6838 9576.211 -0.39980521 0.0011457984 50 + 6840 9709.349 -0.61244278 0.0011457984 50 + 6842 9790.377 -0.04841628 0.0011457984 50 + 6844 9701.5182 0.62161734 0.0011457984 50 + 6846 9782.8363 -0.038225843 0.0011457984 50 + 6848 9699.3989 -0.77828635 0.0011457984 50 + 6850 9472.2321 -0.54977139 0.0011457984 50 + 6852 9544.5917 0.29157291 0.0011457984 50 + 6854 9523.2331 1.9625881 0.0011457984 50 + 6856 9556.5287 2.9066281 0.0011457984 50 + 6858 9758.0217 2.455707 0.0011457984 50 + 6860 9720.5151 2.3155597 0.0011457984 50 + 6862 9718.898 2.8466423 0.0011457984 50 + 6864 9809.3996 3.8603313 0.0011457984 50 + 6866 9766.1581 4.6784565 0.0011457984 50 + 6868 9783.6949 3.9207863 0.0011457984 50 + 6870 9745.4637 2.4425731 0.0011457984 50 + 6872 9616.3958 1.8059494 0.0011457984 50 + 6874 9676.5806 2.2676016 0.0011457984 50 + 6876 9754.9546 3.5887651 0.0011457984 50 + 6878 9809.9564 4.4083 0.0011457984 50 + 6880 9934.5346 3.901907 0.0011457984 50 + 6882 9924.503 3.1667118 0.0011457984 50 + 6884 9892.5187 3.0940516 0.0011457984 50 + 6886 9885.7093 3.9258883 0.0011457984 50 + 6888 9857.212 4.8890991 0.0011457984 50 + 6890 9890.7579 4.7763457 0.0011457984 50 + 6892 9933.0785 3.8000778 0.0011457984 50 + 6894 9900.619 3.1976105 0.0011457984 50 + 6896 9858.432 3.7924904 0.0011457984 50 + 6898 9847.2897 5.4122494 0.0011457984 50 + 6900 9858.8995 6.969799 0.0011457984 50 + 6902 9931.5971 7.3803058 0.0011457984 50 + 6904 9917.5095 6.8833714 0.0011457984 50 + 6906 9772.3484 6.6003831 0.0011457984 50 + 6908 9615.9521 7.250668 0.0011457984 50 + 6910 9595.5589 8.2944889 0.0011457984 50 + 6912 9669.3373 8.5743927 0.0011457984 50 + 6914 9803.7043 7.2428001 0.0011457984 50 + 6916 9856.3221 5.0942255 0.0011457984 50 + 6918 9770.5344 3.8340889 0.0011457984 50 + 6920 9737.3237 3.9319718 0.0011457984 50 + 6922 9813.5645 4.5151651 0.0011457984 50 + 6924 9839.2713 4.4669171 0.0011457984 50 + 6926 9880.5785 3.1456377 0.0011457984 50 + 6928 9867.8611 1.8093077 0.0011457984 50 + 6930 9854.0491 1.8572101 0.0011457984 50 + 6932 9950.8028 3.2248345 0.0011457984 50 + 6934 10007.469 4.8800184 0.0011457984 50 + 6936 10060.405 5.2125272 0.0011457984 50 + 6938 10139.72 4.0751831 0.0011457984 50 + 6940 10103.556 3.2651112 0.0011457984 50 + 6942 10035.304 3.8806931 0.0011457984 50 + 6944 9941.4949 5.6889739 0.0011457984 50 + 6946 9748.653 7.4386549 0.0011457984 50 + 6948 9747.8782 7.5434348 0.0011457984 50 + 6950 9782.2201 6.8376514 0.0011457984 50 + 6952 9784.6755 6.7479056 0.0011457984 50 + 6954 9832.154 7.6631317 0.0011457984 50 + 6956 9744.0013 9.2453763 0.0011457984 50 + 6958 9700.4866 9.696079 0.0011457984 50 + 6960 9872.7564 8.0501877 0.0011457984 50 + 6962 9925.1225 5.8075771 0.0011457984 50 + 6964 9910.4396 4.256995 0.0011457984 50 + 6966 9830.7971 4.1976973 0.0011457984 50 + 6968 9659.6425 5.143125 0.0011457984 50 + 6970 9674.6794 5.2410296 0.0011457984 50 + 6972 9748.0172 4.3825217 0.0011457984 50 + 6974 9790.2541 3.6671921 0.0011457984 50 + 6976 9939.1812 3.9423 0.0011457984 50 + 6978 9932.8511 5.8172683 0.0011457984 50 + 6980 9884.9175 7.6922373 0.0011457984 50 + 6982 9895.2403 7.9709608 0.0011457984 50 + 6984 9762.5286 7.072368 0.0011457984 50 + 6986 9755.1631 5.5979588 0.0011457984 50 + 6988 9762.0504 4.9498373 0.0011457984 50 + 6990 9659.8034 5.3966357 0.0011457984 50 + 6992 9716.6387 5.2844339 0.0011457984 50 + 6994 9735.9467 4.2759314 0.0011457984 50 + 6996 9743.0525 2.7961936 0.0011457984 50 + 6998 9896.086 1.692222 0.0011457984 50 + 7000 9905.1475 2.2252591 0.0011457984 50 + 7002 9851.4447 3.4057239 0.0011457984 50 + 7004 9862.627 3.6016316 0.0011457984 50 + 7006 9759.465 2.6279267 0.0011457984 50 + 7008 9823.8161 0.71673442 0.0011457984 50 + 7010 9836.6571 -0.38918008 0.0011457984 50 + 7012 9742.651 -0.14535188 0.0011457984 50 + 7014 9750.9131 0.038451941 0.0011457984 50 + 7016 9720.239 -0.6333034 0.0011457984 50 + 7018 9752.3057 -2.3504903 0.0011457984 50 + 7020 9862.6501 -3.9143079 0.0011457984 50 + 7022 9836.8609 -3.6920412 0.0011457984 50 + 7024 9859.9236 -2.366967 0.0011457984 50 + 7026 9886.1452 -1.2972528 0.0011457984 50 + 7028 9759.0504 -1.1164197 0.0011457984 50 + 7030 9726.7701 -1.5244622 0.0011457984 50 + 7032 9705.1252 -0.74104909 0.0011457984 50 + 7034 9751.6131 1.5160451 0.0011457984 50 + 7036 9901.517 3.5859683 0.0011457984 50 + 7038 9920.4779 4.1768844 0.0011457984 50 + 7040 9781.1918 3.3255486 0.0011457984 50 + 7042 9672.4876 2.3834462 0.0011457984 50 + 7044 9549.8157 2.8398027 0.0011457984 50 + 7046 9523.3642 3.9150077 0.0011457984 50 + 7048 9563.0761 3.8366633 0.0011457984 50 + 7050 9517.2689 1.9767778 0.0011457984 50 + 7052 9466.1265 -0.60668872 0.0011457984 50 + 7054 9460.0101 -1.9274155 0.0011457984 50 + 7056 9478.2953 -1.2685099 0.0011457984 50 + 7058 9471.3773 -0.1073304 0.0011457984 50 + 7060 9492.9054 -0.4455594 0.0011457984 50 + 7062 9498.2241 -1.9624484 0.0011457984 50 + 7064 9551.7972 -2.5884117 0.0011457984 50 + 7066 9696.0907 -0.88024432 0.0011457984 50 + 7068 9764.5702 2.5222199 0.0011457984 50 + 7070 9740.9518 5.1339921 0.0011457984 50 + 7072 9737.3787 5.4068726 0.0011457984 50 + 7074 9630.342 4.8497948 0.0011457984 50 + 7076 9555.1194 5.3711742 0.0011457984 50 + 7078 9622.6202 7.177986 0.0011457984 50 + 7080 9578.9797 8.7394766 0.0011457984 50 + 7082 9589.5453 7.4358952 0.0011457984 50 + 7084 9672.4561 3.480566 0.0011457984 50 + 7086 9649.2968 -0.063116868 0.0011457984 50 + 7088 9645.6554 -1.3282696 0.0011457984 50 + 7090 9590.6878 -0.6524447 0.0011457984 50 + 7092 9435.5727 -0.15463847 0.0011457984 50 + 7094 9536.661 -1.8138538 0.0011457984 50 + 7096 9662.5782 -3.8494254 0.0011457984 50 + 7098 9698.9293 -3.5611364 0.0011457984 50 + 7100 9824.9231 -0.68219554 0.0011457984 50 + 7102 9784.4341 3.2622803 0.0011457984 50 + 7104 9641.4705 5.2965189 0.0011457984 50 + 7106 9683.4242 4.2100647 0.0011457984 50 + 7108 9635.9176 2.7227711 0.0011457984 50 + 7110 9657.8311 2.7728803 0.0011457984 50 + 7112 9740.3662 4.0686243 0.0011457984 50 + 7114 9610.9517 4.7455425 0.0011457984 50 + 7116 9527.4004 2.6998747 0.0011457984 50 + 7118 9488.9733 -0.60609595 0.0011457984 50 + 7120 9392.2499 -2.0143086 0.0011457984 50 + 7122 9383.3778 -0.65989418 0.0011457984 50 + 7124 9391.6481 2.0243673 0.0011457984 50 + 7126 9301.0051 3.8002685 0.0011457984 50 + 7128 9283.5382 3.7322338 0.0011457984 50 + 7130 9259.5284 3.6918727 0.0011457984 50 + 7132 9290.232 5.4416545 0.0011457984 50 + 7134 9307.6079 8.7353407 0.0011457984 50 + 7136 9320.6695 11.21586 0.0011457984 50 + 7138 9277.4608 11.165481 0.0011457984 50 + 7140 9254.2507 9.1967545 0.0011457984 50 + 7142 9298.9163 7.5227226 0.0011457984 50 + 7144 9279.7586 7.6700277 0.0011457984 50 + 7146 9216.6621 8.5381081 0.0011457984 50 + 7148 9213.4492 7.9484644 0.0011457984 50 + 7150 9221.8823 5.687558 0.0011457984 50 + 7152 9299.416 3.3114392 0.0011457984 50 + 7154 9431.6379 2.7331472 0.0011457984 50 + 7156 9418.2556 4.4086777 0.0011457984 50 + 7158 9467.3486 6.1375197 0.0011457984 50 + 7160 9497.8155 6.5764777 0.0011457984 50 + 7162 9439.7388 6.2689593 0.0011457984 50 + 7164 9445.8327 6.4266445 0.0011457984 50 + 7166 9332.322 8.4143992 0.0011457984 50 + 7168 9208.61 11.190738 0.0011457984 50 + 7170 9310.3149 12.420728 0.0011457984 50 + 7172 9351.2523 11.901528 0.0011457984 50 + 7174 9405.8964 10.335017 0.0011457984 50 + 7176 9542.4233 9.0515937 0.0011457984 50 + 7178 9474.2086 9.1449707 0.0011457984 50 + 7180 9485.7437 8.9387276 0.0011457984 50 + 7182 9550.4526 7.2951759 0.0011457984 50 + 7184 9420.8638 4.9885282 0.0011457984 50 + 7186 9440.5158 2.7685394 0.0011457984 50 + 7188 9461.3134 2.172931 0.0011457984 50 + 7190 9386.5315 3.1073231 0.0011457984 50 + 7192 9490.8781 3.7126116 0.0011457984 50 + 7194 9508.4209 3.8076901 0.0011457984 50 + 7196 9510.5281 3.4926701 0.0011457984 50 + 7198 9660.8341 3.2696957 0.0011457984 50 + 7200 9601.535 4.19073 0.0011457984 50 + 7202 9474.8425 5.2454886 0.0011457984 50 + 7204 9327.4634 5.5992572 0.0011457984 50 + 7206 9149.472 5.1619656 0.0011457984 50 + 7208 9192.9823 3.8581082 0.0011457984 50 + 7210 9255.2434 2.9255786 0.0011457984 50 + 7212 9227.6962 2.8923463 0.0011457984 50 + 7214 9255.8081 3.1432165 0.0011457984 50 + 7216 9192.628 3.4461202 0.0011457984 50 + 7218 9183.761 3.0555117 0.0011457984 50 + 7220 9247.867 2.1542773 0.0011457984 50 + 7222 9159.1068 1.8716263 0.0011457984 50 + 7224 9131.2203 2.2986379 0.0011457984 50 + 7226 9138.3216 3.4431762 0.0011457984 50 + 7228 9204.0436 4.3584618 0.0011457984 50 + 7230 9345.4984 3.962756 0.0011457984 50 + 7232 9315.6285 2.9387608 0.0011457984 50 + 7234 9192.7706 2.2882283 0.0011457984 50 + 7236 9152.6147 2.6605417 0.0011457984 50 + 7238 9097.0063 3.8442839 0.0011457984 50 + 7240 9208.8249 3.9743241 0.0011457984 50 + 7242 9369.5115 2.5468362 0.0011457984 50 + 7244 9395.1587 0.88524305 0.0011457984 50 + 7246 9395.8607 0.35110541 0.0011457984 50 + 7248 9306.3464 1.7019311 0.0011457984 50 + 7250 9141.1472 3.7093716 0.0011457984 50 + 7252 9150.9055 4.1170519 0.0011457984 50 + 7254 9225.0194 2.9947207 0.0011457984 50 + 7256 9301.5287 2.1560628 0.0011457984 50 + 7258 9420.2229 3.1245648 0.0011457984 50 + 7260 9426.5146 5.6813569 0.0011457984 50 + 7262 9314.5724 7.4774615 0.0011457984 50 + 7264 9320.0147 6.6025106 0.0011457984 50 + 7266 9307.2822 4.47175 0.0011457984 50 + 7268 9301.3998 3.5107791 0.0011457984 50 + 7270 9299.5661 4.7564319 0.0011457984 50 + 7272 9270.5218 6.7098349 0.0011457984 50 + 7274 9286.529 6.7969039 0.0011457984 50 + 7276 9410.861 4.4584762 0.0011457984 50 + 7278 9489.27 2.0011075 0.0011457984 50 + 7280 9502.3333 1.684916 0.0011457984 50 + 7282 9474.0127 3.3735745 0.0011457984 50 + 7284 9403.8255 4.638689 0.0011457984 50 + 7286 9451.1342 3.1353356 0.0011457984 50 + 7288 9480.7679 0.0066918041 0.0011457984 50 + 7290 9463.4491 -1.6395987 0.0011457984 50 + 7292 9419.4177 -0.14904997 0.0011457984 50 + 7294 9414.538 2.7399776 0.0011457984 50 + 7296 9374.7493 3.9802283 0.0011457984 50 + 7298 9364.8023 2.4941183 0.0011457984 50 + 7300 9294.6429 0.71789311 0.0011457984 50 + 7302 9298.9619 1.2068361 0.0011457984 50 + 7304 9368.068 4.0095033 0.0011457984 50 + 7306 9417.2777 6.464639 0.0011457984 50 + 7308 9408.8339 6.0709905 0.0011457984 50 + 7310 9322.6281 3.5474429 0.0011457984 50 + 7312 9281.8769 1.7436637 0.0011457984 50 + 7314 9342.533 2.3990706 0.0011457984 50 + 7316 9350.4835 4.3914393 0.0011457984 50 + 7318 9316.4467 4.6659937 0.0011457984 50 + 7320 9292.7393 2.2441799 0.0011457984 50 + 7322 9216.9193 -0.47391034 0.0011457984 50 + 7324 9315.4332 -1.1163484 0.0011457984 50 + 7326 9398.8563 0.96915884 0.0011457984 50 + 7328 9359.4189 3.434131 0.0011457984 50 + 7330 9395.2118 3.4898625 0.0011457984 50 + 7332 9387.826 1.9443663 0.0011457984 50 + 7334 9410.6837 1.2459609 0.0011457984 50 + 7336 9519.947 2.8322466 0.0011457984 50 + 7338 9484.9172 5.862886 0.0011457984 50 + 7340 9438.6075 7.2800714 0.0011457984 50 + 7342 9490.2695 5.9500588 0.0011457984 50 + 7344 9449.4263 4.0293974 0.0011457984 50 + 7346 9507.654 3.4314554 0.0011457984 50 + 7348 9496.6221 4.8283128 0.0011457984 50 + 7350 9392.7485 6.3025924 0.0011457984 50 + 7352 9441.276 5.3974276 0.0011457984 50 + 7354 9454.6318 2.9690653 0.0011457984 50 + 7356 9443.7475 1.3178664 0.0011457984 50 + 7358 9525.6456 1.7279697 0.0011457984 50 + 7360 9504.7476 3.5492429 0.0011457984 50 + 7362 9492.9302 4.143493 0.0011457984 50 + 7364 9550.7726 2.5616525 0.0011457984 50 + 7366 9526.2485 0.67866327 0.0011457984 50 + 7368 9591.2953 0.18365962 0.0011457984 50 + 7370 9664.2119 1.579754 0.0011457984 50 + 7372 9611.3609 3.4869243 0.0011457984 50 + 7374 9610.5069 3.8985181 0.0011457984 50 + 7376 9561.1861 3.3114327 0.0011457984 50 + 7378 9532.4005 3.1389618 0.0011457984 50 + 7380 9651.5365 3.9428553 0.0011457984 50 + 7382 9676.2487 5.3749563 0.0011457984 50 + 7384 9589.5116 5.8921794 0.0011457984 50 + 7386 9557.6205 4.8741386 0.0011457984 50 + 7388 9511.8686 3.7537842 0.0011457984 50 + 7390 9548.7795 3.5544484 0.0011457984 50 + 7392 9653.8805 4.2198724 0.0011457984 50 + 7394 9632.8838 5.002441 0.0011457984 50 + 7396 9719.2027 4.6499711 0.0011457984 50 + 7398 9831.2644 3.6627656 0.0011457984 50 + 7400 9883.4385 3.0827174 0.0011457984 50 + 7402 9881.9691 3.0999039 0.0011457984 50 + 7404 9749.996 3.3574858 0.0011457984 50 + 7406 9582.7862 2.9633399 0.0011457984 50 + 7408 9635.2751 1.4413803 0.0011457984 50 + 7410 9715.5639 -0.075919588 0.0011457984 50 + 7412 9757.9215 -0.83885311 0.0011457984 50 + 7414 9769.002 -0.87797105 0.0011457984 50 + 7416 9599.278 -0.33909427 0.0011457984 50 + 7418 9441.7848 0.17134883 0.0011457984 50 + 7420 9426.1066 0.68125899 0.0011457984 50 + 7422 9437.1351 1.7674849 0.0011457984 50 + 7424 9500.6425 3.2878942 0.0011457984 50 + 7426 9535.3806 4.8936619 0.0011457984 50 + 7428 9486.3862 6.1923477 0.0011457984 50 + 7430 9417.2089 6.8698959 0.0011457984 50 + 7432 9384.6502 6.9749972 0.0011457984 50 + 7434 9322.1322 6.8304123 0.0011457984 50 + 7436 9406.35 6.1073481 0.0011457984 50 + 7438 9525.9922 4.9898311 0.0011457984 50 + 7440 9559.5792 3.8870015 0.0011457984 50 + 7442 9623.884 2.7643718 0.0011457984 50 + 7444 9616.4375 1.8529093 0.0011457984 50 + 7446 9582.8656 0.9840396 0.0011457984 50 + 7448 9617.097 -0.024633469 0.0011457984 50 + 7450 9573.3835 -0.44123727 0.0011457984 50 + 7452 9476.2635 0.11013702 0.0011457984 50 + 7454 9473.8768 1.2820056 0.0011457984 50 + 7456 9459.0484 2.71048 0.0011457984 50 + 7458 9532.4938 3.5106692 0.0011457984 50 + 7460 9624.925 3.697208 0.0011457984 50 + 7462 9564.9509 4.2072021 0.0011457984 50 + 7464 9553.3086 5.0527198 0.0011457984 50 + 7466 9551.3619 5.8525434 0.0011457984 50 + 7468 9513.6267 5.6650826 0.0011457984 50 + 7470 9507.7846 3.8869282 0.0011457984 50 + 7472 9398.0642 1.8918919 0.0011457984 50 + 7474 9341.8749 0.97413899 0.0011457984 50 + 7476 9376.9782 1.4510035 0.0011457984 50 + 7478 9392.1499 2.3484419 0.0011457984 50 + 7480 9451.8765 2.1914005 0.0011457984 50 + 7482 9511.2196 1.2607779 0.0011457984 50 + 7484 9563.6374 0.88635346 0.0011457984 50 + 7486 9620.0349 1.7459739 0.0011457984 50 + 7488 9604.3505 3.2525131 0.0011457984 50 + 7490 9590.9346 3.7425664 0.0011457984 50 + 7492 9522.3988 2.8032866 0.0011457984 50 + 7494 9494.9559 1.4256268 0.0011457984 50 + 7496 9573.1982 1.0053352 0.0011457984 50 + 7498 9601.5697 1.9606036 0.0011457984 50 + 7500 9582.0828 2.6275963 0.0011457984 50 + 7502 9614.3819 1.5728655 0.0011457984 50 + 7504 9536.3627 -0.081088967 0.0011457984 50 + 7506 9585.9946 -0.92030032 0.0011457984 50 + 7508 9587.2868 0.28323303 0.0011457984 50 + 7510 9528.9131 2.5152283 0.0011457984 50 + 7512 9643.5854 3.4660557 0.0011457984 50 + 7514 9689.8607 3.2065806 0.0011457984 50 + 7516 9721.3389 2.9803491 0.0011457984 50 + 7518 9777.5554 4.1047011 0.0011457984 50 + 7520 9620.0088 6.8774095 0.0011457984 50 + 7522 9502.8216 8.9090657 0.0011457984 50 + 7524 9536.3096 8.5715993 0.0011457984 50 + 7526 9430.0745 7.0672411 0.0011457984 50 + 7528 9450.4065 5.7492142 0.0011457984 50 + 7530 9454.0207 5.7231316 0.0011457984 50 + 7532 9419.0919 5.8071811 0.0011457984 50 + 7534 9539.5751 3.8208512 0.0011457984 50 + 7536 9545.0205 0.35397896 0.0011457984 50 + 7538 9472.4819 -2.7954424 0.0011457984 50 + 7540 9417.4001 -3.9611563 0.0011457984 50 + 7542 9262.3557 -2.8579227 0.0011457984 50 + 7544 9297.3341 -1.755726 0.0011457984 50 + 7546 9427.1736 -1.6469164 0.0011457984 50 + 7548 9430.5916 -1.5166592 0.0011457984 50 + 7550 9478.5136 -0.34981721 0.0011457984 50 + 7552 9473.1761 2.6548766 0.0011457984 50 + 7554 9341.2932 6.2584298 0.0011457984 50 + 7556 9410.2365 7.8239294 0.0011457984 50 + 7558 9381.6052 7.5311417 0.0011457984 50 + 7560 9437.1569 6.3664849 0.0011457984 50 + 7562 9542.198 5.6669502 0.0011457984 50 + 7564 9477.5663 5.7225117 0.0011457984 50 + 7566 9485.1494 4.6941954 0.0011457984 50 + 7568 9535.1098 2.2509721 0.0011457984 50 + 7570 9507.2274 -0.32454484 0.0011457984 50 + 7572 9636.0736 -2.3180481 0.0011457984 50 + 7574 9658.1354 -2.7226114 0.0011457984 50 + 7576 9495.6354 -1.930176 0.0011457984 50 + 7578 9587.4497 -1.6178495 0.0011457984 50 + 7580 9622.3903 -1.3399174 0.0011457984 50 + 7582 9704.3184 -0.92434441 0.0011457984 50 + 7584 9926.6399 -0.15472678 0.0011457984 50 + 7586 9892.8863 1.6692809 0.0011457984 50 + 7588 9863.4979 3.1137697 0.0011457984 50 + 7590 9906.4139 3.4536603 0.0011457984 50 + 7592 9769.0965 3.4593296 0.0011457984 50 + 7594 9743.17 3.0424924 0.0011457984 50 + 7596 9719.9591 2.8191167 0.0011457984 50 + 7598 9558.0651 3.0322152 0.0011457984 50 + 7600 9645.6938 2.6112039 0.0011457984 50 + 7602 9714.0215 2.185614 0.0011457984 50 + 7604 9605.7654 2.3876785 0.0011457984 50 + 7606 9693.6003 2.6081601 0.0011457984 50 + 7608 9629.2089 3.4337647 0.0011457984 50 + 7610 9551.3938 4.3618115 0.0011457984 50 + 7612 9601.7189 5.042988 0.0011457984 50 + 7614 9530.2921 6.231394 0.0011457984 50 + 7616 9423.4273 7.5166546 0.0011457984 50 + 7618 9505.4428 8.0291626 0.0011457984 50 + 7620 9429.315 8.1655715 0.0011457984 50 + 7622 9410.5734 7.5124718 0.0011457984 50 + 7624 9483.015 6.434736 0.0011457984 50 + 7626 9417.367 5.8180565 0.0011457984 50 + 7628 9504.2707 4.8808406 0.0011457984 50 + 7630 9708.7689 3.1972208 0.0011457984 50 + 7632 9705.0142 1.4578035 0.0011457984 50 + 7634 9712.5013 0.041948151 0.0011457984 50 + 7636 9729.5345 -0.061359152 0.0011457984 50 + 7638 9603.3866 1.3424057 0.0011457984 50 + 7640 9659.7375 2.5412485 0.0011457984 50 + 7642 9653.7578 3.3597609 0.0011457984 50 + 7644 9526.3277 4.5019132 0.0011457984 50 + 7646 9522.1426 6.4723916 0.0011457984 50 + 7648 9551.1617 9.4539084 0.0011457984 50 + 7650 9448.6486 12.17887 0.0011457984 50 + 7652 9441.6445 12.73528 0.0011457984 50 + 7654 9372.3016 11.623139 0.0011457984 50 + 7656 9353.7281 10.159189 0.0011457984 50 + 7658 9533.6437 9.1148105 0.0011457984 50 + 7660 9720.4729 8.2979611 0.0011457984 50 + 7662 9687.7535 6.5903069 0.0011457984 50 + 7664 9679.7651 3.1582718 0.0011457984 50 + 7666 9506.8095 -0.16657303 0.0011457984 50 + 7668 9432.2748 -1.9647403 0.0011457984 50 + 7670 9562.3452 -2.0511502 0.0011457984 50 + 7672 9603.1776 -1.1215214 0.0011457984 50 + 7674 9614.5799 -0.73355736 0.0011457984 50 + 7676 9717.1466 -0.97171895 0.0011457984 50 + 7678 9660.4746 -0.065105035 0.0011457984 50 + 7680 9652.4727 2.1105705 0.0011457984 50 + 7682 9632.6572 4.7124033 0.0011457984 50 + 7684 9459.4445 6.5506091 0.0011457984 50 + 7686 9459.2384 6.5399378 0.0011457984 50 + 7688 9527.0273 5.8950819 0.0011457984 50 + 7690 9552.6913 5.8727872 0.0011457984 50 + 7692 9594.6979 6.1402731 0.0011457984 50 + 7694 9507.6571 6.0382366 0.0011457984 50 + 7696 9435.6211 4.6987185 0.0011457984 50 + 7698 9593.5298 2.4864572 0.0011457984 50 + 7700 9649.3417 1.3774067 0.0011457984 50 + 7702 9733.9587 1.3621968 0.0011457984 50 + 7704 9748.2134 1.6826187 0.0011457984 50 + 7706 9607.2673 1.730675 0.0011457984 50 + 7708 9570.3284 1.056172 0.0011457984 50 + 7710 9623.4646 0.68062243 0.0011457984 50 + 7712 9584.1504 1.5492829 0.0011457984 50 + 7714 9727.4828 2.3647176 0.0011457984 50 + 7716 9768.0882 2.5188312 0.0011457984 50 + 7718 9675.8436 1.915033 0.0011457984 50 + 7720 9742.4159 0.98004134 0.0011457984 50 + 7722 9729.339 1.348188 0.0011457984 50 + 7724 9737.0089 2.3572792 0.0011457984 50 + 7726 9867.0438 2.3334077 0.0011457984 50 + 7728 9685.1497 1.779699 0.0011457984 50 + 7730 9541.5463 1.0959201 0.0011457984 50 + 7732 9601.3202 1.360164 0.0011457984 50 + 7734 9511.1979 3.3763173 0.0011457984 50 + 7736 9691.0676 4.6273168 0.0011457984 50 + 7738 9841.6024 4.2729278 0.0011457984 50 + 7740 9648.3216 3.3438312 0.0011457984 50 + 7742 9644.2115 2.2183629 0.0011457984 50 + 7744 9588.828 2.5300306 0.0011457984 50 + 7746 9341.8422 3.7987816 0.0011457984 50 + 7748 9547.0139 3.0814107 0.0011457984 50 + 7750 9527.4193 1.3593932 0.0011457984 50 + 7752 9489.3054 -0.4087885 0.0011457984 50 + 7754 9740.3405 -1.2673367 0.0011457984 50 + 7756 9721.0147 0.00428777 0.0011457984 50 + 7758 9702.5241 0.82419258 0.0011457984 50 + 7760 9859.071 -0.6228219 0.0011457984 50 + 7762 9650.9663 -2.3957203 0.0011457984 50 + 7764 9706.9729 -3.6785526 0.0011457984 50 + 7766 9818.8903 -2.8392329 0.0011457984 50 + 7768 9663.4435 -0.34323863 0.0011457984 50 + 7770 9803.2456 0.38943494 0.0011457984 50 + 7772 9820.2274 -0.39394936 0.0011457984 50 + 7774 9713.4768 -1.0733572 0.0011457984 50 + 7776 9852.736 -0.42363135 0.0011457984 50 + 7778 9886.2509 2.3769023 0.0011457984 50 + 7780 9832.7358 4.9166992 0.0011457984 50 + 7782 9932.8973 4.712252 0.0011457984 50 + 7784 9796.5384 3.1448764 0.0011457984 50 + 7786 9753.7015 1.9309203 0.0011457984 50 + 7788 9839.8416 2.3899169 0.0011457984 50 + 7790 9872.1501 3.7655463 0.0011457984 50 + 7792 9953.7516 3.4859888 0.0011457984 50 + 7794 10034.369 1.1698958 0.0011457984 50 + 7796 9944.3003 -0.92549906 0.0011457984 50 + 7798 9965.518 -1.1278296 0.0011457984 50 + 7800 10012.5 0.80938361 0.0011457984 50 + 7802 10034.925 2.8840295 0.0011457984 50 + 7804 10097.202 3.1108041 0.0011457984 50 + 7806 10109.566 2.2692514 0.0011457984 50 + 7808 10070.186 2.6683711 0.0011457984 50 + 7810 10086.066 5.1330175 0.0011457984 50 + 7812 10101.889 8.1779122 0.0011457984 50 + 7814 9955.2551 9.6584018 0.0011457984 50 + 7816 9924.9784 8.6108988 0.0011457984 50 + 7818 9892.9233 7.3026856 0.0011457984 50 + 7820 9940.0085 7.6562588 0.0011457984 50 + 7822 10043.889 9.2169653 0.0011457984 50 + 7824 10040.433 10.071061 0.0011457984 50 + 7826 9888.6625 8.8793367 0.0011457984 50 + 7828 9843.2339 6.2958302 0.0011457984 50 + 7830 9769.9935 4.9813275 0.0011457984 50 + 7832 9817.1369 5.5036474 0.0011457984 50 + 7834 9908.1863 6.5022137 0.0011457984 50 + 7836 9836.952 6.5533027 0.0011457984 50 + 7838 9823.5066 5.1861522 0.0011457984 50 + 7840 9842.244 4.290555 0.0011457984 50 + 7842 9807.8307 5.4702915 0.0011457984 50 + 7844 9866.4119 7.5011118 0.0011457984 50 + 7846 9948.1838 8.4741237 0.0011457984 50 + 7848 9929.854 7.7316361 0.0011457984 50 + 7850 10067.409 5.8569645 0.0011457984 50 + 7852 10032.145 5.2165212 0.0011457984 50 + 7854 9899.4962 6.0924898 0.0011457984 50 + 7856 9921.7169 6.719158 0.0011457984 50 + 7858 9916.003 6.389409 0.0011457984 50 + 7860 9870.0171 5.3824146 0.0011457984 50 + 7862 9982.1614 4.6911758 0.0011457984 50 + 7864 9885.8857 5.9014244 0.0011457984 50 + 7866 9833.4896 7.7602131 0.0011457984 50 + 7868 9945.8481 8.582649 0.0011457984 50 + 7870 9940.9251 8.4512902 0.0011457984 50 + 7872 9955.2114 7.7609086 0.0011457984 50 + 7874 9947.7609 7.5875024 0.0011457984 50 + 7876 9824.999 8.1626806 0.0011457984 50 + 7878 9821.2327 8.0188501 0.0011457984 50 + 7880 9842.1396 6.8799344 0.0011457984 50 + 7882 9763.4974 5.6291783 0.0011457984 50 + 7884 9830.8014 4.8298768 0.0011457984 50 + 7886 9864.651 5.1057619 0.0011457984 50 + 7888 9897.6271 5.4523732 0.0011457984 50 + 7890 9969.4632 4.8645946 0.0011457984 50 + 7892 9905.2637 4.0683578 0.0011457984 50 + 7894 9867.218 3.7625675 0.0011457984 50 + 7896 9964.8143 4.1222515 0.0011457984 50 + 7898 9970.8383 4.8135178 0.0011457984 50 + 7900 9960.2843 4.6528207 0.0011457984 50 + 7902 9929.1614 4.0045485 0.0011457984 50 + 7904 9732.7455 4.4197682 0.0011457984 50 + 7906 9784.6307 5.46138 0.0011457984 50 + 7908 9902.0578 6.4536086 0.0011457984 50 + 7910 9835.8696 6.5806316 0.0011457984 50 + 7912 9816.4882 5.2605278 0.0011457984 50 + 7914 9678.3646 4.2597874 0.0011457984 50 + 7916 9495.2316 4.5265141 0.0011457984 50 + 7918 9625.0995 4.6607196 0.0011457984 50 + 7920 9667.4185 3.9419695 0.0011457984 50 + 7922 9602.5767 1.8452379 0.0011457984 50 + 7924 9714.4671 -0.78549348 0.0011457984 50 + 7926 9600.4719 -1.3021957 0.0011457984 50 + 7928 9595.5944 -0.40978783 0.0011457984 50 + 7930 9671.4849 0.18383962 0.0011457984 50 + 7932 9427.9403 0.13097094 0.0011457984 50 + 7934 9336.0891 -0.75045689 0.0011457984 50 + 7936 9377.7418 -0.37773788 0.0011457984 50 + 7938 9313.8567 2.3838933 0.0011457984 50 + 7940 9563.9378 4.7263846 0.0011457984 50 + 7942 9725.0125 5.1314861 0.0011457984 50 + 7944 9526.2488 3.8387064 0.0011457984 50 + 7946 9567.6993 1.6692464 0.0011457984 50 + 7948 9454.276 1.4617733 0.0011457984 50 + 7950 9353.5637 2.4804377 0.0011457984 50 + 7952 9601.2572 1.7746058 0.0011457984 50 + 7954 9621.3707 -0.54877445 0.0011457984 50 + 7956 9545.5258 -3.3532832 0.0011457984 50 + 7958 9635.7985 -4.5615531 0.0011457984 50 + 7960 9426.8802 -2.4111311 0.0011457984 50 + 7962 9415.5196 0.10777037 0.0011457984 50 + 7964 9525.2541 0.98550692 0.0011457984 50 + 7966 9409.782 1.0022769 0.0011457984 50 + 7968 9501.2728 1.0925635 0.0011457984 50 + 7970 9566.9142 2.9916085 0.0011457984 50 + 7972 9434.188 5.8343619 0.0011457984 50 + 7974 9543.452 6.3023867 0.0011457984 50 + 7976 9515.7435 4.393159 0.0011457984 50 + 7978 9397.8265 1.67238 0.0011457984 50 + 7980 9518.8853 -0.26214002 0.0011457984 50 + 7982 9464.9738 -0.20322159 0.0011457984 50 + 7984 9411.3658 -0.34294737 0.0011457984 50 + 7986 9480.5763 -2.2898799 0.0011457984 50 + 7988 9346.0022 -4.3015335 0.0011457984 50 + 7990 9323.7758 -4.7818874 0.0011457984 50 + 7992 9447.4591 -2.8155787 0.0011457984 50 + 7994 9370.0301 0.86042184 0.0011457984 50 + 7996 9414.3206 3.209964 0.0011457984 50 + 7998 9443.2413 3.7897264 0.0011457984 50 + 8000 9337.5805 4.2404387 0.0011457984 50 +Loop time of 107.636 on 8 procs for 8000 steps with 848 atoms + +Performance: 6.422 ns/day, 3.737 hours/ns, 74.325 timesteps/s +93.6% CPU use with 8 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0071581 | 0.99286 | 4.3913 | 151.9 | 0.92 +Bond | 0.023263 | 2.2103 | 10.081 | 229.9 | 2.05 +Kspace | 28.814 | 39.764 | 42.853 | 76.0 | 36.94 +Neigh | 6.4084 | 6.4395 | 6.4689 | 1.0 | 5.98 +Comm | 0.19227 | 0.25072 | 0.36267 | 12.4 | 0.23 +Output | 56.437 | 56.509 | 56.849 | 1.7 | 52.50 +Modify | 0.78657 | 1.4521 | 1.6493 | 23.1 | 1.35 +Other | | 0.0172 | | | 0.02 + +Nlocal: 106.000 ave 407 max 0 min +Histogram: 5 0 0 0 1 0 1 0 0 1 +Nghost: 71.1250 ave 338 max 0 min +Histogram: 5 0 1 0 1 0 0 0 0 1 +Neighs: 7377.88 ave 29891 max 0 min +Histogram: 5 0 0 0 1 1 0 0 0 1 + +Total # of neighbors = 59023 +Ave neighs/atom = 69.602594 +Ave special neighs/atom = 11.443396 +Neighbor list builds = 8000 +Dangerous builds = 0 +System init for write_data ... +PPPM initialization ... + using 12-bit tables for long-range coulomb (../kspace.cpp:328) + G vector (1/distance) = 0.20144813 + grid = 45 45 45 + stencil order = 5 + estimated absolute RMS force accuracy = 0.0022576485 + estimated relative force accuracy = 6.7988414e-06 + using double precision KISS FFT + 3d grid and FFT values/proc = 21952 12167 +System init for write_data ... +PPPM initialization ... + using 12-bit tables for long-range coulomb (../kspace.cpp:328) + G vector (1/distance) = 0.20144813 + grid = 45 45 45 + stencil order = 5 + estimated absolute RMS force accuracy = 0.0022576485 + estimated relative force accuracy = 6.7988414e-06 + using double precision KISS FFT + 3d grid and FFT values/proc = 21952 12167 + +Please see the log.cite file for references relevant to this simulation + +Total wall time: 0:01:48 diff --git a/examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_map_create_atoms b/examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_map_create_atoms new file mode 100644 index 0000000000..a90f1528bb --- /dev/null +++ b/examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_map_create_atoms @@ -0,0 +1,66 @@ +this is a map file + +1 edgeIDs +30 equivalences +16 createIDs + +EdgeIDs + +30 + +BondingIDs + +4 +13 + +CreateIDs + +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 + +Equivalences + +1 45 +2 46 +3 44 +4 43 +5 42 +6 41 +7 40 +8 39 +9 38 +10 37 +11 36 +12 35 +13 34 +14 33 +15 32 +16 31 +17 17 +18 18 +19 19 +20 20 +21 21 +22 22 +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 diff --git a/examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_reacted.data_template b/examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_reacted.data_template new file mode 100755 index 0000000000..83f04899b1 --- /dev/null +++ b/examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_reacted.data_template @@ -0,0 +1,456 @@ +LAMMPS data file. msi2lmp v3.9.8 / 06 Oct 2016 / CGCMM for chain_plus_styrene_reacted + +46 atoms +48 bonds +81 angles +121 dihedrals +35 impropers +1 fragments + +Fragments + +create_fit 34 44 + +Types + +1 1 +2 2 +3 1 +4 5 +5 1 +6 2 +7 1 +8 2 +9 1 +10 2 +11 1 +12 2 +13 2 +14 6 +15 2 +16 2 +17 1 +18 2 +19 1 +20 5 +21 1 +22 2 +23 1 +24 2 +25 1 +26 2 +27 1 +28 2 +29 2 +30 6 +31 1 +32 2 +33 1 +34 5 +35 1 +36 2 +37 1 +38 2 +39 1 +40 2 +41 1 +42 2 +43 2 +44 6 +45 2 +46 2 + +Charges + +1 -0.129000 +2 0.123700 +3 0.026600 +4 -0.018200 +5 -0.129000 +6 0.123700 +7 -0.173400 +8 0.140300 +9 -0.113400 +10 0.128800 +11 -0.173400 +12 0.140300 +13 0.051600 +14 -0.069600 +15 0.035400 +16 0.035400 +17 -0.129000 +18 0.123700 +19 0.026600 +20 -0.018200 +21 -0.129000 +22 0.123700 +23 -0.173400 +24 0.140300 +25 -0.113400 +26 0.128800 +27 -0.173400 +28 0.140300 +29 0.051600 +30 -0.069600 +31 -0.129000 +32 0.123700 +33 0.026600 +34 -0.018200 +35 -0.129000 +36 0.123700 +37 -0.173400 +38 0.140300 +39 -0.113400 +40 0.128800 +41 -0.173400 +42 0.140300 +43 0.051600 +44 -0.069600 +45 0.035400 +46 0.035400 + +Coords + +1 24.130699 1.043900 -1.309300 +2 25.062700 1.582900 -1.309300 +3 22.900700 1.753900 -1.309300 +4 22.900700 3.253900 -1.309300 +5 21.670700 1.043900 -1.309300 +6 20.738701 1.582900 -1.309300 +7 21.670700 -0.376100 -1.309300 +8 20.738701 -0.915100 -1.309300 +9 22.900700 -1.086100 -1.309300 +10 22.900700 -2.163100 -1.309300 +11 24.130699 -0.376100 -1.309300 +12 25.062700 -0.915100 -1.309300 +13 23.766701 3.658900 -0.952300 +14 21.622700 3.802900 -1.871300 +15 21.672701 4.544900 -1.970300 +16 20.979700 2.979900 -2.165300 +17 13.465800 0.682500 -1.658900 +18 14.397800 1.221500 -1.658900 +19 12.235800 1.392500 -1.658900 +20 12.235800 2.892500 -1.658900 +21 11.005800 0.682500 -1.658900 +22 10.073800 1.221500 -1.658900 +23 11.005800 -0.737500 -1.658900 +24 10.073800 -1.276500 -1.658900 +25 12.235800 -1.447500 -1.658900 +26 12.235800 -2.524500 -1.658900 +27 13.465800 -0.737500 -1.658900 +28 14.397800 -1.276500 -1.658900 +29 13.101800 3.297500 -1.301900 +30 10.957800 3.441500 -2.220900 +31 18.663500 0.855500 -1.372100 +32 19.595501 1.394500 -1.372100 +33 17.433500 1.565500 -1.372100 +34 17.433500 3.065500 -1.372100 +35 16.203501 0.855500 -1.372100 +36 15.271500 1.394500 -1.372100 +37 16.203501 -0.564500 -1.372100 +38 15.271500 -1.103500 -1.372100 +39 17.433500 -1.274500 -1.372100 +40 17.433500 -2.351500 -1.372100 +41 18.663500 -0.564500 -1.372100 +42 19.595501 -1.103500 -1.372100 +43 18.299500 3.470500 -1.015100 +44 16.155500 3.614500 -1.934100 +45 16.205500 4.356500 -2.033100 +46 15.512500 2.791500 -2.228100 + +Bonds + +1 1 1 2 +2 2 1 3 +3 2 1 11 +4 11 3 4 +5 2 3 5 +6 12 13 4 +7 13 4 14 +8 1 5 6 +9 2 5 7 +10 1 7 8 +11 2 7 9 +12 1 9 10 +13 2 9 11 +14 1 11 12 +15 10 15 14 +16 10 16 14 +17 9 14 34 +18 1 17 18 +19 2 17 19 +20 2 17 27 +21 7 19 20 +22 2 19 21 +23 8 29 20 +24 9 30 20 +25 9 44 20 +26 1 21 22 +27 2 21 23 +28 1 23 24 +29 2 23 25 +30 1 25 26 +31 2 25 27 +32 1 27 28 +33 1 31 32 +34 2 31 33 +35 2 31 41 +36 7 33 34 +37 2 33 35 +38 8 43 34 +39 9 44 34 +40 1 35 36 +41 2 35 37 +42 1 37 38 +43 2 37 39 +44 1 39 40 +45 2 39 41 +46 1 41 42 +47 10 45 44 +48 10 46 44 + +Angles + +1 1 3 1 2 +2 1 11 1 2 +3 2 3 1 11 +4 17 1 3 4 +5 2 1 3 5 +6 17 5 3 4 +7 18 3 4 13 +8 19 3 4 14 +9 20 13 4 14 +10 1 3 5 6 +11 2 3 5 7 +12 1 7 5 6 +13 1 5 7 8 +14 2 5 7 9 +15 1 9 7 8 +16 1 7 9 10 +17 2 7 9 11 +18 1 11 9 10 +19 2 1 11 9 +20 1 1 11 12 +21 1 9 11 12 +22 21 15 14 4 +23 21 16 14 4 +24 22 4 14 34 +25 15 15 14 16 +26 14 15 14 34 +27 14 16 14 34 +28 1 19 17 18 +29 1 27 17 18 +30 2 19 17 27 +31 9 17 19 20 +32 2 17 19 21 +33 9 21 19 20 +34 10 19 20 29 +35 11 19 20 30 +36 11 19 20 44 +37 12 29 20 30 +38 12 29 20 44 +39 13 30 20 44 +40 1 19 21 22 +41 2 19 21 23 +42 1 23 21 22 +43 1 21 23 24 +44 2 21 23 25 +45 1 25 23 24 +46 1 23 25 26 +47 2 23 25 27 +48 1 27 25 26 +49 2 17 27 25 +50 1 17 27 28 +51 1 25 27 28 +52 1 33 31 32 +53 1 41 31 32 +54 2 33 31 41 +55 9 31 33 34 +56 2 31 33 35 +57 9 35 33 34 +58 11 33 34 14 +59 12 43 34 14 +60 13 14 34 44 +61 10 33 34 43 +62 11 33 34 44 +63 12 43 34 44 +64 1 33 35 36 +65 2 33 35 37 +66 1 37 35 36 +67 1 35 37 38 +68 2 35 37 39 +69 1 39 37 38 +70 1 37 39 40 +71 2 37 39 41 +72 1 41 39 40 +73 2 31 41 39 +74 1 31 41 42 +75 1 39 41 42 +76 16 20 44 34 +77 14 45 44 20 +78 14 46 44 20 +79 14 45 44 34 +80 14 46 44 34 +81 15 45 44 46 + +Dihedrals + +1 20 2 1 3 4 +2 2 5 3 1 2 +3 21 11 1 3 4 +4 4 11 1 3 5 +5 2 9 11 1 2 +6 5 2 1 11 12 +7 4 3 1 11 9 +8 2 3 1 11 12 +9 22 1 3 4 13 +10 23 1 3 4 14 +11 22 5 3 4 13 +12 23 5 3 4 14 +13 2 1 3 5 6 +14 4 1 3 5 7 +15 20 6 5 3 4 +16 21 7 5 3 4 +17 24 3 4 14 15 +18 24 3 4 14 16 +19 25 3 4 14 34 +20 26 13 4 14 15 +21 26 13 4 14 16 +22 27 13 4 14 34 +23 2 3 5 7 8 +24 4 3 5 7 9 +25 5 6 5 7 8 +26 2 9 7 5 6 +27 2 5 7 9 10 +28 4 5 7 9 11 +29 5 8 7 9 10 +30 2 11 9 7 8 +31 4 7 9 11 1 +32 2 7 9 11 12 +33 2 1 11 9 10 +34 5 10 9 11 12 +35 28 4 14 34 33 +36 29 4 14 34 43 +37 30 4 14 34 44 +38 31 15 14 34 33 +39 32 15 14 34 43 +40 33 15 14 34 44 +41 31 16 14 34 33 +42 32 16 14 34 43 +43 33 16 14 34 44 +44 10 18 17 19 20 +45 2 21 19 17 18 +46 11 27 17 19 20 +47 4 27 17 19 21 +48 2 25 27 17 18 +49 5 18 17 27 28 +50 4 19 17 27 25 +51 2 19 17 27 28 +52 12 17 19 20 29 +53 13 17 19 20 30 +54 13 17 19 20 44 +55 12 21 19 20 29 +56 13 21 19 20 30 +57 13 21 19 20 44 +58 2 17 19 21 22 +59 4 17 19 21 23 +60 10 22 21 19 20 +61 11 23 21 19 20 +62 34 34 44 20 19 +63 31 45 44 20 19 +64 31 46 44 20 19 +65 35 34 44 20 29 +66 32 45 44 20 29 +67 32 46 44 20 29 +68 36 34 44 20 30 +69 33 45 44 20 30 +70 33 46 44 20 30 +71 2 19 21 23 24 +72 4 19 21 23 25 +73 5 22 21 23 24 +74 2 25 23 21 22 +75 2 21 23 25 26 +76 4 21 23 25 27 +77 5 24 23 25 26 +78 2 27 25 23 24 +79 4 23 25 27 17 +80 2 23 25 27 28 +81 2 17 27 25 26 +82 5 26 25 27 28 +83 10 32 31 33 34 +84 2 35 33 31 32 +85 11 41 31 33 34 +86 4 41 31 33 35 +87 2 39 41 31 32 +88 5 32 31 41 42 +89 4 33 31 41 39 +90 2 33 31 41 42 +91 13 31 33 34 14 +92 12 31 33 34 43 +93 13 31 33 34 44 +94 13 35 33 34 14 +95 12 35 33 34 43 +96 13 35 33 34 44 +97 2 31 33 35 36 +98 4 31 33 35 37 +99 10 36 35 33 34 +100 11 37 35 33 34 +101 36 20 44 34 14 +102 33 45 44 34 14 +103 33 46 44 34 14 +104 34 20 44 34 33 +105 31 45 44 34 33 +106 31 46 44 34 33 +107 35 20 44 34 43 +108 32 45 44 34 43 +109 32 46 44 34 43 +110 2 33 35 37 38 +111 4 33 35 37 39 +112 5 36 35 37 38 +113 2 39 37 35 36 +114 2 35 37 39 40 +115 4 35 37 39 41 +116 5 38 37 39 40 +117 2 41 39 37 38 +118 4 37 39 41 31 +119 2 37 39 41 42 +120 2 31 41 39 40 +121 5 40 39 41 42 + +Impropers + +1 1 3 1 11 2 +2 8 1 3 5 4 +3 9 3 4 13 14 +4 1 3 5 7 6 +5 1 5 7 9 8 +6 1 7 9 11 10 +7 1 1 11 9 12 +8 1 19 17 27 18 +9 5 17 19 21 20 +10 1 19 21 23 22 +11 1 21 23 25 24 +12 1 23 25 27 26 +13 1 17 27 25 28 +14 1 33 31 41 32 +15 5 31 33 35 34 +16 1 33 35 37 36 +17 1 35 37 39 38 +18 1 37 39 41 40 +19 1 31 41 39 42 +20 1 15 14 16 4 +21 1 15 14 4 34 +22 1 16 14 4 34 +23 1 15 14 16 34 +24 1 19 20 29 30 +25 1 19 20 29 44 +26 1 19 20 30 44 +27 1 29 20 30 44 +28 1 33 34 43 14 +29 1 33 34 14 44 +30 1 43 34 14 44 +31 1 33 34 43 44 +32 1 45 44 34 20 +33 1 46 44 34 20 +34 1 45 44 46 20 +35 1 45 44 46 34 diff --git a/examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_unreacted_create_atoms.data_template b/examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_unreacted_create_atoms.data_template new file mode 100644 index 0000000000..f85b928f1e --- /dev/null +++ b/examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_unreacted_create_atoms.data_template @@ -0,0 +1,294 @@ +LAMMPS data file via write_data, version 18 Sep 2020, timestep = 0 + +30 atoms +31 bonds +51 angles +73 dihedrals +21 impropers + +Types + +1 2 +2 2 +3 6 +4 2 +5 2 +6 1 +7 2 +8 1 +9 2 +10 1 +11 2 +12 1 +13 5 +14 1 +15 2 +16 1 +17 1 +18 2 +19 1 +20 5 +21 1 +22 2 +23 1 +24 2 +25 1 +26 2 +27 1 +28 2 +29 2 +30 6 + +Coords + +1 59.89981112372972 62.733697275315585 59.09884284578856 +2 61.41970248324232 63.42116581894993 59.52874545893742 +3 60.864754970096406 62.91724243011892 59.559720865992695 +4 62.139819000186826 61.41011937002877 60.81065044071466 +5 60.036455711425084 57.160029629288026 60.31958663310848 +6 59.734195751174056 58.18706337912225 60.20562410798949 +7 57.64574781117771 57.712432799329 59.860109977091554 +8 58.37408644866664 58.50134169314242 59.94422053768215 +9 56.94300092269842 60.093170109004795 59.5955638127831 +10 57.974275786582744 59.85577775892068 59.793714995577716 +11 58.63231375134033 61.922969938852454 59.79065033121885 +12 58.934573711591355 60.89593618901822 59.904612856337835 +13 61.30908151524225 61.68041745837013 60.28316188676589 +14 60.29468229868386 60.58165855333751 60.16601625920239 +15 61.725768540066994 58.98982945913568 60.51467315154424 +16 60.69449367618267 59.2272218092198 60.31652196874961 +17 56.90935800040509 62.609851248143706 59.150831390216375 +18 57.940632148874506 62.37245957639904 59.3489824055682 +19 56.509546622906285 63.96428799226142 59.00032568066915 +20 57.52394583946467 65.06304689729403 59.11747130823266 +21 55.14943732039887 64.27856630628159 58.738922110361806 +22 54.84717807556275 65.30559937777636 58.62495975268562 +23 54.18913939539026 63.23840787618404 58.62802424960169 +24 53.15786524692084 63.4757995479287 58.42987323424986 +25 54.58895077288906 61.88397113206633 58.77852995914891 +26 53.86061213540014 61.09506223825291 58.69441939855832 +27 55.94906007539648 61.56969281804616 59.039933529456256 +28 56.2513193202326 60.54265974655139 59.15389588713244 +29 58.35468332440925 64.79274880895268 59.64495986218142 +30 57.07961929431883 66.29987186904283 58.394030287459465 + +Charges + +1 0.0354 +2 0.0354 +3 -0.0696 +4 0.0516 +5 0.1403 +6 -0.1734 +7 0.1288 +8 -0.1134 +9 0.1403 +10 -0.1734 +11 0.1237 +12 -0.129 +13 -0.0182 +14 0.0266 +15 0.1237 +16 -0.129 +17 -0.129 +18 0.1237 +19 0.0266 +20 -0.0182 +21 -0.129 +22 0.1237 +23 -0.1734 +24 0.1403 +25 -0.1134 +26 0.1288 +27 -0.1734 +28 0.1403 +29 0.0516 +30 -0.0696 + +Bonds + +1 10 1 3 +2 10 2 3 +3 8 4 13 +4 1 6 5 +5 1 8 7 +6 2 8 6 +7 1 10 9 +8 2 10 8 +9 1 12 11 +10 2 12 10 +11 9 13 3 +12 7 14 13 +13 2 14 12 +14 1 16 15 +15 2 16 14 +16 2 16 6 +17 1 17 18 +18 2 17 19 +19 2 17 27 +20 7 19 20 +21 2 19 21 +22 9 20 30 +23 9 20 3 +24 1 21 22 +25 2 21 23 +26 1 23 24 +27 2 23 25 +28 1 25 26 +29 2 25 27 +30 1 27 28 +31 8 29 20 + +Angles + +1 16 20 3 13 +2 14 2 3 20 +3 14 1 3 20 +4 14 2 3 13 +5 14 1 3 13 +6 15 2 3 1 +7 2 16 6 8 +8 1 16 6 5 +9 1 8 6 5 +10 1 10 8 7 +11 2 10 8 6 +12 1 6 8 7 +13 1 12 10 9 +14 2 12 10 8 +15 1 8 10 9 +16 1 14 12 11 +17 2 14 12 10 +18 1 10 12 11 +19 10 14 13 4 +20 11 14 13 3 +21 12 4 13 3 +22 9 16 14 13 +23 2 16 14 12 +24 9 12 14 13 +25 1 14 16 15 +26 1 6 16 15 +27 2 14 16 6 +28 1 19 17 18 +29 1 27 17 18 +30 2 19 17 27 +31 9 17 19 20 +32 2 17 19 21 +33 9 21 19 20 +34 10 19 20 29 +35 11 19 20 30 +36 11 19 20 3 +37 12 29 20 30 +38 12 29 20 3 +39 13 30 20 3 +40 1 19 21 22 +41 2 19 21 23 +42 1 23 21 22 +43 1 21 23 24 +44 2 21 23 25 +45 1 25 23 24 +46 1 23 25 26 +47 2 23 25 27 +48 1 27 25 26 +49 2 17 27 25 +50 1 17 27 28 +51 1 25 27 28 + +Dihedrals + +1 2 8 6 16 15 +2 2 16 6 8 7 +3 2 6 8 10 9 +4 4 10 8 6 16 +5 2 10 8 6 5 +6 5 7 8 6 5 +7 2 8 10 12 11 +8 2 12 10 8 7 +9 4 12 10 8 6 +10 5 9 10 8 7 +11 10 11 12 14 13 +12 11 10 12 14 13 +13 2 14 12 10 9 +14 4 14 12 10 8 +15 5 11 12 10 9 +16 17 14 13 3 20 +17 14 14 13 3 2 +18 14 14 13 3 1 +19 18 4 13 3 20 +20 15 4 13 3 2 +21 15 4 13 3 1 +22 2 12 14 16 15 +23 12 16 14 13 4 +24 13 16 14 13 3 +25 12 12 14 13 4 +26 13 12 14 13 3 +27 2 16 14 12 11 +28 4 16 14 12 10 +29 10 15 16 14 13 +30 11 6 16 14 13 +31 4 6 16 14 12 +32 5 15 16 6 5 +33 4 14 16 6 8 +34 2 14 16 6 5 +35 10 18 17 19 20 +36 11 27 17 19 20 +37 4 27 17 19 21 +38 5 18 17 27 28 +39 4 19 17 27 25 +40 2 19 17 27 28 +41 2 21 19 17 18 +42 12 17 19 20 29 +43 13 17 19 20 30 +44 13 17 19 20 3 +45 12 21 19 20 29 +46 13 21 19 20 30 +47 13 21 19 20 3 +48 2 17 19 21 22 +49 4 17 19 21 23 +50 17 19 20 3 13 +51 14 19 20 3 2 +52 14 19 20 3 1 +53 18 29 20 3 13 +54 15 29 20 3 2 +55 15 29 20 3 1 +56 19 30 20 3 13 +57 16 30 20 3 2 +58 16 30 20 3 1 +59 10 22 21 19 20 +60 11 23 21 19 20 +61 2 19 21 23 24 +62 4 19 21 23 25 +63 5 22 21 23 24 +64 2 25 23 21 22 +65 2 21 23 25 26 +66 4 21 23 25 27 +67 5 24 23 25 26 +68 2 27 25 23 24 +69 4 23 25 27 17 +70 2 23 25 27 28 +71 5 26 25 27 28 +72 2 25 27 17 18 +73 2 17 27 25 26 + +Impropers + +1 1 2 3 13 20 +2 1 1 3 13 20 +3 1 2 3 1 20 +4 1 2 3 1 13 +5 1 16 6 8 5 +6 1 10 8 6 7 +7 1 12 10 8 9 +8 1 14 12 10 11 +9 7 14 13 4 3 +10 5 16 14 12 13 +11 1 14 16 6 15 +12 1 19 17 27 18 +13 5 17 19 21 20 +14 1 19 20 29 30 +15 1 19 20 29 3 +16 1 19 20 30 3 +17 1 29 20 30 3 +18 1 19 21 23 22 +19 1 21 23 25 24 +20 1 23 25 27 26 +21 1 17 27 25 28 diff --git a/examples/USER/reaction/polystyrene_create_atoms/infromdata.class2 b/examples/USER/reaction/polystyrene_create_atoms/infromdata.class2 new file mode 100755 index 0000000000..3affb24904 --- /dev/null +++ b/examples/USER/reaction/polystyrene_create_atoms/infromdata.class2 @@ -0,0 +1,49 @@ +# Jake practice run + +units real + +boundary p p p + +atom_style full + +kspace_style pppm 1.0e-4 + +pair_style lj/class2/coul/long 8.5 + +angle_style class2 + +bond_style class2 + +dihedral_style class2 + +improper_style class2 + +variable T equal 530 + +read_data trimer.data & + extra/bond/per/atom 5 & + extra/angle/per/atom 15 & + extra/dihedral/per/atom 15 & + extra/improper/per/atom 25 & + extra/special/per/atom 25 + +molecule mol3 chain_plus_styrene_unreacted_create_atoms.data_template +molecule mol4 chain_plus_styrene_reacted.data_template + +fix rxn1 all bond/react stabilization yes statted_grp .03 & + react rxn2 all 1 0 3.0 mol3 mol4 chain_plus_styrene_map_create_atoms & + modify_create create_fit stabilize_steps 100 max_rxn 50 + +fix 1 statted_grp_REACT nvt temp $T $T 100 #iso 1 1 1000 + +fix 4 bond_react_MASTER_group temp/rescale 1 $T $T 1 1 + +thermo_style custom step temp press density f_rxn1[1] + +#restart 1 restart1 restart2 + +thermo 2 + +run 8000 + +write_data restart_longrun.data nofix diff --git a/examples/USER/reaction/polystyrene_create_atoms/trimer.data b/examples/USER/reaction/polystyrene_create_atoms/trimer.data new file mode 100644 index 0000000000..5a40205e16 --- /dev/null +++ b/examples/USER/reaction/polystyrene_create_atoms/trimer.data @@ -0,0 +1,797 @@ +LAMMPS data file via write_data, version 15 May 2019, timestep = 500 + +48 atoms +7 atom types +50 bonds +13 bond types +84 angles +22 angle types +127 dihedrals +36 dihedral types +36 impropers +9 improper types + +50 250 xlo xhi +50 250 ylo yhi +50 250 zlo zhi + +Masses + +1 12.0112 +2 1.00797 +3 12.0112 +4 12.0112 +5 12.0112 +6 12.0112 +7 12.0112 + +Pair Coeffs # lj/class2/coul/long + +1 0.064 4.01 +2 0.02 2.7 +3 0.064 4.01 +4 0.064 3.9 +5 0.054 4.01 +6 0.054 4.01 +7 0.054 4.01 + +Bond Coeffs # class2 + +1 1.0982 372.825 -803.453 894.317 +2 1.417 470.836 -627.618 1327.63 +3 1.501 321.902 -521.821 572.163 +4 1.0883 365.768 -725.54 781.662 +5 1.34 543.99 -1238.2 1644.03 +6 1.0883 365.768 -725.54 781.662 +7 1.501 321.902 -521.821 572.163 +8 1.101 345 -691.89 844.6 +9 1.53 299.67 -501.77 679.81 +10 1.101 345 -691.89 844.6 +11 1.501 321.902 -521.821 572.163 +12 1.101 345 -691.89 844.6 +13 1.53 299.67 -501.77 679.81 + +Angle Coeffs # class2 + +1 117.94 35.1558 -12.4682 0 +2 118.9 61.0226 -34.9931 0 +3 120.05 44.7148 -22.7352 0 +4 111 44.3234 -9.4454 0 +5 108.4 43.9594 -8.3924 -9.3379 +6 124.88 35.2766 -17.774 -1.6215 +7 124.88 35.2766 -17.774 -1.6215 +8 115.49 29.6363 -12.4853 -6.2218 +9 120.05 44.7148 -22.7352 0 +10 111 44.3234 -9.4454 0 +11 108.4 43.9594 -8.3924 -9.3379 +12 110.77 41.453 -10.604 5.129 +13 112.67 39.516 -7.443 -9.5583 +14 110.77 41.453 -10.604 5.129 +15 107.66 39.641 -12.921 -2.4318 +16 112.67 39.516 -7.443 -9.5583 +17 120.05 44.7148 -22.7352 0 +18 111 44.3234 -9.4454 0 +19 108.4 43.9594 -8.3924 -9.3379 +20 110.77 41.453 -10.604 5.129 +21 110.77 41.453 -10.604 5.129 +22 112.67 39.516 -7.443 -9.5583 + +BondBond Coeffs + +1 1.0795 1.417 1.0982 +2 68.2856 1.417 1.417 +3 12.0676 1.417 1.501 +4 2.9168 1.501 1.0883 +5 0 1.501 1.34 +6 10.1047 1.0883 1.34 +7 10.1047 1.0883 1.34 +8 4.8506 1.0883 1.0883 +9 12.0676 1.417 1.501 +10 2.9168 1.501 1.101 +11 0 1.501 1.53 +12 3.3872 1.101 1.53 +13 0 1.53 1.53 +14 3.3872 1.101 1.53 +15 5.3316 1.101 1.101 +16 0 1.53 1.53 +17 12.0676 1.417 1.501 +18 2.9168 1.501 1.101 +19 0 1.501 1.53 +20 3.3872 1.101 1.53 +21 3.3872 1.101 1.53 +22 0 1.53 1.53 + +BondAngle Coeffs + +1 20.0033 24.2183 1.417 1.0982 +2 28.8708 28.8708 1.417 1.417 +3 31.0771 47.0579 1.417 1.501 +4 26.4608 11.7717 1.501 1.0883 +5 0 0 1.501 1.34 +6 19.0592 23.3588 1.0883 1.34 +7 19.0592 23.3588 1.0883 1.34 +8 17.9795 17.9795 1.0883 1.0883 +9 31.0771 47.0579 1.417 1.501 +10 26.4608 11.7717 1.501 1.101 +11 0 0 1.501 1.53 +12 11.421 20.754 1.101 1.53 +13 8.016 8.016 1.53 1.53 +14 11.421 20.754 1.101 1.53 +15 18.103 18.103 1.101 1.101 +16 8.016 8.016 1.53 1.53 +17 31.0771 47.0579 1.417 1.501 +18 26.4608 11.7717 1.501 1.101 +19 0 0 1.501 1.53 +20 11.421 20.754 1.101 1.53 +21 11.421 20.754 1.101 1.53 +22 8.016 8.016 1.53 1.53 + +Dihedral Coeffs # class2 + +1 0 0 1.559 0 0 0 +2 0 0 3.9661 0 0 0 +3 0 0 4.4072 0 0 0 +4 8.3667 0 1.1932 0 0 0 +5 0 0 1.8769 0 0 0 +6 0 0 0 0 0 0 +7 0 0 0 0 0 0 +8 0 0 0 0 0 0 +9 0 0 4.8974 0 0 0 +10 0 0 1.559 0 0 0 +11 0 0 4.4072 0 0 0 +12 -0.2801 0 -0.0678 0 -0.0122 0 +13 -0.2802 0 -0.0678 0 -0.0122 0 +14 -0.0228 0 0.028 0 -0.1863 0 +15 -0.1432 0 0.0617 0 -0.1083 0 +16 0 0 0.0316 0 -0.1681 0 +17 0 0 0 0 0 0 +18 0 0 0.0316 0 -0.1681 0 +19 0 0 0.0514 0 -0.143 0 +20 0 0 1.559 0 0 0 +21 0 0 4.4072 0 0 0 +22 -0.2801 0 -0.0678 0 -0.0122 0 +23 -0.2802 0 -0.0678 0 -0.0122 0 +24 -0.0228 0 0.028 0 -0.1863 0 +25 0 0 0 0 0 0 +26 -0.1432 0 0.0617 0 -0.1083 0 +27 0 0 0.0316 0 -0.1681 0 +28 0 0 0 0 0 0 +29 0 0 0.0316 0 -0.1681 0 +30 0 0 0.0514 0 -0.143 0 +31 -0.0228 0 0.028 0 -0.1863 0 +32 -0.1432 0 0.0617 0 -0.1083 0 +33 0 0 0.0316 0 -0.1681 0 +34 0 0 0 0 0 0 +35 0 0 0.0316 0 -0.1681 0 +36 0 0 0.0514 0 -0.143 0 + +AngleAngleTorsion Coeffs + +1 4.4444 117.94 120.05 +2 -4.8141 118.9 117.94 +3 -14.4097 118.9 120.05 +4 0 118.9 118.9 +5 0.3598 117.94 117.94 +6 0 120.05 111 +7 0 120.05 108.4 +8 0 108.4 124.88 +9 -7.0058 124.88 124.88 +10 4.4444 117.94 120.05 +11 -14.4097 118.9 120.05 +12 -5.8888 120.05 111 +13 0 120.05 108.4 +14 0 108.4 110.77 +15 -12.564 110.77 110.77 +16 -16.164 112.67 110.77 +17 0 108.4 112.67 +18 -16.164 110.77 112.67 +19 -22.045 112.67 112.67 +20 4.4444 117.94 120.05 +21 -14.4097 118.9 120.05 +22 -5.8888 120.05 111 +23 0 120.05 108.4 +24 0 108.4 110.77 +25 0 108.4 112.67 +26 -12.564 110.77 110.77 +27 -16.164 110.77 112.67 +28 0 112.67 108.4 +29 -16.164 112.67 110.77 +30 -22.045 112.67 112.67 +31 0 110.77 108.4 +32 -12.564 110.77 110.77 +33 -16.164 110.77 112.67 +34 0 112.67 108.4 +35 -16.164 112.67 110.77 +36 -22.045 112.67 112.67 + +EndBondTorsion Coeffs + +1 0 -0.4879 0 0 -1.797 0 1.0982 1.501 +2 0 -6.8958 0 0 -0.4669 0 1.417 1.0982 +3 0 -0.6918 0 0 0.2421 0 1.417 1.501 +4 -0.1185 6.3204 0 -0.1185 6.3204 0 1.417 1.417 +5 0 -0.689 0 0 -0.689 0 1.0982 1.0982 +6 0 0 0 0 0 0 1.417 1.0883 +7 0 0 0 0 0 0 1.417 1.34 +8 0 0 0 0 0 0 1.501 1.0883 +9 0.7129 0.5161 0 0.7129 0.5161 0 1.0883 1.0883 +10 0 -0.4879 0 0 -1.797 0 1.0982 1.501 +11 0 -0.6918 0 0 0.2421 0 1.417 1.501 +12 -0.5835 1.122 0.3978 1.3997 0.7756 0 1.417 1.101 +13 0 0 0 0 0 0 1.417 1.53 +14 0 0 0 0 0 0 1.501 1.101 +15 0.213 0.312 0.0777 0.213 0.312 0.0777 1.101 1.101 +16 0.2486 0.2422 -0.0925 0.0814 0.0591 0.2219 1.53 1.101 +17 0 0 0 0 0 0 1.501 1.53 +18 0.0814 0.0591 0.2219 0.2486 0.2422 -0.0925 1.101 1.53 +19 -0.0732 0 0 -0.0732 0 0 1.53 1.53 +20 0 -0.4879 0 0 -1.797 0 1.0982 1.501 +21 0 -0.6918 0 0 0.2421 0 1.417 1.501 +22 -0.5835 1.122 0.3978 1.3997 0.7756 0 1.417 1.101 +23 0 0 0 0 0 0 1.417 1.53 +24 0 0 0 0 0 0 1.501 1.101 +25 0 0 0 0 0 0 1.501 1.53 +26 0.213 0.312 0.0777 0.213 0.312 0.0777 1.101 1.101 +27 0.0814 0.0591 0.2219 0.2486 0.2422 -0.0925 1.101 1.53 +28 0 0 0 0 0 0 1.53 1.501 +29 0.2486 0.2422 -0.0925 0.0814 0.0591 0.2219 1.53 1.101 +30 -0.0732 0 0 -0.0732 0 0 1.53 1.53 +31 0 0 0 0 0 0 1.101 1.501 +32 0.213 0.312 0.0777 0.213 0.312 0.0777 1.101 1.101 +33 0.0814 0.0591 0.2219 0.2486 0.2422 -0.0925 1.101 1.53 +34 0 0 0 0 0 0 1.53 1.501 +35 0.2486 0.2422 -0.0925 0.0814 0.0591 0.2219 1.53 1.101 +36 -0.0732 0 0 -0.0732 0 0 1.53 1.53 + +MiddleBondTorsion Coeffs + +1 0 3.9421 0 1.417 +2 0 -1.1521 0 1.417 +3 0 9.1792 0 1.417 +4 27.5989 -2.312 0 1.417 +5 0 4.8228 0 1.417 +6 0 0 0 1.501 +7 0 0 0 1.501 +8 0 0 0 1.34 +9 0.8558 6.3911 0 1.34 +10 0 3.9421 0 1.417 +11 0 9.1792 0 1.417 +12 -5.5679 1.4083 0.301 1.501 +13 0 0 0 1.501 +14 0 0 0 1.53 +15 -14.261 -0.5322 -0.4864 1.53 +16 -14.879 -3.6581 -0.3138 1.53 +17 0 0 0 1.53 +18 -14.879 -3.6581 -0.3138 1.53 +19 -17.787 -7.1877 0 1.53 +20 0 3.9421 0 1.417 +21 0 9.1792 0 1.417 +22 -5.5679 1.4083 0.301 1.501 +23 0 0 0 1.501 +24 0 0 0 1.53 +25 0 0 0 1.53 +26 -14.261 -0.5322 -0.4864 1.53 +27 -14.879 -3.6581 -0.3138 1.53 +28 0 0 0 1.53 +29 -14.879 -3.6581 -0.3138 1.53 +30 -17.787 -7.1877 0 1.53 +31 0 0 0 1.53 +32 -14.261 -0.5322 -0.4864 1.53 +33 -14.879 -3.6581 -0.3138 1.53 +34 0 0 0 1.53 +35 -14.879 -3.6581 -0.3138 1.53 +36 -17.787 -7.1877 0 1.53 + +BondBond13 Coeffs + +1 0.8743 1.0982 1.501 +2 -6.2741 1.417 1.0982 +3 2.5085 1.417 1.501 +4 53 1.417 1.417 +5 -1.7077 1.0982 1.0982 +6 0 1.417 1.0883 +7 0 1.417 1.34 +8 0 1.501 1.0883 +9 0 1.0883 1.0883 +10 0.8743 1.0982 1.501 +11 2.5085 1.417 1.501 +12 -3.4826 1.417 1.101 +13 0 1.417 1.53 +14 0 1.501 1.101 +15 0 1.101 1.101 +16 0 1.53 1.101 +17 0 1.501 1.53 +18 0 1.101 1.53 +19 0 1.53 1.53 +20 0.8743 1.0982 1.501 +21 2.5085 1.417 1.501 +22 -3.4826 1.417 1.101 +23 0 1.417 1.53 +24 0 1.501 1.101 +25 0 1.501 1.53 +26 0 1.101 1.101 +27 0 1.101 1.53 +28 0 1.53 1.501 +29 0 1.53 1.101 +30 0 1.53 1.53 +31 0 1.101 1.501 +32 0 1.101 1.101 +33 0 1.101 1.53 +34 0 1.53 1.501 +35 0 1.53 1.101 +36 0 1.53 1.53 + +AngleTorsion Coeffs + +1 0 3.4601 0 0 -0.1242 0 117.94 120.05 +2 0 2.5014 0 0 2.7147 0 118.9 117.94 +3 0 3.8987 0 0 -4.4683 0 118.9 120.05 +4 1.9767 1.0239 0 1.9767 1.0239 0 118.9 118.9 +5 0 2.4501 0 0 2.4501 0 117.94 117.94 +6 0 0 0 0 0 0 120.05 111 +7 0 0 0 0 0 0 120.05 108.4 +8 0 0 0 0 0 0 108.4 124.88 +9 -1.8911 3.254 0 -1.8911 3.254 0 124.88 124.88 +10 0 3.4601 0 0 -0.1242 0 117.94 120.05 +11 0 3.8987 0 0 -4.4683 0 118.9 120.05 +12 0.2251 0.6548 0.1237 4.6266 0.1632 0.0461 120.05 111 +13 0 0 0 0 0 0 120.05 108.4 +14 0 0 0 0 0 0 108.4 110.77 +15 -0.8085 0.5569 -0.2466 -0.8085 0.5569 -0.2466 110.77 110.77 +16 -0.2454 0 -0.1136 0.3113 0.4516 -0.1988 112.67 110.77 +17 0 0 0 0 0 0 108.4 112.67 +18 0.3113 0.4516 -0.1988 -0.2454 0 -0.1136 110.77 112.67 +19 0.3886 -0.3139 0.1389 0.3886 -0.3139 0.1389 112.67 112.67 +20 0 3.4601 0 0 -0.1242 0 117.94 120.05 +21 0 3.8987 0 0 -4.4683 0 118.9 120.05 +22 0.2251 0.6548 0.1237 4.6266 0.1632 0.0461 120.05 111 +23 0 0 0 0 0 0 120.05 108.4 +24 0 0 0 0 0 0 108.4 110.77 +25 0 0 0 0 0 0 108.4 112.67 +26 -0.8085 0.5569 -0.2466 -0.8085 0.5569 -0.2466 110.77 110.77 +27 0.3113 0.4516 -0.1988 -0.2454 0 -0.1136 110.77 112.67 +28 0 0 0 0 0 0 112.67 108.4 +29 -0.2454 0 -0.1136 0.3113 0.4516 -0.1988 112.67 110.77 +30 0.3886 -0.3139 0.1389 0.3886 -0.3139 0.1389 112.67 112.67 +31 0 0 0 0 0 0 110.77 108.4 +32 -0.8085 0.5569 -0.2466 -0.8085 0.5569 -0.2466 110.77 110.77 +33 0.3113 0.4516 -0.1988 -0.2454 0 -0.1136 110.77 112.67 +34 0 0 0 0 0 0 112.67 108.4 +35 -0.2454 0 -0.1136 0.3113 0.4516 -0.1988 112.67 110.77 +36 0.3886 -0.3139 0.1389 0.3886 -0.3139 0.1389 112.67 112.67 + +Improper Coeffs # class2 + +1 4.8912 0 +2 7.8153 0 +3 0 0 +4 2.8561 0 +5 7.8153 0 +6 0 0 +7 0 0 +8 7.8153 0 +9 0 0 + +AngleAngle Coeffs + +1 0 0 0 118.9 117.94 117.94 +2 0 0 0 118.9 120.05 120.05 +3 0 0 0 111 124.88 108.4 +4 0 0 0 115.49 124.88 124.88 +5 0 0 0 118.9 120.05 120.05 +6 0 0 0 107.66 110.77 110.77 +7 0 0 0 111 110.77 108.4 +8 0 0 0 118.9 120.05 120.05 +9 0 0 0 111 110.77 108.4 + +Atoms # full + +44 1 2 3.5400000000000001e-02 6.1476397222913839e+01 8.2376490601205234e+01 6.0906939115836181e+01 0 -1 0 +45 1276 2 3.5400000000000001e-02 5.8398688202244472e+01 8.0172948526664996e+01 6.2115536813582672e+01 0 0 1 +46 1276 6 -6.9599999999999995e-02 5.9489073989392523e+01 8.0264057167571636e+01 6.1984002598976552e+01 0 0 1 +48 1276 2 3.5400000000000001e-02 5.9675170230342431e+01 8.0048052449390738e+01 6.0920159395372401e+01 0 0 1 +47 1276 2 1.2370000000000000e-01 5.9297455513100488e+01 8.3187777608476154e+01 5.9645157256520122e+01 0 0 1 +18 1 5 -1.8200000000000001e-02 6.2426251430535707e+01 8.2055473568260709e+01 6.2971661388612958e+01 0 -1 0 +19 1 6 -6.9599999999999995e-02 6.1399255844467369e+01 8.1794665295860213e+01 6.1821819828185660e+01 0 -1 0 +21 1 1 -1.2900000000000000e-01 6.4032918371445831e+01 8.0190179089286701e+01 6.3021564712316334e+01 0 -1 0 +22 1 1 2.6599999999999999e-02 6.3672975135915053e+01 8.1418558650051665e+01 6.2448012627881994e+01 0 -1 0 +23 1 2 3.5400000000000001e-02 6.1545198223694939e+01 8.0836309422842305e+01 6.1349823957467130e+01 0 -1 0 +27 1276 2 5.1600000000000000e-02 5.9809503696580933e+01 8.1831265916389881e+01 6.3253745193271065e+01 0 0 1 +28 1276 5 -1.8200000000000001e-02 5.9900307947967441e+01 8.1677453781363639e+01 6.2190757403657820e+01 0 0 1 +31 1276 2 1.2370000000000000e-01 5.8050043823867973e+01 8.2698312265456622e+01 6.3667111329534436e+01 0 0 1 +38 1 2 1.2370000000000000e-01 6.3754126973935612e+01 7.9931147303963002e+01 6.4022259163067275e+01 0 -1 0 +20 1 2 1.2370000000000000e-01 6.4070158368422781e+01 8.2950071388392274e+01 6.1042631212883315e+01 0 -1 0 +24 1 1 -1.2900000000000000e-01 6.4337973861569580e+01 8.1916618276489871e+01 6.1387866780102470e+01 0 -1 0 +37 1 2 1.4030000000000001e-01 6.5360115866618415e+01 7.8586112104863830e+01 6.3004997314380716e+01 0 -1 0 +39 1 1 -1.7340000000000000e-01 6.5018338085325610e+01 7.9478260591306125e+01 6.2440745569712817e+01 0 -1 0 +40 1 1 -1.1340000000000000e-01 6.5628759887796605e+01 7.9941156332165264e+01 6.1248476296558067e+01 0 -1 0 +41 1 1 -1.7340000000000000e-01 6.5247995680260402e+01 8.1172439250598345e+01 6.0753045571239831e+01 0 -1 0 +42 1 2 1.2880000000000000e-01 6.6569600059599281e+01 7.9514748976494360e+01 6.0810611807135601e+01 0 -1 0 +43 1 2 1.4030000000000001e-01 6.5780165393063371e+01 8.1570974991007958e+01 5.9850915261812396e+01 0 -1 0 +9 1276 2 1.2880000000000000e-01 5.5651795605743445e+01 8.5074472139235127e+01 6.1094480497979262e+01 0 0 1 +30 1276 2 1.4030000000000001e-01 5.6082982679196888e+01 8.3912863624076010e+01 6.3351889697403472e+01 0 0 1 +33 1276 1 -1.7340000000000000e-01 5.6718133911388506e+01 8.3758479063002000e+01 6.2493293749545209e+01 0 0 1 +34 1276 1 -1.1340000000000000e-01 5.6498352105218459e+01 8.4426576393179090e+01 6.1290147608586011e+01 0 0 1 +6 3822 1 -1.7340000000000000e-01 6.3308103537340351e+01 8.7713509787622499e+01 6.4643082313868433e+01 0 0 0 +7 3822 1 -1.2900000000000000e-01 6.3010291684764312e+01 8.6423650045069493e+01 6.4252844241495922e+01 0 0 0 +8 3822 2 1.2370000000000000e-01 6.2089199187020355e+01 8.6309198636296912e+01 6.3711263099850854e+01 0 0 0 +10 1276 2 1.4030000000000001e-01 5.7266131308654970e+01 8.4599328362003035e+01 5.9281511478144402e+01 0 0 1 +11 3822 2 3.5400000000000001e-02 6.1694306618059791e+01 8.3823470438280594e+01 6.3778953909925114e+01 0 0 0 +12 3822 5 -1.8200000000000001e-02 6.3814926998838651e+01 8.3900077798460728e+01 6.4108991789590448e+01 0 0 0 +13 3822 6 -6.9599999999999995e-02 6.2604540882379787e+01 8.3491998603381077e+01 6.3249610918984622e+01 0 0 0 +14 3822 2 1.2370000000000000e-01 6.5739253131027880e+01 8.4813736128157771e+01 6.5351692111169555e+01 0 0 0 +15 3822 1 -1.2900000000000000e-01 6.5071144269009466e+01 8.5646783550482454e+01 6.5086813218945636e+01 0 0 0 +16 3822 1 2.6599999999999999e-02 6.3957099792282079e+01 8.5375816595044753e+01 6.4385073943729708e+01 0 0 0 +17 1 2 5.1600000000000000e-02 6.2256484483973310e+01 8.1576962161157596e+01 6.3963984654065122e+01 0 -1 0 +26 3822 2 5.1600000000000000e-02 6.4196825763126355e+01 8.3291442832977836e+01 6.4907094488854057e+01 0 0 0 +29 1276 1 2.6599999999999999e-02 5.8784742332505303e+01 8.2766055380197670e+01 6.1667239692876961e+01 0 0 1 +32 1276 1 -1.2900000000000000e-01 5.7836199787435064e+01 8.3005060229118428e+01 6.2669788306756018e+01 0 0 1 +35 1276 1 -1.2900000000000000e-01 5.8572661840325132e+01 8.3404075689965083e+01 6.0443288532625175e+01 0 0 1 +36 1276 1 -1.7340000000000000e-01 5.7380616699226330e+01 8.4134680429976896e+01 6.0248710539932475e+01 0 0 1 +25 3822 2 3.5400000000000001e-02 6.2750675036816460e+01 8.3891633300878468e+01 6.2249429178485677e+01 0 0 0 +5 3822 2 1.4030000000000001e-01 6.2626160082050376e+01 8.8416565740835182e+01 6.4093918967496805e+01 0 0 0 +1 3822 2 1.2880000000000000e-01 6.4863557606529355e+01 8.9096029197548390e+01 6.5342927535537825e+01 0 0 0 +2 3822 1 -1.1340000000000000e-01 6.4627442641031166e+01 8.8047381925321190e+01 6.5138073202291650e+01 0 0 0 +3 3822 2 1.4030000000000001e-01 6.6470254992065406e+01 8.6991893750821745e+01 6.5857474890608984e+01 0 0 0 +4 3822 1 -1.7340000000000000e-01 6.5416488888088338e+01 8.6963894801200169e+01 6.5357641085394278e+01 0 0 0 + +Velocities + +44 -1.1274099342391698e-02 2.8614364731871914e-02 7.8116535486555949e-03 +45 2.3164382404151666e-03 3.9815732957733160e-03 -2.9971878581527899e-02 +46 -7.1653099619954563e-03 4.5491360587300133e-04 4.9898614093692017e-03 +48 9.8069086061434527e-03 4.0008139512159270e-03 6.2934259772882122e-03 +47 2.2646445306743783e-03 1.3029071608409702e-03 4.2232440120174040e-02 +18 7.0040064100195757e-03 3.2877451206009701e-03 -3.5376010407568422e-04 +19 -1.3998188760009689e-02 7.2238210565990146e-03 7.7956220633332383e-03 +21 3.1954292320462373e-03 -2.9717583309420764e-03 -3.1753395094325522e-03 +22 5.2997643939121201e-03 -2.9646963088534335e-03 -4.1351926198204894e-03 +23 7.6443400078766528e-03 4.0358953976530103e-02 -2.6684706183248367e-02 +27 1.9261652416455359e-03 -1.1632914130150688e-02 1.0061732021630769e-02 +28 -8.2251676802878315e-03 -1.5111873066969876e-04 1.3808893565582731e-02 +31 5.2475840572179860e-03 1.8266996572138715e-02 2.3453280610166885e-03 +38 -2.0343905130199073e-02 3.2815536859276281e-02 3.6511922534330152e-03 +20 2.2914549087537126e-02 1.4424503744223915e-02 2.1708279654645496e-03 +24 -2.4717233344142471e-03 1.2966123098719246e-02 8.1261459853411936e-03 +37 -2.4547379584186218e-02 -3.0213966592845171e-02 -3.1437442951939183e-02 +39 2.5476117829076835e-03 1.2743160680987653e-03 1.8775880208113892e-03 +40 -6.9216508143939990e-03 1.0986173624795060e-02 8.4543093049661480e-03 +41 -6.9641432145561661e-03 3.4497795547843439e-03 -6.5914679936187716e-03 +42 -1.6682931637687005e-02 -7.9952140358728052e-03 -5.4993265930488526e-02 +43 -1.2747392921213267e-03 -8.9033092043203244e-03 -1.4285400545629027e-02 +9 -4.6235166357676289e-03 -1.3071850427027999e-02 -1.4097407987100977e-02 +30 -1.0949617396609294e-02 2.8255703113196974e-03 1.7171748232322353e-02 +33 -6.1375812469323665e-03 -2.4748644899411924e-03 -9.4761978149296138e-03 +34 1.3676079846441525e-03 5.6076140293943458e-03 4.3217204641336267e-03 +6 -1.0264635053701928e-02 6.5278337056107680e-03 7.0056151148588212e-04 +7 -8.7519451205145676e-03 -4.6476440106580945e-03 2.5970484253527112e-03 +8 2.1377395557690311e-02 -3.3261274153819453e-03 -1.0112266596677577e-02 +10 -3.5793767912309253e-02 -4.7139872292323019e-02 -1.6709528481405608e-02 +11 8.5071485795589590e-03 9.9402848610678270e-03 -3.8088596341056854e-03 +12 -7.1678159384257103e-04 -6.9164463557228907e-04 -6.4073519808107186e-03 +13 -4.8443902657902991e-03 -1.1919190682985097e-03 6.3946846087726637e-03 +14 1.4810157483257907e-02 1.9829623839419017e-03 -2.7393844990063056e-02 +15 2.4171850935506777e-03 8.5003135180758520e-03 -1.4373227798951704e-03 +16 2.7567342910947553e-03 4.7168484476890456e-03 -5.5131873288712992e-03 +17 -3.8456662730386774e-02 2.0220106671151108e-02 -1.3822049134399602e-02 +26 2.7415414728694614e-02 1.4392155257037418e-03 -6.7281635499082748e-03 +29 2.8284983560440745e-03 2.8809942505517976e-03 -9.0489583066552114e-04 +32 -3.8543634697614316e-03 4.6751647301899795e-03 4.2171867397204537e-03 +35 -8.6957974827209118e-03 -4.4615282666186267e-04 -2.6571026120482824e-03 +36 9.4881057996863086e-04 -7.5665878069688429e-03 2.0333670960646154e-03 +25 1.8105924111310519e-02 -8.6933495274689535e-03 -1.9695291360338044e-04 +5 -5.0447438383189585e-03 -4.5665146331657552e-02 1.0653751333175230e-02 +1 -1.7372868398038824e-02 -2.3625357536259349e-03 1.2220266128368908e-02 +2 3.7050246021929395e-03 -1.0236943515935205e-03 7.2206774682170580e-03 +3 2.3669435799326944e-02 2.7891427939155597e-02 -6.7091036888174346e-03 +4 3.4910623999263577e-03 2.6370880132825258e-03 -6.4694788112864129e-03 + +Bonds + +1 10 44 19 +2 10 45 46 +3 10 48 46 +4 9 19 18 +5 1 21 38 +6 2 21 22 +7 2 21 39 +8 7 22 18 +9 2 22 24 +10 10 23 19 +11 8 27 28 +12 9 28 46 +13 9 28 19 +14 1 24 20 +15 2 24 41 +16 1 39 37 +17 1 40 42 +18 2 40 39 +19 1 41 43 +20 2 41 40 +21 1 33 30 +22 1 34 9 +23 2 34 33 +24 1 6 5 +25 2 6 2 +26 1 7 8 +27 2 7 6 +28 10 11 13 +29 13 12 13 +30 9 13 18 +31 1 15 14 +32 2 15 16 +33 2 15 4 +34 11 16 12 +35 2 16 7 +36 8 17 18 +37 12 26 12 +38 7 29 28 +39 2 29 35 +40 1 32 31 +41 2 32 29 +42 2 32 33 +43 1 35 47 +44 2 35 36 +45 1 36 10 +46 2 36 34 +47 10 25 13 +48 1 2 1 +49 2 2 4 +50 1 4 3 + +Angles + +1 14 45 46 28 +2 14 48 46 28 +3 15 45 46 48 +4 11 22 18 13 +5 12 17 18 13 +6 13 13 18 19 +7 10 22 18 17 +8 11 22 18 19 +9 12 17 18 19 +10 16 28 19 18 +11 14 44 19 28 +12 14 23 19 28 +13 14 44 19 18 +14 14 23 19 18 +15 15 44 19 23 +16 1 22 21 38 +17 1 39 21 38 +18 2 22 21 39 +19 9 21 22 18 +20 2 21 22 24 +21 9 24 22 18 +22 10 29 28 27 +23 11 29 28 46 +24 11 29 28 19 +25 12 27 28 46 +26 12 27 28 19 +27 13 46 28 19 +28 1 22 24 20 +29 2 22 24 41 +30 1 41 24 20 +31 2 21 39 40 +32 1 21 39 37 +33 1 40 39 37 +34 1 41 40 42 +35 2 41 40 39 +36 1 39 40 42 +37 1 24 41 43 +38 2 24 41 40 +39 1 40 41 43 +40 2 32 33 34 +41 1 32 33 30 +42 1 34 33 30 +43 1 36 34 9 +44 2 36 34 33 +45 1 33 34 9 +46 1 7 6 5 +47 2 7 6 2 +48 1 2 6 5 +49 1 16 7 8 +50 2 16 7 6 +51 1 6 7 8 +52 18 16 12 26 +53 19 16 12 13 +54 20 26 12 13 +55 21 25 13 12 +56 21 11 13 12 +57 22 12 13 18 +58 15 25 13 11 +59 14 25 13 18 +60 14 11 13 18 +61 1 16 15 14 +62 1 4 15 14 +63 2 16 15 4 +64 17 15 16 12 +65 2 15 16 7 +66 17 7 16 12 +67 9 32 29 28 +68 2 32 29 35 +69 9 35 29 28 +70 1 29 32 31 +71 1 33 32 31 +72 2 29 32 33 +73 1 29 35 47 +74 2 29 35 36 +75 1 36 35 47 +76 1 35 36 10 +77 2 35 36 34 +78 1 34 36 10 +79 1 6 2 1 +80 2 6 2 4 +81 1 4 2 1 +82 2 15 4 2 +83 1 15 4 3 +84 1 2 4 3 + +Dihedrals + +1 34 18 19 28 29 +2 31 44 19 28 29 +3 31 23 19 28 29 +4 35 18 19 28 27 +5 32 44 19 28 27 +6 32 23 19 28 27 +7 36 18 19 28 46 +8 33 44 19 28 46 +9 33 23 19 28 46 +10 36 28 19 18 13 +11 33 44 19 18 13 +12 33 23 19 18 13 +13 34 28 19 18 22 +14 31 44 19 18 22 +15 31 23 19 18 22 +16 35 28 19 18 17 +17 32 44 19 18 17 +18 32 23 19 18 17 +19 10 38 21 22 18 +20 11 39 21 22 18 +21 4 39 21 22 24 +22 5 38 21 39 37 +23 4 22 21 39 40 +24 2 22 21 39 37 +25 2 24 22 21 38 +26 13 21 22 18 13 +27 12 21 22 18 17 +28 13 21 22 18 19 +29 13 24 22 18 13 +30 12 24 22 18 17 +31 13 24 22 18 19 +32 2 21 22 24 20 +33 4 21 22 24 41 +34 14 29 28 46 45 +35 14 29 28 46 48 +36 15 27 28 46 45 +37 15 27 28 46 48 +38 16 19 28 46 45 +39 16 19 28 46 48 +40 10 20 24 22 18 +41 11 41 24 22 18 +42 2 22 24 41 43 +43 4 22 24 41 40 +44 5 20 24 41 43 +45 2 40 39 21 38 +46 2 21 39 40 42 +47 2 39 40 41 43 +48 4 41 40 39 21 +49 2 41 40 39 37 +50 5 42 40 39 37 +51 2 40 41 24 20 +52 2 24 41 40 42 +53 4 24 41 40 39 +54 5 43 41 40 42 +55 2 34 33 32 31 +56 2 32 33 34 9 +57 2 33 34 36 10 +58 4 36 34 33 32 +59 2 36 34 33 30 +60 5 9 34 33 30 +61 2 2 6 7 8 +62 2 7 6 2 1 +63 4 7 6 2 4 +64 5 5 6 2 1 +65 20 8 7 16 12 +66 21 6 7 16 12 +67 2 16 7 6 5 +68 4 16 7 6 2 +69 5 8 7 6 5 +70 24 16 12 13 25 +71 24 16 12 13 11 +72 25 16 12 13 18 +73 26 26 12 13 25 +74 26 26 12 13 11 +75 27 26 12 13 18 +76 28 12 13 18 22 +77 29 12 13 18 17 +78 30 12 13 18 19 +79 31 25 13 18 22 +80 32 25 13 18 17 +81 33 25 13 18 19 +82 31 11 13 18 22 +83 32 11 13 18 17 +84 33 11 13 18 19 +85 20 14 15 16 12 +86 21 4 15 16 12 +87 4 4 15 16 7 +88 5 14 15 4 3 +89 4 16 15 4 2 +90 2 16 15 4 3 +91 2 7 16 15 14 +92 22 15 16 12 26 +93 23 15 16 12 13 +94 22 7 16 12 26 +95 23 7 16 12 13 +96 2 15 16 7 8 +97 4 15 16 7 6 +98 2 35 29 32 31 +99 12 32 29 28 27 +100 13 32 29 28 46 +101 13 32 29 28 19 +102 12 35 29 28 27 +103 13 35 29 28 46 +104 13 35 29 28 19 +105 2 32 29 35 47 +106 4 32 29 35 36 +107 10 31 32 29 28 +108 11 33 32 29 28 +109 4 33 32 29 35 +110 5 31 32 33 30 +111 4 29 32 33 34 +112 2 29 32 33 30 +113 10 47 35 29 28 +114 11 36 35 29 28 +115 2 29 35 36 10 +116 4 29 35 36 34 +117 5 47 35 36 10 +118 2 34 36 35 47 +119 2 35 36 34 9 +120 4 35 36 34 33 +121 5 10 36 34 9 +122 2 4 2 6 5 +123 4 6 2 4 15 +124 2 6 2 4 3 +125 5 1 2 4 3 +126 2 2 4 15 14 +127 2 15 4 2 1 + +Impropers + +1 6 45 46 48 28 +2 1 22 18 17 13 +3 1 22 18 13 19 +4 1 17 18 13 19 +5 1 22 18 17 19 +6 1 44 19 18 28 +7 1 23 19 18 28 +8 1 44 19 23 28 +9 1 44 19 23 18 +10 1 22 21 39 38 +11 5 21 22 24 18 +12 1 29 28 27 46 +13 1 29 28 27 19 +14 1 29 28 46 19 +15 1 27 28 46 19 +16 1 22 24 41 20 +17 1 21 39 40 37 +18 1 41 40 39 42 +19 1 24 41 40 43 +20 1 32 33 34 30 +21 1 36 34 33 9 +22 1 7 6 2 5 +23 1 16 7 6 8 +24 9 16 12 26 13 +25 1 25 13 11 12 +26 1 25 13 12 18 +27 1 11 13 12 18 +28 1 25 13 11 18 +29 1 16 15 4 14 +30 8 15 16 7 12 +31 5 32 29 35 28 +32 1 29 32 33 31 +33 1 29 35 36 47 +34 1 35 36 34 10 +35 1 6 2 4 1 +36 1 15 4 2 3 + From 17c14661bc1f0be585f58efe2a5933ef9644bbba Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Mon, 9 Nov 2020 00:18:24 -0500 Subject: [PATCH 021/384] port over some recent bugfixes --- src/USER-REACTION/fix_bond_react.cpp | 31 ++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 3a5f91177b..9f0d1fd36d 100755 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -485,6 +485,14 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : } } + for (int i = 0; i < nreacts; i++) { + if (closeneigh[i] == -1) { // indicates will search non-bonded neighbors + if (cutsq[i][1] > neighbor->cutneighsq[iatomtype[i]][jatomtype[i]]) { + error->all(FLERR,"Bond/react: Fix bond/react cutoff is longer than pairwise cutoff"); + } + } + } + // initialize Marsaglia RNG with processor-unique seed ('prob' keyword) random = new class RanMars*[nreacts]; @@ -779,12 +787,6 @@ void FixBondReact::init() if (strstr(update->integrate_style,"respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; - // check cutoff for iatomtype,jatomtype - for (int i = 0; i < nreacts; i++) { - if (force->pair == nullptr || cutsq[i][1] > force->pair->cutsq[iatomtype[i]][jatomtype[i]]) - error->all(FLERR,"Bond/react: Fix bond/react cutoff is longer than pairwise cutoff"); - } - // need a half neighbor list, built every Nevery steps int irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->pair = 0; @@ -1747,6 +1749,17 @@ void FixBondReact::ring_check() // ring_check can be made more efficient by re-introducing 'frozen' atoms // 'frozen' atoms have been assigned and also are no longer pioneers + // double check the number of neighbors match for all non-edge atoms + // otherwise, atoms at 'end' of symmetric ring can behave like edge atoms + for (int i = 0; i < onemol->natoms; i++) { + if (edge[i][rxnID] == 0) { + if (onemol_nxspecial[i][0] != nxspecial[atom->map(glove[i][1])][0]) { + status = GUESSFAIL; + return; + } + } + } + for (int i = 0; i < onemol->natoms; i++) { for (int j = 0; j < onemol_nxspecial[i][0]; j++) { int ring_fail = 1; @@ -3175,6 +3188,12 @@ void FixBondReact::update_everything() int Tdelta_imprp; MPI_Allreduce(&delta_imprp,&Tdelta_imprp,1,MPI_INT,MPI_SUM,world); atom->nimpropers += Tdelta_imprp; + + if (ndel && (atom->map_style != Atom::MAP_NONE)) { + atom->nghost = 0; + atom->map_init(); + atom->map_set(); + } } /* ---------------------------------------------------------------------- From fdd7ecd9d9dcb911fcd019f618ec8482b77e9097 Mon Sep 17 00:00:00 2001 From: jrgissing Date: Wed, 11 Nov 2020 14:08:35 -0500 Subject: [PATCH 022/384] bond/react, create_atoms: correctly update molecule IDs --- src/USER-REACTION/fix_bond_react.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 9f0d1fd36d..1973c54539 100755 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -3363,7 +3363,13 @@ void FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) // locally update mega_glove my_mega_glove[preID][iupdate] = atom->tag[n]; - if (atom->molecule_flag) atom->molecule[n] = maxmol_all+1; + if (atom->molecule_flag) { + if (twomol->moleculeflag) { + atom->molecule[n] = maxmol_all + twomol->molecule[m]; + } else { + atom->molecule[n] = maxmol_all + 1; + } + } if (atom->molecular == 2) { atom->molindex[n] = 0; atom->molatom[n] = m; From b5c2dac6e6a620cc2a6596b94739d7f58f030803 Mon Sep 17 00:00:00 2001 From: jrgissing Date: Wed, 11 Nov 2020 20:55:47 -0500 Subject: [PATCH 023/384] bond/react, create_atoms: fix bug in parallel --- src/USER-REACTION/fix_bond_react.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 1973c54539..e1e326aa60 100755 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -3254,9 +3254,9 @@ void FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) int ifit = atom->map(my_mega_glove[ibonding[rxnID]+1][iupdate]); // use this local ID to find fitting proc Superpose3D superposer(n2superpose); - int root = 0; + int fitroot = 0; if (ifit >= 0 && ifit < atom->nlocal) { - root = me; + fitroot = me; // get 'temperatere' averaged over site, used for created atoms' vels t = get_temperature(my_mega_glove,1,iupdate); @@ -3294,15 +3294,14 @@ void FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) memory->destroy(xfrozen); memory->destroy(xmobile); } - MPI_Allreduce(MPI_IN_PLACE,&root,1,MPI_INT,MPI_SUM,world); - MPI_Bcast(&t,1,MPI_DOUBLE,root,world); + MPI_Allreduce(MPI_IN_PLACE,&fitroot,1,MPI_INT,MPI_SUM,world); + MPI_Bcast(&t,1,MPI_DOUBLE,fitroot,world); // check if new atoms are in my sub-box or above it if I am highest proc // if so, add atom to my list via create_atom() // initialize additional info about the atoms // set group mask to "all" plus fix group int preID; // new equivalences index - root = 0; int add_count = 0; for (int m = 0; m < twomol->natoms; m++) { if (create_atoms[m][rxnID] == 1) { @@ -3312,17 +3311,14 @@ void FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) // apply optimal rotation/translation for created atom coords // also map coords back into simulation box - root = 0; - if (ifit >= 0 && ifit < atom->nlocal) { - root = me; + if (fitroot == me) { MathExtra::matvec(rotmat,twomol->x[m],coord); for (int i = 0; i < 3; i++) coord[i] += superposer.T[i]; imageflag = ((imageint) IMGMAX << IMG2BITS) | ((imageint) IMGMAX << IMGBITS) | IMGMAX; domain->remap(coord,imageflag); } - MPI_Allreduce(MPI_IN_PLACE,&root,1,MPI_INT,MPI_SUM,world); - MPI_Bcast(coord,3,MPI_DOUBLE,root,world); + MPI_Bcast(coord,3,MPI_DOUBLE,fitroot,world); if (domain->triclinic) { domain->x2lamda(coord,lamda); @@ -3352,7 +3348,8 @@ void FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) newcoord[0] >= sublo[0] && newcoord[0] < subhi[0]) flag = 1; } } - root = 0; + + int root = 0; if (flag) { root = me; From 9d4ed1a2012bc5b5a9e77ba766f63d068f7ced1f Mon Sep 17 00:00:00 2001 From: jrgissing Date: Wed, 11 Nov 2020 21:47:04 -0500 Subject: [PATCH 024/384] bond/react, create_atoms: image flag fix --- src/USER-REACTION/fix_bond_react.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index e1e326aa60..a6878dbd20 100755 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -3204,11 +3204,12 @@ void FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) { // inserting atoms based off fix_deposit->pre_exchange int flag; - imageint imageflag; double coord[3],lamda[3],rotmat[3][3],vnew[3]; double *newcoord; double **v = atom->v; double t; + imageint imageflag = ((imageint) IMGMAX << IMG2BITS) | + ((imageint) IMGMAX << IMGBITS) | IMGMAX;; // clear ghost count and any ghost bonus data internal to AtomVec // same logic as beginning of Comm::exchange() @@ -3314,8 +3315,6 @@ void FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) if (fitroot == me) { MathExtra::matvec(rotmat,twomol->x[m],coord); for (int i = 0; i < 3; i++) coord[i] += superposer.T[i]; - imageflag = ((imageint) IMGMAX << IMG2BITS) | - ((imageint) IMGMAX << IMGBITS) | IMGMAX; domain->remap(coord,imageflag); } MPI_Bcast(coord,3,MPI_DOUBLE,fitroot,world); From bd19cf73eb66c2650ffa472a4843b6e05b339c2f Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Thu, 12 Nov 2020 12:01:59 -0500 Subject: [PATCH 025/384] bond/react, create_atoms: correct image flag fix --- src/USER-REACTION/fix_bond_react.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index a6878dbd20..366a67c210 100755 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -3204,12 +3204,11 @@ void FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) { // inserting atoms based off fix_deposit->pre_exchange int flag; + imageint imageflag; double coord[3],lamda[3],rotmat[3][3],vnew[3]; double *newcoord; double **v = atom->v; double t; - imageint imageflag = ((imageint) IMGMAX << IMG2BITS) | - ((imageint) IMGMAX << IMGBITS) | IMGMAX;; // clear ghost count and any ghost bonus data internal to AtomVec // same logic as beginning of Comm::exchange() @@ -3315,8 +3314,11 @@ void FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) if (fitroot == me) { MathExtra::matvec(rotmat,twomol->x[m],coord); for (int i = 0; i < 3; i++) coord[i] += superposer.T[i]; + imageflag = ((imageint) IMGMAX << IMG2BITS) | + ((imageint) IMGMAX << IMGBITS) | IMGMAX; domain->remap(coord,imageflag); } + MPI_Bcast(&imageflag,1,MPI_LMP_IMAGEINT,fitroot,world); MPI_Bcast(coord,3,MPI_DOUBLE,fitroot,world); if (domain->triclinic) { From fb00fc6646ca4a59d0b4e52450361db6421a2e6c Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Thu, 12 Nov 2020 12:21:05 -0500 Subject: [PATCH 026/384] correct image flags in example data file bond/react, create_atoms --- .../polystyrene_create_atoms/trimer.data | 97 +++++++++---------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/examples/USER/reaction/polystyrene_create_atoms/trimer.data b/examples/USER/reaction/polystyrene_create_atoms/trimer.data index 5a40205e16..8bd81f0600 100644 --- a/examples/USER/reaction/polystyrene_create_atoms/trimer.data +++ b/examples/USER/reaction/polystyrene_create_atoms/trimer.data @@ -386,54 +386,54 @@ AngleAngle Coeffs Atoms # full -44 1 2 3.5400000000000001e-02 6.1476397222913839e+01 8.2376490601205234e+01 6.0906939115836181e+01 0 -1 0 -45 1276 2 3.5400000000000001e-02 5.8398688202244472e+01 8.0172948526664996e+01 6.2115536813582672e+01 0 0 1 -46 1276 6 -6.9599999999999995e-02 5.9489073989392523e+01 8.0264057167571636e+01 6.1984002598976552e+01 0 0 1 -48 1276 2 3.5400000000000001e-02 5.9675170230342431e+01 8.0048052449390738e+01 6.0920159395372401e+01 0 0 1 -47 1276 2 1.2370000000000000e-01 5.9297455513100488e+01 8.3187777608476154e+01 5.9645157256520122e+01 0 0 1 -18 1 5 -1.8200000000000001e-02 6.2426251430535707e+01 8.2055473568260709e+01 6.2971661388612958e+01 0 -1 0 -19 1 6 -6.9599999999999995e-02 6.1399255844467369e+01 8.1794665295860213e+01 6.1821819828185660e+01 0 -1 0 -21 1 1 -1.2900000000000000e-01 6.4032918371445831e+01 8.0190179089286701e+01 6.3021564712316334e+01 0 -1 0 -22 1 1 2.6599999999999999e-02 6.3672975135915053e+01 8.1418558650051665e+01 6.2448012627881994e+01 0 -1 0 -23 1 2 3.5400000000000001e-02 6.1545198223694939e+01 8.0836309422842305e+01 6.1349823957467130e+01 0 -1 0 -27 1276 2 5.1600000000000000e-02 5.9809503696580933e+01 8.1831265916389881e+01 6.3253745193271065e+01 0 0 1 -28 1276 5 -1.8200000000000001e-02 5.9900307947967441e+01 8.1677453781363639e+01 6.2190757403657820e+01 0 0 1 -31 1276 2 1.2370000000000000e-01 5.8050043823867973e+01 8.2698312265456622e+01 6.3667111329534436e+01 0 0 1 -38 1 2 1.2370000000000000e-01 6.3754126973935612e+01 7.9931147303963002e+01 6.4022259163067275e+01 0 -1 0 -20 1 2 1.2370000000000000e-01 6.4070158368422781e+01 8.2950071388392274e+01 6.1042631212883315e+01 0 -1 0 -24 1 1 -1.2900000000000000e-01 6.4337973861569580e+01 8.1916618276489871e+01 6.1387866780102470e+01 0 -1 0 -37 1 2 1.4030000000000001e-01 6.5360115866618415e+01 7.8586112104863830e+01 6.3004997314380716e+01 0 -1 0 -39 1 1 -1.7340000000000000e-01 6.5018338085325610e+01 7.9478260591306125e+01 6.2440745569712817e+01 0 -1 0 -40 1 1 -1.1340000000000000e-01 6.5628759887796605e+01 7.9941156332165264e+01 6.1248476296558067e+01 0 -1 0 -41 1 1 -1.7340000000000000e-01 6.5247995680260402e+01 8.1172439250598345e+01 6.0753045571239831e+01 0 -1 0 -42 1 2 1.2880000000000000e-01 6.6569600059599281e+01 7.9514748976494360e+01 6.0810611807135601e+01 0 -1 0 -43 1 2 1.4030000000000001e-01 6.5780165393063371e+01 8.1570974991007958e+01 5.9850915261812396e+01 0 -1 0 -9 1276 2 1.2880000000000000e-01 5.5651795605743445e+01 8.5074472139235127e+01 6.1094480497979262e+01 0 0 1 -30 1276 2 1.4030000000000001e-01 5.6082982679196888e+01 8.3912863624076010e+01 6.3351889697403472e+01 0 0 1 -33 1276 1 -1.7340000000000000e-01 5.6718133911388506e+01 8.3758479063002000e+01 6.2493293749545209e+01 0 0 1 -34 1276 1 -1.1340000000000000e-01 5.6498352105218459e+01 8.4426576393179090e+01 6.1290147608586011e+01 0 0 1 -6 3822 1 -1.7340000000000000e-01 6.3308103537340351e+01 8.7713509787622499e+01 6.4643082313868433e+01 0 0 0 -7 3822 1 -1.2900000000000000e-01 6.3010291684764312e+01 8.6423650045069493e+01 6.4252844241495922e+01 0 0 0 -8 3822 2 1.2370000000000000e-01 6.2089199187020355e+01 8.6309198636296912e+01 6.3711263099850854e+01 0 0 0 -10 1276 2 1.4030000000000001e-01 5.7266131308654970e+01 8.4599328362003035e+01 5.9281511478144402e+01 0 0 1 -11 3822 2 3.5400000000000001e-02 6.1694306618059791e+01 8.3823470438280594e+01 6.3778953909925114e+01 0 0 0 -12 3822 5 -1.8200000000000001e-02 6.3814926998838651e+01 8.3900077798460728e+01 6.4108991789590448e+01 0 0 0 -13 3822 6 -6.9599999999999995e-02 6.2604540882379787e+01 8.3491998603381077e+01 6.3249610918984622e+01 0 0 0 -14 3822 2 1.2370000000000000e-01 6.5739253131027880e+01 8.4813736128157771e+01 6.5351692111169555e+01 0 0 0 -15 3822 1 -1.2900000000000000e-01 6.5071144269009466e+01 8.5646783550482454e+01 6.5086813218945636e+01 0 0 0 -16 3822 1 2.6599999999999999e-02 6.3957099792282079e+01 8.5375816595044753e+01 6.4385073943729708e+01 0 0 0 -17 1 2 5.1600000000000000e-02 6.2256484483973310e+01 8.1576962161157596e+01 6.3963984654065122e+01 0 -1 0 -26 3822 2 5.1600000000000000e-02 6.4196825763126355e+01 8.3291442832977836e+01 6.4907094488854057e+01 0 0 0 -29 1276 1 2.6599999999999999e-02 5.8784742332505303e+01 8.2766055380197670e+01 6.1667239692876961e+01 0 0 1 -32 1276 1 -1.2900000000000000e-01 5.7836199787435064e+01 8.3005060229118428e+01 6.2669788306756018e+01 0 0 1 -35 1276 1 -1.2900000000000000e-01 5.8572661840325132e+01 8.3404075689965083e+01 6.0443288532625175e+01 0 0 1 -36 1276 1 -1.7340000000000000e-01 5.7380616699226330e+01 8.4134680429976896e+01 6.0248710539932475e+01 0 0 1 -25 3822 2 3.5400000000000001e-02 6.2750675036816460e+01 8.3891633300878468e+01 6.2249429178485677e+01 0 0 0 -5 3822 2 1.4030000000000001e-01 6.2626160082050376e+01 8.8416565740835182e+01 6.4093918967496805e+01 0 0 0 -1 3822 2 1.2880000000000000e-01 6.4863557606529355e+01 8.9096029197548390e+01 6.5342927535537825e+01 0 0 0 -2 3822 1 -1.1340000000000000e-01 6.4627442641031166e+01 8.8047381925321190e+01 6.5138073202291650e+01 0 0 0 -3 3822 2 1.4030000000000001e-01 6.6470254992065406e+01 8.6991893750821745e+01 6.5857474890608984e+01 0 0 0 -4 3822 1 -1.7340000000000000e-01 6.5416488888088338e+01 8.6963894801200169e+01 6.5357641085394278e+01 0 0 0 +44 1 2 3.5400000000000001e-02 6.1476397222913839e+01 8.2376490601205234e+01 6.0906939115836181e+01 +45 1276 2 3.5400000000000001e-02 5.8398688202244472e+01 8.0172948526664996e+01 6.2115536813582672e+01 +46 1276 6 -6.9599999999999995e-02 5.9489073989392523e+01 8.0264057167571636e+01 6.1984002598976552e+01 +48 1276 2 3.5400000000000001e-02 5.9675170230342431e+01 8.0048052449390738e+01 6.0920159395372401e+01 +47 1276 2 1.2370000000000000e-01 5.9297455513100488e+01 8.3187777608476154e+01 5.9645157256520122e+01 +18 1 5 -1.8200000000000001e-02 6.2426251430535707e+01 8.2055473568260709e+01 6.2971661388612958e+01 +19 1 6 -6.9599999999999995e-02 6.1399255844467369e+01 8.1794665295860213e+01 6.1821819828185660e+01 +21 1 1 -1.2900000000000000e-01 6.4032918371445831e+01 8.0190179089286701e+01 6.3021564712316334e+01 +22 1 1 2.6599999999999999e-02 6.3672975135915053e+01 8.1418558650051665e+01 6.2448012627881994e+01 +23 1 2 3.5400000000000001e-02 6.1545198223694939e+01 8.0836309422842305e+01 6.1349823957467130e+01 +27 1276 2 5.1600000000000000e-02 5.9809503696580933e+01 8.1831265916389881e+01 6.3253745193271065e+01 +28 1276 5 -1.8200000000000001e-02 5.9900307947967441e+01 8.1677453781363639e+01 6.2190757403657820e+01 +31 1276 2 1.2370000000000000e-01 5.8050043823867973e+01 8.2698312265456622e+01 6.3667111329534436e+01 +38 1 2 1.2370000000000000e-01 6.3754126973935612e+01 7.9931147303963002e+01 6.4022259163067275e+01 +20 1 2 1.2370000000000000e-01 6.4070158368422781e+01 8.2950071388392274e+01 6.1042631212883315e+01 +24 1 1 -1.2900000000000000e-01 6.4337973861569580e+01 8.1916618276489871e+01 6.1387866780102470e+01 +37 1 2 1.4030000000000001e-01 6.5360115866618415e+01 7.8586112104863830e+01 6.3004997314380716e+01 +39 1 1 -1.7340000000000000e-01 6.5018338085325610e+01 7.9478260591306125e+01 6.2440745569712817e+01 +40 1 1 -1.1340000000000000e-01 6.5628759887796605e+01 7.9941156332165264e+01 6.1248476296558067e+01 +41 1 1 -1.7340000000000000e-01 6.5247995680260402e+01 8.1172439250598345e+01 6.0753045571239831e+01 +42 1 2 1.2880000000000000e-01 6.6569600059599281e+01 7.9514748976494360e+01 6.0810611807135601e+01 +43 1 2 1.4030000000000001e-01 6.5780165393063371e+01 8.1570974991007958e+01 5.9850915261812396e+01 +9 1276 2 1.2880000000000000e-01 5.5651795605743445e+01 8.5074472139235127e+01 6.1094480497979262e+01 +30 1276 2 1.4030000000000001e-01 5.6082982679196888e+01 8.3912863624076010e+01 6.3351889697403472e+01 +33 1276 1 -1.7340000000000000e-01 5.6718133911388506e+01 8.3758479063002000e+01 6.2493293749545209e+01 +34 1276 1 -1.1340000000000000e-01 5.6498352105218459e+01 8.4426576393179090e+01 6.1290147608586011e+01 +6 3822 1 -1.7340000000000000e-01 6.3308103537340351e+01 8.7713509787622499e+01 6.4643082313868433e+01 +7 3822 1 -1.2900000000000000e-01 6.3010291684764312e+01 8.6423650045069493e+01 6.4252844241495922e+01 +8 3822 2 1.2370000000000000e-01 6.2089199187020355e+01 8.6309198636296912e+01 6.3711263099850854e+01 +10 1276 2 1.4030000000000001e-01 5.7266131308654970e+01 8.4599328362003035e+01 5.9281511478144402e+01 +11 3822 2 3.5400000000000001e-02 6.1694306618059791e+01 8.3823470438280594e+01 6.3778953909925114e+01 +12 3822 5 -1.8200000000000001e-02 6.3814926998838651e+01 8.3900077798460728e+01 6.4108991789590448e+01 +13 3822 6 -6.9599999999999995e-02 6.2604540882379787e+01 8.3491998603381077e+01 6.3249610918984622e+01 +14 3822 2 1.2370000000000000e-01 6.5739253131027880e+01 8.4813736128157771e+01 6.5351692111169555e+01 +15 3822 1 -1.2900000000000000e-01 6.5071144269009466e+01 8.5646783550482454e+01 6.5086813218945636e+01 +16 3822 1 2.6599999999999999e-02 6.3957099792282079e+01 8.5375816595044753e+01 6.4385073943729708e+01 +17 1 2 5.1600000000000000e-02 6.2256484483973310e+01 8.1576962161157596e+01 6.3963984654065122e+01 +26 3822 2 5.1600000000000000e-02 6.4196825763126355e+01 8.3291442832977836e+01 6.4907094488854057e+01 +29 1276 1 2.6599999999999999e-02 5.8784742332505303e+01 8.2766055380197670e+01 6.1667239692876961e+01 +32 1276 1 -1.2900000000000000e-01 5.7836199787435064e+01 8.3005060229118428e+01 6.2669788306756018e+01 +35 1276 1 -1.2900000000000000e-01 5.8572661840325132e+01 8.3404075689965083e+01 6.0443288532625175e+01 +36 1276 1 -1.7340000000000000e-01 5.7380616699226330e+01 8.4134680429976896e+01 6.0248710539932475e+01 +25 3822 2 3.5400000000000001e-02 6.2750675036816460e+01 8.3891633300878468e+01 6.2249429178485677e+01 +5 3822 2 1.4030000000000001e-01 6.2626160082050376e+01 8.8416565740835182e+01 6.4093918967496805e+01 +1 3822 2 1.2880000000000000e-01 6.4863557606529355e+01 8.9096029197548390e+01 6.5342927535537825e+01 +2 3822 1 -1.1340000000000000e-01 6.4627442641031166e+01 8.8047381925321190e+01 6.5138073202291650e+01 +3 3822 2 1.4030000000000001e-01 6.6470254992065406e+01 8.6991893750821745e+01 6.5857474890608984e+01 +4 3822 1 -1.7340000000000000e-01 6.5416488888088338e+01 8.6963894801200169e+01 6.5357641085394278e+01 Velocities @@ -794,4 +794,3 @@ Impropers 34 1 35 36 34 10 35 1 6 2 4 1 36 1 15 4 2 3 - From a3ce72c1b2bcfe45d422c7d73e688ff48423cc5f Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Thu, 12 Nov 2020 23:07:36 -0500 Subject: [PATCH 027/384] actually correct image flag fix hopefully --- src/USER-REACTION/fix_bond_react.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 366a67c210..2bc4335b20 100755 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -3314,8 +3314,7 @@ void FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) if (fitroot == me) { MathExtra::matvec(rotmat,twomol->x[m],coord); for (int i = 0; i < 3; i++) coord[i] += superposer.T[i]; - imageflag = ((imageint) IMGMAX << IMG2BITS) | - ((imageint) IMGMAX << IMGBITS) | IMGMAX; + imageflag = atom->image[ifit]; domain->remap(coord,imageflag); } MPI_Bcast(&imageflag,1,MPI_LMP_IMAGEINT,fitroot,world); From bb52af9a0772bdf41e5b795fb62667afab3e757e Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Fri, 13 Nov 2020 00:51:48 -0500 Subject: [PATCH 028/384] revert cutoff check temporary fix for hybrid pair style --- src/USER-REACTION/fix_bond_react.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 2bc4335b20..200988c44c 100755 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -485,14 +485,6 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : } } - for (int i = 0; i < nreacts; i++) { - if (closeneigh[i] == -1) { // indicates will search non-bonded neighbors - if (cutsq[i][1] > neighbor->cutneighsq[iatomtype[i]][jatomtype[i]]) { - error->all(FLERR,"Bond/react: Fix bond/react cutoff is longer than pairwise cutoff"); - } - } - } - // initialize Marsaglia RNG with processor-unique seed ('prob' keyword) random = new class RanMars*[nreacts]; @@ -787,6 +779,13 @@ void FixBondReact::init() if (strstr(update->integrate_style,"respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; + // check cutoff for iatomtype,jatomtype + for (int i = 0; i < nreacts; i++) { + if (!utils::strmatch(force->pair_style,"^hybrid")) + if (force->pair == nullptr || cutsq[i][1] > force->pair->cutsq[iatomtype[i]][jatomtype[i]]) + error->all(FLERR,"Bond/react: Fix bond/react cutoff is longer than pairwise cutoff"); + } + // need a half neighbor list, built every Nevery steps int irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->pair = 0; From 21e495d5ec486bb7bb0a8e2b028739399c698258 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Tue, 17 Nov 2020 14:47:50 -0500 Subject: [PATCH 029/384] bond/react: update modify_create syntax now, allows for multiple sub-keywords --- src/USER-REACTION/fix_bond_react.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 200988c44c..d50f876b16 100755 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -385,15 +385,25 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : } iarg += 2; } else if (strcmp(arg[iarg],"modify_create") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: " + if (iarg++ > narg) error->all(FLERR,"Illegal fix bond/react command: " "'modify_create' has too few arguments"); - if (strcmp(arg[iarg+1],"no") == 0) modify_create_fragid[rxn] = -1; //default - else { - modify_create_fragid[rxn] = atom->molecules[reacted_mol[rxn]]->findfragment(arg[iarg+1]); - if (modify_create_fragid[rxn] < 0) error->one(FLERR,"Bond/react: Molecule fragment for " - "'modify_create' keyword does not exist"); + while (iarg < narg && strcmp(arg[iarg],"react") != 0 ) { + if (strcmp(arg[iarg],"fit") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: " + "'modify_create' has too few arguments"); + if (strcmp(arg[iarg+1],"all") == 0) modify_create_fragid[rxn] = -1; //default + else { + modify_create_fragid[rxn] = atom->molecules[reacted_mol[rxn]]->findfragment(arg[iarg+1]); + if (modify_create_fragid[rxn] < 0) error->one(FLERR,"Bond/react: Molecule fragment for " + "'modify_create' keyword does not exist"); + } + iarg += 2; + } else if (strcmp(arg[iarg],"near") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: " + "'modify_create' has too few arguments"); + iarg += 2; + } else break; } - iarg += 2; } else error->all(FLERR,"Illegal fix bond/react command: unknown keyword"); } } From 400812c4f10dbbd0370f8f2ee912e59fd4c3bb59 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Tue, 17 Nov 2020 21:06:47 -0500 Subject: [PATCH 030/384] refactor where/when atoms are insert, set up for near keyword --- src/USER-REACTION/fix_bond_react.cpp | 39 +++++++++++++++------------- src/USER-REACTION/fix_bond_react.h | 3 ++- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index d50f876b16..af48ec39ec 100755 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -207,6 +207,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : memory->create(custom_charges_fragid,nreacts,"bond/react:custom_charges_fragid"); memory->create(create_atoms_flag,nreacts,"bond/react:create_atoms_flag"); memory->create(modify_create_fragid,nreacts,"bond/react:modify_create_fragid"); + memory->create(nearsq,nreacts,"bond/react:nearsq"); memory->create(constraints,1,MAXCONARGS,"bond/react:constraints"); memory->create(var_flag,NUMVARVALS,nreacts,"bond/react:var_flag"); memory->create(var_id,NUMVARVALS,nreacts,"bond/react:var_id"); @@ -229,6 +230,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : custom_charges_fragid[i] = -1; create_atoms_flag[i] = 0; modify_create_fragid[i] = -1; + nearsq[i] = 0; // set default limit duration to 60 timesteps limit_duration[i] = 60; reaction_count[i] = 0; @@ -401,6 +403,8 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"near") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: " "'modify_create' has too few arguments"); + nearsq[rxn] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + nearsq[rxn] *= nearsq[rxn]; iarg += 2; } else break; } @@ -587,6 +591,7 @@ FixBondReact::~FixBondReact() memory->destroy(custom_charges_fragid); memory->destroy(create_atoms_flag); memory->destroy(modify_create_fragid); + memory->destroy(nearsq); memory->destroy(iatomtype); memory->destroy(jatomtype); @@ -2645,9 +2650,8 @@ update molecule IDs, charges, types, special lists and all topology void FixBondReact::update_everything() { + int nlocal; // must be defined after create_atoms int *type = atom->type; - - int nlocal = atom->nlocal; int **nspecial = atom->nspecial; tagint **special = atom->special; @@ -2696,6 +2700,17 @@ void FixBondReact::update_everything() rxnID = global_mega_glove[0][i]; // reactions already shuffled from dedup procedure, so can skip first N if (iskip[rxnID]++ < nghostlyskips[rxnID]) continue; + + // we can insert atoms here, now that reactions are finalized + // can't do it any earlier, due to skipped reactions (max_rxn) + // reactions that create atoms are always treated as 'global' + if (create_atoms_flag[rxnID] == 1) { + onemol = atom->molecules[unreacted_mol[rxnID]]; + twomol = atom->molecules[reacted_mol[rxnID]]; + if (insert_atoms(global_mega_glove,i)) + ; else continue; // create aborted + } + for (int j = 0; j < max_natoms+1; j++) update_mega_glove[j][update_num_mega] = global_mega_glove[j][i]; update_num_mega++; @@ -2703,22 +2718,8 @@ void FixBondReact::update_everything() } delete [] iskip; - // we can insert atoms here, now that reactions are finalized - // can't do it any earlier, due to skipped reactions (max_rxn) - // reactions that create atoms are always treated as 'global' - if (pass == 1) { - for (int i = 0; i < update_num_mega; i++) { - rxnID = update_mega_glove[0][i]; - if (create_atoms_flag[rxnID] == 1) { - onemol = atom->molecules[unreacted_mol[rxnID]]; - twomol = atom->molecules[reacted_mol[rxnID]]; - insert_atoms(update_mega_glove,i); - nlocal = atom->nlocal; - } - } - } - // mark to-delete atoms + nlocal = atom->nlocal; mark = new int[nlocal]; for (int i = 0; i < nlocal; i++) mark[i] = 0; for (int i = 0; i < update_num_mega; i++) { @@ -3209,7 +3210,7 @@ void FixBondReact::update_everything() insert created atoms ------------------------------------------------------------------------- */ -void FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) +int FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) { // inserting atoms based off fix_deposit->pre_exchange int flag; @@ -3440,6 +3441,8 @@ void FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) atom->map_init(); atom->map_set(); } + + return 1; } /* ---------------------------------------------------------------------- diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h index d8ff4154e3..92927b853c 100755 --- a/src/USER-REACTION/fix_bond_react.h +++ b/src/USER-REACTION/fix_bond_react.h @@ -67,6 +67,7 @@ class FixBondReact : public Fix { int *custom_charges_fragid; int *create_atoms_flag; int *modify_create_fragid; + double *nearsq; int nconstraints; int narrhenius; double **constraints; @@ -185,7 +186,7 @@ class FixBondReact : public Fix { void glove_ghostcheck(); void ghost_glovecast(); void update_everything(); - void insert_atoms(tagint **, int); + int insert_atoms(tagint **, int); void unlimit_bond(); void limit_bond(int); void dedup_mega_gloves(int); //dedup global mega_glove From c4bf7766fe52b6a487c458214615aab0ea9697ff Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Tue, 17 Nov 2020 21:37:00 -0500 Subject: [PATCH 031/384] refactor insert_atoms --- src/USER-REACTION/fix_bond_react.cpp | 31 ++++++++++++++++------------ 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index af48ec39ec..2d3fa8b8d8 100755 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -3214,12 +3214,15 @@ int FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) { // inserting atoms based off fix_deposit->pre_exchange int flag; - imageint imageflag; - double coord[3],lamda[3],rotmat[3][3],vnew[3]; + imageint *imageflags; + double **coords,lamda[3],rotmat[3][3],vnew[3]; double *newcoord; double **v = atom->v; double t; + memory->create(coords,twomol->natoms,3,"bond/react:coords"); + memory->create(imageflags,twomol->natoms,"bond/react:imageflags"); + // clear ghost count and any ghost bonus data internal to AtomVec // same logic as beginning of Comm::exchange() // do it now b/c inserting atoms will overwrite ghost atoms @@ -3322,18 +3325,18 @@ int FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) // apply optimal rotation/translation for created atom coords // also map coords back into simulation box if (fitroot == me) { - MathExtra::matvec(rotmat,twomol->x[m],coord); - for (int i = 0; i < 3; i++) coord[i] += superposer.T[i]; - imageflag = atom->image[ifit]; - domain->remap(coord,imageflag); + MathExtra::matvec(rotmat,twomol->x[m],coords[m]); + for (int i = 0; i < 3; i++) coords[m][i] += superposer.T[i]; + imageflags[m] = atom->image[ifit]; + domain->remap(coords[m],imageflags[m]); } - MPI_Bcast(&imageflag,1,MPI_LMP_IMAGEINT,fitroot,world); - MPI_Bcast(coord,3,MPI_DOUBLE,fitroot,world); + MPI_Bcast(&imageflags[m],1,MPI_LMP_IMAGEINT,fitroot,world); + MPI_Bcast(coords[m],3,MPI_DOUBLE,fitroot,world); if (domain->triclinic) { - domain->x2lamda(coord,lamda); + domain->x2lamda(coords[m],lamda); newcoord = lamda; - } else newcoord = coord; + } else newcoord = coords[m]; flag = 0; if (newcoord[0] >= sublo[0] && newcoord[0] < subhi[0] && @@ -3363,7 +3366,7 @@ int FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) if (flag) { root = me; - atom->avec->create_atom(twomol->type[m],coord); + atom->avec->create_atom(twomol->type[m],coords[m]); int n = atom->nlocal - 1; atom->tag[n] = maxtag_all + add_count; @@ -3383,7 +3386,7 @@ int FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) } atom->mask[n] = 1 | groupbit; - atom->image[n] = imageflag; + atom->image[n] = imageflags[m]; // guess a somewhat reasonable initial velocity based on reaction site // further control is possible using bond_react_MASTER_group @@ -3441,7 +3444,9 @@ int FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) atom->map_init(); atom->map_set(); } - + // atom creation successful + memory->destroy(coords); + memory->destroy(imageflags); return 1; } From 1931cfa56ad2129e85996f25377decad0e463738 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Tue, 17 Nov 2020 22:18:08 -0500 Subject: [PATCH 032/384] add 'near' keyword --- src/USER-REACTION/fix_bond_react.cpp | 62 ++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 13 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 2d3fa8b8d8..dd8883fabc 100755 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -2708,7 +2708,10 @@ void FixBondReact::update_everything() onemol = atom->molecules[unreacted_mol[rxnID]]; twomol = atom->molecules[reacted_mol[rxnID]]; if (insert_atoms(global_mega_glove,i)) - ; else continue; // create aborted + ; else { // create aborted + reaction_count_total[rxnID]--; + continue; + } } for (int j = 0; j < max_natoms+1; j++) @@ -3218,7 +3221,7 @@ int FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) double **coords,lamda[3],rotmat[3][3],vnew[3]; double *newcoord; double **v = atom->v; - double t; + double t,delx,dely,delz,rsq; memory->create(coords,twomol->natoms,3,"bond/react:coords"); memory->create(imageflags,twomol->natoms,"bond/react:imageflags"); @@ -3310,6 +3313,50 @@ int FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) MPI_Allreduce(MPI_IN_PLACE,&fitroot,1,MPI_INT,MPI_SUM,world); MPI_Bcast(&t,1,MPI_DOUBLE,fitroot,world); + // get coordinates and image flags + for (int m = 0; m < twomol->natoms; m++) { + if (create_atoms[m][rxnID] == 1) { + // apply optimal rotation/translation for created atom coords + // also map coords back into simulation box + if (fitroot == me) { + MathExtra::matvec(rotmat,twomol->x[m],coords[m]); + for (int i = 0; i < 3; i++) coords[m][i] += superposer.T[i]; + imageflags[m] = atom->image[ifit]; + domain->remap(coords[m],imageflags[m]); + } + MPI_Bcast(&imageflags[m],1,MPI_LMP_IMAGEINT,fitroot,world); + MPI_Bcast(coords[m],3,MPI_DOUBLE,fitroot,world); + } + } + + // check distance between any existing atom and inserted atom + // if less than near, abort + if (nearsq[rxnID] > 0) { + int abortflag = 0; + for (int m = 0; m < twomol->natoms; m++) { + if (create_atoms[m][rxnID] == 1) { + for (int i = 0; i < nlocal; i++) { + delx = coords[m][0] - x[i][0]; + dely = coords[m][1] - x[i][1]; + delz = coords[m][2] - x[i][2]; + domain->minimum_image(delx,dely,delz); + rsq = delx*delx + dely*dely + delz*delz; + if (rsq < nearsq[rxnID]) { + abortflag = 1; + break; + } + } + if (abortflag) break; + } + } + MPI_Allreduce(MPI_IN_PLACE,&abortflag,1,MPI_INT,MPI_MAX,world); + if (abortflag) { + memory->destroy(coords); + memory->destroy(imageflags); + return 0; + } + } + // check if new atoms are in my sub-box or above it if I am highest proc // if so, add atom to my list via create_atom() // initialize additional info about the atoms @@ -3322,17 +3369,6 @@ int FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) add_count++; preID = onemol->natoms+add_count; - // apply optimal rotation/translation for created atom coords - // also map coords back into simulation box - if (fitroot == me) { - MathExtra::matvec(rotmat,twomol->x[m],coords[m]); - for (int i = 0; i < 3; i++) coords[m][i] += superposer.T[i]; - imageflags[m] = atom->image[ifit]; - domain->remap(coords[m],imageflags[m]); - } - MPI_Bcast(&imageflags[m],1,MPI_LMP_IMAGEINT,fitroot,world); - MPI_Bcast(coords[m],3,MPI_DOUBLE,fitroot,world); - if (domain->triclinic) { domain->x2lamda(coords[m],lamda); newcoord = lamda; From 337d47ca6cc433cfef26c543865d6accb11343cf Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Tue, 17 Nov 2020 22:46:42 -0500 Subject: [PATCH 033/384] update docs --- doc/src/fix_bond_react.rst | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/doc/src/fix_bond_react.rst b/doc/src/fix_bond_react.rst index cd40828e7d..34d2282312 100755 --- a/doc/src/fix_bond_react.rst +++ b/doc/src/fix_bond_react.rst @@ -41,7 +41,7 @@ Syntax * template-ID(post-reacted) = ID of a molecule template containing post-reaction topology * map_file = name of file specifying corresponding atom-IDs in the pre- and post-reacted templates * zero or more individual keyword/value pairs may be appended to each react argument -* individual_keyword = *prob* or *max_rxn* or *stabilize_steps* or *custom_charges* +* individual_keyword = *prob* or *max_rxn* or *stabilize_steps* or *custom_charges* or *modify_create* .. parsed-literal:: @@ -55,9 +55,12 @@ Syntax *custom_charges* value = *no* or *fragmentID* no = update all atomic charges (default) fragmentID = ID of molecule fragment whose charges are updated - *modify_create* value = *no* or *fragmentID* - no = use all eligible atoms for create-atoms fit (default) - fragmentID = ID of molecule fragment used for create-atoms fit + *modify_create* keyword values + *fit* value = *all* or *fragmentID* + all = use all eligible atoms for create-atoms fit (default) + fragmentID = ID of molecule fragment used for create-atoms fit + *near* value = R + R = only insert atom/molecule if further than R from existing particles (distance units) Examples """""""" @@ -362,13 +365,23 @@ pre-reaction template. The inserted positions of created atoms are determined by the coordinates of the post-reaction template, after optimal translation and rotation of the post-reaction template to the reaction site (using a fit with atoms that are neither created nor -deleted). Or, the *modify_create* keyword can be used to specify which -post-reaction atoms are used for this fit. The *fragmentID* value must -be the name of a molecule fragment defined in the post-reaction -:doc:`molecule ` template, and only atoms in this fragment -are used for the fit. The velocity of each created atom is initialized -in a random direction with a magnitude calculated from the -instantaneous temperature of the reaction site. +deleted). The *modify_create* keyword can be used to modify the +default behavior when creating atoms. The *modify_create* keyword has +two sub-keywords, *fit* and *near*. One or more of the sub-keywords +may be used after the *modify_create* keyword. The *fit* sub-keyword +can be used to specify which post-reaction atoms are used for the +optimal translation and rotation of the post-reaction template. The +*fragmentID* value of the *fit* sub-keyword must be the name of a +molecule fragment defined in the post-reaction :doc:`molecule +` template, and only atoms in this fragment are used for the +fit. Atoms are created only if no current atom in the simulation is +within a distance R of any created atom, including the effect of +periodic boundary conditions if applicable. R is defined by the *near* +sub-keyword. Note that the default value for R is 0.0, which will +allow atoms to strongly overlap if you are inserting where other atoms +are present. The velocity of each created atom is initialized in a +random direction with a magnitude calculated from the instantaneous +temperature of the reaction site. The handedness of atoms that are chiral centers can be enforced by listing their IDs in the ChiralIDs section. A chiral atom must be From aa683eca594f15b7ce59b278b58f4a55fb072430 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Wed, 18 Nov 2020 11:47:28 -0500 Subject: [PATCH 034/384] bond/react, create_atom: bugfix when create is aborted --- src/USER-REACTION/fix_bond_react.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index dd8883fabc..85c265309e 100755 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -3226,12 +3226,6 @@ int FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) memory->create(coords,twomol->natoms,3,"bond/react:coords"); memory->create(imageflags,twomol->natoms,"bond/react:imageflags"); - // clear ghost count and any ghost bonus data internal to AtomVec - // same logic as beginning of Comm::exchange() - // do it now b/c inserting atoms will overwrite ghost atoms - atom->nghost = 0; - atom->avec->clear_bonus(); - double *sublo,*subhi; if (domain->triclinic == 0) { sublo = domain->sublo; @@ -3357,6 +3351,12 @@ int FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) } } + // clear ghost count and any ghost bonus data internal to AtomVec + // same logic as beginning of Comm::exchange() + // do it now b/c inserting atoms will overwrite ghost atoms + atom->nghost = 0; + atom->avec->clear_bonus(); + // check if new atoms are in my sub-box or above it if I am highest proc // if so, add atom to my list via create_atom() // initialize additional info about the atoms From 9b7831dc4f71b37076109d37e1117c1c9ef4ad36 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Wed, 18 Nov 2020 11:59:13 -0500 Subject: [PATCH 035/384] rename example folder --- .../8procs_out.lammps | 0 .../chain_plus_styrene_map_create_atoms | 0 .../chain_plus_styrene_reacted.data_template | 0 .../chain_plus_styrene_unreacted_create_atoms.data_template | 0 .../infromdata.class2 | 0 .../trimer.data | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename examples/USER/reaction/{polystyrene_create_atoms => create_atoms_polystyrene}/8procs_out.lammps (100%) rename examples/USER/reaction/{polystyrene_create_atoms => create_atoms_polystyrene}/chain_plus_styrene_map_create_atoms (100%) rename examples/USER/reaction/{polystyrene_create_atoms => create_atoms_polystyrene}/chain_plus_styrene_reacted.data_template (100%) rename examples/USER/reaction/{polystyrene_create_atoms => create_atoms_polystyrene}/chain_plus_styrene_unreacted_create_atoms.data_template (100%) rename examples/USER/reaction/{polystyrene_create_atoms => create_atoms_polystyrene}/infromdata.class2 (100%) rename examples/USER/reaction/{polystyrene_create_atoms => create_atoms_polystyrene}/trimer.data (100%) diff --git a/examples/USER/reaction/polystyrene_create_atoms/8procs_out.lammps b/examples/USER/reaction/create_atoms_polystyrene/8procs_out.lammps similarity index 100% rename from examples/USER/reaction/polystyrene_create_atoms/8procs_out.lammps rename to examples/USER/reaction/create_atoms_polystyrene/8procs_out.lammps diff --git a/examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_map_create_atoms b/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_map_create_atoms similarity index 100% rename from examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_map_create_atoms rename to examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_map_create_atoms diff --git a/examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_reacted.data_template b/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_reacted.data_template similarity index 100% rename from examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_reacted.data_template rename to examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_reacted.data_template diff --git a/examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_unreacted_create_atoms.data_template b/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_unreacted_create_atoms.data_template similarity index 100% rename from examples/USER/reaction/polystyrene_create_atoms/chain_plus_styrene_unreacted_create_atoms.data_template rename to examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_unreacted_create_atoms.data_template diff --git a/examples/USER/reaction/polystyrene_create_atoms/infromdata.class2 b/examples/USER/reaction/create_atoms_polystyrene/infromdata.class2 similarity index 100% rename from examples/USER/reaction/polystyrene_create_atoms/infromdata.class2 rename to examples/USER/reaction/create_atoms_polystyrene/infromdata.class2 diff --git a/examples/USER/reaction/polystyrene_create_atoms/trimer.data b/examples/USER/reaction/create_atoms_polystyrene/trimer.data similarity index 100% rename from examples/USER/reaction/polystyrene_create_atoms/trimer.data rename to examples/USER/reaction/create_atoms_polystyrene/trimer.data From 95c267c21bad16c0b58714b55c5f4966f71e9b91 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Wed, 18 Nov 2020 12:02:19 -0500 Subject: [PATCH 036/384] update example with new syntax --- .../USER/reaction/create_atoms_polystyrene/infromdata.class2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/USER/reaction/create_atoms_polystyrene/infromdata.class2 b/examples/USER/reaction/create_atoms_polystyrene/infromdata.class2 index 3affb24904..b6e63d5365 100755 --- a/examples/USER/reaction/create_atoms_polystyrene/infromdata.class2 +++ b/examples/USER/reaction/create_atoms_polystyrene/infromdata.class2 @@ -32,7 +32,7 @@ molecule mol4 chain_plus_styrene_reacted.data_template fix rxn1 all bond/react stabilization yes statted_grp .03 & react rxn2 all 1 0 3.0 mol3 mol4 chain_plus_styrene_map_create_atoms & - modify_create create_fit stabilize_steps 100 max_rxn 50 + modify_create fit create_fit near 2.0 stabilize_steps 100 max_rxn 50 fix 1 statted_grp_REACT nvt temp $T $T 100 #iso 1 1 1000 From 0927e52dea30dbe7feea35954380aec294bd2f2e Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Wed, 18 Nov 2020 16:18:34 -0500 Subject: [PATCH 037/384] cleanup dead code --- src/USER-REACTION/fix_bond_react.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 85c265309e..08542b518e 100755 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -3416,11 +3416,7 @@ int FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) atom->molecule[n] = maxmol_all + 1; } } - if (atom->molecular == 2) { - atom->molindex[n] = 0; - atom->molatom[n] = m; - } - + atom->mask[n] = 1 | groupbit; atom->image[n] = imageflags[m]; From 4912cde2ae802f96f101f7f90f6bcf8b3d7fd90e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 27 Dec 2020 12:14:12 -0500 Subject: [PATCH 038/384] initial attempt to refactor the citation logging in LAMMPS this implements the basic features and flow of control. to be done are the specific texts and the documentation. --- src/citeme.cpp | 89 +++++++++++++++++++++++++++++++++++------------ src/citeme.h | 17 +++++---- src/integrate.cpp | 9 +++-- src/lammps.cpp | 37 ++++++++++++++++++-- src/lammps.h | 5 ++- src/minimize.cpp | 2 ++ 6 files changed, 122 insertions(+), 37 deletions(-) diff --git a/src/citeme.cpp b/src/citeme.cpp index 4b1b627298..5082f058b5 100644 --- a/src/citeme.cpp +++ b/src/citeme.cpp @@ -12,6 +12,7 @@ ------------------------------------------------------------------------- */ #include "citeme.h" +#include "comm.h" #include "universe.h" using namespace LAMMPS_NS; @@ -21,55 +22,99 @@ static const char cite_header[] = "following references. See https://lammps.sandia.gov/cite.html\n" "for details.\n\n"; -static const char cite_nagline[] = "\nPlease see the log.cite file " +static const char cite_nagline[] = "Please see the log.cite file " "for references relevant to this simulation\n\n"; +static const char cite_seefile[] = "Please see the citation file " + "for references relevant to this simulation\n\n"; + +static const char cite_separator[] = + "\nCITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE\n\n"; + /* ---------------------------------------------------------------------- */ -CiteMe::CiteMe(LAMMPS *lmp) : Pointers(lmp) +CiteMe::CiteMe(LAMMPS *lmp, int _screen, int _logfile, const char *_file) + : Pointers(lmp) { fp = nullptr; cs = new citeset(); + + screen_flag = _screen; + scrbuffer.clear(); + + logfile_flag = _logfile; + logbuffer.clear(); + + if (_file && universe->me == 0) { + fp = fopen(_file,"w"); + if (fp) { + fputs(cite_header,fp); + fflush(fp); + } else { + utils::logmesg(lmp, "Unable to open citation file '" + std::string(_file) + + "': " + utils::getsyserror() + "\n"); + } + } } /* ---------------------------------------------------------------------- - write out nag-line at the end of the regular output and clean up + write out remaining citations at end of the regular output and clean up ------------------------------------------------------------------------- */ CiteMe::~CiteMe() { - if (universe->me || cs->size() == 0) { - delete cs; - return; - } - + flush(); delete cs; - if (fp) { - if (screen) fprintf(screen,cite_nagline); - if (logfile) fprintf(logfile,cite_nagline); - - fclose(fp); - } + if (fp) fclose(fp); } /* ---------------------------------------------------------------------- - write out and register a citation so it will be written only once + process an added citation so it will be shown only once and as requested ------------------------------------------------------------------------- */ void CiteMe::add(const char *ref) { - if (universe->me) return; + if (comm->me != 0) return; if (cs->find(ref) != cs->end()) return; cs->insert(ref); - if (!fp) { - fp = fopen("log.cite","w"); - if (!fp) return; - fputs(cite_header,fp); + if (fp) { + fputs(ref,fp); fflush(fp); } - fputs(ref,fp); - fflush(fp); + if (scrbuffer.empty()) { + scrbuffer += cite_separator; + if (screen_flag == VERBOSE) scrbuffer += cite_header; + if (screen_flag == TERSE) scrbuffer += cite_nagline; + } + + if (logbuffer.empty()) { + logbuffer += cite_separator; + if (logfile_flag == VERBOSE) logbuffer += cite_header; + if (logfile_flag == TERSE) logbuffer += cite_nagline; + } + + std::string reference = ref; + std::size_t found = reference.find_first_of("\n"); + std::string header = reference.substr(0,found+1); + if (screen_flag == VERBOSE) scrbuffer += reference; + if (screen_flag == TERSE) scrbuffer += header; + if (logfile_flag == VERBOSE) logbuffer += reference; + if (logfile_flag == TERSE) logbuffer += header; } + +void CiteMe::flush() +{ + if (comm->me == 0) { + scrbuffer += cite_separator; + logbuffer += cite_separator; + if (screen) fputs(scrbuffer.c_str(),screen); + if (logfile) fputs(logbuffer.c_str(),logfile); + scrbuffer.clear(); + logbuffer.clear(); + } + return; +} + diff --git a/src/citeme.h b/src/citeme.h index c383ec2227..9a3d30e8e8 100644 --- a/src/citeme.h +++ b/src/citeme.h @@ -21,27 +21,32 @@ namespace LAMMPS_NS { class CiteMe : protected Pointers { public: - CiteMe(class LAMMPS *); + CiteMe(class LAMMPS *, int, int, const char *); virtual ~CiteMe(); - void add(const char *); // print out and register publication + void add(const char *); // register publication for output + void flush(); // flush buffers to screen and logfile + enum {VERBOSE, TERSE}; private: - FILE *fp; // opaque pointer to log.cite file object + FILE *fp; // explicit citation file pointer or NULL + int screen_flag; // determine whether verbose or terse output + int logfile_flag; // determine whether verbose or terse output + std::string scrbuffer; // output buffer for screen + std::string logbuffer; // output buffer for logfile typedef std::set citeset; citeset *cs; // registered set of publications }; - } #endif /* ERROR/WARNING messages: -E: Cannot open log.cite file +E: Cannot open citation file This file is created when you use some LAMMPS features, to indicate what paper you should cite on behalf of those who implemented -the feature. Check that you have write privileges into the directory +the feature. Check that you have write privileges in the directory you are running in. */ diff --git a/src/integrate.cpp b/src/integrate.cpp index 5c700527a1..f866840f1c 100644 --- a/src/integrate.cpp +++ b/src/integrate.cpp @@ -12,12 +12,14 @@ ------------------------------------------------------------------------- */ #include "integrate.h" -#include "update.h" + +#include "citeme.h" +#include "compute.h" #include "force.h" -#include "pair.h" #include "kspace.h" #include "modify.h" -#include "compute.h" +#include "pair.h" +#include "update.h" using namespace LAMMPS_NS; @@ -45,6 +47,7 @@ Integrate::~Integrate() void Integrate::init() { + if (lmp->citeme) lmp->citeme->flush(); update->atimestep = update->ntimestep; // allow pair and Kspace compute() to be turned off via modify flags diff --git a/src/lammps.cpp b/src/lammps.cpp index 69baec5557..b882c76032 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -171,6 +171,9 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : int restart2dump = 0; int restartremap = 0; int citeflag = 1; + int citescreen = CiteMe::TERSE; + int citelogfile = CiteMe::VERBOSE; + char *citefile = nullptr; int helpflag = 0; suffix = suffix2 = suffixp = nullptr; @@ -190,7 +193,35 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : iarg = 1; while (iarg < narg) { - if (strcmp(arg[iarg],"-echo") == 0 || + if (strcmp(arg[iarg],"-cite") == 0 || + strcmp(arg[iarg],"-c") == 0) { + if (iarg+2 > narg) + error->universe_all(FLERR,"Invalid command-line argument"); + + if (strcmp(arg[iarg+1],"both") == 0) { + citescreen = CiteMe::VERBOSE; + citelogfile = CiteMe::VERBOSE; + citefile = nullptr; + } else if (strcmp(arg[iarg+1],"none") == 0) { + citescreen = CiteMe::TERSE; + citelogfile = CiteMe::TERSE; + citefile = nullptr; + } else if (strcmp(arg[iarg+1],"screen") == 0) { + citescreen = CiteMe::VERBOSE; + citelogfile = CiteMe::TERSE; + citefile = nullptr; + } else if (strcmp(arg[iarg+1],"log") == 0) { + citescreen = CiteMe::TERSE; + citelogfile = CiteMe::VERBOSE; + citefile = nullptr; + } else { + citescreen = CiteMe::TERSE; + citelogfile = CiteMe::TERSE; + citefile = arg[iarg+1]; + } + iarg += 2; + + } else if (strcmp(arg[iarg],"-echo") == 0 || strcmp(arg[iarg],"-e") == 0) { if (iarg+2 > narg) error->universe_all(FLERR,"Invalid command-line argument"); @@ -605,7 +636,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : // allocate CiteMe class if enabled - if (citeflag) citeme = new CiteMe(this); + if (citeflag) citeme = new CiteMe(this,citescreen,citelogfile,citefile); else citeme = nullptr; // allocate input class now that MPI is fully setup @@ -669,8 +700,8 @@ LAMMPS::~LAMMPS() { const int me = comm->me; - destroy(); delete citeme; + destroy(); if (num_package) { for (int i = 0; i < num_package; i++) { diff --git a/src/lammps.h b/src/lammps.h index 49d55d4e37..553db6597e 100644 --- a/src/lammps.h +++ b/src/lammps.h @@ -56,7 +56,6 @@ class LAMMPS { char *exename; // pointer to argv[0] char ***packargs; // arguments for cmdline package commands int num_package; // number of cmdline package commands - int cite_enable; // 1 if generating log.cite, 0 if disabled int clientserver; // 0 = neither, 1 = client, 2 = server void *cslib; // client/server messaging via CSlib @@ -66,9 +65,9 @@ class LAMMPS { class AtomKokkos *atomKK; // KOKKOS version of Atom class class MemoryKokkos *memoryKK; // KOKKOS version of Memory class - class Python * python; // Python interface + class Python *python; // Python interface - class CiteMe *citeme; // citation info + class CiteMe *citeme; // handle citation info const char *match_style(const char *style, const char *name); static const char * installed_packages[]; diff --git a/src/minimize.cpp b/src/minimize.cpp index a909afdaa5..8e55d6e0ea 100644 --- a/src/minimize.cpp +++ b/src/minimize.cpp @@ -13,6 +13,7 @@ #include "minimize.h" +#include "citeme.h" #include "domain.h" #include "error.h" #include "finish.h" @@ -46,6 +47,7 @@ void Minimize::command(int narg, char **arg) if (update->etol < 0.0 || update->ftol < 0.0) error->all(FLERR,"Illegal minimize command"); + if (lmp->citeme) lmp->citeme->flush(); update->whichflag = 2; update->beginstep = update->firststep = update->ntimestep; update->endstep = update->laststep = update->firststep + update->nsteps; From 1d38cc19905a285be8ed288796849519f0ab25e2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 27 Dec 2020 13:46:09 -0500 Subject: [PATCH 039/384] must not output and add separator line on empty buffers when flushing citations. --- src/citeme.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/citeme.cpp b/src/citeme.cpp index 5082f058b5..d032e34803 100644 --- a/src/citeme.cpp +++ b/src/citeme.cpp @@ -41,10 +41,9 @@ CiteMe::CiteMe(LAMMPS *lmp, int _screen, int _logfile, const char *_file) screen_flag = _screen; scrbuffer.clear(); - logfile_flag = _logfile; logbuffer.clear(); - + if (_file && universe->me == 0) { fp = fopen(_file,"w"); if (fp) { @@ -89,7 +88,6 @@ void CiteMe::add(const char *ref) if (screen_flag == VERBOSE) scrbuffer += cite_header; if (screen_flag == TERSE) scrbuffer += cite_nagline; } - if (logbuffer.empty()) { logbuffer += cite_separator; if (logfile_flag == VERBOSE) logbuffer += cite_header; @@ -108,12 +106,16 @@ void CiteMe::add(const char *ref) void CiteMe::flush() { if (comm->me == 0) { - scrbuffer += cite_separator; - logbuffer += cite_separator; - if (screen) fputs(scrbuffer.c_str(),screen); - if (logfile) fputs(logbuffer.c_str(),logfile); - scrbuffer.clear(); - logbuffer.clear(); + if (!scrbuffer.empty()) { + scrbuffer += cite_separator; + if (screen) fputs(scrbuffer.c_str(),screen); + scrbuffer.clear(); + } + if (!scrbuffer.empty()) { + logbuffer += cite_separator; + if (logfile) fputs(logbuffer.c_str(),logfile); + logbuffer.clear(); + } } return; } From d3c14dcb5104505d3369922ffe5f0a3a66e44042 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 8 Jan 2021 17:58:46 -0500 Subject: [PATCH 040/384] update citation output to more closely resemble what had been proposed --- src/citeme.cpp | 53 +++++++++++++++++++++++++++++++++----------------- src/citeme.h | 1 + src/lammps.cpp | 3 ++- 3 files changed, 38 insertions(+), 19 deletions(-) diff --git a/src/citeme.cpp b/src/citeme.cpp index d032e34803..a3bbef2f3c 100644 --- a/src/citeme.cpp +++ b/src/citeme.cpp @@ -17,20 +17,23 @@ using namespace LAMMPS_NS; -static const char cite_header[] = - "This LAMMPS simulation made specific use of work described in the\n" - "following references. See https://lammps.sandia.gov/cite.html\n" - "for details.\n\n"; - -static const char cite_nagline[] = "Please see the log.cite file " - "for references relevant to this simulation\n\n"; - -static const char cite_seefile[] = "Please see the citation file " - "for references relevant to this simulation\n\n"; - static const char cite_separator[] = "\nCITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE\n\n"; +static const char cite_nagline[] = + "Your LAMMPS simulation uses code contributions which should be cited.\n" + "Please see https://lammps.sandia.gov/doc/Intro_citing.html for more\n" + "information on citing LAMMPS itself.\n"; + +static const char cite_short[] = + "A short list of the features is given below.\n\n"; + +static const char cite_full[] = + "Below is a list of the full references in BibTeX format.\n\n"; + +static const char cite_file[] = "Please see the {} {} " + "for detailed references in BibTeX format.\n"; + /* ---------------------------------------------------------------------- */ CiteMe::CiteMe(LAMMPS *lmp, int _screen, int _logfile, const char *_file) @@ -45,12 +48,14 @@ CiteMe::CiteMe(LAMMPS *lmp, int _screen, int _logfile, const char *_file) logbuffer.clear(); if (_file && universe->me == 0) { + citefile = _file; fp = fopen(_file,"w"); if (fp) { - fputs(cite_header,fp); + fputs(cite_nagline,fp); + fputs(cite_full,fp); fflush(fp); } else { - utils::logmesg(lmp, "Unable to open citation file '" + std::string(_file) + utils::logmesg(lmp, "Unable to open citation file '" + citefile + "': " + utils::getsyserror() + "\n"); } } @@ -85,13 +90,25 @@ void CiteMe::add(const char *ref) if (scrbuffer.empty()) { scrbuffer += cite_separator; - if (screen_flag == VERBOSE) scrbuffer += cite_header; - if (screen_flag == TERSE) scrbuffer += cite_nagline; + scrbuffer += cite_nagline; + if (!citefile.empty()) scrbuffer += fmt::format(cite_file,"file",citefile); + if (screen_flag == VERBOSE) scrbuffer += cite_full; + if (screen_flag == TERSE) { + if (logfile_flag == VERBOSE) + scrbuffer += fmt::format(cite_file,"log","file"); + scrbuffer += cite_short; + } } if (logbuffer.empty()) { logbuffer += cite_separator; - if (logfile_flag == VERBOSE) logbuffer += cite_header; - if (logfile_flag == TERSE) logbuffer += cite_nagline; + logbuffer += cite_nagline; + if (!citefile.empty()) logbuffer += fmt::format(cite_file,"file",citefile); + if (logfile_flag == VERBOSE) logbuffer += cite_full; + if (logfile_flag == TERSE) { + if (screen_flag == VERBOSE) + scrbuffer += fmt::format(cite_file,"screen","output"); + logbuffer += cite_short; + } } std::string reference = ref; @@ -111,7 +128,7 @@ void CiteMe::flush() if (screen) fputs(scrbuffer.c_str(),screen); scrbuffer.clear(); } - if (!scrbuffer.empty()) { + if (!logbuffer.empty()) { logbuffer += cite_separator; if (logfile) fputs(logbuffer.c_str(),logfile); logbuffer.clear(); diff --git a/src/citeme.h b/src/citeme.h index 9a3d30e8e8..dd54268a3b 100644 --- a/src/citeme.h +++ b/src/citeme.h @@ -29,6 +29,7 @@ class CiteMe : protected Pointers { private: FILE *fp; // explicit citation file pointer or NULL + std::string citefile; // name of the explicit citation file. int screen_flag; // determine whether verbose or terse output int logfile_flag; // determine whether verbose or terse output std::string scrbuffer; // output buffer for screen diff --git a/src/lammps.cpp b/src/lammps.cpp index b882c76032..1648c55852 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -1142,7 +1142,8 @@ void _noopt LAMMPS::help() "-kokkos on/off ... : turn KOKKOS mode on or off (-k)\n" "-log none/filename : where to send log output (-l)\n" "-mpicolor color : which exe in a multi-exe mpirun cmd (-m)\n" - "-nocite : disable writing log.cite file (-nc)\n" + "-cite : select citation reminder style (-c)\n" + "-nocite : disable citation reminder (-nc)\n" "-package style ... : invoke package command (-pk)\n" "-partition size1 size2 ... : assign partition sizes (-p)\n" "-plog basename : basename for partition logs (-pl)\n" From 6428e542db9aaa8237f5f46c43fa5434894108b5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 8 Jan 2021 18:29:15 -0500 Subject: [PATCH 041/384] document updated citation reminder --- doc/src/Intro_citing.rst | 19 ++++++++++--------- doc/src/Modify_contribute.rst | 14 +++++++------- doc/src/Run_options.rst | 27 +++++++++++++++++++++++---- doc/src/fix_bond_react.rst | 4 ++-- doc/src/kim_commands.rst | 2 +- 5 files changed, 43 insertions(+), 23 deletions(-) diff --git a/doc/src/Intro_citing.rst b/doc/src/Intro_citing.rst index a74d3134f3..e758992e2b 100644 --- a/doc/src/Intro_citing.rst +++ b/doc/src/Intro_citing.rst @@ -38,17 +38,18 @@ In addition there are DOIs for individual stable releases. Currently there are: Home page ^^^^^^^^^ -The LAMMPS website at `https://lammps.sandia.gov/ `_ is the canonical -location for information about LAMMPS and more detailed lists of publications -using LAMMPS and contributing features. +The LAMMPS website at `https://lammps.sandia.gov/ +`_ is the canonical location for information +about LAMMPS and its features. Citing contributions ^^^^^^^^^^^^^^^^^^^^ -LAMMPS has many features and uses previously published methods and -algorithms or novel features. It also includes potential parameter -filed for specific models. You can look up relevant publications either -in the LAMMPS output to the screen, the ``log.cite`` file (which is -populated with references to relevant papers through embedding them into -the source code) and in the documentation of the :doc:`corresponding commands +LAMMPS has many features and that use either previously published +methods and algorithms or novel features. It also includes potential +parameter filed for specific models. Where available, a reminder about +references for optional features used in a specific run is printed to +the screen and log file. Style and output location can be selected with +the :ref:`-cite command-line switch `. Additional references are +given in the documentation of the :doc:`corresponding commands ` or in the :doc:`Howto tutorials `. diff --git a/doc/src/Modify_contribute.rst b/doc/src/Modify_contribute.rst index 27de36f30c..9d19df5cc4 100644 --- a/doc/src/Modify_contribute.rst +++ b/doc/src/Modify_contribute.rst @@ -209,13 +209,13 @@ packages in the src directory for examples. If you are uncertain, please ask. A LaTeX citation is stored in a variable at the top of the file and a single line of code that references the variable is added to the constructor of the class. Whenever a user invokes your feature from - their input script, this will cause LAMMPS to output the citation to a - log.cite file and prompt the user to examine the file. Note that you - should only use this for a paper you or your group authored. - E.g. adding a cite in the code for a paper by Nose and Hoover if you - write a fix that implements their integrator is not the intended - usage. That kind of citation should just be in the doc page you - provide. + their input script, this will cause LAMMPS to output a reminder to + cite that reference. Note that you should only use this for the most + relevant paper for a feature and a publication that you or your group + authored. E.g. adding a citation in the code for a paper by Nose and + Hoover if you write a fix that implements their integrator is not the + intended usage. That kind of citation should just be in the + documentation page you provide describing your contribution. Finally, as a general rule-of-thumb, the more clear and self-explanatory you make your documentation and README files, and the diff --git a/doc/src/Run_options.rst b/doc/src/Run_options.rst index 9c269e552f..ddd57bd189 100644 --- a/doc/src/Run_options.rst +++ b/doc/src/Run_options.rst @@ -11,6 +11,7 @@ letter abbreviation can be used: * :ref:`-k or -kokkos ` * :ref:`-l or -log ` * :ref:`-m or -mpicolor ` +* :ref:`-c or -cite ` * :ref:`-nc or -nocite ` * :ref:`-pk or -package ` * :ref:`-p or -partition ` @@ -220,14 +221,32 @@ links with from the lib/message directory. See the ---------- +.. _cite: + +**-cite style or file name** + +Select how and where to output a reminder about citing contributions +to the LAMMPS code that were used during the run. Available styles are +"both", "none", "screen", or "log". Any flag will be considered a file +name to write the citation info to. Default is the "log" style where +there is a short summary in the screen output and detailed citations +in BibTeX format in the logfile. The option "both" selects the detailed +output for both, "none", the short output for both, and "screen" will +write the detailed info to the screen and the short version to the log +file. Any other option will be taken as a file name to which the detailed +citation info is written and screen and log file output will be short +(same as with "none"). + +See the :doc:`citation page ` for more details on +how to correctly reference and cite LAMMPS. + +---------- + .. _nocite: **-nocite** -Disable writing the log.cite file which is normally written to list -references for specific cite-able features used during a LAMMPS run. -See the `citation page `_ for more -details. +Disable generating a citation reminder (see above) at all. ---------- diff --git a/doc/src/fix_bond_react.rst b/doc/src/fix_bond_react.rst index 38f061e05f..97684c4b76 100644 --- a/doc/src/fix_bond_react.rst +++ b/doc/src/fix_bond_react.rst @@ -616,8 +616,8 @@ reset_mol_ids = yes, custom_charges = no, molecule = off .. _Gissinger: -**(Gissinger)** Gissinger, Jensen and Wise, Polymer, 128, 211-217 (2017). +**(Gissinger2017)** Gissinger, Jensen and Wise, Polymer, 128, 211-217 (2017). .. _Gissinger2020: -**(Gissinger)** Gissinger, Jensen and Wise, Macromolecules, 53, 22, 9953–9961 (2020). +**(Gissinger2020)** Gissinger, Jensen and Wise, Macromolecules, 53, 22, 9953-9961 (2020). diff --git a/doc/src/kim_commands.rst b/doc/src/kim_commands.rst index 99f7efffd5..e9afa48fd5 100644 --- a/doc/src/kim_commands.rst +++ b/doc/src/kim_commands.rst @@ -1286,7 +1286,7 @@ to cite the OpenKIM project :ref:`(Tadmor) `, KIM API in addition to the relevant scientific references for the IM. The citation format for an IM is displayed on its page on `OpenKIM `_ along with the corresponding BibTex file, -and is automatically added to the LAMMPS *log.cite* file. +and is automatically added to the LAMMPS citation reminder. Citing the IM software (KIM infrastructure and specific PM or SM codes) used in the simulation gives credit to the researchers who developed them From 0ae5d963ce1914c28d3755e6d498682ca86bb614 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 12 Jan 2021 20:44:43 -0500 Subject: [PATCH 042/384] update formulations in docs to incorporate suggestions by @sjplimp --- doc/src/Modify_contribute.rst | 26 ++++++++++++++++---------- doc/src/Run_options.rst | 13 ++++++------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/doc/src/Modify_contribute.rst b/doc/src/Modify_contribute.rst index 9d19df5cc4..4998712a3d 100644 --- a/doc/src/Modify_contribute.rst +++ b/doc/src/Modify_contribute.rst @@ -206,16 +206,22 @@ packages in the src directory for examples. If you are uncertain, please ask. algorithm/science behind the feature itself, or its initial usage, or its implementation in LAMMPS), you can add the citation to the \*.cpp source file. See src/USER-EFF/atom_vec_electron.cpp for an example. - A LaTeX citation is stored in a variable at the top of the file and a - single line of code that references the variable is added to the - constructor of the class. Whenever a user invokes your feature from - their input script, this will cause LAMMPS to output a reminder to - cite that reference. Note that you should only use this for the most - relevant paper for a feature and a publication that you or your group - authored. E.g. adding a citation in the code for a paper by Nose and - Hoover if you write a fix that implements their integrator is not the - intended usage. That kind of citation should just be in the - documentation page you provide describing your contribution. + A LaTeX citation is stored in a variable at the top of the file and + a single line of code registering this variable is added to the + constructor of the class. If there is additional functionality (which + may have been added later) described in a different publication, + additional citation descriptions may be added for as long as they + are only registered when the corresponding keyword activating this + functionality is used. With these options it is possible to have + LAMMPS output a specific citation reminder whenever a user invokes + your feature from their input script. Note that you should only use + this for the most relevant paper for a feature and a publication that + you or your group authored. E.g. adding a citation in the code for + a paper by Nose and Hoover if you write a fix that implements their + integrator is not the intended usage. That kind of citation should + just be included in the documentation page you provide describing + your contribution. If you are not sure what the best option would + be, please contact the LAMMPS developers for advice. Finally, as a general rule-of-thumb, the more clear and self-explanatory you make your documentation and README files, and the diff --git a/doc/src/Run_options.rst b/doc/src/Run_options.rst index ddd57bd189..25756d9be0 100644 --- a/doc/src/Run_options.rst +++ b/doc/src/Run_options.rst @@ -227,15 +227,14 @@ links with from the lib/message directory. See the Select how and where to output a reminder about citing contributions to the LAMMPS code that were used during the run. Available styles are -"both", "none", "screen", or "log". Any flag will be considered a file -name to write the citation info to. Default is the "log" style where -there is a short summary in the screen output and detailed citations -in BibTeX format in the logfile. The option "both" selects the detailed +"both", "none", "screen", or "log". Any flag will be considered a file +name to write the detailed citation info to. Default is the "log" style +where there is a short summary in the screen output and detailed citations +in BibTeX format in the logfile. The option "both" selects the detailed output for both, "none", the short output for both, and "screen" will write the detailed info to the screen and the short version to the log -file. Any other option will be taken as a file name to which the detailed -citation info is written and screen and log file output will be short -(same as with "none"). +file. If a dedicated citation info file is requested, the screen and +log file output will be in the short format (same as with "none"). See the :doc:`citation page ` for more details on how to correctly reference and cite LAMMPS. From f54fd8fa72510969054e90150bb27403260ba309 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Thu, 21 Jan 2021 10:31:53 -0700 Subject: [PATCH 043/384] intial refactoring of THERMO_ENERGY mask --- src/RIGID/fix_shake.cpp | 2 - src/compute_pe.cpp | 3 +- src/compute_pe_atom.cpp | 4 +- src/fix.cpp | 51 ++++++------ src/fix.h | 32 +++++--- src/fix_addforce.cpp | 2 +- src/fix_temp_rescale.cpp | 4 +- src/modify.cpp | 110 ++++++++++++++++++------- src/modify.h | 17 ++-- src/thermo.cpp | 172 +++++++++++++++++++++++++-------------- src/thermo.h | 5 +- 11 files changed, 262 insertions(+), 140 deletions(-) diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index 61ba36ea2b..cb2daaac2a 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -33,8 +33,6 @@ #include "memory.h" #include "error.h" - - using namespace LAMMPS_NS; using namespace FixConst; using namespace MathConst; diff --git a/src/compute_pe.cpp b/src/compute_pe.cpp index f10f1eb344..b7078675e5 100644 --- a/src/compute_pe.cpp +++ b/src/compute_pe.cpp @@ -99,7 +99,8 @@ double ComputePE::compute_scalar() scalar += force->pair->etail / volume; } - if (fixflag && modify->n_thermo_energy) scalar += modify->thermo_energy(); + if (fixflag && modify->n_energy_global) + scalar += modify->energy_global(); return scalar; } diff --git a/src/compute_pe_atom.cpp b/src/compute_pe_atom.cpp index 52e132a626..ad490c66a6 100644 --- a/src/compute_pe_atom.cpp +++ b/src/compute_pe_atom.cpp @@ -152,8 +152,8 @@ void ComputePEAtom::compute_peratom() // add in per-atom contributions from relevant fixes // always only for owned atoms, not ghost - if (fixflag && modify->n_thermo_energy_atom) - modify->thermo_energy_atom(nlocal,energy); + if (fixflag && modify->n_energy_atom) + modify->energy_atom(nlocal,energy); // communicate ghost energy between neighbor procs diff --git a/src/fix.cpp b/src/fix.cpp index 573d8ae1a1..bd3d91767b 100644 --- a/src/fix.cpp +++ b/src/fix.cpp @@ -63,9 +63,11 @@ Fix::Fix(LAMMPS *lmp, int /*narg*/, char **arg) : box_change = NO_BOX_CHANGE; thermo_energy = 0; thermo_virial = 0; + energy_global_flag = energy_atom_flag = 0; + virial_global_flag = virial_atom_flag = 0; + ecouple_flag = 0; rigid_flag = 0; peatom_flag = 0; - virial_flag = 0; no_change_box = 0; time_integrate = 0; time_depend = 0; @@ -150,8 +152,7 @@ void Fix::modify_params(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal fix_modify command"); if (strcmp(arg[iarg+1],"no") == 0) thermo_energy = 0; else if (strcmp(arg[iarg+1],"yes") == 0) { - if (!(THERMO_ENERGY & setmask())) - error->all(FLERR,"Illegal fix_modify command"); + if (energy_flag == 0) error->all(FLERR,"Illegal fix_modify command"); thermo_energy = 1; } else error->all(FLERR,"Illegal fix_modify command"); iarg += 2; @@ -159,8 +160,7 @@ void Fix::modify_params(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal fix_modify command"); if (strcmp(arg[iarg+1],"no") == 0) thermo_virial = 0; else if (strcmp(arg[iarg+1],"yes") == 0) { - if (virial_flag == 0) - error->all(FLERR,"Illegal fix_modify command"); + if (virial_flag == 0) error->all(FLERR,"Illegal fix_modify command"); thermo_virial = 1; } else error->all(FLERR,"Illegal fix_modify command"); iarg += 2; @@ -180,9 +180,12 @@ void Fix::modify_params(int narg, char **arg) } /* ---------------------------------------------------------------------- - setup for energy, virial computation + setup for peratom energy and global/peratom virial computation see integrate::ev_set() for values of eflag (0-3) and vflag (0-6) - fixes call this if they use ev_tally() + fixes call Fix::ev_init() if tally energy and virial values + if thermo_energy is not set, energy tallying is disabled + if thermo_virial is not set, virial tallying is disabled + global energy is tallied separately, output by compute_scalar() method ------------------------------------------------------------------------- */ void Fix::ev_setup(int eflag, int vflag) @@ -191,13 +194,19 @@ void Fix::ev_setup(int eflag, int vflag) evflag = 1; - eflag_either = eflag; - eflag_global = eflag & ENERGY_GLOBAL; - eflag_atom = eflag & ENERGY_ATOM; + if (!thermo_energy) eflag_either = eflag_global = eflag_atom = 0; + else { + eflag_either = eflag; + eflag_global = eflag & ENERGY_GLOBAL; + eflag_atom = eflag & ENERGY_ATOM; + } - vflag_either = vflag; - vflag_global = vflag & (VIRIAL_PAIR | VIRIAL_FDOTR); - vflag_atom = vflag & (VIRIAL_ATOM | VIRIAL_CENTROID); + if (!thermo_virial) vflag_either = vflag_global = vflag_atom = 0; + else { + vflag_either = vflag; + vflag_global = vflag & (VIRIAL_PAIR | VIRIAL_FDOTR); + vflag_atom = vflag & (VIRIAL_ATOM | VIRIAL_CENTROID); + } // reallocate per-atom arrays if necessary @@ -235,24 +244,17 @@ void Fix::ev_setup(int eflag, int vflag) } /* ---------------------------------------------------------------------- - if thermo_virial is on: - setup for virial computation - see integrate::ev_set() for values of vflag - fixes call this if use v_tally() - else: set evflag=0 + setup for global/peratom virial computation + see integrate::ev_set() for values of vflag (0-6) + fixes call Fix::v_init() if tally virial values but not energy + if thermo_virial is not set, virial tallying is disabled ------------------------------------------------------------------------- */ void Fix::v_setup(int vflag) { int i,n; - if (!thermo_virial) { - evflag = 0; - return; - } - evflag = 1; - vflag_global = vflag & (VIRIAL_PAIR | VIRIAL_FDOTR); vflag_atom = vflag & (VIRIAL_ATOM | VIRIAL_CENTROID); @@ -304,7 +306,6 @@ void Fix::ev_tally(int n, int *list, double total, double eng, double *v) v_tally(n,list,total,v); } - /* ---------------------------------------------------------------------- tally virial into global and per-atom accumulators n = # of local owned atoms involved, with local indices in list diff --git a/src/fix.h b/src/fix.h index ec951e3bb2..290ceebcda 100644 --- a/src/fix.h +++ b/src/fix.h @@ -40,14 +40,17 @@ class Fix : protected Pointers { }; bigint next_reneighbor; // next timestep to force a reneighboring - int thermo_energy; // 1 if fix_modify enabled ThEng, 0 if not - int thermo_virial; // 1 if fix_modify enabled ThVir, 0 if not int nevery; // how often to call an end_of_step fix - int rigid_flag; // 1 if Fix integrates rigid bodies, 0 if not - int peatom_flag; // 1 if Fix contributes per-atom eng, 0 if not - int virial_flag; // 1 if Fix contributes to virial, 0 if not + int thermo_energy; // 1 if fix_modify energy enabled, 0 if not + int thermo_virial; // 1 if fix_modify virial enabled, 0 if not + int energy_global_flag; // 1 if contributes to global eng + int energy_atom_flag; // 1 if contributes to peratom eng + int virial_global_flag; // 1 if contributes to global virial + int virial_peratom_flag; // 1 if contributes to peratom virial + int ecouple_flag; // 1 if thermostat which accumulates eng to ecouple + int time_integrate; // 1 if performs time integration, 0 if no + int rigid_flag; // 1 if integrates rigid bodies, 0 if not int no_change_box; // 1 if cannot swap ortho <-> triclinic - int time_integrate; // 1 if fix performs time integration, 0 if no int time_depend; // 1 if requires continuous timestepping int create_attribute; // 1 if fix stores attributes that need // setting when a new atom is created @@ -99,8 +102,9 @@ class Fix : protected Pointers { int comm_reverse; // size of reverse communication (0 if none) int comm_border; // size of border communication (0 if none) - double virial[6]; // accumulated virial - double *eatom,**vatom; // accumulated per-atom energy/virial + double ecouple; // cumulative energy added to reservoir by thermostatting + double virial[6]; // virial for this timestep + double *eatom,**vatom; // per-atom energy/virial for this timestep int centroidstressflag; // centroid stress compared to two-body stress // CENTROID_SAME = same as two-body stress @@ -239,11 +243,17 @@ class Fix : protected Pointers { int dynamic; // recount atoms for temperature computes void ev_init(int eflag, int vflag) { - if (eflag||vflag) ev_setup(eflag, vflag); - else evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = 0; + if ((eflag && thermo_energy) || (vflag && thermo_virial)) ev_setup(eflag, vflag); + else evflag = eflag_either = eflag_global = eflag_atom = + vflag_either = vflag_global = vflag_atom = 0; } void ev_setup(int, int); void ev_tally(int, int *, double, double, double *); + + void v_init(int vflag) { + if (vflag && thermo_virial) v_setup(vflag); + else evflag = vflag_either = vflag_global = vflag_atom = 0; + } void v_setup(int); void v_tally(int, int *, double, double *); void v_tally(int, double *); @@ -263,7 +273,7 @@ namespace FixConst { FINAL_INTEGRATE = 1<<8, END_OF_STEP = 1<<9, POST_RUN = 1<<10, - THERMO_ENERGY = 1<<11, + //THERMO_ENERGY = 1<<11, // remove when done with refactoring INITIAL_INTEGRATE_RESPA = 1<<12, POST_INTEGRATE_RESPA = 1<<13, PRE_FORCE_RESPA = 1<<14, diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp index 881f77c05c..8bd5bc69a3 100644 --- a/src/fix_addforce.cpp +++ b/src/fix_addforce.cpp @@ -352,7 +352,7 @@ void FixAddForce::post_force(int vflag) v[3] = xstyle ? xvalue*unwrap[1] : 0.0; v[4] = xstyle ? xvalue*unwrap[2] : 0.0; v[5] = ystyle ? yvalue*unwrap[2] : 0.0; - v_tally(i, v); + v_tally(i,v); } } } diff --git a/src/fix_temp_rescale.cpp b/src/fix_temp_rescale.cpp index 46b00f9e83..5e6638a56c 100644 --- a/src/fix_temp_rescale.cpp +++ b/src/fix_temp_rescale.cpp @@ -12,9 +12,10 @@ ------------------------------------------------------------------------- */ #include "fix_temp_rescale.h" -#include +#include #include + #include "atom.h" #include "force.h" #include "group.h" @@ -26,7 +27,6 @@ #include "compute.h" #include "error.h" - using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/modify.cpp b/src/modify.cpp index f3ebb03c38..5812947dd4 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -46,8 +46,8 @@ Modify::Modify(LAMMPS *lmp) : Pointers(lmp) n_initial_integrate = n_post_integrate = 0; n_pre_exchange = n_pre_neighbor = n_post_neighbor = 0; n_pre_force = n_pre_reverse = n_post_force = 0; - n_final_integrate = n_end_of_step = n_thermo_energy = 0; - n_thermo_energy_atom = 0; + n_final_integrate = n_end_of_step = 0; + n_energy_couple = n_energy_global = n_energy_atom = 0; n_initial_integrate_respa = n_post_integrate_respa = 0; n_pre_force_respa = n_post_force_respa = n_final_integrate_respa = 0; n_min_pre_exchange = n_min_pre_force = n_min_pre_reverse = 0; @@ -60,7 +60,7 @@ Modify::Modify(LAMMPS *lmp) : Pointers(lmp) list_pre_exchange = list_pre_neighbor = list_post_neighbor = nullptr; list_pre_force = list_pre_reverse = list_post_force = nullptr; list_final_integrate = list_end_of_step = nullptr; - list_thermo_energy = list_thermo_energy_atom = nullptr; + list_energy_couple = list_energy_global = list_energy_atom = nullptr; list_initial_integrate_respa = list_post_integrate_respa = nullptr; list_pre_force_respa = list_post_force_respa = nullptr; list_final_integrate_respa = nullptr; @@ -137,8 +137,9 @@ Modify::~Modify() delete [] list_post_force; delete [] list_final_integrate; delete [] list_end_of_step; - delete [] list_thermo_energy; - delete [] list_thermo_energy_atom; + delete [] list_energy_couple; + delete [] list_energy_global; + delete [] list_energy_atom; delete [] list_initial_integrate_respa; delete [] list_post_integrate_respa; delete [] list_pre_force_respa; @@ -218,8 +219,9 @@ void Modify::init() list_init(POST_FORCE,n_post_force,list_post_force); list_init(FINAL_INTEGRATE,n_final_integrate,list_final_integrate); list_init_end_of_step(END_OF_STEP,n_end_of_step,list_end_of_step); - list_init_thermo_energy(THERMO_ENERGY,n_thermo_energy,list_thermo_energy); - list_init_thermo_energy_atom(n_thermo_energy_atom,list_thermo_energy_atom); + list_init_energy_couple(n_energy_couple,list_energy_couple); + list_init_energy_global(n_energy_global,list_energy_global); + list_init_energy_atom(n_energy_atom,list_energy_atom); list_init(INITIAL_INTEGRATE_RESPA, n_initial_integrate_respa,list_initial_integrate_respa); @@ -486,31 +488,45 @@ void Modify::end_of_step() } /* ---------------------------------------------------------------------- - thermo energy call, only for relevant fixes - called by Thermo class - compute_scalar() is fix call to return energy + coupling energy call, only for relevant fixes + stored by each fix in ecouple variable + ecouple = cumulative energy added to reservoir by thermostatting ------------------------------------------------------------------------- */ -double Modify::thermo_energy() +double Modify::energy_couple() { double energy = 0.0; - for (int i = 0; i < n_thermo_energy; i++) - energy += fix[list_thermo_energy[i]]->compute_scalar(); + for (int i = 0; i < n_energy_couple; i++) + energy += fix[list_energy_couple[i]]->ecouple; return energy; } /* ---------------------------------------------------------------------- - per-atom thermo energy call, only for relevant fixes + global energy call, only for relevant fixes + they return energy via compute_scalar() + called by compute pe +------------------------------------------------------------------------- */ + +double Modify::energy_global() +{ + double energy = 0.0; + for (i = 0; i < n_energy_global; i++) + energy += fix[list_energy_global[i]]->compute_scalar(); + return energy; +} + +/* ---------------------------------------------------------------------- + peratom energy call, only for relevant fixes called by compute pe/atom ------------------------------------------------------------------------- */ -void Modify::thermo_energy_atom(int nlocal, double *energy) +void Modify::energy_atom(int nlocal, double *energy) { int i,j; double *eatom; - for (i = 0; i < n_thermo_energy_atom; i++) { - eatom = fix[list_thermo_energy_atom[i]]->eatom; + for (i = 0; i < n_energy_atom; i++) { + eatom = fix[list_energy_atom[i]]->eatom; if (!eatom) continue; for (j = 0; j < nlocal; j++) energy[j] += eatom[j]; } @@ -1632,43 +1648,79 @@ void Modify::list_init_end_of_step(int mask, int &n, int *&list) } /* ---------------------------------------------------------------------- - create list of fix indices for thermo energy fixes - only added to list if fix has THERMO_ENERGY mask set, - and its thermo_energy flag was set via fix_modify + create list of fix indices for fixes that compute reservoir coupling energy + only added to list if fix has ecouple_flag set ------------------------------------------------------------------------- */ -void Modify::list_init_thermo_energy(int mask, int &n, int *&list) +void Modify::list_init_energy_couple(int &n, int *&list) { delete [] list; n = 0; for (int i = 0; i < nfix; i++) - if (fmask[i] & mask && fix[i]->thermo_energy) n++; + if (fix[i]->ecouple_flag) n++; list = new int[n]; n = 0; for (int i = 0; i < nfix; i++) - if (fmask[i] & mask && fix[i]->thermo_energy) list[n++] = i; + if (fix[i]->ecouple_flag) list[n++] = i; } /* ---------------------------------------------------------------------- - create list of fix indices for peratom thermo energy fixes - only added to list if fix has its peatom_flag set, - and its thermo_energy flag was set via fix_modify + create list of fix indices for fixes that compute peratom energy + only added to list if fix has energy_atom_flag and thermo_energy set ------------------------------------------------------------------------- */ -void Modify::list_init_thermo_energy_atom(int &n, int *&list) +void Modify::list_init_energy_atom(int &n, int *&list) { delete [] list; n = 0; for (int i = 0; i < nfix; i++) - if (fix[i]->peatom_flag && fix[i]->thermo_energy) n++; + if (fix[i]->energy_atom_flag && fix[i]->thermo_energy) n++; list = new int[n]; n = 0; for (int i = 0; i < nfix; i++) - if (fix[i]->peatom_flag && fix[i]->thermo_energy) list[n++] = i; + if (fix[i]->energy_atom_flag && fix[i]->thermo_energy) list[n++] = i; +} + +/* ---------------------------------------------------------------------- + create list of fix indices for fixes that compute global energy + only added to list if fix has energy_global_flag and thermo_energy set +------------------------------------------------------------------------- */ + +void Modify::list_init_energy_global(int &n, int *&list) +{ + delete [] list; + + n = 0; + for (int i = 0; i < nfix; i++) + if (fix[i]->energy_global_flag && fix[i]->thermo_energy) n++; + list = new int[n]; + + n = 0; + for (int i = 0; i < nfix; i++) + if (fix[i]->energy_global_flag && fix[i]->thermo_energy) list[n++] = i; +} + +/* ---------------------------------------------------------------------- + create list of fix indices for fixes that compute peratom energy + only added to list if fix has energy_atom_flag and thermo_energy set +------------------------------------------------------------------------- */ + +void Modify::list_init_energy_atom(int &n, int *&list) +{ + delete [] list; + + n = 0; + for (int i = 0; i < nfix; i++) + if (fix[i]->energy_atom_flag && fix[i]->thermo_energy) n++; + list = new int[n]; + + n = 0; + for (int i = 0; i < nfix; i++) + if (fix[i]->energy_atom_flag && fix[i]->thermo_energy) list[n++] = i; } /* ---------------------------------------------------------------------- diff --git a/src/modify.h b/src/modify.h index a347e8486d..ba8efd6525 100644 --- a/src/modify.h +++ b/src/modify.h @@ -33,7 +33,8 @@ class Modify : protected Pointers { int n_initial_integrate,n_post_integrate,n_pre_exchange; int n_pre_neighbor,n_post_neighbor; int n_pre_force,n_pre_reverse,n_post_force; - int n_final_integrate,n_end_of_step,n_thermo_energy,n_thermo_energy_atom; + int n_final_integrate,n_end_of_step; + int n_energy_couple,n_energy_global,n_energy_atom; int n_initial_integrate_respa,n_post_integrate_respa; int n_pre_force_respa,n_post_force_respa,n_final_integrate_respa; int n_min_pre_exchange,n_min_pre_neighbor,n_min_post_neighbor; @@ -69,8 +70,9 @@ class Modify : protected Pointers { virtual void post_force(int); virtual void final_integrate(); virtual void end_of_step(); - virtual double thermo_energy(); - virtual void thermo_energy_atom(int, double *); + virtual double energy_couple(); + virtual double energy_global(); + virtual void energy_atom(int, double *); virtual void post_run(); virtual void create_attribute(int); @@ -135,8 +137,8 @@ class Modify : protected Pointers { int *list_initial_integrate,*list_post_integrate; int *list_pre_exchange,*list_pre_neighbor,*list_post_neighbor; int *list_pre_force,*list_pre_reverse,*list_post_force; - int *list_final_integrate,*list_end_of_step,*list_thermo_energy; - int *list_thermo_energy_atom; + int *list_final_integrate,*list_end_of_step; + int *list_energy_couple,*list_energy_global,*list_energy_atom; int *list_initial_integrate_respa,*list_post_integrate_respa; int *list_pre_force_respa,*list_post_force_respa; int *list_final_integrate_respa; @@ -163,8 +165,9 @@ class Modify : protected Pointers { void list_init(int, int &, int *&); void list_init_end_of_step(int, int &, int *&); - void list_init_thermo_energy(int, int &, int *&); - void list_init_thermo_energy_atom(int &, int *&); + void list_init_energy_couple(int &, int *&); + void list_init_energy_global(int &, int *&); + void list_init_energy_atom(int &, int *&); void list_init_dofflag(int &, int *&); void list_init_compute(); diff --git a/src/thermo.cpp b/src/thermo.cpp index 9197f88084..626dc09c3f 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -54,13 +54,14 @@ using namespace MathConst; // step, elapsed, elaplong, dt, time, cpu, tpcpu, spcpu, cpuremain, // part, timeremain -// atoms, temp, press, pe, ke, etotal, enthalpy +// atoms, temp, press, pe, ke, etotal // evdwl, ecoul, epair, ebond, eangle, edihed, eimp, emol, elong, etail -// vol, density, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi, xy, xz, yz, +// enthalpy, ecouple, econserve +// vol, density, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi, xy, xz, yz // xlat, ylat, zlat -// bonds, angles, dihedrals, impropers, +// bonds, angles, dihedrals, impropers // pxx, pyy, pzz, pxy, pxz, pyz -// fmax, fnorm, nbuild, ndanger, +// fmax, fnorm, nbuild, ndanger // cella, cellb, cellc, cellalpha, cellbeta, cellgamma // customize a new thermo style by adding a DEFINE to this list @@ -753,11 +754,6 @@ void Thermo::parse_fields(char *str) addfield("TotEng",&Thermo::compute_etotal,FLOAT); index_temp = add_compute(id_temp,SCALAR); index_pe = add_compute(id_pe,SCALAR); - } else if (word == "enthalpy") { - addfield("Enthalpy",&Thermo::compute_enthalpy,FLOAT); - index_temp = add_compute(id_temp,SCALAR); - index_press_scalar = add_compute(id_press,SCALAR); - index_pe = add_compute(id_pe,SCALAR); } else if (word == "evdwl") { addfield("E_vdwl",&Thermo::compute_evdwl,FLOAT); @@ -790,6 +786,19 @@ void Thermo::parse_fields(char *str) addfield("E_tail",&Thermo::compute_etail,FLOAT); index_pe = add_compute(id_pe,SCALAR); + } else if (word == "enthalpy") { + addfield("Enthalpy",&Thermo::compute_enthalpy,FLOAT); + index_temp = add_compute(id_temp,SCALAR); + index_press_scalar = add_compute(id_press,SCALAR); + index_pe = add_compute(id_pe,SCALAR); + } else if (word == "ecouple") { + addfield("Ecouple",&Thermo::compute_ecouple,FLOAT); + index_pe = add_compute(id_pe,SCALAR); + } else if (word == "econserve") { + addfield("Econserve",&Thermo::compute_econserve,FLOAT); + index_temp = add_compute(id_temp,SCALAR); + index_pe = add_compute(id_pe,SCALAR); + } else if (word == "vol") { addfield("Volume",&Thermo::compute_vol,FLOAT); } else if (word == "density") { @@ -1234,42 +1243,6 @@ int Thermo::evaluate_keyword(const char *word, double *answer) } compute_etotal(); - } else if (strcmp(word,"enthalpy") == 0) { - if (!pe) - error->all(FLERR, - "Thermo keyword in variable requires thermo to use/init pe"); - if (update->whichflag == 0) { - if (pe->invoked_scalar != update->ntimestep) - error->all(FLERR,"Compute used in variable thermo keyword between runs " - "is not current"); - } else { - pe->compute_scalar(); - pe->invoked_flag |= INVOKED_SCALAR; - } - if (!temperature) - error->all(FLERR,"Thermo keyword in variable requires " - "thermo to use/init temp"); - if (update->whichflag == 0) { - if (temperature->invoked_scalar != update->ntimestep) - error->all(FLERR,"Compute used in variable thermo keyword between runs " - "is not current"); - } else if (!(temperature->invoked_flag & INVOKED_SCALAR)) { - temperature->compute_scalar(); - temperature->invoked_flag |= INVOKED_SCALAR; - } - if (!pressure) - error->all(FLERR,"Thermo keyword in variable requires " - "thermo to use/init press"); - if (update->whichflag == 0) { - if (pressure->invoked_scalar != update->ntimestep) - error->all(FLERR,"Compute used in variable thermo keyword between runs " - "is not current"); - } else if (!(pressure->invoked_flag & INVOKED_SCALAR)) { - pressure->compute_scalar(); - pressure->invoked_flag |= INVOKED_SCALAR; - } - compute_enthalpy(); - } else if (strcmp(word,"evdwl") == 0) { if (update->eflag_global != update->ntimestep) error->all(FLERR,"Energy was not tallied on needed timestep"); @@ -1356,6 +1329,68 @@ int Thermo::evaluate_keyword(const char *word, double *answer) error->all(FLERR,"Energy was not tallied on needed timestep"); compute_etail(); + } else if (strcmp(word,"enthalpy") == 0) { + if (!pe) + error->all(FLERR, + "Thermo keyword in variable requires thermo to use/init pe"); + if (update->whichflag == 0) { + if (pe->invoked_scalar != update->ntimestep) + error->all(FLERR,"Compute used in variable thermo keyword between runs " + "is not current"); + } else { + pe->compute_scalar(); + pe->invoked_flag |= INVOKED_SCALAR; + } + if (!temperature) + error->all(FLERR,"Thermo keyword in variable requires " + "thermo to use/init temp"); + if (update->whichflag == 0) { + if (temperature->invoked_scalar != update->ntimestep) + error->all(FLERR,"Compute used in variable thermo keyword between runs " + "is not current"); + } else if (!(temperature->invoked_flag & INVOKED_SCALAR)) { + temperature->compute_scalar(); + temperature->invoked_flag |= INVOKED_SCALAR; + } + if (!pressure) + error->all(FLERR,"Thermo keyword in variable requires " + "thermo to use/init press"); + if (update->whichflag == 0) { + if (pressure->invoked_scalar != update->ntimestep) + error->all(FLERR,"Compute used in variable thermo keyword between runs " + "is not current"); + } else if (!(pressure->invoked_flag & INVOKED_SCALAR)) { + pressure->compute_scalar(); + pressure->invoked_flag |= INVOKED_SCALAR; + } + compute_enthalpy(); + + } else if (strcmp(word,"ecouple") == 0) compute_ecouple(); + } else if (strcmp(word,"econserve") == 0) { + if (!pe) + error->all(FLERR, + "Thermo keyword in variable requires thermo to use/init pe"); + if (update->whichflag == 0) { + if (pe->invoked_scalar != update->ntimestep) + error->all(FLERR,"Compute used in variable thermo keyword between runs " + "is not current"); + } else { + pe->compute_scalar(); + pe->invoked_flag |= INVOKED_SCALAR; + } + if (!temperature) + error->all(FLERR,"Thermo keyword in variable requires " + "thermo to use/init temp"); + if (update->whichflag == 0) { + if (temperature->invoked_scalar != update->ntimestep) + error->all(FLERR,"Compute used in variable thermo keyword between runs " + "is not current"); + } else if (!(temperature->invoked_flag & INVOKED_SCALAR)) { + temperature->compute_scalar(); + temperature->invoked_flag |= INVOKED_SCALAR; + } + compute_econserve(); + } else if (strcmp(word,"vol") == 0) compute_vol(); else if (strcmp(word,"density") == 0) compute_density(); else if (strcmp(word,"lx") == 0) compute_lx(); @@ -1721,27 +1756,28 @@ void Thermo::compute_ke() void Thermo::compute_etotal() { compute_pe(); - double ke = temperature->scalar; - ke *= 0.5 * temperature->dof * force->boltz; - if (normflag) ke /= natoms; - dvalue += ke; + double dvalue_pe = dvalue; + compute_ke(); + dvalue += dvalue_pe; } /* ---------------------------------------------------------------------- */ -void Thermo::compute_enthalpy() +void Thermo::compute_ecouple() { - compute_etotal(); - double etmp = dvalue; + dvalue = modify->ecouple(); +} - compute_vol(); - double vtmp = dvalue; - if (normflag) vtmp /= natoms; +/* ---------------------------------------------------------------------- */ - compute_press(); - double ptmp = dvalue; - - dvalue = etmp + ptmp*vtmp/(force->nktv2p); +void Thermo::compute_econserve() +{ + compute_pe(); + double dvalue_pe = dvalue; + compute_ke(); + double dvalue_ke = dvalue; + compute_ecouple(); + dvalue += dvalue_pe + dvalue_ke; } /* ---------------------------------------------------------------------- */ @@ -1867,6 +1903,24 @@ void Thermo::compute_etail() } else dvalue = 0.0; } +/* ---------------------------------------------------------------------- */ + +void Thermo::compute_enthalpy() +{ + compute_etotal(); + double etmp = dvalue; + + compute_vol(); + double vtmp = dvalue; + if (normflag) vtmp /= natoms; + + compute_press(); + double ptmp = dvalue; + + dvalue = etmp + ptmp*vtmp/(force->nktv2p); +} + + /* ---------------------------------------------------------------------- */ void Thermo::compute_vol() diff --git a/src/thermo.h b/src/thermo.h index def8cead65..90ce41c6e4 100644 --- a/src/thermo.h +++ b/src/thermo.h @@ -143,7 +143,6 @@ class Thermo : protected Pointers { void compute_pe(); void compute_ke(); void compute_etotal(); - void compute_enthalpy(); void compute_evdwl(); void compute_ecoul(); @@ -156,6 +155,10 @@ class Thermo : protected Pointers { void compute_elong(); void compute_etail(); + void compute_enthalpy(); + void compute_ecouple(); + void compute_econserve(); + void compute_vol(); void compute_density(); void compute_lx(); From 182eb35f1a015b679a82eab941dd3663be853141 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Thu, 21 Jan 2021 11:32:11 -0700 Subject: [PATCH 044/384] changes to fixes that use THERMO_ENERGY --- src/compute_pressure.cpp | 9 +- src/compute_stress_atom.cpp | 6 +- src/fix_addforce.cpp | 13 ++- src/fix_external.cpp | 8 +- src/fix_gravity.cpp | 4 +- src/fix_indent.cpp | 2 +- src/fix_langevin.cpp | 14 ++- src/fix_nh.cpp | 2 +- src/fix_restrain.cpp | 3 +- src/fix_spring.cpp | 2 +- src/fix_spring_chunk.cpp | 2 +- src/fix_spring_self.cpp | 2 +- src/fix_temp_berendsen.cpp | 17 ++-- src/fix_temp_csld.cpp | 16 ++-- src/fix_temp_csvr.cpp | 172 ++++++++++++++++++------------------ src/fix_temp_rescale.cpp | 12 +-- src/fix_wall.cpp | 12 +-- src/fix_wall_harmonic.cpp | 2 +- src/fix_wall_region.cpp | 10 +-- 19 files changed, 151 insertions(+), 157 deletions(-) diff --git a/src/compute_pressure.cpp b/src/compute_pressure.cpp index 7acf92ea2e..aadf96fdea 100644 --- a/src/compute_pressure.cpp +++ b/src/compute_pressure.cpp @@ -215,10 +215,13 @@ void ComputePressure::init() vptr[nvirial++] = force->dihedral->virial; if (improperflag && force->improper) vptr[nvirial++] = force->improper->virial; - if (fixflag) - for (int i = 0; i < modify->nfix; i++) - if (modify->fix[i]->thermo_virial) + if (fixflag) { + Fix **fix = modify->fix; + int nfix = modify->nfix; + for (int i = 0; i < nfix; i++) + if (fix[i]->virial_global_flag && fix[i]->thermo_virial) vptr[nvirial++] = modify->fix[i]->virial; + } } // flag Kspace contribution separately, since not summed across procs diff --git a/src/compute_stress_atom.cpp b/src/compute_stress_atom.cpp index f918f7f293..aefb58dbb4 100644 --- a/src/compute_stress_atom.cpp +++ b/src/compute_stress_atom.cpp @@ -219,8 +219,10 @@ void ComputeStressAtom::compute_peratom() // and fix ave/spatial uses a per-atom stress from this compute as input if (fixflag) { - for (int ifix = 0; ifix < modify->nfix; ifix++) - if (modify->fix[ifix]->virial_flag) { + Fix **fix = modify->fix; + int nfix = modify->nfix; + for (int ifix = 0; ifix < nfix; ifix++) + if (fix[i]->virial_atom_flag && fix[ifix]->virial_flag) { double **vatom = modify->fix[ifix]->vatom; if (vatom) for (i = 0; i < nlocal; i++) diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp index 8bd5bc69a3..22c7408996 100644 --- a/src/fix_addforce.cpp +++ b/src/fix_addforce.cpp @@ -36,8 +36,8 @@ enum{NONE,CONSTANT,EQUAL,ATOM}; FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xstr(nullptr), ystr(nullptr), zstr(nullptr), estr(nullptr), idregion(nullptr), sforce(nullptr) - + xstr(nullptr), ystr(nullptr), zstr(nullptr), estr(nullptr), + idregion(nullptr), sforce(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix addforce command"); @@ -48,9 +48,10 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extscalar = 1; extvector = 1; + energy_global_flag = 1; + virial_global_flag = virial_atom_flag = 1; respa_level_support = 1; ilevel_respa = 0; - virial_flag = 1; xstr = ystr = zstr = nullptr; @@ -138,7 +139,6 @@ int FixAddForce::setmask() int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; mask |= MIN_POST_FORCE; return mask; @@ -242,10 +242,9 @@ void FixAddForce::post_force(int vflag) if (update->ntimestep % nevery) return; - // energy and virial setup + // virial setup - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); if (lmp->kokkos) atom->sync_modify(Host, (unsigned int) (F_MASK | MASK_MASK), diff --git a/src/fix_external.cpp b/src/fix_external.cpp index 81ab1ec36a..f3ad25d3b3 100644 --- a/src/fix_external.cpp +++ b/src/fix_external.cpp @@ -35,9 +35,10 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; global_freq = 1; - virial_flag = 1; - thermo_virial = 1; extscalar = 1; + energy_global_flag = energy_atom_flag = 1; + virial_global_flag = virial_atom_flag = 1; + thermo_energy = thermo_virial = 1; if (strcmp(arg[3],"pf/callback") == 0) { if (narg != 6) error->all(FLERR,"Illegal fix external command"); @@ -89,7 +90,6 @@ int FixExternal::setmask() if (mode == PF_CALLBACK || mode == PF_ARRAY) { mask |= PRE_REVERSE; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= MIN_POST_FORCE; } return mask; @@ -195,7 +195,6 @@ void FixExternal::set_energy_global(double caller_energy) void FixExternal::set_virial_global(double *caller_virial) { - if (!evflag) return; if (!vflag_global) return; for (int i = 0; i < 6; i++) @@ -223,7 +222,6 @@ void FixExternal::set_virial_peratom(double **caller_virial) { int i,j; - if (!evflag) return; if (!vflag_atom) return; int nlocal = atom->nlocal; diff --git a/src/fix_gravity.cpp b/src/fix_gravity.cpp index a96303742c..b4e894316a 100644 --- a/src/fix_gravity.cpp +++ b/src/fix_gravity.cpp @@ -46,6 +46,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; global_freq = 1; extscalar = 1; + energy_global_flag = 1; respa_level_support = 1; ilevel_respa = 0; @@ -62,7 +63,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : mstyle = CONSTANT; } - int iarg=4; + int iarg = 4; if (strcmp(arg[4],"chute") == 0) { if (narg < 6) error->all(FLERR,"Illegal fix gravity command"); @@ -186,7 +187,6 @@ int FixGravity::setmask() { int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; return mask; } diff --git a/src/fix_indent.cpp b/src/fix_indent.cpp index cc7a3c8877..b8f2d23312 100644 --- a/src/fix_indent.cpp +++ b/src/fix_indent.cpp @@ -47,6 +47,7 @@ FixIndent::FixIndent(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; vector_flag = 1; size_vector = 3; + energy_global_flag = 1; global_freq = 1; extscalar = 1; extvector = 1; @@ -107,7 +108,6 @@ int FixIndent::setmask() { int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; mask |= MIN_POST_FORCE; return mask; diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index 8bc2aa3976..f798252a50 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -39,7 +39,6 @@ #include "error.h" #include "group.h" - using namespace LAMMPS_NS; using namespace FixConst; @@ -62,6 +61,7 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; global_freq = 1; extscalar = 1; + ecouple_flag = 1; nevery = 1; if (strstr(arg[3],"v_") == arg[3]) { @@ -159,7 +159,7 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : id_temp = nullptr; temperature = nullptr; - energy = 0.0; + ecouple = 0.0; // flangevin is unallocated until first call to setup() // compute_scalar checks for this and returns 0.0 @@ -192,7 +192,6 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : lv[i][2] = 0.0; } } - } /* ---------------------------------------------------------------------- */ @@ -224,7 +223,6 @@ int FixLangevin::setmask() mask |= POST_FORCE; mask |= POST_FORCE_RESPA; mask |= END_OF_STEP; - mask |= THERMO_ENERGY; return mask; } @@ -992,7 +990,7 @@ void FixLangevin::end_of_step() } } - energy += energy_onestep*update->dt; + ecouple += energy_onestep*update->dt; } /* ---------------------------------------------------------------------- */ @@ -1070,7 +1068,7 @@ double FixLangevin::compute_scalar() if (mask[i] & groupbit) energy_onestep += flangevin[i][0]*v[i][0] + flangevin[i][1]*v[i][1] + flangevin[i][2]*v[i][2]; - energy = 0.5*energy_onestep*update->dt; + ecouple = 0.5*energy_onestep*update->dt; } else { for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) { @@ -1081,13 +1079,13 @@ double FixLangevin::compute_scalar() if (tbiasflag) temperature->restore_bias(i, lv[i]); } - energy = -0.5*energy_onestep*update->dt; + ecouple = -0.5*energy_onestep*update->dt; } } // convert midstep energy back to previous fullstep energy - double energy_me = energy - 0.5*energy_onestep*update->dt; + double energy_me = ecouple - 0.5*energy_onestep*update->dt; double energy_all; MPI_Allreduce(&energy_me,&energy_all,1,MPI_DOUBLE,MPI_SUM,world); diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index 674cda4529..ee2b74ddb9 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -66,6 +66,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extscalar = 1; extvector = 0; + ecouple_flag = 1; // default values @@ -632,7 +633,6 @@ int FixNH::setmask() int mask = 0; mask |= INITIAL_INTEGRATE; mask |= FINAL_INTEGRATE; - mask |= THERMO_ENERGY; mask |= INITIAL_INTEGRATE_RESPA; mask |= FINAL_INTEGRATE_RESPA; if (pre_exchange_flag) mask |= PRE_EXCHANGE; diff --git a/src/fix_restrain.cpp b/src/fix_restrain.cpp index d1a05c2aca..82e91c8289 100644 --- a/src/fix_restrain.cpp +++ b/src/fix_restrain.cpp @@ -30,7 +30,6 @@ #include "memory.h" #include "error.h" - using namespace LAMMPS_NS; using namespace FixConst; using namespace MathConst; @@ -57,6 +56,7 @@ FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) : vector_flag = 1; size_vector = 3; extvector = 1; + energy_global_flag = 1; respa_level_support = 1; ilevel_respa = 0; @@ -176,7 +176,6 @@ int FixRestrain::setmask() { int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; mask |= MIN_POST_FORCE; return mask; diff --git a/src/fix_spring.cpp b/src/fix_spring.cpp index d3f89ec97a..4bbaf594bd 100644 --- a/src/fix_spring.cpp +++ b/src/fix_spring.cpp @@ -47,6 +47,7 @@ FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extscalar = 1; extvector = 1; + energy_global_flag = 1; dynamic_group_allow = 1; respa_level_support = 1; ilevel_respa = 0; @@ -108,7 +109,6 @@ int FixSpring::setmask() { int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; mask |= MIN_POST_FORCE; return mask; diff --git a/src/fix_spring_chunk.cpp b/src/fix_spring_chunk.cpp index 130998dcd5..9ae4ee4632 100644 --- a/src/fix_spring_chunk.cpp +++ b/src/fix_spring_chunk.cpp @@ -43,6 +43,7 @@ FixSpringChunk::FixSpringChunk(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; global_freq = 1; extscalar = 1; + energy_global_flag = 1; respa_level_support = 1; ilevel_respa = 0; @@ -86,7 +87,6 @@ int FixSpringChunk::setmask() { int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; mask |= MIN_POST_FORCE; return mask; diff --git a/src/fix_spring_self.cpp b/src/fix_spring_self.cpp index 50d09acf50..b736271912 100644 --- a/src/fix_spring_self.cpp +++ b/src/fix_spring_self.cpp @@ -42,6 +42,7 @@ FixSpringSelf::FixSpringSelf(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; global_freq = 1; extscalar = 1; + energy_global_flag = 1; respa_level_support = 1; k = utils::numeric(FLERR,arg[3],false,lmp); @@ -110,7 +111,6 @@ int FixSpringSelf::setmask() { int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; mask |= MIN_POST_FORCE; return mask; diff --git a/src/fix_temp_berendsen.cpp b/src/fix_temp_berendsen.cpp index afa41c50e4..61cec81e8f 100644 --- a/src/fix_temp_berendsen.cpp +++ b/src/fix_temp_berendsen.cpp @@ -26,7 +26,6 @@ #include "compute.h" #include "error.h" - using namespace LAMMPS_NS; using namespace FixConst; @@ -45,10 +44,11 @@ FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) : restart_global = 1; dynamic_group_allow = 1; - nevery = 1; scalar_flag = 1; - global_freq = nevery; extscalar = 1; + ecouple_flag = 1; + nevery = 1; + global_freq = nevery; tstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { @@ -81,7 +81,7 @@ FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) : modify->add_compute(cmd); tflag = 1; - energy = 0; + ecouple = 0; } /* ---------------------------------------------------------------------- */ @@ -102,7 +102,6 @@ int FixTempBerendsen::setmask() { int mask = 0; mask |= END_OF_STEP; - mask |= THERMO_ENERGY; return mask; } @@ -171,7 +170,7 @@ void FixTempBerendsen::end_of_step() double lamda = sqrt(1.0 + update->dt/t_period*(t_target/t_current - 1.0)); double efactor = 0.5 * force->boltz * tdof; - energy += t_current * (1.0-lamda*lamda) * efactor; + ecouple += t_current * (1.0-lamda*lamda) * efactor; double **v = atom->v; int *mask = atom->mask; @@ -239,7 +238,7 @@ void FixTempBerendsen::reset_target(double t_new) double FixTempBerendsen::compute_scalar() { - return energy; + return ecouple; } /* ---------------------------------------------------------------------- @@ -250,7 +249,7 @@ void FixTempBerendsen::write_restart(FILE *fp) { int n = 0; double list[1]; - list[n++] = energy; + list[n++] = ecouple; if (comm->me == 0) { int size = n * sizeof(double); @@ -267,7 +266,7 @@ void FixTempBerendsen::restart(char *buf) { double *list = (double *) buf; - energy = list[0]; + ecouple = list[0]; } /* ---------------------------------------------------------------------- diff --git a/src/fix_temp_csld.cpp b/src/fix_temp_csld.cpp index 3b522c185f..da6447b694 100644 --- a/src/fix_temp_csld.cpp +++ b/src/fix_temp_csld.cpp @@ -32,7 +32,6 @@ #include "random_mars.h" #include "error.h" - using namespace LAMMPS_NS; using namespace FixConst; @@ -52,6 +51,7 @@ FixTempCSLD::FixTempCSLD(LAMMPS *lmp, int narg, char **arg) : restart_global = 1; nevery = 1; scalar_flag = 1; + ecouple_flag = 1; global_freq = nevery; dynamic_group_allow = 1; extscalar = 1; @@ -92,7 +92,7 @@ FixTempCSLD::FixTempCSLD(LAMMPS *lmp, int narg, char **arg) : vhold = nullptr; nmax = -1; - energy = 0.0; + ecouple = 0.0; } /* ---------------------------------------------------------------------- */ @@ -118,7 +118,6 @@ int FixTempCSLD::setmask() { int mask = 0; mask |= END_OF_STEP; - mask |= THERMO_ENERGY; return mask; } @@ -251,7 +250,7 @@ void FixTempCSLD::end_of_step() // tally the kinetic energy transferred between heat bath and system t_current = temperature->compute_scalar(); - energy += ekin_old - t_current * 0.5 * temperature->dof * force->boltz; + ecouple += ekin_old - t_current * 0.5 * temperature->dof * force->boltz; } /* ---------------------------------------------------------------------- */ @@ -295,10 +294,9 @@ void FixTempCSLD::reset_target(double t_new) double FixTempCSLD::compute_scalar() { - return energy; + return ecouple; } - /* ---------------------------------------------------------------------- pack entire state of Fix into one write ------------------------------------------------------------------------- */ @@ -306,11 +304,11 @@ double FixTempCSLD::compute_scalar() void FixTempCSLD::write_restart(FILE *fp) { const int PRNGSIZE = 98+2+3; - int nsize = PRNGSIZE*comm->nprocs+2; // pRNG state per proc + nprocs + energy + int nsize = PRNGSIZE*comm->nprocs+2; // pRNG state per proc + nprocs + ecouple double *list = nullptr; if (comm->me == 0) { list = new double[nsize]; - list[0] = energy; + list[0] = ecouple; list[1] = comm->nprocs; } double state[PRNGSIZE]; @@ -333,7 +331,7 @@ void FixTempCSLD::restart(char *buf) { double *list = (double *) buf; - energy = list[0]; + ecouple = list[0]; int nprocs = (int) list[1]; if (nprocs != comm->nprocs) { if (comm->me == 0) diff --git a/src/fix_temp_csvr.cpp b/src/fix_temp_csvr.cpp index eedf24c387..8779e7fb5e 100644 --- a/src/fix_temp_csvr.cpp +++ b/src/fix_temp_csvr.cpp @@ -33,89 +33,12 @@ #include "random_mars.h" #include "error.h" - using namespace LAMMPS_NS; using namespace FixConst; enum{NOBIAS,BIAS}; enum{CONSTANT,EQUAL}; -double FixTempCSVR::gamdev(const int ia) -{ - int j; - double am,e,s,v1,v2,x,y; - - if (ia < 1) return 0.0; - if (ia < 6) { - x=1.0; - for (j=1; j<=ia; j++) - x *= random->uniform(); - - // make certain, that -log() doesn't overflow. - if (x < 2.2250759805e-308) - x = 708.4; - else - x = -log(x); - } else { - restart: - do { - do { - do { - v1 = random->uniform(); - v2 = 2.0*random->uniform() - 1.0; - } while (v1*v1 + v2*v2 > 1.0); - - y=v2/v1; - am=ia-1; - s=sqrt(2.0*am+1.0); - x=s*y+am; - } while (x <= 0.0); - - if (am*log(x/am)-s*y < -700 || v1<0.00001) { - goto restart; - } - - e=(1.0+y*y)*exp(am*log(x/am)-s*y); - } while (random->uniform() > e); - } - return x; -} - -/* ------------------------------------------------------------------- - returns the sum of n independent gaussian noises squared - (i.e. equivalent to summing the square of the return values of nn - calls to gasdev) ----------------------------------------------------------------------- */ -double FixTempCSVR::sumnoises(int nn) { - if (nn == 0) { - return 0.0; - } else if (nn == 1) { - const double rr = random->gaussian(); - return rr*rr; - } else if (nn % 2 == 0) { - return 2.0 * gamdev(nn / 2); - } else { - const double rr = random->gaussian(); - return 2.0 * gamdev((nn-1) / 2) + rr*rr; - } -} - -/* ------------------------------------------------------------------- - returns the scaling factor for velocities to thermalize - the system so it samples the canonical ensemble ----------------------------------------------------------------------- */ - -double FixTempCSVR::resamplekin(double ekin_old, double ekin_new) { - const double tdof = temperature->dof; - const double c1 = exp(-update->dt/t_period); - const double c2 = (1.0-c1)*ekin_new/ekin_old/tdof; - const double r1 = random->gaussian(); - const double r2 = sumnoises(tdof - 1); - - const double scale = c1 + c2*(r1*r1+r2) + 2.0*r1*sqrt(c1*c2); - return sqrt(scale); -} - /* ---------------------------------------------------------------------- */ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) : @@ -129,6 +52,7 @@ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) : restart_global = 1; nevery = 1; scalar_flag = 1; + ecouple_flag = 1; global_freq = nevery; dynamic_group_allow = 1; extscalar = 1; @@ -168,7 +92,7 @@ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) : tflag = 1; nmax = -1; - energy = 0.0; + ecouple = 0.0; } /* ---------------------------------------------------------------------- */ @@ -192,7 +116,6 @@ int FixTempCSVR::setmask() { int mask = 0; mask |= END_OF_STEP; - mask |= THERMO_ENERGY; return mask; } @@ -200,7 +123,6 @@ int FixTempCSVR::setmask() void FixTempCSVR::init() { - // check variable if (tstr) { @@ -224,7 +146,6 @@ void FixTempCSVR::init() void FixTempCSVR::end_of_step() { - // set current t_target // if variable temp, evaluate variable, wrap with clear/add @@ -285,7 +206,7 @@ void FixTempCSVR::end_of_step() // tally the kinetic energy transferred between heat bath and system - energy += ekin_old * (1.0 - lamda*lamda); + ecouple += ekin_old * (1.0 - lamda*lamda); } /* ---------------------------------------------------------------------- */ @@ -320,6 +241,85 @@ int FixTempCSVR::modify_param(int narg, char **arg) /* ---------------------------------------------------------------------- */ +double FixTempCSVR::gamdev(const int ia) +{ + int j; + double am,e,s,v1,v2,x,y; + + if (ia < 1) return 0.0; + if (ia < 6) { + x=1.0; + for (j=1; j<=ia; j++) + x *= random->uniform(); + + // make certain, that -log() doesn't overflow. + if (x < 2.2250759805e-308) + x = 708.4; + else + x = -log(x); + } else { + restart: + do { + do { + do { + v1 = random->uniform(); + v2 = 2.0*random->uniform() - 1.0; + } while (v1*v1 + v2*v2 > 1.0); + + y=v2/v1; + am=ia-1; + s=sqrt(2.0*am+1.0); + x=s*y+am; + } while (x <= 0.0); + + if (am*log(x/am)-s*y < -700 || v1<0.00001) { + goto restart; + } + + e=(1.0+y*y)*exp(am*log(x/am)-s*y); + } while (random->uniform() > e); + } + return x; +} + +/* ------------------------------------------------------------------- + returns the sum of n independent gaussian noises squared + (i.e. equivalent to summing the square of the return values of nn + calls to gasdev) +---------------------------------------------------------------------- */ + +double FixTempCSVR::sumnoises(int nn) { + if (nn == 0) { + return 0.0; + } else if (nn == 1) { + const double rr = random->gaussian(); + return rr*rr; + } else if (nn % 2 == 0) { + return 2.0 * gamdev(nn / 2); + } else { + const double rr = random->gaussian(); + return 2.0 * gamdev((nn-1) / 2) + rr*rr; + } +} + +/* ------------------------------------------------------------------- + returns the scaling factor for velocities to thermalize + the system so it samples the canonical ensemble +---------------------------------------------------------------------- */ + +double FixTempCSVR::resamplekin(double ekin_old, double ekin_new) { + const double tdof = temperature->dof; + const double c1 = exp(-update->dt/t_period); + const double c2 = (1.0-c1)*ekin_new/ekin_old/tdof; + const double r1 = random->gaussian(); + const double r2 = sumnoises(tdof - 1); + + const double scale = c1 + c2*(r1*r1+r2) + 2.0*r1*sqrt(c1*c2); + return sqrt(scale); +} + +/* ---------------------------------------------------------------------- */ + void FixTempCSVR::reset_target(double t_new) { t_target = t_start = t_stop = t_new; @@ -329,7 +329,7 @@ void FixTempCSVR::reset_target(double t_new) double FixTempCSVR::compute_scalar() { - return energy; + return ecouple; } /* ---------------------------------------------------------------------- @@ -339,11 +339,11 @@ double FixTempCSVR::compute_scalar() void FixTempCSVR::write_restart(FILE *fp) { const int PRNGSIZE = 98+2+3; - int nsize = PRNGSIZE*comm->nprocs+2; // pRNG state per proc + nprocs + energy + int nsize = PRNGSIZE*comm->nprocs+2; // pRNG state per proc + nprocs + ecouple double *list = nullptr; if (comm->me == 0) { list = new double[nsize]; - list[0] = energy; + list[0] = ecouple; list[1] = comm->nprocs; } double state[PRNGSIZE]; @@ -366,7 +366,7 @@ void FixTempCSVR::restart(char *buf) { double *list = (double *) buf; - energy = list[0]; + ecouple = list[0]; int nprocs = (int) list[1]; if (nprocs != comm->nprocs) { if (comm->me == 0) diff --git a/src/fix_temp_rescale.cpp b/src/fix_temp_rescale.cpp index 5e6638a56c..80470e3ccb 100644 --- a/src/fix_temp_rescale.cpp +++ b/src/fix_temp_rescale.cpp @@ -48,6 +48,7 @@ FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; global_freq = nevery; extscalar = 1; + ecouple_flag = 1; dynamic_group_allow = 1; tstr = nullptr; @@ -77,7 +78,7 @@ FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) : modify->add_compute(cmd); tflag = 1; - energy = 0.0; + ecouple = 0.0; } /* ---------------------------------------------------------------------- */ @@ -98,7 +99,6 @@ int FixTempRescale::setmask() { int mask = 0; mask |= END_OF_STEP; - mask |= THERMO_ENERGY; return mask; } @@ -171,7 +171,7 @@ void FixTempRescale::end_of_step() int *mask = atom->mask; int nlocal = atom->nlocal; - energy += (t_current-t_target) * efactor; + ecouple += (t_current-t_target) * efactor; if (which == NOBIAS) { for (int i = 0; i < nlocal; i++) { @@ -236,7 +236,7 @@ void FixTempRescale::reset_target(double t_new) double FixTempRescale::compute_scalar() { - return energy; + return ecouple; } /* ---------------------------------------------------------------------- @@ -247,7 +247,7 @@ void FixTempRescale::write_restart(FILE *fp) { int n = 0; double list[1]; - list[n++] = energy; + list[n++] = ecouple; if (comm->me == 0) { int size = n * sizeof(double); @@ -265,7 +265,7 @@ void FixTempRescale::restart(char *buf) int n = 0; double *list = (double *) buf; - energy = list[n++]; + ecouple = list[n++]; } /* ---------------------------------------------------------------------- diff --git a/src/fix_wall.cpp b/src/fix_wall.cpp index 31aae965d4..5740045a63 100644 --- a/src/fix_wall.cpp +++ b/src/fix_wall.cpp @@ -41,9 +41,10 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extscalar = 1; extvector = 1; + energy_global_flag = 1; + virial_global_flag = virial_atom_flag = 1; respa_level_support = 1; ilevel_respa = 0; - virial_flag = 1; // parse args @@ -233,7 +234,6 @@ int FixWall::setmask() if (fldflag) mask |= PRE_FORCE; else mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; mask |= MIN_POST_FORCE; return mask; @@ -310,12 +310,12 @@ void FixWall::pre_force(int vflag) void FixWall::post_force(int vflag) { + // virial setup - // energy and virial setup + v_init(vflag); - eflag = 0; - if (vflag) v_setup(vflag); - else evflag = 0; + // energy intialize + for (int m = 0; m <= nwall; m++) ewall[m] = 0.0; // coord = current position of wall diff --git a/src/fix_wall_harmonic.cpp b/src/fix_wall_harmonic.cpp index 864125d93f..ffd950262b 100644 --- a/src/fix_wall_harmonic.cpp +++ b/src/fix_wall_harmonic.cpp @@ -67,7 +67,7 @@ void FixWallHarmonic::wall_particle(int m, int which, double coord) if (evflag) { if (side < 0) vn = -fwall*delta; else vn = fwall*delta; - v_tally(dim, i, vn); + v_tally(dim,i,vn); } } diff --git a/src/fix_wall_region.cpp b/src/fix_wall_region.cpp index 3107f876de..2399dbfe94 100644 --- a/src/fix_wall_region.cpp +++ b/src/fix_wall_region.cpp @@ -44,9 +44,10 @@ FixWallRegion::FixWallRegion(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extscalar = 1; extvector = 1; + energy_global_flag = 1; + virial_global_flag = virial_atom_flag = 1; respa_level_support = 1; ilevel_respa = 0; - virial_flag = 1; // parse args @@ -104,7 +105,6 @@ int FixWallRegion::setmask() { int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; mask |= MIN_POST_FORCE; return mask; @@ -234,11 +234,9 @@ void FixWallRegion::post_force(int vflag) int onflag = 0; - // energy and virial setup + // virial setup - eflag = 0; - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // region->match() insures particle is in region or on surface, else error // if returned contact dist r = 0, is on surface, also an error From 6e3b9307a45987c8ff957b2e54945461f935b96d Mon Sep 17 00:00:00 2001 From: Plimpton Date: Thu, 21 Jan 2021 11:56:33 -0700 Subject: [PATCH 045/384] remove ecouple variable from Fix --- src/fix.h | 8 ++++---- src/fix_langevin.cpp | 13 +++++++------ src/fix_nh.cpp | 6 ++++-- src/fix_temp_berendsen.cpp | 10 +++++----- src/fix_temp_csld.cpp | 12 ++++++------ src/fix_temp_csvr.cpp | 12 ++++++------ src/fix_temp_rescale.cpp | 10 +++++----- src/modify.cpp | 4 ++-- 8 files changed, 39 insertions(+), 36 deletions(-) diff --git a/src/fix.h b/src/fix.h index 290ceebcda..af8e4dc554 100644 --- a/src/fix.h +++ b/src/fix.h @@ -47,7 +47,8 @@ class Fix : protected Pointers { int energy_atom_flag; // 1 if contributes to peratom eng int virial_global_flag; // 1 if contributes to global virial int virial_peratom_flag; // 1 if contributes to peratom virial - int ecouple_flag; // 1 if thermostat which accumulates eng to ecouple + int ecouple_flag; // 1 if thermostat fix outputs cumulative + // reservoir energy via compute_scalar() int time_integrate; // 1 if performs time integration, 0 if no int rigid_flag; // 1 if integrates rigid bodies, 0 if not int no_change_box; // 1 if cannot swap ortho <-> triclinic @@ -102,9 +103,8 @@ class Fix : protected Pointers { int comm_reverse; // size of reverse communication (0 if none) int comm_border; // size of border communication (0 if none) - double ecouple; // cumulative energy added to reservoir by thermostatting - double virial[6]; // virial for this timestep - double *eatom,**vatom; // per-atom energy/virial for this timestep + double virial[6]; // virial for this timestep + double *eatom,**vatom; // per-atom energy/virial for this timestep int centroidstressflag; // centroid stress compared to two-body stress // CENTROID_SAME = same as two-body stress diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index f798252a50..cb7c87e6ff 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -53,7 +53,8 @@ enum{CONSTANT,EQUAL,ATOM}; FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), gjfflag(0), gfactor1(nullptr), gfactor2(nullptr), ratio(nullptr), tstr(nullptr), - flangevin(nullptr), tforce(nullptr), franprev(nullptr), lv(nullptr), id_temp(nullptr), random(nullptr) + flangevin(nullptr), tforce(nullptr), franprev(nullptr), + lv(nullptr), id_temp(nullptr), random(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix langevin command"); @@ -159,7 +160,7 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : id_temp = nullptr; temperature = nullptr; - ecouple = 0.0; + energy = 0.0; // flangevin is unallocated until first call to setup() // compute_scalar checks for this and returns 0.0 @@ -990,7 +991,7 @@ void FixLangevin::end_of_step() } } - ecouple += energy_onestep*update->dt; + energy += energy_onestep*update->dt; } /* ---------------------------------------------------------------------- */ @@ -1068,7 +1069,7 @@ double FixLangevin::compute_scalar() if (mask[i] & groupbit) energy_onestep += flangevin[i][0]*v[i][0] + flangevin[i][1]*v[i][1] + flangevin[i][2]*v[i][2]; - ecouple = 0.5*energy_onestep*update->dt; + energy = 0.5*energy_onestep*update->dt; } else { for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) { @@ -1079,13 +1080,13 @@ double FixLangevin::compute_scalar() if (tbiasflag) temperature->restore_bias(i, lv[i]); } - ecouple = -0.5*energy_onestep*update->dt; + energy = -0.5*energy_onestep*update->dt; } } // convert midstep energy back to previous fullstep energy - double energy_me = ecouple - 0.5*energy_onestep*update->dt; + double energy_me = energy - 0.5*energy_onestep*update->dt; double energy_all; MPI_Allreduce(&energy_me,&energy_all,1,MPI_DOUBLE,MPI_SUM,world); diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index ee2b74ddb9..f4de07a5ae 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -51,7 +51,8 @@ enum{ISO,ANISO,TRICLINIC}; FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - rfix(nullptr), id_dilate(nullptr), irregular(nullptr), id_temp(nullptr), id_press(nullptr), + rfix(nullptr), id_dilate(nullptr), irregular(nullptr), + id_temp(nullptr), id_press(nullptr), eta(nullptr), eta_dot(nullptr), eta_dotdot(nullptr), eta_mass(nullptr), etap(nullptr), etap_dot(nullptr), etap_dotdot(nullptr), etap_mass(nullptr) @@ -784,7 +785,8 @@ void FixNH::setup(int /*vflag*/) } else { t0 = temperature->compute_scalar(); if (t0 < EPSILON) - error->all(FLERR, "Current temperature too close to zero, consider using ptemp setting"); + error->all(FLERR,"Current temperature too close to zero, " + "consider using ptemp setting"); } } t_target = t0; diff --git a/src/fix_temp_berendsen.cpp b/src/fix_temp_berendsen.cpp index 61cec81e8f..0ff5857fb5 100644 --- a/src/fix_temp_berendsen.cpp +++ b/src/fix_temp_berendsen.cpp @@ -81,7 +81,7 @@ FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) : modify->add_compute(cmd); tflag = 1; - ecouple = 0; + energy = 0; } /* ---------------------------------------------------------------------- */ @@ -170,7 +170,7 @@ void FixTempBerendsen::end_of_step() double lamda = sqrt(1.0 + update->dt/t_period*(t_target/t_current - 1.0)); double efactor = 0.5 * force->boltz * tdof; - ecouple += t_current * (1.0-lamda*lamda) * efactor; + energy += t_current * (1.0-lamda*lamda) * efactor; double **v = atom->v; int *mask = atom->mask; @@ -238,7 +238,7 @@ void FixTempBerendsen::reset_target(double t_new) double FixTempBerendsen::compute_scalar() { - return ecouple; + return energy; } /* ---------------------------------------------------------------------- @@ -249,7 +249,7 @@ void FixTempBerendsen::write_restart(FILE *fp) { int n = 0; double list[1]; - list[n++] = ecouple; + list[n++] = energy; if (comm->me == 0) { int size = n * sizeof(double); @@ -266,7 +266,7 @@ void FixTempBerendsen::restart(char *buf) { double *list = (double *) buf; - ecouple = list[0]; + energy = list[0]; } /* ---------------------------------------------------------------------- diff --git a/src/fix_temp_csld.cpp b/src/fix_temp_csld.cpp index da6447b694..b4da730b97 100644 --- a/src/fix_temp_csld.cpp +++ b/src/fix_temp_csld.cpp @@ -92,7 +92,7 @@ FixTempCSLD::FixTempCSLD(LAMMPS *lmp, int narg, char **arg) : vhold = nullptr; nmax = -1; - ecouple = 0.0; + energy = 0.0; } /* ---------------------------------------------------------------------- */ @@ -250,7 +250,7 @@ void FixTempCSLD::end_of_step() // tally the kinetic energy transferred between heat bath and system t_current = temperature->compute_scalar(); - ecouple += ekin_old - t_current * 0.5 * temperature->dof * force->boltz; + energy += ekin_old - t_current * 0.5 * temperature->dof * force->boltz; } /* ---------------------------------------------------------------------- */ @@ -294,7 +294,7 @@ void FixTempCSLD::reset_target(double t_new) double FixTempCSLD::compute_scalar() { - return ecouple; + return energy; } /* ---------------------------------------------------------------------- @@ -304,11 +304,11 @@ double FixTempCSLD::compute_scalar() void FixTempCSLD::write_restart(FILE *fp) { const int PRNGSIZE = 98+2+3; - int nsize = PRNGSIZE*comm->nprocs+2; // pRNG state per proc + nprocs + ecouple + int nsize = PRNGSIZE*comm->nprocs+2; // pRNG state per proc + nprocs + energy double *list = nullptr; if (comm->me == 0) { list = new double[nsize]; - list[0] = ecouple; + list[0] = energy; list[1] = comm->nprocs; } double state[PRNGSIZE]; @@ -331,7 +331,7 @@ void FixTempCSLD::restart(char *buf) { double *list = (double *) buf; - ecouple = list[0]; + energy = list[0]; int nprocs = (int) list[1]; if (nprocs != comm->nprocs) { if (comm->me == 0) diff --git a/src/fix_temp_csvr.cpp b/src/fix_temp_csvr.cpp index 8779e7fb5e..b89cf9959a 100644 --- a/src/fix_temp_csvr.cpp +++ b/src/fix_temp_csvr.cpp @@ -92,7 +92,7 @@ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) : tflag = 1; nmax = -1; - ecouple = 0.0; + energy = 0.0; } /* ---------------------------------------------------------------------- */ @@ -206,7 +206,7 @@ void FixTempCSVR::end_of_step() // tally the kinetic energy transferred between heat bath and system - ecouple += ekin_old * (1.0 - lamda*lamda); + energy += ekin_old * (1.0 - lamda*lamda); } /* ---------------------------------------------------------------------- */ @@ -329,7 +329,7 @@ void FixTempCSVR::reset_target(double t_new) double FixTempCSVR::compute_scalar() { - return ecouple; + return energy; } /* ---------------------------------------------------------------------- @@ -339,11 +339,11 @@ double FixTempCSVR::compute_scalar() void FixTempCSVR::write_restart(FILE *fp) { const int PRNGSIZE = 98+2+3; - int nsize = PRNGSIZE*comm->nprocs+2; // pRNG state per proc + nprocs + ecouple + int nsize = PRNGSIZE*comm->nprocs+2; // pRNG state per proc + nprocs + energy double *list = nullptr; if (comm->me == 0) { list = new double[nsize]; - list[0] = ecouple; + list[0] = energy; list[1] = comm->nprocs; } double state[PRNGSIZE]; @@ -366,7 +366,7 @@ void FixTempCSVR::restart(char *buf) { double *list = (double *) buf; - ecouple = list[0]; + energy = list[0]; int nprocs = (int) list[1]; if (nprocs != comm->nprocs) { if (comm->me == 0) diff --git a/src/fix_temp_rescale.cpp b/src/fix_temp_rescale.cpp index 80470e3ccb..b393815faf 100644 --- a/src/fix_temp_rescale.cpp +++ b/src/fix_temp_rescale.cpp @@ -78,7 +78,7 @@ FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) : modify->add_compute(cmd); tflag = 1; - ecouple = 0.0; + energy = 0.0; } /* ---------------------------------------------------------------------- */ @@ -171,7 +171,7 @@ void FixTempRescale::end_of_step() int *mask = atom->mask; int nlocal = atom->nlocal; - ecouple += (t_current-t_target) * efactor; + energy += (t_current-t_target) * efactor; if (which == NOBIAS) { for (int i = 0; i < nlocal; i++) { @@ -236,7 +236,7 @@ void FixTempRescale::reset_target(double t_new) double FixTempRescale::compute_scalar() { - return ecouple; + return energy; } /* ---------------------------------------------------------------------- @@ -247,7 +247,7 @@ void FixTempRescale::write_restart(FILE *fp) { int n = 0; double list[1]; - list[n++] = ecouple; + list[n++] = energy; if (comm->me == 0) { int size = n * sizeof(double); @@ -265,7 +265,7 @@ void FixTempRescale::restart(char *buf) int n = 0; double *list = (double *) buf; - ecouple = list[n++]; + energy = list[n++]; } /* ---------------------------------------------------------------------- diff --git a/src/modify.cpp b/src/modify.cpp index 5812947dd4..f8718ca5df 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -489,7 +489,7 @@ void Modify::end_of_step() /* ---------------------------------------------------------------------- coupling energy call, only for relevant fixes - stored by each fix in ecouple variable + each thermostsat fix returns this via compute_scalar() ecouple = cumulative energy added to reservoir by thermostatting ------------------------------------------------------------------------- */ @@ -497,7 +497,7 @@ double Modify::energy_couple() { double energy = 0.0; for (int i = 0; i < n_energy_couple; i++) - energy += fix[list_energy_couple[i]]->ecouple; + energy += fix[list_energy_couple[i]]->compute_scalar(); return energy; } From 2c1b6adce32f7781d24ba17f1267966ea6ec6c6e Mon Sep 17 00:00:00 2001 From: Plimpton Date: Thu, 21 Jan 2021 12:00:16 -0700 Subject: [PATCH 046/384] change virial_atom to virial_peratom --- src/compute_stress_atom.cpp | 2 +- src/fix.cpp | 4 ++-- src/fix.h | 2 +- src/fix_addforce.cpp | 2 +- src/fix_external.cpp | 4 ++-- src/fix_wall.cpp | 2 +- src/fix_wall_region.cpp | 2 +- src/modify.cpp | 25 +++---------------------- 8 files changed, 12 insertions(+), 31 deletions(-) diff --git a/src/compute_stress_atom.cpp b/src/compute_stress_atom.cpp index aefb58dbb4..5f6b336802 100644 --- a/src/compute_stress_atom.cpp +++ b/src/compute_stress_atom.cpp @@ -222,7 +222,7 @@ void ComputeStressAtom::compute_peratom() Fix **fix = modify->fix; int nfix = modify->nfix; for (int ifix = 0; ifix < nfix; ifix++) - if (fix[i]->virial_atom_flag && fix[ifix]->virial_flag) { + if (fix[i]->virial_peratom_flag && fix[ifix]->virial_flag) { double **vatom = modify->fix[ifix]->vatom; if (vatom) for (i = 0; i < nlocal; i++) diff --git a/src/fix.cpp b/src/fix.cpp index bd3d91767b..c63893ea13 100644 --- a/src/fix.cpp +++ b/src/fix.cpp @@ -63,8 +63,8 @@ Fix::Fix(LAMMPS *lmp, int /*narg*/, char **arg) : box_change = NO_BOX_CHANGE; thermo_energy = 0; thermo_virial = 0; - energy_global_flag = energy_atom_flag = 0; - virial_global_flag = virial_atom_flag = 0; + energy_global_flag = energy_peratom_flag = 0; + virial_global_flag = virial_peratom_flag = 0; ecouple_flag = 0; rigid_flag = 0; peatom_flag = 0; diff --git a/src/fix.h b/src/fix.h index af8e4dc554..c4c9267e54 100644 --- a/src/fix.h +++ b/src/fix.h @@ -44,7 +44,7 @@ class Fix : protected Pointers { int thermo_energy; // 1 if fix_modify energy enabled, 0 if not int thermo_virial; // 1 if fix_modify virial enabled, 0 if not int energy_global_flag; // 1 if contributes to global eng - int energy_atom_flag; // 1 if contributes to peratom eng + int energy_peratom_flag; // 1 if contributes to peratom eng int virial_global_flag; // 1 if contributes to global virial int virial_peratom_flag; // 1 if contributes to peratom virial int ecouple_flag; // 1 if thermostat fix outputs cumulative diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp index 22c7408996..bd5dc767fd 100644 --- a/src/fix_addforce.cpp +++ b/src/fix_addforce.cpp @@ -49,7 +49,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; extvector = 1; energy_global_flag = 1; - virial_global_flag = virial_atom_flag = 1; + virial_global_flag = virial_peratom_flag = 1; respa_level_support = 1; ilevel_respa = 0; diff --git a/src/fix_external.cpp b/src/fix_external.cpp index f3ad25d3b3..c2bd447a47 100644 --- a/src/fix_external.cpp +++ b/src/fix_external.cpp @@ -36,8 +36,8 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; global_freq = 1; extscalar = 1; - energy_global_flag = energy_atom_flag = 1; - virial_global_flag = virial_atom_flag = 1; + energy_global_flag = energy_peratom_flag = 1; + virial_global_flag = virial_peratom_flag = 1; thermo_energy = thermo_virial = 1; if (strcmp(arg[3],"pf/callback") == 0) { diff --git a/src/fix_wall.cpp b/src/fix_wall.cpp index 5740045a63..942dd1f81a 100644 --- a/src/fix_wall.cpp +++ b/src/fix_wall.cpp @@ -42,7 +42,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; extvector = 1; energy_global_flag = 1; - virial_global_flag = virial_atom_flag = 1; + virial_global_flag = virial_peratom_flag = 1; respa_level_support = 1; ilevel_respa = 0; diff --git a/src/fix_wall_region.cpp b/src/fix_wall_region.cpp index 2399dbfe94..4d976373a5 100644 --- a/src/fix_wall_region.cpp +++ b/src/fix_wall_region.cpp @@ -45,7 +45,7 @@ FixWallRegion::FixWallRegion(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; extvector = 1; energy_global_flag = 1; - virial_global_flag = virial_atom_flag = 1; + virial_global_flag = virial_peratom_flag = 1; respa_level_support = 1; ilevel_respa = 0; diff --git a/src/modify.cpp b/src/modify.cpp index f8718ca5df..1dcd439c8e 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -1666,25 +1666,6 @@ void Modify::list_init_energy_couple(int &n, int *&list) if (fix[i]->ecouple_flag) list[n++] = i; } -/* ---------------------------------------------------------------------- - create list of fix indices for fixes that compute peratom energy - only added to list if fix has energy_atom_flag and thermo_energy set -------------------------------------------------------------------------- */ - -void Modify::list_init_energy_atom(int &n, int *&list) -{ - delete [] list; - - n = 0; - for (int i = 0; i < nfix; i++) - if (fix[i]->energy_atom_flag && fix[i]->thermo_energy) n++; - list = new int[n]; - - n = 0; - for (int i = 0; i < nfix; i++) - if (fix[i]->energy_atom_flag && fix[i]->thermo_energy) list[n++] = i; -} - /* ---------------------------------------------------------------------- create list of fix indices for fixes that compute global energy only added to list if fix has energy_global_flag and thermo_energy set @@ -1706,7 +1687,7 @@ void Modify::list_init_energy_global(int &n, int *&list) /* ---------------------------------------------------------------------- create list of fix indices for fixes that compute peratom energy - only added to list if fix has energy_atom_flag and thermo_energy set + only added to list if fix has energy_peratom_flag and thermo_energy set ------------------------------------------------------------------------- */ void Modify::list_init_energy_atom(int &n, int *&list) @@ -1715,12 +1696,12 @@ void Modify::list_init_energy_atom(int &n, int *&list) n = 0; for (int i = 0; i < nfix; i++) - if (fix[i]->energy_atom_flag && fix[i]->thermo_energy) n++; + if (fix[i]->energy_peratom_flag && fix[i]->thermo_energy) n++; list = new int[n]; n = 0; for (int i = 0; i < nfix; i++) - if (fix[i]->energy_atom_flag && fix[i]->thermo_energy) list[n++] = i; + if (fix[i]->energy_peratom_flag && fix[i]->thermo_energy) list[n++] = i; } /* ---------------------------------------------------------------------- From 20650dc7ceb616c336be8266c1cf14fb624cac79 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Thu, 21 Jan 2021 12:16:39 -0700 Subject: [PATCH 047/384] more changes --- src/compute_centroid_stress_atom.cpp | 10 ++++++---- src/compute_stress_atom.cpp | 2 +- src/fix.cpp | 7 ++++--- src/modify.cpp | 2 +- src/thermo.cpp | 5 +++-- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/compute_centroid_stress_atom.cpp b/src/compute_centroid_stress_atom.cpp index 1b814961a0..fa3122f5d6 100644 --- a/src/compute_centroid_stress_atom.cpp +++ b/src/compute_centroid_stress_atom.cpp @@ -149,7 +149,7 @@ void ComputeCentroidStressAtom::init() if (fixflag) { for (int ifix = 0; ifix < modify->nfix; ifix++) - if (modify->fix[ifix]->virial_flag && + if (modify->fix[ifix]->virial_peratom_flag && modify->fix[ifix]->centroidstressflag == CENTROID_NOTAVAIL) error->all(FLERR, "Fix style does not support compute centroid/stress/atom"); } @@ -273,9 +273,11 @@ void ComputeCentroidStressAtom::compute_peratom() // fix styles are CENTROID_SAME or CENTROID_NOTAVAIL if (fixflag) { - for (int ifix = 0; ifix < modify->nfix; ifix++) - if (modify->fix[ifix]->virial_flag) { - double **vatom = modify->fix[ifix]->vatom; + Fix **fix = modify->fix; + int nfix = modify->nfix; + for (int ifix = 0; ifix < nfix; ifix++) + if (fix[ifix]->virial_peratom_flag && fix[ifix]->thermo_virial) { + double **vatom = fix[ifix]->vatom; if (vatom) for (i = 0; i < nlocal; i++) { for (j = 0; j < 6; j++) diff --git a/src/compute_stress_atom.cpp b/src/compute_stress_atom.cpp index 5f6b336802..88b092ecba 100644 --- a/src/compute_stress_atom.cpp +++ b/src/compute_stress_atom.cpp @@ -222,7 +222,7 @@ void ComputeStressAtom::compute_peratom() Fix **fix = modify->fix; int nfix = modify->nfix; for (int ifix = 0; ifix < nfix; ifix++) - if (fix[i]->virial_peratom_flag && fix[ifix]->virial_flag) { + if (fix[i]->virial_peratom_flag && fix[ifix]->thermo_virial) { double **vatom = modify->fix[ifix]->vatom; if (vatom) for (i = 0; i < nlocal; i++) diff --git a/src/fix.cpp b/src/fix.cpp index c63893ea13..074040a4d8 100644 --- a/src/fix.cpp +++ b/src/fix.cpp @@ -67,7 +67,6 @@ Fix::Fix(LAMMPS *lmp, int /*narg*/, char **arg) : virial_global_flag = virial_peratom_flag = 0; ecouple_flag = 0; rigid_flag = 0; - peatom_flag = 0; no_change_box = 0; time_integrate = 0; time_depend = 0; @@ -152,7 +151,8 @@ void Fix::modify_params(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal fix_modify command"); if (strcmp(arg[iarg+1],"no") == 0) thermo_energy = 0; else if (strcmp(arg[iarg+1],"yes") == 0) { - if (energy_flag == 0) error->all(FLERR,"Illegal fix_modify command"); + if (energy_global_flag == 0 && energy_peratom_flag == 0) + error->all(FLERR,"Illegal fix_modify command"); thermo_energy = 1; } else error->all(FLERR,"Illegal fix_modify command"); iarg += 2; @@ -160,7 +160,8 @@ void Fix::modify_params(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal fix_modify command"); if (strcmp(arg[iarg+1],"no") == 0) thermo_virial = 0; else if (strcmp(arg[iarg+1],"yes") == 0) { - if (virial_flag == 0) error->all(FLERR,"Illegal fix_modify command"); + if (virial_global_flag == 0 && virial_peratom_flag == 0) + error->all(FLERR,"Illegal fix_modify command"); thermo_virial = 1; } else error->all(FLERR,"Illegal fix_modify command"); iarg += 2; diff --git a/src/modify.cpp b/src/modify.cpp index 1dcd439c8e..71fce8937a 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -510,7 +510,7 @@ double Modify::energy_couple() double Modify::energy_global() { double energy = 0.0; - for (i = 0; i < n_energy_global; i++) + for (int i = 0; i < n_energy_global; i++) energy += fix[list_energy_global[i]]->compute_scalar(); return energy; } diff --git a/src/thermo.cpp b/src/thermo.cpp index 626dc09c3f..9e4658fcdb 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -1366,7 +1366,8 @@ int Thermo::evaluate_keyword(const char *word, double *answer) compute_enthalpy(); } else if (strcmp(word,"ecouple") == 0) compute_ecouple(); - } else if (strcmp(word,"econserve") == 0) { + + else if (strcmp(word,"econserve") == 0) { if (!pe) error->all(FLERR, "Thermo keyword in variable requires thermo to use/init pe"); @@ -1765,7 +1766,7 @@ void Thermo::compute_etotal() void Thermo::compute_ecouple() { - dvalue = modify->ecouple(); + dvalue = modify->energy_couple(); } /* ---------------------------------------------------------------------- */ From 9decb3b37a4b45e87ac358128a9da5808989e912 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 21 Jan 2021 12:17:53 -0700 Subject: [PATCH 048/384] more changes --- src/compute_centroid_stress_atom.cpp | 10 ++++++---- src/compute_stress_atom.cpp | 2 +- src/fix.cpp | 7 ++++--- src/modify.cpp | 2 +- src/thermo.cpp | 5 +++-- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/compute_centroid_stress_atom.cpp b/src/compute_centroid_stress_atom.cpp index 1b814961a0..fa3122f5d6 100644 --- a/src/compute_centroid_stress_atom.cpp +++ b/src/compute_centroid_stress_atom.cpp @@ -149,7 +149,7 @@ void ComputeCentroidStressAtom::init() if (fixflag) { for (int ifix = 0; ifix < modify->nfix; ifix++) - if (modify->fix[ifix]->virial_flag && + if (modify->fix[ifix]->virial_peratom_flag && modify->fix[ifix]->centroidstressflag == CENTROID_NOTAVAIL) error->all(FLERR, "Fix style does not support compute centroid/stress/atom"); } @@ -273,9 +273,11 @@ void ComputeCentroidStressAtom::compute_peratom() // fix styles are CENTROID_SAME or CENTROID_NOTAVAIL if (fixflag) { - for (int ifix = 0; ifix < modify->nfix; ifix++) - if (modify->fix[ifix]->virial_flag) { - double **vatom = modify->fix[ifix]->vatom; + Fix **fix = modify->fix; + int nfix = modify->nfix; + for (int ifix = 0; ifix < nfix; ifix++) + if (fix[ifix]->virial_peratom_flag && fix[ifix]->thermo_virial) { + double **vatom = fix[ifix]->vatom; if (vatom) for (i = 0; i < nlocal; i++) { for (j = 0; j < 6; j++) diff --git a/src/compute_stress_atom.cpp b/src/compute_stress_atom.cpp index 5f6b336802..88b092ecba 100644 --- a/src/compute_stress_atom.cpp +++ b/src/compute_stress_atom.cpp @@ -222,7 +222,7 @@ void ComputeStressAtom::compute_peratom() Fix **fix = modify->fix; int nfix = modify->nfix; for (int ifix = 0; ifix < nfix; ifix++) - if (fix[i]->virial_peratom_flag && fix[ifix]->virial_flag) { + if (fix[i]->virial_peratom_flag && fix[ifix]->thermo_virial) { double **vatom = modify->fix[ifix]->vatom; if (vatom) for (i = 0; i < nlocal; i++) diff --git a/src/fix.cpp b/src/fix.cpp index c63893ea13..074040a4d8 100644 --- a/src/fix.cpp +++ b/src/fix.cpp @@ -67,7 +67,6 @@ Fix::Fix(LAMMPS *lmp, int /*narg*/, char **arg) : virial_global_flag = virial_peratom_flag = 0; ecouple_flag = 0; rigid_flag = 0; - peatom_flag = 0; no_change_box = 0; time_integrate = 0; time_depend = 0; @@ -152,7 +151,8 @@ void Fix::modify_params(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal fix_modify command"); if (strcmp(arg[iarg+1],"no") == 0) thermo_energy = 0; else if (strcmp(arg[iarg+1],"yes") == 0) { - if (energy_flag == 0) error->all(FLERR,"Illegal fix_modify command"); + if (energy_global_flag == 0 && energy_peratom_flag == 0) + error->all(FLERR,"Illegal fix_modify command"); thermo_energy = 1; } else error->all(FLERR,"Illegal fix_modify command"); iarg += 2; @@ -160,7 +160,8 @@ void Fix::modify_params(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal fix_modify command"); if (strcmp(arg[iarg+1],"no") == 0) thermo_virial = 0; else if (strcmp(arg[iarg+1],"yes") == 0) { - if (virial_flag == 0) error->all(FLERR,"Illegal fix_modify command"); + if (virial_global_flag == 0 && virial_peratom_flag == 0) + error->all(FLERR,"Illegal fix_modify command"); thermo_virial = 1; } else error->all(FLERR,"Illegal fix_modify command"); iarg += 2; diff --git a/src/modify.cpp b/src/modify.cpp index 1dcd439c8e..71fce8937a 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -510,7 +510,7 @@ double Modify::energy_couple() double Modify::energy_global() { double energy = 0.0; - for (i = 0; i < n_energy_global; i++) + for (int i = 0; i < n_energy_global; i++) energy += fix[list_energy_global[i]]->compute_scalar(); return energy; } diff --git a/src/thermo.cpp b/src/thermo.cpp index 626dc09c3f..9e4658fcdb 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -1366,7 +1366,8 @@ int Thermo::evaluate_keyword(const char *word, double *answer) compute_enthalpy(); } else if (strcmp(word,"ecouple") == 0) compute_ecouple(); - } else if (strcmp(word,"econserve") == 0) { + + else if (strcmp(word,"econserve") == 0) { if (!pe) error->all(FLERR, "Thermo keyword in variable requires thermo to use/init pe"); @@ -1765,7 +1766,7 @@ void Thermo::compute_etotal() void Thermo::compute_ecouple() { - dvalue = modify->ecouple(); + dvalue = modify->energy_couple(); } /* ---------------------------------------------------------------------- */ From b5525a19bc2ae8e9a4c39b52e5541ef52796ee82 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Thu, 21 Jan 2021 13:56:50 -0700 Subject: [PATCH 049/384] changes to files with THERMO_ENERGY mask in standard packages --- src/LATTE/fix_latte.cpp | 11 +++-------- src/MC/fix_gcmc.cpp | 4 ++-- src/MC/fix_widom.cpp | 4 ++-- src/MESSAGE/fix_client_md.cpp | 8 ++++---- src/MISC/fix_efield.cpp | 2 +- src/MISC/fix_orient_bcc.cpp | 3 +-- src/MISC/fix_orient_fcc.cpp | 3 +-- src/MOLECULE/fix_cmap.cpp | 7 +++---- src/REPLICA/fix_hyper_global.cpp | 2 +- src/REPLICA/fix_hyper_local.cpp | 3 +-- src/RIGID/fix_rigid_nh.cpp | 4 ++-- src/RIGID/fix_rigid_nh_small.cpp | 4 ++-- src/SHOCK/fix_msst.cpp | 4 +--- src/SPIN/fix_langevin_spin.cpp | 23 ----------------------- src/SPIN/fix_precession_spin.cpp | 7 +++---- src/USER-MISC/fix_orient_eco.cpp | 7 +++---- 16 files changed, 30 insertions(+), 66 deletions(-) diff --git a/src/LATTE/fix_latte.cpp b/src/LATTE/fix_latte.cpp index 46b15a60d0..4f2d90f3de 100644 --- a/src/LATTE/fix_latte.cpp +++ b/src/LATTE/fix_latte.cpp @@ -70,8 +70,9 @@ FixLatte::FixLatte(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; global_freq = 1; extscalar = 1; - virial_flag = 1; - thermo_virial = 1; + energy_global_flag = 1; + virial_global_flag = 1; + thermo_energy = thermo_virial = 1; // store ID of compute pe/atom used to generate Coulomb potential for LATTE // null pointer means LATTE will compute Coulombic potential @@ -117,12 +118,9 @@ FixLatte::~FixLatte() int FixLatte::setmask() { int mask = 0; - //mask |= INITIAL_INTEGRATE; - //mask |= FINAL_INTEGRATE; mask |= PRE_REVERSE; mask |= POST_FORCE; mask |= MIN_POST_FORCE; - mask |= THERMO_ENERGY; return mask; } @@ -267,9 +265,6 @@ void FixLatte::post_force(int vflag) // hardwire these unsupported flags for now int coulombflag = 0; - // pe_peratom = 0; - // virial_global = 1; // set via vflag_global at some point - // virial_peratom = 0; neighflag = 0; // set flags used by LATTE diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index 79cfd09f96..4c0cb1c9bf 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -2334,9 +2334,9 @@ double FixGCMC::energy_full() if (modify->n_post_force) modify->post_force(vflag); if (modify->n_end_of_step) modify->end_of_step(); - // NOTE: all fixes with THERMO_ENERGY mask set and which + // NOTE: all fixes with energy_global_flag set and which // operate at pre_force() or post_force() or end_of_step() - // and which user has enable via fix_modify thermo yes, + // and which user has enabled via fix_modify energy yes, // will contribute to total MC energy via pe->compute_scalar() update->eflag_global = update->ntimestep; diff --git a/src/MC/fix_widom.cpp b/src/MC/fix_widom.cpp index c06573ab1a..318314992f 100644 --- a/src/MC/fix_widom.cpp +++ b/src/MC/fix_widom.cpp @@ -1061,9 +1061,9 @@ double FixWidom::energy_full() if (modify->n_pre_force) modify->pre_force(vflag); if (modify->n_end_of_step) modify->end_of_step(); - // NOTE: all fixes with THERMO_ENERGY mask set and which + // NOTE: all fixes with energy_global_flag set and which // operate at pre_force() or post_force() or end_of_step() - // and which user has enable via fix_modify thermo yes, + // and which user has enabled via fix_modify energy yes, // will contribute to total MC energy via pe->compute_scalar() update->eflag_global = update->ntimestep; diff --git a/src/MESSAGE/fix_client_md.cpp b/src/MESSAGE/fix_client_md.cpp index cd0d45cda7..7482a33110 100644 --- a/src/MESSAGE/fix_client_md.cpp +++ b/src/MESSAGE/fix_client_md.cpp @@ -42,7 +42,8 @@ FixClientMD::FixClientMD(LAMMPS *lmp, int narg, char **arg) : { if (lmp->clientserver != 1) error->all(FLERR,"Fix client/md requires LAMMPS be running as a client"); - if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix client/md requires atom map"); + if (atom->map_style == Atom::MAP_NONE) + error->all(FLERR,"Fix client/md requires atom map"); if (sizeof(tagint) != 4) error->all(FLERR,"Fix client/md only supports 32-bit atom IDs"); @@ -54,8 +55,8 @@ FixClientMD::FixClientMD(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; global_freq = 1; extscalar = 1; - virial_flag = 1; - thermo_virial = 1; + energy_global_flag = virial_global_flag = 1; + thermo_energy = thermo_virial = 1; inv_nprocs = 1.0 / comm->nprocs; if (domain->dimension == 2) @@ -89,7 +90,6 @@ int FixClientMD::setmask() int mask = 0; mask |= POST_FORCE; mask |= MIN_POST_FORCE; - mask |= THERMO_ENERGY; return mask; } diff --git a/src/MISC/fix_efield.cpp b/src/MISC/fix_efield.cpp index fd81448b2b..9f50439158 100644 --- a/src/MISC/fix_efield.cpp +++ b/src/MISC/fix_efield.cpp @@ -49,6 +49,7 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : vector_flag = 1; scalar_flag = 1; size_vector = 3; + energy_global_flag = 1; global_freq = 1; extvector = 1; extscalar = 1; @@ -138,7 +139,6 @@ FixEfield::~FixEfield() int FixEfield::setmask() { int mask = 0; - mask |= THERMO_ENERGY; mask |= POST_FORCE; mask |= POST_FORCE_RESPA; mask |= MIN_POST_FORCE; diff --git a/src/MISC/fix_orient_bcc.cpp b/src/MISC/fix_orient_bcc.cpp index b6ab2545ad..f7a266be83 100644 --- a/src/MISC/fix_orient_bcc.cpp +++ b/src/MISC/fix_orient_bcc.cpp @@ -67,7 +67,7 @@ FixOrientBCC::FixOrientBCC(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; global_freq = 1; extscalar = 1; - + energy_global_flag = 1; peratom_flag = 1; size_peratom_cols = 2; peratom_freq = 1; @@ -202,7 +202,6 @@ int FixOrientBCC::setmask() { int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; return mask; } diff --git a/src/MISC/fix_orient_fcc.cpp b/src/MISC/fix_orient_fcc.cpp index f718df07ad..7dc89df977 100644 --- a/src/MISC/fix_orient_fcc.cpp +++ b/src/MISC/fix_orient_fcc.cpp @@ -65,7 +65,7 @@ FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; global_freq = 1; extscalar = 1; - + energy_global_flag = 1; peratom_flag = 1; size_peratom_cols = 2; peratom_freq = 1; @@ -200,7 +200,6 @@ int FixOrientFCC::setmask() { int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; return mask; } diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp index d8aee3e181..7fa5adf292 100644 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -70,10 +70,10 @@ FixCMAP::FixCMAP(LAMMPS *lmp, int narg, char **arg) : restart_global = 1; restart_peratom = 1; - peatom_flag = 1; - virial_flag = 1; + energy_global_flag = energy_peratom_flag = 1; + virial_global_flag = virial_peratom_flag = 1; + thermo_energy = thermo_virial = 1; centroidstressflag = CENTROID_NOTAVAIL; - thermo_virial = 1; peratom_freq = 1; scalar_flag = 1; global_freq = 1; @@ -154,7 +154,6 @@ int FixCMAP::setmask() mask |= PRE_NEIGHBOR; mask |= PRE_REVERSE; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; mask |= MIN_POST_FORCE; return mask; diff --git a/src/REPLICA/fix_hyper_global.cpp b/src/REPLICA/fix_hyper_global.cpp index d29aa36e31..8d0bc5bd2e 100644 --- a/src/REPLICA/fix_hyper_global.cpp +++ b/src/REPLICA/fix_hyper_global.cpp @@ -50,6 +50,7 @@ FixHyperGlobal::FixHyperGlobal(LAMMPS *lmp, int narg, char **arg) : hyperflag = 1; scalar_flag = 1; + energy_global_flag = 1; vector_flag = 1; size_vector = 12; global_freq = 1; @@ -104,7 +105,6 @@ int FixHyperGlobal::setmask() int mask = 0; mask |= PRE_NEIGHBOR; mask |= PRE_REVERSE; - mask |= THERMO_ENERGY; return mask; } diff --git a/src/REPLICA/fix_hyper_local.cpp b/src/REPLICA/fix_hyper_local.cpp index 4a18a47176..d0186006d4 100644 --- a/src/REPLICA/fix_hyper_local.cpp +++ b/src/REPLICA/fix_hyper_local.cpp @@ -31,7 +31,6 @@ #include "memory.h" #include "error.h" - using namespace LAMMPS_NS; using namespace FixConst; @@ -63,6 +62,7 @@ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : hyperflag = 2; scalar_flag = 1; + energy_global_flag = 1; vector_flag = 1; size_vector = 26; //size_vector = 28; // can add 2 for debugging @@ -237,7 +237,6 @@ int FixHyperLocal::setmask() mask |= PRE_NEIGHBOR; mask |= PRE_REVERSE; mask |= MIN_PRE_NEIGHBOR; - mask |= THERMO_ENERGY; return mask; } diff --git a/src/RIGID/fix_rigid_nh.cpp b/src/RIGID/fix_rigid_nh.cpp index 148a532d41..7e05c694c2 100644 --- a/src/RIGID/fix_rigid_nh.cpp +++ b/src/RIGID/fix_rigid_nh.cpp @@ -49,6 +49,8 @@ FixRigidNH::FixRigidNH(LAMMPS *lmp, int narg, char **arg) : eta_dot_b(nullptr), f_eta_b(nullptr), rfix(nullptr), id_temp(nullptr), id_press(nullptr), temperature(nullptr), pressure(nullptr) { + if (tstat_flag || pstat_flag) ecouple_flag = 1; + // error checks: could be moved up to FixRigid if ((p_flag[0] == 1 && p_period[0] <= 0.0) || @@ -186,8 +188,6 @@ int FixRigidNH::setmask() { int mask = 0; mask = FixRigid::setmask(); - if (tstat_flag || pstat_flag) mask |= THERMO_ENERGY; - return mask; } diff --git a/src/RIGID/fix_rigid_nh_small.cpp b/src/RIGID/fix_rigid_nh_small.cpp index 17e5d30aaf..354ef08dbb 100644 --- a/src/RIGID/fix_rigid_nh_small.cpp +++ b/src/RIGID/fix_rigid_nh_small.cpp @@ -51,6 +51,8 @@ FixRigidNHSmall::FixRigidNHSmall(LAMMPS *lmp, int narg, char **arg) : f_eta_b(nullptr), rfix(nullptr), id_temp(nullptr), id_press(nullptr), temperature(nullptr), pressure(nullptr) { + if (tstat_flag || pstat_flag) ecouple_flag = 1; + // error checks if ((p_flag[0] == 1 && p_period[0] <= 0.0) || @@ -199,8 +201,6 @@ int FixRigidNHSmall::setmask() { int mask = 0; mask = FixRigidSmall::setmask(); - if (tstat_flag || pstat_flag) mask |= THERMO_ENERGY; - return mask; } diff --git a/src/SHOCK/fix_msst.cpp b/src/SHOCK/fix_msst.cpp index a73409e584..3947811a52 100644 --- a/src/SHOCK/fix_msst.cpp +++ b/src/SHOCK/fix_msst.cpp @@ -33,8 +33,6 @@ #include "memory.h" #include "error.h" - - using namespace LAMMPS_NS; using namespace FixConst; @@ -55,6 +53,7 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extscalar = 1; extvector = 0; + ecouple_flag = 1; // set defaults @@ -238,7 +237,6 @@ int FixMSST::setmask() int mask = 0; mask |= INITIAL_INTEGRATE; mask |= FINAL_INTEGRATE; - mask |= THERMO_ENERGY; return mask; } diff --git a/src/SPIN/fix_langevin_spin.cpp b/src/SPIN/fix_langevin_spin.cpp index 6ebddff602..c9cb0fa2ec 100644 --- a/src/SPIN/fix_langevin_spin.cpp +++ b/src/SPIN/fix_langevin_spin.cpp @@ -35,7 +35,6 @@ #include "respa.h" #include "update.h" - using namespace LAMMPS_NS; using namespace FixConst; using namespace MathConst; @@ -47,12 +46,6 @@ FixLangevinSpin::FixLangevinSpin(LAMMPS *lmp, int narg, char **arg) : { if (narg != 6) error->all(FLERR,"Illegal langevin/spin command"); - dynamic_group_allow = 1; - scalar_flag = 1; - global_freq = 1; - extscalar = 1; - nevery = 1; - temp = utils::numeric(FLERR,arg[3],false,lmp); alpha_t = utils::numeric(FLERR,arg[4],false,lmp); seed = utils::inumeric(FLERR,arg[5],false,lmp); @@ -77,7 +70,6 @@ FixLangevinSpin::FixLangevinSpin(LAMMPS *lmp, int narg, char **arg) : // random = new RanPark(lmp,seed + comm->me); random = new RanMars(lmp,seed + comm->me); - } /* ---------------------------------------------------------------------- */ @@ -92,10 +84,6 @@ FixLangevinSpin::~FixLangevinSpin() int FixLangevinSpin::setmask() { int mask = 0; - mask |= POST_FORCE; - mask |= POST_FORCE_RESPA; - mask |= END_OF_STEP; - mask |= THERMO_ENERGY; return mask; } @@ -156,7 +144,6 @@ void FixLangevinSpin::add_tdamping(double spi[3], double fmi[3]) void FixLangevinSpin::add_temperature(double fmi[3]) { - // double rx = sigma*(2.0*random->uniform() - 1.0); // double ry = sigma*(2.0*random->uniform() - 1.0); // double rz = sigma*(2.0*random->uniform() - 1.0); @@ -175,14 +162,4 @@ void FixLangevinSpin::add_temperature(double fmi[3]) fmi[0] *= gil_factor; fmi[1] *= gil_factor; fmi[2] *= gil_factor; - } - - -/* ---------------------------------------------------------------------- */ - -void FixLangevinSpin::post_force_respa(int vflag, int ilevel, int /*iloop*/) -{ - if (ilevel == nlevels_respa-1) post_force(vflag); -} - diff --git a/src/SPIN/fix_precession_spin.cpp b/src/SPIN/fix_precession_spin.cpp index 81fb0ed9eb..70ea7e1a09 100644 --- a/src/SPIN/fix_precession_spin.cpp +++ b/src/SPIN/fix_precession_spin.cpp @@ -44,7 +44,8 @@ enum{CONSTANT,EQUAL}; /* ---------------------------------------------------------------------- */ -FixPrecessionSpin::FixPrecessionSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), emag(nullptr) +FixPrecessionSpin::FixPrecessionSpin(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg), emag(nullptr) { if (narg < 7) error->all(FLERR,"Illegal precession/spin command"); @@ -56,6 +57,7 @@ FixPrecessionSpin::FixPrecessionSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lm scalar_flag = 1; global_freq = 1; extscalar = 1; + energy_global_flag = 1; respa_level_support = 1; ilevel_respa = 0; @@ -165,12 +167,10 @@ int FixPrecessionSpin::setmask() int mask = 0; mask |= POST_FORCE; mask |= MIN_POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; return mask; } - /* ---------------------------------------------------------------------- */ void FixPrecessionSpin::init() @@ -245,7 +245,6 @@ void FixPrecessionSpin::min_setup(int vflag) void FixPrecessionSpin::post_force(int /* vflag */) { - // update mag field with time (potential improvement) if (varflag != CONSTANT) { diff --git a/src/USER-MISC/fix_orient_eco.cpp b/src/USER-MISC/fix_orient_eco.cpp index f90a1ab23e..88175fbb06 100644 --- a/src/USER-MISC/fix_orient_eco.cpp +++ b/src/USER-MISC/fix_orient_eco.cpp @@ -65,21 +65,20 @@ FixOrientECO::FixOrientECO(LAMMPS *lmp, int narg, char **arg) : { if (lmp->citeme) lmp->citeme->add(cite_fix_orient_eco); - // get rank of this processor MPI_Comm_rank(world, &me); - // check for illegal command if (narg != 7) error->all(FLERR, "Illegal fix orient/eco command"); - // set fix flags scalar_flag = 1; // computes scalar global_freq = 1; // values can be computed at every timestep extscalar = 1; // scalar scales with # of atoms + energy_global_flag = 1; peratom_flag = 1; // quantities are per atom quantities size_peratom_cols = 2; // # of per atom quantities peratom_freq = 1; // // parse input parameters + u_0 = utils::numeric(FLERR, arg[3],false,lmp); sign = (u_0 >= 0.0 ? 1 : -1); eta = utils::numeric(FLERR, arg[4],false,lmp); @@ -87,6 +86,7 @@ FixOrientECO::FixOrientECO(LAMMPS *lmp, int narg, char **arg) : // read reference orientations from file // work on rank 0 only + int n = strlen(arg[6]) + 1; dir_filename = new char[n]; strcpy(dir_filename, arg[6]); @@ -151,7 +151,6 @@ FixOrientECO::~FixOrientECO() { int FixOrientECO::setmask() { int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; return mask; } From c091515427cb0fcf1fb8d1bcf62afdafd3f99bd9 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Thu, 21 Jan 2021 15:12:16 -0700 Subject: [PATCH 050/384] changed syntax for virial tallying in standard package fixes --- src/COLLOID/fix_wall_colloid.cpp | 2 +- src/KOKKOS/fix_shake_kokkos.cpp | 3 +-- src/MISC/fix_efield.cpp | 11 +++++------ src/POEMS/fix_poems.cpp | 8 +++----- src/RIGID/fix_ehex.cpp | 1 - src/RIGID/fix_rattle.cpp | 1 - src/RIGID/fix_rigid.cpp | 10 +++------- src/RIGID/fix_rigid_small.cpp | 10 +++------- src/RIGID/fix_shake.cpp | 7 +++---- 9 files changed, 19 insertions(+), 34 deletions(-) diff --git a/src/COLLOID/fix_wall_colloid.cpp b/src/COLLOID/fix_wall_colloid.cpp index 665c34fe50..ad2cd66f95 100644 --- a/src/COLLOID/fix_wall_colloid.cpp +++ b/src/COLLOID/fix_wall_colloid.cpp @@ -153,7 +153,7 @@ void FixWallColloid::wall_particle(int m, int which, double coord) if (evflag) { if (side < 0) vn = -fwall*delta; else vn = fwall*delta; - v_tally(dim, i, vn); + v_tally(dim,i,vn); } } diff --git a/src/KOKKOS/fix_shake_kokkos.cpp b/src/KOKKOS/fix_shake_kokkos.cpp index 00db34ce20..d7162a98cc 100644 --- a/src/KOKKOS/fix_shake_kokkos.cpp +++ b/src/KOKKOS/fix_shake_kokkos.cpp @@ -331,8 +331,7 @@ void FixShakeKokkos::post_force(int vflag) // virial setup - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // reallocate per-atom arrays if necessary diff --git a/src/MISC/fix_efield.cpp b/src/MISC/fix_efield.cpp index 9f50439158..5ba83ed7a6 100644 --- a/src/MISC/fix_efield.cpp +++ b/src/MISC/fix_efield.cpp @@ -49,13 +49,13 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : vector_flag = 1; scalar_flag = 1; size_vector = 3; - energy_global_flag = 1; global_freq = 1; extvector = 1; extscalar = 1; respa_level_support = 1; ilevel_respa = 0; - virial_flag = 1; + energy_global_flag = 1; + virial_global_flag = virial_peratom_flag = 1; qe2f = force->qe2f; xstr = ystr = zstr = nullptr; @@ -257,10 +257,9 @@ void FixEfield::post_force(int vflag) imageint *image = atom->image; int nlocal = atom->nlocal; - // energy and virial setup + // virial setup - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // reallocate efield array if necessary @@ -319,7 +318,7 @@ void FixEfield::post_force(int vflag) v[3] = fx*unwrap[1]; v[4] = fx*unwrap[2]; v[5] = fy*unwrap[2]; - v_tally(i, v); + v_tally(i,v); } } } diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index a220216fdd..529757abb1 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -73,7 +73,7 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) : time_integrate = 1; rigid_flag = 1; - virial_flag = 1; + virial_global_flag = virial_peratom_flag = 1; centroidstressflag = CENTROID_NOTAVAIL; thermo_virial = 1; dof_flag = 1; @@ -684,8 +684,7 @@ void FixPOEMS::setup(int vflag) // virial setup before call to set_v - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // set velocities from angmom & omega @@ -732,8 +731,7 @@ void FixPOEMS::initial_integrate(int vflag) // virial setup before call to set_xv - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // set coords and velocities of atoms in rigid bodies diff --git a/src/RIGID/fix_ehex.cpp b/src/RIGID/fix_ehex.cpp index a3346b3d1c..5af363af15 100644 --- a/src/RIGID/fix_ehex.cpp +++ b/src/RIGID/fix_ehex.cpp @@ -309,7 +309,6 @@ double FixEHEX::compute_scalar() return scale; } - /* ---------------------------------------------------------------------- memory usage of local atom-based arrays ------------------------------------------------------------------------- */ diff --git a/src/RIGID/fix_rattle.cpp b/src/RIGID/fix_rattle.cpp index 2d2c11974c..e8e5eebd63 100644 --- a/src/RIGID/fix_rattle.cpp +++ b/src/RIGID/fix_rattle.cpp @@ -79,7 +79,6 @@ FixRattle::~FixRattle() { memory->destroy(vp); - if (RATTLE_DEBUG) { // communicate maximum distance error diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index 9ce28438d3..2724fb1c78 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -37,8 +37,6 @@ #include "error.h" #include "rigid_const.h" - - using namespace LAMMPS_NS; using namespace FixConst; using namespace MathConst; @@ -64,7 +62,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : extscalar = 0; time_integrate = 1; rigid_flag = 1; - virial_flag = 1; + virial_global_flag = virial_peratom_flag = 1; thermo_virial = 1; create_attribute = 1; dof_flag = 1; @@ -887,8 +885,7 @@ void FixRigid::setup(int vflag) // virial setup before call to set_v - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // set velocities from angmom & omega @@ -951,8 +948,7 @@ void FixRigid::initial_integrate(int vflag) // virial setup before call to set_xv - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // set coords/orient and velocity/rotation of atoms in rigid bodies // from quarternion and omega diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 1b022f35c4..706e660ec0 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -41,8 +41,6 @@ #include "error.h" #include "rigid_const.h" - - #include using namespace LAMMPS_NS; @@ -69,7 +67,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; time_integrate = 1; rigid_flag = 1; - virial_flag = 1; + virial_global_flag = virial_peratom_flag = 1; thermo_virial = 1; create_attribute = 1; dof_flag = 1; @@ -725,8 +723,7 @@ void FixRigidSmall::setup(int vflag) // virial setup before call to set_v - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // compute and forward communicate vcm and omega of all bodies @@ -797,8 +794,7 @@ void FixRigidSmall::initial_integrate(int vflag) // virial setup before call to set_xv - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // forward communicate updated info of all bodies diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index cb2daaac2a..71017aac30 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -59,7 +59,7 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); - virial_flag = 1; + virial_global_flag = virial_peratom_flag = 1; thermo_virial = 1; create_attribute = 1; dof_flag = 1; @@ -569,8 +569,7 @@ void FixShake::post_force(int vflag) // virial setup - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // loop over clusters to add constraint forces @@ -616,7 +615,7 @@ void FixShake::post_force_respa(int vflag, int ilevel, int iloop) // and if pressure is requested // virial accumulation happens via evflag at last iteration of each level - if (ilevel == 0 && iloop == loop_respa[ilevel]-1 && vflag) v_setup(vflag); + if (ilevel == 0 && iloop == loop_respa[ilevel]-1 && vflag) v_init(vflag); if (iloop == loop_respa[ilevel]-1) evflag = 1; else evflag = 0; From 43977066540d25df0457c64ff822a830343650f1 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Thu, 21 Jan 2021 15:18:16 -0700 Subject: [PATCH 051/384] missing a change in fix langevin/spin --- src/SPIN/fix_langevin_spin.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SPIN/fix_langevin_spin.h b/src/SPIN/fix_langevin_spin.h index 0e4fc69f92..c73b33353b 100644 --- a/src/SPIN/fix_langevin_spin.h +++ b/src/SPIN/fix_langevin_spin.h @@ -26,15 +26,15 @@ namespace LAMMPS_NS { class FixLangevinSpin : public Fix { public: + int tdamp_flag,ldamp_flag,temp_flag; // damping and temperature flags + FixLangevinSpin(class LAMMPS *, int, char **); virtual ~FixLangevinSpin(); int setmask(); void init(); void setup(int); - void post_force_respa(int, int, int); void add_tdamping(double *, double *); // add transverse damping void add_temperature(double *); // add temperature - int tdamp_flag, ldamp_flag, temp_flag; // damping and temperature flags protected: double alpha_t; // transverse mag. damping From 54e3ee74a2c993041ab5670855bbbb0242798933 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Thu, 21 Jan 2021 15:37:18 -0700 Subject: [PATCH 052/384] changes to USER-MISC package --- src/USER-MISC/fix_addtorque.cpp | 2 +- src/USER-MISC/fix_ffl.cpp | 31 ++++++-------- src/USER-MISC/fix_flow_gauss.cpp | 9 +++- src/USER-MISC/fix_gle.cpp | 10 ++--- src/USER-MISC/fix_npt_cauchy.cpp | 2 +- src/USER-MISC/fix_rhok.cpp | 60 +++++++++++++-------------- src/USER-MISC/fix_ti_spring.cpp | 4 +- src/USER-MISC/fix_wall_region_ees.cpp | 5 ++- src/fix.h | 25 ++++++----- 9 files changed, 74 insertions(+), 74 deletions(-) diff --git a/src/USER-MISC/fix_addtorque.cpp b/src/USER-MISC/fix_addtorque.cpp index eba7348f21..3c1a46a7fd 100644 --- a/src/USER-MISC/fix_addtorque.cpp +++ b/src/USER-MISC/fix_addtorque.cpp @@ -47,6 +47,7 @@ FixAddTorque::FixAddTorque(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extscalar = 1; extvector = 1; + energy_global_flag = 1; dynamic_group_allow = 1; respa_level_support = 1; ilevel_respa = 0; @@ -97,7 +98,6 @@ int FixAddTorque::setmask() { int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; mask |= MIN_POST_FORCE; return mask; diff --git a/src/USER-MISC/fix_ffl.cpp b/src/USER-MISC/fix_ffl.cpp index 061d5f4559..b882a19e91 100644 --- a/src/USER-MISC/fix_ffl.cpp +++ b/src/USER-MISC/fix_ffl.cpp @@ -46,20 +46,17 @@ enum {NO_FLIP, FLIP_RESCALE, FLIP_HARD, FLIP_SOFT}; /* syntax for fix_ffl: * fix nfix id-group ffl tau Tstart Tstop seed [flip_type] - * * */ /* ---------------------------------------------------------------------- */ - -FixFFL::FixFFL(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) { - - +FixFFL::FixFFL(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) +{ if (narg < 7) error->all(FLERR,"Illegal fix ffl command. Expecting: fix " " ffl "); + ecouple_flag = 1; restart_peratom = 1; time_integrate = 1; scalar_flag = 1; @@ -121,7 +118,6 @@ FixFFL::FixFFL(LAMMPS *lmp, int narg, char **arg) : energy = 0.0; } - /* --- Frees up memory used by temporaries and buffers ------------------ */ FixFFL::~FixFFL() { @@ -139,14 +135,10 @@ FixFFL::~FixFFL() { int FixFFL::setmask() { int mask = 0; - mask |= INITIAL_INTEGRATE; mask |= FINAL_INTEGRATE; mask |= INITIAL_INTEGRATE_RESPA; mask |= FINAL_INTEGRATE_RESPA; - mask |= THERMO_ENERGY; - - return mask; } @@ -181,12 +173,8 @@ void FixFFL::init_ffl() { c1 = exp ( - gamma * 0.5 * dtv ); c2 = sqrt( (1.0 - c1*c1)* kT ); //without the mass term - - } - - /* ---------------------------------------------------------------------- */ void FixFFL::setup(int vflag) { @@ -199,6 +187,8 @@ void FixFFL::setup(int vflag) { } } +/* ---------------------------------------------------------------------- */ + void FixFFL::ffl_integrate() { double **v = atom->v; double *rmass = atom->rmass, smi, ismi; @@ -287,9 +277,10 @@ void FixFFL::ffl_integrate() { } energy += deltae*0.5*force->mvv2e; - } +/* ---------------------------------------------------------------------- */ + void FixFFL::initial_integrate(int /* vflag */) { double dtfm; @@ -333,6 +324,8 @@ void FixFFL::initial_integrate(int /* vflag */) { } } +/* ---------------------------------------------------------------------- */ + void FixFFL::final_integrate() { double dtfm; @@ -381,6 +374,7 @@ void FixFFL::final_integrate() { } } + /* ---------------------------------------------------------------------- */ void FixFFL::initial_integrate_respa(int vflag, int ilevel, int /* iloop */) { @@ -398,6 +392,8 @@ void FixFFL::initial_integrate_respa(int vflag, int ilevel, int /* iloop */) { } } +/* ---------------------------------------------------------------------- */ + void FixFFL::final_integrate_respa(int ilevel, int /* iloop */) { dtv = step_respa[ilevel]; @@ -407,6 +403,7 @@ void FixFFL::final_integrate_respa(int ilevel, int /* iloop */) { if (ilevel==nlevels_respa-1) ffl_integrate(); } +/* ---------------------------------------------------------------------- */ double FixFFL::compute_scalar() { @@ -429,7 +426,6 @@ void *FixFFL::extract(const char *str, int &dim) { return nullptr; } - /* ---------------------------------------------------------------------- Called when a change to the target temperature is requested mid-run ------------------------------------------------------------------------- */ @@ -459,7 +455,6 @@ double FixFFL::memory_usage() { return bytes; } - /* ---------------------------------------------------------------------- allocate local atom-based arrays ------------------------------------------------------------------------- */ diff --git a/src/USER-MISC/fix_flow_gauss.cpp b/src/USER-MISC/fix_flow_gauss.cpp index b1b4174352..f785545fa5 100644 --- a/src/USER-MISC/fix_flow_gauss.cpp +++ b/src/USER-MISC/fix_flow_gauss.cpp @@ -46,6 +46,8 @@ static const char cite_flow_gauss[] = "pages = {189--207}\n" "}\n\n"; +/* ---------------------------------------------------------------------- */ + FixFlowGauss::FixFlowGauss(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { @@ -61,6 +63,7 @@ FixFlowGauss::FixFlowGauss(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; extvector = 1; size_vector = 3; + energy_global_flag = 1; global_freq = 1; //data available every timestep respa_level_support = 1; //default respa level=outermost level is set in init() @@ -109,7 +112,6 @@ int FixFlowGauss::setmask() { int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; return mask; } @@ -154,6 +156,7 @@ void FixFlowGauss::setup(int vflag) /* ---------------------------------------------------------------------- this is where Gaussian dynamics constraint is applied ------------------------------------------------------------------------- */ + void FixFlowGauss::post_force(int /*vflag*/) { double **f = atom->f; @@ -218,9 +221,10 @@ void FixFlowGauss::post_force(int /*vflag*/) MPI_Allreduce(&peAdded,&pe_tmp,1,MPI_DOUBLE,MPI_SUM,world); pe_tot += pe_tmp; } - } +/* ---------------------------------------------------------------------- */ + void FixFlowGauss::post_force_respa(int vflag, int ilevel, int /*iloop*/) { if (ilevel == ilevel_respa) post_force(vflag); @@ -230,6 +234,7 @@ void FixFlowGauss::post_force_respa(int vflag, int ilevel, int /*iloop*/) negative of work done by this fix This is only computed if requested, either with fix_modify energy yes, or with the energy keyword. Otherwise returns 0. ------------------------------------------------------------------------- */ + double FixFlowGauss::compute_scalar() { return -pe_tot*dt; diff --git a/src/USER-MISC/fix_gle.cpp b/src/USER-MISC/fix_gle.cpp index e091c3d80e..2bf6a65395 100644 --- a/src/USER-MISC/fix_gle.cpp +++ b/src/USER-MISC/fix_gle.cpp @@ -30,7 +30,6 @@ #include "memory.h" #include "error.h" - using namespace LAMMPS_NS; using namespace FixConst; @@ -186,6 +185,8 @@ void MatrixExp(int n, const double* M, double* EM, int j=8, int k=8) } } +/* ---------------------------------------------------------------------- */ + FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { @@ -193,6 +194,7 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix gle command. Expecting: fix " " gle "); + ecouple_flag = 1; restart_peratom = 1; time_integrate = 1; @@ -395,9 +397,6 @@ int FixGLE::setmask() mask |= FINAL_INTEGRATE; mask |= INITIAL_INTEGRATE_RESPA; mask |= FINAL_INTEGRATE_RESPA; - mask |= THERMO_ENERGY; - - return mask; } @@ -499,7 +498,6 @@ void FixGLE::init_gles() return; } - /* ---------------------------------------------------------------------- */ void FixGLE::setup(int vflag) @@ -513,6 +511,8 @@ void FixGLE::setup(int vflag) } } +/* ---------------------------------------------------------------------- */ + void FixGLE::gle_integrate() { double **v = atom->v; diff --git a/src/USER-MISC/fix_npt_cauchy.cpp b/src/USER-MISC/fix_npt_cauchy.cpp index cb7ca713a1..5d51114262 100644 --- a/src/USER-MISC/fix_npt_cauchy.cpp +++ b/src/USER-MISC/fix_npt_cauchy.cpp @@ -61,6 +61,7 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : if (narg < 4) error->all(FLERR,"Illegal fix npt/cauchy command"); dynamic_group_allow = 1; + ecouple_flag = 1; time_integrate = 1; scalar_flag = 1; vector_flag = 1; @@ -686,7 +687,6 @@ int FixNPTCauchy::setmask() int mask = 0; mask |= INITIAL_INTEGRATE; mask |= FINAL_INTEGRATE; - mask |= THERMO_ENERGY; mask |= INITIAL_INTEGRATE_RESPA; mask |= FINAL_INTEGRATE_RESPA; if (pre_exchange_flag) mask |= PRE_EXCHANGE; diff --git a/src/USER-MISC/fix_rhok.cpp b/src/USER-MISC/fix_rhok.cpp index 416adc2165..f546b9a814 100644 --- a/src/USER-MISC/fix_rhok.cpp +++ b/src/USER-MISC/fix_rhok.cpp @@ -48,21 +48,19 @@ static const char cite_fix_rhok[] = FixRhok::FixRhok( LAMMPS* inLMP, int inArgc, char** inArgv ) : Fix( inLMP, inArgc, inArgv ) { - if (lmp->citeme) lmp->citeme->add(cite_fix_rhok); // Check arguments - if (inArgc != 8) - error->all(FLERR,"Illegal fix rhoKUmbrella command" ); + if (inArgc != 8) error->all(FLERR,"Illegal fix rhoKUmbrella command" ); // Set up fix flags scalar_flag = 1; // have compute_scalar vector_flag = 1; // have compute_vector... size_vector = 3; // ...with this many components global_freq = 1; // whose value can be computed at every timestep - thermo_energy = 1; // this fix changes system's potential energy extscalar = 0; // but the deltaPE might not scale with # of atoms extvector = 0; // neither do the components of the vector + energy_global_flag = 1; // Parse fix options int n[3]; @@ -79,29 +77,22 @@ FixRhok::FixRhok( LAMMPS* inLMP, int inArgc, char** inArgv ) mRhoK0 = utils::numeric(FLERR,inArgv[7],false,lmp); } -// Methods that this fix implements -// -------------------------------- +/* ---------------------------------------------------------------------- */ // Tells LAMMPS where this fix should act -int -FixRhok::setmask() +int FixRhok::setmask() { int mask = 0; - - // This fix modifies forces... mask |= POST_FORCE; mask |= POST_FORCE_RESPA; mask |= MIN_POST_FORCE; - - // ...and potential energies - mask |= THERMO_ENERGY; - return mask; } +/* ---------------------------------------------------------------------- */ + // Initializes the fix at the beginning of a run -void -FixRhok::init() +void FixRhok::init() { // RESPA boilerplate if (strcmp( update->integrate_style, "respa" ) == 0) @@ -121,9 +112,10 @@ FixRhok::init() mSqrtNThis = sqrt( mNThis ); } +/* ---------------------------------------------------------------------- */ + // Initial application of the fix to a system (when doing MD) -void -FixRhok::setup( int inVFlag ) +void FixRhok::setup( int inVFlag ) { if (strcmp( update->integrate_style, "verlet" ) == 0) post_force( inVFlag ); @@ -135,16 +127,20 @@ FixRhok::setup( int inVFlag ) } } +/* ---------------------------------------------------------------------- */ + // Initial application of the fix to a system (when doing minimization) -void -FixRhok::min_setup( int inVFlag ) + +void FixRhok::min_setup( int inVFlag ) { post_force( inVFlag ); } +/* ---------------------------------------------------------------------- */ + // Modify the forces calculated in the main force loop of ordinary MD -void -FixRhok::post_force( int /*inVFlag*/ ) + +void FixRhok::post_force( int /*inVFlag*/ ) { double **x = atom->x; double **f = atom->f; @@ -204,24 +200,27 @@ FixRhok::post_force( int /*inVFlag*/ ) } } +/* ---------------------------------------------------------------------- */ + // Forces in RESPA loop -void -FixRhok::post_force_respa( int inVFlag, int inILevel, int /*inILoop*/ ) +void FixRhok::post_force_respa( int inVFlag, int inILevel, int /*inILoop*/ ) { if (inILevel == mNLevelsRESPA - 1) post_force( inVFlag ); } +/* ---------------------------------------------------------------------- */ + // Forces in minimization loop -void -FixRhok::min_post_force( int inVFlag ) +void FixRhok::min_post_force( int inVFlag ) { post_force( inVFlag ); } +/* ---------------------------------------------------------------------- */ + // Compute the change in the potential energy induced by this fix -double -FixRhok::compute_scalar() +double FixRhok::compute_scalar() { double rhoK = sqrt( mRhoKGlobal[0]*mRhoKGlobal[0] + mRhoKGlobal[1]*mRhoKGlobal[1] ); @@ -229,9 +228,10 @@ FixRhok::compute_scalar() return 0.5 * mKappa * (rhoK - mRhoK0) * (rhoK - mRhoK0); } +/* ---------------------------------------------------------------------- */ + // Compute the ith component of the vector -double -FixRhok::compute_vector( int inI ) +double FixRhok::compute_vector( int inI ) { if (inI == 0) return mRhoKGlobal[0]; // Real part diff --git a/src/USER-MISC/fix_ti_spring.cpp b/src/USER-MISC/fix_ti_spring.cpp index 5aac36a47b..9e6c1ce296 100644 --- a/src/USER-MISC/fix_ti_spring.cpp +++ b/src/USER-MISC/fix_ti_spring.cpp @@ -64,7 +64,8 @@ FixTISpring::FixTISpring(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extscalar = 1; extvector = 1; - + energy_global_flag = 1; + // disallow resetting the time step, while this fix is defined time_depend = 1; @@ -133,7 +134,6 @@ int FixTISpring::setmask() mask |= POST_FORCE; mask |= POST_FORCE_RESPA; mask |= MIN_POST_FORCE; - mask |= THERMO_ENERGY; return mask; } diff --git a/src/USER-MISC/fix_wall_region_ees.cpp b/src/USER-MISC/fix_wall_region_ees.cpp index ab475ffb9b..7fe3ab24a3 100644 --- a/src/USER-MISC/fix_wall_region_ees.cpp +++ b/src/USER-MISC/fix_wall_region_ees.cpp @@ -38,13 +38,15 @@ FixWallRegionEES::FixWallRegionEES(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg != 7) error->all(FLERR,"Illegal fix wall/region/ees command"); + scalar_flag = 1; vector_flag = 1; size_vector = 3; global_freq = 1; extscalar = 1; extvector = 1; - + energy_global_flag = 1; + // parse args iregion = domain->find_region(arg[3]); @@ -77,7 +79,6 @@ int FixWallRegionEES::setmask() { int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; mask |= MIN_POST_FORCE; return mask; diff --git a/src/fix.h b/src/fix.h index c4c9267e54..c8db215255 100644 --- a/src/fix.h +++ b/src/fix.h @@ -273,19 +273,18 @@ namespace FixConst { FINAL_INTEGRATE = 1<<8, END_OF_STEP = 1<<9, POST_RUN = 1<<10, - //THERMO_ENERGY = 1<<11, // remove when done with refactoring - INITIAL_INTEGRATE_RESPA = 1<<12, - POST_INTEGRATE_RESPA = 1<<13, - PRE_FORCE_RESPA = 1<<14, - POST_FORCE_RESPA = 1<<15, - FINAL_INTEGRATE_RESPA = 1<<16, - MIN_PRE_EXCHANGE = 1<<17, - MIN_PRE_NEIGHBOR = 1<<18, - MIN_POST_NEIGHBOR = 1<<19, - MIN_PRE_FORCE = 1<<20, - MIN_PRE_REVERSE = 1<<21, - MIN_POST_FORCE = 1<<22, - MIN_ENERGY = 1<<23 + INITIAL_INTEGRATE_RESPA = 1<<11, + POST_INTEGRATE_RESPA = 1<<12, + PRE_FORCE_RESPA = 1<<13, + POST_FORCE_RESPA = 1<<14, + FINAL_INTEGRATE_RESPA = 1<<15, + MIN_PRE_EXCHANGE = 1<<16, + MIN_PRE_NEIGHBOR = 1<<17, + MIN_POST_NEIGHBOR = 1<<18, + MIN_PRE_FORCE = 1<<19, + MIN_PRE_REVERSE = 1<<20, + MIN_POST_FORCE = 1<<21, + MIN_ENERGY = 1<<22 }; } From 5a51c74b9d59adcea676490f12163897a4f2b622 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Thu, 21 Jan 2021 15:41:06 -0700 Subject: [PATCH 053/384] vtally change to fix smd --- src/USER-MISC/fix_smd.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/USER-MISC/fix_smd.cpp b/src/USER-MISC/fix_smd.cpp index 828ceda0ed..b4645f78cf 100644 --- a/src/USER-MISC/fix_smd.cpp +++ b/src/USER-MISC/fix_smd.cpp @@ -58,7 +58,7 @@ FixSMD::FixSMD(LAMMPS *lmp, int narg, char **arg) : extvector = 1; respa_level_support = 1; ilevel_respa = 0; - virial_flag = 1; + virial_global_flag = virial_atom_flag = 1; int argoffs=3; if (strcmp(arg[argoffs],"cvel") == 0) { @@ -182,10 +182,9 @@ void FixSMD::setup(int vflag) void FixSMD::post_force(int vflag) { - // energy and virial setup + // virial setup - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); if (styleflag & SMD_TETHER) smd_tether(); else smd_couple(); @@ -276,7 +275,7 @@ void FixSMD::smd_tether() v[3] = -fx*massfrac*unwrap[1]; v[4] = -fx*massfrac*unwrap[2]; v[5] = -fy*massfrac*unwrap[2]; - v_tally(i, v); + v_tally(i,v); } } } else { @@ -297,7 +296,7 @@ void FixSMD::smd_tether() v[3] = -fx*massfrac*unwrap[1]; v[4] = -fx*massfrac*unwrap[2]; v[5] = -fy*massfrac*unwrap[2]; - v_tally(i, v); + v_tally(i,v); } } } From 320ba4ef8fb53e89b8651382af3b8cc0bbfb980f Mon Sep 17 00:00:00 2001 From: Plimpton Date: Thu, 21 Jan 2021 15:44:08 -0700 Subject: [PATCH 054/384] more changes to USER-MISC --- src/USER-MISC/fix_orient_eco.cpp | 4 ++-- src/USER-MISC/fix_smd.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/USER-MISC/fix_orient_eco.cpp b/src/USER-MISC/fix_orient_eco.cpp index 88175fbb06..58973b29fe 100644 --- a/src/USER-MISC/fix_orient_eco.cpp +++ b/src/USER-MISC/fix_orient_eco.cpp @@ -72,10 +72,10 @@ FixOrientECO::FixOrientECO(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; // computes scalar global_freq = 1; // values can be computed at every timestep extscalar = 1; // scalar scales with # of atoms - energy_global_flag = 1; peratom_flag = 1; // quantities are per atom quantities size_peratom_cols = 2; // # of per atom quantities - peratom_freq = 1; // + peratom_freq = 1; + energy_global_flag = 1; // parse input parameters diff --git a/src/USER-MISC/fix_smd.cpp b/src/USER-MISC/fix_smd.cpp index b4645f78cf..8ea1beac71 100644 --- a/src/USER-MISC/fix_smd.cpp +++ b/src/USER-MISC/fix_smd.cpp @@ -58,7 +58,7 @@ FixSMD::FixSMD(LAMMPS *lmp, int narg, char **arg) : extvector = 1; respa_level_support = 1; ilevel_respa = 0; - virial_global_flag = virial_atom_flag = 1; + virial_global_flag = virial_peratom_flag = 1; int argoffs=3; if (strcmp(arg[argoffs],"cvel") == 0) { From 5a23b804d915f0ebae202fb742247e5c5e4fb4f5 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Thu, 21 Jan 2021 16:06:54 -0700 Subject: [PATCH 055/384] vtally changes to USER packages --- src/SHOCK/fix_nphug.cpp | 3 ++- src/USER-ATC/fix_atc.cpp | 5 +---- src/USER-BOCS/fix_bocs.cpp | 4 ++-- src/USER-COLVARS/fix_colvars.cpp | 6 ++++-- src/USER-DRUDE/fix_tgnh_drude.cpp | 4 ++-- src/USER-EFF/fix_temp_rescale_eff.cpp | 2 +- src/USER-LB/fix_lb_rigid_pc_sphere.cpp | 17 ++++------------- src/USER-OMP/fix_rigid_nh_omp.cpp | 3 +-- src/USER-OMP/fix_rigid_omp.cpp | 3 +-- src/USER-OMP/fix_rigid_small_omp.cpp | 4 +--- src/USER-PLUMED/fix_plumed.cpp | 7 +++---- src/USER-QTB/fix_qbmsst.cpp | 13 ++++++++----- src/USER-QTB/fix_qtb.cpp | 8 +------- src/USER-SDPD/fix_rigid_meso.cpp | 7 ++++--- 14 files changed, 35 insertions(+), 51 deletions(-) diff --git a/src/SHOCK/fix_nphug.cpp b/src/SHOCK/fix_nphug.cpp index 744f9d89cb..be4b71446e 100644 --- a/src/SHOCK/fix_nphug.cpp +++ b/src/SHOCK/fix_nphug.cpp @@ -32,7 +32,6 @@ enum{ISO,ANISO,TRICLINIC}; // same as fix_nh.cpp FixNPHug::FixNPHug(LAMMPS *lmp, int narg, char **arg) : FixNH(lmp, narg, arg), pe(nullptr), id_pe(nullptr) { - // Prevent masses from being updated every timestep eta_mass_flag = 0; @@ -346,6 +345,8 @@ double FixNPHug::compute_up() return up; } +/* ----------------------------------------------------------------------- */ + // look for index in local class // if index not found, look in base class diff --git a/src/USER-ATC/fix_atc.cpp b/src/USER-ATC/fix_atc.cpp index 82fbfcc958..6eba5a766a 100644 --- a/src/USER-ATC/fix_atc.cpp +++ b/src/USER-ATC/fix_atc.cpp @@ -479,8 +479,6 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), // we write our own restart file restart_global = 0; - - // Set output computation data based on transfer info scalar_flag = atc_->scalar_flag(); vector_flag = atc_->vector_flag(); @@ -489,6 +487,7 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), extscalar = atc_->extscalar(); extvector = atc_->extvector(); extlist = atc_->extlist(); + energy_global_flag = 1; thermo_energy = atc_->thermo_energy_flag(); // set pointer for output @@ -496,7 +495,6 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), size_peratom_cols = atc_->size_peratom_cols(); peratom_freq = atc_->peratom_freq(); - // set comm size needed by this fix comm_forward = atc_->comm_forward(); @@ -527,7 +525,6 @@ int FixATC::setmask() mask |= MIN_PRE_NEIGHBOR; mask |= MIN_PRE_FORCE; mask |= MIN_POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_RUN; mask |= END_OF_STEP; return mask; diff --git a/src/USER-BOCS/fix_bocs.cpp b/src/USER-BOCS/fix_bocs.cpp index 81bf3538df..3df1cc2bd3 100644 --- a/src/USER-BOCS/fix_bocs.cpp +++ b/src/USER-BOCS/fix_bocs.cpp @@ -87,7 +87,8 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extscalar = 1; extvector = 0; - + ecouple_flag = 1; + // default values pcouple = NONE; @@ -489,7 +490,6 @@ int FixBocs::setmask() int mask = 0; mask |= INITIAL_INTEGRATE; mask |= FINAL_INTEGRATE; - mask |= THERMO_ENERGY; mask |= INITIAL_INTEGRATE_RESPA; mask |= FINAL_INTEGRATE_RESPA; if (pre_exchange_flag) mask |= PRE_EXCHANGE; diff --git a/src/USER-COLVARS/fix_colvars.cpp b/src/USER-COLVARS/fix_colvars.cpp index 841e2e0099..4bcd68dae9 100644 --- a/src/USER-COLVARS/fix_colvars.cpp +++ b/src/USER-COLVARS/fix_colvars.cpp @@ -282,6 +282,7 @@ int FixColvars::instances=0; tstat (label of thermostatting fix) ***************************************************************/ + FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { @@ -297,7 +298,8 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) : nevery = 1; extscalar = 1; restart_global = 1; - + energy_global_flag = 1; + me = comm->me; root2root = MPI_COMM_NULL; @@ -360,6 +362,7 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) : /********************************* * Clean up on deleting the fix. * *********************************/ + FixColvars::~FixColvars() { memory->sfree(conf_file); @@ -386,7 +389,6 @@ FixColvars::~FixColvars() int FixColvars::setmask() { int mask = 0; - mask |= THERMO_ENERGY; mask |= MIN_POST_FORCE; mask |= POST_FORCE; mask |= POST_FORCE_RESPA; diff --git a/src/USER-DRUDE/fix_tgnh_drude.cpp b/src/USER-DRUDE/fix_tgnh_drude.cpp index d660f16c4a..ee47d8a0d9 100644 --- a/src/USER-DRUDE/fix_tgnh_drude.cpp +++ b/src/USER-DRUDE/fix_tgnh_drude.cpp @@ -66,7 +66,8 @@ FixTGNHDrude::FixTGNHDrude(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extscalar = 1; extvector = 0; - + ecouple_flag = 1; + // default values pcouple = NONE; @@ -585,7 +586,6 @@ int FixTGNHDrude::setmask() int mask = 0; mask |= INITIAL_INTEGRATE; mask |= FINAL_INTEGRATE; - mask |= THERMO_ENERGY; mask |= INITIAL_INTEGRATE_RESPA; mask |= FINAL_INTEGRATE_RESPA; if (pre_exchange_flag) mask |= PRE_EXCHANGE; diff --git a/src/USER-EFF/fix_temp_rescale_eff.cpp b/src/USER-EFF/fix_temp_rescale_eff.cpp index b8a614ae6e..f796c7cb02 100644 --- a/src/USER-EFF/fix_temp_rescale_eff.cpp +++ b/src/USER-EFF/fix_temp_rescale_eff.cpp @@ -46,6 +46,7 @@ FixTempRescaleEff::FixTempRescaleEff(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; global_freq = nevery; extscalar = 1; + ecouple_flag = 1; t_start = utils::numeric(FLERR,arg[4],false,lmp); t_stop = utils::numeric(FLERR,arg[5],false,lmp); @@ -87,7 +88,6 @@ int FixTempRescaleEff::setmask() { int mask = 0; mask |= END_OF_STEP; - mask |= THERMO_ENERGY; return mask; } diff --git a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp index 88eb54593a..52ca8ec857 100644 --- a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp +++ b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp @@ -32,7 +32,6 @@ #include "error.h" #include "fix_lb_fluid.h" - using namespace LAMMPS_NS; using namespace FixConst; @@ -48,7 +47,7 @@ FixLbRigidPCSphere::FixLbRigidPCSphere(LAMMPS *lmp, int narg, char **arg) : time_integrate = 1; rigid_flag = 1; create_attribute = 1; - virial_flag = 1; + virial_global_flag = virial_peratom_flag = 1; thermo_virial = 1; // perform initial allocation of atom-based arrays @@ -737,8 +736,7 @@ void FixLbRigidPCSphere::setup(int vflag) // virial setup before call to set_v - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // Set the velocities set_v(); @@ -938,14 +936,11 @@ void FixLbRigidPCSphere::initial_integrate(int vflag) } // virial setup before call to set_xv - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); set_xv(); - } - /* ---------------------------------------------------------------------- */ void FixLbRigidPCSphere::final_integrate() @@ -1188,8 +1183,6 @@ void FixLbRigidPCSphere::set_v() v_tally(1,&i,1.0,vr); } - - } } @@ -1310,11 +1303,9 @@ void FixLbRigidPCSphere::set_xv() v_tally(1,&i,1.0,vr); } - } - - } + /* ---------------------------------------------------------------------- remap xcm of each rigid body back into periodic simulation box done during pre_neighbor so will be after call to pbc() diff --git a/src/USER-OMP/fix_rigid_nh_omp.cpp b/src/USER-OMP/fix_rigid_nh_omp.cpp index 8a8b649d92..5a1e6ca25e 100644 --- a/src/USER-OMP/fix_rigid_nh_omp.cpp +++ b/src/USER-OMP/fix_rigid_nh_omp.cpp @@ -201,8 +201,7 @@ void FixRigidNHOMP::initial_integrate(int vflag) // virial setup before call to set_xv - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // remap simulation box by 1/2 step diff --git a/src/USER-OMP/fix_rigid_omp.cpp b/src/USER-OMP/fix_rigid_omp.cpp index 07ddb06233..99e967f472 100644 --- a/src/USER-OMP/fix_rigid_omp.cpp +++ b/src/USER-OMP/fix_rigid_omp.cpp @@ -86,8 +86,7 @@ void FixRigidOMP::initial_integrate(int vflag) // virial setup before call to set_xv - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // set coords/orient and velocity/rotation of atoms in rigid bodies // from quarternion and omega diff --git a/src/USER-OMP/fix_rigid_small_omp.cpp b/src/USER-OMP/fix_rigid_small_omp.cpp index bc09aa101a..9da8958305 100644 --- a/src/USER-OMP/fix_rigid_small_omp.cpp +++ b/src/USER-OMP/fix_rigid_small_omp.cpp @@ -25,7 +25,6 @@ #include "comm.h" #include "domain.h" - #if defined(_OPENMP) #include #endif @@ -85,8 +84,7 @@ void FixRigidSmallOMP::initial_integrate(int vflag) // virial setup before call to set_xv - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // forward communicate updated info of all bodies diff --git a/src/USER-PLUMED/fix_plumed.cpp b/src/USER-PLUMED/fix_plumed.cpp index e2246adcd9..cd6292d64e 100644 --- a/src/USER-PLUMED/fix_plumed.cpp +++ b/src/USER-PLUMED/fix_plumed.cpp @@ -210,10 +210,10 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) : double dt=update->dt; p->cmd("setTimestep",&dt); - virial_flag=1; - thermo_virial=1; scalar_flag = 1; - + energy_global_flag = virial_global_flag = 1; + thermo_energy = thermo_virial = 1; + // This is the real initialization: p->cmd("init"); @@ -288,7 +288,6 @@ int FixPlumed::setmask() // set with a bitmask how and when apply the force from plumed int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; mask |= MIN_POST_FORCE; return mask; diff --git a/src/USER-QTB/fix_qbmsst.cpp b/src/USER-QTB/fix_qbmsst.cpp index 2257c9992e..db162bd0c2 100644 --- a/src/USER-QTB/fix_qbmsst.cpp +++ b/src/USER-QTB/fix_qbmsst.cpp @@ -21,7 +21,6 @@ #include #include - #include "atom.h" #include "force.h" #include "update.h" @@ -35,8 +34,6 @@ #include "kspace.h" #include "math_const.h" - - using namespace LAMMPS_NS; using namespace FixConst; using namespace MathConst; @@ -66,6 +63,7 @@ FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix qbmsst command"); // default parameters + global_freq = 1; extscalar = 1; extvector = 0; @@ -75,7 +73,8 @@ FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; vector_flag = 1; size_vector = 5; - + ecouple_flag = 1; + qmass = 1.0e1; mu = 0.0; p0 = 0.0; @@ -96,6 +95,7 @@ FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : qtb_set = 0; // reading parameters + int iarg = 5; while (iarg < narg) { if (strcmp(arg[iarg],"q") == 0) { @@ -282,6 +282,7 @@ FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- release memories ------------------------------------------------------------------------- */ + FixQBMSST::~FixQBMSST() { delete [] rfix; @@ -309,18 +310,19 @@ FixQBMSST::~FixQBMSST() /* ---------------------------------------------------------------------- setmask ------------------------------------------------------------------------- */ + int FixQBMSST::setmask() { int mask = 0; mask |= INITIAL_INTEGRATE; mask |= FINAL_INTEGRATE; - mask |= THERMO_ENERGY; return mask; } /* ---------------------------------------------------------------------- fix initiation ------------------------------------------------------------------------- */ + void FixQBMSST::init() { // copy parameters from other classes @@ -929,6 +931,7 @@ int FixQBMSST::modify_param(int narg, char **arg) /* ---------------------------------------------------------------------- compute scalar ------------------------------------------------------------------------- */ + double FixQBMSST::compute_scalar() { // compute new pressure and volume. diff --git a/src/USER-QTB/fix_qtb.cpp b/src/USER-QTB/fix_qtb.cpp index 31f0808ca7..761a0ed537 100644 --- a/src/USER-QTB/fix_qtb.cpp +++ b/src/USER-QTB/fix_qtb.cpp @@ -33,8 +33,6 @@ #include "memory.h" #include "error.h" - - using namespace LAMMPS_NS; using namespace FixConst; using namespace MathConst; @@ -48,10 +46,7 @@ FixQTB::FixQTB(LAMMPS *lmp, int narg, char **arg) : if (narg < 3) error->all(FLERR,"Illegal fix qtb command"); // default parameters - global_freq = 1; - extscalar = 1; - nevery = 1; - + t_target = 300.0; t_period = 1.0; fric_coef = 1/t_period; @@ -147,7 +142,6 @@ int FixQTB::setmask() int mask = 0; mask |= POST_FORCE; mask |= POST_FORCE_RESPA; - mask |= THERMO_ENERGY; return mask; } diff --git a/src/USER-SDPD/fix_rigid_meso.cpp b/src/USER-SDPD/fix_rigid_meso.cpp index 35fb89aee7..6847c4e2e5 100644 --- a/src/USER-SDPD/fix_rigid_meso.cpp +++ b/src/USER-SDPD/fix_rigid_meso.cpp @@ -40,9 +40,11 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixRigidMeso::FixRigidMeso (LAMMPS *lmp, int narg, char **arg) : -FixRigid (lmp, narg, arg) { + FixRigid (lmp, narg, arg) +{ scalar_flag = 0; size_array_cols = 28; + if ((atom->esph_flag != 1) || (atom->rho_flag != 1)) error->all (FLERR, "fix rigid/meso command requires atom_style with" " both energy and density"); @@ -160,8 +162,7 @@ void FixRigidMeso::initial_integrate (int vflag) { // virial setup before call to set_xv - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // set coords/orient and velocity/rotation of atoms in rigid bodies // from quarternion and omega From d169f6c169cbf924cea70633bb4aceb5c1af3b2e Mon Sep 17 00:00:00 2001 From: Plimpton Date: Thu, 21 Jan 2021 17:27:45 -0700 Subject: [PATCH 056/384] USER-BOCS and other compute pressures --- src/USER-BOCS/compute_pressure_bocs.cpp | 29 +++++++++++++++---------- src/compute_pressure.cpp | 9 +++----- src/compute_stress_atom.cpp | 2 +- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/USER-BOCS/compute_pressure_bocs.cpp b/src/USER-BOCS/compute_pressure_bocs.cpp index f97edfeaa1..004a11d048 100644 --- a/src/USER-BOCS/compute_pressure_bocs.cpp +++ b/src/USER-BOCS/compute_pressure_bocs.cpp @@ -158,9 +158,12 @@ void ComputePressureBocs::init() if (dihedralflag && force->dihedral) nvirial++; if (improperflag && force->improper) nvirial++; } - if (fixflag) - for (int i = 0; i < modify->nfix; i++) - if (modify->fix[i]->virial_flag) nvirial++; + if (fixflag) { + Fix **fix = modify->fix; + int nfix = modify->nfix; + for (int i = 0; i < nfix; i++) + if (fix[i]->thermo_virial) nvirial++; + } if (nvirial) { vptr = new double*[nvirial]; @@ -174,7 +177,7 @@ void ComputePressureBocs::init() vptr[nvirial++] = force->improper->virial; if (fixflag) for (int i = 0; i < modify->nfix; i++) - if (modify->fix[i]->virial_flag) + if (modify->fix[i]->virial_global_flag && modify->fix[i]->thermo_virial) vptr[nvirial++] = modify->fix[i]->virial; } @@ -184,26 +187,24 @@ void ComputePressureBocs::init() else kspace_virial = nullptr; } -/* Extra functions added for BOCS */ - /* ---------------------------------------------------------------------- Compute the pressure correction for the analytical basis set ------------------------------------------------------------------------- */ + double ComputePressureBocs::get_cg_p_corr(int N_basis, double *phi_coeff, int N_mol, double vavg, double vCG) { double correction = 0.0; for (int i = 1; i <= N_basis; ++i) - { correction -= phi_coeff[i-1] * ( N_mol * i / vavg ) * - pow( ( 1 / vavg ) * ( vCG - vavg ),i-1); - } + pow( ( 1 / vavg ) * ( vCG - vavg ),i-1); return correction; } /* ---------------------------------------------------------------------- Find the relevant index position if using a spline basis set ------------------------------------------------------------------------- */ + double ComputePressureBocs::find_index(double * grid, double value) { int i; @@ -230,7 +231,7 @@ double ComputePressureBocs::find_index(double * grid, double value) ------------------------------------------------------------------------- */ double ComputePressureBocs::get_cg_p_corr(double ** grid, int basis_type, - double vCG) + double vCG) { int i = find_index(grid[0],vCG); double correction, deltax = vCG - grid[0][i]; @@ -256,8 +257,10 @@ double ComputePressureBocs::get_cg_p_corr(double ** grid, int basis_type, send cg info from fix_bocs to compute_pressure_bocs for the analytical basis set ------------------------------------------------------------------------- */ + void ComputePressureBocs::send_cg_info(int basis_type, int sent_N_basis, - double *sent_phi_coeff, int sent_N_mol, double sent_vavg) + double *sent_phi_coeff, int sent_N_mol, + double sent_vavg) { if (basis_type == BASIS_ANALYTIC) { p_basis_type = BASIS_ANALYTIC; } else @@ -280,8 +283,9 @@ void ComputePressureBocs::send_cg_info(int basis_type, int sent_N_basis, send cg info from fix_bocs to compute_pressure_bocs for a spline basis set ------------------------------------------------------------------------- */ + void ComputePressureBocs::send_cg_info(int basis_type, - double ** in_splines, int gridsize) + double ** in_splines, int gridsize) { if (basis_type == BASIS_LINEAR_SPLINE) { p_basis_type = BASIS_LINEAR_SPLINE; } else if (basis_type == BASIS_CUBIC_SPLINE) { p_basis_type = BASIS_CUBIC_SPLINE; } @@ -299,6 +303,7 @@ void ComputePressureBocs::send_cg_info(int basis_type, /* ---------------------------------------------------------------------- compute total pressure, averaged over Pxx, Pyy, Pzz ------------------------------------------------------------------------- */ + double ComputePressureBocs::compute_scalar() { invoked_scalar = update->ntimestep; diff --git a/src/compute_pressure.cpp b/src/compute_pressure.cpp index aadf96fdea..82ddbbb5c5 100644 --- a/src/compute_pressure.cpp +++ b/src/compute_pressure.cpp @@ -215,13 +215,10 @@ void ComputePressure::init() vptr[nvirial++] = force->dihedral->virial; if (improperflag && force->improper) vptr[nvirial++] = force->improper->virial; - if (fixflag) { - Fix **fix = modify->fix; - int nfix = modify->nfix; - for (int i = 0; i < nfix; i++) - if (fix[i]->virial_global_flag && fix[i]->thermo_virial) + if (fixflag) + for (int i = 0; i < modify->nfix; i++) + if (modify->fix[i]->virial_global_flag && modify->fix[i]->thermo_virial) vptr[nvirial++] = modify->fix[i]->virial; - } } // flag Kspace contribution separately, since not summed across procs diff --git a/src/compute_stress_atom.cpp b/src/compute_stress_atom.cpp index 88b092ecba..f55eef544d 100644 --- a/src/compute_stress_atom.cpp +++ b/src/compute_stress_atom.cpp @@ -223,7 +223,7 @@ void ComputeStressAtom::compute_peratom() int nfix = modify->nfix; for (int ifix = 0; ifix < nfix; ifix++) if (fix[i]->virial_peratom_flag && fix[ifix]->thermo_virial) { - double **vatom = modify->fix[ifix]->vatom; + double **vatom = fix[ifix]->vatom; if (vatom) for (i = 0; i < nlocal; i++) for (j = 0; j < 6; j++) From d8fbf7f0ca49bffc92f8a132d452bd2d79aaa481 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Thu, 21 Jan 2021 17:36:20 -0700 Subject: [PATCH 057/384] remove last v_setup() calls from fixes --- src/MESSAGE/fix_client_md.cpp | 5 ++--- src/RIGID/fix_rigid_nh.cpp | 3 +-- src/RIGID/fix_rigid_nh_small.cpp | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/MESSAGE/fix_client_md.cpp b/src/MESSAGE/fix_client_md.cpp index 7482a33110..1ef103ec3b 100644 --- a/src/MESSAGE/fix_client_md.cpp +++ b/src/MESSAGE/fix_client_md.cpp @@ -158,10 +158,9 @@ void FixClientMD::min_setup(int vflag) void FixClientMD::post_force(int vflag) { - // energy and virial setup + // virial setup - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // STEP send every step // required fields: COORDS diff --git a/src/RIGID/fix_rigid_nh.cpp b/src/RIGID/fix_rigid_nh.cpp index 7e05c694c2..7fefdaebfe 100644 --- a/src/RIGID/fix_rigid_nh.cpp +++ b/src/RIGID/fix_rigid_nh.cpp @@ -565,8 +565,7 @@ void FixRigidNH::initial_integrate(int vflag) // virial setup before call to set_xv - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // remap simulation box by 1/2 step diff --git a/src/RIGID/fix_rigid_nh_small.cpp b/src/RIGID/fix_rigid_nh_small.cpp index 354ef08dbb..cfefe285f3 100644 --- a/src/RIGID/fix_rigid_nh_small.cpp +++ b/src/RIGID/fix_rigid_nh_small.cpp @@ -591,8 +591,7 @@ void FixRigidNHSmall::initial_integrate(int vflag) // virial setup before call to set_xv - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // remap simulation box by 1/2 step From 46b4043966a3957944c804a13218b49fe9ae28e2 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Mon, 25 Jan 2021 09:01:51 -0700 Subject: [PATCH 058/384] more changes to Kokkos Modify class --- src/KOKKOS/modify_kokkos.cpp | 57 +++++++++++++++++++++++++++++------- src/KOKKOS/modify_kokkos.h | 4 ++- 2 files changed, 49 insertions(+), 12 deletions(-) diff --git a/src/KOKKOS/modify_kokkos.cpp b/src/KOKKOS/modify_kokkos.cpp index 04e5baced2..89153def23 100644 --- a/src/KOKKOS/modify_kokkos.cpp +++ b/src/KOKKOS/modify_kokkos.cpp @@ -350,27 +350,62 @@ void ModifyKokkos::end_of_step() } /* ---------------------------------------------------------------------- - thermo energy call, only for relevant fixes - called by Thermo class - compute_scalar() is fix call to return energy + coupling energy call, only for relevant fixes + each thermostsat fix returns this via compute_scalar() + ecouple = cumulative energy added to reservoir by thermostatting ------------------------------------------------------------------------- */ -double ModifyKokkos::thermo_energy() +double Modify::energy_couple() { double energy = 0.0; - for (int i = 0; i < n_thermo_energy; i++) { - atomKK->sync(fix[list_thermo_energy[i]]->execution_space, - fix[list_thermo_energy[i]]->datamask_read); + for (int i = 0; i < n_energy_couple; i++) { int prev_auto_sync = lmp->kokkos->auto_sync; - if (!fix[list_thermo_energy[i]]->kokkosable) lmp->kokkos->auto_sync = 1; - energy += fix[list_thermo_energy[i]]->compute_scalar(); + if (!fix[list_energy_couple[i]]->kokkosable) lmp->kokkos->auto_sync = 1; + energy += fix[list_energy_couple[i]]->compute_scalar(); lmp->kokkos->auto_sync = prev_auto_sync; - atomKK->modified(fix[list_thermo_energy[i]]->execution_space, - fix[list_thermo_energy[i]]->datamask_modify); + atomKK->modified(fix[list_energy_couple[i]]->execution_space, + fix[list_energy_couple[i]]->datamask_modify); } return energy; } +/* ---------------------------------------------------------------------- + global energy call, only for relevant fixes + they return energy via compute_scalar() + called by compute pe +------------------------------------------------------------------------- */ + +double Modify::energy_global() +{ + double energy = 0.0; + for (int i = 0; i < n_energy_global; i++) { + int prev_auto_sync = lmp->kokkos->auto_sync; + if (!fix[list_energy_global[i]]->kokkosable) lmp->kokkos->auto_sync = 1; + energy += fix[list_energy_global[i]]->compute_scalar(); + lmp->kokkos->auto_sync = prev_auto_sync; + atomKK->modified(fix[list_energy_global[i]]->execution_space, + fix[list_energy_global[i]]->datamask_modify); + } + return energy; +} + +/* ---------------------------------------------------------------------- + peratom energy call, only for relevant fixes + called by compute pe/atom +------------------------------------------------------------------------- */ + +void Modify::energy_atom(int nlocal, double *energy) +{ + int i,j; + double *eatom; + + //for (i = 0; i < n_energy_atom; i++) { + // eatom = fix[list_energy_atom[i]]->eatom; + // if (!eatom) continue; + // for (j = 0; j < nlocal; j++) energy[j] += eatom[j]; + //} +} + /* ---------------------------------------------------------------------- post_run call ------------------------------------------------------------------------- */ diff --git a/src/KOKKOS/modify_kokkos.h b/src/KOKKOS/modify_kokkos.h index 32dfb2fd97..be52e4bfff 100644 --- a/src/KOKKOS/modify_kokkos.h +++ b/src/KOKKOS/modify_kokkos.h @@ -37,7 +37,9 @@ class ModifyKokkos : public Modify { void post_force(int); void final_integrate(); void end_of_step(); - double thermo_energy(); + double energy_couple(); + double energy_global(); + void energy_atom(); void post_run(); void setup_pre_force_respa(int, int); From a0e4817a2cd62af338e823c2f25fe2911471dfe7 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Mon, 25 Jan 2021 09:08:40 -0700 Subject: [PATCH 059/384] more changes to Kokkos Modify class --- src/KOKKOS/modify_kokkos.cpp | 57 +++++++----------------------------- src/KOKKOS/modify_kokkos.h | 4 +-- 2 files changed, 12 insertions(+), 49 deletions(-) diff --git a/src/KOKKOS/modify_kokkos.cpp b/src/KOKKOS/modify_kokkos.cpp index 89153def23..04e5baced2 100644 --- a/src/KOKKOS/modify_kokkos.cpp +++ b/src/KOKKOS/modify_kokkos.cpp @@ -350,62 +350,27 @@ void ModifyKokkos::end_of_step() } /* ---------------------------------------------------------------------- - coupling energy call, only for relevant fixes - each thermostsat fix returns this via compute_scalar() - ecouple = cumulative energy added to reservoir by thermostatting + thermo energy call, only for relevant fixes + called by Thermo class + compute_scalar() is fix call to return energy ------------------------------------------------------------------------- */ -double Modify::energy_couple() +double ModifyKokkos::thermo_energy() { double energy = 0.0; - for (int i = 0; i < n_energy_couple; i++) { + for (int i = 0; i < n_thermo_energy; i++) { + atomKK->sync(fix[list_thermo_energy[i]]->execution_space, + fix[list_thermo_energy[i]]->datamask_read); int prev_auto_sync = lmp->kokkos->auto_sync; - if (!fix[list_energy_couple[i]]->kokkosable) lmp->kokkos->auto_sync = 1; - energy += fix[list_energy_couple[i]]->compute_scalar(); + if (!fix[list_thermo_energy[i]]->kokkosable) lmp->kokkos->auto_sync = 1; + energy += fix[list_thermo_energy[i]]->compute_scalar(); lmp->kokkos->auto_sync = prev_auto_sync; - atomKK->modified(fix[list_energy_couple[i]]->execution_space, - fix[list_energy_couple[i]]->datamask_modify); + atomKK->modified(fix[list_thermo_energy[i]]->execution_space, + fix[list_thermo_energy[i]]->datamask_modify); } return energy; } -/* ---------------------------------------------------------------------- - global energy call, only for relevant fixes - they return energy via compute_scalar() - called by compute pe -------------------------------------------------------------------------- */ - -double Modify::energy_global() -{ - double energy = 0.0; - for (int i = 0; i < n_energy_global; i++) { - int prev_auto_sync = lmp->kokkos->auto_sync; - if (!fix[list_energy_global[i]]->kokkosable) lmp->kokkos->auto_sync = 1; - energy += fix[list_energy_global[i]]->compute_scalar(); - lmp->kokkos->auto_sync = prev_auto_sync; - atomKK->modified(fix[list_energy_global[i]]->execution_space, - fix[list_energy_global[i]]->datamask_modify); - } - return energy; -} - -/* ---------------------------------------------------------------------- - peratom energy call, only for relevant fixes - called by compute pe/atom -------------------------------------------------------------------------- */ - -void Modify::energy_atom(int nlocal, double *energy) -{ - int i,j; - double *eatom; - - //for (i = 0; i < n_energy_atom; i++) { - // eatom = fix[list_energy_atom[i]]->eatom; - // if (!eatom) continue; - // for (j = 0; j < nlocal; j++) energy[j] += eatom[j]; - //} -} - /* ---------------------------------------------------------------------- post_run call ------------------------------------------------------------------------- */ diff --git a/src/KOKKOS/modify_kokkos.h b/src/KOKKOS/modify_kokkos.h index be52e4bfff..32dfb2fd97 100644 --- a/src/KOKKOS/modify_kokkos.h +++ b/src/KOKKOS/modify_kokkos.h @@ -37,9 +37,7 @@ class ModifyKokkos : public Modify { void post_force(int); void final_integrate(); void end_of_step(); - double energy_couple(); - double energy_global(); - void energy_atom(); + double thermo_energy(); void post_run(); void setup_pre_force_respa(int, int); From 064e0d1c44289d749f25869201c4afeb15bc909b Mon Sep 17 00:00:00 2001 From: Plimpton Date: Mon, 25 Jan 2021 09:18:37 -0700 Subject: [PATCH 060/384] redo changes to modify_kokkos.cpp/h --- src/KOKKOS/modify_kokkos.cpp | 57 +++++++++++++++++++++++++++++------- src/KOKKOS/modify_kokkos.h | 4 ++- 2 files changed, 49 insertions(+), 12 deletions(-) diff --git a/src/KOKKOS/modify_kokkos.cpp b/src/KOKKOS/modify_kokkos.cpp index 04e5baced2..89153def23 100644 --- a/src/KOKKOS/modify_kokkos.cpp +++ b/src/KOKKOS/modify_kokkos.cpp @@ -350,27 +350,62 @@ void ModifyKokkos::end_of_step() } /* ---------------------------------------------------------------------- - thermo energy call, only for relevant fixes - called by Thermo class - compute_scalar() is fix call to return energy + coupling energy call, only for relevant fixes + each thermostsat fix returns this via compute_scalar() + ecouple = cumulative energy added to reservoir by thermostatting ------------------------------------------------------------------------- */ -double ModifyKokkos::thermo_energy() +double Modify::energy_couple() { double energy = 0.0; - for (int i = 0; i < n_thermo_energy; i++) { - atomKK->sync(fix[list_thermo_energy[i]]->execution_space, - fix[list_thermo_energy[i]]->datamask_read); + for (int i = 0; i < n_energy_couple; i++) { int prev_auto_sync = lmp->kokkos->auto_sync; - if (!fix[list_thermo_energy[i]]->kokkosable) lmp->kokkos->auto_sync = 1; - energy += fix[list_thermo_energy[i]]->compute_scalar(); + if (!fix[list_energy_couple[i]]->kokkosable) lmp->kokkos->auto_sync = 1; + energy += fix[list_energy_couple[i]]->compute_scalar(); lmp->kokkos->auto_sync = prev_auto_sync; - atomKK->modified(fix[list_thermo_energy[i]]->execution_space, - fix[list_thermo_energy[i]]->datamask_modify); + atomKK->modified(fix[list_energy_couple[i]]->execution_space, + fix[list_energy_couple[i]]->datamask_modify); } return energy; } +/* ---------------------------------------------------------------------- + global energy call, only for relevant fixes + they return energy via compute_scalar() + called by compute pe +------------------------------------------------------------------------- */ + +double Modify::energy_global() +{ + double energy = 0.0; + for (int i = 0; i < n_energy_global; i++) { + int prev_auto_sync = lmp->kokkos->auto_sync; + if (!fix[list_energy_global[i]]->kokkosable) lmp->kokkos->auto_sync = 1; + energy += fix[list_energy_global[i]]->compute_scalar(); + lmp->kokkos->auto_sync = prev_auto_sync; + atomKK->modified(fix[list_energy_global[i]]->execution_space, + fix[list_energy_global[i]]->datamask_modify); + } + return energy; +} + +/* ---------------------------------------------------------------------- + peratom energy call, only for relevant fixes + called by compute pe/atom +------------------------------------------------------------------------- */ + +void Modify::energy_atom(int nlocal, double *energy) +{ + int i,j; + double *eatom; + + //for (i = 0; i < n_energy_atom; i++) { + // eatom = fix[list_energy_atom[i]]->eatom; + // if (!eatom) continue; + // for (j = 0; j < nlocal; j++) energy[j] += eatom[j]; + //} +} + /* ---------------------------------------------------------------------- post_run call ------------------------------------------------------------------------- */ diff --git a/src/KOKKOS/modify_kokkos.h b/src/KOKKOS/modify_kokkos.h index 32dfb2fd97..be52e4bfff 100644 --- a/src/KOKKOS/modify_kokkos.h +++ b/src/KOKKOS/modify_kokkos.h @@ -37,7 +37,9 @@ class ModifyKokkos : public Modify { void post_force(int); void final_integrate(); void end_of_step(); - double thermo_energy(); + double energy_couple(); + double energy_global(); + void energy_atom(); void post_run(); void setup_pre_force_respa(int, int); From 6147b9c2efc6eb0dfbc1f5d8f14d098bb6a5fd66 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Tue, 26 Jan 2021 08:51:47 -0700 Subject: [PATCH 061/384] doc page updates for energy contributions of thermostat and non-thermostat fixes --- doc/src/compute_displace_atom.rst | 11 +-- doc/src/fix_addforce.rst | 28 ++++--- doc/src/fix_addtorque.rst | 38 ++++++--- doc/src/fix_atc.rst | 69 +++++++++++++---- doc/src/fix_bocs.rst | 33 ++++++++ doc/src/fix_client_md.rst | 36 +++++---- doc/src/fix_cmap.rst | 37 +++++---- doc/src/fix_colvars.rst | 29 +++---- doc/src/fix_efield.rst | 48 ++++++------ doc/src/fix_external.rst | 33 ++++---- doc/src/fix_ffl.rst | 35 +++++---- doc/src/fix_flow_gauss.rst | 75 +++++++++++------- doc/src/fix_gcmc.rst | 20 ++--- doc/src/fix_gle.rst | 35 +++++---- doc/src/fix_gravity.rst | 26 ++++--- doc/src/fix_hyper_global.rst | 23 +++--- doc/src/fix_hyper_local.rst | 23 +++--- doc/src/fix_indent.rst | 31 ++++---- doc/src/fix_langevin.rst | 18 +++-- doc/src/fix_langevin_eff.rst | 18 +++-- doc/src/fix_latte.rst | 28 ++++--- doc/src/fix_modify.rst | 81 +++++++++++-------- doc/src/fix_msst.rst | 35 +++++---- doc/src/fix_nh.rst | 21 ++--- doc/src/fix_nph_asphere.rst | 10 ++- doc/src/fix_nph_body.rst | 10 ++- doc/src/fix_nph_sphere.rst | 10 ++- doc/src/fix_nphug.rst | 52 +++++++------ doc/src/fix_npt_asphere.rst | 8 +- doc/src/fix_npt_body.rst | 11 +-- doc/src/fix_npt_cauchy.rst | 38 +++++---- doc/src/fix_npt_sphere.rst | 31 ++++---- doc/src/fix_nvt_asphere.rst | 16 ++-- doc/src/fix_nvt_body.rst | 16 ++-- doc/src/fix_nvt_sllod.rst | 16 ++-- doc/src/fix_nvt_sllod_eff.rst | 16 ++-- doc/src/fix_nvt_sphere.rst | 16 ++-- doc/src/fix_orient.rst | 27 ++++--- doc/src/fix_orient_eco.rst | 125 ++++++++++++++++-------------- doc/src/fix_plumed.rst | 44 ++++++----- doc/src/fix_precession_spin.rst | 90 +++++++++++---------- doc/src/fix_qbmsst.rst | 48 +++++++----- doc/src/fix_restrain.rst | 16 ++-- doc/src/fix_rhok.rst | 25 +++++- doc/src/fix_rigid.rst | 45 ++++++----- doc/src/fix_spring.rst | 11 ++- doc/src/fix_spring_chunk.rst | 8 +- doc/src/fix_spring_self.rst | 19 +++-- doc/src/fix_temp_berendsen.rst | 13 ++-- doc/src/fix_temp_csvr.rst | 46 ++++++----- doc/src/fix_temp_rescale.rst | 43 +++++----- doc/src/fix_temp_rescale_eff.rst | 16 ++-- doc/src/fix_tgnh_drude.rst | 65 +++++++++------- doc/src/fix_ti_spring.rst | 60 +++++++------- doc/src/fix_wall.rst | 28 ++++--- doc/src/fix_wall_ees.rst | 94 +++++++++++++++++----- doc/src/fix_wall_region.rst | 34 ++++---- doc/src/fix_widom.rst | 10 +-- doc/src/thermo_modify.rst | 2 +- doc/src/thermo_style.rst | 101 +++++++++++++++--------- src/SHOCK/fix_msst.cpp | 1 - src/SHOCK/fix_nphug.cpp | 3 - src/USER-EFF/fix_langevin_eff.cpp | 1 - src/USER-MISC/fix_flow_gauss.cpp | 10 ++- src/USER-MISC/fix_pimd.cpp | 1 - src/USER-QTB/fix_qbmsst.cpp | 11 ++- src/thermo.cpp | 8 +- 67 files changed, 1241 insertions(+), 845 deletions(-) diff --git a/doc/src/compute_displace_atom.rst b/doc/src/compute_displace_atom.rst index 9079538fd8..688e73d914 100644 --- a/doc/src/compute_displace_atom.rst +++ b/doc/src/compute_displace_atom.rst @@ -46,11 +46,12 @@ the compute command was issued. The value of the displacement will be .. note:: Initial coordinates are stored in "unwrapped" form, by using the - image flags associated with each atom. See the :doc:`dump custom ` command for a discussion of "unwrapped" coordinates. - See the Atoms section of the :doc:`read_data ` command for a - discussion of image flags and how they are set for each atom. You can - reset the image flags (e.g. to 0) before invoking this compute by - using the :doc:`set image ` command. + image flags associated with each atom. See the :doc:`dump custom + ` command for a discussion of "unwrapped" coordinates. See + the Atoms section of the :doc:`read_data ` command for a + discussion of image flags and how they are set for each atom. You + can reset the image flags (e.g. to 0) before invoking this compute + by using the :doc:`set image ` command. .. note:: diff --git a/doc/src/fix_addforce.rst b/doc/src/fix_addforce.rst index f2f7a69f6c..4aca227246 100644 --- a/doc/src/fix_addforce.rst +++ b/doc/src/fix_addforce.rst @@ -118,20 +118,24 @@ converge properly. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. +No information about this fix is written to :doc:`binary restart files +`. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the potential "energy" inferred by the added force to the -system's potential energy as part of :doc:`thermodynamic output `. This is a fictitious quantity but is -needed so that the :doc:`minimize ` command can include the -forces added by this fix in a consistent manner. I.e. there is a -decrease in potential energy when atoms move in the direction of the -added force. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the global potential "energy" inferred by the added +force to the global potential energy of the system as part of +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify energy no `. Note that this +energy is a fictitious quantity but is needed so that the +:doc:`minimize ` command can include the forces added by +this fix in a consistent manner. I.e. there is a decrease in +potential energy when atoms move in the direction of the added force. -The :doc:`fix_modify ` *virial* option is supported by this -fix to add the contribution due to the added forces on atoms to the -system's virial as part of :doc:`thermodynamic output `. -The default is *virial no* +The :doc:`fix_modify ` *virial* option is supported by +this fix to add the contribution due to the added forces on atoms to +the global pressure of the system as part of :doc:`thermodynamic +output `. The default setting for this fix is +:doc:`fix_modify virial no `. The :doc:`fix_modify ` *respa* option is supported by this fix. This allows to set at which level of the :doc:`r-RESPA ` diff --git a/doc/src/fix_addtorque.rst b/doc/src/fix_addtorque.rst index b716f94dc8..fbb957e547 100644 --- a/doc/src/fix_addtorque.rst +++ b/doc/src/fix_addtorque.rst @@ -55,13 +55,15 @@ Restart, fix_modify, output, run start/stop, minimize info No information about this fix is written to :doc:`binary restart files `. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the potential "energy" inferred by the added forces to the -system's potential energy as part of :doc:`thermodynamic output `. This is a fictitious quantity but is -needed so that the :doc:`minimize ` command can include the -forces added by this fix in a consistent manner. I.e. there is a -decrease in potential energy when atoms move in the direction of the -added forces. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the potential "energy" inferred by the added torques +to the global potential energy of the system as part of +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify energy no `. Note that this +is a fictitious quantity but is needed so that the :doc:`minimize +` command can include the forces added by this fix in a +consistent manner. I.e. there is a decrease in potential energy when +atoms move in the direction of the added forces. The :doc:`fix_modify ` *respa* option is supported by this fix. This allows to set at which level of the :doc:`r-RESPA ` @@ -78,16 +80,28 @@ No parameter of this fix can be used with the *start/stop* keywords of the :doc:`run ` command. The forces due to this fix are imposed during an energy minimization, -invoked by the :doc:`minimize ` command. You should not -specify force components with a variable that has time-dependence for -use with a minimizer, since the minimizer increments the timestep as -the iteration count during the minimization. +invoked by the :doc:`minimize ` command. + +.. note:: + + If you want the fictitious potential energy associated with the + added forces to be included in the total potential energy of the + system (the quantity being minimized), you MUST enable the + :doc:`fix_modify ` *energy* option for this fix. + +.. note:: + + You should not specify force components with a variable that has + time-dependence for use with a minimizer, since the minimizer + increments the timestep as the iteration count during the + minimization. Restrictions """""""""""" This fix is part of the USER-MISC package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. +LAMMPS was built with that package. See the :doc:`Build package +` doc page for more info. Related commands """""""""""""""" diff --git a/doc/src/fix_atc.rst b/doc/src/fix_atc.rst index 8e9ab0ceb2..25f85f6f6c 100644 --- a/doc/src/fix_atc.rst +++ b/doc/src/fix_atc.rst @@ -122,10 +122,22 @@ Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files -`. The :doc:`fix_modify ` options relevant to this -fix are listed below. No global scalar or vector or per-atom quantities -are stored by this fix for access by various :doc:`output commands -`. No parameter of this fix can be used with the +`. + +The :doc:`fix_modify ` *energy* option is not supported by +this fix, but this fix does add the kinetic energy imparted to atoms +by the momentum coupling mode of the AtC package to the global +potential energy of the system as part of :doc:`thermodynamic output +`. + +Additional :doc:`fix_modify ` options relevant to this +fix are listed below. + +This fix computes a global scalar which can be accessed by various +:doc:`output commands `. The scalar is the energy +discussed in the previous paragraph. The scalar value is "extensive". + +No parameter of this fix can be used with the *start/stop* keywords of the :doc:`run ` command. This fix is not invoked during :doc:`energy minimization `. @@ -145,10 +157,10 @@ one, e.g. nve, nvt, etc. In addition, currently: Related commands """""""""""""""" -After specifying this fix in your input script, several other -:doc:`fix_modify ` commands are used to setup the problem, -e.g. define the finite element mesh and prescribe initial and boundary -conditions. +After specifying this fix in your input script, several +:doc:`fix_modify AtC ` commands are used to setup the +problem, e.g. define the finite element mesh and prescribe initial and +boundary conditions. Each of these options has its own doc page. *fix_modify* commands for setup: @@ -240,7 +252,8 @@ miscellaneous *fix_modify* commands: * :doc:`fix_modify AtC remove_species ` * :doc:`fix_modify AtC remove_molecule ` -Note: a set of example input files with the attendant material files are included in the ``examples/USER/atc`` folders. +Note: a set of example input files with the attendant material files +are included in the ``examples/USER/atc`` folders. Default """"""" @@ -252,30 +265,52 @@ For detailed exposition of the theory and algorithms please see: .. _Wagner: -**(Wagner)** Wagner, GJ; Jones, RE; Templeton, JA; Parks, MA, "An atomistic-to-continuum coupling method for heat transfer in solids." Special Issue of Computer Methods and Applied Mechanics (2008) 197:3351. +**(Wagner)** Wagner, GJ; Jones, RE; Templeton, JA; Parks, MA, "An + atomistic-to-continuum coupling method for heat transfer in solids." + Special Issue of Computer Methods and Applied Mechanics (2008) + 197:3351. .. _Zimmeman2004: -**(Zimmerman2004)** Zimmerman, JA; Webb, EB; Hoyt, JJ;. Jones, RE; Klein, PA; Bammann, DJ, "Calculation of stress in atomistic simulation." Special Issue of Modelling and Simulation in Materials Science and Engineering (2004), 12:S319. +**(Zimmerman2004)** Zimmerman, JA; Webb, EB; Hoyt, JJ;. Jones, RE; + Klein, PA; Bammann, DJ, "Calculation of stress in atomistic + simulation." Special Issue of Modelling and Simulation in Materials + Science and Engineering (2004), 12:S319. .. _Zimmerman2010: -**(Zimmerman2010)** Zimmerman, JA; Jones, RE; Templeton, JA, "A material frame approach for evaluating continuum variables in atomistic simulations." Journal of Computational Physics (2010), 229:2364. +**(Zimmerman2010)** Zimmerman, JA; Jones, RE; Templeton, JA, "A + material frame approach for evaluating continuum variables in + atomistic simulations." Journal of Computational Physics (2010), + 229:2364. .. _Templeton2010: -**(Templeton2010)** Templeton, JA; Jones, RE; Wagner, GJ, "Application of a field-based method to spatially varying thermal transport problems in molecular dynamics." Modelling and Simulation in Materials Science and Engineering (2010), 18:085007. +**(Templeton2010)** Templeton, JA; Jones, RE; Wagner, GJ, "Application + of a field-based method to spatially varying thermal transport + problems in molecular dynamics." Modelling and Simulation in + Materials Science and Engineering (2010), 18:085007. .. _Jones: -**(Jones)** Jones, RE; Templeton, JA; Wagner, GJ; Olmsted, D; Modine, JA, "Electron transport enhanced molecular dynamics for metals and semi-metals." International Journal for Numerical Methods in Engineering (2010), 83:940. +**(Jones)** Jones, RE; Templeton, JA; Wagner, GJ; Olmsted, D; Modine, + JA, "Electron transport enhanced molecular dynamics for metals and + semi-metals." International Journal for Numerical Methods in + Engineering (2010), 83:940. .. _Templeton2011: -**(Templeton2011)** Templeton, JA; Jones, RE; Lee, JW; Zimmerman, JA; Wong, BM, "A long-range electric field solver for molecular dynamics based on atomistic-to-continuum modeling." Journal of Chemical Theory and Computation (2011), 7:1736. +**(Templeton2011)** Templeton, JA; Jones, RE; Lee, JW; Zimmerman, JA; + Wong, BM, "A long-range electric field solver for molecular dynamics + based on atomistic-to-continuum modeling." Journal of Chemical Theory + and Computation (2011), 7:1736. .. _Mandadapu: -**(Mandadapu)** Mandadapu, KK; Templeton, JA; Lee, JW, "Polarization as a field variable from molecular dynamics simulations." Journal of Chemical Physics (2013), 139:054115. +**(Mandadapu)** Mandadapu, KK; Templeton, JA; Lee, JW, "Polarization + as a field variable from molecular dynamics simulations." Journal of + Chemical Physics (2013), 139:054115. -Please refer to the standard finite element (FE) texts, e.g. T.J.R Hughes " The finite element method ", Dover 2003, for the basics of FE simulation. +Please refer to the standard finite element (FE) texts, e.g. T.J.R +Hughes " The finite element method ", Dover 2003, for the basics of FE +simulation. diff --git a/doc/src/fix_bocs.rst b/doc/src/fix_bocs.rst index b5a00b2687..f4b3080cc0 100644 --- a/doc/src/fix_bocs.rst +++ b/doc/src/fix_bocs.rst @@ -75,6 +75,39 @@ Note that *V_avg* and *Coeff_i* should all be in the proper units, e.g. if you are using *units real*\ , *V_avg* should be in cubic angstroms, and the coefficients should all be in atmospheres \* cubic angstroms. +---------- + +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +This fix writes the cumulative global energy change to :doc:`binary +restart files `. See the :doc:`read_restart ` +command for info on how to re-specify a fix in an input script that +reads a restart file, so that the fix continues in an uninterrupted +fashion. + +The :doc:`fix_modify ` *temp* option is supported by this +fix. You can use it to assign a temperature :doc:`compute ` +you have defined to this fix which will be used in its thermostatting +procedure, as described above. For consistency, the group used by +this fix and by the compute should be the same. + +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. + +This fix computes a global scalar which can be accessed by various +:doc:`output commands `. The scalar is the same +cumulative energy change due to this fix described in the previous +paragraph. The scalar value calculated by this fix is "extensive". + +This fix can ramp its target temperature over multiple runs, using the +*start* and *stop* keywords of the :doc:`run ` command. See the +:doc:`run ` command for details of how to do this. + +This fix is not invoked during :doc:`energy minimization `. + Restrictions """""""""""" diff --git a/doc/src/fix_client_md.rst b/doc/src/fix_client_md.rst index 0200966a34..5344f29459 100644 --- a/doc/src/fix_client_md.rst +++ b/doc/src/fix_client_md.rst @@ -47,14 +47,15 @@ for running *ab initio* MD with quantum forces. The group associated with this fix is ignored. The protocol and :doc:`units ` for message format and content -that LAMMPS exchanges with the server code is defined on the :doc:`server md ` doc page. +that LAMMPS exchanges with the server code is defined on the +:doc:`server md ` doc page. Note that when using LAMMPS as an MD client, your LAMMPS input script should not normally contain force field commands, like a :doc:`pair_style `, :doc:`bond_style `, or -:doc:`kspace_style ` command. However it is possible for -a server code to only compute a portion of the full force-field, while -LAMMPS computes the remaining part. Your LAMMPS script can also +:doc:`kspace_style ` command. However it is possible +for a server code to only compute a portion of the full force-field, +while LAMMPS computes the remaining part. Your LAMMPS script can also specify boundary conditions or force constraints in the usual way, which will be added to the per-atom forces returned by the server code. @@ -69,16 +70,20 @@ LAMMPS and another code in tandem to perform a coupled simulation. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. +No information about this fix is written to :doc:`binary restart files +`. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the potential energy computed by the server application to -the system's potential energy as part of :doc:`thermodynamic output `. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the potential energy set by the server application to +the global potential energy of the system as part of +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify energy yes `. -The :doc:`fix_modify ` *virial* option is supported by this -fix to add the server application's contribution to the system's -virial as part of :doc:`thermodynamic output `. The -default is *virial yes* +The :doc:`fix_modify ` *virial* option is supported by +this fix to add the contribution computed by the external program to +the global pressure of the system as part of :doc:`thermodynamic +output `. The default setting for this fix is +:doc:`fix_modify virial yes `. This fix computes a global scalar which can be accessed by various :doc:`output commands `. The scalar is the potential @@ -86,13 +91,16 @@ energy discussed above. The scalar value calculated by this fix is "extensive". No parameter of this fix can be used with the *start/stop* keywords of -the :doc:`run ` command. This fix is not invoked during :doc:`energy minimization `. +the :doc:`run ` command. + +This fix is not invoked during :doc:`energy minimization `. Restrictions """""""""""" This fix is part of the MESSAGE package. It is only enabled if LAMMPS -was built with that package. See the :doc:`Build package ` doc page for more info. +was built with that package. See the :doc:`Build package +` doc page for more info. A script that uses this command must also use the :doc:`message ` command to setup and shut down the messaging diff --git a/doc/src/fix_cmap.rst b/doc/src/fix_cmap.rst index 14e83f49e6..83e4b6d9b8 100644 --- a/doc/src/fix_cmap.rst +++ b/doc/src/fix_cmap.rst @@ -29,11 +29,12 @@ Description This command enables CMAP cross-terms to be added to simulations which use the CHARMM force field. These are relevant for any CHARMM model of a peptide or protein sequences that is 3 or more amino-acid -residues long; see :ref:`(Buck) ` and :ref:`(Brooks) ` for details, -including the analytic energy expressions for CMAP interactions. The -CMAP cross-terms add additional potential energy contributions to pairs -of overlapping phi-psi dihedrals of amino-acids, which are important -to properly represent their conformational behavior. +residues long; see :ref:`(Buck) ` and :ref:`(Brooks) ` +for details, including the analytic energy expressions for CMAP +interactions. The CMAP cross-terms add additional potential energy +contributions to pairs of overlapping phi-psi dihedrals of +amino-acids, which are important to properly represent their +conformational behavior. The examples/cmap directory has a sample input script and data file for a small peptide, that illustrates use of the fix cmap command. @@ -93,19 +94,25 @@ the note below about how to include the CMAP energy when performing an Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This fix writes the list of CMAP cross-terms to :doc:`binary restart files `. See the :doc:`read_restart ` command +This fix writes the list of CMAP cross-terms to :doc:`binary restart +files `. See the :doc:`read_restart ` command for info on how to re-specify a fix in an input script that reads a restart file, so that the operation of the fix continues in an uninterrupted fashion. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the potential "energy" of the CMAP interactions system's -potential energy as part of :doc:`thermodynamic output `. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the potential energy of the CMAP interactions to both +the global potential energy and peratom potential energies of the +sysstem as part of :doc:`thermodynamic output ` or +output by the :doc:`compute pe/atom ` command. The +default setting for this fix is :doc:`fix_modify energy yes +`. -The :doc:`fix_modify ` *virial* option is supported by this -fix to add the contribution due to the interaction between atoms to -the system's virial as part of :doc:`thermodynamic output `. -The default is *virial yes* +The :doc:`fix_modify ` *virial* option is supported by +this fix to add the contribution due to the CMAP interactions between +atoms to the global prsesure of the system as part of +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify virial yes `. This fix computes a global scalar which can be accessed by various :doc:`output commands `. The scalar is the potential @@ -121,8 +128,8 @@ invoked by the :doc:`minimize ` command. .. note:: If you want the potential energy associated with the CMAP terms - forces to be included in the total potential energy of the system (the - quantity being minimized), you MUST enable the + forces to be included in the total potential energy of the system + (the quantity being minimized), you MUST not disable the :doc:`fix_modify ` *energy* option for this fix. Restrictions diff --git a/doc/src/fix_colvars.rst b/doc/src/fix_colvars.rst index fbc39f3f2f..7a238d3242 100644 --- a/doc/src/fix_colvars.rst +++ b/doc/src/fix_colvars.rst @@ -35,12 +35,12 @@ Examples Description """"""""""" -This fix interfaces LAMMPS to the collective variables "Colvars" -library, which allows to calculate potentials of mean force -(PMFs) for any set of colvars, using different sampling methods: -currently implemented are the Adaptive Biasing Force (ABF) method, -metadynamics, Steered Molecular Dynamics (SMD) and Umbrella Sampling -(US) via a flexible harmonic restraint bias. +This fix interfaces LAMMPS to the collective variables (Colvars) +library, which allows to calculate potentials of mean force (PMFs) for +any set of colvars, using different sampling methods: currently +implemented are the Adaptive Biasing Force (ABF) method, metadynamics, +Steered Molecular Dynamics (SMD) and Umbrella Sampling (US) via a +flexible harmonic restraint bias. This documentation describes only the fix colvars command itself and LAMMPS specific parts of the code. The full documentation of the @@ -98,9 +98,11 @@ This fix writes the current status of the colvars module into mode status file that is written by the colvars module itself and the kind of information in both files is identical. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change from the biasing force added by the fix -to the system's potential energy as part of :doc:`thermodynamic output `. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the energy change from the biasing force added by +Colvars to the global potential energy of the system as part of +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify energy no `. The *fix_modify configfile * option allows to add settings from an additional config file to the colvars module. This option can @@ -113,15 +115,16 @@ in a pair of double quotes ("), or can span multiple lines when bracketed by a pair of triple double quotes (""", like python embedded documentation). This fix computes a global scalar which can be accessed by various -:doc:`output commands `. The scalar is the cumulative -energy change due to this fix. The scalar value calculated by this -fix is "extensive". +:doc:`output commands `. The scalar is the Covars +energy mentioned above. The scalar value calculated by this fix is +"extensive". Restrictions """""""""""" This fix is part of the USER-COLVARS package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. +LAMMPS was built with that package. See the :doc:`Build package +` doc page for more info. There can only be one colvars fix active at a time. Since the interface communicates only the minimum amount of information and colvars module diff --git a/doc/src/fix_efield.rst b/doc/src/fix_efield.rst index 227e048c8c..fdfc8b427b 100644 --- a/doc/src/fix_efield.rst +++ b/doc/src/fix_efield.rst @@ -100,9 +100,9 @@ minimize the orientation of dipoles in an applied electric field. The *energy* keyword specifies the name of an atom-style :doc:`variable ` which is used to compute the energy of each -atom as function of its position. Like variables used for *ex*\ , *ey*\ , -*ez*\ , the energy variable is specified as v_name, where name is the -variable name. +atom as function of its position. Like variables used for *ex*\ , +*ey*\ , *ez*\ , the energy variable is specified as v_name, where name +is the variable name. Note that when the *energy* keyword is used during an energy minimization, you must insure that the formula defined for the @@ -117,31 +117,35 @@ minimization will not converge properly. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. +No information about this fix is written to :doc:`binary restart files +`. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the potential "energy" inferred by the added force due to -the electric field to the system's potential energy as part of -:doc:`thermodynamic output `. This is a fictitious -quantity but is needed so that the :doc:`minimize ` command -can include the forces added by this fix in a consistent manner. -I.e. there is a decrease in potential energy when atoms move in the -direction of the added force due to the electric field. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the potential energy inferred by the added force due +to the electric field to the global potential energy of the system as +part of :doc:`thermodynamic output `. The default +setting for this fix is :doc:`fix_modify energy no `. +Note that this energy is a fictitious quantity but is needed so that +the :doc:`minimize ` command can include the forces added by +this fix in a consistent manner. I.e. there is a decrease in +potential energy when atoms move in the direction of the added force +due to the electric field. -The :doc:`fix_modify ` *virial* option is supported by this -fix to add the contribution due to the added forces on atoms to the -system's virial as part of :doc:`thermodynamic output `. -The default is *virial no* +The :doc:`fix_modify ` *virial* option is supported by +this fix to add the contribution due to the added forces on atoms to +the system's virial as part of :doc:`thermodynamic output +`. The default is *virial no* The :doc:`fix_modify ` *respa* option is supported by this -fix. This allows to set at which level of the :doc:`r-RESPA ` -integrator the fix adding its forces. Default is the outermost level. +fix. This allows to set at which level of the :doc:`r-RESPA +` integrator the fix adding its forces. Default is the +outermost level. This fix computes a global scalar and a global 3-vector of forces, -which can be accessed by various :doc:`output commands `. -The scalar is the potential energy discussed above. The vector is the -total force added to the group of atoms. The scalar and vector values -calculated by this fix are "extensive". +which can be accessed by various :doc:`output commands +`. The scalar is the potential energy discussed above. +The vector is the total force added to the group of atoms. The scalar +and vector values calculated by this fix are "extensive". No parameter of this fix can be used with the *start/stop* keywords of the :doc:`run ` command. diff --git a/doc/src/fix_external.rst b/doc/src/fix_external.rst index fb71888025..cdb87c68a9 100644 --- a/doc/src/fix_external.rst +++ b/doc/src/fix_external.rst @@ -84,7 +84,8 @@ code `Quest `_. If mode is *pf/array* then the fix simply stores force values in an array. The fix adds these forces to each atom in the group, once -every *Napply* steps, similar to the way the :doc:`fix addforce ` command works. +every *Napply* steps, similar to the way the :doc:`fix addforce +` command works. The name of the public force array provided by the FixExternal class is @@ -150,19 +151,25 @@ of properties that the caller code may want to communicate to LAMMPS Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. +No information about this fix is written to :doc:`binary restart files +`. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the potential "energy" set by the external driver to the -system's potential energy as part of :doc:`thermodynamic output `. This is a fictitious quantity but is -needed so that the :doc:`minimize ` command can include the -forces added by this fix in a consistent manner. I.e. there is a -decrease in potential energy when atoms move in the direction of the -added force. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the potential energy set by the external driver to +both the global potential energy and peratom potential energies of the +system as part of :doc:`thermodynamic output ` or output +by the :doc:`compute pe/atom ` command. The default +setting for this fix is :doc:`fix_modify energy yes `. +Note that this energy may be a fictitious quantity but it is needed so +that the :doc:`minimize ` command can include the forces +added by this fix in a consistent manner. I.e. there is a decrease in +potential energy when atoms move in the direction of the added force. -The :doc:`fix_modify ` *virial* option is supported by this -fix to add the contribution due to the interactions computed by the -external program to the system's virial as part of :doc:`thermodynamic output `. The default is *virial yes* +The :doc:`fix_modify ` *virial* option is supported by +this fix to add the contribution computed by the external program to +the global pressure of the system as part of :doc:`thermodynamic +output `. The default setting for this fix is +:doc:`fix_modify virial yes `. This fix computes a global scalar which can be accessed by various :doc:`output commands `. The scalar is the potential @@ -178,7 +185,7 @@ invoked by the :doc:`minimize ` command. If you want the fictitious potential energy associated with the added forces to be included in the total potential energy of the - system (the quantity being minimized), you MUST enable the + system (the quantity being minimized), you MUST not disable the :doc:`fix_modify ` *energy* option for this fix. Restrictions diff --git a/doc/src/fix_ffl.rst b/doc/src/fix_ffl.rst index 3888c439c5..0bfdaf87c9 100644 --- a/doc/src/fix_ffl.rst +++ b/doc/src/fix_ffl.rst @@ -76,28 +76,31 @@ Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" The instantaneous values of the extended variables are written to -:doc:`binary restart files `. Because the state of the random -number generator is not saved in restart files, this means you cannot -do "exact" restarts with this fix, where the simulation continues on -the same as if no restart had taken place. However, in a statistical -sense, a restarted simulation should produce the same behavior. -Note however that you should use a different seed each time you -restart, otherwise the same sequence of random numbers will be used -each time, which might lead to stochastic synchronization and +:doc:`binary restart files `. Because the state of the +random number generator is not saved in restart files, this means you +cannot do "exact" restarts with this fix, where the simulation +continues on the same as if no restart had taken place. However, in a +statistical sense, a restarted simulation should produce the same +behavior. Note however that you should use a different seed each time +you restart, otherwise the same sequence of random numbers will be +used each time, which might lead to stochastic synchronization and subtle artifacts in the sampling. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. + +This fix computes a global scalar which can be accessed by various +:doc:`output commands `. The scalar is the same +cumulative energy change due to this fix described in the previous +paragraph. The scalar value calculated by this fix is "extensive". + This fix can ramp its target temperature over multiple runs, using the *start* and *stop* keywords of the :doc:`run ` command. See the :doc:`run ` command for details of how to do this. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change induced by Langevin thermostatting to the -system's potential energy as part of :doc:`thermodynamic output `. - -This fix computes a global scalar which can be accessed by various -:doc:`output commands `. The scalar is the cumulative -energy change due to this fix. The scalar value calculated by this -fix is "extensive". +This fix is not invoked during :doc:`energy minimization `. Restrictions """""""""""" diff --git a/doc/src/fix_flow_gauss.rst b/doc/src/fix_flow_gauss.rst index b40fefff0e..2affbd68f4 100644 --- a/doc/src/fix_flow_gauss.rst +++ b/doc/src/fix_flow_gauss.rst @@ -55,17 +55,22 @@ momentum. GD applies an external fluctuating gravitational field that acts as a driving force to keep the system away from equilibrium. To maintain steady state, a profile-unbiased thermostat must be implemented to -dissipate the heat that is added by the driving force. :doc:`Compute temp/profile ` can be used to implement a +dissipate the heat that is added by the driving force. :doc:`Compute +temp/profile ` can be used to implement a profile-unbiased thermostat. A common use of this fix is to compute a pressure drop across a pipe, pore, or membrane. The pressure profile can be computed in LAMMPS with -:doc:`compute stress/atom ` and :doc:`fix ave/chunk `, or with the hardy method in :doc:`fix atc `. Note that the simple :doc:`compute stress/atom ` method is only accurate away -from inhomogeneities in the fluid, such as fixed wall atoms. Further, -the computed pressure profile must be corrected for the acceleration +:doc:`compute stress/atom ` and :doc:`fix +ave/chunk `, or with the hardy method in :doc:`fix atc +`. Note that the simple :doc:`compute stress/atom +` method is only accurate away from +inhomogeneities in the fluid, such as fixed wall atoms. Further, the +computed pressure profile must be corrected for the acceleration applied by GD before computing a pressure drop or comparing it to -other methods, such as the pump method :ref:`(Zhu) `. The pressure -correction is discussed and described in :ref:`(Strong) `. +other methods, such as the pump method :ref:`(Zhu) `. The +pressure correction is discussed and described in :ref:`(Strong) +`. For a complete example including the considerations discussed above, see the examples/USER/flow_gauss directory. @@ -102,14 +107,15 @@ computed by the fix will return zero. of wall atoms fixed, such as :doc:`fix spring/self `. If this fix is used in a simulation with the :doc:`rRESPA ` -integrator, the applied acceleration must be computed and applied at the same -rRESPA level as the interactions between the flowing fluid and the obstacle. -The rRESPA level at which the acceleration is applied can be changed using -the :doc:`fix_modify ` *respa* option discussed below. If the -flowing fluid and the obstacle interact through multiple interactions that are -computed at different rRESPA levels, then there must be a separate flow/gauss -fix for each level. For example, if the flowing fluid and obstacle interact -through pairwise and long-range Coulomb interactions, which are computed at +integrator, the applied acceleration must be computed and applied at +the same rRESPA level as the interactions between the flowing fluid +and the obstacle. The rRESPA level at which the acceleration is +applied can be changed using the :doc:`fix_modify ` +*respa* option discussed below. If the flowing fluid and the obstacle +interact through multiple interactions that are computed at different +rRESPA levels, then there must be a separate flow/gauss fix for each +level. For example, if the flowing fluid and obstacle interact through +pairwise and long-range Coulomb interactions, which are computed at rRESPA levels 3 and 4, respectively, then there must be two separate flow/gauss fixes, one that specifies *fix_modify respa 3* and one with *fix_modify respa 4*. @@ -119,33 +125,42 @@ flow/gauss fixes, one that specifies *fix_modify respa 3* and one with Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This fix is part of the USER-MISC package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. +No information about this fix is written to :doc:`binary restart files +`. -No information about this fix is written to :doc:`binary restart files `. - -The :doc:`fix_modify ` *energy* option is supported by this -fix to subtract the work done from the -system's potential energy as part of :doc:`thermodynamic output `. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the potential energy added by the fix to the global +potential energy of the system as part of :doc:`thermodynamic output +`. The default setting for this fix is :doc:`fix_modify +energy no `. The :doc:`fix_modify ` *respa* option is supported by this -fix. This allows the user to set at which level of the :doc:`rRESPA ` -integrator the fix computes and adds the external acceleration. Default is the -outermost level. +fix. This allows the user to set at which level of the :doc:`rRESPA +` integrator the fix computes and adds the external +acceleration. Default is the outermost level. This fix computes a global scalar and a global 3-vector of forces, -which can be accessed by various :doc:`output commands `. -The scalar is the negative of the work done on the system, see above -discussion. The vector is the total force that this fix applied to -the group of atoms on the current timestep. The scalar and vector -values calculated by this fix are "extensive". +which can be accessed by various :doc:`output commands +`. The scalar is the negative of the work done on the +system, see the discussion above. It is only calculated if the +*energy* keyword is enabled or :doc:`fix_modify energy yes +` is set. + +The vector is the total force that this fix applied to the group of +atoms on the current timestep. The scalar and vector values +calculated by this fix are "extensive". No parameter of this fix can be used with the *start/stop* keywords of the :doc:`run ` command. +This fix is not invoked during :doc:`energy minimization `. + Restrictions """""""""""" - none + +This fix is part of the USER-MISC package. It is only enabled if +LAMMPS was built with that package. See the :doc:`Build package +` doc page for more info. Related commands """""""""""""""" diff --git a/doc/src/fix_gcmc.rst b/doc/src/fix_gcmc.rst index 8ea84303bc..894e4ec4b1 100644 --- a/doc/src/fix_gcmc.rst +++ b/doc/src/fix_gcmc.rst @@ -398,12 +398,13 @@ adds all inserted atoms of the specified type to the Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This fix writes the state of the fix to :doc:`binary restart files `. This includes information about the random -number generator seed, the next timestep for MC exchanges, the number -of MC step attempts and successes etc. See -the :doc:`read_restart ` command for info on how to -re-specify a fix in an input script that reads a restart file, so that -the operation of the fix continues in an uninterrupted fashion. +This fix writes the state of the fix to :doc:`binary restart files +`. This includes information about the random number +generator seed, the next timestep for MC exchanges, the number of MC +step attempts and successes etc. See the :doc:`read_restart +` command for info on how to re-specify a fix in an +input script that reads a restart file, so that the operation of the +fix continues in an uninterrupted fashion. .. note:: @@ -411,8 +412,8 @@ the operation of the fix continues in an uninterrupted fashion. after reading the restart with :doc:`reset_timestep `. The fix will try to detect it and stop with an error. -None of the :doc:`fix_modify ` options are relevant to this -fix. +None of the :doc:`fix_modify ` options are relevant to +this fix. This fix computes a global vector of length 8, which can be accessed by various :doc:`output commands `. The vector values are @@ -430,7 +431,8 @@ the following global cumulative quantities: The vector values calculated by this fix are "extensive". No parameter of this fix can be used with the *start/stop* keywords of -the :doc:`run ` command. This fix is not invoked during :doc:`energy minimization `. +the :doc:`run ` command. This fix is not invoked during +:doc:`energy minimization `. Restrictions """""""""""" diff --git a/doc/src/fix_gle.rst b/doc/src/fix_gle.rst index 1f14c7245d..a341e0fa08 100644 --- a/doc/src/fix_gle.rst +++ b/doc/src/fix_gle.rst @@ -103,28 +103,31 @@ Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" The instantaneous values of the extended variables are written to -:doc:`binary restart files `. Because the state of the random -number generator is not saved in restart files, this means you cannot -do "exact" restarts with this fix, where the simulation continues on -the same as if no restart had taken place. However, in a statistical -sense, a restarted simulation should produce the same behavior. -Note however that you should use a different seed each time you -restart, otherwise the same sequence of random numbers will be used -each time, which might lead to stochastic synchronization and +:doc:`binary restart files `. Because the state of the +random number generator is not saved in restart files, this means you +cannot do "exact" restarts with this fix, where the simulation +continues on the same as if no restart had taken place. However, in a +statistical sense, a restarted simulation should produce the same +behavior. Note however that you should use a different seed each time +you restart, otherwise the same sequence of random numbers will be +used each time, which might lead to stochastic synchronization and subtle artifacts in the sampling. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. + +This fix computes a global scalar which can be accessed by various +:doc:`output commands `. The scalar is the same +cumulative energy change due to this fix described in the previous +paragraph. The scalar value calculated by this fix is "extensive". + This fix can ramp its target temperature over multiple runs, using the *start* and *stop* keywords of the :doc:`run ` command. See the :doc:`run ` command for details of how to do this. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change induced by Langevin thermostatting to the -system's potential energy as part of :doc:`thermodynamic output `. - -This fix computes a global scalar which can be accessed by various -:doc:`output commands `. The scalar is the cumulative -energy change due to this fix. The scalar value calculated by this -fix is "extensive". +This fix is not invoked during :doc:`energy minimization `. Restrictions """""""""""" diff --git a/doc/src/fix_gravity.rst b/doc/src/fix_gravity.rst index a163eb4ab2..bd585b1312 100644 --- a/doc/src/fix_gravity.rst +++ b/doc/src/fix_gravity.rst @@ -103,23 +103,27 @@ Restart, fix_modify, output, run start/stop, minimize info No information about this fix is written to :doc:`binary restart files `. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the gravitational potential energy of the system to the -system's potential energy as part of :doc:`thermodynamic output `. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the gravitational potential energy of the system to +the global potential energy of the system as part of +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify energy no `. The :doc:`fix_modify ` *respa* option is supported by this -fix. This allows to set at which level of the :doc:`r-RESPA ` -integrator the fix is adding its forces. Default is the outermost level. +fix. This allows to set at which level of the :doc:`r-RESPA +` integrator the fix is adding its forces. Default is the +outermost level. This fix computes a global scalar which can be accessed by various -:doc:`output commands `. This scalar is the gravitational -potential energy of the particles in the defined field, namely mass \* -(g dot x) for each particles, where x and mass are the particles -position and mass, and g is the gravitational field. The scalar value -calculated by this fix is "extensive". +:doc:`output commands `. This scalar is the +gravitational potential energy of the particles in the defined field, +namely mass \* (g dot x) for each particles, where x and mass are the +particles position and mass, and g is the gravitational field. The +scalar value calculated by this fix is "extensive". No parameter of this fix can be used with the *start/stop* keywords of -the :doc:`run ` command. This fix is not invoked during :doc:`energy minimization `. +the :doc:`run ` command. This fix is not invoked during +:doc:`energy minimization `. Restrictions """""""""""" diff --git a/doc/src/fix_hyper_global.rst b/doc/src/fix_hyper_global.rst index 52f542f647..0b46616c5e 100644 --- a/doc/src/fix_hyper_global.rst +++ b/doc/src/fix_hyper_global.rst @@ -200,16 +200,20 @@ algorithm. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. +No information about this fix is written to :doc:`binary restart files +`. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy of the bias potential to the system's -potential energy as part of :doc:`thermodynamic output `. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the energy of the bias potential to the global +potential energy of the system as part of :doc:`thermodynamic output +`. The default setting for this fix is :doc:`fix_modify +energy no `. -This fix computes a global scalar and global vector of length 12, which -can be accessed by various :doc:`output commands `. The -scalar is the magnitude of the bias potential (energy units) applied on -the current timestep. The vector stores the following quantities: +This fix computes a global scalar and global vector of length 12, +which can be accessed by various :doc:`output commands +`. The scalar is the magnitude of the bias potential +(energy units) applied on the current timestep. The vector stores the +following quantities: * 1 = boost factor on this step (unitless) * 2 = max strain :math:`E_{ij}` of any bond on this step (absolute value, unitless) @@ -253,7 +257,8 @@ The scalar and vector values calculated by this fix are all "intensive". No parameter of this fix can be used with the *start/stop* keywords of -the :doc:`run ` command. This fix is not invoked during :doc:`energy minimization `. +the :doc:`run ` command. This fix is not invoked during +:doc:`energy minimization `. Restrictions """""""""""" diff --git a/doc/src/fix_hyper_local.rst b/doc/src/fix_hyper_local.rst index da197cad20..90238e0b4a 100644 --- a/doc/src/fix_hyper_local.rst +++ b/doc/src/fix_hyper_local.rst @@ -370,15 +370,17 @@ Restart, fix_modify, output, run start/stop, minimize info No information about this fix is written to :doc:`binary restart files `. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy of the bias potential to the system's potential -energy as part of :doc:`thermodynamic output `. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the energy of the bias potential to the global +potential energy of the system as part of :doc:`thermodynamic output +`. The default setting for this fix is :doc:`fix_modify +energy no `. This fix computes a global scalar and global vector of length 28, -which can be accessed by various :doc:`output commands `. -The scalar is the magnitude of the bias potential (energy units) -applied on the current timestep, summed over all biased bonds. The -vector stores the following quantities: +which can be accessed by various :doc:`output commands +`. The scalar is the magnitude of the bias potential +(energy units) applied on the current timestep, summed over all biased +bonds. The vector stores the following quantities: * 1 = average boost for all bonds on this step (unitless) * 2 = # of biased bonds on this step @@ -510,8 +512,8 @@ Value 27 computes the average boost for biased bonds only on this step. Value 28 is the count of bonds with an absolute value of strain >= q on this step. -The scalar and vector values calculated by this fix are all -"intensive". +The scalar value is an "extensive" quantity since it grows with the +system size; the vector values are all "intensive". This fix also computes a local vector of length the number of bonds currently in the system. The value for each bond is its :math:`C_{ij}` @@ -524,7 +526,8 @@ close to 1.0, which indicates a good choice of :math:`V^{max}`. The local values calculated by this fix are unitless. No parameter of this fix can be used with the *start/stop* keywords of -the :doc:`run ` command. This fix is not invoked during :doc:`energy minimization `. +the :doc:`run ` command. This fix is not invoked during +:doc:`energy minimization `. Restrictions """""""""""" diff --git a/doc/src/fix_indent.rst b/doc/src/fix_indent.rst index 2a77e27268..e9dab5141f 100644 --- a/doc/src/fix_indent.rst +++ b/doc/src/fix_indent.rst @@ -179,20 +179,25 @@ contains *xlat*\ , *ylat*\ , *zlat* keywords of the Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. +No information about this fix is written to :doc:`binary restart files +`. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy of interaction between atoms and the indenter to -the system's potential energy as part of :doc:`thermodynamic output `. The energy of each particle interacting -with the indenter is K/3 (r - R)\^3. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the energy of interaction between atoms and the +indenter to the global potential energy of the system as part of +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify energy no `. The energy of +each particle interacting with the indenter is K/3 (r - R)\^3. The :doc:`fix_modify ` *respa* option is supported by this -fix. This allows to set at which level of the :doc:`r-RESPA ` -integrator the fix is adding its forces. Default is the outermost level. +fix. This allows to set at which level of the :doc:`r-RESPA +` integrator the fix is adding its forces. Default is the +outermost level. This fix computes a global scalar energy and a global 3-vector of -forces (on the indenter), which can be accessed by various :doc:`output commands `. The scalar and vector values calculated -by this fix are "extensive". +forces (on the indenter), which can be accessed by various +:doc:`output commands `. The scalar and vector values +calculated by this fix are "extensive". The forces due to this fix are imposed during an energy minimization, invoked by the :doc:`minimize ` command. Note that if you @@ -204,10 +209,10 @@ check if you have done this. .. note:: - If you want the atom/indenter interaction energy to be included - in the total potential energy of the system (the quantity being - minimized), you must enable the :doc:`fix_modify ` *energy* - option for this fix. + If you want the atom/indenter interaction energy to be included in + the total potential energy of the system (the quantity being + minimized), you must enable the :doc:`fix_modify ` + *energy* option for this fix. Restrictions """""""""""" diff --git a/doc/src/fix_langevin.rst b/doc/src/fix_langevin.rst index e31434247f..b8524069ec 100644 --- a/doc/src/fix_langevin.rst +++ b/doc/src/fix_langevin.rst @@ -287,16 +287,18 @@ you have defined to this fix which will be used in its thermostatting procedure, as described above. For consistency, the group used by this fix and by the compute should be the same. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change induced by Langevin thermostatting to the -system's potential energy as part of :doc:`thermodynamic output `. Note that use of this option requires -setting the *tally* keyword to *yes*\ . +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*\ , but only if the *tally* keyword to set to +*yes*\ . See the :doc:`thermo_style ` doc page for +details. This fix computes a global scalar which can be accessed by various -:doc:`output commands `. The scalar is the cumulative -energy change due to this fix. The scalar value calculated by this -fix is "extensive". Note that calculation of this quantity requires -setting the *tally* keyword to *yes*\ . +:doc:`output commands `. The scalar is the same +cumulative energy change due to this fix described in the previous +paragraph. The scalar value calculated by this fix is "extensive". +Note that calculation of this quantity also requires setting the +*tally* keyword to *yes*\ . This fix can ramp its target temperature over multiple runs, using the *start* and *stop* keywords of the :doc:`run ` command. See the diff --git a/doc/src/fix_langevin_eff.rst b/doc/src/fix_langevin_eff.rst index 29df472d83..c6fd1b0b40 100644 --- a/doc/src/fix_langevin_eff.rst +++ b/doc/src/fix_langevin_eff.rst @@ -81,16 +81,18 @@ you have defined to this fix which will be used in its thermostatting procedure, as described above. For consistency, the group used by this fix and by the compute should be the same. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change induced by Langevin thermostatting to the -system's potential energy as part of :doc:`thermodynamic output `. Note that use of this option requires -setting the *tally* keyword to *yes*\ . +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*\ , but only if the *tally* keyword to set to +*yes*\ . See the :doc:`thermo_style ` doc page for +details. This fix computes a global scalar which can be accessed by various -:doc:`output commands `. The scalar is the cumulative -energy change due to this fix. The scalar value calculated by this -fix is "extensive". Note that calculation of this quantity requires -setting the *tally* keyword to *yes*\ . +:doc:`output commands `. The scalar is the same +cumulative energy change due to this fix described in the previous +paragraph. The scalar value calculated by this fix is "extensive". +Note that calculation of this quantity also requires setting the +*tally* keyword to *yes*\ . This fix can ramp its target temperature over multiple runs, using the *start* and *stop* keywords of the :doc:`run ` command. See the diff --git a/doc/src/fix_latte.rst b/doc/src/fix_latte.rst index 0d6488af26..563656be5f 100644 --- a/doc/src/fix_latte.rst +++ b/doc/src/fix_latte.rst @@ -107,16 +107,20 @@ larger system sizes and longer time scales Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. +No information about this fix is written to :doc:`binary restart files +`. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the potential energy computed by LATTE to the system's -potential energy as part of :doc:`thermodynamic output `. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the potential energy computed by LATTE to the global +potential energy of the system as part of :doc:`thermodynamic output +`. The default setting for this fix is :doc:`fix_modify +energy yes `. -The :doc:`fix_modify ` *virial* option is supported by this -fix to add the LATTE DFTB contribution to the system's virial as part -of :doc:`thermodynamic output `. The default is *virial -yes* +The :doc:`fix_modify ` *virial* option is supported by +this fix to add the contribution computed by LATTE to the global +pressure of the system as part of :doc:`thermodynamic output +`. The default setting for this fix is :doc:`fix_modify +virial yes `. This fix computes a global scalar which can be accessed by various :doc:`output commands `. The scalar is the potential @@ -127,20 +131,22 @@ No parameter of this fix can be used with the *start/stop* keywords of the :doc:`run ` command. The DFTB forces computed by LATTE via this fix are imposed during an -energy minimization, invoked by the :doc:`minimize ` command. +energy minimization, invoked by the :doc:`minimize ` +command. .. note:: If you want the potential energy associated with the DFTB forces to be included in the total potential energy of the system (the - quantity being minimized), you MUST enable the + quantity being minimized), you MUST not disable the :doc:`fix_modify ` *energy* option for this fix. Restrictions """""""""""" This fix is part of the LATTE package. It is only enabled if LAMMPS -was built with that package. See the :doc:`Build package ` doc page for more info. +was built with that package. See the :doc:`Build package +` doc page for more info. You must use metal units, as set by the :doc:`units ` command to use this fix. diff --git a/doc/src/fix_modify.rst b/doc/src/fix_modify.rst index 604b63550c..d382d3ebe8 100644 --- a/doc/src/fix_modify.rst +++ b/doc/src/fix_modify.rst @@ -59,43 +59,58 @@ define their own compute by default, as described in their documentation. Thus this option allows the user to override the default method for computing P. -The *energy* keyword can be used with fixes that support it. -*energy yes* adds a contribution to the potential energy of the -system. The fix's global and per-atom -energy is included in the calculation performed by the :doc:`compute pe ` or :doc:`compute pe/atom ` -commands. See the :doc:`thermo_style ` command for info -on how potential energy is output. For fixes that tally a global -energy, it can be printed by using the keyword f_ID in the -thermo_style custom command, where ID is the fix-ID of the appropriate -fix. +The *energy* keyword can be used with fixes that support it, which is +explained at the bottom of their doc page. *Energy yes* will add a +contribution to the potential energy of the system. More +specifically, the fix's global or per-atom energy is included in the +calculation performed by the :doc:`compute pe ` or +:doc:`compute pe/atom ` commands. The former is what +is used the :doc:`thermo_style ` command for output of +any quantity that includes the global potential energy of the system. +Note that the :doc:`compute pe ` and :doc:`compute pe/atom +` commands also have an option to include or exclude +the contribution from fixes. For fixes that tally a global energy, it +can also be printed with thermodynamic output by using the keyword +f_ID in the thermo_style custom command, where ID is the fix-ID of the +appropriate fix. .. note:: - You must also specify the *energy yes* setting for a fix if you - are using it when performing an :doc:`energy minimization ` - and if you want the energy and forces it produces to be part of the - optimization criteria. - -The *virial* keyword can be used with fixes that support it. -*virial yes* adds a contribution to the virial of the -system. The fix's global and per-atom -virial is included in the calculation performed by the :doc:`compute pressure ` or -:doc:`compute stress/atom ` -commands. See the :doc:`thermo_style ` command for info -on how pressure is output. + If you are performing an :doc:`energy minimization ` with + one of these fixes and want the energy and forces it produces to be + part of the optimization criteria, you must specify the *energy + yes* setting. .. note:: - You must specify the *virial yes* setting for a fix if you - are doing :doc:`box relaxation ` and - if you want virial contribution of the fix to be part of the - relaxation criteria, although this seems unlikely. + For most fixes that suppport the *energy* keyword, the default + setting is *no*. For a few it is *yes*, when a user would expect + that to be the case. The doc page of each fix gives the default. + +The *virial* keyword can be used with fixes that support it, which is +explained at the bottom of their doc page. *Virial yes* will add a +contribution to the virial of the system. More specifically, the +fix's global or per-atom virial is included in the calculation +performed by the :doc:`compute pressure ` or +:doc:`compute stress/atom ` commands. The former +is what is used the :doc:`thermo_style ` command for +output of any quantity that includes the global pressure of the +system. Note that the :doc:`compute pressure ` and +:doc:`compute stress/atom ` commands also have an +option to include or exclude the contribution from fixes. .. note:: - This option is only supported by fixes that explicitly say - so. For some of these (e.g. the :doc:`fix shake ` command) - the default setting is *virial yes*\ , for others it is *virial no*\ . + If you are performing an :doc:`energy minimization ` with + :doc:`box relaxation ` and one of these fixes and + want the virial contribution of the fix to be part of the + optimization criteria, you must specify the *virial yes* setting. + +.. note:: + + For most fixes that suppport the *virial* keyword, the default + setting is *no*. For a few it is *yes*, when a user would expect + that to be the case. The doc page of each fix gives the default. For fixes that set or modify forces, it may be possible to select at which :doc:`r-RESPA ` level the fix operates via the *respa* @@ -112,13 +127,15 @@ The *dynamic/dof* keyword determines whether the number of atoms N in the fix group and their associated degrees of freedom are re-computed each time a temperature is computed. Only fix styles that calculate their own internal temperature use this option. Currently this is -only the :doc:`fix rigid/nvt/small ` and :doc:`fix rigid/npt/small ` commands for the purpose of +only the :doc:`fix rigid/nvt/small ` and :doc:`fix +rigid/npt/small ` commands for the purpose of thermostatting rigid body translation and rotation. By default, N and their DOF are assumed to be constant. If you are adding atoms or -molecules to the system (see the :doc:`fix pour `, :doc:`fix deposit `, and :doc:`fix gcmc ` commands) or +molecules to the system (see the :doc:`fix pour `, :doc:`fix +deposit `, and :doc:`fix gcmc ` commands) or expect atoms or molecules to be lost (e.g. due to exiting the -simulation box or via :doc:`fix evaporate `), then -this option should be used to insure the temperature is correctly +simulation box or via :doc:`fix evaporate `), then this +option should be used to insure the temperature is correctly normalized. .. note:: diff --git a/doc/src/fix_msst.rst b/doc/src/fix_msst.rst index 14158227d0..e3996776a1 100644 --- a/doc/src/fix_msst.rst +++ b/doc/src/fix_msst.rst @@ -131,20 +131,29 @@ command for info on how to re-specify a fix in an input script that reads a restart file, so that the operation of the fix continues in an uninterrupted fashion. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. + +This fix computes a global scalar which can be accessed by various +:doc:`output commands `. The scalar is the same +cumulative energy change due to this fix described in the previous +paragraph. The scalar value calculated by this fix is "extensive". + The progress of the MSST can be monitored by printing the global scalar and global vector quantities computed by the fix. -The scalar is the cumulative energy change due to the fix. This is -also the energy added to the potential energy by the -:doc:`fix_modify ` *energy* command. With this command, the -thermo keyword *etotal* prints the conserved quantity of the MSST -dynamic equations. This can be used to test if the MD timestep is -sufficiently small for accurate integration of the dynamic -equations. See also :doc:`thermo_style ` command. +As mentioned above, the scalar is the cumulative energy change due to +the fix. By monitoring the thermodynamic *econserve* output, this can +be used to test if the MD timestep is sufficiently small for accurate +integration of the dynamic equations. -The global vector contains four values in this order: +The global vector contains four values in the following order. The +vector values output by this fix are "intensive". -[\ *dhugoniot*\ , *drayleigh*\ , *lagrangian_speed*, *lagrangian_position*] +[\ *dhugoniot*\ , *drayleigh*\ , *lagrangian_speed*, +*lagrangian_position*] 1. *dhugoniot* is the departure from the Hugoniot (temperature units). 2. *drayleigh* is the departure from the Rayleigh line (pressure units). @@ -157,17 +166,11 @@ headers, the following LAMMPS commands are suggested: .. code-block:: LAMMPS fix msst all msst z - fix_modify msst energy yes variable dhug equal f_msst[1] variable dray equal f_msst[2] variable lgr_vel equal f_msst[3] variable lgr_pos equal f_msst[4] - thermo_style custom step temp ke pe lz pzz etotal v_dhug v_dray v_lgr_vel v_lgr_pos f_msst - -These fixes compute a global scalar and a global vector of 4 -quantities, which can be accessed by various :doc:`output commands -`. The scalar values calculated by this fix are -"extensive"; the vector values are "intensive". + thermo_style custom step temp ke pe lz pzz econserve v_dhug v_dray v_lgr_vel v_lgr_pos f_msst Restrictions """""""""""" diff --git a/doc/src/fix_nh.rst b/doc/src/fix_nh.rst index 988a147abe..590211eda7 100644 --- a/doc/src/fix_nh.rst +++ b/doc/src/fix_nh.rst @@ -594,17 +594,20 @@ compute temperature on a subset of atoms. specified by the *press* keyword will be unaffected by the *temp* setting. -The :doc:`fix_modify ` *energy* option is supported by these -fixes to add the energy change induced by Nose/Hoover thermostatting -and barostatting to the system's potential energy as part of -:doc:`thermodynamic output `. +The cumulative energy change in the system imposed by these fixes, via +either thermostatting and/or barostatting, is included in the +:doc:`thermodynamic output ` keywords *ecouple* and +*econserve*. See the :doc:`thermo_style ` doc page for +details. -These fixes compute a global scalar and a global vector of quantities, -which can be accessed by various :doc:`output commands `. -The scalar value calculated by these fixes is "extensive"; the vector -values are "intensive". +These fixes compute a global scalar which can be accessed by various +:doc:`output commands `. The scalar is the same +cumulative energy change due to this fix described in the previous +paragraph. The scalar value calculated by this fix is "extensive". -The scalar is the cumulative energy change due to the fix. +These fixes compute also compute a global vector of quantities, which +can be accessed by various :doc:`output commands `. The +vector values are "intensive". The vector stores internal Nose/Hoover thermostat and barostat variables. The number and meaning of the vector values depends on diff --git a/doc/src/fix_nph_asphere.rst b/doc/src/fix_nph_asphere.rst index da0510492e..011630a534 100644 --- a/doc/src/fix_nph_asphere.rst +++ b/doc/src/fix_nph_asphere.rst @@ -87,7 +87,8 @@ It also means that changing attributes of *thermo_temp* or Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This fix writes the state of the Nose/Hoover barostat to :doc:`binary restart files `. See the :doc:`read_restart ` +This fix writes the state of the Nose/Hoover barostat to :doc:`binary +restart files `. See the :doc:`read_restart ` command for info on how to re-specify a fix in an input script that reads a restart file, so that the operation of the fix continues in an uninterrupted fashion. @@ -101,9 +102,10 @@ consistent with the virial term computed using all atoms for the pressure. LAMMPS will warn you if you choose to compute temperature on a subset of atoms. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change induced by Nose/Hoover barostatting to -the system's potential energy as part of :doc:`thermodynamic output `. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. This fix computes the same global scalar and global vector of quantities as does the :doc:`fix nph ` command. diff --git a/doc/src/fix_nph_body.rst b/doc/src/fix_nph_body.rst index fd517b5243..4c91d28588 100644 --- a/doc/src/fix_nph_body.rst +++ b/doc/src/fix_nph_body.rst @@ -84,7 +84,8 @@ It also means that changing attributes of *thermo_temp* or Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This fix writes the state of the Nose/Hoover barostat to :doc:`binary restart files `. See the :doc:`read_restart ` +This fix writes the state of the Nose/Hoover barostat to :doc:`binary +restart files `. See the :doc:`read_restart ` command for info on how to re-specify a fix in an input script that reads a restart file, so that the operation of the fix continues in an uninterrupted fashion. @@ -98,9 +99,10 @@ consistent with the virial term computed using all atoms for the pressure. LAMMPS will warn you if you choose to compute temperature on a subset of atoms. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change induced by Nose/Hoover barostatting to -the system's potential energy as part of :doc:`thermodynamic output `. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. This fix computes the same global scalar and global vector of quantities as does the :doc:`fix nph ` command. diff --git a/doc/src/fix_nph_sphere.rst b/doc/src/fix_nph_sphere.rst index 4b76f7252f..6062faa50e 100644 --- a/doc/src/fix_nph_sphere.rst +++ b/doc/src/fix_nph_sphere.rst @@ -100,7 +100,8 @@ It also means that changing attributes of *thermo_temp* or Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This fix writes the state of the Nose/Hoover barostat to :doc:`binary restart files `. See the :doc:`read_restart ` +This fix writes the state of the Nose/Hoover barostat to :doc:`binary +restart files `. See the :doc:`read_restart ` command for info on how to re-specify a fix in an input script that reads a restart file, so that the operation of the fix continues in an uninterrupted fashion. @@ -114,9 +115,10 @@ consistent with the virial term computed using all atoms for the pressure. LAMMPS will warn you if you choose to compute temperature on a subset of atoms. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change induced by Nose/Hoover barostatting to -the system's potential energy as part of :doc:`thermodynamic output `. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. This fix computes the same global scalar and global vector of quantities as does the :doc:`fix nph ` command. diff --git a/doc/src/fix_nphug.rst b/doc/src/fix_nphug.rst index d55f435d43..776b3e4849 100644 --- a/doc/src/fix_nphug.rst +++ b/doc/src/fix_nphug.rst @@ -168,43 +168,47 @@ specified, then the instantaneous value in the system at the start of the simulation is used. The :doc:`fix_modify ` *temp* and *press* options are -supported by these fixes. You can use them to assign a -:doc:`compute ` you have defined to this fix which will be used -in its thermostatting or barostatting procedure, as described above. -If you do this, note that the kinetic energy derived from the compute +supported by this fix. You can use them to assign a :doc:`compute +` you have defined to this fix which will be used in its +thermostatting or barostatting procedure, as described above. If you +do this, note that the kinetic energy derived from the compute temperature should be consistent with the virial term computed using all atoms for the pressure. LAMMPS will warn you if you choose to compute temperature on a subset of atoms. -The :doc:`fix_modify ` *energy* option is supported by these -fixes to add the energy change induced by Nose/Hoover thermostatting -and barostatting to the system's potential energy as part of -:doc:`thermodynamic output `. Either way, this energy is \*not\* -included in the definition of internal energy E when calculating the value -of Delta in the above equation. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. Note that this energy is \*not\* included in +the definition of internal energy E when calculating the value of +Delta in the above equation. -These fixes compute a global scalar and a global vector of quantities, -which can be accessed by various :doc:`output commands `. -The scalar value calculated by these fixes is "extensive"; the vector -values are "intensive". +This fix computes a global scalar which can be accessed by various +:doc:`output commands `. The scalar is the same +cumulative energy change due to this fix described in the previous +paragraph. The scalar value calculated by this fix is "extensive". -The scalar is the cumulative energy change due to the fix. +This fix also computes a global vector of quantities, which can be +accessed by various :doc:`output commands `. The scalar +The vector values are "intensive". -The vector stores three quantities unique to this fix (:math:`\Delta`, Us, and up), -followed by all the internal Nose/Hoover thermostat and barostat -variables defined for :doc:`fix npt `. Delta is the deviation -of the temperature from the target temperature, given by the above equation. -Us and up are the shock and particle velocity corresponding to a steady -shock calculated from the RH conditions. They have units of distance/time. +The vector stores three quantities unique to this fix (:math:`\Delta`, +Us, and up), followed by all the internal Nose/Hoover thermostat and +barostat variables defined for :doc:`fix npt `. Delta is the +deviation of the temperature from the target temperature, given by the +above equation. Us and up are the shock and particle velocity +corresponding to a steady shock calculated from the RH +conditions. They have units of distance/time. Restrictions """""""""""" This fix style is part of the SHOCK package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. +LAMMPS was built with that package. See the :doc:`Build package +` doc page for more info. -All the usual restrictions for :doc:`fix npt ` apply, -plus the additional ones mentioned above. +All the usual restrictions for :doc:`fix npt ` apply, plus the +additional ones mentioned above. Related commands """""""""""""""" diff --git a/doc/src/fix_npt_asphere.rst b/doc/src/fix_npt_asphere.rst index de2289a068..f65ecd8d19 100644 --- a/doc/src/fix_npt_asphere.rst +++ b/doc/src/fix_npt_asphere.rst @@ -124,10 +124,10 @@ consistent with the virial term computed using all atoms for the pressure. LAMMPS will warn you if you choose to compute temperature on a subset of atoms. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change induced by Nose/Hoover thermostatting and -barostatting to the system's potential energy as part of -:doc:`thermodynamic output `. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. This fix computes the same global scalar and global vector of quantities as does the :doc:`fix npt ` command. diff --git a/doc/src/fix_npt_body.rst b/doc/src/fix_npt_body.rst index 412d522a45..af0a0fb252 100644 --- a/doc/src/fix_npt_body.rst +++ b/doc/src/fix_npt_body.rst @@ -45,7 +45,8 @@ can also have a bias velocity removed from them before thermostatting takes place; see the description below. Additional parameters affecting the thermostat and barostat are -specified by keywords and values documented with the :doc:`fix npt ` command. See, for example, discussion of the *temp*\ , +specified by keywords and values documented with the :doc:`fix npt +` command. See, for example, discussion of the *temp*\ , *iso*\ , *aniso*\ , and *dilate* keywords. The particles in the fix group are the only ones whose velocities and @@ -121,10 +122,10 @@ consistent with the virial term computed using all atoms for the pressure. LAMMPS will warn you if you choose to compute temperature on a subset of atoms. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change induced by Nose/Hoover thermostatting and -barostatting to the system's potential energy as part of -:doc:`thermodynamic output `. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. This fix computes the same global scalar and global vector of quantities as does the :doc:`fix npt ` command. diff --git a/doc/src/fix_npt_cauchy.rst b/doc/src/fix_npt_cauchy.rst index 034a2c9c8d..8ef74b25c9 100644 --- a/doc/src/fix_npt_cauchy.rst +++ b/doc/src/fix_npt_cauchy.rst @@ -487,27 +487,31 @@ compute temperature on a subset of atoms. .. note:: If both the *temp* and *press* keywords are used in a single - thermo_modify command (or in two separate commands), then the order in - which the keywords are specified is important. Note that a :doc:`pressure compute ` defines its own temperature compute as - an argument when it is specified. The *temp* keyword will override - this (for the pressure compute being used by fix npt), but only if the - *temp* keyword comes after the *press* keyword. If the *temp* keyword - comes before the *press* keyword, then the new pressure compute - specified by the *press* keyword will be unaffected by the *temp* - setting. + thermo_modify command (or in two separate commands), then the order + in which the keywords are specified is important. Note that a + :doc:`pressure compute ` defines its own + temperature compute as an argument when it is specified. The + *temp* keyword will override this (for the pressure compute being + used by fix npt), but only if the *temp* keyword comes after the + *press* keyword. If the *temp* keyword comes before the *press* + keyword, then the new pressure compute specified by the *press* + keyword will be unaffected by the *temp* setting. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change induced by Nose/Hoover thermostatting -and barostatting to the system's potential energy as part of -:doc:`thermodynamic output `. +The cumulative energy change in the system imposed by this fix, due to +thermostatting and/or barostatting, is included in the +:doc:`thermodynamic output ` keywords *ecouple* and +*econserve*. See the :doc:`thermo_style ` doc page for +details. -This fix computes a global scalar and a global vector of quantities, -which can be accessed by various :doc:`output commands `. -The scalar value calculated by this fix is "extensive"; the vector +This fix computes a global scalar which can be accessed by various +:doc:`output commands `. The scalar is the same +cumulative energy change due to this fix described in the previous +paragraph. The scalar value calculated by this fix is "extensive". + +This fix also computes a global vector of quantities, which can be +accessed by various :doc:`output commands `. Rhe vector values are "intensive". -The scalar is the cumulative energy change due to the fix. - The vector stores internal Nose/Hoover thermostat and barostat variables. The number and meaning of the vector values depends on which fix is used and the settings for keywords *tchain* and *pchain*\ , diff --git a/doc/src/fix_npt_sphere.rst b/doc/src/fix_npt_sphere.rst index 7363375ff3..dd78cebbf1 100644 --- a/doc/src/fix_npt_sphere.rst +++ b/doc/src/fix_npt_sphere.rst @@ -93,13 +93,14 @@ IDs of the new computes are the fix-ID + underscore + "temp" or fix_ID since pressure is computed for the entire system. Note that these are NOT the computes used by thermodynamic output (see -the :doc:`thermo_style ` command) with ID = *thermo_temp* -and *thermo_press*. This means you can change the attributes of this -fix's temperature or pressure via the -:doc:`compute_modify ` command or print this temperature -or pressure during thermodynamic output via the :doc:`thermo_style custom ` command using the appropriate compute-ID. -It also means that changing attributes of *thermo_temp* or -*thermo_press* will have no effect on this fix. +the :doc:`thermo_style ` command) with ID = +*thermo_temp* and *thermo_press*. This means you can change the +attributes of this fix's temperature or pressure via the +:doc:`compute_modify ` command or print this +temperature or pressure during thermodynamic output via the +:doc:`thermo_style custom ` command using the +appropriate compute-ID. It also means that changing attributes of +*thermo_temp* or *thermo_press* will have no effect on this fix. Like other fixes that perform thermostatting, this fix can be used with :doc:`compute commands ` that calculate a temperature @@ -129,18 +130,18 @@ a fix in an input script that reads a restart file, so that the operation of the fix continues in an uninterrupted fashion. The :doc:`fix_modify ` *temp* and *press* options are -supported by this fix. You can use them to assign a -:doc:`compute ` you have defined to this fix which will be used -in its thermostatting or barostatting procedure. If you do this, note -that the kinetic energy derived from the compute temperature should be +supported by this fix. You can use them to assign a :doc:`compute +` you have defined to this fix which will be used in its +thermostatting or barostatting procedure. If you do this, note that +the kinetic energy derived from the compute temperature should be consistent with the virial term computed using all atoms for the pressure. LAMMPS will warn you if you choose to compute temperature on a subset of atoms. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change induced by Nose/Hoover thermostatting and -barostatting to the system's potential energy as part of -:doc:`thermodynamic output `. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. This fix computes the same global scalar and global vector of quantities as does the :doc:`fix npt ` command. diff --git a/doc/src/fix_nvt_asphere.rst b/doc/src/fix_nvt_asphere.rst index bb4139d95f..98e8a5b495 100644 --- a/doc/src/fix_nvt_asphere.rst +++ b/doc/src/fix_nvt_asphere.rst @@ -92,19 +92,21 @@ thermal degrees of freedom, and the bias is added back in. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This fix writes the state of the Nose/Hoover thermostat to :doc:`binary restart files `. See the :doc:`read_restart ` -command for info on how to re-specify a fix in an input script that -reads a restart file, so that the operation of the fix continues in an -uninterrupted fashion. +This fix writes the state of the Nose/Hoover thermostat to +:doc:`binary restart files `. See the :doc:`read_restart +` command for info on how to re-specify a fix in an +input script that reads a restart file, so that the operation of the +fix continues in an uninterrupted fashion. The :doc:`fix_modify ` *temp* option is supported by this fix. You can use it to assign a :doc:`compute ` you have defined to this fix which will be used in its thermostatting procedure. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change induced by Nose/Hoover thermostatting to -the system's potential energy as part of :doc:`thermodynamic output `. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. This fix computes the same global scalar and global vector of quantities as does the :doc:`fix nvt ` command. diff --git a/doc/src/fix_nvt_body.rst b/doc/src/fix_nvt_body.rst index b608c93f27..02b7d0c66c 100644 --- a/doc/src/fix_nvt_body.rst +++ b/doc/src/fix_nvt_body.rst @@ -89,19 +89,21 @@ thermal degrees of freedom, and the bias is added back in. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This fix writes the state of the Nose/Hoover thermostat to :doc:`binary restart files `. See the :doc:`read_restart ` -command for info on how to re-specify a fix in an input script that -reads a restart file, so that the operation of the fix continues in an -uninterrupted fashion. +This fix writes the state of the Nose/Hoover thermostat to +:doc:`binary restart files `. See the :doc:`read_restart +` command for info on how to re-specify a fix in an +input script that reads a restart file, so that the operation of the +fix continues in an uninterrupted fashion. The :doc:`fix_modify ` *temp* option is supported by this fix. You can use it to assign a :doc:`compute ` you have defined to this fix which will be used in its thermostatting procedure. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change induced by Nose/Hoover thermostatting to -the system's potential energy as part of :doc:`thermodynamic output `. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. This fix computes the same global scalar and global vector of quantities as does the :doc:`fix nvt ` command. diff --git a/doc/src/fix_nvt_sllod.rst b/doc/src/fix_nvt_sllod.rst index ff9a4f0d12..9ff22bca09 100644 --- a/doc/src/fix_nvt_sllod.rst +++ b/doc/src/fix_nvt_sllod.rst @@ -122,19 +122,21 @@ thermal degrees of freedom, and the bias is added back in. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This fix writes the state of the Nose/Hoover thermostat to :doc:`binary restart files `. See the :doc:`read_restart ` -command for info on how to re-specify a fix in an input script that -reads a restart file, so that the operation of the fix continues in an -uninterrupted fashion. +This fix writes the state of the Nose/Hoover thermostat to +:doc:`binary restart files `. See the :doc:`read_restart +` command for info on how to re-specify a fix in an +input script that reads a restart file, so that the operation of the +fix continues in an uninterrupted fashion. The :doc:`fix_modify ` *temp* option is supported by this fix. You can use it to assign a :doc:`compute ` you have defined to this fix which will be used in its thermostatting procedure. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change induced by Nose/Hoover thermostatting to -the system's potential energy as part of :doc:`thermodynamic output `. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. This fix computes the same global scalar and global vector of quantities as does the :doc:`fix nvt ` command. diff --git a/doc/src/fix_nvt_sllod_eff.rst b/doc/src/fix_nvt_sllod_eff.rst index 09fc1ecff6..e07e990d4b 100644 --- a/doc/src/fix_nvt_sllod_eff.rst +++ b/doc/src/fix_nvt_sllod_eff.rst @@ -41,19 +41,21 @@ velocity. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This fix writes the state of the Nose/Hoover thermostat to :doc:`binary restart files `. See the :doc:`read_restart ` -command for info on how to re-specify a fix in an input script that -reads a restart file, so that the operation of the fix continues in an -uninterrupted fashion. +This fix writes the state of the Nose/Hoover thermostat to +:doc:`binary restart files `. See the :doc:`read_restart +` command for info on how to re-specify a fix in an +input script that reads a restart file, so that the operation of the +fix continues in an uninterrupted fashion. The :doc:`fix_modify ` *temp* option is supported by this fix. You can use it to assign a :doc:`compute ` you have defined to this fix which will be used in its thermostatting procedure. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change induced by Nose/Hoover thermostatting to -the system's potential energy as part of :doc:`thermodynamic output `. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. This fix computes the same global scalar and global vector of quantities as does the :doc:`fix nvt/eff ` command. diff --git a/doc/src/fix_nvt_sphere.rst b/doc/src/fix_nvt_sphere.rst index 8226328cea..31c8d91889 100644 --- a/doc/src/fix_nvt_sphere.rst +++ b/doc/src/fix_nvt_sphere.rst @@ -106,19 +106,21 @@ thermal degrees of freedom, and the bias is added back in. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This fix writes the state of the Nose/Hoover thermostat to :doc:`binary restart files `. See the :doc:`read_restart ` -command for info on how to re-specify a fix in an input script that -reads a restart file, so that the operation of the fix continues in an -uninterrupted fashion. +This fix writes the state of the Nose/Hoover thermostat to +:doc:`binary restart files `. See the :doc:`read_restart +` command for info on how to re-specify a fix in an +input script that reads a restart file, so that the operation of the +fix continues in an uninterrupted fashion. The :doc:`fix_modify ` *temp* option is supported by this fix. You can use it to assign a :doc:`compute ` you have defined to this fix which will be used in its thermostatting procedure. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change induced by Nose/Hoover thermostatting to -the system's potential energy as part of :doc:`thermodynamic output `. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. This fix computes the same global scalar and global vector of quantities as does the :doc:`fix nvt ` command. diff --git a/doc/src/fix_orient.rst b/doc/src/fix_orient.rst index 31aa6074d1..12f22403cd 100644 --- a/doc/src/fix_orient.rst +++ b/doc/src/fix_orient.rst @@ -144,16 +144,20 @@ writing the orientation files is given in :ref:`(Wicaksono2) ` Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. +No information about this fix is written to :doc:`binary restart files +`. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the potential energy of atom interactions with the grain -boundary driving force to the system's potential energy as part of -:doc:`thermodynamic output `. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the potential energy of atom interactions with the +grain bounadry driving force to the global potential energy of the +system as part of :doc:`thermodynamic output `. The +default setting for this fix is :doc:`fix_modify energy no +`. -The :doc:`fix_modify ` *respa* option is supported by these -fixes. This allows to set at which level of the :doc:`r-RESPA ` -integrator a fix is adding its forces. Default is the outermost level. +The :doc:`fix_modify ` *respa* option is supported by +these fixes. This allows to set at which level of the :doc:`r-RESPA +` integrator a fix is adding its forces. Default is the +outermost level. This fix calculates a global scalar which can be accessed by various :doc:`output commands `. The scalar is the potential @@ -166,13 +170,16 @@ order parameter Xi and normalized order parameter (0 to 1) for each atom. The per-atom values can be accessed on any timestep. No parameter of this fix can be used with the *start/stop* keywords of -the :doc:`run ` command. This fix is not invoked during :doc:`energy minimization `. +the :doc:`run ` command. + +This fix is not invoked during :doc:`energy minimization `. Restrictions """""""""""" This fix is part of the MISC package. It is only enabled if LAMMPS -was built with that package. See the :doc:`Build package ` doc page for more info. +was built with that package. See the :doc:`Build package +` doc page for more info. This fix should only be used with fcc or bcc lattices. diff --git a/doc/src/fix_orient_eco.rst b/doc/src/fix_orient_eco.rst index 58ff38268f..71d5a6de86 100644 --- a/doc/src/fix_orient_eco.rst +++ b/doc/src/fix_orient_eco.rst @@ -26,22 +26,24 @@ Examples Description """"""""""" -The fix applies a synthetic driving force to a grain boundary which can -be used for the investigation of grain boundary motion. The affiliation -of atoms to either of the two grains forming the grain boundary is -determined from an orientation-dependent order parameter as described -in :ref:`(Ulomek) `. The potential energy of atoms is either increased by an amount -of 0.5*\ *u0* or -0.5*\ *u0* according to the orientation of the surrounding -crystal. This creates a potential energy gradient which pushes atoms near -the grain boundary to orient according to the energetically favorable -grain orientation. This fix is designed for applications in bicrystal system -with one grain boundary and open ends, or two opposite grain boundaries in -a periodic system. In either case, the entire system can experience a -displacement during the simulation which needs to be accounted for in the -evaluation of the grain boundary velocity. While the basic method is -described in :ref:`(Ulomek) `, the implementation follows the efficient -implementation from :ref:`(Schratt & Mohles) `. The synthetic potential energy added to an -atom j is given by the following formulas +The fix applies a synthetic driving force to a grain boundary which +can be used for the investigation of grain boundary motion. The +affiliation of atoms to either of the two grains forming the grain +boundary is determined from an orientation-dependent order parameter +as described in :ref:`(Ulomek) `. The potential energy of +atoms is either increased by an amount of 0.5*\ *u0* or -0.5*\ *u0* +according to the orientation of the surrounding crystal. This creates +a potential energy gradient which pushes atoms near the grain boundary +to orient according to the energetically favorable grain +orientation. This fix is designed for applications in bicrystal system +with one grain boundary and open ends, or two opposite grain +boundaries in a periodic system. In either case, the entire system can +experience a displacement during the simulation which needs to be +accounted for in the evaluation of the grain boundary velocity. While +the basic method is described in :ref:`(Ulomek) `, the +implementation follows the efficient implementation from +:ref:`(Schratt & Mohles) `. The synthetic potential energy +added to an atom j is given by the following formulas .. math:: @@ -60,60 +62,69 @@ atom j is given by the following formulas which are fully explained in :ref:`(Ulomek) ` and :ref:`(Schratt & Mohles) `. -The force on each atom is the negative gradient of the synthetic potential energy. It -depends on the surrounding of this atom. An atom far from the grain boundary does not -experience a synthetic force as its surrounding is that of an oriented single crystal -and thermal fluctuations are masked by the parameter *eta*\ . Near the grain boundary -however, the gradient is nonzero and synthetic force terms are computed. -The orientationsFile specifies the perfect oriented crystal basis vectors for the -two adjoining crystals. The first three lines (line=row vector) for the energetically penalized and the -last three lines for the energetically favored grain assuming *u0* is positive. For -negative *u0*, this is reversed. With the *cutoff* parameter, the size of the region around -each atom which is used in the order parameter computation is defined. The cutoff must be -smaller than the interaction range of the MD potential. It should at -least include the nearest neighbor shell. For high temperatures or low angle -grain boundaries, it might be beneficial to increase the cutoff in order to get a more -precise identification of the atoms surrounding. However, computation time will -increase as more atoms are considered in the order parameter and force computation. -It is also worth noting that the cutoff radius must not exceed the communication -distance for ghost atoms in LAMMPS. With orientationsFile, the -6 oriented crystal basis vectors is specified. Each line of the input file -contains the three components of a primitive lattice vector oriented according to -the grain orientation in the simulation box. The first (last) three lines correspond -to the primitive lattice vectors of the first (second) grain. An example for -a :math:`\Sigma\langle001\rangle` mis-orientation is given at the end. - -If no synthetic energy difference between the grains is created, :math:`u0=0`, the -force computation is omitted. In this case, still, the order parameter of the -driving force is computed and can be used to track the grain boundary motion throughout the -simulation. - +The force on each atom is the negative gradient of the synthetic +potential energy. It depends on the surrounding of this atom. An atom +far from the grain boundary does not experience a synthetic force as +its surrounding is that of an oriented single crystal and thermal +fluctuations are masked by the parameter *eta*\ . Near the grain +boundary however, the gradient is nonzero and synthetic force terms +are computed. The orientationsFile specifies the perfect oriented +crystal basis vectors for the two adjoining crystals. The first three +lines (line=row vector) for the energetically penalized and the last +three lines for the energetically favored grain assuming *u0* is +positive. For negative *u0*, this is reversed. With the *cutoff* +parameter, the size of the region around each atom which is used in +the order parameter computation is defined. The cutoff must be smaller +than the interaction range of the MD potential. It should at least +include the nearest neighbor shell. For high temperatures or low angle +grain boundaries, it might be beneficial to increase the cutoff in +order to get a more precise identification of the atoms +surrounding. However, computation time will increase as more atoms are +considered in the order parameter and force computation. It is also +worth noting that the cutoff radius must not exceed the communication +distance for ghost atoms in LAMMPS. With orientationsFile, the 6 +oriented crystal basis vectors is specified. Each line of the input +file contains the three components of a primitive lattice vector +oriented according to the grain orientation in the simulation box. The +first (last) three lines correspond to the primitive lattice vectors +of the first (second) grain. An example for a +:math:`\Sigma\langle001\rangle` mis-orientation is given at the end. +If no synthetic energy difference between the grains is created, +:math:`u0=0`, the force computation is omitted. In this case, still, +the order parameter of the driving force is computed and can be used +to track the grain boundary motion throughout the simulation. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc: `binary restart files `. +No information about this fix is written to :doc: `binary restart +files `. -The :doc:`fix_modify ` *energy* option is supported by this fix to -add the potential energy of atom interactions with the grain boundary -driving force to the system's potential energy as part of thermodynamic output. -The total sum of added synthetic potential energy is computed and can be accessed -by various output options. The order parameter as well as the thermally masked -output parameter are stored in per-atom arrays and can also be accessed by various -:doc:`output commands `. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the potential energy of atom interactions with the +grain bounadry driving force to the global potential energy of the +system as part of :doc:`thermodynamic output `. The +default setting for this fix is :doc:`fix_modify energy no +`. -No parameter of this fix can be used with the start/stop keywords of the run command. This fix is -not invoked during energy minimization. +This fix calculates a per-atom array with 2 columns, which can be +accessed by indices 1-1 by any command that uses per-atom values from +a fix as input. See the :doc:`Howto output ` doc page +for an overview of LAMMPS output options. +The first column is the order parameter for each atom; the second is +the thermal masking value for each atom. Both are described above. +No parameter of this fix can be used with the start/stop keywords of +the run command. This fix is not invoked during energy minimization. Restrictions """""""""""" -This fix is part of the USER-MISC package. It is only enabled if LAMMPS was -built with that package. See the :doc:`Build package ` doc page for more info. - +This fix is part of the USER-MISC package. It is only enabled if +LAMMPS was built with that package. See the :doc:`Build package +` doc page for more info. Related commands diff --git a/doc/src/fix_plumed.rst b/doc/src/fix_plumed.rst index e2eadfe6bd..67118b6bfa 100644 --- a/doc/src/fix_plumed.rst +++ b/doc/src/fix_plumed.rst @@ -66,7 +66,8 @@ plumed fix in the LAMMPS input. The *plumedfile* keyword allows the user to specify the name of the PLUMED input file. Instructions as to what should be included in a -plumed input file can be found in the `documentation for PLUMED `_ +plumed input file can be found in the `documentation for PLUMED +`_ The *outfile* keyword allows the user to specify the name of a file in which to output the PLUMED log. This log file normally just repeats the @@ -78,31 +79,38 @@ be specified by the user in the PLUMED input file. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -When performing a restart of a calculation that involves PLUMED you must -include a RESTART command in the PLUMED input file as detailed in the -`PLUMED documentation `_. When the restart command is found in -the PLUMED input PLUMED will append to the files that were generated in -the run that was performed previously. No part of the PLUMED restart -data is included in the LAMMPS restart files. Furthermore, any history -dependent bias potentials that were accumulated in previous calculations -will be read in when the RESTART command is included in the PLUMED -input. +When performing a restart of a calculation that involves PLUMED you +must include a RESTART command in the PLUMED input file as detailed in +the `PLUMED documentation `_. When the restart command +is found in the PLUMED input PLUMED will append to the files that were +generated in the run that was performed previously. No part of the +PLUMED restart data is included in the LAMMPS restart files. +Furthermore, any history dependent bias potentials that were +accumulated in previous calculations will be read in when the RESTART +command is included in the PLUMED input. -The :doc:`fix_modify ` *energy* option is not supported by -this fix. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the energy change from the biasing force added by +PLUMED to the global potential energy of the system as part of +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify energy yes `. -Nothing is computed by this fix that can be accessed by any of the -:doc:`output commands ` within LAMMPS. All the quantities -of interest can be output by commands that are native to PLUMED, -however. +This fix computes a global scalar which can be accessed by various +:doc:`output commands `. The scalar is the PLUMED +energy mentioned above. The scalar value calculated by this fix is +"extensive". + +Note that other quantities of interest can be output by commands that +are native to PLUMED. Restrictions """""""""""" This fix is part of the USER-PLUMED package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. +LAMMPS was built with that package. See the :doc:`Build package +` doc page for more info. -There can only be one plumed fix active at a time. +There can only be one fix plumed command active at a time. Related commands """""""""""""""" diff --git a/doc/src/fix_precession_spin.rst b/doc/src/fix_precession_spin.rst index 0cb8cc1148..17231d5686 100644 --- a/doc/src/fix_precession_spin.rst +++ b/doc/src/fix_precession_spin.rst @@ -42,11 +42,12 @@ Examples Description """"""""""" -This fix applies a precession torque to each magnetic spin in the group. +This fix applies a precession torque to each magnetic spin in the +group. -Style *zeeman* is used for the simulation of the interaction -between the magnetic spins in the defined group and an external -magnetic field: +Style *zeeman* is used for the simulation of the interaction between +the magnetic spins in the defined group and an external magnetic +field: .. math:: @@ -62,17 +63,17 @@ with: The field value in Tesla is multiplied by the gyromagnetic ratio, :math:`g \cdot \mu_B/\hbar`, converting it into a precession frequency in -rad.THz (in metal units and with :math:`\mu_B = 5.788\cdot 10^{-5}` eV/T). +rad.THz (in metal units and with :math:`\mu_B = 5.788\cdot 10^{-5}` +eV/T). -As a comparison, the figure below displays the simulation of a -single spin (of norm :math:`\mu_i = 1.0`) submitted to an external -magnetic field of :math:`\vert B_{ext}\vert = 10.0\; \mathrm{Tesla}` (and oriented along the z -axis). -The upper plot shows the average magnetization along the -external magnetic field axis and the lower plot the Zeeman -energy, both as a function of temperature. -The reference result is provided by the plot of the Langevin -function for the same parameters. +As a comparison, the figure below displays the simulation of a single +spin (of norm :math:`\mu_i = 1.0`) submitted to an external magnetic +field of :math:`\vert B_{ext}\vert = 10.0\; \mathrm{Tesla}` (and +oriented along the z axis). The upper plot shows the average +magnetization along the external magnetic field axis and the lower +plot the Zeeman energy, both as a function of temperature. The +reference result is provided by the plot of the Langevin function for +the same parameters. .. image:: JPG/zeeman_langevin.jpg :align: center @@ -88,10 +89,12 @@ for the magnetic spins in the defined group: .. math:: - H_{aniso} = -\sum_{{ i}=1}^{N} K_{an}(\mathbf{r}_{i})\, \left( \vec{s}_{i} \cdot \vec{n}_{i} \right)^2 + H_{aniso} = -\sum_{{ i}=1}^{N} K_{an}(\mathbf{r}_{i})\, \left( + \vec{s}_{i} \cdot \vec{n}_{i} \right)^2 -with :math:`n` defining the direction of the anisotropy, and :math:`K` (in eV) its intensity. -If :math:`K > 0`, an easy axis is defined, and if :math:`K < 0`, an easy plane is defined. +with :math:`n` defining the direction of the anisotropy, and :math:`K` +(in eV) its intensity. If :math:`K > 0`, an easy axis is defined, and +if :math:`K < 0`, an easy plane is defined. Style *cubic* is used to simulate a cubic anisotropy, with three possible easy axis for the magnetic spins in the defined group: @@ -110,17 +113,17 @@ possible easy axis for the magnetic spins in the defined group: \left(\vec{s}_{i} \cdot \vec{n_2} \right)^2 \left(\vec{s}_{i} \cdot \vec{n_3} \right)^2 -with :math:`K_1` and :math:`K_{2c}` (in eV) the intensity coefficients and -:math:`\vec{n}_1`, :math:`\vec{n}_2` and :math:`\vec{n}_3` defining the three anisotropic directions -defined by the command (from *n1x* to *n3z*). -For :math:`\vec{n}_1 = (1 0 0)`, :math:`\vec{n}_2 = (0 1 0)`, and :math:`\vec{n}_3 = (0 0 1)`, :math:`K_1 < 0` defines an +with :math:`K_1` and :math:`K_{2c}` (in eV) the intensity coefficients +and :math:`\vec{n}_1`, :math:`\vec{n}_2` and :math:`\vec{n}_3` +defining the three anisotropic directions defined by the command (from +*n1x* to *n3z*). For :math:`\vec{n}_1 = (1 0 0)`, :math:`\vec{n}_2 = +(0 1 0)`, and :math:`\vec{n}_3 = (0 0 1)`, :math:`K_1 < 0` defines an iron type anisotropy (easy axis along the :math:`(0 0 1)`-type cube -edges), and :math:`K_1 > 0` defines a nickel type anisotropy (easy axis -along the :math:`(1 1 1)`-type cube diagonals). -:math:`K_2^c > 0` also defines easy axis along the :math:`(1 1 1)`-type cube -diagonals. -See chapter 2 of :ref:`(Skomski) ` for more details on cubic -anisotropies. +edges), and :math:`K_1 > 0` defines a nickel type anisotropy (easy +axis along the :math:`(1 1 1)`-type cube diagonals). :math:`K_2^c > +0` also defines easy axis along the :math:`(1 1 1)`-type cube +diagonals. See chapter 2 of :ref:`(Skomski) ` for more +details on cubic anisotropies. In all cases, the choice of :math:`(x y z)` only imposes the vector directions for the forces. Only the direction of the vector is @@ -134,32 +137,35 @@ Those styles can be combined within one single command line. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -By default, the energy associated to this fix is not added to the potential -energy of the system. -The :doc:`fix_modify ` *energy* option is supported by this fix -to add this magnetic potential energy to the potential energy of the system, +No information about this fix is written to :doc:`binary restart files +`. -.. code-block:: LAMMPS - - fix 1 all precession/spin zeeman 1.0 0.0 0.0 1.0 - fix_modify 1 energy yes +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the energy assocatiated with the spin precession +torque to the global potential energy of the system as part of +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify energy no `. This fix computes a global scalar which can be accessed by various -:doc:`output commands `. +:doc:`output commands `. The scalar is the potential +energy (in energy units) discussed in the previous paragraph. The +scalar value is an "extensive" quantity. -No information about this fix is written to :doc:`binary restart files `. +No information about this fix is written to :doc:`binary restart files +`. Restrictions """""""""""" The *precession/spin* style is part of the SPIN package. This style is only enabled if LAMMPS was built with this package, and if the -atom_style "spin" was declared. See the :doc:`Build package ` doc page for more info. +atom_style "spin" was declared. See the :doc:`Build package +` doc page for more info. -The *precession/spin* style can only be declared once. If more -than one precession type (for example combining an anisotropy and a Zeeman interactions) -has to be declared, they have to be chained in the same command -line (as shown in the examples above). +The *precession/spin* style can only be declared once. If more than +one precession type (for example combining an anisotropy and a Zeeman +interactions) has to be declared, they have to be chained in the same +command line (as shown in the examples above). Related commands """""""""""""""" diff --git a/doc/src/fix_qbmsst.rst b/doc/src/fix_qbmsst.rst index 8444312681..ef820a68d6 100644 --- a/doc/src/fix_qbmsst.rst +++ b/doc/src/fix_qbmsst.rst @@ -152,13 +152,30 @@ Because the state of the random number generator is not written to "exactly" in an uninterrupted fashion. However, in a statistical sense, a restarted simulation should produce similar behaviors of the system as if it is not interrupted. To achieve such a restart, one -should write explicitly the same value for *q*\ , *mu*\ , *damp*\ , *f_max*, -*N_f*, *eta*\ , and *beta* and set *tscale* = 0 if the system is -compressed during the first run. +should write explicitly the same value for *q*\ , *mu*\ , *damp*\ , +*f_max*, *N_f*, *eta*\ , and *beta* and set *tscale* = 0 if the system +is compressed during the first run. + +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. + +This fix computes a global scalar which can be accessed by various +:doc:`output commands `. The scalar is the same +cumulative energy change due to this fix described in the previous +paragraph. The scalar value calculated by this fix is "extensive". The progress of the QBMSST can be monitored by printing the global -scalar and global vector quantities computed by the fix. The global -vector contains five values in this order: +scalar and global vector quantities computed by the fix. + +As mentioned above, the scalar is the cumulative energy change due to +the fix. By monitoring the thermodynamic *econserve* output, this can +be used to test if the MD timestep is sufficiently small for accurate +integration of the dynamic equations. + +The global vector contains five values in the following order. The +vector values output by this fix are "intensive". [\ *dhugoniot*\ , *drayleigh*\ , *lagrangian_speed*, *lagrangian_position*, *quantum_temperature*] @@ -170,29 +187,21 @@ vector contains five values in this order: 5. *quantum_temperature* is the temperature of the quantum thermal bath :math:`T^{qm}`. To print these quantities to the log file with descriptive column -headers, the following LAMMPS commands are suggested. Here the -:doc:`fix_modify ` energy command is also enabled to allow -the thermo keyword *etotal* to print the quantity :math:`E^{tot}`. See -also the :doc:`thermo_style ` command. +headers, the following LAMMPS commands are suggested. .. parsed-literal:: fix fix_id all msst z - fix_modify fix_id energy yes variable dhug equal f_fix_id[1] variable dray equal f_fix_id[2] variable lgr_vel equal f_fix_id[3] variable lgr_pos equal f_fix_id[4] variable T_qm equal f_fix_id[5] - thermo_style custom step temp ke pe lz pzz etotal v_dhug v_dray v_lgr_vel v_lgr_pos v_T_qm f_fix_id + thermo_style custom step temp ke pe lz pzz econserve v_dhug v_dray v_lgr_vel v_lgr_pos v_T_qm f_fix_id -The global scalar under the entry f_fix_id is the quantity of thermo -energy as an extra part of :math:`E^{tot}`. This global scalar and the -vector of 5 quantities can be accessed by various :doc:`output commands `. -It is worth noting that the temp keyword -under the :doc:`thermo_style ` command print the -instantaneous classical temperature :math:`T^{cl}` as described -in the command :doc:`fix qtb `. +It is worth noting that the temp keyword for the :doc:`thermo_style +` command prints the instantaneous classical temperature +:math:`T^{cl}` as described by the :doc:`fix qtb ` command. ---------- @@ -200,7 +209,8 @@ Restrictions """""""""""" This fix style is part of the USER-QTB package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. +LAMMPS was built with that package. See the :doc:`Build package +` doc page for more info. All cell dimensions must be periodic. This fix can not be used with a triclinic cell. The QBMSST fix has been tested only for the group-ID diff --git a/doc/src/fix_restrain.rst b/doc/src/fix_restrain.rst index 1f127bce2f..84e525cdf2 100644 --- a/doc/src/fix_restrain.rst +++ b/doc/src/fix_restrain.rst @@ -219,15 +219,19 @@ current dihedral angle :math:`\phi` is equal to :math:`\phi_0`. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. +No information about this fix is written to :doc:`binary restart files +`. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the potential energy associated with this fix to the -system's potential energy as part of :doc:`thermodynamic output `. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the potential energy associated with this fix to the +global potential energy of the system as part of :doc:`thermodynamic +output ` The default setting for this fix is +:doc:`fix_modify energy no `. The :doc:`fix_modify ` *respa* option is supported by this -fix. This allows to set at which level of the :doc:`r-RESPA ` -integrator the fix is adding its forces. Default is the outermost level. +fix. This allows to set at which level of the :doc:`r-RESPA +` integrator the fix is adding its forces. Default is the +outermost level. .. note:: diff --git a/doc/src/fix_rhok.rst b/doc/src/fix_rhok.rst index 38bde220ef..cffba5bafa 100644 --- a/doc/src/fix_rhok.rst +++ b/doc/src/fix_rhok.rst @@ -45,11 +45,34 @@ temperatures :ref:`(Pedersen) `. An example of using the interface pinning method is located in the *examples/USER/misc/rhok* directory. +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +No information about this fix is written to :doc:`binary restart files +`. + +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the potential energy calculated by the fix to the +global potential energy of the system as part of :doc:`thermodynamic +output `. The default setting for this fix is +:doc:`fix_modify energy no `. + +This fix computes a global scalar which can be accessed by various +:doc:`output commands `. The scalar is the potential +energy discussed in the preceding paragraph. The scalar stored by +this fix is "extensive". + +No parameter of this fix can be used with the *start/stop* keywords of +the :doc:`run ` command. + +This fix is not invoked during :doc:`energy minimization `. + Restrictions """""""""""" This fix is part of the USER-MISC package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. +LAMMPS was built with that package. See the :doc:`Build package +` doc page for more info. Related commands """""""""""""""" diff --git a/doc/src/fix_rigid.rst b/doc/src/fix_rigid.rst index efadc5dd13..526d2d53e3 100644 --- a/doc/src/fix_rigid.rst +++ b/doc/src/fix_rigid.rst @@ -752,25 +752,17 @@ rigid/nvt. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about the 4 NVE rigid styles is written to :doc:`binary restart files `. The exception is if the *infile* or -*mol* keyword is used, in which case an auxiliary file is written out -with rigid body information each time a restart file is written, as +No information about the 4 NVE rigid styles is written to :doc:`binary +restart files `. The exception is if the *infile* or *mol* +keyword is used, in which case an auxiliary file is written out with +rigid body information each time a restart file is written, as explained above for the *infile* keyword. For the 2 NVT rigid styles, -the state of the Nose/Hoover thermostat is written to :doc:`binary restart files `. Ditto for the 4 NPT and NPH rigid styles, and -the state of the Nose/Hoover barostat. See the -:doc:`read_restart ` command for info on how to re-specify -a fix in an input script that reads a restart file, so that the -operation of the fix continues in an uninterrupted fashion. - -The :doc:`fix_modify ` *energy* option is supported by the 6 -NVT, NPT, NPH rigid styles to add the energy change induced by the -thermostatting to the system's potential energy as part of -:doc:`thermodynamic output `. - -The :doc:`fix_modify ` *virial* option is supported by this -fix to add the contribution due to keeping the objects rigid to the -system's virial as part of :doc:`thermodynamic output `. -The default is *virial yes* +the state of the Nose/Hoover thermostat is written to :doc:`binary +restart files `. Ditto for the 4 NPT and NPH rigid styles, +and the state of the Nose/Hoover barostat. See the :doc:`read_restart +` command for info on how to re-specify a fix in an +input script that reads a restart file, so that the operation of the +fix continues in an uninterrupted fashion. The :doc:`fix_modify ` *temp* and *press* options are supported by the 4 NPT and NPH rigid styles to change the computes @@ -783,6 +775,12 @@ all rigid styles to set whether per-body forces and torques are computed early or late in a timestep, i.e. at the post-force stage or at the final-integrate stage or the timestep, respectively. +The cumulative energy change in the system imposed by the 6 NVT, NPT, +NPH rigid fixes, via either thermostatting and/or barostatting, is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. + The 2 NVE rigid fixes compute a global scalar which can be accessed by various :doc:`output commands `. The scalar value calculated by these fixes is "intensive". The scalar is the current @@ -798,13 +796,14 @@ are removed from this calculation, but only for the *rigid* and The 6 NVT, NPT, NPH rigid fixes compute a global scalar which can be accessed by various :doc:`output commands `. The scalar -value calculated by these fixes is "extensive". The scalar is the -cumulative energy change due to the thermostatting and barostatting -the fix performs. +is the same cumulative energy change due to these fixes described +above. The scalar value calculated by this fix is "extensive". All of the *rigid* styles (not the *rigid/small* styles) compute a -global array of values which can be accessed by various :doc:`output commands `. Similar information about the bodies -defined by the *rigid/small* styles can be accessed via the :doc:`compute rigid/local ` command. +global array of values which can be accessed by various :doc:`output +commands `. Similar information about the bodies +defined by the *rigid/small* styles can be accessed via the +:doc:`compute rigid/local ` command. The number of rows in the array is equal to the number of rigid bodies. The number of columns is 15. Thus for each rigid body, 15 diff --git a/doc/src/fix_spring.rst b/doc/src/fix_spring.rst index 06b9279c4d..007f2cd278 100644 --- a/doc/src/fix_spring.rst +++ b/doc/src/fix_spring.rst @@ -100,11 +100,14 @@ last example holds the ion a distance 5 away from the pore axis Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. +No information about this fix is written to :doc:`binary restart files +`. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy stored in the spring to the system's potential -energy as part of :doc:`thermodynamic output `. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the energy stored in the spring to the global +potential energy of the system as part of :doc:`thermodynamic output +`. The default setting for this fix is :doc:`fix_modify +energy no `. The :doc:`fix_modify ` *respa* option is supported by this fix. This allows to set at which level of the :doc:`r-RESPA ` diff --git a/doc/src/fix_spring_chunk.rst b/doc/src/fix_spring_chunk.rst index a2d9945a0b..3d3069c53e 100644 --- a/doc/src/fix_spring_chunk.rst +++ b/doc/src/fix_spring_chunk.rst @@ -62,9 +62,11 @@ will define the same number of chunks. The restart data is only applied when the number of chunks matches. Otherwise the center of mass coordinates are recomputed. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy stored in all the springs to the system's potential -energy as part of :doc:`thermodynamic output `. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the energy stored in all the springs to the global +potential energy of the system as part of :doc:`thermodynamic output +`. The default setting for this fix is :doc:`fix_modify +energy no `. The :doc:`fix_modify ` *respa* option is supported by this fix. This allows to set at which level of the :doc:`r-RESPA ` diff --git a/doc/src/fix_spring_self.rst b/doc/src/fix_spring_self.rst index 8c5442943f..6cf0a9e0e7 100644 --- a/doc/src/fix_spring_self.rst +++ b/doc/src/fix_spring_self.rst @@ -44,15 +44,18 @@ plane, respectively. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This fix writes the original coordinates of tethered atoms to :doc:`binary restart files `, so that the spring effect will be the -same in a restarted simulation. See the -:doc:`read_restart ` command for info on how to re-specify -a fix in an input script that reads a restart file, so that the -operation of the fix continues in an uninterrupted fashion. +This fix writes the original coordinates of tethered atoms to +:doc:`binary restart files `, so that the spring effect will +be the same in a restarted simulation. See the :doc:`read_restart +` command for info on how to re-specify a fix in an +input script that reads a restart file, so that the operation of the +fix continues in an uninterrupted fashion. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy stored in the per-atom springs to the system's -potential energy as part of :doc:`thermodynamic output `. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the energy stored in the per-atom springs to the +global potential energy of the system as part of :doc:`thermodynamic +output `. The default setting for this fix is +:doc:`fix_modify energy no `. The :doc:`fix_modify ` *respa* option is supported by this fix. This allows to set at which level of the :doc:`r-RESPA ` diff --git a/doc/src/fix_temp_berendsen.rst b/doc/src/fix_temp_berendsen.rst index ae9f8a933a..59f4de64a9 100644 --- a/doc/src/fix_temp_berendsen.rst +++ b/doc/src/fix_temp_berendsen.rst @@ -132,14 +132,15 @@ you have defined to this fix which will be used in its thermostatting procedure, as described above. For consistency, the group used by this fix and by the compute should be the same. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change implied by a velocity rescaling to the -system's potential energy as part of :doc:`thermodynamic output `. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. This fix computes a global scalar which can be accessed by various -:doc:`output commands `. The scalar is the cumulative -energy change due to this fix. The scalar value calculated by this -fix is "extensive". +:doc:`output commands `. The scalar is the same +cumulative energy change due to this fix described in the previous +paragraph. The scalar value calculated by this fix is "extensive". This fix can ramp its target temperature over multiple runs, using the *start* and *stop* keywords of the :doc:`run ` command. See the diff --git a/doc/src/fix_temp_csvr.rst b/doc/src/fix_temp_csvr.rst index 440a264ed5..ae276f9fc5 100644 --- a/doc/src/fix_temp_csvr.rst +++ b/doc/src/fix_temp_csvr.rst @@ -142,32 +142,36 @@ ensemble. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -These fixes write the cumulative global energy change and the -random number generator states to :doc:`binary restart files `. -See the :doc:`read_restart ` command for info on how to -re-specify a fix in an input script that reads a restart file, -so that the selected fix continues in an uninterrupted fashion. The -random number generator state can only be restored when the number -of processors remains unchanged from what is recorded in the restart file. - -No information about these fixes are written to :doc:`binary restart files `. +These fixes write the cumulative global energy change and the random +number generator states to :doc:`binary restart files `. See +the :doc:`read_restart ` command for info on how to +re-specify a fix in an input script that reads a restart file, so that +the selected fix continues in an uninterrupted fashion. The random +number generator state can only be restored when the number of +processors remains unchanged from what is recorded in the restart +file. The :doc:`fix_modify ` *temp* option is supported by these -fixes. You can use it to assign a temperature :doc:`compute ` -you have defined to these fixes which will be used in its thermostatting -procedure, as described above. For consistency, the group used by -these fixes and by the compute should be the same. +fixes. You can use it to assign a temperature :doc:`compute +` you have defined to these fixes which will be used in its +thermostatting procedure, as described above. For consistency, the +group used by these fixes and by the compute should be the same. -These fixes can ramp its target temperature over multiple runs, using -the *start* and *stop* keywords of the :doc:`run ` command. See the -:doc:`run ` command for details of how to do this. - -These fixes are not invoked during :doc:`energy minimization `. +The cumulative energy change in the system imposed by these fixes is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. These fixes compute a global scalar which can be accessed by various -:doc:`output commands `. The scalar is the cumulative -energy change due to the fix. The scalar value calculated by this fix -is "extensive". +:doc:`output commands `. The scalar is the same +cumulative energy change due to this fix described in the previous +paragraph. The scalar value calculated by this fix is "extensive". + +These fixes can ramp their target temperature over multiple runs, +using the *start* and *stop* keywords of the :doc:`run ` command. +See the :doc:`run ` command for details of how to do this. + +These fixes are not invoked during :doc:`energy minimization `. Restrictions """""""""""" diff --git a/doc/src/fix_temp_rescale.rst b/doc/src/fix_temp_rescale.rst index b00d8e446a..125f74306e 100644 --- a/doc/src/fix_temp_rescale.rst +++ b/doc/src/fix_temp_rescale.rst @@ -100,13 +100,13 @@ ID of the new compute is the fix-ID + underscore + "temp", and the group for the new compute is the same as the fix group. Note that this is NOT the compute used by thermodynamic output (see -the :doc:`thermo_style ` command) with ID = *thermo_temp*. -This means you can change the attributes of this fix's temperature -(e.g. its degrees-of-freedom) via the -:doc:`compute_modify ` command or print this temperature -during thermodynamic output via the :doc:`thermo_style custom ` command using the appropriate compute-ID. -It also means that changing attributes of *thermo_temp* will have no -effect on this fix. +the :doc:`thermo_style ` command) with ID = +*thermo_temp*. This means you can change the attributes of this fix's +temperature (e.g. its degrees-of-freedom) via the :doc:`compute_modify +` command or print this temperature during +thermodynamic output via the :doc:`thermo_style custom ` +command using the appropriate compute-ID. It also means that changing +attributes of *thermo_temp* will have no effect on this fix. Like other fixes that perform thermostatting, this fix can be used with :doc:`compute commands ` that calculate a temperature @@ -114,13 +114,14 @@ after removing a "bias" from the atom velocities. E.g. removing the center-of-mass velocity from a group of atoms or only calculating temperature on the x-component of velocity or only calculating temperature for atoms in a geometric region. This is not done by -default, but only if the :doc:`fix_modify ` command is used -to assign a temperature compute to this fix that includes such a bias -term. See the doc pages for individual :doc:`compute commands ` to determine which ones include a bias. In -this case, the thermostat works in the following manner: the current -temperature is calculated taking the bias into account, bias is -removed from each atom, thermostatting is performed on the remaining -thermal degrees of freedom, and the bias is added back in. +default, but only if the :doc:`fix_modify ` command is +used to assign a temperature compute to this fix that includes such a +bias term. See the doc pages for individual :doc:`compute commands +` to determine which ones include a bias. In this case, the +thermostat works in the following manner: the current temperature is +calculated taking the bias into account, bias is removed from each +atom, thermostatting is performed on the remaining thermal degrees of +freedom, and the bias is added back in. ---------- @@ -139,15 +140,15 @@ you have defined to this fix which will be used in its thermostatting procedure, as described above. For consistency, the group used by this fix and by the compute should be the same. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change implied by a velocity rescaling to the -system's potential energy as part of :doc:`thermodynamic output -`. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. This fix computes a global scalar which can be accessed by various -:doc:`output commands `. The scalar is the cumulative -energy change due to this fix. The scalar value calculated by this -fix is "extensive". +:doc:`output commands `. The scalar is the same +cumulative energy change due to this fix described in the previous +paragraph. The scalar value calculated by this fix is "extensive". This fix can ramp its target temperature over multiple runs, using the *start* and *stop* keywords of the :doc:`run ` command. See the diff --git a/doc/src/fix_temp_rescale_eff.rst b/doc/src/fix_temp_rescale_eff.rst index 4ad175b62f..01017c0267 100644 --- a/doc/src/fix_temp_rescale_eff.rst +++ b/doc/src/fix_temp_rescale_eff.rst @@ -38,7 +38,8 @@ particles. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. +No information about this fix is written to :doc:`binary restart files +`. The :doc:`fix_modify ` *temp* option is supported by this fix. You can use it to assign a temperature :doc:`compute ` @@ -46,14 +47,15 @@ you have defined to this fix which will be used in its thermostatting procedure, as described above. For consistency, the group used by this fix and by the compute should be the same. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy change implied by a velocity rescaling to the -system's potential energy as part of :doc:`thermodynamic output `. +The cumulative energy change in the system imposed by this fix is +included in the :doc:`thermodynamic output ` keywords +*ecouple* and *econserve*. See the :doc:`thermo_style ` +doc page for details. This fix computes a global scalar which can be accessed by various -:doc:`output commands `. The scalar is the cumulative -energy change due to this fix. The scalar value calculated by this -fix is "extensive". +:doc:`output commands `. The scalar is the same +cumulative energy change due to this fix described in the previous +paragraph. The scalar value calculated by this fix is "extensive". This fix can ramp its target temperature over multiple runs, using the *start* and *stop* keywords of the :doc:`run ` command. See the diff --git a/doc/src/fix_tgnh_drude.rst b/doc/src/fix_tgnh_drude.rst index 92781cd9e8..6d11539dd2 100644 --- a/doc/src/fix_tgnh_drude.rst +++ b/doc/src/fix_tgnh_drude.rst @@ -218,10 +218,10 @@ a fix in an input script that reads a restart file, so that the operation of the fix continues in an uninterrupted fashion. The :doc:`fix_modify ` *temp* and *press* options are -supported by these fixes. You can use them to assign a -:doc:`compute ` you have defined to this fix which will be used -in its thermostatting or barostatting procedure, as described above. -If you do this, note that the kinetic energy derived from the compute +supported by these fixes. You can use them to assign a :doc:`compute +` you have defined to this fix which will be used in its +thermostatting or barostatting procedure, as described above. If you +do this, note that the kinetic energy derived from the compute temperature should be consistent with the virial term computed using all atoms for the pressure. LAMMPS will warn you if you choose to compute temperature on a subset of atoms. @@ -229,42 +229,49 @@ compute temperature on a subset of atoms. .. note:: If both the *temp* and *press* keywords are used in a single - thermo_modify command (or in two separate commands), then the order in - which the keywords are specified is important. Note that a :doc:`pressure compute ` defines its own temperature compute as - an argument when it is specified. The *temp* keyword will override - this (for the pressure compute being used by fix npt), but only if the - *temp* keyword comes after the *press* keyword. If the *temp* keyword - comes before the *press* keyword, then the new pressure compute - specified by the *press* keyword will be unaffected by the *temp* - setting. + thermo_modify command (or in two separate commands), then the order + in which the keywords are specified is important. Note that a + :doc:`pressure compute ` defines its own + temperature compute as an argument when it is specified. The + *temp* keyword will override this (for the pressure compute being + used by fix npt), but only if the *temp* keyword comes after the + *press* keyword. If the *temp* keyword comes before the *press* + keyword, then the new pressure compute specified by the *press* + keyword will be unaffected by the *temp* setting. -The :doc:`fix_modify ` *energy* option is supported by these -fixes to add the energy change induced by Nose/Hoover thermostatting -and barostatting to the system's potential energy as part of -:doc:`thermodynamic output `. +The cumulative energy change in the system imposed by these fixes, due +to thermostatting and/or barostating, are included in the +:doc:`thermodynamic output ` keywords *ecouple* and +*econserve*. See the :doc:`thermo_style ` doc page for +details. -These fixes compute a global scalar and a global vector of quantities, -which can be accessed by various :doc:`output commands `. -The scalar value calculated by these fixes is "extensive"; the vector -values are "intensive". -The scalar is the cumulative energy change due to the fix. -The vector stores the three temperatures :math:`T_\mathrm{M}`, :math:`T_\mathrm{R}` and :math:`T_\mathrm{D}`. +These fixes compute a global scalar which can be accessed by various +:doc:`output commands `. The scalar is the same +cumulative energy change due to this fix described in the previous +paragraph. The scalar value calculated by this fix is "extensive". + +These fixes also compute a global vector of quantities, which can be +accessed by various :doc:`output commands `. The vector +values are "intensive". The vector stores the three temperatures +:math:`T_\mathrm{M}`, :math:`T_\mathrm{R}` and :math:`T_\mathrm{D}`. These fixes can ramp their external temperature and pressure over -multiple runs, using the *start* and *stop* keywords of the -:doc:`run ` command. See the :doc:`run ` command for details of -how to do this. +multiple runs, using the *start* and *stop* keywords of the :doc:`run +` command. See the :doc:`run ` command for details of how +to do this. -These fixes are not invoked during :doc:`energy minimization `. +These fixes are not invoked during :doc:`energy minimization +`. ---------- Restrictions """""""""""" -These fixes are only available when LAMMPS was built with the USER-DRUDE package. -These fixes cannot be used with dynamic groups as defined by the :doc:`group ` command. -These fixes cannot be used in 2D simulations. +These fixes are only available when LAMMPS was built with the +USER-DRUDE package. These fixes cannot be used with dynamic groups as +defined by the :doc:`group ` command. These fixes cannot be +used in 2D simulations. *X*\ , *y*\ , *z* cannot be barostatted if the associated dimension is not periodic. *Xy*\ , *xz*\ , and *yz* can only be barostatted if the diff --git a/doc/src/fix_ti_spring.rst b/doc/src/fix_ti_spring.rst index 08bd6ff2a8..d569f707af 100644 --- a/doc/src/fix_ti_spring.rst +++ b/doc/src/fix_ti_spring.rst @@ -89,13 +89,14 @@ time: \lambda(\tau) = \tau -where :math:`\tau` is the scaled time variable *t/t_s*. The option *2* performs -the lambda switching at a rate defined by the following switching -function +where :math:`\tau` is the scaled time variable *t/t_s*. The option *2* +performs the lambda switching at a rate defined by the following +switching function .. math:: - \lambda(\tau) = \tau^5 \left( 70 \tau^4 - 315 \tau^3 + 540 \tau^2 - 420 \tau + 126 \right) + \lambda(\tau) = \tau^5 \left( 70 \tau^4 - 315 \tau^3 + 540 \tau^2 - + 420 \tau + 126 \right) This function has zero slope as lambda approaches its extreme values (0 and 1), according to :ref:`de Koning ` this results in @@ -106,36 +107,43 @@ increase in computational resources cost. .. note:: - As described in :ref:`Freitas `, it is important to keep the - center-of-mass fixed during the thermodynamic integration. A nonzero - total velocity will result in divergences during the integration due - to the fact that the atoms are 'attached' to their equilibrium - positions by the Einstein crystal. Check the option *zero* of :doc:`fix langevin ` and :doc:`velocity `. The use of - the Nose-Hoover thermostat (:doc:`fix nvt `) is *NOT* - recommended due to its well documented issues with the canonical - sampling of harmonic degrees of freedom (notice that the *chain* - option will *NOT* solve this problem). The Langevin thermostat (:doc:`fix langevin `) correctly thermostats the system and we - advise its usage with ti/spring command. + As described in :ref:`Freitas `, it is important to keep + the center-of-mass fixed during the thermodynamic integration. A + nonzero total velocity will result in divergences during the + integration due to the fact that the atoms are 'attached' to their + equilibrium positions by the Einstein crystal. Check the option + *zero* of :doc:`fix langevin ` and :doc:`velocity + `. The use of the Nose-Hoover thermostat (:doc:`fix nvt + `) is *NOT* recommended due to its well documented issues + with the canonical sampling of harmonic degrees of freedom (notice + that the *chain* option will *NOT* solve this problem). The + Langevin thermostat (:doc:`fix langevin `) correctly + thermostats the system and we advise its usage with ti/spring + command. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This fix writes the original coordinates of tethered atoms to :doc:`binary restart files `, so that the spring effect will be the -same in a restarted simulation. See the :doc:`read restart ` command for info on how to re-specify a fix -in an input script that reads a restart file, so that the operation of -the fix continues in an uninterrupted fashion. +This fix writes the original coordinates of tethered atoms to +:doc:`binary restart files `, so that the spring effect will +be the same in a restarted simulation. See the :doc:`read restart +` command for info on how to re-specify a fix in an +input script that reads a restart file, so that the operation of the +fix continues in an uninterrupted fashion. -The :doc:`fix modify ` *energy* option is supported by this -fix to add the energy stored in the per-atom springs to the system's -potential energy as part of :doc:`thermodynamic output `. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the energy stored in the per-atom springs to the +global potential energy of the system as part of :doc:`thermodynamic +output `. The default setting for this fix is +:doc:`fix_modify energy no `. This fix computes a global scalar and a global vector quantities which can be accessed by various :doc:`output commands `. The -scalar is an energy which is the sum of the spring energy for each -atom, where the per-atom energy is 0.5 \* k \* r\^2. The vector has 2 -positions, the first one is the coupling parameter lambda and the -second one is the time derivative of lambda. The scalar and vector -values calculated by this fix are "extensive". +scalar is the sum of the spring energy for each atom, where the +per-atom energy is 0.5 \* k \* r\^2. The vector has 2 positions, the +first one is the coupling parameter lambda and the second one is the +time derivative of lambda. The scalar and vector values calculated by +this fix are "extensive". No parameter of this fix can be used with the *start/stop* keywords of the :doc:`run ` command. diff --git a/doc/src/fix_wall.rst b/doc/src/fix_wall.rst index 39ff879138..0bd7f241dd 100644 --- a/doc/src/fix_wall.rst +++ b/doc/src/fix_wall.rst @@ -331,23 +331,29 @@ perturbation on the particles: Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. +No information about this fix is written to :doc:`binary restart files +`. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy of interaction between atoms and each wall to -the system's potential energy as part of :doc:`thermodynamic output `. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the energy of interaction between atoms and all the +specified walls to the global potential energy of the system as part +of :doc:`thermodynamic output `. The default setting +for this fix is :doc:`fix_modify energy no `. -The :doc:`fix_modify ` *virial* option is supported by this -fix to add the contribution due to the interaction between -atoms and each wall to the system's virial as part of :doc:`thermodynamic output `. The default is *virial no* +The :doc:`fix_modify ` *virial* option is supported by +this fix to add the contribution due to the interaction between atoms +and each wall to the system's virial as part of :doc:`thermodynamic +output `. The default is *virial no* The :doc:`fix_modify ` *respa* option is supported by this -fix. This allows to set at which level of the :doc:`r-RESPA ` -integrator the fix is adding its forces. Default is the outermost level. +fix. This allows to set at which level of the :doc:`r-RESPA +` integrator the fix is adding its forces. Default is the +outermost level. This fix computes a global scalar energy and a global vector of -forces, which can be accessed by various :doc:`output commands `. Note that the scalar energy is the sum -of interactions with all defined walls. If you want the energy on a +forces, which can be accessed by various :doc:`output commands +`. Note that the scalar energy is the sum of +interactions with all defined walls. If you want the energy on a per-wall basis, you need to use multiple fix wall commands. The length of the vector is equal to the number of walls defined by the fix. Each vector value is the normal force on a specific wall. Note diff --git a/doc/src/fix_wall_ees.rst b/doc/src/fix_wall_ees.rst index 2bab8c6056..c3e8a9affb 100644 --- a/doc/src/fix_wall_ees.rst +++ b/doc/src/fix_wall_ees.rst @@ -56,20 +56,27 @@ Description """"""""""" Fix *wall/ees* bounds the simulation domain on one or more of its -faces with a flat wall that interacts with the ellipsoidal atoms in the -group by generating a force on the atom in a direction perpendicular to -the wall and a torque parallel with the wall. The energy of -wall-particle interactions E is given by: +faces with a flat wall that interacts with the ellipsoidal atoms in +the group by generating a force on the atom in a direction +perpendicular to the wall and a torque parallel with the wall. The +energy of wall-particle interactions E is given by: .. math:: - E = \epsilon \left[ \frac{2 \sigma_{LJ}^{12} \left(7 r^5+14 r^3 \sigma_{n}^2+3 r \sigma_{n}^4\right) }{945 \left(r^2-\sigma_{n}^2\right)^7} -\frac{ \sigma_{LJ}^6 \left(2 r \sigma_{n}^3+\sigma_{n}^2 \left(r^2-\sigma_{n}^2\right)\log{ \left[\frac{r-\sigma_{n}}{r+\sigma_{n}}\right]}\right) }{12 \sigma_{n}^5 \left(r^2-\sigma_{n}^2\right)} \right]\qquad \sigma_n < r < r_c + E = \epsilon \left[ \frac{2 \sigma_{LJ}^{12} \left(7 r^5+14 r^3 + \sigma_{n}^2+3 r \sigma_{n}^4\right) }{945 + \left(r^2-\sigma_{n}^2\right)^7} -\frac{ \sigma_{LJ}^6 \left(2 r + \sigma_{n}^3+\sigma_{n}^2 \left(r^2-\sigma_{n}^2\right)\log{ + \left[\frac{r-\sigma_{n}}{r+\sigma_{n}}\right]}\right) }{12 + \sigma_{n}^5 \left(r^2-\sigma_{n}^2\right)} \right]\qquad \sigma_n + < r < r_c -Introduced by Babadi and Ejtehadi in :ref:`(Babadi) `. Here, -*r* is the distance from the particle to the wall at position *coord*\ , -and Rc is the *cutoff* distance at which the particle and wall no -longer interact. Also, :math:`\sigma_n` is the distance between center of -ellipsoid and the nearest point of its surface to the wall as shown below. +Introduced by Babadi and Ejtehadi in :ref:`(Babadi) +`. Here, *r* is the distance from the particle to the +wall at position *coord*\ , and Rc is the *cutoff* distance at which +the particle and wall no longer interact. Also, :math:`\sigma_n` is +the distance between center of ellipsoid and the nearest point of its +surface to the wall as shown below. .. image:: JPG/fix_wall_ees_image.jpg :align: center @@ -85,13 +92,15 @@ pre-factor is .. math:: - 8 \pi^2 \quad \rho_{wall} \quad \rho_{ellipsoid} \quad \epsilon \quad \sigma_a \quad \sigma_b \quad \sigma_c + 8 \pi^2 \quad \rho_{wall} \quad \rho_{ellipsoid} \quad \epsilon + \quad \sigma_a \quad \sigma_b \quad \sigma_c -where :math:`\epsilon` is the LJ energy parameter for the constituent LJ -particles and :math:`\sigma_a`, :math:`\sigma_b`, and :math:`\sigma_c` -are the radii of the ellipsoidal particles. :math:`\rho_{wall}` and -:math:`\rho_{ellipsoid}` are the number density of the constituent -particles, in the wall and ellipsoid respectively, in units of 1/volume. +where :math:`\epsilon` is the LJ energy parameter for the constituent +LJ particles and :math:`\sigma_a`, :math:`\sigma_b`, and +:math:`\sigma_c` are the radii of the ellipsoidal +particles. :math:`\rho_{wall}` and :math:`\rho_{ellipsoid}` are the +number density of the constituent particles, in the wall and ellipsoid +respectively, in units of 1/volume. .. note:: @@ -106,16 +115,61 @@ Fix *wall/region/ees* treats the surface of the geometric region defined by the *region-ID* as a bounding wall which interacts with nearby ellipsoidal particles according to the EES potential introduced above. -Other details of this command are the same as for the :doc:`fix wall/region ` command. One may also find an example +Other details of this command are the same as for the :doc:`fix +wall/region ` command. One may also find an example of using this fix in the examples/USER/misc/ees/ directory. +---------- + +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +No information about these fixes are written to :doc:`binary restart +files `. + +The :doc:`fix_modify ` *energy* option is supported by +these fixes to add the energy of interaction between atoms and all the +specified walls or region wall to the global potential energy of the +system as part of :doc:`thermodynamic output `. The +default settings for thes fixes are :doc:`fix_modify energy no +`. + +The :doc:`fix_modify ` *virial* option is supported by +these rixes to add the contribution due to the interaction between +atoms and each wall to the system's virial as part of +:doc:`thermodynamic output `. The default is *virial no* + +The :doc:`fix_modify ` *respa* option is supported by +these fixes. This allows to set at which level of the :doc:`r-RESPA +` integrator the fix is adding its forces. Default is the +outermost level. + +These fixes computes a global scalar and a global vector of forces, +which can be accessed by various :doc:`output commands +`. See the :doc:`fix wall ` command for a +description of the scalar and vector. + +No parameter of these fixes can be used with the *start/stop* keywords of +the :doc:`run ` command. + +The forces due to these fixes are imposed during an energy +minimization, invoked by the :doc:`minimize ` command. + +.. note:: + + If you want the atom/wall interaction energy to be included in + the total potential energy of the system (the quantity being + minimized), you MUST enable the :doc:`fix_modify ` *energy* + option for this fix. + Restrictions """""""""""" -This fix is part of the USER-MISC package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. +These fixes are part of the USER-MISC package. They are only enabled +if LAMMPS was built with that package. See the :doc:`Build package +` doc page for more info. -This fix requires that atoms be ellipsoids as defined by the +These fixes requires that atoms be ellipsoids as defined by the :doc:`atom_style ellipsoid ` command. Related commands diff --git a/doc/src/fix_wall_region.rst b/doc/src/fix_wall_region.rst index 2359e27255..12bbaea454 100644 --- a/doc/src/fix_wall_region.rst +++ b/doc/src/fix_wall_region.rst @@ -194,24 +194,28 @@ Restart, fix_modify, output, run start/stop, minimize info No information about this fix is written to :doc:`binary restart files `. -The :doc:`fix_modify ` *energy* option is supported by this -fix to add the energy of interaction between atoms and the wall to the -system's potential energy as part of :doc:`thermodynamic output `. +The :doc:`fix_modify ` *energy* option is supported by +this fix to add the energy of interaction between atoms and the region +wall to the global potential energy of the system as part of +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify energy no `. -The :doc:`fix_modify ` *virial* option is supported by this -fix to add the contribution due to the interaction between -atoms and each wall to the system's virial as part of :doc:`thermodynamic output `. The default is *virial no* +The :doc:`fix_modify ` *virial* option is supported by +this fix to add the contribution due to the interaction between atoms +and each wall to the system's virial as part of :doc:`thermodynamic +output `. The default is *virial no* The :doc:`fix_modify ` *respa* option is supported by this fix. This allows to set at which level of the :doc:`r-RESPA ` integrator the fix is adding its forces. Default is the outermost level. This fix computes a global scalar energy and a global 3-length vector -of forces, which can be accessed by various :doc:`output commands `. The scalar energy is the sum of energy -interactions for all particles interacting with the wall represented -by the region surface. The 3 vector quantities are the x,y,z -components of the total force acting on the wall due to the particles. -The scalar and vector values calculated by this fix are "extensive". +of forces, which can be accessed by various :doc:`output commands +`. The scalar energy is the sum of energy interactions +for all particles interacting with the wall represented by the region +surface. The 3 vector quantities are the x,y,z components of the +total force acting on the wall due to the particles. The scalar and +vector values calculated by this fix are "extensive". No parameter of this fix can be used with the *start/stop* keywords of the :doc:`run ` command. @@ -221,10 +225,10 @@ invoked by the :doc:`minimize ` command. .. note:: - If you want the atom/wall interaction energy to be included in - the total potential energy of the system (the quantity being - minimized), you MUST enable the :doc:`fix_modify ` *energy* - option for this fix. + If you want the atom/wall interaction energy to be included in the + total potential energy of the system (the quantity being + minimized), you MUST enable the :doc:`fix_modify ` + *energy* option for this fix. Restrictions """""""""""" diff --git a/doc/src/fix_widom.rst b/doc/src/fix_widom.rst index 853bc6201c..8ec5a1308d 100644 --- a/doc/src/fix_widom.rst +++ b/doc/src/fix_widom.rst @@ -155,11 +155,11 @@ Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the state of the fix to :doc:`binary restart files -`. This includes information about the random number generator -seed, the next timestep for Widom insertions etc. See the -:doc:`read_restart ` command for info on how to re-specify -a fix in an input script that reads a restart file, so that the -operation of the fix continues in an uninterrupted fashion. +`. This includes information about the random number +generator seed, the next timestep for Widom insertions etc. See the +:doc:`read_restart ` command for info on how to +re-specify a fix in an input script that reads a restart file, so that +the operation of the fix continues in an uninterrupted fashion. .. note:: diff --git a/doc/src/thermo_modify.rst b/doc/src/thermo_modify.rst index fc8f66b90b..f525aef79a 100644 --- a/doc/src/thermo_modify.rst +++ b/doc/src/thermo_modify.rst @@ -11,10 +11,10 @@ Syntax thermo_modify keyword value ... * one or more keyword/value pairs may be listed +* keyword = *lost* or *lost/bond* or *norm* or *flush* or *line* or *format* or *temp* or *press* .. parsed-literal:: - keyword = *lost* or *lost/bond* or *norm* or *flush* or *line* or *format* or *temp* or *press*\ :l *lost* value = *error* or *warn* or *ignore* *lost/bond* value = *error* or *warn* or *ignore* *norm* value = *yes* or *no* diff --git a/doc/src/thermo_style.rst b/doc/src/thermo_style.rst index dbb634a2b0..c43bf9ed0d 100644 --- a/doc/src/thermo_style.rst +++ b/doc/src/thermo_style.rst @@ -20,9 +20,10 @@ Syntax *custom* args = list of keywords possible keywords = step, elapsed, elaplong, dt, time, cpu, tpcpu, spcpu, cpuremain, part, timeremain, - atoms, temp, press, pe, ke, etotal, enthalpy, + atoms, temp, press, pe, ke, etotal, evdwl, ecoul, epair, ebond, eangle, edihed, eimp, emol, elong, etail, + enthalpy, ecouple, econserve, vol, density, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi, xy, xz, yz, xlat, ylat, zlat, bonds, angles, dihedrals, impropers, @@ -49,7 +50,6 @@ Syntax pe = total potential energy ke = kinetic energy etotal = total energy (pe + ke) - enthalpy = enthalpy (etotal + press\*vol) evdwl = van der Waals pairwise energy (includes etail) ecoul = Coulombic pairwise energy epair = pairwise energy (evdwl + ecoul + elong) @@ -60,6 +60,9 @@ Syntax emol = molecular energy (ebond + eangle + edihed + eimp) elong = long-range kspace energy etail = van der Waals energy long-range tail correction + enthalpy = enthalpy (etotal + press\*vol) + ecouple = cumulative energy change due to thermo/baro statting fixes + econserve = pe + ke + ecouple = etotal + ecouple vol = volume density = mass density of system lx,ly,lz = box lengths in x,y,z @@ -197,27 +200,33 @@ change the attributes of this potential energy via the The kinetic energy of the system *ke* is inferred from the temperature of the system with :math:`\frac{1}{2} k_B T` of energy for each degree -of freedom. Thus, using different :doc:`compute commands ` for -calculating temperature, via the :doc:`thermo_modify temp +of freedom. Thus, using different :doc:`compute commands ` +for calculating temperature, via the :doc:`thermo_modify temp ` command, may yield different kinetic energies, since -different computes that calculate temperature can subtract out different -non-thermal components of velocity and/or include different degrees of -freedom (translational, rotational, etc). +different computes that calculate temperature can subtract out +different non-thermal components of velocity and/or include different +degrees of freedom (translational, rotational, etc). The potential energy of the system *pe* will include contributions -from fixes if the :doc:`fix_modify thermo ` option is set -for a fix that calculates such a contribution. For example, the :doc:`fix wall/lj93 ` fix calculates the energy of atoms +from fixes if the :doc:`fix_modify energy yes ` option is +set for a fix that calculates such a contribution. For example, the +:doc:`fix wall/lj93 ` fix calculates the energy of atoms interacting with the wall. See the doc pages for "individual fixes" -to see which ones contribute. +to see which ones contribute and whether their default +:doc:`fix_modify energy ` setting is *yes* or *no*\ . A long-range tail correction *etail* for the van der Waals pairwise -energy will be non-zero only if the :doc:`pair_modify tail ` option is turned on. The *etail* contribution -is included in *evdwl*\ , *epair*\ , *pe*\ , and *etotal*\ , and the +energy will be non-zero only if the :doc:`pair_modify tail +` option is turned on. The *etail* contribution is +included in *evdwl*\ , *epair*\ , *pe*\ , and *etotal*\ , and the corresponding tail correction to the pressure is included in *press* and *pxx*\ , *pyy*\ , etc. ---------- +Here is more information on other keywords whose meaning may not be +clear: + The *step*\ , *elapsed*\ , and *elaplong* keywords refer to timestep count. *Step* is the current timestep, or iteration count when a :doc:`minimization ` is being performed. *Elapsed* is the @@ -228,13 +237,14 @@ keywords for the :doc:`run ` for info on how to invoke a series of runs that keep track of an initial starting time. If these keywords are not used, then *elapsed* and *elaplong* are the same value. -The *dt* keyword is the current timestep size in time -:doc:`units `. The *time* keyword is the current elapsed -simulation time, also in time :doc:`units `, which is simply -(step\*dt) if the timestep size has not changed and the timestep has -not been reset. If the timestep has changed (e.g. via :doc:`fix dt/reset `) or the timestep has been reset (e.g. via -the "reset_timestep" command), then the simulation time is effectively -a cumulative value up to the current point. +The *dt* keyword is the current timestep size in time :doc:`units +`. The *time* keyword is the current elapsed simulation time, +also in time :doc:`units `, which is simply (step\*dt) if the +timestep size has not changed and the timestep has not been reset. If +the timestep has changed (e.g. via :doc:`fix dt/reset `) +or the timestep has been reset (e.g. via the "reset_timestep" +command), then the simulation time is effectively a cumulative value +up to the current point. The *cpu* keyword is elapsed CPU seconds since the beginning of this run. The *tpcpu* and *spcpu* keywords are measures of how fast your @@ -266,16 +276,29 @@ a filename for output specific to this partition. See discussion of the :doc:`-partition command-line switch ` for details on running in multi-partition mode. -The *timeremain* keyword returns the remaining seconds when a -timeout has been configured via the :doc:`timer timeout ` command. -If the timeout timer is inactive, the value of this keyword is 0.0 and -if the timer is expired, it is negative. This allows for example to exit +The *timeremain* keyword is the seconds remaining when a timeout has +been configured via the :doc:`timer timeout ` command. If the +timeout timer is inactive, the value of this keyword is 0.0 and if the +timer is expired, it is negative. This allows for example to exit loops cleanly, if the timeout is expired with: .. code-block:: LAMMPS if "$(timeremain) < 0.0" then "quit 0" +The *ecouple* keyword is cumulative energy change in the system due to +any thermostatting or barostatting fixes that are being used. A +positive value means that energy has been subtracted from the system +(added to the coupling reservoir). See the *econserve* keyword for an +explanation of why this sign choice makes sense. + +The *econserve* keyword is the sum of the potential and kinetic energy +of the system as well as the energy that has been transferred by +thermostatting or barostatting to their coupling reservoirs. I.e. it +is *pe* + *ke* + *econserve*\ . Ideally, for a simulation in the NVE, +NPH, or NPT ensembles, the *econserve* quantity should remain constant +over time. + The *fmax* and *fnorm* keywords are useful for monitoring the progress of an :doc:`energy minimization `. The *fmax* keyword calculates the maximum force in any dimension on any atom in the @@ -295,12 +318,13 @@ to reduce the delay factor to insure no force interactions are missed by atoms moving beyond the neighbor skin distance before a rebuild takes place. -The keywords *cella*\ , *cellb*\ , *cellc*\ , *cellalpha*\ , *cellbeta*\ , -*cellgamma*\ , correspond to the usual crystallographic quantities that -define the periodic unit cell of a crystal. See the :doc:`Howto triclinic ` doc page for a geometric description -of triclinic periodic cells, including a precise definition of these -quantities in terms of the internal LAMMPS cell dimensions *lx*\ , *ly*\ , -*lz*\ , *yz*\ , *xz*\ , *xy*\ . +The keywords *cella*\ , *cellb*\ , *cellc*\ , *cellalpha*\ , +*cellbeta*\ , *cellgamma*\ , correspond to the usual crystallographic +quantities that define the periodic unit cell of a crystal. See the +:doc:`Howto triclinic ` doc page for a geometric +description of triclinic periodic cells, including a precise +definition of these quantities in terms of the internal LAMMPS cell +dimensions *lx*\ , *ly*\ , *lz*\ , *yz*\ , *xz*\ , *xy*\ . ---------- @@ -330,8 +354,8 @@ creates a global vector with 6 values. ---------- -The *c_ID* and *c_ID[I]* and *c_ID[I][J]* keywords allow global -values calculated by a compute to be output. As discussed on the +The *c_ID* and *c_ID[I]* and *c_ID[I][J]* keywords allow global values +calculated by a compute to be output. As discussed on the :doc:`compute ` doc page, computes can calculate global, per-atom, or local values. Only global values can be referenced by this command. However, per-atom compute values for an individual atom @@ -353,12 +377,13 @@ kinetic energy that are summed over all atoms in the compute group. Intensive quantities are printed directly without normalization by thermo_style custom. Extensive quantities may be normalized by the total number of atoms in the simulation (NOT the number of atoms in -the compute group) when output, depending on the :doc:`thermo_modify norm ` option being used. +the compute group) when output, depending on the :doc:`thermo_modify +norm ` option being used. -The *f_ID* and *f_ID[I]* and *f_ID[I][J]* keywords allow global -values calculated by a fix to be output. As discussed on the -:doc:`fix ` doc page, fixes can calculate global, per-atom, or -local values. Only global values can be referenced by this command. +The *f_ID* and *f_ID[I]* and *f_ID[I][J]* keywords allow global values +calculated by a fix to be output. As discussed on the :doc:`fix +` doc page, fixes can calculate global, per-atom, or local +values. Only global values can be referenced by this command. However, per-atom fix values can be referenced for an individual atom in a :doc:`variable ` and the variable referenced by thermo_style custom, as discussed below. See the discussion above for @@ -377,8 +402,8 @@ energy that are summed over all atoms in the fix group. Intensive quantities are printed directly without normalization by thermo_style custom. Extensive quantities may be normalized by the total number of atoms in the simulation (NOT the number of atoms in the fix group) -when output, depending on the :doc:`thermo_modify norm ` -option being used. +when output, depending on the :doc:`thermo_modify norm +` option being used. The *v_name* keyword allow the current value of a variable to be output. The name in the keyword should be replaced by the variable diff --git a/src/SHOCK/fix_msst.cpp b/src/SHOCK/fix_msst.cpp index 3947811a52..d0dee1af90 100644 --- a/src/SHOCK/fix_msst.cpp +++ b/src/SHOCK/fix_msst.cpp @@ -1003,7 +1003,6 @@ double FixMSST::compute_etotal() { double epot,ekin,etot; epot = pe->compute_scalar(); - if (thermo_energy) epot -= compute_scalar(); ekin = temperature->compute_scalar(); ekin *= 0.5 * temperature->dof * force->boltz; etot = epot+ekin; diff --git a/src/SHOCK/fix_nphug.cpp b/src/SHOCK/fix_nphug.cpp index be4b71446e..c54bc0fa44 100644 --- a/src/SHOCK/fix_nphug.cpp +++ b/src/SHOCK/fix_nphug.cpp @@ -170,13 +170,11 @@ FixNPHug::FixNPHug(LAMMPS *lmp, int narg, char **arg) : FixNPHug::~FixNPHug() { - // temp and press computes handled by base class // delete pe compute if (peflag) modify->delete_compute(id_pe); delete [] id_pe; - } /* ---------------------------------------------------------------------- */ @@ -248,7 +246,6 @@ double FixNPHug::compute_etotal() { double epot,ekin,etot; epot = pe->compute_scalar(); - if (thermo_energy) epot -= compute_scalar(); ekin = temperature->compute_scalar(); ekin *= 0.5 * tdof * force->boltz; etot = epot+ekin; diff --git a/src/USER-EFF/fix_langevin_eff.cpp b/src/USER-EFF/fix_langevin_eff.cpp index 1a49a203d9..9c4ec9024d 100644 --- a/src/USER-EFF/fix_langevin_eff.cpp +++ b/src/USER-EFF/fix_langevin_eff.cpp @@ -15,7 +15,6 @@ Contributing author: Andres Jaramillo-Botero ------------------------------------------------------------------------- */ - #include #include "fix_langevin_eff.h" diff --git a/src/USER-MISC/fix_flow_gauss.cpp b/src/USER-MISC/fix_flow_gauss.cpp index f785545fa5..f5cbeaeed5 100644 --- a/src/USER-MISC/fix_flow_gauss.cpp +++ b/src/USER-MISC/fix_flow_gauss.cpp @@ -82,6 +82,7 @@ FixFlowGauss::FixFlowGauss(LAMMPS *lmp, int narg, char **arg) : } // by default, do not compute work done + workflag=0; // process optional keyword @@ -135,11 +136,12 @@ void FixFlowGauss::init() ------------------------------------------------------------------------- */ void FixFlowGauss::setup(int vflag) { - //need to compute work done if set fix_modify energy yes - if (thermo_energy) - workflag=1; + // need to compute work done if fix_modify energy yes is set + + if (thermo_energy) workflag = 1; - //get total mass of group + // get total mass of group + mTot=group->mass(igroup); if (mTot <= 0.0) error->all(FLERR,"Invalid group mass in fix flow/gauss"); diff --git a/src/USER-MISC/fix_pimd.cpp b/src/USER-MISC/fix_pimd.cpp index 5571f1cf35..1e4e03bfbf 100644 --- a/src/USER-MISC/fix_pimd.cpp +++ b/src/USER-MISC/fix_pimd.cpp @@ -121,7 +121,6 @@ FixPIMD::FixPIMD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) peratom_freq = 1; global_freq = 1; - thermo_energy = 1; vector_flag = 1; size_vector = 2; extvector = 1; diff --git a/src/USER-QTB/fix_qbmsst.cpp b/src/USER-QTB/fix_qbmsst.cpp index db162bd0c2..283a4a5b41 100644 --- a/src/USER-QTB/fix_qbmsst.cpp +++ b/src/USER-QTB/fix_qbmsst.cpp @@ -41,8 +41,8 @@ using namespace MathConst; /* ---------------------------------------------------------------------- read parameters ------------------------------------------------------------------------- */ -FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) + +FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg < 5) error->all(FLERR,"Illegal fix qbmsst command"); @@ -1048,7 +1048,6 @@ double FixQBMSST::compute_etotal() { double epot,ekin,etot; epot = pe->compute_scalar(); - if (thermo_energy) epot -= compute_scalar(); ekin = temperature->compute_scalar(); ekin *= 0.5 * temperature->dof * force->boltz; etot = epot+ekin; @@ -1060,12 +1059,12 @@ double FixQBMSST::compute_etotal() ------------------------------------------------------------------------- */ double FixQBMSST::compute_egrand() { - double epot,ekin,etot; + double epot,ekin,ecouple,etot; epot = pe->compute_scalar(); - if (!thermo_energy) epot += compute_scalar(); ekin = temperature->compute_scalar(); ekin *= 0.5 * temperature->dof * force->boltz; - etot = epot+ekin; + ecouple = compute_scalar(); + etot = epot + ekin + econserve; return etot; } diff --git a/src/thermo.cpp b/src/thermo.cpp index 9e4658fcdb..2a5b945a24 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -1773,12 +1773,10 @@ void Thermo::compute_ecouple() void Thermo::compute_econserve() { - compute_pe(); - double dvalue_pe = dvalue; - compute_ke(); - double dvalue_ke = dvalue; + compute_etotal(); + double dvalue_etotal = dvalue; compute_ecouple(); - dvalue += dvalue_pe + dvalue_ke; + dvalue += dvalue_etotal; } /* ---------------------------------------------------------------------- */ From fc0936c7781ef3ae419a03fc381480db43e50d27 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Tue, 26 Jan 2021 09:26:31 -0700 Subject: [PATCH 062/384] doc pages for virial contributions of fixes --- doc/src/fix_addforce.rst | 28 +++++++++-------- doc/src/fix_client_md.rst | 9 +++--- doc/src/fix_cmap.rst | 10 ++++--- doc/src/fix_efield.rst | 7 +++-- doc/src/fix_external.rst | 8 +++-- doc/src/fix_latte.rst | 7 +++++ doc/src/fix_lb_rigid_pc_sphere.rst | 19 +++++++++--- doc/src/fix_plumed.rst | 7 +++++ doc/src/fix_poems.rst | 42 ++++++++++++++++---------- doc/src/fix_shake.rst | 27 ++++++++++------- doc/src/fix_smd.rst | 48 +++++++++++++++++------------- doc/src/fix_wall.rst | 8 +++-- doc/src/fix_wall_ees.rst | 5 ---- doc/src/fix_wall_region.rst | 8 +++-- 14 files changed, 149 insertions(+), 84 deletions(-) diff --git a/doc/src/fix_addforce.rst b/doc/src/fix_addforce.rst index 4aca227246..0137066ff7 100644 --- a/doc/src/fix_addforce.rst +++ b/doc/src/fix_addforce.rst @@ -122,8 +122,8 @@ No information about this fix is written to :doc:`binary restart files `. The :doc:`fix_modify ` *energy* option is supported by -this fix to add the global potential "energy" inferred by the added -force to the global potential energy of the system as part of +this fix to add the potential energy inferred by the added force to +the global potential energy of the system as part of :doc:`thermodynamic output `. The default setting for this fix is :doc:`fix_modify energy no `. Note that this energy is a fictitious quantity but is needed so that the @@ -133,21 +133,23 @@ potential energy when atoms move in the direction of the added force. The :doc:`fix_modify ` *virial* option is supported by this fix to add the contribution due to the added forces on atoms to -the global pressure of the system as part of :doc:`thermodynamic -output `. The default setting for this fix is -:doc:`fix_modify virial no `. +both the global pressure and per-atom stress of the system via the +:doc:`compute pressure ` and :doc:`compute +stress/atom ` commands. The former can be +accessed by :doc:`thermodynamic output `. The default +setting for this fix is :doc:`fix_modify virial no `. The :doc:`fix_modify ` *respa* option is supported by this -fix. This allows to set at which level of the :doc:`r-RESPA ` -integrator the fix is adding its forces. Default is the outermost -level. +fix. This allows to set at which level of the :doc:`r-RESPA +` integrator the fix is adding its forces. Default is the +outermost level. This fix computes a global scalar and a global 3-vector of forces, -which can be accessed by various :doc:`output commands `. -The scalar is the potential energy discussed above. The vector is the -total force on the group of atoms before the forces on individual -atoms are changed by the fix. The scalar and vector values calculated -by this fix are "extensive". +which can be accessed by various :doc:`output commands +`. The scalar is the potential energy discussed above. +The vector is the total force on the group of atoms before the forces +on individual atoms are changed by the fix. The scalar and vector +values calculated by this fix are "extensive". No parameter of this fix can be used with the *start/stop* keywords of the :doc:`run ` command. diff --git a/doc/src/fix_client_md.rst b/doc/src/fix_client_md.rst index 5344f29459..3bcc6bdaa5 100644 --- a/doc/src/fix_client_md.rst +++ b/doc/src/fix_client_md.rst @@ -80,10 +80,11 @@ the global potential energy of the system as part of this fix is :doc:`fix_modify energy yes `. The :doc:`fix_modify ` *virial* option is supported by -this fix to add the contribution computed by the external program to -the global pressure of the system as part of :doc:`thermodynamic -output `. The default setting for this fix is -:doc:`fix_modify virial yes `. +this fix to add the contribution computed by the server application to +the global pressure of the system via the :doc:`compute pressure +` command. This can be accessed by +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify virial yes `. This fix computes a global scalar which can be accessed by various :doc:`output commands `. The scalar is the potential diff --git a/doc/src/fix_cmap.rst b/doc/src/fix_cmap.rst index 83e4b6d9b8..94f8a903e9 100644 --- a/doc/src/fix_cmap.rst +++ b/doc/src/fix_cmap.rst @@ -109,10 +109,12 @@ default setting for this fix is :doc:`fix_modify energy yes `. The :doc:`fix_modify ` *virial* option is supported by -this fix to add the contribution due to the CMAP interactions between -atoms to the global prsesure of the system as part of -:doc:`thermodynamic output `. The default setting for -this fix is :doc:`fix_modify virial yes `. +this fix to add the contribution due to the CMAP interactions to both +the global pressure and per-atom stress of the system via the +:doc:`compute pressure ` and :doc:`compute +stress/atom ` commands. The former can be +accessed by :doc:`thermodynamic output `. The default +setting for this fix is :doc:`fix_modify virial yes `. This fix computes a global scalar which can be accessed by various :doc:`output commands `. The scalar is the potential diff --git a/doc/src/fix_efield.rst b/doc/src/fix_efield.rst index fdfc8b427b..2feaa61db7 100644 --- a/doc/src/fix_efield.rst +++ b/doc/src/fix_efield.rst @@ -133,8 +133,11 @@ due to the electric field. The :doc:`fix_modify ` *virial* option is supported by this fix to add the contribution due to the added forces on atoms to -the system's virial as part of :doc:`thermodynamic output -`. The default is *virial no* +both the global pressure and per-atom stress of the system via the +:doc:`compute pressure ` :doc:`compute stress/atom +` commands. The former can be accessed by +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify virial no `. The :doc:`fix_modify ` *respa* option is supported by this fix. This allows to set at which level of the :doc:`r-RESPA diff --git a/doc/src/fix_external.rst b/doc/src/fix_external.rst index cdb87c68a9..481df30628 100644 --- a/doc/src/fix_external.rst +++ b/doc/src/fix_external.rst @@ -167,9 +167,11 @@ potential energy when atoms move in the direction of the added force. The :doc:`fix_modify ` *virial* option is supported by this fix to add the contribution computed by the external program to -the global pressure of the system as part of :doc:`thermodynamic -output `. The default setting for this fix is -:doc:`fix_modify virial yes `. +both the global pressure and per-atom stress of the system via the +:doc:`compute pressure ` :doc:`compute stress/atom +` commands. The former can be accessed by +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify virial yes `. This fix computes a global scalar which can be accessed by various :doc:`output commands `. The scalar is the potential diff --git a/doc/src/fix_latte.rst b/doc/src/fix_latte.rst index 563656be5f..58a8ddbe20 100644 --- a/doc/src/fix_latte.rst +++ b/doc/src/fix_latte.rst @@ -116,6 +116,13 @@ potential energy of the system as part of :doc:`thermodynamic output `. The default setting for this fix is :doc:`fix_modify energy yes `. +The :doc:`fix_modify ` *virial* option is supported by +this fix to add the contribution compute by LATTE to the global +pressure of the system via the :doc:`compute pressure +` command. This can be accessed by +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify virial yes `. + The :doc:`fix_modify ` *virial* option is supported by this fix to add the contribution computed by LATTE to the global pressure of the system as part of :doc:`thermodynamic output diff --git a/doc/src/fix_lb_rigid_pc_sphere.rst b/doc/src/fix_lb_rigid_pc_sphere.rst index 66b5f5f8d5..b6a19c98d5 100644 --- a/doc/src/fix_lb_rigid_pc_sphere.rst +++ b/doc/src/fix_lb_rigid_pc_sphere.rst @@ -50,7 +50,8 @@ This fix is based on the :doc:`fix rigid ` command, and was created to be used in place of that fix, to integrate the equations of motion of spherical rigid bodies when a lattice-Boltzmann fluid is present with a user-specified value of the force-coupling constant. -The fix uses the integration algorithm described in :ref:`Mackay et al. ` to update the positions, velocities, and orientations of +The fix uses the integration algorithm described in :ref:`Mackay et +al. ` to update the positions, velocities, and orientations of a set of spherical rigid bodies experiencing velocity dependent hydrodynamic forces. The spherical bodies are assumed to rotate as solid, uniform density spheres, with moments of inertia calculated @@ -88,9 +89,18 @@ Restart, fix_modify, output, run start/stop, minimize info No information about the *rigid* and *rigid/nve* fixes are written to :doc:`binary restart files `. +The :doc:`fix_modify ` *virial* option is supported by +this fix to add the contribution due to the added forces on atoms to +both the global pressure and per-atom stress of the system via the +:doc:`compute pressure ` and :doc:`compute +stress/atom ` commands. The former can be +accessed by :doc:`thermodynamic output `. The default +setting for this fix is :doc:`fix_modify virial yes `. + Similar to the :doc:`fix rigid ` command: The rigid fix -computes a global scalar which can be accessed by various :doc:`output commands `. The scalar value calculated by these -fixes is "intensive". The scalar is the current temperature of the +computes a global scalar which can be accessed by various :doc:`output +commands `. The scalar value calculated by these fixes +is "intensive". The scalar is the current temperature of the collection of rigid bodies. This is averaged over all rigid bodies and their translational and rotational degrees of freedom. The translational energy of a rigid body is 1/2 m v\^2, where m = total @@ -130,7 +140,8 @@ Restrictions """""""""""" This fix is part of the USER-LB package. It is only enabled if LAMMPS -was built with that package. See the :doc:`Build package ` doc page for more info. +was built with that package. See the :doc:`Build package +` doc page for more info. Can only be used if a lattice-Boltzmann fluid has been created via the :doc:`fix lb/fluid ` command, and must come after this diff --git a/doc/src/fix_plumed.rst b/doc/src/fix_plumed.rst index 67118b6bfa..bd2c05adfe 100644 --- a/doc/src/fix_plumed.rst +++ b/doc/src/fix_plumed.rst @@ -95,6 +95,13 @@ PLUMED to the global potential energy of the system as part of :doc:`thermodynamic output `. The default setting for this fix is :doc:`fix_modify energy yes `. +The :doc:`fix_modify ` *virial* option is supported by +this fix to add the contribution from the biasing force to the global +pressure of the system via the :doc:`compute pressure +` command. This can be accessed by +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify virial yes `. + This fix computes a global scalar which can be accessed by various :doc:`output commands `. The scalar is the PLUMED energy mentioned above. The scalar value calculated by this fix is diff --git a/doc/src/fix_poems.rst b/doc/src/fix_poems.rst index 0f173fcc4e..b782b7809e 100644 --- a/doc/src/fix_poems.rst +++ b/doc/src/fix_poems.rst @@ -39,14 +39,15 @@ useful for treating a large biomolecule as a collection of connected, coarse-grained particles. The coupling, associated motion constraints, and time integration is -performed by the software package `Parallelizable Open source Efficient Multibody Software (POEMS)` which computes the -constrained rigid-body motion of articulated (jointed) multibody -systems :ref:`(Anderson) `. POEMS was written and is distributed -by Prof Kurt Anderson, his graduate student Rudranarayan Mukherjee, -and other members of his group at Rensselaer Polytechnic Institute -(RPI). Rudranarayan developed the LAMMPS/POEMS interface. For -copyright information on POEMS and other details, please refer to the -documents in the poems directory distributed with LAMMPS. +performed by the software package `Parallelizable Open source +Efficient Multibody Software (POEMS)` which computes the constrained +rigid-body motion of articulated (jointed) multibody systems +:ref:`(Anderson) `. POEMS was written and is distributed by +Prof Kurt Anderson, his graduate student Rudranarayan Mukherjee, and +other members of his group at Rensselaer Polytechnic Institute (RPI). +Rudranarayan developed the LAMMPS/POEMS interface. For copyright +information on POEMS and other details, please refer to the documents +in the poems directory distributed with LAMMPS. This fix updates the positions and velocities of the rigid atoms with a constant-energy time integration, so you should not update the same @@ -107,7 +108,16 @@ off, and there is only a single fix poems defined. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. +No information about this fix is written to :doc:`binary restart files +`. + +The :doc:`fix_modify ` *virial* option is supported by +this fix to add the contribution due to the added forces and torques +on atoms to both the global pressure and per-atom stress of the system +via the :doc:`compute pressure ` and :doc:`compute +stress/atom ` commands. The former can be +accessed by :doc:`thermodynamic output `. The default +setting for this fix is :doc:`fix_modify virial yes `. The :doc:`fix_modify ` *bodyforces* option is supported by this fix style to set whether per-body forces and torques are computed @@ -115,16 +125,18 @@ early or late in a timestep, i.e. at the post-force stage or at the final-integrate stage, respectively. No global or per-atom quantities are stored by this fix for access by -various :doc:`output commands `. No parameter of this fix -can be used with the *start/stop* keywords of the :doc:`run ` -command. This fix is not invoked during :doc:`energy minimization `. +various :doc:`output commands `. No parameter of this +fix can be used with the *start/stop* keywords of the :doc:`run ` +command. This fix is not invoked during :doc:`energy minimization +`. Restrictions """""""""""" -This fix is part of the :ref:`POEMS ` package. It is only enabled if LAMMPS -was built with that package, which also requires the POEMS library be -built and linked with LAMMPS. See the :doc:`Build package ` doc page for more info. +This fix is part of the :ref:`POEMS ` package. It is only +enabled if LAMMPS was built with that package, which also requires the +POEMS library be built and linked with LAMMPS. See the :doc:`Build +package ` doc page for more info. Related commands """""""""""""""" diff --git a/doc/src/fix_shake.rst b/doc/src/fix_shake.rst index 116edd8c7e..8e8f3e0988 100644 --- a/doc/src/fix_shake.rst +++ b/doc/src/fix_shake.rst @@ -191,22 +191,29 @@ LAMMPS closely follows (:ref:`Andersen (1983) `). Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -The :doc:`fix_modify ` *virial* option is supported by this -fix to add the contribution due to keeping the constraints to the -system's virial as part of :doc:`thermodynamic output `. -The default is *virial yes* +No information about these fixes is written to :doc:`binary restart +files `. -No information about these fixes is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options -are relevant to these fixes. No global or per-atom quantities are -stored by these fixes for access by various :doc:`output commands `. No parameter of these fixes can be used -with the *start/stop* keywords of the :doc:`run ` command. These -fixes are not invoked during :doc:`energy minimization `. +The :doc:`fix_modify ` *virial* option is supported by +these fixes to add the contribution due to the added forces on atoms +to both the global pressure and per-atom stress of the system via the +:doc:`compute pressure ` and :doc:`compute +stress/atom ` commands. The former can be +accessed by :doc:`thermodynamic output `. The default +setting for this fix is :doc:`fix_modify virial yes `. + +No global or per-atom quantities are stored by these fixes for access +by various :doc:`output commands `. No parameter of +these fixes can be used with the *start/stop* keywords of the +:doc:`run ` command. These fixes are not invoked during +:doc:`energy minimization `. Restrictions """""""""""" These fixes are part of the RIGID package. They are only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. +LAMMPS was built with that package. See the :doc:`Build package +` doc page for more info. For computational efficiency, there can only be one shake or rattle fix defined in a simulation. diff --git a/doc/src/fix_smd.rst b/doc/src/fix_smd.rst index 8cbae29adf..8bf7c25478 100644 --- a/doc/src/fix_smd.rst +++ b/doc/src/fix_smd.rst @@ -48,10 +48,12 @@ Description """"""""""" This fix implements several options of steered MD (SMD) as reviewed in -:ref:`(Izrailev) `, which allows to induce conformational changes -in systems and to compute the potential of mean force (PMF) along the -assumed reaction coordinate :ref:`(Park) ` based on Jarzynski's -equality :ref:`(Jarzynski) `. This fix borrows a lot from :doc:`fix spring ` and :doc:`fix setforce `. +:ref:`(Izrailev) `, which allows to induce conformational +changes in systems and to compute the potential of mean force (PMF) +along the assumed reaction coordinate :ref:`(Park) ` based on +Jarzynski's equality :ref:`(Jarzynski) `. This fix borrows +a lot from :doc:`fix spring ` and :doc:`fix setforce +`. You can apply a moving spring force to a group of atoms (\ *tether* style) or between two groups of atoms (\ *couple* style). The spring @@ -108,30 +110,36 @@ See the :doc:`read_restart ` command for info on how to re-specify a fix in an input script that reads a restart file, so that the operation of the fix continues in an uninterrupted fashion. -The :doc:`fix_modify ` *virial* option is supported by this -fix to add the contribution due to the added forces on atoms to the -system's virial as part of :doc:`thermodynamic output `. -The default is *virial no* +The :doc:`fix_modify ` *virial* option is supported by +this fix to add the contribution due to the added forces on atoms to +both the global pressure and per-atom stress of the system via the +:doc:`compute pressure ` and :doc:`compute +stress/atom ` commands. The former can be +accessed by :doc:`thermodynamic output `. The default +setting for this fix is :doc:`fix_modify virial no `. -The :doc:`fix_modify ` *respa* option is supported by -this fix. This allows to set at which level of the :doc:`r-RESPA ` -integrator the fix is adding its forces. Default is the outermost level. +The :doc:`fix_modify ` *respa* option is supported by this +fix. This allows to set at which level of the :doc:`r-RESPA +` integrator the fix is adding its forces. Default is the +outermost level. This fix computes a vector list of 7 quantities, which can be accessed -by various :doc:`output commands `. The quantities in the -vector are in this order: the x-, y-, and z-component of the pulling -force, the total force in direction of the pull, the equilibrium -distance of the spring, the distance between the two reference points, -and finally the accumulated PMF (the sum of pulling forces times -displacement). +by various :doc:`output commands `. The quantities in +the vector are in this order: the x-, y-, and z-component of the +pulling force, the total force in direction of the pull, the +equilibrium distance of the spring, the distance between the two +reference points, and finally the accumulated PMF (the sum of pulling +forces times displacement). The force is the total force on the group of atoms by the spring. In the case of the *couple* style, it is the force on the fix group -(group-ID) or the negative of the force on the second group (group-ID2). -The vector values calculated by this fix are "extensive". +(group-ID) or the negative of the force on the second group +(group-ID2). The vector values calculated by this fix are +"extensive". No parameter of this fix can be used with the *start/stop* keywords of -the :doc:`run ` command. This fix is not invoked during :doc:`energy minimization `. +the :doc:`run ` command. This fix is not invoked during +:doc:`energy minimization `. Restrictions """""""""""" diff --git a/doc/src/fix_wall.rst b/doc/src/fix_wall.rst index 0bd7f241dd..cda9d4f8fa 100644 --- a/doc/src/fix_wall.rst +++ b/doc/src/fix_wall.rst @@ -342,8 +342,12 @@ for this fix is :doc:`fix_modify energy no `. The :doc:`fix_modify ` *virial* option is supported by this fix to add the contribution due to the interaction between atoms -and each wall to the system's virial as part of :doc:`thermodynamic -output `. The default is *virial no* +and all the specified walls to both the global pressure and per-atom +stress of the system via the :doc:`compute pressure +` :doc:`compute stress/atom ` +commands. The former can be accessed by :doc:`thermodynamic output +`. The default setting for this fix is :doc:`fix_modify +virial no `. The :doc:`fix_modify ` *respa* option is supported by this fix. This allows to set at which level of the :doc:`r-RESPA diff --git a/doc/src/fix_wall_ees.rst b/doc/src/fix_wall_ees.rst index c3e8a9affb..fde9fe7234 100644 --- a/doc/src/fix_wall_ees.rst +++ b/doc/src/fix_wall_ees.rst @@ -134,11 +134,6 @@ system as part of :doc:`thermodynamic output `. The default settings for thes fixes are :doc:`fix_modify energy no `. -The :doc:`fix_modify ` *virial* option is supported by -these rixes to add the contribution due to the interaction between -atoms and each wall to the system's virial as part of -:doc:`thermodynamic output `. The default is *virial no* - The :doc:`fix_modify ` *respa* option is supported by these fixes. This allows to set at which level of the :doc:`r-RESPA ` integrator the fix is adding its forces. Default is the diff --git a/doc/src/fix_wall_region.rst b/doc/src/fix_wall_region.rst index 12bbaea454..1d06062fdd 100644 --- a/doc/src/fix_wall_region.rst +++ b/doc/src/fix_wall_region.rst @@ -202,8 +202,12 @@ this fix is :doc:`fix_modify energy no `. The :doc:`fix_modify ` *virial* option is supported by this fix to add the contribution due to the interaction between atoms -and each wall to the system's virial as part of :doc:`thermodynamic -output `. The default is *virial no* +and the region wall to both the global pressure and per-atom stress of +the system via the :doc:`compute pressure ` +:doc:`compute stress/atom ` commands. The former +can be accessed by :doc:`thermodynamic output `. The +default setting for this fix is :doc:`fix_modify virial no +`. The :doc:`fix_modify ` *respa* option is supported by this fix. This allows to set at which level of the :doc:`r-RESPA ` From eb9e28e6652ed2276cf5711e5abb011373ecc0ff Mon Sep 17 00:00:00 2001 From: Plimpton Date: Tue, 26 Jan 2021 09:30:28 -0700 Subject: [PATCH 063/384] fix some typos --- doc/src/fix_efield.rst | 8 ++++---- doc/src/fix_external.rst | 8 ++++---- doc/src/fix_wall.rst | 8 ++++---- doc/src/fix_wall_region.rst | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/src/fix_efield.rst b/doc/src/fix_efield.rst index 2feaa61db7..86dcda9bc5 100644 --- a/doc/src/fix_efield.rst +++ b/doc/src/fix_efield.rst @@ -134,10 +134,10 @@ due to the electric field. The :doc:`fix_modify ` *virial* option is supported by this fix to add the contribution due to the added forces on atoms to both the global pressure and per-atom stress of the system via the -:doc:`compute pressure ` :doc:`compute stress/atom -` commands. The former can be accessed by -:doc:`thermodynamic output `. The default setting for -this fix is :doc:`fix_modify virial no `. +:doc:`compute pressure ` and :doc:`compute +stress/atom ` commands. The former can be +accessed by :doc:`thermodynamic output `. The default +setting for this fix is :doc:`fix_modify virial no `. The :doc:`fix_modify ` *respa* option is supported by this fix. This allows to set at which level of the :doc:`r-RESPA diff --git a/doc/src/fix_external.rst b/doc/src/fix_external.rst index 481df30628..938b798ddf 100644 --- a/doc/src/fix_external.rst +++ b/doc/src/fix_external.rst @@ -168,10 +168,10 @@ potential energy when atoms move in the direction of the added force. The :doc:`fix_modify ` *virial* option is supported by this fix to add the contribution computed by the external program to both the global pressure and per-atom stress of the system via the -:doc:`compute pressure ` :doc:`compute stress/atom -` commands. The former can be accessed by -:doc:`thermodynamic output `. The default setting for -this fix is :doc:`fix_modify virial yes `. +:doc:`compute pressure ` and :doc:`compute +stress/atom ` commands. The former can be +accessed by :doc:`thermodynamic output `. The default +setting for this fix is :doc:`fix_modify virial yes `. This fix computes a global scalar which can be accessed by various :doc:`output commands `. The scalar is the potential diff --git a/doc/src/fix_wall.rst b/doc/src/fix_wall.rst index cda9d4f8fa..2a2aba777d 100644 --- a/doc/src/fix_wall.rst +++ b/doc/src/fix_wall.rst @@ -344,10 +344,10 @@ The :doc:`fix_modify ` *virial* option is supported by this fix to add the contribution due to the interaction between atoms and all the specified walls to both the global pressure and per-atom stress of the system via the :doc:`compute pressure -` :doc:`compute stress/atom ` -commands. The former can be accessed by :doc:`thermodynamic output -`. The default setting for this fix is :doc:`fix_modify -virial no `. +` and :doc:`compute stress/atom +` commands. The former can be accessed by +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify virial no `. The :doc:`fix_modify ` *respa* option is supported by this fix. This allows to set at which level of the :doc:`r-RESPA diff --git a/doc/src/fix_wall_region.rst b/doc/src/fix_wall_region.rst index 1d06062fdd..3803d4b74b 100644 --- a/doc/src/fix_wall_region.rst +++ b/doc/src/fix_wall_region.rst @@ -203,7 +203,7 @@ this fix is :doc:`fix_modify energy no `. The :doc:`fix_modify ` *virial* option is supported by this fix to add the contribution due to the interaction between atoms and the region wall to both the global pressure and per-atom stress of -the system via the :doc:`compute pressure ` +the system via the :doc:`compute pressure ` and :doc:`compute stress/atom ` commands. The former can be accessed by :doc:`thermodynamic output `. The default setting for this fix is :doc:`fix_modify virial no From 78b46e819b693e0b4d67233e29f6c13b0718b322 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Tue, 26 Jan 2021 10:54:02 -0700 Subject: [PATCH 064/384] added Developer doc info for this refactoring --- doc/src/Developer_notes.rst | 132 ++++++++++++++++++++++++++++++++++-- doc/src/fix_langevin.rst | 32 +++++---- 2 files changed, 144 insertions(+), 20 deletions(-) diff --git a/doc/src/Developer_notes.rst b/doc/src/Developer_notes.rst index 87ef97ea7b..81161fa348 100644 --- a/doc/src/Developer_notes.rst +++ b/doc/src/Developer_notes.rst @@ -1,11 +1,133 @@ -Notes for Developers and Code Maintainers +Notes for developers and code maintainers ----------------------------------------- -This section documents how a few large sections of code with LAMMPS -work at a conceptual level. Comments on code in source files +This section documents how some of the code functionality within +LAMMPS works at a conceptual level. Comments on code in source files typically document what a variable stores, what a small section of -code does, or what a function does or its input/outputs. The topics -on this page are intended to document code at a higher level. +code does, or what a function does and its input/outputs. The topics +on this page are intended to document code functionality at a higher level. + +Fix contributions to instantaneous energy, virial, and cumulative energy +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Fixes can calculate contributions to the instantaneous energy and/or +virial of the system, both in a global and peratom sense. Fixes that +perform thermostatting or barostatting can calculate the cumulative +energy they add to or subtract from the system, which is accessed by +the *ecouple* and *econserve* thermodynamic keywords. This subsection +explains how both work and what flags to set in a new fix to enable +this functionality. + +Let's start with thermostatting and barostatting fixes. Examples are +the :doc:`fix langevin ` and :doc:`fix npt ` +commands. Here is what the fix needs to do: + +* Set the variable *ecouple_flag* = 1 in the constructor. Also set + *scalar_flag* = 1, *extscalar* = 1, and *global_freq* to a timestep + increment which matches how often the fix is invoked. +* Implement a compute_scalar() method that returns the cumulative + energy added or subtracted by the fix, e.g. by rescaling the + velocity of atoms. The sign convention is that subtracted energy is + positive, added energy is negative. This must be the total energy + added to the entire system, i.e. an "extensive" quantity, not a + per-atom energy. Cumulative means the summed energy since the fix + was instantiated, even across multiple runs. This is because the + energy is used by the *econserve* thermodynamic keyword to check + that the fix is conserving the total energy of the system, + i.e. potential energy + kinetic energy + coupling energy = a + constant. + +And here is how the code operates: + +* The Modify class makes a list of all fixes that set *ecouple_flag* = 1. +* The :doc:`thermo_style custom ` command defines + *ecouple* and *econserve* keywords. +* These keywords sum the energy contributions from all the + *ecouple_flag* = 1 fixes by invoking the energy_couple() method in + the Modify class, which calls the compute_scalar() method of each + fix in the list. + +------------------ + +Next, here is how a fix contributes to the instantaneous energy and +virial of the system. First, it sets any or all of these flags to a +value of 1 in their constructor: + +* *energy_global_flag* to contribute to global energy, example: :doc:`fix indent ` +* *energy_peratom_flag* to contribute to peratom energy, :doc:`fix cmap ` +* *virial_global_flag* to contribute to global virial, example: :doc:`fix wall ` +* *virial_peratom_flag* to contribute to peratom virial, example: :doc:`fix wall ` + +The fix must also do the following: + +* For global energy, implement a compute_scalar() method that returns + the energy added or subtracted on this timestep. Here the sign + convention is that added energy is positive, subtracted energy is + negative. +* For peratom energy, invoke the ev_init(eflag,vflag) function each + time the fix is invoked, which initializes per-atom energy storage. + The value of eflag may need to be stored from an earlier call to the + fix during the same timestep. See how the :doc:`fix cmap + ` command does this in src/MOLECULE/fix_cmap.cpp. When an + energy for one or more atoms is calculated, invoke the ev_tally() + function to tally the contribution to each atom. Both the ev_init() + and ev_tally() methods are in the parent Fix class. +* For global and/or peratom virial, invoke the v_init(vflag) function + each time the fix is invoked, which initializes virial storage. + When forces on one or more atoms are calculated, invoke the + v_tally() function to tally the contribution. Both the v_init() and + v_tally() methods are in the parent Fix class. Note that there are + several variants of v_tally(); choose the one appropriate to your + fix. + +.. note:: + + The ev_init() and ev_tally() methods also account for global and + peratom virial contributions. Thus you do not need to invoke the + v_init() and v_tally() methods, if the fix also calculates peratom + energies. + +The fix must also specify whether (by default) to include or exclude +these contributions to the global/peratom energy/virial of the system. +For the fix to include the contributions, set either of both of these +variables in the contructor: + +* *thermo_energy* = 1, for global and peratom energy +* *thermo_virial* = 1, for global and peratom virial + +Note that these variables are zeroed in fix.cpp. Thus if you don't +set the variables, the contributions will be excluded (by default) + +However, the user has ultimate control over whether to include or +exclude the contributions of the fix via the :doc:`fix modify +` command: + +* fix modify *energy yes* to include global and peratom energy contributions +* fix modify *virial yes* to include global and peratom virial contributions + +If the fix contributes to any of the global/peratom energy/virial +values for the system, it should be explained on the fix doc page, +along with the default values for the *energy yes/no* and *virial +yes/no* settings of the :doc:`fix modify ` command. + +Finally, these 4 contributions are included in the output of 4 +computes: + +* global energy in :doc:`compute pe ` +* peratom energy in :doc:`compute pe/atom ` +* global virial in :doc:`compute pressure ` +* peratom virial in :doc:`compute stress/atom ` + +These computes invoke a method of the Modify class to include +contributions from fixes that have the corresponding flags set, +e.g. *energy_peratom_flag* and *thermo_energy* for :doc:`compute +pe/atom `. + +Note that each compute has an optional keyword to either include or +exclude all contributions from fixes. Also note that :doc:`compute pe +` and :doc:`compute pressure ` are what +is used (by default) by :doc:`thermodynamic output ` to +calculate values for its *pe* and *press* keywords. KSpace PPPM FFT grids ^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/src/fix_langevin.rst b/doc/src/fix_langevin.rst index b8524069ec..918573fc6b 100644 --- a/doc/src/fix_langevin.rst +++ b/doc/src/fix_langevin.rst @@ -230,7 +230,7 @@ conservation. .. note:: - this accumulated energy does NOT include kinetic energy removed + This accumulated energy does NOT include kinetic energy removed by the *zero* flag. LAMMPS will print a warning when both options are active. @@ -244,7 +244,8 @@ to zero by subtracting off an equal part of it from each atom in the group. As a result, the center-of-mass of a system with zero initial momentum will not drift over time. -The keyword *gjf* can be used to run the :ref:`Gronbech-Jensen/Farago ` time-discretization of the Langevin model. As +The keyword *gjf* can be used to run the :ref:`Gronbech-Jensen/Farago +` time-discretization of the Langevin model. As described in the papers cited below, the purpose of this method is to enable longer timesteps to be used (up to the numerical stability limit of the integrator), while still producing the correct Boltzmann @@ -252,19 +253,20 @@ distribution of atom positions. The current implementation provides the user with the option to output the velocity in one of two forms: *vfull* or *vhalf*\ , which replaces -the outdated option *yes*\ . The *gjf* option *vfull* outputs the on-site -velocity given in :ref:`Gronbech-Jensen/Farago `; this velocity -is shown to be systematically lower than the target temperature by a small -amount, which grows quadratically with the timestep. -The *gjf* option *vhalf* outputs the 2GJ half-step velocity given in -:ref:`Gronbech Jensen/Gronbech-Jensen <2Gronbech-Jensen>`; for linear systems, -this velocity is shown to not have any statistical errors for any stable time step. -An overview of statistically correct Boltzmann and Maxwell-Boltzmann -sampling of true on-site and true half-step velocities is given in -:ref:`Gronbech-Jensen <1Gronbech-Jensen>`. -Regardless of the choice of output velocity, the sampling of the configurational -distribution of atom positions is the same, and linearly consistent with the -target temperature. +the outdated option *yes*\ . The *gjf* option *vfull* outputs the +on-site velocity given in :ref:`Gronbech-Jensen/Farago +`; this velocity is shown to be systematically lower +than the target temperature by a small amount, which grows +quadratically with the timestep. The *gjf* option *vhalf* outputs the +2GJ half-step velocity given in :ref:`Gronbech Jensen/Gronbech-Jensen +<2Gronbech-Jensen>`; for linear systems, this velocity is shown to not +have any statistical errors for any stable time step. An overview of +statistically correct Boltzmann and Maxwell-Boltzmann sampling of true +on-site and true half-step velocities is given in +:ref:`Gronbech-Jensen <1Gronbech-Jensen>`. Regardless of the choice +of output velocity, the sampling of the configurational distribution +of atom positions is the same, and linearly consistent with the target +temperature. ---------- From 80bac271849d6da611d56bacacf13be7bdf7ac25 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Tue, 26 Jan 2021 11:02:27 -0700 Subject: [PATCH 065/384] extra files that were not checked in --- doc/src/fix_flow_gauss.rst | 3 ++- doc/src/fix_rigid.rst | 8 ++++++++ src/USER-MISC/fix_wall_ees.cpp | 2 -- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/src/fix_flow_gauss.rst b/doc/src/fix_flow_gauss.rst index 2affbd68f4..c7907432dc 100644 --- a/doc/src/fix_flow_gauss.rst +++ b/doc/src/fix_flow_gauss.rst @@ -165,7 +165,8 @@ LAMMPS was built with that package. See the :doc:`Build package Related commands """""""""""""""" -:doc:`fix addforce `, :doc:`compute temp/profile `, :doc:`velocity ` +:doc:`fix addforce `, :doc:`compute temp/profile + `, :doc:`velocity ` Default """"""" diff --git a/doc/src/fix_rigid.rst b/doc/src/fix_rigid.rst index 526d2d53e3..43750d59a1 100644 --- a/doc/src/fix_rigid.rst +++ b/doc/src/fix_rigid.rst @@ -799,6 +799,14 @@ accessed by various :doc:`output commands `. The scalar is the same cumulative energy change due to these fixes described above. The scalar value calculated by this fix is "extensive". +The :doc:`fix_modify ` *virial* option is supported by +these fixes to add the contribution due to the added forces on atoms +to both the global pressure and per-atom stress of the system via the +:doc:`compute pressure ` and :doc:`compute +stress/atom ` commands. The former can be +accessed by :doc:`thermodynamic output `. The default +setting for this fix is :doc:`fix_modify virial yes `. + All of the *rigid* styles (not the *rigid/small* styles) compute a global array of values which can be accessed by various :doc:`output commands `. Similar information about the bodies diff --git a/src/USER-MISC/fix_wall_ees.cpp b/src/USER-MISC/fix_wall_ees.cpp index e8e307224f..8adac48263 100644 --- a/src/USER-MISC/fix_wall_ees.cpp +++ b/src/USER-MISC/fix_wall_ees.cpp @@ -84,14 +84,12 @@ void FixWallEES::wall_particle(int m, int which, double coord) double **f = atom->f; double **tor = atom->torque; - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); AtomVecEllipsoid::Bonus *bonus = avec->bonus; int *ellipsoid = atom->ellipsoid; int *mask = atom->mask; int nlocal = atom->nlocal; - int dim = which / 2; int side = which % 2; if (side == 0) side = -1; From 2b290d5e42d76d3993b5dea81496dcb02252d266 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 26 Jan 2021 18:31:23 -0500 Subject: [PATCH 066/384] recover from compilation failures --- src/KOKKOS/fix_wall_lj93_kokkos.cpp | 2 +- src/KOKKOS/modify_kokkos.cpp | 6 +++--- src/KOKKOS/modify_kokkos.h | 2 +- src/USER-QTB/fix_qbmsst.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/KOKKOS/fix_wall_lj93_kokkos.cpp b/src/KOKKOS/fix_wall_lj93_kokkos.cpp index 29baa3a813..9b8b146ba3 100644 --- a/src/KOKKOS/fix_wall_lj93_kokkos.cpp +++ b/src/KOKKOS/fix_wall_lj93_kokkos.cpp @@ -31,7 +31,7 @@ FixWallLJ93Kokkos::FixWallLJ93Kokkos(LAMMPS *lmp, int narg, char **a execution_space = ExecutionSpaceFromDevice::space; datamask_read = EMPTY_MASK; datamask_modify = EMPTY_MASK; - virial_flag = 0; + virial_global_flag = virial_peratom_flag = 0; } /* ---------------------------------------------------------------------- diff --git a/src/KOKKOS/modify_kokkos.cpp b/src/KOKKOS/modify_kokkos.cpp index 89153def23..c3d94f8dc5 100644 --- a/src/KOKKOS/modify_kokkos.cpp +++ b/src/KOKKOS/modify_kokkos.cpp @@ -355,7 +355,7 @@ void ModifyKokkos::end_of_step() ecouple = cumulative energy added to reservoir by thermostatting ------------------------------------------------------------------------- */ -double Modify::energy_couple() +double ModifyKokkos::energy_couple() { double energy = 0.0; for (int i = 0; i < n_energy_couple; i++) { @@ -375,7 +375,7 @@ double Modify::energy_couple() called by compute pe ------------------------------------------------------------------------- */ -double Modify::energy_global() +double ModifyKokkos::energy_global() { double energy = 0.0; for (int i = 0; i < n_energy_global; i++) { @@ -394,7 +394,7 @@ double Modify::energy_global() called by compute pe/atom ------------------------------------------------------------------------- */ -void Modify::energy_atom(int nlocal, double *energy) +void ModifyKokkos::energy_atom(int nlocal, double *energy) { int i,j; double *eatom; diff --git a/src/KOKKOS/modify_kokkos.h b/src/KOKKOS/modify_kokkos.h index be52e4bfff..9ae1cfb5e2 100644 --- a/src/KOKKOS/modify_kokkos.h +++ b/src/KOKKOS/modify_kokkos.h @@ -39,7 +39,7 @@ class ModifyKokkos : public Modify { void end_of_step(); double energy_couple(); double energy_global(); - void energy_atom(); + void energy_atom(int, double *); void post_run(); void setup_pre_force_respa(int, int); diff --git a/src/USER-QTB/fix_qbmsst.cpp b/src/USER-QTB/fix_qbmsst.cpp index 283a4a5b41..7e442aceba 100644 --- a/src/USER-QTB/fix_qbmsst.cpp +++ b/src/USER-QTB/fix_qbmsst.cpp @@ -1064,7 +1064,7 @@ double FixQBMSST::compute_egrand() ekin = temperature->compute_scalar(); ekin *= 0.5 * temperature->dof * force->boltz; ecouple = compute_scalar(); - etot = epot + ekin + econserve; + etot = epot + ekin + ecouple; return etot; } From bca3164fc42353e5ba00f2a80ee10be037e4ddca Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 26 Jan 2021 18:39:02 -0500 Subject: [PATCH 067/384] fix whitespace issues --- doc/src/Developer_notes.rst | 2 +- doc/src/fix_modify.rst | 2 +- doc/src/thermo_style.rst | 2 +- src/KSPACE/pppm_dipole.cpp | 100 ++++++++++++------------ src/KSPACE/pppm_disp.cpp | 50 ++++++------ src/RIGID/fix_rigid_nh.cpp | 2 +- src/USER-BOCS/compute_pressure_bocs.cpp | 8 +- src/USER-BOCS/fix_bocs.cpp | 2 +- src/USER-COLVARS/fix_colvars.cpp | 2 +- src/USER-DRUDE/fix_tgnh_drude.cpp | 2 +- src/USER-MISC/fix_flow_gauss.cpp | 6 +- src/USER-MISC/fix_ti_spring.cpp | 2 +- src/USER-MISC/fix_wall_region_ees.cpp | 4 +- src/USER-PLUMED/fix_plumed.cpp | 2 +- src/USER-QTB/fix_qbmsst.cpp | 6 +- src/USER-QTB/fix_qtb.cpp | 2 +- src/fix.cpp | 4 +- src/fix.h | 2 +- src/fix_nh.cpp | 2 +- src/fix_wall.cpp | 2 +- 20 files changed, 102 insertions(+), 102 deletions(-) diff --git a/doc/src/Developer_notes.rst b/doc/src/Developer_notes.rst index 81161fa348..d4fee7b9a0 100644 --- a/doc/src/Developer_notes.rst +++ b/doc/src/Developer_notes.rst @@ -57,7 +57,7 @@ value of 1 in their constructor: * *energy_peratom_flag* to contribute to peratom energy, :doc:`fix cmap ` * *virial_global_flag* to contribute to global virial, example: :doc:`fix wall ` * *virial_peratom_flag* to contribute to peratom virial, example: :doc:`fix wall ` - + The fix must also do the following: * For global energy, implement a compute_scalar() method that returns diff --git a/doc/src/fix_modify.rst b/doc/src/fix_modify.rst index d382d3ebe8..3f97b158e2 100644 --- a/doc/src/fix_modify.rst +++ b/doc/src/fix_modify.rst @@ -86,7 +86,7 @@ appropriate fix. For most fixes that suppport the *energy* keyword, the default setting is *no*. For a few it is *yes*, when a user would expect that to be the case. The doc page of each fix gives the default. - + The *virial* keyword can be used with fixes that support it, which is explained at the bottom of their doc page. *Virial yes* will add a contribution to the virial of the system. More specifically, the diff --git a/doc/src/thermo_style.rst b/doc/src/thermo_style.rst index c43bf9ed0d..ac53e575e5 100644 --- a/doc/src/thermo_style.rst +++ b/doc/src/thermo_style.rst @@ -298,7 +298,7 @@ thermostatting or barostatting to their coupling reservoirs. I.e. it is *pe* + *ke* + *econserve*\ . Ideally, for a simulation in the NVE, NPH, or NPT ensembles, the *econserve* quantity should remain constant over time. - + The *fmax* and *fnorm* keywords are useful for monitoring the progress of an :doc:`energy minimization `. The *fmax* keyword calculates the maximum force in any dimension on any atom in the diff --git a/src/KSPACE/pppm_dipole.cpp b/src/KSPACE/pppm_dipole.cpp index 7a472be818..54810158aa 100644 --- a/src/KSPACE/pppm_dipole.cpp +++ b/src/KSPACE/pppm_dipole.cpp @@ -463,7 +463,7 @@ void PPPMDipole::compute(int eflag, int vflag) if (evflag_atom) gc_dipole->forward_comm_kspace(this,18,sizeof(FFT_SCALAR),FORWARD_MU_PERATOM, - gc_buf1,gc_buf2,MPI_FFT_SCALAR); + gc_buf1,gc_buf2,MPI_FFT_SCALAR); // calculate the force on my particles @@ -1333,7 +1333,7 @@ void PPPMDipole::poisson_ik_dipole() wimg = (work1[n+1]*fkx[i] + work2[n+1]*fky[j] + work3[n+1]*fkz[k]); energy += s2 * greensfn[ii] * (wreal*wreal + wimg*wimg); - ii++; + ii++; n += 2; } } @@ -1430,9 +1430,9 @@ void PPPMDipole::poisson_ik_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = -fkx[i]*fkx[i]*(work1[n+1]*fkx[i] + - work2[n+1]*fky[j] + work3[n+1]*fkz[k]); + work2[n+1]*fky[j] + work3[n+1]*fkz[k]); work4[n+1] = fkx[i]*fkx[i]*(work1[n]*fkx[i] + - work2[n]*fky[j] + work3[n]*fkz[k]); + work2[n]*fky[j] + work3[n]*fkz[k]); n += 2; } @@ -1453,9 +1453,9 @@ void PPPMDipole::poisson_ik_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = -fky[j]*fky[j]*(work1[n+1]*fkx[i] + - work2[n+1]*fky[j] + work3[n+1]*fkz[k]); + work2[n+1]*fky[j] + work3[n+1]*fkz[k]); work4[n+1] = fky[j]*fky[j]*(work1[n]*fkx[i] + - work2[n]*fky[j] + work3[n]*fkz[k]); + work2[n]*fky[j] + work3[n]*fkz[k]); n += 2; } @@ -1476,9 +1476,9 @@ void PPPMDipole::poisson_ik_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = -fkz[k]*fkz[k]*(work1[n+1]*fkx[i] + - work2[n+1]*fky[j] + work3[n+1]*fkz[k]); + work2[n+1]*fky[j] + work3[n+1]*fkz[k]); work4[n+1] = fkz[k]*fkz[k]*(work1[n]*fkx[i] + - work2[n]*fky[j] + work3[n]*fkz[k]); + work2[n]*fky[j] + work3[n]*fkz[k]); n += 2; } @@ -1499,9 +1499,9 @@ void PPPMDipole::poisson_ik_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = -fkx[i]*fky[j]*(work1[n+1]*fkx[i] + - work2[n+1]*fky[j] + work3[n+1]*fkz[k]); + work2[n+1]*fky[j] + work3[n+1]*fkz[k]); work4[n+1] = fkx[i]*fky[j]*(work1[n]*fkx[i] + - work2[n]*fky[j] + work3[n]*fkz[k]); + work2[n]*fky[j] + work3[n]*fkz[k]); n += 2; } @@ -1522,9 +1522,9 @@ void PPPMDipole::poisson_ik_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = -fkx[i]*fkz[k]*(work1[n+1]*fkx[i] + - work2[n+1]*fky[j] + work3[n+1]*fkz[k]); + work2[n+1]*fky[j] + work3[n+1]*fkz[k]); work4[n+1] = fkx[i]*fkz[k]*(work1[n]*fkx[i] + - work2[n]*fky[j] + work3[n]*fkz[k]); + work2[n]*fky[j] + work3[n]*fkz[k]); n += 2; } @@ -1545,9 +1545,9 @@ void PPPMDipole::poisson_ik_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = -fky[j]*fkz[k]*(work1[n+1]*fkx[i] + - work2[n+1]*fky[j] + work3[n+1]*fkz[k]); + work2[n+1]*fky[j] + work3[n+1]*fkz[k]); work4[n+1] = fky[j]*fkz[k]*(work1[n]*fkx[i] + - work2[n]*fky[j] + work3[n]*fkz[k]); + work2[n]*fky[j] + work3[n]*fkz[k]); n += 2; } @@ -1582,9 +1582,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fkx[i]*(vg[ii][0]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fkx[i]*work1[n]); + work3[n]*fkz[k]) + 2.0*fkx[i]*work1[n]); work4[n+1] = fkx[i]*(vg[ii][0]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fkx[i]*work1[n+1]); + work3[n+1]*fkz[k]) + 2.0*fkx[i]*work1[n+1]); n += 2; ii++; } @@ -1607,9 +1607,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fky[j]*(vg[ii][0]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fkx[i]*work1[n]); + work3[n]*fkz[k]) + 2.0*fkx[i]*work1[n]); work4[n+1] = fky[j]*(vg[ii][0]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fkx[i]*work1[n+1]); + work3[n+1]*fkz[k]) + 2.0*fkx[i]*work1[n+1]); n += 2; ii++; } @@ -1632,9 +1632,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fkz[k]*(vg[ii][0]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fkx[i]*work1[n]); + work3[n]*fkz[k]) + 2.0*fkx[i]*work1[n]); work4[n+1] = fkz[k]*(vg[ii][0]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fkx[i]*work1[n+1]); + work3[n+1]*fkz[k]) + 2.0*fkx[i]*work1[n+1]); n += 2; ii++; } @@ -1657,9 +1657,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fkx[i]*(vg[ii][1]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fky[j]*work2[n]); + work3[n]*fkz[k]) + 2.0*fky[j]*work2[n]); work4[n+1] = fkx[i]*(vg[ii][1]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fky[j]*work2[n+1]); + work3[n+1]*fkz[k]) + 2.0*fky[j]*work2[n+1]); n += 2; ii++; } @@ -1682,9 +1682,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fky[j]*(vg[ii][1]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fky[j]*work2[n]); + work3[n]*fkz[k]) + 2.0*fky[j]*work2[n]); work4[n+1] = fky[j]*(vg[ii][1]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fky[j]*work2[n+1]); + work3[n+1]*fkz[k]) + 2.0*fky[j]*work2[n+1]); n += 2; ii++; } @@ -1707,9 +1707,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fkz[k]*(vg[ii][1]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fky[j]*work2[n]); + work3[n]*fkz[k]) + 2.0*fky[j]*work2[n]); work4[n+1] = fkz[k]*(vg[ii][1]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fky[j]*work2[n+1]); + work3[n+1]*fkz[k]) + 2.0*fky[j]*work2[n+1]); n += 2; ii++; } @@ -1732,9 +1732,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fkx[i]*(vg[ii][2]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fkz[k]*work3[n]); + work3[n]*fkz[k]) + 2.0*fkz[k]*work3[n]); work4[n+1] = fkx[i]*(vg[ii][2]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fkz[k]*work3[n+1]); + work3[n+1]*fkz[k]) + 2.0*fkz[k]*work3[n+1]); n += 2; ii++; } @@ -1757,9 +1757,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fky[j]*(vg[ii][2]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fkz[k]*work3[n]); + work3[n]*fkz[k]) + 2.0*fkz[k]*work3[n]); work4[n+1] = fky[j]*(vg[ii][2]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fkz[k]*work3[n+1]); + work3[n+1]*fkz[k]) + 2.0*fkz[k]*work3[n+1]); n += 2; ii++; } @@ -1782,9 +1782,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fkz[k]*(vg[ii][2]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fkz[k]*work3[n]); + work3[n]*fkz[k]) + 2.0*fkz[k]*work3[n]); work4[n+1] = fkz[k]*(vg[ii][2]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fkz[k]*work3[n+1]); + work3[n+1]*fkz[k]) + 2.0*fkz[k]*work3[n+1]); n += 2; ii++; } @@ -1807,9 +1807,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fkx[i]*(vg[ii][3]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fky[j]*work1[n]); + work3[n]*fkz[k]) + 2.0*fky[j]*work1[n]); work4[n+1] = fkx[i]*(vg[ii][3]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fky[j]*work1[n+1]); + work3[n+1]*fkz[k]) + 2.0*fky[j]*work1[n+1]); n += 2; ii++; } @@ -1832,9 +1832,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fky[j]*(vg[ii][3]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fky[j]*work1[n]); + work3[n]*fkz[k]) + 2.0*fky[j]*work1[n]); work4[n+1] = fky[j]*(vg[ii][3]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fky[j]*work1[n+1]); + work3[n+1]*fkz[k]) + 2.0*fky[j]*work1[n+1]); n += 2; ii++; } @@ -1857,9 +1857,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fkz[k]*(vg[ii][3]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fky[j]*work1[n]); + work3[n]*fkz[k]) + 2.0*fky[j]*work1[n]); work4[n+1] = fkz[k]*(vg[ii][3]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fky[j]*work1[n+1]); + work3[n+1]*fkz[k]) + 2.0*fky[j]*work1[n+1]); n += 2; ii++; } @@ -1882,9 +1882,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fkx[i]*(vg[ii][4]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fkz[k]*work1[n]); + work3[n]*fkz[k]) + 2.0*fkz[k]*work1[n]); work4[n+1] = fkx[i]*(vg[ii][4]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fkz[k]*work1[n+1]); + work3[n+1]*fkz[k]) + 2.0*fkz[k]*work1[n+1]); n += 2; ii++; } @@ -1907,9 +1907,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fky[j]*(vg[ii][4]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fkz[k]*work1[n]); + work3[n]*fkz[k]) + 2.0*fkz[k]*work1[n]); work4[n+1] = fky[j]*(vg[ii][4]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fkz[k]*work1[n+1]); + work3[n+1]*fkz[k]) + 2.0*fkz[k]*work1[n+1]); n += 2; ii++; } @@ -1932,9 +1932,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fkz[k]*(vg[ii][4]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fkz[k]*work1[n]); + work3[n]*fkz[k]) + 2.0*fkz[k]*work1[n]); work4[n+1] = fkz[k]*(vg[ii][4]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fkz[k]*work1[n+1]); + work3[n+1]*fkz[k]) + 2.0*fkz[k]*work1[n+1]); n += 2; ii++; } @@ -1957,9 +1957,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fkx[i]*(vg[ii][5]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fkz[k]*work2[n]); + work3[n]*fkz[k]) + 2.0*fkz[k]*work2[n]); work4[n+1] = fkx[i]*(vg[ii][5]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fkz[k]*work2[n+1]); + work3[n+1]*fkz[k]) + 2.0*fkz[k]*work2[n+1]); n += 2; ii++; } @@ -1982,9 +1982,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fky[j]*(vg[ii][5]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fkz[k]*work2[n]); + work3[n]*fkz[k]) + 2.0*fkz[k]*work2[n]); work4[n+1] = fky[j]*(vg[ii][5]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fkz[k]*work2[n+1]); + work3[n+1]*fkz[k]) + 2.0*fkz[k]*work2[n+1]); n += 2; ii++; } @@ -2007,9 +2007,9 @@ void PPPMDipole::poisson_peratom_dipole() for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { work4[n] = fkz[k]*(vg[ii][5]*(work1[n]*fkx[i] + work2[n]*fky[j] + - work3[n]*fkz[k]) + 2.0*fkz[k]*work2[n]); + work3[n]*fkz[k]) + 2.0*fkz[k]*work2[n]); work4[n+1] = fkz[k]*(vg[ii][5]*(work1[n+1]*fkx[i] + work2[n+1]*fky[j] + - work3[n+1]*fkz[k]) + 2.0*fkz[k]*work2[n+1]); + work3[n+1]*fkz[k]) + 2.0*fkz[k]*work2[n+1]); n += 2; ii++; } diff --git a/src/KSPACE/pppm_disp.cpp b/src/KSPACE/pppm_disp.cpp index a9af0aff40..d982d57853 100644 --- a/src/KSPACE/pppm_disp.cpp +++ b/src/KSPACE/pppm_disp.cpp @@ -689,9 +689,9 @@ void PPPMDisp::setup() vg[n][3] = 0.0; vg[n][4] = 0.0; vg[n][5] = 0.0; - vg2[n][0] = 0.0; - vg2[n][1] = 0.0; - vg2[n][2] = 0.0; + vg2[n][0] = 0.0; + vg2[n][1] = 0.0; + vg2[n][2] = 0.0; } else { vterm = -2.0 * (1.0/sqk + 0.25*gew2inv); vg[n][0] = 1.0 + vterm*fkx[i]*fkx[i]; @@ -1048,7 +1048,7 @@ void PPPMDisp::compute(int eflag, int vflag) make_rho_a(); gc6->reverse_comm_kspace(this,7,sizeof(FFT_SCALAR),REVERSE_RHO_ARITH, - gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); brick2fft_a(); @@ -1143,7 +1143,7 @@ void PPPMDisp::compute(int eflag, int vflag) make_rho_none(); gc6->reverse_comm_kspace(this,nsplit_alloc,sizeof(FFT_SCALAR),REVERSE_RHO_NONE, - gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); brick2fft_none(); @@ -1158,14 +1158,14 @@ void PPPMDisp::compute(int eflag, int vflag) } gc6->forward_comm_kspace(this,1*nsplit_alloc,sizeof(FFT_SCALAR), - FORWARD_AD_NONE, + FORWARD_AD_NONE, gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); fieldforce_none_ad(); if (vflag_atom) gc6->forward_comm_kspace(this,6*nsplit_alloc,sizeof(FFT_SCALAR), - FORWARD_AD_PERATOM_NONE, + FORWARD_AD_PERATOM_NONE, gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); } else { @@ -1180,14 +1180,14 @@ void PPPMDisp::compute(int eflag, int vflag) } gc6->forward_comm_kspace(this,3*nsplit_alloc,sizeof(FFT_SCALAR), - FORWARD_IK_NONE, + FORWARD_IK_NONE, gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); fieldforce_none_ik(); if (evflag_atom) gc6->forward_comm_kspace(this,7*nsplit_alloc,sizeof(FFT_SCALAR), - FORWARD_IK_PERATOM_NONE, + FORWARD_IK_PERATOM_NONE, gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); } @@ -1321,7 +1321,7 @@ void PPPMDisp::init_coeffs() converged = qr_alg(A,Q,n); if (function[3] && !converged) { error->all(FLERR, - "Matrix factorization to split dispersion coefficients failed"); + "Matrix factorization to split dispersion coefficients failed"); } // determine number of used eigenvalues @@ -1409,8 +1409,8 @@ void PPPMDisp::init_coeffs() utils::logmesg(lmp,fmt::format(" Using {} structure factors\n", nsplit)); if (nsplit > 9) - error->warning(FLERR,"Simulations might be very slow " - "because of large number of structure factors"); + error->warning(FLERR,"Simulations might be very slow " + "because of large number of structure factors"); } memory->destroy(A); @@ -4564,11 +4564,11 @@ void PPPMDisp::make_rho_none() my = m+ny; x0 = y0*rho1d_6[1][m]; for (l = nlower_6; l <= nupper_6; l++) { - mx = l+nx; + mx = l+nx; w = x0*rho1d_6[0][l]; for (k = 0; k < nsplit; k++) { density_brick_none[k][mz][my][mx] += w*B[nsplit*type + k]; - } + } } } } @@ -4813,13 +4813,13 @@ void PPPMDisp::poisson_ad(FFT_SCALAR* wk1, FFT_SCALAR* wk2, ------------------------------------------------------------------------- */ void PPPMDisp::poisson_peratom(FFT_SCALAR* wk1, FFT_SCALAR* wk2, LAMMPS_NS::FFT3d* ft2, - double** vcoeff, double** vcoeff2, int nft, - int nxlo_i, int nylo_i, int nzlo_i, - int nxhi_i, int nyhi_i, int nzhi_i, - FFT_SCALAR*** v0_pa, FFT_SCALAR*** v1_pa, - FFT_SCALAR*** v2_pa, - FFT_SCALAR*** v3_pa, FFT_SCALAR*** v4_pa, - FFT_SCALAR*** v5_pa) + double** vcoeff, double** vcoeff2, int nft, + int nxlo_i, int nylo_i, int nzlo_i, + int nxhi_i, int nyhi_i, int nzhi_i, + FFT_SCALAR*** v0_pa, FFT_SCALAR*** v1_pa, + FFT_SCALAR*** v2_pa, + FFT_SCALAR*** v3_pa, FFT_SCALAR*** v4_pa, + FFT_SCALAR*** v5_pa) { // v0 & v1 term @@ -5227,8 +5227,8 @@ poisson_none_ik(int n1, int n2,FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, if (vflag_atom) poisson_none_peratom(n1,n2, - v0_pa[n1],v1_pa[n1],v2_pa[n1],v3_pa[n1],v4_pa[n1],v5_pa[n1], - v0_pa[n2],v1_pa[n2],v2_pa[n2],v3_pa[n2],v4_pa[n2],v5_pa[n2]); + v0_pa[n1],v1_pa[n1],v2_pa[n1],v3_pa[n1],v4_pa[n1],v5_pa[n1], + v0_pa[n2],v1_pa[n2],v2_pa[n2],v3_pa[n2],v4_pa[n2],v5_pa[n2]); } /* ---------------------------------------------------------------------- @@ -5429,8 +5429,8 @@ poisson_none_ad(int n1, int n2, FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, if (vflag_atom) poisson_none_peratom(n1,n2, - v0_pa[n1],v1_pa[n1],v2_pa[n1],v3_pa[n1],v4_pa[n1],v5_pa[n1], - v0_pa[n2],v1_pa[n2],v2_pa[n2],v3_pa[n2],v4_pa[n2],v5_pa[n2]); + v0_pa[n1],v1_pa[n1],v2_pa[n1],v3_pa[n1],v4_pa[n1],v5_pa[n1], + v0_pa[n2],v1_pa[n2],v2_pa[n2],v3_pa[n2],v4_pa[n2],v5_pa[n2]); } /* ---------------------------------------------------------------------- diff --git a/src/RIGID/fix_rigid_nh.cpp b/src/RIGID/fix_rigid_nh.cpp index 7fefdaebfe..a29c8d9863 100644 --- a/src/RIGID/fix_rigid_nh.cpp +++ b/src/RIGID/fix_rigid_nh.cpp @@ -50,7 +50,7 @@ FixRigidNH::FixRigidNH(LAMMPS *lmp, int narg, char **arg) : id_press(nullptr), temperature(nullptr), pressure(nullptr) { if (tstat_flag || pstat_flag) ecouple_flag = 1; - + // error checks: could be moved up to FixRigid if ((p_flag[0] == 1 && p_period[0] <= 0.0) || diff --git a/src/USER-BOCS/compute_pressure_bocs.cpp b/src/USER-BOCS/compute_pressure_bocs.cpp index 004a11d048..a84442e658 100644 --- a/src/USER-BOCS/compute_pressure_bocs.cpp +++ b/src/USER-BOCS/compute_pressure_bocs.cpp @@ -231,7 +231,7 @@ double ComputePressureBocs::find_index(double * grid, double value) ------------------------------------------------------------------------- */ double ComputePressureBocs::get_cg_p_corr(double ** grid, int basis_type, - double vCG) + double vCG) { int i = find_index(grid[0],vCG); double correction, deltax = vCG - grid[0][i]; @@ -259,8 +259,8 @@ double ComputePressureBocs::get_cg_p_corr(double ** grid, int basis_type, ------------------------------------------------------------------------- */ void ComputePressureBocs::send_cg_info(int basis_type, int sent_N_basis, - double *sent_phi_coeff, int sent_N_mol, - double sent_vavg) + double *sent_phi_coeff, int sent_N_mol, + double sent_vavg) { if (basis_type == BASIS_ANALYTIC) { p_basis_type = BASIS_ANALYTIC; } else @@ -285,7 +285,7 @@ void ComputePressureBocs::send_cg_info(int basis_type, int sent_N_basis, ------------------------------------------------------------------------- */ void ComputePressureBocs::send_cg_info(int basis_type, - double ** in_splines, int gridsize) + double ** in_splines, int gridsize) { if (basis_type == BASIS_LINEAR_SPLINE) { p_basis_type = BASIS_LINEAR_SPLINE; } else if (basis_type == BASIS_CUBIC_SPLINE) { p_basis_type = BASIS_CUBIC_SPLINE; } diff --git a/src/USER-BOCS/fix_bocs.cpp b/src/USER-BOCS/fix_bocs.cpp index 3df1cc2bd3..28a0d6c01a 100644 --- a/src/USER-BOCS/fix_bocs.cpp +++ b/src/USER-BOCS/fix_bocs.cpp @@ -88,7 +88,7 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; extvector = 0; ecouple_flag = 1; - + // default values pcouple = NONE; diff --git a/src/USER-COLVARS/fix_colvars.cpp b/src/USER-COLVARS/fix_colvars.cpp index 4bcd68dae9..1a8338ccf6 100644 --- a/src/USER-COLVARS/fix_colvars.cpp +++ b/src/USER-COLVARS/fix_colvars.cpp @@ -299,7 +299,7 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; restart_global = 1; energy_global_flag = 1; - + me = comm->me; root2root = MPI_COMM_NULL; diff --git a/src/USER-DRUDE/fix_tgnh_drude.cpp b/src/USER-DRUDE/fix_tgnh_drude.cpp index ee47d8a0d9..8185b9bcbb 100644 --- a/src/USER-DRUDE/fix_tgnh_drude.cpp +++ b/src/USER-DRUDE/fix_tgnh_drude.cpp @@ -67,7 +67,7 @@ FixTGNHDrude::FixTGNHDrude(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; extvector = 0; ecouple_flag = 1; - + // default values pcouple = NONE; diff --git a/src/USER-MISC/fix_flow_gauss.cpp b/src/USER-MISC/fix_flow_gauss.cpp index f5cbeaeed5..3c913f8039 100644 --- a/src/USER-MISC/fix_flow_gauss.cpp +++ b/src/USER-MISC/fix_flow_gauss.cpp @@ -82,7 +82,7 @@ FixFlowGauss::FixFlowGauss(LAMMPS *lmp, int narg, char **arg) : } // by default, do not compute work done - + workflag=0; // process optional keyword @@ -137,11 +137,11 @@ void FixFlowGauss::init() void FixFlowGauss::setup(int vflag) { // need to compute work done if fix_modify energy yes is set - + if (thermo_energy) workflag = 1; // get total mass of group - + mTot=group->mass(igroup); if (mTot <= 0.0) error->all(FLERR,"Invalid group mass in fix flow/gauss"); diff --git a/src/USER-MISC/fix_ti_spring.cpp b/src/USER-MISC/fix_ti_spring.cpp index 9e6c1ce296..cb343fc9d6 100644 --- a/src/USER-MISC/fix_ti_spring.cpp +++ b/src/USER-MISC/fix_ti_spring.cpp @@ -65,7 +65,7 @@ FixTISpring::FixTISpring(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; extvector = 1; energy_global_flag = 1; - + // disallow resetting the time step, while this fix is defined time_depend = 1; diff --git a/src/USER-MISC/fix_wall_region_ees.cpp b/src/USER-MISC/fix_wall_region_ees.cpp index 7fe3ab24a3..44067b0742 100644 --- a/src/USER-MISC/fix_wall_region_ees.cpp +++ b/src/USER-MISC/fix_wall_region_ees.cpp @@ -38,7 +38,7 @@ FixWallRegionEES::FixWallRegionEES(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg != 7) error->all(FLERR,"Illegal fix wall/region/ees command"); - + scalar_flag = 1; vector_flag = 1; size_vector = 3; @@ -46,7 +46,7 @@ FixWallRegionEES::FixWallRegionEES(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; extvector = 1; energy_global_flag = 1; - + // parse args iregion = domain->find_region(arg[3]); diff --git a/src/USER-PLUMED/fix_plumed.cpp b/src/USER-PLUMED/fix_plumed.cpp index cd6292d64e..5e85cc56de 100644 --- a/src/USER-PLUMED/fix_plumed.cpp +++ b/src/USER-PLUMED/fix_plumed.cpp @@ -213,7 +213,7 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; energy_global_flag = virial_global_flag = 1; thermo_energy = thermo_virial = 1; - + // This is the real initialization: p->cmd("init"); diff --git a/src/USER-QTB/fix_qbmsst.cpp b/src/USER-QTB/fix_qbmsst.cpp index 7e442aceba..fea549c07e 100644 --- a/src/USER-QTB/fix_qbmsst.cpp +++ b/src/USER-QTB/fix_qbmsst.cpp @@ -63,7 +63,7 @@ FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) error->all(FLERR,"Illegal fix qbmsst command"); // default parameters - + global_freq = 1; extscalar = 1; extvector = 0; @@ -74,7 +74,7 @@ FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) vector_flag = 1; size_vector = 5; ecouple_flag = 1; - + qmass = 1.0e1; mu = 0.0; p0 = 0.0; @@ -95,7 +95,7 @@ FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) qtb_set = 0; // reading parameters - + int iarg = 5; while (iarg < narg) { if (strcmp(arg[iarg],"q") == 0) { diff --git a/src/USER-QTB/fix_qtb.cpp b/src/USER-QTB/fix_qtb.cpp index 761a0ed537..a344a5eaec 100644 --- a/src/USER-QTB/fix_qtb.cpp +++ b/src/USER-QTB/fix_qtb.cpp @@ -46,7 +46,7 @@ FixQTB::FixQTB(LAMMPS *lmp, int narg, char **arg) : if (narg < 3) error->all(FLERR,"Illegal fix qtb command"); // default parameters - + t_target = 300.0; t_period = 1.0; fric_coef = 1/t_period; diff --git a/src/fix.cpp b/src/fix.cpp index 074040a4d8..8cf13f6f1d 100644 --- a/src/fix.cpp +++ b/src/fix.cpp @@ -152,7 +152,7 @@ void Fix::modify_params(int narg, char **arg) if (strcmp(arg[iarg+1],"no") == 0) thermo_energy = 0; else if (strcmp(arg[iarg+1],"yes") == 0) { if (energy_global_flag == 0 && energy_peratom_flag == 0) - error->all(FLERR,"Illegal fix_modify command"); + error->all(FLERR,"Illegal fix_modify command"); thermo_energy = 1; } else error->all(FLERR,"Illegal fix_modify command"); iarg += 2; @@ -161,7 +161,7 @@ void Fix::modify_params(int narg, char **arg) if (strcmp(arg[iarg+1],"no") == 0) thermo_virial = 0; else if (strcmp(arg[iarg+1],"yes") == 0) { if (virial_global_flag == 0 && virial_peratom_flag == 0) - error->all(FLERR,"Illegal fix_modify command"); + error->all(FLERR,"Illegal fix_modify command"); thermo_virial = 1; } else error->all(FLERR,"Illegal fix_modify command"); iarg += 2; diff --git a/src/fix.h b/src/fix.h index c8db215255..7092b56c8f 100644 --- a/src/fix.h +++ b/src/fix.h @@ -245,7 +245,7 @@ class Fix : protected Pointers { void ev_init(int eflag, int vflag) { if ((eflag && thermo_energy) || (vflag && thermo_virial)) ev_setup(eflag, vflag); else evflag = eflag_either = eflag_global = eflag_atom = - vflag_either = vflag_global = vflag_atom = 0; + vflag_either = vflag_global = vflag_atom = 0; } void ev_setup(int, int); void ev_tally(int, int *, double, double, double *); diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index f4de07a5ae..d1a2cb1463 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -786,7 +786,7 @@ void FixNH::setup(int /*vflag*/) t0 = temperature->compute_scalar(); if (t0 < EPSILON) error->all(FLERR,"Current temperature too close to zero, " - "consider using ptemp setting"); + "consider using ptemp setting"); } } t_target = t0; diff --git a/src/fix_wall.cpp b/src/fix_wall.cpp index 942dd1f81a..56bc91e5f6 100644 --- a/src/fix_wall.cpp +++ b/src/fix_wall.cpp @@ -315,7 +315,7 @@ void FixWall::post_force(int vflag) v_init(vflag); // energy intialize - + for (int m = 0; m <= nwall; m++) ewall[m] = 0.0; // coord = current position of wall From 1312a76dec2413ac9cc7643c3bd3e57ad8058cd1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 29 Jan 2021 15:32:19 -0500 Subject: [PATCH 068/384] eliminate use of strtok() by using ValueTokenizer class --- src/MLIAP/mliap_model.cpp | 43 ++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/MLIAP/mliap_model.cpp b/src/MLIAP/mliap_model.cpp index aa198e6085..882f64263f 100644 --- a/src/MLIAP/mliap_model.cpp +++ b/src/MLIAP/mliap_model.cpp @@ -20,6 +20,7 @@ #include "comm.h" #include "error.h" #include "memory.h" +#include "tokenizer.h" #include @@ -30,7 +31,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -MLIAPModel::MLIAPModel(LAMMPS* lmp, char* coefffilename) : Pointers(lmp) +MLIAPModel::MLIAPModel(LAMMPS *lmp, char *) : Pointers(lmp) { nparams = 0; nelements = 0; @@ -44,7 +45,6 @@ MLIAPModel::~MLIAPModel() { } - /* ---------------------------------------------------------------------- placeholder ------------------------------------------------------------------------- */ @@ -74,7 +74,7 @@ void MLIAPModel::set_ndescriptors(int ndescriptors_in) /* ---------------------------------------------------------------------- */ -MLIAPModelSimple::MLIAPModelSimple(LAMMPS* lmp, char* coefffilename) : MLIAPModel(lmp, coefffilename) +MLIAPModelSimple::MLIAPModelSimple(LAMMPS *lmp, char *coefffilename) : MLIAPModel(lmp, coefffilename) { coeffelem = nullptr; if (coefffilename) read_coeffs(coefffilename); @@ -87,6 +87,7 @@ MLIAPModelSimple::~MLIAPModelSimple() memory->destroy(coeffelem); } +/* ---------------------------------------------------------------------- */ void MLIAPModelSimple::read_coeffs(char *coefffilename) { @@ -130,14 +131,14 @@ void MLIAPModelSimple::read_coeffs(char *coefffilename) // words = ptrs to all words in line // strip single and double quotes from words - char* words[MAXWORD]; - int iword = 0; - words[iword] = strtok(line,"' \t\n\r\f"); - iword = 1; - words[iword] = strtok(nullptr,"' \t\n\r\f"); - - nelements = atoi(words[0]); - nparams = atoi(words[1]); + try { + ValueTokenizer coeffs(line); + nelements = coeffs.next_int(); + nparams = coeffs.next_int(); + } catch (TokenizerException &e) { + error->all(FLERR,fmt::format("Incorrect format in MLIAPModel coefficient " + "file: {}",e.what())); + } // set up coeff lists @@ -157,19 +158,19 @@ void MLIAPModelSimple::read_coeffs(char *coefffilename) MPI_Bcast(&eof,1,MPI_INT,0,world); if (eof) - error->all(FLERR,"Incorrect format in coefficient file"); + error->all(FLERR,"Incorrect format in MLIAPModel coefficient file"); MPI_Bcast(&n,1,MPI_INT,0,world); MPI_Bcast(line,n,MPI_CHAR,0,world); - nwords = utils::trim_and_count_words(line); - if (nwords != 1) - error->all(FLERR,"Incorrect format in coefficient file"); - - iword = 0; - words[iword] = strtok(line,"' \t\n\r\f"); - - coeffelem[ielem][icoeff] = atof(words[0]); - + try { + ValueTokenizer coeffs(utils::trim_comment(line)); + if (coeffs.count() != 1) + throw TokenizerException("Wrong number of items",""); + coeffelem[ielem][icoeff] = coeffs.next_double(); + } catch (TokenizerException &e) { + error->all(FLERR,fmt::format("Incorrect format in MLIAPModel " + "coefficient file: {}",e.what())); + } } } From 461364c0060b7f00b48b17d486a54e629450b7ed Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 29 Jan 2021 15:50:26 -0500 Subject: [PATCH 069/384] silence compiler warnings --- src/MLIAP/mliap_model_python.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/MLIAP/mliap_model_python.cpp b/src/MLIAP/mliap_model_python.cpp index 823cee711f..4dda7df357 100644 --- a/src/MLIAP/mliap_model_python.cpp +++ b/src/MLIAP/mliap_model_python.cpp @@ -87,7 +87,7 @@ int MLIAPModelPython::get_nparams() return nparams; } -void MLIAPModelPython::read_coeffs(char * fname) +void MLIAPModelPython::read_coeffs(char *fname) { PyGILState_STATE gstate = PyGILState_Ensure(); @@ -134,7 +134,7 @@ void MLIAPModelPython::connect_param_counts() for each atom beta_i = dE(B_i)/dB_i ---------------------------------------------------------------------- */ -void MLIAPModelPython::compute_gradients(MLIAPData* data) +void MLIAPModelPython::compute_gradients(MLIAPData *data) { if (not model_loaded) { error->all(FLERR,"Model not loaded."); @@ -167,7 +167,7 @@ void MLIAPModelPython::compute_gradients(MLIAPData* data) egradient is derivative of energy w.r.t. parameters ---------------------------------------------------------------------- */ -void MLIAPModelPython::compute_gradgrads(class MLIAPData* data) +void MLIAPModelPython::compute_gradgrads(class MLIAPData *) { error->all(FLERR,"compute_gradgrads not implemented"); } @@ -177,7 +177,7 @@ void MLIAPModelPython::compute_gradgrads(class MLIAPData* data) egradient is derivative of energy w.r.t. parameters ---------------------------------------------------------------------- */ -void MLIAPModelPython::compute_force_gradients(class MLIAPData* data) +void MLIAPModelPython::compute_force_gradients(class MLIAPData *) { error->all(FLERR,"compute_force_gradients not implemented"); } @@ -186,7 +186,7 @@ void MLIAPModelPython::compute_force_gradients(class MLIAPData* data) count the number of non-zero entries in gamma matrix ---------------------------------------------------------------------- */ -int MLIAPModelPython::get_gamma_nnz(class MLIAPData* data) +int MLIAPModelPython::get_gamma_nnz(class MLIAPData *) { // todo: get_gamma_nnz return 0; From a23e45cc0c5f01ac0a051cb2e884b56af8e61923 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 29 Jan 2021 15:50:33 -0500 Subject: [PATCH 070/384] remove dead code --- src/SPIN/pair_spin_exchange_biquadratic.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/SPIN/pair_spin_exchange_biquadratic.cpp b/src/SPIN/pair_spin_exchange_biquadratic.cpp index f2baf1333b..352949e5c3 100644 --- a/src/SPIN/pair_spin_exchange_biquadratic.cpp +++ b/src/SPIN/pair_spin_exchange_biquadratic.cpp @@ -474,7 +474,7 @@ double PairSpinExchangeBiquadratic::compute_energy(int i, int j, double rsq, int *type = atom->type; int itype,jtype; double Jex,Kex,ra,sdots; - double rj,rk,r2j,r2k,ir3j,ir3k; + double rj,rk,r2j,r2k; double energy = 0.0; itype = type[i]; jtype = type[j]; @@ -482,10 +482,8 @@ double PairSpinExchangeBiquadratic::compute_energy(int i, int j, double rsq, ra = sqrt(rsq); rj = ra/J3[itype][jtype]; r2j = rsq/J3[itype][jtype]/J3[itype][jtype]; - ir3j = 1.0/(rj*rj*rj); rk = ra/K3[itype][jtype]; r2k = rsq/K3[itype][jtype]/K3[itype][jtype]; - ir3k = 1.0/(rk*rk*rk); Jex = 4.0*J1_mech[itype][jtype]*r2j; Jex *= (1.0-J2[itype][jtype]*r2j); From 48fa5e6736827c7df7f3dd5398110015af38a6ba Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 29 Jan 2021 15:59:52 -0500 Subject: [PATCH 071/384] fix argument bug --- src/KOKKOS/atom_vec_dpd_kokkos.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KOKKOS/atom_vec_dpd_kokkos.cpp b/src/KOKKOS/atom_vec_dpd_kokkos.cpp index 8c1668a411..ad47b6f108 100644 --- a/src/KOKKOS/atom_vec_dpd_kokkos.cpp +++ b/src/KOKKOS/atom_vec_dpd_kokkos.cpp @@ -784,7 +784,7 @@ struct AtomVecDPDKokkos_PackBorder { _uCond(uCond), _uMech(uMech), _uChem(uChem), - _uCG(uCGnew), + _uCG(uCG), _uCGnew(uCGnew), _dx(dx),_dy(dy),_dz(dz) {} From 72b022c5fab61333ee157635a0ffdefba94ead95 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 29 Jan 2021 16:14:06 -0500 Subject: [PATCH 072/384] make implicit copy contructor explicit and thus silence compiler warnings --- src/USER-REAXC/reaxc_types.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/USER-REAXC/reaxc_types.h b/src/USER-REAXC/reaxc_types.h index f038f00bb0..36678ad2b0 100644 --- a/src/USER-REAXC/reaxc_types.h +++ b/src/USER-REAXC/reaxc_types.h @@ -862,14 +862,23 @@ struct cubic_spline_coef cubic_spline_coef() {} LAMMPS_INLINE - void operator = (const cubic_spline_coef& rhs) { + cubic_spline_coef(const cubic_spline_coef &_c) { + a = _c.a; + b = _c.b; + c = _c.c; + d = _c.d; + } + + LAMMPS_INLINE + void operator=(const cubic_spline_coef &rhs) { a = rhs.a; b = rhs.b; c = rhs.c; d = rhs.d; } + LAMMPS_INLINE - void operator = (const cubic_spline_coef& rhs) volatile { + void operator=(const cubic_spline_coef &rhs) volatile { a = rhs.a; b = rhs.b; c = rhs.c; From 95b445a25ae21fd1c77646a888011387c89869a1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 29 Jan 2021 18:38:33 -0500 Subject: [PATCH 073/384] must initialized has_exceptions to avoid false positives in unit tests --- unittest/python/python-open.py | 1 + 1 file changed, 1 insertion(+) diff --git a/unittest/python/python-open.py b/unittest/python/python-open.py index 6153e032e3..67500ea6fa 100644 --- a/unittest/python/python-open.py +++ b/unittest/python/python-open.py @@ -4,6 +4,7 @@ from lammps import lammps has_mpi=False has_mpi4py=False +has_exceptions=False try: from mpi4py import __version__ as mpi4py_version # tested to work with mpi4py versions 2 and 3 From 0e2b5283512039804461c7ab08f557891c14dc5b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 29 Jan 2021 18:40:24 -0500 Subject: [PATCH 074/384] add additional heuristics to prevent python unit tests from failing on MacOS --- python/lammps/core.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python/lammps/core.py b/python/lammps/core.py index fe23fa587c..6c1300ccf2 100644 --- a/python/lammps/core.py +++ b/python/lammps/core.py @@ -99,6 +99,7 @@ class lammps(object): # so that LD_LIBRARY_PATH does not need to be set for regular install # fall back to loading with a relative path, # typically requires LD_LIBRARY_PATH to be set appropriately + # guess shared library extension based on OS, if not inferred from actual file if any([f.startswith('liblammps') and f.endswith('.dylib') for f in os.listdir(modpath)]): @@ -111,7 +112,13 @@ class lammps(object): lib_ext = ".dll" modpath = winpath else: - lib_ext = ".so" + import platform + if platform.system() == "Darwin": + lib_ext = ".dylib" + elif platform.system() == "Windows": + lib_ext = ".dll" + else: + lib_ext = ".so" if not self.lib: try: From 065c4939ed405cfb888a50c35731533ae8f71336 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 29 Jan 2021 18:48:05 -0500 Subject: [PATCH 075/384] relax some unit test epsilons, so the tests pass on MacOS --- unittest/force-styles/tests/angle-quartic.yaml | 2 +- unittest/force-styles/tests/atomic-pair-reax_c_lgvdw.yaml | 2 +- unittest/force-styles/tests/fix-timestep-momentum.yaml | 2 +- unittest/force-styles/tests/fix-timestep-temp_csvr.yaml | 2 +- unittest/force-styles/tests/mol-pair-tip4p_table.yaml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/unittest/force-styles/tests/angle-quartic.yaml b/unittest/force-styles/tests/angle-quartic.yaml index 1ffa163732..912825d3a2 100644 --- a/unittest/force-styles/tests/angle-quartic.yaml +++ b/unittest/force-styles/tests/angle-quartic.yaml @@ -1,7 +1,7 @@ --- lammps_version: 24 Aug 2020 date_generated: Tue Sep 15 09:44:35 202 -epsilon: 2.5e-13 +epsilon: 4e-13 prerequisites: ! | atom full angle quartic diff --git a/unittest/force-styles/tests/atomic-pair-reax_c_lgvdw.yaml b/unittest/force-styles/tests/atomic-pair-reax_c_lgvdw.yaml index 90bfd15f3d..db4bb284fa 100644 --- a/unittest/force-styles/tests/atomic-pair-reax_c_lgvdw.yaml +++ b/unittest/force-styles/tests/atomic-pair-reax_c_lgvdw.yaml @@ -1,7 +1,7 @@ --- lammps_version: 24 Aug 2020 date_generated: Tue Sep 15 09:44:25 202 -epsilon: 1e-10 +epsilon: 2e-10 prerequisites: ! | pair reax/c fix qeq/reax diff --git a/unittest/force-styles/tests/fix-timestep-momentum.yaml b/unittest/force-styles/tests/fix-timestep-momentum.yaml index 884c71785d..96a3e9d4bb 100644 --- a/unittest/force-styles/tests/fix-timestep-momentum.yaml +++ b/unittest/force-styles/tests/fix-timestep-momentum.yaml @@ -1,7 +1,7 @@ --- lammps_version: 24 Aug 2020 date_generated: Tue Sep 15 09:44:40 202 -epsilon: 4e-14 +epsilon: 5e-14 prerequisites: ! | atom full fix momentum diff --git a/unittest/force-styles/tests/fix-timestep-temp_csvr.yaml b/unittest/force-styles/tests/fix-timestep-temp_csvr.yaml index d4f77f596c..8716de39de 100644 --- a/unittest/force-styles/tests/fix-timestep-temp_csvr.yaml +++ b/unittest/force-styles/tests/fix-timestep-temp_csvr.yaml @@ -1,7 +1,7 @@ --- lammps_version: 24 Aug 2020 date_generated: Tue Sep 15 09:44:43 202 -epsilon: 2e-14 +epsilon: 3e-14 prerequisites: ! | atom full fix temp/csvr diff --git a/unittest/force-styles/tests/mol-pair-tip4p_table.yaml b/unittest/force-styles/tests/mol-pair-tip4p_table.yaml index 9a1f5fccec..26e60777d2 100644 --- a/unittest/force-styles/tests/mol-pair-tip4p_table.yaml +++ b/unittest/force-styles/tests/mol-pair-tip4p_table.yaml @@ -1,7 +1,7 @@ --- lammps_version: 24 Aug 2020 date_generated: Tue Sep 15 09:44:20 202 -epsilon: 1e-13 +epsilon: 2.5e-13 prerequisites: ! | atom full pair tip4p/long From 10834321b04924d9cb560f2728fedc61f57a3d1b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 30 Jan 2021 00:49:57 -0500 Subject: [PATCH 076/384] ArgInfo class for simpler parsing of compute, fix, variable references --- src/arg_info.cpp | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ src/arg_info.h | 71 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 145 insertions(+) create mode 100644 src/arg_info.cpp create mode 100644 src/arg_info.h diff --git a/src/arg_info.cpp b/src/arg_info.cpp new file mode 100644 index 0000000000..2453d6df93 --- /dev/null +++ b/src/arg_info.cpp @@ -0,0 +1,74 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://lammps.sandia.gov/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "arg_info.h" + +#include +#include + +using namespace LAMMPS_NS; + +ArgInfo::ArgInfo(const std::string &arg, int allowed) + : type(NONE), dim(0), index1(-1), index2(-1) +{ + if ((arg.size() > 2) && (arg[1] == '_')) { + if ((arg[0] == 'c') && (allowed & COMPUTE)) type = COMPUTE; + else if ((arg[0] == 'f') && (allowed & FIX)) type = FIX; + else if ((arg[0] == 'v') && (allowed & VARIABLE)) type = VARIABLE; + else { + name = arg; + return; + } + + std::size_t has_idx1 = arg.find('[',2); + if (has_idx1 != std::string::npos) { + name = arg.substr(2,has_idx1-2); + dim = 1; + + std::size_t has_idx2 = arg.find('[',has_idx1+1); + if (has_idx2 != std::string::npos) { + dim = 2; + + if (arg[arg.size()-1] != ']') { + type = UNKNOWN; + } else { + try { + index2 = std::stoi(arg.substr(has_idx2+1,arg.size()-(has_idx2+2))); + } catch (std::invalid_argument &) { + type = UNKNOWN; + } + } + } else has_idx2 = arg.size(); + + if (arg[has_idx2-1] != ']') { + type = UNKNOWN; + } else { + try { + index1 = std::stoi(arg.substr(has_idx1+1,arg.size()-(has_idx2+2))); + } catch (std::invalid_argument &) { + type = UNKNOWN; + } + } + } else name = arg.substr(2); + } else name = arg; +} + +/* ---------------------------------------------------------------------- */ + +char *ArgInfo::copy_name() +{ + char *dest = new char[name.size()+1]; + strcpy(dest,name.c_str()); + return dest; +} + diff --git a/src/arg_info.h b/src/arg_info.h new file mode 100644 index 0000000000..ea1208c49b --- /dev/null +++ b/src/arg_info.h @@ -0,0 +1,71 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef LMP_ARG_INFO_H +#define LMP_ARG_INFO_H + +/*! \file arg_info.h */ + +#include + +namespace LAMMPS_NS { + class ArgInfo { + public: + enum { + ERROR =-2, + UNKNOWN =-1, + NONE = 0, + X = 1<<0, + V = 1<<1, + F = 1<<2, + COMPUTE = 1<<3, + FIX = 1<<4, + VARIABLE = 1<<5, + KEYWORD = 1<<6, + TYPE = 1<<7, + MOLECULE = 1<<8, + DNAME = 1<<9, + INAME = 1<<10, + DENSITY_NUMBER = 1<<11, + DENSITY_MASS = 1<<12, + MASS = 1<<13, + TEMPERATURE = 1<<14, + BIN1D = 1<<15, + BIN2D = 1<<16, + BIN3D = 1<<17, + BINSPHERE = 1<<18, + BINCYLINDER = 1<<19 + }; + + ArgInfo(const std::string &arg, int allowed=COMPUTE|FIX|VARIABLE); + virtual ~ArgInfo() {} + + public: + int get_type() const { return type; } + int get_dim() const { return dim; } + int get_index1() const { return index1; } + int get_index2() const { return index2; } + const char *get_name() const { return name.c_str(); } + char *copy_name(); + + private: + std::string name; + int type, dim, index1, index2; + + // disabled standard methods + ArgInfo() {} + ArgInfo(const ArgInfo &) {} + void operator=(const ArgInfo &) {} + }; +} +#endif From c1742aa3d1dc586a7fc5456b22d5de4fbda7b5f7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 30 Jan 2021 00:50:15 -0500 Subject: [PATCH 077/384] add unit tests for ArgInfo class --- unittest/utils/CMakeLists.txt | 4 + unittest/utils/test_argutils.cpp | 172 +++++++++++++++++++++++++++++++ 2 files changed, 176 insertions(+) create mode 100644 unittest/utils/test_argutils.cpp diff --git a/unittest/utils/CMakeLists.txt b/unittest/utils/CMakeLists.txt index 1a10613403..c1ce7c136f 100644 --- a/unittest/utils/CMakeLists.txt +++ b/unittest/utils/CMakeLists.txt @@ -6,6 +6,10 @@ add_executable(test_mempool test_mempool.cpp) target_link_libraries(test_mempool PRIVATE lammps GTest::GMockMain GTest::GMock GTest::GTest) add_test(MemPool test_mempool) +add_executable(test_argutils test_argutils.cpp) +target_link_libraries(test_argutils PRIVATE lammps GTest::GMockMain GTest::GMock GTest::GTest) +add_test(ArgUtils test_argutils) + add_executable(test_utils test_utils.cpp) target_link_libraries(test_utils PRIVATE lammps GTest::GMockMain GTest::GMock GTest::GTest) add_test(Utils test_utils) diff --git a/unittest/utils/test_argutils.cpp b/unittest/utils/test_argutils.cpp new file mode 100644 index 0000000000..4d75526013 --- /dev/null +++ b/unittest/utils/test_argutils.cpp @@ -0,0 +1,172 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://lammps.sandia.gov/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "arg_info.h" +#include "gmock/gmock.h" +#include "gtest/gtest.h" +#include + +using namespace LAMMPS_NS; +using ::testing::StrEq; + +TEST(ArgInfo, plain) +{ + ArgInfo arg("text"); + ASSERT_EQ(arg.get_dim(), 0); + ASSERT_EQ(arg.get_type(), ArgInfo::NONE); + ASSERT_EQ(arg.get_index1(), -1); + ASSERT_EQ(arg.get_index2(), -1); + ASSERT_THAT(arg.get_name(), StrEq("text")); +} + +TEST(ArgInfo, copy_name) +{ + char *name=nullptr; + ArgInfo arg("text"); + ASSERT_THAT(arg.get_name(), StrEq("text")); + name = arg.copy_name(); + ASSERT_THAT(name, StrEq("text")); + delete[] name; +} + +TEST(ArgInfo, compute0) +{ + ArgInfo arg("c_text"); + ASSERT_EQ(arg.get_dim(), 0); + ASSERT_EQ(arg.get_type(), ArgInfo::COMPUTE); + ASSERT_EQ(arg.get_index1(), -1); + ASSERT_EQ(arg.get_index2(), -1); + ASSERT_THAT(arg.get_name(), StrEq("text")); +} + +TEST(ArgInfo, compute1) +{ + ArgInfo arg("c_1[5]", ArgInfo::COMPUTE); + ASSERT_EQ(arg.get_dim(), 1); + ASSERT_EQ(arg.get_type(), ArgInfo::COMPUTE); + ASSERT_EQ(arg.get_index1(), 5); + ASSERT_EQ(arg.get_index2(), -1); + ASSERT_THAT(arg.get_name(), StrEq("1")); +} + +TEST(ArgInfo, compute2) +{ + ArgInfo arg("c_text[02][05]", ArgInfo::COMPUTE | ArgInfo::FIX); + ASSERT_EQ(arg.get_dim(), 2); + ASSERT_EQ(arg.get_type(), ArgInfo::COMPUTE); + ASSERT_EQ(arg.get_index1(), 2); + ASSERT_EQ(arg.get_index2(), 5); + ASSERT_THAT(arg.get_name(), StrEq("text")); +} + +TEST(ArgInfo, fix0) +{ + ArgInfo arg("f_2"); + ASSERT_EQ(arg.get_dim(), 0); + ASSERT_EQ(arg.get_type(), ArgInfo::FIX); + ASSERT_EQ(arg.get_index1(), -1); + ASSERT_EQ(arg.get_index2(), -1); + ASSERT_THAT(arg.get_name(), StrEq("2")); +} + +TEST(ArgInfo, fix1) +{ + ArgInfo arg("f_text[5]", ArgInfo::FIX | ArgInfo::VARIABLE); + ASSERT_EQ(arg.get_dim(), 1); + ASSERT_EQ(arg.get_type(), ArgInfo::FIX); + ASSERT_EQ(arg.get_index1(), 5); + ASSERT_EQ(arg.get_index2(), -1); + ASSERT_THAT(arg.get_name(), StrEq("text")); +} + +TEST(ArgInfo, fix2) +{ + ArgInfo arg("f_text[02][05]", ArgInfo::FIX); + ASSERT_EQ(arg.get_dim(), 2); + ASSERT_EQ(arg.get_type(), ArgInfo::FIX); + ASSERT_EQ(arg.get_index1(), 2); + ASSERT_EQ(arg.get_index2(), 5); + ASSERT_THAT(arg.get_name(), StrEq("text")); +} + +TEST(ArgInfo, variable0) +{ + ArgInfo arg("v_text"); + ASSERT_EQ(arg.get_dim(), 0); + ASSERT_EQ(arg.get_type(), ArgInfo::VARIABLE); + ASSERT_EQ(arg.get_index1(), -1); + ASSERT_EQ(arg.get_index2(), -1); + ASSERT_THAT(arg.get_name(), StrEq("text")); +} + +TEST(ArgInfo, variable1) +{ + ArgInfo arg("v_text_1[5]", ArgInfo::VARIABLE); + ASSERT_EQ(arg.get_dim(), 1); + ASSERT_EQ(arg.get_type(), ArgInfo::VARIABLE); + ASSERT_EQ(arg.get_index1(), 5); + ASSERT_EQ(arg.get_index2(), -1); + ASSERT_THAT(arg.get_name(), StrEq("text_1")); +} + +TEST(ArgInfo, variable2) +{ + ArgInfo arg("v_x[02][05]"); + ASSERT_EQ(arg.get_dim(), 2); + ASSERT_EQ(arg.get_type(), ArgInfo::VARIABLE); + ASSERT_EQ(arg.get_index1(), 2); + ASSERT_EQ(arg.get_index2(), 5); + ASSERT_THAT(arg.get_name(), StrEq("x")); +} + +TEST(ArgInfo, unsupported) +{ + ArgInfo arg("v_text[02][05]", ArgInfo::COMPUTE | ArgInfo::FIX); + ASSERT_EQ(arg.get_type(), ArgInfo::NONE); +} + +TEST(ArgInfo, no_bracket1) +{ + ArgInfo arg("v_text[2"); + ASSERT_EQ(arg.get_type(), ArgInfo::UNKNOWN); +} + +TEST(ArgInfo, no_bracket2) +{ + ArgInfo arg("v_text[2][1"); + ASSERT_EQ(arg.get_type(), ArgInfo::UNKNOWN); +} + +TEST(ArgInfo, no_bracket3) +{ + ArgInfo arg("v_text[2[1]"); + ASSERT_EQ(arg.get_type(), ArgInfo::UNKNOWN); +} + +TEST(ArgInfo, none) +{ + ArgInfo arg("x_text"); + ASSERT_EQ(arg.get_type(), ArgInfo::NONE); +} + +TEST(ArgInfo, bad_idx1) +{ + ArgInfo arg("c_1[a]"); + ASSERT_EQ(arg.get_type(), ArgInfo::UNKNOWN); +} + +TEST(ArgInfo, bad_idx2) +{ + ArgInfo arg("c_1[1][b]"); + ASSERT_EQ(arg.get_type(), ArgInfo::UNKNOWN); +} From 03136ed3e33547f3f607cd155da9cb36eb31f21e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 30 Jan 2021 00:51:06 -0500 Subject: [PATCH 078/384] two example cases of using the ArgInfo class --- src/compute_chunk_atom.cpp | 138 +++++++++++++++++-------------------- src/fix_ave_atom.cpp | 77 +++++++++------------ 2 files changed, 93 insertions(+), 122 deletions(-) diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index ac878183ed..db16830312 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -15,6 +15,7 @@ #include "compute_chunk_atom.h" +#include "arg_info.h" #include "atom.h" #include "comm.h" #include "domain.h" @@ -39,8 +40,6 @@ using namespace LAMMPS_NS; using namespace MathConst; -enum{BIN1D,BIN2D,BIN3D,BINSPHERE,BINCYLINDER, - TYPE,MOLECULE,COMPUTE,FIX,VARIABLE}; enum{LOWER,CENTER,UPPER,COORD}; enum{BOX,LATTICE,REDUCED}; enum{NODISCARD,MIXED,YESDISCARD}; @@ -77,14 +76,14 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[3],"bin/1d") == 0) { binflag = 1; - which = BIN1D; + which = ArgInfo::BIN1D; ncoord = 1; iarg = 4; readdim(narg,arg,iarg,0); iarg += 3; } else if (strcmp(arg[3],"bin/2d") == 0) { binflag = 1; - which = BIN2D; + which = ArgInfo::BIN2D; ncoord = 2; iarg = 4; readdim(narg,arg,iarg,0); @@ -92,7 +91,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : iarg += 6; } else if (strcmp(arg[3],"bin/3d") == 0) { binflag = 1; - which = BIN3D; + which = ArgInfo::BIN3D; ncoord = 3; iarg = 4; readdim(narg,arg,iarg,0); @@ -102,7 +101,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[3],"bin/sphere") == 0) { binflag = 1; - which = BINSPHERE; + which = ArgInfo::BINSPHERE; ncoord = 1; iarg = 4; if (iarg+6 > narg) error->all(FLERR,"Illegal compute chunk/atom command"); @@ -115,7 +114,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : iarg += 6; } else if (strcmp(arg[3],"bin/cylinder") == 0) { binflag = 1; - which = BINCYLINDER; + which = ArgInfo::BINCYLINDER; ncoord = 2; iarg = 4; readdim(narg,arg,iarg,0); @@ -141,38 +140,23 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : iarg += 5; } else if (strcmp(arg[3],"type") == 0) { - which = TYPE; + which = ArgInfo::TYPE; iarg = 4; } else if (strcmp(arg[3],"molecule") == 0) { - which = MOLECULE; + which = ArgInfo::MOLECULE; iarg = 4; - } else if (strstr(arg[3],"c_") == arg[3] || - strstr(arg[3],"f_") == arg[3] || - strstr(arg[3],"v_") == arg[3]) { - if (arg[3][0] == 'c') which = COMPUTE; - else if (arg[3][0] == 'f') which = FIX; - else if (arg[3][0] == 'v') which = VARIABLE; - iarg = 4; + } else { + ArgInfo argi(arg[3]); - int n = strlen(arg[3]); - char *suffix = new char[n]; - strcpy(suffix,&arg[3][2]); + which = argi.get_type(); + argindex = argi.get_dim(); + cfvid = argi.copy_name(); - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Illegal compute chunk/atom command"); - argindex = atoi(ptr+1); - *ptr = '\0'; - } else argindex = 0; - - n = strlen(suffix) + 1; - cfvid = new char[n]; - strcpy(cfvid,suffix); - delete [] suffix; - - } else error->all(FLERR,"Illegal compute chunk/atom command"); + if ((which == ArgInfo::UNKNOWN) || (which == ArgInfo::NONE) + || (argindex > 1)) + error->all(FLERR,"Illegal compute chunk/atom command"); + } // optional args @@ -291,8 +275,8 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : if (scaleflag == REDUCED) nchunkflag = ONCE; else nchunkflag = EVERY; } - if (which == TYPE) nchunkflag = ONCE; - if (which == MOLECULE) { + if (which == ArgInfo::TYPE) nchunkflag = ONCE; + if (which == ArgInfo::MOLECULE) { if (regionflag) nchunkflag = EVERY; else nchunkflag = ONCE; } @@ -306,31 +290,31 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : // error checks - if (which == MOLECULE && !atom->molecule_flag) + if (which == ArgInfo::MOLECULE && !atom->molecule_flag) error->all(FLERR,"Compute chunk/atom molecule for non-molecular system"); if (!binflag && discard == MIXED) error->all(FLERR,"Compute chunk/atom without bins " "cannot use discard mixed"); - if (which == BIN1D && delta[0] <= 0.0) + if (which == ArgInfo::BIN1D && delta[0] <= 0.0) error->all(FLERR,"Illegal compute chunk/atom command"); - if (which == BIN2D && (delta[0] <= 0.0 || delta[1] <= 0.0)) + if (which == ArgInfo::BIN2D && (delta[0] <= 0.0 || delta[1] <= 0.0)) error->all(FLERR,"Illegal compute chunk/atom command"); - if (which == BIN2D && (dim[0] == dim[1])) + if (which == ArgInfo::BIN2D && (dim[0] == dim[1])) error->all(FLERR,"Illegal compute chunk/atom command"); - if (which == BIN3D && + if (which == ArgInfo::BIN3D && (delta[0] <= 0.0 || delta[1] <= 0.0 || delta[2] <= 0.0)) error->all(FLERR,"Illegal compute chunk/atom command"); - if (which == BIN3D && + if (which == ArgInfo::BIN3D && (dim[0] == dim[1] || dim[1] == dim[2] || dim[0] == dim[2])) error->all(FLERR,"Illegal compute chunk/atom command"); - if (which == BINSPHERE) { + if (which == ArgInfo::BINSPHERE) { if (domain->dimension == 2 && sorigin_user[2] != 0.0) error->all(FLERR,"Compute chunk/atom sphere z origin must be 0.0 for 2d"); if (sradmin_user < 0.0 || sradmin_user >= sradmax_user || nsbin < 1) error->all(FLERR,"Illegal compute chunk/atom command"); } - if (which == BINCYLINDER) { + if (which == ArgInfo::BINCYLINDER) { if (delta[0] <= 0.0) error->all(FLERR,"Illegal compute chunk/atom command"); if (domain->dimension == 2 && dim[0] != 2) @@ -339,7 +323,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal compute chunk/atom command"); } - if (which == COMPUTE) { + if (which == ArgInfo::COMPUTE) { int icompute = modify->find_compute(cfvid); if (icompute < 0) error->all(FLERR,"Compute ID for compute chunk /atom does not exist"); @@ -360,7 +344,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : "accessed out-of-range"); } - if (which == FIX) { + if (which == ArgInfo::FIX) { int ifix = modify->find_fix(cfvid); if (ifix < 0) error->all(FLERR,"Fix ID for compute chunk/atom does not exist"); @@ -377,7 +361,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Compute chunk/atom fix array is accessed out-of-range"); } - if (which == VARIABLE) { + if (which == ArgInfo::VARIABLE) { int ivariable = input->variable->find(cfvid); if (ivariable < 0) error->all(FLERR,"Variable name for compute chunk/atom does not exist"); @@ -404,11 +388,11 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : if (binflag) { double scale; - if (which == BIN1D || which == BIN2D || which == BIN3D || - which == BINCYLINDER) { - if (which == BIN1D || which == BINCYLINDER) ndim = 1; - if (which == BIN2D) ndim = 2; - if (which == BIN3D) ndim = 3; + if (which == ArgInfo::BIN1D || which == ArgInfo::BIN2D + || which == ArgInfo::BIN3D || which == ArgInfo::BINCYLINDER) { + if (which == ArgInfo::BIN1D || which == ArgInfo::BINCYLINDER) ndim = 1; + if (which == ArgInfo::BIN2D) ndim = 2; + if (which == ArgInfo::BIN3D) ndim = 3; for (int idim = 0; idim < ndim; idim++) { if (dim[idim] == 0) scale = xscale; else if (dim[idim] == 1) scale = yscale; @@ -419,13 +403,13 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : if (minflag[idim] == COORD) minvalue[idim] *= scale; if (maxflag[idim] == COORD) maxvalue[idim] *= scale; } - } else if (which == BINSPHERE) { + } else if (which == ArgInfo::BINSPHERE) { sorigin_user[0] *= xscale; sorigin_user[1] *= yscale; sorigin_user[2] *= zscale; sradmin_user *= xscale; // radii are scaled by xscale sradmax_user *= xscale; - } else if (which == BINCYLINDER) { + } else if (which == ArgInfo::BINCYLINDER) { if (dim[0] == 0) { corigin_user[cdim1] *= yscale; corigin_user[cdim2] *= zscale; @@ -462,7 +446,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : // computeflag = 1 if this compute might invoke another compute // during assign_chunk_ids() - if (which == COMPUTE || which == FIX || which == VARIABLE) computeflag = 1; + if (which == ArgInfo::COMPUTE || which == ArgInfo::FIX || which == ArgInfo::VARIABLE) computeflag = 1; else computeflag = 0; // other initializations @@ -482,7 +466,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : lockcount = 0; lockfix = nullptr; - if (which == MOLECULE) molcheck = 1; + if (which == ArgInfo::MOLECULE) molcheck = 1; else molcheck = 0; } @@ -524,17 +508,17 @@ void ComputeChunkAtom::init() // set compute,fix,variable - if (which == COMPUTE) { + if (which == ArgInfo::COMPUTE) { int icompute = modify->find_compute(cfvid); if (icompute < 0) error->all(FLERR,"Compute ID for compute chunk/atom does not exist"); cchunk = modify->compute[icompute]; - } else if (which == FIX) { + } else if (which == ArgInfo::FIX) { int ifix = modify->find_fix(cfvid); if (ifix < 0) error->all(FLERR,"Fix ID for compute chunk/atom does not exist"); fchunk = modify->fix[ifix]; - } else if (which == VARIABLE) { + } else if (which == ArgInfo::VARIABLE) { int ivariable = input->variable->find(cfvid); if (ivariable < 0) error->all(FLERR,"Variable name for compute chunk/atom does not exist"); @@ -544,7 +528,7 @@ void ComputeChunkAtom::init() // for style MOLECULE, check that no mol IDs exceed MAXSMALLINT // don't worry about group or optional region - if (which == MOLECULE) { + if (which == ArgInfo::MOLECULE) { tagint *molecule = atom->molecule; int nlocal = atom->nlocal; tagint maxone = -1; @@ -835,10 +819,11 @@ int ComputeChunkAtom::setup_chunks() // IDs are needed to scan for max ID and for compress() if (binflag) { - if (which == BIN1D || which == BIN2D || which == BIN3D) + if (which == ArgInfo::BIN1D || which == ArgInfo::BIN2D + || which == ArgInfo::BIN3D) nchunk = setup_xyz_bins(); - else if (which == BINSPHERE) nchunk = setup_sphere_bins(); - else if (which == BINCYLINDER) nchunk = setup_cylinder_bins(); + else if (which == ArgInfo::BINSPHERE) nchunk = setup_sphere_bins(); + else if (which == ArgInfo::BINCYLINDER) nchunk = setup_cylinder_bins(); bin_volumes(); } else { chunk_volume_scalar = domain->xprd * domain->yprd; @@ -850,7 +835,7 @@ int ComputeChunkAtom::setup_chunks() // set nchunk for chunk styles other than binning // for styles other than TYPE, scan for max ID - if (which == TYPE) nchunk = atom->ntypes; + if (which == ArgInfo::TYPE) nchunk = atom->ntypes; else if (!binflag) { int nlocal = atom->nlocal; @@ -937,27 +922,27 @@ void ComputeChunkAtom::assign_chunk_ids() // binning styles apply discard rule, others do not yet if (binflag) { - if (which == BIN1D) atom2bin1d(); - else if (which == BIN2D) atom2bin2d(); - else if (which == BIN3D) atom2bin3d(); - else if (which == BINSPHERE) atom2binsphere(); - else if (which == BINCYLINDER) atom2bincylinder(); + if (which == ArgInfo::BIN1D) atom2bin1d(); + else if (which == ArgInfo::BIN2D) atom2bin2d(); + else if (which == ArgInfo::BIN3D) atom2bin3d(); + else if (which == ArgInfo::BINSPHERE) atom2binsphere(); + else if (which == ArgInfo::BINCYLINDER) atom2bincylinder(); - } else if (which == TYPE) { + } else if (which == ArgInfo::TYPE) { int *type = atom->type; for (i = 0; i < nlocal; i++) { if (exclude[i]) continue; ichunk[i] = type[i]; } - } else if (which == MOLECULE) { + } else if (which == ArgInfo::MOLECULE) { tagint *molecule = atom->molecule; for (i = 0; i < nlocal; i++) { if (exclude[i]) continue; ichunk[i] = static_cast (molecule[i]); } - } else if (which == COMPUTE) { + } else if (which == ArgInfo::COMPUTE) { if (!(cchunk->invoked_flag & INVOKED_PERATOM)) { cchunk->compute_peratom(); cchunk->invoked_flag |= INVOKED_PERATOM; @@ -978,7 +963,7 @@ void ComputeChunkAtom::assign_chunk_ids() } } - } else if (which == FIX) { + } else if (which == ArgInfo::FIX) { if (update->ntimestep % fchunk->peratom_freq) error->all(FLERR,"Fix used in compute chunk/atom not " "computed at compatible time"); @@ -998,7 +983,7 @@ void ComputeChunkAtom::assign_chunk_ids() } } - } else if (which == VARIABLE) { + } else if (which == ArgInfo::VARIABLE) { if (atom->nmax > maxvar) { maxvar = atom->nmax; memory->destroy(varatom); @@ -1428,7 +1413,8 @@ int ComputeChunkAtom::setup_cylinder_bins() void ComputeChunkAtom::bin_volumes() { - if (which == BIN1D || which == BIN2D || which == BIN3D) { + if (which == ArgInfo::BIN1D || which == ArgInfo::BIN2D + || which == ArgInfo::BIN3D) { if (domain->dimension == 3) chunk_volume_scalar = domain->xprd * domain->yprd * domain->zprd; else chunk_volume_scalar = domain->xprd * domain->yprd; @@ -1438,7 +1424,7 @@ void ComputeChunkAtom::bin_volumes() for (int m = 0; m < ndim; m++) chunk_volume_scalar *= delta[m]/prd[dim[m]]; - } else if (which == BINSPHERE) { + } else if (which == ArgInfo::BINSPHERE) { memory->destroy(chunk_volume_vec); memory->create(chunk_volume_vec,nchunk,"chunk/atom:chunk_volume_vec"); double rlo,rhi,vollo,volhi; @@ -1451,7 +1437,7 @@ void ComputeChunkAtom::bin_volumes() chunk_volume_vec[i] = volhi - vollo; } - } else if (which == BINCYLINDER) { + } else if (which == ArgInfo::BINCYLINDER) { memory->destroy(chunk_volume_vec); memory->create(chunk_volume_vec,nchunk,"chunk/atom:chunk_volume_vec"); diff --git a/src/fix_ave_atom.cpp b/src/fix_ave_atom.cpp index 7d67744a5c..d59d39a2e8 100644 --- a/src/fix_ave_atom.cpp +++ b/src/fix_ave_atom.cpp @@ -13,6 +13,7 @@ #include "fix_ave_atom.h" +#include "arg_info.h" #include "atom.h" #include "compute.h" #include "error.h" @@ -27,8 +28,6 @@ using namespace LAMMPS_NS; using namespace FixConst; -enum{X,V,F,COMPUTE,FIX,VARIABLE}; - #define INVOKED_PERATOM 8 /* ---------------------------------------------------------------------- */ @@ -67,60 +66,46 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) : ids[i] = nullptr; if (strcmp(arg[i],"x") == 0) { - which[i] = X; + which[i] = ArgInfo::X; argindex[i] = 0; } else if (strcmp(arg[i],"y") == 0) { - which[i] = X; + which[i] = ArgInfo::X; argindex[i] = 1; } else if (strcmp(arg[i],"z") == 0) { - which[i] = X; + which[i] = ArgInfo::X; argindex[i] = 2; } else if (strcmp(arg[i],"vx") == 0) { - which[i] = V; + which[i] = ArgInfo::V; argindex[i] = 0; } else if (strcmp(arg[i],"vy") == 0) { - which[i] = V; + which[i] = ArgInfo::V; argindex[i] = 1; } else if (strcmp(arg[i],"vz") == 0) { - which[i] = V; + which[i] = ArgInfo::V; argindex[i] = 2; } else if (strcmp(arg[i],"fx") == 0) { - which[i] = F; + which[i] = ArgInfo::F; argindex[i] = 0; } else if (strcmp(arg[i],"fy") == 0) { - which[i] = F; + which[i] = ArgInfo::F; argindex[i] = 1; } else if (strcmp(arg[i],"fz") == 0) { - which[i] = F; + which[i] = ArgInfo::F; argindex[i] = 2; - } else if (strncmp(arg[i],"c_",2) == 0 || - strncmp(arg[i],"f_",2) == 0 || - strncmp(arg[i],"v_",2) == 0) { - if (arg[i][0] == 'c') which[i] = COMPUTE; - else if (arg[i][0] == 'f') which[i] = FIX; - else if (arg[i][0] == 'v') which[i] = VARIABLE; + } else { + ArgInfo argi(arg[i]); - int n = strlen(arg[i]); - char *suffix = new char[n]; - strcpy(suffix,&arg[i][2]); + which[i] = argi.get_type(); + argindex[i] = argi.get_dim(); + ids[i] = argi.copy_name(); - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Illegal fix ave/atom command"); - argindex[i] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[i] = 0; - - n = strlen(suffix) + 1; - ids[i] = new char[n]; - strcpy(ids[i],suffix); - delete [] suffix; - - } else error->all(FLERR,"Illegal fix ave/atom command"); + if ((which[i] == ArgInfo::UNKNOWN) || (which[i] == ArgInfo::NONE) + || (argindex[i] > 1)) + error->all(FLERR,"Illegal fix ave/atom command"); + } } // if wildcard expansion occurred, free earg memory from exapnd_args() @@ -139,7 +124,7 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix ave/atom command"); for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/atom does not exist"); @@ -157,7 +142,7 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) : argindex[i] > modify->compute[icompute]->size_peratom_cols) error->all(FLERR,"Fix ave/atom compute array is accessed out-of-range"); - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for fix ave/atom does not exist"); @@ -175,7 +160,7 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Fix for fix ave/atom not computed at compatible time"); - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix ave/atom does not exist"); @@ -248,19 +233,19 @@ void FixAveAtom::init() // set indices and check validity of all computes,fixes,variables for (int m = 0; m < nvalues; m++) { - if (which[m] == COMPUTE) { + if (which[m] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[m]); if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/atom does not exist"); value2index[m] = icompute; - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[m]); if (ifix < 0) error->all(FLERR,"Fix ID for fix ave/atom does not exist"); value2index[m] = ifix; - } else if (which[m] == VARIABLE) { + } else if (which[m] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[m]); if (ivariable < 0) error->all(FLERR,"Variable name for fix ave/atom does not exist"); @@ -322,24 +307,24 @@ void FixAveAtom::end_of_step() n = value2index[m]; j = argindex[m]; - if (which[m] == X) { + if (which[m] == ArgInfo::X) { double **x = atom->x; for (i = 0; i < nlocal; i++) if (mask[i] & groupbit) array[i][m] += x[i][j]; - } else if (which[m] == V) { + } else if (which[m] == ArgInfo::V) { double **v = atom->v; for (i = 0; i < nlocal; i++) if (mask[i] & groupbit) array[i][m] += v[i][j]; - } else if (which[m] == F) { + } else if (which[m] == ArgInfo::F) { double **f = atom->f; for (i = 0; i < nlocal; i++) if (mask[i] & groupbit) array[i][m] += f[i][j]; // invoke compute if not previously invoked - } else if (which[m] == COMPUTE) { + } else if (which[m] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[n]; if (!(compute->invoked_flag & INVOKED_PERATOM)) { compute->compute_peratom(); @@ -359,7 +344,7 @@ void FixAveAtom::end_of_step() // access fix fields, guaranteed to be ready - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { if (j == 0) { double *fix_vector = modify->fix[n]->vector_atom; for (i = 0; i < nlocal; i++) @@ -374,7 +359,7 @@ void FixAveAtom::end_of_step() // evaluate atom-style variable // final argument = 1 sums result to array - } else if (which[m] == VARIABLE) { + } else if (which[m] == ArgInfo::VARIABLE) { if (array) input->variable->compute_atom(n,igroup,&array[0][m],nvalues,1); else input->variable->compute_atom(n,igroup,nullptr,nvalues,1); } From 4747e0496a55f116e97274b77cc2bab7e246f8dd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 30 Jan 2021 02:22:49 -0500 Subject: [PATCH 079/384] add a bunch of unicode space equivalents --- src/utils.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/utils.cpp b/src/utils.cpp index 80800397d3..44dcc16f0c 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -588,6 +588,9 @@ std::string utils::utf8_subst(const std::string &line) // UTF-8 2-byte character if ((in[i] & 0xe0U) == 0xc0U) { if ((i+1) < len) { + // NON-BREAKING SPACE (U+00A0) + if ((in[i] == 0xc2U) && (in[i+1] == 0xa0U)) + out += ' ', ++i; // MODIFIER LETTER PLUS SIGN (U+02D6) if ((in[i] == 0xcbU) && (in[i+1] == 0x96U)) out += '+', ++i; @@ -598,6 +601,48 @@ std::string utils::utf8_subst(const std::string &line) // UTF-8 3-byte character } else if ((in[i] & 0xf0U) == 0xe0U) { if ((i+2) < len) { + // EN QUAD (U+2000) + if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x80U)) + out += ' ', i += 2; + // EM QUAD (U+2001) + if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x81U)) + out += ' ', i += 2; + // EN SPACE (U+2002) + if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x82U)) + out += ' ', i += 2; + // EM SPACE (U+2003) + if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x83U)) + out += ' ', i += 2; + // THREE-PER-EM SPACE (U+2004) + if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x84U)) + out += ' ', i += 2; + // FOUR-PER-EM SPACE (U+2005) + if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x85U)) + out += ' ', i += 2; + // SIX-PER-EM SPACE (U+2006) + if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x86U)) + out += ' ', i += 2; + // FIGURE SPACE (U+2007) + if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x87U)) + out += ' ', i += 2; + // PUNCTUATION SPACE (U+2008) + if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x88U)) + out += ' ', i += 2; + // THIN SPACE (U+2009) + if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x89U)) + out += ' ', i += 2; + // HAIR SPACE (U+200A) + if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x8aU)) + out += ' ', i += 2; + // ZERO WIDTH SPACE (U+200B) + if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x8bU)) + out += ' ', i += 2; + // NARROW NO-BREAK SPACE (U+202F) + if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0xafU)) + out += ' ', i += 2; + // WORD JOINER (U+2060) + if ((in[i] == 0xe2U) && (in[i+1] == 0x81U) && (in[i+2] == 0xa0U)) + out += ' ', i += 2; // INVISIBLE SEPARATOR (U+2063) if ((in[i] == 0xe2U) && (in[i+1] == 0x81U) && (in[i+2] == 0xa3U)) out += ' ', i += 2; @@ -607,6 +652,9 @@ std::string utils::utf8_subst(const std::string &line) // MINUS SIGN (U+2212) if ((in[i] == 0xe2U) && (in[i+1] == 0x88U) && (in[i+2] == 0x92U)) out += '-', i += 2; + // ZERO WIDTH NO-BREAK SPACE (U+FEFF) + if ((in[i] == 0xefU) && (in[i+1] == 0xbbU) && (in[i+2] == 0xbfU)) + out += ' ', i += 2; } // UTF-8 4-byte character } else if ((in[i] & 0xe8U) == 0xf0U) { From 3ce92db405cf31f5ebaaf4c7b37fd7639b0156e0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 30 Jan 2021 06:08:17 -0500 Subject: [PATCH 080/384] correct path to CMake preset folder in example command --- doc/src/Python_install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/Python_install.rst b/doc/src/Python_install.rst index c12644bf4a..dce19ce2c0 100644 --- a/doc/src/Python_install.rst +++ b/doc/src/Python_install.rst @@ -69,7 +69,7 @@ this. cd build # configure LAMMPS compilation - cmake -C cmake/presets/minimal.cmake -D BUILD_SHARED_LIBS=on \ + cmake -C ../cmake/presets/minimal.cmake -D BUILD_SHARED_LIBS=on \ -D LAMMPS_EXCEPTIONS=on -D PKG_PYTHON=on ../cmake # compile LAMMPS From aeaaeed70385dbabeb96e00a947c517e5c10c4b8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 30 Jan 2021 06:08:35 -0500 Subject: [PATCH 081/384] clarify and fix typo --- doc/src/Python_install.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/src/Python_install.rst b/doc/src/Python_install.rst index dce19ce2c0..8d7f9ee83e 100644 --- a/doc/src/Python_install.rst +++ b/doc/src/Python_install.rst @@ -97,10 +97,11 @@ this. For a system-wide installation you need to set ``CMAKE_INSTALL_PREFIX`` to a system folder like ``/usr`` (or - ``/usr/local``). The installation step (**not** the - configuration/compilation) needs to be done with superuser + ``/usr/local``); the default is ``${HOME}/.local``. + The installation step for a system folder installation + (**not** the configuration/compilation) needs to be done with superuser privilege, e.g. by using ``sudo cmake --install .``. The - installation folders will then by changed to: + installation folders will then be changed to (for ``/usr`` as prefix): +------------------------+---------------------------------------------------------+-------------------------------------------------------------+ | File | Location | Notes | From f0e4f906082898120aed33a37072f699fd33e91e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 31 Jan 2021 13:06:10 -0500 Subject: [PATCH 082/384] reformat paragraph --- doc/src/Python_install.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/src/Python_install.rst b/doc/src/Python_install.rst index 8d7f9ee83e..134d3e22d2 100644 --- a/doc/src/Python_install.rst +++ b/doc/src/Python_install.rst @@ -97,11 +97,12 @@ this. For a system-wide installation you need to set ``CMAKE_INSTALL_PREFIX`` to a system folder like ``/usr`` (or - ``/usr/local``); the default is ``${HOME}/.local``. - The installation step for a system folder installation - (**not** the configuration/compilation) needs to be done with superuser + ``/usr/local``); the default is ``${HOME}/.local``. The + installation step for a system folder installation (**not** the + configuration/compilation) needs to be done with superuser privilege, e.g. by using ``sudo cmake --install .``. The - installation folders will then be changed to (for ``/usr`` as prefix): + installation folders will then be changed to (assuming ``/usr`` as + prefix): +------------------------+---------------------------------------------------------+-------------------------------------------------------------+ | File | Location | Notes | From 48f15e485d0a1521ff8943384c65bafc2794389f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 31 Jan 2021 20:13:47 -0500 Subject: [PATCH 083/384] put consistent definition of INVOKED_* constants as enumerator into compute.h --- src/KOKKOS/compute_coord_atom_kokkos.cpp | 5 +- src/LATTE/fix_latte.cpp | 5 +- src/REPLICA/compute_event_displace.cpp | 1 - src/USER-DIFFRACTION/fix_saed_vtk.cpp | 5 +- src/USER-MISC/fix_ave_correlate_long.cpp | 11 ++- src/USER-PHONON/fix_phonon.cpp | 4 +- src/USER-PLUMED/fix_plumed.cpp | 1 - src/USER-VTK/dump_vtk.cpp | 5 +- src/compute.cpp | 2 +- src/compute.h | 8 +++ src/compute_chunk_atom.cpp | 5 +- src/compute_chunk_spread_atom.cpp | 11 ++- src/compute_coord_atom.cpp | 5 +- src/compute_global_atom.cpp | 15 ++-- src/compute_heat_flux.cpp | 13 ++-- src/compute_reduce.cpp | 12 ++-- src/compute_reduce_chunk.cpp | 5 +- src/compute_reduce_region.cpp | 12 ++-- src/compute_slice.cpp | 10 ++- src/dump_custom.cpp | 5 +- src/dump_local.cpp | 5 +- src/fix_ave_atom.cpp | 5 +- src/fix_ave_chunk.cpp | 5 +- src/fix_ave_correlate.cpp | 11 ++- src/fix_ave_histo.cpp | 29 ++++---- src/fix_ave_histo_weight.cpp | 53 +++++++-------- src/fix_ave_time.cpp | 19 +++--- src/fix_controller.cpp | 10 ++- src/fix_store_state.cpp | 5 +- src/fix_vector.cpp | 11 ++- src/modify.cpp | 2 +- src/thermo.cpp | 87 ++++++++++++------------ src/variable.cpp | 48 ++++++------- 33 files changed, 187 insertions(+), 243 deletions(-) diff --git a/src/KOKKOS/compute_coord_atom_kokkos.cpp b/src/KOKKOS/compute_coord_atom_kokkos.cpp index a8fe6562d9..b447d2cd7b 100644 --- a/src/KOKKOS/compute_coord_atom_kokkos.cpp +++ b/src/KOKKOS/compute_coord_atom_kokkos.cpp @@ -27,7 +27,6 @@ using namespace LAMMPS_NS; -#define INVOKED_PERATOM 8 /* ---------------------------------------------------------------------- */ @@ -113,9 +112,9 @@ void ComputeCoordAtomKokkos::compute_peratom() } if (cstyle == ORIENT) { - if (!(c_orientorder->invoked_flag & INVOKED_PERATOM)) { + if (!(c_orientorder->invoked_flag & Compute::INVOKED_PERATOM)) { c_orientorder->compute_peratom(); - c_orientorder->invoked_flag |= INVOKED_PERATOM; + c_orientorder->invoked_flag |= Compute::INVOKED_PERATOM; } nqlist = c_orientorder->nqlist; normv = c_orientorder->array_atom; diff --git a/src/LATTE/fix_latte.cpp b/src/LATTE/fix_latte.cpp index 46b15a60d0..25ddd2036a 100644 --- a/src/LATTE/fix_latte.cpp +++ b/src/LATTE/fix_latte.cpp @@ -49,7 +49,6 @@ extern "C" { // difficult to debug crashes or memory corruption. #define LATTE_ABIVERSION 20180622 -#define INVOKED_PERATOM 8 /* ---------------------------------------------------------------------- */ @@ -248,9 +247,9 @@ void FixLatte::post_force(int vflag) if (coulomb) { modify->clearstep_compute(); - if (!(c_pe->invoked_flag & INVOKED_PERATOM)) { + if (!(c_pe->invoked_flag & Compute::INVOKED_PERATOM)) { c_pe->compute_peratom(); - c_pe->invoked_flag |= INVOKED_PERATOM; + c_pe->invoked_flag |= Compute::INVOKED_PERATOM; } modify->addstep_compute(update->ntimestep+1); diff --git a/src/REPLICA/compute_event_displace.cpp b/src/REPLICA/compute_event_displace.cpp index b1592b973c..958c2d3c22 100644 --- a/src/REPLICA/compute_event_displace.cpp +++ b/src/REPLICA/compute_event_displace.cpp @@ -28,7 +28,6 @@ using namespace LAMMPS_NS; -#define INVOKED_SCALAR 1 /* ---------------------------------------------------------------------- */ diff --git a/src/USER-DIFFRACTION/fix_saed_vtk.cpp b/src/USER-DIFFRACTION/fix_saed_vtk.cpp index 9c3666b426..84283a7ca2 100644 --- a/src/USER-DIFFRACTION/fix_saed_vtk.cpp +++ b/src/USER-DIFFRACTION/fix_saed_vtk.cpp @@ -35,7 +35,6 @@ enum{COMPUTE}; enum{ONE,RUNNING,WINDOW}; enum{FIRST,MULTI}; -#define INVOKED_VECTOR 2 /* ---------------------------------------------------------------------- */ @@ -357,9 +356,9 @@ void FixSAEDVTK::invoke_vector(bigint ntimestep) Compute *compute = modify->compute[icompute]; - if (!(compute->invoked_flag & INVOKED_VECTOR)) { + if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } double *vector = compute->vector; diff --git a/src/USER-MISC/fix_ave_correlate_long.cpp b/src/USER-MISC/fix_ave_correlate_long.cpp index a9c8228871..cf9e6c0dca 100644 --- a/src/USER-MISC/fix_ave_correlate_long.cpp +++ b/src/USER-MISC/fix_ave_correlate_long.cpp @@ -42,9 +42,6 @@ using namespace FixConst; enum{COMPUTE,FIX,VARIABLE}; enum{AUTO,UPPER,LOWER,AUTOUPPER,AUTOLOWER,FULL}; -#define INVOKED_SCALAR 1 -#define INVOKED_VECTOR 2 -#define INVOKED_ARRAY 4 static const char cite_fix_ave_correlate_long[] = "fix ave/correlate/long command:\n\n" @@ -448,15 +445,15 @@ void FixAveCorrelateLong::end_of_step() Compute *compute = modify->compute[m]; if (argindex[i] == 0) { - if (!(compute->invoked_flag & INVOKED_SCALAR)) { + if (!(compute->invoked_flag & Compute::INVOKED_SCALAR)) { compute->compute_scalar(); - compute->invoked_flag |= INVOKED_SCALAR; + compute->invoked_flag |= Compute::INVOKED_SCALAR; } scalar = compute->scalar; } else { - if (!(compute->invoked_flag & INVOKED_VECTOR)) { + if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } scalar = compute->vector[argindex[i]-1]; } diff --git a/src/USER-PHONON/fix_phonon.cpp b/src/USER-PHONON/fix_phonon.cpp index e3ea7a52e7..320a12d8f9 100644 --- a/src/USER-PHONON/fix_phonon.cpp +++ b/src/USER-PHONON/fix_phonon.cpp @@ -42,8 +42,6 @@ using namespace LAMMPS_NS; using namespace FixConst; -#define INVOKED_SCALAR 1 -#define INVOKED_VECTOR 2 #define MAXLINE 512 enum{FORWARD=-1,BACKWARD=1}; @@ -338,7 +336,7 @@ void FixPhonon::end_of_step() double xcur[3]; // to get the current temperature - if (!(temperature->invoked_flag & INVOKED_VECTOR)) temperature->compute_vector(); + if (!(temperature->invoked_flag & Compute::INVOKED_VECTOR)) temperature->compute_vector(); for (idim = 0; idim < sysdim; ++idim) TempSum[idim] += temperature->vector[idim]; // evaluate R(r) on local proc diff --git a/src/USER-PLUMED/fix_plumed.cpp b/src/USER-PLUMED/fix_plumed.cpp index e2246adcd9..779a9b93d8 100644 --- a/src/USER-PLUMED/fix_plumed.cpp +++ b/src/USER-PLUMED/fix_plumed.cpp @@ -49,7 +49,6 @@ static char plumed_default_kernel[] = "PLUMED_KERNEL=" PLUMED_QUOTE(__PLUMED_DEF using namespace LAMMPS_NS; using namespace FixConst; -#define INVOKED_SCALAR 1 FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), diff --git a/src/USER-VTK/dump_vtk.cpp b/src/USER-VTK/dump_vtk.cpp index 518015d688..373680dfc2 100644 --- a/src/USER-VTK/dump_vtk.cpp +++ b/src/USER-VTK/dump_vtk.cpp @@ -89,7 +89,6 @@ enum{X,Y,Z, // required for vtk, must come first enum{LT,LE,GT,GE,EQ,NEQ}; enum{VTK,VTP,VTU,PVTP,PVTU}; // file formats -#define INVOKED_PERATOM 8 #define ONEFIELD 32 #define DELTA 1048576 @@ -302,9 +301,9 @@ int DumpVTK::count() error->all(FLERR,"Compute used in dump between runs is not current"); } else { for (i = 0; i < ncompute; i++) { - if (!(compute[i]->invoked_flag & INVOKED_PERATOM)) { + if (!(compute[i]->invoked_flag & Compute::INVOKED_PERATOM)) { compute[i]->compute_peratom(); - compute[i]->invoked_flag |= INVOKED_PERATOM; + compute[i]->invoked_flag |= Compute::INVOKED_PERATOM; } } } diff --git a/src/compute.cpp b/src/compute.cpp index 36364888cb..df2bf9429c 100644 --- a/src/compute.cpp +++ b/src/compute.cpp @@ -84,7 +84,7 @@ Compute::Compute(LAMMPS *lmp, int narg, char **arg) : invoked_scalar = invoked_vector = invoked_array = -1; invoked_peratom = invoked_local = -1; - invoked_flag = 0; + invoked_flag = INVOKED_NONE; // set modify defaults diff --git a/src/compute.h b/src/compute.h index b6d053dd0e..71c07737d4 100644 --- a/src/compute.h +++ b/src/compute.h @@ -20,6 +20,14 @@ namespace LAMMPS_NS { class Compute : protected Pointers { public: + enum { + INVOKED_NONE = 0, + INVOKED_SCALAR = 1<<0, + INVOKED_VECTOR = 1<<1, + INVOKED_ARRAY = 1<<2, + INVOKED_PERATOM = 1<<3, + INVOKED_LOCAL = 1<<4, + }; static int instance_total; // # of Compute classes ever instantiated char *id,*style; diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index ac878183ed..764f7ac586 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -48,7 +48,6 @@ enum{ONCE,NFREQ,EVERY}; // used in several files enum{LIMITMAX,LIMITEXACT}; #define IDMAX 1024*1024 -#define INVOKED_PERATOM 8 /* ---------------------------------------------------------------------- */ @@ -958,9 +957,9 @@ void ComputeChunkAtom::assign_chunk_ids() } } else if (which == COMPUTE) { - if (!(cchunk->invoked_flag & INVOKED_PERATOM)) { + if (!(cchunk->invoked_flag & Compute::INVOKED_PERATOM)) { cchunk->compute_peratom(); - cchunk->invoked_flag |= INVOKED_PERATOM; + cchunk->invoked_flag |= Compute::INVOKED_PERATOM; } if (argindex == 0) { diff --git a/src/compute_chunk_spread_atom.cpp b/src/compute_chunk_spread_atom.cpp index 1e3f9575d7..f4f9861990 100644 --- a/src/compute_chunk_spread_atom.cpp +++ b/src/compute_chunk_spread_atom.cpp @@ -28,9 +28,6 @@ using namespace LAMMPS_NS; enum{COMPUTE,FIX}; -#define INVOKED_VECTOR 2 -#define INVOKED_ARRAY 4 -#define INVOKED_PERATOM 8 /* ---------------------------------------------------------------------- */ @@ -275,9 +272,9 @@ void ComputeChunkSpreadAtom::compute_peratom() Compute *compute = modify->compute[n]; if (argindex[m] == 0) { - if (!(compute->invoked_flag & INVOKED_VECTOR)) { + if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } double *cvector = compute->vector; for (i = 0; i < nlocal; i++, ptr += nstride) { @@ -289,9 +286,9 @@ void ComputeChunkSpreadAtom::compute_peratom() } } else { - if (!(compute->invoked_flag & INVOKED_ARRAY)) { + if (!(compute->invoked_flag & Compute::INVOKED_ARRAY)) { compute->compute_array(); - compute->invoked_flag |= INVOKED_ARRAY; + compute->invoked_flag |= Compute::INVOKED_ARRAY; } int icol = argindex[m]-1; double **carray = compute->array; diff --git a/src/compute_coord_atom.cpp b/src/compute_coord_atom.cpp index 21284549b6..686c58e8d9 100644 --- a/src/compute_coord_atom.cpp +++ b/src/compute_coord_atom.cpp @@ -32,7 +32,6 @@ using namespace LAMMPS_NS; -#define INVOKED_PERATOM 8 /* ---------------------------------------------------------------------- */ @@ -198,9 +197,9 @@ void ComputeCoordAtom::compute_peratom() } if (cstyle == ORIENT) { - if (!(c_orientorder->invoked_flag & INVOKED_PERATOM)) { + if (!(c_orientorder->invoked_flag & Compute::INVOKED_PERATOM)) { c_orientorder->compute_peratom(); - c_orientorder->invoked_flag |= INVOKED_PERATOM; + c_orientorder->invoked_flag |= Compute::INVOKED_PERATOM; } nqlist = c_orientorder->nqlist; normv = c_orientorder->array_atom; diff --git a/src/compute_global_atom.cpp b/src/compute_global_atom.cpp index d9919b13b2..10cde42ef9 100644 --- a/src/compute_global_atom.cpp +++ b/src/compute_global_atom.cpp @@ -29,9 +29,6 @@ using namespace LAMMPS_NS; enum{COMPUTE,FIX,VARIABLE}; enum{VECTOR,ARRAY}; -#define INVOKED_VECTOR 2 -#define INVOKED_ARRAY 4 -#define INVOKED_PERATOM 8 #define BIG 1.0e20 @@ -340,9 +337,9 @@ void ComputeGlobalAtom::compute_peratom() if (whichref == COMPUTE) { Compute *compute = modify->compute[ref2index]; - if (!(compute->invoked_flag & INVOKED_PERATOM)) { + if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) { compute->compute_peratom(); - compute->invoked_flag |= INVOKED_PERATOM; + compute->invoked_flag |= Compute::INVOKED_PERATOM; } if (indexref == 0) { @@ -397,9 +394,9 @@ void ComputeGlobalAtom::compute_peratom() if (which[m] == COMPUTE) { Compute *compute = modify->compute[value2index[m]]; - if (!(compute->invoked_flag & INVOKED_VECTOR)) { + if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } source = compute->vector; @@ -455,9 +452,9 @@ void ComputeGlobalAtom::compute_peratom() if (which[m] == COMPUTE) { Compute *compute = modify->compute[value2index[m]]; - if (!(compute->invoked_flag & INVOKED_ARRAY)) { + if (!(compute->invoked_flag & Compute::INVOKED_ARRAY)) { compute->compute_array(); - compute->invoked_flag |= INVOKED_ARRAY; + compute->invoked_flag |= Compute::INVOKED_ARRAY; } double **compute_array = compute->array; diff --git a/src/compute_heat_flux.cpp b/src/compute_heat_flux.cpp index 404cb988e7..91019aef28 100644 --- a/src/compute_heat_flux.cpp +++ b/src/compute_heat_flux.cpp @@ -27,7 +27,6 @@ using namespace LAMMPS_NS; -#define INVOKED_PERATOM 8 /* ---------------------------------------------------------------------- */ @@ -108,17 +107,17 @@ void ComputeHeatFlux::compute_vector() // invoke 3 computes if they haven't been already - if (!(c_ke->invoked_flag & INVOKED_PERATOM)) { + if (!(c_ke->invoked_flag & Compute::INVOKED_PERATOM)) { c_ke->compute_peratom(); - c_ke->invoked_flag |= INVOKED_PERATOM; + c_ke->invoked_flag |= Compute::INVOKED_PERATOM; } - if (!(c_pe->invoked_flag & INVOKED_PERATOM)) { + if (!(c_pe->invoked_flag & Compute::INVOKED_PERATOM)) { c_pe->compute_peratom(); - c_pe->invoked_flag |= INVOKED_PERATOM; + c_pe->invoked_flag |= Compute::INVOKED_PERATOM; } - if (!(c_stress->invoked_flag & INVOKED_PERATOM)) { + if (!(c_stress->invoked_flag & Compute::INVOKED_PERATOM)) { c_stress->compute_peratom(); - c_stress->invoked_flag |= INVOKED_PERATOM; + c_stress->invoked_flag |= Compute::INVOKED_PERATOM; } // heat flux vector = jc[3] + jv[3] diff --git a/src/compute_reduce.cpp b/src/compute_reduce.cpp index 45c0570239..7f2b769d49 100644 --- a/src/compute_reduce.cpp +++ b/src/compute_reduce.cpp @@ -33,10 +33,6 @@ enum{SUM,SUMSQ,MINN,MAXX,AVE,AVESQ}; // also in ComputeReduceRegion enum{UNKNOWN=-1,X,V,F,COMPUTE,FIX,VARIABLE}; enum{PERATOM,LOCAL}; -#define INVOKED_VECTOR 2 -#define INVOKED_ARRAY 4 -#define INVOKED_PERATOM 8 -#define INVOKED_LOCAL 16 #define BIG 1.0e20 @@ -513,9 +509,9 @@ double ComputeReduce::compute_one(int m, int flag) Compute *compute = modify->compute[vidx]; if (flavor[m] == PERATOM) { - if (!(compute->invoked_flag & INVOKED_PERATOM)) { + if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) { compute->compute_peratom(); - compute->invoked_flag |= INVOKED_PERATOM; + compute->invoked_flag |= Compute::INVOKED_PERATOM; } if (aidx == 0) { @@ -536,9 +532,9 @@ double ComputeReduce::compute_one(int m, int flag) } } else if (flavor[m] == LOCAL) { - if (!(compute->invoked_flag & INVOKED_LOCAL)) { + if (!(compute->invoked_flag & Compute::INVOKED_LOCAL)) { compute->compute_local(); - compute->invoked_flag |= INVOKED_LOCAL; + compute->invoked_flag |= Compute::INVOKED_LOCAL; } if (aidx == 0) { diff --git a/src/compute_reduce_chunk.cpp b/src/compute_reduce_chunk.cpp index 50e9c767c5..a93d38d721 100644 --- a/src/compute_reduce_chunk.cpp +++ b/src/compute_reduce_chunk.cpp @@ -32,7 +32,6 @@ using namespace LAMMPS_NS; enum{SUM,MINN,MAXX}; enum{UNKNOWN=-1,COMPUTE,FIX,VARIABLE}; -#define INVOKED_PERATOM 8 #define BIG 1.0e20 @@ -374,9 +373,9 @@ void ComputeReduceChunk::compute_one(int m, double *vchunk, int nstride) if (which[m] == COMPUTE) { Compute *compute = modify->compute[vidx]; - if (!(compute->invoked_flag & INVOKED_PERATOM)) { + if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) { compute->compute_peratom(); - compute->invoked_flag |= INVOKED_PERATOM; + compute->invoked_flag |= Compute::INVOKED_PERATOM; } if (argindex[m] == 0) { diff --git a/src/compute_reduce_region.cpp b/src/compute_reduce_region.cpp index 9dabc5c5d8..fbb1450534 100644 --- a/src/compute_reduce_region.cpp +++ b/src/compute_reduce_region.cpp @@ -31,10 +31,6 @@ enum{SUM,SUMSQ,MINN,MAXX,AVE,AVESQ}; // also in ComputeReduce enum{UNKNOWN=-1,X,V,F,COMPUTE,FIX,VARIABLE}; enum{PERATOM,LOCAL}; -#define INVOKED_VECTOR 2 -#define INVOKED_ARRAY 4 -#define INVOKED_PERATOM 8 -#define INVOKED_LOCAL 16 #define BIG 1.0e20 @@ -110,9 +106,9 @@ double ComputeReduceRegion::compute_one(int m, int flag) Compute *compute = modify->compute[n]; if (flavor[m] == PERATOM) { - if (!(compute->invoked_flag & INVOKED_PERATOM)) { + if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) { compute->compute_peratom(); - compute->invoked_flag |= INVOKED_PERATOM; + compute->invoked_flag |= Compute::INVOKED_PERATOM; } if (j == 0) { @@ -135,9 +131,9 @@ double ComputeReduceRegion::compute_one(int m, int flag) } } else if (flavor[m] == LOCAL) { - if (!(compute->invoked_flag & INVOKED_LOCAL)) { + if (!(compute->invoked_flag & Compute::INVOKED_LOCAL)) { compute->compute_local(); - compute->invoked_flag |= INVOKED_LOCAL; + compute->invoked_flag |= Compute::INVOKED_LOCAL; } if (j == 0) { diff --git a/src/compute_slice.cpp b/src/compute_slice.cpp index 4de3ad5a9b..aa89359a5e 100644 --- a/src/compute_slice.cpp +++ b/src/compute_slice.cpp @@ -27,8 +27,6 @@ using namespace LAMMPS_NS; enum{COMPUTE,FIX,VARIABLE}; -#define INVOKED_VECTOR 2 -#define INVOKED_ARRAY 4 /* ---------------------------------------------------------------------- */ @@ -290,9 +288,9 @@ void ComputeSlice::extract_one(int m, double *vec, int stride) Compute *compute = modify->compute[value2index[m]]; if (argindex[m] == 0) { - if (!(compute->invoked_flag & INVOKED_VECTOR)) { + if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } double *cvector = compute->vector; j = 0; @@ -302,9 +300,9 @@ void ComputeSlice::extract_one(int m, double *vec, int stride) } } else { - if (!(compute->invoked_flag & INVOKED_ARRAY)) { + if (!(compute->invoked_flag & Compute::INVOKED_ARRAY)) { compute->compute_array(); - compute->invoked_flag |= INVOKED_ARRAY; + compute->invoked_flag |= Compute::INVOKED_ARRAY; } double **carray = compute->array; int icol = argindex[m]-1; diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index d927bca48d..ef45780e91 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -45,7 +45,6 @@ enum{ID,MOL,PROC,PROCP1,TYPE,ELEMENT,MASS, COMPUTE,FIX,VARIABLE,INAME,DNAME}; enum{LT,LE,GT,GE,EQ,NEQ,XOR}; -#define INVOKED_PERATOM 8 #define ONEFIELD 32 #define DELTA 1048576 @@ -584,9 +583,9 @@ int DumpCustom::count() error->all(FLERR,"Compute used in dump between runs is not current"); } else { for (i = 0; i < ncompute; i++) { - if (!(compute[i]->invoked_flag & INVOKED_PERATOM)) { + if (!(compute[i]->invoked_flag & Compute::INVOKED_PERATOM)) { compute[i]->compute_peratom(); - compute[i]->invoked_flag |= INVOKED_PERATOM; + compute[i]->invoked_flag |= Compute::INVOKED_PERATOM; } } } diff --git a/src/dump_local.cpp b/src/dump_local.cpp index 211d50f49b..d2608f99f0 100644 --- a/src/dump_local.cpp +++ b/src/dump_local.cpp @@ -27,7 +27,6 @@ using namespace LAMMPS_NS; enum{INT,DOUBLE}; -#define INVOKED_LOCAL 16 #define ONEFIELD 32 #define DELTA 1048576 @@ -297,9 +296,9 @@ int DumpLocal::count() error->all(FLERR,"Compute used in dump between runs is not current"); } else { for (i = 0; i < ncompute; i++) { - if (!(compute[i]->invoked_flag & INVOKED_LOCAL)) { + if (!(compute[i]->invoked_flag & Compute::INVOKED_LOCAL)) { compute[i]->compute_local(); - compute[i]->invoked_flag |= INVOKED_LOCAL; + compute[i]->invoked_flag |= Compute::INVOKED_LOCAL; } } } diff --git a/src/fix_ave_atom.cpp b/src/fix_ave_atom.cpp index 7d67744a5c..6b9c01c4b1 100644 --- a/src/fix_ave_atom.cpp +++ b/src/fix_ave_atom.cpp @@ -29,7 +29,6 @@ using namespace FixConst; enum{X,V,F,COMPUTE,FIX,VARIABLE}; -#define INVOKED_PERATOM 8 /* ---------------------------------------------------------------------- */ @@ -341,9 +340,9 @@ void FixAveAtom::end_of_step() } else if (which[m] == COMPUTE) { Compute *compute = modify->compute[n]; - if (!(compute->invoked_flag & INVOKED_PERATOM)) { + if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) { compute->compute_peratom(); - compute->invoked_flag |= INVOKED_PERATOM; + compute->invoked_flag |= Compute::INVOKED_PERATOM; } if (j == 0) { diff --git a/src/fix_ave_chunk.cpp b/src/fix_ave_chunk.cpp index d8b5b3e48d..21e56ee697 100644 --- a/src/fix_ave_chunk.cpp +++ b/src/fix_ave_chunk.cpp @@ -39,7 +39,6 @@ enum{SAMPLE,ALL}; enum{NOSCALE,ATOM}; enum{ONE,RUNNING,WINDOW}; -#define INVOKED_PERATOM 8 /* ---------------------------------------------------------------------- */ @@ -738,9 +737,9 @@ void FixAveChunk::end_of_step() } else if (which[m] == COMPUTE) { Compute *compute = modify->compute[n]; - if (!(compute->invoked_flag & INVOKED_PERATOM)) { + if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) { compute->compute_peratom(); - compute->invoked_flag |= INVOKED_PERATOM; + compute->invoked_flag |= Compute::INVOKED_PERATOM; } double *vector = compute->vector_atom; double **array = compute->array_atom; diff --git a/src/fix_ave_correlate.cpp b/src/fix_ave_correlate.cpp index 833965e7bc..1cda758e5f 100644 --- a/src/fix_ave_correlate.cpp +++ b/src/fix_ave_correlate.cpp @@ -37,9 +37,6 @@ enum{COMPUTE,FIX,VARIABLE}; enum{ONE,RUNNING}; enum{AUTO,UPPER,LOWER,AUTOUPPER,AUTOLOWER,FULL}; -#define INVOKED_SCALAR 1 -#define INVOKED_VECTOR 2 -#define INVOKED_ARRAY 4 /* ---------------------------------------------------------------------- */ @@ -442,15 +439,15 @@ void FixAveCorrelate::end_of_step() Compute *compute = modify->compute[m]; if (argindex[i] == 0) { - if (!(compute->invoked_flag & INVOKED_SCALAR)) { + if (!(compute->invoked_flag & Compute::INVOKED_SCALAR)) { compute->compute_scalar(); - compute->invoked_flag |= INVOKED_SCALAR; + compute->invoked_flag |= Compute::INVOKED_SCALAR; } scalar = compute->scalar; } else { - if (!(compute->invoked_flag & INVOKED_VECTOR)) { + if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } scalar = compute->vector[argindex[i]-1]; } diff --git a/src/fix_ave_histo.cpp b/src/fix_ave_histo.cpp index af4a8ba57d..438cc5a0e7 100644 --- a/src/fix_ave_histo.cpp +++ b/src/fix_ave_histo.cpp @@ -34,11 +34,6 @@ enum{SCALAR,VECTOR,WINDOW}; enum{DEFAULT,GLOBAL,PERATOM,LOCAL}; enum{IGNORE,END,EXTRA}; -#define INVOKED_SCALAR 1 -#define INVOKED_VECTOR 2 -#define INVOKED_ARRAY 4 -#define INVOKED_PERATOM 8 -#define INVOKED_LOCAL 16 #define BIG 1.0e20 /* ---------------------------------------------------------------------- */ @@ -638,29 +633,29 @@ void FixAveHisto::end_of_step() if (kind == GLOBAL && mode == SCALAR) { if (j == 0) { - if (!(compute->invoked_flag & INVOKED_SCALAR)) { + if (!(compute->invoked_flag & Compute::INVOKED_SCALAR)) { compute->compute_scalar(); - compute->invoked_flag |= INVOKED_SCALAR; + compute->invoked_flag |= Compute::INVOKED_SCALAR; } bin_one(compute->scalar); } else { - if (!(compute->invoked_flag & INVOKED_VECTOR)) { + if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } bin_one(compute->vector[j-1]); } } else if (kind == GLOBAL && mode == VECTOR) { if (j == 0) { - if (!(compute->invoked_flag & INVOKED_VECTOR)) { + if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } bin_vector(compute->size_vector,compute->vector,1); } else { - if (!(compute->invoked_flag & INVOKED_ARRAY)) { + if (!(compute->invoked_flag & Compute::INVOKED_ARRAY)) { compute->compute_array(); - compute->invoked_flag |= INVOKED_ARRAY; + compute->invoked_flag |= Compute::INVOKED_ARRAY; } if (compute->array) bin_vector(compute->size_array_rows,&compute->array[0][j-1], @@ -668,9 +663,9 @@ void FixAveHisto::end_of_step() } } else if (kind == PERATOM) { - if (!(compute->invoked_flag & INVOKED_PERATOM)) { + if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) { compute->compute_peratom(); - compute->invoked_flag |= INVOKED_PERATOM; + compute->invoked_flag |= Compute::INVOKED_PERATOM; } if (j == 0) bin_atoms(compute->vector_atom,1); @@ -678,9 +673,9 @@ void FixAveHisto::end_of_step() bin_atoms(&compute->array_atom[0][j-1],compute->size_peratom_cols); } else if (kind == LOCAL) { - if (!(compute->invoked_flag & INVOKED_LOCAL)) { + if (!(compute->invoked_flag & Compute::INVOKED_LOCAL)) { compute->compute_local(); - compute->invoked_flag |= INVOKED_LOCAL; + compute->invoked_flag |= Compute::INVOKED_LOCAL; } if (j == 0) bin_vector(compute->size_local_rows,compute->vector_local,1); diff --git a/src/fix_ave_histo_weight.cpp b/src/fix_ave_histo_weight.cpp index 61a36819b0..652136f9c6 100644 --- a/src/fix_ave_histo_weight.cpp +++ b/src/fix_ave_histo_weight.cpp @@ -37,11 +37,6 @@ enum{DEFAULT,GLOBAL,PERATOM,LOCAL}; enum{IGNORE,END,EXTRA}; enum{SINGLE,VALUE}; -#define INVOKED_SCALAR 1 -#define INVOKED_VECTOR 2 -#define INVOKED_ARRAY 4 -#define INVOKED_PERATOM 8 -#define INVOKED_LOCAL 16 #define BIG 1.0e20 @@ -155,38 +150,38 @@ void FixAveHistoWeight::end_of_step() if (kind == GLOBAL && mode == SCALAR) { if (j == 0) { - if (!(compute->invoked_flag & INVOKED_SCALAR)) { + if (!(compute->invoked_flag & Compute::INVOKED_SCALAR)) { compute->compute_scalar(); - compute->invoked_flag |= INVOKED_SCALAR; + compute->invoked_flag |= Compute::INVOKED_SCALAR; } weight = compute->scalar; } else { - if (!(compute->invoked_flag & INVOKED_VECTOR)) { + if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } weight = compute->vector[j-1]; } } else if (kind == GLOBAL && mode == VECTOR) { if (j == 0) { - if (!(compute->invoked_flag & INVOKED_VECTOR)) { + if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } weights = compute->vector; stride = 1; } else { - if (!(compute->invoked_flag & INVOKED_ARRAY)) { + if (!(compute->invoked_flag & Compute::INVOKED_ARRAY)) { compute->compute_array(); - compute->invoked_flag |= INVOKED_ARRAY; + compute->invoked_flag |= Compute::INVOKED_ARRAY; } if (compute->array) weights = &compute->array[0][j-1]; stride = compute->size_array_cols; } } else if (kind == PERATOM) { - if (!(compute->invoked_flag & INVOKED_PERATOM)) { + if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) { compute->compute_peratom(); - compute->invoked_flag |= INVOKED_PERATOM; + compute->invoked_flag |= Compute::INVOKED_PERATOM; } if (j == 0) { weights = compute->vector_atom; @@ -196,9 +191,9 @@ void FixAveHistoWeight::end_of_step() stride = compute->size_peratom_cols; } } else if (kind == LOCAL) { - if (!(compute->invoked_flag & INVOKED_LOCAL)) { + if (!(compute->invoked_flag & Compute::INVOKED_LOCAL)) { compute->compute_local(); - compute->invoked_flag |= INVOKED_LOCAL; + compute->invoked_flag |= Compute::INVOKED_LOCAL; } if (j == 0) { weights = compute->vector_local; @@ -283,30 +278,30 @@ void FixAveHistoWeight::end_of_step() Compute *compute = modify->compute[m]; if (kind == GLOBAL && mode == SCALAR) { if (j == 0) { - if (!(compute->invoked_flag & INVOKED_SCALAR)) { + if (!(compute->invoked_flag & Compute::INVOKED_SCALAR)) { compute->compute_scalar(); - compute->invoked_flag |= INVOKED_SCALAR; + compute->invoked_flag |= Compute::INVOKED_SCALAR; } bin_one_weights(compute->scalar,weight); } else { - if (!(compute->invoked_flag & INVOKED_VECTOR)) { + if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } bin_one_weights(compute->vector[j-1],weight); } } else if (kind == GLOBAL && mode == VECTOR) { if (j == 0) { - if (!(compute->invoked_flag & INVOKED_VECTOR)) { + if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } bin_vector_weights(compute->size_vector,compute->vector,1, weights,stride); } else { - if (!(compute->invoked_flag & INVOKED_ARRAY)) { + if (!(compute->invoked_flag & Compute::INVOKED_ARRAY)) { compute->compute_array(); - compute->invoked_flag |= INVOKED_ARRAY; + compute->invoked_flag |= Compute::INVOKED_ARRAY; } if (compute->array) bin_vector_weights(compute->size_array_rows,&compute->array[0][j-1], @@ -314,9 +309,9 @@ void FixAveHistoWeight::end_of_step() } } else if (kind == PERATOM) { - if (!(compute->invoked_flag & INVOKED_PERATOM)) { + if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) { compute->compute_peratom(); - compute->invoked_flag |= INVOKED_PERATOM; + compute->invoked_flag |= Compute::INVOKED_PERATOM; } if (j == 0) bin_atoms_weights(compute->vector_atom,1,weights, stride); @@ -325,9 +320,9 @@ void FixAveHistoWeight::end_of_step() compute->size_peratom_cols,weights,stride); } else if (kind == LOCAL) { - if (!(compute->invoked_flag & INVOKED_LOCAL)) { + if (!(compute->invoked_flag & Compute::INVOKED_LOCAL)) { compute->compute_local(); - compute->invoked_flag |= INVOKED_LOCAL; + compute->invoked_flag |= Compute::INVOKED_LOCAL; } if (j == 0) bin_vector_weights(compute->size_local_rows, diff --git a/src/fix_ave_time.cpp b/src/fix_ave_time.cpp index f74bb8c3f3..5ee46b42f6 100644 --- a/src/fix_ave_time.cpp +++ b/src/fix_ave_time.cpp @@ -35,9 +35,6 @@ enum{COMPUTE,FIX,VARIABLE}; enum{ONE,RUNNING,WINDOW}; enum{SCALAR,VECTOR}; -#define INVOKED_SCALAR 1 -#define INVOKED_VECTOR 2 -#define INVOKED_ARRAY 4 /* ---------------------------------------------------------------------- */ @@ -587,15 +584,15 @@ void FixAveTime::invoke_scalar(bigint ntimestep) Compute *compute = modify->compute[m]; if (argindex[i] == 0) { - if (!(compute->invoked_flag & INVOKED_SCALAR)) { + if (!(compute->invoked_flag & Compute::INVOKED_SCALAR)) { compute->compute_scalar(); - compute->invoked_flag |= INVOKED_SCALAR; + compute->invoked_flag |= Compute::INVOKED_SCALAR; } scalar = compute->scalar; } else { - if (!(compute->invoked_flag & INVOKED_VECTOR)) { + if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } if (varlen[i] && compute->size_vector < argindex[i]) scalar = 0.0; else scalar = compute->vector[argindex[i]-1]; @@ -771,18 +768,18 @@ void FixAveTime::invoke_vector(bigint ntimestep) Compute *compute = modify->compute[m]; if (argindex[j] == 0) { - if (!(compute->invoked_flag & INVOKED_VECTOR)) { + if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } double *cvector = compute->vector; for (i = 0; i < nrows; i++) column[i] = cvector[i]; } else { - if (!(compute->invoked_flag & INVOKED_ARRAY)) { + if (!(compute->invoked_flag & Compute::INVOKED_ARRAY)) { compute->compute_array(); - compute->invoked_flag |= INVOKED_ARRAY; + compute->invoked_flag |= Compute::INVOKED_ARRAY; } double **carray = compute->array; int icol = argindex[j]-1; diff --git a/src/fix_controller.cpp b/src/fix_controller.cpp index 7c07e2a8d2..d9b927a39c 100644 --- a/src/fix_controller.cpp +++ b/src/fix_controller.cpp @@ -27,8 +27,6 @@ using namespace FixConst; enum{COMPUTE,FIX,VARIABLE}; -#define INVOKED_SCALAR 1 -#define INVOKED_VECTOR 2 /* ---------------------------------------------------------------------- */ @@ -200,15 +198,15 @@ void FixController::end_of_step() if (pvwhich == COMPUTE) { if (pvindex == 0) { - if (!(pcompute->invoked_flag & INVOKED_SCALAR)) { + if (!(pcompute->invoked_flag & Compute::INVOKED_SCALAR)) { pcompute->compute_scalar(); - pcompute->invoked_flag |= INVOKED_SCALAR; + pcompute->invoked_flag |= Compute::INVOKED_SCALAR; } current = pcompute->scalar; } else { - if (!(pcompute->invoked_flag & INVOKED_VECTOR)) { + if (!(pcompute->invoked_flag & Compute::INVOKED_VECTOR)) { pcompute->compute_vector(); - pcompute->invoked_flag |= INVOKED_VECTOR; + pcompute->invoked_flag |= Compute::INVOKED_VECTOR; } current = pcompute->vector[pvindex-1]; } diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp index b7c54c1103..216e56eefe 100644 --- a/src/fix_store_state.cpp +++ b/src/fix_store_state.cpp @@ -32,7 +32,6 @@ using namespace FixConst; enum{KEYWORD,COMPUTE,FIX,VARIABLE,DNAME,INAME}; -#define INVOKED_PERATOM 8 /* ---------------------------------------------------------------------- */ @@ -495,9 +494,9 @@ void FixStoreState::end_of_step() if (which[m] == COMPUTE) { Compute *compute = modify->compute[n]; - if (!(compute->invoked_flag & INVOKED_PERATOM)) { + if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) { compute->compute_peratom(); - compute->invoked_flag |= INVOKED_PERATOM; + compute->invoked_flag |= Compute::INVOKED_PERATOM; } if (j == 0) { diff --git a/src/fix_vector.cpp b/src/fix_vector.cpp index c4bf8120e1..dcedd4c3be 100644 --- a/src/fix_vector.cpp +++ b/src/fix_vector.cpp @@ -30,9 +30,6 @@ enum{COMPUTE,FIX,VARIABLE}; enum{ONE,RUNNING,WINDOW}; enum{SCALAR,VECTOR}; -#define INVOKED_SCALAR 1 -#define INVOKED_VECTOR 2 -#define INVOKED_ARRAY 4 /* ---------------------------------------------------------------------- */ @@ -272,15 +269,15 @@ void FixVector::end_of_step() Compute *compute = modify->compute[m]; if (argindex[i] == 0) { - if (!(compute->invoked_flag & INVOKED_SCALAR)) { + if (!(compute->invoked_flag & Compute::INVOKED_SCALAR)) { compute->compute_scalar(); - compute->invoked_flag |= INVOKED_SCALAR; + compute->invoked_flag |= Compute::INVOKED_SCALAR; } result[i] = compute->scalar; } else { - if (!(compute->invoked_flag & INVOKED_VECTOR)) { + if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } result[i] = compute->vector[argindex[i]-1]; } diff --git a/src/modify.cpp b/src/modify.cpp index f3ebb03c38..eab2d82fcf 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -1345,7 +1345,7 @@ int Modify::find_compute(const std::string &id) void Modify::clearstep_compute() { for (int icompute = 0; icompute < ncompute; icompute++) - compute[icompute]->invoked_flag = 0; + compute[icompute]->invoked_flag = Compute::INVOKED_NONE; } /* ---------------------------------------------------------------------- diff --git a/src/thermo.cpp b/src/thermo.cpp index 9197f88084..c58ebe4afc 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -73,9 +73,6 @@ enum{ONELINE,MULTILINE}; enum{INT,FLOAT,BIGINT}; enum{SCALAR,VECTOR,ARRAY}; -#define INVOKED_SCALAR 1 -#define INVOKED_VECTOR 2 -#define INVOKED_ARRAY 4 #define DELTA 8 @@ -339,19 +336,19 @@ void Thermo::compute(int flag) for (i = 0; i < ncompute; i++) if (compute_which[i] == SCALAR) { - if (!(computes[i]->invoked_flag & INVOKED_SCALAR)) { + if (!(computes[i]->invoked_flag & Compute::INVOKED_SCALAR)) { computes[i]->compute_scalar(); - computes[i]->invoked_flag |= INVOKED_SCALAR; + computes[i]->invoked_flag |= Compute::INVOKED_SCALAR; } } else if (compute_which[i] == VECTOR) { - if (!(computes[i]->invoked_flag & INVOKED_VECTOR)) { + if (!(computes[i]->invoked_flag & Compute::INVOKED_VECTOR)) { computes[i]->compute_vector(); - computes[i]->invoked_flag |= INVOKED_VECTOR; + computes[i]->invoked_flag |= Compute::INVOKED_VECTOR; } } else if (compute_which[i] == ARRAY) { - if (!(computes[i]->invoked_flag & INVOKED_ARRAY)) { + if (!(computes[i]->invoked_flag & Compute::INVOKED_ARRAY)) { computes[i]->compute_array(); - computes[i]->invoked_flag |= INVOKED_ARRAY; + computes[i]->invoked_flag |= Compute::INVOKED_ARRAY; } } @@ -1161,9 +1158,9 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (temperature->invoked_scalar != update->ntimestep) error->all(FLERR,"Compute used in variable thermo keyword between runs " "is not current"); - } else if (!(temperature->invoked_flag & INVOKED_SCALAR)) { + } else if (!(temperature->invoked_flag & Compute::INVOKED_SCALAR)) { temperature->compute_scalar(); - temperature->invoked_flag |= INVOKED_SCALAR; + temperature->invoked_flag |= Compute::INVOKED_SCALAR; } compute_temp(); @@ -1175,9 +1172,9 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (pressure->invoked_scalar != update->ntimestep) error->all(FLERR,"Compute used in variable thermo keyword between runs " "is not current"); - } else if (!(pressure->invoked_flag & INVOKED_SCALAR)) { + } else if (!(pressure->invoked_flag & Compute::INVOKED_SCALAR)) { pressure->compute_scalar(); - pressure->invoked_flag |= INVOKED_SCALAR; + pressure->invoked_flag |= Compute::INVOKED_SCALAR; } compute_press(); @@ -1191,7 +1188,7 @@ int Thermo::evaluate_keyword(const char *word, double *answer) "is not current"); } else { pe->compute_scalar(); - pe->invoked_flag |= INVOKED_SCALAR; + pe->invoked_flag |= Compute::INVOKED_SCALAR; } compute_pe(); @@ -1203,9 +1200,9 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (temperature->invoked_scalar != update->ntimestep) error->all(FLERR,"Compute used in variable thermo keyword between runs " "is not current"); - } else if (!(temperature->invoked_flag & INVOKED_SCALAR)) { + } else if (!(temperature->invoked_flag & Compute::INVOKED_SCALAR)) { temperature->compute_scalar(); - temperature->invoked_flag |= INVOKED_SCALAR; + temperature->invoked_flag |= Compute::INVOKED_SCALAR; } compute_ke(); @@ -1219,7 +1216,7 @@ int Thermo::evaluate_keyword(const char *word, double *answer) "is not current"); } else { pe->compute_scalar(); - pe->invoked_flag |= INVOKED_SCALAR; + pe->invoked_flag |= Compute::INVOKED_SCALAR; } if (!temperature) error->all(FLERR,"Thermo keyword in variable requires " @@ -1228,9 +1225,9 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (temperature->invoked_scalar != update->ntimestep) error->all(FLERR,"Compute used in variable thermo keyword between runs " "is not current"); - } else if (!(temperature->invoked_flag & INVOKED_SCALAR)) { + } else if (!(temperature->invoked_flag & Compute::INVOKED_SCALAR)) { temperature->compute_scalar(); - temperature->invoked_flag |= INVOKED_SCALAR; + temperature->invoked_flag |= Compute::INVOKED_SCALAR; } compute_etotal(); @@ -1244,7 +1241,7 @@ int Thermo::evaluate_keyword(const char *word, double *answer) "is not current"); } else { pe->compute_scalar(); - pe->invoked_flag |= INVOKED_SCALAR; + pe->invoked_flag |= Compute::INVOKED_SCALAR; } if (!temperature) error->all(FLERR,"Thermo keyword in variable requires " @@ -1253,9 +1250,9 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (temperature->invoked_scalar != update->ntimestep) error->all(FLERR,"Compute used in variable thermo keyword between runs " "is not current"); - } else if (!(temperature->invoked_flag & INVOKED_SCALAR)) { + } else if (!(temperature->invoked_flag & Compute::INVOKED_SCALAR)) { temperature->compute_scalar(); - temperature->invoked_flag |= INVOKED_SCALAR; + temperature->invoked_flag |= Compute::INVOKED_SCALAR; } if (!pressure) error->all(FLERR,"Thermo keyword in variable requires " @@ -1264,9 +1261,9 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (pressure->invoked_scalar != update->ntimestep) error->all(FLERR,"Compute used in variable thermo keyword between runs " "is not current"); - } else if (!(pressure->invoked_flag & INVOKED_SCALAR)) { + } else if (!(pressure->invoked_flag & Compute::INVOKED_SCALAR)) { pressure->compute_scalar(); - pressure->invoked_flag |= INVOKED_SCALAR; + pressure->invoked_flag |= Compute::INVOKED_SCALAR; } compute_enthalpy(); @@ -1276,7 +1273,7 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (!pe) error->all(FLERR, "Thermo keyword in variable requires thermo to use/init pe"); - pe->invoked_flag |= INVOKED_SCALAR; + pe->invoked_flag |= Compute::INVOKED_SCALAR; compute_evdwl(); } else if (strcmp(word,"ecoul") == 0) { @@ -1285,7 +1282,7 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (!pe) error->all(FLERR, "Thermo keyword in variable requires thermo to use/init pe"); - pe->invoked_flag |= INVOKED_SCALAR; + pe->invoked_flag |= Compute::INVOKED_SCALAR; compute_ecoul(); } else if (strcmp(word,"epair") == 0) { @@ -1294,7 +1291,7 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (!pe) error->all(FLERR, "Thermo keyword in variable requires thermo to use/init pe"); - pe->invoked_flag |= INVOKED_SCALAR; + pe->invoked_flag |= Compute::INVOKED_SCALAR; compute_epair(); } else if (strcmp(word,"ebond") == 0) { @@ -1303,7 +1300,7 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (!pe) error->all(FLERR, "Thermo keyword in variable requires thermo to use/init pe"); - pe->invoked_flag |= INVOKED_SCALAR; + pe->invoked_flag |= Compute::INVOKED_SCALAR; compute_ebond(); } else if (strcmp(word,"eangle") == 0) { @@ -1312,7 +1309,7 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (!pe) error->all(FLERR, "Thermo keyword in variable requires thermo to use/init pe"); - pe->invoked_flag |= INVOKED_SCALAR; + pe->invoked_flag |= Compute::INVOKED_SCALAR; compute_eangle(); } else if (strcmp(word,"edihed") == 0) { @@ -1321,7 +1318,7 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (!pe) error->all(FLERR, "Thermo keyword in variable requires thermo to use/init pe"); - pe->invoked_flag |= INVOKED_SCALAR; + pe->invoked_flag |= Compute::INVOKED_SCALAR; compute_edihed(); } else if (strcmp(word,"eimp") == 0) { @@ -1330,7 +1327,7 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (!pe) error->all(FLERR, "Thermo keyword in variable requires thermo to use/init pe"); - pe->invoked_flag |= INVOKED_SCALAR; + pe->invoked_flag |= Compute::INVOKED_SCALAR; compute_eimp(); } else if (strcmp(word,"emol") == 0) { @@ -1339,7 +1336,7 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (!pe) error->all(FLERR, "Thermo keyword in variable requires thermo to use/init pe"); - pe->invoked_flag |= INVOKED_SCALAR; + pe->invoked_flag |= Compute::INVOKED_SCALAR; compute_emol(); } else if (strcmp(word,"elong") == 0) { @@ -1348,7 +1345,7 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (!pe) error->all(FLERR, "Thermo keyword in variable requires thermo to use/init pe"); - pe->invoked_flag |= INVOKED_SCALAR; + pe->invoked_flag |= Compute::INVOKED_SCALAR; compute_elong(); } else if (strcmp(word,"etail") == 0) { @@ -1385,9 +1382,9 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (pressure->invoked_vector != update->ntimestep) error->all(FLERR,"Compute used in variable thermo keyword between runs " "is not current"); - } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) { + } else if (!(pressure->invoked_flag & Compute::INVOKED_VECTOR)) { pressure->compute_vector(); - pressure->invoked_flag |= INVOKED_VECTOR; + pressure->invoked_flag |= Compute::INVOKED_VECTOR; } compute_pxx(); @@ -1399,9 +1396,9 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (pressure->invoked_vector != update->ntimestep) error->all(FLERR,"Compute used in variable thermo keyword between runs " "is not current"); - } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) { + } else if (!(pressure->invoked_flag & Compute::INVOKED_VECTOR)) { pressure->compute_vector(); - pressure->invoked_flag |= INVOKED_VECTOR; + pressure->invoked_flag |= Compute::INVOKED_VECTOR; } compute_pyy(); @@ -1413,9 +1410,9 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (pressure->invoked_vector != update->ntimestep) error->all(FLERR,"Compute used in variable thermo keyword between runs " "is not current"); - } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) { + } else if (!(pressure->invoked_flag & Compute::INVOKED_VECTOR)) { pressure->compute_vector(); - pressure->invoked_flag |= INVOKED_VECTOR; + pressure->invoked_flag |= Compute::INVOKED_VECTOR; } compute_pzz(); @@ -1427,9 +1424,9 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (pressure->invoked_vector != update->ntimestep) error->all(FLERR,"Compute used in variable thermo keyword between runs " "is not current"); - } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) { + } else if (!(pressure->invoked_flag & Compute::INVOKED_VECTOR)) { pressure->compute_vector(); - pressure->invoked_flag |= INVOKED_VECTOR; + pressure->invoked_flag |= Compute::INVOKED_VECTOR; } compute_pxy(); @@ -1441,9 +1438,9 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (pressure->invoked_vector != update->ntimestep) error->all(FLERR,"Compute used in variable thermo keyword between runs " "is not current"); - } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) { + } else if (!(pressure->invoked_flag & Compute::INVOKED_VECTOR)) { pressure->compute_vector(); - pressure->invoked_flag |= INVOKED_VECTOR; + pressure->invoked_flag |= Compute::INVOKED_VECTOR; } compute_pxz(); @@ -1455,9 +1452,9 @@ int Thermo::evaluate_keyword(const char *word, double *answer) if (pressure->invoked_vector != update->ntimestep) error->all(FLERR,"Compute used in variable thermo keyword between runs " "is not current"); - } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) { + } else if (!(pressure->invoked_flag & Compute::INVOKED_VECTOR)) { pressure->compute_vector(); - pressure->invoked_flag |= INVOKED_VECTOR; + pressure->invoked_flag |= Compute::INVOKED_VECTOR; } compute_pyz(); } diff --git a/src/variable.cpp b/src/variable.cpp index bd5fc6cf8c..bd40920d3c 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -72,10 +72,6 @@ enum{DONE,ADD,SUBTRACT,MULTIPLY,DIVIDE,CARAT,MODULO,UNARY, enum{SUM,XMIN,XMAX,AVE,TRAP,SLOPE}; -#define INVOKED_SCALAR 1 -#define INVOKED_VECTOR 2 -#define INVOKED_ARRAY 4 -#define INVOKED_PERATOM 8 #define BIG 1.0e20 @@ -1380,9 +1376,9 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (compute->invoked_scalar != update->ntimestep) print_var_error(FLERR,"Compute used in variable between " "runs is not current",ivar); - } else if (!(compute->invoked_flag & INVOKED_SCALAR)) { + } else if (!(compute->invoked_flag & Compute::INVOKED_SCALAR)) { compute->compute_scalar(); - compute->invoked_flag |= INVOKED_SCALAR; + compute->invoked_flag |= Compute::INVOKED_SCALAR; } value1 = compute->scalar; @@ -1407,9 +1403,9 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (compute->invoked_vector != update->ntimestep) print_var_error(FLERR,"Compute used in variable between runs " "is not current",ivar); - } else if (!(compute->invoked_flag & INVOKED_VECTOR)) { + } else if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } if (compute->size_vector_variable && @@ -1439,9 +1435,9 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (compute->invoked_array != update->ntimestep) print_var_error(FLERR,"Compute used in variable between runs " "is not current",ivar); - } else if (!(compute->invoked_flag & INVOKED_ARRAY)) { + } else if (!(compute->invoked_flag & Compute::INVOKED_ARRAY)) { compute->compute_array(); - compute->invoked_flag |= INVOKED_ARRAY; + compute->invoked_flag |= Compute::INVOKED_ARRAY; } if (compute->size_array_rows_variable && @@ -1473,9 +1469,9 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (compute->invoked_vector != update->ntimestep) print_var_error(FLERR,"Compute used in variable between " "runs is not current",ivar); - } else if (!(compute->invoked_flag & INVOKED_VECTOR)) { + } else if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } Tree *newtree = new Tree(); @@ -1505,9 +1501,9 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (compute->invoked_array != update->ntimestep) print_var_error(FLERR,"Compute used in variable between " "runs is not current",ivar); - } else if (!(compute->invoked_flag & INVOKED_ARRAY)) { + } else if (!(compute->invoked_flag & Compute::INVOKED_ARRAY)) { compute->compute_array(); - compute->invoked_flag |= INVOKED_ARRAY; + compute->invoked_flag |= Compute::INVOKED_ARRAY; } Tree *newtree = new Tree(); @@ -1529,9 +1525,9 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (compute->invoked_peratom != update->ntimestep) print_var_error(FLERR,"Compute used in variable " "between runs is not current",ivar); - } else if (!(compute->invoked_flag & INVOKED_PERATOM)) { + } else if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) { compute->compute_peratom(); - compute->invoked_flag |= INVOKED_PERATOM; + compute->invoked_flag |= Compute::INVOKED_PERATOM; } peratom2global(1,nullptr,compute->vector_atom,1,index1, @@ -1549,9 +1545,9 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (compute->invoked_peratom != update->ntimestep) print_var_error(FLERR,"Compute used in variable " "between runs is not current",ivar); - } else if (!(compute->invoked_flag & INVOKED_PERATOM)) { + } else if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) { compute->compute_peratom(); - compute->invoked_flag |= INVOKED_PERATOM; + compute->invoked_flag |= Compute::INVOKED_PERATOM; } if (compute->array_atom) @@ -1578,9 +1574,9 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (compute->invoked_peratom != update->ntimestep) print_var_error(FLERR,"Compute used in variable " "between runs is not current",ivar); - } else if (!(compute->invoked_flag & INVOKED_PERATOM)) { + } else if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) { compute->compute_peratom(); - compute->invoked_flag |= INVOKED_PERATOM; + compute->invoked_flag |= Compute::INVOKED_PERATOM; } Tree *newtree = new Tree(); @@ -1610,9 +1606,9 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (compute->invoked_peratom != update->ntimestep) print_var_error(FLERR,"Compute used in variable " "between runs is not current",ivar); - } else if (!(compute->invoked_flag & INVOKED_PERATOM)) { + } else if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) { compute->compute_peratom(); - compute->invoked_flag |= INVOKED_PERATOM; + compute->invoked_flag |= Compute::INVOKED_PERATOM; } Tree *newtree = new Tree(); @@ -4137,9 +4133,9 @@ int Variable::special_function(char *word, char *contents, Tree **tree, if (compute->invoked_vector != update->ntimestep) print_var_error(FLERR,"Compute used in variable between runs " "is not current",ivar); - } else if (!(compute->invoked_flag & INVOKED_VECTOR)) { + } else if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) { compute->compute_vector(); - compute->invoked_flag |= INVOKED_VECTOR; + compute->invoked_flag |= Compute::INVOKED_VECTOR; } nvec = compute->size_vector; nstride = 1; @@ -4151,9 +4147,9 @@ int Variable::special_function(char *word, char *contents, Tree **tree, if (compute->invoked_array != update->ntimestep) print_var_error(FLERR,"Compute used in variable between runs " "is not current",ivar); - } else if (!(compute->invoked_flag & INVOKED_ARRAY)) { + } else if (!(compute->invoked_flag & Compute::INVOKED_ARRAY)) { compute->compute_array(); - compute->invoked_flag |= INVOKED_ARRAY; + compute->invoked_flag |= Compute::INVOKED_ARRAY; } nvec = compute->size_array_rows; nstride = compute->size_array_cols; From 829e5a7f85db840358851cc7729d72b08791f85f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 31 Jan 2021 21:06:35 -0500 Subject: [PATCH 084/384] update docs about the organization of sources and relation between classes --- doc/src/Developer_org.rst | 193 ++++++++++++++++++++------------------ 1 file changed, 104 insertions(+), 89 deletions(-) diff --git a/doc/src/Developer_org.rst b/doc/src/Developer_org.rst index c234cd11cc..6ecccf084d 100644 --- a/doc/src/Developer_org.rst +++ b/doc/src/Developer_org.rst @@ -1,68 +1,75 @@ Source files ------------ -The source files of the LAMMPS code are found in two -directories of the distribution: ``src`` and ``lib``. -Most of the code is C++ but there are small numbers of files -in several other languages. +The source files of the LAMMPS code are found in two directories of the +distribution: ``src`` and ``lib``. Most of the code is written in C++ +but there are small a number of files in several other languages like C, +Fortran, Shell script, or Python. -The core of the code is located in the -``src`` folder and its sub-directories. -A sizable number of these files are in the ``src`` directory -itself, but there are plenty of :doc:`packages `, which can be -included or excluded when LAMMPS is built. See the :doc:`Include -packages in build ` section of the manual for more -information about that part of the build process. LAMMPS currently -supports building with :doc:`conventional makefiles ` and -through :doc:`CMake ` which differ in how packages are -enabled or disabled for a LAMMPS binary. The source files for each +The core of the code is located in the ``src`` folder and its +sub-directories. A sizable number of these files are in the ``src`` +directory itself, but there are plenty of :doc:`packages `, +which can be included or excluded when LAMMPS is built. See the +:doc:`Include packages in build ` section of the manual +for more information about that part of the build process. LAMMPS +currently supports building with :doc:`conventional makefiles +` and through :doc:`CMake `. Those procedures +differ in how packages are enabled or disabled for inclusion into a +LAMMPS binary so they cannot be mixed. The source files for each package are in all-uppercase sub-directories of the ``src`` folder, for example ``src/MOLECULE`` or ``src/USER-MISC``. The ``src/STUBS`` sub-directory is not a package but contains a dummy MPI library, that is used when building a serial version of the code. The ``src/MAKE`` -directory contains makefiles with settings and flags for a variety of -configuration and machines for the build process with traditional -makefiles. +directory and its sub-directories contain makefiles with settings and +flags for a variety of configuration and machines for the build process +with traditional makefiles. The ``lib`` directory contains the source code for several supporting libraries or files with configuration settings to use globally installed -libraries, that are required by some of the optional packages. -Each sub-directory, like ``lib/poems`` or ``lib/gpu``, contains the -source files, some of which are in different languages such as Fortran -or CUDA. These libraries are linked to during a LAMMPS build, if the -corresponding package is installed. +libraries, that are required by some of the optional packages. They may +include python scripts that can transparently download additional source +code on request. Each sub-directory, like ``lib/poems`` or ``lib/gpu``, +contains the source files, some of which are in different languages such +as Fortran or CUDA. These libraries included in the LAMMPS build, +if the corresponding package is installed. LAMMPS C++ source files almost always come in pairs, such as ``src/run.cpp`` (implementation file) and ``src/run.h`` (header file). -Each pair of files defines a C++ -class, for example the :cpp:class:`LAMMPS_NS::Run` class which contains -the code invoked by the :doc:`run ` command in a LAMMPS input script. -As this example illustrates, source file and class names often have a -one-to-one correspondence with a command used in a LAMMPS input script. -Some source files and classes do not have a corresponding input script +Each pair of files defines a C++ class, for example the +:cpp:class:`LAMMPS_NS::Run` class which contains the code invoked by the +:doc:`run ` command in a LAMMPS input script. As this example +illustrates, source file and class names often have a one-to-one +correspondence with a command used in a LAMMPS input script. Some +source files and classes do not have a corresponding input script command, e.g. ``src/force.cpp`` and the :cpp:class:`LAMMPS_NS::Force` class. They are discussed in the next section. -A small number of C++ classes and utility functions are implemented with -only a ``.h`` file. Examples are the Pointer class or the MathVec functions. +The names of all source files are in lower case and may use the +underscore character '_' to separate words. Outside of bundled libraries +which may have different conventions, all C and C++ header files have a +``.h`` extension, all C++ files have a ``.cpp`` extension, and C files a +``.c`` extension. A small number of C++ classes and utility functions +are implemented with only a ``.h`` file. Examples are the Pointer class +or the MathVec functions. Class topology -------------- Though LAMMPS has a lot of source files and classes, its class topology -is relative flat, as outlined in the :ref:`class-topology` figure. Each -name refers to a class and has a pair of associated source files in the -``src`` folder, for example the class :cpp:class:`LAMMPS_NS::Memory` -corresponds to the files ``memory.cpp`` and ``memory.h``, or the class -:cpp:class:`LAMMPS_NS::AtomVec` corresponds to the files -``atom_vec.cpp`` and ``atom_vec.h``. Full lines in the figure represent -compositing: that is the class to the left holds a pointer to an -instance of the class to the right. Dashed lines instead represent -inheritance: the class to the right is derived from the class on the -left. Classes with a red boundary are not instantiated directly, but -they represent the base classes for "styles". Those "styles" make up -the bulk of the LAMMPS code and only a few typical examples are included -in the figure for demonstration purposes. +is not very deep, which can be seen from the :ref:`class-topology` +figure. In that figure, each name refers to a class and has a pair of +associated source files in the ``src`` folder, for example the class +:cpp:class:`LAMMPS_NS::Memory` corresponds to the files ``memory.cpp`` +and ``memory.h``, or the class :cpp:class:`LAMMPS_NS::AtomVec` +corresponds to the files ``atom_vec.cpp`` and ``atom_vec.h``. Full +lines in the figure represent compositing: that is the class at the base +of the arrow holds a pointer to an instance of the class at the tip. +Dashed lines instead represent inheritance: the class to the tip of the +arrow is derived from the class at the base. Classes with a red boundary +are not instantiated directly, but they represent the base classes for +"styles". Those "styles" make up the bulk of the LAMMPS code and only +a few representative examples are included in the figure so it remains +readable. .. _class-topology: .. figure:: JPG/lammps-classes.png @@ -82,69 +89,76 @@ in the figure for demonstration purposes. derived classes, which may also hold instances of other classes. The :cpp:class:`LAMMPS_NS::LAMMPS` class is the topmost class and -represents what is referred to an "instance" of LAMMPS. It is a -composite holding references to instances of other core classes +represents what is generally referred to an "instance" of LAMMPS. It is +a composite holding pointers to instances of other core classes providing the core functionality of the MD engine in LAMMPS and through them abstractions of the required operations. The constructor of the LAMMPS class will instantiate those instances, process the command line flags, initialize MPI (if not already done) and set up file pointers for -input and output. The destructor will shut everything down and free all +input and output. The destructor will shut everything down and free all associated memory. Thus code for the standalone LAMMPS executable in ``main.cpp`` simply initializes MPI, instantiates a single instance of -LAMMPS, and passes it the command line flags and input script. It +LAMMPS while passing it the command line flags and input script. It deletes the LAMMPS instance after the method reading the input returns and shuts down the MPI environment before it exits the executable. The :cpp:class:`LAMMPS_NS::Pointers` is not shown in the -:ref:`class-topology` figure, it holds references to members of the -`LAMMPS_NS::LAMMPS`, so that all classes derived from -:cpp:class:`LAMMPS_NS::Pointers` have direct access to those reference. -From the class topology all classes with blue boundary are referenced in -this class and all classes in the second and third columns, that are not -listed as derived classes are instead derived from -:cpp:class:`LAMMPS_NS::Pointers`. +:ref:`class-topology` figure for clarity. It holds references to many +of the members of the `LAMMPS_NS::LAMMPS`, so that all classes derived +from :cpp:class:`LAMMPS_NS::Pointers` have direct access to those +reference. From the class topology all classes with blue boundary are +referenced in the Pointers class and all classes in the second and third +columns, that are not listed as derived classes are instead derived from +:cpp:class:`LAMMPS_NS::Pointers`. To initialize the pointer references +in Pointers, a pointer to the LAMMPS class instance needs to be passed +to the constructor and thus all constructors for classes derived from it +must do so and pass this pointer to the constructor for Pointers. -Since all storage is encapsulated, the LAMMPS class can also be -instantiated multiple times by a calling code, and that can be either -simultaneously or consecutively. When running in parallel with MPI, -care has to be taken, that suitable communicators are used to not -create conflicts between different instances. +Since all storage is supposed to be encapsulated (there are a few +exceptions), the LAMMPS class can also be instantiated multiple times by +a calling code. Outside of the aforementioned exceptions, those LAMMPS +instances can be used alternately. As of the time of this writing +(early 2021) LAMMPS is not yet sufficiently thread-safe for concurrent +execution. When running in parallel with MPI, care has to be taken, +that suitable copies of communicators are used to not create conflicts +between different instances. -The LAMMPS class currently holds instances of 19 classes representing -different core functionalities There are a handful of virtual parent -classes in LAMMPS that define what LAMMPS calls ``styles``. They are -shaded red in the :ref:`class-topology` figure. Each of these are +The LAMMPS class currently (early 2021) holds instances of 19 classes +representing the core functionality. There are a handful of virtual +parent classes in LAMMPS that define what LAMMPS calls ``styles``. They +are shaded red in the :ref:`class-topology` figure. Each of these are parents of a number of child classes that implement the interface defined by the parent class. There are two main categories of these ``styles``: some may only have one instance active at a time (e.g. atom, pair, bond, angle, dihedral, improper, kspace, comm) and there is a -dedicated pointer variable in the composite class that manages them. +dedicated pointer variable for each of them in the composite class. Setups that require a mix of different such styles have to use a -*hybrid* class that manages and forwards calls to the corresponding -sub-styles for the designated subset of atoms or data. or the composite -class may have lists of class instances, e.g. Modify handles lists of -compute and fix styles, while Output handles dumps class instances. +*hybrid* class that takes the place of the one allowed instance and then +manages and forwards calls to the corresponding sub-styles for the +designated subset of atoms or data. The composite class may also have +lists of class instances, e.g. Modify handles lists of compute and fix +styles, while Output handles a list of dump class instances. -The exception to this scheme are the ``command`` style classes. These -implement specific commands that can be invoked before, after, or between -runs or are commands which launch a simulation. For these an instance -of the class is created, its command() method called and then, after -completion, the class instance deleted. Examples for this are the -create_box, create_atoms, minimize, run, or velocity command styles. +The exception to this scheme are the ``command`` style classes. These +implement specific commands that can be invoked before, after, or in +between runs. For these an instance of the class is created, its +command() method called and then, after completion, the class instance +deleted. Examples for this are the create_box, create_atoms, minimize, +run, or velocity command styles. For all those ``styles`` certain naming conventions are employed: for -the fix nve command the class is called FixNVE and the files are +the fix nve command the class is called FixNVE and the source files are ``fix_nve.h`` and ``fix_nve.cpp``. Similarly for fix ave/time we have -FixAveTime and ``fix_ave_time.h`` and ``fix_ave_time.cpp``. Style names +FixAveTime and ``fix_ave_time.h`` and ``fix_ave_time.cpp``. Style names are lower case and without spaces or special characters. A suffix or -multiple appended with a forward slash '/' denotes a variant of the -corresponding class without the suffix. To connect the style name and -the class name, LAMMPS uses macros like the following ATOM\_CLASS, -PAIR\_CLASS, BOND\_CLASS, REGION\_CLASS, FIX\_CLASS, COMPUTE\_CLASS, -or DUMP\_CLASS in the corresponding header file. During compilation -files with the pattern ``style_name.h`` are created that contain include -statements including all headers of all styles of a given type that -are currently active (or "installed). +words are appended with a forward slash '/' which denotes a variant of +the corresponding class without the suffix. To connect the style name +and the class name, LAMMPS uses macros like: ``AtomStyle()``, +``PairStyle()``, ``BondStyle()``, ``RegionStyle()``, and so on in the +corresponding header file. During configuration or compilation files +with the pattern ``style_.h`` are created that consist of a list +of include statements including all headers of all styles of a given +type that are currently active (or "installed). More details on individual classes in the :ref:`class-topology` are as @@ -152,11 +166,11 @@ follows: - The Memory class handles allocation of all large vectors and arrays. -- The Error class prints all error and warning messages. +- The Error class prints all (terminal) error and warning messages. -- The Universe class sets up partitions of processors so that multiple - simulations can be run, each on a subset of the processors allocated - for a run, e.g. by the mpirun command. +- The Universe class sets up one or more partitions of processors so + that one or multiple simulations can be run, on the processors + allocated for a run, e.g. by the mpirun command. - The Input class reads and processes input input strings and files, stores variables, and invokes :doc:`commands `. @@ -241,7 +255,8 @@ follows: .. TODO section on "Spatial decomposition and parallel operations" .. diagram of 3d processor grid, brick vs. tiled. local vs. ghost .. atoms, 6-way communication with pack/unpack functions, -.. PBC as part of the communication +.. PBC as part of the communication, forward and reverse communication +.. rendezvous communication, ring communication. .. TODO section on "Fixes, Computes, and Variables" .. how and when data is computed and provided and how it is From 0f49ce81c71bd429a9de1a5afdff38304e64999f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 31 Jan 2021 21:47:55 -0500 Subject: [PATCH 085/384] convert some more files --- src/compute_chunk_spread_atom.cpp | 51 +++++--------- src/compute_reduce.cpp | 106 +++++++++++++----------------- src/compute_reduce.h | 3 + src/compute_reduce_chunk.cpp | 77 ++++++++-------------- src/compute_reduce_region.cpp | 43 ++++++------ src/compute_slice.cpp | 66 +++++++------------ 6 files changed, 134 insertions(+), 212 deletions(-) diff --git a/src/compute_chunk_spread_atom.cpp b/src/compute_chunk_spread_atom.cpp index 1e3f9575d7..965c0d5cc7 100644 --- a/src/compute_chunk_spread_atom.cpp +++ b/src/compute_chunk_spread_atom.cpp @@ -13,6 +13,7 @@ #include "compute_chunk_spread_atom.h" +#include "arg_info.h" #include "atom.h" #include "compute.h" #include "compute_chunk_atom.h" @@ -22,12 +23,8 @@ #include "modify.h" #include "update.h" -#include - using namespace LAMMPS_NS; -enum{COMPUTE,FIX}; - #define INVOKED_VECTOR 2 #define INVOKED_ARRAY 4 #define INVOKED_PERATOM 8 @@ -66,36 +63,20 @@ ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) : value2index = new int[nargnew]; nvalues = 0; - iarg = 0; - while (iarg < nargnew) { + for (iarg = 0; iarg < nargnew; iarg++) { ids[nvalues] = nullptr; - if (strncmp(arg[iarg],"c_",2) == 0 || - strncmp(arg[iarg],"f_",2) == 0) { - if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE; - else if (arg[iarg][0] == 'f') which[nvalues] = FIX; + ArgInfo argi(arg[iarg], ArgInfo::COMPUTE|ArgInfo::FIX); - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + which[nvalues] = argi.get_type(); + argindex[nvalues] = argi.get_dim(); + ids[nvalues] = argi.copy_name(); - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Illegal compute chunk/spread/atom command"); - argindex[nvalues] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[nvalues] = 0; + if ((which[nvalues] == ArgInfo::UNKNOWN) || (which[nvalues] == ArgInfo::NONE) + || (argindex[nvalues] > 1)) + error->all(FLERR,"Illegal compute chunk/spread/atom command"); - n = strlen(suffix) + 1; - ids[nvalues] = new char[n]; - strcpy(ids[nvalues],suffix); - nvalues++; - delete [] suffix; - - } else error->all(FLERR,"Illegal compute chunk/spread/atom command"); - - iarg++; + nvalues++; } // if wildcard expansion occurred, free earg memory from expand_args() @@ -110,7 +91,7 @@ ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) : // for fix, assume a global vector or array is per-chunk data for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for compute chunk/spread/atom " @@ -133,7 +114,7 @@ ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) : "is accessed out-of-range"); } - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for compute chunk/spread/atom does not exist"); @@ -190,14 +171,14 @@ void ComputeChunkSpreadAtom::init() // set indices of all computes,fixes,variables for (int m = 0; m < nvalues; m++) { - if (which[m] == COMPUTE) { + if (which[m] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[m]); if (icompute < 0) error->all(FLERR,"Compute ID for compute chunk/spread/atom " "does not exist"); value2index[m] = icompute; - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[m]); if (ifix < 0) error->all(FLERR,"Fix ID for compute chunk/spread/atom does not exist"); @@ -271,7 +252,7 @@ void ComputeChunkSpreadAtom::compute_peratom() // invoke compute if not previously invoked - if (which[m] == COMPUTE) { + if (which[m] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[n]; if (argindex[m] == 0) { @@ -308,7 +289,7 @@ void ComputeChunkSpreadAtom::compute_peratom() // are assuming the fix global vector/array is per-chunk data // check if index exceeds fix output length/rows - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { Fix *fix = modify->fix[n]; if (update->ntimestep % fix->global_freq) error->all(FLERR,"Fix used in compute chunk/spread/atom not " diff --git a/src/compute_reduce.cpp b/src/compute_reduce.cpp index 45c0570239..1a26955858 100644 --- a/src/compute_reduce.cpp +++ b/src/compute_reduce.cpp @@ -13,26 +13,20 @@ #include "compute_reduce.h" -#include - +#include "arg_info.h" #include "atom.h" -#include "update.h" #include "domain.h" -#include "modify.h" +#include "error.h" #include "fix.h" #include "group.h" #include "input.h" -#include "variable.h" #include "memory.h" -#include "error.h" - +#include "modify.h" +#include "update.h" +#include "variable.h" using namespace LAMMPS_NS; -enum{SUM,SUMSQ,MINN,MAXX,AVE,AVESQ}; // also in ComputeReduceRegion -enum{UNKNOWN=-1,X,V,F,COMPUTE,FIX,VARIABLE}; -enum{PERATOM,LOCAL}; - #define INVOKED_VECTOR 2 #define INVOKED_ARRAY 4 #define INVOKED_PERATOM 8 @@ -92,7 +86,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : ids = new char*[nargnew]; value2index = new int[nargnew]; for (int i=0; i < nargnew; ++i) { - which[i] = argindex[i] = flavor[i] = value2index[i] = UNKNOWN; + which[i] = argindex[i] = flavor[i] = value2index[i] = ArgInfo::UNKNOWN; ids[i] = nullptr; } nvalues = 0; @@ -102,61 +96,49 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : ids[nvalues] = nullptr; if (strcmp(arg[iarg],"x") == 0) { - which[nvalues] = X; + which[nvalues] = ArgInfo::X; argindex[nvalues++] = 0; } else if (strcmp(arg[iarg],"y") == 0) { - which[nvalues] = X; + which[nvalues] = ArgInfo::X; argindex[nvalues++] = 1; } else if (strcmp(arg[iarg],"z") == 0) { - which[nvalues] = X; + which[nvalues] = ArgInfo::X; argindex[nvalues++] = 2; } else if (strcmp(arg[iarg],"vx") == 0) { - which[nvalues] = V; + which[nvalues] = ArgInfo::V; argindex[nvalues++] = 0; } else if (strcmp(arg[iarg],"vy") == 0) { - which[nvalues] = V; + which[nvalues] = ArgInfo::V; argindex[nvalues++] = 1; } else if (strcmp(arg[iarg],"vz") == 0) { - which[nvalues] = V; + which[nvalues] = ArgInfo::V; argindex[nvalues++] = 2; } else if (strcmp(arg[iarg],"fx") == 0) { - which[nvalues] = F; + which[nvalues] = ArgInfo::F; argindex[nvalues++] = 0; } else if (strcmp(arg[iarg],"fy") == 0) { - which[nvalues] = F; + which[nvalues] = ArgInfo::F; argindex[nvalues++] = 1; } else if (strcmp(arg[iarg],"fz") == 0) { - which[nvalues] = F; + which[nvalues] = ArgInfo::F; argindex[nvalues++] = 2; - } else if (strncmp(arg[iarg],"c_",2) == 0 || - strncmp(arg[iarg],"f_",2) == 0 || - strncmp(arg[iarg],"v_",2) == 0) { - if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE; - else if (arg[iarg][0] == 'f') which[nvalues] = FIX; - else if (arg[iarg][0] == 'v') which[nvalues] = VARIABLE; + } else { - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + ArgInfo argi(arg[iarg]); - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Illegal compute reduce command"); - argindex[nvalues] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[nvalues] = 0; + which[nvalues] = argi.get_type(); + argindex[nvalues] = argi.get_dim(); + ids[nvalues] = argi.copy_name(); - n = strlen(suffix) + 1; - ids[nvalues] = new char[n]; - strcpy(ids[nvalues],suffix); + if ((which[nvalues] == ArgInfo::UNKNOWN) || (argindex[nvalues] > 1)) + error->all(FLERR,"Illegal compute reduce command"); + + if (which[nvalues] == ArgInfo::NONE) break; nvalues++; - delete [] suffix; - - } else break; + } iarg++; } @@ -203,10 +185,10 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : // setup and error check for (int i = 0; i < nvalues; i++) { - if (which[i] == X || which[i] == V || which[i] == F) + if (which[i] == ArgInfo::X || which[i] == ArgInfo::V || which[i] == ArgInfo::F) flavor[i] = PERATOM; - else if (which[i] == COMPUTE) { + else if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for compute reduce does not exist"); @@ -239,7 +221,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR, "Compute reduce compute calculates global values"); - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for compute reduce does not exist"); @@ -269,7 +251,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Compute reduce fix array is accessed out-of-range"); } else error->all(FLERR,"Compute reduce fix calculates global values"); - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for compute reduce does not exist"); @@ -330,25 +312,25 @@ void ComputeReduce::init() // set indices of all computes,fixes,variables for (int m = 0; m < nvalues; m++) { - if (which[m] == COMPUTE) { + if (which[m] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[m]); if (icompute < 0) error->all(FLERR,"Compute ID for compute reduce does not exist"); value2index[m] = icompute; - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[m]); if (ifix < 0) error->all(FLERR,"Fix ID for compute reduce does not exist"); value2index[m] = ifix; - } else if (which[m] == VARIABLE) { + } else if (which[m] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[m]); if (ivariable < 0) error->all(FLERR,"Variable name for compute reduce does not exist"); value2index[m] = ivariable; - } else value2index[m] = UNKNOWN; + } else value2index[m] = ArgInfo::UNKNOWN; } // set index and check validity of region @@ -475,7 +457,7 @@ double ComputeReduce::compute_one(int m, int flag) // initialization in case it has not yet been run, e.g. when // the compute was invoked right after it has been created - if (vidx == UNKNOWN) { + if (vidx == ArgInfo::UNKNOWN) { init(); vidx = value2index[m]; } @@ -488,19 +470,19 @@ double ComputeReduce::compute_one(int m, int flag) if (mode == MINN) one = BIG; if (mode == MAXX) one = -BIG; - if (which[m] == X) { + if (which[m] == ArgInfo::X) { double **x = atom->x; if (flag < 0) { for (i = 0; i < nlocal; i++) if (mask[i] & groupbit) combine(one,x[i][aidx],i); } else one = x[flag][aidx]; - } else if (which[m] == V) { + } else if (which[m] == ArgInfo::V) { double **v = atom->v; if (flag < 0) { for (i = 0; i < nlocal; i++) if (mask[i] & groupbit) combine(one,v[i][aidx],i); } else one = v[flag][aidx]; - } else if (which[m] == F) { + } else if (which[m] == ArgInfo::F) { double **f = atom->f; if (flag < 0) { for (i = 0; i < nlocal; i++) @@ -509,7 +491,7 @@ double ComputeReduce::compute_one(int m, int flag) // invoke compute if not previously invoked - } else if (which[m] == COMPUTE) { + } else if (which[m] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[vidx]; if (flavor[m] == PERATOM) { @@ -561,7 +543,7 @@ double ComputeReduce::compute_one(int m, int flag) // access fix fields, check if fix frequency is a match - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { if (update->ntimestep % modify->fix[vidx]->peratom_freq) error->all(FLERR,"Fix used in compute reduce not " "computed at compatible time"); @@ -605,7 +587,7 @@ double ComputeReduce::compute_one(int m, int flag) // evaluate atom-style variable - } else if (which[m] == VARIABLE) { + } else if (which[m] == ArgInfo::VARIABLE) { if (atom->nmax > maxatom) { maxatom = atom->nmax; memory->destroy(varatom); @@ -628,9 +610,9 @@ bigint ComputeReduce::count(int m) { int vidx = value2index[m]; - if (which[m] == X || which[m] == V || which[m] == F) + if (which[m] == ArgInfo::X || which[m] == ArgInfo::V || which[m] == ArgInfo::F) return group->count(igroup); - else if (which[m] == COMPUTE) { + else if (which[m] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[vidx]; if (flavor[m] == PERATOM) { return group->count(igroup); @@ -640,7 +622,7 @@ bigint ComputeReduce::count(int m) MPI_Allreduce(&ncount,&ncountall,1,MPI_LMP_BIGINT,MPI_SUM,world); return ncountall; } - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { Fix *fix = modify->fix[vidx]; if (flavor[m] == PERATOM) { return group->count(igroup); @@ -650,7 +632,7 @@ bigint ComputeReduce::count(int m) MPI_Allreduce(&ncount,&ncountall,1,MPI_LMP_BIGINT,MPI_SUM,world); return ncountall; } - } else if (which[m] == VARIABLE) + } else if (which[m] == ArgInfo::VARIABLE) return group->count(igroup); bigint dummy = 0; diff --git a/src/compute_reduce.h b/src/compute_reduce.h index 00c1a9a6b9..53568ac942 100644 --- a/src/compute_reduce.h +++ b/src/compute_reduce.h @@ -26,6 +26,9 @@ namespace LAMMPS_NS { class ComputeReduce : public Compute { public: + enum {SUM,SUMSQ,MINN,MAXX,AVE,AVESQ}; + enum {PERATOM,LOCAL}; + ComputeReduce(class LAMMPS *, int, char **); virtual ~ComputeReduce(); void init(); diff --git a/src/compute_reduce_chunk.cpp b/src/compute_reduce_chunk.cpp index 50e9c767c5..83dbcbe11a 100644 --- a/src/compute_reduce_chunk.cpp +++ b/src/compute_reduce_chunk.cpp @@ -13,24 +13,23 @@ #include "compute_reduce_chunk.h" -#include - +#include "arg_info.h" #include "atom.h" -#include "update.h" -#include "modify.h" -#include "fix.h" #include "compute.h" #include "compute_chunk_atom.h" -#include "input.h" -#include "variable.h" -#include "memory.h" #include "error.h" +#include "fix.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "update.h" +#include "variable.h" +#include using namespace LAMMPS_NS; enum{SUM,MINN,MAXX}; -enum{UNKNOWN=-1,COMPUTE,FIX,VARIABLE}; #define INVOKED_PERATOM 8 @@ -77,43 +76,23 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) : ids = new char*[nargnew]; value2index = new int[nargnew]; for (int i=0; i < nargnew; ++i) { - which[i] = argindex[i] = value2index[i] = UNKNOWN; + which[i] = argindex[i] = value2index[i] = ArgInfo::UNKNOWN; ids[i] = nullptr; } nvalues = 0; - iarg = 0; - while (iarg < nargnew) { - ids[nvalues] = nullptr; + for (iarg = 0; iarg < nargnew; iarg++) { + ArgInfo argi(arg[iarg]); - if (strncmp(arg[iarg],"c_",2) == 0 || - strncmp(arg[iarg],"f_",2) == 0 || - strncmp(arg[iarg],"v_",2) == 0) { - if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE; - else if (arg[iarg][0] == 'f') which[nvalues] = FIX; - else if (arg[iarg][0] == 'v') which[nvalues] = VARIABLE; + which[nvalues] = argi.get_type(); + argindex[nvalues] = argi.get_dim(); + ids[nvalues] = argi.copy_name(); - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + if ((which[nvalues] == ArgInfo::UNKNOWN) || (which[nvalues] == ArgInfo::NONE) + || (argindex[nvalues] > 1)) + error->all(FLERR,"Illegal compute reduce/chunk command"); - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Illegal compute reduce/chunk command"); - argindex[nvalues] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[nvalues] = 0; - - n = strlen(suffix) + 1; - ids[nvalues] = new char[n]; - strcpy(ids[nvalues],suffix); - nvalues++; - delete [] suffix; - - } else error->all(FLERR,"Illegal compute reduce/chunk command"); - - iarg++; + nvalues++; } // if wildcard expansion occurred, free earg memory from expand_args() @@ -126,7 +105,7 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) : // error check for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for compute reduce/chunk does not exist"); @@ -145,7 +124,7 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Compute reduce/chunk compute array is accessed out-of-range"); - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for compute reduce/chunk does not exist"); @@ -163,7 +142,7 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Compute reduce/chunk fix array is " "accessed out-of-range"); - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for compute reduce/chunk does not exist"); @@ -229,19 +208,19 @@ void ComputeReduceChunk::init() // set indices of all computes,fixes,variables for (int m = 0; m < nvalues; m++) { - if (which[m] == COMPUTE) { + if (which[m] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[m]); if (icompute < 0) error->all(FLERR,"Compute ID for compute reduce/chunk does not exist"); value2index[m] = icompute; - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[m]); if (ifix < 0) error->all(FLERR,"Fix ID for compute reduce/chunk does not exist"); value2index[m] = ifix; - } else if (which[m] == VARIABLE) { + } else if (which[m] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[m]); if (ivariable < 0) error->all(FLERR,"Variable name for compute reduce/chunk does not exist"); @@ -366,12 +345,12 @@ void ComputeReduceChunk::compute_one(int m, double *vchunk, int nstride) // initialization in case it has not yet been run, e.g. when // the compute was invoked right after it has been created - if (vidx == UNKNOWN) { + if (vidx == ArgInfo::UNKNOWN) { init(); vidx = value2index[m]; } - if (which[m] == COMPUTE) { + if (which[m] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[vidx]; if (!(compute->invoked_flag & INVOKED_PERATOM)) { @@ -400,7 +379,7 @@ void ComputeReduceChunk::compute_one(int m, double *vchunk, int nstride) // access fix fields, check if fix frequency is a match - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { Fix *fix = modify->fix[vidx]; if (update->ntimestep % fix->peratom_freq) error->all(FLERR,"Fix used in compute reduce/chunk not " @@ -427,7 +406,7 @@ void ComputeReduceChunk::compute_one(int m, double *vchunk, int nstride) // evaluate atom-style variable - } else if (which[m] == VARIABLE) { + } else if (which[m] == ArgInfo::VARIABLE) { if (atom->nmax > maxatom) { memory->destroy(varatom); maxatom = atom->nmax; diff --git a/src/compute_reduce_region.cpp b/src/compute_reduce_region.cpp index 9dabc5c5d8..e6c974b9ef 100644 --- a/src/compute_reduce_region.cpp +++ b/src/compute_reduce_region.cpp @@ -13,24 +13,21 @@ #include "compute_reduce_region.h" +#include "arg_info.h" #include "atom.h" -#include "update.h" -#include "modify.h" #include "domain.h" -#include "group.h" -#include "region.h" -#include "fix.h" -#include "input.h" -#include "variable.h" -#include "memory.h" #include "error.h" +#include "fix.h" +#include "group.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "region.h" +#include "update.h" +#include "variable.h" using namespace LAMMPS_NS; -enum{SUM,SUMSQ,MINN,MAXX,AVE,AVESQ}; // also in ComputeReduce -enum{UNKNOWN=-1,X,V,F,COMPUTE,FIX,VARIABLE}; -enum{PERATOM,LOCAL}; - #define INVOKED_VECTOR 2 #define INVOKED_ARRAY 4 #define INVOKED_PERATOM 8 @@ -72,7 +69,7 @@ double ComputeReduceRegion::compute_one(int m, int flag) // initialization in case it has not yet been run, // e.g. when invoked - if (n == UNKNOWN) { + if (n == ArgInfo::UNKNOWN) { init(); n = value2index[m]; } @@ -83,20 +80,20 @@ double ComputeReduceRegion::compute_one(int m, int flag) if (mode == MINN) one = BIG; if (mode == MAXX) one = -BIG; - if (which[m] == X) { + if (which[m] == ArgInfo::X) { if (flag < 0) { for (i = 0; i < nlocal; i++) if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) combine(one,x[i][j],i); } else one = x[flag][j]; - } else if (which[m] == V) { + } else if (which[m] == ArgInfo::V) { double **v = atom->v; if (flag < 0) { for (i = 0; i < nlocal; i++) if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) combine(one,v[i][j],i); } else one = v[flag][j]; - } else if (which[m] == F) { + } else if (which[m] == ArgInfo::F) { double **f = atom->f; if (flag < 0) { for (i = 0; i < nlocal; i++) @@ -106,7 +103,7 @@ double ComputeReduceRegion::compute_one(int m, int flag) // invoke compute if not previously invoked - } else if (which[m] == COMPUTE) { + } else if (which[m] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[n]; if (flavor[m] == PERATOM) { @@ -160,7 +157,7 @@ double ComputeReduceRegion::compute_one(int m, int flag) // check if fix frequency is a match - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { if (update->ntimestep % modify->fix[n]->peratom_freq) error->all(FLERR,"Fix used in compute reduce not computed at " "compatible time"); @@ -206,7 +203,7 @@ double ComputeReduceRegion::compute_one(int m, int flag) // evaluate atom-style variable - } else if (which[m] == VARIABLE) { + } else if (which[m] == ArgInfo::VARIABLE) { if (atom->nmax > maxatom) { maxatom = atom->nmax; memory->destroy(varatom); @@ -230,9 +227,9 @@ bigint ComputeReduceRegion::count(int m) { int n = value2index[m]; - if (which[m] == X || which[m] == V || which[m] == F) + if (which[m] == ArgInfo::X || which[m] == ArgInfo::V || which[m] == ArgInfo::F) return group->count(igroup,iregion); - else if (which[m] == COMPUTE) { + else if (which[m] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[n]; if (flavor[m] == PERATOM) { return group->count(igroup,iregion); @@ -242,7 +239,7 @@ bigint ComputeReduceRegion::count(int m) MPI_Allreduce(&ncount,&ncountall,1,MPI_DOUBLE,MPI_SUM,world); return ncountall; } - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { Fix *fix = modify->fix[n]; if (flavor[m] == PERATOM) { return group->count(igroup,iregion); @@ -252,7 +249,7 @@ bigint ComputeReduceRegion::count(int m) MPI_Allreduce(&ncount,&ncountall,1,MPI_DOUBLE,MPI_SUM,world); return ncountall; } - } else if (which[m] == VARIABLE) + } else if (which[m] == ArgInfo::VARIABLE) return group->count(igroup,iregion); bigint dummy = 0; diff --git a/src/compute_slice.cpp b/src/compute_slice.cpp index 4de3ad5a9b..8713063fdf 100644 --- a/src/compute_slice.cpp +++ b/src/compute_slice.cpp @@ -13,6 +13,7 @@ #include "compute_slice.h" +#include "arg_info.h" #include "error.h" #include "fix.h" #include "input.h" @@ -21,12 +22,8 @@ #include "update.h" #include "variable.h" -#include - using namespace LAMMPS_NS; -enum{COMPUTE,FIX,VARIABLE}; - #define INVOKED_VECTOR 2 #define INVOKED_ARRAY 4 @@ -56,38 +53,21 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) : nvalues = 0; for (int iarg = 6; iarg < narg; iarg++) { - if (strncmp(arg[iarg],"c_",2) == 0 || - strncmp(arg[iarg],"f_",2) == 0 || - strncmp(arg[iarg],"v_",2) == 0) { - if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE; - else if (arg[iarg][0] == 'f') which[nvalues] = FIX; - else if (arg[iarg][0] == 'v') which[nvalues] = VARIABLE; + ArgInfo argi(arg[iarg]); - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + which[nvalues] = argi.get_type(); + argindex[nvalues] = argi.get_dim(); + ids[nvalues] = argi.copy_name(); - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Illegal compute slice command"); - argindex[nvalues] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[nvalues] = 0; - - n = strlen(suffix) + 1; - ids[nvalues] = new char[n]; - strcpy(ids[nvalues],suffix); - nvalues++; - delete [] suffix; - - } else error->all(FLERR,"Illegal compute slice command"); + if ((which[nvalues] == ArgInfo::UNKNOWN) || (which[nvalues] == ArgInfo::NONE) + || (argindex[nvalues] > 1)) + error->all(FLERR,"Illegal compute slice command"); } // setup and error check for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for compute slice does not exist"); @@ -111,7 +91,7 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Compute slice compute does not calculate " "global vector or array"); - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for compute slice does not exist"); @@ -132,7 +112,7 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Compute slice fix does not calculate " "global vector or array"); - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for compute slice does not exist"); @@ -152,7 +132,7 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) : size_vector = (nstop-nstart) / nskip; memory->create(vector,size_vector,"slice:vector"); - if (which[0] == COMPUTE) { + if (which[0] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[0]); if (argindex[0] == 0) { extvector = modify->compute[icompute]->extvector; @@ -163,7 +143,7 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) : extlist[j++] = modify->compute[icompute]->extlist[i-1]; } } else extvector = modify->compute[icompute]->extarray; - } else if (which[0] == FIX) { + } else if (which[0] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[0]); if (argindex[0] == 0) { extvector = modify->fix[ifix]->extvector; @@ -174,7 +154,7 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) : extlist[j++] = modify->fix[ifix]->extlist[i-1]; } } else extvector = modify->fix[ifix]->extarray; - } else if (which[0] == VARIABLE) { + } else if (which[0] == ArgInfo::VARIABLE) { extvector = 0; } @@ -186,7 +166,7 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) : extarray = 0; for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (argindex[i] == 0) { if (modify->compute[icompute]->extvector == 1) extarray = 1; @@ -197,7 +177,7 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) : } else { if (modify->compute[icompute]->extarray) extarray = 1; } - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (argindex[i] == 0) { if (modify->fix[ifix]->extvector == 1) extarray = 1; @@ -208,7 +188,7 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) : } else { if (modify->fix[ifix]->extarray) extarray = 1; } - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { // variable is always intensive, does not change extarray } } @@ -237,17 +217,17 @@ void ComputeSlice::init() // set indices and check validity of all computes,fixes for (int m = 0; m < nvalues; m++) { - if (which[m] == COMPUTE) { + if (which[m] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[m]); if (icompute < 0) error->all(FLERR,"Compute ID for compute slice does not exist"); value2index[m] = icompute; - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[m]); if (ifix < 0) error->all(FLERR,"Fix ID for compute slice does not exist"); value2index[m] = ifix; - } else if (which[m] == VARIABLE) { + } else if (which[m] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[m]); if (ivariable < 0) error->all(FLERR,"Variable name for compute slice does not exist"); @@ -286,7 +266,7 @@ void ComputeSlice::extract_one(int m, double *vec, int stride) // invoke the appropriate compute if needed - if (which[m] == COMPUTE) { + if (which[m] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[value2index[m]]; if (argindex[m] == 0) { @@ -317,7 +297,7 @@ void ComputeSlice::extract_one(int m, double *vec, int stride) // access fix fields, check if fix frequency is a match - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { if (update->ntimestep % modify->fix[value2index[m]]->global_freq) error->all(FLERR,"Fix used in compute slice not " "computed at compatible time"); @@ -340,7 +320,7 @@ void ComputeSlice::extract_one(int m, double *vec, int stride) // invoke vector-style variable - } else if (which[m] == VARIABLE) { + } else if (which[m] == ArgInfo::VARIABLE) { double *varvec; int nvec = input->variable->compute_vector(value2index[m],&varvec); if (nvec < nstop) From 2882208e0ba42538166b6796a2d40787eaa98e9f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 31 Jan 2021 22:05:33 -0500 Subject: [PATCH 086/384] must report index1 as 0 for type == ArgInfo::NONE --- src/arg_info.cpp | 11 +++++++++-- unittest/utils/test_argutils.cpp | 8 ++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/arg_info.cpp b/src/arg_info.cpp index 2453d6df93..225b822fb9 100644 --- a/src/arg_info.cpp +++ b/src/arg_info.cpp @@ -26,6 +26,7 @@ ArgInfo::ArgInfo(const std::string &arg, int allowed) else if ((arg[0] == 'f') && (allowed & FIX)) type = FIX; else if ((arg[0] == 'v') && (allowed & VARIABLE)) type = VARIABLE; else { + index1 = 0; name = arg; return; } @@ -59,8 +60,14 @@ ArgInfo::ArgInfo(const std::string &arg, int allowed) type = UNKNOWN; } } - } else name = arg.substr(2); - } else name = arg; + } else { + index1 = 0; + name = arg.substr(2); + } + } else { + index1 = 0; + name = arg; + } } /* ---------------------------------------------------------------------- */ diff --git a/unittest/utils/test_argutils.cpp b/unittest/utils/test_argutils.cpp index 4d75526013..ef370c44ea 100644 --- a/unittest/utils/test_argutils.cpp +++ b/unittest/utils/test_argutils.cpp @@ -24,7 +24,7 @@ TEST(ArgInfo, plain) ArgInfo arg("text"); ASSERT_EQ(arg.get_dim(), 0); ASSERT_EQ(arg.get_type(), ArgInfo::NONE); - ASSERT_EQ(arg.get_index1(), -1); + ASSERT_EQ(arg.get_index1(), 0); ASSERT_EQ(arg.get_index2(), -1); ASSERT_THAT(arg.get_name(), StrEq("text")); } @@ -44,7 +44,7 @@ TEST(ArgInfo, compute0) ArgInfo arg("c_text"); ASSERT_EQ(arg.get_dim(), 0); ASSERT_EQ(arg.get_type(), ArgInfo::COMPUTE); - ASSERT_EQ(arg.get_index1(), -1); + ASSERT_EQ(arg.get_index1(), 0); ASSERT_EQ(arg.get_index2(), -1); ASSERT_THAT(arg.get_name(), StrEq("text")); } @@ -74,7 +74,7 @@ TEST(ArgInfo, fix0) ArgInfo arg("f_2"); ASSERT_EQ(arg.get_dim(), 0); ASSERT_EQ(arg.get_type(), ArgInfo::FIX); - ASSERT_EQ(arg.get_index1(), -1); + ASSERT_EQ(arg.get_index1(), 0); ASSERT_EQ(arg.get_index2(), -1); ASSERT_THAT(arg.get_name(), StrEq("2")); } @@ -104,7 +104,7 @@ TEST(ArgInfo, variable0) ArgInfo arg("v_text"); ASSERT_EQ(arg.get_dim(), 0); ASSERT_EQ(arg.get_type(), ArgInfo::VARIABLE); - ASSERT_EQ(arg.get_index1(), -1); + ASSERT_EQ(arg.get_index1(), 0); ASSERT_EQ(arg.get_index2(), -1); ASSERT_THAT(arg.get_name(), StrEq("text")); } From 99184eb65308a0ecc49f86541838f0f6b253b336 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 31 Jan 2021 22:06:06 -0500 Subject: [PATCH 087/384] correctly use index and dim --- src/compute_reduce.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compute_reduce.cpp b/src/compute_reduce.cpp index 1a26955858..de77e25fb2 100644 --- a/src/compute_reduce.cpp +++ b/src/compute_reduce.cpp @@ -130,10 +130,10 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : ArgInfo argi(arg[iarg]); which[nvalues] = argi.get_type(); - argindex[nvalues] = argi.get_dim(); + argindex[nvalues] = argi.get_index1(); ids[nvalues] = argi.copy_name(); - if ((which[nvalues] == ArgInfo::UNKNOWN) || (argindex[nvalues] > 1)) + if ((which[nvalues] == ArgInfo::UNKNOWN) || (argi.get_dim() > 1)) error->all(FLERR,"Illegal compute reduce command"); if (which[nvalues] == ArgInfo::NONE) break; From d5e6bcd9d38a892f11cd7f15c01d668b15aed76e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 31 Jan 2021 22:13:43 -0500 Subject: [PATCH 088/384] correctly check for index and dimensionality --- src/compute_chunk_atom.cpp | 4 ++-- src/compute_chunk_spread_atom.cpp | 4 ++-- src/compute_reduce_chunk.cpp | 4 ++-- src/compute_slice.cpp | 6 ++++-- src/fix_ave_atom.cpp | 4 ++-- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index db16830312..96bb5003f9 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -150,11 +150,11 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : ArgInfo argi(arg[3]); which = argi.get_type(); - argindex = argi.get_dim(); + argindex = argi.get_index1(); cfvid = argi.copy_name(); if ((which == ArgInfo::UNKNOWN) || (which == ArgInfo::NONE) - || (argindex > 1)) + || (argi.get_dim() > 1)) error->all(FLERR,"Illegal compute chunk/atom command"); } diff --git a/src/compute_chunk_spread_atom.cpp b/src/compute_chunk_spread_atom.cpp index 965c0d5cc7..ae7d855dbf 100644 --- a/src/compute_chunk_spread_atom.cpp +++ b/src/compute_chunk_spread_atom.cpp @@ -69,11 +69,11 @@ ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) : ArgInfo argi(arg[iarg], ArgInfo::COMPUTE|ArgInfo::FIX); which[nvalues] = argi.get_type(); - argindex[nvalues] = argi.get_dim(); + argindex[nvalues] = argi.get_index1(); ids[nvalues] = argi.copy_name(); if ((which[nvalues] == ArgInfo::UNKNOWN) || (which[nvalues] == ArgInfo::NONE) - || (argindex[nvalues] > 1)) + || (argi.get_dim() > 1)) error->all(FLERR,"Illegal compute chunk/spread/atom command"); nvalues++; diff --git a/src/compute_reduce_chunk.cpp b/src/compute_reduce_chunk.cpp index 83dbcbe11a..9be88a74d0 100644 --- a/src/compute_reduce_chunk.cpp +++ b/src/compute_reduce_chunk.cpp @@ -85,11 +85,11 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) : ArgInfo argi(arg[iarg]); which[nvalues] = argi.get_type(); - argindex[nvalues] = argi.get_dim(); + argindex[nvalues] = argi.get_index1(); ids[nvalues] = argi.copy_name(); if ((which[nvalues] == ArgInfo::UNKNOWN) || (which[nvalues] == ArgInfo::NONE) - || (argindex[nvalues] > 1)) + || (argi.get_dim() > 1)) error->all(FLERR,"Illegal compute reduce/chunk command"); nvalues++; diff --git a/src/compute_slice.cpp b/src/compute_slice.cpp index 8713063fdf..d8b6ee395a 100644 --- a/src/compute_slice.cpp +++ b/src/compute_slice.cpp @@ -56,12 +56,14 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) : ArgInfo argi(arg[iarg]); which[nvalues] = argi.get_type(); - argindex[nvalues] = argi.get_dim(); + argindex[nvalues] = argi.get_index1(); ids[nvalues] = argi.copy_name(); if ((which[nvalues] == ArgInfo::UNKNOWN) || (which[nvalues] == ArgInfo::NONE) - || (argindex[nvalues] > 1)) + || (argi.get_dim() > 1)) error->all(FLERR,"Illegal compute slice command"); + + nvalues++; } // setup and error check diff --git a/src/fix_ave_atom.cpp b/src/fix_ave_atom.cpp index d59d39a2e8..04163bfa84 100644 --- a/src/fix_ave_atom.cpp +++ b/src/fix_ave_atom.cpp @@ -99,11 +99,11 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) : ArgInfo argi(arg[i]); which[i] = argi.get_type(); - argindex[i] = argi.get_dim(); + argindex[i] = argi.get_index1(); ids[i] = argi.copy_name(); if ((which[i] == ArgInfo::UNKNOWN) || (which[i] == ArgInfo::NONE) - || (argindex[i] > 1)) + || (argi.get_dim() > 1)) error->all(FLERR,"Illegal fix ave/atom command"); } } From 26ea789834d9b251051a3da9130375c0a5ea680c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 31 Jan 2021 23:06:59 -0500 Subject: [PATCH 089/384] add some documentation for the programmer guide and doxygen decorations --- doc/doxygen/Doxyfile.in | 2 + doc/src/Developer_utils.rst | 44 +++++++++++++++++++++ doc/utils/sphinx-config/false_positives.txt | 3 ++ src/arg_info.cpp | 21 ++++++++++ src/arg_info.h | 44 ++++++++++++++++++++- 5 files changed, 113 insertions(+), 1 deletion(-) diff --git a/doc/doxygen/Doxyfile.in b/doc/doxygen/Doxyfile.in index f8a5bc6cdb..49a271355f 100644 --- a/doc/doxygen/Doxyfile.in +++ b/doc/doxygen/Doxyfile.in @@ -424,6 +424,8 @@ INPUT = @LAMMPS_SOURCE_DIR@/utils.cpp \ @LAMMPS_SOURCE_DIR@/input.h \ @LAMMPS_SOURCE_DIR@/tokenizer.cpp \ @LAMMPS_SOURCE_DIR@/tokenizer.h \ + @LAMMPS_SOURCE_DIR@/arg_info.cpp \ + @LAMMPS_SOURCE_DIR@/arg_info.h \ @LAMMPS_SOURCE_DIR@/text_file_reader.cpp \ @LAMMPS_SOURCE_DIR@/text_file_reader.h \ @LAMMPS_SOURCE_DIR@/potential_file_reader.cpp \ diff --git a/doc/src/Developer_utils.rst b/doc/src/Developer_utils.rst index 17b6f13bad..f6e7d64c3e 100644 --- a/doc/src/Developer_utils.rst +++ b/doc/src/Developer_utils.rst @@ -292,6 +292,50 @@ This code example should produce the following output: ---------- + +Argument parsing classes +--------------------------- + +The purpose of argument parsing classes it to simplify and unify how +arguments of commands in LAMMPS are parsed and to make abstractions of +repetitive tasks. + +The :cpp:class:`LAMMPS_NS::ArgInfo` class provides an abstraction +for parsing references to compute or fix styles or variables. These +would start with a "c\_", "f\_", "v\_" followed by the ID or name of +than instance and may be postfixed with one or two array indices +"[]" with numbers > 0. + +A typical code segment would look like this: + +.. code-block:: C++ + :caption: Usage example for ArgInfo class + + int nvalues = 0; + for (iarg = 0; iarg < nargnew; iarg++) { + ArgInfo argi(arg[iarg]); + + which[nvalues] = argi.get_type(); + argindex[nvalues] = argi.get_index1(); + ids[nvalues] = argi.copy_name(); + + if ((which[nvalues] == ArgInfo::UNKNOWN) + || (which[nvalues] == ArgInfo::NONE) + || (argi.get_dim() > 1)) + error->all(FLERR,"Illegal compute XXX command"); + + nvalues++; + } + +---------- + +.. doxygenclass:: LAMMPS_NS::ArgInfo + :project: progguide + :members: + + +---------- + File reader classes ------------------- diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 21582f11f1..e9ba170ac5 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -2478,6 +2478,9 @@ Poresag pos Poschel posix +postfix +postfixed +postfixes Postma Potapkin potin diff --git a/src/arg_info.cpp b/src/arg_info.cpp index 225b822fb9..72dde9a81f 100644 --- a/src/arg_info.cpp +++ b/src/arg_info.cpp @@ -18,6 +18,17 @@ using namespace LAMMPS_NS; +/** Class for processing references to fixes, computes and variables + * + * This class provides an abstraction for the repetitive task of + * parsing arguments that may contain references to fixes, computes, + * or variables. It will identify the name and the index in the first + * and second dimension, if present. + * + * + * \param arg string with possible reference + * \param allowed integer with bitmap of allowed types of references */ + ArgInfo::ArgInfo(const std::string &arg, int allowed) : type(NONE), dim(0), index1(-1), index2(-1) { @@ -72,6 +83,16 @@ ArgInfo::ArgInfo(const std::string &arg, int allowed) /* ---------------------------------------------------------------------- */ +/*! make copy of the ID of the reference as C-style string + * + * The ID is copied into a buffer allocated with "new" and thus + * must be later deleted with "delete []" to avoid a memory leak. + * Because it is a full copy in a newly allocated buffer, the + * lifetime of this string extends beyond the the time the ArgInfo + * class is in scope. + * + * \return copy of string as char * */ + char *ArgInfo::copy_name() { char *dest = new char[name.size()+1]; diff --git a/src/arg_info.h b/src/arg_info.h index ea1208c49b..34924c0796 100644 --- a/src/arg_info.h +++ b/src/arg_info.h @@ -21,7 +21,8 @@ namespace LAMMPS_NS { class ArgInfo { public: - enum { + /*! constants for argument types */ + enum ArgTypes { ERROR =-2, UNKNOWN =-1, NONE = 0, @@ -51,11 +52,52 @@ namespace LAMMPS_NS { virtual ~ArgInfo() {} public: + /*! get type of reference + * + * Return a type constant for the reference. This may be either + * COMPUTE, FIX, VARIABLE (if not restricted to a subset of those + * by the "allowed" argument of the constructor) or NONE, if it + * if not a recognized or allowed reference, or UNKNOWN, in case + * some error happened identifying or parsing the values of the indices + * + * \return integer with a constant from ArgTypes enumerator */ + int get_type() const { return type; } + + /*! get dimension of reference + * + * This will return either 0, 1, 2 depending on whether the + * reference has no, one or two "[]" postfixes. + * + * \return integer with the dimensionality of the reference */ int get_dim() const { return dim; } + + /*! get index of first dimension + * + * This will return the in the first "[]" + * postfix or 0 if there is no postfix. + * + * \return integer with index or the postfix or 0 */ int get_index1() const { return index1; } + + /*! get index of second dimension + * + * This will return the in the second "[]" + * postfix or -1 if there is no second postfix. + * + * \return integer with index of the postfix or -1 */ int get_index2() const { return index2; } + + /*! return reference to the ID or name of the reference + * + * This string is pointing to an internal storage element and + * is only valid to use while the ArgInfo class instance is + * in scope. If you need a long-lived string make a copy + * with copy_name(). + * + * \return C-style char * string */ const char *get_name() const { return name.c_str(); } + char *copy_name(); private: From 6d2d3cc33b379da74c55195852c10298a7bd2edc Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Feb 2021 08:01:11 -0500 Subject: [PATCH 090/384] translated the final compute style to use ArgInfo --- src/compute_global_atom.cpp | 115 ++++++++++++------------------------ 1 file changed, 39 insertions(+), 76 deletions(-) diff --git a/src/compute_global_atom.cpp b/src/compute_global_atom.cpp index d9919b13b2..37c2e038fa 100644 --- a/src/compute_global_atom.cpp +++ b/src/compute_global_atom.cpp @@ -13,6 +13,7 @@ #include "compute_global_atom.h" +#include "arg_info.h" #include "atom.h" #include "error.h" #include "fix.h" @@ -22,11 +23,8 @@ #include "update.h" #include "variable.h" -#include - using namespace LAMMPS_NS; -enum{COMPUTE,FIX,VARIABLE}; enum{VECTOR,ARRAY}; #define INVOKED_VECTOR 2 @@ -49,31 +47,15 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : // process index arg int iarg = 3; + ArgInfo argi(arg[iarg]); - if (strncmp(arg[iarg],"c_",2) == 0 || - strncmp(arg[iarg],"f_",2) == 0 || - strncmp(arg[iarg],"v_",2) == 0) { - if (arg[iarg][0] == 'c') whichref = COMPUTE; - else if (arg[iarg][0] == 'f') whichref = FIX; - else if (arg[iarg][0] == 'v') whichref = VARIABLE; + whichref = argi.get_type(); + indexref = argi.get_index1(); + idref = argi.copy_name(); - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); - - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Illegal compute global/atom command"); - indexref = atoi(ptr+1); - *ptr = '\0'; - } else indexref = 0; - - n = strlen(suffix) + 1; - idref = new char[n]; - strcpy(idref,suffix); - delete [] suffix; - } else error->all(FLERR,"Illegal compute global/atom command"); + if ((whichref == ArgInfo::UNKNOWN) || (which[nvalues] == ArgInfo::NONE) + || (argi.get_dim() > 1)) + error->all(FLERR,"Illegal compute global/atom command"); iarg++; @@ -94,37 +76,18 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : value2index = new int[nargnew]; nvalues = 0; - iarg = 0; - while (iarg < nargnew) { - ids[nvalues] = nullptr; - if (strncmp(arg[iarg],"c_",2) == 0 || - strncmp(arg[iarg],"f_",2) == 0 || - strncmp(arg[iarg],"v_",2) == 0) { - if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE; - else if (arg[iarg][0] == 'f') which[nvalues] = FIX; - else if (arg[iarg][0] == 'v') which[nvalues] = VARIABLE; + for (iarg = 0; iarg < nargnew; iarg++) { + ArgInfo argi(arg[iarg]); - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + which[nvalues] = argi.get_type(); + argindex[nvalues] = argi.get_index1(); + ids[nvalues] = argi.copy_name(); - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Illegal compute global/atom command"); - argindex[nvalues] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[nvalues] = 0; + if ((which[nvalues] == ArgInfo::UNKNOWN) || (which[nvalues] == ArgInfo::NONE) + || (argi.get_dim() > 1)) + error->all(FLERR,"Illegal compute slice command"); - n = strlen(suffix) + 1; - ids[nvalues] = new char[n]; - strcpy(ids[nvalues],suffix); - nvalues++; - delete [] suffix; - - } else error->all(FLERR,"Illegal compute global/atom command"); - - iarg++; + nvalues++; } // if wildcard expansion occurred, free earg memory from expand_args() @@ -136,7 +99,7 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : // setup and error check both index arg and values - if (whichref == COMPUTE) { + if (whichref == ArgInfo::COMPUTE) { int icompute = modify->find_compute(idref); if (icompute < 0) error->all(FLERR,"Compute ID for compute global/atom does not exist"); @@ -155,7 +118,7 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Compute global/atom compute array is accessed out-of-range"); - } else if (whichref == FIX) { + } else if (whichref == ArgInfo::FIX) { int ifix = modify->find_fix(idref); if (ifix < 0) error->all(FLERR,"Fix ID for compute global/atom does not exist"); @@ -173,7 +136,7 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Compute global/atom fix array is accessed out-of-range"); - } else if (whichref == VARIABLE) { + } else if (whichref == ArgInfo::VARIABLE) { int ivariable = input->variable->find(idref); if (ivariable < 0) error->all(FLERR,"Variable name for compute global/atom does not exist"); @@ -183,7 +146,7 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : } for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for compute global/atom does not exist"); @@ -200,7 +163,7 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : "accessed out-of-range"); } - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for compute global/atom does not exist"); @@ -217,7 +180,7 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : "accessed out-of-range"); } - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for compute global/atom " @@ -263,17 +226,17 @@ void ComputeGlobalAtom::init() { // set indices of all computes,fixes,variables - if (whichref == COMPUTE) { + if (whichref == ArgInfo::COMPUTE) { int icompute = modify->find_compute(idref); if (icompute < 0) error->all(FLERR,"Compute ID for compute global/atom does not exist"); ref2index = icompute; - } else if (whichref == FIX) { + } else if (whichref == ArgInfo::FIX) { int ifix = modify->find_fix(idref); if (ifix < 0) error->all(FLERR,"Fix ID for compute global/atom does not exist"); ref2index = ifix; - } else if (whichref == VARIABLE) { + } else if (whichref == ArgInfo::VARIABLE) { int ivariable = input->variable->find(idref); if (ivariable < 0) error->all(FLERR,"Variable name for compute global/atom does not exist"); @@ -281,19 +244,19 @@ void ComputeGlobalAtom::init() } for (int m = 0; m < nvalues; m++) { - if (which[m] == COMPUTE) { + if (which[m] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[m]); if (icompute < 0) error->all(FLERR,"Compute ID for compute global/atom does not exist"); value2index[m] = icompute; - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[m]); if (ifix < 0) error->all(FLERR,"Fix ID for compute global/atom does not exist"); value2index[m] = ifix; - } else if (which[m] == VARIABLE) { + } else if (which[m] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[m]); if (ivariable < 0) error->all(FLERR,"Variable name for compute global/atom " @@ -317,7 +280,7 @@ void ComputeGlobalAtom::compute_peratom() nmax = atom->nmax; memory->destroy(indices); memory->create(indices,nmax,"global/atom:indices"); - if (whichref == VARIABLE) { + if (whichref == ArgInfo::VARIABLE) { memory->destroy(varatom); memory->create(varatom,nmax,"global/atom:varatom"); } @@ -337,7 +300,7 @@ void ComputeGlobalAtom::compute_peratom() int *mask = atom->mask; int nlocal = atom->nlocal; - if (whichref == COMPUTE) { + if (whichref == ArgInfo::COMPUTE) { Compute *compute = modify->compute[ref2index]; if (!(compute->invoked_flag & INVOKED_PERATOM)) { @@ -358,7 +321,7 @@ void ComputeGlobalAtom::compute_peratom() indices[i] = static_cast (compute_array[i][im1]) - 1; } - } else if (whichref == FIX) { + } else if (whichref == ArgInfo::FIX) { if (update->ntimestep % modify->fix[ref2index]->peratom_freq) error->all(FLERR,"Fix used in compute global/atom not " "computed at compatible time"); @@ -377,7 +340,7 @@ void ComputeGlobalAtom::compute_peratom() indices[i] = static_cast (fix_array[i][im1]) - 1; } - } else if (whichref == VARIABLE) { + } else if (whichref == ArgInfo::VARIABLE) { input->variable->compute_atom(ref2index,igroup,varatom,1,0); for (i = 0; i < nlocal; i++) if (mask[i] & groupbit) @@ -394,7 +357,7 @@ void ComputeGlobalAtom::compute_peratom() int vmax; double *source; - if (which[m] == COMPUTE) { + if (which[m] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[value2index[m]]; if (!(compute->invoked_flag & INVOKED_VECTOR)) { @@ -405,7 +368,7 @@ void ComputeGlobalAtom::compute_peratom() source = compute->vector; vmax = compute->size_vector; - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { if (update->ntimestep % modify->fix[value2index[m]]->peratom_freq) error->all(FLERR,"Fix used in compute global/atom not " "computed at compatible time"); @@ -423,7 +386,7 @@ void ComputeGlobalAtom::compute_peratom() source = vecglobal; - } else if (which[m] == VARIABLE) { + } else if (which[m] == ArgInfo::VARIABLE) { vmax = input->variable->compute_vector(value2index[m],&source); } @@ -452,7 +415,7 @@ void ComputeGlobalAtom::compute_peratom() double *source; int col = argindex[m] - 1; - if (which[m] == COMPUTE) { + if (which[m] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[value2index[m]]; if (!(compute->invoked_flag & INVOKED_ARRAY)) { @@ -474,7 +437,7 @@ void ComputeGlobalAtom::compute_peratom() source = vecglobal; - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { if (update->ntimestep % modify->fix[value2index[m]]->peratom_freq) error->all(FLERR,"Fix used in compute global/atom not " "computed at compatible time"); @@ -492,7 +455,7 @@ void ComputeGlobalAtom::compute_peratom() source = vecglobal; - } else if (which[m] == VARIABLE) { + } else if (which[m] == ArgInfo::VARIABLE) { vmax = input->variable->compute_vector(value2index[m],&source); } From 660572a0e61bb28f807b97f0cb5581e15b41abd4 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Feb 2021 09:07:15 -0500 Subject: [PATCH 091/384] add support for processing "d_" and "i_" for DNAME and INAME, respectively --- src/arg_info.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/arg_info.cpp b/src/arg_info.cpp index 72dde9a81f..9e4f572fea 100644 --- a/src/arg_info.cpp +++ b/src/arg_info.cpp @@ -22,9 +22,8 @@ using namespace LAMMPS_NS; * * This class provides an abstraction for the repetitive task of * parsing arguments that may contain references to fixes, computes, - * or variables. It will identify the name and the index in the first - * and second dimension, if present. - * + * variables, or custom per-atom properties. It will identify the name + * and the index value in the first and second dimension, if present. * * \param arg string with possible reference * \param allowed integer with bitmap of allowed types of references */ @@ -36,6 +35,8 @@ ArgInfo::ArgInfo(const std::string &arg, int allowed) if ((arg[0] == 'c') && (allowed & COMPUTE)) type = COMPUTE; else if ((arg[0] == 'f') && (allowed & FIX)) type = FIX; else if ((arg[0] == 'v') && (allowed & VARIABLE)) type = VARIABLE; + else if ((arg[0] == 'd') && (allowed & DNAME)) type = DNAME; + else if ((arg[0] == 'i') && (allowed & INAME)) type = INAME; else { index1 = 0; name = arg; From 3b9f3d989e5c0540d0d4075b9feb5e4841783cea Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Feb 2021 09:08:07 -0500 Subject: [PATCH 092/384] IDs are immutable strings --- src/dump_custom.cpp | 8 ++++---- src/dump_custom.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index d927bca48d..dab19b2c5f 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -1584,7 +1584,7 @@ int DumpCustom::parse_fields(int narg, char **arg) if already in list, do not add, just return index, else add to list ------------------------------------------------------------------------- */ -int DumpCustom::add_compute(char *id) +int DumpCustom::add_compute(const char *id) { int icompute; for (icompute = 0; icompute < ncompute; icompute++) @@ -1609,7 +1609,7 @@ int DumpCustom::add_compute(char *id) if already in list, do not add, just return index, else add to list ------------------------------------------------------------------------- */ -int DumpCustom::add_fix(char *id) +int DumpCustom::add_fix(const char *id) { int ifix; for (ifix = 0; ifix < nfix; ifix++) @@ -1634,7 +1634,7 @@ int DumpCustom::add_fix(char *id) if already in list, do not add, just return index, else add to list ------------------------------------------------------------------------- */ -int DumpCustom::add_variable(char *id) +int DumpCustom::add_variable(const char *id) { int ivariable; for (ivariable = 0; ivariable < nvariable; ivariable++) @@ -1663,7 +1663,7 @@ int DumpCustom::add_variable(char *id) if already in list, do not add, just return index, else add to list ------------------------------------------------------------------------- */ -int DumpCustom::add_custom(char *id, int flag) +int DumpCustom::add_custom(const char *id, int flag) { int icustom; for (icustom = 0; icustom < ncustom; icustom++) diff --git a/src/dump_custom.h b/src/dump_custom.h index 654a87fc6a..2677f21dae 100644 --- a/src/dump_custom.h +++ b/src/dump_custom.h @@ -105,10 +105,10 @@ class DumpCustom : public Dump { double memory_usage(); int parse_fields(int, char **); - int add_compute(char *); - int add_fix(char *); - int add_variable(char *); - int add_custom(char *, int); + int add_compute(const char *); + int add_fix(const char *); + int add_variable(const char *); + int add_custom(const char *, int); virtual int modify_param(int, char **); void header_format_binary(); From fae6fef1ac7a5a35e64e5acc156a94f0c64ebe97 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Feb 2021 09:39:13 -0500 Subject: [PATCH 093/384] add tests for DNAME/INAME argument references --- unittest/utils/test_argutils.cpp | 36 ++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/unittest/utils/test_argutils.cpp b/unittest/utils/test_argutils.cpp index ef370c44ea..d836fc00c4 100644 --- a/unittest/utils/test_argutils.cpp +++ b/unittest/utils/test_argutils.cpp @@ -31,7 +31,7 @@ TEST(ArgInfo, plain) TEST(ArgInfo, copy_name) { - char *name=nullptr; + char *name = nullptr; ArgInfo arg("text"); ASSERT_THAT(arg.get_name(), StrEq("text")); name = arg.copy_name(); @@ -129,12 +129,44 @@ TEST(ArgInfo, variable2) ASSERT_THAT(arg.get_name(), StrEq("x")); } -TEST(ArgInfo, unsupported) +TEST(ArgInfo, dname0) +{ + ArgInfo arg("d_text", ArgInfo::DNAME); + ASSERT_EQ(arg.get_dim(), 0); + ASSERT_EQ(arg.get_type(), ArgInfo::DNAME); + ASSERT_EQ(arg.get_index1(), 0); + ASSERT_EQ(arg.get_index2(), -1); + ASSERT_THAT(arg.get_name(), StrEq("text")); +} + +TEST(ArgInfo, iname0) +{ + ArgInfo arg("i_text", ArgInfo::INAME); + ASSERT_EQ(arg.get_dim(), 0); + ASSERT_EQ(arg.get_type(), ArgInfo::INAME); + ASSERT_EQ(arg.get_index1(), 0); + ASSERT_EQ(arg.get_index2(), -1); + ASSERT_THAT(arg.get_name(), StrEq("text")); +} + +TEST(ArgInfo, unsupported1) { ArgInfo arg("v_text[02][05]", ArgInfo::COMPUTE | ArgInfo::FIX); ASSERT_EQ(arg.get_type(), ArgInfo::NONE); } +TEST(ArgInfo, unsupported2) +{ + ArgInfo arg("d_text"); + ASSERT_EQ(arg.get_type(), ArgInfo::NONE); +} + +TEST(ArgInfo, unsupported3) +{ + ArgInfo arg("i_text"); + ASSERT_EQ(arg.get_type(), ArgInfo::NONE); +} + TEST(ArgInfo, no_bracket1) { ArgInfo arg("v_text[2"); From 55da46f3e3a3c287ab2be62fe59bcd50eb5e5105 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Feb 2021 09:39:50 -0500 Subject: [PATCH 094/384] add ArgInfo support to some dump styles --- src/dump_cfg.cpp | 23 +- src/dump_custom.cpp | 598 ++++++++++++++++++++------------------------ src/dump_local.cpp | 114 ++++----- 3 files changed, 330 insertions(+), 405 deletions(-) diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp index 9829280bb4..ed8df72096 100644 --- a/src/dump_cfg.cpp +++ b/src/dump_cfg.cpp @@ -17,12 +17,15 @@ ------------------------------------------------------------------------- */ #include "dump_cfg.h" -#include + +#include "arg_info.h" #include "atom.h" #include "domain.h" #include "memory.h" #include "error.h" +#include + using namespace LAMMPS_NS; #define UNWRAPEXPAND 10.0 @@ -67,18 +70,14 @@ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) : int i = 0; for (int iarg = 5; iarg < nfield; iarg++, i++) { - if ((strncmp(earg[iarg],"c_",2) == 0 || - strncmp(earg[iarg],"f_",2) == 0 || - strncmp(earg[iarg],"v_",2) == 0) && strchr(earg[iarg],'[')) { - char *ptr = strchr(earg[iarg],'['); - char *ptr2 = strchr(ptr,']'); - auxname[i] = new char[strlen(earg[iarg])]; - *ptr = '\0'; - *ptr2 = '\0'; - strcpy(auxname[i],earg[iarg]); - strcat(auxname[i],"_"); - strcat(auxname[i],ptr+1); + ArgInfo argi(earg[iarg],ArgInfo::COMPUTE|ArgInfo::FIX|ArgInfo::VARIABLE + |ArgInfo::DNAME|ArgInfo::INAME); + if (argi.get_dim() == 1) { + std::string newarg(std::to_string(earg[iarg][0])); + newarg += '_' + argi.get_name() + '_' + std::to_string(argi.get_index1()); + auxname[i] = new char[newarg.size()+1]; + strcpy(auxname[i],newarg.c_str()); } else { auxname[i] = new char[strlen(earg[iarg]) + 1]; strcpy(auxname[i],earg[iarg]); diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index dab19b2c5f..bacf2a51db 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -13,6 +13,7 @@ #include "dump_custom.h" +#include "arg_info.h" #include "atom.h" #include "compute.h" #include "domain.h" @@ -1252,327 +1253,302 @@ int DumpCustom::parse_fields(int narg, char **arg) { // customize by adding to if statement - int i; for (int iarg = 0; iarg < narg; iarg++) { - i = iarg; if (strcmp(arg[iarg],"id") == 0) { - pack_choice[i] = &DumpCustom::pack_id; - if (sizeof(tagint) == sizeof(smallint)) vtype[i] = Dump::INT; - else vtype[i] = Dump::BIGINT; + pack_choice[iarg] = &DumpCustom::pack_id; + if (sizeof(tagint) == sizeof(smallint)) vtype[iarg] = Dump::INT; + else vtype[iarg] = Dump::BIGINT; } else if (strcmp(arg[iarg],"mol") == 0) { if (!atom->molecule_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[i] = &DumpCustom::pack_molecule; - if (sizeof(tagint) == sizeof(smallint)) vtype[i] = Dump::INT; - else vtype[i] = Dump::BIGINT; + pack_choice[iarg] = &DumpCustom::pack_molecule; + if (sizeof(tagint) == sizeof(smallint)) vtype[iarg] = Dump::INT; + else vtype[iarg] = Dump::BIGINT; } else if (strcmp(arg[iarg],"proc") == 0) { - pack_choice[i] = &DumpCustom::pack_proc; - vtype[i] = Dump::INT; + pack_choice[iarg] = &DumpCustom::pack_proc; + vtype[iarg] = Dump::INT; } else if (strcmp(arg[iarg],"procp1") == 0) { - pack_choice[i] = &DumpCustom::pack_procp1; - vtype[i] = Dump::INT; + pack_choice[iarg] = &DumpCustom::pack_procp1; + vtype[iarg] = Dump::INT; } else if (strcmp(arg[iarg],"type") == 0) { - pack_choice[i] = &DumpCustom::pack_type; - vtype[i] = Dump::INT; + pack_choice[iarg] = &DumpCustom::pack_type; + vtype[iarg] = Dump::INT; } else if (strcmp(arg[iarg],"element") == 0) { - pack_choice[i] = &DumpCustom::pack_type; - vtype[i] = Dump::STRING; + pack_choice[iarg] = &DumpCustom::pack_type; + vtype[iarg] = Dump::STRING; } else if (strcmp(arg[iarg],"mass") == 0) { - pack_choice[i] = &DumpCustom::pack_mass; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_mass; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"x") == 0) { - pack_choice[i] = &DumpCustom::pack_x; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_x; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"y") == 0) { - pack_choice[i] = &DumpCustom::pack_y; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_y; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"z") == 0) { - pack_choice[i] = &DumpCustom::pack_z; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_z; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"xs") == 0) { - if (domain->triclinic) pack_choice[i] = &DumpCustom::pack_xs_triclinic; - else pack_choice[i] = &DumpCustom::pack_xs; - vtype[i] = Dump::DOUBLE; + if (domain->triclinic) pack_choice[iarg] = &DumpCustom::pack_xs_triclinic; + else pack_choice[iarg] = &DumpCustom::pack_xs; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"ys") == 0) { - if (domain->triclinic) pack_choice[i] = &DumpCustom::pack_ys_triclinic; - else pack_choice[i] = &DumpCustom::pack_ys; - vtype[i] = Dump::DOUBLE; + if (domain->triclinic) pack_choice[iarg] = &DumpCustom::pack_ys_triclinic; + else pack_choice[iarg] = &DumpCustom::pack_ys; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"zs") == 0) { - if (domain->triclinic) pack_choice[i] = &DumpCustom::pack_zs_triclinic; - else pack_choice[i] = &DumpCustom::pack_zs; - vtype[i] = Dump::DOUBLE; + if (domain->triclinic) pack_choice[iarg] = &DumpCustom::pack_zs_triclinic; + else pack_choice[iarg] = &DumpCustom::pack_zs; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"xu") == 0) { - if (domain->triclinic) pack_choice[i] = &DumpCustom::pack_xu_triclinic; - else pack_choice[i] = &DumpCustom::pack_xu; - vtype[i] = Dump::DOUBLE; + if (domain->triclinic) pack_choice[iarg] = &DumpCustom::pack_xu_triclinic; + else pack_choice[iarg] = &DumpCustom::pack_xu; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"yu") == 0) { - if (domain->triclinic) pack_choice[i] = &DumpCustom::pack_yu_triclinic; - else pack_choice[i] = &DumpCustom::pack_yu; - vtype[i] = Dump::DOUBLE; + if (domain->triclinic) pack_choice[iarg] = &DumpCustom::pack_yu_triclinic; + else pack_choice[iarg] = &DumpCustom::pack_yu; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"zu") == 0) { - if (domain->triclinic) pack_choice[i] = &DumpCustom::pack_zu_triclinic; - else pack_choice[i] = &DumpCustom::pack_zu; - vtype[i] = Dump::DOUBLE; + if (domain->triclinic) pack_choice[iarg] = &DumpCustom::pack_zu_triclinic; + else pack_choice[iarg] = &DumpCustom::pack_zu; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"xsu") == 0) { - if (domain->triclinic) pack_choice[i] = &DumpCustom::pack_xsu_triclinic; - else pack_choice[i] = &DumpCustom::pack_xsu; - vtype[i] = Dump::DOUBLE; + if (domain->triclinic) pack_choice[iarg] = &DumpCustom::pack_xsu_triclinic; + else pack_choice[iarg] = &DumpCustom::pack_xsu; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"ysu") == 0) { - if (domain->triclinic) pack_choice[i] = &DumpCustom::pack_ysu_triclinic; - else pack_choice[i] = &DumpCustom::pack_ysu; - vtype[i] = Dump::DOUBLE; + if (domain->triclinic) pack_choice[iarg] = &DumpCustom::pack_ysu_triclinic; + else pack_choice[iarg] = &DumpCustom::pack_ysu; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"zsu") == 0) { - if (domain->triclinic) pack_choice[i] = &DumpCustom::pack_zsu_triclinic; - else pack_choice[i] = &DumpCustom::pack_zsu; - vtype[i] = Dump::DOUBLE; + if (domain->triclinic) pack_choice[iarg] = &DumpCustom::pack_zsu_triclinic; + else pack_choice[iarg] = &DumpCustom::pack_zsu; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"ix") == 0) { - pack_choice[i] = &DumpCustom::pack_ix; - vtype[i] = Dump::INT; + pack_choice[iarg] = &DumpCustom::pack_ix; + vtype[iarg] = Dump::INT; } else if (strcmp(arg[iarg],"iy") == 0) { - pack_choice[i] = &DumpCustom::pack_iy; - vtype[i] = Dump::INT; + pack_choice[iarg] = &DumpCustom::pack_iy; + vtype[iarg] = Dump::INT; } else if (strcmp(arg[iarg],"iz") == 0) { - pack_choice[i] = &DumpCustom::pack_iz; - vtype[i] = Dump::INT; + pack_choice[iarg] = &DumpCustom::pack_iz; + vtype[iarg] = Dump::INT; } else if (strcmp(arg[iarg],"vx") == 0) { - pack_choice[i] = &DumpCustom::pack_vx; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_vx; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"vy") == 0) { - pack_choice[i] = &DumpCustom::pack_vy; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_vy; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"vz") == 0) { - pack_choice[i] = &DumpCustom::pack_vz; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_vz; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"fx") == 0) { - pack_choice[i] = &DumpCustom::pack_fx; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_fx; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"fy") == 0) { - pack_choice[i] = &DumpCustom::pack_fy; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_fy; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"fz") == 0) { - pack_choice[i] = &DumpCustom::pack_fz; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_fz; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"q") == 0) { if (!atom->q_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[i] = &DumpCustom::pack_q; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_q; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"mux") == 0) { if (!atom->mu_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[i] = &DumpCustom::pack_mux; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_mux; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"muy") == 0) { if (!atom->mu_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[i] = &DumpCustom::pack_muy; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_muy; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"muz") == 0) { if (!atom->mu_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[i] = &DumpCustom::pack_muz; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_muz; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"mu") == 0) { if (!atom->mu_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[i] = &DumpCustom::pack_mu; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_mu; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"radius") == 0) { if (!atom->radius_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[i] = &DumpCustom::pack_radius; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_radius; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"diameter") == 0) { if (!atom->radius_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[i] = &DumpCustom::pack_diameter; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_diameter; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"omegax") == 0) { if (!atom->omega_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[i] = &DumpCustom::pack_omegax; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_omegax; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"omegay") == 0) { if (!atom->omega_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[i] = &DumpCustom::pack_omegay; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_omegay; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"omegaz") == 0) { if (!atom->omega_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[i] = &DumpCustom::pack_omegaz; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_omegaz; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"angmomx") == 0) { if (!atom->angmom_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[i] = &DumpCustom::pack_angmomx; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_angmomx; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"angmomy") == 0) { if (!atom->angmom_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[i] = &DumpCustom::pack_angmomy; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_angmomy; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"angmomz") == 0) { if (!atom->angmom_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[i] = &DumpCustom::pack_angmomz; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_angmomz; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"tqx") == 0) { if (!atom->torque_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[i] = &DumpCustom::pack_tqx; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_tqx; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"tqy") == 0) { if (!atom->torque_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[i] = &DumpCustom::pack_tqy; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_tqy; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"tqz") == 0) { if (!atom->torque_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[i] = &DumpCustom::pack_tqz; - vtype[i] = Dump::DOUBLE; + pack_choice[iarg] = &DumpCustom::pack_tqz; + vtype[iarg] = Dump::DOUBLE; - // compute value = c_ID - // if no trailing [], then arg is set to 0, else arg is int between [] + } else { - } else if (strncmp(arg[iarg],"c_",2) == 0) { - pack_choice[i] = &DumpCustom::pack_compute; - vtype[i] = Dump::DOUBLE; + int n,tmp; + ArgInfo argi(arg[iarg],ArgInfo::COMPUTE|ArgInfo::FIX|ArgInfo::VARIABLE + |ArgInfo::DNAME|ArgInfo::INAME); + argindex[iarg] = argi.get_index1(); - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + switch (argi.get_type()) { - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Invalid attribute in dump custom command"); - argindex[i] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[i] = 0; + case ArgInfo::UNKNOWN: + error->all(FLERR,"Invalid attribute in dump custom command"); + break; - n = modify->find_compute(suffix); - if (n < 0) error->all(FLERR,"Could not find dump custom compute ID"); - if (modify->compute[n]->peratom_flag == 0) - error->all(FLERR,"Dump custom compute does not compute per-atom info"); - if (argindex[i] == 0 && modify->compute[n]->size_peratom_cols > 0) - error->all(FLERR, - "Dump custom compute does not calculate per-atom vector"); - if (argindex[i] > 0 && modify->compute[n]->size_peratom_cols == 0) - error->all(FLERR, - "Dump custom compute does not calculate per-atom array"); - if (argindex[i] > 0 && - argindex[i] > modify->compute[n]->size_peratom_cols) - error->all(FLERR,"Dump custom compute vector is accessed out-of-range"); + // compute value = c_ID + // if no trailing [], then arg is set to 0, else arg is int between [] - field2index[i] = add_compute(suffix); - delete [] suffix; + case ArgInfo::COMPUTE: + pack_choice[iarg] = &DumpCustom::pack_compute; + vtype[iarg] = Dump::DOUBLE; - // fix value = f_ID - // if no trailing [], then arg is set to 0, else arg is between [] + n = modify->find_compute(argi.get_name()); + if (n < 0) error->all(FLERR,"Could not find dump custom compute ID"); + if (modify->compute[n]->peratom_flag == 0) + error->all(FLERR,"Dump custom compute does not compute per-atom info"); + if (argi.get_dim() == 0 && modify->compute[n]->size_peratom_cols > 0) + error->all(FLERR, + "Dump custom compute does not calculate per-atom vector"); + if (argi.get_index1() > 0 && modify->compute[n]->size_peratom_cols == 0) + error->all(FLERR, + "Dump custom compute does not calculate per-atom array"); + if (argi.get_index1() > 0 && + argi.get_index1() > modify->compute[n]->size_peratom_cols) + error->all(FLERR,"Dump custom compute vector is accessed out-of-range"); - } else if (strncmp(arg[iarg],"f_",2) == 0) { - pack_choice[i] = &DumpCustom::pack_fix; - vtype[i] = Dump::DOUBLE; + field2index[iarg] = add_compute(argi.get_name()); + break; - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + // fix value = f_ID + // if no trailing [], then arg is set to 0, else arg is between [] - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Invalid attribute in dump custom command"); - argindex[i] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[i] = 0; + case ArgInfo::FIX: + pack_choice[iarg] = &DumpCustom::pack_fix; + vtype[iarg] = Dump::DOUBLE; - n = modify->find_fix(suffix); - if (n < 0) error->all(FLERR,"Could not find dump custom fix ID"); - if (modify->fix[n]->peratom_flag == 0) - error->all(FLERR,"Dump custom fix does not compute per-atom info"); - if (argindex[i] == 0 && modify->fix[n]->size_peratom_cols > 0) - error->all(FLERR,"Dump custom fix does not compute per-atom vector"); - if (argindex[i] > 0 && modify->fix[n]->size_peratom_cols == 0) - error->all(FLERR,"Dump custom fix does not compute per-atom array"); - if (argindex[i] > 0 && - argindex[i] > modify->fix[n]->size_peratom_cols) - error->all(FLERR,"Dump custom fix vector is accessed out-of-range"); + n = modify->find_fix(argi.get_name()); + if (n < 0) error->all(FLERR,"Could not find dump custom fix ID"); + if (modify->fix[n]->peratom_flag == 0) + error->all(FLERR,"Dump custom fix does not compute per-atom info"); + if (argi.get_dim() == 0 && modify->fix[n]->size_peratom_cols > 0) + error->all(FLERR,"Dump custom fix does not compute per-atom vector"); + if (argi.get_index1() > 0 && modify->fix[n]->size_peratom_cols == 0) + error->all(FLERR,"Dump custom fix does not compute per-atom array"); + if (argi.get_index1() > 0 && + argi.get_index1() > modify->fix[n]->size_peratom_cols) + error->all(FLERR,"Dump custom fix vector is accessed out-of-range"); - field2index[i] = add_fix(suffix); - delete [] suffix; + field2index[iarg] = add_fix(argi.get_name()); + break; - // variable value = v_name + // variable value = v_name - } else if (strncmp(arg[iarg],"v_",2) == 0) { - pack_choice[i] = &DumpCustom::pack_variable; - vtype[i] = Dump::DOUBLE; + case ArgInfo::VARIABLE: + pack_choice[iarg] = &DumpCustom::pack_variable; + vtype[iarg] = Dump::DOUBLE; - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + n = input->variable->find(argi.get_name()); + if (n < 0) error->all(FLERR,"Could not find dump custom variable name"); + if (input->variable->atomstyle(n) == 0) + error->all(FLERR,"Dump custom variable is not atom-style variable"); - argindex[i] = 0; + field2index[iarg] = add_variable(argi.get_name()); + break; - n = input->variable->find(suffix); - if (n < 0) error->all(FLERR,"Could not find dump custom variable name"); - if (input->variable->atomstyle(n) == 0) - error->all(FLERR,"Dump custom variable is not atom-style variable"); + // custom per-atom floating point value = d_ID - field2index[i] = add_variable(suffix); - delete [] suffix; + case ArgInfo::DNAME: + pack_choice[iarg] = &DumpCustom::pack_custom; + vtype[iarg] = Dump::DOUBLE; - // custom per-atom floating point value = d_ID + tmp = -1; + n = atom->find_custom(argi.get_name(),tmp); + if (n < 0) + error->all(FLERR,"Could not find custom per-atom property ID"); - } else if (strncmp(arg[iarg],"d_",2) == 0) { - pack_choice[i] = &DumpCustom::pack_custom; - vtype[i] = Dump::DOUBLE; + if (tmp != 1) + error->all(FLERR,"Custom per-atom property ID is not floating point"); - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); - argindex[i] = 0; + field2index[iarg] = add_custom(argi.get_name(),1); + break; - int tmp = -1; - n = atom->find_custom(suffix,tmp); - if (n < 0) - error->all(FLERR,"Could not find custom per-atom property ID"); + // custom per-atom integer value = i_ID - if (tmp != 1) - error->all(FLERR,"Custom per-atom property ID is not floating point"); + case ArgInfo::INAME: + pack_choice[iarg] = &DumpCustom::pack_custom; + vtype[iarg] = Dump::INT; - field2index[i] = add_custom(suffix,1); - delete [] suffix; + tmp = -1; + n = atom->find_custom(argi.get_name(),tmp); + if (n < 0) + error->all(FLERR,"Could not find custom per-atom property ID"); - // custom per-atom integer value = i_ID + if (tmp != 0) + error->all(FLERR,"Custom per-atom property ID is not integer"); - } else if (strncmp(arg[iarg],"i_",2) == 0) { - pack_choice[i] = &DumpCustom::pack_custom; - vtype[i] = Dump::INT; + field2index[iarg] = add_custom(argi.get_name(),0); + break; - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); - argindex[i] = 0; - - int tmp = -1; - n = atom->find_custom(suffix,tmp); - if (n < 0) - error->all(FLERR,"Could not find custom per-atom property ID"); - - if (tmp != 0) - error->all(FLERR,"Custom per-atom property ID is not integer"); - - field2index[i] = add_custom(suffix,0); - delete [] suffix; - - } else return iarg; + default: + return iarg; + break; + } + } } return narg; @@ -1897,149 +1873,113 @@ int DumpCustom::modify_param(int narg, char **arg) else if (strcmp(arg[1],"tqy") == 0) thresh_array[nthresh] = TQY; else if (strcmp(arg[1],"tqz") == 0) thresh_array[nthresh] = TQZ; - // compute value = c_ID - // if no trailing [], then arg is set to 0, else arg is between [] - // must grow field2index and argindex arrays, since access is beyond nfield + else { + + // must grow field2index and argindex arrays, since access is beyond nfield - else if (strncmp(arg[1],"c_",2) == 0) { - thresh_array[nthresh] = COMPUTE; memory->grow(field2index,nfield+nthresh+1,"dump:field2index"); memory->grow(argindex,nfield+nthresh+1,"dump:argindex"); - int n = strlen(arg[1]); - char *suffix = new char[n]; - strcpy(suffix,&arg[1][2]); - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Invalid attribute in dump modify command"); - argindex[nfield+nthresh] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[nfield+nthresh] = 0; + int n,tmp; + ArgInfo argi(arg[1],ArgInfo::COMPUTE|ArgInfo::FIX|ArgInfo::VARIABLE + |ArgInfo::DNAME|ArgInfo::INAME); + argindex[nfield+nthresh] = argi.get_index1(); - n = modify->find_compute(suffix); - if (n < 0) error->all(FLERR,"Could not find dump modify compute ID"); + switch (argi.get_type()) { - if (modify->compute[n]->peratom_flag == 0) - error->all(FLERR, - "Dump modify compute ID does not compute per-atom info"); - if (argindex[nfield+nthresh] == 0 && - modify->compute[n]->size_peratom_cols > 0) - error->all(FLERR, - "Dump modify compute ID does not compute per-atom vector"); - if (argindex[nfield+nthresh] > 0 && - modify->compute[n]->size_peratom_cols == 0) - error->all(FLERR, - "Dump modify compute ID does not compute per-atom array"); - if (argindex[nfield+nthresh] > 0 && - argindex[nfield+nthresh] > modify->compute[n]->size_peratom_cols) - error->all(FLERR,"Dump modify compute ID vector is not large enough"); + case ArgInfo::UNKNOWN: + error->all(FLERR,"Invalid attribute in dump modify command"); + break; - field2index[nfield+nthresh] = add_compute(suffix); - delete [] suffix; + // compute value = c_ID + // if no trailing [], then arg is set to 0, else arg is between [] - // fix value = f_ID - // if no trailing [], then arg is set to 0, else arg is between [] - // must grow field2index and argindex arrays, since access is beyond nfield + case ArgInfo::COMPUTE: + thresh_array[nthresh] = COMPUTE; + n = modify->find_compute(argi.get_name()); + if (n < 0) error->all(FLERR,"Could not find dump modify compute ID"); - } else if (strncmp(arg[1],"f_",2) == 0) { - thresh_array[nthresh] = FIX; - memory->grow(field2index,nfield+nthresh+1,"dump:field2index"); - memory->grow(argindex,nfield+nthresh+1,"dump:argindex"); - int n = strlen(arg[1]); - char *suffix = new char[n]; - strcpy(suffix,&arg[1][2]); + if (modify->compute[n]->peratom_flag == 0) + error->all(FLERR, + "Dump modify compute ID does not compute per-atom info"); + if (argi.get_dim() == 0 && modify->compute[n]->size_peratom_cols > 0) + error->all(FLERR, + "Dump modify compute ID does not compute per-atom vector"); + if (argi.get_index1() > 0 && modify->compute[n]->size_peratom_cols == 0) + error->all(FLERR, + "Dump modify compute ID does not compute per-atom array"); + if (argi.get_index1() > 0 && + argi.get_index1() > modify->compute[n]->size_peratom_cols) + error->all(FLERR,"Dump modify compute ID vector is not large enough"); - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Invalid attribute in dump modify command"); - argindex[nfield+nthresh] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[nfield+nthresh] = 0; + field2index[nfield+nthresh] = add_compute(argi.get_name()); + break; - n = modify->find_fix(suffix); - if (n < 0) error->all(FLERR,"Could not find dump modify fix ID"); + // fix value = f_ID + // if no trailing [], then arg is set to 0, else arg is between [] - if (modify->fix[n]->peratom_flag == 0) - error->all(FLERR,"Dump modify fix ID does not compute per-atom info"); - if (argindex[nfield+nthresh] == 0 && - modify->fix[n]->size_peratom_cols > 0) - error->all(FLERR,"Dump modify fix ID does not compute per-atom vector"); - if (argindex[nfield+nthresh] > 0 && - modify->fix[n]->size_peratom_cols == 0) + case ArgInfo::FIX: + thresh_array[nthresh] = FIX; + n = modify->find_fix(argi.get_name()); + if (n < 0) error->all(FLERR,"Could not find dump modify fix ID"); + + if (modify->fix[n]->peratom_flag == 0) + error->all(FLERR,"Dump modify fix ID does not compute per-atom info"); + if (argi.get_dim() == 0 && modify->fix[n]->size_peratom_cols > 0) + error->all(FLERR,"Dump modify fix ID does not compute per-atom vector"); + if (argi.get_index1() > 0 && modify->fix[n]->size_peratom_cols == 0) error->all(FLERR,"Dump modify fix ID does not compute per-atom array"); - if (argindex[nfield+nthresh] > 0 && - argindex[nfield+nthresh] > modify->fix[n]->size_peratom_cols) - error->all(FLERR,"Dump modify fix ID vector is not large enough"); + if (argi.get_index1() > 0 && + argi.get_index1() > modify->fix[n]->size_peratom_cols) + error->all(FLERR,"Dump modify fix ID vector is not large enough"); - field2index[nfield+nthresh] = add_fix(suffix); - delete [] suffix; + field2index[nfield+nthresh] = add_fix(argi.get_name()); + break; - // variable value = v_ID - // must grow field2index and argindex arrays, since access is beyond nfield + // variable value = v_ID + // must grow field2index and argindex arrays, since access is beyond nfield - } else if (strncmp(arg[1],"v_",2) == 0) { - thresh_array[nthresh] = VARIABLE; - memory->grow(field2index,nfield+nthresh+1,"dump:field2index"); - memory->grow(argindex,nfield+nthresh+1,"dump:argindex"); - int n = strlen(arg[1]); - char *suffix = new char[n]; - strcpy(suffix,&arg[1][2]); + case ArgInfo::VARIABLE: + thresh_array[nthresh] = VARIABLE; + n = input->variable->find(argi.get_name()); + if (n < 0) error->all(FLERR,"Could not find dump modify variable name"); + if (input->variable->atomstyle(n) == 0) + error->all(FLERR,"Dump modify variable is not atom-style variable"); - argindex[nfield+nthresh] = 0; + field2index[nfield+nthresh] = add_variable(argi.get_name()); + break; - n = input->variable->find(suffix); - if (n < 0) error->all(FLERR,"Could not find dump modify variable name"); - if (input->variable->atomstyle(n) == 0) - error->all(FLERR,"Dump modify variable is not atom-style variable"); + // custom per atom floating point value = d_ID - field2index[nfield+nthresh] = add_variable(suffix); - delete [] suffix; + case ArgInfo::DNAME: + thresh_array[nthresh] = DNAME; + tmp = -1; + n = atom->find_custom(argi.get_name(),tmp); + if ((n < 0) || (tmp != 1)) + error->all(FLERR,"Could not find dump modify " + "custom atom floating point property ID"); - // custom per atom floating point value = d_ID - // must grow field2index and argindex arrays, since access is beyond nfield + field2index[nfield+nthresh] = add_custom(argi.get_name(),1); + break; - } else if (strncmp(arg[1],"d_",2) == 0) { - thresh_array[nthresh] = DNAME; - memory->grow(field2index,nfield+nthresh+1,"dump:field2index"); - memory->grow(argindex,nfield+nthresh+1,"dump:argindex"); - int n = strlen(arg[1]); - char *suffix = new char[n]; - strcpy(suffix,&arg[1][2]); - argindex[nfield+nthresh] = 0; + // custom per atom integer value = i_ID - int tmp = -1; - n = atom->find_custom(suffix,tmp); - if ((n < 0) || (tmp != 1)) - error->all(FLERR,"Could not find dump modify " - "custom atom floating point property ID"); + case ArgInfo::INAME: + thresh_array[nthresh] = INAME; + tmp = -1; + n = atom->find_custom(argi.get_name(),tmp); + if ((n < 0) || (tmp != 0)) + error->all(FLERR,"Could not find dump modify " + "custom atom integer property ID"); - field2index[nfield+nthresh] = add_custom(suffix,1); - delete [] suffix; + field2index[nfield+nthresh] = add_custom(argi.get_name(),0); + break; - // custom per atom integer value = i_ID - // must grow field2index and argindex arrays, since access is beyond nfield - - } else if (strncmp(arg[1],"i_",2) == 0) { - thresh_array[nthresh] = INAME; - memory->grow(field2index,nfield+nthresh+1,"dump:field2index"); - memory->grow(argindex,nfield+nthresh+1,"dump:argindex"); - int n = strlen(arg[1]); - char *suffix = new char[n]; - strcpy(suffix,&arg[1][2]); - argindex[nfield+nthresh] = 0; - - int tmp = -1; - n = atom->find_custom(suffix,tmp); - if ((n < 0) || (tmp != 0)) - error->all(FLERR,"Could not find dump modify " - "custom atom integer property ID"); - - field2index[nfield+nthresh] = add_custom(suffix,0); - delete [] suffix; - - } else error->all(FLERR,"Invalid dump_modify thresh attribute"); + default: + error->all(FLERR,"Invalid dump_modify thresh attribute"); + break; + } + } // set operation type of threshold diff --git a/src/dump_local.cpp b/src/dump_local.cpp index 211d50f49b..0041790063 100644 --- a/src/dump_local.cpp +++ b/src/dump_local.cpp @@ -13,6 +13,7 @@ #include "dump_local.h" +#include "arg_info.h" #include "compute.h" #include "domain.h" #include "error.h" @@ -404,85 +405,70 @@ void DumpLocal::parse_fields(int narg, char **arg) // customize by adding to if statement - int i; for (int iarg = 0; iarg < narg; iarg++) { - i = iarg; if (strcmp(arg[iarg],"index") == 0) { - pack_choice[i] = &DumpLocal::pack_index; - vtype[i] = INT; + pack_choice[iarg] = &DumpLocal::pack_index; + vtype[iarg] = INT; - // compute value = c_ID - // if no trailing [], then arg is set to 0, else arg is int between [] - - } else if (strncmp(arg[iarg],"c_",2) == 0) { + } else { + int n; + ArgInfo argi(arg[iarg],ArgInfo::COMPUTE|ArgInfo::FIX); computefixflag = 1; - pack_choice[i] = &DumpLocal::pack_compute; - vtype[i] = DOUBLE; + vtype[iarg] = DOUBLE; + argindex[iarg] = argi.get_index1(); - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + switch (argi.get_type()) { - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Invalid attribute in dump local command"); - argindex[i] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[i] = 0; + // compute value = c_ID + // if no trailing [], then arg is set to 0, else arg is int between [] - n = modify->find_compute(suffix); - if (n < 0) error->all(FLERR,"Could not find dump local compute ID"); - if (modify->compute[n]->local_flag == 0) - error->all(FLERR,"Dump local compute does not compute local info"); - if (argindex[i] == 0 && modify->compute[n]->size_local_cols > 0) - error->all(FLERR,"Dump local compute does not calculate local vector"); - if (argindex[i] > 0 && modify->compute[n]->size_local_cols == 0) - error->all(FLERR,"Dump local compute does not calculate local array"); - if (argindex[i] > 0 && - argindex[i] > modify->compute[n]->size_local_cols) - error->all(FLERR,"Dump local compute vector is accessed out-of-range"); + case ArgInfo::COMPUTE: + pack_choice[iarg] = &DumpLocal::pack_compute; - field2index[i] = add_compute(suffix); - delete [] suffix; + n = modify->find_compute(argi.get_name()); + if (n < 0) error->all(FLERR,"Could not find dump local compute ID"); + if (modify->compute[n]->local_flag == 0) + error->all(FLERR,"Dump local compute does not compute local info"); + if (argi.get_dim() == 0 && modify->compute[n]->size_local_cols > 0) + error->all(FLERR,"Dump local compute does not calculate local vector"); + if (argi.get_index1() > 0 && modify->compute[n]->size_local_cols == 0) + error->all(FLERR,"Dump local compute does not calculate local array"); + if (argi.get_index1() > 0 && + argi.get_index1() > modify->compute[n]->size_local_cols) + error->all(FLERR,"Dump local compute vector is accessed out-of-range"); - // fix value = f_ID - // if no trailing [], then arg is set to 0, else arg is between [] + field2index[iarg] = add_compute(argi.get_name()); + break; - } else if (strncmp(arg[iarg],"f_",2) == 0) { - computefixflag = 1; - pack_choice[i] = &DumpLocal::pack_fix; - vtype[i] = DOUBLE; + // fix value = f_ID + // if no trailing [], then arg is set to 0, else arg is between [] - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + case ArgInfo::FIX: + pack_choice[iarg] = &DumpLocal::pack_fix; - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Invalid attribute in dump local command"); - argindex[i] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[i] = 0; + n = modify->find_fix(argi.get_name()); + if (n < 0) error->all(FLERR,"Could not find dump local fix ID"); + if (modify->fix[n]->local_flag == 0) + error->all(FLERR,"Dump local fix does not compute local info"); + if (argi.get_dim() == 0 && modify->fix[n]->size_local_cols > 0) + error->all(FLERR,"Dump local fix does not compute local vector"); + if (argi.get_index1() > 0 && modify->fix[n]->size_local_cols == 0) + error->all(FLERR,"Dump local fix does not compute local array"); + if (argi.get_index1() > 0 && + argi.get_index1() > modify->fix[n]->size_local_cols) + error->all(FLERR,"Dump local fix vector is accessed out-of-range"); - n = modify->find_fix(suffix); - if (n < 0) error->all(FLERR,"Could not find dump local fix ID"); - if (modify->fix[n]->local_flag == 0) - error->all(FLERR,"Dump local fix does not compute local info"); - if (argindex[i] == 0 && modify->fix[n]->size_local_cols > 0) - error->all(FLERR,"Dump local fix does not compute local vector"); - if (argindex[i] > 0 && modify->fix[n]->size_local_cols == 0) - error->all(FLERR,"Dump local fix does not compute local array"); - if (argindex[i] > 0 && - argindex[i] > modify->fix[n]->size_local_cols) - error->all(FLERR,"Dump local fix vector is accessed out-of-range"); + field2index[iarg] = add_fix(argi.get_name()); + break; - field2index[i] = add_fix(suffix); - delete [] suffix; - - } else error->all(FLERR,"Invalid attribute in dump local command"); + case ArgInfo::NONE: // fallthrough + case ArgInfo::UNKNOWN: // fallthrough + default: + error->all(FLERR,"Invalid attribute in dump local command"); + break; + } + } } if (computefixflag == 0) From 0e9c44d155a760b756b327e42cf8b4bcfee4a6ae Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Feb 2021 10:12:13 -0500 Subject: [PATCH 095/384] IDs are immutable strings --- src/dump_local.cpp | 4 ++-- src/dump_local.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dump_local.cpp b/src/dump_local.cpp index 0041790063..4a0d4c3a2f 100644 --- a/src/dump_local.cpp +++ b/src/dump_local.cpp @@ -481,7 +481,7 @@ void DumpLocal::parse_fields(int narg, char **arg) if already in list, do not add, just return index, else add to list ------------------------------------------------------------------------- */ -int DumpLocal::add_compute(char *id) +int DumpLocal::add_compute(const char *id) { int icompute; for (icompute = 0; icompute < ncompute; icompute++) @@ -506,7 +506,7 @@ int DumpLocal::add_compute(char *id) if already in list, do not add, just return index, else add to list ------------------------------------------------------------------------- */ -int DumpLocal::add_fix(char *id) +int DumpLocal::add_fix(const char *id) { int ifix; for (ifix = 0; ifix < nfix; ifix++) diff --git a/src/dump_local.h b/src/dump_local.h index 9b15082995..80f0692bb0 100644 --- a/src/dump_local.h +++ b/src/dump_local.h @@ -62,8 +62,8 @@ class DumpLocal : public Dump { virtual void write_data(int, double *); void parse_fields(int, char **); - int add_compute(char *); - int add_fix(char *); + int add_compute(const char *); + int add_fix(const char *); typedef void (DumpLocal::*FnPtrWrite)(int, double *); FnPtrWrite write_choice; // ptr to write data functions From 5c3b88d938a34d7c9d289c1e2f015a0ab319ad13 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Feb 2021 10:14:31 -0500 Subject: [PATCH 096/384] whitespace --- src/arg_info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arg_info.h b/src/arg_info.h index 34924c0796..1a1114f6de 100644 --- a/src/arg_info.h +++ b/src/arg_info.h @@ -97,7 +97,7 @@ namespace LAMMPS_NS { * * \return C-style char * string */ const char *get_name() const { return name.c_str(); } - + char *copy_name(); private: From 9a419154fafcf57cc290aeab7962a1f89c02a12c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Feb 2021 10:15:06 -0500 Subject: [PATCH 097/384] whitespace --- src/USER-MISC/pair_agni.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/USER-MISC/pair_agni.h b/src/USER-MISC/pair_agni.h index 4627d79804..58adc2002d 100644 --- a/src/USER-MISC/pair_agni.h +++ b/src/USER-MISC/pair_agni.h @@ -40,7 +40,7 @@ class PairAGNI : public Pair { double *eta,**xU,*alpha; double sigma,lambda,b,gwidth; int numeta,numtrain,ielement; - + }; protected: From 2b44d671283a0ed2b7211dd80c9fff83a8c1d431 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Feb 2021 18:13:00 -0500 Subject: [PATCH 098/384] consistent dependencies for targes in "doc" folder makefile --- doc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 041c7a372a..aad20461ec 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -94,7 +94,7 @@ $(SPHINXCONFIG)/conf.py: $(SPHINXCONFIG)/conf.py.in -e 's,@LAMMPS_PYTHON_DIR@,$(BUILDDIR)/../python,g' \ -e 's,@LAMMPS_DOC_DIR@,$(BUILDDIR),g' $< > $@ -html: xmlgen $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX) +html: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX) @if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi @$(MAKE) $(MFLAGS) -C graphviz all @(\ @@ -118,7 +118,7 @@ html: xmlgen $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX) @rm -rf html/PDF/.[sg]* @echo "Build finished. The HTML pages are in doc/html." -spelling: xmlgen $(VENV) $(SPHINXCONFIG)/false_positives.txt +spelling: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(SPHINXCONFIG)/false_positives.txt @if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi @(\ . $(VENV)/bin/activate ; env PYTHONWARNINGS= \ From 2ee701f7191b7f84d18adf552fcd86393d279786 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Feb 2021 18:43:42 -0500 Subject: [PATCH 099/384] also flush screen stdio buffer with thermo_modify flush yes --- src/thermo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/thermo.cpp b/src/thermo.cpp index 9197f88084..0e9defd165 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -381,6 +381,7 @@ void Thermo::compute(int flag) if (me == 0) { utils::logmesg(lmp,line); + if (screen && flushflag) fflush(screen); if (logfile && flushflag) fflush(logfile); } From 9ca0653c3ec6445c3a1473c366cc2e377e9b1a2d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 1 Oct 2020 11:26:30 -0400 Subject: [PATCH 100/384] add CodeQL static code analysis workflow --- .github/workflows/codeql-analysis.yml | 50 +++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000000..5e0518e876 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,50 @@ +# GitHub action to run static code analysis on C++ and Python code +name: "CodeQL Code Analysis" + +on: + push: + branches: [master] + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] + language: ['cpp', 'python'] + + steps: + - name: Checkout repository + if: ${{ github.repository == 'lammps/lammps' }} + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.repository == 'lammps/lammps' && github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + if: ${{ github.repository == 'lammps/lammps' }} + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + + - name: Building LAMMPS via CMake + if: ${{ github.repository == 'lammps/lammps' }} + run: | + mkdir build + cd build + cmake -C ../cmake/presets/most.cmake ../cmake -DBUILD_SHARED_LIBS=on + make + + - name: Perform CodeQL Analysis + if: ${{ github.repository == 'lammps/lammps' }} + uses: github/codeql-action/analyze@v1 From c11bd658fc54df6f3c80962e363b1619efb5a381 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Thu, 1 Oct 2020 11:45:13 -0400 Subject: [PATCH 101/384] Add documentation and style check workflow --- .github/workflows/documentation.yml | 21 +++++++++++++++ .github/workflows/style.yml | 42 +++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .github/workflows/documentation.yml create mode 100644 .github/workflows/style.yml diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000000..430657bd85 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,21 @@ +name: documentation +on: + push: + branches: + - master + paths: + - 'doc/*' + +jobs: + build: + continue-on-error: true + runs-on: ubuntu-latest + container: "lammps/buildenv:fedora32_mingw" + steps: + - uses: actions/checkout@master + - name: Generate HTML + run: make -C doc -j 2 html + - name: Generate PDF + run: make -C doc -j 2 pdf + - name: Check Spelling + run: make -C doc -j 2 spelling diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 0000000000..8b9d55b22f --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,42 @@ +name: style +on: + push: + branches: + - master + +jobs: + check_whitespace: + runs-on: ubuntu-latest + steps: + - name: Set up Python 3.6 + uses: actions/setup-python@v2 + with: + python-version: 3.6 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install --upgrade pyyaml + sudo apt install -y ninja-build + - uses: actions/checkout@master + - name: Configure + run: cmake -B build -G Ninja -D Python3_EXECUTABLE=$(which python) -S cmake + - name: Check for whitespace errors + run: cmake --build build --target check-whitespace + + check_permissions: + runs-on: ubuntu-latest + steps: + - name: Set up Python 3.6 + uses: actions/setup-python@v2 + with: + python-version: 3.6 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install --upgrade pyyaml + sudo apt install -y ninja-build + - uses: actions/checkout@master + - name: Configure + run: cmake -B build -G Ninja -D Python3_EXECUTABLE=$(which python) -S cmake + - name: Check file permissions + run: cmake --build build --target check-permissions From 60a11b9ea1278503988f90149ee29f51ab7b2e2f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 1 Oct 2020 12:21:09 -0400 Subject: [PATCH 102/384] do parallel compilation --- .github/workflows/codeql-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5e0518e876..e84483ff6c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -43,7 +43,7 @@ jobs: mkdir build cd build cmake -C ../cmake/presets/most.cmake ../cmake -DBUILD_SHARED_LIBS=on - make + make -j2 - name: Perform CodeQL Analysis if: ${{ github.repository == 'lammps/lammps' }} From 0be1a419c7538251db35f05bdb4567c1470885b5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 1 Oct 2020 12:52:23 -0400 Subject: [PATCH 103/384] split codeql workflow into two files as no compilation is needed for python --- .../{codeql-analysis.yml => codeql-cpp.yml} | 2 +- .github/workflows/codeql-python.yml | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) rename .github/workflows/{codeql-analysis.yml => codeql-cpp.yml} (97%) create mode 100644 .github/workflows/codeql-python.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-cpp.yml similarity index 97% rename from .github/workflows/codeql-analysis.yml rename to .github/workflows/codeql-cpp.yml index e84483ff6c..dcaab19d29 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-cpp.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] - language: ['cpp', 'python'] + language: ['cpp'] steps: - name: Checkout repository diff --git a/.github/workflows/codeql-python.yml b/.github/workflows/codeql-python.yml new file mode 100644 index 0000000000..2d4a4992ed --- /dev/null +++ b/.github/workflows/codeql-python.yml @@ -0,0 +1,42 @@ +# GitHub action to run static code analysis on C++ and Python code +name: "CodeQL Code Analysis" + +on: + push: + branches: [master] + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] + language: ['python'] + + steps: + - name: Checkout repository + if: ${{ github.repository == 'lammps/lammps' }} + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.repository == 'lammps/lammps' && github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + if: ${{ github.repository == 'lammps/lammps' }} + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + + - name: Perform CodeQL Analysis + if: ${{ github.repository == 'lammps/lammps' }} + uses: github/codeql-action/analyze@v1 From b15555724d4c466f51565712a99e6073b17394e1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 1 Oct 2020 14:15:28 -0400 Subject: [PATCH 104/384] combine analysis and simplify --- ...{codeql-python.yml => codeql-analysis.yml} | 14 ++++-- .github/workflows/codeql-cpp.yml | 50 ------------------- 2 files changed, 9 insertions(+), 55 deletions(-) rename .github/workflows/{codeql-python.yml => codeql-analysis.yml} (74%) delete mode 100644 .github/workflows/codeql-cpp.yml diff --git a/.github/workflows/codeql-python.yml b/.github/workflows/codeql-analysis.yml similarity index 74% rename from .github/workflows/codeql-python.yml rename to .github/workflows/codeql-analysis.yml index 2d4a4992ed..a74f5fe12f 100644 --- a/.github/workflows/codeql-python.yml +++ b/.github/workflows/codeql-analysis.yml @@ -8,17 +8,17 @@ on: jobs: analyze: name: Analyze + if: ${{ github.repository == 'lammps/lammps' }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] - language: ['python'] + language: ['cpp', 'python'] steps: - name: Checkout repository - if: ${{ github.repository == 'lammps/lammps' }} uses: actions/checkout@v2 with: # We must fetch at least the immediate parents so that if this is @@ -28,15 +28,19 @@ jobs: # If this run was triggered by a pull request event, then checkout # the head of the pull request instead of the merge commit. - run: git checkout HEAD^2 - if: ${{ github.repository == 'lammps/lammps' && github.event_name == 'pull_request' }} + if: ${{ github.event_name == 'pull_request' }} # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - if: ${{ github.repository == 'lammps/lammps' }} uses: github/codeql-action/init@v1 with: languages: ${{ matrix.language }} + - name: Building LAMMPS via CMake + if: ${{ matrix.language == 'cpp' }} + run: | + cmake -B build -C cmake/presets/most.cmake cmake -DBUILD_SHARED_LIBS=on + make -C build -j2 + - name: Perform CodeQL Analysis - if: ${{ github.repository == 'lammps/lammps' }} uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/codeql-cpp.yml b/.github/workflows/codeql-cpp.yml deleted file mode 100644 index dcaab19d29..0000000000 --- a/.github/workflows/codeql-cpp.yml +++ /dev/null @@ -1,50 +0,0 @@ -# GitHub action to run static code analysis on C++ and Python code -name: "CodeQL Code Analysis" - -on: - push: - branches: [master] - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] - language: ['cpp'] - - steps: - - name: Checkout repository - if: ${{ github.repository == 'lammps/lammps' }} - uses: actions/checkout@v2 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.repository == 'lammps/lammps' && github.event_name == 'pull_request' }} - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - if: ${{ github.repository == 'lammps/lammps' }} - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - - - name: Building LAMMPS via CMake - if: ${{ github.repository == 'lammps/lammps' }} - run: | - mkdir build - cd build - cmake -C ../cmake/presets/most.cmake ../cmake -DBUILD_SHARED_LIBS=on - make -j2 - - - name: Perform CodeQL Analysis - if: ${{ github.repository == 'lammps/lammps' }} - uses: github/codeql-action/analyze@v1 From 88e182da646ed62e1a71d800d380cf71ef71a2ef Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 1 Oct 2020 19:01:28 -0400 Subject: [PATCH 105/384] speed up compilation for static code analysis by switching to debug build type and turning off optimization --- .github/workflows/codeql-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a74f5fe12f..4bf207b49b 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,7 +39,7 @@ jobs: - name: Building LAMMPS via CMake if: ${{ matrix.language == 'cpp' }} run: | - cmake -B build -C cmake/presets/most.cmake cmake -DBUILD_SHARED_LIBS=on + cmake -B build -C cmake/presets/most.cmake cmake -DCMAKE_BUILD_TYPE=Debug make -C build -j2 - name: Perform CodeQL Analysis From a83fe46860992a6e299c33e23588e73a10a5d7dc Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 1 Oct 2020 21:56:30 -0400 Subject: [PATCH 106/384] spelling target needs conf.py --- doc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index aad20461ec..6032aff45f 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -118,7 +118,7 @@ html: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX) @rm -rf html/PDF/.[sg]* @echo "Build finished. The HTML pages are in doc/html." -spelling: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(SPHINXCONFIG)/false_positives.txt +spelling: xmlgen $(SPHINXCONFIG)/conf.py $(VENV) $(SPHINXCONFIG)/false_positives.txt @if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi @(\ . $(VENV)/bin/activate ; env PYTHONWARNINGS= \ From 6d836d8f302e9368a69474aabdc8dda3476b1e4c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 1 Oct 2020 21:56:53 -0400 Subject: [PATCH 107/384] run documentation actions in parallel --- .github/workflows/documentation.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 430657bd85..9a85f4897d 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -11,11 +11,10 @@ jobs: continue-on-error: true runs-on: ubuntu-latest container: "lammps/buildenv:fedora32_mingw" + strategy: + matrix: + target: ['html', 'pdf', 'spelling'] steps: - uses: actions/checkout@master - - name: Generate HTML - run: make -C doc -j 2 html - - name: Generate PDF - run: make -C doc -j 2 pdf - - name: Check Spelling - run: make -C doc -j 2 spelling + - name: Generate ${{ matrix.target }} + run: make -C doc ${{ matrix.target }} From bfe64629fd8ae61980bf6f08a21dc682b61f9009 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 Feb 2021 20:30:32 -0500 Subject: [PATCH 108/384] switch to do CodeQL analysis and Unittest on MacOS. currently for PRs and master --- .github/workflows/codeql-analysis.yml | 23 ++++++++------- .github/workflows/documentation.yml | 20 ------------- .github/workflows/style.yml | 42 --------------------------- .github/workflows/unittest-macos.yml | 36 +++++++++++++++++++++++ 4 files changed, 49 insertions(+), 72 deletions(-) delete mode 100644 .github/workflows/documentation.yml delete mode 100644 .github/workflows/style.yml create mode 100644 .github/workflows/unittest-macos.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 4bf207b49b..7507db07ef 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -4,6 +4,8 @@ name: "CodeQL Code Analysis" on: push: branches: [master] + pull_request: + branches: [master] jobs: analyze: @@ -14,33 +16,34 @@ jobs: strategy: fail-fast: false matrix: - # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] language: ['cpp', 'python'] steps: - name: Checkout repository uses: actions/checkout@v2 with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. fetch-depth: 2 - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: languages: ${{ matrix.language }} + - name: Create Build Environment + run: cmake -E make_directory ${{github.workspace}}/build + - name: Building LAMMPS via CMake if: ${{ matrix.language == 'cpp' }} + shell: bash + working-directory: ${{github.workspace}}/build run: | - cmake -B build -C cmake/presets/most.cmake cmake -DCMAKE_BUILD_TYPE=Debug - make -C build -j2 + cmake -C $GITHUB_WORKSPACE/cmake/presets/most.cmake $GITHUB_WORKSPACE/cmake + cmake --build . --parallel 2 - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml deleted file mode 100644 index 9a85f4897d..0000000000 --- a/.github/workflows/documentation.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: documentation -on: - push: - branches: - - master - paths: - - 'doc/*' - -jobs: - build: - continue-on-error: true - runs-on: ubuntu-latest - container: "lammps/buildenv:fedora32_mingw" - strategy: - matrix: - target: ['html', 'pdf', 'spelling'] - steps: - - uses: actions/checkout@master - - name: Generate ${{ matrix.target }} - run: make -C doc ${{ matrix.target }} diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml deleted file mode 100644 index 8b9d55b22f..0000000000 --- a/.github/workflows/style.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: style -on: - push: - branches: - - master - -jobs: - check_whitespace: - runs-on: ubuntu-latest - steps: - - name: Set up Python 3.6 - uses: actions/setup-python@v2 - with: - python-version: 3.6 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install --upgrade pyyaml - sudo apt install -y ninja-build - - uses: actions/checkout@master - - name: Configure - run: cmake -B build -G Ninja -D Python3_EXECUTABLE=$(which python) -S cmake - - name: Check for whitespace errors - run: cmake --build build --target check-whitespace - - check_permissions: - runs-on: ubuntu-latest - steps: - - name: Set up Python 3.6 - uses: actions/setup-python@v2 - with: - python-version: 3.6 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install --upgrade pyyaml - sudo apt install -y ninja-build - - uses: actions/checkout@master - - name: Configure - run: cmake -B build -G Ninja -D Python3_EXECUTABLE=$(which python) -S cmake - - name: Check file permissions - run: cmake --build build --target check-permissions diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml new file mode 100644 index 0000000000..ed3b9562a5 --- /dev/null +++ b/.github/workflows/unittest-macos.yml @@ -0,0 +1,36 @@ +# GitHub action to build LAMMPS on MacOS and run unit tests +name: "Unittest for MacOS" + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + name: MacOS Unit Test + if: ${{ github.repository == 'lammps/lammps' }} + runs-on: macos-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 2 + + - name: Create Build Environment + run: cmake -E make_directory ${{github.workspace}}/build + + - name: Building LAMMPS via CMake + shell: bash + working-directory: ${{github.workspace}}/build + run: | + cmake -C $GITHUB_WORKSPACE/cmake/presets/most.cmake $GITHUB_WORKSPACE/cmake \ + -DENABLE_TESTING=ON -DBUILD_SHARED_LIBS=ON -DLAMMPS_EXCEPTIONS=ON + cmake --build . --parallel 2 + + - name: Run Tests + working-directory: ${{github.workspace}}/build + shell: bash + run: ctest -V From 4d98d9f6aae6eea2cf4757163f7c84f2435df864 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Feb 2021 11:29:08 -0500 Subject: [PATCH 109/384] add arginfo to fix saed/vtk --- src/USER-DIFFRACTION/fix_saed_vtk.cpp | 111 ++++++++++---------------- src/USER-DIFFRACTION/fix_saed_vtk.h | 2 - 2 files changed, 40 insertions(+), 73 deletions(-) diff --git a/src/USER-DIFFRACTION/fix_saed_vtk.cpp b/src/USER-DIFFRACTION/fix_saed_vtk.cpp index 9c3666b426..af78b9443f 100644 --- a/src/USER-DIFFRACTION/fix_saed_vtk.cpp +++ b/src/USER-DIFFRACTION/fix_saed_vtk.cpp @@ -18,6 +18,8 @@ #include "fix_saed_vtk.h" +#include "arg_info.h" +#include "comm.h" #include "compute.h" #include "compute_saed.h" #include "domain.h" @@ -31,7 +33,6 @@ using namespace LAMMPS_NS; using namespace FixConst; -enum{COMPUTE}; enum{ONE,RUNNING,WINDOW}; enum{FIRST,MULTI}; @@ -45,84 +46,52 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : { if (narg < 7) error->all(FLERR,"Illegal fix saed/vtk command"); - MPI_Comm_rank(world,&me); - nevery = utils::inumeric(FLERR,arg[3],false,lmp); nrepeat = utils::inumeric(FLERR,arg[4],false,lmp); nfreq = utils::inumeric(FLERR,arg[5],false,lmp); global_freq = nfreq; - - nvalues = 0; - int iarg = 6; - while (iarg < narg) { - if (strncmp(arg[iarg],"c_",2) == 0) { - nvalues++; - iarg++; - } else break; - } - if (nvalues != 1) error->all(FLERR,"Illegal fix saed/vtk command"); - options(narg,arg); - which = 0; - ids = nullptr; + ArgInfo argi(arg[6],ArgInfo::COMPUTE); - nvalues = 0; + if ((argi.get_type() == ArgInfo::NONE) + || (argi.get_type() == ArgInfo::UNKNOWN) + || (argi.get_dim() != 0) ) + error->all(FLERR,"Illegal fix saed/vtk command"); - iarg = 6; - while (iarg < narg) { - if (strncmp(arg[iarg],"c_",2) == 0) { + ids = argi.copy_name(); + int icompute = modify->find_compute(ids); + if (icompute < 0) + error->all(FLERR,"Compute ID for fix saed/vtk does not exist"); - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + // Check that specified compute is for SAED + compute_saed = (ComputeSAED *) modify->compute[icompute]; + if (strcmp(compute_saed->style,"saed") != 0) + error->all(FLERR,"Fix saed/vtk has invalid compute assigned"); - char *ptr = strchr(suffix,'['); - if (ptr) error->all(FLERR,"Illegal fix saed/vtk command"); + // Gather variables from specified compute_saed + double *saed_var = compute_saed->saed_var; + lambda = saed_var[0]; + Kmax = saed_var[1]; + Zone[0] = saed_var[2]; + Zone[1] = saed_var[3]; + Zone[2] = saed_var[4]; + c[0] = saed_var[5]; + c[1] = saed_var[6]; + c[2] = saed_var[7]; + dR_Ewald = saed_var[8]; + double manual_double = saed_var[9]; + manual = false; + if (manual_double == 1) manual = true; - n = strlen(suffix) + 1; - ids = new char[n]; - strcpy(ids,suffix); - delete [] suffix; + // Standard error check for fix/ave/time + if (compute_saed->vector_flag == 0) + error->all(FLERR,"Fix saed/vtk compute does not calculate a vector"); + if (compute_saed->extvector != 0) + error->all(FLERR,"Illegal fix saed/vtk command"); - int icompute = modify->find_compute(ids); - if (icompute < 0) - error->all(FLERR,"Compute ID for fix saed/vtk does not exist"); - - Compute *compute = modify->compute[icompute]; - - // Check that specified compute is for SAED - compute_saed = (ComputeSAED*) modify->compute[icompute]; - if (strcmp(compute_saed->style,"saed") != 0) - error->all(FLERR,"Fix saed/vtk has invalid compute assigned"); - - // Gather variables from specified compute_saed - double *saed_var = compute_saed->saed_var; - lambda = saed_var[0]; - Kmax = saed_var[1]; - Zone[0] = saed_var[2]; - Zone[1] = saed_var[3]; - Zone[2] = saed_var[4]; - c[0] = saed_var[5]; - c[1] = saed_var[6]; - c[2] = saed_var[7]; - dR_Ewald = saed_var[8]; - double manual_double = saed_var[9]; - manual = false; - if (manual_double == 1) manual = true; - - // Standard error check for fix/ave/time - if (compute->vector_flag == 0) - error->all(FLERR,"Fix saed/vtk compute does not calculate a vector"); - if (compute->extvector != 0) - error->all(FLERR,"Illegal fix saed/vtk command"); - - nrows = compute->size_vector; - nvalues++; - iarg++; - } else break; - } + nrows = compute_saed->size_vector; // setup and error check // for fix inputs, check that fix frequency is acceptable @@ -140,7 +109,7 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : vector_list = nullptr; if (ave == WINDOW) - memory->create(vector_list,nwindow,nvalues,"saed/vtk:vector_list"); + memory->create(vector_list,nwindow,1,"saed/vtk:vector_list"); memory->create(vector,nrows,"saed/vtk:vector"); memory->create(vector_total,nrows,"saed/vtk:vector_total"); @@ -284,7 +253,7 @@ FixSAEDVTK::~FixSAEDVTK() delete [] ids; memory->destroy(vector); memory->destroy(vector_total); - if (fp && me == 0) fclose(fp); + if (fp && comm->me == 0) fclose(fp); } /* ---------------------------------------------------------------------- */ @@ -414,7 +383,7 @@ void FixSAEDVTK::invoke_vector(bigint ntimestep) // output result to file - if (fp && me == 0) { + if (fp && comm->me == 0) { if (nOutput > 0) { fclose(fp); @@ -534,11 +503,11 @@ void FixSAEDVTK::options(int narg, char **arg) overwrite = 0; // optional args - int iarg = 6 + nvalues; + int iarg = 7; while (iarg < narg) { if (strcmp(arg[iarg],"file") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix saed/vtk command"); - if (me == 0) { + if (comm->me == 0) { nOutput = 0; int n = strlen(arg[iarg+1]) + 1; diff --git a/src/USER-DIFFRACTION/fix_saed_vtk.h b/src/USER-DIFFRACTION/fix_saed_vtk.h index 94abbf0194..1f70bfd164 100644 --- a/src/USER-DIFFRACTION/fix_saed_vtk.h +++ b/src/USER-DIFFRACTION/fix_saed_vtk.h @@ -37,10 +37,8 @@ class FixSAEDVTK : public Fix { private: - int me,nvalues; int nrepeat,nfreq,irepeat; bigint nvalid; - int which; char *ids; FILE *fp; int nrows; From 85539765d0d0b34db5e49a5967c4d60468bd2f15 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Feb 2021 10:24:03 -0500 Subject: [PATCH 110/384] update docs about thermo_modify flush --- doc/src/thermo_modify.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/src/thermo_modify.rst b/doc/src/thermo_modify.rst index fc8f66b90b..6d56f60276 100644 --- a/doc/src/thermo_modify.rst +++ b/doc/src/thermo_modify.rst @@ -96,9 +96,11 @@ always include a divide by the number of atoms in the variable formula if this is not the case. The *flush* keyword invokes a flush operation after thermodynamic info -is written to the log file. This insures the output in that file is -current (no buffering by the OS), even if LAMMPS halts before the -simulation completes. +is written to the screen and log file. This insures the output is +updated and not buffered (by the application) even if LAMMPS halts +before the simulation completes. Please note that this does not +affect buffering by the OS or devices, so you may still lose data +in case the simulation stops due to a hardware failure. The *line* keyword determines whether thermodynamics will be output as a series of numeric values on one line or in a multi-line format with From 4404469f5ca4ecef509b1d51490381ebe22e7fc1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Feb 2021 11:38:24 -0500 Subject: [PATCH 111/384] run GitHub actions only on merges/pushes to master to save minutes --- .github/workflows/codeql-analysis.yml | 2 -- .github/workflows/unittest-macos.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7507db07ef..827306c9aa 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -4,8 +4,6 @@ name: "CodeQL Code Analysis" on: push: branches: [master] - pull_request: - branches: [master] jobs: analyze: diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index ed3b9562a5..a65db7636b 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -4,8 +4,6 @@ name: "Unittest for MacOS" on: push: branches: [master] - pull_request: - branches: [master] jobs: build: From 1da3ba87f41fd78dca42cb3ee81c5b95bcd33908 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Feb 2021 14:12:46 -0500 Subject: [PATCH 112/384] use -mpicolor flag as documented (and not -mpi). closes #2575 --- src/lammps.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lammps.cpp b/src/lammps.cpp index 69baec5557..0b38f09ef5 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -129,13 +129,13 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : init_pkg_lists(); - // check if -mpi is first arg + // check if -mpicolor is first arg // if so, then 2 apps were launched with one mpirun command // this means passed communicator (e.g. MPI_COMM_WORLD) is bigger than LAMMPS // e.g. for client/server coupling with another code // in the future LAMMPS might leverage this in other ways // universe communicator needs to shrink to be just LAMMPS - // syntax: -mpi color + // syntax: -mpicolor color // color = integer for this app, different than other app(s) // do the following: // perform an MPI_Comm_split() to create a new LAMMPS-only subcomm @@ -145,7 +145,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : // cscomm is used by CSLIB package to exchange messages w/ other app int iarg = 1; - if (narg-iarg >= 2 && (strcmp(arg[iarg],"-mpi") == 0 || + if (narg-iarg >= 2 && (strcmp(arg[iarg],"-mpicolor") == 0 || strcmp(arg[iarg],"-m") == 0)) { int me,nprocs; MPI_Comm_rank(communicator,&me); From 5196926c28f061c466c2b05a8d0c5cb43fdbd8f4 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Feb 2021 14:36:37 -0500 Subject: [PATCH 113/384] remove meaningless typecast --- src/force.cpp | 12 ++++++------ src/modify.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/force.cpp b/src/force.cpp index 1f03206f31..0073366c27 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -849,11 +849,11 @@ void Force::set_special(int narg, char **arg) double Force::memory_usage() { double bytes = 0; - if (pair) bytes += static_cast (pair->memory_usage()); - if (bond) bytes += static_cast (bond->memory_usage()); - if (angle) bytes += static_cast (angle->memory_usage()); - if (dihedral) bytes += static_cast (dihedral->memory_usage()); - if (improper) bytes += static_cast (improper->memory_usage()); - if (kspace) bytes += static_cast (kspace->memory_usage()); + if (pair) bytes += pair->memory_usage(); + if (bond) bytes += bond->memory_usage(); + if (angle) bytes += angle->memory_usage(); + if (dihedral) bytes += dihedral->memory_usage(); + if (improper) bytes += improper->memory_usage(); + if (kspace) bytes += kspace->memory_usage(); return bytes; } diff --git a/src/modify.cpp b/src/modify.cpp index eab2d82fcf..b74b48dbad 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -1697,8 +1697,8 @@ double Modify::memory_usage() { double bytes = 0; for (int i = 0; i < nfix; i++) - bytes += static_cast (fix[i]->memory_usage()); + bytes += fix[i]->memory_usage(); for (int i = 0; i < ncompute; i++) - bytes += static_cast (compute[i]->memory_usage()); + bytes += compute[i]->memory_usage(); return bytes; } From e2e6639013c095c520df4a273a424b742a075174 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Feb 2021 17:27:04 -0500 Subject: [PATCH 114/384] add typecast to avoid (unlikely but possible) integer overflows. this will silence a lot of static code analysis warnings --- src/GRANULAR/fix_wall_gran.cpp | 6 +- src/GRANULAR/fix_wall_gran_region.cpp | 8 +- src/KOKKOS/fix_neigh_history_kokkos.cpp | 8 +- src/KOKKOS/fix_qeq_reax_kokkos.cpp | 8 +- src/KOKKOS/fix_shardlow_kokkos.cpp | 2 +- src/KOKKOS/pair_reaxc_kokkos.cpp | 22 +- src/KOKKOS/pppm_kokkos.cpp | 14 +- src/KSPACE/ewald.cpp | 8 +- src/KSPACE/ewald_disp.cpp | 16 +- src/KSPACE/msm.cpp | 4 +- src/KSPACE/msm_cg.cpp | 2 +- src/KSPACE/pair_lj_cut_tip4p_long.cpp | 4 +- src/KSPACE/pair_lj_long_tip4p_long.cpp | 4 +- src/KSPACE/pair_tip4p_long.cpp | 4 +- src/KSPACE/pppm.cpp | 20 +- src/KSPACE/pppm_cg.cpp | 2 +- src/KSPACE/pppm_dipole.cpp | 14 +- src/KSPACE/pppm_disp.cpp | 20 +- src/LATTE/fix_latte.cpp | 4 +- src/MANYBODY/pair_adp.cpp | 2 +- src/MANYBODY/pair_airebo.cpp | 6 +- src/MANYBODY/pair_bop.cpp | 218 +++++++++--------- src/MANYBODY/pair_comb.cpp | 10 +- src/MANYBODY/pair_comb3.cpp | 8 +- src/MANYBODY/pair_eam.cpp | 4 +- src/MANYBODY/pair_eim.cpp | 4 +- src/MANYBODY/pair_lcbop.cpp | 6 +- src/MC/fix_bond_break.cpp | 2 +- src/MC/fix_bond_create.cpp | 2 +- src/MISC/fix_orient_bcc.cpp | 2 +- src/MISC/fix_orient_fcc.cpp | 2 +- src/MISC/fix_ttm.cpp | 4 +- src/MLIAP/compute_mliap.cpp | 4 +- src/MLIAP/mliap_data.cpp | 30 +-- src/MLIAP/mliap_descriptor_snap.cpp | 8 +- src/MLIAP/mliap_model.cpp | 2 +- src/MLIAP/pair_mliap.cpp | 6 +- src/MOLECULE/fix_cmap.cpp | 6 +- src/MOLECULE/pair_lj_cut_tip4p_cut.cpp | 4 +- src/MOLECULE/pair_tip4p_cut.cpp | 4 +- src/PERI/fix_peri_neigh.cpp | 16 +- src/POEMS/fix_poems.cpp | 4 +- src/QEQ/fix_qeq.cpp | 8 +- src/REPLICA/fix_event.cpp | 2 +- src/REPLICA/fix_hyper_local.cpp | 20 +- src/RIGID/fix_ehex.cpp | 2 +- src/RIGID/fix_rattle.cpp | 2 +- src/RIGID/fix_rigid.cpp | 8 +- src/RIGID/fix_rigid_small.cpp | 10 +- src/RIGID/fix_shake.cpp | 8 +- src/SNAP/compute_snap.cpp | 6 +- src/SNAP/pair_snap.cpp | 10 +- src/SNAP/sna.cpp | 40 ++-- src/SRD/fix_srd.cpp | 10 +- src/USER-AWPMD/pair_awpmd_cut.cpp | 4 +- src/USER-CGSDK/pair_lj_sdk.cpp | 4 +- src/USER-CGSDK/pair_lj_sdk_coul_long.cpp | 6 +- src/USER-COLVARS/fix_colvars.cpp | 2 +- src/USER-DIFFRACTION/compute_saed.cpp | 17 +- src/USER-DIFFRACTION/compute_xrd.cpp | 17 +- src/USER-DPD/fix_shardlow.cpp | 4 +- src/USER-EFF/pair_eff_cut.cpp | 4 +- src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp | 4 +- src/USER-FEP/pair_tip4p_long_soft.cpp | 4 +- src/USER-INTEL/pppm_intel.cpp | 8 +- src/USER-LB/fix_lb_rigid_pc_sphere.cpp | 4 +- src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp | 8 +- src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp | 2 +- src/USER-MEAMC/pair_meamc.cpp | 4 +- src/USER-MISC/compute_cnp_atom.cpp | 4 +- src/USER-MISC/fix_filter_corotate.cpp | 10 +- src/USER-MISC/fix_orient_eco.cpp | 2 +- src/USER-MISC/fix_propel_self.cpp | 2 +- src/USER-MISC/fix_ttm_mod.cpp | 4 +- src/USER-MISC/pair_gauss_cut.cpp | 4 +- src/USER-MISC/pair_list.cpp | 6 +- src/USER-MISC/pair_local_density.cpp | 4 +- src/USER-MOLFILE/dump_molfile.cpp | 2 +- src/USER-OMP/fix_omp.cpp | 4 +- src/USER-OMP/msm_cg_omp.cpp | 2 +- src/USER-OMP/pair_adp_omp.cpp | 4 +- src/USER-OMP/pair_brownian_omp.cpp | 4 +- src/USER-OMP/pair_brownian_poly_omp.cpp | 4 +- src/USER-OMP/pair_dpd_omp.cpp | 4 +- src/USER-OMP/pair_dpd_tstat_omp.cpp | 4 +- src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp | 2 +- .../pair_hbond_dreiding_morse_omp.cpp | 2 +- src/USER-OMP/thr_data.cpp | 4 +- src/USER-PTM/compute_ptm_atom.cpp | 2 +- src/USER-QMMM/fix_qmmm.cpp | 4 +- src/USER-QTB/fix_qbmsst.cpp | 6 +- src/USER-QTB/fix_qtb.cpp | 6 +- src/USER-REACTION/fix_bond_react.cpp | 2 +- src/USER-REAXC/fix_qeq_reax.cpp | 10 +- src/USER-REAXC/fix_reaxc_bonds.cpp | 6 +- src/USER-REAXC/pair_reaxc.cpp | 26 +-- src/USER-SCAFACOS/scafacos.cpp | 4 +- src/USER-SDPD/fix_meso_move.cpp | 4 +- .../fix_smd_tlsph_reference_configuration.cpp | 10 +- src/USER-SMTBQ/pair_smtbq.cpp | 6 +- src/VORONOI/compute_voronoi_atom.cpp | 2 +- src/angle.cpp | 4 +- src/angle_hybrid.cpp | 6 +- src/atom.cpp | 6 +- src/atom_vec_body.cpp | 6 +- src/atom_vec_line.cpp | 2 +- src/atom_vec_tri.cpp | 2 +- src/bond.cpp | 2 +- src/bond_hybrid.cpp | 4 +- src/comm_brick.cpp | 2 +- src/compute_angmom_chunk.cpp | 4 +- src/compute_centro_atom.cpp | 2 +- src/compute_chunk_atom.cpp | 6 +- src/compute_cna_atom.cpp | 4 +- src/compute_com_chunk.cpp | 2 +- src/compute_dipole_chunk.cpp | 4 +- src/compute_displace_atom.cpp | 2 +- src/compute_fragment_atom.cpp | 2 +- src/compute_global_atom.cpp | 6 +- src/compute_gyration_chunk.cpp | 6 +- src/compute_hexorder_atom.cpp | 4 +- src/compute_inertia_chunk.cpp | 4 +- src/compute_msd_chunk.cpp | 4 +- src/compute_omega_chunk.cpp | 8 +- src/compute_orientorder_atom.cpp | 4 +- src/compute_property_chunk.cpp | 2 +- src/compute_property_local.cpp | 2 +- src/compute_reduce_chunk.cpp | 4 +- src/compute_temp_chunk.cpp | 8 +- src/compute_temp_profile.cpp | 2 +- src/compute_torque_chunk.cpp | 4 +- src/compute_vcm_chunk.cpp | 2 +- src/dihedral.cpp | 4 +- src/dihedral_hybrid.cpp | 6 +- src/dump.cpp | 6 +- src/fix_ave_chunk.cpp | 8 +- src/fix_langevin.cpp | 6 +- src/fix_minimize.cpp | 2 +- src/fix_move.cpp | 8 +- src/fix_neigh_history.cpp | 8 +- src/fix_numdiff.cpp | 2 +- src/fix_read_restart.cpp | 2 +- src/fix_respa.cpp | 2 +- src/fix_store.cpp | 4 +- src/improper.cpp | 2 +- src/improper_hybrid.cpp | 6 +- src/irregular.cpp | 12 +- src/my_pool_chunk.cpp | 6 +- src/nbin.cpp | 4 +- src/neigh_list.cpp | 6 +- src/nstencil.cpp | 4 +- src/ntopo.cpp | 8 +- src/pair.cpp | 4 +- src/pair_coul_streitz.cpp | 6 +- src/pair_hybrid.cpp | 4 +- 155 files changed, 566 insertions(+), 576 deletions(-) diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index f52b976b63..73d2a2f8ba 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -1446,10 +1446,10 @@ double FixWallGran::memory_usage() { int nmax = atom->nmax; double bytes = 0.0; - if (use_history) bytes += nmax*size_history * sizeof(double); // shear history - if (fix_rigid) bytes += nmax * sizeof(int); // mass_rigid + if (use_history) bytes += (double)nmax*size_history * sizeof(double); // shear history + if (fix_rigid) bytes += (double)nmax * sizeof(int); // mass_rigid // store contacts - if (peratom_flag) bytes += nmax*size_peratom_cols*sizeof(double); + if (peratom_flag) bytes += (double)nmax*size_peratom_cols*sizeof(double); return bytes; } diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index d4199c2023..5e670a0a07 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -346,11 +346,11 @@ double FixWallGranRegion::memory_usage() int nmax = atom->nmax; double bytes = 0.0; if (use_history) { // shear history - bytes += nmax * sizeof(int); // ncontact - bytes += nmax*tmax * sizeof(int); // walls - bytes += nmax*tmax*size_history * sizeof(double); // history_many + bytes += (double)nmax * sizeof(int); // ncontact + bytes += (double)nmax*tmax * sizeof(int); // walls + bytes += (double)nmax*tmax*size_history * sizeof(double); // history_many } - if (fix_rigid) bytes += nmax * sizeof(int); // mass_rigid + if (fix_rigid) bytes += (double)nmax * sizeof(int); // mass_rigid return bytes; } diff --git a/src/KOKKOS/fix_neigh_history_kokkos.cpp b/src/KOKKOS/fix_neigh_history_kokkos.cpp index e7b16e64f8..fd625c6718 100644 --- a/src/KOKKOS/fix_neigh_history_kokkos.cpp +++ b/src/KOKKOS/fix_neigh_history_kokkos.cpp @@ -244,10 +244,10 @@ template double FixNeighHistoryKokkos::memory_usage() { double bytes = d_firstflag.extent(0)*d_firstflag.extent(1)*sizeof(int); - bytes += d_firstvalue.extent(0)*d_firstvalue.extent(1)*sizeof(double); - bytes += 2*k_npartner.extent(0)*sizeof(int); - bytes += 2*k_partner.extent(0)*k_partner.extent(1)*sizeof(int); - bytes += 2*k_valuepartner.extent(0)*k_valuepartner.extent(1)*sizeof(double); + bytes += (double)d_firstvalue.extent(0)*d_firstvalue.extent(1)*sizeof(double); + bytes += (double)2*k_npartner.extent(0)*sizeof(int); + bytes += (double)2*k_partner.extent(0)*k_partner.extent(1)*sizeof(int); + bytes += (double)2*k_valuepartner.extent(0)*k_valuepartner.extent(1)*sizeof(double); return bytes; } diff --git a/src/KOKKOS/fix_qeq_reax_kokkos.cpp b/src/KOKKOS/fix_qeq_reax_kokkos.cpp index 81922c764b..7e4d99e1c3 100644 --- a/src/KOKKOS/fix_qeq_reax_kokkos.cpp +++ b/src/KOKKOS/fix_qeq_reax_kokkos.cpp @@ -1492,10 +1492,10 @@ double FixQEqReaxKokkos::memory_usage() double bytes; bytes = atom->nmax*nprev*2 * sizeof(F_FLOAT); // s_hist & t_hist - bytes += atom->nmax*8 * sizeof(F_FLOAT); // storage - bytes += n_cap*2 * sizeof(int); // matrix... - bytes += m_cap * sizeof(int); - bytes += m_cap * sizeof(F_FLOAT); + bytes += (double)atom->nmax*8 * sizeof(F_FLOAT); // storage + bytes += (double)n_cap*2 * sizeof(int); // matrix... + bytes += (double)m_cap * sizeof(int); + bytes += (double)m_cap * sizeof(F_FLOAT); return bytes; } diff --git a/src/KOKKOS/fix_shardlow_kokkos.cpp b/src/KOKKOS/fix_shardlow_kokkos.cpp index 029740a305..fa4828dece 100644 --- a/src/KOKKOS/fix_shardlow_kokkos.cpp +++ b/src/KOKKOS/fix_shardlow_kokkos.cpp @@ -790,7 +790,7 @@ template double FixShardlowKokkos::memory_usage() { double bytes = 0.0; - bytes += sizeof(double)*3*ghostmax; // v_t0[] + bytes += (double)sizeof(double)*3*ghostmax; // v_t0[] return bytes; } diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxc_kokkos.cpp index a918695e33..75a1448b33 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxc_kokkos.cpp @@ -3696,25 +3696,25 @@ double PairReaxCKokkos::memory_usage() double bytes = 0.0; if (cut_hbsq > 0.0) { - bytes += nmax*3*sizeof(int); - bytes += maxhb*nmax*sizeof(int); + bytes += (double)nmax*3*sizeof(int); + bytes += (double)maxhb*nmax*sizeof(int); } - bytes += nmax*2*sizeof(int); - bytes += maxbo*nmax*sizeof(int); + bytes += (double)nmax*2*sizeof(int); + bytes += (double)maxbo*nmax*sizeof(int); - bytes += nmax*17*sizeof(F_FLOAT); - bytes += maxbo*nmax*34*sizeof(F_FLOAT); + bytes += (double)nmax*17*sizeof(F_FLOAT); + bytes += (double)maxbo*nmax*34*sizeof(F_FLOAT); // FixReaxCSpecies if (fixspecies_flag) { - bytes += MAXSPECBOND*nmax*sizeof(tagint); - bytes += MAXSPECBOND*nmax*sizeof(F_FLOAT); + bytes += (double)MAXSPECBOND*nmax*sizeof(tagint); + bytes += (double)MAXSPECBOND*nmax*sizeof(F_FLOAT); } // FixReaxCBonds - bytes += maxbo*nmax*sizeof(tagint); - bytes += maxbo*nmax*sizeof(F_FLOAT); - bytes += nmax*sizeof(int); + bytes += (double)maxbo*nmax*sizeof(tagint); + bytes += (double)maxbo*nmax*sizeof(F_FLOAT); + bytes += (double)nmax*sizeof(int); return bytes; } diff --git a/src/KOKKOS/pppm_kokkos.cpp b/src/KOKKOS/pppm_kokkos.cpp index edee26e645..cdf973ce28 100644 --- a/src/KOKKOS/pppm_kokkos.cpp +++ b/src/KOKKOS/pppm_kokkos.cpp @@ -2876,18 +2876,18 @@ double PPPMKokkos::memory_usage() double bytes = nmax*3 * sizeof(double); int nbrick = (nxhi_out-nxlo_out+1) * (nyhi_out-nylo_out+1) * (nzhi_out-nzlo_out+1); - bytes += 4 * nbrick * sizeof(FFT_SCALAR); - if (triclinic) bytes += 3 * nfft_both * sizeof(double); - bytes += 6 * nfft_both * sizeof(double); - bytes += nfft_both * sizeof(double); - bytes += nfft_both*5 * sizeof(FFT_SCALAR); + bytes += (double)4 * nbrick * sizeof(FFT_SCALAR); + if (triclinic) bytes += (double)3 * nfft_both * sizeof(double); + bytes += (double)6 * nfft_both * sizeof(double); + bytes += (double)nfft_both * sizeof(double); + bytes += (double)nfft_both*5 * sizeof(FFT_SCALAR); if (peratom_allocate_flag) - bytes += 6 * nbrick * sizeof(FFT_SCALAR); + bytes += (double)6 * nbrick * sizeof(FFT_SCALAR); // two GridComm bufs - bytes += (ngc_buf1 + ngc_buf2) * npergrid * sizeof(FFT_SCALAR); + bytes += (double)(ngc_buf1 + ngc_buf2) * npergrid * sizeof(FFT_SCALAR); return bytes; } diff --git a/src/KSPACE/ewald.cpp b/src/KSPACE/ewald.cpp index a1fa018ef1..12b3a7d962 100644 --- a/src/KSPACE/ewald.cpp +++ b/src/KSPACE/ewald.cpp @@ -1228,10 +1228,10 @@ void Ewald::slabcorr() double Ewald::memory_usage() { double bytes = 3 * kmax3d * sizeof(int); - bytes += (1 + 3 + 6) * kmax3d * sizeof(double); - bytes += 4 * kmax3d * sizeof(double); - bytes += nmax*3 * sizeof(double); - bytes += 2 * (2*kmax+1)*3*nmax * sizeof(double); + bytes += (double)(1 + 3 + 6) * kmax3d * sizeof(double); + bytes += (double)4 * kmax3d * sizeof(double); + bytes += (double)nmax*3 * sizeof(double); + bytes += (double)2 * (2*kmax+1)*3*nmax * sizeof(double); return bytes; } diff --git a/src/KSPACE/ewald_disp.cpp b/src/KSPACE/ewald_disp.cpp index 83e33b9e8f..89eeb4b3eb 100644 --- a/src/KSPACE/ewald_disp.cpp +++ b/src/KSPACE/ewald_disp.cpp @@ -406,17 +406,17 @@ void EwaldDisp::reallocate() if (nkvec>nkvec_max) { deallocate(); // free memory hvec = new hvector[nkvec]; // hvec - bytes += (nkvec-nkvec_max)*sizeof(hvector); + bytes += (double)(nkvec-nkvec_max)*sizeof(hvector); kvec = new kvector[nkvec]; // kvec - bytes += (nkvec-nkvec_max)*sizeof(kvector); + bytes += (double)(nkvec-nkvec_max)*sizeof(kvector); kenergy = new double[nkvec*nfunctions]; // kenergy - bytes += (nkvec-nkvec_max)*nfunctions*sizeof(double); + bytes += (double)(nkvec-nkvec_max)*nfunctions*sizeof(double); kvirial = new double[6*nkvec*nfunctions]; // kvirial - bytes += 6*(nkvec-nkvec_max)*nfunctions*sizeof(double); + bytes += (double)6*(nkvec-nkvec_max)*nfunctions*sizeof(double); cek_local = new complex[nkvec*nsums]; // cek_local - bytes += (nkvec-nkvec_max)*nsums*sizeof(complex); + bytes += (double)(nkvec-nkvec_max)*nsums*sizeof(complex); cek_global = new complex[nkvec*nsums]; // cek_global - bytes += (nkvec-nkvec_max)*nsums*sizeof(complex); + bytes += (double)(nkvec-nkvec_max)*nsums*sizeof(complex); nkvec_max = nkvec; } @@ -449,7 +449,7 @@ void EwaldDisp::reallocate_atoms() if ((nevec = atom->nmax*(2*nbox+1))<=nevec_max) return; delete [] ekr_local; ekr_local = new cvector[nevec]; - bytes += (nevec-nevec_max)*sizeof(cvector); + bytes += (double)(nevec-nevec_max)*sizeof(cvector); nevec_max = nevec; } @@ -549,7 +549,7 @@ void EwaldDisp::init_coeffs() delete [] B; B = new double[n+1]; B[0] = 0.0; - bytes += (n+1)*sizeof(double); + bytes += (double)(n+1)*sizeof(double); for (int i=1; i<=n; ++i) B[i] = sqrt(fabs(b[i][i])); } if (function[2]) { // arithmetic 1/r^6 diff --git a/src/KSPACE/msm.cpp b/src/KSPACE/msm.cpp index 2ff758a6fc..febf37029b 100644 --- a/src/KSPACE/msm.cpp +++ b/src/KSPACE/msm.cpp @@ -3433,11 +3433,11 @@ double MSM::memory_usage() // all GridComm bufs - bytes += (ngcall_buf1 + ngcall_buf2) * npergrid * sizeof(double); + bytes += (double)(ngcall_buf1 + ngcall_buf2) * npergrid * sizeof(double); for (int n=0; nnthreads; i++) bytes += ipage[i].size(); - bytes += 2*maxlocal * sizeof(double); + bytes += (double)2*maxlocal * sizeof(double); return bytes; } diff --git a/src/MANYBODY/pair_bop.cpp b/src/MANYBODY/pair_bop.cpp index 9f12b0755a..be4f17b291 100644 --- a/src/MANYBODY/pair_bop.cpp +++ b/src/MANYBODY/pair_bop.cpp @@ -5339,226 +5339,226 @@ double PairBOP::memory_usage() double bytes = 0.0; // rcut - bytes += npairs * sizeof (double); + bytes += (double)npairs * sizeof (double); // rcut3 - bytes += npairs * sizeof (double); + bytes += (double)npairs * sizeof (double); // rcutsq - bytes += npairs * sizeof (double); + bytes += (double)npairs * sizeof (double); // rcutsq3 - bytes += npairs * sizeof (double); + bytes += (double)npairs * sizeof (double); // dr - bytes += npairs * sizeof (double); + bytes += (double)npairs * sizeof (double); // rdr - bytes += npairs * sizeof (double); + bytes += (double)npairs * sizeof (double); // dr3 - bytes += npairs * sizeof (double); + bytes += (double)npairs * sizeof (double); // rdr3 - bytes += npairs * sizeof (double); + bytes += (double)npairs * sizeof (double); // setflag - bytes += (n+1) * (n+1) * sizeof (int); + bytes += (double)(n+1) * (n+1) * sizeof (int); // cutsq - bytes += (n+1) * (n+1) * sizeof (double); + bytes += (double)(n+1) * (n+1) * sizeof (double); // cutghost - bytes += (n+1) * (n+1) * sizeof (double); + bytes += (double)(n+1) * (n+1) * sizeof (double); // cutghost - bytes += (n+1) * (n+1) * sizeof (double); + bytes += (double)(n+1) * (n+1) * sizeof (double); // pBetaS - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaS1 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaS2 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaS3 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaS4 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaS5 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaS6 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pLong - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pLong1 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pLong2 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pLong3 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pLong4 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pLong5 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pLong6 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaP - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaP1 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaP2 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaP3 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaP4 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaP5 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaP6 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pRepul - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pRepul1 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pRepul2 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pRepul3 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pRepul4 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pRepul5 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pRepul6 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // FsigBO - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // FsigBO1 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // FsigBO2 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // FsigBO3 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // FsigBO4 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // FsigBO5 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // FsigBO6 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // itypeSigBk - bytes += neigh_ct* sizeof(int); + bytes += (double)neigh_ct* sizeof(int); // itypePiBk - bytes += neigh_ct* sizeof(int); + bytes += (double)neigh_ct* sizeof(int); // BOP_index - bytes += nall * sizeof(double); + bytes += (double)nall * sizeof(double); // BOP_total - bytes += nall * sizeof(double); + bytes += (double)nall * sizeof(double); if (otfly==0) { // cosAng - bytes += cos_total* sizeof(double); + bytes += (double)cos_total* sizeof(double); // dcAng - bytes += cos_total * 3 * 2 * sizeof(double); + bytes += (double)cos_total * 3 * 2 * sizeof(double); // disij - bytes += neigh_total * 3 * sizeof(double); + bytes += (double)neigh_total * 3 * sizeof(double); // rij - bytes += neigh_total * sizeof(double); + bytes += (double)neigh_total * sizeof(double); // betaS - bytes += neigh_total * sizeof(double); + bytes += (double)neigh_total * sizeof(double); // dBetaS - bytes += neigh_total * sizeof(double); + bytes += (double)neigh_total * sizeof(double); // betaP - bytes += neigh_total * sizeof(double); + bytes += (double)neigh_total * sizeof(double); // dBetaP - bytes += neigh_total * sizeof(double); + bytes += (double)neigh_total * sizeof(double); // repul - bytes += neigh_total * sizeof(double); + bytes += (double)neigh_total * sizeof(double); // dRepul - bytes += neigh_total * sizeof(double); + bytes += (double)neigh_total * sizeof(double); // cos_index - bytes += nall * sizeof(double); + bytes += (double)nall * sizeof(double); } // pi_a - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pro - bytes += bop_types * sizeof(double); + bytes += (double)bop_types * sizeof(double); // pi_delta - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_p - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_c - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_r0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_r0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // phi_r0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_rc - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_rc - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_a - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pro_delta - bytes += bop_types * sizeof(double); + bytes += (double)bop_types * sizeof(double); // pi_delta - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_p - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_c - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_r0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_r0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // phi_r0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_rc - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_rc - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // phi_rc - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // r1 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_beta0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_beta0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // phi0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_n - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_n - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // phi_m - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_nc - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_nc - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // phi_nc - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_delta - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_c - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_a - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_f - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_k - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // small3 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // bt_pi - bytes += maxneigh*(maxneigh/2) *sizeof(B_PI); + bytes += (double)maxneigh*(maxneigh/2) *sizeof(B_PI); // bt_sigma - bytes += maxneigh*(maxneigh/2) *sizeof(B_SG); + bytes += (double)maxneigh*(maxneigh/2) *sizeof(B_SG); if (npower<=2) { // gfunc - bytes += bop_types*bop_types*bop_types*ntheta *sizeof(double); + bytes += (double)bop_types*bop_types*bop_types*ntheta *sizeof(double); // gfunc1 - bytes += bop_types*bop_types*bop_types*ntheta *sizeof(double); + bytes += (double)bop_types*bop_types*bop_types*ntheta *sizeof(double); // gfunc2 - bytes += bop_types*bop_types*bop_types*ntheta *sizeof(double); + bytes += (double)bop_types*bop_types*bop_types*ntheta *sizeof(double); // gfunc3 - bytes += bop_types*bop_types*bop_types*ntheta *sizeof(double); + bytes += (double)bop_types*bop_types*bop_types*ntheta *sizeof(double); // gfunc4 - bytes += bop_types*bop_types*bop_types*ntheta *sizeof(double); + bytes += (double)bop_types*bop_types*bop_types*ntheta *sizeof(double); // gfunc5 - bytes += bop_types*bop_types*bop_types*ntheta *sizeof(double); + bytes += (double)bop_types*bop_types*bop_types*ntheta *sizeof(double); // gfunc6 - bytes += bop_types*bop_types*bop_types*ntheta *sizeof(double); + bytes += (double)bop_types*bop_types*bop_types*ntheta *sizeof(double); } else { - bytes += bop_types*bop_types*bop_types*npower+1 *sizeof(double); + bytes += (double)bop_types*bop_types*bop_types*npower+1 *sizeof(double); } return bytes; } diff --git a/src/MANYBODY/pair_comb.cpp b/src/MANYBODY/pair_comb.cpp index 86bf7a20c5..7292726292 100644 --- a/src/MANYBODY/pair_comb.cpp +++ b/src/MANYBODY/pair_comb.cpp @@ -2099,14 +2099,14 @@ void PairComb::Short_neigh() double PairComb::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += nmax * sizeof(int); - bytes += nmax * sizeof(int *); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)nmax * sizeof(int); + bytes += (double)nmax * sizeof(int *); for (int i = 0; i < comm->nthreads; i++) bytes += ipage[i].size(); - bytes += nmax * sizeof(int); - bytes += MAXNEIGH*nmax * sizeof(double); + bytes += (double)nmax * sizeof(int); + bytes += (double)MAXNEIGH*nmax * sizeof(double); return bytes; } diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp index 5f08a6a97b..aa2afe5d20 100644 --- a/src/MANYBODY/pair_comb3.cpp +++ b/src/MANYBODY/pair_comb3.cpp @@ -3851,10 +3851,10 @@ void PairComb3::unpack_reverse_comm(int n, int *list, double *buf) double PairComb3::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += nmax * sizeof(int); - bytes += nmax * 8.0 * sizeof(double); - bytes += 25000*2*sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)nmax * sizeof(int); + bytes += (double)nmax * 8.0 * sizeof(double); + bytes += (double)25000*2*sizeof(double); for (int i = 0; i < comm->nthreads; i++) bytes += ipage[i].size(); diff --git a/src/MANYBODY/pair_eam.cpp b/src/MANYBODY/pair_eam.cpp index 889f0969ef..d509768572 100644 --- a/src/MANYBODY/pair_eam.cpp +++ b/src/MANYBODY/pair_eam.cpp @@ -914,8 +914,8 @@ void PairEAM::unpack_reverse_comm(int n, int *list, double *buf) double PairEAM::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * nmax * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/MANYBODY/pair_eim.cpp b/src/MANYBODY/pair_eim.cpp index db673611e2..c56a07fb71 100644 --- a/src/MANYBODY/pair_eim.cpp +++ b/src/MANYBODY/pair_eim.cpp @@ -1045,8 +1045,8 @@ void PairEIM::unpack_reverse_comm(int n, int *list, double *buf) double PairEIM::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * nmax * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/MANYBODY/pair_lcbop.cpp b/src/MANYBODY/pair_lcbop.cpp index 070f23dbb9..a2a8c3d1fa 100644 --- a/src/MANYBODY/pair_lcbop.cpp +++ b/src/MANYBODY/pair_lcbop.cpp @@ -1263,12 +1263,12 @@ void PairLCBOP::spline_init() { double PairLCBOP::memory_usage() { double bytes = 0.0; - bytes += maxlocal * sizeof(int); - bytes += maxlocal * sizeof(int *); + bytes += (double)maxlocal * sizeof(int); + bytes += (double)maxlocal * sizeof(int *); for (int i = 0; i < comm->nthreads; i++) bytes += ipage[i].size(); - bytes += 3*maxlocal * sizeof(double); + bytes += (double)3*maxlocal * sizeof(double); return bytes; } diff --git a/src/MC/fix_bond_break.cpp b/src/MC/fix_bond_break.cpp index 5530649fd7..ba19cfaf69 100644 --- a/src/MC/fix_bond_break.cpp +++ b/src/MC/fix_bond_break.cpp @@ -849,6 +849,6 @@ double FixBondBreak::memory_usage() { int nmax = atom->nmax; double bytes = 2*nmax * sizeof(tagint); - bytes += nmax * sizeof(double); + bytes += (double)nmax * sizeof(double); return bytes; } diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp index 773e033907..b33e213759 100644 --- a/src/MC/fix_bond_create.cpp +++ b/src/MC/fix_bond_create.cpp @@ -1429,7 +1429,7 @@ double FixBondCreate::memory_usage() int nmax = atom->nmax; double bytes = nmax * sizeof(int); bytes = 2*nmax * sizeof(tagint); - bytes += nmax * sizeof(double); + bytes += (double)nmax * sizeof(double); return bytes; } diff --git a/src/MISC/fix_orient_bcc.cpp b/src/MISC/fix_orient_bcc.cpp index b6ab2545ad..85734b0a6c 100644 --- a/src/MISC/fix_orient_bcc.cpp +++ b/src/MISC/fix_orient_bcc.cpp @@ -597,6 +597,6 @@ int FixOrientBCC::compare(const void *pi, const void *pj) double FixOrientBCC::memory_usage() { double bytes = nmax * sizeof(Nbr); - bytes += 2*nmax * sizeof(double); + bytes += (double)2*nmax * sizeof(double); return bytes; } diff --git a/src/MISC/fix_orient_fcc.cpp b/src/MISC/fix_orient_fcc.cpp index f718df07ad..b46232c710 100644 --- a/src/MISC/fix_orient_fcc.cpp +++ b/src/MISC/fix_orient_fcc.cpp @@ -595,6 +595,6 @@ int FixOrientFCC::compare(const void *pi, const void *pj) double FixOrientFCC::memory_usage() { double bytes = nmax * sizeof(Nbr); - bytes += 2*nmax * sizeof(double); + bytes += (double)2*nmax * sizeof(double); return bytes; } diff --git a/src/MISC/fix_ttm.cpp b/src/MISC/fix_ttm.cpp index 700c7f3d4b..4658c0c943 100644 --- a/src/MISC/fix_ttm.cpp +++ b/src/MISC/fix_ttm.cpp @@ -558,8 +558,8 @@ void FixTTM::end_of_step() double FixTTM::memory_usage() { double bytes = 0.0; - bytes += 5*total_nnodes * sizeof(int); - bytes += 14*total_nnodes * sizeof(double); + bytes += (double)5*total_nnodes * sizeof(int); + bytes += (double)14*total_nnodes * sizeof(double); return bytes; } diff --git a/src/MLIAP/compute_mliap.cpp b/src/MLIAP/compute_mliap.cpp index 0842e421c0..5b2d97d251 100644 --- a/src/MLIAP/compute_mliap.cpp +++ b/src/MLIAP/compute_mliap.cpp @@ -359,10 +359,10 @@ double ComputeMLIAP::memory_usage() double bytes = size_array_rows*size_array_cols * sizeof(double); // mliaparray - bytes += size_array_rows*size_array_cols * + bytes += (double)size_array_rows*size_array_cols * sizeof(double); // mliaparrayall int n = atom->ntypes+1; - bytes += n*sizeof(int); // map + bytes += (double)n*sizeof(int); // map bytes += descriptor->memory_usage(); // Descriptor object bytes += model->memory_usage(); // Model object diff --git a/src/MLIAP/mliap_data.cpp b/src/MLIAP/mliap_data.cpp index c310f0efc7..8eff580dd7 100644 --- a/src/MLIAP/mliap_data.cpp +++ b/src/MLIAP/mliap_data.cpp @@ -260,32 +260,32 @@ double MLIAPData::memory_usage() { double bytes = 0.0; - bytes += nelements*nparams*sizeof(double); // egradient - bytes += nmax*size_gradforce*sizeof(double); // gradforce + bytes += (double)nelements*nparams*sizeof(double); // egradient + bytes += (double)nmax*size_gradforce*sizeof(double); // gradforce if (gradgradflag == 1) { - bytes += natomgamma_max* + bytes += (double)natomgamma_max* gamma_nnz*sizeof(int); //gamma_row_index - bytes += natomgamma_max* + bytes += (double)natomgamma_max* gamma_nnz*sizeof(int); // gamma_col_index - bytes += natomgamma_max* + bytes += (double)natomgamma_max* gamma_nnz*sizeof(double); // gamma } - bytes += natoms*ndescriptors*sizeof(int); // betas - bytes += natoms*ndescriptors*sizeof(int); // descriptors - bytes += natoms*sizeof(double); // eatoms + bytes += (double)natoms*ndescriptors*sizeof(int); // betas + bytes += (double)natoms*ndescriptors*sizeof(int); // descriptors + bytes += (double)natoms*sizeof(double); // eatoms - bytes += natomneigh_max*sizeof(int); // iatoms - bytes += natomneigh_max*sizeof(int); // ielems - bytes += natomneigh_max*sizeof(int); // numneighs + bytes += (double)natomneigh_max*sizeof(int); // iatoms + bytes += (double)natomneigh_max*sizeof(int); // ielems + bytes += (double)natomneigh_max*sizeof(int); // numneighs - bytes += nneigh_max*sizeof(int); // jatoms - bytes += nneigh_max*sizeof(int); // jelems - bytes += nneigh_max*3*sizeof(double); // rij" + bytes += (double)nneigh_max*sizeof(int); // jatoms + bytes += (double)nneigh_max*sizeof(int); // jelems + bytes += (double)nneigh_max*3*sizeof(double); // rij" if (gradgradflag == 0) - bytes += nneigh_max*ndescriptors*3*sizeof(double);// graddesc + bytes += (double)nneigh_max*ndescriptors*3*sizeof(double);// graddesc return bytes; } diff --git a/src/MLIAP/mliap_descriptor_snap.cpp b/src/MLIAP/mliap_descriptor_snap.cpp index 275eadd74e..21de044f40 100644 --- a/src/MLIAP/mliap_descriptor_snap.cpp +++ b/src/MLIAP/mliap_descriptor_snap.cpp @@ -515,10 +515,10 @@ double MLIAPDescriptorSNAP::memory_usage() { double bytes = 0; - bytes += nelements*sizeof(double); // radelem - bytes += nelements*sizeof(double); // welem - bytes += nelements*nelements*sizeof(int); // cutsq - bytes += snaptr->memory_usage(); // SNA object + bytes += (double)nelements*sizeof(double); // radelem + bytes += (double)nelements*sizeof(double); // welem + bytes += (double)nelements*nelements*sizeof(int); // cutsq + bytes += snaptr->memory_usage(); // SNA object return bytes; } diff --git a/src/MLIAP/mliap_model.cpp b/src/MLIAP/mliap_model.cpp index 882f64263f..f993aeb725 100644 --- a/src/MLIAP/mliap_model.cpp +++ b/src/MLIAP/mliap_model.cpp @@ -185,7 +185,7 @@ double MLIAPModelSimple::memory_usage() { double bytes = 0; - bytes += nelements*nparams*sizeof(double); // coeffelem + bytes += (double)nelements*nparams*sizeof(double); // coeffelem return bytes; } diff --git a/src/MLIAP/pair_mliap.cpp b/src/MLIAP/pair_mliap.cpp index 0c6f3903f6..ef8a4c974e 100644 --- a/src/MLIAP/pair_mliap.cpp +++ b/src/MLIAP/pair_mliap.cpp @@ -336,9 +336,9 @@ double PairMLIAP::memory_usage() double bytes = Pair::memory_usage(); int n = atom->ntypes+1; - bytes += n*n*sizeof(int); // setflag - bytes += n*n*sizeof(int); // cutsq - bytes += n*sizeof(int); // map + bytes += (double)n*n*sizeof(int); // setflag + bytes += (double)n*n*sizeof(int); // cutsq + bytes += (double)n*sizeof(int); // map bytes += descriptor->memory_usage(); // Descriptor object bytes += model->memory_usage(); // Model object bytes += data->memory_usage(); // Data object diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp index d8aee3e181..b594c4770d 100644 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -1441,8 +1441,8 @@ double FixCMAP::memory_usage() { int nmax = atom->nmax; double bytes = nmax * sizeof(int); // num_crossterm - bytes += nmax*CMAPMAX * sizeof(int); // crossterm_type - bytes += 5*nmax*CMAPMAX * sizeof(int); // crossterm_atom 12345 - bytes += maxcrossterm*6 * sizeof(int); // crosstermlist + bytes += (double)nmax*CMAPMAX * sizeof(int); // crossterm_type + bytes += (double)5*nmax*CMAPMAX * sizeof(int); // crossterm_atom 12345 + bytes += (double)maxcrossterm*6 * sizeof(int); // crosstermlist return bytes; } diff --git a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp index 1ef51cbcc8..32b5332484 100644 --- a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp +++ b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp @@ -749,7 +749,7 @@ void *PairLJCutTIP4PCut::extract(const char *str, int &dim) double PairLJCutTIP4PCut::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * nmax * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/MOLECULE/pair_tip4p_cut.cpp b/src/MOLECULE/pair_tip4p_cut.cpp index 3f30122a65..82055aa55b 100644 --- a/src/MOLECULE/pair_tip4p_cut.cpp +++ b/src/MOLECULE/pair_tip4p_cut.cpp @@ -551,7 +551,7 @@ void PairTIP4PCut::compute_newsite(double *xO, double *xH1, double PairTIP4PCut::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * nmax * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/PERI/fix_peri_neigh.cpp b/src/PERI/fix_peri_neigh.cpp index dd3cd12831..99210bde5b 100644 --- a/src/PERI/fix_peri_neigh.cpp +++ b/src/PERI/fix_peri_neigh.cpp @@ -399,18 +399,18 @@ double FixPeriNeigh::memory_usage() { int nmax = atom->nmax; int bytes = nmax * sizeof(int); - bytes += nmax*maxpartner * sizeof(tagint); - bytes += nmax*maxpartner * sizeof(double); + bytes += (double)nmax*maxpartner * sizeof(tagint); + bytes += (double)nmax*maxpartner * sizeof(double); if (isVES) { - bytes += nmax*maxpartner * sizeof(double); - bytes += nmax*maxpartner * sizeof(double); + bytes += (double)nmax*maxpartner * sizeof(double); + bytes += (double)nmax*maxpartner * sizeof(double); } if (isEPS) { - bytes += nmax*maxpartner * sizeof(double); - bytes += nmax * sizeof(double); + bytes += (double)nmax*maxpartner * sizeof(double); + bytes += (double)nmax * sizeof(double); } - bytes += nmax * sizeof(double); - bytes += nmax * sizeof(double); + bytes += (double)nmax * sizeof(double); + bytes += (double)nmax * sizeof(double); return bytes; } diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index a220216fdd..4379fa6bec 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -1526,8 +1526,8 @@ double FixPOEMS::memory_usage() { int nmax = atom->nmax; double bytes = nmax * sizeof(int); - bytes += nmax*MAXBODY * sizeof(int); - bytes += nmax*3 * sizeof(double); + bytes += (double)nmax*MAXBODY * sizeof(int); + bytes += (double)nmax*3 * sizeof(double); return bytes; } diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp index 733d566b7d..1ad01e5c4e 100644 --- a/src/QEQ/fix_qeq.cpp +++ b/src/QEQ/fix_qeq.cpp @@ -525,10 +525,10 @@ double FixQEq::memory_usage() double bytes; bytes = atom->nmax*nprev*2 * sizeof(double); // s_hist & t_hist - bytes += atom->nmax*11 * sizeof(double); // storage - bytes += n_cap*2 * sizeof(int); // matrix... - bytes += m_cap * sizeof(int); - bytes += m_cap * sizeof(double); + bytes += (double)atom->nmax*11 * sizeof(double); // storage + bytes += (double)n_cap*2 * sizeof(int); // matrix... + bytes += (double)m_cap * sizeof(int); + bytes += (double)m_cap * sizeof(double); return bytes; } diff --git a/src/REPLICA/fix_event.cpp b/src/REPLICA/fix_event.cpp index a1158b0e85..8862030b7e 100644 --- a/src/REPLICA/fix_event.cpp +++ b/src/REPLICA/fix_event.cpp @@ -208,7 +208,7 @@ void FixEvent::restore_state_dephase() double FixEvent::memory_usage() { double bytes = 12*atom->nmax * sizeof(double); - bytes += atom->nmax*sizeof(int); + bytes += (double)atom->nmax*sizeof(int); return bytes; } diff --git a/src/REPLICA/fix_hyper_local.cpp b/src/REPLICA/fix_hyper_local.cpp index 4a18a47176..5bca43fbe5 100644 --- a/src/REPLICA/fix_hyper_local.cpp +++ b/src/REPLICA/fix_hyper_local.cpp @@ -1733,15 +1733,15 @@ double FixHyperLocal::memory_usage() { double bytes = maxbond * sizeof(OneBond); // blist bytes = maxbond * sizeof(double); // per-bond bias coeffs - bytes += 3*maxlocal * sizeof(int); // numbond,maxhalf,eligible - bytes += maxlocal * sizeof(double); // maxhalfstrain - bytes += maxall * sizeof(int); // old2now - bytes += maxall * sizeof(tagint); // tagold - bytes += 3*maxall * sizeof(double); // xold - bytes += 2*maxall * sizeof(double); // maxstrain,maxstrain_domain - if (checkbias) bytes += maxall * sizeof(tagint); // biasflag - bytes += maxcoeff * sizeof(int); // numcoeff - bytes += maxcoeff * sizeof(HyperOneCoeff *); // clist - bytes += maxlocal*maxbondperatom * sizeof(HyperOneCoeff); // cpage estimate + bytes += (double)3*maxlocal * sizeof(int); // numbond,maxhalf,eligible + bytes += (double)maxlocal * sizeof(double); // maxhalfstrain + bytes += (double)maxall * sizeof(int); // old2now + bytes += (double)maxall * sizeof(tagint); // tagold + bytes += (double)3*maxall * sizeof(double); // xold + bytes += (double)2*maxall * sizeof(double); // maxstrain,maxstrain_domain + if (checkbias) bytes += (double)maxall * sizeof(tagint); // biasflag + bytes += (double)maxcoeff * sizeof(int); // numcoeff + bytes += (double)maxcoeff * sizeof(HyperOneCoeff *); // clist + bytes += (double)maxlocal*maxbondperatom * sizeof(HyperOneCoeff); // cpage estimate return bytes; } diff --git a/src/RIGID/fix_ehex.cpp b/src/RIGID/fix_ehex.cpp index a3346b3d1c..474c865a8b 100644 --- a/src/RIGID/fix_ehex.cpp +++ b/src/RIGID/fix_ehex.cpp @@ -317,7 +317,7 @@ double FixEHEX::compute_scalar() double FixEHEX::memory_usage() { double bytes = 0.0; - bytes += atom->nmax * sizeof(double); + bytes += (double)atom->nmax * sizeof(double); return bytes; } diff --git a/src/RIGID/fix_rattle.cpp b/src/RIGID/fix_rattle.cpp index 2d2c11974c..6482a28e6f 100644 --- a/src/RIGID/fix_rattle.cpp +++ b/src/RIGID/fix_rattle.cpp @@ -629,7 +629,7 @@ double FixRattle::memory_usage() { int nmax = atom->nmax; double bytes = FixShake::memory_usage(); - bytes += nmax*3 * sizeof(double); + bytes += (double)nmax*3 * sizeof(double); return bytes; } diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index 9ce28438d3..b46cb1667f 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -2453,11 +2453,11 @@ double FixRigid::memory_usage() { int nmax = atom->nmax; double bytes = nmax * sizeof(int); - bytes += nmax * sizeof(imageint); - bytes += nmax*3 * sizeof(double); - bytes += maxvatom*6 * sizeof(double); // vatom + bytes += (double)nmax * sizeof(imageint); + bytes += (double)nmax*3 * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); // vatom if (extended) { - bytes += nmax * sizeof(int); + bytes += (double)nmax * sizeof(int); if (orientflag) bytes = nmax*orientflag * sizeof(double); if (dorientflag) bytes = nmax*3 * sizeof(double); } diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 1b022f35c4..6a26de6083 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -3568,15 +3568,15 @@ double FixRigidSmall::memory_usage() { int nmax = atom->nmax; double bytes = nmax*2 * sizeof(int); - bytes += nmax * sizeof(imageint); - bytes += nmax*3 * sizeof(double); - bytes += maxvatom*6 * sizeof(double); // vatom + bytes += (double)nmax * sizeof(imageint); + bytes += (double)nmax*3 * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); // vatom if (extended) { - bytes += nmax * sizeof(int); + bytes += (double)nmax * sizeof(int); if (orientflag) bytes = nmax*orientflag * sizeof(double); if (dorientflag) bytes = nmax*3 * sizeof(double); } - bytes += nmax_body * sizeof(Body); + bytes += (double)nmax_body * sizeof(Body); return bytes; } diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index 61ba36ea2b..2af6ed8440 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -2679,10 +2679,10 @@ double FixShake::memory_usage() { int nmax = atom->nmax; double bytes = nmax * sizeof(int); - bytes += nmax*4 * sizeof(int); - bytes += nmax*3 * sizeof(int); - bytes += nmax*3 * sizeof(double); - bytes += maxvatom*6 * sizeof(double); + bytes += (double)nmax*4 * sizeof(int); + bytes += (double)nmax*3 * sizeof(int); + bytes += (double)nmax*3 * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); return bytes; } diff --git a/src/SNAP/compute_snap.cpp b/src/SNAP/compute_snap.cpp index eca832f665..ee37b24198 100644 --- a/src/SNAP/compute_snap.cpp +++ b/src/SNAP/compute_snap.cpp @@ -531,12 +531,12 @@ double ComputeSnap::memory_usage() double bytes = size_array_rows*size_array_cols * sizeof(double); // snap - bytes += size_array_rows*size_array_cols * + bytes += (double)size_array_rows*size_array_cols * sizeof(double); // snapall - bytes += nmax*size_peratom * sizeof(double); // snap_peratom + bytes += (double)nmax*size_peratom * sizeof(double); // snap_peratom bytes += snaptr->memory_usage(); // SNA object int n = atom->ntypes+1; - bytes += n*sizeof(int); // map + bytes += (double)n*sizeof(int); // map return bytes; } diff --git a/src/SNAP/pair_snap.cpp b/src/SNAP/pair_snap.cpp index 9be8638db0..8673dd09af 100644 --- a/src/SNAP/pair_snap.cpp +++ b/src/SNAP/pair_snap.cpp @@ -747,11 +747,11 @@ double PairSNAP::memory_usage() double bytes = Pair::memory_usage(); int n = atom->ntypes+1; - bytes += n*n*sizeof(int); // setflag - bytes += n*n*sizeof(double); // cutsq - bytes += n*sizeof(int); // map - bytes += beta_max*ncoeff*sizeof(double); // bispectrum - bytes += beta_max*ncoeff*sizeof(double); // beta + bytes += (double)n*n*sizeof(int); // setflag + bytes += (double)n*n*sizeof(double); // cutsq + bytes += (double)n*sizeof(int); // map + bytes += (double)beta_max*ncoeff*sizeof(double); // bispectrum + bytes += (double)beta_max*ncoeff*sizeof(double); // beta bytes += snaptr->memory_usage(); // SNA object diff --git a/src/SNAP/sna.cpp b/src/SNAP/sna.cpp index d2b423d5db..5568dd002e 100644 --- a/src/SNAP/sna.cpp +++ b/src/SNAP/sna.cpp @@ -1282,33 +1282,33 @@ double SNA::memory_usage() bytes = 0; - bytes += jdimpq*jdimpq * sizeof(double); // pqarray - bytes += idxcg_max * sizeof(double); // cglist + bytes += (double)jdimpq*jdimpq * sizeof(double); // pqarray + bytes += (double)idxcg_max * sizeof(double); // cglist - bytes += nmax * idxu_max * sizeof(double) * 2; // ulist_ij - bytes += idxu_max * nelements * sizeof(double) * 2; // ulisttot - bytes += idxu_max * 3 * sizeof(double) * 2; // dulist + bytes += (double)nmax * idxu_max * sizeof(double) * 2; // ulist_ij + bytes += (double)idxu_max * nelements * sizeof(double) * 2; // ulisttot + bytes += (double)idxu_max * 3 * sizeof(double) * 2; // dulist - bytes += idxz_max * ndoubles * sizeof(double) * 2; // zlist - bytes += idxb_max * ntriples * sizeof(double); // blist - bytes += idxb_max * ntriples * 3 * sizeof(double); // dblist - bytes += idxu_max * nelements * sizeof(double) * 2; // ylist + bytes += (double)idxz_max * ndoubles * sizeof(double) * 2; // zlist + bytes += (double)idxb_max * ntriples * sizeof(double); // blist + bytes += (double)idxb_max * ntriples * 3 * sizeof(double); // dblist + bytes += (double)idxu_max * nelements * sizeof(double) * 2; // ylist - bytes += jdim * jdim * jdim * sizeof(int); // idxcg_block - bytes += jdim * sizeof(int); // idxu_block - bytes += jdim * jdim * jdim * sizeof(int); // idxz_block - bytes += jdim * jdim * jdim * sizeof(int); // idxb_block + bytes += (double)jdim * jdim * jdim * sizeof(int); // idxcg_block + bytes += (double)jdim * sizeof(int); // idxu_block + bytes += (double)jdim * jdim * jdim * sizeof(int); // idxz_block + bytes += (double)jdim * jdim * jdim * sizeof(int); // idxb_block - bytes += idxz_max * sizeof(SNA_ZINDICES); // idxz - bytes += idxb_max * sizeof(SNA_BINDICES); // idxb + bytes += (double)idxz_max * sizeof(SNA_ZINDICES); // idxz + bytes += (double)idxb_max * sizeof(SNA_BINDICES); // idxb if (bzero_flag) - bytes += jdim * sizeof(double); // bzero + bytes += (double)jdim * sizeof(double); // bzero - bytes += nmax * 3 * sizeof(double); // rij - bytes += nmax * sizeof(int); // inside - bytes += nmax * sizeof(double); // wj - bytes += nmax * sizeof(double); // rcutij + bytes += (double)nmax * 3 * sizeof(double); // rij + bytes += (double)nmax * sizeof(int); // inside + bytes += (double)nmax * sizeof(double); // wj + bytes += (double)nmax * sizeof(double); // rcutij return bytes; } diff --git a/src/SRD/fix_srd.cpp b/src/SRD/fix_srd.cpp index d8c5ef2cee..1ba6e4a03f 100644 --- a/src/SRD/fix_srd.cpp +++ b/src/SRD/fix_srd.cpp @@ -3979,13 +3979,13 @@ void FixSRD::triside(double t, double &f, double &df) double FixSRD::memory_usage() { double bytes = 0.0; - bytes += (shifts[0].nbins + shifts[1].nbins) * sizeof(BinAve); - bytes += nmax * sizeof(int); + bytes += (double)(shifts[0].nbins + shifts[1].nbins) * sizeof(BinAve); + bytes += (double)nmax * sizeof(int); if (bigexist) { - bytes += nbins2 * sizeof(int); - bytes += nbins2*ATOMPERBIN * sizeof(int); + bytes += (double)nbins2 * sizeof(int); + bytes += (double)nbins2*ATOMPERBIN * sizeof(int); } - bytes += nmax * sizeof(int); + bytes += (double)nmax * sizeof(int); return bytes; } diff --git a/src/USER-AWPMD/pair_awpmd_cut.cpp b/src/USER-AWPMD/pair_awpmd_cut.cpp index 19bb06ad87..b46bf75181 100644 --- a/src/USER-AWPMD/pair_awpmd_cut.cpp +++ b/src/USER-AWPMD/pair_awpmd_cut.cpp @@ -735,7 +735,7 @@ void PairAWPMDCut::min_x_set(int /* ignore */) double PairAWPMDCut::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * nmax * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/USER-CGSDK/pair_lj_sdk.cpp b/src/USER-CGSDK/pair_lj_sdk.cpp index beac894cc8..fd9e13fecf 100644 --- a/src/USER-CGSDK/pair_lj_sdk.cpp +++ b/src/USER-CGSDK/pair_lj_sdk.cpp @@ -495,9 +495,9 @@ double PairLJSDK::memory_usage() int n = atom->ntypes; // setflag/lj_type - bytes += 2 * (n+1)*(n+1)*sizeof(int); + bytes += (double)2 * (n+1)*(n+1)*sizeof(int); // cut/cutsq/epsilon/sigma/offset/lj1/lj2/lj3/lj4/rminsq/emin - bytes += 11 * (n+1)*(n+1)*sizeof(double); + bytes += (double)11 * (n+1)*(n+1)*sizeof(double); return bytes; } diff --git a/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp b/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp index 7136aa381f..293a4b1b9c 100644 --- a/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp +++ b/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp @@ -654,13 +654,13 @@ double PairLJSDKCoulLong::memory_usage() int n = atom->ntypes; // setflag/lj_type - bytes += 2 * (n+1)*(n+1)*sizeof(int); + bytes += (double)2 * (n+1)*(n+1)*sizeof(int); // lj_cut/lj_cutsq/epsilon/sigma/offset/lj1/lj2/lj3/lj4/rminsq/emin - bytes += 11 * (n+1)*(n+1)*sizeof(double); + bytes += (double)11 * (n+1)*(n+1)*sizeof(double); if (ncoultablebits) { int ntable = 1<nghost; // v_t0[] - bytes += sizeof(*rand_state)*maxRNG; // rand_state[] + bytes += (double)sizeof(double)*3*atom->nghost; // v_t0[] + bytes += (double)sizeof(*rand_state)*maxRNG; // rand_state[] return bytes; } diff --git a/src/USER-EFF/pair_eff_cut.cpp b/src/USER-EFF/pair_eff_cut.cpp index 63c6c6f46a..f39c1d31af 100644 --- a/src/USER-EFF/pair_eff_cut.cpp +++ b/src/USER-EFF/pair_eff_cut.cpp @@ -1079,7 +1079,7 @@ void PairEffCut::min_x_set(int /*ignore*/) double PairEffCut::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * nmax * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp index 0cc21f73a8..c06bd69c48 100644 --- a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp @@ -589,7 +589,7 @@ void *PairLJCutTIP4PLongSoft::extract(const char *str, int &dim) double PairLJCutTIP4PLongSoft::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * nmax * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/USER-FEP/pair_tip4p_long_soft.cpp b/src/USER-FEP/pair_tip4p_long_soft.cpp index 216276ebf1..47b9fe0a93 100644 --- a/src/USER-FEP/pair_tip4p_long_soft.cpp +++ b/src/USER-FEP/pair_tip4p_long_soft.cpp @@ -511,7 +511,7 @@ void *PairTIP4PLongSoft::extract(const char *str, int &dim) double PairTIP4PLongSoft::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * nmax * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/USER-INTEL/pppm_intel.cpp b/src/USER-INTEL/pppm_intel.cpp index 6e836dd3b3..c91066e314 100644 --- a/src/USER-INTEL/pppm_intel.cpp +++ b/src/USER-INTEL/pppm_intel.cpp @@ -979,16 +979,16 @@ double PPPMIntel::memory_usage() { double bytes = PPPM::memory_usage(); if ((comm->nthreads > 1) && !_use_lrt) { - bytes += (comm->nthreads - 1) * (ngrid + INTEL_P3M_ALIGNED_MAXORDER) * + bytes += (double)(comm->nthreads - 1) * (ngrid + INTEL_P3M_ALIGNED_MAXORDER) * sizeof(FFT_SCALAR); } if (differentiation_flag == 1) { - bytes += 3 * nmax * sizeof(FFT_SCALAR); + bytes += (double)3 * nmax * sizeof(FFT_SCALAR); } if (_use_table) { - bytes += rho_points * INTEL_P3M_ALIGNED_MAXORDER * sizeof(FFT_SCALAR); + bytes += (double)rho_points * INTEL_P3M_ALIGNED_MAXORDER * sizeof(FFT_SCALAR); if (differentiation_flag == 1) { - bytes += rho_points * INTEL_P3M_ALIGNED_MAXORDER * sizeof(FFT_SCALAR); + bytes += (double)rho_points * INTEL_P3M_ALIGNED_MAXORDER * sizeof(FFT_SCALAR); } } return bytes; diff --git a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp index 88eb54593a..b139d8e6f2 100644 --- a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp +++ b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp @@ -1431,8 +1431,8 @@ double FixLbRigidPCSphere::memory_usage() { int nmax = atom->nmax; double bytes = nmax * sizeof(int); - bytes += nmax*3 * sizeof(double); - bytes += maxvatom*6 * sizeof(double); + bytes += (double)nmax*3 * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); return bytes; } diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp index 229dfd2433..5d5bdea156 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp @@ -330,10 +330,10 @@ double FixNVEManifoldRattle::memory_usage() { double bytes = 0.0; - bytes += sizeof(statistics); - bytes += sizeof(*ptr_m) + sizeof(ptr_m); - bytes += nvars*sizeof(double) + sizeof(double*); - bytes += nvars*( sizeof(char*) + 3*sizeof(int) ); + bytes += (double)sizeof(statistics); + bytes += (double)sizeof(*ptr_m) + sizeof(ptr_m); + bytes += (double)nvars*sizeof(double) + sizeof(double*); + bytes += (double)nvars*( sizeof(char*) + 3*sizeof(int) ); return bytes; } diff --git a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp index 9ac81aafb0..310dae8725 100644 --- a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp @@ -402,7 +402,7 @@ void FixNVTManifoldRattle::reset_dt() double FixNVTManifoldRattle::memory_usage() { double bytes = FixNVEManifoldRattle::memory_usage(); - bytes += (4*mtchain+1)*sizeof(double); + bytes += (double)(4*mtchain+1)*sizeof(double); return bytes; } diff --git a/src/USER-MEAMC/pair_meamc.cpp b/src/USER-MEAMC/pair_meamc.cpp index d0fb8a0463..b9738f779d 100644 --- a/src/USER-MEAMC/pair_meamc.cpp +++ b/src/USER-MEAMC/pair_meamc.cpp @@ -803,8 +803,8 @@ void PairMEAMC::unpack_reverse_comm(int n, int *list, double *buf) double PairMEAMC::memory_usage() { double bytes = 11 * meam_inst->nmax * sizeof(double); - bytes += (3 + 6 + 10 + 3 + 3 + 3) * meam_inst->nmax * sizeof(double); - bytes += 3 * meam_inst->maxneigh * sizeof(double); + bytes += (double)(3 + 6 + 10 + 3 + 3 + 3) * meam_inst->nmax * sizeof(double); + bytes += (double)3 * meam_inst->maxneigh * sizeof(double); return bytes; } diff --git a/src/USER-MISC/compute_cnp_atom.cpp b/src/USER-MISC/compute_cnp_atom.cpp index 7928599805..c927d8e520 100644 --- a/src/USER-MISC/compute_cnp_atom.cpp +++ b/src/USER-MISC/compute_cnp_atom.cpp @@ -324,7 +324,7 @@ void ComputeCNPAtom::compute_peratom() double ComputeCNPAtom::memory_usage() { double bytes = nmax * sizeof(int); - bytes += nmax * MAXNEAR * sizeof(int); - bytes += nmax * sizeof(double); + bytes += (double)nmax * MAXNEAR * sizeof(int); + bytes += (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-MISC/fix_filter_corotate.cpp b/src/USER-MISC/fix_filter_corotate.cpp index 4f1feeaa6c..38b22c1189 100644 --- a/src/USER-MISC/fix_filter_corotate.cpp +++ b/src/USER-MISC/fix_filter_corotate.cpp @@ -1810,17 +1810,17 @@ double FixFilterCorotate::memory_usage() { double bytes = 0; //GROW: - bytes += 3*sizeof(double) + 5*sizeof(tagint) + 5*sizeof(int); + bytes += (double)3*sizeof(double) + 5*sizeof(tagint) + 5*sizeof(int); //clist - bytes += 13*atom->nlocal*sizeof(int); - bytes += 15*16*nlocal*sizeof(double); + bytes += (double)13*atom->nlocal*sizeof(int); + bytes += (double)15*16*nlocal*sizeof(double); //fixed: int nb = atom->nbondtypes+1; int na = atom->nangletypes+1; int nt = atom->ntypes+1; - bytes += (nb+na+nt)*sizeof(int); - bytes += (nt-1+nb+na+15*15+18+10*15)*sizeof(double); + bytes += (double)(nb+na+nt)*sizeof(int); + bytes += (double)(nt-1+nb+na+15*15+18+10*15)*sizeof(double); return bytes; } diff --git a/src/USER-MISC/fix_orient_eco.cpp b/src/USER-MISC/fix_orient_eco.cpp index f90a1ab23e..0594e9c5b4 100644 --- a/src/USER-MISC/fix_orient_eco.cpp +++ b/src/USER-MISC/fix_orient_eco.cpp @@ -475,7 +475,7 @@ void FixOrientECO::unpack_forward_comm(int n, int first, double *buf) { double FixOrientECO::memory_usage() { double bytes = nmax * sizeof(Nbr); - bytes += 2 * nmax * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/USER-MISC/fix_propel_self.cpp b/src/USER-MISC/fix_propel_self.cpp index 7805c4d9a7..a1e69ad179 100644 --- a/src/USER-MISC/fix_propel_self.cpp +++ b/src/USER-MISC/fix_propel_self.cpp @@ -131,7 +131,7 @@ double FixPropelSelf::memory_usage() { // magnitude + thermostat_orient + mode + n_types_filter + apply_to_type double bytes = sizeof(double) + 3*sizeof(int) + sizeof(int*); - bytes += sizeof(int)*atom->ntypes*n_types_filter; + bytes += (double)sizeof(int)*atom->ntypes*n_types_filter; return bytes; } diff --git a/src/USER-MISC/fix_ttm_mod.cpp b/src/USER-MISC/fix_ttm_mod.cpp index a776e7e1da..9cac1c02b2 100644 --- a/src/USER-MISC/fix_ttm_mod.cpp +++ b/src/USER-MISC/fix_ttm_mod.cpp @@ -886,8 +886,8 @@ void FixTTMMod::end_of_step() double FixTTMMod::memory_usage() { double bytes = 0.0; - bytes += 5*total_nnodes * sizeof(int); - bytes += 14*total_nnodes * sizeof(double); + bytes += (double)5*total_nnodes * sizeof(int); + bytes += (double)14*total_nnodes * sizeof(double); return bytes; } diff --git a/src/USER-MISC/pair_gauss_cut.cpp b/src/USER-MISC/pair_gauss_cut.cpp index 2e65640090..80101b8f97 100644 --- a/src/USER-MISC/pair_gauss_cut.cpp +++ b/src/USER-MISC/pair_gauss_cut.cpp @@ -392,8 +392,8 @@ double PairGaussCut::memory_usage() double bytes = Pair::memory_usage(); - bytes += 7*((n+1)*(n+1) * sizeof(double) + (n+1)*sizeof(double *)); - bytes += 1*((n+1)*(n+1) * sizeof(int) + (n+1)*sizeof(int *)); + bytes += (double)7*((n+1)*(n+1) * sizeof(double) + (n+1)*sizeof(double *)); + bytes += (double)1*((n+1)*(n+1) * sizeof(int) + (n+1)*sizeof(int *)); return bytes; } diff --git a/src/USER-MISC/pair_list.cpp b/src/USER-MISC/pair_list.cpp index f14fd67bf7..5b6729ff58 100644 --- a/src/USER-MISC/pair_list.cpp +++ b/src/USER-MISC/pair_list.cpp @@ -410,9 +410,9 @@ double PairList::init_one(int, int) double PairList::memory_usage() { double bytes = npairs * sizeof(int); - bytes += npairs * sizeof(list_parm_t); + bytes += (double)npairs * sizeof(list_parm_t); const int n = atom->ntypes+1; - bytes += n*(n*sizeof(int) + sizeof(int *)); - bytes += n*(n*sizeof(double) + sizeof(double *)); + bytes += (double)n*(n*sizeof(int) + sizeof(int *)); + bytes += (double)n*(n*sizeof(double) + sizeof(double *)); return bytes; } diff --git a/src/USER-MISC/pair_local_density.cpp b/src/USER-MISC/pair_local_density.cpp index dc4e694995..c85633e600 100644 --- a/src/USER-MISC/pair_local_density.cpp +++ b/src/USER-MISC/pair_local_density.cpp @@ -882,8 +882,8 @@ void PairLocalDensity::unpack_reverse_comm(int n, int *list, double *buf) { double PairLocalDensity::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * (nmax*nLD) * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * (nmax*nLD) * sizeof(double); return bytes; } diff --git a/src/USER-MOLFILE/dump_molfile.cpp b/src/USER-MOLFILE/dump_molfile.cpp index f96807138e..9de9a79e26 100644 --- a/src/USER-MOLFILE/dump_molfile.cpp +++ b/src/USER-MOLFILE/dump_molfile.cpp @@ -456,6 +456,6 @@ double DumpMolfile::memory_usage() { double bytes = Dump::memory_usage(); bytes += memory->usage(coords,natoms*3); - bytes += sizeof(MFI); + bytes += (double)sizeof(MFI); return bytes; } diff --git a/src/USER-OMP/fix_omp.cpp b/src/USER-OMP/fix_omp.cpp index b60a8d1e32..23671f4c7e 100644 --- a/src/USER-OMP/fix_omp.cpp +++ b/src/USER-OMP/fix_omp.cpp @@ -371,8 +371,8 @@ void FixOMP::pre_force(int) double FixOMP::memory_usage() { - double bytes = _nthr * (sizeof(ThrData *) + sizeof(ThrData)); - bytes += _nthr * thr[0]->memory_usage(); + double bytes = (double)_nthr * (sizeof(ThrData *) + sizeof(ThrData)); + bytes += (double)_nthr * thr[0]->memory_usage(); return bytes; } diff --git a/src/USER-OMP/msm_cg_omp.cpp b/src/USER-OMP/msm_cg_omp.cpp index e7cfa10cd4..b3f173d550 100644 --- a/src/USER-OMP/msm_cg_omp.cpp +++ b/src/USER-OMP/msm_cg_omp.cpp @@ -564,6 +564,6 @@ void MSMCGOMP::fieldforce_peratom() double MSMCGOMP::memory_usage() { double bytes = MSM::memory_usage(); - bytes += nmax * sizeof(int); + bytes += (double)nmax * sizeof(int); return bytes; } diff --git a/src/USER-OMP/pair_adp_omp.cpp b/src/USER-OMP/pair_adp_omp.cpp index 1e0bcd214d..bd92936ecb 100644 --- a/src/USER-OMP/pair_adp_omp.cpp +++ b/src/USER-OMP/pair_adp_omp.cpp @@ -387,7 +387,7 @@ void PairADPOMP::eval(int iifrom, int iito, ThrData * const thr) double PairADPOMP::memory_usage() { double bytes = memory_usage_thr(); - bytes += PairADP::memory_usage(); - bytes += (comm->nthreads-1) * nmax * (10*sizeof(double) + 3*sizeof(double *)); + bytes += (double)PairADP::memory_usage(); + bytes += (double)(comm->nthreads-1) * nmax * (10*sizeof(double) + 3*sizeof(double *)); return bytes; } diff --git a/src/USER-OMP/pair_brownian_omp.cpp b/src/USER-OMP/pair_brownian_omp.cpp index 2841c5e840..a82b8d575c 100644 --- a/src/USER-OMP/pair_brownian_omp.cpp +++ b/src/USER-OMP/pair_brownian_omp.cpp @@ -406,8 +406,8 @@ double PairBrownianOMP::memory_usage() { double bytes = memory_usage_thr(); bytes += PairBrownian::memory_usage(); - bytes += nthreads * sizeof(RanMars*); - bytes += nthreads * sizeof(RanMars); + bytes += (double)nthreads * sizeof(RanMars*); + bytes += (double)nthreads * sizeof(RanMars); return bytes; } diff --git a/src/USER-OMP/pair_brownian_poly_omp.cpp b/src/USER-OMP/pair_brownian_poly_omp.cpp index d02d13a74e..124617afab 100644 --- a/src/USER-OMP/pair_brownian_poly_omp.cpp +++ b/src/USER-OMP/pair_brownian_poly_omp.cpp @@ -396,8 +396,8 @@ double PairBrownianPolyOMP::memory_usage() { double bytes = memory_usage_thr(); bytes += PairBrownianPoly::memory_usage(); - bytes += nthreads * sizeof(RanMars*); - bytes += nthreads * sizeof(RanMars); + bytes += (double)nthreads * sizeof(RanMars*); + bytes += (double)nthreads * sizeof(RanMars); return bytes; } diff --git a/src/USER-OMP/pair_dpd_omp.cpp b/src/USER-OMP/pair_dpd_omp.cpp index ddee900b56..97a3c5c647 100644 --- a/src/USER-OMP/pair_dpd_omp.cpp +++ b/src/USER-OMP/pair_dpd_omp.cpp @@ -220,8 +220,8 @@ double PairDPDOMP::memory_usage() { double bytes = memory_usage_thr(); bytes += PairDPD::memory_usage(); - bytes += comm->nthreads * sizeof(RanMars*); - bytes += comm->nthreads * sizeof(RanMars); + bytes += (double)comm->nthreads * sizeof(RanMars*); + bytes += (double)comm->nthreads * sizeof(RanMars); return bytes; } diff --git a/src/USER-OMP/pair_dpd_tstat_omp.cpp b/src/USER-OMP/pair_dpd_tstat_omp.cpp index 9695895ddc..5e1b145494 100644 --- a/src/USER-OMP/pair_dpd_tstat_omp.cpp +++ b/src/USER-OMP/pair_dpd_tstat_omp.cpp @@ -220,8 +220,8 @@ double PairDPDTstatOMP::memory_usage() { double bytes = memory_usage_thr(); bytes += PairDPDTstat::memory_usage(); - bytes += comm->nthreads * sizeof(RanMars*); - bytes += comm->nthreads * sizeof(RanMars); + bytes += (double)comm->nthreads * sizeof(RanMars*); + bytes += (double)comm->nthreads * sizeof(RanMars); return bytes; } diff --git a/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp b/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp index 9dceea1239..9abc0c236e 100644 --- a/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp +++ b/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp @@ -309,7 +309,7 @@ void PairHbondDreidingLJOMP::eval(int iifrom, int iito, ThrData * const thr) double PairHbondDreidingLJOMP::memory_usage() { double bytes = memory_usage_thr(); - bytes += comm->nthreads * 2 * sizeof(double); + bytes += (double)comm->nthreads * 2 * sizeof(double); bytes += PairHbondDreidingLJ::memory_usage(); return bytes; diff --git a/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp b/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp index 531131885d..1cc416219d 100644 --- a/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp +++ b/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp @@ -308,7 +308,7 @@ void PairHbondDreidingMorseOMP::eval(int iifrom, int iito, ThrData * const thr) double PairHbondDreidingMorseOMP::memory_usage() { double bytes = memory_usage_thr(); - bytes += comm->nthreads * 2 * sizeof(double); + bytes += (double)comm->nthreads * 2 * sizeof(double); bytes += PairHbondDreidingMorse::memory_usage(); return bytes; diff --git a/src/USER-OMP/thr_data.cpp b/src/USER-OMP/thr_data.cpp index 6a0ce9ba3e..2935e87d04 100644 --- a/src/USER-OMP/thr_data.cpp +++ b/src/USER-OMP/thr_data.cpp @@ -278,8 +278,8 @@ void ThrData::virial_fdotr_compute(double **x, int nlocal, int nghost, int nfirs double ThrData::memory_usage() { double bytes = (7 + 6*6) * sizeof(double); - bytes += 2 * sizeof(double*); - bytes += 4 * sizeof(int); + bytes += (double)2 * sizeof(double*); + bytes += (double)4 * sizeof(int); return bytes; } diff --git a/src/USER-PTM/compute_ptm_atom.cpp b/src/USER-PTM/compute_ptm_atom.cpp index db472aac85..593c7f9b5e 100644 --- a/src/USER-PTM/compute_ptm_atom.cpp +++ b/src/USER-PTM/compute_ptm_atom.cpp @@ -334,6 +334,6 @@ void ComputePTMAtom::compute_peratom() { double ComputePTMAtom::memory_usage() { double bytes = nmax * NUM_COLUMNS * sizeof(double); - bytes += nmax * sizeof(double); + bytes += (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-QMMM/fix_qmmm.cpp b/src/USER-QMMM/fix_qmmm.cpp index f352cce827..6689ebdb9d 100644 --- a/src/USER-QMMM/fix_qmmm.cpp +++ b/src/USER-QMMM/fix_qmmm.cpp @@ -826,8 +826,8 @@ double FixQMMM::memory_usage(void) double bytes; bytes = sizeof(FixQMMM); - bytes += maxbuf; - bytes += 6*num_qm*sizeof(double); + bytes += (double)maxbuf; + bytes += (double)6*num_qm*sizeof(double); return bytes; } diff --git a/src/USER-QTB/fix_qbmsst.cpp b/src/USER-QTB/fix_qbmsst.cpp index 2257c9992e..b1a4f39382 100644 --- a/src/USER-QTB/fix_qbmsst.cpp +++ b/src/USER-QTB/fix_qbmsst.cpp @@ -1122,10 +1122,10 @@ double FixQBMSST::memory_usage() { double bytes = 0.0; // random_arrays memory usage - bytes += (atom->nmax* 6*N_f * sizeof(double)); + bytes += (double)(atom->nmax* 6*N_f * sizeof(double)); // fran memory usage - bytes += (atom->nmax* 3 * sizeof(double)); - bytes += (4*N_f * sizeof(double)); + bytes += (double)(atom->nmax* 3 * sizeof(double)); + bytes += (double)(4*N_f * sizeof(double)); return bytes; } diff --git a/src/USER-QTB/fix_qtb.cpp b/src/USER-QTB/fix_qtb.cpp index 31f0808ca7..f97d142099 100644 --- a/src/USER-QTB/fix_qtb.cpp +++ b/src/USER-QTB/fix_qtb.cpp @@ -375,10 +375,10 @@ double FixQTB::memory_usage() { double bytes = 0.0; // random_arrays memory usage - bytes += (atom->nmax* 6*N_f * sizeof(double)); + bytes += (double)(atom->nmax* 6*N_f * sizeof(double)); // fran memory usage - bytes += (atom->nmax* 3 * sizeof(double)); - bytes += (4*N_f * sizeof(double)); + bytes += (double)(atom->nmax* 3 * sizeof(double)); + bytes += (double)(4*N_f * sizeof(double)); return bytes; } diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index e1b7ff4fa6..f49374b0b8 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -3745,7 +3745,7 @@ double FixBondReact::memory_usage() int nmax = atom->nmax; double bytes = nmax * sizeof(int); bytes = 2*nmax * sizeof(tagint); - bytes += nmax * sizeof(double); + bytes += (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp index abe6f26081..dd978c7582 100644 --- a/src/USER-REAXC/fix_qeq_reax.cpp +++ b/src/USER-REAXC/fix_qeq_reax.cpp @@ -900,13 +900,13 @@ double FixQEqReax::memory_usage() double bytes; bytes = atom->nmax*nprev*2 * sizeof(double); // s_hist & t_hist - bytes += atom->nmax*11 * sizeof(double); // storage - bytes += n_cap*2 * sizeof(int); // matrix... - bytes += m_cap * sizeof(int); - bytes += m_cap * sizeof(double); + bytes += (double)atom->nmax*11 * sizeof(double); // storage + bytes += (double)n_cap*2 * sizeof(int); // matrix... + bytes += (double)m_cap * sizeof(int); + bytes += (double)m_cap * sizeof(double); if (dual_enabled) - bytes += atom->nmax*4 * sizeof(double); // double size for q, d, r, and p + bytes += (double)atom->nmax*4 * sizeof(double); // double size for q, d, r, and p return bytes; } diff --git a/src/USER-REAXC/fix_reaxc_bonds.cpp b/src/USER-REAXC/fix_reaxc_bonds.cpp index 6d90ef5fae..0cb78521f2 100644 --- a/src/USER-REAXC/fix_reaxc_bonds.cpp +++ b/src/USER-REAXC/fix_reaxc_bonds.cpp @@ -354,9 +354,9 @@ double FixReaxCBonds::memory_usage() double bytes; bytes = 3.0*nmax*sizeof(double); - bytes += nmax*sizeof(int); - bytes += 1.0*nmax*MAXREAXBOND*sizeof(double); - bytes += 1.0*nmax*MAXREAXBOND*sizeof(int); + bytes += (double)nmax*sizeof(int); + bytes += (double)1.0*nmax*MAXREAXBOND*sizeof(double); + bytes += (double)1.0*nmax*MAXREAXBOND*sizeof(int); return bytes; } diff --git a/src/USER-REAXC/pair_reaxc.cpp b/src/USER-REAXC/pair_reaxc.cpp index bfe9330819..fe78fbbb37 100644 --- a/src/USER-REAXC/pair_reaxc.cpp +++ b/src/USER-REAXC/pair_reaxc.cpp @@ -829,25 +829,25 @@ double PairReaxC::memory_usage() double bytes = 0.0; // From pair_reax_c - bytes += 1.0 * system->N * sizeof(int); - bytes += 1.0 * system->N * sizeof(double); + bytes += (double)1.0 * system->N * sizeof(int); + bytes += (double)1.0 * system->N * sizeof(double); // From reaxc_allocate: BO - bytes += 1.0 * system->total_cap * sizeof(reax_atom); - bytes += 19.0 * system->total_cap * sizeof(double); - bytes += 3.0 * system->total_cap * sizeof(int); + bytes += (double)1.0 * system->total_cap * sizeof(reax_atom); + bytes += (double)19.0 * system->total_cap * sizeof(double); + bytes += (double)3.0 * system->total_cap * sizeof(int); // From reaxc_lists - bytes += 2.0 * lists->n * sizeof(int); - bytes += lists->num_intrs * sizeof(three_body_interaction_data); - bytes += lists->num_intrs * sizeof(bond_data); - bytes += lists->num_intrs * sizeof(dbond_data); - bytes += lists->num_intrs * sizeof(dDelta_data); - bytes += lists->num_intrs * sizeof(far_neighbor_data); - bytes += lists->num_intrs * sizeof(hbond_data); + bytes += (double)2.0 * lists->n * sizeof(int); + bytes += (double)lists->num_intrs * sizeof(three_body_interaction_data); + bytes += (double)lists->num_intrs * sizeof(bond_data); + bytes += (double)lists->num_intrs * sizeof(dbond_data); + bytes += (double)lists->num_intrs * sizeof(dDelta_data); + bytes += (double)lists->num_intrs * sizeof(far_neighbor_data); + bytes += (double)lists->num_intrs * sizeof(hbond_data); if (fixspecies_flag) - bytes += 2 * nmax * MAXSPECBOND * sizeof(double); + bytes += (double)2 * nmax * MAXSPECBOND * sizeof(double); return bytes; } diff --git a/src/USER-SCAFACOS/scafacos.cpp b/src/USER-SCAFACOS/scafacos.cpp index ab28589f20..0ce027ec1e 100644 --- a/src/USER-SCAFACOS/scafacos.cpp +++ b/src/USER-SCAFACOS/scafacos.cpp @@ -380,8 +380,8 @@ int Scafacos::modify_param(int narg, char **arg) double Scafacos::memory_usage() { double bytes = 0.0; - bytes += maxatom * sizeof(double); - bytes += 3*maxatom * sizeof(double); + bytes += (double)maxatom * sizeof(double); + bytes += (double)3*maxatom * sizeof(double); return bytes; } diff --git a/src/USER-SDPD/fix_meso_move.cpp b/src/USER-SDPD/fix_meso_move.cpp index 75a5179f8e..6721bcb70e 100644 --- a/src/USER-SDPD/fix_meso_move.cpp +++ b/src/USER-SDPD/fix_meso_move.cpp @@ -800,8 +800,8 @@ void FixMesoMove::final_integrate () { double FixMesoMove::memory_usage () { double bytes = atom->nmax*3 * sizeof(double); - if (displaceflag) bytes += atom->nmax*3 * sizeof(double); - if (velocityflag) bytes += atom->nmax*3 * sizeof(double); + if (displaceflag) bytes += (double)atom->nmax*3 * sizeof(double); + if (velocityflag) bytes += (double)atom->nmax*3 * sizeof(double); return bytes; } diff --git a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp index 1c1fb539f3..685278d846 100644 --- a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp +++ b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp @@ -355,11 +355,11 @@ void FixSMD_TLSPH_ReferenceConfiguration::setup(int /*vflag*/) { double FixSMD_TLSPH_ReferenceConfiguration::memory_usage() { int nmax = atom->nmax; int bytes = nmax * sizeof(int); - bytes += nmax * maxpartner * sizeof(tagint); // partner array - bytes += nmax * maxpartner * sizeof(float); // wf_list - bytes += nmax * maxpartner * sizeof(float); // wfd_list - bytes += nmax * maxpartner * sizeof(float); // damage_per_interaction array - bytes += nmax * sizeof(int); // npartner array + bytes += (double)nmax * maxpartner * sizeof(tagint); // partner array + bytes += (double)nmax * maxpartner * sizeof(float); // wf_list + bytes += (double)nmax * maxpartner * sizeof(float); // wfd_list + bytes += (double)nmax * maxpartner * sizeof(float); // damage_per_interaction array + bytes += (double)nmax * sizeof(int); // npartner array return bytes; } diff --git a/src/USER-SMTBQ/pair_smtbq.cpp b/src/USER-SMTBQ/pair_smtbq.cpp index 2eeb6990d3..f32d2e0c98 100644 --- a/src/USER-SMTBQ/pair_smtbq.cpp +++ b/src/USER-SMTBQ/pair_smtbq.cpp @@ -3525,9 +3525,9 @@ void PairSMTBQ::reverse_int(int *tab) double PairSMTBQ::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += nmax * sizeof(int); - bytes += MAXNEIGH * nmax * sizeof(int); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)nmax * sizeof(int); + bytes += (double)MAXNEIGH * nmax * sizeof(int); return bytes; } diff --git a/src/VORONOI/compute_voronoi_atom.cpp b/src/VORONOI/compute_voronoi_atom.cpp index 2c3dac06f8..63158d4a6b 100644 --- a/src/VORONOI/compute_voronoi_atom.cpp +++ b/src/VORONOI/compute_voronoi_atom.cpp @@ -616,7 +616,7 @@ double ComputeVoronoi::memory_usage() { double bytes = size_peratom_cols * nmax * sizeof(double); // estimate based on average coordination of 12 - if (faces_flag) bytes += 12 * size_local_cols * nmax * sizeof(double); + if (faces_flag) bytes += (double)12 * size_local_cols * nmax * sizeof(double); return bytes; } diff --git a/src/angle.cpp b/src/angle.cpp index 110719d432..17ece68755 100644 --- a/src/angle.cpp +++ b/src/angle.cpp @@ -351,7 +351,7 @@ void Angle::ev_tally(int i, int j, int k, int nlocal, int newton_bond, double Angle::memory_usage() { double bytes = comm->nthreads*maxeatom * sizeof(double); - bytes += comm->nthreads*maxvatom*6 * sizeof(double); - bytes += comm->nthreads*maxcvatom*9 * sizeof(double); + bytes += (double)comm->nthreads*maxvatom*6 * sizeof(double); + bytes += (double)comm->nthreads*maxcvatom*9 * sizeof(double); return bytes; } diff --git a/src/angle_hybrid.cpp b/src/angle_hybrid.cpp index 94b941c234..98d9bb9762 100644 --- a/src/angle_hybrid.cpp +++ b/src/angle_hybrid.cpp @@ -392,9 +392,9 @@ double AngleHybrid::single(int type, int i1, int i2, int i3) double AngleHybrid::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += maxcvatom*9 * sizeof(double); - for (int m = 0; m < nstyles; m++) bytes += maxangle[m]*4 * sizeof(int); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)maxcvatom*9 * sizeof(double); + for (int m = 0; m < nstyles; m++) bytes += (double)maxangle[m]*4 * sizeof(int); for (int m = 0; m < nstyles; m++) if (styles[m]) bytes += styles[m]->memory_usage(); return bytes; diff --git a/src/atom.cpp b/src/atom.cpp index daead53a83..3308d07267 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -2700,12 +2700,12 @@ double Atom::memory_usage() { double bytes = avec->memory_usage(); - bytes += max_same*sizeof(int); + bytes += (double)max_same*sizeof(int); if (map_style == MAP_ARRAY) bytes += memory->usage(map_array,map_maxarray); else if (map_style == MAP_HASH) { - bytes += map_nbucket*sizeof(int); - bytes += map_nhash*sizeof(HashElem); + bytes += (double)map_nbucket*sizeof(int); + bytes += (double)map_nhash*sizeof(HashElem); } if (maxnext) { bytes += memory->usage(next,maxnext); diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp index 0310e10540..533d7975c1 100644 --- a/src/atom_vec_body.cpp +++ b/src/atom_vec_body.cpp @@ -554,14 +554,14 @@ void AtomVecBody::data_body(int m, int ninteger, int ndouble, double AtomVecBody::memory_usage_bonus() { double bytes = 0; - bytes += nmax_bonus*sizeof(Bonus); + bytes += (double)nmax_bonus*sizeof(Bonus); bytes += icp->size() + dcp->size(); int nall = nlocal_bonus + nghost_bonus; for (int i = 0; i < nall; i++) { if (body[i] >= 0) { - bytes += bonus[body[i]].ninteger * sizeof(int); - bytes += bonus[body[i]].ndouble * sizeof(double); + bytes += (double)bonus[body[i]].ninteger * sizeof(int); + bytes += (double)bonus[body[i]].ndouble * sizeof(double); } } diff --git a/src/atom_vec_line.cpp b/src/atom_vec_line.cpp index dd899fbb7e..696110ab77 100644 --- a/src/atom_vec_line.cpp +++ b/src/atom_vec_line.cpp @@ -383,7 +383,7 @@ void AtomVecLine::data_atom_bonus(int m, char **values) double AtomVecLine::memory_usage_bonus() { double bytes = 0; - bytes += nmax_bonus*sizeof(Bonus); + bytes += (double)nmax_bonus*sizeof(Bonus); return bytes; } diff --git a/src/atom_vec_tri.cpp b/src/atom_vec_tri.cpp index 77a46c2b59..e9477a7d41 100644 --- a/src/atom_vec_tri.cpp +++ b/src/atom_vec_tri.cpp @@ -605,7 +605,7 @@ void AtomVecTri::data_atom_bonus(int m, char **values) double AtomVecTri::memory_usage_bonus() { double bytes = 0; - bytes += nmax_bonus*sizeof(Bonus); + bytes += (double)nmax_bonus*sizeof(Bonus); return bytes; } diff --git a/src/bond.cpp b/src/bond.cpp index 16d3c43dea..e8d220d104 100644 --- a/src/bond.cpp +++ b/src/bond.cpp @@ -330,7 +330,7 @@ void Bond::write_file(int narg, char **arg) double Bond::memory_usage() { double bytes = comm->nthreads*maxeatom * sizeof(double); - bytes += comm->nthreads*maxvatom*6 * sizeof(double); + bytes += (double)comm->nthreads*maxvatom*6 * sizeof(double); return bytes; } diff --git a/src/bond_hybrid.cpp b/src/bond_hybrid.cpp index bcd079105f..ec275ce0a4 100644 --- a/src/bond_hybrid.cpp +++ b/src/bond_hybrid.cpp @@ -387,8 +387,8 @@ double BondHybrid::single(int type, double rsq, int i, int j, double BondHybrid::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - for (int m = 0; m < nstyles; m++) bytes += maxbond[m]*3 * sizeof(int); + bytes += (double)maxvatom*6 * sizeof(double); + for (int m = 0; m < nstyles; m++) bytes += (double)maxbond[m]*3 * sizeof(int); for (int m = 0; m < nstyles; m++) if (styles[m]) bytes += styles[m]->memory_usage(); return bytes; diff --git a/src/comm_brick.cpp b/src/comm_brick.cpp index 1af471bf37..8983637e5a 100644 --- a/src/comm_brick.cpp +++ b/src/comm_brick.cpp @@ -1510,7 +1510,7 @@ void *CommBrick::extract(const char *str, int &dim) double CommBrick::memory_usage() { double bytes = 0; - bytes += nprocs * sizeof(int); // grid2proc + bytes += (double)nprocs * sizeof(int); // grid2proc for (int i = 0; i < nswap; i++) bytes += memory->usage(sendlist[i],maxsendlist[i]); bytes += memory->usage(buf_send,maxsend+bufextra); diff --git a/src/compute_angmom_chunk.cpp b/src/compute_angmom_chunk.cpp index 03c65deb19..d35f274d7a 100644 --- a/src/compute_angmom_chunk.cpp +++ b/src/compute_angmom_chunk.cpp @@ -251,7 +251,7 @@ void ComputeAngmomChunk::allocate() double ComputeAngmomChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); return bytes; } diff --git a/src/compute_centro_atom.cpp b/src/compute_centro_atom.cpp index da5e88030e..a8669efb28 100644 --- a/src/compute_centro_atom.cpp +++ b/src/compute_centro_atom.cpp @@ -437,6 +437,6 @@ void ComputeCentroAtom::select2(int k, int n, double *arr, int *iarr) double ComputeCentroAtom::memory_usage() { double bytes = nmax * sizeof(double); - if (axes_flag) bytes += size_peratom_cols*nmax * sizeof(double); + if (axes_flag) bytes += (double)size_peratom_cols*nmax * sizeof(double); return bytes; } diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index 764f7ac586..9604c8d7a2 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -2005,8 +2005,8 @@ void ComputeChunkAtom::set_arrays(int i) double ComputeChunkAtom::memory_usage() { double bytes = 2*MAX(nmaxint,0) * sizeof(int); // ichunk,exclude - bytes += nmax * sizeof(double); // chunk - bytes += ncoord*nchunk * sizeof(double); // coord - if (compress) bytes += nchunk * sizeof(int); // chunkID + bytes += (double)nmax * sizeof(double); // chunk + bytes += (double)ncoord*nchunk * sizeof(double); // coord + if (compress) bytes += (double)nchunk * sizeof(int); // chunkID return bytes; } diff --git a/src/compute_cna_atom.cpp b/src/compute_cna_atom.cpp index cfc649ec0b..f629508bde 100644 --- a/src/compute_cna_atom.cpp +++ b/src/compute_cna_atom.cpp @@ -356,7 +356,7 @@ void ComputeCNAAtom::compute_peratom() double ComputeCNAAtom::memory_usage() { double bytes = nmax * sizeof(int); - bytes += nmax * MAXNEAR * sizeof(int); - bytes += nmax * sizeof(double); + bytes += (double)nmax * MAXNEAR * sizeof(int); + bytes += (double)nmax * sizeof(double); return bytes; } diff --git a/src/compute_com_chunk.cpp b/src/compute_com_chunk.cpp index 57685cf5a5..54b2354d26 100644 --- a/src/compute_com_chunk.cpp +++ b/src/compute_com_chunk.cpp @@ -239,6 +239,6 @@ void ComputeCOMChunk::allocate() double ComputeCOMChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); return bytes; } diff --git a/src/compute_dipole_chunk.cpp b/src/compute_dipole_chunk.cpp index 2197c8d598..540e533727 100644 --- a/src/compute_dipole_chunk.cpp +++ b/src/compute_dipole_chunk.cpp @@ -293,7 +293,7 @@ void ComputeDipoleChunk::allocate() double ComputeDipoleChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); - bytes += (bigint) maxchunk * 2*4 * sizeof(double); + bytes += (double)maxchunk * 2*3 * sizeof(double); + bytes += (double)maxchunk * 2*4 * sizeof(double); return bytes; } diff --git a/src/compute_displace_atom.cpp b/src/compute_displace_atom.cpp index d0912df6d3..cb1bb30275 100644 --- a/src/compute_displace_atom.cpp +++ b/src/compute_displace_atom.cpp @@ -248,6 +248,6 @@ void ComputeDisplaceAtom::refresh() double ComputeDisplaceAtom::memory_usage() { double bytes = nmax*4 * sizeof(double); - bytes += nvmax * sizeof(double); + bytes += (double)nvmax * sizeof(double); return bytes; } diff --git a/src/compute_fragment_atom.cpp b/src/compute_fragment_atom.cpp index c136c1aba8..b7ed6c31d1 100644 --- a/src/compute_fragment_atom.cpp +++ b/src/compute_fragment_atom.cpp @@ -286,6 +286,6 @@ void ComputeFragmentAtom::unpack_forward_comm(int n, int first, double *buf) double ComputeFragmentAtom::memory_usage() { double bytes = nmax * sizeof(double); - bytes += 3*nmax * sizeof(int); + bytes += (double)3*nmax * sizeof(int); return bytes; } diff --git a/src/compute_global_atom.cpp b/src/compute_global_atom.cpp index 10cde42ef9..63fd4241d8 100644 --- a/src/compute_global_atom.cpp +++ b/src/compute_global_atom.cpp @@ -521,8 +521,8 @@ void ComputeGlobalAtom::compute_peratom() double ComputeGlobalAtom::memory_usage() { double bytes = nmax*nvalues * sizeof(double); - bytes += nmax * sizeof(int); // indices - if (varatom) bytes += nmax * sizeof(double); // varatom - bytes += maxvector * sizeof(double); // vecglobal + bytes += (double)nmax * sizeof(int); // indices + if (varatom) bytes += (double)nmax * sizeof(double); // varatom + bytes += (double)maxvector * sizeof(double); // vecglobal return bytes; } diff --git a/src/compute_gyration_chunk.cpp b/src/compute_gyration_chunk.cpp index 94aac64623..d2af181eaf 100644 --- a/src/compute_gyration_chunk.cpp +++ b/src/compute_gyration_chunk.cpp @@ -357,8 +357,8 @@ void ComputeGyrationChunk::allocate() double ComputeGyrationChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); - if (tensor) bytes += (bigint) maxchunk * 2*6 * sizeof(double); - else bytes += (bigint) maxchunk * 2 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); + if (tensor) bytes += (double) maxchunk * 2*6 * sizeof(double); + else bytes += (double) maxchunk * 2 * sizeof(double); return bytes; } diff --git a/src/compute_hexorder_atom.cpp b/src/compute_hexorder_atom.cpp index aae935815c..4c50b227ab 100644 --- a/src/compute_hexorder_atom.cpp +++ b/src/compute_hexorder_atom.cpp @@ -339,8 +339,8 @@ void ComputeHexOrderAtom::select2(int k, int n, double *arr, int *iarr) double ComputeHexOrderAtom::memory_usage() { double bytes = ncol*nmax * sizeof(double); - bytes += maxneigh * sizeof(double); - bytes += maxneigh * sizeof(int); + bytes += (double)maxneigh * sizeof(double); + bytes += (double)maxneigh * sizeof(int); return bytes; } diff --git a/src/compute_inertia_chunk.cpp b/src/compute_inertia_chunk.cpp index 8c0655f916..d2c6d345ce 100644 --- a/src/compute_inertia_chunk.cpp +++ b/src/compute_inertia_chunk.cpp @@ -253,7 +253,7 @@ void ComputeInertiaChunk::allocate() double ComputeInertiaChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); - bytes += (bigint) maxchunk * 2*6 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2*6 * sizeof(double); return bytes; } diff --git a/src/compute_msd_chunk.cpp b/src/compute_msd_chunk.cpp index e0bb54c68f..9dc3281b78 100644 --- a/src/compute_msd_chunk.cpp +++ b/src/compute_msd_chunk.cpp @@ -296,7 +296,7 @@ void ComputeMSDChunk::allocate() double ComputeMSDChunk::memory_usage() { double bytes = (bigint) nchunk * 2 * sizeof(double); - bytes += (bigint) nchunk * 2*3 * sizeof(double); - bytes += (bigint) nchunk * 4 * sizeof(double); + bytes += (double) nchunk * 2*3 * sizeof(double); + bytes += (double) nchunk * 4 * sizeof(double); return bytes; } diff --git a/src/compute_omega_chunk.cpp b/src/compute_omega_chunk.cpp index 3619040737..b721f0efb5 100644 --- a/src/compute_omega_chunk.cpp +++ b/src/compute_omega_chunk.cpp @@ -382,9 +382,9 @@ void ComputeOmegaChunk::allocate() double ComputeOmegaChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); - bytes += (bigint) maxchunk * 2*6 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); - bytes += (bigint) maxchunk * 3 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2*6 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 3 * sizeof(double); return bytes; } diff --git a/src/compute_orientorder_atom.cpp b/src/compute_orientorder_atom.cpp index db72fa3935..21baaf008a 100644 --- a/src/compute_orientorder_atom.cpp +++ b/src/compute_orientorder_atom.cpp @@ -332,8 +332,8 @@ void ComputeOrientOrderAtom::compute_peratom() double ComputeOrientOrderAtom::memory_usage() { double bytes = ncol*nmax * sizeof(double); - bytes += (qmax*(2*qmax+1)+maxneigh*4) * sizeof(double); - bytes += (nqlist+maxneigh) * sizeof(int); + bytes += (double)(qmax*(2*qmax+1)+maxneigh*4) * sizeof(double); + bytes += (double)(nqlist+maxneigh) * sizeof(int); return bytes; } diff --git a/src/compute_property_chunk.cpp b/src/compute_property_chunk.cpp index 7fe4e3a611..d1588b61a3 100644 --- a/src/compute_property_chunk.cpp +++ b/src/compute_property_chunk.cpp @@ -256,7 +256,7 @@ void ComputePropertyChunk::allocate() double ComputePropertyChunk::memory_usage() { double bytes = (bigint) nchunk * nvalues * sizeof(double); - if (countflag) bytes += (bigint) nchunk * 2 * sizeof(int); + if (countflag) bytes += (double) nchunk * 2 * sizeof(int); return bytes; } diff --git a/src/compute_property_local.cpp b/src/compute_property_local.cpp index ccc60a510d..365995f863 100644 --- a/src/compute_property_local.cpp +++ b/src/compute_property_local.cpp @@ -651,7 +651,7 @@ void ComputePropertyLocal::reallocate(int n) double ComputePropertyLocal::memory_usage() { double bytes = nmax*nvalues * sizeof(double); - bytes += nmax*2 * sizeof(int); + bytes += (double)nmax*2 * sizeof(int); return bytes; } diff --git a/src/compute_reduce_chunk.cpp b/src/compute_reduce_chunk.cpp index a93d38d721..606169c908 100644 --- a/src/compute_reduce_chunk.cpp +++ b/src/compute_reduce_chunk.cpp @@ -520,7 +520,7 @@ void ComputeReduceChunk::unlock(Fix *fixptr) double ComputeReduceChunk::memory_usage() { double bytes = (bigint) maxatom * sizeof(double); - if (nvalues == 1) bytes += (bigint) maxchunk * 2 * sizeof(double); - else bytes += (bigint) maxchunk * nvalues * 2 * sizeof(double); + if (nvalues == 1) bytes += (double) maxchunk * 2 * sizeof(double); + else bytes += (double) maxchunk * nvalues * 2 * sizeof(double); return bytes; } diff --git a/src/compute_temp_chunk.cpp b/src/compute_temp_chunk.cpp index 7ded525f01..765effa6c0 100644 --- a/src/compute_temp_chunk.cpp +++ b/src/compute_temp_chunk.cpp @@ -852,11 +852,11 @@ void ComputeTempChunk::allocate() double ComputeTempChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2 * sizeof(int); - bytes += (bigint) maxchunk * nvalues * sizeof(double); + bytes += (double) maxchunk * 2 * sizeof(int); + bytes += (double) maxchunk * nvalues * sizeof(double); if (comflag || nvalues) { - bytes += (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); } return bytes; } diff --git a/src/compute_temp_profile.cpp b/src/compute_temp_profile.cpp index 2d002be17a..6f705d077f 100644 --- a/src/compute_temp_profile.cpp +++ b/src/compute_temp_profile.cpp @@ -578,6 +578,6 @@ void ComputeTempProfile::bin_assign() double ComputeTempProfile::memory_usage() { double bytes = maxatom * sizeof(int); - bytes += nbins*ncount * sizeof(double); + bytes += (double)nbins*ncount * sizeof(double); return bytes; } diff --git a/src/compute_torque_chunk.cpp b/src/compute_torque_chunk.cpp index 672c8db094..d961c914e8 100644 --- a/src/compute_torque_chunk.cpp +++ b/src/compute_torque_chunk.cpp @@ -248,7 +248,7 @@ void ComputeTorqueChunk::allocate() double ComputeTorqueChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); return bytes; } diff --git a/src/compute_vcm_chunk.cpp b/src/compute_vcm_chunk.cpp index e8531584ed..182e8191cb 100644 --- a/src/compute_vcm_chunk.cpp +++ b/src/compute_vcm_chunk.cpp @@ -234,6 +234,6 @@ void ComputeVCMChunk::allocate() double ComputeVCMChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); return bytes; } diff --git a/src/dihedral.cpp b/src/dihedral.cpp index 4680b6f67d..2932bcbe2f 100644 --- a/src/dihedral.cpp +++ b/src/dihedral.cpp @@ -391,7 +391,7 @@ void Dihedral::ev_tally(int i1, int i2, int i3, int i4, double Dihedral::memory_usage() { double bytes = comm->nthreads*maxeatom * sizeof(double); - bytes += comm->nthreads*maxvatom*6 * sizeof(double); - bytes += comm->nthreads*maxcvatom*9 * sizeof(double); + bytes += (double)comm->nthreads*maxvatom*6 * sizeof(double); + bytes += (double)comm->nthreads*maxcvatom*9 * sizeof(double); return bytes; } diff --git a/src/dihedral_hybrid.cpp b/src/dihedral_hybrid.cpp index f7b8502ef4..dbad92868d 100644 --- a/src/dihedral_hybrid.cpp +++ b/src/dihedral_hybrid.cpp @@ -355,9 +355,9 @@ void DihedralHybrid::read_restart(FILE *fp) double DihedralHybrid::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += maxcvatom*9 * sizeof(double); - for (int m = 0; m < nstyles; m++) bytes += maxdihedral[m]*5 * sizeof(int); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)maxcvatom*9 * sizeof(double); + for (int m = 0; m < nstyles; m++) bytes += (double)maxdihedral[m]*5 * sizeof(int); for (int m = 0; m < nstyles; m++) if (styles[m]) bytes += styles[m]->memory_usage(); return bytes; diff --git a/src/dump.cpp b/src/dump.cpp index cd7366194b..ab2a84ab22 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -1182,11 +1182,11 @@ double Dump::memory_usage() if (sortcol == 0) bytes += memory->usage(idsort,maxsort); bytes += memory->usage(index,maxsort); bytes += memory->usage(proclist,maxproc); - if (irregular) bytes += irregular->memory_usage(); + if (irregular) bytes += (double)irregular->memory_usage(); } if (pbcflag) { - bytes += 6*maxpbc * sizeof(double); - bytes += maxpbc * sizeof(imageint); + bytes += (double)6*maxpbc * sizeof(double); + bytes += (double)maxpbc * sizeof(imageint); } return bytes; } diff --git a/src/fix_ave_chunk.cpp b/src/fix_ave_chunk.cpp index 21e56ee697..4fb93a5ea2 100644 --- a/src/fix_ave_chunk.cpp +++ b/src/fix_ave_chunk.cpp @@ -1147,9 +1147,9 @@ bigint FixAveChunk::nextvalid() double FixAveChunk::memory_usage() { double bytes = maxvar * sizeof(double); // varatom - bytes += 4*maxchunk * sizeof(double); // count one,many,sum,total - bytes += nvalues*maxchunk * sizeof(double); // values one,many,sum,total - bytes += nwindow*maxchunk * sizeof(double); // count_list - bytes += nwindow*maxchunk*nvalues * sizeof(double); // values_list + bytes += (double)4*maxchunk * sizeof(double); // count one,many,sum,total + bytes += (double)nvalues*maxchunk * sizeof(double); // values one,many,sum,total + bytes += (double)nwindow*maxchunk * sizeof(double); // count_list + bytes += (double)nwindow*maxchunk*nvalues * sizeof(double); // values_list return bytes; } diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index 8bc2aa3976..51a40ef9d2 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -1114,9 +1114,9 @@ void *FixLangevin::extract(const char *str, int &dim) double FixLangevin::memory_usage() { double bytes = 0.0; - if (gjfflag) bytes += atom->nmax*6 * sizeof(double); - if (tallyflag || osflag) bytes += atom->nmax*3 * sizeof(double); - if (tforce) bytes += atom->nmax * sizeof(double); + if (gjfflag) bytes += (double)atom->nmax*6 * sizeof(double); + if (tallyflag || osflag) bytes += (double)atom->nmax*3 * sizeof(double); + if (tforce) bytes += (double)atom->nmax * sizeof(double); return bytes; } diff --git a/src/fix_minimize.cpp b/src/fix_minimize.cpp index 7e618be566..8aefe5ef5d 100644 --- a/src/fix_minimize.cpp +++ b/src/fix_minimize.cpp @@ -166,7 +166,7 @@ double FixMinimize::memory_usage() { double bytes = 0.0; for (int m = 0; m < nvector; m++) - bytes += atom->nmax*peratom[m]*sizeof(double); + bytes += (double)atom->nmax*peratom[m]*sizeof(double); return bytes; } diff --git a/src/fix_move.cpp b/src/fix_move.cpp index e3813d0a91..abea871935 100644 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -965,10 +965,10 @@ void FixMove::final_integrate_respa(int ilevel, int /*iloop*/) double FixMove::memory_usage() { double bytes = atom->nmax*3 * sizeof(double); - if (theta_flag) bytes += atom->nmax * sizeof(double); - if (quat_flag) bytes += atom->nmax*4 * sizeof(double); - if (displaceflag) bytes += atom->nmax*3 * sizeof(double); - if (velocityflag) bytes += atom->nmax*3 * sizeof(double); + if (theta_flag) bytes += (double)atom->nmax * sizeof(double); + if (quat_flag) bytes += (double)atom->nmax*4 * sizeof(double); + if (displaceflag) bytes += (double)atom->nmax*3 * sizeof(double); + if (velocityflag) bytes += (double)atom->nmax*3 * sizeof(double); return bytes; } diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp index 83ef0666c2..2098382161 100644 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -673,10 +673,10 @@ double FixNeighHistory::memory_usage() { int nmax = atom->nmax; double bytes = nmax * sizeof(int); // npartner - bytes += nmax * sizeof(tagint *); // partner - bytes += nmax * sizeof(double *); // valuepartner - bytes += maxatom * sizeof(int *); // firstflag - bytes += maxatom * sizeof(double *); // firstvalue + bytes += (double)nmax * sizeof(tagint *); // partner + bytes += (double)nmax * sizeof(double *); // valuepartner + bytes += (double)maxatom * sizeof(int *); // firstflag + bytes += (double)maxatom * sizeof(double *); // firstvalue int nmypage = comm->nthreads; for (int i = 0; i < nmypage; i++) { diff --git a/src/fix_numdiff.cpp b/src/fix_numdiff.cpp index d2f70712ac..4be6d07d3d 100644 --- a/src/fix_numdiff.cpp +++ b/src/fix_numdiff.cpp @@ -339,6 +339,6 @@ void FixNumDiff::reallocate() double FixNumDiff::memory_usage() { double bytes = 0.0; - bytes += 3 * maxatom*3 * sizeof(double); + bytes += (double)3 * maxatom*3 * sizeof(double); return bytes; } diff --git a/src/fix_read_restart.cpp b/src/fix_read_restart.cpp index 04229d601f..7ff816ea37 100644 --- a/src/fix_read_restart.cpp +++ b/src/fix_read_restart.cpp @@ -77,7 +77,7 @@ int FixReadRestart::setmask() double FixReadRestart::memory_usage() { double bytes = atom->nmax*nextra * sizeof(double); - bytes += atom->nmax * sizeof(int); + bytes += (double)atom->nmax * sizeof(int); return bytes; } diff --git a/src/fix_respa.cpp b/src/fix_respa.cpp index 81f4acd100..f2dc7d69d3 100644 --- a/src/fix_respa.cpp +++ b/src/fix_respa.cpp @@ -75,7 +75,7 @@ int FixRespa::setmask() double FixRespa::memory_usage() { double bytes = atom->nmax*nlevels*3 * sizeof(double); - if (store_torque) bytes += atom->nmax*nlevels*3 * sizeof(double); + if (store_torque) bytes += (double)atom->nmax*nlevels*3 * sizeof(double); return bytes; } diff --git a/src/fix_store.cpp b/src/fix_store.cpp index 1fa2c637b7..9df9fcd3bd 100644 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -340,7 +340,7 @@ int FixStore::size_restart(int /*nlocal*/) double FixStore::memory_usage() { double bytes = 0.0; - if (flavor == GLOBAL) bytes += nrow*ncol * sizeof(double); - if (flavor == PERATOM) bytes += atom->nmax*nvalues * sizeof(double); + if (flavor == GLOBAL) bytes += (double)nrow*ncol * sizeof(double); + if (flavor == PERATOM) bytes += (double)atom->nmax*nvalues * sizeof(double); return bytes; } diff --git a/src/improper.cpp b/src/improper.cpp index 6e0f829733..8e24c98116 100644 --- a/src/improper.cpp +++ b/src/improper.cpp @@ -389,6 +389,6 @@ void Improper::ev_tally(int i1, int i2, int i3, int i4, double Improper::memory_usage() { double bytes = comm->nthreads*maxeatom * sizeof(double); - bytes += comm->nthreads*maxvatom*6 * sizeof(double); + bytes += (double)comm->nthreads*maxvatom*6 * sizeof(double); return bytes; } diff --git a/src/improper_hybrid.cpp b/src/improper_hybrid.cpp index 9dec9ae363..66ec692d4b 100644 --- a/src/improper_hybrid.cpp +++ b/src/improper_hybrid.cpp @@ -351,9 +351,9 @@ void ImproperHybrid::read_restart(FILE *fp) double ImproperHybrid::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += maxcvatom*9 * sizeof(double); - for (int m = 0; m < nstyles; m++) bytes += maximproper[m]*5 * sizeof(int); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)maxcvatom*9 * sizeof(double); + for (int m = 0; m < nstyles; m++) bytes += (double)maximproper[m]*5 * sizeof(int); for (int m = 0; m < nstyles; m++) if (styles[m]) bytes += styles[m]->memory_usage(); return bytes; diff --git a/src/irregular.cpp b/src/irregular.cpp index 548b0e4097..330a96f514 100644 --- a/src/irregular.cpp +++ b/src/irregular.cpp @@ -1054,11 +1054,11 @@ void Irregular::grow_recv(int n) double Irregular::memory_usage() { double bytes = 0; - bytes += maxsend*sizeof(double); // buf_send - bytes += maxrecv*sizeof(double); // buf_recv - bytes += maxdbuf*sizeof(double); // dbuf - bytes += maxbuf; // buf - bytes += 2*maxlocal*sizeof(int); // mproclist,msizes - bytes += 2*nprocs*sizeof(int); // work1,work2 + bytes += (double)maxsend*sizeof(double); // buf_send + bytes += (double)maxrecv*sizeof(double); // buf_recv + bytes += (double)maxdbuf*sizeof(double); // dbuf + bytes += (double)maxbuf; // buf + bytes += (double)2*maxlocal*sizeof(int); // mproclist,msizes + bytes += (double)2*nprocs*sizeof(int); // work1,work2 return bytes; } diff --git a/src/my_pool_chunk.cpp b/src/my_pool_chunk.cpp index 4d0713991c..c58bb5c209 100644 --- a/src/my_pool_chunk.cpp +++ b/src/my_pool_chunk.cpp @@ -212,10 +212,10 @@ void MyPoolChunk::allocate(int ibin) { template double MyPoolChunk::size() const { double bytes = npage*chunkperpage*sizeof(int); - bytes += npage*sizeof(T *); - bytes += npage*sizeof(int); + bytes += (double)npage*sizeof(T *); + bytes += (double)npage*sizeof(int); for (int i=0; i < npage; ++i) - bytes += chunkperpage*chunksize[i]*sizeof(T); + bytes += (double)chunkperpage*chunksize[i]*sizeof(T); return bytes; } diff --git a/src/nbin.cpp b/src/nbin.cpp index 8f9b1c9f1c..e2024b81f8 100644 --- a/src/nbin.cpp +++ b/src/nbin.cpp @@ -156,7 +156,7 @@ int NBin::coord2bin(double *x) double NBin::memory_usage() { double bytes = 0; - bytes += maxbin*sizeof(int); - bytes += 2*maxatom*sizeof(int); + bytes += (double)maxbin*sizeof(int); + bytes += (double)2*maxatom*sizeof(int); return bytes; } diff --git a/src/neigh_list.cpp b/src/neigh_list.cpp index cc1ecdd0bd..308ecbbf6e 100644 --- a/src/neigh_list.cpp +++ b/src/neigh_list.cpp @@ -299,7 +299,7 @@ double NeighList::memory_usage() double bytes = 0; bytes += memory->usage(ilist,maxatom); bytes += memory->usage(numneigh,maxatom); - bytes += maxatom * sizeof(int *); + bytes += (double)maxatom * sizeof(int *); int nmypage = comm->nthreads; @@ -311,7 +311,7 @@ double NeighList::memory_usage() if (respainner) { bytes += memory->usage(ilist_inner,maxatom); bytes += memory->usage(numneigh_inner,maxatom); - bytes += maxatom * sizeof(int *); + bytes += (double)maxatom * sizeof(int *); if (ipage_inner) { for (int i = 0; i < nmypage; i++) bytes += ipage_inner[i].size(); @@ -321,7 +321,7 @@ double NeighList::memory_usage() if (respamiddle) { bytes += memory->usage(ilist_middle,maxatom); bytes += memory->usage(numneigh_middle,maxatom); - bytes += maxatom * sizeof(int *); + bytes += (double)maxatom * sizeof(int *); if (ipage_middle) { for (int i = 0; i < nmypage; i++) bytes += ipage_middle[i].size(); diff --git a/src/nstencil.cpp b/src/nstencil.cpp index bcfc0d4d9b..90de8dcf3c 100644 --- a/src/nstencil.cpp +++ b/src/nstencil.cpp @@ -229,8 +229,8 @@ double NStencil::memory_usage() bytes += memory->usage(stencil,maxstencil); bytes += memory->usage(stencilxyz,maxstencil,3); } else if (neighstyle == Neighbor::MULTI) { - bytes += atom->ntypes*maxstencil_multi * sizeof(int); - bytes += atom->ntypes*maxstencil_multi * sizeof(double); + bytes += (double)atom->ntypes*maxstencil_multi * sizeof(int); + bytes += (double)atom->ntypes*maxstencil_multi * sizeof(double); } return bytes; } diff --git a/src/ntopo.cpp b/src/ntopo.cpp index a4f8db7517..78b7cca1b0 100644 --- a/src/ntopo.cpp +++ b/src/ntopo.cpp @@ -209,10 +209,10 @@ void NTopo::dihedral_check(int nlist, int **list) double NTopo::memory_usage() { double bytes = 0; - bytes += 3*maxbond * sizeof(int); - bytes += 4*maxangle * sizeof(int); - bytes += 5*maxdihedral * sizeof(int); - bytes += 5*maximproper * sizeof(int); + bytes += (double)3*maxbond * sizeof(int); + bytes += (double)4*maxangle * sizeof(int); + bytes += (double)5*maxdihedral * sizeof(int); + bytes += (double)5*maximproper * sizeof(int); return bytes; } diff --git a/src/pair.cpp b/src/pair.cpp index afc5eb2785..d9e7304ba3 100644 --- a/src/pair.cpp +++ b/src/pair.cpp @@ -1837,8 +1837,8 @@ void Pair::hessian_twobody(double fforce, double dfac, double delr[3], double ph double Pair::memory_usage() { double bytes = comm->nthreads*maxeatom * sizeof(double); - bytes += comm->nthreads*maxvatom*6 * sizeof(double); - bytes += comm->nthreads*maxcvatom*9 * sizeof(double); + bytes += (double)comm->nthreads*maxvatom*6 * sizeof(double); + bytes += (double)comm->nthreads*maxcvatom*9 * sizeof(double); return bytes; } diff --git a/src/pair_coul_streitz.cpp b/src/pair_coul_streitz.cpp index de2f180d44..941bc8c83d 100644 --- a/src/pair_coul_streitz.cpp +++ b/src/pair_coul_streitz.cpp @@ -737,9 +737,9 @@ void PairCoulStreitz::ewald_sum(double qi, double qj, double zj, double r, double PairCoulStreitz::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += nmax * sizeof(int); - bytes += MAXNEIGH * nmax * sizeof(int); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)nmax * sizeof(int); + bytes += (double)MAXNEIGH * nmax * sizeof(int); return bytes; } diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index 3026c9c741..fc8f24defd 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -1079,8 +1079,8 @@ int PairHybrid::check_ijtype(int itype, int jtype, char *substyle) double PairHybrid::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += maxcvatom*9 * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)maxcvatom*9 * sizeof(double); for (int m = 0; m < nstyles; m++) bytes += styles[m]->memory_usage(); return bytes; } From 4eb143bfee4141cd66ed16b68703c5d3edb5116f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 2 Feb 2021 17:27:29 -0500 Subject: [PATCH 115/384] fix another border communication issue in KOKKOS version of atom style dpd --- src/KOKKOS/atom_vec_dpd_kokkos.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KOKKOS/atom_vec_dpd_kokkos.cpp b/src/KOKKOS/atom_vec_dpd_kokkos.cpp index ad47b6f108..923f734d6e 100644 --- a/src/KOKKOS/atom_vec_dpd_kokkos.cpp +++ b/src/KOKKOS/atom_vec_dpd_kokkos.cpp @@ -1101,7 +1101,7 @@ struct AtomVecDPDKokkos_UnpackBorder { _uCond(uCond), _uMech(uMech), _uChem(uChem), - _uCG(uCGnew), + _uCG(uCG), _uCGnew(uCGnew), _first(first) {}; From f745d5d7be75cb316dde1c75daded20c7fe14578 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 3 Feb 2021 10:52:16 -0500 Subject: [PATCH 116/384] continue adding ArgInfo support --- src/fix_halt.cpp | 17 ++++++--- src/fix_store_state.cpp | 77 +++++++++++++++-------------------------- src/fix_vector.cpp | 53 +++++++++++----------------- 3 files changed, 61 insertions(+), 86 deletions(-) diff --git a/src/fix_halt.cpp b/src/fix_halt.cpp index 76941dc176..a27c830be1 100644 --- a/src/fix_halt.cpp +++ b/src/fix_halt.cpp @@ -13,6 +13,7 @@ #include "fix_halt.h" +#include "arg_info.h" #include "atom.h" #include "comm.h" #include "error.h" @@ -56,16 +57,22 @@ FixHalt::FixHalt(LAMMPS *lmp, int narg, char **arg) : strcpy(dlimit_path,"."); } else if (strcmp(arg[iarg],"bondmax") == 0) { attribute = BONDMAX; - } else if (strncmp(arg[iarg],"v_",2) == 0) { + } else { + ArgInfo argi(arg[iarg],ArgInfo::VARIABLE); + + if ((argi.get_type() == ArgInfo::UNKNOWN) + || (argi.get_type() == ArgInfo::NONE) + || (argi.get_dim() != 0)) + error->all(FLERR,"Invalid fix halt attribute"); + attribute = VARIABLE; - int n = strlen(arg[iarg]); - idvar = new char[n]; - strcpy(idvar,&arg[iarg][2]); + idvar = argi.copy_name(); ivar = input->variable->find(idvar); + if (ivar < 0) error->all(FLERR,"Could not find fix halt variable name"); if (input->variable->equalstyle(ivar) == 0) error->all(FLERR,"Fix halt variable is not equal-style variable"); - } else error->all(FLERR,"Invalid fix halt attribute"); + } ++iarg; if (strcmp(arg[iarg],"<") == 0) operation = LT; diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp index 216e56eefe..639012a735 100644 --- a/src/fix_store_state.cpp +++ b/src/fix_store_state.cpp @@ -13,6 +13,7 @@ #include "fix_store_state.h" +#include "arg_info.h" #include "atom.h" #include "compute.h" #include "domain.h" @@ -30,9 +31,6 @@ using namespace LAMMPS_NS; using namespace FixConst; -enum{KEYWORD,COMPUTE,FIX,VARIABLE,DNAME,INAME}; - - /* ---------------------------------------------------------------------- */ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) : @@ -62,7 +60,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) : int iarg = 4; while (iarg < narg) { - which[nvalues] = KEYWORD; + which[nvalues] = ArgInfo::KEYWORD; ids[nvalues] = nullptr; if (strcmp(arg[iarg],"id") == 0) { @@ -222,38 +220,19 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) : "Fix store/state for atom property that isn't allocated"); pack_choice[nvalues++] = &FixStoreState::pack_tqz; - } else if (strncmp(arg[iarg],"c_",2) == 0 || - strncmp(arg[iarg],"d_",2) == 0 || - strncmp(arg[iarg],"f_",2) == 0 || - strncmp(arg[iarg],"i_",2) == 0 || - strncmp(arg[iarg],"v_",2) == 0) { - cfv_any = 1; - if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE; - else if (arg[iarg][0] == 'd') which[nvalues] = DNAME; - else if (arg[iarg][0] == 'f') which[nvalues] = FIX; - else if (arg[iarg][0] == 'i') which[nvalues] = INAME; - else if (arg[iarg][0] == 'v') which[nvalues] = VARIABLE; + } else { + ArgInfo argi(arg[iarg],ArgInfo::COMPUTE|ArgInfo::FIX|ArgInfo::VARIABLE + |ArgInfo::DNAME|ArgInfo::INAME); - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + if (argi.get_type() == ArgInfo::NONE) break; + if ((argi.get_type() == ArgInfo::UNKNOWN) || (argi.get_dim() > 1)) + error->all(FLERR,"Illegal fix store/state command"); - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Illegal fix store/state command"); - argindex[nvalues] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[nvalues] = 0; - - n = strlen(suffix) + 1; - ids[nvalues] = new char[n]; - strcpy(ids[nvalues],suffix); + which[nvalues] = argi.get_type(); + argindex[nvalues] = argi.get_index1(); + ids[nvalues] = argi.copy_name(); nvalues++; - delete [] suffix; - - } else break; - + } iarg++; } @@ -274,7 +253,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) : // error check for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for fix store/state does not exist"); @@ -294,21 +273,21 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Fix store/state compute array is accessed out-of-range"); - } else if (which[i] == INAME) { + } else if (which[i] == ArgInfo::INAME) { int icustom,iflag; icustom = atom->find_custom(ids[i],iflag); if ((icustom < 0) || (iflag != 0)) error->all(FLERR, "Custom integer vector for fix store/state does not exist"); - } else if (which[i] == DNAME) { + } else if (which[i] == ArgInfo::DNAME) { int icustom,iflag; icustom = atom->find_custom(ids[i],iflag); if ((icustom < 0) || (iflag != 1)) error->all(FLERR, "Custom floating point vector for fix store/state does not exist"); - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR, @@ -329,7 +308,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Fix for fix store/state not computed at compatible time"); - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix store/state does not exist"); @@ -406,13 +385,13 @@ void FixStoreState::init() if (!firstflag && nevery == 0) return; for (int m = 0; m < nvalues; m++) { - if (which[m] == COMPUTE) { + if (which[m] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[m]); if (icompute < 0) error->all(FLERR,"Compute ID for fix store/state does not exist"); value2index[m] = icompute; - } else if (which[m] == INAME) { + } else if (which[m] == ArgInfo::INAME) { int icustom,iflag; icustom = atom->find_custom(ids[m],iflag); if ((icustom < 0) || (iflag != 0)) @@ -420,7 +399,7 @@ void FixStoreState::init() "Custom integer vector for fix store/state does not exist"); value2index[m] = icustom; - } else if (which[m] == DNAME) { + } else if (which[m] == ArgInfo::DNAME) { int icustom,iflag; icustom = atom->find_custom(ids[m],iflag); if ((icustom < 0) || (iflag != 1)) @@ -428,13 +407,13 @@ void FixStoreState::init() "Custom floating point vector for fix store/state does not exist"); value2index[m] = icustom; - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[m]); if (ifix < 0) error->all(FLERR,"Fix ID for fix store/state does not exist"); value2index[m] = ifix; - } else if (which[m] == VARIABLE) { + } else if (which[m] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[m]); if (ivariable < 0) error->all(FLERR,"Variable name for fix store/state does not exist"); @@ -481,7 +460,7 @@ void FixStoreState::end_of_step() else vbuf = nullptr; for (int m = 0; m < nvalues; m++) { - if (which[m] == KEYWORD && kflag) (this->*pack_choice[m])(m); + if (which[m] == ArgInfo::KEYWORD && kflag) (this->*pack_choice[m])(m); else if (cfv_flag) { n = value2index[m]; @@ -492,7 +471,7 @@ void FixStoreState::end_of_step() // invoke compute if not previously invoked - if (which[m] == COMPUTE) { + if (which[m] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[n]; if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) { compute->compute_peratom(); @@ -512,7 +491,7 @@ void FixStoreState::end_of_step() // access fix fields, guaranteed to be ready - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { if (j == 0) { double *fix_vector = modify->fix[n]->vector_atom; for (i = 0; i < nlocal; i++) @@ -526,19 +505,19 @@ void FixStoreState::end_of_step() // access custom atom property fields - } else if (which[m] == INAME) { + } else if (which[m] == ArgInfo::INAME) { int *ivector = atom->ivector[n]; for (i = 0; i < nlocal; i++) if (mask[i] & groupbit) values[i][m] = ivector[i]; - } else if (which[m] == DNAME) { + } else if (which[m] == ArgInfo::DNAME) { double *dvector = atom->dvector[n]; for (i = 0; i < nlocal; i++) if (mask[i] & groupbit) values[i][m] = dvector[i]; // evaluate atom-style variable - } else if (which[m] == VARIABLE) { + } else if (which[m] == ArgInfo::VARIABLE) { input->variable->compute_atom(n,igroup,&values[0][m],nvalues,0); } } diff --git a/src/fix_vector.cpp b/src/fix_vector.cpp index dcedd4c3be..afd3778841 100644 --- a/src/fix_vector.cpp +++ b/src/fix_vector.cpp @@ -13,6 +13,7 @@ #include "fix_vector.h" +#include "arg_info.h" #include "compute.h" #include "error.h" #include "input.h" @@ -26,7 +27,6 @@ using namespace LAMMPS_NS; using namespace FixConst; -enum{COMPUTE,FIX,VARIABLE}; enum{ONE,RUNNING,WINDOW}; enum{SCALAR,VECTOR}; @@ -50,27 +50,16 @@ FixVector::FixVector(LAMMPS *lmp, int narg, char **arg) : nvalues = 0; for (int iarg = 4; iarg < narg; iarg++) { - if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE; - else if (arg[iarg][0] == 'f') which[nvalues] = FIX; - else if (arg[iarg][0] == 'v') which[nvalues] = VARIABLE; - else error->all(FLERR,"Illegal fix vector command"); + ArgInfo argi(arg[iarg]); - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + which[nvalues] = argi.get_type(); + argindex[nvalues] = argi.get_index1(); + ids[nvalues] = argi.copy_name(); - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Illegal fix vector command"); - argindex[nvalues] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[nvalues] = 0; - - n = strlen(suffix) + 1; - ids[nvalues] = new char[n]; - strcpy(ids[nvalues],suffix); - delete [] suffix; + if ((argi.get_type() == ArgInfo::UNKNOWN) + || (argi.get_type() == ArgInfo::NONE) + || (argi.get_dim() > 1)) + error->all(FLERR,"Illegal fix vector command"); nvalues++; } @@ -79,7 +68,7 @@ FixVector::FixVector(LAMMPS *lmp, int narg, char **arg) : // for fix inputs, check that fix frequency is acceptable for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for fix vector does not exist"); @@ -91,7 +80,7 @@ FixVector::FixVector(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Fix vector compute vector is accessed out-of-range"); - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for fix vector does not exist"); @@ -105,7 +94,7 @@ FixVector::FixVector(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Fix for fix vector not computed at compatible time"); - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix vector does not exist"); @@ -121,16 +110,16 @@ FixVector::FixVector(LAMMPS *lmp, int narg, char **arg) : int value,finalvalue; for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[modify->find_compute(ids[i])]; if (argindex[0] == 0) value = compute->extscalar; else if (compute->extvector >= 0) value = compute->extvector; else value = compute->extlist[argindex[0]-1]; - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { Fix *fix = modify->fix[modify->find_fix(ids[i])]; if (argindex[i] == 0) value = fix->extvector; else value = fix->extarray; - } else if (which[i] == VARIABLE) value = 0; + } else if (which[i] == ArgInfo::VARIABLE) value = 0; if (i == 0) finalvalue = value; else if (value != finalvalue) error->all(FLERR,"Fix vector cannot set output array " @@ -201,19 +190,19 @@ void FixVector::init() // set current indices for all computes,fixes,variables for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for fix vector does not exist"); value2index[i] = icompute; - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for fix vector does not exist"); value2index[i] = ifix; - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix vector does not exist"); @@ -265,7 +254,7 @@ void FixVector::end_of_step() // invoke compute if not previously invoked - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[m]; if (argindex[i] == 0) { @@ -284,7 +273,7 @@ void FixVector::end_of_step() // access fix fields, guaranteed to be ready - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { if (argindex[i] == 0) result[i] = modify->fix[m]->compute_scalar(); else @@ -292,7 +281,7 @@ void FixVector::end_of_step() // evaluate equal-style or vector-style variable - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { if (argindex[i] == 0) result[i] = input->variable->compute_equal(m); else { From 2f7d6672df040056b9727748ec89a5a8115a9a8d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 3 Feb 2021 16:19:05 -0500 Subject: [PATCH 117/384] more files with ArgInfo support added --- src/dump_custom.cpp | 7 +-- src/fix_ave_chunk.cpp | 119 +++++++++++++++++--------------------- src/fix_ave_correlate.cpp | 56 +++++++----------- src/fix_ave_histo.cpp | 100 ++++++++++++++------------------ src/fix_ave_time.cpp | 97 ++++++++++++++----------------- src/fix_controller.cpp | 58 ++++++------------- 6 files changed, 182 insertions(+), 255 deletions(-) diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 09522c2f13..0f2e62408d 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -1748,14 +1748,13 @@ int DumpCustom::modify_param(int narg, char **arg) if (strcmp(arg[0],"refresh") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); - if (strncmp(arg[1],"c_",2) != 0) + ArgInfo argi(arg[1],ArgInfo::COMPUTE); + if ((argi.get_type() != ArgInfo::COMPUTE) || (argi.get_dim() != 0)) error->all(FLERR,"Illegal dump_modify command"); if (refreshflag) error->all(FLERR,"Dump modify can only have one refresh"); refreshflag = 1; - int n = strlen(arg[1]); - refresh = new char[n]; - strcpy(refresh,&arg[1][2]); + refresh = argi.copy_name(); return 2; } diff --git a/src/fix_ave_chunk.cpp b/src/fix_ave_chunk.cpp index 21e56ee697..36fcb4af4f 100644 --- a/src/fix_ave_chunk.cpp +++ b/src/fix_ave_chunk.cpp @@ -13,27 +13,25 @@ #include "fix_ave_chunk.h" +#include "arg_info.h" +#include "atom.h" +#include "compute.h" +#include "compute_chunk_atom.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "update.h" +#include "variable.h" #include #include -#include "atom.h" -#include "update.h" -#include "force.h" -#include "domain.h" -#include "modify.h" -#include "compute.h" -#include "compute_chunk_atom.h" -#include "input.h" -#include "variable.h" -#include "memory.h" -#include "error.h" - - using namespace LAMMPS_NS; using namespace FixConst; -enum{V,F,DENSITY_NUMBER,DENSITY_MASS,MASS,TEMPERATURE,COMPUTE,FIX,VARIABLE}; enum{SCALAR,VECTOR}; enum{SAMPLE,ALL}; enum{NOSCALE,ATOM}; @@ -90,67 +88,53 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : ids[nvalues] = nullptr; if (strcmp(arg[iarg],"vx") == 0) { - which[nvalues] = V; + which[nvalues] = ArgInfo::V; argindex[nvalues++] = 0; } else if (strcmp(arg[iarg],"vy") == 0) { - which[nvalues] = V; + which[nvalues] = ArgInfo::V; argindex[nvalues++] = 1; } else if (strcmp(arg[iarg],"vz") == 0) { - which[nvalues] = V; + which[nvalues] = ArgInfo::V; argindex[nvalues++] = 2; } else if (strcmp(arg[iarg],"fx") == 0) { - which[nvalues] = F; + which[nvalues] = ArgInfo::F; argindex[nvalues++] = 0; } else if (strcmp(arg[iarg],"fy") == 0) { - which[nvalues] = F; + which[nvalues] = ArgInfo::F; argindex[nvalues++] = 1; } else if (strcmp(arg[iarg],"fz") == 0) { - which[nvalues] = F; + which[nvalues] = ArgInfo::F; argindex[nvalues++] = 2; } else if (strcmp(arg[iarg],"density/number") == 0) { densityflag = 1; - which[nvalues] = DENSITY_NUMBER; + which[nvalues] = ArgInfo::DENSITY_NUMBER; argindex[nvalues++] = 0; } else if (strcmp(arg[iarg],"density/mass") == 0) { densityflag = 1; - which[nvalues] = DENSITY_MASS; + which[nvalues] = ArgInfo::DENSITY_MASS; argindex[nvalues++] = 0; } else if (strcmp(arg[iarg],"mass") == 0) { - which[nvalues] = MASS; + which[nvalues] = ArgInfo::MASS; argindex[nvalues++] = 0; } else if (strcmp(arg[iarg],"temp") == 0) { - which[nvalues] = TEMPERATURE; + which[nvalues] = ArgInfo::TEMPERATURE; argindex[nvalues++] = 0; - } else if (strncmp(arg[iarg],"c_",2) == 0 || - strncmp(arg[iarg],"f_",2) == 0 || - strncmp(arg[iarg],"v_",2) == 0) { - if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE; - else if (arg[iarg][0] == 'f') which[nvalues] = FIX; - else if (arg[iarg][0] == 'v') which[nvalues] = VARIABLE; + } else { + ArgInfo argi(arg[iarg]); - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + if (argi.get_type() == ArgInfo::NONE) break; + if ((argi.get_type() == ArgInfo::UNKNOWN) || (argi.get_dim() > 1)) + error->all(FLERR,"Invalid fix ave/chunk command"); - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Illegal fix ave/chunk command"); - argindex[nvalues] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[nvalues] = 0; + which[nvalues] = argi.get_type(); + argindex[nvalues] = argi.get_index1(); + ids[nvalues] = argi.copy_name(); - n = strlen(suffix) + 1; - ids[nvalues] = new char[n]; - strcpy(ids[nvalues],suffix); nvalues++; - delete [] suffix; - - } else break; - + } iarg++; } @@ -285,7 +269,7 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : } for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/chunk does not exist"); @@ -304,7 +288,7 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Fix ave/chunk compute vector is accessed out-of-range"); - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for fix ave/chunk does not exist"); @@ -319,7 +303,7 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : "Fix ave/chunk fix does not calculate a per-atom array"); if (argindex[i] && argindex[i] > modify->fix[ifix]->size_peratom_cols) error->all(FLERR,"Fix ave/chunk fix vector is accessed out-of-range"); - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix ave/chunk does not exist"); @@ -514,13 +498,13 @@ void FixAveChunk::init() } for (int m = 0; m < nvalues; m++) { - if (which[m] == COMPUTE) { + if (which[m] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[m]); if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/chunk does not exist"); value2index[m] = icompute; - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[m]); if (ifix < 0) error->all(FLERR,"Fix ID for fix ave/chunk does not exist"); @@ -530,7 +514,7 @@ void FixAveChunk::init() error->all(FLERR, "Fix for fix ave/chunk not computed at compatible time"); - } else if (which[m] == VARIABLE) { + } else if (which[m] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[m]); if (ivariable < 0) error->all(FLERR,"Variable name for fix ave/chunk does not exist"); @@ -656,9 +640,9 @@ void FixAveChunk::end_of_step() // V,F adds velocities,forces to values - if (which[m] == V || which[m] == F) { + if (which[m] == ArgInfo::V || which[m] == ArgInfo::F) { double **attribute; - if (which[m] == V) attribute = atom->v; + if (which[m] == ArgInfo::V) attribute = atom->v; else attribute = atom->f; for (i = 0; i < nlocal; i++) @@ -669,7 +653,7 @@ void FixAveChunk::end_of_step() // DENSITY_NUMBER adds 1 to values - } else if (which[m] == DENSITY_NUMBER) { + } else if (which[m] == ArgInfo::DENSITY_NUMBER) { for (i = 0; i < nlocal; i++) if (mask[i] & groupbit && ichunk[i] > 0) { @@ -679,7 +663,8 @@ void FixAveChunk::end_of_step() // DENSITY_MASS or MASS adds mass to values - } else if (which[m] == DENSITY_MASS || which[m] == MASS) { + } else if ((which[m] == ArgInfo::DENSITY_MASS) + || (which[m] == ArgInfo::MASS)) { int *type = atom->type; double *mass = atom->mass; double *rmass = atom->rmass; @@ -701,7 +686,7 @@ void FixAveChunk::end_of_step() // TEMPERATURE adds KE to values // subtract and restore velocity bias if requested - } else if (which[m] == TEMPERATURE) { + } else if (which[m] == ArgInfo::TEMPERATURE) { if (biasflag) { if (tbias->invoked_scalar != ntimestep) tbias->compute_scalar(); @@ -735,7 +720,7 @@ void FixAveChunk::end_of_step() // COMPUTE adds its scalar or vector component to values // invoke compute if not previously invoked - } else if (which[m] == COMPUTE) { + } else if (which[m] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[n]; if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) { compute->compute_peratom(); @@ -755,7 +740,7 @@ void FixAveChunk::end_of_step() // FIX adds its scalar or vector component to values // access fix fields, guaranteed to be ready - } else if (which[m] == FIX) { + } else if (which[m] == ArgInfo::FIX) { double *vector = modify->fix[n]->vector_atom; double **array = modify->fix[n]->array_atom; int jm1 = j - 1; @@ -770,7 +755,7 @@ void FixAveChunk::end_of_step() // VARIABLE adds its per-atom quantities to values // evaluate atom-style variable - } else if (which[m] == VARIABLE) { + } else if (which[m] == ArgInfo::VARIABLE) { if (atom->nmax > maxvar) { maxvar = atom->nmax; memory->destroy(varatom); @@ -824,14 +809,14 @@ void FixAveChunk::end_of_step() for (m = 0; m < nchunk; m++) { if (count_many[m] > 0.0) for (j = 0; j < nvalues; j++) { - if (which[j] == TEMPERATURE) { + if (which[j] == ArgInfo::TEMPERATURE) { values_many[m][j] += mvv2e*values_one[m][j] / ((cdof + adof*count_many[m]) * boltz); - } else if (which[j] == DENSITY_NUMBER) { + } else if (which[j] == ArgInfo::DENSITY_NUMBER) { if (volflag == SCALAR) values_one[m][j] /= chunk_volume_scalar; else values_one[m][j] /= chunk_volume_vec[m]; values_many[m][j] += values_one[m][j]; - } else if (which[j] == DENSITY_MASS) { + } else if (which[j] == ArgInfo::DENSITY_MASS) { if (volflag == SCALAR) values_one[m][j] /= chunk_volume_scalar; else values_one[m][j] /= chunk_volume_vec[m]; values_many[m][j] += mv2d*values_one[m][j]; @@ -894,13 +879,13 @@ void FixAveChunk::end_of_step() for (m = 0; m < nchunk; m++) { if (count_sum[m] > 0.0) for (j = 0; j < nvalues; j++) { - if (which[j] == TEMPERATURE) { + if (which[j] == ArgInfo::TEMPERATURE) { values_sum[m][j] *= mvv2e / ((cdof + adof*count_sum[m]) * boltz); - } else if (which[j] == DENSITY_NUMBER) { + } else if (which[j] == ArgInfo::DENSITY_NUMBER) { if (volflag == SCALAR) values_sum[m][j] /= chunk_volume_scalar; else values_sum[m][j] /= chunk_volume_vec[m]; values_sum[m][j] /= repeat; - } else if (which[j] == DENSITY_MASS) { + } else if (which[j] == ArgInfo::DENSITY_MASS) { if (volflag == SCALAR) values_sum[m][j] /= chunk_volume_scalar; else values_sum[m][j] /= chunk_volume_vec[m]; values_sum[m][j] *= mv2d/repeat; diff --git a/src/fix_ave_correlate.cpp b/src/fix_ave_correlate.cpp index 1cda758e5f..de0cc0da6f 100644 --- a/src/fix_ave_correlate.cpp +++ b/src/fix_ave_correlate.cpp @@ -19,6 +19,7 @@ #include "fix_ave_correlate.h" +#include "arg_info.h" #include "compute.h" #include "error.h" #include "input.h" @@ -33,11 +34,9 @@ using namespace LAMMPS_NS; using namespace FixConst; -enum{COMPUTE,FIX,VARIABLE}; enum{ONE,RUNNING}; enum{AUTO,UPPER,LOWER,AUTOUPPER,AUTOLOWER,FULL}; - /* ---------------------------------------------------------------------- */ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): @@ -74,33 +73,18 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): int iarg = 0; while (iarg < nargnew) { - if (strncmp(arg[iarg],"c_",2) == 0 || - strncmp(arg[iarg],"f_",2) == 0 || - strncmp(arg[iarg],"v_",2) == 0) { - if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE; - else if (arg[iarg][0] == 'f') which[nvalues] = FIX; - else if (arg[iarg][0] == 'v') which[nvalues] = VARIABLE; + ArgInfo argi(arg[iarg]); + + if (argi.get_type() == ArgInfo::NONE) break; + if ((argi.get_type() == ArgInfo::UNKNOWN) || (argi.get_dim() > 1)) + error->all(FLERR,"Invalid fix ave/correlate command"); - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + which[nvalues] = argi.get_type(); + argindex[nvalues] = argi.get_index1(); + ids[nvalues] = argi.copy_name(); - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Illegal fix ave/correlate command"); - argindex[nvalues] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[nvalues] = 0; - - n = strlen(suffix) + 1; - ids[nvalues] = new char[n]; - strcpy(ids[nvalues],suffix); - delete [] suffix; - - nvalues++; - iarg++; - } else break; + nvalues++; + iarg++; } // optional args @@ -189,7 +173,7 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): error->all(FLERR,"Illegal fix ave/correlate command"); for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/correlate does not exist"); @@ -203,7 +187,7 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): error->all(FLERR,"Fix ave/correlate compute vector " "is accessed out-of-range"); - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for fix ave/correlate does not exist"); @@ -218,7 +202,7 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): error->all(FLERR,"Fix for fix ave/correlate " "not computed at compatible time"); - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix ave/correlate does not exist"); @@ -364,19 +348,19 @@ void FixAveCorrelate::init() // set current indices for all computes,fixes,variables for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/correlate does not exist"); value2index[i] = icompute; - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for fix ave/correlate does not exist"); value2index[i] = ifix; - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix ave/correlate does not exist"); @@ -435,7 +419,7 @@ void FixAveCorrelate::end_of_step() // invoke compute if not previously invoked - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[m]; if (argindex[i] == 0) { @@ -454,7 +438,7 @@ void FixAveCorrelate::end_of_step() // access fix fields, guaranteed to be ready - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { if (argindex[i] == 0) scalar = modify->fix[m]->compute_scalar(); else @@ -462,7 +446,7 @@ void FixAveCorrelate::end_of_step() // evaluate equal-style or vector-style variable - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { if (argindex[i] == 0) scalar = input->variable->compute_equal(m); else { diff --git a/src/fix_ave_histo.cpp b/src/fix_ave_histo.cpp index 438cc5a0e7..cad509e165 100644 --- a/src/fix_ave_histo.cpp +++ b/src/fix_ave_histo.cpp @@ -13,6 +13,7 @@ #include "fix_ave_histo.h" +#include "arg_info.h" #include "atom.h" #include "compute.h" #include "error.h" @@ -28,7 +29,6 @@ using namespace LAMMPS_NS; using namespace FixConst; -enum{X,V,F,COMPUTE,FIX,VARIABLE}; enum{ONE,RUNNING}; enum{SCALAR,VECTOR,WINDOW}; enum{DEFAULT,GLOBAL,PERATOM,LOCAL}; @@ -113,67 +113,56 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : for (int i = 0; i < nvalues; i++) { if (strcmp(arg[i],"x") == 0) { - which[i] = X; + which[i] = ArgInfo::X; argindex[i] = 0; ids[i] = nullptr; } else if (strcmp(arg[i],"y") == 0) { - which[i] = X; + which[i] = ArgInfo::X; argindex[i] = 1; ids[i] = nullptr; } else if (strcmp(arg[i],"z") == 0) { - which[i] = X; + which[i] = ArgInfo::X; argindex[i] = 2; ids[i] = nullptr; } else if (strcmp(arg[i],"vx") == 0) { - which[i] = V; + which[i] = ArgInfo::V; argindex[i] = 0; ids[i] = nullptr; } else if (strcmp(arg[i],"vy") == 0) { - which[i] = V; + which[i] = ArgInfo::V; argindex[i] = 1; ids[i] = nullptr; } else if (strcmp(arg[i],"vz") == 0) { - which[i] = V; + which[i] = ArgInfo::V; argindex[i] = 2; ids[i] = nullptr; } else if (strcmp(arg[i],"fx") == 0) { - which[i] = F; + which[i] = ArgInfo::F; argindex[i] = 0; ids[i] = nullptr; } else if (strcmp(arg[i],"fy") == 0) { - which[i] = F; + which[i] = ArgInfo::F; argindex[i] = 1; ids[i] = nullptr; } else if (strcmp(arg[i],"fz") == 0) { - which[i] = F; + which[i] = ArgInfo::F; argindex[i] = 2; ids[i] = nullptr; - } else if ((strncmp(arg[i],"c_",2) == 0) || - (strncmp(arg[i],"f_",2) == 0) || - (strncmp(arg[i],"v_",2) == 0)) { - if (arg[i][0] == 'c') which[i] = COMPUTE; - else if (arg[i][0] == 'f') which[i] = FIX; - else if (arg[i][0] == 'v') which[i] = VARIABLE; + } else { + ArgInfo argi(arg[iarg]); - int n = strlen(arg[i]); - char *suffix = new char[n]; - strcpy(suffix,&arg[i][2]); + if (argi.get_type() == ArgInfo::NONE) break; + if ((argi.get_type() == ArgInfo::UNKNOWN) || (argi.get_dim() > 1)) + error->all(FLERR,"Invalid fix ave/histo command"); - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Illegal fix ave/histo command"); - argindex[i] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[i] = 0; + which[nvalues] = argi.get_type(); + argindex[nvalues] = argi.get_index1(); + ids[nvalues] = argi.copy_name(); - n = strlen(suffix) + 1; - ids[i] = new char[n]; - strcpy(ids[i],suffix); - delete [] suffix; + nvalues++; } } @@ -201,10 +190,11 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : for (int i = 0; i < nvalues; i++) { kindglobal = kindperatom = kindlocal = 0; - if (which[i] == X || which[i] == V || which[i] == F) { + if ((which[i] == ArgInfo::X) || (which[i] == ArgInfo::V) + || (which[i] == ArgInfo::F)) { kindperatom = 1; - } else if (which[i] == COMPUTE) { + } else if (which[i] == ArgInfo::COMPUTE) { int c_id = modify->find_compute(ids[i]); if (c_id < 0) error->all(FLERR,"Fix ave/histo input is invalid compute"); Compute *compute = modify->compute[c_id]; @@ -214,7 +204,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : if (compute->peratom_flag) kindperatom = 1; if (compute->local_flag) kindlocal = 1; - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int f_id = modify->find_fix(ids[i]); if (f_id < 0) error->all(FLERR,"Fix ave/histo input is invalid fix"); Fix *fix = modify->fix[f_id]; @@ -224,7 +214,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : if (fix->peratom_flag) kindperatom = 1; if (fix->local_flag) kindlocal = 1; - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Fix ave/histo input is invalid variable"); @@ -262,7 +252,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Fix ave/histo cannot input local values in scalar mode"); for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE && kind == GLOBAL && mode == SCALAR) { + if (which[i] == ArgInfo::COMPUTE && kind == GLOBAL && mode == SCALAR) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/histo does not exist"); @@ -276,7 +266,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Fix ave/histo compute vector is accessed out-of-range"); - } else if (which[i] == COMPUTE && kind == GLOBAL && mode == VECTOR) { + } else if (which[i] == ArgInfo::COMPUTE && kind == GLOBAL && mode == VECTOR) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/histo does not exist"); @@ -291,7 +281,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Fix ave/histo compute array is accessed out-of-range"); - } else if (which[i] == COMPUTE && kind == PERATOM) { + } else if (which[i] == ArgInfo::COMPUTE && kind == PERATOM) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/histo does not exist"); @@ -310,7 +300,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Fix ave/histo compute array is accessed out-of-range"); - } else if (which[i] == COMPUTE && kind == LOCAL) { + } else if (which[i] == ArgInfo::COMPUTE && kind == LOCAL) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/histo does not exist"); @@ -329,7 +319,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Fix ave/histo compute array is accessed out-of-range"); - } else if (which[i] == FIX && kind == GLOBAL && mode == SCALAR) { + } else if (which[i] == ArgInfo::FIX && kind == GLOBAL && mode == SCALAR) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for fix ave/histo does not exist"); @@ -345,7 +335,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Fix for fix ave/histo not computed at compatible time"); - } else if (which[i] == FIX && kind == GLOBAL && mode == VECTOR) { + } else if (which[i] == ArgInfo::FIX && kind == GLOBAL && mode == VECTOR) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for fix ave/histo does not exist"); @@ -360,7 +350,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Fix for fix ave/histo not computed at compatible time"); - } else if (which[i] == FIX && kind == PERATOM) { + } else if (which[i] == ArgInfo::FIX && kind == PERATOM) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for fix ave/histo does not exist"); @@ -381,7 +371,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Fix for fix ave/histo not computed at compatible time"); - } else if (which[i] == FIX && kind == LOCAL) { + } else if (which[i] == ArgInfo::FIX && kind == LOCAL) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for fix ave/histo does not exist"); @@ -401,7 +391,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Fix for fix ave/histo not computed at compatible time"); - } else if (which[i] == VARIABLE && kind == GLOBAL && mode == SCALAR) { + } else if (which[i] == ArgInfo::VARIABLE && kind == GLOBAL && mode == SCALAR) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix ave/histo does not exist"); @@ -410,7 +400,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : if (argindex[i] && input->variable->vectorstyle(ivariable) == 0) error->all(FLERR,"Fix ave/histo variable is not vector-style variable"); - } else if (which[i] == VARIABLE && kind == GLOBAL && mode == VECTOR) { + } else if (which[i] == ArgInfo::VARIABLE && kind == GLOBAL && mode == VECTOR) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix ave/histo does not exist"); @@ -419,7 +409,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : if (argindex[i]) error->all(FLERR,"Fix ave/histo variable cannot be indexed"); - } else if (which[i] == VARIABLE && kind == PERATOM) { + } else if (which[i] == ArgInfo::VARIABLE && kind == PERATOM) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix ave/histo does not exist"); @@ -546,19 +536,19 @@ void FixAveHisto::init() // set current indices for all computes,fixes,variables for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/histo does not exist"); value2index[i] = icompute; - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for fix ave/histo does not exist"); value2index[i] = ifix; - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix ave/histo does not exist"); @@ -619,16 +609,16 @@ void FixAveHisto::end_of_step() // atom attributes - if (which[i] == X) + if (which[i] == ArgInfo::X) bin_atoms(&atom->x[0][j],3); - else if (which[i] == V) + else if (which[i] == ArgInfo::V) bin_atoms(&atom->v[0][j],3); - else if (which[i] == F) + else if (which[i] == ArgInfo::F) bin_atoms(&atom->f[0][j],3); // invoke compute if not previously invoked - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[m]; if (kind == GLOBAL && mode == SCALAR) { @@ -686,7 +676,7 @@ void FixAveHisto::end_of_step() // access fix fields, guaranteed to be ready - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { Fix *fix = modify->fix[m]; @@ -717,7 +707,7 @@ void FixAveHisto::end_of_step() // evaluate equal-style or vector-style or atom-style variable - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { if (kind == GLOBAL && mode == SCALAR) { if (j == 0) bin_one(input->variable->compute_equal(m)); else { @@ -732,7 +722,7 @@ void FixAveHisto::end_of_step() int nvec = input->variable->compute_vector(m,&varvec); bin_vector(nvec,varvec,1); - } else if (which[i] == VARIABLE && kind == PERATOM) { + } else if (which[i] == ArgInfo::VARIABLE && kind == PERATOM) { if (atom->nmax > maxatom) { memory->destroy(vector); maxatom = atom->nmax; diff --git a/src/fix_ave_time.cpp b/src/fix_ave_time.cpp index 5ee46b42f6..e51c86a5e1 100644 --- a/src/fix_ave_time.cpp +++ b/src/fix_ave_time.cpp @@ -17,6 +17,7 @@ #include "fix_ave_time.h" +#include "arg_info.h" #include "compute.h" #include "error.h" #include "input.h" @@ -31,11 +32,9 @@ using namespace LAMMPS_NS; using namespace FixConst; -enum{COMPUTE,FIX,VARIABLE}; enum{ONE,RUNNING,WINDOW}; enum{SCALAR,VECTOR}; - /* ---------------------------------------------------------------------- */ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : @@ -97,26 +96,16 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : ids = new char*[nvalues]; for (int i = 0; i < nvalues; i++) { - if (arg[i][0] == 'c') which[i] = COMPUTE; - else if (arg[i][0] == 'f') which[i] = FIX; - else if (arg[i][0] == 'v') which[i] = VARIABLE; + ArgInfo argi(arg[i]); - int n = strlen(arg[i]); - char *suffix = new char[n]; - strcpy(suffix,&arg[i][2]); + if ((argi.get_type() == ArgInfo::NONE) + || (argi.get_type() == ArgInfo::UNKNOWN) + || (argi.get_dim() > 1)) + error->all(FLERR,"Invalid fix ave/time command"); - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Illegal fix ave/time command"); - argindex[i] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[i] = 0; - - n = strlen(suffix) + 1; - ids[i] = new char[n]; - strcpy(ids[i],suffix); - delete [] suffix; + which[i] = argi.get_type(); + argindex[i] = argi.get_index1(); + ids[i] = argi.copy_name(); } // set off columns now that nvalues is finalized @@ -142,7 +131,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : for (int i = 0; i < nvalues; i++) { varlen[i] = 0; - if (which[i] == COMPUTE && mode == SCALAR) { + if (which[i] == ArgInfo::COMPUTE && mode == SCALAR) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/time does not exist"); @@ -157,7 +146,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : if (argindex[i] && modify->compute[icompute]->size_vector_variable) varlen[i] = 1; - } else if (which[i] == COMPUTE && mode == VECTOR) { + } else if (which[i] == ArgInfo::COMPUTE && mode == VECTOR) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/time does not exist"); @@ -173,7 +162,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : if (argindex[i] && modify->compute[icompute]->size_array_rows_variable) varlen[i] = 1; - } else if (which[i] == FIX && mode == SCALAR) { + } else if (which[i] == ArgInfo::FIX && mode == SCALAR) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for fix ave/time does not exist"); @@ -189,7 +178,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Fix for fix ave/time not computed at compatible time"); - } else if (which[i] == FIX && mode == VECTOR) { + } else if (which[i] == ArgInfo::FIX && mode == VECTOR) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for fix ave/time does not exist"); @@ -205,7 +194,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Fix for fix ave/time not computed at compatible time"); - } else if (which[i] == VARIABLE && mode == SCALAR) { + } else if (which[i] == ArgInfo::VARIABLE && mode == SCALAR) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix ave/time does not exist"); @@ -214,7 +203,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : if (argindex[i] && input->variable->vectorstyle(ivariable) == 0) error->all(FLERR,"Fix ave/time variable is not vector-style variable"); - } else if (which[i] == VARIABLE && mode == VECTOR) { + } else if (which[i] == ArgInfo::VARIABLE && mode == VECTOR) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix ave/time does not exist"); @@ -254,7 +243,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : if (any_variable_length && (nrepeat > 1 || ave == RUNNING || ave == WINDOW)) { for (int i = 0; i < nvalues; i++) - if (varlen[i] && which[i] == COMPUTE) { + if (varlen[i] && which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); modify->compute[icompute]->lock_enable(); } @@ -323,17 +312,17 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : if (mode == SCALAR) { if (nvalues == 1) { scalar_flag = 1; - if (which[0] == COMPUTE) { + if (which[0] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[modify->find_compute(ids[0])]; if (argindex[0] == 0) extscalar = compute->extscalar; else if (compute->extvector >= 0) extscalar = compute->extvector; else extscalar = compute->extlist[argindex[0]-1]; - } else if (which[0] == FIX) { + } else if (which[0] == ArgInfo::FIX) { Fix *fix = modify->fix[modify->find_fix(ids[0])]; if (argindex[0] == 0) extscalar = fix->extscalar; else if (fix->extvector >= 0) extscalar = fix->extvector; else extscalar = fix->extlist[argindex[0]-1]; - } else if (which[0] == VARIABLE) { + } else if (which[0] == ArgInfo::VARIABLE) { extscalar = 0; } @@ -343,17 +332,17 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : extvector = -1; extlist = new int[nvalues]; for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[modify->find_compute(ids[i])]; if (argindex[i] == 0) extlist[i] = compute->extscalar; else if (compute->extvector >= 0) extlist[i] = compute->extvector; else extlist[i] = compute->extlist[argindex[i]-1]; - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { Fix *fix = modify->fix[modify->find_fix(ids[i])]; if (argindex[i] == 0) extlist[i] = fix->extscalar; else if (fix->extvector >= 0) extlist[i] = fix->extvector; else extlist[i] = fix->extlist[argindex[i]-1]; - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { extlist[i] = 0; } } @@ -364,7 +353,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : vector_flag = 1; size_vector = nrows; if (all_variable_length) size_vector_variable = 1; - if (which[0] == COMPUTE) { + if (which[0] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[modify->find_compute(ids[0])]; if (argindex[0] == 0) { extvector = compute->extvector; @@ -373,7 +362,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : for (int i = 0; i < nrows; i++) extlist[i] = compute->extlist[i]; } } else extvector = compute->extarray; - } else if (which[0] == FIX) { + } else if (which[0] == ArgInfo::FIX) { Fix *fix = modify->fix[modify->find_fix(ids[0])]; if (argindex[0] == 0) { extvector = fix->extvector; @@ -382,7 +371,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : for (int i = 0; i < nrows; i++) extlist[i] = fix->extlist[i]; } } else extvector = fix->extarray; - } else if (which[0] == VARIABLE) { + } else if (which[0] == ArgInfo::VARIABLE) { extlist = new int[nrows]; for (int i = 0; i < nrows; i++) extlist[i] = 0; } @@ -394,15 +383,15 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : if (all_variable_length) size_array_rows_variable = 1; int value; for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[modify->find_compute(ids[i])]; if (argindex[i] == 0) value = compute->extvector; else value = compute->extarray; - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { Fix *fix = modify->fix[modify->find_fix(ids[i])]; if (argindex[i] == 0) value = fix->extvector; else value = fix->extarray; - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { value = 0; } if (value == -1) @@ -495,17 +484,17 @@ void FixAveTime::init() // set current indices for all computes,fixes,variables for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/time does not exist"); value2index[i] = icompute; - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for fix ave/time does not exist"); value2index[i] = ifix; - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix ave/time does not exist"); @@ -580,7 +569,7 @@ void FixAveTime::invoke_scalar(bigint ntimestep) // invoke compute if not previously invoked // insure no out-of-range access to variable-length compute vector - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[m]; if (argindex[i] == 0) { @@ -600,7 +589,7 @@ void FixAveTime::invoke_scalar(bigint ntimestep) // access fix fields, guaranteed to be ready - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { if (argindex[i] == 0) scalar = modify->fix[m]->compute_scalar(); else @@ -609,7 +598,7 @@ void FixAveTime::invoke_scalar(bigint ntimestep) // evaluate equal-style or vector-style variable // insure no out-of-range access to vector-style variable - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { if (argindex[i] == 0) scalar = input->variable->compute_equal(m); else { @@ -737,7 +726,7 @@ void FixAveTime::invoke_vector(bigint ntimestep) bigint ntimestep = update->ntimestep; int lockforever_flag = 0; for (i = 0; i < nvalues; i++) { - if (!varlen[i] || which[i] != COMPUTE) continue; + if (!varlen[i] || which[i] != ArgInfo::COMPUTE) continue; if (nrepeat > 1 && ave == ONE) { Compute *compute = modify->compute[value2index[i]]; compute->lock(this,ntimestep,ntimestep+static_cast(nrepeat-1)*nevery); @@ -764,7 +753,7 @@ void FixAveTime::invoke_vector(bigint ntimestep) // invoke compute if not previously invoked - if (which[j] == COMPUTE) { + if (which[j] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[m]; if (argindex[j] == 0) { @@ -789,7 +778,7 @@ void FixAveTime::invoke_vector(bigint ntimestep) // access fix fields, guaranteed to be ready - } else if (which[j] == FIX) { + } else if (which[j] == ArgInfo::FIX) { Fix *fix = modify->fix[m]; if (argindex[j] == 0) for (i = 0; i < nrows; i++) @@ -804,7 +793,7 @@ void FixAveTime::invoke_vector(bigint ntimestep) // insure nvec = nrows, else error // could be different on this timestep than when column_length(1) set nrows - } else if (which[j] == VARIABLE) { + } else if (which[j] == ArgInfo::VARIABLE) { double *varvec; int nvec = input->variable->compute_vector(m,&varvec); if (nvec != nrows) @@ -926,16 +915,16 @@ int FixAveTime::column_length(int dynamic) length = 0; for (int i = 0; i < nvalues; i++) { if (varlen[i]) continue; - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (argindex[i] == 0) lengthone = modify->compute[icompute]->size_vector; else lengthone = modify->compute[icompute]->size_array_rows; - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (argindex[i] == 0) lengthone = modify->fix[ifix]->size_vector; else lengthone = modify->fix[ifix]->size_array_rows; - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { // variables are always varlen = 1, so dynamic } if (length == 0) length = lengthone; @@ -954,10 +943,10 @@ int FixAveTime::column_length(int dynamic) for (int i = 0; i < nvalues; i++) { if (varlen[i] == 0) continue; m = value2index[i]; - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[m]; lengthone = compute->lock_length(); - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { double *varvec; lengthone = input->variable->compute_vector(m,&varvec); } diff --git a/src/fix_controller.cpp b/src/fix_controller.cpp index d9b927a39c..0e2530de41 100644 --- a/src/fix_controller.cpp +++ b/src/fix_controller.cpp @@ -13,6 +13,7 @@ #include "fix_controller.h" +#include "arg_info.h" #include "compute.h" #include "error.h" #include "input.h" @@ -25,9 +26,6 @@ using namespace LAMMPS_NS; using namespace FixConst; -enum{COMPUTE,FIX,VARIABLE}; - - /* ---------------------------------------------------------------------- */ FixController::FixController(LAMMPS *lmp, int narg, char **arg) : @@ -51,37 +49,19 @@ FixController::FixController(LAMMPS *lmp, int narg, char **arg) : // process variable arg - int iarg = 8; - if (strncmp(arg[iarg],"c_",2) == 0 || - strncmp(arg[iarg],"f_",2) == 0 || - strncmp(arg[iarg],"v_",2) == 0) { - if (arg[iarg][0] == 'c') pvwhich = COMPUTE; - else if (arg[iarg][0] == 'f') pvwhich = FIX; - else if (arg[iarg][0] == 'v') pvwhich = VARIABLE; + ArgInfo argi(arg[8]); + if ((argi.get_type() == ArgInfo::UNKNOWN) + || (argi.get_type() == ArgInfo::NONE) + || (argi.get_dim() != 0)) + error->all(FLERR,"Illegal fix controller command"); - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); - - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Illegal fix controller command"); - pvindex = atoi(ptr+1); - *ptr = '\0'; - } else pvindex = 0; - - n = strlen(suffix) + 1; - pvID = new char[n]; - strcpy(pvID,suffix); - delete [] suffix; - - iarg++; - - } else error->all(FLERR,"Illegal fix controller command"); + pvwhich = argi.get_type(); + pvindex = argi.get_index1(); + pvID = argi.copy_name(); // setpoint arg + int iarg=9; setpoint = utils::numeric(FLERR,arg[iarg],false,lmp); iarg++; @@ -93,7 +73,7 @@ FixController::FixController(LAMMPS *lmp, int narg, char **arg) : // error check - if (pvwhich == COMPUTE) { + if (pvwhich == ArgInfo::COMPUTE) { int icompute = modify->find_compute(pvID); if (icompute < 0) error->all(FLERR,"Compute ID for fix controller does not exist"); @@ -106,7 +86,7 @@ FixController::FixController(LAMMPS *lmp, int narg, char **arg) : if (pvindex && pvindex > c->size_vector) error->all(FLERR,"Fix controller compute vector is " "accessed out-of-range"); - } else if (pvwhich == FIX) { + } else if (pvwhich == ArgInfo::FIX) { int ifix = modify->find_fix(pvID); if (ifix < 0) error->all(FLERR,"Fix ID for fix controller does not exist"); @@ -118,7 +98,7 @@ FixController::FixController(LAMMPS *lmp, int narg, char **arg) : "calculate a global scalar or vector"); if (pvindex && pvindex > f->size_vector) error->all(FLERR,"Fix controller fix vector is accessed out-of-range"); - } else if (pvwhich == VARIABLE) { + } else if (pvwhich == ArgInfo::VARIABLE) { int ivariable = input->variable->find(pvID); if (ivariable < 0) error->all(FLERR,"Variable name for fix controller does not exist"); @@ -157,18 +137,18 @@ int FixController::setmask() void FixController::init() { - if (pvwhich == COMPUTE) { + if (pvwhich == ArgInfo::COMPUTE) { int icompute = modify->find_compute(pvID); if (icompute < 0) error->all(FLERR,"Compute ID for fix controller does not exist"); pcompute = modify->compute[icompute]; - } else if (pvwhich == FIX) { + } else if (pvwhich == ArgInfo::FIX) { int ifix = modify->find_fix(pvID); if (ifix < 0) error->all(FLERR,"Fix ID for fix controller does not exist"); pfix = modify->fix[ifix]; - } else if (pvwhich == VARIABLE) { + } else if (pvwhich == ArgInfo::VARIABLE) { pvar = input->variable->find(pvID); if (pvar < 0) error->all(FLERR,"Variable name for fix controller does not exist"); @@ -196,7 +176,7 @@ void FixController::end_of_step() double current = 0.0; - if (pvwhich == COMPUTE) { + if (pvwhich == ArgInfo::COMPUTE) { if (pvindex == 0) { if (!(pcompute->invoked_flag & Compute::INVOKED_SCALAR)) { pcompute->compute_scalar(); @@ -213,13 +193,13 @@ void FixController::end_of_step() // access fix field, guaranteed to be ready - } else if (pvwhich == FIX) { + } else if (pvwhich == ArgInfo::FIX) { if (pvindex == 0) current = pfix->compute_scalar(); else current = pfix->compute_vector(pvindex-1); // evaluate equal-style variable - } else if (pvwhich == VARIABLE) { + } else if (pvwhich == ArgInfo::VARIABLE) { current = input->variable->compute_equal(pvar); } From a700e506ae53be4f036a3dffda650a4aaaf2adcc Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 3 Feb 2021 16:50:19 -0500 Subject: [PATCH 118/384] use utils::strmatch(name,"^x_") instead of (strstr(name,"x_") == name) --- src/library.cpp | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/library.cpp b/src/library.cpp index 557d746226..71bf205d90 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -2693,7 +2693,7 @@ void lammps_gather(void *handle, char *name, int type, int count, void *data) void *vptr = lmp->atom->extract(name); - if (vptr==nullptr && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && utils::strmatch(name,"^f_")) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -2726,7 +2726,7 @@ void lammps_gather(void *handle, char *name, int type, int count, void *data) else vptr = (void *) lmp->modify->fix[fcid]->array_atom; } - if (vptr==nullptr && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && utils::strmatch(name,"^c_")) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -2756,9 +2756,10 @@ void lammps_gather(void *handle, char *name, int type, int count, void *data) } + // property / atom - if ( (vptr == nullptr) && ((strstr(name,"d_") == name) - || (strstr(name,"i_") == name))) { + + if ((vptr == nullptr) && (utils::strmatch(name,"^[di]_"))) { fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { if (lmp->comm->me == 0) @@ -2912,7 +2913,7 @@ void lammps_gather_concat(void *handle, char *name, int type, int count, void *d void *vptr = lmp->atom->extract(name); - if (vptr==nullptr && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && utils::strmatch(name,"^f_")) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -2946,7 +2947,7 @@ void lammps_gather_concat(void *handle, char *name, int type, int count, void *d else vptr = (void *) lmp->modify->fix[fcid]->array_atom; } - if (vptr==nullptr && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && utils::strmatch(name,"^c_")) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -2977,7 +2978,7 @@ void lammps_gather_concat(void *handle, char *name, int type, int count, void *d } - if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && utils::strmatch(name,"^[di]_")) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { @@ -3154,7 +3155,7 @@ void lammps_gather_subset(void *handle, char *name, void *vptr = lmp->atom->extract(name); - if (vptr==nullptr && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && utils::strmatch(name,"^f_")) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -3187,7 +3188,7 @@ void lammps_gather_subset(void *handle, char *name, else vptr = (void *) lmp->modify->fix[fcid]->array_atom; } - if (vptr==nullptr && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && utils::strmatch(name,"^c_")) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -3218,7 +3219,7 @@ void lammps_gather_subset(void *handle, char *name, } - if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && utils::strmatch(name,"^[di]_")) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { @@ -3392,7 +3393,7 @@ void lammps_scatter(void *handle, char *name, int type, int count, void *data) void *vptr = lmp->atom->extract(name); - if (vptr==nullptr && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && utils::strmatch(name,"^f_")) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -3418,7 +3419,7 @@ void lammps_scatter(void *handle, char *name, int type, int count, void *data) else vptr = (void *) lmp->modify->fix[fcid]->array_atom; } - if (vptr==nullptr && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && utils::strmatch(name,"^c_")) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -3449,7 +3450,7 @@ void lammps_scatter(void *handle, char *name, int type, int count, void *data) } - if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && utils::strmatch(name,"^[di]_")) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { @@ -3590,7 +3591,7 @@ void lammps_scatter_subset(void *handle, char *name,int type, int count, void *vptr = lmp->atom->extract(name); - if (vptr==nullptr && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && utils::strmatch(name,"^f_")) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -3616,7 +3617,7 @@ void lammps_scatter_subset(void *handle, char *name,int type, int count, else vptr = (void *) lmp->modify->fix[fcid]->array_atom; } - if (vptr==nullptr && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && utils::strmatch(name,"^c_")) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -3645,7 +3646,7 @@ void lammps_scatter_subset(void *handle, char *name,int type, int count, else vptr = (void *) lmp->modify->compute[fcid]->array_atom; } - if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && utils::strmatch(name,"^[di]_")) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { From 1ee27e2bc2b6c5b2a10e06777e455e4da95325b0 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Wed, 3 Feb 2021 15:01:35 -0700 Subject: [PATCH 119/384] clarify one of the outputs of fix ti/spring --- doc/src/fix_ti_spring.rst | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/doc/src/fix_ti_spring.rst b/doc/src/fix_ti_spring.rst index 08bd6ff2a8..303564456e 100644 --- a/doc/src/fix_ti_spring.rst +++ b/doc/src/fix_ti_spring.rst @@ -120,22 +120,28 @@ increase in computational resources cost. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This fix writes the original coordinates of tethered atoms to :doc:`binary restart files `, so that the spring effect will be the -same in a restarted simulation. See the :doc:`read restart ` command for info on how to re-specify a fix -in an input script that reads a restart file, so that the operation of -the fix continues in an uninterrupted fashion. +This fix writes the original coordinates of tethered atoms to +:doc:`binary restart files `, so that the spring effect will +be the same in a restarted simulation. See the :doc:`read restart +` command for info on how to re-specify a fix in an +input script that reads a restart file, so that the operation of the +fix continues in an uninterrupted fashion. -The :doc:`fix modify ` *energy* option is supported by this -fix to add the energy stored in the per-atom springs to the system's -potential energy as part of :doc:`thermodynamic output `. +The :doc:`fix modify ` *energy* option is supported by +this fix to add the energy stored in the per-atom springs to the +system's potential energy as part of :doc:`thermodynamic output +`. This fix computes a global scalar and a global vector quantities which can be accessed by various :doc:`output commands `. The scalar is an energy which is the sum of the spring energy for each -atom, where the per-atom energy is 0.5 \* k \* r\^2. The vector has 2 -positions, the first one is the coupling parameter lambda and the -second one is the time derivative of lambda. The scalar and vector -values calculated by this fix are "extensive". +atom, where the per-atom energy is 0.5 \* k \* r\^2. The vector stores +2 values. The first value is the coupling parameter lambda. The +second value is the derivative of lambda with respect to the integer +timestep *s*, i.e. d lambda / ds. In order to obtain d lambda / dt, +where t is simulation time, this 2nd value needs to be divided by the +timestep size (e.g. 0.5 fs). The scalar and vector values calculated +by this fix are "extensive". No parameter of this fix can be used with the *start/stop* keywords of the :doc:`run ` command. From 4b15ffcf143c6815f7b3edf467a607bfdf319dd7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 3 Feb 2021 17:43:39 -0500 Subject: [PATCH 120/384] more use of ArgInfo class --- src/USER-MISC/fix_ave_correlate_long.cpp | 54 ++++++++------------- src/thermo.cpp | 61 ++++++++++-------------- 2 files changed, 43 insertions(+), 72 deletions(-) diff --git a/src/USER-MISC/fix_ave_correlate_long.cpp b/src/USER-MISC/fix_ave_correlate_long.cpp index cf9e6c0dca..2aafe9bac0 100644 --- a/src/USER-MISC/fix_ave_correlate_long.cpp +++ b/src/USER-MISC/fix_ave_correlate_long.cpp @@ -23,6 +23,7 @@ #include "fix_ave_correlate_long.h" +#include "arg_info.h" #include "citeme.h" #include "compute.h" #include "error.h" @@ -39,10 +40,8 @@ using namespace LAMMPS_NS; using namespace FixConst; -enum{COMPUTE,FIX,VARIABLE}; enum{AUTO,UPPER,LOWER,AUTOUPPER,AUTOLOWER,FULL}; - static const char cite_fix_ave_correlate_long[] = "fix ave/correlate/long command:\n\n" "@Article{Ramirez10,\n" @@ -82,33 +81,18 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg): int iarg = 5; while (iarg < narg) { - if (strncmp(arg[iarg],"c_",2) == 0 || - strncmp(arg[iarg],"f_",2) == 0 || - strncmp(arg[iarg],"v_",2) == 0) { - if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE; - else if (arg[iarg][0] == 'f') which[nvalues] = FIX; - else if (arg[iarg][0] == 'v') which[nvalues] = VARIABLE; - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + ArgInfo argi(arg[iarg]); + if (argi.get_type() == ArgInfo::NONE) break; + if ((argi.get_type() == ArgInfo::UNKNOWN) || (argi.get_dim() > 1)) + error->all(FLERR,"Illegal fix ave/correlate/long command"); - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Illegal fix ave/correlate/long command"); - argindex[nvalues] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[nvalues] = 0; + which[nvalues] = argi.get_type(); + argindex[nvalues] = argi.get_index1(); + ids[nvalues] = argi.copy_name(); - n = strlen(suffix) + 1; - ids[nvalues] = new char[n]; - strcpy(ids[nvalues],suffix); - delete [] suffix; - - nvalues++; - iarg++; - } else break; + nvalues++; + iarg++; } // optional args @@ -204,7 +188,7 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg): error->all(FLERR,"Illegal fix ave/correlate/long command"); for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/correlate/long does not exist"); @@ -218,7 +202,7 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg): error->all(FLERR,"Fix ave/correlate/long compute vector " "is accessed out-of-range"); - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for fix ave/correlate/long does not exist"); @@ -233,7 +217,7 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg): error->all(FLERR,"Fix for fix ave/correlate/long " "not computed at compatible time"); - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix ave/correlate/long does not exist"); @@ -377,19 +361,19 @@ void FixAveCorrelateLong::init() // set current indices for all computes,fixes,variables for (int i = 0; i < nvalues; i++) { - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/correlate/long does not exist"); value2index[i] = icompute; - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for fix ave/correlate/long does not exist"); value2index[i] = ifix; - } else if (which[i] == VARIABLE) { + } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix ave/correlate/long does not exist"); @@ -441,7 +425,7 @@ void FixAveCorrelateLong::end_of_step() // invoke compute if not previously invoked - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[m]; if (argindex[i] == 0) { @@ -460,7 +444,7 @@ void FixAveCorrelateLong::end_of_step() // access fix fields, guaranteed to be ready - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { if (argindex[i] == 0) scalar = modify->fix[m]->compute_scalar(); else @@ -468,7 +452,7 @@ void FixAveCorrelateLong::end_of_step() // evaluate equal-style variable - } else if (which[i] == VARIABLE) + } else if (which[i] == ArgInfo::VARIABLE) scalar = input->variable->compute_equal(m); values[i] = scalar; diff --git a/src/thermo.cpp b/src/thermo.cpp index 6d806b65e3..649851c9e4 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -18,6 +18,7 @@ #include "thermo.h" #include "angle.h" +#include "arg_info.h" #include "atom.h" #include "bond.h" #include "comm.h" @@ -877,35 +878,25 @@ void Thermo::parse_fields(char *str) } else if (word == "cellgamma") { addfield("CellGamma",&Thermo::compute_cellgamma,FLOAT); - // compute value = c_ID, fix value = f_ID, variable value = v_ID - // count trailing [] and store int arguments + // compute value = c_ID, fix value = f_ID, variable value = v_ID + // count trailing [] and store int arguments - } else if ((word.substr(0, 2) == "c_") || (word.substr(0, 2) == "f_") || - (word.substr(0, 2) == "v_")) { + } else { + ArgInfo argi(word); - int n = word.length() - 1; - char *id = new char[n]; - strcpy(id, &word.c_str()[2]); + if ((argi.get_type() == ArgInfo::UNKNOWN) + || (argi.get_type() == ArgInfo::NONE) + || (argi.get_dim() > 2)) + error->all(FLERR,"Unknown keyword in thermo_style custom command"); - // parse zero or one or two trailing brackets from ID + // process zero or one or two trailing brackets // argindex1,argindex2 = int inside each bracket pair, 0 if no bracket - char *ptr = strchr(id,'['); - if (ptr == nullptr) argindex1[nfield] = argindex2[nfield] = 0; - else { - *ptr = '\0'; - argindex1[nfield] = - (int) input->variable->int_between_brackets(ptr,0); - ptr++; - if (*ptr == '[') { - argindex2[nfield] = - (int) input->variable->int_between_brackets(ptr,0); - ptr++; - } else argindex2[nfield] = 0; - } + argindex1[nfield] = argi.get_index1(); + argindex2[nfield] = (argi.get_dim() > 1) ? argi.get_index2() : 0; - if (word[0] == 'c') { - n = modify->find_compute(id); + if (argi.get_type() == ArgInfo::COMPUTE) { + int n = modify->find_compute(argi.get_name()); if (n < 0) error->all(FLERR,"Could not find thermo custom compute ID"); if (argindex1[nfield] == 0 && modify->compute[n]->scalar_flag == 0) error->all(FLERR,"Thermo compute does not compute scalar"); @@ -927,15 +918,15 @@ void Thermo::parse_fields(char *str) } if (argindex1[nfield] == 0) - field2index[nfield] = add_compute(id, SCALAR); + field2index[nfield] = add_compute(argi.get_name(), SCALAR); else if (argindex2[nfield] == 0) - field2index[nfield] = add_compute(id, VECTOR); + field2index[nfield] = add_compute(argi.get_name(), VECTOR); else - field2index[nfield] = add_compute(id, ARRAY); + field2index[nfield] = add_compute(argi.get_name(), ARRAY); addfield(word.c_str(), &Thermo::compute_compute, FLOAT); - } else if (word[0] == 'f') { - n = modify->find_fix(id); + } else if (argi.get_type() == ArgInfo::FIX) { + int n = modify->find_fix(argi.get_name()); if (n < 0) error->all(FLERR,"Could not find thermo custom fix ID"); if (argindex1[nfield] == 0 && modify->fix[n]->scalar_flag == 0) error->all(FLERR,"Thermo fix does not compute scalar"); @@ -956,11 +947,11 @@ void Thermo::parse_fields(char *str) error->all(FLERR,"Thermo fix array is accessed out-of-range"); } - field2index[nfield] = add_fix(id); + field2index[nfield] = add_fix(argi.get_name()); addfield(word.c_str(), &Thermo::compute_fix, FLOAT); - } else if (word[0] == 'v') { - n = input->variable->find(id); + } else if (argi.get_type() == ArgInfo::VARIABLE) { + int n = input->variable->find(argi.get_name()); if (n < 0) error->all(FLERR,"Could not find thermo custom variable name"); if (argindex1[nfield] == 0 && input->variable->equalstyle(n) == 0) @@ -972,14 +963,10 @@ void Thermo::parse_fields(char *str) if (argindex2[nfield]) error->all(FLERR,"Thermo custom variable cannot have two indices"); - field2index[nfield] = add_variable(id); + field2index[nfield] = add_variable(argi.get_name()); addfield(word.c_str(), &Thermo::compute_variable, FLOAT); } - - delete [] id; - - } else error->all(FLERR,"Unknown keyword in thermo_style custom command"); - + } } } From 9fa1688f395323b4dd4986b13062a0bee61c2335 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 3 Feb 2021 21:06:04 -0500 Subject: [PATCH 121/384] small corrections for dump custom --- src/dump_custom.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 0f2e62408d..07e51ce54a 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -1463,10 +1463,10 @@ int DumpCustom::parse_fields(int narg, char **arg) if (argi.get_dim() == 0 && modify->compute[n]->size_peratom_cols > 0) error->all(FLERR, "Dump custom compute does not calculate per-atom vector"); - if (argi.get_index1() > 0 && modify->compute[n]->size_peratom_cols == 0) + if (argi.get_dim() > 0 && modify->compute[n]->size_peratom_cols == 0) error->all(FLERR, "Dump custom compute does not calculate per-atom array"); - if (argi.get_index1() > 0 && + if (argi.get_dim() > 0 && argi.get_index1() > modify->compute[n]->size_peratom_cols) error->all(FLERR,"Dump custom compute vector is accessed out-of-range"); @@ -1486,9 +1486,9 @@ int DumpCustom::parse_fields(int narg, char **arg) error->all(FLERR,"Dump custom fix does not compute per-atom info"); if (argi.get_dim() == 0 && modify->fix[n]->size_peratom_cols > 0) error->all(FLERR,"Dump custom fix does not compute per-atom vector"); - if (argi.get_index1() > 0 && modify->fix[n]->size_peratom_cols == 0) + if (argi.get_dim() > 0 && modify->fix[n]->size_peratom_cols == 0) error->all(FLERR,"Dump custom fix does not compute per-atom array"); - if (argi.get_index1() > 0 && + if (argi.get_dim() > 0 && argi.get_index1() > modify->fix[n]->size_peratom_cols) error->all(FLERR,"Dump custom fix vector is accessed out-of-range"); From 9f7dc78f8686aa05cce4a3c37aba9bc28695abfd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 3 Feb 2021 21:06:23 -0500 Subject: [PATCH 122/384] convert a few more styles to use ArgInfo --- src/USER-VTK/dump_vtk.cpp | 230 ++++++++++++++++------------------- src/fix_ave_histo_weight.cpp | 66 +++++----- 2 files changed, 137 insertions(+), 159 deletions(-) diff --git a/src/USER-VTK/dump_vtk.cpp b/src/USER-VTK/dump_vtk.cpp index 373680dfc2..92981c98ff 100644 --- a/src/USER-VTK/dump_vtk.cpp +++ b/src/USER-VTK/dump_vtk.cpp @@ -22,26 +22,27 @@ Richard Berger (JKU) ------------------------------------------------------------------------- */ -#include - -#include #include "dump_vtk.h" + #include "atom.h" -#include "force.h" +#include "compute.h" #include "domain.h" -#include "region.h" +#include "error.h" +#include "fix.h" +#include "force.h" #include "group.h" #include "input.h" -#include "variable.h" -#include "update.h" -#include "modify.h" -#include "compute.h" -#include "fix.h" #include "memory.h" -#include "error.h" +#include "modify.h" +#include "region.h" +#include "update.h" +#include "variable.h" -#include +#include +#include #include +#include + #include #ifndef VTK_MAJOR_VERSION @@ -1731,146 +1732,123 @@ int DumpVTK::parse_fields(int narg, char **arg) vtype[TQZ] = Dump::DOUBLE; name[TQZ] = arg[iarg]; - // compute value = c_ID - // if no trailing [], then arg is set to 0, else arg is int between [] + } else { - } else if (strncmp(arg[iarg],"c_",2) == 0) { - pack_choice[ATTRIBUTES+i] = &DumpVTK::pack_compute; - vtype[ATTRIBUTES+i] = Dump::DOUBLE; + int n,tmp; + ArgInfo argi(arg[iarg],ArgInfo::COMPUTE|ArgInfo::FIX|ArgInfo::VARIABLE + |ArgInfo::DNAME|ArgInfo::INAME); + argindex[ATTRIBUTES+i] = argi.get_index1(); - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + switch (argi.get_type()) { - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Invalid attribute in dump vtk command"); - argindex[ATTRIBUTES+i] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[ATTRIBUTES+i] = 0; + case ArgInfo::UNKNOWN: + error->all(FLERR,"Invalid attribute in dump vtk command"); + break; - n = modify->find_compute(suffix); - if (n < 0) error->all(FLERR,"Could not find dump vtk compute ID"); - if (modify->compute[n]->peratom_flag == 0) - error->all(FLERR,"Dump vtk compute does not compute per-atom info"); - if (argindex[ATTRIBUTES+i] == 0 && modify->compute[n]->size_peratom_cols > 0) - error->all(FLERR, - "Dump vtk compute does not calculate per-atom vector"); - if (argindex[ATTRIBUTES+i] > 0 && modify->compute[n]->size_peratom_cols == 0) - error->all(FLERR,\ - "Dump vtk compute does not calculate per-atom array"); - if (argindex[ATTRIBUTES+i] > 0 && - argindex[ATTRIBUTES+i] > modify->compute[n]->size_peratom_cols) - error->all(FLERR,"Dump vtk compute vector is accessed out-of-range"); + // compute value = c_ID + // if no trailing [], then arg is set to 0, else arg is int between [] - field2index[ATTRIBUTES+i] = add_compute(suffix); - name[ATTRIBUTES+i] = arg[iarg]; - delete [] suffix; + case ArgInfo::COMPUTE: + pack_choice[ATTRIBUTES+i] = &DumpVTK::pack_compute; + vtype[ATTRIBUTES+i] = Dump::DOUBLE; - // fix value = f_ID - // if no trailing [], then arg is set to 0, else arg is between [] + n = modify->find_compute(argi.get_name()); + if (n < 0) error->all(FLERR,"Could not find dump vtk compute ID"); + if (modify->compute[n]->peratom_flag == 0) + error->all(FLERR,"Dump vtk compute does not compute per-atom info"); + if (argi.get_dim() == 0 && modify->compute[n]->size_peratom_cols > 0) + error->all(FLERR, + "Dump vtk compute does not calculate per-atom vector"); + if (argi.get_dim() > 0 && modify->compute[n]->size_peratom_cols == 0) + error->all(FLERR, + "Dump vtk compute does not calculate per-atom array"); + if (argi.get_dim() > 0 && + argi.get_index1() > modify->compute[n]->size_peratom_cols) + error->all(FLERR,"Dump vtk compute vector is accessed out-of-range"); - } else if (strncmp(arg[iarg],"f_",2) == 0) { - pack_choice[ATTRIBUTES+i] = &DumpVTK::pack_fix; - vtype[ATTRIBUTES+i] = Dump::DOUBLE; + field2index[ATTRIBUTES+i] = add_compute(argi.get_name()); + name[ATTRIBUTES+i] = arg[iarg]; + break; - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + // fix value = f_ID + // if no trailing [], then arg is set to 0, else arg is between [] - char *ptr = strchr(suffix,'['); - if (ptr) { - if (suffix[strlen(suffix)-1] != ']') - error->all(FLERR,"Invalid attribute in dump vtk command"); - argindex[ATTRIBUTES+i] = atoi(ptr+1); - *ptr = '\0'; - } else argindex[ATTRIBUTES+i] = 0; + case ArgInfo::FIX: + pack_choice[ATTRIBUTES+i] = &DumpVTK::pack_fix; + vtype[ATTRIBUTES+i] = Dump::DOUBLE; - n = modify->find_fix(suffix); - if (n < 0) error->all(FLERR,"Could not find dump vtk fix ID"); - if (modify->fix[n]->peratom_flag == 0) - error->all(FLERR,"Dump vtk fix does not compute per-atom info"); - if (argindex[ATTRIBUTES+i] == 0 && modify->fix[n]->size_peratom_cols > 0) - error->all(FLERR,"Dump vtk fix does not compute per-atom vector"); - if (argindex[ATTRIBUTES+i] > 0 && modify->fix[n]->size_peratom_cols == 0) - error->all(FLERR,"Dump vtk fix does not compute per-atom array"); - if (argindex[ATTRIBUTES+i] > 0 && - argindex[ATTRIBUTES+i] > modify->fix[n]->size_peratom_cols) - error->all(FLERR,"Dump vtk fix vector is accessed out-of-range"); + n = modify->find_fix(argi.get_name()); + if (n < 0) error->all(FLERR,"Could not find dump vtk fix ID"); + if (modify->fix[n]->peratom_flag == 0) + error->all(FLERR,"Dump vtk fix does not compute per-atom info"); + if (argi.get_dim() == 0 && modify->fix[n]->size_peratom_cols > 0) + error->all(FLERR,"Dump vtk fix does not compute per-atom vector"); + if (argi.get_dim() > 0 && modify->fix[n]->size_peratom_cols == 0) + error->all(FLERR,"Dump vtk fix does not compute per-atom array"); + if (argi.get_dim() > 0 && + argi.get_index1() > modify->fix[n]->size_peratom_cols) + error->all(FLERR,"Dump vtk fix vector is accessed out-of-range"); - field2index[ATTRIBUTES+i] = add_fix(suffix); - name[ATTRIBUTES+i] = arg[iarg]; - delete [] suffix; + field2index[ATTRIBUTES+i] = add_fix(argi.get_name()); + name[ATTRIBUTES+i] = arg[iarg]; + break; - // variable value = v_name + // variable value = v_name - } else if (strncmp(arg[iarg],"v_",2) == 0) { - pack_choice[ATTRIBUTES+i] = &DumpVTK::pack_variable; - vtype[ATTRIBUTES+i] = Dump::DOUBLE; + case ArgInfo::VARIABLE: + pack_choice[ATTRIBUTES+i] = &DumpVTK::pack_variable; + vtype[ATTRIBUTES+i] = Dump::DOUBLE; - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); + n = input->variable->find(argi.get_name()); + if (n < 0) error->all(FLERR,"Could not find dump vtk variable name"); + if (input->variable->atomstyle(n) == 0) + error->all(FLERR,"Dump vtk variable is not atom-style variable"); - argindex[ATTRIBUTES+i] = 0; + field2index[ATTRIBUTES+i] = add_variable(argi.get_name()); + name[ATTRIBUTES+i] = arg[iarg]; + break; - n = input->variable->find(suffix); - if (n < 0) error->all(FLERR,"Could not find dump vtk variable name"); - if (input->variable->atomstyle(n) == 0) - error->all(FLERR,"Dump vtk variable is not atom-style variable"); + // custom per-atom floating point value = d_ID - field2index[ATTRIBUTES+i] = add_variable(suffix); - name[ATTRIBUTES+i] = suffix; - delete [] suffix; + case ArgInfo::DNAME: + pack_choice[ATTRIBUTES+i] = &DumpVTK::pack_custom; + vtype[ATTRIBUTES+i] = Dump::DOUBLE; - // custom per-atom floating point value = d_ID + tmp = -1; + n = atom->find_custom(argi.get_name(),tmp); + if (n < 0) + error->all(FLERR,"Could not find custom per-atom property ID"); - } else if (strncmp(arg[iarg],"d_",2) == 0) { - pack_choice[ATTRIBUTES+i] = &DumpVTK::pack_custom; - vtype[ATTRIBUTES+i] = Dump::DOUBLE; + if (tmp != 1) + error->all(FLERR,"Custom per-atom property ID is not floating point"); - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); - argindex[ATTRIBUTES+i] = 0; + field2index[ATTRIBUTES+i] = add_custom(argi.get_name(),1); + name[ATTRIBUTES+i] = arg[iarg]; + break; - int tmp = -1; - n = atom->find_custom(suffix,tmp); - if (n < 0) - error->all(FLERR,"Could not find custom per-atom property ID"); + // custom per-atom integer value = i_ID - if (tmp != 1) - error->all(FLERR,"Custom per-atom property ID is not floating point"); + case ArgInfo::INAME: + pack_choice[ATTRIBUTES+i] = &DumpVTK::pack_custom; + vtype[ATTRIBUTES+i] = Dump::INT; - field2index[ATTRIBUTES+i] = add_custom(suffix,1); - name[ATTRIBUTES+i] = suffix; - delete [] suffix; + tmp = -1; + n = atom->find_custom(argi.get_name(),tmp); + if (n < 0) + error->all(FLERR,"Could not find custom per-atom property ID"); - // custom per-atom integer value = i_ID + if (tmp != 0) + error->all(FLERR,"Custom per-atom property ID is not integer"); - } else if (strncmp(arg[iarg],"i_",2) == 0) { - pack_choice[ATTRIBUTES+i] = &DumpVTK::pack_custom; - vtype[ATTRIBUTES+i] = Dump::INT; + field2index[ATTRIBUTES+i] = add_custom(argi.get_name(),0); + name[ATTRIBUTES+i] = arg[iarg]; + break; - int n = strlen(arg[iarg]); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg][2]); - argindex[ATTRIBUTES+i] = 0; - - int tmp = -1; - n = atom->find_custom(suffix,tmp); - if (n < 0) - error->all(FLERR,"Could not find custom per-atom property ID"); - - if (tmp != 0) - error->all(FLERR,"Custom per-atom property ID is not integer"); - - field2index[ATTRIBUTES+i] = add_custom(suffix,0); - name[ATTRIBUTES+i] = suffix; - delete [] suffix; - - } else return iarg; + default: + return iarg; + break; + } + } } identify_vectors(); diff --git a/src/fix_ave_histo_weight.cpp b/src/fix_ave_histo_weight.cpp index 652136f9c6..ae83d80845 100644 --- a/src/fix_ave_histo_weight.cpp +++ b/src/fix_ave_histo_weight.cpp @@ -16,28 +16,28 @@ ------------------------------------------------------------------------- */ #include "fix_ave_histo_weight.h" -#include -#include "fix.h" +#include "arg_info.h" #include "atom.h" -#include "update.h" -#include "modify.h" #include "compute.h" -#include "input.h" -#include "variable.h" -#include "memory.h" #include "error.h" +#include "fix.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "update.h" +#include "variable.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; -enum{X,V,F,COMPUTE,FIX,VARIABLE}; enum{ONE,RUNNING}; enum{SCALAR,VECTOR,WINDOW}; enum{DEFAULT,GLOBAL,PERATOM,LOCAL}; enum{IGNORE,END,EXTRA}; enum{SINGLE,VALUE}; - #define BIG 1.0e20 /* ---------------------------------------------------------------------- */ @@ -54,31 +54,31 @@ FixAveHistoWeight::FixAveHistoWeight(LAMMPS *lmp, int narg, char **arg) : int size[2]; for (int i = 0; i < nvalues; i++) { - if (which[i] == X || which[i] == V || which[i] == F) { + if (which[i] == ArgInfo::X || which[i] == ArgInfo::V || which[i] == ArgInfo::F) { size[i] = atom->nlocal; - } else if (which[i] == COMPUTE && kind == GLOBAL && mode == SCALAR) { + } else if (which[i] == ArgInfo::COMPUTE && kind == GLOBAL && mode == SCALAR) { int icompute = modify->find_compute(ids[i]); size[i] = modify->compute[icompute]->size_vector; - } else if (which[i] == COMPUTE && kind == GLOBAL && mode == VECTOR) { + } else if (which[i] == ArgInfo::COMPUTE && kind == GLOBAL && mode == VECTOR) { int icompute = modify->find_compute(ids[i]); size[i] = modify->compute[icompute]->size_array_rows; - } else if (which[i] == COMPUTE && kind == PERATOM) { + } else if (which[i] == ArgInfo::COMPUTE && kind == PERATOM) { size[i] = atom->nlocal; - } else if (which[i] == COMPUTE && kind == LOCAL) { + } else if (which[i] == ArgInfo::COMPUTE && kind == LOCAL) { int icompute = modify->find_compute(ids[i]); size[i] = modify->compute[icompute]->size_local_rows; - } else if (which[i] == FIX && kind == GLOBAL && mode == SCALAR) { + } else if (which[i] == ArgInfo::FIX && kind == GLOBAL && mode == SCALAR) { int ifix = modify->find_fix(ids[i]); size[i] = modify->fix[ifix]->size_vector; - } else if (which[i] == FIX && kind == GLOBAL && mode == VECTOR) { + } else if (which[i] == ArgInfo::FIX && kind == GLOBAL && mode == VECTOR) { int ifix = modify->find_fix(ids[i]); size[i]= modify->fix[ifix]->size_array_rows; - } else if (which[i] == FIX && kind == PERATOM) { + } else if (which[i] == ArgInfo::FIX && kind == PERATOM) { size[i] = atom->nlocal; - } else if (which[i] == FIX && kind == LOCAL) { + } else if (which[i] == ArgInfo::FIX && kind == LOCAL) { int ifix = modify->find_fix(ids[i]); size[i] = modify->fix[ifix]->size_local_rows; - } else if (which[i] == VARIABLE && kind == PERATOM) { + } else if (which[i] == ArgInfo::VARIABLE && kind == PERATOM) { size[i] = atom->nlocal; } } @@ -130,21 +130,21 @@ void FixAveHistoWeight::end_of_step() // atom attributes - if (which[i] == X) { + if (which[i] == ArgInfo::X) { weights = &atom->x[0][j]; stride = 3; - } else if (which[i] == V) { + } else if (which[i] == ArgInfo::V) { weights = &atom->v[0][j]; stride = 3; bin_atoms(&atom->v[0][j],3); - } else if (which[i] == F) { + } else if (which[i] == ArgInfo::F) { weights = &atom->f[0][j]; stride = 3; } // invoke compute if not previously invoked - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[m]; @@ -206,7 +206,7 @@ void FixAveHistoWeight::end_of_step() // access fix fields, guaranteed to be ready - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { Fix *fix = modify->fix[m]; @@ -243,10 +243,10 @@ void FixAveHistoWeight::end_of_step() // evaluate equal-style variable - } else if (which[i] == VARIABLE && kind == GLOBAL) { + } else if (which[i] == ArgInfo::VARIABLE && kind == GLOBAL) { weight = input->variable->compute_equal(m); - } else if (which[i] == VARIABLE && kind == PERATOM) { + } else if (which[i] == ArgInfo::VARIABLE && kind == PERATOM) { if (atom->nmax > maxatom) { memory->destroy(vector); maxatom = atom->nmax; @@ -265,16 +265,16 @@ void FixAveHistoWeight::end_of_step() // atom attributes - if (which[i] == X && weights != nullptr) + if (which[i] == ArgInfo::X && weights != nullptr) bin_atoms_weights(&atom->x[0][j],3,weights,stride); - else if (which[i] == V && weights != nullptr) + else if (which[i] == ArgInfo::V && weights != nullptr) bin_atoms_weights(&atom->v[0][j],3,weights,stride); - else if (which[i] == F && weights != nullptr) + else if (which[i] == ArgInfo::F && weights != nullptr) bin_atoms_weights(&atom->f[0][j],3,weights,stride); // invoke compute if not previously invoked - if (which[i] == COMPUTE) { + if (which[i] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[m]; if (kind == GLOBAL && mode == SCALAR) { if (j == 0) { @@ -335,7 +335,7 @@ void FixAveHistoWeight::end_of_step() // access fix fields, guaranteed to be ready - } else if (which[i] == FIX) { + } else if (which[i] == ArgInfo::FIX) { Fix *fix = modify->fix[m]; @@ -372,10 +372,10 @@ void FixAveHistoWeight::end_of_step() // evaluate equal-style variable - } else if (which[i] == VARIABLE && kind == GLOBAL) { + } else if (which[i] == ArgInfo::VARIABLE && kind == GLOBAL) { bin_one_weights(input->variable->compute_equal(m),weight); - } else if (which[i] == VARIABLE && kind == PERATOM) { + } else if (which[i] == ArgInfo::VARIABLE && kind == PERATOM) { if (atom->nmax > maxatom) { memory->destroy(vector); maxatom = atom->nmax; From c6c9c82f960a68aec32bef2e5773d2342c6bdce2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 3 Feb 2021 21:13:54 -0500 Subject: [PATCH 123/384] ID strings are immutable, so make them const char * arguments --- src/USER-VTK/dump_vtk.cpp | 9 +++++---- src/USER-VTK/dump_vtk.h | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/USER-VTK/dump_vtk.cpp b/src/USER-VTK/dump_vtk.cpp index 92981c98ff..8b970820d2 100644 --- a/src/USER-VTK/dump_vtk.cpp +++ b/src/USER-VTK/dump_vtk.cpp @@ -24,6 +24,7 @@ #include "dump_vtk.h" +#include "arg_info.h" #include "atom.h" #include "compute.h" #include "domain.h" @@ -1908,7 +1909,7 @@ void DumpVTK::identify_vectors() if already in list, do not add, just return index, else add to list ------------------------------------------------------------------------- */ -int DumpVTK::add_compute(char *id) +int DumpVTK::add_compute(const char *id) { int icompute; for (icompute = 0; icompute < ncompute; icompute++) @@ -1933,7 +1934,7 @@ int DumpVTK::add_compute(char *id) if already in list, do not add, just return index, else add to list ------------------------------------------------------------------------- */ -int DumpVTK::add_fix(char *id) +int DumpVTK::add_fix(const char *id) { int ifix; for (ifix = 0; ifix < nfix; ifix++) @@ -1958,7 +1959,7 @@ int DumpVTK::add_fix(char *id) if already in list, do not add, just return index, else add to list ------------------------------------------------------------------------- */ -int DumpVTK::add_variable(char *id) +int DumpVTK::add_variable(const char *id) { int ivariable; for (ivariable = 0; ivariable < nvariable; ivariable++) @@ -1987,7 +1988,7 @@ int DumpVTK::add_variable(char *id) if already in list, do not add, just return index, else add to list ------------------------------------------------------------------------- */ -int DumpVTK::add_custom(char *id, int flag) +int DumpVTK::add_custom(const char *id, int flag) { int icustom; for (icustom = 0; icustom < ncustom; icustom++) diff --git a/src/USER-VTK/dump_vtk.h b/src/USER-VTK/dump_vtk.h index 28fcca78d6..9d46571d23 100644 --- a/src/USER-VTK/dump_vtk.h +++ b/src/USER-VTK/dump_vtk.h @@ -81,10 +81,10 @@ class DumpVTK : public DumpCustom { int parse_fields(int, char **); void identify_vectors(); - int add_compute(char *); - int add_fix(char *); - int add_variable(char *); - int add_custom(char *, int); + int add_compute(const char *); + int add_fix(const char *); + int add_variable(const char *); + int add_custom(const char *, int); virtual int modify_param(int, char **); typedef void (DumpVTK::*FnPtrHeader)(bigint); From c9cf8b57f4ce3ade34f55911824b5a126bf3200a Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Wed, 3 Feb 2021 10:00:25 -0600 Subject: [PATCH 124/384] Fix behavor of a 2nd call to 'pair_style kim ...' & a bug for parameter changes --- src/KIM/pair_kim.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index ee6f5f98a5..ecb62cdf7a 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -540,6 +540,19 @@ void PairKIM::coeff(int narg, char **arg) kimerror = KIM_Model_ClearThenRefresh(pkim); if (kimerror) error->all(FLERR,"KIM KIM_Model_ClearThenRefresh returned error"); + + // Update cached quantities that may have changed due to Refresh + KIM_Model_GetInfluenceDistance(pkim, &kim_global_influence_distance); + KIM_Model_GetNeighborListPointers( + pkim, + &kim_number_of_neighbor_lists, + &kim_cutoff_values, + &modelWillNotRequestNeighborsOfNoncontributingParticles); + if (neighborLists) { + delete [] neighborLists; + neighborLists = 0; + } + neighborLists = new NeighList*[kim_number_of_neighbor_lists]; } } @@ -809,6 +822,8 @@ void PairKIM::kim_free() error->all(FLERR,"Unable to destroy Compute Arguments Object"); KIM_Model_Destroy(&pkim); + + lmps_maxalloc = 0; } kim_init_ok = false; } From 8da3bc91444523948433f01e2a90701bfcfa81a0 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Thu, 4 Feb 2021 09:47:29 -0600 Subject: [PATCH 125/384] Increment instance_me in pair_kim to ensure neighbor correct list updates --- src/KIM/pair_kim.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index ecb62cdf7a..53ccdc1d73 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -550,7 +550,7 @@ void PairKIM::coeff(int narg, char **arg) &modelWillNotRequestNeighborsOfNoncontributingParticles); if (neighborLists) { delete [] neighborLists; - neighborLists = 0; + neighborLists = nullptr; } neighborLists = new NeighList*[kim_number_of_neighbor_lists]; } @@ -604,6 +604,9 @@ void PairKIM::init_style() neighbor->requests[irequest]->cutoff = kim_cutoff_values[i] + neighbor->skin; } + // increment instance_me in case of need to change the neighbor list + // request settings + instance_me += 1; } /* ---------------------------------------------------------------------- @@ -823,7 +826,7 @@ void PairKIM::kim_free() KIM_Model_Destroy(&pkim); - lmps_maxalloc = 0; + lmps_maxalloc = 0; // reinitialize member variable } kim_init_ok = false; } @@ -874,7 +877,7 @@ void PairKIM::kim_init() &modelWillNotRequestNeighborsOfNoncontributingParticles); if (neighborLists) { delete [] neighborLists; - neighborLists = 0; + neighborLists = nulptr; } neighborLists = new NeighList*[kim_number_of_neighbor_lists]; From 302be3f946c470ccbf9a156f9ae5f00c224899d4 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Thu, 4 Feb 2021 10:09:14 -0600 Subject: [PATCH 126/384] Fix typo --- src/KIM/pair_kim.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 53ccdc1d73..2f1fb9da3e 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -877,7 +877,7 @@ void PairKIM::kim_init() &modelWillNotRequestNeighborsOfNoncontributingParticles); if (neighborLists) { delete [] neighborLists; - neighborLists = nulptr; + neighborLists = nullptr; } neighborLists = new NeighList*[kim_number_of_neighbor_lists]; From 5256631bee97c06e7c302e4b722111e0e3303b11 Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Thu, 4 Feb 2021 11:08:39 -0600 Subject: [PATCH 127/384] test for correctly supporting the use of multiple calls to pair_style kim --- unittest/commands/test_kim_commands.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/unittest/commands/test_kim_commands.cpp b/unittest/commands/test_kim_commands.cpp index 4e16e28783..275a9eae3a 100644 --- a/unittest/commands/test_kim_commands.cpp +++ b/unittest/commands/test_kim_commands.cpp @@ -219,6 +219,20 @@ TEST_F(KimCommandsTest, kim_interactions) int ifix = lmp->modify->find_fix("KIM_MODEL_STORE"); ASSERT_GE(ifix, 0); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("clear"); + lmp->input->one("kim_init LennardJones_Ar real"); + lmp->input->one("lattice fcc 4.4300"); + lmp->input->one("region box block 0 10 0 10 0 10"); + lmp->input->one("create_box 1 box"); + lmp->input->one("create_atoms 1 box"); + lmp->input->one("kim_interactions Ar"); + lmp->input->one("mass 1 39.95"); + lmp->input->one("run 1"); + lmp->input->one("kim_interactions Ar"); + lmp->input->one("run 1"); + if (!verbose) ::testing::internal::GetCapturedStdout(); } TEST_F(KimCommandsTest, kim_param) From de5ba601f214eab3f26e87693f666821d82c5a51 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Thu, 4 Feb 2021 13:41:58 -0500 Subject: [PATCH 128/384] Update fix_bond_react.rst manual rebase --- doc/src/fix_bond_react.rst | 170 +++++++++++++++++++++++-------------- 1 file changed, 106 insertions(+), 64 deletions(-) diff --git a/doc/src/fix_bond_react.rst b/doc/src/fix_bond_react.rst index 34d2282312..f54ba29bd3 100755 --- a/doc/src/fix_bond_react.rst +++ b/doc/src/fix_bond_react.rst @@ -35,13 +35,13 @@ Syntax * react-ID = user-assigned name for the reaction * react-group-ID = only atoms in this group are considered for the reaction * Nevery = attempt reaction every this many steps -* Rmin = bonding pair atoms must be separated by more than Rmin to initiate reaction (distance units) -* Rmax = bonding pair atoms must be separated by less than Rmax to initiate reaction (distance units) +* Rmin = initiator atoms must be separated by more than Rmin to initiate reaction (distance units) +* Rmax = initiator atoms must be separated by less than Rmax to initiate reaction (distance units) * template-ID(pre-reacted) = ID of a molecule template containing pre-reaction topology * template-ID(post-reacted) = ID of a molecule template containing post-reaction topology * map_file = name of file specifying corresponding atom-IDs in the pre- and post-reacted templates * zero or more individual keyword/value pairs may be appended to each react argument -* individual_keyword = *prob* or *max_rxn* or *stabilize_steps* or *custom_charges* or *modify_create* +* individual_keyword = *prob* or *max_rxn* or *stabilize_steps* or *custom_charges* or *molecule* or *modify_create* .. parsed-literal:: @@ -55,6 +55,10 @@ Syntax *custom_charges* value = *no* or *fragmentID* no = update all atomic charges (default) fragmentID = ID of molecule fragment whose charges are updated + *molecule* value = *off* or *inter* or *intra* + off = allow both inter- and intramolecular reactions (default) + inter = search for reactions between molecules with different IDs + intra = search for reactions within the same molecule *modify_create* keyword values *fit* value = *all* or *fragmentID* all = use all eligible atoms for create-atoms fit (default) @@ -180,17 +184,19 @@ timesteps. *Nevery* can be specified with an equal-style integer. Three physical conditions must be met for a reaction to occur. First, -a bonding atom pair must be identified within the reaction distance -cutoffs. Second, the topology surrounding the bonding atom pair must -match the topology of the pre-reaction template. Finally, any reaction -constraints listed in the map file (see below) must be satisfied. If -all of these conditions are met, the reaction site is eligible to be -modified to match the post-reaction template. +an initiator atom pair must be identified within the reaction distance +cutoffs. Second, the topology surrounding the initiator atom pair must +match the topology of the pre-reaction template. Only atom types and +bond connectivity are used to identify a valid reaction site (not bond +types, etc.). Finally, any reaction constraints listed in the map file +(see below) must be satisfied. If all of these conditions are met, the +reaction site is eligible to be modified to match the post-reaction +template. -A bonding atom pair will be identified if several conditions are met. -First, a pair of atoms I,J within the specified react-group-ID of type -itype and jtype must be separated by a distance between *Rmin* and -*Rmax*\ . *Rmin* and *Rmax* can be specified with equal-style +An initiator atom pair will be identified if several conditions are +met. First, a pair of atoms I,J within the specified react-group-ID of +type itype and jtype must be separated by a distance between *Rmin* +and *Rmax*\ . *Rmin* and *Rmax* can be specified with equal-style :doc:`variables `. For example, these reaction cutoffs can be a function of the reaction conversion using the following commands: @@ -200,23 +206,30 @@ be a function of the reaction conversion using the following commands: fix myrxn all bond/react react myrxn1 all 1 0 v_rmax mol1 mol2 map_file.txt variable rmax equal 3+f_myrxn[1]/100 # arbitrary function of reaction count -It is possible that multiple bonding atom pairs are identified: if the -bonding atoms in the pre-reacted template are 1-2 neighbors, i.e. -directly bonded, the farthest bonding atom partner is set as its -bonding partner; otherwise, the closest potential partner is chosen. -Then, if both an atom I and atom J have each other as their bonding -partners, these two atoms are identified as the bonding atom pair of -the reaction site. Once this unique bonding atom pair is identified -for each reaction, there could two or more reactions that involve a -given atom on the same timestep. If this is the case, only one such -reaction is permitted to occur. This reaction is chosen randomly from -all potential reactions. This capability allows e.g. for different -reaction pathways to proceed from identical reaction sites with -user-specified probabilities. +The following criteria are used if multiple candidate initiator atom +pairs are identified within the cutoff distance: 1) If the initiator +atoms in the pre-reaction template are not 1-2 neighbors (i.e. not +directly bonded) the closest potential partner is chosen. 2) +Otherwise, if the initiator atoms in the pre-reaction template are 1-2 +neighbors (i.e. directly bonded) the farthest potential partner is +chosen. 3) Then, if both an atom I and atom J have each other as their +initiator partners, these two atoms are identified as the initiator +atom pair of the reaction site. Note that it can be helpful to select +unique atom types for the initiator atoms: if an initiator atom pair +is identified, as described in the previous steps, but does not +correspond to the same pair specified in the pre-reaction template, an +otherwise eligible reaction could be prevented from occurring. Once +this unique initiator atom pair is identified for each reaction, there +could be two or more reactions that involve the same atom on the same +timestep. If this is the case, only one such reaction is permitted to +occur. This reaction is chosen randomly from all potential reactions +involving the overlapping atom. This capability allows e.g. for +different reaction pathways to proceed from identical reaction sites +with user-specified probabilities. The pre-reacted molecule template is specified by a molecule command. This molecule template file contains a sample reaction site and its -surrounding topology. As described below, the bonding atom pairs of +surrounding topology. As described below, the initiator atom pairs of the pre-reacted template are specified by atom ID in the map file. The pre-reacted molecule template should contain as few atoms as possible while still completely describing the topology of all atoms affected @@ -230,18 +243,18 @@ missing topology with respect to the simulation. For example, the pre-reacted template may contain an atom that, in the simulation, is currently connected to the rest of a long polymer chain. These are referred to as edge atoms, and are also specified in the map file. All -pre-reaction template atoms should be linked to a bonding atom, via at -least one path that does not involve edge atoms. When the pre-reaction -template contains edge atoms, not all atoms, bonds, charges, etc. -specified in the reaction templates will be updated. Specifically, -topology that involves only atoms that are 'too near' to template -edges will not be updated. The definition of 'too near the edge' -depends on which interactions are defined in the simulation. If the -simulation has defined dihedrals, atoms within two bonds of edge atoms -are considered 'too near the edge.' If the simulation defines angles, -but not dihedrals, atoms within one bond of edge atoms are considered -'too near the edge.' If just bonds are defined, only edge atoms are -considered 'too near the edge.' +pre-reaction template atoms should be linked to an initiator atom, via +at least one path that does not involve edge atoms. When the +pre-reaction template contains edge atoms, not all atoms, bonds, +charges, etc. specified in the reaction templates will be updated. +Specifically, topology that involves only atoms that are 'too near' to +template edges will not be updated. The definition of 'too near the +edge' depends on which interactions are defined in the simulation. If +the simulation has defined dihedrals, atoms within two bonds of edge +atoms are considered 'too near the edge.' If the simulation defines +angles, but not dihedrals, atoms within one bond of edge atoms are +considered 'too near the edge.' If just bonds are defined, only edge +atoms are considered 'too near the edge.' .. note:: @@ -298,25 +311,25 @@ The optional keywords are 'edgeIDs', 'deleteIDs', 'chiralIDs' and The body of the map file contains two mandatory sections and five optional sections. The first mandatory section begins with the keyword -'BondingIDs' and lists the atom IDs of the bonding atom pair in the -pre-reacted molecule template. The second mandatory section begins -with the keyword 'Equivalences' and lists a one-to-one correspondence -between atom IDs of the pre- and post-reacted templates. The first -column is an atom ID of the pre-reacted molecule template, and the -second column is the corresponding atom ID of the post-reacted -molecule template. The first optional section begins with the keyword -'EdgeIDs' and lists the atom IDs of edge atoms in the pre-reacted -molecule template. The second optional section begins with the keyword -'DeleteIDs' and lists the atom IDs of pre-reaction template atoms to -delete. The third optional section begins with the keyword 'CreateIDs' -and lists the atom IDs of the post-reaction template atoms to create. -The fourth optional section begins with the keyword 'ChiralIDs' lists -the atom IDs of chiral atoms whose handedness should be enforced. The -fifth optional section begins with the keyword 'Constraints' and lists -additional criteria that must be satisfied in order for the reaction -to occur. Currently, there are five types of constraints available, as -discussed below: 'distance', 'angle', 'dihedral', 'arrhenius', and -'rmsd'. +'InitiatorIDs' and lists the two atom IDs of the initiator atom pair +in the pre-reacted molecule template. The second mandatory section +begins with the keyword 'Equivalences' and lists a one-to-one +correspondence between atom IDs of the pre- and post-reacted +templates. The first column is an atom ID of the pre-reacted molecule +template, and the second column is the corresponding atom ID of the +post-reacted molecule template. The first optional section begins with +the keyword 'EdgeIDs' and lists the atom IDs of edge atoms in the +pre-reacted molecule template. The second optional section begins with +the keyword 'DeleteIDs' and lists the atom IDs of pre-reaction +template atoms to delete. The third optional section begins with the +keyword 'CreateIDs' and lists the atom IDs of the post-reaction +template atoms to create. The fourth optional section begins with the +keyword 'ChiralIDs' lists the atom IDs of chiral atoms whose +handedness should be enforced. The fifth optional section begins with +the keyword 'Constraints' and lists additional criteria that must be +satisfied in order for the reaction to occur. Currently, there are +five types of constraints available, as discussed below: 'distance', +'angle', 'dihedral', 'arrhenius', and 'rmsd'. A sample map file is given below: @@ -329,7 +342,7 @@ A sample map file is given below: 7 equivalences 2 edgeIDs - BondingIDs + InitiatorIDs 3 5 @@ -487,6 +500,23 @@ example, the molecule fragment could consist of only the backbone atoms of a polymer chain. This constraint can be used to enforce a specific relative position and orientation between reacting molecules. +By default, all constraints must be satisfied for the reaction to +occur. In other words, constraints are evaluated as a series of +logical values using the logical AND operator "&&". More complex logic +can be achieved by explicitly adding the logical AND operator "&&" or +the logical OR operator "||" after a given constraint command. If a +logical operator is specified after a constraint, it must be placed +after all constraint parameters, on the same line as the constraint +(one per line). Similarly, parentheses can be used to group +constraints. The expression that results from concatenating all +constraints should be a valid logical expression that can be read by +the :doc:`variable ` command after converting each +constraint to a logical value. Because exactly one constraint is +allowed per line, having a valid logical expression implies that left +parentheses "(" should only appear before a constraint, and right +parentheses ")" should only appear after a constraint and before any +logical operator. + Once a reaction site has been successfully identified, data structures within LAMMPS that store bond topology are updated to reflect the post-reacted molecule template. All force fields with fixed bonds, @@ -496,7 +526,7 @@ A few capabilities to note: 1) You may specify as many *react* arguments as desired. For example, you could break down a complicated reaction mechanism into several reaction steps, each defined by its own *react* argument. 2) While typically a bond is formed or removed -between the bonding atom pairs specified in the pre-reacted molecule +between the initiator atoms specified in the pre-reacted molecule template, this is not required. 3) By reversing the order of the pre- and post- reacted molecule templates in another *react* argument, you can allow for the possibility of one or more reverse reactions. @@ -525,12 +555,20 @@ situations, decreasing rather than increasing this parameter will result in an increase in stability. The *custom_charges* keyword can be used to specify which atoms' -atomic charges are updated. When the value is set to 'no,' all atomic +atomic charges are updated. When the value is set to 'no', all atomic charges are updated to those specified by the post-reaction template (default). Otherwise, the value should be the name of a molecule fragment defined in the pre-reaction molecule template. In this case, only the atomic charges of atoms in the molecule fragment are updated. +The *molecule* keyword can be used to force the reaction to be +intermolecular, intramolecular or either. When the value is set to +'off', molecule IDs are not considered when searching for reactions +(default). When the value is set to 'inter', the initiator atoms must +have different molecule IDs in order to be considered for the +reaction. When the value is set to 'intra', only initiator atoms with +the same molecule ID are considered for the reaction. + A few other considerations: Optionally, you can enforce additional behaviors on reacting atoms. @@ -583,7 +621,7 @@ These is 1 quantity for each react argument: No parameter of this fix can be used with the *start/stop* keywords of the :doc:`run ` command. This fix is not invoked during :doc:`energy minimization `. -When fix bond/react is 'unfixed,' all internally-created groups are +When fix bond/react is 'unfixed', all internally-created groups are deleted. Therefore, fix bond/react can only be unfixed after unfixing all other fixes that use any group created by fix bond/react. @@ -606,10 +644,14 @@ Default """"""" The option defaults are stabilization = no, prob = 1.0, stabilize_steps = 60, -reset_mol_ids = yes, custom_charges = no, modify_create = no +reset_mol_ids = yes, custom_charges = no, molecule = off, modify_create = no ---------- .. _Gissinger: -**(Gissinger)** Gissinger, Jensen and Wise, Polymer, 128, 211 (2017). +**(Gissinger)** Gissinger, Jensen and Wise, Polymer, 128, 211-217 (2017). + +.. _Gissinger2020: + +**(Gissinger)** Gissinger, Jensen and Wise, Macromolecules, 53, 22, 9953-9961 (2020). From 95e2214d962d0dbbbd8713f8fdfd3cc3ac426f8d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 3 Feb 2021 20:28:40 -0500 Subject: [PATCH 129/384] more typecasts to double to avoid 32-bit int overflows when computing memory usage --- src/BODY/compute_body_local.cpp | 2 +- src/GRANULAR/pair_gran_hooke_history.cpp | 2 +- src/GRANULAR/pair_granular.cpp | 2 +- src/KOKKOS/fix_neigh_history_kokkos.cpp | 2 +- src/KOKKOS/pppm_kokkos.cpp | 2 +- src/KSPACE/pair_lj_cut_tip4p_long.cpp | 2 +- src/KSPACE/pair_lj_long_tip4p_long.cpp | 2 +- src/KSPACE/pair_tip4p_long.cpp | 2 +- src/KSPACE/pppm.cpp | 2 +- src/KSPACE/pppm_dipole.cpp | 2 +- src/KSPACE/pppm_disp.cpp | 2 +- src/MANYBODY/fix_qeq_comb.cpp | 2 +- src/MANYBODY/pair_comb.cpp | 2 +- src/MANYBODY/pair_comb3.cpp | 2 +- src/MANYBODY/pair_eam.cpp | 2 +- src/MANYBODY/pair_eim.cpp | 2 +- src/MC/fix_atom_swap.cpp | 2 +- src/MC/fix_bond_create.cpp | 2 +- src/MC/fix_bond_swap.cpp | 2 +- src/MC/fix_gcmc.cpp | 2 +- src/MC/fix_widom.cpp | 2 +- src/MISC/fix_gld.cpp | 2 +- src/MISC/fix_orient_bcc.cpp | 2 +- src/MISC/fix_orient_fcc.cpp | 2 +- src/MLIAP/compute_mliap.cpp | 2 +- src/MOLECULE/fix_cmap.cpp | 2 +- src/MOLECULE/pair_lj_cut_tip4p_cut.cpp | 2 +- src/MOLECULE/pair_tip4p_cut.cpp | 2 +- src/PERI/compute_damage_atom.cpp | 2 +- src/PERI/compute_dilatation_atom.cpp | 2 +- src/PERI/compute_plasticity_atom.cpp | 2 +- src/PERI/pair_peri_pmb.cpp | 2 +- src/POEMS/fix_poems.cpp | 2 +- src/REPLICA/fix_hyper_global.cpp | 2 +- src/REPLICA/fix_hyper_local.cpp | 2 +- src/REPLICA/verlet_split.cpp | 2 +- src/RIGID/compute_rigid_local.cpp | 2 +- src/RIGID/fix_rigid.cpp | 2 +- src/RIGID/fix_rigid_small.cpp | 2 +- src/RIGID/fix_shake.cpp | 2 +- src/SNAP/compute_sna_atom.cpp | 2 +- src/SNAP/compute_snad_atom.cpp | 2 +- src/SNAP/compute_snap.cpp | 2 +- src/SNAP/compute_snav_atom.cpp | 2 +- src/USER-ATC/fix_atc.cpp | 2 +- src/USER-AWPMD/pair_awpmd_cut.cpp | 2 +- src/USER-DPD/compute_dpd_atom.cpp | 2 +- src/USER-EFF/compute_ke_atom_eff.cpp | 2 +- src/USER-EFF/compute_temp_deform_eff.cpp | 2 +- src/USER-EFF/compute_temp_region_eff.cpp | 2 +- src/USER-EFF/pair_eff_cut.cpp | 2 +- src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp | 2 +- src/USER-FEP/pair_tip4p_long_soft.cpp | 2 +- src/USER-LB/fix_lb_rigid_pc_sphere.cpp | 2 +- src/USER-MESODPD/compute_edpd_temp_atom.cpp | 2 +- src/USER-MESODPD/compute_tdpd_cc_atom.cpp | 2 +- src/USER-MESONT/compute_mesont.cpp | 2 +- src/USER-MISC/compute_ackland_atom.cpp | 2 +- src/USER-MISC/compute_cnp_atom.cpp | 2 +- src/USER-MISC/compute_hma.cpp | 2 +- src/USER-MISC/compute_temp_rotate.cpp | 2 +- src/USER-MISC/fix_ffl.cpp | 2 +- src/USER-MISC/fix_gle.cpp | 2 +- src/USER-MISC/fix_orient_eco.cpp | 2 +- src/USER-MISC/fix_propel_self.cpp | 2 +- src/USER-MISC/fix_srp.cpp | 2 +- src/USER-MISC/fix_ti_spring.cpp | 2 +- src/USER-MISC/pair_list.cpp | 2 +- src/USER-MISC/pair_local_density.cpp | 2 +- src/USER-PHONON/fix_phonon.cpp | 2 +- src/USER-PTM/compute_ptm_atom.cpp | 2 +- src/USER-REACTION/fix_bond_react.cpp | 2 +- src/USER-REAXC/compute_spec_atom.cpp | 2 +- src/USER-REAXC/fix_reaxc.cpp | 2 +- src/USER-SDPD/fix_meso_move.cpp | 2 +- src/USER-SMD/compute_smd_contact_radius.cpp | 2 +- src/USER-SMD/compute_smd_damage.cpp | 2 +- src/USER-SMD/compute_smd_hourglass_error.cpp | 2 +- src/USER-SMD/compute_smd_internal_energy.cpp | 2 +- src/USER-SMD/compute_smd_plastic_strain.cpp | 2 +- src/USER-SMD/compute_smd_plastic_strain_rate.cpp | 2 +- src/USER-SMD/compute_smd_rho.cpp | 2 +- src/USER-SMD/compute_smd_tlsph_defgrad.cpp | 2 +- src/USER-SMD/compute_smd_tlsph_dt.cpp | 2 +- src/USER-SMD/compute_smd_tlsph_num_neighs.cpp | 2 +- src/USER-SMD/compute_smd_tlsph_shape.cpp | 2 +- src/USER-SMD/compute_smd_tlsph_strain.cpp | 2 +- src/USER-SMD/compute_smd_tlsph_strain_rate.cpp | 2 +- src/USER-SMD/compute_smd_tlsph_stress.cpp | 2 +- src/USER-SMD/compute_smd_triangle_vertices.cpp | 2 +- src/USER-SMD/compute_smd_ulsph_effm.cpp | 2 +- src/USER-SMD/compute_smd_ulsph_num_neighs.cpp | 2 +- src/USER-SMD/compute_smd_ulsph_strain.cpp | 2 +- src/USER-SMD/compute_smd_ulsph_strain_rate.cpp | 2 +- src/USER-SMD/compute_smd_ulsph_stress.cpp | 2 +- src/USER-SMD/compute_smd_vol.cpp | 2 +- src/USER-SMTBQ/pair_smtbq.cpp | 2 +- src/USER-SPH/compute_sph_e_atom.cpp | 2 +- src/USER-SPH/compute_sph_rho_atom.cpp | 2 +- src/USER-SPH/compute_sph_t_atom.cpp | 2 +- src/VORONOI/compute_voronoi_atom.cpp | 2 +- src/angle.cpp | 2 +- src/angle_hybrid.cpp | 2 +- src/bond.cpp | 2 +- src/bond_hybrid.cpp | 2 +- src/compute_aggregate_atom.cpp | 2 +- src/compute_angle_local.cpp | 2 +- src/compute_bond_local.cpp | 2 +- src/compute_centro_atom.cpp | 2 +- src/compute_centroid_stress_atom.cpp | 2 +- src/compute_chunk_spread_atom.cpp | 2 +- src/compute_cluster_atom.cpp | 2 +- src/compute_cna_atom.cpp | 2 +- src/compute_contact_atom.cpp | 2 +- src/compute_coord_atom.cpp | 2 +- src/compute_dihedral_local.cpp | 2 +- src/compute_displace_atom.cpp | 2 +- src/compute_erotate_sphere_atom.cpp | 2 +- src/compute_fragment_atom.cpp | 2 +- src/compute_global_atom.cpp | 2 +- src/compute_hexorder_atom.cpp | 2 +- src/compute_improper_local.cpp | 2 +- src/compute_ke_atom.cpp | 2 +- src/compute_orientorder_atom.cpp | 2 +- src/compute_pair_local.cpp | 2 +- src/compute_pe_atom.cpp | 2 +- src/compute_property_atom.cpp | 2 +- src/compute_property_local.cpp | 2 +- src/compute_reduce.cpp | 2 +- src/compute_stress_atom.cpp | 2 +- src/compute_temp_profile.cpp | 2 +- src/dihedral.cpp | 2 +- src/dihedral_hybrid.cpp | 2 +- src/fix_ave_chunk.cpp | 2 +- src/fix_move.cpp | 2 +- src/fix_neigh_history.cpp | 2 +- src/fix_read_restart.cpp | 2 +- src/fix_respa.cpp | 2 +- src/fix_spring_self.cpp | 2 +- src/fix_store_force.cpp | 2 +- src/fix_store_state.cpp | 2 +- src/improper.cpp | 2 +- src/improper_hybrid.cpp | 2 +- src/my_pool_chunk.cpp | 2 +- src/pair.cpp | 2 +- src/pair_coul_streitz.cpp | 2 +- src/pair_hybrid.cpp | 2 +- 147 files changed, 147 insertions(+), 147 deletions(-) diff --git a/src/BODY/compute_body_local.cpp b/src/BODY/compute_body_local.cpp index 62d079b322..e393566b2f 100644 --- a/src/BODY/compute_body_local.cpp +++ b/src/BODY/compute_body_local.cpp @@ -226,6 +226,6 @@ void ComputeBodyLocal::reallocate(int n) double ComputeBodyLocal::memory_usage() { - double bytes = nmax*nvalues * sizeof(double); + double bytes = (double)nmax*nvalues * sizeof(double); return bytes; } diff --git a/src/GRANULAR/pair_gran_hooke_history.cpp b/src/GRANULAR/pair_gran_hooke_history.cpp index 7b7586d355..4deb828d76 100644 --- a/src/GRANULAR/pair_gran_hooke_history.cpp +++ b/src/GRANULAR/pair_gran_hooke_history.cpp @@ -793,6 +793,6 @@ void PairGranHookeHistory::unpack_forward_comm(int n, int first, double *buf) double PairGranHookeHistory::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 215926e23e..cc210138eb 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -1759,7 +1759,7 @@ void PairGranular::unpack_forward_comm(int n, int first, double *buf) double PairGranular::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/KOKKOS/fix_neigh_history_kokkos.cpp b/src/KOKKOS/fix_neigh_history_kokkos.cpp index fd625c6718..0f57b67a0e 100644 --- a/src/KOKKOS/fix_neigh_history_kokkos.cpp +++ b/src/KOKKOS/fix_neigh_history_kokkos.cpp @@ -243,7 +243,7 @@ void FixNeighHistoryKokkos::post_neighbor_item(const int &ii) const template double FixNeighHistoryKokkos::memory_usage() { - double bytes = d_firstflag.extent(0)*d_firstflag.extent(1)*sizeof(int); + double bytes = (double)d_firstflag.extent(0)*d_firstflag.extent(1)*sizeof(int); bytes += (double)d_firstvalue.extent(0)*d_firstvalue.extent(1)*sizeof(double); bytes += (double)2*k_npartner.extent(0)*sizeof(int); bytes += (double)2*k_partner.extent(0)*k_partner.extent(1)*sizeof(int); diff --git a/src/KOKKOS/pppm_kokkos.cpp b/src/KOKKOS/pppm_kokkos.cpp index cdf973ce28..9dc2416dcc 100644 --- a/src/KOKKOS/pppm_kokkos.cpp +++ b/src/KOKKOS/pppm_kokkos.cpp @@ -2873,7 +2873,7 @@ int PPPMKokkos::timing_3d(int n, double &time3d) template double PPPMKokkos::memory_usage() { - double bytes = nmax*3 * sizeof(double); + double bytes = (double)nmax*3 * sizeof(double); int nbrick = (nxhi_out-nxlo_out+1) * (nyhi_out-nylo_out+1) * (nzhi_out-nzlo_out+1); bytes += (double)4 * nbrick * sizeof(FFT_SCALAR); diff --git a/src/KSPACE/pair_lj_cut_tip4p_long.cpp b/src/KSPACE/pair_lj_cut_tip4p_long.cpp index 1f200143ea..7ab2d5d5a1 100644 --- a/src/KSPACE/pair_lj_cut_tip4p_long.cpp +++ b/src/KSPACE/pair_lj_cut_tip4p_long.cpp @@ -603,7 +603,7 @@ void *PairLJCutTIP4PLong::extract(const char *str, int &dim) double PairLJCutTIP4PLong::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)2 * nmax * sizeof(double); return bytes; diff --git a/src/KSPACE/pair_lj_long_tip4p_long.cpp b/src/KSPACE/pair_lj_long_tip4p_long.cpp index 54a8f1e16a..568e6ca37c 100644 --- a/src/KSPACE/pair_lj_long_tip4p_long.cpp +++ b/src/KSPACE/pair_lj_long_tip4p_long.cpp @@ -1636,7 +1636,7 @@ void *PairLJLongTIP4PLong::extract(const char *str, int &dim) double PairLJLongTIP4PLong::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)2 * nmax * sizeof(double); return bytes; diff --git a/src/KSPACE/pair_tip4p_long.cpp b/src/KSPACE/pair_tip4p_long.cpp index 9c5a0dccfc..8d5a8a824a 100644 --- a/src/KSPACE/pair_tip4p_long.cpp +++ b/src/KSPACE/pair_tip4p_long.cpp @@ -523,7 +523,7 @@ void *PairTIP4PLong::extract(const char *str, int &dim) double PairTIP4PLong::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)2 * nmax * sizeof(double); return bytes; diff --git a/src/KSPACE/pppm.cpp b/src/KSPACE/pppm.cpp index 938ddf436e..2419627642 100644 --- a/src/KSPACE/pppm.cpp +++ b/src/KSPACE/pppm.cpp @@ -3057,7 +3057,7 @@ int PPPM::timing_3d(int n, double &time3d) double PPPM::memory_usage() { - double bytes = nmax*3 * sizeof(double); + double bytes = (double)nmax*3 * sizeof(double); int nbrick = (nxhi_out-nxlo_out+1) * (nyhi_out-nylo_out+1) * (nzhi_out-nzlo_out+1); diff --git a/src/KSPACE/pppm_dipole.cpp b/src/KSPACE/pppm_dipole.cpp index e4fa001664..80a87a1d61 100644 --- a/src/KSPACE/pppm_dipole.cpp +++ b/src/KSPACE/pppm_dipole.cpp @@ -2507,7 +2507,7 @@ int PPPMDipole::timing_3d(int n, double &time3d) double PPPMDipole::memory_usage() { - double bytes = nmax*3 * sizeof(double); + double bytes = (double)nmax*3 * sizeof(double); int nbrick = (nxhi_out-nxlo_out+1) * (nyhi_out-nylo_out+1) * (nzhi_out-nzlo_out+1); diff --git a/src/KSPACE/pppm_disp.cpp b/src/KSPACE/pppm_disp.cpp index 4c58de8481..28aa68ff14 100644 --- a/src/KSPACE/pppm_disp.cpp +++ b/src/KSPACE/pppm_disp.cpp @@ -8298,7 +8298,7 @@ int PPPMDisp::timing_3d(int n, double &time3d) double PPPMDisp::memory_usage() { - double bytes = nmax*3 * sizeof(double); + double bytes = (double)nmax*3 * sizeof(double); int mixing = 1; int diff = 3; //depends on differentiation diff --git a/src/MANYBODY/fix_qeq_comb.cpp b/src/MANYBODY/fix_qeq_comb.cpp index 1241d9905c..7c2d18fc13 100644 --- a/src/MANYBODY/fix_qeq_comb.cpp +++ b/src/MANYBODY/fix_qeq_comb.cpp @@ -284,7 +284,7 @@ void FixQEQComb::post_force_respa(int vflag, int ilevel, int /*iloop*/) double FixQEQComb::memory_usage() { - double bytes = atom->nmax*3 * sizeof(double); + double bytes = (double)atom->nmax*3 * sizeof(double); return bytes; } /* ---------------------------------------------------------------------- */ diff --git a/src/MANYBODY/pair_comb.cpp b/src/MANYBODY/pair_comb.cpp index 7292726292..2d93c6783e 100644 --- a/src/MANYBODY/pair_comb.cpp +++ b/src/MANYBODY/pair_comb.cpp @@ -2098,7 +2098,7 @@ void PairComb::Short_neigh() double PairComb::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)nmax * sizeof(int); bytes += (double)nmax * sizeof(int *); diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp index aa2afe5d20..d7814737ea 100644 --- a/src/MANYBODY/pair_comb3.cpp +++ b/src/MANYBODY/pair_comb3.cpp @@ -3850,7 +3850,7 @@ void PairComb3::unpack_reverse_comm(int n, int *list, double *buf) double PairComb3::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)nmax * sizeof(int); bytes += (double)nmax * 8.0 * sizeof(double); diff --git a/src/MANYBODY/pair_eam.cpp b/src/MANYBODY/pair_eam.cpp index d509768572..03098904c8 100644 --- a/src/MANYBODY/pair_eam.cpp +++ b/src/MANYBODY/pair_eam.cpp @@ -913,7 +913,7 @@ void PairEAM::unpack_reverse_comm(int n, int *list, double *buf) double PairEAM::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)2 * nmax * sizeof(double); return bytes; diff --git a/src/MANYBODY/pair_eim.cpp b/src/MANYBODY/pair_eim.cpp index c56a07fb71..b82a410791 100644 --- a/src/MANYBODY/pair_eim.cpp +++ b/src/MANYBODY/pair_eim.cpp @@ -1044,7 +1044,7 @@ void PairEIM::unpack_reverse_comm(int n, int *list, double *buf) double PairEIM::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)2 * nmax * sizeof(double); return bytes; diff --git a/src/MC/fix_atom_swap.cpp b/src/MC/fix_atom_swap.cpp index e2fb7c3f73..16bb8b1aeb 100644 --- a/src/MC/fix_atom_swap.cpp +++ b/src/MC/fix_atom_swap.cpp @@ -753,7 +753,7 @@ double FixAtomSwap::compute_vector(int n) double FixAtomSwap::memory_usage() { - double bytes = atom_swap_nmax * sizeof(int); + double bytes = (double)atom_swap_nmax * sizeof(int); return bytes; } diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp index b33e213759..bcf7a7a843 100644 --- a/src/MC/fix_bond_create.cpp +++ b/src/MC/fix_bond_create.cpp @@ -1427,7 +1427,7 @@ double FixBondCreate::compute_vector(int n) double FixBondCreate::memory_usage() { int nmax = atom->nmax; - double bytes = nmax * sizeof(int); + double bytes = (double)nmax * sizeof(int); bytes = 2*nmax * sizeof(tagint); bytes += (double)nmax * sizeof(double); return bytes; diff --git a/src/MC/fix_bond_swap.cpp b/src/MC/fix_bond_swap.cpp index eedf609a23..51334d6149 100644 --- a/src/MC/fix_bond_swap.cpp +++ b/src/MC/fix_bond_swap.cpp @@ -727,6 +727,6 @@ double FixBondSwap::compute_vector(int n) double FixBondSwap::memory_usage() { - double bytes = nmax * sizeof(int); + double bytes = (double)nmax * sizeof(int); return bytes; } diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index 79cfd09f96..0c61838f65 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -2515,7 +2515,7 @@ double FixGCMC::compute_vector(int n) double FixGCMC::memory_usage() { - double bytes = gcmc_nmax * sizeof(int); + double bytes = (double)gcmc_nmax * sizeof(int); return bytes; } diff --git a/src/MC/fix_widom.cpp b/src/MC/fix_widom.cpp index c06573ab1a..1b0af1ebfb 100644 --- a/src/MC/fix_widom.cpp +++ b/src/MC/fix_widom.cpp @@ -1177,7 +1177,7 @@ double FixWidom::compute_vector(int n) double FixWidom::memory_usage() { - double bytes = widom_nmax * sizeof(int); + double bytes = (double)widom_nmax * sizeof(int); return bytes; } diff --git a/src/MISC/fix_gld.cpp b/src/MISC/fix_gld.cpp index d78dd67bdb..3f6c3da258 100644 --- a/src/MISC/fix_gld.cpp +++ b/src/MISC/fix_gld.cpp @@ -487,7 +487,7 @@ void FixGLD::reset_dt() double FixGLD::memory_usage() { - double bytes = atom->nmax*3*prony_terms*sizeof(double); + double bytes = (double)atom->nmax*3*prony_terms*sizeof(double); return bytes; } diff --git a/src/MISC/fix_orient_bcc.cpp b/src/MISC/fix_orient_bcc.cpp index 85734b0a6c..c9ae5d632b 100644 --- a/src/MISC/fix_orient_bcc.cpp +++ b/src/MISC/fix_orient_bcc.cpp @@ -596,7 +596,7 @@ int FixOrientBCC::compare(const void *pi, const void *pj) double FixOrientBCC::memory_usage() { - double bytes = nmax * sizeof(Nbr); + double bytes = (double)nmax * sizeof(Nbr); bytes += (double)2*nmax * sizeof(double); return bytes; } diff --git a/src/MISC/fix_orient_fcc.cpp b/src/MISC/fix_orient_fcc.cpp index b46232c710..71b38b5258 100644 --- a/src/MISC/fix_orient_fcc.cpp +++ b/src/MISC/fix_orient_fcc.cpp @@ -594,7 +594,7 @@ int FixOrientFCC::compare(const void *pi, const void *pj) double FixOrientFCC::memory_usage() { - double bytes = nmax * sizeof(Nbr); + double bytes = (double)nmax * sizeof(Nbr); bytes += (double)2*nmax * sizeof(double); return bytes; } diff --git a/src/MLIAP/compute_mliap.cpp b/src/MLIAP/compute_mliap.cpp index 5b2d97d251..f119a64a49 100644 --- a/src/MLIAP/compute_mliap.cpp +++ b/src/MLIAP/compute_mliap.cpp @@ -357,7 +357,7 @@ void ComputeMLIAP::compute_array() double ComputeMLIAP::memory_usage() { - double bytes = size_array_rows*size_array_cols * + double bytes = (double)size_array_rows*size_array_cols * sizeof(double); // mliaparray bytes += (double)size_array_rows*size_array_cols * sizeof(double); // mliaparrayall diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp index b594c4770d..6966b5ac11 100644 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -1440,7 +1440,7 @@ int FixCMAP::unpack_exchange(int nlocal, double *buf) double FixCMAP::memory_usage() { int nmax = atom->nmax; - double bytes = nmax * sizeof(int); // num_crossterm + double bytes = (double)nmax * sizeof(int); // num_crossterm bytes += (double)nmax*CMAPMAX * sizeof(int); // crossterm_type bytes += (double)5*nmax*CMAPMAX * sizeof(int); // crossterm_atom 12345 bytes += (double)maxcrossterm*6 * sizeof(int); // crosstermlist diff --git a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp index 32b5332484..2bca4857a1 100644 --- a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp +++ b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp @@ -748,7 +748,7 @@ void *PairLJCutTIP4PCut::extract(const char *str, int &dim) double PairLJCutTIP4PCut::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)2 * nmax * sizeof(double); return bytes; diff --git a/src/MOLECULE/pair_tip4p_cut.cpp b/src/MOLECULE/pair_tip4p_cut.cpp index 82055aa55b..f208c17efd 100644 --- a/src/MOLECULE/pair_tip4p_cut.cpp +++ b/src/MOLECULE/pair_tip4p_cut.cpp @@ -550,7 +550,7 @@ void PairTIP4PCut::compute_newsite(double *xO, double *xH1, double PairTIP4PCut::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)2 * nmax * sizeof(double); return bytes; diff --git a/src/PERI/compute_damage_atom.cpp b/src/PERI/compute_damage_atom.cpp index 6b5d2556e8..17b0374e0a 100644 --- a/src/PERI/compute_damage_atom.cpp +++ b/src/PERI/compute_damage_atom.cpp @@ -120,6 +120,6 @@ void ComputeDamageAtom::compute_peratom() double ComputeDamageAtom::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/PERI/compute_dilatation_atom.cpp b/src/PERI/compute_dilatation_atom.cpp index 53c3bcef30..9ea03acd04 100644 --- a/src/PERI/compute_dilatation_atom.cpp +++ b/src/PERI/compute_dilatation_atom.cpp @@ -117,6 +117,6 @@ void ComputeDilatationAtom::compute_peratom() double ComputeDilatationAtom::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/PERI/compute_plasticity_atom.cpp b/src/PERI/compute_plasticity_atom.cpp index cac746c089..829f10e327 100644 --- a/src/PERI/compute_plasticity_atom.cpp +++ b/src/PERI/compute_plasticity_atom.cpp @@ -103,6 +103,6 @@ void ComputePlasticityAtom::compute_peratom() double ComputePlasticityAtom::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/PERI/pair_peri_pmb.cpp b/src/PERI/pair_peri_pmb.cpp index 1173648400..aeb977c999 100644 --- a/src/PERI/pair_peri_pmb.cpp +++ b/src/PERI/pair_peri_pmb.cpp @@ -493,6 +493,6 @@ double PairPeriPMB::single(int i, int j, int itype, int jtype, double rsq, double PairPeriPMB::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index 4379fa6bec..21fb4bc05e 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -1525,7 +1525,7 @@ void FixPOEMS::copy_arrays(int i, int j, int /* delflag */) double FixPOEMS::memory_usage() { int nmax = atom->nmax; - double bytes = nmax * sizeof(int); + double bytes = (double)nmax * sizeof(int); bytes += (double)nmax*MAXBODY * sizeof(int); bytes += (double)nmax*3 * sizeof(double); return bytes; diff --git a/src/REPLICA/fix_hyper_global.cpp b/src/REPLICA/fix_hyper_global.cpp index d29aa36e31..48dc0bed02 100644 --- a/src/REPLICA/fix_hyper_global.cpp +++ b/src/REPLICA/fix_hyper_global.cpp @@ -559,6 +559,6 @@ double FixHyperGlobal::query(int i) double FixHyperGlobal::memory_usage() { - double bytes = maxbond * sizeof(OneBond); // blist + double bytes = (double)maxbond * sizeof(OneBond); // blist return bytes; } diff --git a/src/REPLICA/fix_hyper_local.cpp b/src/REPLICA/fix_hyper_local.cpp index 5bca43fbe5..14a6c6089f 100644 --- a/src/REPLICA/fix_hyper_local.cpp +++ b/src/REPLICA/fix_hyper_local.cpp @@ -1731,7 +1731,7 @@ double FixHyperLocal::query(int i) double FixHyperLocal::memory_usage() { - double bytes = maxbond * sizeof(OneBond); // blist + double bytes = (double)maxbond * sizeof(OneBond); // blist bytes = maxbond * sizeof(double); // per-bond bias coeffs bytes += (double)3*maxlocal * sizeof(int); // numbond,maxhalf,eligible bytes += (double)maxlocal * sizeof(double); // maxhalfstrain diff --git a/src/REPLICA/verlet_split.cpp b/src/REPLICA/verlet_split.cpp index 384a8fd8dd..506d074eca 100644 --- a/src/REPLICA/verlet_split.cpp +++ b/src/REPLICA/verlet_split.cpp @@ -582,6 +582,6 @@ void VerletSplit::k2r_comm() double VerletSplit::memory_usage() { - double bytes = maxatom*3 * sizeof(double); + double bytes = (double)maxatom*3 * sizeof(double); return bytes; } diff --git a/src/RIGID/compute_rigid_local.cpp b/src/RIGID/compute_rigid_local.cpp index 823970d594..0a40062055 100644 --- a/src/RIGID/compute_rigid_local.cpp +++ b/src/RIGID/compute_rigid_local.cpp @@ -315,6 +315,6 @@ void ComputeRigidLocal::reallocate(int n) double ComputeRigidLocal::memory_usage() { - double bytes = nmax*nvalues * sizeof(double); + double bytes = (double)nmax*nvalues * sizeof(double); return bytes; } diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index b46cb1667f..a90782199e 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -2452,7 +2452,7 @@ void FixRigid::write_restart_file(const char *file) double FixRigid::memory_usage() { int nmax = atom->nmax; - double bytes = nmax * sizeof(int); + double bytes = (double)nmax * sizeof(int); bytes += (double)nmax * sizeof(imageint); bytes += (double)nmax*3 * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); // vatom diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 6a26de6083..a316d9fbdf 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -3567,7 +3567,7 @@ double FixRigidSmall::compute_scalar() double FixRigidSmall::memory_usage() { int nmax = atom->nmax; - double bytes = nmax*2 * sizeof(int); + double bytes = (double)nmax*2 * sizeof(int); bytes += (double)nmax * sizeof(imageint); bytes += (double)nmax*3 * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); // vatom diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index 2af6ed8440..7ce3f9ddf2 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -2678,7 +2678,7 @@ int FixShake::angletype_findset(int i, tagint n1, tagint n2, int setflag) double FixShake::memory_usage() { int nmax = atom->nmax; - double bytes = nmax * sizeof(int); + double bytes = (double)nmax * sizeof(int); bytes += (double)nmax*4 * sizeof(int); bytes += (double)nmax*3 * sizeof(int); bytes += (double)nmax*3 * sizeof(double); diff --git a/src/SNAP/compute_sna_atom.cpp b/src/SNAP/compute_sna_atom.cpp index 8e26d44f61..47679fd8cc 100644 --- a/src/SNAP/compute_sna_atom.cpp +++ b/src/SNAP/compute_sna_atom.cpp @@ -306,7 +306,7 @@ void ComputeSNAAtom::compute_peratom() double ComputeSNAAtom::memory_usage() { - double bytes = nmax*size_peratom_cols * sizeof(double); // sna + double bytes = (double)nmax*size_peratom_cols * sizeof(double); // sna bytes += snaptr->memory_usage(); // SNA object return bytes; diff --git a/src/SNAP/compute_snad_atom.cpp b/src/SNAP/compute_snad_atom.cpp index b9ab2f54ae..0e2a74eea0 100644 --- a/src/SNAP/compute_snad_atom.cpp +++ b/src/SNAP/compute_snad_atom.cpp @@ -406,7 +406,7 @@ void ComputeSNADAtom::unpack_reverse_comm(int n, int *list, double *buf) double ComputeSNADAtom::memory_usage() { - double bytes = nmax*size_peratom_cols * sizeof(double); // snad + double bytes = (double)nmax*size_peratom_cols * sizeof(double); // snad bytes += snaptr->memory_usage(); // SNA object return bytes; diff --git a/src/SNAP/compute_snap.cpp b/src/SNAP/compute_snap.cpp index ee37b24198..d7655dba5f 100644 --- a/src/SNAP/compute_snap.cpp +++ b/src/SNAP/compute_snap.cpp @@ -529,7 +529,7 @@ void ComputeSnap::dbdotr_compute() double ComputeSnap::memory_usage() { - double bytes = size_array_rows*size_array_cols * + double bytes = (double)size_array_rows*size_array_cols * sizeof(double); // snap bytes += (double)size_array_rows*size_array_cols * sizeof(double); // snapall diff --git a/src/SNAP/compute_snav_atom.cpp b/src/SNAP/compute_snav_atom.cpp index 42a54e6cb1..4a6fa3c717 100644 --- a/src/SNAP/compute_snav_atom.cpp +++ b/src/SNAP/compute_snav_atom.cpp @@ -415,7 +415,7 @@ void ComputeSNAVAtom::unpack_reverse_comm(int n, int *list, double *buf) double ComputeSNAVAtom::memory_usage() { - double bytes = nmax*size_peratom_cols * sizeof(double); // snav + double bytes = (double)nmax*size_peratom_cols * sizeof(double); // snav bytes += snaptr->memory_usage(); // SNA object return bytes; diff --git a/src/USER-ATC/fix_atc.cpp b/src/USER-ATC/fix_atc.cpp index 82fbfcc958..90ba43b0e8 100644 --- a/src/USER-ATC/fix_atc.cpp +++ b/src/USER-ATC/fix_atc.cpp @@ -627,7 +627,7 @@ void FixATC::min_pre_exchange() double FixATC::memory_usage() { - double bytes = (double) atc_->memory_usage() * sizeof(double); + double bytes = atc_->memory_usage() * sizeof(double); return bytes; } diff --git a/src/USER-AWPMD/pair_awpmd_cut.cpp b/src/USER-AWPMD/pair_awpmd_cut.cpp index b46bf75181..3d4e1f12a7 100644 --- a/src/USER-AWPMD/pair_awpmd_cut.cpp +++ b/src/USER-AWPMD/pair_awpmd_cut.cpp @@ -734,7 +734,7 @@ void PairAWPMDCut::min_x_set(int /* ignore */) double PairAWPMDCut::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)2 * nmax * sizeof(double); return bytes; diff --git a/src/USER-DPD/compute_dpd_atom.cpp b/src/USER-DPD/compute_dpd_atom.cpp index 8b203b4c0b..9053d8af31 100644 --- a/src/USER-DPD/compute_dpd_atom.cpp +++ b/src/USER-DPD/compute_dpd_atom.cpp @@ -97,6 +97,6 @@ void ComputeDpdAtom::compute_peratom() double ComputeDpdAtom::memory_usage() { - double bytes = size_peratom_cols * nmax * sizeof(double); + double bytes = (double)size_peratom_cols * nmax * sizeof(double); return bytes; } diff --git a/src/USER-EFF/compute_ke_atom_eff.cpp b/src/USER-EFF/compute_ke_atom_eff.cpp index e8ddba137e..c2342c4b5b 100644 --- a/src/USER-EFF/compute_ke_atom_eff.cpp +++ b/src/USER-EFF/compute_ke_atom_eff.cpp @@ -110,6 +110,6 @@ void ComputeKEAtomEff::compute_peratom() double ComputeKEAtomEff::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-EFF/compute_temp_deform_eff.cpp b/src/USER-EFF/compute_temp_deform_eff.cpp index 8baea0ac95..620a7eba21 100644 --- a/src/USER-EFF/compute_temp_deform_eff.cpp +++ b/src/USER-EFF/compute_temp_deform_eff.cpp @@ -319,6 +319,6 @@ void ComputeTempDeformEff::restore_bias_all() double ComputeTempDeformEff::memory_usage() { - double bytes = maxbias * sizeof(double); + double bytes = (double)maxbias * sizeof(double); return bytes; } diff --git a/src/USER-EFF/compute_temp_region_eff.cpp b/src/USER-EFF/compute_temp_region_eff.cpp index 645281d45a..1ca62f39d3 100644 --- a/src/USER-EFF/compute_temp_region_eff.cpp +++ b/src/USER-EFF/compute_temp_region_eff.cpp @@ -291,6 +291,6 @@ void ComputeTempRegionEff::restore_bias_all() double ComputeTempRegionEff::memory_usage() { - double bytes = maxbias * sizeof(double); + double bytes = (double)maxbias * sizeof(double); return bytes; } diff --git a/src/USER-EFF/pair_eff_cut.cpp b/src/USER-EFF/pair_eff_cut.cpp index f39c1d31af..2413a30635 100644 --- a/src/USER-EFF/pair_eff_cut.cpp +++ b/src/USER-EFF/pair_eff_cut.cpp @@ -1078,7 +1078,7 @@ void PairEffCut::min_x_set(int /*ignore*/) double PairEffCut::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)2 * nmax * sizeof(double); return bytes; diff --git a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp index c06bd69c48..f397328f9c 100644 --- a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp @@ -588,7 +588,7 @@ void *PairLJCutTIP4PLongSoft::extract(const char *str, int &dim) double PairLJCutTIP4PLongSoft::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)2 * nmax * sizeof(double); return bytes; diff --git a/src/USER-FEP/pair_tip4p_long_soft.cpp b/src/USER-FEP/pair_tip4p_long_soft.cpp index 47b9fe0a93..caecb36d99 100644 --- a/src/USER-FEP/pair_tip4p_long_soft.cpp +++ b/src/USER-FEP/pair_tip4p_long_soft.cpp @@ -510,7 +510,7 @@ void *PairTIP4PLongSoft::extract(const char *str, int &dim) double PairTIP4PLongSoft::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)2 * nmax * sizeof(double); return bytes; diff --git a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp index b139d8e6f2..9481c0d0f2 100644 --- a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp +++ b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp @@ -1430,7 +1430,7 @@ int FixLbRigidPCSphere::dof(int igroup) double FixLbRigidPCSphere::memory_usage() { int nmax = atom->nmax; - double bytes = nmax * sizeof(int); + double bytes = (double)nmax * sizeof(int); bytes += (double)nmax*3 * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); diff --git a/src/USER-MESODPD/compute_edpd_temp_atom.cpp b/src/USER-MESODPD/compute_edpd_temp_atom.cpp index e7ab79d550..383b5676c1 100644 --- a/src/USER-MESODPD/compute_edpd_temp_atom.cpp +++ b/src/USER-MESODPD/compute_edpd_temp_atom.cpp @@ -91,6 +91,6 @@ void ComputeEDPDTempAtom::compute_peratom() double ComputeEDPDTempAtom::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-MESODPD/compute_tdpd_cc_atom.cpp b/src/USER-MESODPD/compute_tdpd_cc_atom.cpp index e4f015db3e..d616dfca4d 100644 --- a/src/USER-MESODPD/compute_tdpd_cc_atom.cpp +++ b/src/USER-MESODPD/compute_tdpd_cc_atom.cpp @@ -94,6 +94,6 @@ void ComputeTDPDCCAtom::compute_peratom() double ComputeTDPDCCAtom::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-MESONT/compute_mesont.cpp b/src/USER-MESONT/compute_mesont.cpp index e78747697e..a20ed32f26 100644 --- a/src/USER-MESONT/compute_mesont.cpp +++ b/src/USER-MESONT/compute_mesont.cpp @@ -151,6 +151,6 @@ void ComputeMesoNT::unpack_reverse_comm(int n, int *list, double *buf) { ------------------------------------------------------------------------- */ double ComputeMesoNT::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-MISC/compute_ackland_atom.cpp b/src/USER-MISC/compute_ackland_atom.cpp index 6bebbc2c64..d4c5317c5c 100644 --- a/src/USER-MISC/compute_ackland_atom.cpp +++ b/src/USER-MISC/compute_ackland_atom.cpp @@ -462,6 +462,6 @@ void ComputeAcklandAtom::select2(int k, int n, double *arr, int *iarr) double ComputeAcklandAtom::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-MISC/compute_cnp_atom.cpp b/src/USER-MISC/compute_cnp_atom.cpp index c927d8e520..337bf271c4 100644 --- a/src/USER-MISC/compute_cnp_atom.cpp +++ b/src/USER-MISC/compute_cnp_atom.cpp @@ -323,7 +323,7 @@ void ComputeCNPAtom::compute_peratom() double ComputeCNPAtom::memory_usage() { - double bytes = nmax * sizeof(int); + double bytes = (double)nmax * sizeof(int); bytes += (double)nmax * MAXNEAR * sizeof(int); bytes += (double)nmax * sizeof(double); return bytes; diff --git a/src/USER-MISC/compute_hma.cpp b/src/USER-MISC/compute_hma.cpp index a67f4952a9..8220abebc4 100644 --- a/src/USER-MISC/compute_hma.cpp +++ b/src/USER-MISC/compute_hma.cpp @@ -497,6 +497,6 @@ void ComputeHMA::set_arrays(int i) double ComputeHMA::memory_usage() { - double bytes = nmax * 3 * sizeof(double); + double bytes = (double)nmax * 3 * sizeof(double); return bytes; } diff --git a/src/USER-MISC/compute_temp_rotate.cpp b/src/USER-MISC/compute_temp_rotate.cpp index da37a5639b..99cda02b74 100644 --- a/src/USER-MISC/compute_temp_rotate.cpp +++ b/src/USER-MISC/compute_temp_rotate.cpp @@ -294,6 +294,6 @@ void ComputeTempRotate::restore_bias_all() double ComputeTempRotate::memory_usage() { - double bytes = maxbias * sizeof(double); + double bytes = (double)maxbias * sizeof(double); return bytes; } diff --git a/src/USER-MISC/fix_ffl.cpp b/src/USER-MISC/fix_ffl.cpp index 061d5f4559..d07e211021 100644 --- a/src/USER-MISC/fix_ffl.cpp +++ b/src/USER-MISC/fix_ffl.cpp @@ -455,7 +455,7 @@ void FixFFL::reset_dt() { ------------------------------------------------------------------------- */ double FixFFL::memory_usage() { - double bytes = atom->nmax*(3*2)*sizeof(double); + double bytes = (double)atom->nmax*(3*2)*sizeof(double); return bytes; } diff --git a/src/USER-MISC/fix_gle.cpp b/src/USER-MISC/fix_gle.cpp index e091c3d80e..1f0fd70012 100644 --- a/src/USER-MISC/fix_gle.cpp +++ b/src/USER-MISC/fix_gle.cpp @@ -762,7 +762,7 @@ void FixGLE::reset_dt() double FixGLE::memory_usage() { - double bytes = atom->nmax*(3*ns+2*3*(ns+1))*sizeof(double); + double bytes = (double)atom->nmax*(3*ns+2*3*(ns+1))*sizeof(double); return bytes; } diff --git a/src/USER-MISC/fix_orient_eco.cpp b/src/USER-MISC/fix_orient_eco.cpp index 0594e9c5b4..1aab846597 100644 --- a/src/USER-MISC/fix_orient_eco.cpp +++ b/src/USER-MISC/fix_orient_eco.cpp @@ -474,7 +474,7 @@ void FixOrientECO::unpack_forward_comm(int n, int first, double *buf) { ------------------------------------------------------------------------- */ double FixOrientECO::memory_usage() { - double bytes = nmax * sizeof(Nbr); + double bytes = (double)nmax * sizeof(Nbr); bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/USER-MISC/fix_propel_self.cpp b/src/USER-MISC/fix_propel_self.cpp index a1e69ad179..0affa24ffe 100644 --- a/src/USER-MISC/fix_propel_self.cpp +++ b/src/USER-MISC/fix_propel_self.cpp @@ -130,7 +130,7 @@ int FixPropelSelf::setmask() double FixPropelSelf::memory_usage() { // magnitude + thermostat_orient + mode + n_types_filter + apply_to_type - double bytes = sizeof(double) + 3*sizeof(int) + sizeof(int*); + double bytes = (double)sizeof(double) + 3*sizeof(int) + sizeof(int*); bytes += (double)sizeof(int)*atom->ntypes*n_types_filter; return bytes; diff --git a/src/USER-MISC/fix_srp.cpp b/src/USER-MISC/fix_srp.cpp index 254a66f2f2..eb57da30e9 100644 --- a/src/USER-MISC/fix_srp.cpp +++ b/src/USER-MISC/fix_srp.cpp @@ -379,7 +379,7 @@ void FixSRP::pre_exchange() double FixSRP::memory_usage() { - double bytes = atom->nmax*2 * sizeof(double); + double bytes = (double)atom->nmax*2 * sizeof(double); return bytes; } diff --git a/src/USER-MISC/fix_ti_spring.cpp b/src/USER-MISC/fix_ti_spring.cpp index 5aac36a47b..ce30497295 100644 --- a/src/USER-MISC/fix_ti_spring.cpp +++ b/src/USER-MISC/fix_ti_spring.cpp @@ -261,7 +261,7 @@ double FixTISpring::compute_vector(int n) double FixTISpring::memory_usage() { - double bytes = atom->nmax*3 * sizeof(double); + double bytes = (double)atom->nmax*3 * sizeof(double); return bytes; } diff --git a/src/USER-MISC/pair_list.cpp b/src/USER-MISC/pair_list.cpp index 5b6729ff58..a3a3caa81d 100644 --- a/src/USER-MISC/pair_list.cpp +++ b/src/USER-MISC/pair_list.cpp @@ -409,7 +409,7 @@ double PairList::init_one(int, int) double PairList::memory_usage() { - double bytes = npairs * sizeof(int); + double bytes = (double)npairs * sizeof(int); bytes += (double)npairs * sizeof(list_parm_t); const int n = atom->ntypes+1; bytes += (double)n*(n*sizeof(int) + sizeof(int *)); diff --git a/src/USER-MISC/pair_local_density.cpp b/src/USER-MISC/pair_local_density.cpp index c85633e600..ec3c41a47b 100644 --- a/src/USER-MISC/pair_local_density.cpp +++ b/src/USER-MISC/pair_local_density.cpp @@ -881,7 +881,7 @@ void PairLocalDensity::unpack_reverse_comm(int n, int *list, double *buf) { double PairLocalDensity::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)2 * (nmax*nLD) * sizeof(double); return bytes; diff --git a/src/USER-PHONON/fix_phonon.cpp b/src/USER-PHONON/fix_phonon.cpp index 320a12d8f9..455ca80b12 100644 --- a/src/USER-PHONON/fix_phonon.cpp +++ b/src/USER-PHONON/fix_phonon.cpp @@ -424,7 +424,7 @@ void FixPhonon::end_of_step() double FixPhonon::memory_usage() { - double bytes = sizeof(double)*2*mynq + double bytes = (double)sizeof(double)*2*mynq + sizeof(std::map)*2*ngroup + sizeof(double)*(ngroup*(3*sysdim+2)+mynpt*fft_dim*2) + sizeof(std::complex)*MAX(1,mynq)*fft_dim *(1+2*fft_dim) diff --git a/src/USER-PTM/compute_ptm_atom.cpp b/src/USER-PTM/compute_ptm_atom.cpp index 593c7f9b5e..376253dd84 100644 --- a/src/USER-PTM/compute_ptm_atom.cpp +++ b/src/USER-PTM/compute_ptm_atom.cpp @@ -333,7 +333,7 @@ void ComputePTMAtom::compute_peratom() { ------------------------------------------------------------------------- */ double ComputePTMAtom::memory_usage() { - double bytes = nmax * NUM_COLUMNS * sizeof(double); + double bytes = (double)nmax * NUM_COLUMNS * sizeof(double); bytes += (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index f49374b0b8..86e7977d9b 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -3743,7 +3743,7 @@ memory usage of local atom-based arrays double FixBondReact::memory_usage() { int nmax = atom->nmax; - double bytes = nmax * sizeof(int); + double bytes = (double)nmax * sizeof(int); bytes = 2*nmax * sizeof(tagint); bytes += (double)nmax * sizeof(double); return bytes; diff --git a/src/USER-REAXC/compute_spec_atom.cpp b/src/USER-REAXC/compute_spec_atom.cpp index 5b5a6494e5..ebd7784c1c 100644 --- a/src/USER-REAXC/compute_spec_atom.cpp +++ b/src/USER-REAXC/compute_spec_atom.cpp @@ -172,7 +172,7 @@ void ComputeSpecAtom::compute_peratom() double ComputeSpecAtom::memory_usage() { - double bytes = nmax*nvalues * sizeof(double); + double bytes = (double)nmax*nvalues * sizeof(double); return bytes; } diff --git a/src/USER-REAXC/fix_reaxc.cpp b/src/USER-REAXC/fix_reaxc.cpp index a9793b8321..c178b32097 100644 --- a/src/USER-REAXC/fix_reaxc.cpp +++ b/src/USER-REAXC/fix_reaxc.cpp @@ -83,7 +83,7 @@ int FixReaxC::setmask() double FixReaxC::memory_usage() { int nmax = atom->nmax; - double bytes = nmax * 2 * sizeof(int); + double bytes = (double)nmax * 2 * sizeof(int); return bytes; } diff --git a/src/USER-SDPD/fix_meso_move.cpp b/src/USER-SDPD/fix_meso_move.cpp index 6721bcb70e..ddb4bbc3e8 100644 --- a/src/USER-SDPD/fix_meso_move.cpp +++ b/src/USER-SDPD/fix_meso_move.cpp @@ -799,7 +799,7 @@ void FixMesoMove::final_integrate () { ------------------------------------------------------------------------- */ double FixMesoMove::memory_usage () { - double bytes = atom->nmax*3 * sizeof(double); + double bytes = (double)atom->nmax*3 * sizeof(double); if (displaceflag) bytes += (double)atom->nmax*3 * sizeof(double); if (velocityflag) bytes += (double)atom->nmax*3 * sizeof(double); return bytes; diff --git a/src/USER-SMD/compute_smd_contact_radius.cpp b/src/USER-SMD/compute_smd_contact_radius.cpp index 3204c69a69..3f09b30b97 100644 --- a/src/USER-SMD/compute_smd_contact_radius.cpp +++ b/src/USER-SMD/compute_smd_contact_radius.cpp @@ -103,6 +103,6 @@ void ComputeSMDContactRadius::compute_peratom() double ComputeSMDContactRadius::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_damage.cpp b/src/USER-SMD/compute_smd_damage.cpp index 2636ee52c1..cf5b966dc0 100644 --- a/src/USER-SMD/compute_smd_damage.cpp +++ b/src/USER-SMD/compute_smd_damage.cpp @@ -103,6 +103,6 @@ void ComputeSMDDamage::compute_peratom() double ComputeSMDDamage::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_hourglass_error.cpp b/src/USER-SMD/compute_smd_hourglass_error.cpp index 9162eb447b..c226f526cd 100644 --- a/src/USER-SMD/compute_smd_hourglass_error.cpp +++ b/src/USER-SMD/compute_smd_hourglass_error.cpp @@ -107,6 +107,6 @@ void ComputeSMDHourglassError::compute_peratom() { ------------------------------------------------------------------------- */ double ComputeSMDHourglassError::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_internal_energy.cpp b/src/USER-SMD/compute_smd_internal_energy.cpp index 43273271fe..ccebe0ffdd 100644 --- a/src/USER-SMD/compute_smd_internal_energy.cpp +++ b/src/USER-SMD/compute_smd_internal_energy.cpp @@ -103,6 +103,6 @@ void ComputeSMDInternalEnergy::compute_peratom() double ComputeSMDInternalEnergy::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_plastic_strain.cpp b/src/USER-SMD/compute_smd_plastic_strain.cpp index 7cb40ab68a..375802fa6e 100644 --- a/src/USER-SMD/compute_smd_plastic_strain.cpp +++ b/src/USER-SMD/compute_smd_plastic_strain.cpp @@ -103,6 +103,6 @@ void ComputeSMDPlasticStrain::compute_peratom() double ComputeSMDPlasticStrain::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_plastic_strain_rate.cpp b/src/USER-SMD/compute_smd_plastic_strain_rate.cpp index d5d7ac7e16..ce24a4a4ee 100644 --- a/src/USER-SMD/compute_smd_plastic_strain_rate.cpp +++ b/src/USER-SMD/compute_smd_plastic_strain_rate.cpp @@ -103,6 +103,6 @@ void ComputeSMDPlasticStrainRate::compute_peratom() double ComputeSMDPlasticStrainRate::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_rho.cpp b/src/USER-SMD/compute_smd_rho.cpp index d97b1ecbe5..e570090e2a 100644 --- a/src/USER-SMD/compute_smd_rho.cpp +++ b/src/USER-SMD/compute_smd_rho.cpp @@ -101,6 +101,6 @@ void ComputeSMDRho::compute_peratom() { ------------------------------------------------------------------------- */ double ComputeSMDRho::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_tlsph_defgrad.cpp b/src/USER-SMD/compute_smd_tlsph_defgrad.cpp index 96e6a638b9..277df87eec 100644 --- a/src/USER-SMD/compute_smd_tlsph_defgrad.cpp +++ b/src/USER-SMD/compute_smd_tlsph_defgrad.cpp @@ -130,6 +130,6 @@ void ComputeSMDTLSPHDefgrad::compute_peratom() { ------------------------------------------------------------------------- */ double ComputeSMDTLSPHDefgrad::memory_usage() { - double bytes = size_peratom_cols * nmax * sizeof(double); + double bytes = (double)size_peratom_cols * nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_tlsph_dt.cpp b/src/USER-SMD/compute_smd_tlsph_dt.cpp index ee9f3e0db2..54de8a7cd4 100644 --- a/src/USER-SMD/compute_smd_tlsph_dt.cpp +++ b/src/USER-SMD/compute_smd_tlsph_dt.cpp @@ -110,6 +110,6 @@ void ComputeSMDTlsphDt::compute_peratom() { ------------------------------------------------------------------------- */ double ComputeSMDTlsphDt::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp b/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp index 796c16b369..6d77fc38da 100644 --- a/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp +++ b/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp @@ -102,6 +102,6 @@ void ComputeSMDTLSPHNumNeighs::compute_peratom() { ------------------------------------------------------------------------- */ double ComputeSMDTLSPHNumNeighs::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_tlsph_shape.cpp b/src/USER-SMD/compute_smd_tlsph_shape.cpp index 2dce1fbd3a..a32c15af28 100644 --- a/src/USER-SMD/compute_smd_tlsph_shape.cpp +++ b/src/USER-SMD/compute_smd_tlsph_shape.cpp @@ -130,6 +130,6 @@ void ComputeSmdTlsphShape::compute_peratom() { ------------------------------------------------------------------------- */ double ComputeSmdTlsphShape::memory_usage() { - double bytes = size_peratom_cols * nmax * sizeof(double); + double bytes = (double)size_peratom_cols * nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_tlsph_strain.cpp b/src/USER-SMD/compute_smd_tlsph_strain.cpp index f2f7bc2044..c3eae3bfe9 100644 --- a/src/USER-SMD/compute_smd_tlsph_strain.cpp +++ b/src/USER-SMD/compute_smd_tlsph_strain.cpp @@ -139,6 +139,6 @@ void ComputeSMDTLSPHstrain::compute_peratom() { ------------------------------------------------------------------------- */ double ComputeSMDTLSPHstrain::memory_usage() { - double bytes = size_peratom_cols * nmax * sizeof(double); + double bytes = (double)size_peratom_cols * nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp b/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp index aa1f490afb..e6de94abf9 100644 --- a/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp +++ b/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp @@ -112,6 +112,6 @@ void ComputeSMDTLSPHStrainRate::compute_peratom() { ------------------------------------------------------------------------- */ double ComputeSMDTLSPHStrainRate::memory_usage() { - double bytes = size_peratom_cols * nmax * sizeof(double); + double bytes = (double)size_peratom_cols * nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_tlsph_stress.cpp b/src/USER-SMD/compute_smd_tlsph_stress.cpp index 8314b4cbea..26bb78a1db 100644 --- a/src/USER-SMD/compute_smd_tlsph_stress.cpp +++ b/src/USER-SMD/compute_smd_tlsph_stress.cpp @@ -129,6 +129,6 @@ void ComputeSMDTLSPHStress::compute_peratom() { ------------------------------------------------------------------------- */ double ComputeSMDTLSPHStress::memory_usage() { - double bytes = size_peratom_cols * nmax * sizeof(double); + double bytes = (double)size_peratom_cols * nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_triangle_vertices.cpp b/src/USER-SMD/compute_smd_triangle_vertices.cpp index c487e60872..6b949196f9 100644 --- a/src/USER-SMD/compute_smd_triangle_vertices.cpp +++ b/src/USER-SMD/compute_smd_triangle_vertices.cpp @@ -118,6 +118,6 @@ void ComputeSMDTriangleVertices::compute_peratom() { ------------------------------------------------------------------------- */ double ComputeSMDTriangleVertices::memory_usage() { - double bytes = size_peratom_cols * nmax * sizeof(double); + double bytes = (double)size_peratom_cols * nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_ulsph_effm.cpp b/src/USER-SMD/compute_smd_ulsph_effm.cpp index c1668f2932..c3fdd5bab9 100644 --- a/src/USER-SMD/compute_smd_ulsph_effm.cpp +++ b/src/USER-SMD/compute_smd_ulsph_effm.cpp @@ -110,6 +110,6 @@ void ComputeSMD_Ulsph_Effm::compute_peratom() { ------------------------------------------------------------------------- */ double ComputeSMD_Ulsph_Effm::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp b/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp index 54b300a261..ff40172dea 100644 --- a/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp +++ b/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp @@ -102,6 +102,6 @@ void ComputeSMDULSPHNumNeighs::compute_peratom() { ------------------------------------------------------------------------- */ double ComputeSMDULSPHNumNeighs::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_ulsph_strain.cpp b/src/USER-SMD/compute_smd_ulsph_strain.cpp index 3a45301033..fc4d0c6ecf 100644 --- a/src/USER-SMD/compute_smd_ulsph_strain.cpp +++ b/src/USER-SMD/compute_smd_ulsph_strain.cpp @@ -108,6 +108,6 @@ void ComputeSMDULSPHstrain::compute_peratom() { ------------------------------------------------------------------------- */ double ComputeSMDULSPHstrain::memory_usage() { - double bytes = size_peratom_cols * nmax * sizeof(double); + double bytes = (double)size_peratom_cols * nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp b/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp index 13c6a59aa1..dfd746b332 100644 --- a/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp +++ b/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp @@ -119,6 +119,6 @@ void ComputeSMDULSPHStrainRate::compute_peratom() { ------------------------------------------------------------------------- */ double ComputeSMDULSPHStrainRate::memory_usage() { - double bytes = size_peratom_cols * nmax * sizeof(double); + double bytes = (double)size_peratom_cols * nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_ulsph_stress.cpp b/src/USER-SMD/compute_smd_ulsph_stress.cpp index 18c23cc073..6a5363136e 100644 --- a/src/USER-SMD/compute_smd_ulsph_stress.cpp +++ b/src/USER-SMD/compute_smd_ulsph_stress.cpp @@ -130,7 +130,7 @@ void ComputeSMDULSPHStress::compute_peratom() { ------------------------------------------------------------------------- */ double ComputeSMDULSPHStress::memory_usage() { - double bytes = size_peratom_cols * nmax * sizeof(double); + double bytes = (double)size_peratom_cols * nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMD/compute_smd_vol.cpp b/src/USER-SMD/compute_smd_vol.cpp index 9590417747..410fc145f9 100644 --- a/src/USER-SMD/compute_smd_vol.cpp +++ b/src/USER-SMD/compute_smd_vol.cpp @@ -125,6 +125,6 @@ double ComputeSMDVol::compute_scalar() { ------------------------------------------------------------------------- */ double ComputeSMDVol::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-SMTBQ/pair_smtbq.cpp b/src/USER-SMTBQ/pair_smtbq.cpp index f32d2e0c98..7ed37fefc4 100644 --- a/src/USER-SMTBQ/pair_smtbq.cpp +++ b/src/USER-SMTBQ/pair_smtbq.cpp @@ -3524,7 +3524,7 @@ void PairSMTBQ::reverse_int(int *tab) double PairSMTBQ::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)nmax * sizeof(int); bytes += (double)MAXNEIGH * nmax * sizeof(int); diff --git a/src/USER-SPH/compute_sph_e_atom.cpp b/src/USER-SPH/compute_sph_e_atom.cpp index f8297f2c32..249de1498b 100644 --- a/src/USER-SPH/compute_sph_e_atom.cpp +++ b/src/USER-SPH/compute_sph_e_atom.cpp @@ -93,6 +93,6 @@ void ComputeSPHEAtom::compute_peratom() double ComputeSPHEAtom::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-SPH/compute_sph_rho_atom.cpp b/src/USER-SPH/compute_sph_rho_atom.cpp index ebd11c906d..76f46ccdd7 100644 --- a/src/USER-SPH/compute_sph_rho_atom.cpp +++ b/src/USER-SPH/compute_sph_rho_atom.cpp @@ -94,6 +94,6 @@ void ComputeSPHRhoAtom::compute_peratom() double ComputeSPHRhoAtom::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-SPH/compute_sph_t_atom.cpp b/src/USER-SPH/compute_sph_t_atom.cpp index 9369a19faf..d33630c227 100644 --- a/src/USER-SPH/compute_sph_t_atom.cpp +++ b/src/USER-SPH/compute_sph_t_atom.cpp @@ -96,6 +96,6 @@ void ComputeSPHTAtom::compute_peratom() double ComputeSPHTAtom::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/VORONOI/compute_voronoi_atom.cpp b/src/VORONOI/compute_voronoi_atom.cpp index 63158d4a6b..bcd9031b6e 100644 --- a/src/VORONOI/compute_voronoi_atom.cpp +++ b/src/VORONOI/compute_voronoi_atom.cpp @@ -614,7 +614,7 @@ void ComputeVoronoi::processCell(voronoicell_neighbor &c, int i) double ComputeVoronoi::memory_usage() { - double bytes = size_peratom_cols * nmax * sizeof(double); + double bytes = (double)size_peratom_cols * nmax * sizeof(double); // estimate based on average coordination of 12 if (faces_flag) bytes += (double)12 * size_local_cols * nmax * sizeof(double); return bytes; diff --git a/src/angle.cpp b/src/angle.cpp index 17ece68755..110608a867 100644 --- a/src/angle.cpp +++ b/src/angle.cpp @@ -350,7 +350,7 @@ void Angle::ev_tally(int i, int j, int k, int nlocal, int newton_bond, double Angle::memory_usage() { - double bytes = comm->nthreads*maxeatom * sizeof(double); + double bytes = (double)comm->nthreads*maxeatom * sizeof(double); bytes += (double)comm->nthreads*maxvatom*6 * sizeof(double); bytes += (double)comm->nthreads*maxcvatom*9 * sizeof(double); return bytes; diff --git a/src/angle_hybrid.cpp b/src/angle_hybrid.cpp index 98d9bb9762..1e4ade3ca8 100644 --- a/src/angle_hybrid.cpp +++ b/src/angle_hybrid.cpp @@ -391,7 +391,7 @@ double AngleHybrid::single(int type, int i1, int i2, int i3) double AngleHybrid::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)maxcvatom*9 * sizeof(double); for (int m = 0; m < nstyles; m++) bytes += (double)maxangle[m]*4 * sizeof(int); diff --git a/src/bond.cpp b/src/bond.cpp index e8d220d104..1db4681c71 100644 --- a/src/bond.cpp +++ b/src/bond.cpp @@ -329,7 +329,7 @@ void Bond::write_file(int narg, char **arg) double Bond::memory_usage() { - double bytes = comm->nthreads*maxeatom * sizeof(double); + double bytes = (double)comm->nthreads*maxeatom * sizeof(double); bytes += (double)comm->nthreads*maxvatom*6 * sizeof(double); return bytes; } diff --git a/src/bond_hybrid.cpp b/src/bond_hybrid.cpp index ec275ce0a4..3a6bb4b7de 100644 --- a/src/bond_hybrid.cpp +++ b/src/bond_hybrid.cpp @@ -386,7 +386,7 @@ double BondHybrid::single(int type, double rsq, int i, int j, double BondHybrid::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); for (int m = 0; m < nstyles; m++) bytes += (double)maxbond[m]*3 * sizeof(int); for (int m = 0; m < nstyles; m++) diff --git a/src/compute_aggregate_atom.cpp b/src/compute_aggregate_atom.cpp index 7380c02487..212195eb1a 100644 --- a/src/compute_aggregate_atom.cpp +++ b/src/compute_aggregate_atom.cpp @@ -312,6 +312,6 @@ void ComputeAggregateAtom::unpack_reverse_comm(int n, int *list, double *buf) double ComputeAggregateAtom::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/compute_angle_local.cpp b/src/compute_angle_local.cpp index f4dab647fe..8e24eccf01 100644 --- a/src/compute_angle_local.cpp +++ b/src/compute_angle_local.cpp @@ -343,6 +343,6 @@ void ComputeAngleLocal::reallocate(int n) double ComputeAngleLocal::memory_usage() { - double bytes = nmax*nvalues * sizeof(double); + double bytes = (double)nmax*nvalues * sizeof(double); return bytes; } diff --git a/src/compute_bond_local.cpp b/src/compute_bond_local.cpp index 06d351b7c6..d13f313aea 100644 --- a/src/compute_bond_local.cpp +++ b/src/compute_bond_local.cpp @@ -498,6 +498,6 @@ void ComputeBondLocal::reallocate(int n) double ComputeBondLocal::memory_usage() { - double bytes = nmax*nvalues * sizeof(double); + double bytes = (double)nmax*nvalues * sizeof(double); return bytes; } diff --git a/src/compute_centro_atom.cpp b/src/compute_centro_atom.cpp index a8669efb28..9d40fa0fd5 100644 --- a/src/compute_centro_atom.cpp +++ b/src/compute_centro_atom.cpp @@ -436,7 +436,7 @@ void ComputeCentroAtom::select2(int k, int n, double *arr, int *iarr) double ComputeCentroAtom::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); if (axes_flag) bytes += (double)size_peratom_cols*nmax * sizeof(double); return bytes; } diff --git a/src/compute_centroid_stress_atom.cpp b/src/compute_centroid_stress_atom.cpp index 1b814961a0..cf3a308190 100644 --- a/src/compute_centroid_stress_atom.cpp +++ b/src/compute_centroid_stress_atom.cpp @@ -464,6 +464,6 @@ void ComputeCentroidStressAtom::unpack_reverse_comm(int n, int *list, double *bu double ComputeCentroidStressAtom::memory_usage() { - double bytes = nmax*9 * sizeof(double); + double bytes = (double)nmax*9 * sizeof(double); return bytes; } diff --git a/src/compute_chunk_spread_atom.cpp b/src/compute_chunk_spread_atom.cpp index 67f7e304a3..257e5d0960 100644 --- a/src/compute_chunk_spread_atom.cpp +++ b/src/compute_chunk_spread_atom.cpp @@ -322,6 +322,6 @@ void ComputeChunkSpreadAtom::compute_peratom() double ComputeChunkSpreadAtom::memory_usage() { - double bytes = nmax*nvalues * sizeof(double); + double bytes = (double)nmax*nvalues * sizeof(double); return bytes; } diff --git a/src/compute_cluster_atom.cpp b/src/compute_cluster_atom.cpp index 2056ff99a8..4de5a2321c 100644 --- a/src/compute_cluster_atom.cpp +++ b/src/compute_cluster_atom.cpp @@ -267,6 +267,6 @@ void ComputeClusterAtom::unpack_forward_comm(int n, int first, double *buf) double ComputeClusterAtom::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/compute_cna_atom.cpp b/src/compute_cna_atom.cpp index f629508bde..8b857444e5 100644 --- a/src/compute_cna_atom.cpp +++ b/src/compute_cna_atom.cpp @@ -355,7 +355,7 @@ void ComputeCNAAtom::compute_peratom() double ComputeCNAAtom::memory_usage() { - double bytes = nmax * sizeof(int); + double bytes = (double)nmax * sizeof(int); bytes += (double)nmax * MAXNEAR * sizeof(int); bytes += (double)nmax * sizeof(double); return bytes; diff --git a/src/compute_contact_atom.cpp b/src/compute_contact_atom.cpp index f87d49c439..272c677333 100644 --- a/src/compute_contact_atom.cpp +++ b/src/compute_contact_atom.cpp @@ -188,6 +188,6 @@ void ComputeContactAtom::unpack_reverse_comm(int n, int *list, double *buf) double ComputeContactAtom::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/compute_coord_atom.cpp b/src/compute_coord_atom.cpp index 686c58e8d9..3055fb96ac 100644 --- a/src/compute_coord_atom.cpp +++ b/src/compute_coord_atom.cpp @@ -355,6 +355,6 @@ void ComputeCoordAtom::unpack_forward_comm(int n, int first, double *buf) double ComputeCoordAtom::memory_usage() { - double bytes = ncol*nmax * sizeof(double); + double bytes = (double)ncol*nmax * sizeof(double); return bytes; } diff --git a/src/compute_dihedral_local.cpp b/src/compute_dihedral_local.cpp index d895bd33ec..d6fa722e26 100644 --- a/src/compute_dihedral_local.cpp +++ b/src/compute_dihedral_local.cpp @@ -353,6 +353,6 @@ void ComputeDihedralLocal::reallocate(int n) double ComputeDihedralLocal::memory_usage() { - double bytes = nmax*nvalues * sizeof(double); + double bytes = (double)nmax*nvalues * sizeof(double); return bytes; } diff --git a/src/compute_displace_atom.cpp b/src/compute_displace_atom.cpp index cb1bb30275..445caa15dc 100644 --- a/src/compute_displace_atom.cpp +++ b/src/compute_displace_atom.cpp @@ -247,7 +247,7 @@ void ComputeDisplaceAtom::refresh() double ComputeDisplaceAtom::memory_usage() { - double bytes = nmax*4 * sizeof(double); + double bytes = (double)nmax*4 * sizeof(double); bytes += (double)nvmax * sizeof(double); return bytes; } diff --git a/src/compute_erotate_sphere_atom.cpp b/src/compute_erotate_sphere_atom.cpp index ca15a5d917..cdedfd3509 100644 --- a/src/compute_erotate_sphere_atom.cpp +++ b/src/compute_erotate_sphere_atom.cpp @@ -105,6 +105,6 @@ void ComputeErotateSphereAtom::compute_peratom() double ComputeErotateSphereAtom::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/compute_fragment_atom.cpp b/src/compute_fragment_atom.cpp index b7ed6c31d1..b0ad8e5e60 100644 --- a/src/compute_fragment_atom.cpp +++ b/src/compute_fragment_atom.cpp @@ -285,7 +285,7 @@ void ComputeFragmentAtom::unpack_forward_comm(int n, int first, double *buf) double ComputeFragmentAtom::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); bytes += (double)3*nmax * sizeof(int); return bytes; } diff --git a/src/compute_global_atom.cpp b/src/compute_global_atom.cpp index cc5aaf24c4..8745ef82b4 100644 --- a/src/compute_global_atom.cpp +++ b/src/compute_global_atom.cpp @@ -483,7 +483,7 @@ void ComputeGlobalAtom::compute_peratom() double ComputeGlobalAtom::memory_usage() { - double bytes = nmax*nvalues * sizeof(double); + double bytes = (double)nmax*nvalues * sizeof(double); bytes += (double)nmax * sizeof(int); // indices if (varatom) bytes += (double)nmax * sizeof(double); // varatom bytes += (double)maxvector * sizeof(double); // vecglobal diff --git a/src/compute_hexorder_atom.cpp b/src/compute_hexorder_atom.cpp index 4c50b227ab..827d8d3692 100644 --- a/src/compute_hexorder_atom.cpp +++ b/src/compute_hexorder_atom.cpp @@ -338,7 +338,7 @@ void ComputeHexOrderAtom::select2(int k, int n, double *arr, int *iarr) double ComputeHexOrderAtom::memory_usage() { - double bytes = ncol*nmax * sizeof(double); + double bytes = (double)ncol*nmax * sizeof(double); bytes += (double)maxneigh * sizeof(double); bytes += (double)maxneigh * sizeof(int); diff --git a/src/compute_improper_local.cpp b/src/compute_improper_local.cpp index fd1b2dcfab..5d78e585e8 100644 --- a/src/compute_improper_local.cpp +++ b/src/compute_improper_local.cpp @@ -251,6 +251,6 @@ void ComputeImproperLocal::reallocate(int n) double ComputeImproperLocal::memory_usage() { - double bytes = nmax*nvalues * sizeof(double); + double bytes = (double)nmax*nvalues * sizeof(double); return bytes; } diff --git a/src/compute_ke_atom.cpp b/src/compute_ke_atom.cpp index c010041545..17dbd82ee1 100644 --- a/src/compute_ke_atom.cpp +++ b/src/compute_ke_atom.cpp @@ -103,6 +103,6 @@ void ComputeKEAtom::compute_peratom() double ComputeKEAtom::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/compute_orientorder_atom.cpp b/src/compute_orientorder_atom.cpp index 21baaf008a..eb5a96b706 100644 --- a/src/compute_orientorder_atom.cpp +++ b/src/compute_orientorder_atom.cpp @@ -331,7 +331,7 @@ void ComputeOrientOrderAtom::compute_peratom() double ComputeOrientOrderAtom::memory_usage() { - double bytes = ncol*nmax * sizeof(double); + double bytes = (double)ncol*nmax * sizeof(double); bytes += (double)(qmax*(2*qmax+1)+maxneigh*4) * sizeof(double); bytes += (double)(nqlist+maxneigh) * sizeof(int); return bytes; diff --git a/src/compute_pair_local.cpp b/src/compute_pair_local.cpp index 6ca6177b90..6bc1d7b6cb 100644 --- a/src/compute_pair_local.cpp +++ b/src/compute_pair_local.cpp @@ -322,6 +322,6 @@ void ComputePairLocal::reallocate(int n) double ComputePairLocal::memory_usage() { - double bytes = nmax*nvalues * sizeof(double); + double bytes = (double)nmax*nvalues * sizeof(double); return bytes; } diff --git a/src/compute_pe_atom.cpp b/src/compute_pe_atom.cpp index 52e132a626..7c8f786397 100644 --- a/src/compute_pe_atom.cpp +++ b/src/compute_pe_atom.cpp @@ -200,6 +200,6 @@ void ComputePEAtom::unpack_reverse_comm(int n, int *list, double *buf) double ComputePEAtom::memory_usage() { - double bytes = nmax * sizeof(double); + double bytes = (double)nmax * sizeof(double); return bytes; } diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp index ef8888daf7..cb7cbca0b8 100644 --- a/src/compute_property_atom.cpp +++ b/src/compute_property_atom.cpp @@ -453,7 +453,7 @@ void ComputePropertyAtom::compute_peratom() double ComputePropertyAtom::memory_usage() { - double bytes = nmax*nvalues * sizeof(double); + double bytes = (double)nmax*nvalues * sizeof(double); return bytes; } diff --git a/src/compute_property_local.cpp b/src/compute_property_local.cpp index 365995f863..b7b1d711c3 100644 --- a/src/compute_property_local.cpp +++ b/src/compute_property_local.cpp @@ -650,7 +650,7 @@ void ComputePropertyLocal::reallocate(int n) double ComputePropertyLocal::memory_usage() { - double bytes = nmax*nvalues * sizeof(double); + double bytes = (double)nmax*nvalues * sizeof(double); bytes += (double)nmax*2 * sizeof(int); return bytes; } diff --git a/src/compute_reduce.cpp b/src/compute_reduce.cpp index 3efb4adbed..82d3dff458 100644 --- a/src/compute_reduce.cpp +++ b/src/compute_reduce.cpp @@ -662,6 +662,6 @@ void ComputeReduce::combine(double &one, double two, int i) double ComputeReduce::memory_usage() { - double bytes = maxatom * sizeof(double); + double bytes = (double)maxatom * sizeof(double); return bytes; } diff --git a/src/compute_stress_atom.cpp b/src/compute_stress_atom.cpp index f918f7f293..b7cee8957d 100644 --- a/src/compute_stress_atom.cpp +++ b/src/compute_stress_atom.cpp @@ -382,6 +382,6 @@ void ComputeStressAtom::unpack_reverse_comm(int n, int *list, double *buf) double ComputeStressAtom::memory_usage() { - double bytes = nmax*6 * sizeof(double); + double bytes = (double)nmax*6 * sizeof(double); return bytes; } diff --git a/src/compute_temp_profile.cpp b/src/compute_temp_profile.cpp index 6f705d077f..6938560359 100644 --- a/src/compute_temp_profile.cpp +++ b/src/compute_temp_profile.cpp @@ -577,7 +577,7 @@ void ComputeTempProfile::bin_assign() double ComputeTempProfile::memory_usage() { - double bytes = maxatom * sizeof(int); + double bytes = (double)maxatom * sizeof(int); bytes += (double)nbins*ncount * sizeof(double); return bytes; } diff --git a/src/dihedral.cpp b/src/dihedral.cpp index 2932bcbe2f..2fe354b7ab 100644 --- a/src/dihedral.cpp +++ b/src/dihedral.cpp @@ -390,7 +390,7 @@ void Dihedral::ev_tally(int i1, int i2, int i3, int i4, double Dihedral::memory_usage() { - double bytes = comm->nthreads*maxeatom * sizeof(double); + double bytes = (double)comm->nthreads*maxeatom * sizeof(double); bytes += (double)comm->nthreads*maxvatom*6 * sizeof(double); bytes += (double)comm->nthreads*maxcvatom*9 * sizeof(double); return bytes; diff --git a/src/dihedral_hybrid.cpp b/src/dihedral_hybrid.cpp index dbad92868d..c30c0705f6 100644 --- a/src/dihedral_hybrid.cpp +++ b/src/dihedral_hybrid.cpp @@ -354,7 +354,7 @@ void DihedralHybrid::read_restart(FILE *fp) double DihedralHybrid::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)maxcvatom*9 * sizeof(double); for (int m = 0; m < nstyles; m++) bytes += (double)maxdihedral[m]*5 * sizeof(int); diff --git a/src/fix_ave_chunk.cpp b/src/fix_ave_chunk.cpp index 32cba42c9c..c65e0030c5 100644 --- a/src/fix_ave_chunk.cpp +++ b/src/fix_ave_chunk.cpp @@ -1131,7 +1131,7 @@ bigint FixAveChunk::nextvalid() double FixAveChunk::memory_usage() { - double bytes = maxvar * sizeof(double); // varatom + double bytes = (double)maxvar * sizeof(double); // varatom bytes += (double)4*maxchunk * sizeof(double); // count one,many,sum,total bytes += (double)nvalues*maxchunk * sizeof(double); // values one,many,sum,total bytes += (double)nwindow*maxchunk * sizeof(double); // count_list diff --git a/src/fix_move.cpp b/src/fix_move.cpp index abea871935..647a33a5ca 100644 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -964,7 +964,7 @@ void FixMove::final_integrate_respa(int ilevel, int /*iloop*/) double FixMove::memory_usage() { - double bytes = atom->nmax*3 * sizeof(double); + double bytes = (double)atom->nmax*3 * sizeof(double); if (theta_flag) bytes += (double)atom->nmax * sizeof(double); if (quat_flag) bytes += (double)atom->nmax*4 * sizeof(double); if (displaceflag) bytes += (double)atom->nmax*3 * sizeof(double); diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp index 2098382161..cccf6ad0a2 100644 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -672,7 +672,7 @@ void FixNeighHistory::post_run() double FixNeighHistory::memory_usage() { int nmax = atom->nmax; - double bytes = nmax * sizeof(int); // npartner + double bytes = (double)nmax * sizeof(int); // npartner bytes += (double)nmax * sizeof(tagint *); // partner bytes += (double)nmax * sizeof(double *); // valuepartner bytes += (double)maxatom * sizeof(int *); // firstflag diff --git a/src/fix_read_restart.cpp b/src/fix_read_restart.cpp index 7ff816ea37..3c7ef4c564 100644 --- a/src/fix_read_restart.cpp +++ b/src/fix_read_restart.cpp @@ -76,7 +76,7 @@ int FixReadRestart::setmask() double FixReadRestart::memory_usage() { - double bytes = atom->nmax*nextra * sizeof(double); + double bytes = (double)atom->nmax*nextra * sizeof(double); bytes += (double)atom->nmax * sizeof(int); return bytes; } diff --git a/src/fix_respa.cpp b/src/fix_respa.cpp index f2dc7d69d3..99b3c18843 100644 --- a/src/fix_respa.cpp +++ b/src/fix_respa.cpp @@ -74,7 +74,7 @@ int FixRespa::setmask() double FixRespa::memory_usage() { - double bytes = atom->nmax*nlevels*3 * sizeof(double); + double bytes = (double)atom->nmax*nlevels*3 * sizeof(double); if (store_torque) bytes += (double)atom->nmax*nlevels*3 * sizeof(double); return bytes; } diff --git a/src/fix_spring_self.cpp b/src/fix_spring_self.cpp index 50d09acf50..79046e09f7 100644 --- a/src/fix_spring_self.cpp +++ b/src/fix_spring_self.cpp @@ -210,7 +210,7 @@ double FixSpringSelf::compute_scalar() double FixSpringSelf::memory_usage() { - double bytes = atom->nmax*3 * sizeof(double); + double bytes = (double)atom->nmax*3 * sizeof(double); return bytes; } diff --git a/src/fix_store_force.cpp b/src/fix_store_force.cpp index 10c4cc2496..460422aee9 100644 --- a/src/fix_store_force.cpp +++ b/src/fix_store_force.cpp @@ -135,6 +135,6 @@ void FixStoreForce::min_post_force(int vflag) double FixStoreForce::memory_usage() { - double bytes = atom->nmax*3 * sizeof(double); + double bytes = (double)atom->nmax*3 * sizeof(double); return bytes; } diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp index 639012a735..fff7133edb 100644 --- a/src/fix_store_state.cpp +++ b/src/fix_store_state.cpp @@ -537,7 +537,7 @@ void FixStoreState::end_of_step() double FixStoreState::memory_usage() { - double bytes = atom->nmax*nvalues * sizeof(double); + double bytes = (double)atom->nmax*nvalues * sizeof(double); return bytes; } diff --git a/src/improper.cpp b/src/improper.cpp index 8e24c98116..bab1b91fbf 100644 --- a/src/improper.cpp +++ b/src/improper.cpp @@ -388,7 +388,7 @@ void Improper::ev_tally(int i1, int i2, int i3, int i4, double Improper::memory_usage() { - double bytes = comm->nthreads*maxeatom * sizeof(double); + double bytes = (double)comm->nthreads*maxeatom * sizeof(double); bytes += (double)comm->nthreads*maxvatom*6 * sizeof(double); return bytes; } diff --git a/src/improper_hybrid.cpp b/src/improper_hybrid.cpp index 66ec692d4b..fd5d76049b 100644 --- a/src/improper_hybrid.cpp +++ b/src/improper_hybrid.cpp @@ -350,7 +350,7 @@ void ImproperHybrid::read_restart(FILE *fp) double ImproperHybrid::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)maxcvatom*9 * sizeof(double); for (int m = 0; m < nstyles; m++) bytes += (double)maximproper[m]*5 * sizeof(int); diff --git a/src/my_pool_chunk.cpp b/src/my_pool_chunk.cpp index c58bb5c209..8bf40840fe 100644 --- a/src/my_pool_chunk.cpp +++ b/src/my_pool_chunk.cpp @@ -211,7 +211,7 @@ void MyPoolChunk::allocate(int ibin) { template double MyPoolChunk::size() const { - double bytes = npage*chunkperpage*sizeof(int); + double bytes = (double)npage*chunkperpage*sizeof(int); bytes += (double)npage*sizeof(T *); bytes += (double)npage*sizeof(int); for (int i=0; i < npage; ++i) diff --git a/src/pair.cpp b/src/pair.cpp index d9e7304ba3..739d364e57 100644 --- a/src/pair.cpp +++ b/src/pair.cpp @@ -1836,7 +1836,7 @@ void Pair::hessian_twobody(double fforce, double dfac, double delr[3], double ph double Pair::memory_usage() { - double bytes = comm->nthreads*maxeatom * sizeof(double); + double bytes = (double)comm->nthreads*maxeatom * sizeof(double); bytes += (double)comm->nthreads*maxvatom*6 * sizeof(double); bytes += (double)comm->nthreads*maxcvatom*9 * sizeof(double); return bytes; diff --git a/src/pair_coul_streitz.cpp b/src/pair_coul_streitz.cpp index 941bc8c83d..0b6e6513a3 100644 --- a/src/pair_coul_streitz.cpp +++ b/src/pair_coul_streitz.cpp @@ -736,7 +736,7 @@ void PairCoulStreitz::ewald_sum(double qi, double qj, double zj, double r, double PairCoulStreitz::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)nmax * sizeof(int); bytes += (double)MAXNEIGH * nmax * sizeof(int); diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index fc8f24defd..377364b8e5 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -1078,7 +1078,7 @@ int PairHybrid::check_ijtype(int itype, int jtype, char *substyle) double PairHybrid::memory_usage() { - double bytes = maxeatom * sizeof(double); + double bytes = (double)maxeatom * sizeof(double); bytes += (double)maxvatom*6 * sizeof(double); bytes += (double)maxcvatom*9 * sizeof(double); for (int m = 0; m < nstyles; m++) bytes += styles[m]->memory_usage(); From 5e29cba076a0eddc4cd334283cb501a7c6f61d86 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 3 Feb 2021 22:42:28 -0500 Subject: [PATCH 130/384] replace Get_Time() with MPI_Wtime() --- src/USER-REAXC/reaxc_init_md.cpp | 2 +- src/USER-REAXC/reaxc_reset_tools.cpp | 5 +++-- src/USER-REAXC/reaxc_tool_box.cpp | 21 --------------------- src/USER-REAXC/reaxc_tool_box.h | 3 --- 4 files changed, 4 insertions(+), 27 deletions(-) diff --git a/src/USER-REAXC/reaxc_init_md.cpp b/src/USER-REAXC/reaxc_init_md.cpp index e7d46fa742..9d10966d3b 100644 --- a/src/USER-REAXC/reaxc_init_md.cpp +++ b/src/USER-REAXC/reaxc_init_md.cpp @@ -77,7 +77,7 @@ int Init_Simulation_Data(reax_system *system, control_params *control, /* initialize the timer(s) */ if (system->my_rank == MASTER_NODE) { - data->timing.start = Get_Time(); + data->timing.start = MPI_Wtime(); } data->step = data->prev_steps = 0; diff --git a/src/USER-REAXC/reaxc_reset_tools.cpp b/src/USER-REAXC/reaxc_reset_tools.cpp index 5caaf860e7..4367be8217 100644 --- a/src/USER-REAXC/reaxc_reset_tools.cpp +++ b/src/USER-REAXC/reaxc_reset_tools.cpp @@ -25,7 +25,6 @@ ----------------------------------------------------------------------*/ #include "reaxc_reset_tools.h" -#include #include "reaxc_defs.h" #include "reaxc_list.h" #include "reaxc_tool_box.h" @@ -33,6 +32,8 @@ #include "error.h" +#include +#include void Reset_Atoms( reax_system* system, control_params *control ) { @@ -102,7 +103,7 @@ void Reset_Simulation_Data( simulation_data* data, int /*virial*/ ) void Reset_Timing( reax_timing *rt ) { - rt->total = Get_Time(); + rt->total = MPI_Wtime(); rt->comm = 0; rt->nbrs = 0; rt->init_forces = 0; diff --git a/src/USER-REAXC/reaxc_tool_box.cpp b/src/USER-REAXC/reaxc_tool_box.cpp index b559a362f4..f0171d2108 100644 --- a/src/USER-REAXC/reaxc_tool_box.cpp +++ b/src/USER-REAXC/reaxc_tool_box.cpp @@ -30,29 +30,8 @@ #include #include "reaxc_defs.h" -#if !defined(_MSC_VER) -#include -#endif - #include "error.h" -struct timeval tim; -double t_end; - -double Get_Time( ) -{ -#if defined(_MSC_VER) - double t; - - t = GetTickCount(); - t /= 1000.0; - return t; -#else - gettimeofday(&tim, nullptr ); - return( tim.tv_sec + (tim.tv_usec / 1000000.0) ); -#endif -} - int Tokenize( char* s, char*** tok ) { char test[MAX_LINE]; diff --git a/src/USER-REAXC/reaxc_tool_box.h b/src/USER-REAXC/reaxc_tool_box.h index b325819265..773b4f3f3d 100644 --- a/src/USER-REAXC/reaxc_tool_box.h +++ b/src/USER-REAXC/reaxc_tool_box.h @@ -30,9 +30,6 @@ #include "reaxc_types.h" namespace LAMMPS_NS { class Error; } -/* from system_props.h */ -double Get_Time( ); - /* from io_tools.h */ int Tokenize( char*, char*** ); From dadea346637c4b6adfff155069ad95a4135d53ee Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 3 Feb 2021 22:53:35 -0500 Subject: [PATCH 131/384] reformat comment --- src/utils.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.h b/src/utils.h index 0c619d316d..cf64e2df03 100644 --- a/src/utils.h +++ b/src/utils.h @@ -287,9 +287,9 @@ namespace LAMMPS_NS { * * This can handle strings with single and double quotes, escaped quotes, * and escaped codes within quotes, but due to using an STL container and - * STL strings is rather slow because of making copies. Designed for parsing - * command lines and similar text and not for time critical processing. - * Use a tokenizer class for that. + * STL strings is rather slow because of making copies. Designed for + * parsing command lines and similar text and not for time critical + * processing. Use a tokenizer class if performance matters. * \verbatim embed:rst From 3e07711739361fd4b42a04e996541b37f5789a7e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 4 Feb 2021 11:04:50 -0500 Subject: [PATCH 132/384] simplify using C++11 syntax --- src/utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.h b/src/utils.h index cf64e2df03..c8c49b317c 100644 --- a/src/utils.h +++ b/src/utils.h @@ -236,7 +236,7 @@ namespace LAMMPS_NS { inline bool has_utf8(const std::string &line) { const unsigned char * const in = (const unsigned char *)line.c_str(); - for (int i=0; i < line.size(); ++i) if (in[i] & 0x80U) return true; + for (auto c : line) if (c & 0x80U) return true; return false; } From 11b2a1e1ac5a19022fc2408f2ff38d165338447b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 4 Feb 2021 14:58:49 -0500 Subject: [PATCH 133/384] reorder package names to be in 2 groups (non-user, user) and each sorted alphabetically --- cmake/CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index c29fba5957..a4736740cf 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -107,13 +107,15 @@ option(CMAKE_VERBOSE_MAKEFILE "Generate verbose Makefiles" OFF) set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE GRANULAR KSPACE LATTE MANYBODY MC MESSAGE MISC MLIAP MOLECULE PERI POEMS QEQ REPLICA RIGID SHOCK SPIN SNAP SRD KIM PYTHON MSCG MPIIO VORONOI - USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-MESODPD USER-CGSDK USER-COLVARS - USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD USER-LB - USER-MANIFOLD USER-MEAMC USER-MESONT USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE - USER-NETCDF USER-PHONON USER-PLUMED USER-PTM USER-QTB USER-REACTION - USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY - USER-UEF USER-VTK USER-QUIP USER-QMMM USER-YAFF USER-ADIOS) -set(SUFFIX_PACKAGES CORESHELL USER-OMP KOKKOS OPT USER-INTEL GPU) + USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-MESODPD USER-CGSDK + USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD + USER-LB USER-MANIFOLD USER-MEAMC USER-MESONT USER-MGPT USER-MISC USER-MOFFF + USER-MOLFILE USER-NETCDF USER-PHONON USER-PLUMED USER-PTM USER-QTB + USER-REACTION USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH + USER-TALLY USER-UEF USER-VTK USER-QUIP USER-QMMM USER-YAFF) + +set(SUFFIX_PACKAGES CORESHELL GPU KOKKOS OPT USER-INTEL USER-OMP) + foreach(PKG ${STANDARD_PACKAGES} ${SUFFIX_PACKAGES}) option(PKG_${PKG} "Build ${PKG} Package" OFF) endforeach() From 4e791ac4f753c12357f792d236d68cffbb6def10 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 4 Feb 2021 15:20:43 -0500 Subject: [PATCH 134/384] replace 'strstr(xxx,"x_") == xxx' with utils::strmatch("^x_") --- src/MISC/fix_efield.cpp | 8 +- src/PYTHON/python_impl.cpp | 6 +- src/RIGID/fix_rigid.cpp | 4 +- src/RIGID/fix_rigid_small.cpp | 4 +- src/SRD/fix_wall_srd.cpp | 2 +- src/USER-DRUDE/fix_langevin_drude.cpp | 2 +- src/USER-FEP/compute_fep.cpp | 4 +- src/USER-FEP/fix_adapt_fep.cpp | 6 +- src/USER-MISC/fix_addtorque.cpp | 6 +- src/USER-SDPD/fix_meso_move.cpp | 12 +-- src/compute_property_atom.cpp | 4 +- src/dump_image.cpp | 18 ++--- src/fix_adapt.cpp | 8 +- src/fix_addforce.cpp | 8 +- src/fix_aveforce.cpp | 6 +- src/fix_gravity.cpp | 14 ++-- src/fix_heat.cpp | 2 +- src/fix_indent.cpp | 24 +++--- src/fix_langevin.cpp | 2 +- src/fix_move.cpp | 12 +-- src/fix_print.cpp | 2 +- src/fix_property_atom.cpp | 4 +- src/fix_setforce.cpp | 6 +- src/fix_temp_berendsen.cpp | 2 +- src/fix_temp_csld.cpp | 2 +- src/fix_temp_csvr.cpp | 2 +- src/fix_temp_rescale.cpp | 2 +- src/fix_wall.cpp | 8 +- src/fix_wall_reflect.cpp | 2 +- src/output.cpp | 4 +- src/region_cylinder.cpp | 14 ++-- src/region_sphere.cpp | 8 +- src/set.cpp | 104 +++++++++++++------------- src/variable.cpp | 8 +- src/velocity.cpp | 6 +- 35 files changed, 163 insertions(+), 163 deletions(-) diff --git a/src/MISC/fix_efield.cpp b/src/MISC/fix_efield.cpp index fd81448b2b..0dedfd0687 100644 --- a/src/MISC/fix_efield.cpp +++ b/src/MISC/fix_efield.cpp @@ -59,7 +59,7 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : qe2f = force->qe2f; xstr = ystr = zstr = nullptr; - if (strstr(arg[3],"v_") == arg[3]) { + if (utils::strmatch(arg[3],"^v_")) { int n = strlen(&arg[3][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[3][2]); @@ -68,7 +68,7 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : xstyle = CONSTANT; } - if (strstr(arg[4],"v_") == arg[4]) { + if (utils::strmatch(arg[4],"^v_")) { int n = strlen(&arg[4][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[4][2]); @@ -77,7 +77,7 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : ystyle = CONSTANT; } - if (strstr(arg[5],"v_") == arg[5]) { + if (utils::strmatch(arg[5],"^v_")) { int n = strlen(&arg[5][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[5][2]); @@ -105,7 +105,7 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"energy") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix efield command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) { + if (utils::strmatch(arg[iarg+1],"^v_")) { int n = strlen(&arg[iarg+1][2]) + 1; estr = new char[n]; strcpy(estr,&arg[iarg+1][2]); diff --git a/src/PYTHON/python_impl.cpp b/src/PYTHON/python_impl.cpp index 260454d150..0ddec34f7e 100644 --- a/src/PYTHON/python_impl.cpp +++ b/src/PYTHON/python_impl.cpp @@ -450,7 +450,7 @@ int PythonImpl::create_entry(char *name) char type = format[i]; if (type == 'i') { pfuncs[ifunc].itype[i] = INT; - if (strstr(istr[i],"v_") == istr[i]) { + if (utils::strmatch(istr[i],"^v_")) { pfuncs[ifunc].ivarflag[i] = 1; int n = strlen(&istr[i][2]) + 1; pfuncs[ifunc].svalue[i] = new char[n]; @@ -461,7 +461,7 @@ int PythonImpl::create_entry(char *name) } } else if (type == 'f') { pfuncs[ifunc].itype[i] = DOUBLE; - if (strstr(istr[i],"v_") == istr[i]) { + if (utils::strmatch(istr[i],"^v_")) { pfuncs[ifunc].ivarflag[i] = 1; int n = strlen(&istr[i][2]) + 1; pfuncs[ifunc].svalue[i] = new char[n]; @@ -472,7 +472,7 @@ int PythonImpl::create_entry(char *name) } } else if (type == 's') { pfuncs[ifunc].itype[i] = STRING; - if (strstr(istr[i],"v_") == istr[i]) { + if (utils::strmatch(istr[i],"^v_")) { pfuncs[ifunc].ivarflag[i] = 1; int n = strlen(&istr[i][2]) + 1; pfuncs[ifunc].svalue[i] = new char[n]; diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index a90782199e..f837ab5c97 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -129,7 +129,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : // determine whether atom-style variable or atom property is used - if (strstr(arg[4],"i_") == arg[4]) { + if (utils::strmatch(arg[4],"^i_")) { int is_double=0; int custom_index = atom->find_custom(arg[4]+2,is_double); if (custom_index == -1) @@ -151,7 +151,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : else molecule[i] = 0; - } else if (strstr(arg[4],"v_") == arg[4]) { + } else if (utils::strmatch(arg[4],"^v_")) { int ivariable = input->variable->find(arg[4]+2); if (ivariable < 0) error->all(FLERR,"Variable name for fix rigid custom does not exist"); diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index a316d9fbdf..6e41bf9d8b 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -113,7 +113,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : // determine whether atom-style variable or atom property is used - if (strstr(arg[4],"i_") == arg[4]) { + if (utils::strmatch(arg[4],"^i_")) { int is_double=0; int custom_index = atom->find_custom(arg[4]+2,is_double); if (custom_index == -1) @@ -135,7 +135,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : bodyID[i] = (tagint)(value[i] - minval + 1); else bodyID[i] = 0; - } else if (strstr(arg[4],"v_") == arg[4]) { + } else if (utils::strmatch(arg[4],"^v_")) { int ivariable = input->variable->find(arg[4]+2); if (ivariable < 0) error->all(FLERR,"Variable name for fix rigid/small custom " diff --git a/src/SRD/fix_wall_srd.cpp b/src/SRD/fix_wall_srd.cpp index 12e2cfecaf..4a56893233 100644 --- a/src/SRD/fix_wall_srd.cpp +++ b/src/SRD/fix_wall_srd.cpp @@ -69,7 +69,7 @@ FixWallSRD::FixWallSRD(LAMMPS *lmp, int narg, char **arg) : int side = wallwhich[nwall] % 2; if (side == 0) coord0[nwall] = domain->boxlo[dim]; else coord0[nwall] = domain->boxhi[dim]; - } else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) { + } else if (utils::strmatch(arg[iarg+1],"^v_")) { wallstyle[nwall] = VARIABLE; int n = strlen(&arg[iarg+1][2]) + 1; varstr[nwall] = new char[n]; diff --git a/src/USER-DRUDE/fix_langevin_drude.cpp b/src/USER-DRUDE/fix_langevin_drude.cpp index 4e905d16d3..ba475c092b 100644 --- a/src/USER-DRUDE/fix_langevin_drude.cpp +++ b/src/USER-DRUDE/fix_langevin_drude.cpp @@ -49,7 +49,7 @@ FixLangevinDrude::FixLangevinDrude(LAMMPS *lmp, int narg, char **arg) : // core temperature tstr_core = nullptr; - if (strstr(arg[3],"v_") == arg[3]) { + if (utils::strmatch(arg[3],"^v_")) { int n = strlen(&arg[3][2]) + 1; tstr_core = new char[n]; strcpy(tstr_core,&arg[3][2]); diff --git a/src/USER-FEP/compute_fep.cpp b/src/USER-FEP/compute_fep.cpp index d1c6353c89..33e5a309dc 100644 --- a/src/USER-FEP/compute_fep.cpp +++ b/src/USER-FEP/compute_fep.cpp @@ -99,7 +99,7 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : perturb[npert].ilo,perturb[npert].ihi,error); utils::bounds(FLERR,arg[iarg+4],1,atom->ntypes, perturb[npert].jlo,perturb[npert].jhi,error); - if (strstr(arg[iarg+5],"v_") == arg[iarg+5]) { + if (utils::strmatch(arg[iarg+5],"^v_")) { n = strlen(&arg[iarg+5][2]) + 1; perturb[npert].var = new char[n]; strcpy(perturb[npert].var,&arg[iarg+5][2]); @@ -114,7 +114,7 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Illegal atom argument in compute fep"); utils::bounds(FLERR,arg[iarg+2],1,atom->ntypes, perturb[npert].ilo,perturb[npert].ihi,error); - if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { + if (utils::strmatch(arg[iarg+3],"^v_")) { int n = strlen(&arg[iarg+3][2]) + 1; perturb[npert].var = new char[n]; strcpy(perturb[npert].var,&arg[iarg+3][2]); diff --git a/src/USER-FEP/fix_adapt_fep.cpp b/src/USER-FEP/fix_adapt_fep.cpp index 48cc65fd8a..e7a88e982a 100644 --- a/src/USER-FEP/fix_adapt_fep.cpp +++ b/src/USER-FEP/fix_adapt_fep.cpp @@ -98,7 +98,7 @@ FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) : adapt[nadapt].ilo,adapt[nadapt].ihi,error); utils::bounds(FLERR,arg[iarg+4],1,atom->ntypes, adapt[nadapt].jlo,adapt[nadapt].jhi,error); - if (strstr(arg[iarg+5],"v_") == arg[iarg+5]) { + if (utils::strmatch(arg[iarg+5],"^v_")) { n = strlen(&arg[iarg+5][2]) + 1; adapt[nadapt].var = new char[n]; strcpy(adapt[nadapt].var,&arg[iarg+5][2]); @@ -108,7 +108,7 @@ FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"kspace") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt/fep command"); adapt[nadapt].which = KSPACE; - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) { + if (utils::strmatch(arg[iarg+1],"^v_")) { int n = strlen(&arg[iarg+1][2]) + 1; adapt[nadapt].var = new char[n]; strcpy(adapt[nadapt].var,&arg[iarg+1][2]); @@ -127,7 +127,7 @@ FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Illegal fix adapt/fep command"); utils::bounds(FLERR,arg[iarg+2],1,atom->ntypes, adapt[nadapt].ilo,adapt[nadapt].ihi,error); - if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { + if (utils::strmatch(arg[iarg+3],"^v_")) { int n = strlen(&arg[iarg+3][2]) + 1; adapt[nadapt].var = new char[n]; strcpy(adapt[nadapt].var,&arg[iarg+3][2]); diff --git a/src/USER-MISC/fix_addtorque.cpp b/src/USER-MISC/fix_addtorque.cpp index eba7348f21..713cc7cc4e 100644 --- a/src/USER-MISC/fix_addtorque.cpp +++ b/src/USER-MISC/fix_addtorque.cpp @@ -53,7 +53,7 @@ FixAddTorque::FixAddTorque(LAMMPS *lmp, int narg, char **arg) : xstr = ystr = zstr = nullptr; - if (strstr(arg[3],"v_") == arg[3]) { + if (utils::strmatch(arg[3],"^v_")) { int n = strlen(&arg[3][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[3][2]); @@ -61,7 +61,7 @@ FixAddTorque::FixAddTorque(LAMMPS *lmp, int narg, char **arg) : xvalue = utils::numeric(FLERR,arg[3],false,lmp); xstyle = CONSTANT; } - if (strstr(arg[4],"v_") == arg[4]) { + if (utils::strmatch(arg[4],"^v_")) { int n = strlen(&arg[4][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[4][2]); @@ -69,7 +69,7 @@ FixAddTorque::FixAddTorque(LAMMPS *lmp, int narg, char **arg) : yvalue = utils::numeric(FLERR,arg[4],false,lmp); ystyle = CONSTANT; } - if (strstr(arg[5],"v_") == arg[5]) { + if (utils::strmatch(arg[5],"^v_")) { int n = strlen(&arg[5][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[5][2]); diff --git a/src/USER-SDPD/fix_meso_move.cpp b/src/USER-SDPD/fix_meso_move.cpp index ddb4bbc3e8..bc93672c43 100644 --- a/src/USER-SDPD/fix_meso_move.cpp +++ b/src/USER-SDPD/fix_meso_move.cpp @@ -127,37 +127,37 @@ FixMesoMove::FixMesoMove (LAMMPS *lmp, int narg, char **arg) : iarg = 10; mstyle = VARIABLE; if (strcmp(arg[4],"NULL") == 0) xvarstr = nullptr; - else if (strstr(arg[4],"v_") == arg[4]) { + else if (utils::strmatch(arg[4],"^v_")) { int n = strlen(&arg[4][2]) + 1; xvarstr = new char[n]; strcpy(xvarstr,&arg[4][2]); } else error->all(FLERR,"Illegal fix meso/move command"); if (strcmp(arg[5],"NULL") == 0) yvarstr = nullptr; - else if (strstr(arg[5],"v_") == arg[5]) { + else if (utils::strmatch(arg[5],"^v_")) { int n = strlen(&arg[5][2]) + 1; yvarstr = new char[n]; strcpy(yvarstr,&arg[5][2]); } else error->all(FLERR,"Illegal fix meso/move command"); if (strcmp(arg[6],"NULL") == 0) zvarstr = nullptr; - else if (strstr(arg[6],"v_") == arg[6]) { + else if (utils::strmatch(arg[6],"^v_")) { int n = strlen(&arg[6][2]) + 1; zvarstr = new char[n]; strcpy(zvarstr,&arg[6][2]); } else error->all(FLERR,"Illegal fix meso/move command"); if (strcmp(arg[7],"NULL") == 0) vxvarstr = nullptr; - else if (strstr(arg[7],"v_") == arg[7]) { + else if (utils::strmatch(arg[7],"^v_")) { int n = strlen(&arg[7][2]) + 1; vxvarstr = new char[n]; strcpy(vxvarstr,&arg[7][2]); } else error->all(FLERR,"Illegal fix meso/move command"); if (strcmp(arg[8],"NULL") == 0) vyvarstr = nullptr; - else if (strstr(arg[8],"v_") == arg[8]) { + else if (utils::strmatch(arg[8],"^v_")) { int n = strlen(&arg[8][2]) + 1; vyvarstr = new char[n]; strcpy(vyvarstr,&arg[8][2]); } else error->all(FLERR,"Illegal fix meso/move command"); if (strcmp(arg[9],"NULL") == 0) vzvarstr = nullptr; - else if (strstr(arg[9],"v_") == arg[9]) { + else if (utils::strmatch(arg[9],"^v_")) { int n = strlen(&arg[9][2]) + 1; vzvarstr = new char[n]; strcpy(vzvarstr,&arg[9][2]); diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp index cb7cbca0b8..6da82e0e57 100644 --- a/src/compute_property_atom.cpp +++ b/src/compute_property_atom.cpp @@ -361,14 +361,14 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) : "atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_nbonds; - } else if (strstr(arg[iarg],"i_") == arg[iarg]) { + } else if (utils::strmatch(arg[iarg],"^i_")) { int flag; index[i] = atom->find_custom(&arg[iarg][2],flag); if (index[i] < 0 || flag != 0) error->all(FLERR,"Compute property/atom integer " "vector does not exist"); pack_choice[i] = &ComputePropertyAtom::pack_iname; - } else if (strstr(arg[iarg],"d_") == arg[iarg]) { + } else if (utils::strmatch(arg[iarg],"^d_")) { int flag; index[i] = atom->find_custom(&arg[iarg][2],flag); if (index[i] < 0 || flag != 1) diff --git a/src/dump_image.cpp b/src/dump_image.cpp index bb5293fffe..09db165173 100644 --- a/src/dump_image.cpp +++ b/src/dump_image.cpp @@ -225,7 +225,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"view") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) { + if (utils::strmatch(arg[iarg+1],"^v_")) { int n = strlen(&arg[iarg+1][2]) + 1; thetastr = new char[n]; strcpy(thetastr,&arg[iarg+1][2]); @@ -236,7 +236,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : theta *= MY_PI/180.0; image->theta = theta; } - if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { + if (utils::strmatch(arg[iarg+2],"^v_")) { int n = strlen(&arg[iarg+2][2]) + 1; phistr = new char[n]; strcpy(phistr,&arg[iarg+2][2]); @@ -252,19 +252,19 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg+1],"s") == 0) cflag = STATIC; else if (strcmp(arg[iarg+1],"d") == 0) cflag = DYNAMIC; else error->all(FLERR,"Illegal dump image command"); - if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { + if (utils::strmatch(arg[iarg+2],"^v_")) { int n = strlen(&arg[iarg+2][2]) + 1; cxstr = new char[n]; strcpy(cxstr,&arg[iarg+2][2]); cflag = DYNAMIC; } else cx = utils::numeric(FLERR,arg[iarg+2],false,lmp); - if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { + if (utils::strmatch(arg[iarg+3],"^v_")) { int n = strlen(&arg[iarg+3][2]) + 1; cystr = new char[n]; strcpy(cystr,&arg[iarg+3][2]); cflag = DYNAMIC; } else cy = utils::numeric(FLERR,arg[iarg+3],false,lmp); - if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) { + if (utils::strmatch(arg[iarg+4],"^v_")) { int n = strlen(&arg[iarg+4][2]) + 1; czstr = new char[n]; strcpy(czstr,&arg[iarg+4][2]); @@ -274,17 +274,17 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"up") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) { + if (utils::strmatch(arg[iarg+1],"^v_")) { int n = strlen(&arg[iarg+1][2]) + 1; upxstr = new char[n]; strcpy(upxstr,&arg[iarg+1][2]); } else image->up[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); - if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { + if (utils::strmatch(arg[iarg+2],"^v_")) { int n = strlen(&arg[iarg+2][2]) + 1; upystr = new char[n]; strcpy(upystr,&arg[iarg+2][2]); } else image->up[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); - if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { + if (utils::strmatch(arg[iarg+3],"^v_")) { int n = strlen(&arg[iarg+3][2]) + 1; upzstr = new char[n]; strcpy(upzstr,&arg[iarg+3][2]); @@ -293,7 +293,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"zoom") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) { + if (utils::strmatch(arg[iarg+1],"^v_")) { int n = strlen(&arg[iarg+1][2]) + 1; zoomstr = new char[n]; strcpy(zoomstr,&arg[iarg+1][2]); diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp index 657323802d..6e548e7e57 100644 --- a/src/fix_adapt.cpp +++ b/src/fix_adapt.cpp @@ -102,7 +102,7 @@ nadapt(0), id_fix_diam(nullptr), id_fix_chg(nullptr), adapt(nullptr) adapt[nadapt].ilo,adapt[nadapt].ihi,error); utils::bounds(FLERR,arg[iarg+4],1,atom->ntypes, adapt[nadapt].jlo,adapt[nadapt].jhi,error); - if (strstr(arg[iarg+5],"v_") == arg[iarg+5]) { + if (utils::strmatch(arg[iarg+5],"^v_")) { n = strlen(&arg[iarg+5][2]) + 1; adapt[nadapt].var = new char[n]; strcpy(adapt[nadapt].var,&arg[iarg+5][2]); @@ -122,7 +122,7 @@ nadapt(0), id_fix_diam(nullptr), id_fix_chg(nullptr), adapt(nullptr) strcpy(adapt[nadapt].bparam,arg[iarg+2]); utils::bounds(FLERR,arg[iarg+3],1,atom->nbondtypes, adapt[nadapt].ilo,adapt[nadapt].ihi,error); - if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) { + if (utils::strmatch(arg[iarg+4],"^v_")) { n = strlen(&arg[iarg+4][2]) + 1; adapt[nadapt].var = new char[n]; strcpy(adapt[nadapt].var,&arg[iarg+4][2]); @@ -133,7 +133,7 @@ nadapt(0), id_fix_diam(nullptr), id_fix_chg(nullptr), adapt(nullptr) } else if (strcmp(arg[iarg],"kspace") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt command"); adapt[nadapt].which = KSPACE; - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) { + if (utils::strmatch(arg[iarg+1],"^v_")) { int n = strlen(&arg[iarg+1][2]) + 1; adapt[nadapt].var = new char[n]; strcpy(adapt[nadapt].var,&arg[iarg+1][2]); @@ -154,7 +154,7 @@ nadapt(0), id_fix_diam(nullptr), id_fix_chg(nullptr), adapt(nullptr) adapt[nadapt].aparam = CHARGE; chgflag = 1; } else error->all(FLERR,"Illegal fix adapt command"); - if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { + if (utils::strmatch(arg[iarg+2],"^v_")) { int n = strlen(&arg[iarg+2][2]) + 1; adapt[nadapt].var = new char[n]; strcpy(adapt[nadapt].var,&arg[iarg+2][2]); diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp index 881f77c05c..1f46280539 100644 --- a/src/fix_addforce.cpp +++ b/src/fix_addforce.cpp @@ -54,7 +54,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : xstr = ystr = zstr = nullptr; - if (strstr(arg[3],"v_") == arg[3]) { + if (utils::strmatch(arg[3],"^v_")) { int n = strlen(&arg[3][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[3][2]); @@ -62,7 +62,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : xvalue = utils::numeric(FLERR,arg[3],false,lmp); xstyle = CONSTANT; } - if (strstr(arg[4],"v_") == arg[4]) { + if (utils::strmatch(arg[4],"^v_")) { int n = strlen(&arg[4][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[4][2]); @@ -70,7 +70,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : yvalue = utils::numeric(FLERR,arg[4],false,lmp); ystyle = CONSTANT; } - if (strstr(arg[5],"v_") == arg[5]) { + if (utils::strmatch(arg[5],"^v_")) { int n = strlen(&arg[5][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[5][2]); @@ -102,7 +102,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"energy") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix addforce command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) { + if (utils::strmatch(arg[iarg+1],"^v_")) { int n = strlen(&arg[iarg+1][2]) + 1; estr = new char[n]; strcpy(estr,&arg[iarg+1][2]); diff --git a/src/fix_aveforce.cpp b/src/fix_aveforce.cpp index 78b711c3b4..21dbf1f536 100644 --- a/src/fix_aveforce.cpp +++ b/src/fix_aveforce.cpp @@ -48,7 +48,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : xstr = ystr = zstr = nullptr; - if (strstr(arg[3],"v_") == arg[3]) { + if (utils::strmatch(arg[3],"^v_")) { int n = strlen(&arg[3][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[3][2]); @@ -58,7 +58,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : xvalue = utils::numeric(FLERR,arg[3],false,lmp); xstyle = CONSTANT; } - if (strstr(arg[4],"v_") == arg[4]) { + if (utils::strmatch(arg[4],"^v_")) { int n = strlen(&arg[4][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[4][2]); @@ -68,7 +68,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : yvalue = utils::numeric(FLERR,arg[4],false,lmp); ystyle = CONSTANT; } - if (strstr(arg[5],"v_") == arg[5]) { + if (utils::strmatch(arg[5],"^v_")) { int n = strlen(&arg[5][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[5][2]); diff --git a/src/fix_gravity.cpp b/src/fix_gravity.cpp index a96303742c..4e384b5281 100644 --- a/src/fix_gravity.cpp +++ b/src/fix_gravity.cpp @@ -52,7 +52,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : mstr = vstr = pstr = tstr = xstr = ystr = zstr = nullptr; mstyle = vstyle = pstyle = tstyle = xstyle = ystyle = zstyle = CONSTANT; - if (strstr(arg[3],"v_") == arg[3]) { + if (utils::strmatch(arg[3],"^v_")) { int n = strlen(&arg[3][2]) + 1; mstr = new char[n]; strcpy(mstr,&arg[3][2]); @@ -67,7 +67,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[4],"chute") == 0) { if (narg < 6) error->all(FLERR,"Illegal fix gravity command"); style = CHUTE; - if (strstr(arg[5],"v_") == arg[5]) { + if (utils::strmatch(arg[5],"^v_")) { int n = strlen(&arg[5][2]) + 1; vstr = new char[n]; strcpy(vstr,&arg[5][2]); @@ -81,7 +81,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[4],"spherical") == 0) { if (narg < 7) error->all(FLERR,"Illegal fix gravity command"); style = SPHERICAL; - if (strstr(arg[5],"v_") == arg[5]) { + if (utils::strmatch(arg[5],"^v_")) { int n = strlen(&arg[5][2]) + 1; pstr = new char[n]; strcpy(pstr,&arg[5][2]); @@ -90,7 +90,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : phi = utils::numeric(FLERR,arg[5],false,lmp); pstyle = CONSTANT; } - if (strstr(arg[6],"v_") == arg[6]) { + if (utils::strmatch(arg[6],"^v_")) { int n = strlen(&arg[6][2]) + 1; tstr = new char[n]; strcpy(tstr,&arg[6][2]); @@ -104,7 +104,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[4],"vector") == 0) { if (narg < 8) error->all(FLERR,"Illegal fix gravity command"); style = VECTOR; - if (strstr(arg[5],"v_") == arg[5]) { + if (utils::strmatch(arg[5],"^v_")) { int n = strlen(&arg[5][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[5][2]); @@ -113,7 +113,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : xdir = utils::numeric(FLERR,arg[5],false,lmp); xstyle = CONSTANT; } - if (strstr(arg[6],"v_") == arg[6]) { + if (utils::strmatch(arg[6],"^v_")) { int n = strlen(&arg[6][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[6][2]); @@ -122,7 +122,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : ydir = utils::numeric(FLERR,arg[6],false,lmp); ystyle = CONSTANT; } - if (strstr(arg[7],"v_") == arg[7]) { + if (utils::strmatch(arg[7],"^v_")) { int n = strlen(&arg[7][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[7][2]); diff --git a/src/fix_heat.cpp b/src/fix_heat.cpp index 033aa20d8f..d75010985d 100644 --- a/src/fix_heat.cpp +++ b/src/fix_heat.cpp @@ -52,7 +52,7 @@ idregion(nullptr), hstr(nullptr), vheat(nullptr), vscale(nullptr) hstr = nullptr; - if (strstr(arg[4],"v_") == arg[4]) { + if (utils::strmatch(arg[4],"^v_")) { int n = strlen(&arg[4][2]) + 1; hstr = new char[n]; strcpy(hstr,&arg[4][2]); diff --git a/src/fix_indent.cpp b/src/fix_indent.cpp index cc7a3c8877..fa23a6044d 100644 --- a/src/fix_indent.cpp +++ b/src/fix_indent.cpp @@ -417,22 +417,22 @@ void FixIndent::options(int narg, char **arg) if (strcmp(arg[iarg],"sphere") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal fix indent command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) { + if (utils::strmatch(arg[iarg+1],"^v_")) { int n = strlen(&arg[iarg+1][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[iarg+1][2]); } else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); - if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { + if (utils::strmatch(arg[iarg+2],"^v_")) { int n = strlen(&arg[iarg+2][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[iarg+2][2]); } else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); - if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { + if (utils::strmatch(arg[iarg+3],"^v_")) { int n = strlen(&arg[iarg+3][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[iarg+3][2]); } else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); - if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) { + if (utils::strmatch(arg[iarg+4],"^v_")) { int n = strlen(&arg[iarg+4][2]) + 1; rstr = new char[n]; strcpy(rstr,&arg[iarg+4][2]); @@ -446,43 +446,43 @@ void FixIndent::options(int narg, char **arg) if (strcmp(arg[iarg+1],"x") == 0) { cdim = 0; - if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { + if (utils::strmatch(arg[iarg+2],"^v_")) { int n = strlen(&arg[iarg+2][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[iarg+2][2]); } else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); - if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { + if (utils::strmatch(arg[iarg+3],"^v_")) { int n = strlen(&arg[iarg+3][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[iarg+3][2]); } else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); } else if (strcmp(arg[iarg+1],"y") == 0) { cdim = 1; - if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { + if (utils::strmatch(arg[iarg+2],"^v_")) { int n = strlen(&arg[iarg+2][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[iarg+2][2]); } else xvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); - if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { + if (utils::strmatch(arg[iarg+3],"^v_")) { int n = strlen(&arg[iarg+3][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[iarg+3][2]); } else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); } else if (strcmp(arg[iarg+1],"z") == 0) { cdim = 2; - if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { + if (utils::strmatch(arg[iarg+2],"^v_")) { int n = strlen(&arg[iarg+2][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[iarg+2][2]); } else xvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); - if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { + if (utils::strmatch(arg[iarg+3],"^v_")) { int n = strlen(&arg[iarg+3][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[iarg+3][2]); } else yvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); } else error->all(FLERR,"Illegal fix indent command"); - if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) { + if (utils::strmatch(arg[iarg+4],"^v_")) { int n = strlen(&arg[iarg+4][2]) + 1; rstr = new char[n]; strcpy(rstr,&arg[iarg+4][2]); @@ -498,7 +498,7 @@ void FixIndent::options(int narg, char **arg) else if (strcmp(arg[iarg+1],"z") == 0) cdim = 2; else error->all(FLERR,"Illegal fix indent command"); - if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { + if (utils::strmatch(arg[iarg+2],"^v_")) { int n = strlen(&arg[iarg+2][2]) + 1; pstr = new char[n]; strcpy(pstr,&arg[iarg+2][2]); diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index 51a40ef9d2..e94986c933 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -64,7 +64,7 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; nevery = 1; - if (strstr(arg[3],"v_") == arg[3]) { + if (utils::strmatch(arg[3],"^v_")) { int n = strlen(&arg[3][2]) + 1; tstr = new char[n]; strcpy(tstr,&arg[3][2]); diff --git a/src/fix_move.cpp b/src/fix_move.cpp index 647a33a5ca..d19ad4fdef 100644 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -128,37 +128,37 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : iarg = 10; mstyle = VARIABLE; if (strcmp(arg[4],"NULL") == 0) xvarstr = nullptr; - else if (strstr(arg[4],"v_") == arg[4]) { + else if (utils::strmatch(arg[4],"^v_")) { int n = strlen(&arg[4][2]) + 1; xvarstr = new char[n]; strcpy(xvarstr,&arg[4][2]); } else error->all(FLERR,"Illegal fix move command"); if (strcmp(arg[5],"NULL") == 0) yvarstr = nullptr; - else if (strstr(arg[5],"v_") == arg[5]) { + else if (utils::strmatch(arg[5],"^v_")) { int n = strlen(&arg[5][2]) + 1; yvarstr = new char[n]; strcpy(yvarstr,&arg[5][2]); } else error->all(FLERR,"Illegal fix move command"); if (strcmp(arg[6],"NULL") == 0) zvarstr = nullptr; - else if (strstr(arg[6],"v_") == arg[6]) { + else if (utils::strmatch(arg[6],"^v_")) { int n = strlen(&arg[6][2]) + 1; zvarstr = new char[n]; strcpy(zvarstr,&arg[6][2]); } else error->all(FLERR,"Illegal fix move command"); if (strcmp(arg[7],"NULL") == 0) vxvarstr = nullptr; - else if (strstr(arg[7],"v_") == arg[7]) { + else if (utils::strmatch(arg[7],"^v_")) { int n = strlen(&arg[7][2]) + 1; vxvarstr = new char[n]; strcpy(vxvarstr,&arg[7][2]); } else error->all(FLERR,"Illegal fix move command"); if (strcmp(arg[8],"NULL") == 0) vyvarstr = nullptr; - else if (strstr(arg[8],"v_") == arg[8]) { + else if (utils::strmatch(arg[8],"^v_")) { int n = strlen(&arg[8][2]) + 1; vyvarstr = new char[n]; strcpy(vyvarstr,&arg[8][2]); } else error->all(FLERR,"Illegal fix move command"); if (strcmp(arg[9],"NULL") == 0) vzvarstr = nullptr; - else if (strstr(arg[9],"v_") == arg[9]) { + else if (utils::strmatch(arg[9],"^v_")) { int n = strlen(&arg[9][2]) + 1; vzvarstr = new char[n]; strcpy(vzvarstr,&arg[9][2]); diff --git a/src/fix_print.cpp b/src/fix_print.cpp index e186655ccc..240304d436 100644 --- a/src/fix_print.cpp +++ b/src/fix_print.cpp @@ -32,7 +32,7 @@ FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : fp(nullptr), string(nullptr), copy(nullptr), work(nullptr), var_print(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix print command"); - if (strstr(arg[3],"v_") == arg[3]) { + if (utils::strmatch(arg[3],"^v_")) { int n = strlen(&arg[3][2]) + 1; var_print = new char[n]; strcpy(var_print,&arg[3][2]); diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index 4dcaf6077c..72f2eee605 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -75,7 +75,7 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : style[nvalue] = RMASS; atom->rmass_flag = rmass_flag = 1; nvalue++; - } else if (strstr(arg[iarg],"i_") == arg[iarg]) { + } else if (utils::strmatch(arg[iarg],"^i_")) { style[nvalue] = INTEGER; int tmp; index[nvalue] = atom->find_custom(&arg[iarg][2],tmp); @@ -83,7 +83,7 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Fix property/atom vector name already exists"); index[nvalue] = atom->add_custom(&arg[iarg][2],0); nvalue++; - } else if (strstr(arg[iarg],"d_") == arg[iarg]) { + } else if (utils::strmatch(arg[iarg],"^d_")) { style[nvalue] = DOUBLE; int tmp; index[nvalue] = atom->find_custom(&arg[iarg][2],tmp); diff --git a/src/fix_setforce.cpp b/src/fix_setforce.cpp index 7240c3e132..8430f4d784 100644 --- a/src/fix_setforce.cpp +++ b/src/fix_setforce.cpp @@ -48,7 +48,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : ilevel_respa = nlevels_respa = 0; xstr = ystr = zstr = nullptr; - if (strstr(arg[3],"v_") == arg[3]) { + if (utils::strmatch(arg[3],"^v_")) { int n = strlen(&arg[3][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[3][2]); @@ -58,7 +58,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : xvalue = utils::numeric(FLERR,arg[3],false,lmp); xstyle = CONSTANT; } - if (strstr(arg[4],"v_") == arg[4]) { + if (utils::strmatch(arg[4],"^v_")) { int n = strlen(&arg[4][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[4][2]); @@ -68,7 +68,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : yvalue = utils::numeric(FLERR,arg[4],false,lmp); ystyle = CONSTANT; } - if (strstr(arg[5],"v_") == arg[5]) { + if (utils::strmatch(arg[5],"^v_")) { int n = strlen(&arg[5][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[5][2]); diff --git a/src/fix_temp_berendsen.cpp b/src/fix_temp_berendsen.cpp index afa41c50e4..c80ffc7859 100644 --- a/src/fix_temp_berendsen.cpp +++ b/src/fix_temp_berendsen.cpp @@ -51,7 +51,7 @@ FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; tstr = nullptr; - if (strstr(arg[3],"v_") == arg[3]) { + if (utils::strmatch(arg[3],"^v_")) { int n = strlen(&arg[3][2]) + 1; tstr = new char[n]; strcpy(tstr,&arg[3][2]); diff --git a/src/fix_temp_csld.cpp b/src/fix_temp_csld.cpp index 3b522c185f..e38ad2a43f 100644 --- a/src/fix_temp_csld.cpp +++ b/src/fix_temp_csld.cpp @@ -57,7 +57,7 @@ FixTempCSLD::FixTempCSLD(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; tstr = nullptr; - if (strstr(arg[3],"v_") == arg[3]) { + if (utils::strmatch(arg[3],"^v_")) { int n = strlen(&arg[3][2]) + 1; tstr = new char[n]; strcpy(tstr,&arg[3][2]); diff --git a/src/fix_temp_csvr.cpp b/src/fix_temp_csvr.cpp index eedf24c387..9c10b0fb7d 100644 --- a/src/fix_temp_csvr.cpp +++ b/src/fix_temp_csvr.cpp @@ -134,7 +134,7 @@ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; tstr = nullptr; - if (strstr(arg[3],"v_") == arg[3]) { + if (utils::strmatch(arg[3],"^v_")) { int n = strlen(&arg[3][2]) + 1; tstr = new char[n]; strcpy(tstr,&arg[3][2]); diff --git a/src/fix_temp_rescale.cpp b/src/fix_temp_rescale.cpp index 46b00f9e83..321486b761 100644 --- a/src/fix_temp_rescale.cpp +++ b/src/fix_temp_rescale.cpp @@ -51,7 +51,7 @@ FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) : dynamic_group_allow = 1; tstr = nullptr; - if (strstr(arg[4],"v_") == arg[4]) { + if (utils::strmatch(arg[4],"^v_")) { int n = strlen(&arg[4][2]) + 1; tstr = new char[n]; strcpy(tstr,&arg[4][2]); diff --git a/src/fix_wall.cpp b/src/fix_wall.cpp index 31aae965d4..255f851408 100644 --- a/src/fix_wall.cpp +++ b/src/fix_wall.cpp @@ -79,7 +79,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : int side = wallwhich[nwall] % 2; if (side == 0) coord0[nwall] = domain->boxlo[dim]; else coord0[nwall] = domain->boxhi[dim]; - } else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) { + } else if (utils::strmatch(arg[iarg+1],"^v_")) { xstyle[nwall] = VARIABLE; int n = strlen(&arg[iarg+1][2]) + 1; xstr[nwall] = new char[n]; @@ -89,7 +89,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : coord0[nwall] = utils::numeric(FLERR,arg[iarg+1],false,lmp); } - if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { + if (utils::strmatch(arg[iarg+2],"^v_")) { int n = strlen(&arg[iarg+2][2]) + 1; estr[nwall] = new char[n]; strcpy(estr[nwall],&arg[iarg+2][2]); @@ -100,7 +100,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : } if (utils::strmatch(style,"^wall/morse")) { - if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { + if (utils::strmatch(arg[iarg+3],"^v_")) { int n = strlen(&arg[iarg+3][2]) + 1; astr[nwall] = new char[n]; strcpy(astr[nwall],&arg[iarg+3][2]); @@ -112,7 +112,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : ++iarg; } - if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { + if (utils::strmatch(arg[iarg+3],"^v_")) { int n = strlen(&arg[iarg+3][2]) + 1; sstr[nwall] = new char[n]; strcpy(sstr[nwall],&arg[iarg+3][2]); diff --git a/src/fix_wall_reflect.cpp b/src/fix_wall_reflect.cpp index 0db71122dd..12dd7b5877 100644 --- a/src/fix_wall_reflect.cpp +++ b/src/fix_wall_reflect.cpp @@ -73,7 +73,7 @@ FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) : int side = wallwhich[nwall] % 2; if (side == 0) coord0[nwall] = domain->boxlo[dim]; else coord0[nwall] = domain->boxhi[dim]; - } else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) { + } else if (utils::strmatch(arg[iarg+1],"^v_")) { wallstyle[nwall] = VARIABLE; int n = strlen(&arg[iarg+1][2]) + 1; varstr[nwall] = new char[n]; diff --git a/src/output.cpp b/src/output.cpp index 0e190f2e86..31377e9ca6 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -664,7 +664,7 @@ void Output::set_thermo(int narg, char **arg) delete [] var_thermo; var_thermo = nullptr; - if (strstr(arg[0],"v_") == arg[0]) { + if (utils::strmatch(arg[0],"^v_")) { int n = strlen(&arg[0][2]) + 1; var_thermo = new char[n]; strcpy(var_thermo,&arg[0][2]); @@ -712,7 +712,7 @@ void Output::create_restart(int narg, char **arg) int every = 0; int varflag = 0; - if (strstr(arg[0],"v_") == arg[0]) varflag = 1; + if (utils::strmatch(arg[0],"^v_")) varflag = 1; else every = utils::inumeric(FLERR,arg[0],false,lmp); if (!varflag && every == 0) { diff --git a/src/region_cylinder.cpp b/src/region_cylinder.cpp index 9e94a53046..6aec067a40 100644 --- a/src/region_cylinder.cpp +++ b/src/region_cylinder.cpp @@ -44,7 +44,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : axis = arg[2][0]; if (axis == 'x') { - if (strstr(arg[3],"v_") == arg[3]) { + if (utils::strmatch(arg[3],"^v_")) { int n = strlen(arg[3]+2) + 1; c1str = new char[n]; strcpy(c1str,arg[3]+2); @@ -55,7 +55,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c1 = yscale*utils::numeric(FLERR,arg[3],false,lmp); c1style = CONSTANT; } - if (strstr(arg[4],"v_") == arg[4]) { + if (utils::strmatch(arg[4],"^v_")) { int n = strlen(arg[4]+2) + 1; c2str = new char[n]; strcpy(c2str,arg[4]+2); @@ -67,7 +67,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c2style = CONSTANT; } } else if (axis == 'y') { - if (strstr(arg[3],"v_") == arg[3]) { + if (utils::strmatch(arg[3],"^v_")) { int n = strlen(arg[3]+2) + 1; c1str = new char[n]; strcpy(c1str,arg[3]+2); @@ -78,7 +78,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c1 = xscale*utils::numeric(FLERR,arg[3],false,lmp); c1style = CONSTANT; } - if (strstr(arg[4],"v_") == arg[4]) { + if (utils::strmatch(arg[4],"^v_")) { int n = strlen(arg[4]+2) + 1; c2str = new char[n]; strcpy(c2str,arg[4]+2); @@ -90,7 +90,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c2style = CONSTANT; } } else if (axis == 'z') { - if (strstr(arg[3],"v_") == arg[3]) { + if (utils::strmatch(arg[3],"^v_")) { int n = strlen(arg[3]+2) + 1; c1str = new char[n]; strcpy(c1str,arg[3]+2); @@ -101,7 +101,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c1 = xscale*utils::numeric(FLERR,arg[3],false,lmp); c1style = CONSTANT; } - if (strstr(arg[4],"v_") == arg[4]) { + if (utils::strmatch(arg[4],"^v_")) { int n = strlen(arg[4]+2) + 1; c2str = new char[n]; strcpy(c2str,arg[4]+2); @@ -114,7 +114,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : } } - if (strstr(arg[5],"v_") == arg[5]) { + if (utils::strmatch(arg[5],"^v_")) { int n = strlen(&arg[5][2]) + 1; rstr = new char[n]; strcpy(rstr,&arg[5][2]); diff --git a/src/region_sphere.cpp b/src/region_sphere.cpp index 34773d25fb..a5fc292b41 100644 --- a/src/region_sphere.cpp +++ b/src/region_sphere.cpp @@ -32,7 +32,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : { options(narg-6,&arg[6]); - if (strstr(arg[2],"v_") == arg[2]) { + if (utils::strmatch(arg[2],"^v_")) { int n = strlen(arg[2]+2) + 1; xstr = new char[n]; strcpy(xstr,arg[2]+2); @@ -44,7 +44,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : xstyle = CONSTANT; } - if (strstr(arg[3],"v_") == arg[3]) { + if (utils::strmatch(arg[3],"^v_")) { int n = strlen(arg[3]+2) + 1; ystr = new char[n]; strcpy(ystr,arg[3]+2); @@ -56,7 +56,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : ystyle = CONSTANT; } - if (strstr(arg[4],"v_") == arg[4]) { + if (utils::strmatch(arg[4],"^v_")) { int n = strlen(arg[4]+2) + 1; zstr = new char[n]; strcpy(zstr,arg[4]+2); @@ -68,7 +68,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : zstyle = CONSTANT; } - if (strstr(arg[5],"v_") == arg[5]) { + if (utils::strmatch(arg[5],"^v_")) { int n = strlen(&arg[5][2]) + 1; rstr = new char[n]; strcpy(rstr,&arg[5][2]); diff --git a/src/set.cpp b/src/set.cpp index 6763ffa633..4d27e8183b 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -92,7 +92,7 @@ void Set::command(int narg, char **arg) if (strcmp(arg[iarg],"type") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); set(TYPE); iarg += 2; @@ -141,7 +141,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"mol") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (!atom->molecule_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); @@ -150,49 +150,49 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"x") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(X); iarg += 2; } else if (strcmp(arg[iarg],"y") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(Y); iarg += 2; } else if (strcmp(arg[iarg],"z") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(Z); iarg += 2; } else if (strcmp(arg[iarg],"vx") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(VX); iarg += 2; } else if (strcmp(arg[iarg],"vy") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(VY); iarg += 2; } else if (strcmp(arg[iarg],"vz") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(VZ); iarg += 2; } else if (strcmp(arg[iarg],"charge") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->q_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); @@ -201,7 +201,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"mass") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->rmass_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); @@ -210,11 +210,11 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"shape") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); - if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); + if (utils::strmatch(arg[iarg+2],"^v_")) varparse(arg[iarg+2],2); else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); - if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); + if (utils::strmatch(arg[iarg+3],"^v_")) varparse(arg[iarg+3],3); else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (!atom->ellipsoid_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); @@ -223,7 +223,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"length") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->line_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); @@ -232,7 +232,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"tri") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->tri_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); @@ -241,11 +241,11 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"dipole") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); - if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); + if (utils::strmatch(arg[iarg+2],"^v_")) varparse(arg[iarg+2],2); else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); - if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); + if (utils::strmatch(arg[iarg+3],"^v_")) varparse(arg[iarg+3],3); else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (!atom->mu_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); @@ -267,13 +267,13 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"spin") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); - if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); + if (utils::strmatch(arg[iarg+2],"^v_")) varparse(arg[iarg+2],2); else xvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); - if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); + if (utils::strmatch(arg[iarg+3],"^v_")) varparse(arg[iarg+3],3); else yvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); - if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) varparse(arg[iarg+4],4); + if (utils::strmatch(arg[iarg+4],"^v_")) varparse(arg[iarg+4],4); else zvalue = utils::numeric(FLERR,arg[iarg+4],false,lmp); if (!atom->sp_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); @@ -295,13 +295,13 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"quat") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); - if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); + if (utils::strmatch(arg[iarg+2],"^v_")) varparse(arg[iarg+2],2); else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); - if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); + if (utils::strmatch(arg[iarg+3],"^v_")) varparse(arg[iarg+3],3); else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); - if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) varparse(arg[iarg+4],4); + if (utils::strmatch(arg[iarg+4],"^v_")) varparse(arg[iarg+4],4); else wvalue = utils::numeric(FLERR,arg[iarg+4],false,lmp); if (!atom->ellipsoid_flag && !atom->tri_flag && !atom->body_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); @@ -320,7 +320,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"theta") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else { dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); dvalue *= MY_PI/180.0; @@ -342,11 +342,11 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"angmom") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); - if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); + if (utils::strmatch(arg[iarg+2],"^v_")) varparse(arg[iarg+2],2); else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); - if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); + if (utils::strmatch(arg[iarg+3],"^v_")) varparse(arg[iarg+3],3); else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (!atom->angmom_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); @@ -355,11 +355,11 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"omega") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); - if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); + if (utils::strmatch(arg[iarg+2],"^v_")) varparse(arg[iarg+2],2); else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); - if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); + if (utils::strmatch(arg[iarg+3],"^v_")) varparse(arg[iarg+3],3); else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (!atom->omega_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); @@ -368,7 +368,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"diameter") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->radius_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); @@ -378,7 +378,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"density") == 0 || (strcmp(arg[iarg],"density/disc") == 0)) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->rmass_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); @@ -394,7 +394,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"volume") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->vfrac_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); @@ -407,17 +407,17 @@ void Set::command(int narg, char **arg) ximageflag = yimageflag = zimageflag = 0; if (strcmp(arg[iarg+1],"NULL") != 0) { ximageflag = 1; - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else ximage = utils::inumeric(FLERR,arg[iarg+1],false,lmp); } if (strcmp(arg[iarg+2],"NULL") != 0) { yimageflag = 1; - if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); + if (utils::strmatch(arg[iarg+2],"^v_")) varparse(arg[iarg+2],2); else yimage = utils::inumeric(FLERR,arg[iarg+2],false,lmp); } if (strcmp(arg[iarg+3],"NULL") != 0) { zimageflag = 1; - if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); + if (utils::strmatch(arg[iarg+3],"^v_")) varparse(arg[iarg+3],3); else zimage = utils::inumeric(FLERR,arg[iarg+3],false,lmp); } if (ximageflag && ximage && !domain->xperiodic) @@ -474,7 +474,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"sph/e") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->esph_flag) error->all(FLERR,"Cannot set meso/e for this atom style"); @@ -483,7 +483,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"sph/cv") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->cv_flag) error->all(FLERR,"Cannot set meso/cv for this atom style"); @@ -492,7 +492,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"sph/rho") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->rho_flag) error->all(FLERR,"Cannot set meso/rho for this atom style"); @@ -502,7 +502,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"edpd/temp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strcmp(arg[iarg+1],"NULL") == 0) dvalue = -1.0; - else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + else if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else { dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (dvalue < 0.0) error->all(FLERR,"Illegal set command"); @@ -515,7 +515,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"edpd/cv") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strcmp(arg[iarg+1],"NULL") == 0) dvalue = -1.0; - else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + else if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else { dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (dvalue < 0.0) error->all(FLERR,"Illegal set command"); @@ -528,7 +528,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"cc") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal set command"); if (strcmp(arg[iarg+1],"NULL") == 0) dvalue = -1.0; - else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + else if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else { cc_index = utils::inumeric(FLERR,arg[iarg+1],false,lmp); dvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); @@ -541,7 +541,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"smd/mass/density") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->smd_flag) error->all(FLERR,"Cannot set smd/mass/density for this atom style"); @@ -550,7 +550,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"smd/contact/radius") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->smd_flag) error->all(FLERR,"Cannot set smd/contact/radius " @@ -561,7 +561,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"dpd/theta") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strcmp(arg[iarg+1],"NULL") == 0) dvalue = -1.0; - else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + else if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else { dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (dvalue < 0.0) error->all(FLERR,"Illegal set command"); @@ -571,9 +571,9 @@ void Set::command(int narg, char **arg) set(DPDTHETA); iarg += 2; - } else if (strstr(arg[iarg],"i_") == arg[iarg]) { + } else if (utils::strmatch(arg[iarg],"^i_")) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); int flag; index_custom = atom->find_custom(&arg[iarg][2],flag); @@ -582,9 +582,9 @@ void Set::command(int narg, char **arg) set(INAME); iarg += 2; - } else if (strstr(arg[iarg],"d_") == arg[iarg]) { + } else if (utils::strmatch(arg[iarg],"^d_")) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); int flag; index_custom = atom->find_custom(&arg[iarg][2],flag); diff --git a/src/variable.cpp b/src/variable.cpp index bd40920d3c..e8a2083b6f 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -3309,7 +3309,7 @@ tagint Variable::int_between_brackets(char *&ptr, int varallow) char *start = ++ptr; - if (varallow && strstr(ptr,"v_") == ptr) { + if (varallow && utils::strmatch(ptr,"^v_")) { varflag = 1; while (*ptr && *ptr != ']') { if (!isalnum(*ptr) && *ptr != '_') @@ -4112,7 +4112,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, // argument is compute - if (strstr(args[0],"c_") == args[0]) { + if (utils::strmatch(args[0],"^c_")) { ptr1 = strchr(args[0],'['); if (ptr1) { ptr2 = ptr1; @@ -4157,7 +4157,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, // argument is fix - } else if (strstr(args[0],"f_") == args[0]) { + } else if (utils::strmatch(args[0],"^f_")) { ptr1 = strchr(args[0],'['); if (ptr1) { ptr2 = ptr1; @@ -4195,7 +4195,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, // argument is vector-style variable - } else if (strstr(args[0],"v_") == args[0]) { + } else if (utils::strmatch(args[0],"^v_")) { ptr1 = strchr(args[0],'['); if (ptr1) { ptr2 = ptr1; diff --git a/src/velocity.cpp b/src/velocity.cpp index 1599dff1b4..ad3095e2cd 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -419,21 +419,21 @@ void Velocity::set(int /*narg*/, char **arg) xstyle = ystyle = zstyle = CONSTANT; xstr = ystr = zstr = nullptr; - if (strstr(arg[0],"v_") == arg[0]) { + if (utils::strmatch(arg[0],"^v_")) { int n = strlen(&arg[0][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[0][2]); } else if (strcmp(arg[0],"NULL") == 0) xstyle = NONE; else vx = utils::numeric(FLERR,arg[0],false,lmp); - if (strstr(arg[1],"v_") == arg[1]) { + if (utils::strmatch(arg[1],"^v_")) { int n = strlen(&arg[1][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[1][2]); } else if (strcmp(arg[1],"NULL") == 0) ystyle = NONE; else vy = utils::numeric(FLERR,arg[1],false,lmp); - if (strstr(arg[2],"v_") == arg[2]) { + if (utils::strmatch(arg[2],"^v_")) { int n = strlen(&arg[2][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[2][2]); From e5ead83c8f45ff14bcfee333db954d584e9e5452 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Thu, 4 Feb 2021 15:33:45 -0500 Subject: [PATCH 135/384] near->overlap keyword update --- doc/src/fix_bond_react.rst | 14 +++++++------- src/USER-REACTION/fix_bond_react.cpp | 16 ++++++++-------- src/USER-REACTION/fix_bond_react.h | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/src/fix_bond_react.rst b/doc/src/fix_bond_react.rst index f54ba29bd3..b995239d08 100755 --- a/doc/src/fix_bond_react.rst +++ b/doc/src/fix_bond_react.rst @@ -63,7 +63,7 @@ Syntax *fit* value = *all* or *fragmentID* all = use all eligible atoms for create-atoms fit (default) fragmentID = ID of molecule fragment used for create-atoms fit - *near* value = R + *overlap* value = R R = only insert atom/molecule if further than R from existing particles (distance units) Examples @@ -380,7 +380,7 @@ optimal translation and rotation of the post-reaction template to the reaction site (using a fit with atoms that are neither created nor deleted). The *modify_create* keyword can be used to modify the default behavior when creating atoms. The *modify_create* keyword has -two sub-keywords, *fit* and *near*. One or more of the sub-keywords +two sub-keywords, *fit* and *overlap*. One or more of the sub-keywords may be used after the *modify_create* keyword. The *fit* sub-keyword can be used to specify which post-reaction atoms are used for the optimal translation and rotation of the post-reaction template. The @@ -389,11 +389,11 @@ molecule fragment defined in the post-reaction :doc:`molecule ` template, and only atoms in this fragment are used for the fit. Atoms are created only if no current atom in the simulation is within a distance R of any created atom, including the effect of -periodic boundary conditions if applicable. R is defined by the *near* -sub-keyword. Note that the default value for R is 0.0, which will -allow atoms to strongly overlap if you are inserting where other atoms -are present. The velocity of each created atom is initialized in a -random direction with a magnitude calculated from the instantaneous +periodic boundary conditions if applicable. R is defined by the +*overlap* sub-keyword. Note that the default value for R is 0.0, which +will allow atoms to strongly overlap if you are inserting where other +atoms are present. The velocity of each created atom is initialized in +a random direction with a magnitude calculated from the instantaneous temperature of the reaction site. The handedness of atoms that are chiral centers can be enforced by diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index de1a0a1a41..5b298be18d 100755 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -213,7 +213,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : memory->create(custom_charges_fragid,nreacts,"bond/react:custom_charges_fragid"); memory->create(create_atoms_flag,nreacts,"bond/react:create_atoms_flag"); memory->create(modify_create_fragid,nreacts,"bond/react:modify_create_fragid"); - memory->create(nearsq,nreacts,"bond/react:nearsq"); + memory->create(overlapsq,nreacts,"bond/react:overlapsq"); memory->create(molecule_keyword,nreacts,"bond/react:molecule_keyword"); memory->create(nconstraints,nreacts,"bond/react:nconstraints"); memory->create(constraintstr,nreacts,MAXLINE,"bond/react:constraintstr"); @@ -239,7 +239,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : custom_charges_fragid[i] = -1; create_atoms_flag[i] = 0; modify_create_fragid[i] = -1; - nearsq[i] = 0; + overlapsq[i] = 0; molecule_keyword[i] = OFF; nconstraints[i] = 0; // set default limit duration to 60 timesteps @@ -419,11 +419,11 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : "'modify_create' keyword does not exist"); } iarg += 2; - } else if (strcmp(arg[iarg],"near") == 0) { + } else if (strcmp(arg[iarg],"overlap") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: " "'modify_create' has too few arguments"); - nearsq[rxn] = utils::numeric(FLERR,arg[iarg+1],false,lmp); - nearsq[rxn] *= nearsq[rxn]; + overlapsq[rxn] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + overlapsq[rxn] *= overlapsq[rxn]; iarg += 2; } else break; } @@ -616,7 +616,7 @@ FixBondReact::~FixBondReact() // need to delete rxn_name and constraintstr memory->destroy(create_atoms_flag); memory->destroy(modify_create_fragid); - memory->destroy(nearsq); + memory->destroy(overlapsq); memory->destroy(iatomtype); memory->destroy(jatomtype); @@ -3379,7 +3379,7 @@ int FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) // check distance between any existing atom and inserted atom // if less than near, abort - if (nearsq[rxnID] > 0) { + if (overlapsq[rxnID] > 0) { int abortflag = 0; for (int m = 0; m < twomol->natoms; m++) { if (create_atoms[m][rxnID] == 1) { @@ -3389,7 +3389,7 @@ int FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) delz = coords[m][2] - x[i][2]; domain->minimum_image(delx,dely,delz); rsq = delx*delx + dely*dely + delz*delz; - if (rsq < nearsq[rxnID]) { + if (rsq < overlapsq[rxnID]) { abortflag = 1; break; } diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h index d0b3d52625..87a5945d45 100755 --- a/src/USER-REACTION/fix_bond_react.h +++ b/src/USER-REACTION/fix_bond_react.h @@ -69,7 +69,7 @@ class FixBondReact : public Fix { int *custom_charges_fragid; int *create_atoms_flag; int *modify_create_fragid; - double *nearsq; + double *overlapsq; int *molecule_keyword; int maxnconstraints; int *nconstraints; From f5bf10e00f059d89f07e4009b36e99724eb3f835 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 4 Feb 2021 15:34:56 -0500 Subject: [PATCH 136/384] remove dead code --- src/utils.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils.h b/src/utils.h index c8c49b317c..a403217cfe 100644 --- a/src/utils.h +++ b/src/utils.h @@ -235,7 +235,6 @@ namespace LAMMPS_NS { inline bool has_utf8(const std::string &line) { - const unsigned char * const in = (const unsigned char *)line.c_str(); for (auto c : line) if (c & 0x80U) return true; return false; } From c1292598544613e520e3f7e747de24606f4fe12d Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Thu, 4 Feb 2021 15:49:16 -0500 Subject: [PATCH 137/384] rebase correction --- src/USER-REACTION/fix_bond_react.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 5b298be18d..0ef302137e 100755 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -1956,7 +1956,7 @@ int FixBondReact::check_constraints() } if (ANDgate != 1) satisfied[i] = 0; } else if (constraints[i][rxnID].type == ARRHENIUS) { - t = get_temperature(); + t = get_temperature(glove,0,1); prrhob = constraints[i][rxnID].par[1]*pow(t,constraints[i][rxnID].par[2])* exp(-constraints[i][rxnID].par[3]/(force->boltz*t)); if (prrhob < rrhandom[(int) constraints[i][rxnID].par[0]]->uniform()) satisfied[i] = 0; From 0f07215a2b28dcfe3f3968c24677a6cb6222bd95 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 4 Feb 2021 15:35:43 -0500 Subject: [PATCH 138/384] add utils::strdup() convenience function --- doc/src/Developer_utils.rst | 3 +++ src/utils.cpp | 12 ++++++++++++ src/utils.h | 11 +++++++++++ unittest/utils/test_utils.cpp | 15 +++++++++++++++ 4 files changed, 41 insertions(+) diff --git a/doc/src/Developer_utils.rst b/doc/src/Developer_utils.rst index f6e7d64c3e..2945420b5a 100644 --- a/doc/src/Developer_utils.rst +++ b/doc/src/Developer_utils.rst @@ -71,6 +71,9 @@ and parsing files or arguments. ---------- +.. doxygenfunction:: strdup + :project: progguide + .. doxygenfunction:: trim :project: progguide diff --git a/src/utils.cpp b/src/utils.cpp index 44dcc16f0c..ee2533e725 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -546,6 +546,18 @@ int utils::expand_args(const char *file, int line, int narg, char **arg, return newarg; } +/* ---------------------------------------------------------------------- + Make copy of string in new storage. Works like the (non-portable) + C-style strdup() but also accepts a C++ string as argument. +------------------------------------------------------------------------- */ + +char *utils::strdup(const std::string &text) +{ + char *tmp = new char[text.size()+1]; + strcpy(tmp,text.c_str()); + return tmp; +} + /* ---------------------------------------------------------------------- Return string without leading or trailing whitespace ------------------------------------------------------------------------- */ diff --git a/src/utils.h b/src/utils.h index a403217cfe..eece00f306 100644 --- a/src/utils.h +++ b/src/utils.h @@ -195,6 +195,17 @@ namespace LAMMPS_NS { int expand_args(const char *file, int line, int narg, char **arg, int mode, char **&earg, LAMMPS *lmp); + /** Make C-style copy of string in new storage + * + * This allocates a storage buffer and copies the C-style or + * C++ style string into it. The buffer is allocated with "new" + * and thus needs to be deallocated with "delete[]". + * + * \param text string that should be copied + * \return new buffer with copy of string */ + + char *strdup(const std::string &text); + /** Trim leading and trailing whitespace. Like TRIM() in Fortran. * * \param line string that should be trimmed diff --git a/unittest/utils/test_utils.cpp b/unittest/utils/test_utils.cpp index 80042be9b0..73a9449f6e 100644 --- a/unittest/utils/test_utils.cpp +++ b/unittest/utils/test_utils.cpp @@ -30,6 +30,21 @@ using ::testing::StrEq; #define FLERR __FILE__, __LINE__ #endif +TEST(Utils, strdup) +{ + std::string original("some_text"); + const char *copy = utils::strdup(original); + ASSERT_THAT(original, StrEq(copy)); + ASSERT_NE(copy,original.c_str()); + + const char *copy2 = utils::strdup(copy); + ASSERT_THAT(original, StrEq(copy2)); + ASSERT_NE(copy,copy2); + + delete[] copy; + delete[] copy2; +} + TEST(Utils, trim) { auto trimmed = utils::trim("\t some text"); From ab697be9e7d1a6d22fa6794338a7d3c7a729e646 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 4 Feb 2021 17:00:27 -0500 Subject: [PATCH 139/384] simplify using fmtlib --- src/USER-DIFFRACTION/fix_saed_vtk.cpp | 32 ++++++++++----------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/USER-DIFFRACTION/fix_saed_vtk.cpp b/src/USER-DIFFRACTION/fix_saed_vtk.cpp index 65bfd48237..26bc4dc0a1 100644 --- a/src/USER-DIFFRACTION/fix_saed_vtk.cpp +++ b/src/USER-DIFFRACTION/fix_saed_vtk.cpp @@ -386,15 +386,12 @@ void FixSAEDVTK::invoke_vector(bigint ntimestep) if (nOutput > 0) { fclose(fp); - char nName [128]; - snprintf(nName,128,"%s.%d.vtk",filename,nOutput); - fp = fopen(nName,"w"); + std::string nName = fmt::format("{}.{}.vtk",filename,nOutput); + fp = fopen(nName.c_str(),"w"); - if (fp == nullptr) { - char str[128]; - snprintf(str,128,"Cannot open fix saed/vtk file %s",nName); - error->one(FLERR,str); - } + if (fp == nullptr) + error->one(FLERR,fmt::format("Cannot open fix saed/vtk file {}: {}", + nName,utils::getsyserror())); } fprintf(fp,"# vtk DataFile Version 3.0 c_%s\n",ids); @@ -508,20 +505,15 @@ void FixSAEDVTK::options(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal fix saed/vtk command"); if (comm->me == 0) { - nOutput = 0; - int n = strlen(arg[iarg+1]) + 1; - filename = new char[n]; - strcpy(filename,arg[iarg+1]); + nOutput = 0; + filename = utils::strdup(arg[iarg+1]); - char nName [128]; - snprintf(nName,128,"%s.%d.vtk",filename,nOutput); - fp = fopen(nName,"w"); + std::string nName = fmt::format("{}.{}.vtk",filename,nOutput); + fp = fopen(nName.c_str(),"w"); - if (fp == nullptr) { - char str[128]; - snprintf(str,128,"Cannot open fix saed/vtk file %s",nName); - error->one(FLERR,str); - } + if (fp == nullptr) + error->one(FLERR,fmt::format("Cannot open fix saed/vtk file {}: {}", + nName,utils::getsyserror())); } iarg += 2; } else if (strcmp(arg[iarg],"ave") == 0) { From 24bf1e5b0c9c615e8355389277321992537975f7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 4 Feb 2021 17:00:44 -0500 Subject: [PATCH 140/384] make use of utils::strdup() --- src/MISC/fix_efield.cpp | 20 ++----- src/PYTHON/python_impl.cpp | 32 +++-------- src/RIGID/fix_rigid.cpp | 12 ++--- src/RIGID/fix_rigid_small.cpp | 53 ++++++++----------- src/SRD/fix_wall_srd.cpp | 4 +- src/USER-DRUDE/fix_langevin_drude.cpp | 37 ++++++------- src/USER-FEP/compute_fep.cpp | 38 ++++++-------- src/USER-FEP/fix_adapt_fep.cpp | 70 ++++++++---------------- src/USER-MISC/fix_addtorque.cpp | 27 ++++------ src/USER-SDPD/fix_meso_move.cpp | 44 ++++++---------- src/compute_property_atom.cpp | 16 +++--- src/dump_image.cpp | 76 ++++++++++----------------- src/fix_adapt.cpp | 72 +++++++++---------------- src/fix_addforce.cpp | 20 ++----- src/fix_aveforce.cpp | 16 ++---- src/fix_gravity.cpp | 28 +++------- src/fix_heat.cpp | 29 +++++----- src/fix_indent.cpp | 48 +++++------------ src/fix_langevin.cpp | 32 +++++------ src/fix_move.cpp | 52 ++++++++---------- src/fix_print.cpp | 8 +-- src/variable.cpp | 48 +++++------------ src/velocity.cpp | 12 ++--- 23 files changed, 277 insertions(+), 517 deletions(-) diff --git a/src/MISC/fix_efield.cpp b/src/MISC/fix_efield.cpp index 0dedfd0687..e8b7a6d11d 100644 --- a/src/MISC/fix_efield.cpp +++ b/src/MISC/fix_efield.cpp @@ -60,27 +60,21 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : xstr = ystr = zstr = nullptr; if (utils::strmatch(arg[3],"^v_")) { - int n = strlen(&arg[3][2]) + 1; - xstr = new char[n]; - strcpy(xstr,&arg[3][2]); + xstr = utils::strdup(arg[3]+2); } else { ex = qe2f * utils::numeric(FLERR,arg[3],false,lmp); xstyle = CONSTANT; } if (utils::strmatch(arg[4],"^v_")) { - int n = strlen(&arg[4][2]) + 1; - ystr = new char[n]; - strcpy(ystr,&arg[4][2]); + ystr = utils::strdup(arg[4]+2); } else { ey = qe2f * utils::numeric(FLERR,arg[4],false,lmp); ystyle = CONSTANT; } if (utils::strmatch(arg[5],"^v_")) { - int n = strlen(&arg[5][2]) + 1; - zstr = new char[n]; - strcpy(zstr,&arg[5][2]); + zstr = utils::strdup(arg[5]+2); } else { ez = qe2f * utils::numeric(FLERR,arg[5],false,lmp); zstyle = CONSTANT; @@ -99,16 +93,12 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : iregion = domain->find_region(arg[iarg+1]); if (iregion == -1) error->all(FLERR,"Region ID for fix efield does not exist"); - int n = strlen(arg[iarg+1]) + 1; - idregion = new char[n]; - strcpy(idregion,arg[iarg+1]); + idregion = utils::strdup(arg[iarg+1]); iarg += 2; } else if (strcmp(arg[iarg],"energy") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix efield command"); if (utils::strmatch(arg[iarg+1],"^v_")) { - int n = strlen(&arg[iarg+1][2]) + 1; - estr = new char[n]; - strcpy(estr,&arg[iarg+1][2]); + estr = utils::strdup(arg[iarg+1]+2); } else error->all(FLERR,"Illegal fix efield command"); iarg += 2; } else error->all(FLERR,"Illegal fix efield command"); diff --git a/src/PYTHON/python_impl.cpp b/src/PYTHON/python_impl.cpp index 0ddec34f7e..d1f602a1ea 100644 --- a/src/PYTHON/python_impl.cpp +++ b/src/PYTHON/python_impl.cpp @@ -184,9 +184,7 @@ void PythonImpl::command(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"format") == 0) { if (iarg+2 > narg) error->all(FLERR,"Invalid python command"); - int n = strlen(arg[iarg+1]) + 1; - format = new char[n]; - strcpy(format,arg[iarg+1]); + format = utils::strdup(arg[iarg+1]); iarg += 2; } else if (strcmp(arg[iarg],"length") == 0) { if (iarg+2 > narg) error->all(FLERR,"Invalid python command"); @@ -196,9 +194,7 @@ void PythonImpl::command(int narg, char **arg) } else if (strcmp(arg[iarg],"file") == 0) { if (iarg+2 > narg) error->all(FLERR,"Invalid python command"); delete[] pyfile; - int n = strlen(arg[iarg+1]) + 1; - pyfile = new char[n]; - strcpy(pyfile,arg[iarg+1]); + pyfile = utils::strdup(arg[iarg+1]); iarg += 2; } else if (strcmp(arg[iarg],"here") == 0) { if (iarg+2 > narg) error->all(FLERR,"Invalid python command"); @@ -424,9 +420,7 @@ int PythonImpl::create_entry(char *name) nfunc++; pfuncs = (PyFunc *) memory->srealloc(pfuncs,nfunc*sizeof(struct PyFunc),"python:pfuncs"); - int n = strlen(name) + 1; - pfuncs[ifunc].name = new char[n]; - strcpy(pfuncs[ifunc].name,name); + pfuncs[ifunc].name = utils::strdup(name); } else deallocate(ifunc); pfuncs[ifunc].ninput = ninput; @@ -452,9 +446,7 @@ int PythonImpl::create_entry(char *name) pfuncs[ifunc].itype[i] = INT; if (utils::strmatch(istr[i],"^v_")) { pfuncs[ifunc].ivarflag[i] = 1; - int n = strlen(&istr[i][2]) + 1; - pfuncs[ifunc].svalue[i] = new char[n]; - strcpy(pfuncs[ifunc].svalue[i],&istr[i][2]); + pfuncs[ifunc].svalue[i] = utils::strdup(istr[i]+2); } else { pfuncs[ifunc].ivarflag[i] = 0; pfuncs[ifunc].ivalue[i] = utils::inumeric(FLERR,istr[i],false,lmp); @@ -463,9 +455,7 @@ int PythonImpl::create_entry(char *name) pfuncs[ifunc].itype[i] = DOUBLE; if (utils::strmatch(istr[i],"^v_")) { pfuncs[ifunc].ivarflag[i] = 1; - int n = strlen(&istr[i][2]) + 1; - pfuncs[ifunc].svalue[i] = new char[n]; - strcpy(pfuncs[ifunc].svalue[i],&istr[i][2]); + pfuncs[ifunc].svalue[i] = utils::strdup(istr[i]+2); } else { pfuncs[ifunc].ivarflag[i] = 0; pfuncs[ifunc].dvalue[i] = utils::numeric(FLERR,istr[i],false,lmp); @@ -474,14 +464,10 @@ int PythonImpl::create_entry(char *name) pfuncs[ifunc].itype[i] = STRING; if (utils::strmatch(istr[i],"^v_")) { pfuncs[ifunc].ivarflag[i] = 1; - int n = strlen(&istr[i][2]) + 1; - pfuncs[ifunc].svalue[i] = new char[n]; - strcpy(pfuncs[ifunc].svalue[i],&istr[i][2]); + pfuncs[ifunc].svalue[i] = utils::strdup(istr[i]+2); } else { pfuncs[ifunc].ivarflag[i] = 0; - int n = strlen(istr[i]) + 1; - pfuncs[ifunc].svalue[i] = new char[n]; - strcpy(pfuncs[ifunc].svalue[i],istr[i]); + pfuncs[ifunc].svalue[i] = utils::strdup(istr[i]); } } else if (type == 'p') { pfuncs[ifunc].ivarflag[i] = 0; @@ -513,9 +499,7 @@ int PythonImpl::create_entry(char *name) } if (strstr(ostr,"v_") != ostr) error->all(FLERR,"Invalid python command"); - int n = strlen(&ostr[2]) + 1; - pfuncs[ifunc].ovarname = new char[n]; - strcpy(pfuncs[ifunc].ovarname,&ostr[2]); + pfuncs[ifunc].ovarname = utils::strdup(ostr+2); return ifunc; } diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index f837ab5c97..8a8456393c 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -502,9 +502,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : else { allremap = 0; delete [] id_dilate; - int n = strlen(arg[iarg+1]) + 1; - id_dilate = new char[n]; - strcpy(id_dilate,arg[iarg+1]); + id_dilate = utils::strdup(arg[iarg+1]); int idilate = group->find(id_dilate); if (idilate == -1) error->all(FLERR, @@ -531,9 +529,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"infile") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid command"); delete [] inpfile; - int n = strlen(arg[iarg+1]) + 1; - inpfile = new char[n]; - strcpy(inpfile,arg[iarg+1]); + inpfile = utils::strdup(arg[iarg+1]); restart_file = 1; reinitflag = 0; iarg += 2; @@ -548,9 +544,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"gravity") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid command"); delete [] id_gravity; - int n = strlen(arg[iarg+1]) + 1; - id_gravity = new char[n]; - strcpy(id_gravity,arg[iarg+1]); + id_gravity = utils::strdup(arg[iarg+1]); iarg += 2; } else error->all(FLERR,"Illegal fix rigid command"); diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 6e41bf9d8b..8129526d9c 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -13,37 +13,34 @@ #include "fix_rigid_small.h" -#include - -#include -#include -#include "math_extra.h" -#include "math_eigen.h" #include "atom.h" #include "atom_vec_ellipsoid.h" #include "atom_vec_line.h" #include "atom_vec_tri.h" -#include "molecule.h" -#include "domain.h" -#include "update.h" -#include "respa.h" -#include "modify.h" -#include "group.h" #include "comm.h" -#include "neighbor.h" -#include "force.h" -#include "input.h" -#include "variable.h" -#include "random_mars.h" -#include "math_const.h" -#include "hashlittle.h" -#include "memory.h" +#include "domain.h" #include "error.h" +#include "force.h" +#include "group.h" +#include "hashlittle.h" +#include "input.h" +#include "math_const.h" +#include "math_eigen.h" +#include "math_extra.h" +#include "memory.h" +#include "modify.h" +#include "molecule.h" +#include "neighbor.h" +#include "random_mars.h" +#include "respa.h" #include "rigid_const.h" +#include "update.h" +#include "variable.h" - - +#include +#include #include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -223,9 +220,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"infile") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid/small command"); delete [] inpfile; - int n = strlen(arg[iarg+1]) + 1; - inpfile = new char[n]; - strcpy(inpfile,arg[iarg+1]); + inpfile = utils::strdup(arg[iarg+1]); restart_file = 1; reinitflag = 0; iarg += 2; @@ -336,9 +331,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : else { allremap = 0; delete [] id_dilate; - int n = strlen(arg[iarg+1]) + 1; - id_dilate = new char[n]; - strcpy(id_dilate,arg[iarg+1]); + id_dilate = utils::strdup(arg[iarg+1]); int idilate = group->find(id_dilate); if (idilate == -1) error->all(FLERR,"Fix rigid/small nvt/npt/nph dilate group ID " @@ -365,9 +358,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"gravity") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid/small command"); delete [] id_gravity; - int n = strlen(arg[iarg+1]) + 1; - id_gravity = new char[n]; - strcpy(id_gravity,arg[iarg+1]); + id_gravity = utils::strdup(arg[iarg+1]); iarg += 2; } else error->all(FLERR,"Illegal fix rigid/small command"); diff --git a/src/SRD/fix_wall_srd.cpp b/src/SRD/fix_wall_srd.cpp index 4a56893233..f30ba5b8e0 100644 --- a/src/SRD/fix_wall_srd.cpp +++ b/src/SRD/fix_wall_srd.cpp @@ -71,9 +71,7 @@ FixWallSRD::FixWallSRD(LAMMPS *lmp, int narg, char **arg) : else coord0[nwall] = domain->boxhi[dim]; } else if (utils::strmatch(arg[iarg+1],"^v_")) { wallstyle[nwall] = VARIABLE; - int n = strlen(&arg[iarg+1][2]) + 1; - varstr[nwall] = new char[n]; - strcpy(varstr[nwall],&arg[iarg+1][2]); + varstr[nwall] = utils::strdup(arg[iarg+1]+2); } else { wallstyle[nwall] = CONSTANT; coord0[nwall] = utils::numeric(FLERR,arg[iarg+1],false,lmp); diff --git a/src/USER-DRUDE/fix_langevin_drude.cpp b/src/USER-DRUDE/fix_langevin_drude.cpp index ba475c092b..2dabec3a30 100644 --- a/src/USER-DRUDE/fix_langevin_drude.cpp +++ b/src/USER-DRUDE/fix_langevin_drude.cpp @@ -12,21 +12,22 @@ ------------------------------------------------------------------------- */ #include "fix_langevin_drude.h" +#include "fix_drude.h" + +#include "atom.h" +#include "comm.h" +#include "compute.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "input.h" +#include "modify.h" +#include "random_mars.h" +#include "update.h" +#include "variable.h" #include #include -#include "fix_drude.h" -#include "atom.h" -#include "force.h" -#include "comm.h" -#include "input.h" -#include "variable.h" -#include "random_mars.h" -#include "update.h" -#include "modify.h" -#include "compute.h" -#include "error.h" -#include "domain.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -50,9 +51,7 @@ FixLangevinDrude::FixLangevinDrude(LAMMPS *lmp, int narg, char **arg) : // core temperature tstr_core = nullptr; if (utils::strmatch(arg[3],"^v_")) { - int n = strlen(&arg[3][2]) + 1; - tstr_core = new char[n]; - strcpy(tstr_core,&arg[3][2]); + tstr_core = utils::strdup(arg[3]+2); tstyle_core = EQUAL; } else { t_start_core = utils::numeric(FLERR,arg[3],false,lmp); @@ -65,9 +64,7 @@ FixLangevinDrude::FixLangevinDrude(LAMMPS *lmp, int narg, char **arg) : // drude temperature tstr_drude = nullptr; if (strstr(arg[7],"v_") == arg[6]) { - int n = strlen(&arg[6][2]) + 1; - tstr_drude = new char[n]; - strcpy(tstr_drude,&arg[6][2]); + tstr_drude = utils::strdup(arg[6]+2); tstyle_drude = EQUAL; } else { t_start_drude = utils::numeric(FLERR,arg[6],false,lmp); @@ -184,9 +181,7 @@ int FixLangevinDrude::modify_param(int narg, char **arg) if (strcmp(arg[0],"temp") == 0) { if (narg < 2) error->all(FLERR,"Illegal fix_modify command"); delete [] id_temp; - int n = strlen(arg[1]) + 1; - id_temp = new char[n]; - strcpy(id_temp,arg[1]); + id_temp = utils::strdup(arg[1]); int icompute = modify->find_compute(id_temp); if (icompute < 0) diff --git a/src/USER-FEP/compute_fep.cpp b/src/USER-FEP/compute_fep.cpp index 33e5a309dc..920a65a5d8 100644 --- a/src/USER-FEP/compute_fep.cpp +++ b/src/USER-FEP/compute_fep.cpp @@ -16,25 +16,25 @@ ------------------------------------------------------------------------- */ #include "compute_fep.h" -#include -#include -#include "comm.h" -#include "update.h" #include "atom.h" +#include "comm.h" #include "domain.h" +#include "error.h" +#include "fix.h" #include "force.h" +#include "input.h" +#include "kspace.h" +#include "memory.h" +#include "modify.h" #include "pair.h" #include "pair_hybrid.h" -#include "kspace.h" -#include "input.h" -#include "fix.h" -#include "modify.h" -#include "variable.h" #include "timer.h" -#include "memory.h" -#include "error.h" +#include "update.h" +#include "variable.h" +#include +#include using namespace LAMMPS_NS; @@ -89,20 +89,14 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"pair") == 0) { perturb[npert].which = PAIR; - int n = strlen(arg[iarg+1]) + 1; - perturb[npert].pstyle = new char[n]; - strcpy(perturb[npert].pstyle,arg[iarg+1]); - n = strlen(arg[iarg+2]) + 1; - perturb[npert].pparam = new char[n]; - strcpy(perturb[npert].pparam,arg[iarg+2]); + perturb[npert].pstyle = utils::strdup(arg[iarg+1]); + perturb[npert].pparam = utils::strdup(arg[iarg+2]); utils::bounds(FLERR,arg[iarg+3],1,atom->ntypes, perturb[npert].ilo,perturb[npert].ihi,error); utils::bounds(FLERR,arg[iarg+4],1,atom->ntypes, perturb[npert].jlo,perturb[npert].jhi,error); if (utils::strmatch(arg[iarg+5],"^v_")) { - n = strlen(&arg[iarg+5][2]) + 1; - perturb[npert].var = new char[n]; - strcpy(perturb[npert].var,&arg[iarg+5][2]); + perturb[npert].var = utils::strdup(arg[iarg+5]+2); } else error->all(FLERR,"Illegal variable in compute fep"); npert++; iarg += 6; @@ -115,9 +109,7 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : utils::bounds(FLERR,arg[iarg+2],1,atom->ntypes, perturb[npert].ilo,perturb[npert].ihi,error); if (utils::strmatch(arg[iarg+3],"^v_")) { - int n = strlen(&arg[iarg+3][2]) + 1; - perturb[npert].var = new char[n]; - strcpy(perturb[npert].var,&arg[iarg+3][2]); + perturb[npert].var = utils::strdup(arg[iarg+3]+2); } else error->all(FLERR,"Illegal variable in compute fep"); npert++; iarg += 4; diff --git a/src/USER-FEP/fix_adapt_fep.cpp b/src/USER-FEP/fix_adapt_fep.cpp index e7a88e982a..15c9622d6a 100644 --- a/src/USER-FEP/fix_adapt_fep.cpp +++ b/src/USER-FEP/fix_adapt_fep.cpp @@ -16,23 +16,24 @@ ------------------------------------------------------------------------- */ #include "fix_adapt_fep.h" -#include + #include "atom.h" -#include "update.h" -#include "group.h" -#include "modify.h" -#include "force.h" -#include "pair.h" -#include "pair_hybrid.h" -#include "kspace.h" +#include "error.h" #include "fix_store.h" +#include "force.h" +#include "group.h" #include "input.h" -#include "variable.h" -#include "respa.h" +#include "kspace.h" #include "math_const.h" #include "memory.h" -#include "error.h" +#include "modify.h" +#include "pair.h" +#include "pair_hybrid.h" +#include "respa.h" +#include "update.h" +#include "variable.h" +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -88,20 +89,14 @@ FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"pair") == 0) { if (iarg+6 > narg) error->all(FLERR,"Illegal fix adapt/fep command"); adapt[nadapt].which = PAIR; - int n = strlen(arg[iarg+1]) + 1; - adapt[nadapt].pstyle = new char[n]; - strcpy(adapt[nadapt].pstyle,arg[iarg+1]); - n = strlen(arg[iarg+2]) + 1; - adapt[nadapt].pparam = new char[n]; - strcpy(adapt[nadapt].pparam,arg[iarg+2]); + adapt[nadapt].pstyle = utils::strdup(arg[iarg+1]); + adapt[nadapt].pparam = utils::strdup(arg[iarg+2]); utils::bounds(FLERR,arg[iarg+3],1,atom->ntypes, adapt[nadapt].ilo,adapt[nadapt].ihi,error); utils::bounds(FLERR,arg[iarg+4],1,atom->ntypes, adapt[nadapt].jlo,adapt[nadapt].jhi,error); if (utils::strmatch(arg[iarg+5],"^v_")) { - n = strlen(&arg[iarg+5][2]) + 1; - adapt[nadapt].var = new char[n]; - strcpy(adapt[nadapt].var,&arg[iarg+5][2]); + adapt[nadapt].var = utils::strdup(arg[iarg+5]+2); } else error->all(FLERR,"Illegal fix adapt/fep command"); nadapt++; iarg += 6; @@ -109,9 +104,7 @@ FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) : if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt/fep command"); adapt[nadapt].which = KSPACE; if (utils::strmatch(arg[iarg+1],"^v_")) { - int n = strlen(&arg[iarg+1][2]) + 1; - adapt[nadapt].var = new char[n]; - strcpy(adapt[nadapt].var,&arg[iarg+1][2]); + adapt[nadapt].var = utils::strdup(arg[iarg+1]+2); } else error->all(FLERR,"Illegal fix adapt/fep command"); nadapt++; iarg += 2; @@ -128,9 +121,7 @@ FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) : utils::bounds(FLERR,arg[iarg+2],1,atom->ntypes, adapt[nadapt].ilo,adapt[nadapt].ihi,error); if (utils::strmatch(arg[iarg+3],"^v_")) { - int n = strlen(&arg[iarg+3][2]) + 1; - adapt[nadapt].var = new char[n]; - strcpy(adapt[nadapt].var,&arg[iarg+3][2]); + adapt[nadapt].var = utils::strdup(arg[iarg+3]+2); } else error->all(FLERR,"Illegal fix adapt/fep command"); nadapt++; iarg += 4; @@ -223,20 +214,10 @@ void FixAdaptFEP::post_constructor() id_fix_diam = nullptr; id_fix_chg = nullptr; - char **newarg = new char*[6]; - newarg[1] = group->names[igroup]; - newarg[2] = (char *) "STORE"; - newarg[3] = (char *) "peratom"; - newarg[4] = (char *) "1"; - newarg[5] = (char *) "1"; - if (diamflag) { - int n = strlen(id) + strlen("_FIX_STORE_DIAM") + 1; - id_fix_diam = new char[n]; - strcpy(id_fix_diam,id); - strcat(id_fix_diam,"_FIX_STORE_DIAM"); - newarg[0] = id_fix_diam; - modify->add_fix(6,newarg); + auto cmd = fmt::format("{}_FIX_STORE_DIAM {} STORE peratom 1 1", + group->names[igroup]); + modify->add_fix(cmd); fix_diam = (FixStore *) modify->fix[modify->nfix-1]; if (fix_diam->restart_reset) fix_diam->restart_reset = 0; @@ -254,12 +235,9 @@ void FixAdaptFEP::post_constructor() } if (chgflag) { - int n = strlen(id) + strlen("_FIX_STORE_CHG") + 1; - id_fix_chg = new char[n]; - strcpy(id_fix_chg,id); - strcat(id_fix_chg,"_FIX_STORE_CHG"); - newarg[0] = id_fix_chg; - modify->add_fix(6,newarg); + auto cmd = fmt::format("{}_FIX_STORE_CHG {} STORE peratom 1 1", + group->names[igroup]); + modify->add_fix(cmd); fix_chg = (FixStore *) modify->fix[modify->nfix-1]; if (fix_chg->restart_reset) fix_chg->restart_reset = 0; @@ -275,8 +253,6 @@ void FixAdaptFEP::post_constructor() } } } - - delete [] newarg; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-MISC/fix_addtorque.cpp b/src/USER-MISC/fix_addtorque.cpp index 713cc7cc4e..ce59676595 100644 --- a/src/USER-MISC/fix_addtorque.cpp +++ b/src/USER-MISC/fix_addtorque.cpp @@ -17,17 +17,18 @@ #include "fix_addtorque.h" -#include #include "atom.h" -#include "update.h" -#include "modify.h" #include "domain.h" -#include "respa.h" -#include "input.h" -#include "variable.h" #include "error.h" -#include "group.h" #include "force.h" +#include "group.h" +#include "input.h" +#include "modify.h" +#include "respa.h" +#include "update.h" +#include "variable.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -54,25 +55,19 @@ FixAddTorque::FixAddTorque(LAMMPS *lmp, int narg, char **arg) : xstr = ystr = zstr = nullptr; if (utils::strmatch(arg[3],"^v_")) { - int n = strlen(&arg[3][2]) + 1; - xstr = new char[n]; - strcpy(xstr,&arg[3][2]); + xstr = utils::strdup(arg[3]+2); } else { xvalue = utils::numeric(FLERR,arg[3],false,lmp); xstyle = CONSTANT; } if (utils::strmatch(arg[4],"^v_")) { - int n = strlen(&arg[4][2]) + 1; - ystr = new char[n]; - strcpy(ystr,&arg[4][2]); + ystr = utils::strdup(arg[4]+2); } else { yvalue = utils::numeric(FLERR,arg[4],false,lmp); ystyle = CONSTANT; } if (utils::strmatch(arg[5],"^v_")) { - int n = strlen(&arg[5][2]) + 1; - zstr = new char[n]; - strcpy(zstr,&arg[5][2]); + zstr = utils::strdup(arg[5]+2); } else { zvalue = utils::numeric(FLERR,arg[5],false,lmp); zstyle = CONSTANT; diff --git a/src/USER-SDPD/fix_meso_move.cpp b/src/USER-SDPD/fix_meso_move.cpp index bc93672c43..38d0966c8f 100644 --- a/src/USER-SDPD/fix_meso_move.cpp +++ b/src/USER-SDPD/fix_meso_move.cpp @@ -17,20 +17,22 @@ ------------------------------------------------------------------------- */ #include "fix_meso_move.h" -#include -#include + #include "atom.h" -#include "update.h" -#include "modify.h" -#include "force.h" -#include "domain.h" -#include "lattice.h" #include "comm.h" +#include "domain.h" +#include "error.h" +#include "force.h" #include "input.h" -#include "variable.h" +#include "lattice.h" #include "math_const.h" #include "memory.h" -#include "error.h" +#include "modify.h" +#include "update.h" +#include "variable.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -128,39 +130,27 @@ FixMesoMove::FixMesoMove (LAMMPS *lmp, int narg, char **arg) : mstyle = VARIABLE; if (strcmp(arg[4],"NULL") == 0) xvarstr = nullptr; else if (utils::strmatch(arg[4],"^v_")) { - int n = strlen(&arg[4][2]) + 1; - xvarstr = new char[n]; - strcpy(xvarstr,&arg[4][2]); + xvarstr = utils::strdup(arg[4]+2); } else error->all(FLERR,"Illegal fix meso/move command"); if (strcmp(arg[5],"NULL") == 0) yvarstr = nullptr; else if (utils::strmatch(arg[5],"^v_")) { - int n = strlen(&arg[5][2]) + 1; - yvarstr = new char[n]; - strcpy(yvarstr,&arg[5][2]); + yvarstr = utils::strdup(arg[5]+2); } else error->all(FLERR,"Illegal fix meso/move command"); if (strcmp(arg[6],"NULL") == 0) zvarstr = nullptr; else if (utils::strmatch(arg[6],"^v_")) { - int n = strlen(&arg[6][2]) + 1; - zvarstr = new char[n]; - strcpy(zvarstr,&arg[6][2]); + zvarstr = utils::strdup(arg[6]+2); } else error->all(FLERR,"Illegal fix meso/move command"); if (strcmp(arg[7],"NULL") == 0) vxvarstr = nullptr; else if (utils::strmatch(arg[7],"^v_")) { - int n = strlen(&arg[7][2]) + 1; - vxvarstr = new char[n]; - strcpy(vxvarstr,&arg[7][2]); + vxvarstr = utils::strdup(arg[7]+2); } else error->all(FLERR,"Illegal fix meso/move command"); if (strcmp(arg[8],"NULL") == 0) vyvarstr = nullptr; else if (utils::strmatch(arg[8],"^v_")) { - int n = strlen(&arg[8][2]) + 1; - vyvarstr = new char[n]; - strcpy(vyvarstr,&arg[8][2]); + vyvarstr = utils::strdup(arg[8]+2); } else error->all(FLERR,"Illegal fix meso/move command"); if (strcmp(arg[9],"NULL") == 0) vzvarstr = nullptr; else if (utils::strmatch(arg[9],"^v_")) { - int n = strlen(&arg[9][2]) + 1; - vzvarstr = new char[n]; - strcpy(vzvarstr,&arg[9][2]); + vzvarstr = utils::strdup(arg[9]+2); } else error->all(FLERR,"Illegal fix meso/move command"); } else error->all(FLERR,"Illegal fix meso/move command"); diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp index 6da82e0e57..cb45753e8e 100644 --- a/src/compute_property_atom.cpp +++ b/src/compute_property_atom.cpp @@ -12,20 +12,22 @@ ------------------------------------------------------------------------- */ #include "compute_property_atom.h" -#include -#include -#include "math_extra.h" + #include "atom.h" #include "atom_vec.h" +#include "atom_vec_body.h" #include "atom_vec_ellipsoid.h" #include "atom_vec_line.h" #include "atom_vec_tri.h" -#include "atom_vec_body.h" -#include "update.h" -#include "domain.h" #include "comm.h" -#include "memory.h" +#include "domain.h" #include "error.h" +#include "math_extra.h" +#include "memory.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; diff --git a/src/dump_image.cpp b/src/dump_image.cpp index 09db165173..9fc05aaf71 100644 --- a/src/dump_image.cpp +++ b/src/dump_image.cpp @@ -13,29 +13,29 @@ #include "dump_image.h" +#include "atom.h" +#include "atom_vec.h" +#include "atom_vec_body.h" +#include "atom_vec_line.h" +#include "atom_vec_tri.h" +#include "body.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "fix.h" +#include "force.h" +#include "image.h" +#include "input.h" +#include "math_const.h" +#include "math_extra.h" +#include "memory.h" +#include "modify.h" +#include "molecule.h" +#include "variable.h" + #include #include #include -#include "image.h" -#include "atom.h" -#include "atom_vec.h" -#include "atom_vec_line.h" -#include "atom_vec_tri.h" -#include "atom_vec_body.h" -#include "body.h" -#include "molecule.h" -#include "domain.h" -#include "force.h" -#include "comm.h" -#include "modify.h" -#include "fix.h" -#include "input.h" -#include "variable.h" -#include "math_const.h" -#include "math_extra.h" -#include "error.h" -#include "memory.h" - using namespace LAMMPS_NS; using namespace MathConst; @@ -226,9 +226,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"view") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command"); if (utils::strmatch(arg[iarg+1],"^v_")) { - int n = strlen(&arg[iarg+1][2]) + 1; - thetastr = new char[n]; - strcpy(thetastr,&arg[iarg+1][2]); + thetastr = utils::strdup(arg[iarg+1]+2); } else { double theta = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (theta < 0.0 || theta > 180.0) @@ -237,9 +235,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : image->theta = theta; } if (utils::strmatch(arg[iarg+2],"^v_")) { - int n = strlen(&arg[iarg+2][2]) + 1; - phistr = new char[n]; - strcpy(phistr,&arg[iarg+2][2]); + phistr = utils::strdup(arg[iarg+2]+2); } else { double phi = utils::numeric(FLERR,arg[iarg+2],false,lmp); phi *= MY_PI/180.0; @@ -253,21 +249,15 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[iarg+1],"d") == 0) cflag = DYNAMIC; else error->all(FLERR,"Illegal dump image command"); if (utils::strmatch(arg[iarg+2],"^v_")) { - int n = strlen(&arg[iarg+2][2]) + 1; - cxstr = new char[n]; - strcpy(cxstr,&arg[iarg+2][2]); + cxstr = utils::strdup(arg[iarg+2]+2); cflag = DYNAMIC; } else cx = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (utils::strmatch(arg[iarg+3],"^v_")) { - int n = strlen(&arg[iarg+3][2]) + 1; - cystr = new char[n]; - strcpy(cystr,&arg[iarg+3][2]); + cystr = utils::strdup(arg[iarg+3]+2); cflag = DYNAMIC; } else cy = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (utils::strmatch(arg[iarg+4],"^v_")) { - int n = strlen(&arg[iarg+4][2]) + 1; - czstr = new char[n]; - strcpy(czstr,&arg[iarg+4][2]); + czstr = utils::strdup(arg[iarg+4]+2); cflag = DYNAMIC; } else cz = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; @@ -275,28 +265,20 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"up") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command"); if (utils::strmatch(arg[iarg+1],"^v_")) { - int n = strlen(&arg[iarg+1][2]) + 1; - upxstr = new char[n]; - strcpy(upxstr,&arg[iarg+1][2]); + upxstr = utils::strdup(arg[iarg+1]+2); } else image->up[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (utils::strmatch(arg[iarg+2],"^v_")) { - int n = strlen(&arg[iarg+2][2]) + 1; - upystr = new char[n]; - strcpy(upystr,&arg[iarg+2][2]); + upystr = utils::strdup(arg[iarg+2]+2); } else image->up[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (utils::strmatch(arg[iarg+3],"^v_")) { - int n = strlen(&arg[iarg+3][2]) + 1; - upzstr = new char[n]; - strcpy(upzstr,&arg[iarg+3][2]); + upzstr = utils::strdup(arg[iarg+3]+2); } else image->up[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"zoom") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command"); if (utils::strmatch(arg[iarg+1],"^v_")) { - int n = strlen(&arg[iarg+1][2]) + 1; - zoomstr = new char[n]; - strcpy(zoomstr,&arg[iarg+1][2]); + zoomstr = utils::strdup(arg[iarg+1]+2); } else { double zoom = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (zoom <= 0.0) error->all(FLERR,"Illegal dump image command"); diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp index 6e548e7e57..ff634ba298 100644 --- a/src/fix_adapt.cpp +++ b/src/fix_adapt.cpp @@ -12,26 +12,26 @@ ------------------------------------------------------------------------- */ #include "fix_adapt.h" -#include + #include "atom.h" #include "bond.h" #include "domain.h" -#include "update.h" -#include "group.h" -#include "modify.h" -#include "force.h" -#include "pair.h" -#include "pair_hybrid.h" -#include "kspace.h" +#include "error.h" #include "fix_store.h" +#include "force.h" +#include "group.h" #include "input.h" -#include "variable.h" -#include "respa.h" +#include "kspace.h" #include "math_const.h" #include "memory.h" -#include "error.h" - +#include "modify.h" +#include "pair.h" +#include "pair_hybrid.h" +#include "respa.h" +#include "update.h" +#include "variable.h" +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -91,21 +91,15 @@ nadapt(0), id_fix_diam(nullptr), id_fix_chg(nullptr), adapt(nullptr) if (strcmp(arg[iarg],"pair") == 0) { if (iarg+6 > narg) error->all(FLERR,"Illegal fix adapt command"); adapt[nadapt].which = PAIR; - int n = strlen(arg[iarg+1]) + 1; - adapt[nadapt].pstyle = new char[n]; - strcpy(adapt[nadapt].pstyle,arg[iarg+1]); - n = strlen(arg[iarg+2]) + 1; - adapt[nadapt].pparam = new char[n]; adapt[nadapt].pair = nullptr; - strcpy(adapt[nadapt].pparam,arg[iarg+2]); + adapt[nadapt].pstyle = utils::strdup(arg[iarg+1]); + adapt[nadapt].pparam = utils::strdup(arg[iarg+2]); utils::bounds(FLERR,arg[iarg+3],1,atom->ntypes, adapt[nadapt].ilo,adapt[nadapt].ihi,error); utils::bounds(FLERR,arg[iarg+4],1,atom->ntypes, adapt[nadapt].jlo,adapt[nadapt].jhi,error); if (utils::strmatch(arg[iarg+5],"^v_")) { - n = strlen(&arg[iarg+5][2]) + 1; - adapt[nadapt].var = new char[n]; - strcpy(adapt[nadapt].var,&arg[iarg+5][2]); + adapt[nadapt].var = utils::strdup(arg[iarg+5]+2); } else error->all(FLERR,"Illegal fix adapt command"); nadapt++; iarg += 6; @@ -113,19 +107,13 @@ nadapt(0), id_fix_diam(nullptr), id_fix_chg(nullptr), adapt(nullptr) } else if (strcmp(arg[iarg],"bond") == 0) { if (iarg+5 > narg) error->all(FLERR, "Illegal fix adapt command"); adapt[nadapt].which = BOND; - int n = strlen(arg[iarg+1]) + 1; - adapt[nadapt].bstyle = new char[n]; - strcpy(adapt[nadapt].bstyle,arg[iarg+1]); - n = strlen(arg[iarg+2]) + 1; - adapt[nadapt].bparam = new char[n]; adapt[nadapt].bond = nullptr; - strcpy(adapt[nadapt].bparam,arg[iarg+2]); + adapt[nadapt].bstyle = utils::strdup(arg[iarg+1]); + adapt[nadapt].bparam = utils::strdup(arg[iarg+2]); utils::bounds(FLERR,arg[iarg+3],1,atom->nbondtypes, adapt[nadapt].ilo,adapt[nadapt].ihi,error); if (utils::strmatch(arg[iarg+4],"^v_")) { - n = strlen(&arg[iarg+4][2]) + 1; - adapt[nadapt].var = new char[n]; - strcpy(adapt[nadapt].var,&arg[iarg+4][2]); + adapt[nadapt].var = utils::strdup(arg[iarg+4]+2); } else error->all(FLERR,"Illegal fix adapt command"); nadapt++; iarg += 5; @@ -134,9 +122,7 @@ nadapt(0), id_fix_diam(nullptr), id_fix_chg(nullptr), adapt(nullptr) if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt command"); adapt[nadapt].which = KSPACE; if (utils::strmatch(arg[iarg+1],"^v_")) { - int n = strlen(&arg[iarg+1][2]) + 1; - adapt[nadapt].var = new char[n]; - strcpy(adapt[nadapt].var,&arg[iarg+1][2]); + adapt[nadapt].var = utils::strdup(arg[iarg+1]+2); } else error->all(FLERR,"Illegal fix adapt command"); nadapt++; iarg += 2; @@ -155,9 +141,7 @@ nadapt(0), id_fix_diam(nullptr), id_fix_chg(nullptr), adapt(nullptr) chgflag = 1; } else error->all(FLERR,"Illegal fix adapt command"); if (utils::strmatch(arg[iarg+2],"^v_")) { - int n = strlen(&arg[iarg+2][2]) + 1; - adapt[nadapt].var = new char[n]; - strcpy(adapt[nadapt].var,&arg[iarg+2][2]); + adapt[nadapt].var = utils::strdup(arg[iarg+2]+2); } else error->all(FLERR,"Illegal fix adapt command"); nadapt++; iarg += 3; @@ -268,8 +252,7 @@ void FixAdapt::post_constructor() if (diamflag && atom->radius_flag) { std::string fixcmd = id + std::string("_FIX_STORE_DIAM"); - id_fix_diam = new char[fixcmd.size()+1]; - strcpy(id_fix_diam,fixcmd.c_str()); + id_fix_diam = utils::strdup(fixcmd); fixcmd += fmt::format(" {} STORE peratom 1 1",group->names[igroup]); modify->add_fix(fixcmd); fix_diam = (FixStore *) modify->fix[modify->nfix-1]; @@ -290,8 +273,7 @@ void FixAdapt::post_constructor() if (chgflag && atom->q_flag) { std::string fixcmd = id + std::string("_FIX_STORE_CHG"); - id_fix_chg = new char[fixcmd.size()+1]; - strcpy(id_fix_chg,fixcmd.c_str()); + id_fix_chg = utils::strdup(fixcmd); fixcmd += fmt::format(" {} STORE peratom 1 1",group->names[igroup]); modify->add_fix(fixcmd); fix_chg = (FixStore *) modify->fix[modify->nfix-1]; @@ -346,10 +328,7 @@ void FixAdapt::init() // strip it for pstyle arg to pair_match() and set nsub = N // this should work for appended suffixes as well - int n = strlen(ad->pstyle) + 1; - char *pstyle = new char[n]; - strcpy(pstyle,ad->pstyle); - + char *pstyle = strdup(ad->pstyle); char *cptr; int nsub = 0; if ((cptr = strchr(pstyle,':'))) { @@ -399,10 +378,7 @@ void FixAdapt::init() ad->bond = nullptr; anybond = 1; - int n = strlen(ad->bstyle) + 1; - char *bstyle = new char[n]; - strcpy(bstyle,ad->bstyle); - + char *bstyle = utils::strdup(ad->bstyle); if (lmp->suffix_enable) { int len = 2 + strlen(bstyle) + strlen(lmp->suffix); char *bsuffix = new char[len]; diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp index 1f46280539..28b8a23e3c 100644 --- a/src/fix_addforce.cpp +++ b/src/fix_addforce.cpp @@ -55,25 +55,19 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : xstr = ystr = zstr = nullptr; if (utils::strmatch(arg[3],"^v_")) { - int n = strlen(&arg[3][2]) + 1; - xstr = new char[n]; - strcpy(xstr,&arg[3][2]); + xstr = utils::strdup(arg[3]+2); } else { xvalue = utils::numeric(FLERR,arg[3],false,lmp); xstyle = CONSTANT; } if (utils::strmatch(arg[4],"^v_")) { - int n = strlen(&arg[4][2]) + 1; - ystr = new char[n]; - strcpy(ystr,&arg[4][2]); + ystr = utils::strdup(arg[4]+2); } else { yvalue = utils::numeric(FLERR,arg[4],false,lmp); ystyle = CONSTANT; } if (utils::strmatch(arg[5],"^v_")) { - int n = strlen(&arg[5][2]) + 1; - zstr = new char[n]; - strcpy(zstr,&arg[5][2]); + zstr = utils::strdup(arg[5]+2); } else { zvalue = utils::numeric(FLERR,arg[5],false,lmp); zstyle = CONSTANT; @@ -96,16 +90,12 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : iregion = domain->find_region(arg[iarg+1]); if (iregion == -1) error->all(FLERR,"Region ID for fix addforce does not exist"); - int n = strlen(arg[iarg+1]) + 1; - idregion = new char[n]; - strcpy(idregion,arg[iarg+1]); + idregion = utils::strdup(arg[iarg+1]); iarg += 2; } else if (strcmp(arg[iarg],"energy") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix addforce command"); if (utils::strmatch(arg[iarg+1],"^v_")) { - int n = strlen(&arg[iarg+1][2]) + 1; - estr = new char[n]; - strcpy(estr,&arg[iarg+1][2]); + estr = utils::strdup(arg[iarg+1]+2); } else error->all(FLERR,"Illegal fix addforce command"); iarg += 2; } else error->all(FLERR,"Illegal fix addforce command"); diff --git a/src/fix_aveforce.cpp b/src/fix_aveforce.cpp index 21dbf1f536..5ce50aafea 100644 --- a/src/fix_aveforce.cpp +++ b/src/fix_aveforce.cpp @@ -49,9 +49,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : xstr = ystr = zstr = nullptr; if (utils::strmatch(arg[3],"^v_")) { - int n = strlen(&arg[3][2]) + 1; - xstr = new char[n]; - strcpy(xstr,&arg[3][2]); + xstr = utils::strdup(arg[3]+2); } else if (strcmp(arg[3],"NULL") == 0) { xstyle = NONE; } else { @@ -59,9 +57,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : xstyle = CONSTANT; } if (utils::strmatch(arg[4],"^v_")) { - int n = strlen(&arg[4][2]) + 1; - ystr = new char[n]; - strcpy(ystr,&arg[4][2]); + ystr = utils::strdup(arg[4]+2); } else if (strcmp(arg[4],"NULL") == 0) { ystyle = NONE; } else { @@ -69,9 +65,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : ystyle = CONSTANT; } if (utils::strmatch(arg[5],"^v_")) { - int n = strlen(&arg[5][2]) + 1; - zstr = new char[n]; - strcpy(zstr,&arg[5][2]); + zstr = utils::strdup(arg[5]+2); } else if (strcmp(arg[5],"NULL") == 0) { zstyle = NONE; } else { @@ -91,9 +85,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : iregion = domain->find_region(arg[iarg+1]); if (iregion == -1) error->all(FLERR,"Region ID for fix aveforce does not exist"); - int n = strlen(arg[iarg+1]) + 1; - idregion = new char[n]; - strcpy(idregion,arg[iarg+1]); + idregion = utils::strdup(arg[iarg+1]); iarg += 2; } else error->all(FLERR,"Illegal fix aveforce command"); diff --git a/src/fix_gravity.cpp b/src/fix_gravity.cpp index 4e384b5281..f9f1dc317f 100644 --- a/src/fix_gravity.cpp +++ b/src/fix_gravity.cpp @@ -53,9 +53,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : mstyle = vstyle = pstyle = tstyle = xstyle = ystyle = zstyle = CONSTANT; if (utils::strmatch(arg[3],"^v_")) { - int n = strlen(&arg[3][2]) + 1; - mstr = new char[n]; - strcpy(mstr,&arg[3][2]); + mstr = utils::strdup(arg[3]+2); mstyle = EQUAL; } else { magnitude = utils::numeric(FLERR,arg[3],false,lmp); @@ -68,9 +66,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : if (narg < 6) error->all(FLERR,"Illegal fix gravity command"); style = CHUTE; if (utils::strmatch(arg[5],"^v_")) { - int n = strlen(&arg[5][2]) + 1; - vstr = new char[n]; - strcpy(vstr,&arg[5][2]); + vstr = utils::strdup(arg[5]+2); vstyle = EQUAL; } else { vert = utils::numeric(FLERR,arg[5],false,lmp); @@ -82,18 +78,14 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : if (narg < 7) error->all(FLERR,"Illegal fix gravity command"); style = SPHERICAL; if (utils::strmatch(arg[5],"^v_")) { - int n = strlen(&arg[5][2]) + 1; - pstr = new char[n]; - strcpy(pstr,&arg[5][2]); + pstr = utils::strdup(arg[5]+2); pstyle = EQUAL; } else { phi = utils::numeric(FLERR,arg[5],false,lmp); pstyle = CONSTANT; } if (utils::strmatch(arg[6],"^v_")) { - int n = strlen(&arg[6][2]) + 1; - tstr = new char[n]; - strcpy(tstr,&arg[6][2]); + tstr = utils::strdup(arg[6]+2); tstyle = EQUAL; } else { theta = utils::numeric(FLERR,arg[6],false,lmp); @@ -105,27 +97,21 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : if (narg < 8) error->all(FLERR,"Illegal fix gravity command"); style = VECTOR; if (utils::strmatch(arg[5],"^v_")) { - int n = strlen(&arg[5][2]) + 1; - xstr = new char[n]; - strcpy(xstr,&arg[5][2]); + xstr = utils::strdup(arg[5]+2); xstyle = EQUAL; } else { xdir = utils::numeric(FLERR,arg[5],false,lmp); xstyle = CONSTANT; } if (utils::strmatch(arg[6],"^v_")) { - int n = strlen(&arg[6][2]) + 1; - ystr = new char[n]; - strcpy(ystr,&arg[6][2]); + ystr = utils::strdup(arg[6]+2); ystyle = EQUAL; } else { ydir = utils::numeric(FLERR,arg[6],false,lmp); ystyle = CONSTANT; } if (utils::strmatch(arg[7],"^v_")) { - int n = strlen(&arg[7][2]) + 1; - zstr = new char[n]; - strcpy(zstr,&arg[7][2]); + zstr = utils::strdup(arg[7]+2); zstyle = EQUAL; } else { zdir = utils::numeric(FLERR,arg[7],false,lmp); diff --git a/src/fix_heat.cpp b/src/fix_heat.cpp index d75010985d..920d06dc49 100644 --- a/src/fix_heat.cpp +++ b/src/fix_heat.cpp @@ -17,19 +17,20 @@ #include "fix_heat.h" -#include -#include #include "atom.h" #include "domain.h" -#include "region.h" -#include "group.h" -#include "force.h" -#include "update.h" -#include "modify.h" -#include "input.h" -#include "variable.h" -#include "memory.h" #include "error.h" +#include "force.h" +#include "group.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "region.h" +#include "update.h" +#include "variable.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -53,9 +54,7 @@ idregion(nullptr), hstr(nullptr), vheat(nullptr), vscale(nullptr) hstr = nullptr; if (utils::strmatch(arg[4],"^v_")) { - int n = strlen(&arg[4][2]) + 1; - hstr = new char[n]; - strcpy(hstr,&arg[4][2]); + hstr = utils::strdup(arg[4]+2); } else { heat_input = utils::numeric(FLERR,arg[4],false,lmp); hstyle = CONSTANT; @@ -72,9 +71,7 @@ idregion(nullptr), hstr(nullptr), vheat(nullptr), vscale(nullptr) iregion = domain->find_region(arg[iarg+1]); if (iregion == -1) error->all(FLERR,"Region ID for fix heat does not exist"); - int n = strlen(arg[iarg+1]) + 1; - idregion = new char[n]; - strcpy(idregion,arg[iarg+1]); + idregion = utils::strdup(arg[iarg+1]); iarg += 2; } else error->all(FLERR,"Illegal fix heat command"); } diff --git a/src/fix_indent.cpp b/src/fix_indent.cpp index fa23a6044d..8040cf10d1 100644 --- a/src/fix_indent.cpp +++ b/src/fix_indent.cpp @@ -418,24 +418,16 @@ void FixIndent::options(int narg, char **arg) if (iarg+5 > narg) error->all(FLERR,"Illegal fix indent command"); if (utils::strmatch(arg[iarg+1],"^v_")) { - int n = strlen(&arg[iarg+1][2]) + 1; - xstr = new char[n]; - strcpy(xstr,&arg[iarg+1][2]); + xstr = utils::strdup(arg[iarg+1]+2); } else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (utils::strmatch(arg[iarg+2],"^v_")) { - int n = strlen(&arg[iarg+2][2]) + 1; - ystr = new char[n]; - strcpy(ystr,&arg[iarg+2][2]); + ystr = utils::strdup(arg[iarg+2]+2); } else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (utils::strmatch(arg[iarg+3],"^v_")) { - int n = strlen(&arg[iarg+3][2]) + 1; - zstr = new char[n]; - strcpy(zstr,&arg[iarg+3][2]); + zstr = utils::strdup(arg[iarg+3]+2); } else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (utils::strmatch(arg[iarg+4],"^v_")) { - int n = strlen(&arg[iarg+4][2]) + 1; - rstr = new char[n]; - strcpy(rstr,&arg[iarg+4][2]); + rstr = utils::strdup(arg[iarg+4]+2); } else rvalue = utils::numeric(FLERR,arg[iarg+4],false,lmp); istyle = SPHERE; @@ -447,45 +439,31 @@ void FixIndent::options(int narg, char **arg) if (strcmp(arg[iarg+1],"x") == 0) { cdim = 0; if (utils::strmatch(arg[iarg+2],"^v_")) { - int n = strlen(&arg[iarg+2][2]) + 1; - ystr = new char[n]; - strcpy(ystr,&arg[iarg+2][2]); + ystr = utils::strdup(arg[iarg+2]+2); } else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (utils::strmatch(arg[iarg+3],"^v_")) { - int n = strlen(&arg[iarg+3][2]) + 1; - zstr = new char[n]; - strcpy(zstr,&arg[iarg+3][2]); + zstr = utils::strdup(arg[iarg+3]+2); } else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); } else if (strcmp(arg[iarg+1],"y") == 0) { cdim = 1; if (utils::strmatch(arg[iarg+2],"^v_")) { - int n = strlen(&arg[iarg+2][2]) + 1; - xstr = new char[n]; - strcpy(xstr,&arg[iarg+2][2]); + xstr = utils::strdup(arg[iarg+2]+2); } else xvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (utils::strmatch(arg[iarg+3],"^v_")) { - int n = strlen(&arg[iarg+3][2]) + 1; - zstr = new char[n]; - strcpy(zstr,&arg[iarg+3][2]); + zstr = utils::strdup(arg[iarg+3]+2); } else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); } else if (strcmp(arg[iarg+1],"z") == 0) { cdim = 2; if (utils::strmatch(arg[iarg+2],"^v_")) { - int n = strlen(&arg[iarg+2][2]) + 1; - xstr = new char[n]; - strcpy(xstr,&arg[iarg+2][2]); + xstr = utils::strdup(arg[iarg+2]+2); } else xvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (utils::strmatch(arg[iarg+3],"^v_")) { - int n = strlen(&arg[iarg+3][2]) + 1; - ystr = new char[n]; - strcpy(ystr,&arg[iarg+3][2]); + ystr = utils::strdup(arg[iarg+3]+2); } else yvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); } else error->all(FLERR,"Illegal fix indent command"); if (utils::strmatch(arg[iarg+4],"^v_")) { - int n = strlen(&arg[iarg+4][2]) + 1; - rstr = new char[n]; - strcpy(rstr,&arg[iarg+4][2]); + rstr = utils::strdup(arg[iarg+4]+2); } else rvalue = utils::numeric(FLERR,arg[iarg+4],false,lmp); istyle = CYLINDER; @@ -499,9 +477,7 @@ void FixIndent::options(int narg, char **arg) else error->all(FLERR,"Illegal fix indent command"); if (utils::strmatch(arg[iarg+2],"^v_")) { - int n = strlen(&arg[iarg+2][2]) + 1; - pstr = new char[n]; - strcpy(pstr,&arg[iarg+2][2]); + pstr = utils::strdup(arg[iarg+2]+2); } else pvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strcmp(arg[iarg+3],"lo") == 0) planeside = -1; diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index e94986c933..6f870b9138 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -21,24 +21,24 @@ #include "fix_langevin.h" -#include -#include -#include "math_extra.h" #include "atom.h" #include "atom_vec_ellipsoid.h" -#include "force.h" -#include "update.h" -#include "modify.h" -#include "compute.h" -#include "respa.h" #include "comm.h" -#include "input.h" -#include "variable.h" -#include "random_mars.h" -#include "memory.h" +#include "compute.h" #include "error.h" +#include "force.h" #include "group.h" +#include "input.h" +#include "math_extra.h" +#include "memory.h" +#include "modify.h" +#include "random_mars.h" +#include "respa.h" +#include "update.h" +#include "variable.h" +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -65,9 +65,7 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : nevery = 1; if (utils::strmatch(arg[3],"^v_")) { - int n = strlen(&arg[3][2]) + 1; - tstr = new char[n]; - strcpy(tstr,&arg[3][2]); + tstr = utils::strdup(arg[3]+2); } else { t_start = utils::numeric(FLERR,arg[3],false,lmp); t_target = t_start; @@ -1032,9 +1030,7 @@ int FixLangevin::modify_param(int narg, char **arg) if (strcmp(arg[0],"temp") == 0) { if (narg < 2) error->all(FLERR,"Illegal fix_modify command"); delete [] id_temp; - int n = strlen(arg[1]) + 1; - id_temp = new char[n]; - strcpy(id_temp,arg[1]); + id_temp = utils::strdup(arg[1]); int icompute = modify->find_compute(id_temp); if (icompute < 0) diff --git a/src/fix_move.cpp b/src/fix_move.cpp index d19ad4fdef..e37fe52cc9 100644 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -12,26 +12,28 @@ ------------------------------------------------------------------------- */ #include "fix_move.h" -#include -#include + #include "atom.h" -#include "update.h" -#include "modify.h" -#include "force.h" -#include "domain.h" -#include "lattice.h" -#include "comm.h" -#include "respa.h" -#include "input.h" -#include "variable.h" +#include "atom_vec_body.h" #include "atom_vec_ellipsoid.h" #include "atom_vec_line.h" #include "atom_vec_tri.h" -#include "atom_vec_body.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "input.h" +#include "lattice.h" #include "math_const.h" #include "math_extra.h" #include "memory.h" -#include "error.h" +#include "modify.h" +#include "respa.h" +#include "update.h" +#include "variable.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -129,39 +131,27 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : mstyle = VARIABLE; if (strcmp(arg[4],"NULL") == 0) xvarstr = nullptr; else if (utils::strmatch(arg[4],"^v_")) { - int n = strlen(&arg[4][2]) + 1; - xvarstr = new char[n]; - strcpy(xvarstr,&arg[4][2]); + xvarstr = utils::strdup(arg[4]+2); } else error->all(FLERR,"Illegal fix move command"); if (strcmp(arg[5],"NULL") == 0) yvarstr = nullptr; else if (utils::strmatch(arg[5],"^v_")) { - int n = strlen(&arg[5][2]) + 1; - yvarstr = new char[n]; - strcpy(yvarstr,&arg[5][2]); + yvarstr = utils::strdup(arg[5]+2); } else error->all(FLERR,"Illegal fix move command"); if (strcmp(arg[6],"NULL") == 0) zvarstr = nullptr; else if (utils::strmatch(arg[6],"^v_")) { - int n = strlen(&arg[6][2]) + 1; - zvarstr = new char[n]; - strcpy(zvarstr,&arg[6][2]); + zvarstr = utils::strdup(arg[6]+2); } else error->all(FLERR,"Illegal fix move command"); if (strcmp(arg[7],"NULL") == 0) vxvarstr = nullptr; else if (utils::strmatch(arg[7],"^v_")) { - int n = strlen(&arg[7][2]) + 1; - vxvarstr = new char[n]; - strcpy(vxvarstr,&arg[7][2]); + vxvarstr = utils::strdup(arg[7]+2); } else error->all(FLERR,"Illegal fix move command"); if (strcmp(arg[8],"NULL") == 0) vyvarstr = nullptr; else if (utils::strmatch(arg[8],"^v_")) { - int n = strlen(&arg[8][2]) + 1; - vyvarstr = new char[n]; - strcpy(vyvarstr,&arg[8][2]); + vyvarstr = utils::strdup(arg[8]+2); } else error->all(FLERR,"Illegal fix move command"); if (strcmp(arg[9],"NULL") == 0) vzvarstr = nullptr; else if (utils::strmatch(arg[9],"^v_")) { - int n = strlen(&arg[9][2]) + 1; - vzvarstr = new char[n]; - strcpy(vzvarstr,&arg[9][2]); + vzvarstr = utils::strdup(arg[9]+2); } else error->all(FLERR,"Illegal fix move command"); } else error->all(FLERR,"Illegal fix move command"); diff --git a/src/fix_print.cpp b/src/fix_print.cpp index 240304d436..19a8179b0a 100644 --- a/src/fix_print.cpp +++ b/src/fix_print.cpp @@ -33,9 +33,7 @@ FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : { if (narg < 5) error->all(FLERR,"Illegal fix print command"); if (utils::strmatch(arg[3],"^v_")) { - int n = strlen(&arg[3][2]) + 1; - var_print = new char[n]; - strcpy(var_print,&arg[3][2]); + var_print = utils::strdup(arg[3]+2); nevery = 1; } else { nevery = utils::inumeric(FLERR,arg[3],false,lmp); @@ -79,9 +77,7 @@ FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"title") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix print command"); delete [] title; - int n = strlen(arg[iarg+1]) + 1; - title = new char[n]; - strcpy(title,arg[iarg+1]); + title = utils::strdup(arg[iarg+1]); iarg += 2; } else error->all(FLERR,"Illegal fix print command"); } diff --git a/src/variable.cpp b/src/variable.cpp index e8a2083b6f..7cce6546bc 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -328,8 +328,7 @@ void Variable::set(int narg, char **arg) pad[nvar] = 0; data[nvar] = new char*[num[nvar]]; copy(1,&arg[2],data[nvar]); - data[nvar][1] = new char[VALUELENGTH]; - strcpy(data[nvar][1],"(undefined)"); + data[nvar][1] = utils::strdup("(undefined)"); // SCALARFILE for strings or numbers // which = 1st value @@ -521,12 +520,9 @@ void Variable::set(int narg, char **arg) if (replaceflag) return; - int n = strlen(arg[0]) + 1; - names[nvar] = new char[n]; - strcpy(names[nvar],arg[0]); - - for (int i = 0; i < n-1; i++) - if (!isalnum(names[nvar][i]) && names[nvar][i] != '_') + names[nvar] = utils::strdup(arg[0]); + for (auto c : std::string(arg[0])) + if (!isalnum(c) && (c != '_')) error->all(FLERR,fmt::format("Variable name '{}' must have only " "alphanumeric characters or underscores", names[nvar])); @@ -577,8 +573,7 @@ int Variable::set_string(const char *name, const char *str) if (ivar < 0) return -1; if (style[ivar] != STRING) return -1; delete [] data[ivar][0]; - data[ivar][0] = new char[strlen(str)+1]; - strcpy(data[ivar][0],str); + data[ivar][0] = utils::strdup(str); return 0; } @@ -898,11 +893,8 @@ char *Variable::retrieve(const char *name) sprintf(padstr,"%%0%dd",pad[ivar]); sprintf(result,padstr,which[ivar]+1); } - int n = strlen(result) + 1; delete [] data[ivar][0]; - data[ivar][0] = new char[n]; - strcpy(data[ivar][0],result); - str = data[ivar][0]; + str = data[ivar][0] = utils::strdup(result); } else if (style[ivar] == EQUAL) { double answer = evaluate(data[ivar][0],nullptr,ivar); sprintf(data[ivar][1],"%.15g",answer); @@ -917,13 +909,8 @@ char *Variable::retrieve(const char *name) } else if (style[ivar] == GETENV) { const char *result = getenv(data[ivar][0]); if (result == nullptr) result = (const char *) ""; - int n = strlen(result) + 1; - if (n > VALUELENGTH) { - delete [] data[ivar][1]; - data[ivar][1] = new char[n]; - } - strcpy(data[ivar][1],result); - str = data[ivar][1]; + delete [] data[ivar][1]; + str = data[ivar][1] = utils::strdup(result); } else if (style[ivar] == PYTHON) { int ifunc = python->variable_match(data[ivar][0],name,0); if (ifunc < 0) @@ -1185,12 +1172,8 @@ void Variable::grow() void Variable::copy(int narg, char **from, char **to) { - int n; - for (int i = 0; i < narg; i++) { - n = strlen(from[i]) + 1; - to[i] = new char[n]; - strcpy(to[i],from[i]); - } + for (int i = 0; i < narg; i++) + to[i] = utils::strdup(from[i]); } /* ---------------------------------------------------------------------- @@ -4728,18 +4711,14 @@ double Variable::constant(char *word) int Variable::parse_args(char *str, char **args) { - int n; char *ptrnext; - - int narg = 0; + int narg = 0; char *ptr = str; while (ptr && narg < MAXFUNCARG) { ptrnext = find_next_comma(ptr); if (ptrnext) *ptrnext = '\0'; - n = strlen(ptr) + 1; - args[narg] = new char[n]; - strcpy(args[narg],ptr); + args[narg] = utils::strdup(ptr); narg++; ptr = ptrnext; if (ptr) ptr++; @@ -5089,8 +5068,7 @@ VarReader::VarReader(LAMMPS *lmp, char *name, char *file, int flag) : "variable unless an atom map exists"); std::string cmd = name + std::string("_VARIABLE_STORE"); - id_fix = new char[cmd.size()+1]; - strcpy(id_fix,cmd.c_str()); + id_fix = utils::strdup(cmd); cmd += " all STORE peratom 0 1"; modify->add_fix(cmd); diff --git a/src/velocity.cpp b/src/velocity.cpp index ad3095e2cd..b8d2e5229a 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -420,23 +420,17 @@ void Velocity::set(int /*narg*/, char **arg) xstr = ystr = zstr = nullptr; if (utils::strmatch(arg[0],"^v_")) { - int n = strlen(&arg[0][2]) + 1; - xstr = new char[n]; - strcpy(xstr,&arg[0][2]); + xstr = utils::strdup(arg[0]+2); } else if (strcmp(arg[0],"NULL") == 0) xstyle = NONE; else vx = utils::numeric(FLERR,arg[0],false,lmp); if (utils::strmatch(arg[1],"^v_")) { - int n = strlen(&arg[1][2]) + 1; - ystr = new char[n]; - strcpy(ystr,&arg[1][2]); + ystr = utils::strdup(arg[1]+2); } else if (strcmp(arg[1],"NULL") == 0) ystyle = NONE; else vy = utils::numeric(FLERR,arg[1],false,lmp); if (utils::strmatch(arg[2],"^v_")) { - int n = strlen(&arg[2][2]) + 1; - zstr = new char[n]; - strcpy(zstr,&arg[2][2]); + zstr = utils::strdup(arg[2]+2); } else if (strcmp(arg[2],"NULL") == 0) zstyle = NONE; else vz = utils::numeric(FLERR,arg[2],false,lmp); From 5c8bbb42f67d4a64f800a8041e42917d3f5245a7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 4 Feb 2021 17:33:54 -0500 Subject: [PATCH 141/384] replace variable name "string" with "text" to avoid confusion with std::string --- src/fix_print.cpp | 14 ++++++-------- src/fix_print.h | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/fix_print.cpp b/src/fix_print.cpp index 19a8179b0a..c6747ee1ee 100644 --- a/src/fix_print.cpp +++ b/src/fix_print.cpp @@ -29,7 +29,7 @@ using namespace FixConst; FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - fp(nullptr), string(nullptr), copy(nullptr), work(nullptr), var_print(nullptr) + fp(nullptr), text(nullptr), copy(nullptr), work(nullptr), var_print(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix print command"); if (utils::strmatch(arg[3],"^v_")) { @@ -42,10 +42,8 @@ FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_rank(world,&me); - int n = strlen(arg[4]) + 1; - string = new char[n]; - strcpy(string,arg[4]); - + text = utils::strdup(arg[4]); + int n = strlen(text)+1; copy = (char *) memory->smalloc(n*sizeof(char),"fix/print:copy"); work = (char *) memory->smalloc(n*sizeof(char),"fix/print:work"); maxcopy = maxwork = n; @@ -96,7 +94,7 @@ FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : FixPrint::~FixPrint() { - delete [] string; + delete [] text; delete [] var_print; memory->sfree(copy); memory->sfree(work); @@ -154,14 +152,14 @@ void FixPrint::end_of_step() { if (update->ntimestep != next_print) return; - // make a copy of string to work on + // make a copy of text to work on // substitute for $ variables (no printing) // append a newline and print final copy // variable evaluation may invoke computes so wrap with clear/add modify->clearstep_compute(); - strcpy(copy,string); + strcpy(copy,text); input->substitute(copy,work,maxcopy,maxwork,0); if (var_print) { diff --git a/src/fix_print.h b/src/fix_print.h index 6ee39318e8..7b5eaa2b62 100644 --- a/src/fix_print.h +++ b/src/fix_print.h @@ -36,7 +36,7 @@ class FixPrint : public Fix { private: int me,screenflag; FILE *fp; - char *string,*copy,*work; + char *text,*copy,*work; int maxcopy,maxwork; char *var_print; int ivar_print; From cf427bcad88e83119c8a2d40764b8e5957d27127 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 4 Feb 2021 17:52:32 -0500 Subject: [PATCH 142/384] apply utils::strdup() in a few more cases --- src/KIM/kim_init.cpp | 16 +++++----------- src/compute_coord_atom.cpp | 4 +--- src/fix_property_atom.cpp | 9 +++------ src/fix_setforce.cpp | 16 ++++------------ src/fix_temp_berendsen.cpp | 24 ++++++++++-------------- src/fix_temp_csld.cpp | 36 ++++++++++++++++-------------------- src/fix_temp_csvr.cpp | 33 ++++++++++++++------------------- src/fix_temp_rescale.cpp | 24 ++++++++++-------------- src/fix_wall.cpp | 16 ++++------------ src/fix_wall_reflect.cpp | 4 +--- src/output.cpp | 12 +++--------- src/region_cylinder.cpp | 28 +++++++--------------------- src/region_sphere.cpp | 16 ++++------------ src/set.cpp | 4 +--- 14 files changed, 83 insertions(+), 159 deletions(-) diff --git a/src/KIM/kim_init.cpp b/src/KIM/kim_init.cpp index 36df368016..2d639ede4c 100644 --- a/src/KIM/kim_init.cpp +++ b/src/KIM/kim_init.cpp @@ -86,10 +86,8 @@ void KimInit::command(int narg, char **arg) if (domain->box_exist) error->all(FLERR,"Must use 'kim_init' command before " "simulation box is defined"); - char *model_name = new char[strlen(arg[0])+1]; - strcpy(model_name,arg[0]); - char *user_units = new char[strlen(arg[1])+1]; - strcpy(user_units,arg[1]); + char *model_name = utils::strdup(arg[0]); + char *user_units = utils::strdup(arg[1]); if (narg == 3) { if (strcmp(arg[2],"unit_conversion_mode")==0) unit_conversion_mode = true; else { @@ -214,8 +212,7 @@ void KimInit::determine_model_type_and_units(char * model_name, if (units_accepted) { logID = fmt::format("{}_Model", comm->me); KIM_Model_SetLogID(pkim, logID.c_str()); - *model_units = new char[strlen(user_units)+1]; - strcpy(*model_units,user_units); + *model_units = utils::strdup(user_units); return; } else if (unit_conversion_mode) { KIM_Model_Destroy(&pkim); @@ -237,8 +234,7 @@ void KimInit::determine_model_type_and_units(char * model_name, if (units_accepted) { logID = fmt::format("{}_Model", comm->me); KIM_Model_SetLogID(pkim, logID.c_str()); - *model_units = new char[strlen(systems[i])+1]; - strcpy(*model_units,systems[i]); + *model_units = utils::strdup(systems[i]); return; } KIM_Model_Destroy(&pkim); @@ -272,9 +268,7 @@ void KimInit::determine_model_type_and_units(char * model_name, if (0 == strcmp(sim_field,"units")) { KIM_SimulatorModel_GetSimulatorFieldLine( simulatorModel, i, 0, &sim_value); - int len=strlen(sim_value)+1; - *model_units = new char[len]; - strcpy(*model_units,sim_value); + *model_units = utils::strdup(sim_value); break; } } diff --git a/src/compute_coord_atom.cpp b/src/compute_coord_atom.cpp index 3055fb96ac..51a3618d5a 100644 --- a/src/compute_coord_atom.cpp +++ b/src/compute_coord_atom.cpp @@ -53,9 +53,7 @@ ComputeCoordAtom::ComputeCoordAtom(LAMMPS *lmp, int narg, char **arg) : int iarg = 5; if ((narg > 6) && (strcmp(arg[5],"group") == 0)) { - int len = strlen(arg[6])+1; - group2 = new char[len]; - strcpy(group2,arg[6]); + group2 = utils::strdup(arg[6]); iarg += 2; jgroup = group->find(group2); if (jgroup == -1) diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index 72f2eee605..c1c52a3f8c 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -13,13 +13,12 @@ #include "fix_property_atom.h" -#include #include "atom.h" #include "comm.h" -#include "memory.h" #include "error.h" +#include "memory.h" - +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -126,9 +125,7 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : // store current atom style - int n = strlen(atom->atom_style) + 1; - astyle = new char[n]; - strcpy(astyle,atom->atom_style); + astyle = utils::strdup(atom->atom_style); // perform initial allocation of atom-based array // register with Atom class diff --git a/src/fix_setforce.cpp b/src/fix_setforce.cpp index 8430f4d784..7d41b428c9 100644 --- a/src/fix_setforce.cpp +++ b/src/fix_setforce.cpp @@ -49,9 +49,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : xstr = ystr = zstr = nullptr; if (utils::strmatch(arg[3],"^v_")) { - int n = strlen(&arg[3][2]) + 1; - xstr = new char[n]; - strcpy(xstr,&arg[3][2]); + xstr = utils::strdup(arg[3]+2); } else if (strcmp(arg[3],"NULL") == 0) { xstyle = NONE; } else { @@ -59,9 +57,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : xstyle = CONSTANT; } if (utils::strmatch(arg[4],"^v_")) { - int n = strlen(&arg[4][2]) + 1; - ystr = new char[n]; - strcpy(ystr,&arg[4][2]); + ystr = utils::strdup(arg[4]+2); } else if (strcmp(arg[4],"NULL") == 0) { ystyle = NONE; } else { @@ -69,9 +65,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : ystyle = CONSTANT; } if (utils::strmatch(arg[5],"^v_")) { - int n = strlen(&arg[5][2]) + 1; - zstr = new char[n]; - strcpy(zstr,&arg[5][2]); + zstr = utils::strdup(arg[5]+2); } else if (strcmp(arg[5],"NULL") == 0) { zstyle = NONE; } else { @@ -91,9 +85,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : iregion = domain->find_region(arg[iarg+1]); if (iregion == -1) error->all(FLERR,"Region ID for fix setforce does not exist"); - int n = strlen(arg[iarg+1]) + 1; - idregion = new char[n]; - strcpy(idregion,arg[iarg+1]); + idregion = utils::strdup(arg[iarg+1]); iarg += 2; } else error->all(FLERR,"Illegal fix setforce command"); } diff --git a/src/fix_temp_berendsen.cpp b/src/fix_temp_berendsen.cpp index c80ffc7859..403e43cd61 100644 --- a/src/fix_temp_berendsen.cpp +++ b/src/fix_temp_berendsen.cpp @@ -12,20 +12,20 @@ ------------------------------------------------------------------------- */ #include "fix_temp_berendsen.h" -#include -#include #include "atom.h" -#include "force.h" #include "comm.h" -#include "input.h" -#include "variable.h" -#include "group.h" -#include "update.h" -#include "modify.h" #include "compute.h" #include "error.h" +#include "force.h" +#include "group.h" +#include "input.h" +#include "modify.h" +#include "update.h" +#include "variable.h" +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -52,9 +52,7 @@ FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) : tstr = nullptr; if (utils::strmatch(arg[3],"^v_")) { - int n = strlen(&arg[3][2]) + 1; - tstr = new char[n]; - strcpy(tstr,&arg[3][2]); + tstr = utils::strdup(arg[3]+2); tstyle = EQUAL; } else { t_start = utils::numeric(FLERR,arg[3],false,lmp); @@ -74,9 +72,7 @@ FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) : // id = fix-ID + temp, compute group = fix group std::string cmd = id + std::string("_temp"); - id_temp = new char[cmd.size()+1]; - strcpy(id_temp,cmd.c_str()); - + id_temp = utils::strdup(cmd); cmd += fmt::format(" {} temp",group->names[igroup]); modify->add_compute(cmd); tflag = 1; diff --git a/src/fix_temp_csld.cpp b/src/fix_temp_csld.cpp index e38ad2a43f..f8afdada97 100644 --- a/src/fix_temp_csld.cpp +++ b/src/fix_temp_csld.cpp @@ -16,22 +16,22 @@ ------------------------------------------------------------------------- */ #include "fix_temp_csld.h" -#include + +#include "atom.h" +#include "comm.h" +#include "compute.h" +#include "error.h" +#include "force.h" +#include "group.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "random_mars.h" +#include "update.h" +#include "variable.h" #include -#include "atom.h" -#include "force.h" -#include "memory.h" -#include "comm.h" -#include "input.h" -#include "variable.h" -#include "group.h" -#include "update.h" -#include "modify.h" -#include "compute.h" -#include "random_mars.h" -#include "error.h" - +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -58,9 +58,7 @@ FixTempCSLD::FixTempCSLD(LAMMPS *lmp, int narg, char **arg) : tstr = nullptr; if (utils::strmatch(arg[3],"^v_")) { - int n = strlen(&arg[3][2]) + 1; - tstr = new char[n]; - strcpy(tstr,&arg[3][2]); + tstr = utils::strdup(arg[3]+2); tstyle = EQUAL; } else { t_start = utils::numeric(FLERR,arg[3],false,lmp); @@ -83,9 +81,7 @@ FixTempCSLD::FixTempCSLD(LAMMPS *lmp, int narg, char **arg) : // id = fix-ID + temp, compute group = fix group std::string cmd = id + std::string("_temp"); - id_temp = new char[cmd.size()+1]; - strcpy(id_temp,cmd.c_str()); - + id_temp = utils::strdup(cmd); cmd += fmt::format(" {} temp",group->names[igroup]); modify->add_compute(cmd); tflag = 1; diff --git a/src/fix_temp_csvr.cpp b/src/fix_temp_csvr.cpp index 9c10b0fb7d..3f71c211e5 100644 --- a/src/fix_temp_csvr.cpp +++ b/src/fix_temp_csvr.cpp @@ -18,22 +18,21 @@ #include "fix_temp_csvr.h" +#include "atom.h" +#include "comm.h" +#include "compute.h" +#include "error.h" +#include "force.h" +#include "group.h" +#include "input.h" +#include "modify.h" +#include "random_mars.h" +#include "update.h" +#include "variable.h" + #include #include -#include "atom.h" -#include "force.h" -#include "comm.h" -#include "input.h" -#include "variable.h" -#include "group.h" -#include "update.h" -#include "modify.h" -#include "compute.h" -#include "random_mars.h" -#include "error.h" - - using namespace LAMMPS_NS; using namespace FixConst; @@ -135,9 +134,7 @@ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) : tstr = nullptr; if (utils::strmatch(arg[3],"^v_")) { - int n = strlen(&arg[3][2]) + 1; - tstr = new char[n]; - strcpy(tstr,&arg[3][2]); + tstr = utils::strdup(arg[3]+2); tstyle = EQUAL; } else { t_start = utils::numeric(FLERR,arg[3],false,lmp); @@ -160,9 +157,7 @@ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) : // id = fix-ID + temp, compute group = fix group std::string cmd = id + std::string("_temp"); - id_temp = new char[cmd.size()+1]; - strcpy(id_temp,cmd.c_str()); - + id_temp = utils::strdup(cmd); cmd += fmt::format(" {} temp",group->names[igroup]); modify->add_compute(cmd); tflag = 1; diff --git a/src/fix_temp_rescale.cpp b/src/fix_temp_rescale.cpp index 321486b761..6ad0d705f6 100644 --- a/src/fix_temp_rescale.cpp +++ b/src/fix_temp_rescale.cpp @@ -12,20 +12,20 @@ ------------------------------------------------------------------------- */ #include "fix_temp_rescale.h" -#include -#include #include "atom.h" -#include "force.h" -#include "group.h" -#include "update.h" #include "comm.h" -#include "input.h" -#include "variable.h" -#include "modify.h" #include "compute.h" #include "error.h" +#include "force.h" +#include "group.h" +#include "input.h" +#include "modify.h" +#include "update.h" +#include "variable.h" +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -52,9 +52,7 @@ FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) : tstr = nullptr; if (utils::strmatch(arg[4],"^v_")) { - int n = strlen(&arg[4][2]) + 1; - tstr = new char[n]; - strcpy(tstr,&arg[4][2]); + tstr = utils::strdup(arg[4]+2); tstyle = EQUAL; } else { t_start = utils::numeric(FLERR,arg[4],false,lmp); @@ -70,9 +68,7 @@ FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) : // id = fix-ID + temp, compute group = fix group std::string cmd = id + std::string("_temp"); - id_temp = new char[cmd.size()+1]; - strcpy(id_temp,cmd.c_str()); - + id_temp = utils::strdup(cmd); cmd += fmt::format(" {} temp",group->names[igroup]); modify->add_compute(cmd); tflag = 1; diff --git a/src/fix_wall.cpp b/src/fix_wall.cpp index 255f851408..26ea22db9d 100644 --- a/src/fix_wall.cpp +++ b/src/fix_wall.cpp @@ -81,18 +81,14 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : else coord0[nwall] = domain->boxhi[dim]; } else if (utils::strmatch(arg[iarg+1],"^v_")) { xstyle[nwall] = VARIABLE; - int n = strlen(&arg[iarg+1][2]) + 1; - xstr[nwall] = new char[n]; - strcpy(xstr[nwall],&arg[iarg+1][2]); + xstr[nwall] = utils::strdup(arg[iarg+1]+2); } else { xstyle[nwall] = CONSTANT; coord0[nwall] = utils::numeric(FLERR,arg[iarg+1],false,lmp); } if (utils::strmatch(arg[iarg+2],"^v_")) { - int n = strlen(&arg[iarg+2][2]) + 1; - estr[nwall] = new char[n]; - strcpy(estr[nwall],&arg[iarg+2][2]); + estr[nwall] = utils::strdup(arg[iarg+2]+2); estyle[nwall] = VARIABLE; } else { epsilon[nwall] = utils::numeric(FLERR,arg[iarg+2],false,lmp); @@ -101,9 +97,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : if (utils::strmatch(style,"^wall/morse")) { if (utils::strmatch(arg[iarg+3],"^v_")) { - int n = strlen(&arg[iarg+3][2]) + 1; - astr[nwall] = new char[n]; - strcpy(astr[nwall],&arg[iarg+3][2]); + astr[nwall] = utils::strdup(arg[iarg+3]+2); astyle[nwall] = VARIABLE; } else { alpha[nwall] = utils::numeric(FLERR,arg[iarg+3],false,lmp); @@ -113,9 +107,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : } if (utils::strmatch(arg[iarg+3],"^v_")) { - int n = strlen(&arg[iarg+3][2]) + 1; - sstr[nwall] = new char[n]; - strcpy(sstr[nwall],&arg[iarg+3][2]); + sstr[nwall] = utils::strdup(arg[iarg+3]+2); sstyle[nwall] = VARIABLE; } else { sigma[nwall] = utils::numeric(FLERR,arg[iarg+3],false,lmp); diff --git a/src/fix_wall_reflect.cpp b/src/fix_wall_reflect.cpp index 12dd7b5877..77c3cd368f 100644 --- a/src/fix_wall_reflect.cpp +++ b/src/fix_wall_reflect.cpp @@ -75,9 +75,7 @@ FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) : else coord0[nwall] = domain->boxhi[dim]; } else if (utils::strmatch(arg[iarg+1],"^v_")) { wallstyle[nwall] = VARIABLE; - int n = strlen(&arg[iarg+1][2]) + 1; - varstr[nwall] = new char[n]; - strcpy(varstr[nwall],&arg[iarg+1][2]); + varstr[nwall] = utils::strdup(arg[iarg+1]+2); } else { wallstyle[nwall] = CONSTANT; coord0[nwall] = utils::numeric(FLERR,arg[iarg+1],false,lmp); diff --git a/src/output.cpp b/src/output.cpp index 31377e9ca6..828796b873 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -665,9 +665,7 @@ void Output::set_thermo(int narg, char **arg) var_thermo = nullptr; if (utils::strmatch(arg[0],"^v_")) { - int n = strlen(&arg[0][2]) + 1; - var_thermo = new char[n]; - strcpy(var_thermo,&arg[0][2]); + var_thermo = utils::strdup(arg[0]+2); } else { thermo_every = utils::inumeric(FLERR,arg[0],false,lmp); if (thermo_every < 0) error->all(FLERR,"Illegal thermo command"); @@ -745,9 +743,7 @@ void Output::create_restart(int narg, char **arg) if (varflag) { delete [] var_restart_single; - int n = strlen(&arg[0][2]) + 1; - var_restart_single = new char[n]; - strcpy(var_restart_single,&arg[0][2]); + var_restart_single = utils::strdup(arg[0]+2); restart_every_single = 0; } else restart_every_single = every; @@ -763,9 +759,7 @@ void Output::create_restart(int narg, char **arg) if (varflag) { delete [] var_restart_double; - int n = strlen(&arg[0][2]) + 1; - var_restart_double = new char[n]; - strcpy(var_restart_double,&arg[0][2]); + var_restart_double = utils::strdup(arg[0]+2); restart_every_double = 0; } else restart_every_double = every; diff --git a/src/region_cylinder.cpp b/src/region_cylinder.cpp index 6aec067a40..2092a03b79 100644 --- a/src/region_cylinder.cpp +++ b/src/region_cylinder.cpp @@ -45,9 +45,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : if (axis == 'x') { if (utils::strmatch(arg[3],"^v_")) { - int n = strlen(arg[3]+2) + 1; - c1str = new char[n]; - strcpy(c1str,arg[3]+2); + c1str = utils::strdup(arg[3]+2); c1 = 0.0; c1style = VARIABLE; varshape = 1; @@ -56,9 +54,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c1style = CONSTANT; } if (utils::strmatch(arg[4],"^v_")) { - int n = strlen(arg[4]+2) + 1; - c2str = new char[n]; - strcpy(c2str,arg[4]+2); + c2str = utils::strdup(arg[4]+2); c2 = 0.0; c2style = VARIABLE; varshape = 1; @@ -68,9 +64,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : } } else if (axis == 'y') { if (utils::strmatch(arg[3],"^v_")) { - int n = strlen(arg[3]+2) + 1; - c1str = new char[n]; - strcpy(c1str,arg[3]+2); + c1str = utils::strdup(arg[3]+2); c1 = 0.0; c1style = VARIABLE; varshape = 1; @@ -79,9 +73,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c1style = CONSTANT; } if (utils::strmatch(arg[4],"^v_")) { - int n = strlen(arg[4]+2) + 1; - c2str = new char[n]; - strcpy(c2str,arg[4]+2); + c2str = utils::strdup(arg[4]+2); c2 = 0.0; c2style = VARIABLE; varshape = 1; @@ -91,9 +83,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : } } else if (axis == 'z') { if (utils::strmatch(arg[3],"^v_")) { - int n = strlen(arg[3]+2) + 1; - c1str = new char[n]; - strcpy(c1str,arg[3]+2); + c1str = utils::strdup(arg[3]+2); c1 = 0.0; c1style = VARIABLE; varshape = 1; @@ -102,9 +92,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c1style = CONSTANT; } if (utils::strmatch(arg[4],"^v_")) { - int n = strlen(arg[4]+2) + 1; - c2str = new char[n]; - strcpy(c2str,arg[4]+2); + c2str = utils::strdup(arg[4]+2); c2 = 0.0; c2style = VARIABLE; varshape = 1; @@ -115,9 +103,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : } if (utils::strmatch(arg[5],"^v_")) { - int n = strlen(&arg[5][2]) + 1; - rstr = new char[n]; - strcpy(rstr,&arg[5][2]); + rstr = utils::strdup(arg[5]+2); radius = 0.0; rstyle = VARIABLE; varshape = 1; diff --git a/src/region_sphere.cpp b/src/region_sphere.cpp index a5fc292b41..8921cbd456 100644 --- a/src/region_sphere.cpp +++ b/src/region_sphere.cpp @@ -33,9 +33,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : options(narg-6,&arg[6]); if (utils::strmatch(arg[2],"^v_")) { - int n = strlen(arg[2]+2) + 1; - xstr = new char[n]; - strcpy(xstr,arg[2]+2); + xstr = utils::strdup(arg[2]+2); xc = 0.0; xstyle = VARIABLE; varshape = 1; @@ -45,9 +43,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : } if (utils::strmatch(arg[3],"^v_")) { - int n = strlen(arg[3]+2) + 1; - ystr = new char[n]; - strcpy(ystr,arg[3]+2); + ystr = utils::strdup(arg[3]+2); yc = 0.0; ystyle = VARIABLE; varshape = 1; @@ -57,9 +53,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : } if (utils::strmatch(arg[4],"^v_")) { - int n = strlen(arg[4]+2) + 1; - zstr = new char[n]; - strcpy(zstr,arg[4]+2); + zstr = utils::strdup(arg[4]+2); zc = 0.0; zstyle = VARIABLE; varshape = 1; @@ -69,9 +63,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : } if (utils::strmatch(arg[5],"^v_")) { - int n = strlen(&arg[5][2]) + 1; - rstr = new char[n]; - strcpy(rstr,&arg[5][2]); + rstr = utils::strdup(arg[5]+2); radius = 0.0; rstyle = VARIABLE; varshape = 1; diff --git a/src/set.cpp b/src/set.cpp index 4d27e8183b..fdc0c37bfd 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -71,9 +71,7 @@ void Set::command(int narg, char **arg) else if (strcmp(arg[0],"region") == 0) style = REGION_SELECT; else error->all(FLERR,"Illegal set command"); - int n = strlen(arg[1]) + 1; - id = new char[n]; - strcpy(id,arg[1]); + id = utils::strdup(arg[1]); select = nullptr; selection(atom->nlocal); From 8d68623b354032c3f0c03ba053caceb0be5e906c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 4 Feb 2021 18:08:41 -0500 Subject: [PATCH 143/384] silence compiler warnings with IBM XL compilers --- src/fmt/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fmt/core.h b/src/fmt/core.h index 49743efc0b..7946921d8e 100644 --- a/src/fmt/core.h +++ b/src/fmt/core.h @@ -20,7 +20,7 @@ // The fmt library version in the form major * 10000 + minor * 100 + patch. #define FMT_VERSION 70103 -#ifdef __clang__ +#if defined (__clang__ ) && !defined(__ibmxl__) # define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__) #else # define FMT_CLANG_VERSION 0 From cf140e789373e01d4b3fa7e5704ef4ebd283812c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 4 Feb 2021 18:19:57 -0500 Subject: [PATCH 144/384] another case where using utils::strdup() reduces code massively. --- src/SHOCK/fix_append_atoms.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/SHOCK/fix_append_atoms.cpp b/src/SHOCK/fix_append_atoms.cpp index cfff02d292..58e054bda3 100644 --- a/src/SHOCK/fix_append_atoms.cpp +++ b/src/SHOCK/fix_append_atoms.cpp @@ -122,14 +122,8 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Bad fix ID in fix append/atoms command"); spatflag = 1; - int n = strlen(arg[iarg+1]); + spatialid = utils::strdup(arg[iarg+1]+2); spatlead = utils::numeric(FLERR,arg[iarg+2],false,lmp); - char *suffix = new char[n]; - strcpy(suffix,&arg[iarg+1][2]); - n = strlen(suffix) + 1; - spatialid = new char[n]; - strcpy(spatialid,suffix); - delete [] suffix; iarg += 3; } else if (strcmp(arg[iarg],"basis") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix append/atoms command"); From bd1cc91bddba31b6564058a324e40cf72d9a34fd Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Thu, 4 Feb 2021 20:20:18 -0500 Subject: [PATCH 145/384] update create atoms example --- .../chain_plus_styrene_map_create_atoms | 12 ++++---- .../chain_plus_styrene_reacted.data_template | 4 +-- ...yrene_unreacted_create_atoms.data_template | 4 +-- .../infromdata.class2 | 30 ++++++++----------- .../create_atoms_polystyrene/trimer.data | 2 +- 5 files changed, 23 insertions(+), 29 deletions(-) diff --git a/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_map_create_atoms b/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_map_create_atoms index a90f1528bb..88d282690c 100644 --- a/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_map_create_atoms +++ b/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_map_create_atoms @@ -1,18 +1,18 @@ -this is a map file +map file: styrene growth 1 edgeIDs 30 equivalences 16 createIDs -EdgeIDs - -30 - -BondingIDs +InitiatorIDs 4 13 +EdgeIDs + +30 + CreateIDs 1 diff --git a/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_reacted.data_template b/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_reacted.data_template index 83f04899b1..de0c2383bb 100755 --- a/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_reacted.data_template +++ b/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_reacted.data_template @@ -1,4 +1,4 @@ -LAMMPS data file. msi2lmp v3.9.8 / 06 Oct 2016 / CGCMM for chain_plus_styrene_reacted +molecule template: end of chain plus polymerized styrene 46 atoms 48 bonds @@ -9,7 +9,7 @@ LAMMPS data file. msi2lmp v3.9.8 / 06 Oct 2016 / CGCMM for chain_plus_styrene_re Fragments -create_fit 34 44 +create_fit 34 44 Types diff --git a/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_unreacted_create_atoms.data_template b/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_unreacted_create_atoms.data_template index f85b928f1e..d04fefccf5 100644 --- a/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_unreacted_create_atoms.data_template +++ b/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_unreacted_create_atoms.data_template @@ -1,4 +1,4 @@ -LAMMPS data file via write_data, version 18 Sep 2020, timestep = 0 +molecule template: end of styrene chain 30 atoms 31 bonds @@ -69,7 +69,7 @@ Coords 26 53.86061213540014 61.09506223825291 58.69441939855832 27 55.94906007539648 61.56969281804616 59.039933529456256 28 56.2513193202326 60.54265974655139 59.15389588713244 -29 58.35468332440925 64.79274880895268 59.64495986218142 +29 58.35468332440925 64.79274880895268 59.64495986218142 30 57.07961929431883 66.29987186904283 58.394030287459465 Charges diff --git a/examples/USER/reaction/create_atoms_polystyrene/infromdata.class2 b/examples/USER/reaction/create_atoms_polystyrene/infromdata.class2 index b6e63d5365..4331bf60b7 100755 --- a/examples/USER/reaction/create_atoms_polystyrene/infromdata.class2 +++ b/examples/USER/reaction/create_atoms_polystyrene/infromdata.class2 @@ -1,4 +1,4 @@ -# Jake practice run +# use bond/react 'create atoms' feature to add 50 new styrene monomers to chain units real @@ -20,30 +20,24 @@ improper_style class2 variable T equal 530 -read_data trimer.data & - extra/bond/per/atom 5 & - extra/angle/per/atom 15 & - extra/dihedral/per/atom 15 & - extra/improper/per/atom 25 & - extra/special/per/atom 25 +read_data trimer.data -molecule mol3 chain_plus_styrene_unreacted_create_atoms.data_template -molecule mol4 chain_plus_styrene_reacted.data_template +molecule mol1 grow_styrene_pre.data_template +molecule mol2 grow_styrene_post.data_template -fix rxn1 all bond/react stabilization yes statted_grp .03 & - react rxn2 all 1 0 3.0 mol3 mol4 chain_plus_styrene_map_create_atoms & - modify_create fit create_fit near 2.0 stabilize_steps 100 max_rxn 50 +fix myrxns all bond/react stabilization yes statted_grp .03 & + react rxn1 all 1 0 3.0 mol1 mol2 grow_styrene.map & + modify_create fit create_fit overlap 2.0 & + stabilize_steps 100 max_rxn 50 -fix 1 statted_grp_REACT nvt temp $T $T 100 #iso 1 1 1000 +fix 1 statted_grp_REACT nvt temp $T $T 100 fix 4 bond_react_MASTER_group temp/rescale 1 $T $T 1 1 -thermo_style custom step temp press density f_rxn1[1] +thermo_style custom step temp press density f_myrxns[1] -#restart 1 restart1 restart2 - -thermo 2 +thermo 100 run 8000 -write_data restart_longrun.data nofix +# write_data final.data nofix diff --git a/examples/USER/reaction/create_atoms_polystyrene/trimer.data b/examples/USER/reaction/create_atoms_polystyrene/trimer.data index 8bd81f0600..b3ad132f03 100644 --- a/examples/USER/reaction/create_atoms_polystyrene/trimer.data +++ b/examples/USER/reaction/create_atoms_polystyrene/trimer.data @@ -1,4 +1,4 @@ -LAMMPS data file via write_data, version 15 May 2019, timestep = 500 +polystyrene trimer 48 atoms 7 atom types From 9a0805529c5f06a08862ee4b9a9dfdd702467437 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Thu, 4 Feb 2021 20:25:26 -0500 Subject: [PATCH 146/384] rename example files --- .../{chain_plus_styrene_map_create_atoms => grow_styrene.map} | 0 ...rene_reacted.data_template => grow_styrene_post.data_template} | 0 ..._create_atoms.data_template => grow_styrene_pre.data_template} | 0 .../{infromdata.class2 => in.grow_styrene} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename examples/USER/reaction/create_atoms_polystyrene/{chain_plus_styrene_map_create_atoms => grow_styrene.map} (100%) rename examples/USER/reaction/create_atoms_polystyrene/{chain_plus_styrene_reacted.data_template => grow_styrene_post.data_template} (100%) rename examples/USER/reaction/create_atoms_polystyrene/{chain_plus_styrene_unreacted_create_atoms.data_template => grow_styrene_pre.data_template} (100%) rename examples/USER/reaction/create_atoms_polystyrene/{infromdata.class2 => in.grow_styrene} (100%) diff --git a/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_map_create_atoms b/examples/USER/reaction/create_atoms_polystyrene/grow_styrene.map similarity index 100% rename from examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_map_create_atoms rename to examples/USER/reaction/create_atoms_polystyrene/grow_styrene.map diff --git a/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_reacted.data_template b/examples/USER/reaction/create_atoms_polystyrene/grow_styrene_post.data_template similarity index 100% rename from examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_reacted.data_template rename to examples/USER/reaction/create_atoms_polystyrene/grow_styrene_post.data_template diff --git a/examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_unreacted_create_atoms.data_template b/examples/USER/reaction/create_atoms_polystyrene/grow_styrene_pre.data_template similarity index 100% rename from examples/USER/reaction/create_atoms_polystyrene/chain_plus_styrene_unreacted_create_atoms.data_template rename to examples/USER/reaction/create_atoms_polystyrene/grow_styrene_pre.data_template diff --git a/examples/USER/reaction/create_atoms_polystyrene/infromdata.class2 b/examples/USER/reaction/create_atoms_polystyrene/in.grow_styrene similarity index 100% rename from examples/USER/reaction/create_atoms_polystyrene/infromdata.class2 rename to examples/USER/reaction/create_atoms_polystyrene/in.grow_styrene From dde3a8cebba81d634238b49645f528e1f3120753 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Thu, 4 Feb 2021 21:00:46 -0500 Subject: [PATCH 147/384] update log files --- .../8procs_out.lammps | 4137 ----------------- .../create_atoms_polystyrene/in.grow_styrene | 11 +- .../log.24Dec20.grow_styrene.g++.1 | 196 + .../log.24Dec20.grow_styrene.g++.4 | 196 + 4 files changed, 400 insertions(+), 4140 deletions(-) delete mode 100644 examples/USER/reaction/create_atoms_polystyrene/8procs_out.lammps create mode 100644 examples/USER/reaction/create_atoms_polystyrene/log.24Dec20.grow_styrene.g++.1 create mode 100644 examples/USER/reaction/create_atoms_polystyrene/log.24Dec20.grow_styrene.g++.4 diff --git a/examples/USER/reaction/create_atoms_polystyrene/8procs_out.lammps b/examples/USER/reaction/create_atoms_polystyrene/8procs_out.lammps deleted file mode 100644 index 953a32394a..0000000000 --- a/examples/USER/reaction/create_atoms_polystyrene/8procs_out.lammps +++ /dev/null @@ -1,4137 +0,0 @@ -LAMMPS (22 Oct 2020) -Reading data file ... - orthogonal box = (50.000000 50.000000 50.000000) to (250.00000 250.00000 250.00000) - 2 by 2 by 2 MPI processor grid - reading atoms ... - 48 atoms - reading velocities ... - 48 velocities - scanning bonds ... - 8 = max bonds/atom - scanning angles ... - 21 = max angles/atom - scanning dihedrals ... - 33 = max dihedrals/atom - scanning impropers ... - 29 = max impropers/atom - reading bonds ... - 50 bonds - reading angles ... - 84 angles - reading dihedrals ... - 127 dihedrals - reading impropers ... - 36 impropers -Finding 1-2 1-3 1-4 neighbors ... - special bond factors lj: 0.0 0.0 0.0 - special bond factors coul: 0.0 0.0 0.0 - 4 = max # of 1-2 neighbors - 8 = max # of 1-3 neighbors - 17 = max # of 1-4 neighbors - 46 = max # of special neighbors - special bonds CPU = 0.000 seconds - read_data CPU = 0.022 seconds -Read molecule template mol3: - 1 molecules - 30 atoms with max type 6 - 31 bonds with max type 10 - 51 angles with max type 16 - 73 dihedrals with max type 19 - 21 impropers with max type 7 -Read molecule template mol4: - 1 molecules - 46 atoms with max type 6 - 48 bonds with max type 13 - 81 angles with max type 22 - 121 dihedrals with max type 36 - 35 impropers with max type 9 -dynamic group bond_react_MASTER_group defined -dynamic group statted_grp_REACT defined -PPPM initialization ... -WARNING: System is not charge neutral, net charge = -0.0006 (../kspace.cpp:313) - using 12-bit tables for long-range coulomb (../kspace.cpp:328) - G vector (1/distance) = 0.20144813 - grid = 45 45 45 - stencil order = 5 - estimated absolute RMS force accuracy = 0.00053712952 - estimated relative force accuracy = 1.6175496e-06 - using double precision KISS FFT - 3d grid and FFT values/proc = 21952 12167 -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 10.5 - ghost atom cutoff = 10.5 - binsize = 5.25, bins = 39 39 39 - 2 neighbor lists, perpetual/occasional/extra = 1 1 0 - (1) pair lj/class2/coul/long, perpetual - attributes: half, newton on - pair build: half/bin/newton - stencil: half/bin/3d/newton - bin: standard - (2) fix bond/react, occasional, copy from (1) - attributes: half, newton on - pair build: copy - stencil: none - bin: none -Setting up Verlet run ... - Unit style : real - Current step : 0 - Time step : 1.0 -WARNING: Inconsistent image flags (../domain.cpp:812) -Per MPI rank memory allocation (min/avg/max) = 37.97 | 38.12 | 38.70 Mbytes -Step Temp Press Density f_rxn1[1] - 0 496.23742 0.9983211 6.4856516e-05 0 - 2 672.73362 -516.54985 8.6475354e-05 1 - 4 667.5039 -434.77386 8.6475354e-05 1 - 6 672.39598 -362.84027 8.6475354e-05 1 - 8 685.87152 -299.54792 8.6475354e-05 1 - 10 691.00305 -244.43255 8.6475354e-05 1 - 12 669.95405 -197.53983 8.6475354e-05 1 - 14 646.37761 -158.31437 8.6475354e-05 1 - 16 643.66763 -125.39769 8.6475354e-05 1 - 18 667.56644 -97.573538 8.6475354e-05 1 - 20 703.91664 -74.339207 8.6475354e-05 1 - 22 720.06237 -55.689578 8.6475354e-05 1 - 24 697.20697 -41.333247 8.6475354e-05 1 - 26 674.83509 -30.383402 8.6475354e-05 1 - 28 670.01312 -21.803547 8.6475354e-05 1 - 30 679.49765 -15.012223 8.6475354e-05 1 - 32 700.25949 -9.9961585 8.6475354e-05 1 - 34 700.57498 -6.7727869 8.6475354e-05 1 - 36 685.11304 -4.9950196 8.6475354e-05 1 - 38 678.32094 -4.0105508 8.6475354e-05 1 - 40 676.78265 -3.2337378 8.6475354e-05 1 - 42 678.24749 -2.5623955 8.6475354e-05 1 - 44 681.72485 -2.2286571 8.6475354e-05 1 - 46 668.52658 -2.2541195 8.6475354e-05 1 - 48 658.84625 -2.3473498 8.6475354e-05 1 - 50 655.89802 -2.1608375 8.6475354e-05 1 - 52 650.56205 -1.68496 8.6475354e-05 1 - 54 666.65857 -1.3229867 8.6475354e-05 1 - 56 690.98887 -1.3111684 8.6475354e-05 1 - 58 712.94292 -1.4938499 8.6475354e-05 1 - 60 727.24487 -1.5260071 8.6475354e-05 1 - 62 718.0806 -1.2046747 8.6475354e-05 1 - 64 700.02584 -0.7635068 8.6475354e-05 1 - 66 688.52896 -0.53631295 8.6475354e-05 1 - 68 679.79647 -0.53791747 8.6475354e-05 1 - 70 694.44255 -0.5532644 8.6475354e-05 1 - 72 713.0813 -0.30885385 8.6475354e-05 1 - 74 721.95891 0.134531 8.6475354e-05 1 - 76 742.81658 0.42479462 8.6475354e-05 1 - 78 743.68772 0.45650714 8.6475354e-05 1 - 80 735.07709 0.32514596 8.6475354e-05 1 - 82 740.82043 0.20849187 8.6475354e-05 1 - 84 734.58615 0.24802492 8.6475354e-05 1 - 86 739.66066 0.25495108 8.6475354e-05 1 - 88 753.76371 0.1002615 8.6475354e-05 1 - 90 747.39108 -0.10177519 8.6475354e-05 1 - 92 756.14087 -0.28921143 8.6475354e-05 1 - 94 763.80064 -0.3136942 8.6475354e-05 1 - 96 758.26501 -0.22731262 8.6475354e-05 1 - 98 780.51378 -0.27873344 8.6475354e-05 1 - 100 778.14888 -0.39476034 8.6475354e-05 1 - 102 749.63152 -0.47648489 8.6475354e-05 1 - 104 846.93279 -515.29892 0.00010809419 2 - 106 826.13617 -433.34463 0.00010809419 2 - 108 816.77932 -361.49619 0.00010809419 2 - 110 832.98668 -298.67436 0.00010809419 2 - 112 828.70355 -243.96707 0.00010809419 2 - 114 829.78649 -196.94812 0.00010809419 2 - 116 834.95318 -157.12951 0.00010809419 2 - 118 818.14589 -123.74396 0.00010809419 2 - 120 823.23317 -96.119924 0.00010809419 2 - 122 827.11868 -73.432562 0.00010809419 2 - 124 818.85373 -55.093931 0.00010809419 2 - 126 819.83268 -40.717815 0.00010809419 2 - 128 810.0448 -29.70583 0.00010809419 2 - 130 811.69158 -21.50551 0.00010809419 2 - 132 821.37302 -15.473802 0.00010809419 2 - 134 820.66577 -10.994366 0.00010809419 2 - 136 828.20766 -7.7873437 0.00010809419 2 - 138 835.82332 -5.6282316 0.00010809419 2 - 140 845.10867 -4.2922973 0.00010809419 2 - 142 871.58701 -3.5134098 0.00010809419 2 - 144 879.74364 -2.8383489 0.00010809419 2 - 146 875.03242 -2.0846919 0.00010809419 2 - 148 877.25151 -1.3780873 0.00010809419 2 - 150 873.17469 -0.84990975 0.00010809419 2 - 152 890.04002 -0.60830118 0.00010809419 2 - 154 903.70012 -0.4683428 0.00010809419 2 - 156 899.27359 -0.23979738 0.00010809419 2 - 158 898.85893 0.0077916688 0.00010809419 2 - 160 893.65077 0.16405785 0.00010809419 2 - 162 891.71694 0.14137049 0.00010809419 2 - 164 903.78638 0.04704286 0.00010809419 2 - 166 905.9683 0.1349231 0.00010809419 2 - 168 910.76595 0.40440178 0.00010809419 2 - 170 922.28442 0.6891772 0.00010809419 2 - 172 916.21424 0.86117662 0.00010809419 2 - 174 903.02225 0.89400959 0.00010809419 2 - 176 885.39888 0.97920294 0.00010809419 2 - 178 870.41144 1.2525889 0.00010809419 2 - 180 869.70627 1.6068325 0.00010809419 2 - 182 871.11959 1.8160032 0.00010809419 2 - 184 869.3783 1.7223162 0.00010809419 2 - 186 864.82644 1.49422 0.00010809419 2 - 188 870.53517 1.4225742 0.00010809419 2 - 190 886.68548 1.5811771 0.00010809419 2 - 192 891.75807 1.7148245 0.00010809419 2 - 194 894.5438 1.4550304 0.00010809419 2 - 196 884.78947 0.8635917 0.00010809419 2 - 198 868.94073 0.33605001 0.00010809419 2 - 200 875.79343 0.13232632 0.00010809419 2 - 202 883.35077 0.23108222 0.00010809419 2 - 204 888.58232 0.25927752 0.00010809419 2 - 206 1107.5599 8637688.5 0.00012971303 3 - 208 1110.7846 377601.17 0.00012971303 3 - 210 1119.1946 40058.093 0.00012971303 3 - 212 1133.7765 7445.8597 0.00012971303 3 - 214 1135.8825 1828.4071 0.00012971303 3 - 216 1158.7218 403.45537 0.00012971303 3 - 218 1169.4708 -31.054599 0.00012971303 3 - 220 1160.98 -156.65213 0.00012971303 3 - 222 1155.6262 -176.44394 0.00012971303 3 - 224 1131.1594 -167.87497 0.00012971303 3 - 226 1113.9144 -147.95888 0.00012971303 3 - 228 1129.7212 -122.18556 0.00012971303 3 - 230 1135.2926 -98.191841 0.00012971303 3 - 232 1139.5082 -76.954463 0.00012971303 3 - 234 1138.3988 -58.569198 0.00012971303 3 - 236 1114.7516 -43.273595 0.00012971303 3 - 238 1111.675 -31.385143 0.00012971303 3 - 240 1108.3656 -22.575824 0.00012971303 3 - 242 1098.2288 -16.049189 0.00012971303 3 - 244 1097.5592 -11.075179 0.00012971303 3 - 246 1080.575 -7.2891243 0.00012971303 3 - 248 1062.281 -4.8100451 0.00012971303 3 - 250 1054.3602 -3.6457718 0.00012971303 3 - 252 1041.5474 -3.2427207 0.00012971303 3 - 254 1049.6522 -3.0128429 0.00012971303 3 - 256 1067.6297 -2.6265895 0.00012971303 3 - 258 1081.6873 -2.1996331 0.00012971303 3 - 260 1103.2003 -2.0609219 0.00012971303 3 - 262 1103.0801 -2.1514117 0.00012971303 3 - 264 1118.9504 -2.2123932 0.00012971303 3 - 266 1156.5552 -1.9428664 0.00012971303 3 - 268 1167.8606 -1.2867254 0.00012971303 3 - 270 1180.4323 -0.65452596 0.00012971303 3 - 272 1182.9865 -0.2548239 0.00012971303 3 - 274 1168.7598 -0.0051407959 0.00012971303 3 - 276 1186.6008 0.21071708 0.00012971303 3 - 278 1205.0507 0.5419248 0.00012971303 3 - 280 1220.4904 0.76453778 0.00012971303 3 - 282 1244.6059 0.56375436 0.00012971303 3 - 284 1223.3782 0.067494738 0.00012971303 3 - 286 1202.9298 -0.52770675 0.00012971303 3 - 288 1189.6831 -0.93554081 0.00012971303 3 - 290 1154.4315 -1.0402905 0.00012971303 3 - 292 1161.4818 -1.1434855 0.00012971303 3 - 294 1176.833 -1.2714623 0.00012971303 3 - 296 1179.2197 -1.2607495 0.00012971303 3 - 298 1207.8388 -1.0074678 0.00012971303 3 - 300 1215.1726 -0.39937655 0.00012971303 3 - 302 1210.3522 0.26737494 0.00012971303 3 - 304 1218.4689 0.65569106 0.00012971303 3 - 306 1208.8376 0.87597451 0.00012971303 3 - 308 1286.4107 -509.47242 0.00015133187 4 - 310 1273.3815 -427.85316 0.00015133187 4 - 312 1242.1286 -356.22024 0.00015133187 4 - 314 1253.4942 -293.85005 0.00015133187 4 - 316 1273.6312 -239.98924 0.00015133187 4 - 318 1275.0656 -193.99363 0.00015133187 4 - 320 1295.9103 -155.20399 0.00015133187 4 - 322 1290.9077 -122.56609 0.00015133187 4 - 324 1271.6566 -95.381388 0.00015133187 4 - 326 1263.8102 -73.165359 0.00015133187 4 - 328 1239.1977 -55.302863 0.00015133187 4 - 330 1227.6108 -41.236285 0.00015133187 4 - 332 1224.4531 -30.167712 0.00015133187 4 - 334 1208.0527 -21.468457 0.00015133187 4 - 336 1235.9468 -14.916123 0.00015133187 4 - 338 1267.1547 -10.131348 0.00015133187 4 - 340 1292.5478 -6.8056873 0.00015133187 4 - 342 1335.1976 -4.6458831 0.00015133187 4 - 344 1331.0703 -3.2217937 0.00015133187 4 - 346 1304.564 -2.4053344 0.00015133187 4 - 348 1294.6672 -2.0166678 0.00015133187 4 - 350 1275.671 -1.7896119 0.00015133187 4 - 352 1270.708 -1.6647554 0.00015133187 4 - 354 1269.5585 -1.5099971 0.00015133187 4 - 356 1246.2033 -1.2754664 0.00015133187 4 - 358 1255.6589 -1.126802 0.00015133187 4 - 360 1268.2565 -0.97986712 0.00015133187 4 - 362 1275.1167 -0.76954276 0.00015133187 4 - 364 1287.7098 -0.52952795 0.00015133187 4 - 366 1263.1765 -0.27860938 0.00015133187 4 - 368 1232.2653 -0.18570194 0.00015133187 4 - 370 1230.2485 -0.26197611 0.00015133187 4 - 372 1233.9159 -0.30708265 0.00015133187 4 - 374 1253.5708 -0.26988589 0.00015133187 4 - 376 1282.6496 -0.19467244 0.00015133187 4 - 378 1298.4463 -0.17751858 0.00015133187 4 - 380 1320.5676 -0.27144792 0.00015133187 4 - 382 1338.5616 -0.30891377 0.00015133187 4 - 384 1351.3783 -0.18933152 0.00015133187 4 - 386 1357.3252 0.0265073 0.00015133187 4 - 388 1344.6374 0.20930056 0.00015133187 4 - 390 1333.1019 0.27147994 0.00015133187 4 - 392 1337.4623 0.32960244 0.00015133187 4 - 394 1357.0506 0.53222632 0.00015133187 4 - 396 1383.0145 0.84287387 0.00015133187 4 - 398 1402.3315 1.0270585 0.00015133187 4 - 400 1410.03 0.87301772 0.00015133187 4 - 402 1397.5003 0.50658616 0.00015133187 4 - 404 1371.0536 0.22338437 0.00015133187 4 - 406 1355.6828 0.12299714 0.00015133187 4 - 408 1349.6668 0.084479741 0.00015133187 4 - 410 1534.4693 -221.57225 0.00017295071 5 - 412 1543.4054 -308.97261 0.00017295071 5 - 414 1532.8454 -300.08081 0.00017295071 5 - 416 1533.4105 -263.77232 0.00017295071 5 - 418 1537.4915 -221.76219 0.00017295071 5 - 420 1530.954 -181.87958 0.00017295071 5 - 422 1535.7748 -146.85737 0.00017295071 5 - 424 1519.1766 -116.85102 0.00017295071 5 - 426 1497.2677 -91.226974 0.00017295071 5 - 428 1492.6473 -69.62357 0.00017295071 5 - 430 1472.5275 -52.059519 0.00017295071 5 - 432 1462.4413 -38.529891 0.00017295071 5 - 434 1468.9696 -28.36966 0.00017295071 5 - 436 1452.932 -20.460639 0.00017295071 5 - 438 1468.2846 -14.114515 0.00017295071 5 - 440 1490.4484 -9.1886317 0.00017295071 5 - 442 1487.1913 -5.942928 0.00017295071 5 - 444 1497.2185 -4.4123187 0.00017295071 5 - 446 1478.8939 -3.8118845 0.00017295071 5 - 448 1456.0017 -3.3353043 0.00017295071 5 - 450 1466.4786 -2.6872974 0.00017295071 5 - 452 1465.5824 -2.1548854 0.00017295071 5 - 454 1464.9664 -2.2552192 0.00017295071 5 - 456 1464.778 -2.8523593 0.00017295071 5 - 458 1438.9393 -3.2513212 0.00017295071 5 - 460 1430.9755 -3.129067 0.00017295071 5 - 462 1438.8786 -2.7207139 0.00017295071 5 - 464 1442.65 -2.5598392 0.00017295071 5 - 466 1457.4603 -2.8627635 0.00017295071 5 - 468 1456.3288 -3.1617133 0.00017295071 5 - 470 1453.9005 -2.984669 0.00017295071 5 - 472 1466.2228 -2.3645176 0.00017295071 5 - 474 1473.5811 -1.8008842 0.00017295071 5 - 476 1486.9192 -1.7752973 0.00017295071 5 - 478 1486.6985 -2.0930366 0.00017295071 5 - 480 1481.2602 -2.2133575 0.00017295071 5 - 482 1481.1923 -1.8733217 0.00017295071 5 - 484 1473.2641 -1.3520504 0.00017295071 5 - 486 1471.6493 -1.1879697 0.00017295071 5 - 488 1475.4712 -1.4344883 0.00017295071 5 - 490 1481.9981 -1.6453745 0.00017295071 5 - 492 1504.055 -1.4250176 0.00017295071 5 - 494 1510.1599 -0.76544776 0.00017295071 5 - 496 1496.1128 -0.15333711 0.00017295071 5 - 498 1478.523 0.032710644 0.00017295071 5 - 500 1442.1002 -0.01944848 0.00017295071 5 - 502 1435.515 0.020833055 0.00017295071 5 - 504 1435.4149 0.37469386 0.00017295071 5 - 506 1428.6576 0.78486479 0.00017295071 5 - 508 1431.8185 0.8019623 0.00017295071 5 - 510 1421.3836 0.46585338 0.00017295071 5 - 512 1529.4088 729.29069 0.00019456955 6 - 514 1553.6093 -29.679404 0.00019456955 6 - 516 1560.6793 -193.67199 0.00019456955 6 - 518 1582.4456 -214.57181 0.00019456955 6 - 520 1600.209 -196.52872 0.00019456955 6 - 522 1587.5015 -168.43457 0.00019456955 6 - 524 1597.8334 -139.01628 0.00019456955 6 - 526 1588.3299 -110.66293 0.00019456955 6 - 528 1563.7922 -85.583276 0.00019456955 6 - 530 1562.5661 -65.082386 0.00019456955 6 - 532 1545.9594 -48.827328 0.00019456955 6 - 534 1548.1975 -36.047522 0.00019456955 6 - 536 1571.1596 -25.990003 0.00019456955 6 - 538 1568.3742 -18.119354 0.00019456955 6 - 540 1591.6304 -12.364411 0.00019456955 6 - 542 1621.6504 -8.4436521 0.00019456955 6 - 544 1635.2863 -5.8931502 0.00019456955 6 - 546 1668.6883 -4.3787834 0.00019456955 6 - 548 1677.8643 -3.524089 0.00019456955 6 - 550 1672.6149 -3.1111588 0.00019456955 6 - 552 1686.192 -3.0167906 0.00019456955 6 - 554 1694.1881 -3.021889 0.00019456955 6 - 556 1721.201 -3.0411757 0.00019456955 6 - 558 1756.9269 -2.9903902 0.00019456955 6 - 560 1767.176 -2.8616056 0.00019456955 6 - 562 1781.3616 -2.805622 0.00019456955 6 - 564 1772.6438 -2.7043354 0.00019456955 6 - 566 1752.2449 -2.4746308 0.00019456955 6 - 568 1754.9931 -2.2279232 0.00019456955 6 - 570 1754.7206 -2.0446367 0.00019456955 6 - 572 1758.6452 -2.025602 0.00019456955 6 - 574 1766.1608 -2.0914714 0.00019456955 6 - 576 1761.7544 -2.0664004 0.00019456955 6 - 578 1772.1189 -2.000525 0.00019456955 6 - 580 1799.2454 -2.0250243 0.00019456955 6 - 582 1825.067 -2.2293284 0.00019456955 6 - 584 1849.5617 -2.5697748 0.00019456955 6 - 586 1849.2053 -2.7732917 0.00019456955 6 - 588 1836.8275 -2.7313701 0.00019456955 6 - 590 1826.4569 -2.5953868 0.00019456955 6 - 592 1812.2065 -2.5647921 0.00019456955 6 - 594 1804.9949 -2.6702505 0.00019456955 6 - 596 1803.1318 -2.6613268 0.00019456955 6 - 598 1805.1361 -2.3358896 0.00019456955 6 - 600 1824.188 -1.8387289 0.00019456955 6 - 602 1848.6553 -1.5013544 0.00019456955 6 - 604 1870.6838 -1.5441019 0.00019456955 6 - 606 1874.9469 -1.8017458 0.00019456955 6 - 608 1869.5686 -1.9218444 0.00019456955 6 - 610 1877.623 -1.7853588 0.00019456955 6 - 612 1889.4207 -1.5668847 0.00019456955 6 - 614 1965.8448 -467.80498 0.00021618839 7 - 616 1987.3298 -392.09435 0.00021618839 7 - 618 2000.2927 -325.81873 0.00021618839 7 - 620 2023.5139 -267.59947 0.00021618839 7 - 622 2053.7762 -216.83693 0.00021618839 7 - 624 2061.6352 -173.50374 0.00021618839 7 - 626 2052.7458 -137.4578 0.00021618839 7 - 628 2021.4692 -107.67926 0.00021618839 7 - 630 1995.4739 -82.926012 0.00021618839 7 - 632 1995.1292 -62.399746 0.00021618839 7 - 634 1988.8957 -45.877721 0.00021618839 7 - 636 1991.9075 -33.414941 0.00021618839 7 - 638 1994.8193 -24.397758 0.00021618839 7 - 640 1984.0488 -17.632089 0.00021618839 7 - 642 1979.6828 -12.220819 0.00021618839 7 - 644 1956.266 -7.8761194 0.00021618839 7 - 646 1921.9407 -4.9132587 0.00021618839 7 - 648 1906.8953 -3.4249108 0.00021618839 7 - 650 1884.0064 -2.7059283 0.00021618839 7 - 652 1873.4695 -1.9767323 0.00021618839 7 - 654 1879.7171 -0.9043862 0.00021618839 7 - 656 1864.2258 0.17074359 0.00021618839 7 - 658 1879.9729 0.52626965 0.00021618839 7 - 660 1914.8077 0.17422926 0.00021618839 7 - 662 1951.367 -0.27150227 0.00021618839 7 - 664 2003.6903 -0.40419822 0.00021618839 7 - 666 2022.2638 -0.27719235 0.00021618839 7 - 668 2007.5499 -0.46205565 0.00021618839 7 - 670 2001.0368 -1.2081892 0.00021618839 7 - 672 1989.3934 -1.9884832 0.00021618839 7 - 674 2003.9186 -2.2824546 0.00021618839 7 - 676 2029.3746 -1.9648526 0.00021618839 7 - 678 2029.8301 -1.4595559 0.00021618839 7 - 680 2039.736 -1.3563856 0.00021618839 7 - 682 2030.692 -1.5588443 0.00021618839 7 - 684 2012.8781 -1.6591768 0.00021618839 7 - 686 2007.5676 -1.4469618 0.00021618839 7 - 688 1976.2079 -1.0593207 0.00021618839 7 - 690 1936.7606 -0.99860488 0.00021618839 7 - 692 1917.263 -1.4227025 0.00021618839 7 - 694 1898.286 -1.8944056 0.00021618839 7 - 696 1908.9759 -2.0293348 0.00021618839 7 - 698 1929.625 -1.7527389 0.00021618839 7 - 700 1928.5094 -1.4327584 0.00021618839 7 - 702 1925.3732 -1.4772437 0.00021618839 7 - 704 1905.6439 -1.7140386 0.00021618839 7 - 706 1892.0501 -1.7837212 0.00021618839 7 - 708 1897.1334 -1.5195612 0.00021618839 7 - 710 1891.8002 -1.0767969 0.00021618839 7 - 712 1899.5619 -0.86887435 0.00021618839 7 - 714 1905.3485 -0.94002209 0.00021618839 7 - 716 2060.3083 -484.08676 0.00023780722 8 - 718 2101.3468 -422.17239 0.00023780722 8 - 720 2132.6048 -356.92116 0.00023780722 8 - 722 2148.8483 -296.33815 0.00023780722 8 - 724 2165.9219 -242.83932 0.00023780722 8 - 726 2152.8378 -196.66477 0.00023780722 8 - 728 2140.9769 -157.3232 0.00023780722 8 - 730 2135.9583 -124.09964 0.00023780722 8 - 732 2109.2748 -96.383726 0.00023780722 8 - 734 2102.2854 -73.867192 0.00023780722 8 - 736 2094.2383 -56.001724 0.00023780722 8 - 738 2077.1035 -41.839387 0.00023780722 8 - 740 2081.3509 -30.614919 0.00023780722 8 - 742 2066.1613 -21.796463 0.00023780722 8 - 744 2041.6068 -15.208246 0.00023780722 8 - 746 2023.3105 -10.622121 0.00023780722 8 - 748 1988.2601 -7.4664823 0.00023780722 8 - 750 1976.5559 -5.2218916 0.00023780722 8 - 752 1994.2738 -3.5641818 0.00023780722 8 - 754 2015.1651 -2.4337385 0.00023780722 8 - 756 2059.2266 -1.8718232 0.00023780722 8 - 758 2080.4658 -1.5660802 0.00023780722 8 - 760 2085.6804 -1.2208682 0.00023780722 8 - 762 2111.7377 -0.80876969 0.00023780722 8 - 764 2123.4038 -0.46004685 0.00023780722 8 - 766 2142.9461 -0.50137367 0.00023780722 8 - 768 2155.9796 -0.88504716 0.00023780722 8 - 770 2137.3328 -1.2131181 0.00023780722 8 - 772 2133.4178 -1.2839864 0.00023780722 8 - 774 2135.5642 -1.1107438 0.00023780722 8 - 776 2131.4716 -0.9763852 0.00023780722 8 - 778 2141.1425 -1.1141508 0.00023780722 8 - 780 2122.4577 -1.2362837 0.00023780722 8 - 782 2097.188 -1.0587093 0.00023780722 8 - 784 2086.4293 -0.54517591 0.00023780722 8 - 786 2059.7386 0.078658205 0.00023780722 8 - 788 2056.9502 0.39365487 0.00023780722 8 - 790 2059.7875 0.44862285 0.00023780722 8 - 792 2053.9519 0.57572021 0.00023780722 8 - 794 2068.6847 0.87417066 0.00023780722 8 - 796 2074.5991 1.2047124 0.00023780722 8 - 798 2069.278 1.2159747 0.00023780722 8 - 800 2066.7899 0.81647619 0.00023780722 8 - 802 2049.668 0.38483557 0.00023780722 8 - 804 2041.8371 0.23434063 0.00023780722 8 - 806 2038.5434 0.39443232 0.00023780722 8 - 808 2026.6223 0.58693138 0.00023780722 8 - 810 2024.1624 0.5475207 0.00023780722 8 - 812 2004.3173 0.49231818 0.00023780722 8 - 814 1990.7789 0.70059886 0.00023780722 8 - 816 1987.2131 1.2210152 0.00023780722 8 - 818 2161.5038 10822.918 0.00025942606 9 - 820 2177.4678 1175.2783 0.00025942606 9 - 822 2184.519 57.816329 0.00025942606 9 - 824 2178.3276 -139.4906 0.00025942606 9 - 826 2180.645 -171.63641 0.00025942606 9 - 828 2165.9354 -159.58872 0.00025942606 9 - 830 2154.8716 -135.85339 0.00025942606 9 - 832 2159.4294 -110.79695 0.00025942606 9 - 834 2153.9831 -87.18999 0.00025942606 9 - 836 2167.9422 -66.446821 0.00025942606 9 - 838 2187.3361 -49.192935 0.00025942606 9 - 840 2200.8082 -35.535202 0.00025942606 9 - 842 2228.2294 -25.285213 0.00025942606 9 - 844 2225.4003 -17.694836 0.00025942606 9 - 846 2206.6625 -11.958408 0.00025942606 9 - 848 2190.7535 -7.5738088 0.00025942606 9 - 850 2158.8859 -4.4081209 0.00025942606 9 - 852 2150.4249 -2.6693514 0.00025942606 9 - 854 2146.7827 -2.1285586 0.00025942606 9 - 856 2121.866 -2.0452297 0.00025942606 9 - 858 2113.5398 -1.930143 0.00025942606 9 - 860 2093.4925 -1.6900544 0.00025942606 9 - 862 2074.3135 -1.6580782 0.00025942606 9 - 864 2088.9188 -2.0758526 0.00025942606 9 - 866 2087.6915 -2.5592562 0.00025942606 9 - 868 2097.5344 -2.7852457 0.00025942606 9 - 870 2112.2374 -2.6428098 0.00025942606 9 - 872 2097.2111 -2.3002782 0.00025942606 9 - 874 2106.853 -2.1636293 0.00025942606 9 - 876 2129.5068 -2.1747853 0.00025942606 9 - 878 2161.3576 -2.0561981 0.00025942606 9 - 880 2217.5514 -1.7416833 0.00025942606 9 - 882 2230.9698 -1.2884706 0.00025942606 9 - 884 2211.38 -1.0467174 0.00025942606 9 - 886 2187.0138 -1.1460354 0.00025942606 9 - 888 2146.1106 -1.2881048 0.00025942606 9 - 890 2140.9302 -1.3342717 0.00025942606 9 - 892 2149.0235 -1.2373227 0.00025942606 9 - 894 2134.5144 -1.1269002 0.00025942606 9 - 896 2142.6185 -1.2248568 0.00025942606 9 - 898 2137.3035 -1.302225 0.00025942606 9 - 900 2138.4339 -1.1745745 0.00025942606 9 - 902 2166.0789 -0.883737 0.00025942606 9 - 904 2166.6321 -0.53814532 0.00025942606 9 - 906 2163.9023 -0.4089786 0.00025942606 9 - 908 2153.7644 -0.42222952 0.00025942606 9 - 910 2124.8196 -0.28063037 0.00025942606 9 - 912 2123.2354 0.043174822 0.00025942606 9 - 914 2130.1172 0.46272084 0.00025942606 9 - 916 2139.3275 0.76049317 0.00025942606 9 - 918 2178.3808 0.82940816 0.00025942606 9 - 920 2323.8782 -485.39314 0.0002810449 10 - 922 2332.1565 -406.46688 0.0002810449 10 - 924 2336.3166 -337.18565 0.0002810449 10 - 926 2313.084 -276.7101 0.0002810449 10 - 928 2301.6359 -224.66195 0.0002810449 10 - 930 2284.8771 -180.5217 0.0002810449 10 - 932 2268.3016 -143.34858 0.0002810449 10 - 934 2283.2572 -112.17043 0.0002810449 10 - 936 2301.3935 -86.232909 0.0002810449 10 - 938 2326.6508 -65.092653 0.0002810449 10 - 940 2354.0325 -48.308852 0.0002810449 10 - 942 2357.0053 -35.117439 0.0002810449 10 - 944 2362.4019 -24.804745 0.0002810449 10 - 946 2364.5934 -16.882852 0.0002810449 10 - 948 2354.2772 -11.08542 0.0002810449 10 - 950 2358.2567 -7.2073771 0.0002810449 10 - 952 2357.9722 -4.7692456 0.0002810449 10 - 954 2370.3706 -3.2926218 0.0002810449 10 - 956 2395.8214 -2.466307 0.0002810449 10 - 958 2401.6564 -2.11421 0.0002810449 10 - 960 2403.7092 -2.1429976 0.0002810449 10 - 962 2396.0698 -2.2959924 0.0002810449 10 - 964 2390.1649 -2.3157527 0.0002810449 10 - 966 2404.5929 -2.1734121 0.0002810449 10 - 968 2408.3192 -1.98028 0.0002810449 10 - 970 2398.7909 -1.9375567 0.0002810449 10 - 972 2383.6803 -2.0199738 0.0002810449 10 - 974 2355.1449 -1.9574814 0.0002810449 10 - 976 2346.3489 -1.6961375 0.0002810449 10 - 978 2347.3597 -1.3865895 0.0002810449 10 - 980 2343.0369 -1.2700218 0.0002810449 10 - 982 2345.3213 -1.4297279 0.0002810449 10 - 984 2327.6 -1.5695591 0.0002810449 10 - 986 2318.7362 -1.4876651 0.0002810449 10 - 988 2326.2577 -1.2479203 0.0002810449 10 - 990 2316.612 -1.046613 0.0002810449 10 - 992 2313.3503 -1.0544885 0.0002810449 10 - 994 2314.0739 -1.0425882 0.0002810449 10 - 996 2317.8974 -0.69797366 0.0002810449 10 - 998 2349.5732 -0.086575463 0.0002810449 10 - 1000 2378.2958 0.48380694 0.0002810449 10 - 1002 2398.6531 0.66903819 0.0002810449 10 - 1004 2417.9165 0.48507547 0.0002810449 10 - 1006 2402.714 0.343508 0.0002810449 10 - 1008 2387.7715 0.39591155 0.0002810449 10 - 1010 2384.6905 0.48121177 0.0002810449 10 - 1012 2374.5546 0.33734725 0.0002810449 10 - 1014 2375.4496 -0.12992559 0.0002810449 10 - 1016 2366.5143 -0.54452336 0.0002810449 10 - 1018 2351.6829 -0.56192848 0.0002810449 10 - 1020 2345.0219 -0.2460576 0.0002810449 10 - 1022 2463.1847 -516.33252 0.00030266374 11 - 1024 2454.155 -435.41186 0.00030266374 11 - 1026 2437.707 -363.71737 0.00030266374 11 - 1028 2408.2814 -300.48778 0.00030266374 11 - 1030 2391.9754 -245.2709 0.00030266374 11 - 1032 2379.439 -197.89467 0.00030266374 11 - 1034 2368.5571 -158.05214 0.00030266374 11 - 1036 2366.4376 -124.96986 0.00030266374 11 - 1038 2352.3062 -97.480849 0.00030266374 11 - 1040 2359.7206 -74.664867 0.00030266374 11 - 1042 2380.554 -56.050357 0.00030266374 11 - 1044 2392.3114 -41.388607 0.00030266374 11 - 1046 2406.4028 -30.298934 0.00030266374 11 - 1048 2397.032 -21.930411 0.00030266374 11 - 1050 2388.3085 -15.453312 0.00030266374 11 - 1052 2408.961 -10.487276 0.00030266374 11 - 1054 2415.0795 -6.9671499 0.00030266374 11 - 1056 2413.2045 -4.92205 0.00030266374 11 - 1058 2402.5175 -3.9355994 0.00030266374 11 - 1060 2372.7166 -3.3093623 0.00030266374 11 - 1062 2379.1447 -2.6515003 0.00030266374 11 - 1064 2403.202 -1.9596171 0.00030266374 11 - 1066 2420.0621 -1.5615553 0.00030266374 11 - 1068 2434.315 -1.6023246 0.00030266374 11 - 1070 2413.6852 -1.6808363 0.00030266374 11 - 1072 2390.6494 -1.4902277 0.00030266374 11 - 1074 2391.2701 -1.1175681 0.00030266374 11 - 1076 2384.3245 -0.86479593 0.00030266374 11 - 1078 2383.5286 -0.99750191 0.00030266374 11 - 1080 2361.881 -1.2538663 0.00030266374 11 - 1082 2310.5086 -1.2171158 0.00030266374 11 - 1084 2271.943 -0.84898316 0.00030266374 11 - 1086 2245.7089 -0.41447514 0.00030266374 11 - 1088 2238.5277 -0.24768594 0.00030266374 11 - 1090 2250.6586 -0.33937731 0.00030266374 11 - 1092 2252.3465 -0.28270513 0.00030266374 11 - 1094 2257.7627 0.15192401 0.00030266374 11 - 1096 2269.8741 0.81014869 0.00030266374 11 - 1098 2286.5891 1.2659299 0.00030266374 11 - 1100 2325.5369 1.2551156 0.00030266374 11 - 1102 2346.6869 1.0727392 0.00030266374 11 - 1104 2355.8688 1.0527111 0.00030266374 11 - 1106 2358.3475 1.2373615 0.00030266374 11 - 1108 2345.8422 1.3818899 0.00030266374 11 - 1110 2353.8344 1.1564982 0.00030266374 11 - 1112 2369.5181 0.66950876 0.00030266374 11 - 1114 2373.066 0.29808963 0.00030266374 11 - 1116 2378.6809 0.23783651 0.00030266374 11 - 1118 2364.3707 0.43587025 0.00030266374 11 - 1120 2348.2868 0.57308599 0.00030266374 11 - 1122 2353.9119 0.50264505 0.00030266374 11 - 1124 2522.0253 52021.206 0.00032428258 12 - 1126 2539.0142 7338.6879 0.00032428258 12 - 1128 2559.8158 1270.0735 0.00032428258 12 - 1130 2561.38 145.3418 0.00032428258 12 - 1132 2579.5507 -94.489179 0.00032428258 12 - 1134 2589.1423 -136.27816 0.00032428258 12 - 1136 2596.4703 -127.81426 0.00032428258 12 - 1138 2624.7426 -107.06193 0.00032428258 12 - 1140 2635.6919 -85.101749 0.00032428258 12 - 1142 2646.3826 -65.610499 0.00032428258 12 - 1144 2659.2678 -49.534785 0.00032428258 12 - 1146 2649.6461 -36.607005 0.00032428258 12 - 1148 2660.6024 -26.488565 0.00032428258 12 - 1150 2670.7082 -18.659422 0.00032428258 12 - 1152 2675.1501 -12.837639 0.00032428258 12 - 1154 2698.7451 -8.8002486 0.00032428258 12 - 1156 2707.7717 -5.9663794 0.00032428258 12 - 1158 2729.6321 -3.9589674 0.00032428258 12 - 1160 2770.6577 -2.6699229 0.00032428258 12 - 1162 2784.6698 -1.9813875 0.00032428258 12 - 1164 2793.4127 -1.7981665 0.00032428258 12 - 1166 2786.6171 -1.8331689 0.00032428258 12 - 1168 2763.219 -1.8406929 0.00032428258 12 - 1170 2760.6924 -1.8850852 0.00032428258 12 - 1172 2757.2723 -2.0886949 0.00032428258 12 - 1174 2756.8909 -2.6016683 0.00032428258 12 - 1176 2771.3594 -3.2945397 0.00032428258 12 - 1178 2766.3013 -3.773452 0.00032428258 12 - 1180 2754.5699 -3.9231145 0.00032428258 12 - 1182 2743.4624 -3.8874086 0.00032428258 12 - 1184 2724.9347 -3.8562824 0.00032428258 12 - 1186 2722.9503 -3.8989691 0.00032428258 12 - 1188 2735.073 -3.7774613 0.00032428258 12 - 1190 2744.2224 -3.2658869 0.00032428258 12 - 1192 2748.5938 -2.4445578 0.00032428258 12 - 1194 2740.3303 -1.62823 0.00032428258 12 - 1196 2731.1588 -1.1293334 0.00032428258 12 - 1198 2726.6177 -0.94476657 0.00032428258 12 - 1200 2729.2096 -0.85989877 0.00032428258 12 - 1202 2733.9837 -0.76063952 0.00032428258 12 - 1204 2729.2231 -0.7546601 0.00032428258 12 - 1206 2727.2562 -1.0700876 0.00032428258 12 - 1208 2720.7499 -1.6500762 0.00032428258 12 - 1210 2708.6566 -2.1851417 0.00032428258 12 - 1212 2701.892 -2.4148926 0.00032428258 12 - 1214 2688.1758 -2.271921 0.00032428258 12 - 1216 2685.2216 -1.9798955 0.00032428258 12 - 1218 2706.9007 -1.7191217 0.00032428258 12 - 1220 2713.4925 -1.3407824 0.00032428258 12 - 1222 2738.9322 -0.77566391 0.00032428258 12 - 1224 2775.5509 -0.0090904929 0.00032428258 12 - 1226 2871.2813 -310.16764 0.00034590142 13 - 1228 2871.5817 -331.77712 0.00034590142 13 - 1230 2857.2201 -300.83945 0.00034590142 13 - 1232 2837.3673 -256.8061 0.00034590142 13 - 1234 2862.5084 -212.5256 0.00034590142 13 - 1236 2874.7593 -172.25556 0.00034590142 13 - 1238 2882.6633 -137.48854 0.00034590142 13 - 1240 2909.4893 -108.42395 0.00034590142 13 - 1242 2899.363 -84.307615 0.00034590142 13 - 1244 2909.5571 -64.468204 0.00034590142 13 - 1246 2941.0066 -48.373391 0.00034590142 13 - 1248 2936.772 -35.618618 0.00034590142 13 - 1250 2952.4744 -26.043372 0.00034590142 13 - 1252 2969.6093 -18.874053 0.00034590142 13 - 1254 2965.3037 -13.316472 0.00034590142 13 - 1256 2995.4101 -9.132234 0.00034590142 13 - 1258 3007.6778 -6.1946405 0.00034590142 13 - 1260 2994.9045 -4.5054107 0.00034590142 13 - 1262 3004.2835 -3.8873592 0.00034590142 13 - 1264 3001.6362 -3.6367295 0.00034590142 13 - 1266 3010.5562 -3.3538168 0.00034590142 13 - 1268 3046.5006 -3.141016 0.00034590142 13 - 1270 3056.1295 -3.1442573 0.00034590142 13 - 1272 3073.7105 -3.4643552 0.00034590142 13 - 1274 3102.7734 -3.7810315 0.00034590142 13 - 1276 3117.8626 -3.7042351 0.00034590142 13 - 1278 3138.7031 -3.3068889 0.00034590142 13 - 1280 3141.649 -2.81218 0.00034590142 13 - 1282 3120.5478 -2.4008861 0.00034590142 13 - 1284 3115.974 -2.0656352 0.00034590142 13 - 1286 3099.7148 -1.5004649 0.00034590142 13 - 1288 3082.8778 -0.71815106 0.00034590142 13 - 1290 3090.2566 -0.080564342 0.00034590142 13 - 1292 3080.8676 0.15328737 0.00034590142 13 - 1294 3072.2673 -0.084005595 0.00034590142 13 - 1296 3068.6598 -0.48789662 0.00034590142 13 - 1298 3051.4976 -0.73147096 0.00034590142 13 - 1300 3050.1371 -0.91875812 0.00034590142 13 - 1302 3071.9289 -1.302026 0.00034590142 13 - 1304 3089.0938 -1.9004835 0.00034590142 13 - 1306 3115.0464 -2.4956357 0.00034590142 13 - 1308 3141.219 -2.7417336 0.00034590142 13 - 1310 3156.2045 -2.5604889 0.00034590142 13 - 1312 3189.7615 -2.2909175 0.00034590142 13 - 1314 3229.6182 -2.2287307 0.00034590142 13 - 1316 3254.1712 -2.3087605 0.00034590142 13 - 1318 3288.7718 -2.2666589 0.00034590142 13 - 1320 3324.0655 -1.8935613 0.00034590142 13 - 1322 3340.5208 -1.3542012 0.00034590142 13 - 1324 3365.0481 -1.0760891 0.00034590142 13 - 1326 3370.2387 -1.0983067 0.00034590142 13 - 1328 3471.4805 2014.1654 0.00036752025 14 - 1330 3505.1634 330.03534 0.00036752025 14 - 1332 3539.7134 -69.649334 0.00036752025 14 - 1334 3566.793 -167.82115 0.00036752025 14 - 1336 3604.5501 -176.10466 0.00036752025 14 - 1338 3590.7429 -157.35136 0.00036752025 14 - 1340 3556.3012 -131.95483 0.00036752025 14 - 1342 3533.6395 -106.5047 0.00036752025 14 - 1344 3490.0063 -83.120672 0.00036752025 14 - 1346 3465.607 -63.491864 0.00036752025 14 - 1348 3457.3149 -47.999092 0.00036752025 14 - 1350 3412.3409 -35.927698 0.00036752025 14 - 1352 3381.2277 -26.551014 0.00036752025 14 - 1354 3349.4638 -19.272568 0.00036752025 14 - 1356 3304.6611 -13.811171 0.00036752025 14 - 1358 3304.3632 -10.049667 0.00036752025 14 - 1360 3310.1505 -7.4676253 0.00036752025 14 - 1362 3324.0496 -5.5416893 0.00036752025 14 - 1364 3367.7593 -4.0623241 0.00036752025 14 - 1366 3397.9879 -2.7787434 0.00036752025 14 - 1368 3412.4534 -1.7492008 0.00036752025 14 - 1370 3427.9927 -1.147808 0.00036752025 14 - 1372 3421.2999 -0.84877502 0.00036752025 14 - 1374 3431.4368 -0.77334018 0.00036752025 14 - 1376 3461.4741 -0.86904112 0.00036752025 14 - 1378 3483.9644 -1.1476447 0.00036752025 14 - 1380 3505.0425 -1.6733489 0.00036752025 14 - 1382 3494.7077 -2.2709129 0.00036752025 14 - 1384 3454.6986 -2.73897 0.00036752025 14 - 1386 3423.1053 -3.040692 0.00036752025 14 - 1388 3393.9828 -3.1941004 0.00036752025 14 - 1390 3368.8365 -3.3149273 0.00036752025 14 - 1392 3357.374 -3.4753807 0.00036752025 14 - 1394 3338.6876 -3.5730386 0.00036752025 14 - 1396 3322.6963 -3.5669074 0.00036752025 14 - 1398 3317.4036 -3.5137605 0.00036752025 14 - 1400 3306.4233 -3.5036114 0.00036752025 14 - 1402 3294.3469 -3.6465019 0.00036752025 14 - 1404 3288.9613 -3.9285698 0.00036752025 14 - 1406 3281.6542 -4.2217607 0.00036752025 14 - 1408 3289.0894 -4.4494179 0.00036752025 14 - 1410 3305.4438 -4.5424443 0.00036752025 14 - 1412 3307.9857 -4.4630054 0.00036752025 14 - 1414 3295.9878 -4.2471632 0.00036752025 14 - 1416 3282.069 -3.9622413 0.00036752025 14 - 1418 3269.3405 -3.6259962 0.00036752025 14 - 1420 3272.8895 -3.2426864 0.00036752025 14 - 1422 3294.6417 -2.7828443 0.00036752025 14 - 1424 3307.614 -2.2516614 0.00036752025 14 - 1426 3315.9908 -1.8186677 0.00036752025 14 - 1428 3307.4338 -1.6062873 0.00036752025 14 - 1430 3362.0036 591.24602 0.00038913909 15 - 1432 3348.3711 -22.903151 0.00038913909 15 - 1434 3339.0009 -180.94362 0.00038913909 15 - 1436 3327.8309 -205.13316 0.00038913909 15 - 1438 3323.8846 -188.6757 0.00038913909 15 - 1440 3302.8168 -161.33916 0.00038913909 15 - 1442 3280.8634 -133.06553 0.00038913909 15 - 1444 3274.9669 -106.90061 0.00038913909 15 - 1446 3261.4086 -83.772906 0.00038913909 15 - 1448 3260.2033 -64.232762 0.00038913909 15 - 1450 3256.8934 -48.308404 0.00038913909 15 - 1452 3243.1338 -35.618715 0.00038913909 15 - 1454 3249.12 -25.595933 0.00038913909 15 - 1456 3257.8764 -17.638422 0.00038913909 15 - 1458 3248.4414 -11.467315 0.00038913909 15 - 1460 3237.7196 -7.1629632 0.00038913909 15 - 1462 3212.5536 -4.5262728 0.00038913909 15 - 1464 3207.8346 -3.1275511 0.00038913909 15 - 1466 3240.6709 -2.4532209 0.00038913909 15 - 1468 3274.7659 -1.9941312 0.00038913909 15 - 1470 3309.7636 -1.7744811 0.00038913909 15 - 1472 3319.9011 -2.0039409 0.00038913909 15 - 1474 3301.7286 -2.5404117 0.00038913909 15 - 1476 3304.5902 -3.015492 0.00038913909 15 - 1478 3324.5802 -3.0251512 0.00038913909 15 - 1480 3349.1191 -2.6296881 0.00038913909 15 - 1482 3386.3334 -2.3009124 0.00038913909 15 - 1484 3386.5448 -2.2135937 0.00038913909 15 - 1486 3360.3384 -2.1803619 0.00038913909 15 - 1488 3347.1255 -1.9008543 0.00038913909 15 - 1490 3332.276 -1.2843614 0.00038913909 15 - 1492 3332.4353 -0.78765054 0.00038913909 15 - 1494 3362.446 -0.90165015 0.00038913909 15 - 1496 3378.4951 -1.503457 0.00038913909 15 - 1498 3399.9682 -2.142196 0.00038913909 15 - 1500 3424.6642 -2.4001451 0.00038913909 15 - 1502 3415.6927 -2.3206656 0.00038913909 15 - 1504 3399.699 -2.4566927 0.00038913909 15 - 1506 3380.1726 -3.0059402 0.00038913909 15 - 1508 3356.1819 -3.5410815 0.00038913909 15 - 1510 3372.1715 -3.5489313 0.00038913909 15 - 1512 3407.3769 -2.8683598 0.00038913909 15 - 1514 3422.0433 -1.9562886 0.00038913909 15 - 1516 3438.5941 -1.4855083 0.00038913909 15 - 1518 3429.8051 -1.4723825 0.00038913909 15 - 1520 3417.385 -1.4858933 0.00038913909 15 - 1522 3440.37 -1.1865901 0.00038913909 15 - 1524 3458.4548 -0.67483073 0.00038913909 15 - 1526 3469.3533 -0.55678882 0.00038913909 15 - 1528 3490.916 -1.1714695 0.00038913909 15 - 1530 3492.0061 -2.0409487 0.00038913909 15 - 1532 3591.2065 933.33366 0.00041075793 16 - 1534 3613.996 28.275741 0.00041075793 16 - 1536 3592.9837 -172.35131 0.00041075793 16 - 1538 3576.1566 -203.31573 0.00041075793 16 - 1540 3569.3197 -188.5623 0.00041075793 16 - 1542 3559.2173 -161.72853 0.00041075793 16 - 1544 3581.5844 -132.85329 0.00041075793 16 - 1546 3598.8905 -105.35356 0.00041075793 16 - 1548 3591.8015 -81.305445 0.00041075793 16 - 1550 3601.2781 -61.769959 0.00041075793 16 - 1552 3610.8049 -46.305773 0.00041075793 16 - 1554 3635.071 -33.909703 0.00041075793 16 - 1556 3673.1152 -23.903242 0.00041075793 16 - 1558 3674.3301 -16.196577 0.00041075793 16 - 1560 3656.4931 -10.875945 0.00041075793 16 - 1562 3635.4528 -7.5675014 0.00041075793 16 - 1564 3605.0214 -5.4309671 0.00041075793 16 - 1566 3597.8995 -3.8836753 0.00041075793 16 - 1568 3589.3965 -2.7710753 0.00041075793 16 - 1570 3557.0846 -2.1656742 0.00041075793 16 - 1572 3522.8206 -2.1249828 0.00041075793 16 - 1574 3488.0784 -2.3270696 0.00041075793 16 - 1576 3468.5242 -2.3006944 0.00041075793 16 - 1578 3480.3442 -1.9105952 0.00041075793 16 - 1580 3502.4035 -1.4703121 0.00041075793 16 - 1582 3514.5124 -1.3686635 0.00041075793 16 - 1584 3529.8072 -1.6349027 0.00041075793 16 - 1586 3549.9111 -1.8290023 0.00041075793 16 - 1588 3581.7588 -1.6259883 0.00041075793 16 - 1590 3627.3261 -1.2043943 0.00041075793 16 - 1592 3670.0906 -1.032423 0.00041075793 16 - 1594 3693.8859 -1.3608622 0.00041075793 16 - 1596 3716.2459 -2.0059406 0.00041075793 16 - 1598 3731.9525 -2.5008352 0.00041075793 16 - 1600 3743.6525 -2.6784874 0.00041075793 16 - 1602 3760.9905 -2.7998984 0.00041075793 16 - 1604 3761.3113 -3.1223193 0.00041075793 16 - 1606 3748.8697 -3.6314108 0.00041075793 16 - 1608 3739.8794 -3.9850298 0.00041075793 16 - 1610 3722.0372 -3.8300328 0.00041075793 16 - 1612 3715.944 -3.30415 0.00041075793 16 - 1614 3712.6256 -2.7922936 0.00041075793 16 - 1616 3689.1991 -2.5191961 0.00041075793 16 - 1618 3674.8638 -2.4644698 0.00041075793 16 - 1620 3656.7564 -2.3324852 0.00041075793 16 - 1622 3635.8706 -2.016391 0.00041075793 16 - 1624 3634.1611 -1.7433529 0.00041075793 16 - 1626 3612.7237 -1.6722602 0.00041075793 16 - 1628 3577.439 -1.84882 0.00041075793 16 - 1630 3562.4417 -2.128466 0.00041075793 16 - 1632 3549.0826 -2.2282459 0.00041075793 16 - 1634 3632.1374 -186.35031 0.00043237677 17 - 1636 3648.9593 -296.79359 0.00043237677 17 - 1638 3641.3738 -282.99578 0.00043237677 17 - 1640 3650.8687 -244.99487 0.00043237677 17 - 1642 3673.7223 -204.09587 0.00043237677 17 - 1644 3690.3923 -166.23129 0.00043237677 17 - 1646 3717.9157 -133.14546 0.00043237677 17 - 1648 3718.0414 -104.89207 0.00043237677 17 - 1650 3697.4633 -81.115712 0.00043237677 17 - 1652 3705.0511 -61.49637 0.00043237677 17 - 1654 3714.781 -45.659171 0.00043237677 17 - 1656 3730.9613 -33.243337 0.00043237677 17 - 1658 3741.1851 -23.708946 0.00043237677 17 - 1660 3717.9711 -16.478718 0.00043237677 17 - 1662 3701.7524 -11.228053 0.00043237677 17 - 1664 3711.2786 -7.6811287 0.00043237677 17 - 1666 3729.4217 -5.4701745 0.00043237677 17 - 1668 3756.06 -4.196296 0.00043237677 17 - 1670 3762.1859 -3.3948328 0.00043237677 17 - 1672 3750.3442 -2.795002 0.00043237677 17 - 1674 3750.3911 -2.3631317 0.00043237677 17 - 1676 3743.935 -2.1198915 0.00043237677 17 - 1678 3733.116 -2.0433621 0.00043237677 17 - 1680 3711.4814 -1.9570085 0.00043237677 17 - 1682 3673.0703 -1.7553287 0.00043237677 17 - 1684 3640.8032 -1.6100182 0.00043237677 17 - 1686 3623.5278 -1.7720453 0.00043237677 17 - 1688 3609.6657 -2.2903733 0.00043237677 17 - 1690 3595.0925 -2.9520482 0.00043237677 17 - 1692 3574.7946 -3.4520403 0.00043237677 17 - 1694 3553.4592 -3.7172417 0.00043237677 17 - 1696 3550.4998 -3.9662696 0.00043237677 17 - 1698 3573.0918 -4.3864824 0.00043237677 17 - 1700 3608.4812 -4.8143282 0.00043237677 17 - 1702 3649.7102 -4.8822052 0.00043237677 17 - 1704 3691.715 -4.4058032 0.00043237677 17 - 1706 3712.538 -3.5738906 0.00043237677 17 - 1708 3723.8041 -2.8233117 0.00043237677 17 - 1710 3728.6131 -2.3180266 0.00043237677 17 - 1712 3721.5916 -1.8298925 0.00043237677 17 - 1714 3722.2323 -1.145955 0.00043237677 17 - 1716 3720.8412 -0.35106009 0.00043237677 17 - 1718 3704.2798 0.13931625 0.00043237677 17 - 1720 3691.24 0.0070879972 0.00043237677 17 - 1722 3664.7923 -0.49492297 0.00043237677 17 - 1724 3636.2585 -0.93235898 0.00043237677 17 - 1726 3623.6805 -1.0766384 0.00043237677 17 - 1728 3601.4828 -1.0674569 0.00043237677 17 - 1730 3594.1993 -1.2953611 0.00043237677 17 - 1732 3595.7016 -1.7010658 0.00043237677 17 - 1734 3584.1108 -1.801104 0.00043237677 17 - 1736 3713.9177 157.48163 0.00045399561 18 - 1738 3729.1228 -244.26726 0.00045399561 18 - 1740 3729.6815 -300.0614 0.00045399561 18 - 1742 3750.7503 -278.25336 0.00045399561 18 - 1744 3748.1243 -238.83242 0.00045399561 18 - 1746 3741.9127 -197.8389 0.00045399561 18 - 1748 3755.7248 -160.28928 0.00045399561 18 - 1750 3749.7764 -127.74147 0.00045399561 18 - 1752 3753.2746 -100.53428 0.00045399561 18 - 1754 3765.3549 -78.121856 0.00045399561 18 - 1756 3759.2282 -59.655351 0.00045399561 18 - 1758 3775.6312 -44.626232 0.00045399561 18 - 1760 3784.8396 -32.615627 0.00045399561 18 - 1762 3771.0752 -23.447131 0.00045399561 18 - 1764 3780.4144 -16.86878 0.00045399561 18 - 1766 3782.4234 -12.0877 0.00045399561 18 - 1768 3794.5104 -8.4068303 0.00045399561 18 - 1770 3824.6482 -5.5286928 0.00045399561 18 - 1772 3824.8005 -3.4631071 0.00045399561 18 - 1774 3824.9637 -2.4005261 0.00045399561 18 - 1776 3832.2073 -2.0425462 0.00045399561 18 - 1778 3824.1265 -1.7381825 0.00045399561 18 - 1780 3826.3354 -1.2396341 0.00045399561 18 - 1782 3822.7018 -0.70624837 0.00045399561 18 - 1784 3803.6551 -0.51472634 0.00045399561 18 - 1786 3799.9592 -0.8237544 0.00045399561 18 - 1788 3798.5286 -1.2770654 0.00045399561 18 - 1790 3792.3951 -1.4626882 0.00045399561 18 - 1792 3788.7063 -1.3397023 0.00045399561 18 - 1794 3777.0686 -1.1815152 0.00045399561 18 - 1796 3779.2508 -1.2957126 0.00045399561 18 - 1798 3807.3391 -1.6056954 0.00045399561 18 - 1800 3840.8603 -1.7394881 0.00045399561 18 - 1802 3867.8952 -1.5119262 0.00045399561 18 - 1804 3879.448 -1.1126446 0.00045399561 18 - 1806 3874.0178 -0.89376073 0.00045399561 18 - 1808 3870.4205 -1.0013994 0.00045399561 18 - 1810 3874.9689 -1.1896861 0.00045399561 18 - 1812 3882.7366 -1.1347346 0.00045399561 18 - 1814 3893.4144 -0.80375709 0.00045399561 18 - 1816 3892.8065 -0.43723593 0.00045399561 18 - 1818 3879.6317 -0.27127498 0.00045399561 18 - 1820 3863.231 -0.26927869 0.00045399561 18 - 1822 3839.1828 -0.16469626 0.00045399561 18 - 1824 3817.7643 0.17259437 0.00045399561 18 - 1826 3814.5806 0.55900288 0.00045399561 18 - 1828 3814.4881 0.73981688 0.00045399561 18 - 1830 3826.593 0.61721493 0.00045399561 18 - 1832 3850.1378 0.38603904 0.00045399561 18 - 1834 3867.6612 0.31140301 0.00045399561 18 - 1836 3881.9933 0.36675857 0.00045399561 18 - 1838 4088.212 261434.69 0.00047561445 19 - 1840 4096.5564 27676.737 0.00047561445 19 - 1842 4116.6104 4562.7115 0.00047561445 19 - 1844 4138.3331 942.30407 0.00047561445 19 - 1846 4157.8346 171.41233 0.00047561445 19 - 1848 4189.7389 -26.014237 0.00047561445 19 - 1850 4203.2273 -76.212233 0.00047561445 19 - 1852 4206.7084 -81.595913 0.00047561445 19 - 1854 4214.7407 -72.613587 0.00047561445 19 - 1856 4219.541 -59.566243 0.00047561445 19 - 1858 4238.5637 -46.274295 0.00047561445 19 - 1860 4268.5595 -34.588591 0.00047561445 19 - 1862 4277.6539 -25.225003 0.00047561445 19 - 1864 4285.3854 -18.06534 0.00047561445 19 - 1866 4276.8633 -12.627639 0.00047561445 19 - 1868 4255.485 -8.5283892 0.00047561445 19 - 1870 4248.7917 -5.6394153 0.00047561445 19 - 1872 4232.7796 -3.7373251 0.00047561445 19 - 1874 4213.674 -2.5982718 0.00047561445 19 - 1876 4196.3767 -1.8849709 0.00047561445 19 - 1878 4154.9323 -1.2753507 0.00047561445 19 - 1880 4121.2743 -0.82249822 0.00047561445 19 - 1882 4101.6239 -0.60366804 0.00047561445 19 - 1884 4076.731 -0.62133231 0.00047561445 19 - 1886 4071.191 -0.92478991 0.00047561445 19 - 1888 4070.5745 -1.3485064 0.00047561445 19 - 1890 4073.0041 -1.8304913 0.00047561445 19 - 1892 4099.534 -2.4147085 0.00047561445 19 - 1894 4122.2249 -3.0099619 0.00047561445 19 - 1896 4134.95 -3.5440729 0.00047561445 19 - 1898 4138.662 -3.8951738 0.00047561445 19 - 1900 4119.9803 -3.9477528 0.00047561445 19 - 1902 4105.9779 -3.7437217 0.00047561445 19 - 1904 4103.6993 -3.3264299 0.00047561445 19 - 1906 4099.5993 -2.7195122 0.00047561445 19 - 1908 4099.0927 -2.0152229 0.00047561445 19 - 1910 4092.7303 -1.3051093 0.00047561445 19 - 1912 4079.7989 -0.70887774 0.00047561445 19 - 1914 4070.1861 -0.30814281 0.00047561445 19 - 1916 4064.2331 -0.12483815 0.00047561445 19 - 1918 4057.4172 -0.14863786 0.00047561445 19 - 1920 4045.7673 -0.36919485 0.00047561445 19 - 1922 4025.2377 -0.75787503 0.00047561445 19 - 1924 3997.6829 -1.2270004 0.00047561445 19 - 1926 3973.4154 -1.6380242 0.00047561445 19 - 1928 3967.2261 -1.8579591 0.00047561445 19 - 1930 3984.008 -1.8481876 0.00047561445 19 - 1932 4014.2028 -1.695545 0.00047561445 19 - 1934 4040.7038 -1.4466441 0.00047561445 19 - 1936 4046.6823 -1.0457806 0.00047561445 19 - 1938 4050.3414 -0.43691244 0.00047561445 19 - 1940 4158.8456 -485.87062 0.00049723329 20 - 1942 4138.6859 -406.83847 0.00049723329 20 - 1944 4122.6253 -337.57463 0.00049723329 20 - 1946 4101.6274 -277.34116 0.00049723329 20 - 1948 4085.2854 -225.34082 0.00049723329 20 - 1950 4088.9637 -181.0183 0.00049723329 20 - 1952 4109.9585 -143.74698 0.00049723329 20 - 1954 4141.6977 -112.7839 0.00049723329 20 - 1956 4173.9013 -87.397165 0.00049723329 20 - 1958 4185.8014 -66.686886 0.00049723329 20 - 1960 4182.5342 -49.929089 0.00049723329 20 - 1962 4173.7911 -36.539866 0.00049723329 20 - 1964 4164.6792 -26.055513 0.00049723329 20 - 1966 4166.91 -18.173563 0.00049723329 20 - 1968 4170.7606 -12.411793 0.00049723329 20 - 1970 4168.2387 -8.2434854 0.00049723329 20 - 1972 4167.5496 -5.3241601 0.00049723329 20 - 1974 4165.6717 -3.4268698 0.00049723329 20 - 1976 4171.0255 -2.459824 0.00049723329 20 - 1978 4186.2281 -2.210817 0.00049723329 20 - 1980 4200.046 -2.2265372 0.00049723329 20 - 1982 4214.8919 -2.1835848 0.00049723329 20 - 1984 4230.6418 -1.9876854 0.00049723329 20 - 1986 4242.4071 -1.7430167 0.00049723329 20 - 1988 4252.8222 -1.6283597 0.00049723329 20 - 1990 4255.8615 -1.5968122 0.00049723329 20 - 1992 4261.9838 -1.4850549 0.00049723329 20 - 1994 4280.013 -1.1801127 0.00049723329 20 - 1996 4298.903 -0.75483617 0.00049723329 20 - 1998 4315.3363 -0.43775783 0.00049723329 20 - 2000 4312.8744 -0.26775056 0.00049723329 20 - 2002 4295.4994 -0.071325246 0.00049723329 20 - 2004 4276.0581 0.34550495 0.00049723329 20 - 2006 4259.7706 1.0097526 0.00049723329 20 - 2008 4259.7877 1.6450507 0.00049723329 20 - 2010 4266.37 1.9897528 0.00049723329 20 - 2012 4263.4827 2.1177927 0.00049723329 20 - 2014 4268.7607 2.2393951 0.00049723329 20 - 2016 4281.4665 2.4617856 0.00049723329 20 - 2018 4299.8629 2.6164942 0.00049723329 20 - 2020 4332.5133 2.4169235 0.00049723329 20 - 2022 4350.4848 1.8843467 0.00049723329 20 - 2024 4354.7043 1.2629554 0.00049723329 20 - 2026 4348.8078 0.82057161 0.00049723329 20 - 2028 4326.3199 0.59662969 0.00049723329 20 - 2030 4306.4246 0.32430208 0.00049723329 20 - 2032 4292.6428 -0.17386259 0.00049723329 20 - 2034 4285.4709 -0.76060626 0.00049723329 20 - 2036 4289.9933 -1.1707279 0.00049723329 20 - 2038 4289.6574 -1.2615962 0.00049723329 20 - 2040 4289.8823 -1.2227653 0.00049723329 20 - 2042 4372.236 -484.15319 0.00051885212 21 - 2044 4363.8565 -409.58287 0.00051885212 21 - 2046 4374.4373 -342.09516 0.00051885212 21 - 2048 4397.6019 -282.27516 0.00051885212 21 - 2050 4419.5998 -230.19598 0.00051885212 21 - 2052 4444.6113 -185.83214 0.00051885212 21 - 2054 4463.2143 -148.62046 0.00051885212 21 - 2056 4483.7739 -117.65238 0.00051885212 21 - 2058 4502.9214 -92.03373 0.00051885212 21 - 2060 4499.5116 -70.903642 0.00051885212 21 - 2062 4485.0808 -53.819643 0.00051885212 21 - 2064 4460.1892 -40.351592 0.00051885212 21 - 2066 4441.3547 -29.893614 0.00051885212 21 - 2068 4453.6573 -21.870035 0.00051885212 21 - 2070 4471.3583 -15.74966 0.00051885212 21 - 2072 4481.8502 -11.269104 0.00051885212 21 - 2074 4482.5479 -8.2901014 0.00051885212 21 - 2076 4458.9428 -6.4842891 0.00051885212 21 - 2078 4440.2746 -5.4884006 0.00051885212 21 - 2080 4430.7879 -4.8831169 0.00051885212 21 - 2082 4418.2045 -4.3334616 0.00051885212 21 - 2084 4420.9827 -3.8690608 0.00051885212 21 - 2086 4415.2895 -3.4747959 0.00051885212 21 - 2088 4403.2127 -3.0698792 0.00051885212 21 - 2090 4404.9829 -2.6092157 0.00051885212 21 - 2092 4394.4738 -2.0329887 0.00051885212 21 - 2094 4381.445 -1.4800426 0.00051885212 21 - 2096 4382.9362 -1.087972 0.00051885212 21 - 2098 4380.2994 -0.77244565 0.00051885212 21 - 2100 4394.8792 -0.49150427 0.00051885212 21 - 2102 4420.8861 -0.20635176 0.00051885212 21 - 2104 4429.8268 0.0310276 0.00051885212 21 - 2106 4440.2236 0.055920203 0.00051885212 21 - 2108 4439.1631 -0.098651465 0.00051885212 21 - 2110 4427.5624 -0.31987022 0.00051885212 21 - 2112 4425.6367 -0.54703789 0.00051885212 21 - 2114 4413.4448 -0.71799966 0.00051885212 21 - 2116 4390.8139 -0.88704628 0.00051885212 21 - 2118 4370.4401 -1.0790848 0.00051885212 21 - 2120 4341.8148 -1.1893832 0.00051885212 21 - 2122 4323.8283 -1.1913674 0.00051885212 21 - 2124 4316.3088 -1.0938027 0.00051885212 21 - 2126 4303.2157 -0.92089888 0.00051885212 21 - 2128 4293.2329 -0.72556801 0.00051885212 21 - 2130 4277.4687 -0.470313 0.00051885212 21 - 2132 4254.036 -0.18509838 0.00051885212 21 - 2134 4238.7708 0.0079755602 0.00051885212 21 - 2136 4226.4974 0.040694129 0.00051885212 21 - 2138 4216.435 -0.083088073 0.00051885212 21 - 2140 4210.2068 -0.27891332 0.00051885212 21 - 2142 4190.1478 -0.45071942 0.00051885212 21 - 2144 4358.0641 7552.2519 0.00054047096 22 - 2146 4343.8669 2546.2605 0.00054047096 22 - 2148 4337.8495 832.13859 0.00054047096 22 - 2150 4344.8145 161.37654 0.00054047096 22 - 2152 4354.659 -102.52396 0.00054047096 22 - 2154 4351.261 -186.01241 0.00054047096 22 - 2156 4338.2721 -196.408 0.00054047096 22 - 2158 4326.0159 -183.30606 0.00054047096 22 - 2160 4316.8225 -163.19657 0.00054047096 22 - 2162 4315.5646 -139.65485 0.00054047096 22 - 2164 4318.7228 -112.47106 0.00054047096 22 - 2166 4308.7441 -86.692739 0.00054047096 22 - 2168 4296.5417 -64.897163 0.00054047096 22 - 2170 4295.1338 -47.217693 0.00054047096 22 - 2172 4296.3245 -33.218667 0.00054047096 22 - 2174 4309.7186 -22.42771 0.00054047096 22 - 2176 4322.8738 -14.380445 0.00054047096 22 - 2178 4325.1652 -8.7240076 0.00054047096 22 - 2180 4339.5136 -5.1399194 0.00054047096 22 - 2182 4359.4978 -3.125563 0.00054047096 22 - 2184 4374.7235 -2.1060967 0.00054047096 22 - 2186 4392.561 -1.6122362 0.00054047096 22 - 2188 4391.6476 -1.3419931 0.00054047096 22 - 2190 4375.4402 -1.2451958 0.00054047096 22 - 2192 4370.8847 -1.2691448 0.00054047096 22 - 2194 4362.5429 -1.1671537 0.00054047096 22 - 2196 4357.6371 -0.78265168 0.00054047096 22 - 2198 4353.2768 -0.1660927 0.00054047096 22 - 2200 4327.6061 0.4949875 0.00054047096 22 - 2202 4303.2649 0.97439091 0.00054047096 22 - 2204 4295.6358 1.2953222 0.00054047096 22 - 2206 4299.8451 1.6516724 0.00054047096 22 - 2208 4331.8468 2.0778491 0.00054047096 22 - 2210 4369.8179 2.4301813 0.00054047096 22 - 2212 4390.4687 2.4771921 0.00054047096 22 - 2214 4410.043 2.0979253 0.00054047096 22 - 2216 4420.4824 1.5015737 0.00054047096 22 - 2218 4428.5418 0.9293217 0.00054047096 22 - 2220 4438.6351 0.4452181 0.00054047096 22 - 2222 4429.7042 -0.022725602 0.00054047096 22 - 2224 4410.5614 -0.57362223 0.00054047096 22 - 2226 4394.6197 -1.1018693 0.00054047096 22 - 2228 4377.6656 -1.356307 0.00054047096 22 - 2230 4369.9848 -1.2799089 0.00054047096 22 - 2232 4359.5241 -1.033239 0.00054047096 22 - 2234 4329.7464 -0.87111314 0.00054047096 22 - 2236 4297.4136 -0.92360827 0.00054047096 22 - 2238 4274.4896 -1.0300654 0.00054047096 22 - 2240 4273.3355 -0.99506577 0.00054047096 22 - 2242 4299.8049 -0.84965213 0.00054047096 22 - 2244 4375.9624 -0.73547198 0.00054047096 22 - 2246 4419.4249 -428.66499 0.0005620898 23 - 2248 4440.1921 -357.75283 0.0005620898 23 - 2250 4458.4562 -295.72755 0.0005620898 23 - 2252 4483.515 -241.53239 0.0005620898 23 - 2254 4521.6264 -194.6715 0.0005620898 23 - 2256 4558.4436 -154.95368 0.0005620898 23 - 2258 4584.9658 -121.92313 0.0005620898 23 - 2260 4603.2392 -94.63205 0.0005620898 23 - 2262 4610.9187 -72.117113 0.0005620898 23 - 2264 4620.6516 -53.81207 0.0005620898 23 - 2266 4641.2237 -39.52074 0.0005620898 23 - 2268 4656.112 -28.916367 0.0005620898 23 - 2270 4661.2055 -21.28721 0.0005620898 23 - 2272 4654.102 -15.778242 0.0005620898 23 - 2274 4635.5037 -11.772833 0.0005620898 23 - 2276 4629.6411 -9.0646229 0.0005620898 23 - 2278 4644.5739 -7.5297271 0.0005620898 23 - 2280 4672.0076 -6.7876668 0.0005620898 23 - 2282 4715.8278 -6.3114881 0.0005620898 23 - 2284 4756.7958 -5.5841706 0.0005620898 23 - 2286 4786.6985 -4.5853628 0.0005620898 23 - 2288 4809.2288 -3.3898975 0.0005620898 23 - 2290 4814.2053 -2.5577365 0.0005620898 23 - 2292 4817.5747 -2.0119957 0.0005620898 23 - 2294 4838.8221 -1.5689555 0.0005620898 23 - 2296 4875.5697 -1.1551628 0.0005620898 23 - 2298 4930.9308 -0.81843584 0.0005620898 23 - 2300 4984.499 -0.82134226 0.0005620898 23 - 2302 5011.4719 -1.294796 0.0005620898 23 - 2304 5020.5621 -2.0456668 0.0005620898 23 - 2306 5009.736 -2.6179285 0.0005620898 23 - 2308 4995.1273 -3.3240647 0.0005620898 23 - 2310 4989.781 -4.1051438 0.0005620898 23 - 2312 4987.6058 -4.6474518 0.0005620898 23 - 2314 4993.5373 -5.2163273 0.0005620898 23 - 2316 5013.1231 -5.3993449 0.0005620898 23 - 2318 5032.7696 -5.1426741 0.0005620898 23 - 2320 5052.2507 -4.7378163 0.0005620898 23 - 2322 5066.676 -4.4309223 0.0005620898 23 - 2324 5070.9335 -4.011325 0.0005620898 23 - 2326 5075.3187 -3.575017 0.0005620898 23 - 2328 5080.1483 -2.937051 0.0005620898 23 - 2330 5089.0513 -2.218688 0.0005620898 23 - 2332 5106.4161 -1.5761829 0.0005620898 23 - 2334 5114.3901 -1.3379256 0.0005620898 23 - 2336 5111.765 -1.4168282 0.0005620898 23 - 2338 5109.8218 -1.3945147 0.0005620898 23 - 2340 5112.3651 -1.3179987 0.0005620898 23 - 2342 5129.4026 -1.1933029 0.0005620898 23 - 2344 5151.596 -1.1509356 0.0005620898 23 - 2346 5173.0185 -1.1910036 0.0005620898 23 - 2348 5397.9032 68.928762 0.00058370864 24 - 2350 5407.0266 -233.97041 0.00058370864 24 - 2352 5422.5601 -279.88482 0.00058370864 24 - 2354 5473.9255 -259.08824 0.00058370864 24 - 2356 5488.0698 -221.76737 0.00058370864 24 - 2358 5468.2353 -183.12481 0.00058370864 24 - 2360 5493.5403 -147.94875 0.00058370864 24 - 2362 5556.8153 -117.258 0.00058370864 24 - 2364 5476.495 -91.2006 0.00058370864 24 - 2366 5535.1518 -69.535188 0.00058370864 24 - 2368 5463.379 -52.175894 0.00058370864 24 - 2370 5406.5993 -38.635185 0.00058370864 24 - 2372 5379.6399 -28.053989 0.00058370864 24 - 2374 5293.9387 -19.606039 0.00058370864 24 - 2376 5254.14 -12.991082 0.00058370864 24 - 2378 5252.9692 -7.9447819 0.00058370864 24 - 2380 5190.6301 -4.2982853 0.00058370864 24 - 2382 5239.8106 -2.0984084 0.00058370864 24 - 2384 5265.9434 -0.66290855 0.00058370864 24 - 2386 5278.5471 0.24706688 0.00058370864 24 - 2388 5310.5694 0.81491696 0.00058370864 24 - 2390 5325.4843 0.83332156 0.00058370864 24 - 2392 5287.052 0.65384817 0.00058370864 24 - 2394 5217.4306 -0.2905052 0.00058370864 24 - 2396 5151.0811 -1.3614891 0.00058370864 24 - 2398 5089.4464 -2.1978833 0.00058370864 24 - 2400 5096.8527 -2.5845056 0.00058370864 24 - 2402 5081.1023 -2.6357504 0.00058370864 24 - 2404 5112.6314 -2.7644934 0.00058370864 24 - 2406 5098.9354 -2.724554 0.00058370864 24 - 2408 5027.2334 -2.6826803 0.00058370864 24 - 2410 4972.12 -2.1045636 0.00058370864 24 - 2412 4978.4482 -1.2633463 0.00058370864 24 - 2414 5015.2935 -0.8286916 0.00058370864 24 - 2416 5052.309 -0.81559079 0.00058370864 24 - 2418 5003.9654 -1.104621 0.00058370864 24 - 2420 4973.9856 -1.5018687 0.00058370864 24 - 2422 4949.7823 -1.6447218 0.00058370864 24 - 2424 4901.9468 -1.5725746 0.00058370864 24 - 2426 4945.389 -1.9278468 0.00058370864 24 - 2428 4973.9992 -2.4855638 0.00058370864 24 - 2430 4942.1022 -2.7325455 0.00058370864 24 - 2432 4934.3944 -2.6684489 0.00058370864 24 - 2434 4931.5278 -2.3317286 0.00058370864 24 - 2436 4815.7187 -1.7602239 0.00058370864 24 - 2438 4763.8819 -1.4516585 0.00058370864 24 - 2440 4827.3393 -1.5296665 0.00058370864 24 - 2442 4794.2051 -1.3026967 0.00058370864 24 - 2444 4784.3245 -0.9623875 0.00058370864 24 - 2446 4880.5328 -0.79855584 0.00058370864 24 - 2448 4892.9298 -0.48521837 0.00058370864 24 - 2450 5042.5229 182.15531 0.00060532748 25 - 2452 5194.8177 -126.79776 0.00060532748 25 - 2454 5156.6538 -209.68466 0.00060532748 25 - 2456 5136.7898 -214.15629 0.00060532748 25 - 2458 5190.4494 -191.92028 0.00060532748 25 - 2460 5193.0372 -162.44965 0.00060532748 25 - 2462 5135.1347 -132.94313 0.00060532748 25 - 2464 5088.2711 -105.26975 0.00060532748 25 - 2466 5044.2865 -80.777237 0.00060532748 25 - 2468 5030.1682 -60.734524 0.00060532748 25 - 2470 5014.4445 -44.886842 0.00060532748 25 - 2472 5005.9881 -32.581621 0.00060532748 25 - 2474 5084.7476 -23.310238 0.00060532748 25 - 2476 5139.566 -16.306979 0.00060532748 25 - 2478 5123.4439 -11.089426 0.00060532748 25 - 2480 5164.1777 -7.6656601 0.00060532748 25 - 2482 5166.1753 -5.6256871 0.00060532748 25 - 2484 5134.5927 -4.5032297 0.00060532748 25 - 2486 5177.4063 -3.9773157 0.00060532748 25 - 2488 5176.7834 -3.4385437 0.00060532748 25 - 2490 5169.781 -2.9064023 0.00060532748 25 - 2492 5201.8608 -2.6139644 0.00060532748 25 - 2494 5238.2059 -2.4480956 0.00060532748 25 - 2496 5254.5338 -2.3015056 0.00060532748 25 - 2498 5302.7629 -2.3369754 0.00060532748 25 - 2500 5270.998 -2.39524 0.00060532748 25 - 2502 5243.3575 -2.5889856 0.00060532748 25 - 2504 5243.4678 -2.9219197 0.00060532748 25 - 2506 5255.0345 -3.2719206 0.00060532748 25 - 2508 5235.6551 -3.4395484 0.00060532748 25 - 2510 5267.9805 -3.4601437 0.00060532748 25 - 2512 5261.7225 -3.2244038 0.00060532748 25 - 2514 5247.9792 -2.9449064 0.00060532748 25 - 2516 9386.5057 0.95935555 0.00060532748 25 - 2518 8507.1834 0.58218735 0.00060532748 25 - 2520 7456.5024 -1.7231674 0.00060532748 25 - 2522 6442.2381 -5.0299011 0.00060532748 25 - 2524 6243.5623 -4.3174698 0.00060532748 25 - 2526 7107.4023 -1.4486735 0.00060532748 25 - 2528 7462.5296 -1.6382013 0.00060532748 25 - 2530 7393.0945 -4.1006752 0.00060532748 25 - 2532 7446.8193 -4.961236 0.00060532748 25 - 2534 7814.2762 -3.5806698 0.00060532748 25 - 2536 7831.3195 -3.3453364 0.00060532748 25 - 2538 7269.6909 -4.5344277 0.00060532748 25 - 2540 6782.9301 -6.405289 0.00060532748 25 - 2542 6632.3199 -6.7366822 0.00060532748 25 - 2544 6843.4229 -5.4785068 0.00060532748 25 - 2546 7126.1657 -3.6868879 0.00060532748 25 - 2548 7320.2489 -2.1533112 0.00060532748 25 - 2550 7318.4623 -0.76400617 0.00060532748 25 - 2552 7319.7814 54889.243 0.00062694632 26 - 2554 7257.4954 4122.9284 0.00062694632 26 - 2556 7297.3206 322.50289 0.00062694632 26 - 2558 7268.0205 -127.41959 0.00062694632 26 - 2560 7199.2444 -173.52049 0.00062694632 26 - 2562 7087.7664 -155.56395 0.00062694632 26 - 2564 7071.1012 -128.16295 0.00062694632 26 - 2566 7136.41 -102.18408 0.00062694632 26 - 2568 7237.9761 -79.61277 0.00062694632 26 - 2570 7228.6075 -61.50493 0.00062694632 26 - 2572 6904.7633 -47.60803 0.00062694632 26 - 2574 6577.8766 -36.791331 0.00062694632 26 - 2576 6537.2024 -28.595961 0.00062694632 26 - 2578 6268.7053 -22.055058 0.00062694632 26 - 2580 6100.1948 -17.065896 0.00062694632 26 - 2582 6292.5224 -12.531749 0.00062694632 26 - 2584 6617.9859 -9.1082267 0.00062694632 26 - 2586 7058.3242 -6.5873287 0.00062694632 26 - 2588 7139.8019 -5.1508398 0.00062694632 26 - 2590 6870.0064 -4.7676802 0.00062694632 26 - 2592 6850.0669 -3.8204539 0.00062694632 26 - 2594 6914.4185 -2.4871515 0.00062694632 26 - 2596 6820.8591 -1.878383 0.00062694632 26 - 2598 6824.4608 -2.7091904 0.00062694632 26 - 2600 6605.8159 -4.055072 0.00062694632 26 - 2602 6601.1903 -4.9484338 0.00062694632 26 - 2604 6907.3437 -4.3220809 0.00062694632 26 - 2606 7033.6509 -2.8055047 0.00062694632 26 - 2608 7227.168 -1.8930939 0.00062694632 26 - 2610 7251.0672 -1.4869091 0.00062694632 26 - 2612 7140.7433 -1.9045777 0.00062694632 26 - 2614 7217.3576 -2.7698794 0.00062694632 26 - 2616 7199.0311 -3.015468 0.00062694632 26 - 2618 6902.2381 -3.091212 0.00062694632 26 - 2620 6760.3459 -4.3956075 0.00062694632 26 - 2622 6748.5752 -7.1577934 0.00062694632 26 - 2624 6498.4701 -9.9592243 0.00062694632 26 - 2626 6670.5347 -12.012125 0.00062694632 26 - 2628 6924.154 -11.6565 0.00062694632 26 - 2630 7093.9625 -10.6097 0.00062694632 26 - 2632 7200.2062 -9.6426422 0.00062694632 26 - 2634 6935.9294 -8.8684397 0.00062694632 26 - 2636 6515.3997 -7.626073 0.00062694632 26 - 2638 6642.2308 -5.9357977 0.00062694632 26 - 2640 6679.4207 -3.3768289 0.00062694632 26 - 2642 6391.0538 -0.45948537 0.00062694632 26 - 2644 6265.7264 1.2939434 0.00062694632 26 - 2646 6258.969 1.734008 0.00062694632 26 - 2648 6091.1112 1.7722562 0.00062694632 26 - 2650 6065.0546 1.4271238 0.00062694632 26 - 2652 6181.5247 0.9929013 0.00062694632 26 - 2654 6424.8373 2219.1488 0.00064856516 27 - 2656 6921.2471 293.11761 0.00064856516 27 - 2658 6763.5621 -107.46336 0.00064856516 27 - 2660 6599.8594 -186.27697 0.00064856516 27 - 2662 6734.0422 -184.24783 0.00064856516 27 - 2664 6874.8006 -160.69783 0.00064856516 27 - 2666 6818.3636 -132.93351 0.00064856516 27 - 2668 6701.1771 -104.71394 0.00064856516 27 - 2670 6352.4528 -80.998307 0.00064856516 27 - 2672 6092.4085 -60.899354 0.00064856516 27 - 2674 6194.4901 -43.587513 0.00064856516 27 - 2676 6358.7451 -28.845278 0.00064856516 27 - 2678 6360.9285 -17.879904 0.00064856516 27 - 2680 6361.5713 -11.346356 0.00064856516 27 - 2682 6205.8623 -7.4884075 0.00064856516 27 - 2684 6246.8348 -5.4773135 0.00064856516 27 - 2686 6328.5463 -4.3593929 0.00064856516 27 - 2688 6223.9976 -3.9407185 0.00064856516 27 - 2690 6106.554 -4.6997103 0.00064856516 27 - 2692 6168.4171 -6.396616 0.00064856516 27 - 2694 6139.2582 -7.8239605 0.00064856516 27 - 2696 6239.3903 -8.3808936 0.00064856516 27 - 2698 6405.2879 -7.5114356 0.00064856516 27 - 2700 6368.2 -5.6203059 0.00064856516 27 - 2702 6155.1715 -4.1491711 0.00064856516 27 - 2704 6110.6658 -4.0107178 0.00064856516 27 - 2706 5979.7665 -3.8463124 0.00064856516 27 - 2708 6010.5588 -3.0468839 0.00064856516 27 - 2710 6181.1661 -1.5749172 0.00064856516 27 - 2712 6203.6709 -0.24646367 0.00064856516 27 - 2714 6239.7545 -0.66240364 0.00064856516 27 - 2716 6231.4404 -2.7898432 0.00064856516 27 - 2718 5955.3416 -5.003216 0.00064856516 27 - 2720 5917.8094 -6.2365649 0.00064856516 27 - 2722 6133.6974 -6.0739996 0.00064856516 27 - 2724 6298.0231 -5.8507391 0.00064856516 27 - 2726 6295.3699 -6.3683403 0.00064856516 27 - 2728 6198.3701 -7.221616 0.00064856516 27 - 2730 6076.015 -7.0930518 0.00064856516 27 - 2732 6206.0761 -5.8369908 0.00064856516 27 - 2734 6402.0508 -3.7427091 0.00064856516 27 - 2736 6413.189 -1.9094711 0.00064856516 27 - 2738 6454.2519 -1.7466187 0.00064856516 27 - 2740 6325.859 -2.2413434 0.00064856516 27 - 2742 6111.4194 -2.2428871 0.00064856516 27 - 2744 6121.0656 -1.7522684 0.00064856516 27 - 2746 6100.9367 -0.85264856 0.00064856516 27 - 2748 5996.4279 -0.8861401 0.00064856516 27 - 2750 6087.5512 -2.86459 0.00064856516 27 - 2752 5977.3707 -4.7642892 0.00064856516 27 - 2754 5949.0314 -5.57108 0.00064856516 27 - 2756 6168.3001 -502.96405 0.00067018399 28 - 2758 6200.1666 -421.68078 0.00067018399 28 - 2760 6199.5233 -351.10973 0.00067018399 28 - 2762 6234.867 -290.73108 0.00067018399 28 - 2764 6145.1871 -238.129 0.00067018399 28 - 2766 6214.3271 -192.33635 0.00067018399 28 - 2768 6368.3971 -152.80846 0.00067018399 28 - 2770 6316.4154 -119.46414 0.00067018399 28 - 2772 6176.9381 -92.956853 0.00067018399 28 - 2774 6039.3515 -72.434763 0.00067018399 28 - 2776 5818.0769 -55.931431 0.00067018399 28 - 2778 5813.5845 -42.565903 0.00067018399 28 - 2780 5935.7699 -31.678196 0.00067018399 28 - 2782 6026.6265 -23.417297 0.00067018399 28 - 2784 6163.5786 -18.225936 0.00067018399 28 - 2786 6149.8745 -14.890416 0.00067018399 28 - 2788 6041.4351 -12.080924 0.00067018399 28 - 2790 6100.1736 -9.5414071 0.00067018399 28 - 2792 6155.6109 -7.3388116 0.00067018399 28 - 2794 6136.3566 -6.2777817 0.00067018399 28 - 2796 6233.5181 -6.6061357 0.00067018399 28 - 2798 6151.9289 -6.7000464 0.00067018399 28 - 2800 6149.1697 -6.2780785 0.00067018399 28 - 2802 6155.9502 -5.311202 0.00067018399 28 - 2804 6024.1889 -4.3462915 0.00067018399 28 - 2806 5814.2296 -4.3268369 0.00067018399 28 - 2808 5642.9582 -5.2793898 0.00067018399 28 - 2810 5489.9528 -5.9051947 0.00067018399 28 - 2812 5640.7395 -5.9161277 0.00067018399 28 - 2814 5867.8345 -5.2937198 0.00067018399 28 - 2816 5795.7842 -4.3726738 0.00067018399 28 - 2818 5772.502 -4.447022 0.00067018399 28 - 2820 5735.8177 -5.000363 0.00067018399 28 - 2822 5710.0201 -5.0628348 0.00067018399 28 - 2824 5803.017 -4.6695765 0.00067018399 28 - 2826 5948.378 -4.2654852 0.00067018399 28 - 2828 5799.0888 -3.9244904 0.00067018399 28 - 2830 5828.3752 -4.5740029 0.00067018399 28 - 2832 5857.1016 -5.2832346 0.00067018399 28 - 2834 5914.1322 -5.5653537 0.00067018399 28 - 2836 5990.9384 -5.6379058 0.00067018399 28 - 2838 6007.5684 -5.6062956 0.00067018399 28 - 2840 5829.1053 -5.3743156 0.00067018399 28 - 2842 5791.7935 -5.6582957 0.00067018399 28 - 2844 5742.0248 -5.7669999 0.00067018399 28 - 2846 5708.8683 -5.3776393 0.00067018399 28 - 2848 5749.821 -4.8787238 0.00067018399 28 - 2850 5657.0082 -4.1285659 0.00067018399 28 - 2852 5432.8302 -3.3817137 0.00067018399 28 - 2854 5533.1251 -3.8163493 0.00067018399 28 - 2856 5482.4779 -4.5210162 0.00067018399 28 - 2858 5591.5068 10078.074 0.00069180283 29 - 2860 5778.3182 2704.4963 0.00069180283 29 - 2862 5847.8595 810.6613 0.00069180283 29 - 2864 5780.7049 201.58307 0.00069180283 29 - 2866 5919.307 -8.6409893 0.00069180283 29 - 2868 5763.9112 -77.4425 0.00069180283 29 - 2870 5733.7145 -93.233219 0.00069180283 29 - 2872 5985.537 -88.415968 0.00069180283 29 - 2874 6080.6283 -74.305612 0.00069180283 29 - 2876 6090.1818 -57.746325 0.00069180283 29 - 2878 6107.0505 -43.215804 0.00069180283 29 - 2880 5885.3318 -31.303514 0.00069180283 29 - 2882 5787.2313 -22.357492 0.00069180283 29 - 2884 5814.9848 -15.721607 0.00069180283 29 - 2886 5761.2585 -10.771597 0.00069180283 29 - 2888 5766.2082 -8.1764598 0.00069180283 29 - 2890 5873.2138 -7.9116826 0.00069180283 29 - 2892 5706.8186 -8.5071977 0.00069180283 29 - 2894 5700.4979 -9.633124 0.00069180283 29 - 2896 5775.3092 -10.201491 0.00069180283 29 - 2898 5735.4239 -9.8614201 0.00069180283 29 - 2900 5772.5573 -9.685071 0.00069180283 29 - 2902 5709.1096 -9.5318564 0.00069180283 29 - 2904 5551.0836 -8.8045992 0.00069180283 29 - 2906 5649.2227 -7.7078543 0.00069180283 29 - 2908 5767.7144 -5.9888551 0.00069180283 29 - 2910 5685.6769 -3.9843168 0.00069180283 29 - 2912 5750.8035 -3.4358816 0.00069180283 29 - 2914 5685.1406 -4.1156501 0.00069180283 29 - 2916 5505.4975 -5.403883 0.00069180283 29 - 2918 5490.2947 -6.8502363 0.00069180283 29 - 2920 5536.8914 -7.5189219 0.00069180283 29 - 2922 5496.4424 -7.3732427 0.00069180283 29 - 2924 5642.5452 -7.7426445 0.00069180283 29 - 2926 5754.7018 -8.3314405 0.00069180283 29 - 2928 5759.3596 -8.5512801 0.00069180283 29 - 2930 5792.0267 -8.099821 0.00069180283 29 - 2932 5801.987 -6.4894218 0.00069180283 29 - 2934 5746.5527 -4.3364038 0.00069180283 29 - 2936 5743.5356 -2.9292564 0.00069180283 29 - 2938 5685.0191 -2.4294109 0.00069180283 29 - 2940 5730.6318 -2.860644 0.00069180283 29 - 2942 5731.5701 -3.2060076 0.00069180283 29 - 2944 5712.3417 -3.0747772 0.00069180283 29 - 2946 5665.4763 -3.0937864 0.00069180283 29 - 2948 5596.5544 -4.1080737 0.00069180283 29 - 2950 5542.4037 -6.0051076 0.00069180283 29 - 2952 5465.4003 -7.5490741 0.00069180283 29 - 2954 5583.7596 -8.0210846 0.00069180283 29 - 2956 5701.9248 -6.8321071 0.00069180283 29 - 2958 5821.9578 -5.0270435 0.00069180283 29 - 2960 5850.2436 514.0434 0.00071342167 30 - 2962 5791.4468 -87.030472 0.00071342167 30 - 2964 5717.9478 -211.55977 0.00071342167 30 - 2966 5807.1386 -219.55844 0.00071342167 30 - 2968 5866.1488 -195.46533 0.00071342167 30 - 2970 5932.636 -164.42409 0.00071342167 30 - 2972 5942.7119 -134.62158 0.00071342167 30 - 2974 5979.5468 -108.05836 0.00071342167 30 - 2976 6025.3658 -85.448875 0.00071342167 30 - 2978 6110.1521 -66.41261 0.00071342167 30 - 2980 5998.4298 -49.910358 0.00071342167 30 - 2982 5918.6623 -36.60286 0.00071342167 30 - 2984 5925.5844 -27.063497 0.00071342167 30 - 2986 5942.9082 -20.683476 0.00071342167 30 - 2988 5933.1561 -16.149401 0.00071342167 30 - 2990 5929.1714 -12.435952 0.00071342167 30 - 2992 5804.6884 -9.1026254 0.00071342167 30 - 2994 5807.1997 -7.4074003 0.00071342167 30 - 2996 5985.8022 -8.0762634 0.00071342167 30 - 2998 6074.3192 -9.8687069 0.00071342167 30 - 3000 6057.21 -11.174731 0.00071342167 30 - 3002 6075.007 -11.18421 0.00071342167 30 - 3004 5987.3479 -9.9453679 0.00071342167 30 - 3006 5938.4103 -9.0724861 0.00071342167 30 - 3008 5965.8705 -9.4340001 0.00071342167 30 - 3010 5831.196 -9.6673274 0.00071342167 30 - 3012 5870.4376 -8.9025524 0.00071342167 30 - 3014 6016.8784 -6.7616353 0.00071342167 30 - 3016 6010.2107 -3.9697169 0.00071342167 30 - 3018 5901.2968 -2.2568406 0.00071342167 30 - 3020 5891.3535 -2.4619728 0.00071342167 30 - 3022 5730.7697 -2.976375 0.00071342167 30 - 3024 5791.9086 -3.3552926 0.00071342167 30 - 3026 5971.9658 -3.4478784 0.00071342167 30 - 3028 5936.4761 -3.3852394 0.00071342167 30 - 3030 5879.7002 -4.2155063 0.00071342167 30 - 3032 5987.2131 -5.9104065 0.00071342167 30 - 3034 5909.6393 -6.7430419 0.00071342167 30 - 3036 5930.3171 -6.9249843 0.00071342167 30 - 3038 6002.1527 -6.6931199 0.00071342167 30 - 3040 5861.3782 -6.0527004 0.00071342167 30 - 3042 5943.0923 -6.1447396 0.00071342167 30 - 3044 6092.86 -6.4979286 0.00071342167 30 - 3046 6112.986 -6.1871845 0.00071342167 30 - 3048 6270.5634 -5.9882772 0.00071342167 30 - 3050 6246.169 -5.7206045 0.00071342167 30 - 3052 5932.2093 -5.3402899 0.00071342167 30 - 3054 5962.298 -5.8792443 0.00071342167 30 - 3056 5945.843 -6.3127283 0.00071342167 30 - 3058 5850.2141 -6.2687421 0.00071342167 30 - 3060 6099.1919 -6.4263983 0.00071342167 30 - 3062 6152.4698 -469.77342 0.00073504051 31 - 3064 6138.1145 -392.89964 0.00073504051 31 - 3066 6382.1353 -325.82599 0.00073504051 31 - 3068 6368.2319 -267.16804 0.00073504051 31 - 3070 6125.653 -216.23268 0.00073504051 31 - 3072 6199.1075 -173.3993 0.00073504051 31 - 3074 6096.9277 -137.0472 0.00073504051 31 - 3076 6128.4594 -107.02373 0.00073504051 31 - 3078 6410.6432 -83.027038 0.00073504051 31 - 3080 6322.4331 -63.707564 0.00073504051 31 - 3082 6315.6655 -49.044238 0.00073504051 31 - 3084 6384.5813 -37.987635 0.00073504051 31 - 3086 6188.1184 -29.028204 0.00073504051 31 - 3088 6164.6018 -22.005531 0.00073504051 31 - 3090 6302.5303 -16.935448 0.00073504051 31 - 3092 6102.2188 -12.750503 0.00073504051 31 - 3094 6294.5805 -10.162155 0.00073504051 31 - 3096 6324.6812 -7.9212694 0.00073504051 31 - 3098 6098.5679 -5.6224283 0.00073504051 31 - 3100 6170.6064 -3.8113122 0.00073504051 31 - 3102 6268.1523 -2.7517092 0.00073504051 31 - 3104 6042.0518 -1.8996674 0.00073504051 31 - 3106 6371.1553 -2.4739165 0.00073504051 31 - 3108 6353.1109 -2.7139113 0.00073504051 31 - 3110 6155.2247 -2.7357849 0.00073504051 31 - 3112 6265.3662 -3.223482 0.00073504051 31 - 3114 6241.3622 -4.0149702 0.00073504051 31 - 3116 6026.8144 -4.4794651 0.00073504051 31 - 3118 6336.8211 -5.1949313 0.00073504051 31 - 3120 6304.3565 -4.630181 0.00073504051 31 - 3122 6259.2538 -3.5862159 0.00073504051 31 - 3124 6498.2926 -2.9770889 0.00073504051 31 - 3126 6389.8215 -2.3360455 0.00073504051 31 - 3128 6281.7573 -2.0155584 0.00073504051 31 - 3130 6448.7884 -2.2898794 0.00073504051 31 - 3132 6286.5504 -2.1732695 0.00073504051 31 - 3134 6241.8976 -2.4301197 0.00073504051 31 - 3136 6426.9385 -3.514538 0.00073504051 31 - 3138 6176.719 -4.2352839 0.00073504051 31 - 3140 6251.0935 -5.3401436 0.00073504051 31 - 3142 6316.957 -6.0235141 0.00073504051 31 - 3144 6189.9851 -6.0207255 0.00073504051 31 - 3146 6304.8428 -6.0123423 0.00073504051 31 - 3148 6464.3347 -6.159424 0.00073504051 31 - 3150 6195.2089 -5.5140135 0.00073504051 31 - 3152 6380.3579 -5.2160781 0.00073504051 31 - 3154 6286.0613 -4.0278311 0.00073504051 31 - 3156 6080.0756 -2.6145134 0.00073504051 31 - 3158 6229.7127 -1.7227016 0.00073504051 31 - 3160 6303.2142 -1.1585329 0.00073504051 31 - 3162 6097.9077 -0.40806897 0.00073504051 31 - 3164 6509.7871 35236.923 0.00075665935 32 - 3166 6402.4444 6076.3837 0.00075665935 32 - 3168 6291.0264 1275.2998 0.00075665935 32 - 3170 6422.5631 231.70182 0.00075665935 32 - 3172 6389.7334 -33.786499 0.00075665935 32 - 3174 6323.4622 -100.70042 0.00075665935 32 - 3176 6579.8399 -110.06184 0.00075665935 32 - 3178 6482.025 -101.23926 0.00075665935 32 - 3180 6354.3385 -87.243105 0.00075665935 32 - 3182 6402.2719 -71.176204 0.00075665935 32 - 3184 6315.0298 -55.051626 0.00075665935 32 - 3186 6256.0044 -41.274131 0.00075665935 32 - 3188 6342.2232 -30.653402 0.00075665935 32 - 3190 6176.3232 -22.162573 0.00075665935 32 - 3192 6156.7096 -15.538984 0.00075665935 32 - 3194 6302.0206 -10.587747 0.00075665935 32 - 3196 6205.4986 -6.8045291 0.00075665935 32 - 3198 6312.1306 -4.947539 0.00075665935 32 - 3200 6312.9731 -4.2530917 0.00075665935 32 - 3202 6038.6207 -3.7178528 0.00075665935 32 - 3204 6055.3397 -3.3618748 0.00075665935 32 - 3206 6283.1474 -3.438067 0.00075665935 32 - 3208 6190.4768 -3.1737727 0.00075665935 32 - 3210 6431.8312 -3.8344056 0.00075665935 32 - 3212 6411.5893 -4.2280478 0.00075665935 32 - 3214 6184.72 -4.0889917 0.00075665935 32 - 3216 6328.1742 -3.8717794 0.00075665935 32 - 3218 6402.1577 -3.3815252 0.00075665935 32 - 3220 6248.9869 -2.9083862 0.00075665935 32 - 3222 6521.7487 -3.8083129 0.00075665935 32 - 3224 6338.8258 -4.1522715 0.00075665935 32 - 3226 6178.6003 -4.2444983 0.00075665935 32 - 3228 6316.7654 -4.3133222 0.00075665935 32 - 3230 6217.4769 -4.4356963 0.00075665935 32 - 3232 6082.2102 -5.2888398 0.00075665935 32 - 3234 6271.7197 -7.0741328 0.00075665935 32 - 3236 6030.2999 -7.6159982 0.00075665935 32 - 3238 6076.717 -7.6279168 0.00075665935 32 - 3240 6239.0369 -6.9809946 0.00075665935 32 - 3242 6081.9908 -5.6356755 0.00075665935 32 - 3244 6397.3549 -5.4767191 0.00075665935 32 - 3246 6391.5018 -4.8901571 0.00075665935 32 - 3248 6275.561 -3.9301212 0.00075665935 32 - 3250 6365.2589 -2.7691702 0.00075665935 32 - 3252 6363.4406 -1.8499798 0.00075665935 32 - 3254 6177.4881 -1.631069 0.00075665935 32 - 3256 6319.7457 -2.8533645 0.00075665935 32 - 3258 6210.2001 -3.565745 0.00075665935 32 - 3260 6223.1972 -4.0917774 0.00075665935 32 - 3262 6324.2234 -4.2876482 0.00075665935 32 - 3264 6353.9581 -4.3957045 0.00075665935 32 - 3266 6484.7785 1139.5061 0.00077827819 33 - 3268 6591.5394 150.3286 0.00077827819 33 - 3270 6422.9819 -88.927965 0.00077827819 33 - 3272 6387.931 -142.38475 0.00077827819 33 - 3274 6394.1651 -142.49048 0.00077827819 33 - 3276 6352.7155 -127.55273 0.00077827819 33 - 3278 6403.539 -108.8353 0.00077827819 33 - 3280 6393.4741 -89.499587 0.00077827819 33 - 3282 6282.7972 -71.488763 0.00077827819 33 - 3284 6349.6981 -55.896289 0.00077827819 33 - 3286 6434.6705 -42.606864 0.00077827819 33 - 3288 6435.399 -31.952274 0.00077827819 33 - 3290 6438.7909 -24.148345 0.00077827819 33 - 3292 6205.3476 -17.752391 0.00077827819 33 - 3294 6069.7068 -12.516722 0.00077827819 33 - 3296 6265.5342 -8.9778982 0.00077827819 33 - 3298 6382.8635 -6.8502135 0.00077827819 33 - 3300 6357.0508 -5.8052134 0.00077827819 33 - 3302 6481.8683 -5.3418399 0.00077827819 33 - 3304 6320.7328 -3.8622996 0.00077827819 33 - 3306 6322.1166 -2.6682336 0.00077827819 33 - 3308 6514.0727 -2.880462 0.00077827819 33 - 3310 6438.7949 -3.8926256 0.00077827819 33 - 3312 6314.8748 -5.3891805 0.00077827819 33 - 3314 6439.1744 -6.7858704 0.00077827819 33 - 3316 6310.702 -6.755861 0.00077827819 33 - 3318 6395.3688 -7.1208775 0.00077827819 33 - 3320 6523.6992 -8.4265267 0.00077827819 33 - 3322 6334.2553 -9.3987165 0.00077827819 33 - 3324 6345.921 -9.8081715 0.00077827819 33 - 3326 6585.4037 -9.033444 0.00077827819 33 - 3328 6505.3649 -6.7650414 0.00077827819 33 - 3330 6599.1299 -5.5594702 0.00077827819 33 - 3332 6615.2327 -5.4534514 0.00077827819 33 - 3334 6413.9707 -5.2673827 0.00077827819 33 - 3336 6488.773 -4.9346621 0.00077827819 33 - 3338 6592.7128 -3.6838699 0.00077827819 33 - 3340 6492.4529 -2.1093347 0.00077827819 33 - 3342 6624.563 -2.208136 0.00077827819 33 - 3344 6595.2112 -3.0547244 0.00077827819 33 - 3346 6513.9623 -3.6757854 0.00077827819 33 - 3348 6631.5348 -3.7916143 0.00077827819 33 - 3350 6663.5679 -3.0336076 0.00077827819 33 - 3352 6513.9482 -2.3269496 0.00077827819 33 - 3354 6549.0352 -2.9935432 0.00077827819 33 - 3356 6429.0841 -3.9157473 0.00077827819 33 - 3358 6363.8056 -4.4557955 0.00077827819 33 - 3360 6509.4572 -4.426532 0.00077827819 33 - 3362 6573.0489 -3.6842259 0.00077827819 33 - 3364 6522.1123 -3.1179071 0.00077827819 33 - 3366 6706.7798 -3.7056923 0.00077827819 33 - 3368 6859.6857 -433.18889 0.00079989702 34 - 3370 6859.7025 -369.51502 0.00079989702 34 - 3372 7012.9969 -308.73226 0.00079989702 34 - 3374 6898.5562 -253.60146 0.00079989702 34 - 3376 6852.0227 -206.09454 0.00079989702 34 - 3378 6965.6606 -166.26858 0.00079989702 34 - 3380 6883.0721 -132.48286 0.00079989702 34 - 3382 6911.0291 -104.35448 0.00079989702 34 - 3384 7008.4472 -81.127601 0.00079989702 34 - 3386 6871.931 -61.846733 0.00079989702 34 - 3388 6871.6047 -47.074931 0.00079989702 34 - 3390 6872.1258 -35.836117 0.00079989702 34 - 3392 6740.5032 -26.817094 0.00079989702 34 - 3394 6894.8127 -20.164908 0.00079989702 34 - 3396 6945.3615 -14.885111 0.00079989702 34 - 3398 6896.0199 -10.94641 0.00079989702 34 - 3400 6953.316 -8.6422769 0.00079989702 34 - 3402 6942.7839 -7.1884937 0.00079989702 34 - 3404 6872.2911 -6.2325165 0.00079989702 34 - 3406 7008.7697 -6.0248121 0.00079989702 34 - 3408 7028.2392 -5.8133809 0.00079989702 34 - 3410 6954.5587 -5.6856438 0.00079989702 34 - 3412 6934.5764 -5.7987843 0.00079989702 34 - 3414 6788.7386 -5.6593721 0.00079989702 34 - 3416 6781.9026 -5.7768409 0.00079989702 34 - 3418 6861.9043 -5.7789891 0.00079989702 34 - 3420 6845.9974 -5.0411587 0.00079989702 34 - 3422 6896.1167 -4.0372309 0.00079989702 34 - 3424 6855.2377 -2.7801991 0.00079989702 34 - 3426 6705.7216 -1.5853383 0.00079989702 34 - 3428 6727.5449 -1.1111259 0.00079989702 34 - 3430 6822.2667 -1.00108 0.00079989702 34 - 3432 6935.0567 -0.27612483 0.00079989702 34 - 3434 6923.2061 -0.47313452 0.00079989702 34 - 3436 6854.0542 -0.8377992 0.00079989702 34 - 3438 6731.8239 -1.243754 0.00079989702 34 - 3440 6817.9269 -2.0603514 0.00079989702 34 - 3442 6898.4335 -2.6756882 0.00079989702 34 - 3444 6831.1212 -2.7219231 0.00079989702 34 - 3446 6890.7713 -2.6760669 0.00079989702 34 - 3448 6937.7791 -2.4288558 0.00079989702 34 - 3450 6880.2929 -1.9500275 0.00079989702 34 - 3452 6881.6872 -1.667428 0.00079989702 34 - 3454 6768.3494 -1.270681 0.00079989702 34 - 3456 6633.0003 -0.84059394 0.00079989702 34 - 3458 6688.0004 -0.93630092 0.00079989702 34 - 3460 6758.4364 -1.250022 0.00079989702 34 - 3462 6737.351 -1.4418301 0.00079989702 34 - 3464 6924.4994 -1.9680493 0.00079989702 34 - 3466 6965.9264 -2.2343956 0.00079989702 34 - 3468 7099.7771 -2.8338515 0.00079989702 34 - 3470 7365.5406 9210.1322 0.00082151586 35 - 3472 7273.0429 2265.973 0.00082151586 35 - 3474 7086.0007 566.35094 0.00082151586 35 - 3476 7137.9528 75.998379 0.00082151586 35 - 3478 7089.2272 -70.861558 0.00082151586 35 - 3480 7260.9834 -107.43399 0.00082151586 35 - 3482 7298.6582 -106.15764 0.00082151586 35 - 3484 7248.2244 -92.031973 0.00082151586 35 - 3486 7341.0817 -74.371435 0.00082151586 35 - 3488 7439.8508 -57.018026 0.00082151586 35 - 3490 7468.7913 -42.32339 0.00082151586 35 - 3492 7596.887 -31.61683 0.00082151586 35 - 3494 7454.6265 -23.698021 0.00082151586 35 - 3496 7367.0542 -18.074974 0.00082151586 35 - 3498 7443.1139 -14.090777 0.00082151586 35 - 3500 7335.5354 -10.625037 0.00082151586 35 - 3502 7451.7732 -8.6309423 0.00082151586 35 - 3504 7597.9116 -7.7306589 0.00082151586 35 - 3506 7573.996 -6.8833773 0.00082151586 35 - 3508 7685.4891 -6.0764087 0.00082151586 35 - 3510 7704.8387 -4.5814412 0.00082151586 35 - 3512 7453.1923 -2.5302848 0.00082151586 35 - 3514 7480.9293 -1.9603627 0.00082151586 35 - 3516 7414.9212 -2.1424094 0.00082151586 35 - 3518 7341.5999 -2.5941909 0.00082151586 35 - 3520 7502.5881 -3.6003011 0.00082151586 35 - 3522 7410.8775 -4.1379583 0.00082151586 35 - 3524 7195.6431 -4.6876596 0.00082151586 35 - 3526 7282.2831 -6.1200036 0.00082151586 35 - 3528 7156.6473 -6.9781135 0.00082151586 35 - 3530 7117.1928 -7.4998668 0.00082151586 35 - 3532 7315.0548 -7.8113618 0.00082151586 35 - 3534 7245.5705 -6.9777959 0.00082151586 35 - 3536 7243.4926 -6.0865134 0.00082151586 35 - 3538 7418.9789 -5.5194598 0.00082151586 35 - 3540 7297.0501 -4.3056252 0.00082151586 35 - 3542 7276.2132 -3.3854613 0.00082151586 35 - 3544 7352.3988 -2.7943749 0.00082151586 35 - 3546 7289.0909 -2.199869 0.00082151586 35 - 3548 7348.4041 -2.4257071 0.00082151586 35 - 3550 7338.4642 -2.9646835 0.00082151586 35 - 3552 7111.5609 -3.3293719 0.00082151586 35 - 3554 7073.1037 -4.059656 0.00082151586 35 - 3556 7029.0805 -4.3380638 0.00082151586 35 - 3558 7049.1616 -4.2221378 0.00082151586 35 - 3560 7189.4962 -4.1519351 0.00082151586 35 - 3562 7224.8993 -3.8373721 0.00082151586 35 - 3564 7132.671 -3.3841721 0.00082151586 35 - 3566 7191.0892 -3.2422869 0.00082151586 35 - 3568 7214.2291 -2.9159835 0.00082151586 35 - 3570 7253.3367 -2.5775948 0.00082151586 35 - 3572 7422.1579 43074.394 0.0008431347 36 - 3574 7378.0474 8279.5877 0.0008431347 36 - 3576 7279.831 2167.3382 0.0008431347 36 - 3578 7269.3502 633.99813 0.0008431347 36 - 3580 7264.9988 160.90688 0.0008431347 36 - 3582 7250.7559 1.1553943 0.0008431347 36 - 3584 7380.4554 -51.677913 0.0008431347 36 - 3586 7443.8646 -64.740979 0.0008431347 36 - 3588 7461.3387 -61.434866 0.0008431347 36 - 3590 7463.1549 -51.391928 0.0008431347 36 - 3592 7438.5534 -40.338897 0.0008431347 36 - 3594 7264.5781 -30.256086 0.0008431347 36 - 3596 7268.5202 -22.701462 0.0008431347 36 - 3598 7228.5195 -17.294873 0.0008431347 36 - 3600 7201.8062 -13.540261 0.0008431347 36 - 3602 7234.3242 -10.89935 0.0008431347 36 - 3604 7328.7227 -8.9972732 0.0008431347 36 - 3606 7290.0009 -7.4798193 0.0008431347 36 - 3608 7375.1277 -6.7468124 0.0008431347 36 - 3610 7313.1876 -6.0057689 0.0008431347 36 - 3612 7239.5111 -5.1923879 0.0008431347 36 - 3614 7245.7747 -4.3290738 0.0008431347 36 - 3616 7162.401 -3.182203 0.0008431347 36 - 3618 7130.5735 -2.4047591 0.0008431347 36 - 3620 7200.5806 -2.2021632 0.0008431347 36 - 3622 7109.954 -1.9401061 0.0008431347 36 - 3624 7116.0037 -2.1037412 0.0008431347 36 - 3626 7124.5548 -2.2865291 0.0008431347 36 - 3628 7033.0853 -2.2136953 0.0008431347 36 - 3630 7166.5106 -2.7188784 0.0008431347 36 - 3632 7205.6089 -3.1107288 0.0008431347 36 - 3634 7185.4052 -3.3126113 0.0008431347 36 - 3636 7339.2042 -3.7109133 0.0008431347 36 - 3638 7398.2179 -3.6524166 0.0008431347 36 - 3640 7356.9677 -3.3251406 0.0008431347 36 - 3642 7529.0674 -3.4300078 0.0008431347 36 - 3644 7404.9583 -2.8694299 0.0008431347 36 - 3646 7348.5031 -2.3365499 0.0008431347 36 - 3648 7439.5143 -2.0443097 0.0008431347 36 - 3650 7440.5345 -1.6728452 0.0008431347 36 - 3652 7426.9027 -1.6757731 0.0008431347 36 - 3654 7522.6362 -2.1376657 0.0008431347 36 - 3656 7402.4178 -2.4042873 0.0008431347 36 - 3658 7473.021 -3.2318852 0.0008431347 36 - 3660 7491.4296 -4.0566916 0.0008431347 36 - 3662 7448.9995 -4.768084 0.0008431347 36 - 3664 7377.9046 -5.2847911 0.0008431347 36 - 3666 7342.4374 -5.4793032 0.0008431347 36 - 3668 7252.6825 -5.4373863 0.0008431347 36 - 3670 7238.4134 -5.5431568 0.0008431347 36 - 3672 7227.1751 -5.383502 0.0008431347 36 - 3674 7339.3464 -444.62651 0.00086475354 37 - 3676 7342.3871 -378.49228 0.00086475354 37 - 3678 7367.2893 -316.96486 0.00086475354 37 - 3680 7385.1613 -262.40999 0.00086475354 37 - 3682 7323.136 -214.96105 0.00086475354 37 - 3684 7312.9794 -174.149 0.00086475354 37 - 3686 7366.9363 -139.09374 0.00086475354 37 - 3688 7348.4045 -108.93631 0.00086475354 37 - 3690 7376.8893 -84.030482 0.00086475354 37 - 3692 7308.8919 -63.962982 0.00086475354 37 - 3694 7148.8845 -47.766908 0.00086475354 37 - 3696 7118.7058 -34.653456 0.00086475354 37 - 3698 7150.8129 -23.670021 0.00086475354 37 - 3700 7090.1607 -14.719907 0.00086475354 37 - 3702 7165.2257 -8.8656193 0.00086475354 37 - 3704 7088.6694 -5.4452493 0.00086475354 37 - 3706 7021.5798 -3.6315448 0.00086475354 37 - 3708 7127.832 -2.6321388 0.00086475354 37 - 3710 7183.775 -1.7609644 0.00086475354 37 - 3712 7181.7139 -1.6523966 0.00086475354 37 - 3714 7166.9311 -2.6896856 0.00086475354 37 - 3716 7029.456 -3.9284468 0.00086475354 37 - 3718 6953.4802 -4.6023443 0.00086475354 37 - 3720 7033.5585 -4.3027235 0.00086475354 37 - 3722 7023.3101 -3.1205417 0.00086475354 37 - 3724 7023.2748 -2.4353997 0.00086475354 37 - 3726 7003.9572 -2.6314119 0.00086475354 37 - 3728 6994.5976 -3.0750204 0.00086475354 37 - 3730 7057.2702 -3.1048664 0.00086475354 37 - 3732 7177.6239 -2.6145191 0.00086475354 37 - 3734 7158.9201 -2.1302356 0.00086475354 37 - 3736 7152.2976 -2.7650935 0.00086475354 37 - 3738 7138.2264 -4.2089475 0.00086475354 37 - 3740 7144.453 -5.5847115 0.00086475354 37 - 3742 7177.4185 -6.2025365 0.00086475354 37 - 3744 7134.3089 -5.8970079 0.00086475354 37 - 3746 7080.6305 -5.5615302 0.00086475354 37 - 3748 6971.7503 -5.5907106 0.00086475354 37 - 3750 6926.1213 -5.7478665 0.00086475354 37 - 3752 6916.3174 -5.4216883 0.00086475354 37 - 3754 6986.811 -4.4163936 0.00086475354 37 - 3756 6967.5511 -2.9334231 0.00086475354 37 - 3758 7079.0049 -2.2206462 0.00086475354 37 - 3760 7028.033 -1.9696874 0.00086475354 37 - 3762 7042.3512 -2.0623792 0.00086475354 37 - 3764 7085.936 -2.0180576 0.00086475354 37 - 3766 7101.6389 -1.5968782 0.00086475354 37 - 3768 7042.2925 -1.2836046 0.00086475354 37 - 3770 7106.8113 -1.7748565 0.00086475354 37 - 3772 6952.4114 -1.9884305 0.00086475354 37 - 3774 6925.3786 -1.9749027 0.00086475354 37 - 3776 7138.3918 5276.539 0.00088637238 38 - 3778 7110.249 1687.0641 0.00088637238 38 - 3780 7220.9129 396.12882 0.00088637238 38 - 3782 7317.4704 -110.60996 0.00088637238 38 - 3784 7216.3229 -292.66872 0.00088637238 38 - 3786 7217.659 -306.75746 0.00088637238 38 - 3788 7331.8863 -278.97971 0.00088637238 38 - 3790 7288.5986 -244.57168 0.00088637238 38 - 3792 7407.8873 -211.62122 0.00088637238 38 - 3794 7367.6943 -180.51273 0.00088637238 38 - 3796 7232.2854 -149.90398 0.00088637238 38 - 3798 7215.0946 -121.12567 0.00088637238 38 - 3800 7199.5237 -95.896547 0.00088637238 38 - 3802 7229.5017 -75.181272 0.00088637238 38 - 3804 7299.2333 -58.39765 0.00088637238 38 - 3806 7191.2083 -43.961776 0.00088637238 38 - 3808 7143.0592 -31.811824 0.00088637238 38 - 3810 7136.1876 -21.958897 0.00088637238 38 - 3812 7091.5124 -14.646144 0.00088637238 38 - 3814 7204.8466 -9.7752902 0.00088637238 38 - 3816 7227.2283 -6.2782461 0.00088637238 38 - 3818 7268.1234 -3.6182236 0.00088637238 38 - 3820 7370.7177 -2.0363997 0.00088637238 38 - 3822 7362.6296 -1.60587 0.00088637238 38 - 3824 7365.1036 -2.4369776 0.00088637238 38 - 3826 7353.2586 -3.9724174 0.00088637238 38 - 3828 7248.7903 -4.6854279 0.00088637238 38 - 3830 7278.6157 -4.7125989 0.00088637238 38 - 3832 7335.0594 -4.4826615 0.00088637238 38 - 3834 7292.9911 -4.3660502 0.00088637238 38 - 3836 7267.3945 -4.5573359 0.00088637238 38 - 3838 7186.3644 -4.2341925 0.00088637238 38 - 3840 7068.3385 -3.0069118 0.00088637238 38 - 3842 7066.8395 -1.6546869 0.00088637238 38 - 3844 7127.2364 -0.83493787 0.00088637238 38 - 3846 7112.7247 -0.58872056 0.00088637238 38 - 3848 7163.2446 -0.80886443 0.00088637238 38 - 3850 7136.9898 -0.72611361 0.00088637238 38 - 3852 7084.3883 -0.47113622 0.00088637238 38 - 3854 7107.4472 -0.8274916 0.00088637238 38 - 3856 7175.6085 -1.9463428 0.00088637238 38 - 3858 7166.6358 -3.1142427 0.00088637238 38 - 3860 7238.0595 -3.9150194 0.00088637238 38 - 3862 7241.1638 -3.7888633 0.00088637238 38 - 3864 7203.462 -3.1539823 0.00088637238 38 - 3866 7276.1411 -2.8907679 0.00088637238 38 - 3868 7314.6503 -2.7216762 0.00088637238 38 - 3870 7357.8217 -2.3441003 0.00088637238 38 - 3872 7476.7449 -1.743847 0.00088637238 38 - 3874 7453.5377 -0.8865654 0.00088637238 38 - 3876 7541.0645 -0.85326603 0.00088637238 38 - 3878 7697.8992 -502.96083 0.00090799122 39 - 3880 7648.7759 -424.34802 0.00090799122 39 - 3882 7629.8029 -355.35477 0.00090799122 39 - 3884 7676.031 -294.69867 0.00090799122 39 - 3886 7599.0776 -241.6914 0.00090799122 39 - 3888 7672.1562 -196.8112 0.00090799122 39 - 3890 7699.5669 -158.9016 0.00090799122 39 - 3892 7646.208 -126.34403 0.00090799122 39 - 3894 7629.5875 -98.251732 0.00090799122 39 - 3896 7590.7353 -74.188126 0.00090799122 39 - 3898 7519.1257 -54.553068 0.00090799122 39 - 3900 7608.1554 -39.790118 0.00090799122 39 - 3902 7667.6953 -28.68601 0.00090799122 39 - 3904 7685.8185 -20.163893 0.00090799122 39 - 3906 7754.2762 -13.901543 0.00090799122 39 - 3908 7771.8881 -9.942367 0.00090799122 39 - 3910 7859.2959 -8.7287609 0.00090799122 39 - 3912 7898.6568 -9.3927363 0.00090799122 39 - 3914 7858.5761 -10.449787 0.00090799122 39 - 3916 7799.7874 -10.862422 0.00090799122 39 - 3918 7842.0299 -10.580414 0.00090799122 39 - 3920 7846.4299 -10.014798 0.00090799122 39 - 3922 7870.0382 -9.7254013 0.00090799122 39 - 3924 7865.059 -9.3949957 0.00090799122 39 - 3926 7787.633 -8.3643901 0.00090799122 39 - 3928 7732.8853 -6.7927276 0.00090799122 39 - 3930 7791.7591 -5.6579163 0.00090799122 39 - 3932 7808.1907 -5.5439784 0.00090799122 39 - 3934 7847.0494 -6.5440311 0.00090799122 39 - 3936 7883.0673 -8.0426368 0.00090799122 39 - 3938 7864.1018 -9.1963852 0.00090799122 39 - 3940 7897.9239 -10.022789 0.00090799122 39 - 3942 7940.8549 -10.887125 0.00090799122 39 - 3944 7792.452 -11.701679 0.00090799122 39 - 3946 7771.2294 -12.614123 0.00090799122 39 - 3948 7684.4247 -12.303858 0.00090799122 39 - 3950 7657.6047 -10.463108 0.00090799122 39 - 3952 7774.6897 -7.9729519 0.00090799122 39 - 3954 7850.7533 -5.549378 0.00090799122 39 - 3956 7790.2701 -3.7348284 0.00090799122 39 - 3958 7890.6457 -3.0044525 0.00090799122 39 - 3960 7845.095 -2.2506932 0.00090799122 39 - 3962 7872.9801 -1.8809309 0.00090799122 39 - 3964 7914.1315 -2.3104241 0.00090799122 39 - 3966 7773.0926 -3.3811901 0.00090799122 39 - 3968 7747.1728 -5.4434148 0.00090799122 39 - 3970 7762.7159 -7.5342013 0.00090799122 39 - 3972 7693.609 -8.5265487 0.00090799122 39 - 3974 7768.811 -8.874305 0.00090799122 39 - 3976 7818.1708 -8.669013 0.00090799122 39 - 3978 7668.0437 -7.9390202 0.00090799122 39 - 3980 7907.5475 -521.4989 0.00092961006 40 - 3982 7901.2861 -438.49415 0.00092961006 40 - 3984 7912.7266 -365.08545 0.00092961006 40 - 3986 7952.4066 -300.82812 0.00092961006 40 - 3988 7790.094 -245.02042 0.00092961006 40 - 3990 7638.9972 -197.81802 0.00092961006 40 - 3992 7710.1676 -158.64673 0.00092961006 40 - 3994 7660.7605 -125.41186 0.00092961006 40 - 3996 7786.1818 -97.877548 0.00092961006 40 - 3998 7843.3548 -75.313834 0.00092961006 40 - 4000 7664.6576 -57.202999 0.00092961006 40 - 4002 7724.4255 -43.857478 0.00092961006 40 - 4004 7797.9069 -33.453599 0.00092961006 40 - 4006 7786.0759 -24.6743 0.00092961006 40 - 4008 7918.4492 -17.828108 0.00092961006 40 - 4010 7905.0845 -12.630032 0.00092961006 40 - 4012 7754.5678 -9.3419463 0.00092961006 40 - 4014 7823.6592 -8.0002651 0.00092961006 40 - 4016 7809.0945 -7.0481495 0.00092961006 40 - 4018 7823.9309 -6.3498162 0.00092961006 40 - 4020 7962.0556 -6.1173176 0.00092961006 40 - 4022 7873.0001 -6.1023523 0.00092961006 40 - 4024 7819.7799 -7.0153894 0.00092961006 40 - 4026 7852.0238 -8.3378683 0.00092961006 40 - 4028 7797.6458 -8.6622183 0.00092961006 40 - 4030 7767.892 -8.0643743 0.00092961006 40 - 4032 7833.0295 -7.3906575 0.00092961006 40 - 4034 7741.8785 -6.945246 0.00092961006 40 - 4036 7741.4775 -7.0038025 0.00092961006 40 - 4038 7774.2275 -6.5629865 0.00092961006 40 - 4040 7746.0392 -4.9652013 0.00092961006 40 - 4042 7754.6703 -3.025234 0.00092961006 40 - 4044 7747.5827 -1.8799389 0.00092961006 40 - 4046 7609.1583 -1.8461253 0.00092961006 40 - 4048 7523.121 -2.5237592 0.00092961006 40 - 4050 7587.8748 -2.81297 0.00092961006 40 - 4052 7585.1351 -2.0344331 0.00092961006 40 - 4054 7783.5525 -1.6383303 0.00092961006 40 - 4056 7873.1758 -2.1091858 0.00092961006 40 - 4058 7836.9551 -3.4736029 0.00092961006 40 - 4060 7771.8648 -4.6327159 0.00092961006 40 - 4062 7745.3428 -4.3264123 0.00092961006 40 - 4064 7684.791 -2.6463797 0.00092961006 40 - 4066 7793.7564 -1.510762 0.00092961006 40 - 4068 7804.0352 -1.709252 0.00092961006 40 - 4070 7788.7767 -3.0200972 0.00092961006 40 - 4072 7760.8316 -3.8847699 0.00092961006 40 - 4074 7708.6591 -3.280568 0.00092961006 40 - 4076 7658.5731 -2.300304 0.00092961006 40 - 4078 7707.8198 -2.7854801 0.00092961006 40 - 4080 7729.9763 -4.8018491 0.00092961006 40 - 4082 7902.4434 -157.06846 0.00095122889 41 - 4084 7963.9885 -265.74961 0.00095122889 41 - 4086 7914.6068 -273.87897 0.00095122889 41 - 4088 7883.2043 -248.21879 0.00095122889 41 - 4090 7798.741 -213.85753 0.00095122889 41 - 4092 7697.673 -179.8176 0.00095122889 41 - 4094 7682.6156 -147.94705 0.00095122889 41 - 4096 7755.5883 -117.79122 0.00095122889 41 - 4098 7769.1235 -90.037461 0.00095122889 41 - 4100 7877.2039 -67.421656 0.00095122889 41 - 4102 7861.6436 -50.915002 0.00095122889 41 - 4104 7835.5421 -39.405831 0.00095122889 41 - 4106 7862.2339 -30.336739 0.00095122889 41 - 4108 7909.2147 -22.182301 0.00095122889 41 - 4110 7883.4125 -16.026159 0.00095122889 41 - 4112 7989.2857 -13.38701 0.00095122889 41 - 4114 7830.6378 -13.322647 0.00095122889 41 - 4116 7769.5086 -13.526071 0.00095122889 41 - 4118 7825.5764 -12.141454 0.00095122889 41 - 4120 7841.5613 -9.0273754 0.00095122889 41 - 4122 7927.5749 -6.6185333 0.00095122889 41 - 4124 7965.3063 -6.2844682 0.00095122889 41 - 4126 7796.2181 -6.7996879 0.00095122889 41 - 4128 7734.3802 -6.6388671 0.00095122889 41 - 4130 7758.5914 -4.7554937 0.00095122889 41 - 4132 7682.7878 -2.5050831 0.00095122889 41 - 4134 7824.8011 -2.6610935 0.00095122889 41 - 4136 7755.6681 -4.6815735 0.00095122889 41 - 4138 7660.969 -6.9516019 0.00095122889 41 - 4140 7688.7405 -7.7130554 0.00095122889 41 - 4142 7581.4273 -6.3261565 0.00095122889 41 - 4144 7526.3642 -4.9332058 0.00095122889 41 - 4146 7582.4672 -5.0590224 0.00095122889 41 - 4148 7552.4585 -5.6074616 0.00095122889 41 - 4150 7647.6784 -5.2241017 0.00095122889 41 - 4152 7792.9307 -3.0123135 0.00095122889 41 - 4154 7755.9484 0.08787677 0.00095122889 41 - 4156 7923.6998 1.4015904 0.00095122889 41 - 4158 7913.9452 0.402066 0.00095122889 41 - 4160 7816.5845 -1.4091564 0.00095122889 41 - 4162 7797.5379 -2.5730791 0.00095122889 41 - 4164 7767.0704 -2.3411579 0.00095122889 41 - 4166 7775.3551 -2.3498279 0.00095122889 41 - 4168 7833.2488 -3.8539649 0.00095122889 41 - 4170 7864.5177 -6.0886196 0.00095122889 41 - 4172 7933.8629 -7.6786041 0.00095122889 41 - 4174 7968.4774 -7.7282369 0.00095122889 41 - 4176 7978.8883 -6.1422019 0.00095122889 41 - 4178 7932.7975 -4.771645 0.00095122889 41 - 4180 7948.0708 -4.0714699 0.00095122889 41 - 4182 7943.1915 -3.8837665 0.00095122889 41 - 4184 8108.9177 -516.1468 0.00097284773 42 - 4186 8206.3013 -433.68498 0.00097284773 42 - 4188 8217.7025 -361.17364 0.00097284773 42 - 4190 8198.8587 -298.59241 0.00097284773 42 - 4192 8099.2022 -245.14742 0.00097284773 42 - 4194 7979.1079 -199.84977 0.00097284773 42 - 4196 8027.5705 -161.57032 0.00097284773 42 - 4198 8019.9532 -128.81228 0.00097284773 42 - 4200 8042.8235 -101.32318 0.00097284773 42 - 4202 8051.7017 -78.733849 0.00097284773 42 - 4204 8029.8713 -60.5796 0.00097284773 42 - 4206 8019.3048 -46.203864 0.00097284773 42 - 4208 8087.5578 -34.745819 0.00097284773 42 - 4210 8111.1976 -25.552949 0.00097284773 42 - 4212 8118.8629 -18.609752 0.00097284773 42 - 4214 8077.5838 -13.804228 0.00097284773 42 - 4216 8027.3801 -10.905812 0.00097284773 42 - 4218 8000.5759 -9.2810893 0.00097284773 42 - 4220 8037.1325 -8.5888292 0.00097284773 42 - 4222 8067.6335 -8.3374162 0.00097284773 42 - 4224 8038.0059 -8.0719145 0.00097284773 42 - 4226 8018.4883 -7.7890418 0.00097284773 42 - 4228 7956.2369 -7.3379906 0.00097284773 42 - 4230 7932.6107 -6.8064093 0.00097284773 42 - 4232 7944.483 -6.1421048 0.00097284773 42 - 4234 7956.2893 -5.0641406 0.00097284773 42 - 4236 7979.4578 -3.6294807 0.00097284773 42 - 4238 8054.2831 -2.2079124 0.00097284773 42 - 4240 8045.5253 -0.91784072 0.00097284773 42 - 4242 8045.7217 -0.18674195 0.00097284773 42 - 4244 8004.127 0.20356353 0.00097284773 42 - 4246 7940.1172 0.45805105 0.00097284773 42 - 4248 7964.2425 0.36976912 0.00097284773 42 - 4250 7988.7833 -0.029928883 0.00097284773 42 - 4252 7996.9124 -0.89531223 0.00097284773 42 - 4254 8017.1117 -2.1639093 0.00097284773 42 - 4256 7940.2632 -3.0690098 0.00097284773 42 - 4258 7860.6561 -3.3920916 0.00097284773 42 - 4260 7879.9971 -3.2953276 0.00097284773 42 - 4262 7891.806 -2.9424874 0.00097284773 42 - 4264 7992.2304 -2.9380123 0.00097284773 42 - 4266 8026.3982 -2.8724499 0.00097284773 42 - 4268 7972.8388 -2.2516181 0.00097284773 42 - 4270 7973.964 -1.297675 0.00097284773 42 - 4272 7994.0752 -0.39747736 0.00097284773 42 - 4274 7998.7465 -0.11614095 0.00097284773 42 - 4276 8088.8291 -0.8113334 0.00097284773 42 - 4278 8059.6742 -1.5888446 0.00097284773 42 - 4280 8020.6926 -2.050816 0.00097284773 42 - 4282 8028.1365 -2.1996992 0.00097284773 42 - 4284 8052.2891 -2.0985556 0.00097284773 42 - 4286 8278.9938 -509.86421 0.00099446657 43 - 4288 8247.3179 -429.64673 0.00099446657 43 - 4290 8126.1785 -358.97006 0.00099446657 43 - 4292 8173.7712 -296.56464 0.00099446657 43 - 4294 8238.764 -242.102 0.00099446657 43 - 4296 8255.6032 -195.61919 0.00099446657 43 - 4298 8262.4411 -156.7365 0.00099446657 43 - 4300 8302.0004 -124.31989 0.00099446657 43 - 4302 8268.867 -96.949231 0.00099446657 43 - 4304 8306.5281 -74.210979 0.00099446657 43 - 4306 8343.4055 -56.253207 0.00099446657 43 - 4308 8356.4515 -42.854371 0.00099446657 43 - 4310 8299.0659 -32.996689 0.00099446657 43 - 4312 8352.6583 -25.752008 0.00099446657 43 - 4314 8361.5085 -19.985322 0.00099446657 43 - 4316 8571.4568 -15.557804 0.00099446657 43 - 4318 8582.3215 -12.887596 0.00099446657 43 - 4320 8472.6813 -11.558167 0.00099446657 43 - 4322 8474.9823 -10.844405 0.00099446657 43 - 4324 8473.3675 -9.8150724 0.00099446657 43 - 4326 8393.9486 -8.1992451 0.00099446657 43 - 4328 8378.9425 -6.7260885 0.00099446657 43 - 4330 8346.1 -5.564676 0.00099446657 43 - 4332 8235.6896 -4.425222 0.00099446657 43 - 4334 8363.6675 -3.5881597 0.00099446657 43 - 4336 8405.1823 -2.3044991 0.00099446657 43 - 4338 8350.9928 -0.8406972 0.00099446657 43 - 4340 8500.7521 -0.4234826 0.00099446657 43 - 4342 8548.8147 -0.62817151 0.00099446657 43 - 4344 8332.1491 -0.83924293 0.00099446657 43 - 4346 8393.1372 -1.6195255 0.00099446657 43 - 4348 8320.9882 -1.6951836 0.00099446657 43 - 4350 8292.8489 -1.6086181 0.00099446657 43 - 4352 8516.1554 -2.1037774 0.00099446657 43 - 4354 8389.0052 -1.9113063 0.00099446657 43 - 4356 8344.2002 -1.802563 0.00099446657 43 - 4358 8441.592 -1.62227 0.00099446657 43 - 4360 8290.2032 -0.812818 0.00099446657 43 - 4362 8276.3044 -0.54320674 0.00099446657 43 - 4364 8398.8818 -0.50890608 0.00099446657 43 - 4366 8217.6126 0.23032956 0.00099446657 43 - 4368 8277.2966 0.45618773 0.00099446657 43 - 4370 8285.6835 0.64048165 0.00099446657 43 - 4372 8223.9666 0.82233709 0.00099446657 43 - 4374 8368.9826 0.30079286 0.00099446657 43 - 4376 8397.6389 -0.039229341 0.00099446657 43 - 4378 8324.4249 -0.062354972 0.00099446657 43 - 4380 8450.3608 -0.40290024 0.00099446657 43 - 4382 8430.9643 -0.53817058 0.00099446657 43 - 4384 8450.4916 -1.0890976 0.00099446657 43 - 4386 8597.0802 -2.1229363 0.00099446657 43 - 4388 8574.7893 -495.23616 0.0010160854 44 - 4390 8534.2928 -416.45571 0.0010160854 44 - 4392 8515.3825 -347.36621 0.0010160854 44 - 4394 8410.3226 -286.93247 0.0010160854 44 - 4396 8441.4595 -234.96248 0.0010160854 44 - 4398 8494.8924 -190.56091 0.0010160854 44 - 4400 8396.1692 -152.56229 0.0010160854 44 - 4402 8340.2064 -120.49381 0.0010160854 44 - 4404 8262.4814 -93.513076 0.0010160854 44 - 4406 8260.9108 -71.399624 0.0010160854 44 - 4408 8503.2679 -54.196816 0.0010160854 44 - 4410 8612.8867 -40.648655 0.0010160854 44 - 4412 8611.2491 -30.080936 0.0010160854 44 - 4414 8529.1473 -22.008788 0.0010160854 44 - 4416 8274.8886 -15.888411 0.0010160854 44 - 4418 8232.6373 -12.281908 0.0010160854 44 - 4420 8278.7733 -10.540243 0.0010160854 44 - 4422 8256.9019 -9.624563 0.0010160854 44 - 4424 8351.6515 -9.3047728 0.0010160854 44 - 4426 8329.4027 -8.6619836 0.0010160854 44 - 4428 8178.9029 -7.6979987 0.0010160854 44 - 4430 8308.5907 -7.5255745 0.0010160854 44 - 4432 8339.2567 -7.3318811 0.0010160854 44 - 4434 8362.5258 -7.1546324 0.0010160854 44 - 4436 8557.2606 -6.6855469 0.0010160854 44 - 4438 8475.4182 -5.6090375 0.0010160854 44 - 4440 8319.9484 -4.6925255 0.0010160854 44 - 4442 8373.3802 -4.545894 0.0010160854 44 - 4444 8374.4917 -4.6279572 0.0010160854 44 - 4446 8395.4212 -4.9670733 0.0010160854 44 - 4448 8502.6173 -5.3570084 0.0010160854 44 - 4450 8394.9695 -5.1255099 0.0010160854 44 - 4452 8434.3765 -5.2245389 0.0010160854 44 - 4454 8443.8848 -5.4566204 0.0010160854 44 - 4456 8441.6094 -5.6688567 0.0010160854 44 - 4458 8408.897 -5.4910366 0.0010160854 44 - 4460 8395.9315 -4.6146451 0.0010160854 44 - 4462 8365.5718 -3.2374638 0.0010160854 44 - 4464 8565.1171 -2.4491367 0.0010160854 44 - 4466 8593.5937 -2.1052133 0.0010160854 44 - 4468 8499.6193 -2.185188 0.0010160854 44 - 4470 8546.1106 -2.307305 0.0010160854 44 - 4472 8527.2742 -1.8524704 0.0010160854 44 - 4474 8465.1781 -1.7897711 0.0010160854 44 - 4476 8500.7257 -2.6640952 0.0010160854 44 - 4478 8494.4707 -3.8554635 0.0010160854 44 - 4480 8532.6748 -5.1327601 0.0010160854 44 - 4482 8596.1301 -5.8945847 0.0010160854 44 - 4484 8521.9809 -5.593774 0.0010160854 44 - 4486 8550.9191 -5.4219167 0.0010160854 44 - 4488 8509.9533 -5.2971017 0.0010160854 44 - 4490 8527.9509 -496.09766 0.0010377042 45 - 4492 8613.0476 -416.35833 0.0010377042 45 - 4494 8676.1378 -345.86004 0.0010377042 45 - 4496 8617.3621 -283.82315 0.0010377042 45 - 4498 8668.1478 -230.41561 0.0010377042 45 - 4500 8649.6909 -184.8817 0.0010377042 45 - 4502 8679.6804 -146.6874 0.0010377042 45 - 4504 8747.1518 -114.94709 0.0010377042 45 - 4506 8688.4472 -88.603119 0.0010377042 45 - 4508 8608.4958 -67.271273 0.0010377042 45 - 4510 8591.9259 -50.787437 0.0010377042 45 - 4512 8494.9811 -38.402513 0.0010377042 45 - 4514 8463.1609 -28.990894 0.0010377042 45 - 4516 8464.8933 -21.635316 0.0010377042 45 - 4518 8470.0639 -16.177833 0.0010377042 45 - 4520 8471.9812 -12.437599 0.0010377042 45 - 4522 8498.4238 -10.08233 0.0010377042 45 - 4524 8499.769 -8.4613574 0.0010377042 45 - 4526 8553.6516 -6.911356 0.0010377042 45 - 4528 8422.8294 -4.7026624 0.0010377042 45 - 4530 8441.909 -2.9558897 0.0010377042 45 - 4532 8387.1921 -1.5442977 0.0010377042 45 - 4534 8384.5952 -0.86092867 0.0010377042 45 - 4536 8431.7181 -0.54662396 0.0010377042 45 - 4538 8441.649 0.07032512 0.0010377042 45 - 4540 8400.8654 0.65049388 0.0010377042 45 - 4542 8412.8422 0.31166962 0.0010377042 45 - 4544 8293.6405 -0.65121641 0.0010377042 45 - 4546 8235.082 -1.9157396 0.0010377042 45 - 4548 8337.4213 -2.8597252 0.0010377042 45 - 4550 8360.9468 -2.8658973 0.0010377042 45 - 4552 8430.0995 -2.7233891 0.0010377042 45 - 4554 8501.6129 -2.7965692 0.0010377042 45 - 4556 8417.9206 -2.5637444 0.0010377042 45 - 4558 8400.4222 -1.9567773 0.0010377042 45 - 4560 8504.0062 -0.76780017 0.0010377042 45 - 4562 8484.3359 1.0467294 0.0010377042 45 - 4564 8558.8809 2.1140163 0.0010377042 45 - 4566 8601.3852 2.1172908 0.0010377042 45 - 4568 8444.5107 1.9568098 0.0010377042 45 - 4570 8467.9402 1.6835107 0.0010377042 45 - 4572 8449.0471 2.1061386 0.0010377042 45 - 4574 8369.1374 3.0093153 0.0010377042 45 - 4576 8491.3532 3.3567439 0.0010377042 45 - 4578 8478.964 3.3802201 0.0010377042 45 - 4580 8504.6394 2.7694682 0.0010377042 45 - 4582 8642.0159 1.9628767 0.0010377042 45 - 4584 8513.5376 2.223098 0.0010377042 45 - 4586 8474.3971 2.516679 0.0010377042 45 - 4588 8487.1656 2.2985708 0.0010377042 45 - 4590 8289.0437 1.9469959 0.0010377042 45 - 4592 8481.5191 -520.17528 0.0010593231 46 - 4594 8567.1466 -437.6927 0.0010593231 46 - 4596 8518.549 -364.26995 0.0010593231 46 - 4598 8604.1157 -300.08043 0.0010593231 46 - 4600 8529.2258 -244.28279 0.0010593231 46 - 4602 8428.0705 -196.70922 0.0010593231 46 - 4604 8582.5154 -156.849 0.0010593231 46 - 4606 8548.2838 -122.68697 0.0010593231 46 - 4608 8596.5127 -94.410533 0.0010593231 46 - 4610 8674.4143 -71.72073 0.0010593231 46 - 4612 8538.4797 -53.669118 0.0010593231 46 - 4614 8623.2159 -40.344528 0.0010593231 46 - 4616 8759.322 -30.147898 0.0010593231 46 - 4618 8793.5955 -21.884434 0.0010593231 46 - 4620 8982.3765 -15.931732 0.0010593231 46 - 4622 8958.5083 -11.617209 0.0010593231 46 - 4624 8806.9297 -8.8619595 0.0010593231 46 - 4626 8803.6844 -7.2321648 0.0010593231 46 - 4628 8797.2255 -5.570733 0.0010593231 46 - 4630 8892.9851 -4.3531986 0.0010593231 46 - 4632 8964.0601 -3.4170376 0.0010593231 46 - 4634 8846.728 -2.655739 0.0010593231 46 - 4636 8773.1004 -2.2601343 0.0010593231 46 - 4638 8671.2037 -1.557705 0.0010593231 46 - 4640 8585.723 -0.71944384 0.0010593231 46 - 4642 8725.2486 -0.48356301 0.0010593231 46 - 4644 8711.1613 -0.53293687 0.0010593231 46 - 4646 8786.7057 -1.5005599 0.0010593231 46 - 4648 8858.642 -2.4923147 0.0010593231 46 - 4650 8752.25 -2.6581339 0.0010593231 46 - 4652 8815.6087 -3.01017 0.0010593231 46 - 4654 8775.7986 -3.3756535 0.0010593231 46 - 4656 8566.3303 -3.7982073 0.0010593231 46 - 4658 8799.7321 -4.3008093 0.0010593231 46 - 4660 8723.878 -3.9630469 0.0010593231 46 - 4662 8686.2465 -3.0562248 0.0010593231 46 - 4664 8915.9896 -2.5027167 0.0010593231 46 - 4666 8948.6766 -1.7363874 0.0010593231 46 - 4668 8981.9868 -1.4904713 0.0010593231 46 - 4670 8973.8687 -1.2017163 0.0010593231 46 - 4672 8781.5713 -0.098324645 0.0010593231 46 - 4674 8836.3853 0.36211688 0.0010593231 46 - 4676 8888.7808 0.13105451 0.0010593231 46 - 4678 8835.0564 -0.50481902 0.0010593231 46 - 4680 8985.5711 -1.5894088 0.0010593231 46 - 4682 8859.0573 -1.5127093 0.0010593231 46 - 4684 8693.8448 -0.89458263 0.0010593231 46 - 4686 8738.5439 -0.77832982 0.0010593231 46 - 4688 8752.8631 -0.68096596 0.0010593231 46 - 4690 8989.1943 -1.1086408 0.0010593231 46 - 4692 9125.5916 -1.3370384 0.0010593231 46 - 4694 9137.3461 -520.18878 0.0010809419 47 - 4696 9161.8764 -436.8854 0.0010809419 47 - 4698 9090.1914 -363.36 0.0010809419 47 - 4700 8968.747 -299.55079 0.0010809419 47 - 4702 9078.7834 -245.40424 0.0010809419 47 - 4704 8992.5725 -198.91807 0.0010809419 47 - 4706 9051.2817 -159.66594 0.0010809419 47 - 4708 9268.4539 -127.05373 0.0010809419 47 - 4710 9249.7126 -99.872257 0.0010809419 47 - 4712 9272.9869 -78.285794 0.0010809419 47 - 4714 9298.2916 -61.242625 0.0010809419 47 - 4716 9149.9948 -47.047605 0.0010809419 47 - 4718 9174.9535 -35.539318 0.0010809419 47 - 4720 9145.8496 -25.8891 0.0010809419 47 - 4722 9109.5375 -18.1682 0.0010809419 47 - 4724 9242.5523 -12.688902 0.0010809419 47 - 4726 9217.6607 -8.2811481 0.0010809419 47 - 4728 9205.001 -4.9666292 0.0010809419 47 - 4730 9246.4981 -2.8583297 0.0010809419 47 - 4732 9085.8485 -1.4678673 0.0010809419 47 - 4734 9146.1068 -1.4024674 0.0010809419 47 - 4736 9303.335 -1.9059492 0.0010809419 47 - 4738 9271.2857 -2.0258301 0.0010809419 47 - 4740 9304.4859 -2.3846233 0.0010809419 47 - 4742 9270.2033 -2.7896971 0.0010809419 47 - 4744 9206.1576 -3.3254688 0.0010809419 47 - 4746 9293.6448 -4.2902575 0.0010809419 47 - 4748 9273.8176 -4.7705219 0.0010809419 47 - 4750 9133.8374 -4.4378019 0.0010809419 47 - 4752 9197.8675 -3.9840481 0.0010809419 47 - 4754 9175.0908 -3.2269941 0.0010809419 47 - 4756 9161.9743 -2.6815574 0.0010809419 47 - 4758 9235.6272 -2.4653622 0.0010809419 47 - 4760 9217.1381 -1.8932604 0.0010809419 47 - 4762 9181.2102 -1.1216766 0.0010809419 47 - 4764 9338.3737 -0.90234884 0.0010809419 47 - 4766 9335.2303 -0.92297203 0.0010809419 47 - 4768 9298.9426 -1.3455966 0.0010809419 47 - 4770 9325.4367 -1.8336104 0.0010809419 47 - 4772 9230.3934 -1.5479611 0.0010809419 47 - 4774 9178.392 -1.0441831 0.0010809419 47 - 4776 9227.8488 -1.0590378 0.0010809419 47 - 4778 9193.9447 -1.4198565 0.0010809419 47 - 4780 9270.6561 -2.1954197 0.0010809419 47 - 4782 9422.3603 -2.8136615 0.0010809419 47 - 4784 9350.7024 -2.673543 0.0010809419 47 - 4786 9331.5137 -2.8714966 0.0010809419 47 - 4788 9250.4145 -3.5767976 0.0010809419 47 - 4790 9107.9642 -4.5337248 0.0010809419 47 - 4792 9228.1155 -5.7916693 0.0010809419 47 - 4794 9292.6027 -6.3474068 0.0010809419 47 - 4796 9281.1728 -495.56961 0.0011025608 48 - 4798 9257.2823 -416.90739 0.0011025608 48 - 4800 9167.2292 -347.91303 0.0011025608 48 - 4802 9051.4613 -287.59488 0.0011025608 48 - 4804 9051.2474 -235.29211 0.0011025608 48 - 4806 8939.1848 -189.98673 0.0011025608 48 - 4808 8829.7683 -151.62536 0.0011025608 48 - 4810 8824.1916 -119.95289 0.0011025608 48 - 4812 8808.1206 -93.914418 0.0011025608 48 - 4814 8890.8833 -72.704047 0.0011025608 48 - 4816 8917.407 -55.21116 0.0011025608 48 - 4818 8876.1635 -41.05117 0.0011025608 48 - 4820 8854.7425 -30.373475 0.0011025608 48 - 4822 8846.8083 -22.843194 0.0011025608 48 - 4824 8821.8413 -17.705544 0.0011025608 48 - 4826 8837.4071 -14.157948 0.0011025608 48 - 4828 8828.0931 -11.420858 0.0011025608 48 - 4830 8859.1154 -9.5170755 0.0011025608 48 - 4832 8946.3791 -8.7264479 0.0011025608 48 - 4834 8978.8812 -8.8790393 0.0011025608 48 - 4836 8953.0905 -9.2279972 0.0011025608 48 - 4838 8910.8094 -8.9427729 0.0011025608 48 - 4840 8968.6837 -8.0843379 0.0011025608 48 - 4842 8928.639 -6.9476377 0.0011025608 48 - 4844 8823.2 -6.1527852 0.0011025608 48 - 4846 8763.5685 -5.8243942 0.0011025608 48 - 4848 8715.8194 -5.2584257 0.0011025608 48 - 4850 8714.0846 -4.3510558 0.0011025608 48 - 4852 8789.8199 -3.6345733 0.0011025608 48 - 4854 8730.5479 -3.2965154 0.0011025608 48 - 4856 8652.0668 -3.7899389 0.0011025608 48 - 4858 8624.8355 -4.732243 0.0011025608 48 - 4860 8580.5577 -5.1860591 0.0011025608 48 - 4862 8654.1508 -5.1768892 0.0011025608 48 - 4864 8735.3771 -4.9999079 0.0011025608 48 - 4866 8765.1707 -5.1542509 0.0011025608 48 - 4868 8804.1792 -5.6790939 0.0011025608 48 - 4870 8860.7297 -5.8263426 0.0011025608 48 - 4872 8908.8556 -5.2744985 0.0011025608 48 - 4874 8926.07 -4.2957281 0.0011025608 48 - 4876 8850.6097 -3.4599457 0.0011025608 48 - 4878 8832.4203 -3.3921154 0.0011025608 48 - 4880 8797.98 -3.7216781 0.0011025608 48 - 4882 8760.5047 -3.9628578 0.0011025608 48 - 4884 8847.4366 -4.0231587 0.0011025608 48 - 4886 8887.6815 -3.7145985 0.0011025608 48 - 4888 8966.9828 -3.9153205 0.0011025608 48 - 4890 9065.3537 -5.038067 0.0011025608 48 - 4892 8936.417 -5.9841835 0.0011025608 48 - 4894 8864.0481 -6.3394779 0.0011025608 48 - 4896 8910.5544 -5.8998984 0.0011025608 48 - 4898 9020.887 -505.99553 0.0011241796 49 - 4900 9146.5453 -425.18309 0.0011241796 49 - 4902 9199.4841 -354.6505 0.0011241796 49 - 4904 9081.6861 -292.58514 0.0011241796 49 - 4906 9109.4808 -238.36724 0.0011241796 49 - 4908 9201.4749 -191.5871 0.0011241796 49 - 4910 9200.1718 -152.36325 0.0011241796 49 - 4912 9338.4038 -121.01454 0.0011241796 49 - 4914 9302.5903 -95.640879 0.0011241796 49 - 4916 9191.2234 -74.423208 0.0011241796 49 - 4918 9211.5642 -56.502848 0.0011241796 49 - 4920 9188.5122 -41.472493 0.0011241796 49 - 4922 9180.3808 -30.039095 0.0011241796 49 - 4924 9285.1643 -22.268454 0.0011241796 49 - 4926 9277.2896 -16.379292 0.0011241796 49 - 4928 9289.8239 -11.313273 0.0011241796 49 - 4930 9378.02 -6.9392159 0.0011241796 49 - 4932 9367.1409 -3.54637 0.0011241796 49 - 4934 9354.7387 -2.1205117 0.0011241796 49 - 4936 9479.7661 -2.6634686 0.0011241796 49 - 4938 9467.8349 -3.3911836 0.0011241796 49 - 4940 9437.0542 -3.4584366 0.0011241796 49 - 4942 9409.6154 -2.8987342 0.0011241796 49 - 4944 9271.2955 -2.339303 0.0011241796 49 - 4946 9193.9347 -2.7801108 0.0011241796 49 - 4948 9239.9208 -3.7808623 0.0011241796 49 - 4950 9278.7442 -4.0161903 0.0011241796 49 - 4952 9336.3169 -3.1299356 0.0011241796 49 - 4954 9330.3317 -1.5284411 0.0011241796 49 - 4956 9202.1213 -0.2202091 0.0011241796 49 - 4958 9154.2967 -0.011244882 0.0011241796 49 - 4960 9101.7899 -0.16601161 0.0011241796 49 - 4962 9207.7969 -0.31994742 0.0011241796 49 - 4964 9366.7994 -0.19747702 0.0011241796 49 - 4966 9425.9901 -0.079974857 0.0011241796 49 - 4968 9444.2698 -0.74663383 0.0011241796 49 - 4970 9393.8478 -1.7630915 0.0011241796 49 - 4972 9302.1463 -2.2747079 0.0011241796 49 - 4974 9424.5662 -2.4598611 0.0011241796 49 - 4976 9465.0434 -2.1365335 0.0011241796 49 - 4978 9434.4933 -1.9532883 0.0011241796 49 - 4980 9469.4423 -2.1376525 0.0011241796 49 - 4982 9375.2018 -1.5851174 0.0011241796 49 - 4984 9362.759 -0.39474824 0.0011241796 49 - 4986 9442.0402 0.97786903 0.0011241796 49 - 4988 9413.9914 2.0671161 0.0011241796 49 - 4990 9416.6093 1.9942893 0.0011241796 49 - 4992 9404.3458 1.2240715 0.0011241796 49 - 4994 9355.31 0.57065426 0.0011241796 49 - 4996 9383.141 0.046953139 0.0011241796 49 - 4998 9399.1453 -0.57346338 0.0011241796 49 - 5000 9519.25 -518.64483 0.0011457984 50 - 5002 9604.2344 -438.74819 0.0011457984 50 - 5004 9559.8129 -367.48865 0.0011457984 50 - 5006 9544.8737 -304.02506 0.0011457984 50 - 5008 9481.656 -248.0081 0.0011457984 50 - 5010 9414.3533 -199.66492 0.0011457984 50 - 5012 9513.1357 -159.18474 0.0011457984 50 - 5014 9603.1734 -125.22869 0.0011457984 50 - 5016 9551.8186 -96.41966 0.0011457984 50 - 5018 9647.3309 -72.653519 0.0011457984 50 - 5020 9605.0904 -53.340454 0.0011457984 50 - 5022 9586.9507 -38.880254 0.0011457984 50 - 5024 9709.9752 -28.999004 0.0011457984 50 - 5026 9683.8421 -21.832358 0.0011457984 50 - 5028 9643.9148 -16.492713 0.0011457984 50 - 5030 9706.0273 -12.710548 0.0011457984 50 - 5032 9611.9033 -9.9440173 0.0011457984 50 - 5034 9567.2906 -8.5244174 0.0011457984 50 - 5036 9635.3114 -8.030991 0.0011457984 50 - 5038 9612.2959 -7.3510392 0.0011457984 50 - 5040 9722.4871 -6.4873995 0.0011457984 50 - 5042 9836.5908 -5.3676385 0.0011457984 50 - 5044 9832.73 -4.3333074 0.0011457984 50 - 5046 9759.2708 -3.8635602 0.0011457984 50 - 5048 9677.2982 -3.7288336 0.0011457984 50 - 5050 9601.6808 -3.5122622 0.0011457984 50 - 5052 9721.7022 -3.5470923 0.0011457984 50 - 5054 9792.2522 -3.6750964 0.0011457984 50 - 5056 9763.3339 -3.8730349 0.0011457984 50 - 5058 9758.9939 -4.1225654 0.0011457984 50 - 5060 9724.8233 -4.0129457 0.0011457984 50 - 5062 9609.7244 -3.4237045 0.0011457984 50 - 5064 9586.6957 -2.8190939 0.0011457984 50 - 5066 9559.6562 -2.1872918 0.0011457984 50 - 5068 9638.7727 -1.8326397 0.0011457984 50 - 5070 9827.2847 -1.9299282 0.0011457984 50 - 5072 9869.462 -2.0742746 0.0011457984 50 - 5074 9813.1458 -2.2167729 0.0011457984 50 - 5076 9794.8461 -2.457677 0.0011457984 50 - 5078 9711.4358 -2.55187 0.0011457984 50 - 5080 9738.491 -3.0545306 0.0011457984 50 - 5082 9899.1136 -4.2012624 0.0011457984 50 - 5084 9807.3623 -4.9467546 0.0011457984 50 - 5086 9744.1007 -5.2849531 0.0011457984 50 - 5088 9821.1579 -5.1551298 0.0011457984 50 - 5090 9825.4736 -4.2577294 0.0011457984 50 - 5092 9865.2542 -3.5543254 0.0011457984 50 - 5094 9961.4468 -3.4213589 0.0011457984 50 - 5096 9830.6392 -2.8661808 0.0011457984 50 - 5098 9833.4478 -2.0922959 0.0011457984 50 - 5100 9900.2941 -0.83434095 0.0011457984 50 - 5102 9835.9337 0.4699033 0.0011457984 50 - 5104 9833.7603 0.47743244 0.0011457984 50 - 5106 9831.8135 -0.41088598 0.0011457984 50 - 5108 9757.8169 -0.9151913 0.0011457984 50 - 5110 9867.9551 -0.76236525 0.0011457984 50 - 5112 9881.1147 0.26687783 0.0011457984 50 - 5114 9810.935 0.95492784 0.0011457984 50 - 5116 9854.0824 0.16038773 0.0011457984 50 - 5118 9801.1062 -0.97621444 0.0011457984 50 - 5120 9737.6269 -1.3109743 0.0011457984 50 - 5122 9744.1436 -0.55115253 0.0011457984 50 - 5124 9649.6516 0.72316201 0.0011457984 50 - 5126 9664.2682 0.67140181 0.0011457984 50 - 5128 9768.702 -0.94819295 0.0011457984 50 - 5130 9753.6951 -2.6136655 0.0011457984 50 - 5132 9719.31 -3.421216 0.0011457984 50 - 5134 9601.2267 -3.1913958 0.0011457984 50 - 5136 9436.5811 -2.8639748 0.0011457984 50 - 5138 9485.6348 -3.6250392 0.0011457984 50 - 5140 9602.4968 -4.6930818 0.0011457984 50 - 5142 9716.3445 -4.7009462 0.0011457984 50 - 5144 9829.8772 -3.0422762 0.0011457984 50 - 5146 9775.9253 -0.099871825 0.0011457984 50 - 5148 9714.3184 2.3638003 0.0011457984 50 - 5150 9721.8795 3.4407067 0.0011457984 50 - 5152 9711.5028 3.8932963 0.0011457984 50 - 5154 9740.7674 4.6393043 0.0011457984 50 - 5156 9788.8434 5.8877168 0.0011457984 50 - 5158 9735.8911 6.7816444 0.0011457984 50 - 5160 9752.7265 5.8563351 0.0011457984 50 - 5162 9749.8783 3.4223128 0.0011457984 50 - 5164 9755.0591 0.65432948 0.0011457984 50 - 5166 9790.6938 -1.4423029 0.0011457984 50 - 5168 9683.3354 -2.4366479 0.0011457984 50 - 5170 9568.8334 -3.2936067 0.0011457984 50 - 5172 9550.9121 -4.6097096 0.0011457984 50 - 5174 9514.1645 -5.6687719 0.0011457984 50 - 5176 9526.4197 -5.8206698 0.0011457984 50 - 5178 9580.5278 -4.6502361 0.0011457984 50 - 5180 9499.5744 -2.3930624 0.0011457984 50 - 5182 9493.8922 -0.49092775 0.0011457984 50 - 5184 9474.1233 0.87105346 0.0011457984 50 - 5186 9443.4367 2.121042 0.0011457984 50 - 5188 9505.5172 3.4569671 0.0011457984 50 - 5190 9505.6816 5.010125 0.0011457984 50 - 5192 9517.009 5.8421504 0.0011457984 50 - 5194 9547.5435 5.4256946 0.0011457984 50 - 5196 9390.6498 4.4551742 0.0011457984 50 - 5198 9352.7639 2.9903747 0.0011457984 50 - 5200 9437.6381 1.5947939 0.0011457984 50 - 5202 9450.1343 0.70258862 0.0011457984 50 - 5204 9510.3105 -0.33071087 0.0011457984 50 - 5206 9502.9253 -1.3602607 0.0011457984 50 - 5208 9332.6127 -1.9447417 0.0011457984 50 - 5210 9341.5743 -2.3342341 0.0011457984 50 - 5212 9336.7886 -2.0628218 0.0011457984 50 - 5214 9318.1505 -1.4587331 0.0011457984 50 - 5216 9328.1223 -1.0850967 0.0011457984 50 - 5218 9318.8979 -1.017563 0.0011457984 50 - 5220 9330.595 -1.4294349 0.0011457984 50 - 5222 9450.3709 -2.3924416 0.0011457984 50 - 5224 9502.7445 -3.3023586 0.0011457984 50 - 5226 9448.058 -3.7841582 0.0011457984 50 - 5228 9401.1768 -3.9368085 0.0011457984 50 - 5230 9376.2376 -3.884294 0.0011457984 50 - 5232 9490.2547 -3.8750812 0.0011457984 50 - 5234 9658.1297 -3.5385398 0.0011457984 50 - 5236 9767.8043 -2.2736464 0.0011457984 50 - 5238 9761.0999 0.053501857 0.0011457984 50 - 5240 9783.3194 2.5425609 0.0011457984 50 - 5242 9757.6764 4.3275198 0.0011457984 50 - 5244 9722.8232 4.910775 0.0011457984 50 - 5246 9658.9452 4.8162207 0.0011457984 50 - 5248 9549.9302 4.9055441 0.0011457984 50 - 5250 9498.0386 5.0091454 0.0011457984 50 - 5252 9556.7311 4.1185281 0.0011457984 50 - 5254 9557.8028 1.880578 0.0011457984 50 - 5256 9548.9864 -1.1838066 0.0011457984 50 - 5258 9549.5421 -3.602049 0.0011457984 50 - 5260 9475.6275 -4.2460784 0.0011457984 50 - 5262 9448.1808 -3.9399715 0.0011457984 50 - 5264 9419.3009 -3.988808 0.0011457984 50 - 5266 9323.9302 -4.6937748 0.0011457984 50 - 5268 9350.3276 -5.3829053 0.0011457984 50 - 5270 9428.4885 -4.645299 0.0011457984 50 - 5272 9417.8913 -2.2902504 0.0011457984 50 - 5274 9436.9374 -0.11804883 0.0011457984 50 - 5276 9401.9 0.66257181 0.0011457984 50 - 5278 9316.6789 0.31275109 0.0011457984 50 - 5280 9314.8748 0.056129951 0.0011457984 50 - 5282 9304.1942 1.087018 0.0011457984 50 - 5284 9258.2839 2.7234584 0.0011457984 50 - 5286 9294.6632 3.1147868 0.0011457984 50 - 5288 9308.543 1.8812776 0.0011457984 50 - 5290 9351.3899 0.14644409 0.0011457984 50 - 5292 9402.3917 -0.32211565 0.0011457984 50 - 5294 9394.3066 0.91699 0.0011457984 50 - 5296 9363.5405 2.1749681 0.0011457984 50 - 5298 9384.5919 1.7616072 0.0011457984 50 - 5300 9382.0075 0.085544762 0.0011457984 50 - 5302 9444.7238 -1.278927 0.0011457984 50 - 5304 9499.763 -0.95971655 0.0011457984 50 - 5306 9510.1811 0.3954472 0.0011457984 50 - 5308 9521.5827 0.80570679 0.0011457984 50 - 5310 9488.6394 -0.45080118 0.0011457984 50 - 5312 9458.5255 -2.2580491 0.0011457984 50 - 5314 9457.4813 -2.7922614 0.0011457984 50 - 5316 9445.8123 -1.4619951 0.0011457984 50 - 5318 9439.6266 0.15583575 0.0011457984 50 - 5320 9473.753 0.22079091 0.0011457984 50 - 5322 9388.847 -0.86054314 0.0011457984 50 - 5324 9367.7834 -1.620443 0.0011457984 50 - 5326 9380.1644 -0.60133066 0.0011457984 50 - 5328 9304.879 1.8098891 0.0011457984 50 - 5330 9325.2485 3.1393573 0.0011457984 50 - 5332 9358.3543 2.4501572 0.0011457984 50 - 5334 9376.1966 0.84459833 0.0011457984 50 - 5336 9467.6575 -0.083434336 0.0011457984 50 - 5338 9409.1197 0.66408521 0.0011457984 50 - 5340 9250.6533 1.6038726 0.0011457984 50 - 5342 9266.1293 0.61862675 0.0011457984 50 - 5344 9170.0051 -1.5966932 0.0011457984 50 - 5346 9179.8306 -3.6910361 0.0011457984 50 - 5348 9296.0188 -4.0548344 0.0011457984 50 - 5350 9296.8615 -2.5050102 0.0011457984 50 - 5352 9357.2572 -1.4096762 0.0011457984 50 - 5354 9433.7322 -1.9270572 0.0011457984 50 - 5356 9366.3852 -2.9265892 0.0011457984 50 - 5358 9383.244 -3.1782233 0.0011457984 50 - 5360 9330.1465 -1.6512376 0.0011457984 50 - 5362 9194.5054 0.45883229 0.0011457984 50 - 5364 9187.3004 1.0065586 0.0011457984 50 - 5366 9116.9514 0.24444396 0.0011457984 50 - 5368 9123.0653 -0.8484207 0.0011457984 50 - 5370 9235.0911 -0.99263669 0.0011457984 50 - 5372 9188.9208 0.35243273 0.0011457984 50 - 5374 9243.5231 1.2486617 0.0011457984 50 - 5376 9234.3754 1.1088679 0.0011457984 50 - 5378 9105.3344 0.57943502 0.0011457984 50 - 5380 9154.7563 0.26409692 0.0011457984 50 - 5382 9194.3543 1.3453858 0.0011457984 50 - 5384 9205.2826 3.1104191 0.0011457984 50 - 5386 9420.3172 3.7734635 0.0011457984 50 - 5388 9441.4103 3.817096 0.0011457984 50 - 5390 9485.1202 3.3782803 0.0011457984 50 - 5392 9610.8107 2.9155254 0.0011457984 50 - 5394 9501.4179 3.1457124 0.0011457984 50 - 5396 9510.022 2.796283 0.0011457984 50 - 5398 9569.8284 1.81996 0.0011457984 50 - 5400 9457.2815 1.0036435 0.0011457984 50 - 5402 9515.4621 0.079212777 0.0011457984 50 - 5404 9507.745 0.024899951 0.0011457984 50 - 5406 9382.3611 0.84022397 0.0011457984 50 - 5408 9522.7726 1.3301395 0.0011457984 50 - 5410 9508.3297 2.1977172 0.0011457984 50 - 5412 9457.243 3.0751267 0.0011457984 50 - 5414 9584.2886 3.3911486 0.0011457984 50 - 5416 9456.1599 3.9039941 0.0011457984 50 - 5418 9439.7174 3.8015334 0.0011457984 50 - 5420 9595.7276 3.21878 0.0011457984 50 - 5422 9638.3225 2.8942378 0.0011457984 50 - 5424 9764.949 2.1267642 0.0011457984 50 - 5426 9841.5444 1.0682476 0.0011457984 50 - 5428 9680.5031 0.33474701 0.0011457984 50 - 5430 9607.8822 -0.11987808 0.0011457984 50 - 5432 9560.1267 0.27946219 0.0011457984 50 - 5434 9536.9174 1.1692843 0.0011457984 50 - 5436 9631.0768 1.6665967 0.0011457984 50 - 5438 9589.8701 1.9147519 0.0011457984 50 - 5440 9575.3452 1.8639901 0.0011457984 50 - 5442 9659.3629 1.9520524 0.0011457984 50 - 5444 9674.1541 2.4907839 0.0011457984 50 - 5446 9697.7261 2.406508 0.0011457984 50 - 5448 9690.8984 1.1264598 0.0011457984 50 - 5450 9623.3865 -0.92487777 0.0011457984 50 - 5452 9674.9321 -2.905871 0.0011457984 50 - 5454 9702.2485 -3.6732167 0.0011457984 50 - 5456 9635.4187 -3.5217309 0.0011457984 50 - 5458 9581.3254 -3.6059798 0.0011457984 50 - 5460 9480.4669 -3.9734002 0.0011457984 50 - 5462 9435.3131 -4.0387581 0.0011457984 50 - 5464 9534.5506 -2.973297 0.0011457984 50 - 5466 9617.0167 -0.56760995 0.0011457984 50 - 5468 9692.5636 1.7234191 0.0011457984 50 - 5470 9685.9259 2.7363009 0.0011457984 50 - 5472 9599.1928 2.4794484 0.0011457984 50 - 5474 9562.0871 1.8028212 0.0011457984 50 - 5476 9580.3546 1.7444303 0.0011457984 50 - 5478 9604.8083 2.0739899 0.0011457984 50 - 5480 9740.0757 1.5011757 0.0011457984 50 - 5482 9735.5541 0.070083688 0.0011457984 50 - 5484 9721.3199 -1.5645649 0.0011457984 50 - 5486 9719.1871 -2.0903277 0.0011457984 50 - 5488 9755.2534 -1.0516302 0.0011457984 50 - 5490 9741.0741 0.68343685 0.0011457984 50 - 5492 9790.595 1.68584 0.0011457984 50 - 5494 9747.6207 1.940975 0.0011457984 50 - 5496 9760.0492 2.0438587 0.0011457984 50 - 5498 9806.8117 2.9557222 0.0011457984 50 - 5500 9906.2348 4.2445378 0.0011457984 50 - 5502 9937.3762 4.6360945 0.0011457984 50 - 5504 9889.9099 3.36744 0.0011457984 50 - 5506 9801.0867 1.1583543 0.0011457984 50 - 5508 9757.0639 -0.63507871 0.0011457984 50 - 5510 9849.2588 -1.5203115 0.0011457984 50 - 5512 9910.9432 -1.9936042 0.0011457984 50 - 5514 9980.9927 -3.1553219 0.0011457984 50 - 5516 9884.7046 -4.6195607 0.0011457984 50 - 5518 9819.009 -5.5292635 0.0011457984 50 - 5520 9791.743 -5.0244452 0.0011457984 50 - 5522 9876.9616 -3.4374028 0.0011457984 50 - 5524 9913.7323 -1.560895 0.0011457984 50 - 5526 9965.6802 -0.28230669 0.0011457984 50 - 5528 9864.5527 0.77777988 0.0011457984 50 - 5530 9722.3632 2.0611697 0.0011457984 50 - 5532 9692.5948 3.4357418 0.0011457984 50 - 5534 9707.7114 4.4316179 0.0011457984 50 - 5536 9724.5556 4.4200513 0.0011457984 50 - 5538 9810.0608 3.2814823 0.0011457984 50 - 5540 9801.1254 1.9944919 0.0011457984 50 - 5542 9828.6486 0.81577583 0.0011457984 50 - 5544 9886.5246 -0.26945791 0.0011457984 50 - 5546 9814.2295 -1.2219503 0.0011457984 50 - 5548 9769.2818 -2.3790154 0.0011457984 50 - 5550 9671.3607 -3.1813334 0.0011457984 50 - 5552 9566.1375 -3.3034884 0.0011457984 50 - 5554 9662.8479 -3.157334 0.0011457984 50 - 5556 9822.6928 -2.7092017 0.0011457984 50 - 5558 9858.3611 -1.8733723 0.0011457984 50 - 5560 9864.0403 -0.9432148 0.0011457984 50 - 5562 9718.5186 0.33420254 0.0011457984 50 - 5564 9654.7726 1.3559204 0.0011457984 50 - 5566 9734.7499 1.7708321 0.0011457984 50 - 5568 9777.4725 1.9858757 0.0011457984 50 - 5570 9847.5326 2.0634589 0.0011457984 50 - 5572 9936.0477 2.097276 0.0011457984 50 - 5574 9900.7633 2.0720838 0.0011457984 50 - 5576 9937.5273 1.3672326 0.0011457984 50 - 5578 9961.2023 0.43540294 0.0011457984 50 - 5580 9863.5165 0.14546723 0.0011457984 50 - 5582 9788.1833 0.64376512 0.0011457984 50 - 5584 9738.4717 1.7883089 0.0011457984 50 - 5586 9777.5941 2.7944617 0.0011457984 50 - 5588 9844.3258 3.2948653 0.0011457984 50 - 5590 9850.6037 3.73122 0.0011457984 50 - 5592 9798.7444 4.4707532 0.0011457984 50 - 5594 9769.4476 5.2454853 0.0011457984 50 - 5596 9735.6813 5.3788919 0.0011457984 50 - 5598 9750.2623 4.3811369 0.0011457984 50 - 5600 9724.4105 2.9038676 0.0011457984 50 - 5602 9709.8706 1.6769734 0.0011457984 50 - 5604 9638.2747 1.2349895 0.0011457984 50 - 5606 9507.2594 1.3337825 0.0011457984 50 - 5608 9450.6727 1.1336527 0.0011457984 50 - 5610 9408.6365 0.68267355 0.0011457984 50 - 5612 9369.3312 0.59089756 0.0011457984 50 - 5614 9398.4939 1.2016359 0.0011457984 50 - 5616 9399.087 2.5782644 0.0011457984 50 - 5618 9324.4882 3.9215052 0.0011457984 50 - 5620 9341.4802 4.2926302 0.0011457984 50 - 5622 9244.696 4.4103891 0.0011457984 50 - 5624 9215.3593 4.6659322 0.0011457984 50 - 5626 9261.8257 5.3576315 0.0011457984 50 - 5628 9242.4011 6.3450699 0.0011457984 50 - 5630 9285.0978 6.5221442 0.0011457984 50 - 5632 9314.0346 5.9409997 0.0011457984 50 - 5634 9177.7593 5.6044675 0.0011457984 50 - 5636 9156.3214 5.5249683 0.0011457984 50 - 5638 9142.6687 5.7822736 0.0011457984 50 - 5640 9062.436 5.6464383 0.0011457984 50 - 5642 9140.8597 4.0505564 0.0011457984 50 - 5644 9134.2075 1.9875116 0.0011457984 50 - 5646 9084.7092 0.37818807 0.0011457984 50 - 5648 9184.8938 -0.6330058 0.0011457984 50 - 5650 9167.4749 -0.92384704 0.0011457984 50 - 5652 9188.003 -1.5961161 0.0011457984 50 - 5654 9208.2435 -2.6124216 0.0011457984 50 - 5656 9134.2092 -2.7628664 0.0011457984 50 - 5658 9097.3017 -1.5551001 0.0011457984 50 - 5660 9144.5404 0.57803721 0.0011457984 50 - 5662 9067.6426 2.680454 0.0011457984 50 - 5664 9075.8344 3.4574442 0.0011457984 50 - 5666 9019.7649 3.6888499 0.0011457984 50 - 5668 8979.0779 4.3183604 0.0011457984 50 - 5670 9044.7573 5.3882578 0.0011457984 50 - 5672 9106.6295 6.2475025 0.0011457984 50 - 5674 9095.1777 5.8147786 0.0011457984 50 - 5676 9092.9844 3.7292974 0.0011457984 50 - 5678 9006.8683 1.4945746 0.0011457984 50 - 5680 8875.2811 0.39531891 0.0011457984 50 - 5682 8887.6236 0.13437937 0.0011457984 50 - 5684 8857.0466 -0.0678953 0.0011457984 50 - 5686 9029.4601 -1.5241271 0.0011457984 50 - 5688 9195.6539 -3.1525277 0.0011457984 50 - 5690 9255.4237 -3.2301058 0.0011457984 50 - 5692 9262.751 -1.5870815 0.0011457984 50 - 5694 9177.1236 0.75066556 0.0011457984 50 - 5696 8980.3972 2.3413159 0.0011457984 50 - 5698 9046.6838 2.0139028 0.0011457984 50 - 5700 9089.9961 1.3331579 0.0011457984 50 - 5702 9108.9557 1.5442681 0.0011457984 50 - 5704 9183.8128 2.4575345 0.0011457984 50 - 5706 9103.6573 3.3601782 0.0011457984 50 - 5708 9034.187 2.7608128 0.0011457984 50 - 5710 9102.9716 0.72617921 0.0011457984 50 - 5712 9002.0791 -0.57347993 0.0011457984 50 - 5714 8960.5092 -0.6794737 0.0011457984 50 - 5716 8971.8739 -0.00031815209 0.0011457984 50 - 5718 8843.295 0.72776349 0.0011457984 50 - 5720 8934.1565 0.19821608 0.0011457984 50 - 5722 8963.7715 -0.39919342 0.0011457984 50 - 5724 8879.4007 0.20643603 0.0011457984 50 - 5726 8883.8738 1.8298534 0.0011457984 50 - 5728 8875.907 3.9153843 0.0011457984 50 - 5730 8875.0305 5.1890909 0.0011457984 50 - 5732 9093.0103 4.9108717 0.0011457984 50 - 5734 9121.1682 4.658725 0.0011457984 50 - 5736 9147.9828 4.6797083 0.0011457984 50 - 5738 9208.0685 4.6825798 0.0011457984 50 - 5740 9109.1076 4.350183 0.0011457984 50 - 5742 9137.9665 2.5394457 0.0011457984 50 - 5744 9233.8623 -0.13654524 0.0011457984 50 - 5746 9274.9432 -2.1852561 0.0011457984 50 - 5748 9375.8397 -3.1751126 0.0011457984 50 - 5750 9394.0222 -2.9957216 0.0011457984 50 - 5752 9264.7974 -2.3410807 0.0011457984 50 - 5754 9313.8745 -2.2121784 0.0011457984 50 - 5756 9267.4298 -1.5388542 0.0011457984 50 - 5758 9272.5259 0.012455309 0.0011457984 50 - 5760 9378.6847 2.357578 0.0011457984 50 - 5762 9329.1337 5.3400185 0.0011457984 50 - 5764 9318.1234 7.4868473 0.0011457984 50 - 5766 9410.2861 8.1063443 0.0011457984 50 - 5768 9364.9349 7.9969695 0.0011457984 50 - 5770 9397.0258 7.3517553 0.0011457984 50 - 5772 9522.9182 6.4246127 0.0011457984 50 - 5774 9546.1456 5.1902951 0.0011457984 50 - 5776 9688.1023 2.8309542 0.0011457984 50 - 5778 9703.883 0.3843822 0.0011457984 50 - 5780 9560.2136 -0.97898997 0.0011457984 50 - 5782 9491.6947 -1.1277455 0.0011457984 50 - 5784 9464.9945 -0.17086068 0.0011457984 50 - 5786 9410.4041 1.141182 0.0011457984 50 - 5788 9443.3999 1.9891415 0.0011457984 50 - 5790 9390.6079 2.8921217 0.0011457984 50 - 5792 9387.6468 3.9361413 0.0011457984 50 - 5794 9500.5403 4.9627391 0.0011457984 50 - 5796 9496.8831 5.7655291 0.0011457984 50 - 5798 9499.7529 5.2018266 0.0011457984 50 - 5800 9456.1563 3.4798465 0.0011457984 50 - 5802 9375.5941 1.6783349 0.0011457984 50 - 5804 9442.5195 0.3430883 0.0011457984 50 - 5806 9484.4576 -0.077274186 0.0011457984 50 - 5808 9429.8078 -0.17234937 0.0011457984 50 - 5810 9456.4999 -0.69501087 0.0011457984 50 - 5812 9397.6411 -0.73520349 0.0011457984 50 - 5814 9407.137 0.060929401 0.0011457984 50 - 5816 9526.2338 1.5625496 0.0011457984 50 - 5818 9487.0573 3.536031 0.0011457984 50 - 5820 9540.0818 4.4291809 0.0011457984 50 - 5822 9598.9135 4.0269073 0.0011457984 50 - 5824 9531.0727 3.1592454 0.0011457984 50 - 5826 9508.6169 2.2657967 0.0011457984 50 - 5828 9454.0163 1.9297467 0.0011457984 50 - 5830 9396.1836 1.5698577 0.0011457984 50 - 5832 9566.9629 0.057300614 0.0011457984 50 - 5834 9656.9144 -1.7889329 0.0011457984 50 - 5836 9681.8595 -3.1479964 0.0011457984 50 - 5838 9680.7003 -3.4838441 0.0011457984 50 - 5840 9505.8807 -2.7332235 0.0011457984 50 - 5842 9405.8802 -2.3153426 0.0011457984 50 - 5844 9420.8907 -2.7763813 0.0011457984 50 - 5846 9424.7211 -3.3544877 0.0011457984 50 - 5848 9493.4043 -3.3493234 0.0011457984 50 - 5850 9528.0457 -2.1551469 0.0011457984 50 - 5852 9452.8631 -0.35990604 0.0011457984 50 - 5854 9419.8602 0.55498139 0.0011457984 50 - 5856 9334.3062 0.49191412 0.0011457984 50 - 5858 9284.7095 0.012872669 0.0011457984 50 - 5860 9275.8427 0.11749661 0.0011457984 50 - 5862 9238.2407 1.0991173 0.0011457984 50 - 5864 9265.6877 1.7811333 0.0011457984 50 - 5866 9247.8628 1.4524729 0.0011457984 50 - 5868 9251.3414 0.24102384 0.0011457984 50 - 5870 9334.5085 -0.9900622 0.0011457984 50 - 5872 9380.6515 -1.2254557 0.0011457984 50 - 5874 9400.7574 -0.85963511 0.0011457984 50 - 5876 9461.4556 -0.97009484 0.0011457984 50 - 5878 9422.7193 -1.7108859 0.0011457984 50 - 5880 9452.3619 -2.8338146 0.0011457984 50 - 5882 9478.1995 -3.1268178 0.0011457984 50 - 5884 9455.6014 -2.0975814 0.0011457984 50 - 5886 9523.8311 -0.8393345 0.0011457984 50 - 5888 9469.8628 -0.024389183 0.0011457984 50 - 5890 9353.3316 -0.029234815 0.0011457984 50 - 5892 9353.2772 -0.36384581 0.0011457984 50 - 5894 9296.039 0.26316862 0.0011457984 50 - 5896 9347.861 1.2835594 0.0011457984 50 - 5898 9441.5972 1.7248974 0.0011457984 50 - 5900 9381.4678 1.2684522 0.0011457984 50 - 5902 9361.5331 -0.019520588 0.0011457984 50 - 5904 9360.4057 -0.89549679 0.0011457984 50 - 5906 9366.958 -0.86092765 0.0011457984 50 - 5908 9496.5969 -0.84331725 0.0011457984 50 - 5910 9462.4261 -1.1960116 0.0011457984 50 - 5912 9324.8237 -1.9671879 0.0011457984 50 - 5914 9285.0082 -2.3761654 0.0011457984 50 - 5916 9282.2489 -1.3018825 0.0011457984 50 - 5918 9418.5779 0.58373203 0.0011457984 50 - 5920 9539.3709 2.252092 0.0011457984 50 - 5922 9498.438 3.229691 0.0011457984 50 - 5924 9432.9584 3.6446358 0.0011457984 50 - 5926 9419.3007 4.4423313 0.0011457984 50 - 5928 9498.7474 5.7335499 0.0011457984 50 - 5930 9711.7231 6.4606288 0.0011457984 50 - 5932 9824.7497 5.9737039 0.0011457984 50 - 5934 9830.3795 4.2470677 0.0011457984 50 - 5936 9742.2625 2.4954471 0.0011457984 50 - 5938 9622.9601 1.7734819 0.0011457984 50 - 5940 9564.3827 1.6969709 0.0011457984 50 - 5942 9505.3002 1.4169294 0.0011457984 50 - 5944 9527.2581 0.33507768 0.0011457984 50 - 5946 9576.9445 -0.73645779 0.0011457984 50 - 5948 9611.2143 -0.46409823 0.0011457984 50 - 5950 9652.9501 1.2596854 0.0011457984 50 - 5952 9679.4027 3.43528 0.0011457984 50 - 5954 9567.8258 5.0545532 0.0011457984 50 - 5956 9599.4726 5.2843846 0.0011457984 50 - 5958 9589.5061 5.4230915 0.0011457984 50 - 5960 9549.2322 6.5029997 0.0011457984 50 - 5962 9580.8085 8.0667162 0.0011457984 50 - 5964 9553.0902 9.3316431 0.0011457984 50 - 5966 9478.6722 9.3997735 0.0011457984 50 - 5968 9575.7717 8.0819559 0.0011457984 50 - 5970 9522.7041 7.0080815 0.0011457984 50 - 5972 9488.6679 6.4440707 0.0011457984 50 - 5974 9573.1695 5.9298637 0.0011457984 50 - 5976 9582.6086 5.2536087 0.0011457984 50 - 5978 9628.2049 3.8987008 0.0011457984 50 - 5980 9677.3761 2.5384624 0.0011457984 50 - 5982 9596.6234 2.2380369 0.0011457984 50 - 5984 9588.085 2.6032445 0.0011457984 50 - 5986 9680.8357 2.9432395 0.0011457984 50 - 5988 9699.6998 2.9389564 0.0011457984 50 - 5990 9818.7251 2.2461338 0.0011457984 50 - 5992 9865.95 1.7383994 0.0011457984 50 - 5994 9845.4616 1.7345407 0.0011457984 50 - 5996 9854.6465 1.805345 0.0011457984 50 - 5998 9850.1963 1.8001966 0.0011457984 50 - 6000 9809.6304 1.5739345 0.0011457984 50 - 6002 9891.4427 0.92755735 0.0011457984 50 - 6004 9912.1115 0.48270035 0.0011457984 50 - 6006 9887.7326 0.39077694 0.0011457984 50 - 6008 9861.9189 0.6337832 0.0011457984 50 - 6010 9768.1269 1.2151004 0.0011457984 50 - 6012 9773.5059 1.498899 0.0011457984 50 - 6014 9819.8242 1.3529148 0.0011457984 50 - 6016 9828.2381 0.996993 0.0011457984 50 - 6018 9838.2915 0.66495661 0.0011457984 50 - 6020 9869.4576 0.69539003 0.0011457984 50 - 6022 9834.0117 1.1078898 0.0011457984 50 - 6024 9873.4062 1.07854 0.0011457984 50 - 6026 9914.6123 0.44227466 0.0011457984 50 - 6028 9891.3644 -0.36282183 0.0011457984 50 - 6030 9879.73 -0.83632357 0.0011457984 50 - 6032 9860.7734 -0.65427235 0.0011457984 50 - 6034 9835.8156 -0.30828552 0.0011457984 50 - 6036 9823.8167 -0.54884625 0.0011457984 50 - 6038 9779.8815 -1.3563752 0.0011457984 50 - 6040 9695.471 -1.9518387 0.0011457984 50 - 6042 9665.1458 -1.6761814 0.0011457984 50 - 6044 9644.9759 -0.43265853 0.0011457984 50 - 6046 9602.8254 1.0066052 0.0011457984 50 - 6048 9641.4636 1.7985425 0.0011457984 50 - 6050 9704.4729 2.2207014 0.0011457984 50 - 6052 9782.2464 2.9918915 0.0011457984 50 - 6054 9822.1111 4.4377842 0.0011457984 50 - 6056 9791.1854 5.9424321 0.0011457984 50 - 6058 9669.251 6.5453526 0.0011457984 50 - 6060 9594.6289 5.8146205 0.0011457984 50 - 6062 9582.48 4.5586657 0.0011457984 50 - 6064 9618.5592 3.7252984 0.0011457984 50 - 6066 9661.4545 3.4533548 0.0011457984 50 - 6068 9693.2956 3.0938242 0.0011457984 50 - 6070 9742.4217 2.026046 0.0011457984 50 - 6072 9798.2646 0.58042123 0.0011457984 50 - 6074 9844.6891 -0.26831074 0.0011457984 50 - 6076 9883.7518 0.046526836 0.0011457984 50 - 6078 9912.71 1.0839261 0.0011457984 50 - 6080 9944.1643 1.8908726 0.0011457984 50 - 6082 9956.4196 2.0738197 0.0011457984 50 - 6084 9933.531 2.1330963 0.0011457984 50 - 6086 9858.8887 2.8225944 0.0011457984 50 - 6088 9842.6352 3.8176999 0.0011457984 50 - 6090 9869.0454 4.111327 0.0011457984 50 - 6092 9895.151 3.072967 0.0011457984 50 - 6094 9923.4713 1.0726233 0.0011457984 50 - 6096 9846.6654 -0.5488411 0.0011457984 50 - 6098 9727.6782 -1.0304422 0.0011457984 50 - 6100 9644.9934 -0.63623128 0.0011457984 50 - 6102 9688.8998 -0.14299764 0.0011457984 50 - 6104 9788.6344 0.074155995 0.0011457984 50 - 6106 9880.8557 0.46787569 0.0011457984 50 - 6108 9795.1292 1.9605951 0.0011457984 50 - 6110 9781.2803 3.9699667 0.0011457984 50 - 6112 9772.8688 5.6753162 0.0011457984 50 - 6114 9783.1404 6.2397127 0.0011457984 50 - 6116 9862.009 5.4814461 0.0011457984 50 - 6118 9834.7021 4.4466959 0.0011457984 50 - 6120 9718.1031 3.6458456 0.0011457984 50 - 6122 9611.3046 2.7891142 0.0011457984 50 - 6124 9492.9139 1.6648477 0.0011457984 50 - 6126 9466.1975 0.059344629 0.0011457984 50 - 6128 9596.4483 -1.4758409 0.0011457984 50 - 6130 9628.4788 -1.633685 0.0011457984 50 - 6132 9663.5465 -0.60391218 0.0011457984 50 - 6134 9598.4656 1.0889235 0.0011457984 50 - 6136 9457.9898 2.7495116 0.0011457984 50 - 6138 9455.8838 3.8955319 0.0011457984 50 - 6140 9518.8498 5.1312351 0.0011457984 50 - 6142 9550.1571 6.7355515 0.0011457984 50 - 6144 9615.9609 8.1297976 0.0011457984 50 - 6146 9580.9308 9.0695275 0.0011457984 50 - 6148 9519.1276 9.1299634 0.0011457984 50 - 6150 9504.6824 8.4661449 0.0011457984 50 - 6152 9457.6515 7.932841 0.0011457984 50 - 6154 9438.392 7.7647042 0.0011457984 50 - 6156 9507.2605 7.7047419 0.0011457984 50 - 6158 9533.8383 7.5627875 0.0011457984 50 - 6160 9549.8644 7.1790181 0.0011457984 50 - 6162 9485.2333 7.0421404 0.0011457984 50 - 6164 9446.5 7.1354196 0.0011457984 50 - 6166 9515.3201 7.0663308 0.0011457984 50 - 6168 9627.0393 6.622293 0.0011457984 50 - 6170 9749.8051 5.6938844 0.0011457984 50 - 6172 9782.629 4.7167086 0.0011457984 50 - 6174 9726.303 4.1988674 0.0011457984 50 - 6176 9681.211 4.0710617 0.0011457984 50 - 6178 9652.0773 4.083136 0.0011457984 50 - 6180 9526.2991 4.0795518 0.0011457984 50 - 6182 9459.8141 3.8437065 0.0011457984 50 - 6184 9376.45 4.0452702 0.0011457984 50 - 6186 9479.2533 4.5140318 0.0011457984 50 - 6188 9643.0814 4.9451797 0.0011457984 50 - 6190 9623.6312 5.0605544 0.0011457984 50 - 6192 9519.3424 4.345871 0.0011457984 50 - 6194 9384.4864 3.3226331 0.0011457984 50 - 6196 9289.0608 2.7298129 0.0011457984 50 - 6198 9438.2363 2.3236495 0.0011457984 50 - 6200 9534.5097 2.2616915 0.0011457984 50 - 6202 9522.1612 2.2305021 0.0011457984 50 - 6204 9561.3164 2.0368725 0.0011457984 50 - 6206 9488.2213 2.5778043 0.0011457984 50 - 6208 9485.71 3.6261767 0.0011457984 50 - 6210 9544.4238 4.703255 0.0011457984 50 - 6212 9442.1106 5.5055657 0.0011457984 50 - 6214 9455.2624 5.0271672 0.0011457984 50 - 6216 9512.8447 3.7826535 0.0011457984 50 - 6218 9450.445 2.7933333 0.0011457984 50 - 6220 9541.2524 1.7850204 0.0011457984 50 - 6222 9561.4937 0.99601556 0.0011457984 50 - 6224 9504.8285 0.089294214 0.0011457984 50 - 6226 9551.2059 -1.1872491 0.0011457984 50 - 6228 9521.3868 -1.6821833 0.0011457984 50 - 6230 9465.2199 -0.96705063 0.0011457984 50 - 6232 9575.3147 0.43767353 0.0011457984 50 - 6234 9583.8318 2.233984 0.0011457984 50 - 6236 9655.3492 3.1655344 0.0011457984 50 - 6238 9697.5503 3.2691103 0.0011457984 50 - 6240 9527.8029 3.4994103 0.0011457984 50 - 6242 9396.131 3.7934199 0.0011457984 50 - 6244 9335.0447 3.9829087 0.0011457984 50 - 6246 9290.2872 3.5524291 0.0011457984 50 - 6248 9345.2633 2.0516189 0.0011457984 50 - 6250 9357.2713 0.36288783 0.0011457984 50 - 6252 9293.6481 -0.60034651 0.0011457984 50 - 6254 9314.129 -0.79094718 0.0011457984 50 - 6256 9262.6771 -0.2910575 0.0011457984 50 - 6258 9234.2281 0.014823431 0.0011457984 50 - 6260 9357.5686 -0.46680756 0.0011457984 50 - 6262 9416.3145 -1.1281866 0.0011457984 50 - 6264 9403.8035 -1.4862433 0.0011457984 50 - 6266 9367.0496 -1.320256 0.0011457984 50 - 6268 9258.5943 -0.78014425 0.0011457984 50 - 6270 9222.9527 -0.64498925 0.0011457984 50 - 6272 9332.1552 -1.2392307 0.0011457984 50 - 6274 9384.495 -1.8477753 0.0011457984 50 - 6276 9401.0798 -1.84529 0.0011457984 50 - 6278 9394.6872 -0.88277878 0.0011457984 50 - 6280 9326.9138 0.84681766 0.0011457984 50 - 6282 9346.4349 2.2235849 0.0011457984 50 - 6284 9433.7134 2.6237732 0.0011457984 50 - 6286 9367.5213 2.7639499 0.0011457984 50 - 6288 9334.7447 3.1233908 0.0011457984 50 - 6290 9414.9327 3.9228632 0.0011457984 50 - 6292 9396.7388 4.8559892 0.0011457984 50 - 6294 9419.5273 4.39179 0.0011457984 50 - 6296 9336.6624 2.5930407 0.0011457984 50 - 6298 9218.106 0.77310018 0.0011457984 50 - 6300 9338.3455 0.031319512 0.0011457984 50 - 6302 9548.1089 0.9058411 0.0011457984 50 - 6304 9584.955 2.3691874 0.0011457984 50 - 6306 9596.7481 2.5600136 0.0011457984 50 - 6308 9493.407 1.910796 0.0011457984 50 - 6310 9497.6044 1.5160645 0.0011457984 50 - 6312 9677.0697 2.1599041 0.0011457984 50 - 6314 9677.5986 3.8951444 0.0011457984 50 - 6316 9568.551 4.8522466 0.0011457984 50 - 6318 9519.3128 3.8476542 0.0011457984 50 - 6320 9477.2654 1.923282 0.0011457984 50 - 6322 9601.1273 0.39351454 0.0011457984 50 - 6324 9664.4745 0.53874451 0.0011457984 50 - 6326 9493.8865 1.8845461 0.0011457984 50 - 6328 9408.0474 2.3653529 0.0011457984 50 - 6330 9335.7617 1.8595183 0.0011457984 50 - 6332 9391.9314 1.2747265 0.0011457984 50 - 6334 9558.4684 1.8410142 0.0011457984 50 - 6336 9615.703 4.006068 0.0011457984 50 - 6338 9553.4494 6.203629 0.0011457984 50 - 6340 9539.4374 6.6962829 0.0011457984 50 - 6342 9470.5223 5.7852955 0.0011457984 50 - 6344 9485.1119 4.6403634 0.0011457984 50 - 6346 9479.4077 4.7355587 0.0011457984 50 - 6348 9447.633 5.7017265 0.0011457984 50 - 6350 9455.1225 5.798905 0.0011457984 50 - 6352 9430.8198 4.3198142 0.0011457984 50 - 6354 9448.6071 2.0772804 0.0011457984 50 - 6356 9492.6461 0.8769538 0.0011457984 50 - 6358 9549.4594 1.4447744 0.0011457984 50 - 6360 9550.1224 2.7230203 0.0011457984 50 - 6362 9509.9436 3.2113226 0.0011457984 50 - 6364 9526.394 2.4241589 0.0011457984 50 - 6366 9686.0529 1.3451679 0.0011457984 50 - 6368 9783.1581 1.5382741 0.0011457984 50 - 6370 9838.8093 2.7585361 0.0011457984 50 - 6372 9720.7706 3.8895894 0.0011457984 50 - 6374 9516.5516 3.8503907 0.0011457984 50 - 6376 9437.2155 2.8562902 0.0011457984 50 - 6378 9484.8409 2.4668168 0.0011457984 50 - 6380 9617.8774 3.2986277 0.0011457984 50 - 6382 9693.5884 4.538726 0.0011457984 50 - 6384 9582.7671 5.08112 0.0011457984 50 - 6386 9507.7158 4.3440097 0.0011457984 50 - 6388 9504.2482 3.4300535 0.0011457984 50 - 6390 9529.854 3.4743908 0.0011457984 50 - 6392 9619.924 4.1465988 0.0011457984 50 - 6394 9641.9665 4.5472982 0.0011457984 50 - 6396 9646.0139 3.6689701 0.0011457984 50 - 6398 9643.3496 1.8922098 0.0011457984 50 - 6400 9550.7224 0.78810044 0.0011457984 50 - 6402 9518.219 0.76140043 0.0011457984 50 - 6404 9480.1113 1.3310925 0.0011457984 50 - 6406 9430.6607 1.4279179 0.0011457984 50 - 6408 9528.8336 0.41719036 0.0011457984 50 - 6410 9517.5067 -0.23887578 0.0011457984 50 - 6412 9509.2189 0.2683376 0.0011457984 50 - 6414 9610.8635 1.5036072 0.0011457984 50 - 6416 9580.9492 2.7476589 0.0011457984 50 - 6418 9526.445 2.7203747 0.0011457984 50 - 6420 9491.047 1.7609024 0.0011457984 50 - 6422 9332.0354 1.6287409 0.0011457984 50 - 6424 9425.2471 2.2364284 0.0011457984 50 - 6426 9544.4397 3.1942266 0.0011457984 50 - 6428 9570.9285 3.3406159 0.0011457984 50 - 6430 9668.0361 1.8509515 0.0011457984 50 - 6432 9668.7456 0.36824782 0.0011457984 50 - 6434 9584.8751 0.33327993 0.0011457984 50 - 6436 9683.9538 1.246464 0.0011457984 50 - 6438 9588.6432 2.5209673 0.0011457984 50 - 6440 9500.4296 2.5326661 0.0011457984 50 - 6442 9544.7194 1.3443464 0.0011457984 50 - 6444 9519.127 0.86704484 0.0011457984 50 - 6446 9591.6737 1.4271621 0.0011457984 50 - 6448 9609.0228 2.4883879 0.0011457984 50 - 6450 9450.2371 2.8223434 0.0011457984 50 - 6452 9428.5145 1.2923919 0.0011457984 50 - 6454 9535.3168 -0.81269947 0.0011457984 50 - 6456 9606.6468 -1.843664 0.0011457984 50 - 6458 9780.9103 -2.0363082 0.0011457984 50 - 6460 9643.8864 -1.7412278 0.0011457984 50 - 6462 9498.9174 -2.4291832 0.0011457984 50 - 6464 9418.4471 -3.7349724 0.0011457984 50 - 6466 9376.4988 -4.0358005 0.0011457984 50 - 6468 9466.641 -2.9149438 0.0011457984 50 - 6470 9572.1969 -0.80528631 0.0011457984 50 - 6472 9500.8128 1.1712587 0.0011457984 50 - 6474 9525.13 1.6578208 0.0011457984 50 - 6476 9483.7706 1.648966 0.0011457984 50 - 6478 9426.1215 2.1430336 0.0011457984 50 - 6480 9532.4265 3.0967451 0.0011457984 50 - 6482 9586.2159 4.1597866 0.0011457984 50 - 6484 9702.8705 3.9614987 0.0011457984 50 - 6486 9812.5137 2.4781888 0.0011457984 50 - 6488 9783.0439 1.0426266 0.0011457984 50 - 6490 9786.9023 0.31640734 0.0011457984 50 - 6492 9798.5012 0.56327042 0.0011457984 50 - 6494 9725.7503 1.1843854 0.0011457984 50 - 6496 9763.3894 1.0095547 0.0011457984 50 - 6498 9754.2013 0.54200135 0.0011457984 50 - 6500 9747.7199 0.52799448 0.0011457984 50 - 6502 9825.0139 1.3472032 0.0011457984 50 - 6504 9806.6784 2.9080439 0.0011457984 50 - 6506 9739.7754 3.9790545 0.0011457984 50 - 6508 9683.515 3.8746527 0.0011457984 50 - 6510 9585.5878 3.1580565 0.0011457984 50 - 6512 9559.5437 2.6603845 0.0011457984 50 - 6514 9553.1682 3.1173833 0.0011457984 50 - 6516 9617.3126 3.8357277 0.0011457984 50 - 6518 9626.4668 3.9761292 0.0011457984 50 - 6520 9611.781 3.3021231 0.0011457984 50 - 6522 9628.0311 2.6152172 0.0011457984 50 - 6524 9591.2489 3.1468993 0.0011457984 50 - 6526 9631.1291 4.5759197 0.0011457984 50 - 6528 9694.785 5.9110989 0.0011457984 50 - 6530 9668.6226 6.4267127 0.0011457984 50 - 6532 9702.5217 5.7159704 0.0011457984 50 - 6534 9670.8943 4.9904461 0.0011457984 50 - 6536 9566.0723 5.0520415 0.0011457984 50 - 6538 9662.3465 4.9955564 0.0011457984 50 - 6540 9624.7491 4.5554432 0.0011457984 50 - 6542 9610.2655 2.935778 0.0011457984 50 - 6544 9640.991 0.78019926 0.0011457984 50 - 6546 9482.0197 -0.06082777 0.0011457984 50 - 6548 9517.953 0.049353066 0.0011457984 50 - 6550 9600.964 0.68215178 0.0011457984 50 - 6552 9502.3532 1.3797524 0.0011457984 50 - 6554 9590.7046 1.0796687 0.0011457984 50 - 6556 9562.5821 1.3001048 0.0011457984 50 - 6558 9492.4022 2.7582579 0.0011457984 50 - 6560 9685.3054 4.5270068 0.0011457984 50 - 6562 9627.4949 6.5189446 0.0011457984 50 - 6564 9545.571 7.0982162 0.0011457984 50 - 6566 9696.3483 5.9173083 0.0011457984 50 - 6568 9608.3566 5.155166 0.0011457984 50 - 6570 9798.924 4.4248249 0.0011457984 50 - 6572 9959.3866 3.9870838 0.0011457984 50 - 6574 9819.9052 3.549873 0.0011457984 50 - 6576 9834.9811 1.657563 0.0011457984 50 - 6578 9775.7119 -0.26125185 0.0011457984 50 - 6580 9566.1885 -0.83227093 0.0011457984 50 - 6582 9630.6701 -0.46258831 0.0011457984 50 - 6584 9562.4714 1.0978899 0.0011457984 50 - 6586 9567.6935 2.1431484 0.0011457984 50 - 6588 9741.3812 1.9825571 0.0011457984 50 - 6590 9601.135 2.3033609 0.0011457984 50 - 6592 9509.2215 3.0665323 0.0011457984 50 - 6594 9453.8174 4.331052 0.0011457984 50 - 6596 9355.6571 5.3819844 0.0011457984 50 - 6598 9480.7483 4.6423618 0.0011457984 50 - 6600 9561.1556 3.076253 0.0011457984 50 - 6602 9501.0943 2.0980207 0.0011457984 50 - 6604 9518.0895 2.1448739 0.0011457984 50 - 6606 9407.7483 3.3270763 0.0011457984 50 - 6608 9399.702 3.7602426 0.0011457984 50 - 6610 9418.2094 2.9607374 0.0011457984 50 - 6612 9317.8994 2.1554148 0.0011457984 50 - 6614 9404.5025 1.9811111 0.0011457984 50 - 6616 9450.3024 3.1590235 0.0011457984 50 - 6618 9430.1983 4.4687259 0.0011457984 50 - 6620 9483.1949 4.1921788 0.0011457984 50 - 6622 9360.5724 3.0184692 0.0011457984 50 - 6624 9301.5199 1.7706725 0.0011457984 50 - 6626 9358.4074 1.484283 0.0011457984 50 - 6628 9320.3863 2.3142114 0.0011457984 50 - 6630 9357.742 2.4731696 0.0011457984 50 - 6632 9289.3861 1.6933542 0.0011457984 50 - 6634 9200.1606 0.53244548 0.0011457984 50 - 6636 9285.4122 -0.21771618 0.0011457984 50 - 6638 9273.201 0.49778666 0.0011457984 50 - 6640 9277.9378 1.4890229 0.0011457984 50 - 6642 9309.8875 1.4821724 0.0011457984 50 - 6644 9212.6337 0.71477517 0.0011457984 50 - 6646 9261.9296 -0.3750363 0.0011457984 50 - 6648 9232.4584 -0.19330455 0.0011457984 50 - 6650 9138.7723 1.1930289 0.0011457984 50 - 6652 9209.3165 2.1024837 0.0011457984 50 - 6654 9210.6175 2.1006609 0.0011457984 50 - 6656 9247.419 1.0971021 0.0011457984 50 - 6658 9320.7329 0.1871267 0.0011457984 50 - 6660 9229.8721 0.61997654 0.0011457984 50 - 6662 9240.7257 1.3084329 0.0011457984 50 - 6664 9215.9737 1.4367023 0.0011457984 50 - 6666 9112.9071 0.57490944 0.0011457984 50 - 6668 9132.8078 -1.062697 0.0011457984 50 - 6670 9046.1388 -1.6518115 0.0011457984 50 - 6672 9065.662 -1.2216202 0.0011457984 50 - 6674 9211.6125 -0.71351135 0.0011457984 50 - 6676 9127.93 -0.41368587 0.0011457984 50 - 6678 9142.7655 -1.0426587 0.0011457984 50 - 6680 9132.3055 -1.1865672 0.0011457984 50 - 6682 9006.4855 0.2946137 0.0011457984 50 - 6684 9122.5655 2.1250652 0.0011457984 50 - 6686 9085.148 3.8397291 0.0011457984 50 - 6688 9012.2875 4.410528 0.0011457984 50 - 6690 9182.3707 3.690244 0.0011457984 50 - 6692 9214.2012 3.6186026 0.0011457984 50 - 6694 9300.7227 4.0300776 0.0011457984 50 - 6696 9402.6282 4.278306 0.0011457984 50 - 6698 9164.423 4.3089161 0.0011457984 50 - 6700 9120.354 2.9580788 0.0011457984 50 - 6702 9203.2662 1.3893404 0.0011457984 50 - 6704 9181.1238 1.0958729 0.0011457984 50 - 6706 9324.3846 1.485356 0.0011457984 50 - 6708 9272.2965 2.5420935 0.0011457984 50 - 6710 9136.7426 3.1878257 0.0011457984 50 - 6712 9199.9122 2.765785 0.0011457984 50 - 6714 9142.8317 2.6467469 0.0011457984 50 - 6716 9155.3753 2.8862837 0.0011457984 50 - 6718 9196.9246 3.4934651 0.0011457984 50 - 6720 9067.1701 4.3945875 0.0011457984 50 - 6722 9137.1206 4.202401 0.0011457984 50 - 6724 9232.8823 3.3789257 0.0011457984 50 - 6726 9179.6599 2.9253479 0.0011457984 50 - 6728 9247.0025 2.9044453 0.0011457984 50 - 6730 9172.3171 3.8429481 0.0011457984 50 - 6732 9098.1881 4.7163287 0.0011457984 50 - 6734 9133.5711 4.7208533 0.0011457984 50 - 6736 9049.8344 4.6670978 0.0011457984 50 - 6738 9048.7267 4.7360078 0.0011457984 50 - 6740 9119.9462 5.1393015 0.0011457984 50 - 6742 9096.1453 5.8170681 0.0011457984 50 - 6744 9148.796 5.6576858 0.0011457984 50 - 6746 9198.1038 4.6518243 0.0011457984 50 - 6748 9119.522 3.4528783 0.0011457984 50 - 6750 9163.7375 2.3742799 0.0011457984 50 - 6752 9158.9455 2.3179934 0.0011457984 50 - 6754 9200.2824 2.8007244 0.0011457984 50 - 6756 9317.021 2.996827 0.0011457984 50 - 6758 9281.32 3.0866436 0.0011457984 50 - 6760 9214.2542 3.3100198 0.0011457984 50 - 6762 9141.6297 4.2716589 0.0011457984 50 - 6764 9030.6311 6.0850048 0.0011457984 50 - 6766 8986.3202 7.7218338 0.0011457984 50 - 6768 9124.8939 8.233704 0.0011457984 50 - 6770 9181.0828 8.0567261 0.0011457984 50 - 6772 9209.2671 7.6801113 0.0011457984 50 - 6774 9122.5752 7.8305105 0.0011457984 50 - 6776 8971.9074 8.3745788 0.0011457984 50 - 6778 8961.0126 8.1704049 0.0011457984 50 - 6780 8991.452 7.0723724 0.0011457984 50 - 6782 8996.6479 5.8901461 0.0011457984 50 - 6784 9099.4595 5.2664992 0.0011457984 50 - 6786 9183.7895 5.5732067 0.0011457984 50 - 6788 9151.4641 6.1133097 0.0011457984 50 - 6790 9251.8159 5.3922335 0.0011457984 50 - 6792 9242.479 3.912959 0.0011457984 50 - 6794 9218.731 2.536709 0.0011457984 50 - 6796 9407.6498 1.6473009 0.0011457984 50 - 6798 9472.4451 1.8144248 0.0011457984 50 - 6800 9428.5911 1.9508316 0.0011457984 50 - 6802 9379.8411 1.1964955 0.0011457984 50 - 6804 9179.1839 0.5503483 0.0011457984 50 - 6806 9196.9085 0.3697523 0.0011457984 50 - 6808 9437.6308 0.9309951 0.0011457984 50 - 6810 9452.1137 2.2408358 0.0011457984 50 - 6812 9493.9746 2.5532352 0.0011457984 50 - 6814 9462.6461 1.9818521 0.0011457984 50 - 6816 9284.8303 1.6995986 0.0011457984 50 - 6818 9382.9421 1.6019612 0.0011457984 50 - 6820 9418.5061 2.1611876 0.0011457984 50 - 6822 9332.6425 2.4695103 0.0011457984 50 - 6824 9436.2739 1.289469 0.0011457984 50 - 6826 9454.9298 0.029799371 0.0011457984 50 - 6828 9467.8893 -0.40096797 0.0011457984 50 - 6830 9642.5265 -0.063364391 0.0011457984 50 - 6832 9521.2232 1.1706365 0.0011457984 50 - 6834 9485.3758 1.3674092 0.0011457984 50 - 6836 9607.1974 0.29317356 0.0011457984 50 - 6838 9576.211 -0.39980521 0.0011457984 50 - 6840 9709.349 -0.61244278 0.0011457984 50 - 6842 9790.377 -0.04841628 0.0011457984 50 - 6844 9701.5182 0.62161734 0.0011457984 50 - 6846 9782.8363 -0.038225843 0.0011457984 50 - 6848 9699.3989 -0.77828635 0.0011457984 50 - 6850 9472.2321 -0.54977139 0.0011457984 50 - 6852 9544.5917 0.29157291 0.0011457984 50 - 6854 9523.2331 1.9625881 0.0011457984 50 - 6856 9556.5287 2.9066281 0.0011457984 50 - 6858 9758.0217 2.455707 0.0011457984 50 - 6860 9720.5151 2.3155597 0.0011457984 50 - 6862 9718.898 2.8466423 0.0011457984 50 - 6864 9809.3996 3.8603313 0.0011457984 50 - 6866 9766.1581 4.6784565 0.0011457984 50 - 6868 9783.6949 3.9207863 0.0011457984 50 - 6870 9745.4637 2.4425731 0.0011457984 50 - 6872 9616.3958 1.8059494 0.0011457984 50 - 6874 9676.5806 2.2676016 0.0011457984 50 - 6876 9754.9546 3.5887651 0.0011457984 50 - 6878 9809.9564 4.4083 0.0011457984 50 - 6880 9934.5346 3.901907 0.0011457984 50 - 6882 9924.503 3.1667118 0.0011457984 50 - 6884 9892.5187 3.0940516 0.0011457984 50 - 6886 9885.7093 3.9258883 0.0011457984 50 - 6888 9857.212 4.8890991 0.0011457984 50 - 6890 9890.7579 4.7763457 0.0011457984 50 - 6892 9933.0785 3.8000778 0.0011457984 50 - 6894 9900.619 3.1976105 0.0011457984 50 - 6896 9858.432 3.7924904 0.0011457984 50 - 6898 9847.2897 5.4122494 0.0011457984 50 - 6900 9858.8995 6.969799 0.0011457984 50 - 6902 9931.5971 7.3803058 0.0011457984 50 - 6904 9917.5095 6.8833714 0.0011457984 50 - 6906 9772.3484 6.6003831 0.0011457984 50 - 6908 9615.9521 7.250668 0.0011457984 50 - 6910 9595.5589 8.2944889 0.0011457984 50 - 6912 9669.3373 8.5743927 0.0011457984 50 - 6914 9803.7043 7.2428001 0.0011457984 50 - 6916 9856.3221 5.0942255 0.0011457984 50 - 6918 9770.5344 3.8340889 0.0011457984 50 - 6920 9737.3237 3.9319718 0.0011457984 50 - 6922 9813.5645 4.5151651 0.0011457984 50 - 6924 9839.2713 4.4669171 0.0011457984 50 - 6926 9880.5785 3.1456377 0.0011457984 50 - 6928 9867.8611 1.8093077 0.0011457984 50 - 6930 9854.0491 1.8572101 0.0011457984 50 - 6932 9950.8028 3.2248345 0.0011457984 50 - 6934 10007.469 4.8800184 0.0011457984 50 - 6936 10060.405 5.2125272 0.0011457984 50 - 6938 10139.72 4.0751831 0.0011457984 50 - 6940 10103.556 3.2651112 0.0011457984 50 - 6942 10035.304 3.8806931 0.0011457984 50 - 6944 9941.4949 5.6889739 0.0011457984 50 - 6946 9748.653 7.4386549 0.0011457984 50 - 6948 9747.8782 7.5434348 0.0011457984 50 - 6950 9782.2201 6.8376514 0.0011457984 50 - 6952 9784.6755 6.7479056 0.0011457984 50 - 6954 9832.154 7.6631317 0.0011457984 50 - 6956 9744.0013 9.2453763 0.0011457984 50 - 6958 9700.4866 9.696079 0.0011457984 50 - 6960 9872.7564 8.0501877 0.0011457984 50 - 6962 9925.1225 5.8075771 0.0011457984 50 - 6964 9910.4396 4.256995 0.0011457984 50 - 6966 9830.7971 4.1976973 0.0011457984 50 - 6968 9659.6425 5.143125 0.0011457984 50 - 6970 9674.6794 5.2410296 0.0011457984 50 - 6972 9748.0172 4.3825217 0.0011457984 50 - 6974 9790.2541 3.6671921 0.0011457984 50 - 6976 9939.1812 3.9423 0.0011457984 50 - 6978 9932.8511 5.8172683 0.0011457984 50 - 6980 9884.9175 7.6922373 0.0011457984 50 - 6982 9895.2403 7.9709608 0.0011457984 50 - 6984 9762.5286 7.072368 0.0011457984 50 - 6986 9755.1631 5.5979588 0.0011457984 50 - 6988 9762.0504 4.9498373 0.0011457984 50 - 6990 9659.8034 5.3966357 0.0011457984 50 - 6992 9716.6387 5.2844339 0.0011457984 50 - 6994 9735.9467 4.2759314 0.0011457984 50 - 6996 9743.0525 2.7961936 0.0011457984 50 - 6998 9896.086 1.692222 0.0011457984 50 - 7000 9905.1475 2.2252591 0.0011457984 50 - 7002 9851.4447 3.4057239 0.0011457984 50 - 7004 9862.627 3.6016316 0.0011457984 50 - 7006 9759.465 2.6279267 0.0011457984 50 - 7008 9823.8161 0.71673442 0.0011457984 50 - 7010 9836.6571 -0.38918008 0.0011457984 50 - 7012 9742.651 -0.14535188 0.0011457984 50 - 7014 9750.9131 0.038451941 0.0011457984 50 - 7016 9720.239 -0.6333034 0.0011457984 50 - 7018 9752.3057 -2.3504903 0.0011457984 50 - 7020 9862.6501 -3.9143079 0.0011457984 50 - 7022 9836.8609 -3.6920412 0.0011457984 50 - 7024 9859.9236 -2.366967 0.0011457984 50 - 7026 9886.1452 -1.2972528 0.0011457984 50 - 7028 9759.0504 -1.1164197 0.0011457984 50 - 7030 9726.7701 -1.5244622 0.0011457984 50 - 7032 9705.1252 -0.74104909 0.0011457984 50 - 7034 9751.6131 1.5160451 0.0011457984 50 - 7036 9901.517 3.5859683 0.0011457984 50 - 7038 9920.4779 4.1768844 0.0011457984 50 - 7040 9781.1918 3.3255486 0.0011457984 50 - 7042 9672.4876 2.3834462 0.0011457984 50 - 7044 9549.8157 2.8398027 0.0011457984 50 - 7046 9523.3642 3.9150077 0.0011457984 50 - 7048 9563.0761 3.8366633 0.0011457984 50 - 7050 9517.2689 1.9767778 0.0011457984 50 - 7052 9466.1265 -0.60668872 0.0011457984 50 - 7054 9460.0101 -1.9274155 0.0011457984 50 - 7056 9478.2953 -1.2685099 0.0011457984 50 - 7058 9471.3773 -0.1073304 0.0011457984 50 - 7060 9492.9054 -0.4455594 0.0011457984 50 - 7062 9498.2241 -1.9624484 0.0011457984 50 - 7064 9551.7972 -2.5884117 0.0011457984 50 - 7066 9696.0907 -0.88024432 0.0011457984 50 - 7068 9764.5702 2.5222199 0.0011457984 50 - 7070 9740.9518 5.1339921 0.0011457984 50 - 7072 9737.3787 5.4068726 0.0011457984 50 - 7074 9630.342 4.8497948 0.0011457984 50 - 7076 9555.1194 5.3711742 0.0011457984 50 - 7078 9622.6202 7.177986 0.0011457984 50 - 7080 9578.9797 8.7394766 0.0011457984 50 - 7082 9589.5453 7.4358952 0.0011457984 50 - 7084 9672.4561 3.480566 0.0011457984 50 - 7086 9649.2968 -0.063116868 0.0011457984 50 - 7088 9645.6554 -1.3282696 0.0011457984 50 - 7090 9590.6878 -0.6524447 0.0011457984 50 - 7092 9435.5727 -0.15463847 0.0011457984 50 - 7094 9536.661 -1.8138538 0.0011457984 50 - 7096 9662.5782 -3.8494254 0.0011457984 50 - 7098 9698.9293 -3.5611364 0.0011457984 50 - 7100 9824.9231 -0.68219554 0.0011457984 50 - 7102 9784.4341 3.2622803 0.0011457984 50 - 7104 9641.4705 5.2965189 0.0011457984 50 - 7106 9683.4242 4.2100647 0.0011457984 50 - 7108 9635.9176 2.7227711 0.0011457984 50 - 7110 9657.8311 2.7728803 0.0011457984 50 - 7112 9740.3662 4.0686243 0.0011457984 50 - 7114 9610.9517 4.7455425 0.0011457984 50 - 7116 9527.4004 2.6998747 0.0011457984 50 - 7118 9488.9733 -0.60609595 0.0011457984 50 - 7120 9392.2499 -2.0143086 0.0011457984 50 - 7122 9383.3778 -0.65989418 0.0011457984 50 - 7124 9391.6481 2.0243673 0.0011457984 50 - 7126 9301.0051 3.8002685 0.0011457984 50 - 7128 9283.5382 3.7322338 0.0011457984 50 - 7130 9259.5284 3.6918727 0.0011457984 50 - 7132 9290.232 5.4416545 0.0011457984 50 - 7134 9307.6079 8.7353407 0.0011457984 50 - 7136 9320.6695 11.21586 0.0011457984 50 - 7138 9277.4608 11.165481 0.0011457984 50 - 7140 9254.2507 9.1967545 0.0011457984 50 - 7142 9298.9163 7.5227226 0.0011457984 50 - 7144 9279.7586 7.6700277 0.0011457984 50 - 7146 9216.6621 8.5381081 0.0011457984 50 - 7148 9213.4492 7.9484644 0.0011457984 50 - 7150 9221.8823 5.687558 0.0011457984 50 - 7152 9299.416 3.3114392 0.0011457984 50 - 7154 9431.6379 2.7331472 0.0011457984 50 - 7156 9418.2556 4.4086777 0.0011457984 50 - 7158 9467.3486 6.1375197 0.0011457984 50 - 7160 9497.8155 6.5764777 0.0011457984 50 - 7162 9439.7388 6.2689593 0.0011457984 50 - 7164 9445.8327 6.4266445 0.0011457984 50 - 7166 9332.322 8.4143992 0.0011457984 50 - 7168 9208.61 11.190738 0.0011457984 50 - 7170 9310.3149 12.420728 0.0011457984 50 - 7172 9351.2523 11.901528 0.0011457984 50 - 7174 9405.8964 10.335017 0.0011457984 50 - 7176 9542.4233 9.0515937 0.0011457984 50 - 7178 9474.2086 9.1449707 0.0011457984 50 - 7180 9485.7437 8.9387276 0.0011457984 50 - 7182 9550.4526 7.2951759 0.0011457984 50 - 7184 9420.8638 4.9885282 0.0011457984 50 - 7186 9440.5158 2.7685394 0.0011457984 50 - 7188 9461.3134 2.172931 0.0011457984 50 - 7190 9386.5315 3.1073231 0.0011457984 50 - 7192 9490.8781 3.7126116 0.0011457984 50 - 7194 9508.4209 3.8076901 0.0011457984 50 - 7196 9510.5281 3.4926701 0.0011457984 50 - 7198 9660.8341 3.2696957 0.0011457984 50 - 7200 9601.535 4.19073 0.0011457984 50 - 7202 9474.8425 5.2454886 0.0011457984 50 - 7204 9327.4634 5.5992572 0.0011457984 50 - 7206 9149.472 5.1619656 0.0011457984 50 - 7208 9192.9823 3.8581082 0.0011457984 50 - 7210 9255.2434 2.9255786 0.0011457984 50 - 7212 9227.6962 2.8923463 0.0011457984 50 - 7214 9255.8081 3.1432165 0.0011457984 50 - 7216 9192.628 3.4461202 0.0011457984 50 - 7218 9183.761 3.0555117 0.0011457984 50 - 7220 9247.867 2.1542773 0.0011457984 50 - 7222 9159.1068 1.8716263 0.0011457984 50 - 7224 9131.2203 2.2986379 0.0011457984 50 - 7226 9138.3216 3.4431762 0.0011457984 50 - 7228 9204.0436 4.3584618 0.0011457984 50 - 7230 9345.4984 3.962756 0.0011457984 50 - 7232 9315.6285 2.9387608 0.0011457984 50 - 7234 9192.7706 2.2882283 0.0011457984 50 - 7236 9152.6147 2.6605417 0.0011457984 50 - 7238 9097.0063 3.8442839 0.0011457984 50 - 7240 9208.8249 3.9743241 0.0011457984 50 - 7242 9369.5115 2.5468362 0.0011457984 50 - 7244 9395.1587 0.88524305 0.0011457984 50 - 7246 9395.8607 0.35110541 0.0011457984 50 - 7248 9306.3464 1.7019311 0.0011457984 50 - 7250 9141.1472 3.7093716 0.0011457984 50 - 7252 9150.9055 4.1170519 0.0011457984 50 - 7254 9225.0194 2.9947207 0.0011457984 50 - 7256 9301.5287 2.1560628 0.0011457984 50 - 7258 9420.2229 3.1245648 0.0011457984 50 - 7260 9426.5146 5.6813569 0.0011457984 50 - 7262 9314.5724 7.4774615 0.0011457984 50 - 7264 9320.0147 6.6025106 0.0011457984 50 - 7266 9307.2822 4.47175 0.0011457984 50 - 7268 9301.3998 3.5107791 0.0011457984 50 - 7270 9299.5661 4.7564319 0.0011457984 50 - 7272 9270.5218 6.7098349 0.0011457984 50 - 7274 9286.529 6.7969039 0.0011457984 50 - 7276 9410.861 4.4584762 0.0011457984 50 - 7278 9489.27 2.0011075 0.0011457984 50 - 7280 9502.3333 1.684916 0.0011457984 50 - 7282 9474.0127 3.3735745 0.0011457984 50 - 7284 9403.8255 4.638689 0.0011457984 50 - 7286 9451.1342 3.1353356 0.0011457984 50 - 7288 9480.7679 0.0066918041 0.0011457984 50 - 7290 9463.4491 -1.6395987 0.0011457984 50 - 7292 9419.4177 -0.14904997 0.0011457984 50 - 7294 9414.538 2.7399776 0.0011457984 50 - 7296 9374.7493 3.9802283 0.0011457984 50 - 7298 9364.8023 2.4941183 0.0011457984 50 - 7300 9294.6429 0.71789311 0.0011457984 50 - 7302 9298.9619 1.2068361 0.0011457984 50 - 7304 9368.068 4.0095033 0.0011457984 50 - 7306 9417.2777 6.464639 0.0011457984 50 - 7308 9408.8339 6.0709905 0.0011457984 50 - 7310 9322.6281 3.5474429 0.0011457984 50 - 7312 9281.8769 1.7436637 0.0011457984 50 - 7314 9342.533 2.3990706 0.0011457984 50 - 7316 9350.4835 4.3914393 0.0011457984 50 - 7318 9316.4467 4.6659937 0.0011457984 50 - 7320 9292.7393 2.2441799 0.0011457984 50 - 7322 9216.9193 -0.47391034 0.0011457984 50 - 7324 9315.4332 -1.1163484 0.0011457984 50 - 7326 9398.8563 0.96915884 0.0011457984 50 - 7328 9359.4189 3.434131 0.0011457984 50 - 7330 9395.2118 3.4898625 0.0011457984 50 - 7332 9387.826 1.9443663 0.0011457984 50 - 7334 9410.6837 1.2459609 0.0011457984 50 - 7336 9519.947 2.8322466 0.0011457984 50 - 7338 9484.9172 5.862886 0.0011457984 50 - 7340 9438.6075 7.2800714 0.0011457984 50 - 7342 9490.2695 5.9500588 0.0011457984 50 - 7344 9449.4263 4.0293974 0.0011457984 50 - 7346 9507.654 3.4314554 0.0011457984 50 - 7348 9496.6221 4.8283128 0.0011457984 50 - 7350 9392.7485 6.3025924 0.0011457984 50 - 7352 9441.276 5.3974276 0.0011457984 50 - 7354 9454.6318 2.9690653 0.0011457984 50 - 7356 9443.7475 1.3178664 0.0011457984 50 - 7358 9525.6456 1.7279697 0.0011457984 50 - 7360 9504.7476 3.5492429 0.0011457984 50 - 7362 9492.9302 4.143493 0.0011457984 50 - 7364 9550.7726 2.5616525 0.0011457984 50 - 7366 9526.2485 0.67866327 0.0011457984 50 - 7368 9591.2953 0.18365962 0.0011457984 50 - 7370 9664.2119 1.579754 0.0011457984 50 - 7372 9611.3609 3.4869243 0.0011457984 50 - 7374 9610.5069 3.8985181 0.0011457984 50 - 7376 9561.1861 3.3114327 0.0011457984 50 - 7378 9532.4005 3.1389618 0.0011457984 50 - 7380 9651.5365 3.9428553 0.0011457984 50 - 7382 9676.2487 5.3749563 0.0011457984 50 - 7384 9589.5116 5.8921794 0.0011457984 50 - 7386 9557.6205 4.8741386 0.0011457984 50 - 7388 9511.8686 3.7537842 0.0011457984 50 - 7390 9548.7795 3.5544484 0.0011457984 50 - 7392 9653.8805 4.2198724 0.0011457984 50 - 7394 9632.8838 5.002441 0.0011457984 50 - 7396 9719.2027 4.6499711 0.0011457984 50 - 7398 9831.2644 3.6627656 0.0011457984 50 - 7400 9883.4385 3.0827174 0.0011457984 50 - 7402 9881.9691 3.0999039 0.0011457984 50 - 7404 9749.996 3.3574858 0.0011457984 50 - 7406 9582.7862 2.9633399 0.0011457984 50 - 7408 9635.2751 1.4413803 0.0011457984 50 - 7410 9715.5639 -0.075919588 0.0011457984 50 - 7412 9757.9215 -0.83885311 0.0011457984 50 - 7414 9769.002 -0.87797105 0.0011457984 50 - 7416 9599.278 -0.33909427 0.0011457984 50 - 7418 9441.7848 0.17134883 0.0011457984 50 - 7420 9426.1066 0.68125899 0.0011457984 50 - 7422 9437.1351 1.7674849 0.0011457984 50 - 7424 9500.6425 3.2878942 0.0011457984 50 - 7426 9535.3806 4.8936619 0.0011457984 50 - 7428 9486.3862 6.1923477 0.0011457984 50 - 7430 9417.2089 6.8698959 0.0011457984 50 - 7432 9384.6502 6.9749972 0.0011457984 50 - 7434 9322.1322 6.8304123 0.0011457984 50 - 7436 9406.35 6.1073481 0.0011457984 50 - 7438 9525.9922 4.9898311 0.0011457984 50 - 7440 9559.5792 3.8870015 0.0011457984 50 - 7442 9623.884 2.7643718 0.0011457984 50 - 7444 9616.4375 1.8529093 0.0011457984 50 - 7446 9582.8656 0.9840396 0.0011457984 50 - 7448 9617.097 -0.024633469 0.0011457984 50 - 7450 9573.3835 -0.44123727 0.0011457984 50 - 7452 9476.2635 0.11013702 0.0011457984 50 - 7454 9473.8768 1.2820056 0.0011457984 50 - 7456 9459.0484 2.71048 0.0011457984 50 - 7458 9532.4938 3.5106692 0.0011457984 50 - 7460 9624.925 3.697208 0.0011457984 50 - 7462 9564.9509 4.2072021 0.0011457984 50 - 7464 9553.3086 5.0527198 0.0011457984 50 - 7466 9551.3619 5.8525434 0.0011457984 50 - 7468 9513.6267 5.6650826 0.0011457984 50 - 7470 9507.7846 3.8869282 0.0011457984 50 - 7472 9398.0642 1.8918919 0.0011457984 50 - 7474 9341.8749 0.97413899 0.0011457984 50 - 7476 9376.9782 1.4510035 0.0011457984 50 - 7478 9392.1499 2.3484419 0.0011457984 50 - 7480 9451.8765 2.1914005 0.0011457984 50 - 7482 9511.2196 1.2607779 0.0011457984 50 - 7484 9563.6374 0.88635346 0.0011457984 50 - 7486 9620.0349 1.7459739 0.0011457984 50 - 7488 9604.3505 3.2525131 0.0011457984 50 - 7490 9590.9346 3.7425664 0.0011457984 50 - 7492 9522.3988 2.8032866 0.0011457984 50 - 7494 9494.9559 1.4256268 0.0011457984 50 - 7496 9573.1982 1.0053352 0.0011457984 50 - 7498 9601.5697 1.9606036 0.0011457984 50 - 7500 9582.0828 2.6275963 0.0011457984 50 - 7502 9614.3819 1.5728655 0.0011457984 50 - 7504 9536.3627 -0.081088967 0.0011457984 50 - 7506 9585.9946 -0.92030032 0.0011457984 50 - 7508 9587.2868 0.28323303 0.0011457984 50 - 7510 9528.9131 2.5152283 0.0011457984 50 - 7512 9643.5854 3.4660557 0.0011457984 50 - 7514 9689.8607 3.2065806 0.0011457984 50 - 7516 9721.3389 2.9803491 0.0011457984 50 - 7518 9777.5554 4.1047011 0.0011457984 50 - 7520 9620.0088 6.8774095 0.0011457984 50 - 7522 9502.8216 8.9090657 0.0011457984 50 - 7524 9536.3096 8.5715993 0.0011457984 50 - 7526 9430.0745 7.0672411 0.0011457984 50 - 7528 9450.4065 5.7492142 0.0011457984 50 - 7530 9454.0207 5.7231316 0.0011457984 50 - 7532 9419.0919 5.8071811 0.0011457984 50 - 7534 9539.5751 3.8208512 0.0011457984 50 - 7536 9545.0205 0.35397896 0.0011457984 50 - 7538 9472.4819 -2.7954424 0.0011457984 50 - 7540 9417.4001 -3.9611563 0.0011457984 50 - 7542 9262.3557 -2.8579227 0.0011457984 50 - 7544 9297.3341 -1.755726 0.0011457984 50 - 7546 9427.1736 -1.6469164 0.0011457984 50 - 7548 9430.5916 -1.5166592 0.0011457984 50 - 7550 9478.5136 -0.34981721 0.0011457984 50 - 7552 9473.1761 2.6548766 0.0011457984 50 - 7554 9341.2932 6.2584298 0.0011457984 50 - 7556 9410.2365 7.8239294 0.0011457984 50 - 7558 9381.6052 7.5311417 0.0011457984 50 - 7560 9437.1569 6.3664849 0.0011457984 50 - 7562 9542.198 5.6669502 0.0011457984 50 - 7564 9477.5663 5.7225117 0.0011457984 50 - 7566 9485.1494 4.6941954 0.0011457984 50 - 7568 9535.1098 2.2509721 0.0011457984 50 - 7570 9507.2274 -0.32454484 0.0011457984 50 - 7572 9636.0736 -2.3180481 0.0011457984 50 - 7574 9658.1354 -2.7226114 0.0011457984 50 - 7576 9495.6354 -1.930176 0.0011457984 50 - 7578 9587.4497 -1.6178495 0.0011457984 50 - 7580 9622.3903 -1.3399174 0.0011457984 50 - 7582 9704.3184 -0.92434441 0.0011457984 50 - 7584 9926.6399 -0.15472678 0.0011457984 50 - 7586 9892.8863 1.6692809 0.0011457984 50 - 7588 9863.4979 3.1137697 0.0011457984 50 - 7590 9906.4139 3.4536603 0.0011457984 50 - 7592 9769.0965 3.4593296 0.0011457984 50 - 7594 9743.17 3.0424924 0.0011457984 50 - 7596 9719.9591 2.8191167 0.0011457984 50 - 7598 9558.0651 3.0322152 0.0011457984 50 - 7600 9645.6938 2.6112039 0.0011457984 50 - 7602 9714.0215 2.185614 0.0011457984 50 - 7604 9605.7654 2.3876785 0.0011457984 50 - 7606 9693.6003 2.6081601 0.0011457984 50 - 7608 9629.2089 3.4337647 0.0011457984 50 - 7610 9551.3938 4.3618115 0.0011457984 50 - 7612 9601.7189 5.042988 0.0011457984 50 - 7614 9530.2921 6.231394 0.0011457984 50 - 7616 9423.4273 7.5166546 0.0011457984 50 - 7618 9505.4428 8.0291626 0.0011457984 50 - 7620 9429.315 8.1655715 0.0011457984 50 - 7622 9410.5734 7.5124718 0.0011457984 50 - 7624 9483.015 6.434736 0.0011457984 50 - 7626 9417.367 5.8180565 0.0011457984 50 - 7628 9504.2707 4.8808406 0.0011457984 50 - 7630 9708.7689 3.1972208 0.0011457984 50 - 7632 9705.0142 1.4578035 0.0011457984 50 - 7634 9712.5013 0.041948151 0.0011457984 50 - 7636 9729.5345 -0.061359152 0.0011457984 50 - 7638 9603.3866 1.3424057 0.0011457984 50 - 7640 9659.7375 2.5412485 0.0011457984 50 - 7642 9653.7578 3.3597609 0.0011457984 50 - 7644 9526.3277 4.5019132 0.0011457984 50 - 7646 9522.1426 6.4723916 0.0011457984 50 - 7648 9551.1617 9.4539084 0.0011457984 50 - 7650 9448.6486 12.17887 0.0011457984 50 - 7652 9441.6445 12.73528 0.0011457984 50 - 7654 9372.3016 11.623139 0.0011457984 50 - 7656 9353.7281 10.159189 0.0011457984 50 - 7658 9533.6437 9.1148105 0.0011457984 50 - 7660 9720.4729 8.2979611 0.0011457984 50 - 7662 9687.7535 6.5903069 0.0011457984 50 - 7664 9679.7651 3.1582718 0.0011457984 50 - 7666 9506.8095 -0.16657303 0.0011457984 50 - 7668 9432.2748 -1.9647403 0.0011457984 50 - 7670 9562.3452 -2.0511502 0.0011457984 50 - 7672 9603.1776 -1.1215214 0.0011457984 50 - 7674 9614.5799 -0.73355736 0.0011457984 50 - 7676 9717.1466 -0.97171895 0.0011457984 50 - 7678 9660.4746 -0.065105035 0.0011457984 50 - 7680 9652.4727 2.1105705 0.0011457984 50 - 7682 9632.6572 4.7124033 0.0011457984 50 - 7684 9459.4445 6.5506091 0.0011457984 50 - 7686 9459.2384 6.5399378 0.0011457984 50 - 7688 9527.0273 5.8950819 0.0011457984 50 - 7690 9552.6913 5.8727872 0.0011457984 50 - 7692 9594.6979 6.1402731 0.0011457984 50 - 7694 9507.6571 6.0382366 0.0011457984 50 - 7696 9435.6211 4.6987185 0.0011457984 50 - 7698 9593.5298 2.4864572 0.0011457984 50 - 7700 9649.3417 1.3774067 0.0011457984 50 - 7702 9733.9587 1.3621968 0.0011457984 50 - 7704 9748.2134 1.6826187 0.0011457984 50 - 7706 9607.2673 1.730675 0.0011457984 50 - 7708 9570.3284 1.056172 0.0011457984 50 - 7710 9623.4646 0.68062243 0.0011457984 50 - 7712 9584.1504 1.5492829 0.0011457984 50 - 7714 9727.4828 2.3647176 0.0011457984 50 - 7716 9768.0882 2.5188312 0.0011457984 50 - 7718 9675.8436 1.915033 0.0011457984 50 - 7720 9742.4159 0.98004134 0.0011457984 50 - 7722 9729.339 1.348188 0.0011457984 50 - 7724 9737.0089 2.3572792 0.0011457984 50 - 7726 9867.0438 2.3334077 0.0011457984 50 - 7728 9685.1497 1.779699 0.0011457984 50 - 7730 9541.5463 1.0959201 0.0011457984 50 - 7732 9601.3202 1.360164 0.0011457984 50 - 7734 9511.1979 3.3763173 0.0011457984 50 - 7736 9691.0676 4.6273168 0.0011457984 50 - 7738 9841.6024 4.2729278 0.0011457984 50 - 7740 9648.3216 3.3438312 0.0011457984 50 - 7742 9644.2115 2.2183629 0.0011457984 50 - 7744 9588.828 2.5300306 0.0011457984 50 - 7746 9341.8422 3.7987816 0.0011457984 50 - 7748 9547.0139 3.0814107 0.0011457984 50 - 7750 9527.4193 1.3593932 0.0011457984 50 - 7752 9489.3054 -0.4087885 0.0011457984 50 - 7754 9740.3405 -1.2673367 0.0011457984 50 - 7756 9721.0147 0.00428777 0.0011457984 50 - 7758 9702.5241 0.82419258 0.0011457984 50 - 7760 9859.071 -0.6228219 0.0011457984 50 - 7762 9650.9663 -2.3957203 0.0011457984 50 - 7764 9706.9729 -3.6785526 0.0011457984 50 - 7766 9818.8903 -2.8392329 0.0011457984 50 - 7768 9663.4435 -0.34323863 0.0011457984 50 - 7770 9803.2456 0.38943494 0.0011457984 50 - 7772 9820.2274 -0.39394936 0.0011457984 50 - 7774 9713.4768 -1.0733572 0.0011457984 50 - 7776 9852.736 -0.42363135 0.0011457984 50 - 7778 9886.2509 2.3769023 0.0011457984 50 - 7780 9832.7358 4.9166992 0.0011457984 50 - 7782 9932.8973 4.712252 0.0011457984 50 - 7784 9796.5384 3.1448764 0.0011457984 50 - 7786 9753.7015 1.9309203 0.0011457984 50 - 7788 9839.8416 2.3899169 0.0011457984 50 - 7790 9872.1501 3.7655463 0.0011457984 50 - 7792 9953.7516 3.4859888 0.0011457984 50 - 7794 10034.369 1.1698958 0.0011457984 50 - 7796 9944.3003 -0.92549906 0.0011457984 50 - 7798 9965.518 -1.1278296 0.0011457984 50 - 7800 10012.5 0.80938361 0.0011457984 50 - 7802 10034.925 2.8840295 0.0011457984 50 - 7804 10097.202 3.1108041 0.0011457984 50 - 7806 10109.566 2.2692514 0.0011457984 50 - 7808 10070.186 2.6683711 0.0011457984 50 - 7810 10086.066 5.1330175 0.0011457984 50 - 7812 10101.889 8.1779122 0.0011457984 50 - 7814 9955.2551 9.6584018 0.0011457984 50 - 7816 9924.9784 8.6108988 0.0011457984 50 - 7818 9892.9233 7.3026856 0.0011457984 50 - 7820 9940.0085 7.6562588 0.0011457984 50 - 7822 10043.889 9.2169653 0.0011457984 50 - 7824 10040.433 10.071061 0.0011457984 50 - 7826 9888.6625 8.8793367 0.0011457984 50 - 7828 9843.2339 6.2958302 0.0011457984 50 - 7830 9769.9935 4.9813275 0.0011457984 50 - 7832 9817.1369 5.5036474 0.0011457984 50 - 7834 9908.1863 6.5022137 0.0011457984 50 - 7836 9836.952 6.5533027 0.0011457984 50 - 7838 9823.5066 5.1861522 0.0011457984 50 - 7840 9842.244 4.290555 0.0011457984 50 - 7842 9807.8307 5.4702915 0.0011457984 50 - 7844 9866.4119 7.5011118 0.0011457984 50 - 7846 9948.1838 8.4741237 0.0011457984 50 - 7848 9929.854 7.7316361 0.0011457984 50 - 7850 10067.409 5.8569645 0.0011457984 50 - 7852 10032.145 5.2165212 0.0011457984 50 - 7854 9899.4962 6.0924898 0.0011457984 50 - 7856 9921.7169 6.719158 0.0011457984 50 - 7858 9916.003 6.389409 0.0011457984 50 - 7860 9870.0171 5.3824146 0.0011457984 50 - 7862 9982.1614 4.6911758 0.0011457984 50 - 7864 9885.8857 5.9014244 0.0011457984 50 - 7866 9833.4896 7.7602131 0.0011457984 50 - 7868 9945.8481 8.582649 0.0011457984 50 - 7870 9940.9251 8.4512902 0.0011457984 50 - 7872 9955.2114 7.7609086 0.0011457984 50 - 7874 9947.7609 7.5875024 0.0011457984 50 - 7876 9824.999 8.1626806 0.0011457984 50 - 7878 9821.2327 8.0188501 0.0011457984 50 - 7880 9842.1396 6.8799344 0.0011457984 50 - 7882 9763.4974 5.6291783 0.0011457984 50 - 7884 9830.8014 4.8298768 0.0011457984 50 - 7886 9864.651 5.1057619 0.0011457984 50 - 7888 9897.6271 5.4523732 0.0011457984 50 - 7890 9969.4632 4.8645946 0.0011457984 50 - 7892 9905.2637 4.0683578 0.0011457984 50 - 7894 9867.218 3.7625675 0.0011457984 50 - 7896 9964.8143 4.1222515 0.0011457984 50 - 7898 9970.8383 4.8135178 0.0011457984 50 - 7900 9960.2843 4.6528207 0.0011457984 50 - 7902 9929.1614 4.0045485 0.0011457984 50 - 7904 9732.7455 4.4197682 0.0011457984 50 - 7906 9784.6307 5.46138 0.0011457984 50 - 7908 9902.0578 6.4536086 0.0011457984 50 - 7910 9835.8696 6.5806316 0.0011457984 50 - 7912 9816.4882 5.2605278 0.0011457984 50 - 7914 9678.3646 4.2597874 0.0011457984 50 - 7916 9495.2316 4.5265141 0.0011457984 50 - 7918 9625.0995 4.6607196 0.0011457984 50 - 7920 9667.4185 3.9419695 0.0011457984 50 - 7922 9602.5767 1.8452379 0.0011457984 50 - 7924 9714.4671 -0.78549348 0.0011457984 50 - 7926 9600.4719 -1.3021957 0.0011457984 50 - 7928 9595.5944 -0.40978783 0.0011457984 50 - 7930 9671.4849 0.18383962 0.0011457984 50 - 7932 9427.9403 0.13097094 0.0011457984 50 - 7934 9336.0891 -0.75045689 0.0011457984 50 - 7936 9377.7418 -0.37773788 0.0011457984 50 - 7938 9313.8567 2.3838933 0.0011457984 50 - 7940 9563.9378 4.7263846 0.0011457984 50 - 7942 9725.0125 5.1314861 0.0011457984 50 - 7944 9526.2488 3.8387064 0.0011457984 50 - 7946 9567.6993 1.6692464 0.0011457984 50 - 7948 9454.276 1.4617733 0.0011457984 50 - 7950 9353.5637 2.4804377 0.0011457984 50 - 7952 9601.2572 1.7746058 0.0011457984 50 - 7954 9621.3707 -0.54877445 0.0011457984 50 - 7956 9545.5258 -3.3532832 0.0011457984 50 - 7958 9635.7985 -4.5615531 0.0011457984 50 - 7960 9426.8802 -2.4111311 0.0011457984 50 - 7962 9415.5196 0.10777037 0.0011457984 50 - 7964 9525.2541 0.98550692 0.0011457984 50 - 7966 9409.782 1.0022769 0.0011457984 50 - 7968 9501.2728 1.0925635 0.0011457984 50 - 7970 9566.9142 2.9916085 0.0011457984 50 - 7972 9434.188 5.8343619 0.0011457984 50 - 7974 9543.452 6.3023867 0.0011457984 50 - 7976 9515.7435 4.393159 0.0011457984 50 - 7978 9397.8265 1.67238 0.0011457984 50 - 7980 9518.8853 -0.26214002 0.0011457984 50 - 7982 9464.9738 -0.20322159 0.0011457984 50 - 7984 9411.3658 -0.34294737 0.0011457984 50 - 7986 9480.5763 -2.2898799 0.0011457984 50 - 7988 9346.0022 -4.3015335 0.0011457984 50 - 7990 9323.7758 -4.7818874 0.0011457984 50 - 7992 9447.4591 -2.8155787 0.0011457984 50 - 7994 9370.0301 0.86042184 0.0011457984 50 - 7996 9414.3206 3.209964 0.0011457984 50 - 7998 9443.2413 3.7897264 0.0011457984 50 - 8000 9337.5805 4.2404387 0.0011457984 50 -Loop time of 107.636 on 8 procs for 8000 steps with 848 atoms - -Performance: 6.422 ns/day, 3.737 hours/ns, 74.325 timesteps/s -93.6% CPU use with 8 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0071581 | 0.99286 | 4.3913 | 151.9 | 0.92 -Bond | 0.023263 | 2.2103 | 10.081 | 229.9 | 2.05 -Kspace | 28.814 | 39.764 | 42.853 | 76.0 | 36.94 -Neigh | 6.4084 | 6.4395 | 6.4689 | 1.0 | 5.98 -Comm | 0.19227 | 0.25072 | 0.36267 | 12.4 | 0.23 -Output | 56.437 | 56.509 | 56.849 | 1.7 | 52.50 -Modify | 0.78657 | 1.4521 | 1.6493 | 23.1 | 1.35 -Other | | 0.0172 | | | 0.02 - -Nlocal: 106.000 ave 407 max 0 min -Histogram: 5 0 0 0 1 0 1 0 0 1 -Nghost: 71.1250 ave 338 max 0 min -Histogram: 5 0 1 0 1 0 0 0 0 1 -Neighs: 7377.88 ave 29891 max 0 min -Histogram: 5 0 0 0 1 1 0 0 0 1 - -Total # of neighbors = 59023 -Ave neighs/atom = 69.602594 -Ave special neighs/atom = 11.443396 -Neighbor list builds = 8000 -Dangerous builds = 0 -System init for write_data ... -PPPM initialization ... - using 12-bit tables for long-range coulomb (../kspace.cpp:328) - G vector (1/distance) = 0.20144813 - grid = 45 45 45 - stencil order = 5 - estimated absolute RMS force accuracy = 0.0022576485 - estimated relative force accuracy = 6.7988414e-06 - using double precision KISS FFT - 3d grid and FFT values/proc = 21952 12167 -System init for write_data ... -PPPM initialization ... - using 12-bit tables for long-range coulomb (../kspace.cpp:328) - G vector (1/distance) = 0.20144813 - grid = 45 45 45 - stencil order = 5 - estimated absolute RMS force accuracy = 0.0022576485 - estimated relative force accuracy = 6.7988414e-06 - using double precision KISS FFT - 3d grid and FFT values/proc = 21952 12167 - -Please see the log.cite file for references relevant to this simulation - -Total wall time: 0:01:48 diff --git a/examples/USER/reaction/create_atoms_polystyrene/in.grow_styrene b/examples/USER/reaction/create_atoms_polystyrene/in.grow_styrene index 4331bf60b7..8950cec614 100755 --- a/examples/USER/reaction/create_atoms_polystyrene/in.grow_styrene +++ b/examples/USER/reaction/create_atoms_polystyrene/in.grow_styrene @@ -1,4 +1,4 @@ -# use bond/react 'create atoms' feature to add 50 new styrene monomers to chain +# use bond/react 'create atoms' feature to add 30 new styrene monomers to chain units real @@ -20,7 +20,12 @@ improper_style class2 variable T equal 530 -read_data trimer.data +read_data trimer.data & + extra/bond/per/atom 5 & + extra/angle/per/atom 15 & + extra/dihedral/per/atom 15 & + extra/improper/per/atom 25 & + extra/special/per/atom 25 molecule mol1 grow_styrene_pre.data_template molecule mol2 grow_styrene_post.data_template @@ -28,7 +33,7 @@ molecule mol2 grow_styrene_post.data_template fix myrxns all bond/react stabilization yes statted_grp .03 & react rxn1 all 1 0 3.0 mol1 mol2 grow_styrene.map & modify_create fit create_fit overlap 2.0 & - stabilize_steps 100 max_rxn 50 + stabilize_steps 100 max_rxn 30 fix 1 statted_grp_REACT nvt temp $T $T 100 diff --git a/examples/USER/reaction/create_atoms_polystyrene/log.24Dec20.grow_styrene.g++.1 b/examples/USER/reaction/create_atoms_polystyrene/log.24Dec20.grow_styrene.g++.1 new file mode 100644 index 0000000000..5f1f2c6698 --- /dev/null +++ b/examples/USER/reaction/create_atoms_polystyrene/log.24Dec20.grow_styrene.g++.1 @@ -0,0 +1,196 @@ +LAMMPS (24 Dec 2020) +Reading data file ... + orthogonal box = (50.000000 50.000000 50.000000) to (250.00000 250.00000 250.00000) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 48 atoms + reading velocities ... + 48 velocities + scanning bonds ... + 8 = max bonds/atom + scanning angles ... + 21 = max angles/atom + scanning dihedrals ... + 33 = max dihedrals/atom + scanning impropers ... + 29 = max impropers/atom + reading bonds ... + 50 bonds + reading angles ... + 84 angles + reading dihedrals ... + 127 dihedrals + reading impropers ... + 36 impropers +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 4 = max # of 1-2 neighbors + 8 = max # of 1-3 neighbors + 17 = max # of 1-4 neighbors + 46 = max # of special neighbors + special bonds CPU = 0.000 seconds + read_data CPU = 0.077 seconds +Read molecule template mol1: + 1 molecules + 30 atoms with max type 6 + 31 bonds with max type 10 + 51 angles with max type 16 + 73 dihedrals with max type 19 + 21 impropers with max type 7 +Read molecule template mol2: + 1 molecules + 46 atoms with max type 6 + 48 bonds with max type 13 + 81 angles with max type 22 + 121 dihedrals with max type 36 + 35 impropers with max type 9 +dynamic group bond_react_MASTER_group defined +dynamic group statted_grp_REACT defined +PPPM initialization ... +WARNING: System is not charge neutral, net charge = -0.00060000000 (../kspace.cpp:324) + using 12-bit tables for long-range coulomb (../kspace.cpp:339) + G vector (1/distance) = 0.20144813 + grid = 45 45 45 + stencil order = 5 + estimated absolute RMS force accuracy = 0.00053712952 + estimated relative force accuracy = 1.6175496e-06 + using double precision KISS FFT + 3d grid and FFT values/proc = 125000 91125 +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 10.5 + ghost atom cutoff = 10.5 + binsize = 5.25, bins = 39 39 39 + 2 neighbor lists, perpetual/occasional/extra = 1 1 0 + (1) pair lj/class2/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d/newton + bin: standard + (2) fix bond/react, occasional, copy from (1) + attributes: half, newton on + pair build: copy + stencil: none + bin: none +Setting up Verlet run ... + Unit style : real + Current step : 0 + Time step : 1 +Per MPI rank memory allocation (min/avg/max) = 48.02 | 48.02 | 48.02 Mbytes +Step Temp Press Density f_myrxns[1] + 0 496.23742 0.9983211 6.4856516e-05 0 + 100 534.05394 -0.76952227 6.4856516e-05 0 + 200 552.2225 -0.55375493 6.4856516e-05 0 + 300 857.52834 -0.4272061 8.6475354e-05 1 + 400 714.10681 1.5004615 8.6475354e-05 1 + 500 678.19171 0.21965471 8.6475354e-05 1 + 600 572.3234 0.87879933 8.6475354e-05 1 + 700 996.17398 -0.24269717 0.00010809419 2 + 800 904.50395 1.3662054 0.00010809419 2 + 900 1097.1568 -2.2909907 0.00012971303 3 + 1000 954.08892 1.7705672 0.00012971303 3 + 1100 1102.0377 -1.7018446 0.00015133187 4 + 1200 1239.785 -0.30442903 0.00015133187 4 + 1300 1388.4127 1.3301175 0.00017295071 5 + 1400 1559.3853 1.6709729 0.00017295071 5 + 1500 1471.8623 0.8268427 0.00017295071 5 + 1600 1543.6793 2.1987908 0.00019456955 6 + 1700 1694.5595 0.48852817 0.00019456955 6 + 1800 1632.7737 -1.4617692 0.00021618839 7 + 1900 1922.6502 1.1664257 0.00021618839 7 + 2000 2223.503 -0.95799878 0.00023780722 8 + 2100 2142.6035 0.88444463 0.00025942606 9 + 2200 2298.8636 3.4239313 0.00025942606 9 + 2300 2252.4355 0.82167302 0.00025942606 9 + 2400 2321.0788 1.7499714 0.00025942606 9 + 2500 2095.6715 0.55288444 0.00025942606 9 + 2600 2136.0316 -3.833114 0.00025942606 9 + 2700 2466.3134 -2.2519511 0.00025942606 9 + 2800 2294.3454 1.0637304 0.00025942606 9 + 2900 2340.3891 1.3997049 0.0002810449 10 + 3000 2272.0013 -0.27591886 0.0002810449 10 + 3100 2333.9696 -0.11772138 0.0002810449 10 + 3200 2409.0946 -1.025473 0.0002810449 10 + 3300 2148.023 1.6752329 0.0002810449 10 + 3400 2267.636 -0.45297583 0.0002810449 10 + 3500 2457.622 0.35627297 0.0002810449 10 + 3600 2288.008 -15.516626 0.00030266374 11 + 3700 2458.2681 1.4571773 0.00030266374 11 + 3800 2566.7623 -29.140553 0.00032428258 12 + 3900 2839.4062 0.64583638 0.00032428258 12 + 4000 2893.9852 -52.954497 0.00034590142 13 + 4100 3021.3611 -65.03731 0.00036752025 14 + 4200 3002.7136 1.5750081 0.00036752025 14 + 4300 3218.6248 -120.74039 0.00038913909 15 + 4400 3345.1482 -0.96545269 0.00038913909 15 + 4500 3603.2429 1.2438833 0.00038913909 15 + 4600 3129.8814 -249.91806 0.00041075793 16 + 4700 3769.052 -289.24351 0.00043237677 17 + 4800 3560.4714 -3.1655406 0.00043237677 17 + 4900 3452.2717 -2.1270765 0.00043237677 17 + 5000 3594.3247 -523.48506 0.00045399561 18 + 5100 3578.4199 1.0009097 0.00045399561 18 + 5200 3822.1566 1.0526914 0.00047561445 19 + 5300 3901.8883 -0.14607602 0.00047561445 19 + 5400 4059.3644 -1.7789927 0.00049723329 20 + 5500 4163.6847 1.0240127 0.00049723329 20 + 5600 4109.1649 0.80199787 0.00049723329 20 + 5700 4391.2091 2.8730036 0.00049723329 20 + 5800 4279.6579 -0.36499822 0.00051885212 21 + 5900 4296.2695 -1.3064528 0.00051885212 21 + 6000 4065.3758 -2.0483224 0.00051885212 21 + 6100 4772.5362 -2.6814694 0.00054047096 22 + 6200 4627.029 2.999215 0.0005620898 23 + 6300 5120.7881 0.65372968 0.00058370864 24 + 6400 4588.9559 3.7570705 0.00058370864 24 + 6500 5008.7814 2.3595833 0.00060532748 25 + 6600 5195.0053 1.4641612 0.00060532748 25 + 6700 5622.293 -0.33396047 0.00062694632 26 + 6800 5515.1957 -4.234874 0.00062694632 26 + 6900 5156.7455 0.40171954 0.00064856516 27 + 7000 5120.1639 -1.6065245 0.00064856516 27 + 7100 5650.0327 0.94436323 0.00067018399 28 + 7200 5985.1115 -3.8940347 0.00069180283 29 + 7300 5983.197 0.5293568 0.00069180283 29 + 7400 6001.1559 -0.13712834 0.00071342167 30 + 7500 5889.2134 0.17230892 0.00071342167 30 + 7600 5797.31 2.0920058 0.00071342167 30 + 7700 5865.2783 -0.18556395 0.00071342167 30 + 7800 6207.0659 -5.6237083 0.00071342167 30 + 7900 5627.5108 -2.3718942 0.00071342167 30 + 8000 5823.9502 -0.85418578 0.00071342167 30 +Loop time of 184.87 on 1 procs for 8000 steps with 528 atoms + +Performance: 3.739 ns/day, 6.419 hours/ns, 43.274 timesteps/s +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 3.3043 | 3.3043 | 3.3043 | 0.0 | 1.79 +Bond | 8.0003 | 8.0003 | 8.0003 | 0.0 | 4.33 +Kspace | 168.33 | 168.33 | 168.33 | 0.0 | 91.05 +Neigh | 4.6322 | 4.6322 | 4.6322 | 0.0 | 2.51 +Comm | 0.077927 | 0.077927 | 0.077927 | 0.0 | 0.04 +Output | 0.0020548 | 0.0020548 | 0.0020548 | 0.0 | 0.00 +Modify | 0.5005 | 0.5005 | 0.5005 | 0.0 | 0.27 +Other | | 0.02483 | | | 0.01 + +Nlocal: 528.000 ave 528 max 528 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 341.000 ave 341 max 341 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 35111.0 ave 35111 max 35111 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 35111 +Ave neighs/atom = 66.498106 +Ave special neighs/atom = 11.409091 +Neighbor list builds = 8000 +Dangerous builds = 0 + +Please see the log.cite file for references relevant to this simulation + +Total wall time: 0:03:05 diff --git a/examples/USER/reaction/create_atoms_polystyrene/log.24Dec20.grow_styrene.g++.4 b/examples/USER/reaction/create_atoms_polystyrene/log.24Dec20.grow_styrene.g++.4 new file mode 100644 index 0000000000..8daa6d8161 --- /dev/null +++ b/examples/USER/reaction/create_atoms_polystyrene/log.24Dec20.grow_styrene.g++.4 @@ -0,0 +1,196 @@ +LAMMPS (24 Dec 2020) +Reading data file ... + orthogonal box = (50.000000 50.000000 50.000000) to (250.00000 250.00000 250.00000) + 1 by 2 by 2 MPI processor grid + reading atoms ... + 48 atoms + reading velocities ... + 48 velocities + scanning bonds ... + 8 = max bonds/atom + scanning angles ... + 21 = max angles/atom + scanning dihedrals ... + 33 = max dihedrals/atom + scanning impropers ... + 29 = max impropers/atom + reading bonds ... + 50 bonds + reading angles ... + 84 angles + reading dihedrals ... + 127 dihedrals + reading impropers ... + 36 impropers +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 4 = max # of 1-2 neighbors + 8 = max # of 1-3 neighbors + 17 = max # of 1-4 neighbors + 46 = max # of special neighbors + special bonds CPU = 0.000 seconds + read_data CPU = 0.007 seconds +Read molecule template mol1: + 1 molecules + 30 atoms with max type 6 + 31 bonds with max type 10 + 51 angles with max type 16 + 73 dihedrals with max type 19 + 21 impropers with max type 7 +Read molecule template mol2: + 1 molecules + 46 atoms with max type 6 + 48 bonds with max type 13 + 81 angles with max type 22 + 121 dihedrals with max type 36 + 35 impropers with max type 9 +dynamic group bond_react_MASTER_group defined +dynamic group statted_grp_REACT defined +PPPM initialization ... +WARNING: System is not charge neutral, net charge = -0.00060000000 (../kspace.cpp:324) + using 12-bit tables for long-range coulomb (../kspace.cpp:339) + G vector (1/distance) = 0.20144813 + grid = 45 45 45 + stencil order = 5 + estimated absolute RMS force accuracy = 0.00053712952 + estimated relative force accuracy = 1.6175496e-06 + using double precision KISS FFT + 3d grid and FFT values/proc = 39200 24300 +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 10.5 + ghost atom cutoff = 10.5 + binsize = 5.25, bins = 39 39 39 + 2 neighbor lists, perpetual/occasional/extra = 1 1 0 + (1) pair lj/class2/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d/newton + bin: standard + (2) fix bond/react, occasional, copy from (1) + attributes: half, newton on + pair build: copy + stencil: none + bin: none +Setting up Verlet run ... + Unit style : real + Current step : 0 + Time step : 1 +Per MPI rank memory allocation (min/avg/max) = 38.70 | 38.92 | 39.43 Mbytes +Step Temp Press Density f_myrxns[1] + 0 496.23742 0.9983211 6.4856516e-05 0 + 100 534.05394 -0.76952227 6.4856516e-05 0 + 200 552.2225 -0.55375493 6.4856516e-05 0 + 300 857.52834 -0.4272061 8.6475354e-05 1 + 400 714.10681 1.5004615 8.6475354e-05 1 + 500 678.19171 0.21965471 8.6475354e-05 1 + 600 572.3234 0.87879933 8.6475354e-05 1 + 700 996.17398 -0.24269717 0.00010809419 2 + 800 904.50395 1.3662054 0.00010809419 2 + 900 1097.1568 -2.2909907 0.00012971303 3 + 1000 954.08892 1.7705672 0.00012971303 3 + 1100 1102.0377 -1.7018446 0.00015133187 4 + 1200 1239.785 -0.30442903 0.00015133187 4 + 1300 1388.4127 1.3301175 0.00017295071 5 + 1400 1559.3853 1.6709729 0.00017295071 5 + 1500 1471.8623 0.8268427 0.00017295071 5 + 1600 1543.6793 2.1987908 0.00019456955 6 + 1700 1694.5595 0.48852817 0.00019456955 6 + 1800 1632.7737 -1.4617692 0.00021618839 7 + 1900 1922.6502 1.1664257 0.00021618839 7 + 2000 2223.503 -0.95799878 0.00023780722 8 + 2100 2142.6035 0.88444463 0.00025942606 9 + 2200 2298.8636 3.4239313 0.00025942606 9 + 2300 2252.4355 0.82167302 0.00025942606 9 + 2400 2321.0788 1.7499714 0.00025942606 9 + 2500 2095.6715 0.55288444 0.00025942606 9 + 2600 2136.0316 -3.833114 0.00025942606 9 + 2700 2466.3134 -2.2519511 0.00025942606 9 + 2800 2294.3454 1.0637304 0.00025942606 9 + 2900 2340.3891 1.3997049 0.0002810449 10 + 3000 2272.0013 -0.27591886 0.0002810449 10 + 3100 2333.9696 -0.11772138 0.0002810449 10 + 3200 2409.0946 -1.025473 0.0002810449 10 + 3300 2148.023 1.6752329 0.0002810449 10 + 3400 2267.636 -0.45297583 0.0002810449 10 + 3500 2457.622 0.35627297 0.0002810449 10 + 3600 2288.008 -15.516626 0.00030266374 11 + 3700 2458.2681 1.4571773 0.00030266374 11 + 3800 2566.7623 -29.140553 0.00032428258 12 + 3900 2839.4062 0.64583638 0.00032428258 12 + 4000 2893.2204 -53.187892 0.00034590142 13 + 4100 3024.6375 -65.068146 0.00036752025 14 + 4200 3004.6784 1.4155214 0.00036752025 14 + 4300 3033.1895 1.8572273 0.00036752025 14 + 4400 3157.2542 -0.92462977 0.00036752025 14 + 4500 3557.7137 -194.46498 0.00038913909 15 + 4600 3096.485 -1.830492 0.00038913909 15 + 4700 3488.088 -286.81055 0.00041075793 16 + 4800 3390.5493 -372.77818 0.00043237677 17 + 4900 3773.7226 -446.58574 0.00045399561 18 + 5000 3703.0159 -0.81188551 0.00045399561 18 + 5100 4051.3067 1.2567439 0.00045399561 18 + 5200 3813.3682 0.92945737 0.00047561445 19 + 5300 4036.0078 -2.5336258 0.00049723329 20 + 5400 4219.803 -0.96928261 0.00049723329 20 + 5500 4433.7447 -0.026762463 0.00051885212 21 + 5600 4477.4505 -1.417316 0.00054047096 22 + 5700 4500.0306 -1.0551443 0.00054047096 22 + 5800 4600.3507 -4.9580056 0.00054047096 22 + 5900 4765.4978 -2.2546941 0.0005620898 23 + 6000 5442.6193 0.91161284 0.00058370864 24 + 6100 5086.8047 -0.9875332 0.00060532748 25 + 6200 5485.3437 -2.8296626 0.00062694632 26 + 6300 4988.0396 -0.15179023 0.00064856516 27 + 6400 5597.3703 4.2941885 0.00067018399 28 + 6500 5677.0263 -2.8611595 0.00069180283 29 + 6600 6058.0009 1.4111778 0.00071342167 30 + 6700 5859.0817 -2.5782466 0.00071342167 30 + 6800 5879.3941 -4.5681807 0.00071342167 30 + 6900 6398.288 2.5259412 0.00071342167 30 + 7000 6250.1096 -2.6049627 0.00071342167 30 + 7100 5849.651 -0.44062578 0.00071342167 30 + 7200 5778.6532 -0.27299118 0.00071342167 30 + 7300 5977.6661 4.2483639 0.00071342167 30 + 7400 5862.4231 1.0289519 0.00071342167 30 + 7500 6482.376 7.5412373 0.00071342167 30 + 7600 5810.4325 1.0343075 0.00071342167 30 + 7700 5916.7304 2.304302 0.00071342167 30 + 7800 5869.9504 -0.5946555 0.00071342167 30 + 7900 5804.0522 -4.1207689 0.00071342167 30 + 8000 6077.1704 0.52211243 0.00071342167 30 +Loop time of 60.5603 on 4 procs for 8000 steps with 528 atoms + +Performance: 11.413 ns/day, 2.103 hours/ns, 132.100 timesteps/s +99.9% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0041695 | 0.90113 | 2.3423 | 102.8 | 1.49 +Bond | 0.011606 | 2.1188 | 5.8107 | 163.9 | 3.50 +Kspace | 47.987 | 52.817 | 55.679 | 43.7 | 87.21 +Neigh | 3.5961 | 3.6262 | 3.6496 | 1.2 | 5.99 +Comm | 0.11097 | 0.16569 | 0.26369 | 15.3 | 0.27 +Output | 0.0020366 | 0.0023427 | 0.0032469 | 1.1 | 0.00 +Modify | 0.62302 | 0.91659 | 1.1227 | 21.5 | 1.51 +Other | | 0.0126 | | | 0.02 + +Nlocal: 132.000 ave 295 max 0 min +Histogram: 2 0 0 0 0 0 0 1 0 1 +Nghost: 133.000 ave 349 max 0 min +Histogram: 2 0 0 0 0 1 0 0 0 1 +Neighs: 8383.50 ave 20143 max 0 min +Histogram: 2 0 0 0 0 0 1 0 0 1 + +Total # of neighbors = 33534 +Ave neighs/atom = 63.511364 +Ave special neighs/atom = 11.409091 +Neighbor list builds = 8000 +Dangerous builds = 0 + +Please see the log.cite file for references relevant to this simulation + +Total wall time: 0:01:00 From 89e47e7aaecc94010d9d51ddd55271f90f6af88d Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Thu, 4 Feb 2021 22:31:15 -0500 Subject: [PATCH 148/384] memory fix --- src/USER-REACTION/fix_bond_react.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 0ef302137e..6739e20ac6 100755 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -596,6 +596,7 @@ FixBondReact::~FixBondReact() memory->destroy(create_atoms); memory->destroy(chiral_atoms); + memory->destroy(rxn_name); memory->destroy(nevery); memory->destroy(cutsq); memory->destroy(unreacted_mol); @@ -613,7 +614,7 @@ FixBondReact::~FixBondReact() memory->destroy(molecule_keyword); memory->destroy(constraints); memory->destroy(nconstraints); - // need to delete rxn_name and constraintstr + memory->destroy(constraintstr); memory->destroy(create_atoms_flag); memory->destroy(modify_create_fragid); memory->destroy(overlapsq); From 47783aaa9cc2b37d42e5014092b20f67d55cce22 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Feb 2021 13:56:06 -0500 Subject: [PATCH 149/384] whitespace --- src/fix_ave_correlate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fix_ave_correlate.cpp b/src/fix_ave_correlate.cpp index de0cc0da6f..efd06a182a 100644 --- a/src/fix_ave_correlate.cpp +++ b/src/fix_ave_correlate.cpp @@ -74,7 +74,7 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): int iarg = 0; while (iarg < nargnew) { ArgInfo argi(arg[iarg]); - + if (argi.get_type() == ArgInfo::NONE) break; if ((argi.get_type() == ArgInfo::UNKNOWN) || (argi.get_dim() > 1)) error->all(FLERR,"Invalid fix ave/correlate command"); From ba8f7bf3d88f1e3777fffe1d8baa8bd7ff5c3c57 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Feb 2021 13:56:47 -0500 Subject: [PATCH 150/384] address argument indexing bug reported by stan --- src/fix_ave_histo.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/fix_ave_histo.cpp b/src/fix_ave_histo.cpp index cad509e165..0d82fd6b04 100644 --- a/src/fix_ave_histo.cpp +++ b/src/fix_ave_histo.cpp @@ -152,17 +152,15 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : ids[i] = nullptr; } else { - ArgInfo argi(arg[iarg]); + ArgInfo argi(arg[i]); if (argi.get_type() == ArgInfo::NONE) break; if ((argi.get_type() == ArgInfo::UNKNOWN) || (argi.get_dim() > 1)) error->all(FLERR,"Invalid fix ave/histo command"); - which[nvalues] = argi.get_type(); - argindex[nvalues] = argi.get_index1(); - ids[nvalues] = argi.copy_name(); - - nvalues++; + which[i] = argi.get_type(); + argindex[i] = argi.get_index1(); + ids[i] = argi.copy_name(); } } From 4166235be6550f3d8254e8ad59a7b3e10fe2c592 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Feb 2021 16:43:18 -0500 Subject: [PATCH 151/384] synchronize settings with CMake support --- lib/gpu/Install.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/gpu/Install.py b/lib/gpu/Install.py index d06a37567a..4a14c503a6 100644 --- a/lib/gpu/Install.py +++ b/lib/gpu/Install.py @@ -46,10 +46,10 @@ parser.add_argument("-b", "--build", action="store_true", help="build the GPU library from scratch from a customized Makefile.auto") parser.add_argument("-m", "--machine", default='linux', help="suffix of Makefile.machine used as base for customizing Makefile.auto") -parser.add_argument("-a", "--arch", default='sm_30', +parser.add_argument("-a", "--arch", default='sm_50', choices=['sm_12', 'sm_13', 'sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_37', - 'sm_50', 'sm_52', 'sm_60', 'sm_61', 'sm_70', 'sm_75'], - help="set GPU architecture and instruction set (default: 'sm_30')") + 'sm_50', 'sm_52', 'sm_60', 'sm_61', 'sm_70', 'sm_75', 'sm_80'], + help="set GPU architecture and instruction set (default: 'sm_50')") parser.add_argument("-p", "--precision", default='mixed', choices=['single', 'mixed', 'double'], help="set GPU kernel precision mode (default: mixed)") parser.add_argument("-e", "--extramake", default='standard', From 754a469a01d57051b528607a4200eb425102e9ef Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Feb 2021 16:43:51 -0500 Subject: [PATCH 152/384] add variable for handling cuda-mps-server --- lib/gpu/Makefile.cuda | 3 +- lib/gpu/Makefile.cuda_mps | 150 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 lib/gpu/Makefile.cuda_mps diff --git a/lib/gpu/Makefile.cuda b/lib/gpu/Makefile.cuda index d357ebf0e4..b18e4620eb 100644 --- a/lib/gpu/Makefile.cuda +++ b/lib/gpu/Makefile.cuda @@ -30,6 +30,7 @@ AR = ar BSH = /bin/sh CUDPP_OPT = -DUSE_CUDPP -Icudpp_mini +CUDA_MPS = # device code compiler and settings @@ -51,7 +52,7 @@ BIN2C = $(CUDA_HOME)/bin/bin2c CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC CUDR_OPTS = -O2 $(LMP_INC) -CUDR = $(CUDR_CPP) $(CUDR_OPTS) $(CUDA_PRECISION) $(CUDA_INCLUDE) \ +CUDR = $(CUDR_CPP) $(CUDR_OPTS) $(CUDA_PROXY) $(CUDA_PRECISION) $(CUDA_INCLUDE) \ $(CUDPP_OPT) # Headers for Geryon diff --git a/lib/gpu/Makefile.cuda_mps b/lib/gpu/Makefile.cuda_mps new file mode 100644 index 0000000000..c6e5202adc --- /dev/null +++ b/lib/gpu/Makefile.cuda_mps @@ -0,0 +1,150 @@ +# /* ---------------------------------------------------------------------- +# Generic Linux Makefile for CUDA +# - change CUDA_ARCH for your GPU +# ------------------------------------------------------------------------- */ + +# which file will be copied to Makefile.lammps + +EXTRAMAKE = Makefile.lammps.standard + +ifeq ($(CUDA_HOME),) +CUDA_HOME = /usr/local/cuda +endif + +# this setting should match LAMMPS Makefile +# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL + +LMP_INC = -DLAMMPS_SMALLBIG + +# precision for GPU calculations +# -D_SINGLE_SINGLE # Single precision for all calculations +# -D_DOUBLE_DOUBLE # Double precision for all calculations +# -D_SINGLE_DOUBLE # Accumulation of forces, etc. in double + +CUDA_PRECISION = -D_SINGLE_DOUBLE + +BIN_DIR = ./ +OBJ_DIR = ./ +LIB_DIR = ./ +AR = ar +BSH = /bin/sh + +CUDPP_OPT = +CUDA_MPS = -DCUDA_PROXY + +# device code compiler and settings + +NVCC = nvcc + +CUDA_ARCH = -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] \ + -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61] \ + -gencode arch=compute_70,code=[sm_70,compute_70] -gencode arch=compute_75,code=[sm_75,compute_75] +CUDA_INCLUDE = -I$(CUDA_HOME)/include +CUDA_LIB = -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs +CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler -fPIC +CUDA_LINK = $(CUDA_LIB) -lcudart +CUDA = $(NVCC) $(CUDA_INCLUDE) $(CUDA_OPTS) -Icudpp_mini $(CUDA_ARCH) \ + $(CUDA_PRECISION) + +BIN2C = $(CUDA_HOME)/bin/bin2c + +# host code compiler and settings + +CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC +CUDR_OPTS = -O2 $(LMP_INC) +CUDR = $(CUDR_CPP) $(CUDR_OPTS) $(CUDA_PROXY) $(CUDA_PRECISION) $(CUDA_INCLUDE) \ + $(CUDPP_OPT) + +# Headers for Geryon +UCL_H = $(wildcard ./geryon/ucl*.h) +NVD_H = $(wildcard ./geryon/nvd*.h) $(UCL_H) lal_preprocessor.h +ALL_H = $(NVD_H) $(wildcard ./lal_*.h) + +# Source files +SRCS := $(wildcard ./lal_*.cpp) +OBJS := $(subst ./,$(OBJ_DIR)/,$(SRCS:%.cpp=%.o)) +CUS := $(wildcard lal_*.cu) +CUHS := $(filter-out pppm_cubin.h, $(CUS:lal_%.cu=%_cubin.h)) pppm_f_cubin.h pppm_d_cubin.h +CUHS := $(addprefix $(OBJ_DIR)/, $(CUHS)) + +ifdef CUDPP_OPT +CUDPP = $(OBJ_DIR)/cudpp.o $(OBJ_DIR)/cudpp_plan.o \ + $(OBJ_DIR)/cudpp_maximal_launch.o $(OBJ_DIR)/cudpp_plan_manager.o \ + $(OBJ_DIR)/radixsort_app.cu_o $(OBJ_DIR)/scan_app.cu_o +endif + +# targets + +GPU_LIB = $(LIB_DIR)/libgpu.a + +EXECS = $(BIN_DIR)/nvc_get_devices + +all: $(OBJ_DIR) $(CUHS) $(GPU_LIB) $(EXECS) + +$(OBJ_DIR): + mkdir -p $@ + +# device code compilation + +$(OBJ_DIR)/pppm_f.cubin: lal_pppm.cu lal_precision.h lal_preprocessor.h + $(CUDA) --fatbin -DNV_KERNEL -Dgrdtyp=float -Dgrdtyp4=float4 -o $@ lal_pppm.cu + +$(OBJ_DIR)/pppm_f_cubin.h: $(OBJ_DIR)/pppm_f.cubin + $(BIN2C) -c -n pppm_f $(OBJ_DIR)/pppm_f.cubin > $(OBJ_DIR)/pppm_f_cubin.h + +$(OBJ_DIR)/pppm_d.cubin: lal_pppm.cu lal_precision.h lal_preprocessor.h + $(CUDA) --fatbin -DNV_KERNEL -Dgrdtyp=double -Dgrdtyp4=double4 -o $@ lal_pppm.cu + +$(OBJ_DIR)/pppm_d_cubin.h: $(OBJ_DIR)/pppm_d.cubin + $(BIN2C) -c -n pppm_d $(OBJ_DIR)/pppm_d.cubin > $(OBJ_DIR)/pppm_d_cubin.h + +$(OBJ_DIR)/%_cubin.h: lal_%.cu $(ALL_H) + $(CUDA) --fatbin -DNV_KERNEL -o $(OBJ_DIR)/$*.cubin $(OBJ_DIR)/lal_$*.cu + $(BIN2C) -c -n $* $(OBJ_DIR)/$*.cubin > $@ + @rm $(OBJ_DIR)/$*.cubin + +# host code compilation + +$(OBJ_DIR)/lal_%.o: lal_%.cpp $(CUHS) $(ALL_H) + $(CUDR) -o $@ -c $< -I$(OBJ_DIR) + +#ifdef CUDPP_OPT +$(OBJ_DIR)/cudpp.o: cudpp_mini/cudpp.cpp + $(CUDR) -o $@ -c cudpp_mini/cudpp.cpp -Icudpp_mini + +$(OBJ_DIR)/cudpp_plan.o: cudpp_mini/cudpp_plan.cpp + $(CUDR) -o $@ -c cudpp_mini/cudpp_plan.cpp -Icudpp_mini + +$(OBJ_DIR)/cudpp_maximal_launch.o: cudpp_mini/cudpp_maximal_launch.cpp + $(CUDR) -o $@ -c cudpp_mini/cudpp_maximal_launch.cpp -Icudpp_mini + +$(OBJ_DIR)/cudpp_plan_manager.o: cudpp_mini/cudpp_plan_manager.cpp + $(CUDR) -o $@ -c cudpp_mini/cudpp_plan_manager.cpp -Icudpp_mini + +$(OBJ_DIR)/radixsort_app.cu_o: cudpp_mini/radixsort_app.cu + $(CUDA) -o $@ -c cudpp_mini/radixsort_app.cu + +$(OBJ_DIR)/scan_app.cu_o: cudpp_mini/scan_app.cu + $(CUDA) -o $@ -c cudpp_mini/scan_app.cu +#endif + +# build libgpu.a + +$(GPU_LIB): $(OBJS) $(CUDPP) + $(AR) -crusv $(GPU_LIB) $(OBJS) $(CUDPP) + @cp $(EXTRAMAKE) Makefile.lammps + +# test app for querying device info + +$(BIN_DIR)/nvc_get_devices: ./geryon/ucl_get_devices.cpp $(NVD_H) + $(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda + +clean: + -rm -f $(EXECS) $(GPU_LIB) $(OBJS) $(CUDPP) $(CUHS) *.linkinfo + +veryclean: clean + -rm -rf *~ *.linkinfo + +cleanlib: + -rm -f $(EXECS) $(GPU_LIB) $(OBJS) $(CUHS) *.linkinfo + From fc8b8d8825adf65bd1f6c2f92a47d5d7ee7e0e6e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Feb 2021 16:44:26 -0500 Subject: [PATCH 153/384] disallow use of CUDPP with CUDA multiprocessor server --- cmake/Modules/Packages/GPU.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index bc66ef04d2..141b086592 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -36,6 +36,9 @@ if(GPU_API STREQUAL "CUDA") option(CUDPP_OPT "Enable CUDPP_OPT" ON) option(CUDA_MPS_SUPPORT "Enable tweaks to support CUDA Multi-process service (MPS)" OFF) if(CUDA_MPS_SUPPORT) + if(CUDPP_OPT) + message(FATAL_ERROR "Must use -DCUDPP_OPT=OFF with -DGPU_CUDA_MPS_SUPPORT=ON") + endif() set(GPU_CUDA_MPS_FLAGS "-DCUDA_PROXY") endif() From c74c3b3f22e575563c9ec5a3a8934143febc0ca5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Feb 2021 16:50:59 -0500 Subject: [PATCH 154/384] update docs for mention CUDPP and MPS support with conventional make --- doc/src/Build_extras.rst | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index 0c048c53ff..8f1154a167 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -131,7 +131,7 @@ CMake build -D HIP_USE_DEVICE_SORT=value # enables GPU sorting # value = yes (default) or no -D CUDPP_OPT=value # optimization setting for GPU_API=cuda - # enables CUDA Performance Primitives Optimizations + # enables CUDA Performance Primitives Optimizations, must be "no" for CUDA_MPS_SUPPORT=yes # value = yes (default) or no -D CUDA_MPS_SUPPORT=value # enables some tweaks required to run with active nvidia-cuda-mps daemon # value = yes or no (default) @@ -219,11 +219,19 @@ Makefile if desired: * ``CUDA_PRECISION`` = precision (double, mixed, single) * ``EXTRAMAKE`` = which Makefile.lammps.\* file to copy to Makefile.lammps -The file Makefile.linux_multi is set up to include support for multiple +The file Makefile.cuda is set up to include support for multiple GPU architectures as supported by the CUDA toolkit in use. This is done through using the "--gencode " flag, which can be used multiple times and thus support all GPU architectures supported by your CUDA compiler. +To include CUDA performance primitives set the Makefile variable +``CUDPP_OPT = -DUSE_CUDPP -Icudpp_mini``. + +To support the CUDA multiprocessor server you can set the define +``-DCUDA_PROXY``. Please note that in this case you should **not** use +the CUDA performance primitives and thus set the variable ``CUDPP_OPT`` +to empty. + If the library build is successful, 3 files should be created: ``lib/gpu/libgpu.a``\ , ``lib/gpu/nvc_get_devices``\ , and ``lib/gpu/Makefile.lammps``\ . The latter has settings that enable LAMMPS From 960713be3bd2b13da06f8f78386492df06c24f9d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Feb 2021 17:01:28 -0500 Subject: [PATCH 155/384] make recent change to fix ti/spring docs use mathjax --- doc/src/fix_ti_spring.rst | 9 +++++---- doc/utils/sphinx-config/false_positives.txt | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/src/fix_ti_spring.rst b/doc/src/fix_ti_spring.rst index 303564456e..806619cdb1 100644 --- a/doc/src/fix_ti_spring.rst +++ b/doc/src/fix_ti_spring.rst @@ -135,10 +135,11 @@ system's potential energy as part of :doc:`thermodynamic output This fix computes a global scalar and a global vector quantities which can be accessed by various :doc:`output commands `. The scalar is an energy which is the sum of the spring energy for each -atom, where the per-atom energy is 0.5 \* k \* r\^2. The vector stores -2 values. The first value is the coupling parameter lambda. The -second value is the derivative of lambda with respect to the integer -timestep *s*, i.e. d lambda / ds. In order to obtain d lambda / dt, +atom, where the per-atom energy is :math:`0.5 \cdot k \cdot r^2`. +The vector stores 2 values. The first value is the coupling parameter lambda. +The second value is the derivative of lambda with respect to the integer +timestep *s*, i.e. :math:`\frac{d \lambda}{d s}`. In order to obtain +:math:`\frac{d \lambda}{d t}`, where t is simulation time, this 2nd value needs to be divided by the timestep size (e.g. 0.5 fs). The scalar and vector values calculated by this fix are "extensive". diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index e9ba170ac5..a2f8764aee 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -597,6 +597,7 @@ Dcut de dE De +deallocated decorrelation debye Debye From 19811077b7be9f14145388ed051dd0b53f32735a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Feb 2021 17:16:38 -0500 Subject: [PATCH 156/384] fix strdup() vs utils::strdup() bug --- src/fix_adapt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp index ff634ba298..c09b6481f6 100644 --- a/src/fix_adapt.cpp +++ b/src/fix_adapt.cpp @@ -328,7 +328,7 @@ void FixAdapt::init() // strip it for pstyle arg to pair_match() and set nsub = N // this should work for appended suffixes as well - char *pstyle = strdup(ad->pstyle); + char *pstyle = utils::strdup(ad->pstyle); char *cptr; int nsub = 0; if ((cptr = strchr(pstyle,':'))) { From 9995bef9112d424a2926eb2862fd48ba36bb3d04 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Fri, 5 Feb 2021 17:50:23 -0500 Subject: [PATCH 157/384] file permissions --- doc/src/fix_bond_react.rst | 0 src/USER-REACTION/fix_bond_react.cpp | 0 src/USER-REACTION/fix_bond_react.h | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 doc/src/fix_bond_react.rst mode change 100755 => 100644 src/USER-REACTION/fix_bond_react.cpp mode change 100755 => 100644 src/USER-REACTION/fix_bond_react.h diff --git a/doc/src/fix_bond_react.rst b/doc/src/fix_bond_react.rst old mode 100755 new mode 100644 diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp old mode 100755 new mode 100644 diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h old mode 100755 new mode 100644 From 5036adeff0d009afcc12090b870c5e03753b9a18 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Feb 2021 19:19:13 -0500 Subject: [PATCH 158/384] timestep processing functions must use bigint instead of int --- src/variable.cpp | 114 +++++++++++++++++++++++------------------------ 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/src/variable.cpp b/src/variable.cpp index 7cce6546bc..556633c4e0 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -3040,28 +3040,28 @@ double Variable::eval_tree(Tree *tree, int i) } if (tree->type == STAGGER) { - int ivalue1 = static_cast (eval_tree(tree->first,i)); - int ivalue2 = static_cast (eval_tree(tree->second,i)); + bigint ivalue1 = static_cast (eval_tree(tree->first,i)); + bigint ivalue2 = static_cast (eval_tree(tree->second,i)); if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue1 <= ivalue2) error->one(FLERR,"Invalid math function in variable formula"); - int lower = update->ntimestep/ivalue1 * ivalue1; - int delta = update->ntimestep - lower; + bigint lower = update->ntimestep/ivalue1 * ivalue1; + bigint delta = update->ntimestep - lower; if (delta < ivalue2) arg = lower+ivalue2; else arg = lower+ivalue1; return arg; } if (tree->type == LOGFREQ) { - int ivalue1 = static_cast (eval_tree(tree->first,i)); - int ivalue2 = static_cast (eval_tree(tree->second,i)); - int ivalue3 = static_cast (eval_tree(tree->extra[0],i)); + bigint ivalue1 = static_cast (eval_tree(tree->first,i)); + bigint ivalue2 = static_cast (eval_tree(tree->second,i)); + bigint ivalue3 = static_cast (eval_tree(tree->extra[0],i)); if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 || ivalue2 >= ivalue3) error->one(FLERR,"Invalid math function in variable formula"); if (update->ntimestep < ivalue1) arg = ivalue1; else { - int lower = ivalue1; + bigint lower = ivalue1; while (update->ntimestep >= ivalue3*lower) lower *= ivalue3; - int multiple = update->ntimestep/lower; + bigint multiple = update->ntimestep/lower; if (multiple < ivalue2) arg = (multiple+1)*lower; else arg = lower*ivalue3; } @@ -3069,16 +3069,16 @@ double Variable::eval_tree(Tree *tree, int i) } if (tree->type == LOGFREQ2) { - int ivalue1 = static_cast (eval_tree(tree->first,i)); - int ivalue2 = static_cast (eval_tree(tree->second,i)); - int ivalue3 = static_cast (eval_tree(tree->extra[0],i)); + bigint ivalue1 = static_cast (eval_tree(tree->first,i)); + bigint ivalue2 = static_cast (eval_tree(tree->second,i)); + bigint ivalue3 = static_cast (eval_tree(tree->extra[0],i)); if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 ) error->all(FLERR,"Invalid math function in variable formula"); if (update->ntimestep < ivalue1) arg = ivalue1; else { arg = ivalue1; double delta = ivalue1*(ivalue3-1.0)/ivalue2; - int count = 0; + bigint count = 0; while (update->ntimestep >= arg) { arg += delta; count++; @@ -3090,14 +3090,14 @@ double Variable::eval_tree(Tree *tree, int i) } if (tree->type == STRIDE) { - int ivalue1 = static_cast (eval_tree(tree->first,i)); - int ivalue2 = static_cast (eval_tree(tree->second,i)); - int ivalue3 = static_cast (eval_tree(tree->extra[0],i)); + bigint ivalue1 = static_cast (eval_tree(tree->first,i)); + bigint ivalue2 = static_cast (eval_tree(tree->second,i)); + bigint ivalue3 = static_cast (eval_tree(tree->extra[0],i)); if (ivalue1 < 0 || ivalue2 < 0 || ivalue3 <= 0 || ivalue1 > ivalue2) error->one(FLERR,"Invalid math function in variable formula"); if (update->ntimestep < ivalue1) arg = ivalue1; else if (update->ntimestep < ivalue2) { - int offset = update->ntimestep - ivalue1; + bigint offset = update->ntimestep - ivalue1; arg = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3; if (arg > ivalue2) arg = (double) MAXBIGINT; } else arg = (double) MAXBIGINT; @@ -3105,12 +3105,12 @@ double Variable::eval_tree(Tree *tree, int i) } if (tree->type == STRIDE2) { - int ivalue1 = static_cast (eval_tree(tree->first,i)); - int ivalue2 = static_cast (eval_tree(tree->second,i)); - int ivalue3 = static_cast (eval_tree(tree->extra[0],i)); - int ivalue4 = static_cast (eval_tree(tree->extra[1],i)); - int ivalue5 = static_cast (eval_tree(tree->extra[2],i)); - int ivalue6 = static_cast (eval_tree(tree->extra[3],i)); + bigint ivalue1 = static_cast (eval_tree(tree->first,i)); + bigint ivalue2 = static_cast (eval_tree(tree->second,i)); + bigint ivalue3 = static_cast (eval_tree(tree->extra[0],i)); + bigint ivalue4 = static_cast (eval_tree(tree->extra[1],i)); + bigint ivalue5 = static_cast (eval_tree(tree->extra[2],i)); + bigint ivalue6 = static_cast (eval_tree(tree->extra[3],i)); if (ivalue1 < 0 || ivalue2 < 0 || ivalue3 <= 0 || ivalue1 > ivalue2) error->one(FLERR,"Invalid math function in variable formula"); if (ivalue4 < 0 || ivalue5 < 0 || ivalue6 <= 0 || ivalue4 > ivalue5) @@ -3121,15 +3121,15 @@ double Variable::eval_tree(Tree *tree, int i) if (update->ntimestep < ivalue1) istep = ivalue1; else if (update->ntimestep < ivalue2) { if (update->ntimestep < ivalue4 || update->ntimestep > ivalue5) { - int offset = update->ntimestep - ivalue1; + bigint offset = update->ntimestep - ivalue1; istep = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3; if (update->ntimestep < ivalue2 && istep > ivalue4) tree->value = ivalue4; } else { - int offset = update->ntimestep - ivalue4; + bigint offset = update->ntimestep - ivalue4; istep = ivalue4 + (offset/ivalue6)*ivalue6 + ivalue6; if (istep > ivalue5) { - int offset = ivalue5 - ivalue1; + bigint offset = ivalue5 - ivalue1; istep = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3; if (istep > ivalue2) istep = MAXBIGINT; } @@ -3571,12 +3571,12 @@ int Variable::math_function(char *word, char *contents, Tree **tree, print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (tree) newtree->type = STAGGER; else { - int ivalue1 = static_cast (value1); - int ivalue2 = static_cast (value2); + bigint ivalue1 = static_cast (value1); + bigint ivalue2 = static_cast (value2); if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue1 <= ivalue2) print_var_error(FLERR,"Invalid math function in variable formula",ivar); - int lower = update->ntimestep/ivalue1 * ivalue1; - int delta = update->ntimestep - lower; + bigint lower = update->ntimestep/ivalue1 * ivalue1; + bigint delta = update->ntimestep - lower; double value; if (delta < ivalue2) value = lower+ivalue2; else value = lower+ivalue1; @@ -3588,17 +3588,17 @@ int Variable::math_function(char *word, char *contents, Tree **tree, print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (tree) newtree->type = LOGFREQ; else { - int ivalue1 = static_cast (value1); - int ivalue2 = static_cast (value2); - int ivalue3 = static_cast (values[0]); + bigint ivalue1 = static_cast (value1); + bigint ivalue2 = static_cast (value2); + bigint ivalue3 = static_cast (values[0]); if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 || ivalue2 >= ivalue3) print_var_error(FLERR,"Invalid math function in variable formula",ivar); double value; if (update->ntimestep < ivalue1) value = ivalue1; else { - int lower = ivalue1; + bigint lower = ivalue1; while (update->ntimestep >= ivalue3*lower) lower *= ivalue3; - int multiple = update->ntimestep/lower; + bigint multiple = update->ntimestep/lower; if (multiple < ivalue2) value = (multiple+1)*lower; else value = lower*ivalue3; } @@ -3610,9 +3610,9 @@ int Variable::math_function(char *word, char *contents, Tree **tree, print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (tree) newtree->type = LOGFREQ2; else { - int ivalue1 = static_cast (value1); - int ivalue2 = static_cast (value2); - int ivalue3 = static_cast (values[0]); + bigint ivalue1 = static_cast (value1); + bigint ivalue2 = static_cast (value2); + bigint ivalue3 = static_cast (values[0]); if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 ) print_var_error(FLERR,"Invalid math function in variable formula",ivar); double value; @@ -3620,7 +3620,7 @@ int Variable::math_function(char *word, char *contents, Tree **tree, else { value = ivalue1; double delta = ivalue1*(ivalue3-1.0)/ivalue2; - int count = 0; + bigint count = 0; while (update->ntimestep >= value) { value += delta; count++; @@ -3635,9 +3635,9 @@ int Variable::math_function(char *word, char *contents, Tree **tree, print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (tree) newtree->type = LOGFREQ3; else { - int ivalue1 = static_cast (value1); - int ivalue2 = static_cast (value2); - int ivalue3 = static_cast (values[0]); + bigint ivalue1 = static_cast (value1); + bigint ivalue2 = static_cast (value2); + bigint ivalue3 = static_cast (values[0]); if (ivalue1 <= 0 || ivalue2 <= 1 || ivalue3 <= 0 || ivalue3-ivalue1+1 < ivalue2 ) print_var_error(FLERR,"Invalid math function in variable formula",ivar); @@ -3648,12 +3648,12 @@ int Variable::math_function(char *word, char *contents, Tree **tree, value = ivalue1; double logsp = ivalue1; double factor = pow(((double)ivalue3)/ivalue1, 1.0/(ivalue2-1)); - int linsp = ivalue1; + bigint linsp = ivalue1; while (update->ntimestep >= value) { logsp *= factor; linsp++; if (linsp > logsp) value = linsp; - else value = ceil(logsp)-(((int)ceil(logsp)-1)/ivalue3); + else value = ceil(logsp)-(((bigint)ceil(logsp)-1)/ivalue3); } } if (update->ntimestep > ivalue3) @@ -3666,15 +3666,15 @@ int Variable::math_function(char *word, char *contents, Tree **tree, print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (tree) newtree->type = STRIDE; else { - int ivalue1 = static_cast (value1); - int ivalue2 = static_cast (value2); - int ivalue3 = static_cast (values[0]); + bigint ivalue1 = static_cast (value1); + bigint ivalue2 = static_cast (value2); + bigint ivalue3 = static_cast (values[0]); if (ivalue1 < 0 || ivalue2 < 0 || ivalue3 <= 0 || ivalue1 > ivalue2) error->one(FLERR,"Invalid math function in variable formula"); double value; if (update->ntimestep < ivalue1) value = ivalue1; else if (update->ntimestep < ivalue2) { - int offset = update->ntimestep - ivalue1; + bigint offset = update->ntimestep - ivalue1; value = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3; if (value > ivalue2) value = (double) MAXBIGINT; } else value = (double) MAXBIGINT; @@ -3686,12 +3686,12 @@ int Variable::math_function(char *word, char *contents, Tree **tree, print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (tree) newtree->type = STRIDE2; else { - int ivalue1 = static_cast (value1); - int ivalue2 = static_cast (value2); - int ivalue3 = static_cast (values[0]); - int ivalue4 = static_cast (values[1]); - int ivalue5 = static_cast (values[2]); - int ivalue6 = static_cast (values[3]); + bigint ivalue1 = static_cast (value1); + bigint ivalue2 = static_cast (value2); + bigint ivalue3 = static_cast (values[0]); + bigint ivalue4 = static_cast (values[1]); + bigint ivalue5 = static_cast (values[2]); + bigint ivalue6 = static_cast (values[3]); if (ivalue1 < 0 || ivalue2 < 0 || ivalue3 <= 0 || ivalue1 > ivalue2) error->one(FLERR,"Invalid math function in variable formula"); if (ivalue4 < 0 || ivalue5 < 0 || ivalue6 <= 0 || ivalue4 > ivalue5) @@ -3702,14 +3702,14 @@ int Variable::math_function(char *word, char *contents, Tree **tree, if (update->ntimestep < ivalue1) istep = ivalue1; else if (update->ntimestep < ivalue2) { if (update->ntimestep < ivalue4 || update->ntimestep > ivalue5) { - int offset = update->ntimestep - ivalue1; + bigint offset = update->ntimestep - ivalue1; istep = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3; if (update->ntimestep < ivalue4 && istep > ivalue4) istep = ivalue4; } else { - int offset = update->ntimestep - ivalue4; + bigint offset = update->ntimestep - ivalue4; istep = ivalue4 + (offset/ivalue6)*ivalue6 + ivalue6; if (istep > ivalue5) { - int offset = ivalue5 - ivalue1; + bigint offset = ivalue5 - ivalue1; istep = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3; if (istep > ivalue2) istep = MAXBIGINT; } From e223ea3784cbe7b7a8616e763405b90f6335af55 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Feb 2021 19:41:17 -0500 Subject: [PATCH 159/384] cast timestep related expressions to bigint before they can overflow --- src/fix_ave_atom.cpp | 6 +++--- src/fix_ave_chunk.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/fix_ave_atom.cpp b/src/fix_ave_atom.cpp index 7182855766..affdf001f9 100644 --- a/src/fix_ave_atom.cpp +++ b/src/fix_ave_atom.cpp @@ -374,7 +374,7 @@ void FixAveAtom::end_of_step() } irepeat = 0; - nvalid = ntimestep+peratom_freq - (nrepeat-1)*nevery; + nvalid = ntimestep+peratom_freq - ((bigint)nrepeat-1)*nevery; modify->addstep_compute(nvalid); if (array == nullptr) return; @@ -394,7 +394,7 @@ void FixAveAtom::end_of_step() double FixAveAtom::memory_usage() { double bytes; - bytes = atom->nmax*nvalues * sizeof(double); + bytes = (double)atom->nmax*nvalues * sizeof(double); return bytes; } @@ -452,7 +452,7 @@ bigint FixAveAtom::nextvalid() if (nvalid-peratom_freq == update->ntimestep && nrepeat == 1) nvalid = update->ntimestep; else - nvalid -= (nrepeat-1)*nevery; + nvalid -= ((bigint)nrepeat-1)*nevery; if (nvalid < update->ntimestep) nvalid += peratom_freq; return nvalid; } diff --git a/src/fix_ave_chunk.cpp b/src/fix_ave_chunk.cpp index c65e0030c5..d13d46fc20 100644 --- a/src/fix_ave_chunk.cpp +++ b/src/fix_ave_chunk.cpp @@ -583,7 +583,7 @@ void FixAveChunk::end_of_step() } allocate(); if (nrepeat > 1 && ave == ONE) - cchunk->lock(this,ntimestep,ntimestep+(nrepeat-1)*nevery); + cchunk->lock(this,ntimestep,ntimestep+((bigint)nrepeat-1)*nevery); else if ((ave == RUNNING || ave == WINDOW) && !lockforever) { cchunk->lock(this,update->ntimestep,-1); lockforever = 1; @@ -841,7 +841,7 @@ void FixAveChunk::end_of_step() } irepeat = 0; - nvalid = ntimestep+nfreq - (nrepeat-1)*nevery; + nvalid = ntimestep+nfreq - ((bigint)nrepeat-1)*nevery; modify->addstep_compute(nvalid); // unlock compute chunk/atom at end of Nfreq epoch @@ -1120,7 +1120,7 @@ bigint FixAveChunk::nextvalid() if (nvalid-nfreq == update->ntimestep && nrepeat == 1) nvalid = update->ntimestep; else - nvalid -= (nrepeat-1)*nevery; + nvalid -= ((bigint)nrepeat-1)*nevery; if (nvalid < update->ntimestep) nvalid += nfreq; return nvalid; } From 12f49c4c89616c2f7adfe4eea582717db8f5a6ce Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Feb 2021 19:42:07 -0500 Subject: [PATCH 160/384] avoid overflow when computing memory address offsets on 64-bit machines --- src/fix_store.cpp | 4 ++-- src/irregular.cpp | 4 ++-- src/my_pool_chunk.cpp | 10 +++++----- src/pair_table.cpp | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/fix_store.cpp b/src/fix_store.cpp index 9df9fcd3bd..f979cf9da0 100644 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -167,8 +167,8 @@ void FixStore::write_restart(FILE *fp) rbuf[0] = nrow; rbuf[1] = ncol; - if (vecflag) memcpy(&rbuf[2],vstore,nrow*sizeof(double)); - else memcpy(&rbuf[2],&astore[0][0],nrow*ncol*sizeof(double)); + if (vecflag) memcpy(&rbuf[2],vstore,sizeof(double)*nrow); + else memcpy(&rbuf[2],&astore[0][0],sizeof(double)*nrow*ncol); int n = nrow*ncol + 2; if (comm->me == 0) { diff --git a/src/irregular.cpp b/src/irregular.cpp index 330a96f514..c1c4ff44fb 100644 --- a/src/irregular.cpp +++ b/src/irregular.cpp @@ -930,11 +930,11 @@ void Irregular::exchange_data(char *sendbuf, int nbytes, char *recvbuf) // post all receives, starting after self copies - bigint offset = num_self*(bigint)nbytes; + bigint offset = (bigint)num_self*(bigint)nbytes; for (int irecv = 0; irecv < nrecv_proc; irecv++) { MPI_Irecv(&recvbuf[offset],num_recv[irecv]*nbytes,MPI_CHAR, proc_recv[irecv],0,world,&request[irecv]); - offset += num_recv[irecv]*nbytes; + offset += (bigint)num_recv[irecv]*nbytes; } // reallocate buf for largest send if necessary diff --git a/src/my_pool_chunk.cpp b/src/my_pool_chunk.cpp index 8bf40840fe..d866804adc 100644 --- a/src/my_pool_chunk.cpp +++ b/src/my_pool_chunk.cpp @@ -174,9 +174,9 @@ template void MyPoolChunk::allocate(int ibin) { int oldpage = npage; npage += pagedelta; - freelist = (int *) realloc(freelist,npage*chunkperpage*sizeof(int)); - pages = (T **) realloc(pages,npage*sizeof(T *)); - whichbin = (int *) realloc(whichbin,npage*sizeof(int)); + freelist = (int *) realloc(freelist,sizeof(int)*npage*chunkperpage); + pages = (T **) realloc(pages,sizeof(T *)*npage); + whichbin = (int *) realloc(whichbin,sizeof(int)*npage); if (!freelist || !pages) { errorflag = 2; return; @@ -189,11 +189,11 @@ void MyPoolChunk::allocate(int ibin) { #if defined(LAMMPS_MEMALIGN) void *ptr; if (posix_memalign(&ptr, LAMMPS_MEMALIGN, - chunkperpage*chunksize[ibin]*sizeof(T))) + sizeof(T)*chunkperpage*chunksize[ibin])) errorflag = 2; pages[i] = (T *) ptr; #else - pages[i] = (T *) malloc(chunkperpage*chunksize[ibin]*sizeof(T)); + pages[i] = (T *) malloc(sizeof(T)*chunkperpage*chunksize[ibin]); if (!pages[i]) errorflag = 2; #endif } diff --git a/src/pair_table.cpp b/src/pair_table.cpp index 124e9139ec..7e331a16a4 100644 --- a/src/pair_table.cpp +++ b/src/pair_table.cpp @@ -195,9 +195,9 @@ void PairTable::allocate() memory->create(cutsq,nt,nt,"pair:cutsq"); memory->create(tabindex,nt,nt,"pair:tabindex"); - memset(&setflag[0][0],0,nt*nt*sizeof(int)); - memset(&cutsq[0][0],0,nt*nt*sizeof(double)); - memset(&tabindex[0][0],0,nt*nt*sizeof(int)); + memset(&setflag[0][0],0,sizeof(int)*nt*nt); + memset(&cutsq[0][0],0,sizeof(double)*nt*nt); + memset(&tabindex[0][0],0,sizeof(int)*nt*nt); } /* ---------------------------------------------------------------------- From 26037982bce6cb962aed34ec469b8bf9ff0d8a97 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Feb 2021 19:42:40 -0500 Subject: [PATCH 161/384] convert to double early when computing memory usage --- src/QEQ/fix_qeq.cpp | 2 +- src/USER-DIFFRACTION/compute_xrd.cpp | 2 +- src/USER-MISC/pair_gauss_cut.cpp | 4 ++-- src/USER-REAXC/fix_qeq_reax.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp index 1ad01e5c4e..a63e008b36 100644 --- a/src/QEQ/fix_qeq.cpp +++ b/src/QEQ/fix_qeq.cpp @@ -524,7 +524,7 @@ double FixQEq::memory_usage() { double bytes; - bytes = atom->nmax*nprev*2 * sizeof(double); // s_hist & t_hist + bytes = (double)atom->nmax*nprev*2 * sizeof(double); // s_hist & t_hist bytes += (double)atom->nmax*11 * sizeof(double); // storage bytes += (double)n_cap*2 * sizeof(int); // matrix... bytes += (double)m_cap * sizeof(int); diff --git a/src/USER-DIFFRACTION/compute_xrd.cpp b/src/USER-DIFFRACTION/compute_xrd.cpp index 7c3cb28e49..a077df0183 100644 --- a/src/USER-DIFFRACTION/compute_xrd.cpp +++ b/src/USER-DIFFRACTION/compute_xrd.cpp @@ -524,7 +524,7 @@ void ComputeXRD::compute_array() double ComputeXRD::memory_usage() { - double bytes = size_array_rows * size_array_cols * sizeof(double); //array + double bytes = (double)size_array_rows * size_array_cols * sizeof(double); //array bytes += (double) 4.0 * size_array_rows * sizeof(double); //Fvec1 & 2, scratch1 & 2 bytes += (double)3.0 * nlocalgroup * sizeof(double); // xlocal bytes += (double)nlocalgroup * sizeof(int); // typelocal diff --git a/src/USER-MISC/pair_gauss_cut.cpp b/src/USER-MISC/pair_gauss_cut.cpp index 80101b8f97..85f4446358 100644 --- a/src/USER-MISC/pair_gauss_cut.cpp +++ b/src/USER-MISC/pair_gauss_cut.cpp @@ -392,8 +392,8 @@ double PairGaussCut::memory_usage() double bytes = Pair::memory_usage(); - bytes += (double)7*((n+1)*(n+1) * sizeof(double) + (n+1)*sizeof(double *)); - bytes += (double)1*((n+1)*(n+1) * sizeof(int) + (n+1)*sizeof(int *)); + bytes += 7.0*((n+1.0)*(n+1.0) * sizeof(double) + (n+1.0)*sizeof(double *)); + bytes += 1.0*((n+1.0)*(n+1.0) * sizeof(int) + (n+1.0)*sizeof(int *)); return bytes; } diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp index dd978c7582..355cbbb770 100644 --- a/src/USER-REAXC/fix_qeq_reax.cpp +++ b/src/USER-REAXC/fix_qeq_reax.cpp @@ -899,7 +899,7 @@ double FixQEqReax::memory_usage() { double bytes; - bytes = atom->nmax*nprev*2 * sizeof(double); // s_hist & t_hist + bytes = (double)atom->nmax*nprev*2 * sizeof(double); // s_hist & t_hist bytes += (double)atom->nmax*11 * sizeof(double); // storage bytes += (double)n_cap*2 * sizeof(int); // matrix... bytes += (double)m_cap * sizeof(int); From 1380b7b142ab1bf2b510cd21a0c3056405f44a86 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Feb 2021 18:04:41 -0500 Subject: [PATCH 162/384] replace (temporary) long double with double. --- src/KSPACE/pppm_disp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/KSPACE/pppm_disp.cpp b/src/KSPACE/pppm_disp.cpp index 28aa68ff14..b6f05606b6 100644 --- a/src/KSPACE/pppm_disp.cpp +++ b/src/KSPACE/pppm_disp.cpp @@ -742,8 +742,8 @@ void PPPMDisp::setup() fkz2_6[i] = unitkz*per; } double sqk,vterm; - long double erft,expt,nom,denom; - long double b,bs,bt; + double erft,expt,nom,denom; + double b,bs,bt; double rtpi = sqrt(MY_PI); double gewinv = 1/g_ewald_6; n = 0; From 77402bdbc877746eacb5a9e2f4d4ea422bd50eff Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Feb 2021 18:12:47 -0500 Subject: [PATCH 163/384] avoid overflows when computing memory offsets and allocating memory --- src/KSPACE/remap.cpp | 2 +- src/OPT/pair_eam_opt.cpp | 4 ++-- src/USER-DPD/pair_multi_lucy.cpp | 6 +++--- src/USER-DPD/pair_multi_lucy_rx.cpp | 6 +++--- src/USER-MISC/fix_imd.cpp | 4 ++-- src/USER-MISC/fix_ttm_mod.cpp | 2 +- src/USER-PHONON/fix_phonon.cpp | 2 +- src/USER-REAXC/reaxc_allocate.cpp | 4 ++-- src/angle_hybrid.cpp | 2 +- src/bond_hybrid.cpp | 2 +- src/comm.cpp | 9 +++++---- src/compute_orientorder_atom.cpp | 2 +- src/memory.h | 10 +++++----- 13 files changed, 28 insertions(+), 27 deletions(-) diff --git a/src/KSPACE/remap.cpp b/src/KSPACE/remap.cpp index c3c3703d1d..ab2ec687d7 100644 --- a/src/KSPACE/remap.cpp +++ b/src/KSPACE/remap.cpp @@ -597,7 +597,7 @@ struct remap_plan_3d *remap_3d_create_plan( if (memory == 1) { if (nrecv > 0) { plan->scratch = - (FFT_SCALAR *) malloc(nqty*out.isize*out.jsize*out.ksize * + (FFT_SCALAR *) malloc((size_t)nqty*out.isize*out.jsize*out.ksize * sizeof(FFT_SCALAR)); if (plan->scratch == nullptr) return nullptr; } diff --git a/src/OPT/pair_eam_opt.cpp b/src/OPT/pair_eam_opt.cpp index c7d3541e67..67923515c9 100644 --- a/src/OPT/pair_eam_opt.cpp +++ b/src/OPT/pair_eam_opt.cpp @@ -112,7 +112,7 @@ void PairEAMOpt::eval() int ntypes2 = ntypes*ntypes; fast_alpha_t* _noalias fast_alpha = - (fast_alpha_t*) malloc(ntypes2*(nr+1)*sizeof(fast_alpha_t)); + (fast_alpha_t*) malloc((size_t)ntypes2*(nr+1)*sizeof(fast_alpha_t)); for (i = 0; i < ntypes; i++) for (j = 0; j < ntypes; j++) { fast_alpha_t* _noalias tab = &fast_alpha[i*ntypes*nr+j*nr]; if (type2rhor[i+1][j+1] >= 0) { @@ -135,7 +135,7 @@ void PairEAMOpt::eval() fast_alpha_t* _noalias tabeight = fast_alpha; fast_gamma_t* _noalias fast_gamma = - (fast_gamma_t*) malloc(ntypes2*(nr+1)*sizeof(fast_gamma_t)); + (fast_gamma_t*) malloc((size_t)ntypes2*(nr+1)*sizeof(fast_gamma_t)); for (i = 0; i < ntypes; i++) for (j = 0; j < ntypes; j++) { fast_gamma_t* _noalias tab = &fast_gamma[i*ntypes*nr+j*nr]; if (type2rhor[i+1][j+1] >= 0) { diff --git a/src/USER-DPD/pair_multi_lucy.cpp b/src/USER-DPD/pair_multi_lucy.cpp index 11bc1c7ba5..70ea8b40ad 100644 --- a/src/USER-DPD/pair_multi_lucy.cpp +++ b/src/USER-DPD/pair_multi_lucy.cpp @@ -221,9 +221,9 @@ void PairMultiLucy::allocate() memory->create(cutsq,nt,nt,"pair:cutsq"); memory->create(tabindex,nt,nt,"pair:tabindex"); - memset(&setflag[0][0],0,nt*nt*sizeof(int)); - memset(&cutsq[0][0],0,nt*nt*sizeof(double)); - memset(&tabindex[0][0],0,nt*nt*sizeof(int)); + memset(&setflag[0][0],0,sizeof(int)*nt*nt); + memset(&cutsq[0][0],0,sizeof(double)*nt*nt); + memset(&tabindex[0][0],0,sizeof(int)*nt*nt); } /* ---------------------------------------------------------------------- diff --git a/src/USER-DPD/pair_multi_lucy_rx.cpp b/src/USER-DPD/pair_multi_lucy_rx.cpp index e1a263b7dc..bd720ae138 100644 --- a/src/USER-DPD/pair_multi_lucy_rx.cpp +++ b/src/USER-DPD/pair_multi_lucy_rx.cpp @@ -310,9 +310,9 @@ void PairMultiLucyRX::allocate() memory->create(cutsq,nt,nt,"pair:cutsq"); memory->create(tabindex,nt,nt,"pair:tabindex"); - memset(&setflag[0][0],0,nt*nt*sizeof(int)); - memset(&cutsq[0][0],0,nt*nt*sizeof(double)); - memset(&tabindex[0][0],0,nt*nt*sizeof(int)); + memset(&setflag[0][0],0,sizeof(int)*nt*nt); + memset(&cutsq[0][0],0,sizeof(double)*nt*nt); + memset(&tabindex[0][0],0,sizeof(int)*nt*nt); } /* ---------------------------------------------------------------------- diff --git a/src/USER-MISC/fix_imd.cpp b/src/USER-MISC/fix_imd.cpp index 0da5b29b62..8796de289e 100644 --- a/src/USER-MISC/fix_imd.cpp +++ b/src/USER-MISC/fix_imd.cpp @@ -919,7 +919,7 @@ void FixIMD::post_force(int /*vflag*/) if (imd_forces < length) { /* grow holding space for forces, if needed. */ memory->destroy(force_buf); - force_buf = (void *) memory->smalloc(length*size_one, + force_buf = (void *) memory->smalloc((bigint)length*size_one, "imd:force_buf"); } imd_forces = length; @@ -960,7 +960,7 @@ void FixIMD::post_force(int /*vflag*/) if (old_imd_forces < imd_forces) { /* grow holding space for forces, if needed. */ if (force_buf != nullptr) memory->sfree(force_buf); - force_buf = memory->smalloc(imd_forces*size_one, "imd:force_buf"); + force_buf = memory->smalloc((bigint)imd_forces*size_one, "imd:force_buf"); } } MPI_Bcast(force_buf, imd_forces*size_one, MPI_BYTE, 0, world); diff --git a/src/USER-MISC/fix_ttm_mod.cpp b/src/USER-MISC/fix_ttm_mod.cpp index 9cac1c02b2..7056ad6a00 100644 --- a/src/USER-MISC/fix_ttm_mod.cpp +++ b/src/USER-MISC/fix_ttm_mod.cpp @@ -136,7 +136,7 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) : gfactor1 = new double[atom->ntypes+1]; gfactor2 = new double[atom->ntypes+1]; // allocate 3d grid variables - total_nnodes = nxnodes*nynodes*nznodes; + total_nnodes = (bigint)nxnodes*nynodes*nznodes; memory->create(nsum,nxnodes,nynodes,nznodes,"ttm/mod:nsum"); memory->create(nsum_all,nxnodes,nynodes,nznodes,"ttm/mod:nsum_all"); memory->create(sum_vsq,nxnodes,nynodes,nznodes,"ttm/mod:sum_vsq"); diff --git a/src/USER-PHONON/fix_phonon.cpp b/src/USER-PHONON/fix_phonon.cpp index 455ca80b12..30fb7baad5 100644 --- a/src/USER-PHONON/fix_phonon.cpp +++ b/src/USER-PHONON/fix_phonon.cpp @@ -723,7 +723,7 @@ void FixPhonon::postprocess( ) fwrite(&nucell, sizeof(int), 1, fp_bin); fwrite(&boltz, sizeof(double), 1, fp_bin); - fwrite(Phi_all[0],sizeof(double),ntotal*fft_dim2*2,fp_bin); + fwrite(Phi_all[0],sizeof(double),(bigint)ntotal*fft_dim2*2,fp_bin); fwrite(&TempAve, sizeof(double),1, fp_bin); fwrite(&basevec[0], sizeof(double),9, fp_bin); diff --git a/src/USER-REAXC/reaxc_allocate.cpp b/src/USER-REAXC/reaxc_allocate.cpp index f043dc85d6..9ba92b9dfa 100644 --- a/src/USER-REAXC/reaxc_allocate.cpp +++ b/src/USER-REAXC/reaxc_allocate.cpp @@ -302,10 +302,10 @@ int Allocate_Workspace( reax_system * /*system*/, control_params * control, // storage for reductions with multiple threads #ifdef LMP_USER_OMP - workspace->CdDeltaReduction = (double *) scalloc(control->error_ptr, sizeof(double), total_cap*control->nthreads, + workspace->CdDeltaReduction = (double *) scalloc(control->error_ptr, sizeof(double), (rc_bigint)total_cap*control->nthreads, "cddelta_reduce"); - workspace->forceReduction = (rvec *) scalloc(control->error_ptr, sizeof(rvec), total_cap*control->nthreads, + workspace->forceReduction = (rvec *) scalloc(control->error_ptr, sizeof(rvec), (rc_bigint)total_cap*control->nthreads, "forceReduction"); workspace->valence_angle_atom_myoffset = (int *) scalloc(control->error_ptr, sizeof(int), total_cap, "valence_angle_atom_myoffset"); diff --git a/src/angle_hybrid.cpp b/src/angle_hybrid.cpp index 1e4ade3ca8..d7e3051b90 100644 --- a/src/angle_hybrid.cpp +++ b/src/angle_hybrid.cpp @@ -113,7 +113,7 @@ void AngleHybrid::compute(int eflag, int vflag) const int nthreads = comm->nthreads; if (comm->nthreads > 1) { - const int nall = atom->nlocal + atom->nghost; + const bigint nall = atom->nlocal + atom->nghost; if (eflag_atom) memset(&eatom[0],0,nall*nthreads*sizeof(double)); if (vflag_atom) diff --git a/src/bond_hybrid.cpp b/src/bond_hybrid.cpp index 3a6bb4b7de..f1debc0676 100644 --- a/src/bond_hybrid.cpp +++ b/src/bond_hybrid.cpp @@ -113,7 +113,7 @@ void BondHybrid::compute(int eflag, int vflag) const int nthreads = comm->nthreads; if (nthreads > 1) { - const int nall = atom->nlocal + atom->nghost; + const bigint nall = atom->nlocal + atom->nghost; if (eflag_atom) memset(&eatom[0],0,nall*nthreads*sizeof(double)); if (vflag_atom) diff --git a/src/comm.cpp b/src/comm.cpp index 77d1ade148..8e119744fc 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -979,7 +979,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, offsets[0] = 0; for (int i = 1; i < nprocs; i++) - offsets[i] = offsets[i-1] + insize*procs_a2a[i-1]; + offsets[i] = offsets[i-1] + (bigint)insize*procs_a2a[i-1]; bigint offset = 0; for (int i = 0; i < n; i++) { @@ -989,7 +989,8 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, offset += insize; } - all2all1_bytes = nprocs*sizeof(int) + nprocs*sizeof(bigint) + n*insize; + all2all1_bytes = nprocs*sizeof(int) + nprocs*sizeof(bigint) + + (bigint)n*insize; } else { procs_a2a = procs; @@ -1085,7 +1086,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, offsets[0] = 0; for (int i = 1; i < nprocs; i++) - offsets[i] = offsets[i-1] + outsize*procs_a2a[i-1]; + offsets[i] = offsets[i-1] + (bigint)outsize*procs_a2a[i-1]; bigint offset = 0; for (int i = 0; i < nrvous_out; i++) { @@ -1096,7 +1097,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, } all2all2_bytes = nprocs*sizeof(int) + nprocs*sizeof(bigint) + - nrvous_out*outsize; + (bigint)nrvous_out*outsize; } else { procs_a2a = procs_rvous; diff --git a/src/compute_orientorder_atom.cpp b/src/compute_orientorder_atom.cpp index eb5a96b706..8a836a97b8 100644 --- a/src/compute_orientorder_atom.cpp +++ b/src/compute_orientorder_atom.cpp @@ -258,7 +258,7 @@ void ComputeOrientOrderAtom::compute_peratom() double **x = atom->x; int *mask = atom->mask; - memset(&qnarray[0][0],0,nmax*ncol*sizeof(double)); + memset(&qnarray[0][0],0,sizeof(double)*nmax*ncol); for (ii = 0; ii < inum; ii++) { i = ilist[ii]; diff --git a/src/memory.h b/src/memory.h index 64685feac0..d85eb64a36 100644 --- a/src/memory.h +++ b/src/memory.h @@ -410,18 +410,18 @@ class Memory : protected Pointers { nbytes = ((bigint) sizeof(TYPE ***)) * n1; array = (TYPE ****) smalloc(nbytes,name); - int i,j,k; + bigint i,j,k; bigint m1,m2; bigint n = 0; for (i = 0; i < n1; i++) { - m2 = ((bigint) i) * n2; + m2 = i * n2; array[i] = &plane[m2]; for (j = 0; j < n2; j++) { - m1 = ((bigint) i) * n2 + j; - m2 = ((bigint) i) * n2*n3 + j*n3; + m1 = i * n2 + j; + m2 = i * n2*n3 + j*n3; plane[m1] = &cube[m2]; for (k = 0; k < n3; k++) { - m1 = ((bigint) i) * n2*n3 + j*n3 + k; + m1 = i * n2*n3 + j*n3 + k; cube[m1] = &data[n]; n += n4; } From 779bbd0853b8be4530b25bfdc31ca4b4df2730a3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Feb 2021 18:15:24 -0500 Subject: [PATCH 164/384] avoid overflows when computing time or timestep related values --- src/GRANULAR/fix_pour.cpp | 10 +++++----- src/REPLICA/prd.cpp | 2 +- src/USER-DIFFRACTION/fix_saed_vtk.cpp | 4 ++-- src/USER-OMP/reaxc_forces_omp.cpp | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index 9ecde81f53..54b7366003 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -263,7 +263,7 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) : nper = static_cast (volfrac*volume/volume_one); if (nper == 0) error->all(FLERR,"Fix pour insertion count per timestep is 0"); - int nfinal = update->ntimestep + 1 + (ninsert-1)/nper * nfreq; + int nfinal = update->ntimestep + 1 + ((bigint)ninsert-1)/nper * nfreq; // print stats @@ -705,10 +705,10 @@ void FixPour::pre_exchange() if (atom->natoms < 0) error->all(FLERR,"Too many total atoms"); if (mode == MOLECULE) { - atom->nbonds += onemols[imol]->nbonds * ninserted_mols; - atom->nangles += onemols[imol]->nangles * ninserted_mols; - atom->ndihedrals += onemols[imol]->ndihedrals * ninserted_mols; - atom->nimpropers += onemols[imol]->nimpropers * ninserted_mols; + atom->nbonds += (bigint)onemols[imol]->nbonds * ninserted_mols; + atom->nangles += (bigint)onemols[imol]->nangles * ninserted_mols; + atom->ndihedrals += (bigint)onemols[imol]->ndihedrals * ninserted_mols; + atom->nimpropers += (bigint)onemols[imol]->nimpropers * ninserted_mols; } if (maxtag_all >= MAXTAGINT) error->all(FLERR,"New atom IDs exceed maximum allowed ID"); diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp index bd9525ea10..de45116194 100644 --- a/src/REPLICA/prd.cpp +++ b/src/REPLICA/prd.cpp @@ -310,7 +310,7 @@ void PRD::command(int narg, char **arg) dynamics(t_event,time_dynamics); fix_event->store_state_quench(); quench(); - clock = clock + t_event*universe->nworlds; + clock += (bigint)t_event*universe->nworlds; ireplica = check_event(); if (ireplica >= 0) break; fix_event->restore_state_quench(); diff --git a/src/USER-DIFFRACTION/fix_saed_vtk.cpp b/src/USER-DIFFRACTION/fix_saed_vtk.cpp index 26bc4dc0a1..90eedb1127 100644 --- a/src/USER-DIFFRACTION/fix_saed_vtk.cpp +++ b/src/USER-DIFFRACTION/fix_saed_vtk.cpp @@ -343,7 +343,7 @@ void FixSAEDVTK::invoke_vector(bigint ntimestep) } irepeat = 0; - nvalid = ntimestep+nfreq - (nrepeat-1)*nevery; + nvalid = ntimestep+nfreq - ((bigint)nrepeat-1)*nevery; modify->addstep_compute(nvalid); // average the final result for the Nfreq timestep @@ -554,7 +554,7 @@ bigint FixSAEDVTK::nextvalid() if (nvalid-nfreq == update->ntimestep && nrepeat == 1) nvalid = update->ntimestep; else - nvalid -= (nrepeat-1)*nevery; + nvalid -= ((bigint)nrepeat-1)*nevery; if (nvalid < update->ntimestep) nvalid += nfreq; return nvalid; } diff --git a/src/USER-OMP/reaxc_forces_omp.cpp b/src/USER-OMP/reaxc_forces_omp.cpp index 7fe6a41e9d..5eb939cf8c 100644 --- a/src/USER-OMP/reaxc_forces_omp.cpp +++ b/src/USER-OMP/reaxc_forces_omp.cpp @@ -145,7 +145,7 @@ void Compute_Total_ForceOMP( reax_system *system, control_params *control, int natoms = system->N; int nthreads = control->nthreads; - long totalReductionSize = system->N * nthreads; + long totalReductionSize = (bigint)system->N * nthreads; reax_list *bonds = (*lists) + BONDS; #if defined(_OPENMP) @@ -381,8 +381,8 @@ void Init_Forces_noQEq_OMP( reax_system *system, control_params *control, #else int tid = 0; #endif - long reductionOffset = system->N * tid; - long totalReductionSize = system->N * nthreads; + long reductionOffset = (bigint)system->N * tid; + long totalReductionSize = (bigint)system->N * nthreads; #if defined(_OPENMP) #pragma omp for schedule(dynamic,50) reduction(+:num_bonds) From 1609c498bcd0f9caa3ef60dcf4d490982da0c248 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Feb 2021 18:15:48 -0500 Subject: [PATCH 165/384] avoid integer overflow when computing memory usage --- src/MANYBODY/pair_vashishta_table.cpp | 3 +-- src/RIGID/fix_rigid.cpp | 4 ++-- src/RIGID/fix_rigid_small.cpp | 4 ++-- src/USER-MISC/fix_ave_correlate_long.cpp | 4 ++-- src/USER-MISC/fix_pimd.cpp | 4 +--- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/MANYBODY/pair_vashishta_table.cpp b/src/MANYBODY/pair_vashishta_table.cpp index 475710a396..76b44d8664 100644 --- a/src/MANYBODY/pair_vashishta_table.cpp +++ b/src/MANYBODY/pair_vashishta_table.cpp @@ -289,6 +289,5 @@ void PairVashishtaTable::create_tables() double PairVashishtaTable::memory_usage() { - double bytes = 2*nelements*nelements*sizeof(double)*ntable; - return bytes; + return (double)2*nelements*nelements*sizeof(double)*ntable; } diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index 8a8456393c..53b1f4c897 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -2452,8 +2452,8 @@ double FixRigid::memory_usage() bytes += (double)maxvatom*6 * sizeof(double); // vatom if (extended) { bytes += (double)nmax * sizeof(int); - if (orientflag) bytes = nmax*orientflag * sizeof(double); - if (dorientflag) bytes = nmax*3 * sizeof(double); + if (orientflag) bytes = (double)nmax*orientflag * sizeof(double); + if (dorientflag) bytes = (double)nmax*3 * sizeof(double); } return bytes; } diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 8129526d9c..a33703efa4 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -3564,8 +3564,8 @@ double FixRigidSmall::memory_usage() bytes += (double)maxvatom*6 * sizeof(double); // vatom if (extended) { bytes += (double)nmax * sizeof(int); - if (orientflag) bytes = nmax*orientflag * sizeof(double); - if (dorientflag) bytes = nmax*3 * sizeof(double); + if (orientflag) bytes = (double)nmax*orientflag * sizeof(double); + if (dorientflag) bytes = (double)nmax*3 * sizeof(double); } bytes += (double)nmax_body * sizeof(Body); return bytes; diff --git a/src/USER-MISC/fix_ave_correlate_long.cpp b/src/USER-MISC/fix_ave_correlate_long.cpp index 2aafe9bac0..deeec0f1c7 100644 --- a/src/USER-MISC/fix_ave_correlate_long.cpp +++ b/src/USER-MISC/fix_ave_correlate_long.cpp @@ -702,8 +702,8 @@ double FixAveCorrelateLong::memory_usage() { // f: npair x numcorrelators x p double bytes = (4*npair*numcorrelators*p + 2*npair*numcorrelators + numcorrelators*p)*sizeof(double) - + numcorrelators*p*sizeof(unsigned long int) - + 2*numcorrelators*sizeof(unsigned int); + + (double)numcorrelators*p*sizeof(unsigned long int) + + 2.0*numcorrelators*sizeof(unsigned int); return bytes; } diff --git a/src/USER-MISC/fix_pimd.cpp b/src/USER-MISC/fix_pimd.cpp index 5571f1cf35..097eb0b28f 100644 --- a/src/USER-MISC/fix_pimd.cpp +++ b/src/USER-MISC/fix_pimd.cpp @@ -726,9 +726,7 @@ void FixPIMD::unpack_forward_comm(int n, int first, double *buf) double FixPIMD::memory_usage() { - double bytes = 0; - bytes = atom->nmax * size_peratom_cols * sizeof(double); - return bytes; + return (double)atom->nmax * size_peratom_cols * sizeof(double); } /* ---------------------------------------------------------------------- */ From 5573d01079d72885286e184fffa69da2cb91fbf1 Mon Sep 17 00:00:00 2001 From: Giacomo Fiorin Date: Sat, 6 Feb 2021 17:30:01 -0500 Subject: [PATCH 166/384] Use typecast to silence CodeQL warnings --- lib/colvars/colvargrid.cpp | 24 ++++++++++++------------ lib/colvars/colvargrid.h | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/colvars/colvargrid.cpp b/lib/colvars/colvargrid.cpp index 7c2fe3b33c..6cf2cdee45 100644 --- a/lib/colvars/colvargrid.cpp +++ b/lib/colvars/colvargrid.cpp @@ -423,8 +423,8 @@ void integrate_potential::atimes(const std::vector &A, std::vector(w - 1); // Follows right edge if (periodic[0]) { xm = h * (w - 1); xp = h; @@ -478,7 +478,7 @@ void integrate_potential::atimes(const std::vector &A, std::vector &A, std::vector(h); // Skip left slab fact = facty * factz; for (i=1; i &A, std::vector(w - 1); // Follows right slab if (periodic[0]) { xm = d * h * (w - 1); xp = d * h; @@ -639,8 +639,8 @@ void integrate_potential::atimes(const std::vector &A, std::vector(d - 1); // Follows back slab if (periodic[1]) { ym = h * (d - 1); yp = h; @@ -664,8 +664,8 @@ void integrate_potential::atimes(const std::vector &A, std::vector(d - 1); + index2 += h * static_cast(d - 1); } } else { ym = -h; @@ -691,8 +691,8 @@ void integrate_potential::atimes(const std::vector &A, std::vector(d - 1); + index2 += h * static_cast(d - 1); } } diff --git a/lib/colvars/colvargrid.h b/lib/colvars/colvargrid.h index 427e5b0825..17d049a6eb 100644 --- a/lib/colvars/colvargrid.h +++ b/lib/colvars/colvargrid.h @@ -59,7 +59,7 @@ protected: { size_t addr = 0; for (size_t i = 0; i < nd; i++) { - addr += ix[i]*nxc[i]; + addr += ix[i]*static_cast(nxc[i]); if (cvm::debug()) { if (ix[i] >= nx[i]) { cvm::error("Error: exceeding bounds in colvar_grid.\n", BUG_ERROR); From 7c1569459c664bcc45a98cac080187e5d2d8b841 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Feb 2021 18:28:18 -0500 Subject: [PATCH 167/384] Step version strings for next patch release --- doc/lammps.1 | 2 +- src/version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/lammps.1 b/doc/lammps.1 index 299f8538b0..12cff4eeec 100644 --- a/doc/lammps.1 +++ b/doc/lammps.1 @@ -1,4 +1,4 @@ -.TH LAMMPS "24 December 2020" "2020-12-24" +.TH LAMMPS "9 February 2021" "2021-02-09" .SH NAME .B LAMMPS \- Molecular Dynamics Simulator. diff --git a/src/version.h b/src/version.h index f812b62821..c04929c145 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define LAMMPS_VERSION "24 Dec 2020" +#define LAMMPS_VERSION "9 Feb 2021" From 813429631128ee752fb50b237fa70ee9b69bad48 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 7 Feb 2021 09:39:07 -0500 Subject: [PATCH 168/384] fix typo --- doc/src/compute_reduce_chunk.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/compute_reduce_chunk.rst b/doc/src/compute_reduce_chunk.rst index e63f4b7b54..342c6ceb05 100644 --- a/doc/src/compute_reduce_chunk.rst +++ b/doc/src/compute_reduce_chunk.rst @@ -30,7 +30,7 @@ Examples .. code-block:: LAMMPS - compute 1 all reduce/chunk/atom mychunk min c_cluster + compute 1 all reduce/chunk mychunk min c_cluster Description """"""""""" From 06e484d3e0a03e0a1bf3479ede1aa0c89876dced Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 7 Feb 2021 15:30:55 -0500 Subject: [PATCH 169/384] make flags for supporting GPU archs consistent, add ampere consumer GPU arch --- cmake/Modules/Packages/GPU.cmake | 4 ++-- lib/gpu/Makefile.cuda | 3 ++- lib/gpu/Makefile.cuda_mps | 3 ++- lib/gpu/Makefile.linux | 4 ++++ lib/gpu/Makefile.linux_multi | 17 ++++++++++++++++- 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index 141b086592..4c52eee68b 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -97,9 +97,9 @@ if(GPU_API STREQUAL "CUDA") if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0") string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_75,code=[sm_75,compute_75]") endif() - # Ampere (GPU Arch 8.0) is supported by CUDA 11 and later + # Ampere (GPU Arch 8.0 and 8.6) is supported by CUDA 11 and later if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0") - string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]") + string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80] -gencode arch=compute_86,code=[sm_86,compute_86]") endif() if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0") message(WARNING "Unsupported CUDA version. Use at your own risk.") diff --git a/lib/gpu/Makefile.cuda b/lib/gpu/Makefile.cuda index b18e4620eb..e03b59979a 100644 --- a/lib/gpu/Makefile.cuda +++ b/lib/gpu/Makefile.cuda @@ -38,7 +38,8 @@ NVCC = nvcc CUDA_ARCH = -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] \ -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61] \ - -gencode arch=compute_70,code=[sm_70,compute_70] -gencode arch=compute_75,code=[sm_75,compute_75] + -gencode arch=compute_70,code=[sm_70,compute_70] -gencode arch=compute_75,code=[sm_75,compute_75] \ + -gencode arch=compute_80,code=[sm_80,compute_80] -gencode arch=compute_86,code=[sm_86,compute_86] CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler -fPIC diff --git a/lib/gpu/Makefile.cuda_mps b/lib/gpu/Makefile.cuda_mps index c6e5202adc..172640ce6a 100644 --- a/lib/gpu/Makefile.cuda_mps +++ b/lib/gpu/Makefile.cuda_mps @@ -38,7 +38,8 @@ NVCC = nvcc CUDA_ARCH = -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] \ -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61] \ - -gencode arch=compute_70,code=[sm_70,compute_70] -gencode arch=compute_75,code=[sm_75,compute_75] + -gencode arch=compute_70,code=[sm_70,compute_70] -gencode arch=compute_75,code=[sm_75,compute_75] \ + -gencode arch=compute_80,code=[sm_80,compute_80] -gencode arch=compute_86,code=[sm_86,compute_86] CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler -fPIC diff --git a/lib/gpu/Makefile.linux b/lib/gpu/Makefile.linux index da18ae41ca..5fff81072b 100644 --- a/lib/gpu/Makefile.linux +++ b/lib/gpu/Makefile.linux @@ -41,6 +41,10 @@ CUDA_ARCH = -arch=sm_50 # Turing hardware #CUDA_ARCH = -arch=sm_75 +# Ampere hardware +#CUDA_ARCH = -arch=sm_80 +#CUDA_ARCH = -arch=sm_86 + # this setting should match LAMMPS Makefile # one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL diff --git a/lib/gpu/Makefile.linux_multi b/lib/gpu/Makefile.linux_multi index e0c250a951..aa7d92572d 100644 --- a/lib/gpu/Makefile.linux_multi +++ b/lib/gpu/Makefile.linux_multi @@ -31,9 +31,24 @@ NVCC = nvcc CUDA_ARCH = -arch=sm_50 #CUDA_ARCH = -arch=sm_52 +# Pascal hardware +#CUDA_ARCH = -arch=sm_60 +#CUDA_ARCH = -arch=sm_61 + +# Volta hardware +#CUDA_ARCH = -arch=sm_70 + +# Turing hardware +#CUDA_ARCH = -arch=sm_75 + +# Ampere hardware +#CUDA_ARCH = -arch=sm_80 +#CUDA_ARCH = -arch=sm_86 + CUDA_CODE = -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] \ -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61] \ - -gencode arch=compute_70,code=[sm_70,compute_70] -gencode arch=compute_75,code=[sm_75,compute_75] + -gencode arch=compute_70,code=[sm_70,compute_70] -gencode arch=compute_75,code=[sm_75,compute_75] \ + -gencode arch=compute_80,code=[sm_80,compute_80] -gencode arch=compute_86,code=[sm_86,compute_86] CUDA_ARCH += $(CUDA_CODE) From 9cdacbdebd033b9d8f40b38f62320afdfaa6c977 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 7 Feb 2021 21:18:54 -0500 Subject: [PATCH 170/384] apply cast to first variable in sequence of multiplications --- lib/colvars/colvargrid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/colvars/colvargrid.cpp b/lib/colvars/colvargrid.cpp index 6cf2cdee45..df122b1be4 100644 --- a/lib/colvars/colvargrid.cpp +++ b/lib/colvars/colvargrid.cpp @@ -565,7 +565,7 @@ void integrate_potential::atimes(const std::vector &A, std::vector(w - 1); // Follows right slab + index2 = static_cast(d) * h * (w - 1); // Follows right slab if (periodic[0]) { xm = d * h * (w - 1); xp = d * h; From 92605393f7686cb5e7b5063fc04babcf47b9d57e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 8 Feb 2021 10:07:11 -0500 Subject: [PATCH 171/384] correct initialization and memory leaks issues detected by valgrind --- src/USER-FEP/pair_morse_soft.h | 2 +- src/USER-MISC/angle_gaussian.cpp | 21 ++++++++++++--------- src/USER-MISC/bond_gaussian.cpp | 21 ++++++++++++--------- src/USER-MISC/pair_edip_multi.cpp | 8 ++++---- src/create_atoms.cpp | 4 ++-- 5 files changed, 31 insertions(+), 25 deletions(-) diff --git a/src/USER-FEP/pair_morse_soft.h b/src/USER-FEP/pair_morse_soft.h index f5be4de0b0..3a8d5a777f 100644 --- a/src/USER-FEP/pair_morse_soft.h +++ b/src/USER-FEP/pair_morse_soft.h @@ -29,7 +29,7 @@ namespace LAMMPS_NS { class PairMorseSoft : public PairMorse { public: - PairMorseSoft(class LAMMPS *lmp) : PairMorse(lmp) {}; + PairMorseSoft(class LAMMPS *lmp) : PairMorse(lmp), lambda(nullptr) {}; virtual ~PairMorseSoft(); virtual void compute(int, int); diff --git a/src/USER-MISC/angle_gaussian.cpp b/src/USER-MISC/angle_gaussian.cpp index 2150ef7a4b..ad311fdb5d 100644 --- a/src/USER-MISC/angle_gaussian.cpp +++ b/src/USER-MISC/angle_gaussian.cpp @@ -32,7 +32,9 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ -AngleGaussian::AngleGaussian(LAMMPS *lmp) : Angle(lmp) +AngleGaussian::AngleGaussian(LAMMPS *lmp) + : Angle(lmp), nterms(nullptr), angle_temperature(nullptr), + alpha(nullptr), width(nullptr), theta0(nullptr) { } @@ -45,9 +47,9 @@ AngleGaussian::~AngleGaussian() memory->destroy(nterms); memory->destroy(angle_temperature); for (int i = 1; i <= atom->nangletypes; i++) { - if (alpha[i]) delete [] alpha[i]; - if (width[i]) delete [] width[i]; - if (theta0[i]) delete [] theta0[i]; + delete [] alpha[i]; + delete [] width[i]; + delete [] theta0[i]; } delete [] alpha; delete [] width; @@ -180,11 +182,9 @@ void AngleGaussian::allocate() alpha = new double *[n+1]; width = new double *[n+1]; theta0 = new double *[n+1]; - for (int i = 1; i <= n; i++) { - alpha[i] = 0; - width[i] = 0; - theta0[i] = 0; - } + memset(alpha,0,sizeof(double)*(n+1)); + memset(width,0,sizeof(double)*(n+1)); + memset(theta0,0,sizeof(double)*(n+1)); memory->create(setflag,n+1,"angle:setflag"); for (int i = 1; i <= n; i++) setflag[i] = 0; @@ -214,8 +214,11 @@ void AngleGaussian::coeff(int narg, char **arg) for (int i = ilo; i <= ihi; i++) { angle_temperature[i] = angle_temperature_one; nterms[i] = n; + delete[] alpha[i]; alpha[i] = new double [n]; + delete[] width[i]; width[i] = new double [n]; + delete[] theta0[i]; theta0[i] = new double [n]; for (int j = 0; j < n; j++) { alpha[i][j] = utils::numeric(FLERR,arg[3+3*j],false,lmp); diff --git a/src/USER-MISC/bond_gaussian.cpp b/src/USER-MISC/bond_gaussian.cpp index dcb8d7a4ad..350377f5d3 100644 --- a/src/USER-MISC/bond_gaussian.cpp +++ b/src/USER-MISC/bond_gaussian.cpp @@ -31,7 +31,9 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ -BondGaussian::BondGaussian(LAMMPS *lmp) : Bond(lmp) +BondGaussian::BondGaussian(LAMMPS *lmp) + : Bond(lmp), nterms(nullptr), bond_temperature(nullptr), + alpha(nullptr), width(nullptr), r0(nullptr) { reinitflag = 1; } @@ -45,9 +47,9 @@ BondGaussian::~BondGaussian() memory->destroy(nterms); memory->destroy(bond_temperature); for (int i = 1; i <= atom->nbondtypes; i++) { - if (alpha[i]) delete [] alpha[i]; - if (width[i]) delete [] width[i]; - if (r0[i]) delete [] r0[i]; + delete [] alpha[i]; + delete [] width[i]; + delete [] r0[i]; } delete [] alpha; delete [] width; @@ -136,11 +138,9 @@ void BondGaussian::allocate() alpha = new double *[n+1]; width = new double *[n+1]; r0 = new double *[n+1]; - for (int i = 1; i <= n; i++) { - alpha[i] = 0; - width[i] = 0; - r0[i] = 0; - } + memset(alpha,0,sizeof(double)*(n+1)); + memset(width,0,sizeof(double)*(n+1)); + memset(r0,0,sizeof(double)*(n+1)); memory->create(setflag,n+1,"bond:setflag"); for (int i = 1; i <= n; i++) setflag[i] = 0; @@ -168,8 +168,11 @@ void BondGaussian::coeff(int narg, char **arg) for (int i = ilo; i <= ihi; i++) { bond_temperature[i] = bond_temp_one; nterms[i] = n; + delete[] alpha[i]; alpha[i] = new double [n]; + delete[] width[i]; width[i] = new double [n]; + delete[] r0[i]; r0[i] = new double [n]; for (int j = 0; j < n; j++) { alpha[i][j] = utils::numeric(FLERR,arg[3+3*j],false,lmp); diff --git a/src/USER-MISC/pair_edip_multi.cpp b/src/USER-MISC/pair_edip_multi.cpp index 312b829ede..c0969831b9 100644 --- a/src/USER-MISC/pair_edip_multi.cpp +++ b/src/USER-MISC/pair_edip_multi.cpp @@ -72,7 +72,7 @@ static inline void costheta_d(const double *dr_ij, const double r_ij, /* ---------------------------------------------------------------------- */ -PairEDIPMulti::PairEDIPMulti(LAMMPS *lmp) : Pair(lmp) +PairEDIPMulti::PairEDIPMulti(LAMMPS *lmp) : Pair(lmp), preForceCoord(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_pair_edip); @@ -105,9 +105,8 @@ PairEDIPMulti::~PairEDIPMulti() memory->destroy(setflag); memory->destroy(cutsq); delete [] map; - - deallocatePreLoops(); } + deallocatePreLoops(); } /* ---------------------------------------------------------------------- */ @@ -603,8 +602,9 @@ void PairEDIPMulti::coeff(int narg, char **arg) if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); - // allocate tables and internal structures + // (re-)allocate tables and internal structures + deallocatePreLoops(); allocatePreLoops(); } diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index 4abb2c4696..46aff081d9 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -52,7 +52,7 @@ enum{NONE,RATIO,SUBSET}; /* ---------------------------------------------------------------------- */ -CreateAtoms::CreateAtoms(LAMMPS *lmp) : Pointers(lmp) {} +CreateAtoms::CreateAtoms(LAMMPS *lmp) : Pointers(lmp), basistype(nullptr) {} /* ---------------------------------------------------------------------- */ @@ -573,7 +573,7 @@ void CreateAtoms::command(int narg, char **arg) delete ranmol; delete ranlatt; - if (domain->lattice) delete [] basistype; + delete [] basistype; delete [] vstr; delete [] xstr; delete [] ystr; From c810cda64c8d1579426ed53e1e5f2dc51c7224a4 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 8 Feb 2021 10:40:20 -0500 Subject: [PATCH 172/384] must free MPI communicators created by MPI_Comm_split() --- unittest/c-library/test_library_open.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/unittest/c-library/test_library_open.cpp b/unittest/c-library/test_library_open.cpp index d6234c1c04..377f3c53ef 100644 --- a/unittest/c-library/test_library_open.cpp +++ b/unittest/c-library/test_library_open.cpp @@ -72,6 +72,7 @@ TEST(lammps_open, with_args) output = ::testing::internal::GetCapturedStdout(); EXPECT_THAT(output, HasSubstr("Total wall time:")); if (verbose) std::cout << output; + MPI_Comm_free(&mycomm); } TEST(lammps_open, with_kokkos) @@ -195,4 +196,5 @@ TEST(lammps_open_fortran, no_args) output = ::testing::internal::GetCapturedStdout(); EXPECT_THAT(output, HasSubstr("Total wall time:")); if (verbose) std::cout << output; + MPI_Comm_free(&mycomm); } From 01a05b88b47b99ee40854cebb9468d4bf148d1d5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 8 Feb 2021 10:43:18 -0500 Subject: [PATCH 173/384] avoid memory leak in unit test fixture --- unittest/python/test_python_package.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/unittest/python/test_python_package.cpp b/unittest/python/test_python_package.cpp index d8ab860c26..cba77ee2b0 100644 --- a/unittest/python/test_python_package.cpp +++ b/unittest/python/test_python_package.cpp @@ -67,6 +67,7 @@ protected: void TearDown() override { if (!verbose) ::testing::internal::CaptureStdout(); + delete info; delete lmp; if (!verbose) ::testing::internal::GetCapturedStdout(); } From b8282a1152b852029b30bf7719f69909a687f191 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 8 Feb 2021 11:07:13 -0500 Subject: [PATCH 174/384] search for python 3.9 as preferred version as well --- cmake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index a4736740cf..755ee02b12 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -652,7 +652,7 @@ install( if(BUILD_SHARED_LIBS) if(CMAKE_VERSION VERSION_LESS 3.12) # adjust so we find Python 3 versions before Python 2 on old systems with old CMake - set(Python_ADDITIONAL_VERSIONS 3.8 3.7 3.6 3.5) + set(Python_ADDITIONAL_VERSIONS 3.9 3.8 3.7 3.6 3.5) find_package(PythonInterp) # Deprecated since version 3.12 if(PYTHONINTERP_FOUND) set(Python_EXECUTABLE ${PYTHON_EXECUTABLE}) From 3d46b084e829d8f56fc888fb6047dc2da2fb3690 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 8 Feb 2021 11:08:00 -0500 Subject: [PATCH 175/384] must include LAMMPS_MACHINE suffix when installing python package --- cmake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 755ee02b12..c1fef4d4e1 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -665,7 +665,7 @@ if(BUILD_SHARED_LIBS) install-python ${Python_EXECUTABLE} install.py -v ${LAMMPS_SOURCE_DIR}/version.h -p ${LAMMPS_PYTHON_DIR}/lammps - -l ${CMAKE_BINARY_DIR}/liblammps${CMAKE_SHARED_LIBRARY_SUFFIX} + -l ${CMAKE_BINARY_DIR}/liblammps${LAMMPS_MACHINE}${CMAKE_SHARED_LIBRARY_SUFFIX} WORKING_DIRECTORY ${LAMMPS_PYTHON_DIR} COMMENT "Installing LAMMPS Python module") else() From ca1a5731e72872164770f87262ff4fe2c91a4e7e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 8 Feb 2021 12:32:27 -0500 Subject: [PATCH 176/384] remove files left behind by accident --- examples/hBN-momolayer-5nm.data | 892 -------------------------------- examples/in.hBN_shift | 37 -- 2 files changed, 929 deletions(-) delete mode 100644 examples/hBN-momolayer-5nm.data delete mode 100644 examples/in.hBN_shift diff --git a/examples/hBN-momolayer-5nm.data b/examples/hBN-momolayer-5nm.data deleted file mode 100644 index 18ae541279..0000000000 --- a/examples/hBN-momolayer-5nm.data +++ /dev/null @@ -1,892 +0,0 @@ - Makeup graphene nanoribbon on hBN - - 880 atoms - - 2 atom types - - 0.000000000000000 46.152979739999999 xlo xhi - 0.000000000000000 48.443364211584992 ylo yhi - 0.000000000000000 100.000000000000000 zlo zhi - - Atoms - - 1 1 0.420 0.000000000000000 0.000000000000000 0.000000000000000 - 2 2 -0.420 0.698900000000000 1.210530287683010 0.000000000000000 - 3 1 0.420 2.096700000000000 1.210530287683010 0.000000000000000 - 4 2 -0.420 2.795600000000000 0.000000000000000 0.000000000000000 - 5 1 0.420 4.193400000000000 0.000000000000000 0.000000000000000 - 6 2 -0.420 4.892300000000000 1.210530287683010 0.000000000000000 - 7 1 0.420 6.290100000000000 1.210530287683010 0.000000000000000 - 8 2 -0.420 6.989000000000000 0.000000000000000 0.000000000000000 - 9 1 0.420 8.386799999999999 0.000000000000000 0.000000000000000 - 10 2 -0.420 9.085699999999999 1.210530287683010 0.000000000000000 - 11 1 0.420 10.483499999999999 1.210530287683010 0.000000000000000 - 12 2 -0.420 11.182399999999999 0.000000000000000 0.000000000000000 - 13 1 0.420 12.580200000000000 0.000000000000000 0.000000000000000 - 14 2 -0.420 13.279100000000000 1.210530287683010 0.000000000000000 - 15 1 0.420 14.676900000000000 1.210530287683010 0.000000000000000 - 16 2 -0.420 15.375800000000000 0.000000000000000 0.000000000000000 - 17 1 0.420 16.773599999999998 0.000000000000000 0.000000000000000 - 18 2 -0.420 17.472500000000000 1.210530287683010 0.000000000000000 - 19 1 0.420 18.870300000000000 1.210530287683010 0.000000000000000 - 20 2 -0.420 19.569199999999999 0.000000000000000 0.000000000000000 - 21 1 0.420 20.966999999999999 0.000000000000000 0.000000000000000 - 22 2 -0.420 21.665900000000001 1.210530287683010 0.000000000000000 - 23 1 0.420 23.063699999999997 1.210530287683010 0.000000000000000 - 24 2 -0.420 23.762599999999999 0.000000000000000 0.000000000000000 - 25 1 0.420 25.160399999999999 0.000000000000000 0.000000000000000 - 26 2 -0.420 25.859299999999998 1.210530287683010 0.000000000000000 - 27 1 0.420 27.257099999999998 1.210530287683010 0.000000000000000 - 28 2 -0.420 27.956000000000000 0.000000000000000 0.000000000000000 - 29 1 0.420 29.353800000000000 0.000000000000000 0.000000000000000 - 30 2 -0.420 30.052699999999998 1.210530287683010 0.000000000000000 - 31 1 0.420 31.450499999999998 1.210530287683010 0.000000000000000 - 32 2 -0.420 32.149400000000000 0.000000000000000 0.000000000000000 - 33 1 0.420 33.547199999999997 0.000000000000000 0.000000000000000 - 34 2 -0.420 34.246099999999998 1.210530287683010 0.000000000000000 - 35 1 0.420 35.643899999999995 1.210530287683010 0.000000000000000 - 36 2 -0.420 36.342799999999997 0.000000000000000 0.000000000000000 - 37 1 0.420 37.740600000000001 0.000000000000000 0.000000000000000 - 38 2 -0.420 38.439499999999995 1.210530287683010 0.000000000000000 - 39 1 0.420 39.837299999999999 1.210530287683010 0.000000000000000 - 40 2 -0.420 40.536200000000001 0.000000000000000 0.000000000000000 - 41 1 0.420 41.933999999999997 0.000000000000000 0.000000000000000 - 42 2 -0.420 42.632899999999999 1.210530287683010 0.000000000000000 - 43 1 0.420 44.030699999999996 1.210530287683010 0.000000000000000 - 44 2 -0.420 44.729599999999998 0.000000000000000 0.000000000000000 - 45 1 0.420 0.000000000000000 2.421060575366020 0.000000000000000 - 46 2 -0.420 0.698900000000000 3.631590863049030 0.000000000000000 - 47 1 0.420 2.096700000000000 3.631590863049030 0.000000000000000 - 48 2 -0.420 2.795600000000000 2.421060575366020 0.000000000000000 - 49 1 0.420 4.193400000000000 2.421060575366020 0.000000000000000 - 50 2 -0.420 4.892300000000000 3.631590863049030 0.000000000000000 - 51 1 0.420 6.290100000000000 3.631590863049030 0.000000000000000 - 52 2 -0.420 6.989000000000000 2.421060575366020 0.000000000000000 - 53 1 0.420 8.386799999999999 2.421060575366020 0.000000000000000 - 54 2 -0.420 9.085699999999999 3.631590863049030 0.000000000000000 - 55 1 0.420 10.483499999999999 3.631590863049030 0.000000000000000 - 56 2 -0.420 11.182399999999999 2.421060575366020 0.000000000000000 - 57 1 0.420 12.580200000000000 2.421060575366020 0.000000000000000 - 58 2 -0.420 13.279100000000000 3.631590863049030 0.000000000000000 - 59 1 0.420 14.676900000000000 3.631590863049030 0.000000000000000 - 60 2 -0.420 15.375800000000000 2.421060575366020 0.000000000000000 - 61 1 0.420 16.773599999999998 2.421060575366020 0.000000000000000 - 62 2 -0.420 17.472500000000000 3.631590863049030 0.000000000000000 - 63 1 0.420 18.870300000000000 3.631590863049030 0.000000000000000 - 64 2 -0.420 19.569199999999999 2.421060575366020 0.000000000000000 - 65 1 0.420 20.966999999999999 2.421060575366020 0.000000000000000 - 66 2 -0.420 21.665900000000001 3.631590863049030 0.000000000000000 - 67 1 0.420 23.063699999999997 3.631590863049030 0.000000000000000 - 68 2 -0.420 23.762599999999999 2.421060575366020 0.000000000000000 - 69 1 0.420 25.160399999999999 2.421060575366020 0.000000000000000 - 70 2 -0.420 25.859299999999998 3.631590863049030 0.000000000000000 - 71 1 0.420 27.257099999999998 3.631590863049030 0.000000000000000 - 72 2 -0.420 27.956000000000000 2.421060575366020 0.000000000000000 - 73 1 0.420 29.353800000000000 2.421060575366020 0.000000000000000 - 74 2 -0.420 30.052699999999998 3.631590863049030 0.000000000000000 - 75 1 0.420 31.450499999999998 3.631590863049030 0.000000000000000 - 76 2 -0.420 32.149400000000000 2.421060575366020 0.000000000000000 - 77 1 0.420 33.547199999999997 2.421060575366020 0.000000000000000 - 78 2 -0.420 34.246099999999998 3.631590863049030 0.000000000000000 - 79 1 0.420 35.643899999999995 3.631590863049030 0.000000000000000 - 80 2 -0.420 36.342799999999997 2.421060575366020 0.000000000000000 - 81 1 0.420 37.740600000000001 2.421060575366020 0.000000000000000 - 82 2 -0.420 38.439499999999995 3.631590863049030 0.000000000000000 - 83 1 0.420 39.837299999999999 3.631590863049030 0.000000000000000 - 84 2 -0.420 40.536200000000001 2.421060575366020 0.000000000000000 - 85 1 0.420 41.933999999999997 2.421060575366020 0.000000000000000 - 86 2 -0.420 42.632899999999999 3.631590863049030 0.000000000000000 - 87 1 0.420 44.030699999999996 3.631590863049030 0.000000000000000 - 88 2 -0.420 44.729599999999998 2.421060575366020 0.000000000000000 - 89 1 0.420 0.000000000000000 4.842121150732040 0.000000000000000 - 90 2 -0.420 0.698900000000000 6.052651438415050 0.000000000000000 - 91 1 0.420 2.096700000000000 6.052651438415050 0.000000000000000 - 92 2 -0.420 2.795600000000000 4.842121150732040 0.000000000000000 - 93 1 0.420 4.193400000000000 4.842121150732040 0.000000000000000 - 94 2 -0.420 4.892300000000000 6.052651438415050 0.000000000000000 - 95 1 0.420 6.290100000000000 6.052651438415050 0.000000000000000 - 96 2 -0.420 6.989000000000000 4.842121150732040 0.000000000000000 - 97 1 0.420 8.386799999999999 4.842121150732040 0.000000000000000 - 98 2 -0.420 9.085699999999999 6.052651438415050 0.000000000000000 - 99 1 0.420 10.483499999999999 6.052651438415050 0.000000000000000 - 100 2 -0.420 11.182399999999999 4.842121150732040 0.000000000000000 - 101 1 0.420 12.580200000000000 4.842121150732040 0.000000000000000 - 102 2 -0.420 13.279100000000000 6.052651438415050 0.000000000000000 - 103 1 0.420 14.676900000000000 6.052651438415050 0.000000000000000 - 104 2 -0.420 15.375800000000000 4.842121150732040 0.000000000000000 - 105 1 0.420 16.773599999999998 4.842121150732040 0.000000000000000 - 106 2 -0.420 17.472500000000000 6.052651438415050 0.000000000000000 - 107 1 0.420 18.870300000000000 6.052651438415050 0.000000000000000 - 108 2 -0.420 19.569199999999999 4.842121150732040 0.000000000000000 - 109 1 0.420 20.966999999999999 4.842121150732040 0.000000000000000 - 110 2 -0.420 21.665900000000001 6.052651438415050 0.000000000000000 - 111 1 0.420 23.063699999999997 6.052651438415050 0.000000000000000 - 112 2 -0.420 23.762599999999999 4.842121150732040 0.000000000000000 - 113 1 0.420 25.160399999999999 4.842121150732040 0.000000000000000 - 114 2 -0.420 25.859299999999998 6.052651438415050 0.000000000000000 - 115 1 0.420 27.257099999999998 6.052651438415050 0.000000000000000 - 116 2 -0.420 27.956000000000000 4.842121150732040 0.000000000000000 - 117 1 0.420 29.353800000000000 4.842121150732040 0.000000000000000 - 118 2 -0.420 30.052699999999998 6.052651438415050 0.000000000000000 - 119 1 0.420 31.450499999999998 6.052651438415050 0.000000000000000 - 120 2 -0.420 32.149400000000000 4.842121150732040 0.000000000000000 - 121 1 0.420 33.547199999999997 4.842121150732040 0.000000000000000 - 122 2 -0.420 34.246099999999998 6.052651438415050 0.000000000000000 - 123 1 0.420 35.643899999999995 6.052651438415050 0.000000000000000 - 124 2 -0.420 36.342799999999997 4.842121150732040 0.000000000000000 - 125 1 0.420 37.740600000000001 4.842121150732040 0.000000000000000 - 126 2 -0.420 38.439499999999995 6.052651438415050 0.000000000000000 - 127 1 0.420 39.837299999999999 6.052651438415050 0.000000000000000 - 128 2 -0.420 40.536200000000001 4.842121150732040 0.000000000000000 - 129 1 0.420 41.933999999999997 4.842121150732040 0.000000000000000 - 130 2 -0.420 42.632899999999999 6.052651438415050 0.000000000000000 - 131 1 0.420 44.030699999999996 6.052651438415050 0.000000000000000 - 132 2 -0.420 44.729599999999998 4.842121150732040 0.000000000000000 - 133 1 0.420 0.000000000000000 7.263181726098059 0.000000000000000 - 134 2 -0.420 0.698900000000000 8.473712013781070 0.000000000000000 - 135 1 0.420 2.096700000000000 8.473712013781070 0.000000000000000 - 136 2 -0.420 2.795600000000000 7.263181726098059 0.000000000000000 - 137 1 0.420 4.193400000000000 7.263181726098059 0.000000000000000 - 138 2 -0.420 4.892300000000000 8.473712013781070 0.000000000000000 - 139 1 0.420 6.290100000000000 8.473712013781070 0.000000000000000 - 140 2 -0.420 6.989000000000000 7.263181726098059 0.000000000000000 - 141 1 0.420 8.386799999999999 7.263181726098059 0.000000000000000 - 142 2 -0.420 9.085699999999999 8.473712013781070 0.000000000000000 - 143 1 0.420 10.483499999999999 8.473712013781070 0.000000000000000 - 144 2 -0.420 11.182399999999999 7.263181726098059 0.000000000000000 - 145 1 0.420 12.580200000000000 7.263181726098059 0.000000000000000 - 146 2 -0.420 13.279100000000000 8.473712013781070 0.000000000000000 - 147 1 0.420 14.676900000000000 8.473712013781070 0.000000000000000 - 148 2 -0.420 15.375800000000000 7.263181726098059 0.000000000000000 - 149 1 0.420 16.773599999999998 7.263181726098059 0.000000000000000 - 150 2 -0.420 17.472500000000000 8.473712013781070 0.000000000000000 - 151 1 0.420 18.870300000000000 8.473712013781070 0.000000000000000 - 152 2 -0.420 19.569199999999999 7.263181726098059 0.000000000000000 - 153 1 0.420 20.966999999999999 7.263181726098059 0.000000000000000 - 154 2 -0.420 21.665900000000001 8.473712013781070 0.000000000000000 - 155 1 0.420 23.063699999999997 8.473712013781070 0.000000000000000 - 156 2 -0.420 23.762599999999999 7.263181726098059 0.000000000000000 - 157 1 0.420 25.160399999999999 7.263181726098059 0.000000000000000 - 158 2 -0.420 25.859299999999998 8.473712013781070 0.000000000000000 - 159 1 0.420 27.257099999999998 8.473712013781070 0.000000000000000 - 160 2 -0.420 27.956000000000000 7.263181726098059 0.000000000000000 - 161 1 0.420 29.353800000000000 7.263181726098059 0.000000000000000 - 162 2 -0.420 30.052699999999998 8.473712013781070 0.000000000000000 - 163 1 0.420 31.450499999999998 8.473712013781070 0.000000000000000 - 164 2 -0.420 32.149400000000000 7.263181726098059 0.000000000000000 - 165 1 0.420 33.547199999999997 7.263181726098059 0.000000000000000 - 166 2 -0.420 34.246099999999998 8.473712013781070 0.000000000000000 - 167 1 0.420 35.643899999999995 8.473712013781070 0.000000000000000 - 168 2 -0.420 36.342799999999997 7.263181726098059 0.000000000000000 - 169 1 0.420 37.740600000000001 7.263181726098059 0.000000000000000 - 170 2 -0.420 38.439499999999995 8.473712013781070 0.000000000000000 - 171 1 0.420 39.837299999999999 8.473712013781070 0.000000000000000 - 172 2 -0.420 40.536200000000001 7.263181726098059 0.000000000000000 - 173 1 0.420 41.933999999999997 7.263181726098059 0.000000000000000 - 174 2 -0.420 42.632899999999999 8.473712013781070 0.000000000000000 - 175 1 0.420 44.030699999999996 8.473712013781070 0.000000000000000 - 176 2 -0.420 44.729599999999998 7.263181726098059 0.000000000000000 - 177 1 0.420 0.000000000000000 9.684242301464080 0.000000000000000 - 178 2 -0.420 0.698900000000000 10.894772589147090 0.000000000000000 - 179 1 0.420 2.096700000000000 10.894772589147090 0.000000000000000 - 180 2 -0.420 2.795600000000000 9.684242301464080 0.000000000000000 - 181 1 0.420 4.193400000000000 9.684242301464080 0.000000000000000 - 182 2 -0.420 4.892300000000000 10.894772589147090 0.000000000000000 - 183 1 0.420 6.290100000000000 10.894772589147090 0.000000000000000 - 184 2 -0.420 6.989000000000000 9.684242301464080 0.000000000000000 - 185 1 0.420 8.386799999999999 9.684242301464080 0.000000000000000 - 186 2 -0.420 9.085699999999999 10.894772589147090 0.000000000000000 - 187 1 0.420 10.483499999999999 10.894772589147090 0.000000000000000 - 188 2 -0.420 11.182399999999999 9.684242301464080 0.000000000000000 - 189 1 0.420 12.580200000000000 9.684242301464080 0.000000000000000 - 190 2 -0.420 13.279100000000000 10.894772589147090 0.000000000000000 - 191 1 0.420 14.676900000000000 10.894772589147090 0.000000000000000 - 192 2 -0.420 15.375800000000000 9.684242301464080 0.000000000000000 - 193 1 0.420 16.773599999999998 9.684242301464080 0.000000000000000 - 194 2 -0.420 17.472500000000000 10.894772589147090 0.000000000000000 - 195 1 0.420 18.870300000000000 10.894772589147090 0.000000000000000 - 196 2 -0.420 19.569199999999999 9.684242301464080 0.000000000000000 - 197 1 0.420 20.966999999999999 9.684242301464080 0.000000000000000 - 198 2 -0.420 21.665900000000001 10.894772589147090 0.000000000000000 - 199 1 0.420 23.063699999999997 10.894772589147090 0.000000000000000 - 200 2 -0.420 23.762599999999999 9.684242301464080 0.000000000000000 - 201 1 0.420 25.160399999999999 9.684242301464080 0.000000000000000 - 202 2 -0.420 25.859299999999998 10.894772589147090 0.000000000000000 - 203 1 0.420 27.257099999999998 10.894772589147090 0.000000000000000 - 204 2 -0.420 27.956000000000000 9.684242301464080 0.000000000000000 - 205 1 0.420 29.353800000000000 9.684242301464080 0.000000000000000 - 206 2 -0.420 30.052699999999998 10.894772589147090 0.000000000000000 - 207 1 0.420 31.450499999999998 10.894772589147090 0.000000000000000 - 208 2 -0.420 32.149400000000000 9.684242301464080 0.000000000000000 - 209 1 0.420 33.547199999999997 9.684242301464080 0.000000000000000 - 210 2 -0.420 34.246099999999998 10.894772589147090 0.000000000000000 - 211 1 0.420 35.643899999999995 10.894772589147090 0.000000000000000 - 212 2 -0.420 36.342799999999997 9.684242301464080 0.000000000000000 - 213 1 0.420 37.740600000000001 9.684242301464080 0.000000000000000 - 214 2 -0.420 38.439499999999995 10.894772589147090 0.000000000000000 - 215 1 0.420 39.837299999999999 10.894772589147090 0.000000000000000 - 216 2 -0.420 40.536200000000001 9.684242301464080 0.000000000000000 - 217 1 0.420 41.933999999999997 9.684242301464080 0.000000000000000 - 218 2 -0.420 42.632899999999999 10.894772589147090 0.000000000000000 - 219 1 0.420 44.030699999999996 10.894772589147090 0.000000000000000 - 220 2 -0.420 44.729599999999998 9.684242301464080 0.000000000000000 - 221 1 0.420 0.000000000000000 12.105302876830100 0.000000000000000 - 222 2 -0.420 0.698900000000000 13.315833164513110 0.000000000000000 - 223 1 0.420 2.096700000000000 13.315833164513110 0.000000000000000 - 224 2 -0.420 2.795600000000000 12.105302876830100 0.000000000000000 - 225 1 0.420 4.193400000000000 12.105302876830100 0.000000000000000 - 226 2 -0.420 4.892300000000000 13.315833164513110 0.000000000000000 - 227 1 0.420 6.290100000000000 13.315833164513110 0.000000000000000 - 228 2 -0.420 6.989000000000000 12.105302876830100 0.000000000000000 - 229 1 0.420 8.386799999999999 12.105302876830100 0.000000000000000 - 230 2 -0.420 9.085699999999999 13.315833164513110 0.000000000000000 - 231 1 0.420 10.483499999999999 13.315833164513110 0.000000000000000 - 232 2 -0.420 11.182399999999999 12.105302876830100 0.000000000000000 - 233 1 0.420 12.580200000000000 12.105302876830100 0.000000000000000 - 234 2 -0.420 13.279100000000000 13.315833164513110 0.000000000000000 - 235 1 0.420 14.676900000000000 13.315833164513110 0.000000000000000 - 236 2 -0.420 15.375800000000000 12.105302876830100 0.000000000000000 - 237 1 0.420 16.773599999999998 12.105302876830100 0.000000000000000 - 238 2 -0.420 17.472500000000000 13.315833164513110 0.000000000000000 - 239 1 0.420 18.870300000000000 13.315833164513110 0.000000000000000 - 240 2 -0.420 19.569199999999999 12.105302876830100 0.000000000000000 - 241 1 0.420 20.966999999999999 12.105302876830100 0.000000000000000 - 242 2 -0.420 21.665900000000001 13.315833164513110 0.000000000000000 - 243 1 0.420 23.063699999999997 13.315833164513110 0.000000000000000 - 244 2 -0.420 23.762599999999999 12.105302876830100 0.000000000000000 - 245 1 0.420 25.160399999999999 12.105302876830100 0.000000000000000 - 246 2 -0.420 25.859299999999998 13.315833164513110 0.000000000000000 - 247 1 0.420 27.257099999999998 13.315833164513110 0.000000000000000 - 248 2 -0.420 27.956000000000000 12.105302876830100 0.000000000000000 - 249 1 0.420 29.353800000000000 12.105302876830100 0.000000000000000 - 250 2 -0.420 30.052699999999998 13.315833164513110 0.000000000000000 - 251 1 0.420 31.450499999999998 13.315833164513110 0.000000000000000 - 252 2 -0.420 32.149400000000000 12.105302876830100 0.000000000000000 - 253 1 0.420 33.547199999999997 12.105302876830100 0.000000000000000 - 254 2 -0.420 34.246099999999998 13.315833164513110 0.000000000000000 - 255 1 0.420 35.643899999999995 13.315833164513110 0.000000000000000 - 256 2 -0.420 36.342799999999997 12.105302876830100 0.000000000000000 - 257 1 0.420 37.740600000000001 12.105302876830100 0.000000000000000 - 258 2 -0.420 38.439499999999995 13.315833164513110 0.000000000000000 - 259 1 0.420 39.837299999999999 13.315833164513110 0.000000000000000 - 260 2 -0.420 40.536200000000001 12.105302876830100 0.000000000000000 - 261 1 0.420 41.933999999999997 12.105302876830100 0.000000000000000 - 262 2 -0.420 42.632899999999999 13.315833164513110 0.000000000000000 - 263 1 0.420 44.030699999999996 13.315833164513110 0.000000000000000 - 264 2 -0.420 44.729599999999998 12.105302876830100 0.000000000000000 - 265 1 0.420 0.000000000000000 14.526363452196119 0.000000000000000 - 266 2 -0.420 0.698900000000000 15.736893739879129 0.000000000000000 - 267 1 0.420 2.096700000000000 15.736893739879129 0.000000000000000 - 268 2 -0.420 2.795600000000000 14.526363452196119 0.000000000000000 - 269 1 0.420 4.193400000000000 14.526363452196119 0.000000000000000 - 270 2 -0.420 4.892300000000000 15.736893739879129 0.000000000000000 - 271 1 0.420 6.290100000000000 15.736893739879129 0.000000000000000 - 272 2 -0.420 6.989000000000000 14.526363452196119 0.000000000000000 - 273 1 0.420 8.386799999999999 14.526363452196119 0.000000000000000 - 274 2 -0.420 9.085699999999999 15.736893739879129 0.000000000000000 - 275 1 0.420 10.483499999999999 15.736893739879129 0.000000000000000 - 276 2 -0.420 11.182399999999999 14.526363452196119 0.000000000000000 - 277 1 0.420 12.580200000000000 14.526363452196119 0.000000000000000 - 278 2 -0.420 13.279100000000000 15.736893739879129 0.000000000000000 - 279 1 0.420 14.676900000000000 15.736893739879129 0.000000000000000 - 280 2 -0.420 15.375800000000000 14.526363452196119 0.000000000000000 - 281 1 0.420 16.773599999999998 14.526363452196119 0.000000000000000 - 282 2 -0.420 17.472500000000000 15.736893739879129 0.000000000000000 - 283 1 0.420 18.870300000000000 15.736893739879129 0.000000000000000 - 284 2 -0.420 19.569199999999999 14.526363452196119 0.000000000000000 - 285 1 0.420 20.966999999999999 14.526363452196119 0.000000000000000 - 286 2 -0.420 21.665900000000001 15.736893739879129 0.000000000000000 - 287 1 0.420 23.063699999999997 15.736893739879129 0.000000000000000 - 288 2 -0.420 23.762599999999999 14.526363452196119 0.000000000000000 - 289 1 0.420 25.160399999999999 14.526363452196119 0.000000000000000 - 290 2 -0.420 25.859299999999998 15.736893739879129 0.000000000000000 - 291 1 0.420 27.257099999999998 15.736893739879129 0.000000000000000 - 292 2 -0.420 27.956000000000000 14.526363452196119 0.000000000000000 - 293 1 0.420 29.353800000000000 14.526363452196119 0.000000000000000 - 294 2 -0.420 30.052699999999998 15.736893739879129 0.000000000000000 - 295 1 0.420 31.450499999999998 15.736893739879129 0.000000000000000 - 296 2 -0.420 32.149400000000000 14.526363452196119 0.000000000000000 - 297 1 0.420 33.547199999999997 14.526363452196119 0.000000000000000 - 298 2 -0.420 34.246099999999998 15.736893739879129 0.000000000000000 - 299 1 0.420 35.643899999999995 15.736893739879129 0.000000000000000 - 300 2 -0.420 36.342799999999997 14.526363452196119 0.000000000000000 - 301 1 0.420 37.740600000000001 14.526363452196119 0.000000000000000 - 302 2 -0.420 38.439499999999995 15.736893739879129 0.000000000000000 - 303 1 0.420 39.837299999999999 15.736893739879129 0.000000000000000 - 304 2 -0.420 40.536200000000001 14.526363452196119 0.000000000000000 - 305 1 0.420 41.933999999999997 14.526363452196119 0.000000000000000 - 306 2 -0.420 42.632899999999999 15.736893739879129 0.000000000000000 - 307 1 0.420 44.030699999999996 15.736893739879129 0.000000000000000 - 308 2 -0.420 44.729599999999998 14.526363452196119 0.000000000000000 - 309 1 0.420 0.000000000000000 16.947424027562139 0.000000000000000 - 310 2 -0.420 0.698900000000000 18.157954315245149 0.000000000000000 - 311 1 0.420 2.096700000000000 18.157954315245149 0.000000000000000 - 312 2 -0.420 2.795600000000000 16.947424027562139 0.000000000000000 - 313 1 0.420 4.193400000000000 16.947424027562139 0.000000000000000 - 314 2 -0.420 4.892300000000000 18.157954315245149 0.000000000000000 - 315 1 0.420 6.290100000000000 18.157954315245149 0.000000000000000 - 316 2 -0.420 6.989000000000000 16.947424027562139 0.000000000000000 - 317 1 0.420 8.386799999999999 16.947424027562139 0.000000000000000 - 318 2 -0.420 9.085699999999999 18.157954315245149 0.000000000000000 - 319 1 0.420 10.483499999999999 18.157954315245149 0.000000000000000 - 320 2 -0.420 11.182399999999999 16.947424027562139 0.000000000000000 - 321 1 0.420 12.580200000000000 16.947424027562139 0.000000000000000 - 322 2 -0.420 13.279100000000000 18.157954315245149 0.000000000000000 - 323 1 0.420 14.676900000000000 18.157954315245149 0.000000000000000 - 324 2 -0.420 15.375800000000000 16.947424027562139 0.000000000000000 - 325 1 0.420 16.773599999999998 16.947424027562139 0.000000000000000 - 326 2 -0.420 17.472500000000000 18.157954315245149 0.000000000000000 - 327 1 0.420 18.870300000000000 18.157954315245149 0.000000000000000 - 328 2 -0.420 19.569199999999999 16.947424027562139 0.000000000000000 - 329 1 0.420 20.966999999999999 16.947424027562139 0.000000000000000 - 330 2 -0.420 21.665900000000001 18.157954315245149 0.000000000000000 - 331 1 0.420 23.063699999999997 18.157954315245149 0.000000000000000 - 332 2 -0.420 23.762599999999999 16.947424027562139 0.000000000000000 - 333 1 0.420 25.160399999999999 16.947424027562139 0.000000000000000 - 334 2 -0.420 25.859299999999998 18.157954315245149 0.000000000000000 - 335 1 0.420 27.257099999999998 18.157954315245149 0.000000000000000 - 336 2 -0.420 27.956000000000000 16.947424027562139 0.000000000000000 - 337 1 0.420 29.353800000000000 16.947424027562139 0.000000000000000 - 338 2 -0.420 30.052699999999998 18.157954315245149 0.000000000000000 - 339 1 0.420 31.450499999999998 18.157954315245149 0.000000000000000 - 340 2 -0.420 32.149400000000000 16.947424027562139 0.000000000000000 - 341 1 0.420 33.547199999999997 16.947424027562139 0.000000000000000 - 342 2 -0.420 34.246099999999998 18.157954315245149 0.000000000000000 - 343 1 0.420 35.643899999999995 18.157954315245149 0.000000000000000 - 344 2 -0.420 36.342799999999997 16.947424027562139 0.000000000000000 - 345 1 0.420 37.740600000000001 16.947424027562139 0.000000000000000 - 346 2 -0.420 38.439499999999995 18.157954315245149 0.000000000000000 - 347 1 0.420 39.837299999999999 18.157954315245149 0.000000000000000 - 348 2 -0.420 40.536200000000001 16.947424027562139 0.000000000000000 - 349 1 0.420 41.933999999999997 16.947424027562139 0.000000000000000 - 350 2 -0.420 42.632899999999999 18.157954315245149 0.000000000000000 - 351 1 0.420 44.030699999999996 18.157954315245149 0.000000000000000 - 352 2 -0.420 44.729599999999998 16.947424027562139 0.000000000000000 - 353 1 0.420 0.000000000000000 19.368484602928159 0.000000000000000 - 354 2 -0.420 0.698900000000000 20.579014890611170 0.000000000000000 - 355 1 0.420 2.096700000000000 20.579014890611170 0.000000000000000 - 356 2 -0.420 2.795600000000000 19.368484602928159 0.000000000000000 - 357 1 0.420 4.193400000000000 19.368484602928159 0.000000000000000 - 358 2 -0.420 4.892300000000000 20.579014890611170 0.000000000000000 - 359 1 0.420 6.290100000000000 20.579014890611170 0.000000000000000 - 360 2 -0.420 6.989000000000000 19.368484602928159 0.000000000000000 - 361 1 0.420 8.386799999999999 19.368484602928159 0.000000000000000 - 362 2 -0.420 9.085699999999999 20.579014890611170 0.000000000000000 - 363 1 0.420 10.483499999999999 20.579014890611170 0.000000000000000 - 364 2 -0.420 11.182399999999999 19.368484602928159 0.000000000000000 - 365 1 0.420 12.580200000000000 19.368484602928159 0.000000000000000 - 366 2 -0.420 13.279100000000000 20.579014890611170 0.000000000000000 - 367 1 0.420 14.676900000000000 20.579014890611170 0.000000000000000 - 368 2 -0.420 15.375800000000000 19.368484602928159 0.000000000000000 - 369 1 0.420 16.773599999999998 19.368484602928159 0.000000000000000 - 370 2 -0.420 17.472500000000000 20.579014890611170 0.000000000000000 - 371 1 0.420 18.870300000000000 20.579014890611170 0.000000000000000 - 372 2 -0.420 19.569199999999999 19.368484602928159 0.000000000000000 - 373 1 0.420 20.966999999999999 19.368484602928159 0.000000000000000 - 374 2 -0.420 21.665900000000001 20.579014890611170 0.000000000000000 - 375 1 0.420 23.063699999999997 20.579014890611170 0.000000000000000 - 376 2 -0.420 23.762599999999999 19.368484602928159 0.000000000000000 - 377 1 0.420 25.160399999999999 19.368484602928159 0.000000000000000 - 378 2 -0.420 25.859299999999998 20.579014890611170 0.000000000000000 - 379 1 0.420 27.257099999999998 20.579014890611170 0.000000000000000 - 380 2 -0.420 27.956000000000000 19.368484602928159 0.000000000000000 - 381 1 0.420 29.353800000000000 19.368484602928159 0.000000000000000 - 382 2 -0.420 30.052699999999998 20.579014890611170 0.000000000000000 - 383 1 0.420 31.450499999999998 20.579014890611170 0.000000000000000 - 384 2 -0.420 32.149400000000000 19.368484602928159 0.000000000000000 - 385 1 0.420 33.547199999999997 19.368484602928159 0.000000000000000 - 386 2 -0.420 34.246099999999998 20.579014890611170 0.000000000000000 - 387 1 0.420 35.643899999999995 20.579014890611170 0.000000000000000 - 388 2 -0.420 36.342799999999997 19.368484602928159 0.000000000000000 - 389 1 0.420 37.740600000000001 19.368484602928159 0.000000000000000 - 390 2 -0.420 38.439499999999995 20.579014890611170 0.000000000000000 - 391 1 0.420 39.837299999999999 20.579014890611170 0.000000000000000 - 392 2 -0.420 40.536200000000001 19.368484602928159 0.000000000000000 - 393 1 0.420 41.933999999999997 19.368484602928159 0.000000000000000 - 394 2 -0.420 42.632899999999999 20.579014890611170 0.000000000000000 - 395 1 0.420 44.030699999999996 20.579014890611170 0.000000000000000 - 396 2 -0.420 44.729599999999998 19.368484602928159 0.000000000000000 - 397 1 0.420 0.000000000000000 21.789545178294180 0.000000000000000 - 398 2 -0.420 0.698900000000000 23.000075465977190 0.000000000000000 - 399 1 0.420 2.096700000000000 23.000075465977190 0.000000000000000 - 400 2 -0.420 2.795600000000000 21.789545178294180 0.000000000000000 - 401 1 0.420 4.193400000000000 21.789545178294180 0.000000000000000 - 402 2 -0.420 4.892300000000000 23.000075465977190 0.000000000000000 - 403 1 0.420 6.290100000000000 23.000075465977190 0.000000000000000 - 404 2 -0.420 6.989000000000000 21.789545178294180 0.000000000000000 - 405 1 0.420 8.386799999999999 21.789545178294180 0.000000000000000 - 406 2 -0.420 9.085699999999999 23.000075465977190 0.000000000000000 - 407 1 0.420 10.483499999999999 23.000075465977190 0.000000000000000 - 408 2 -0.420 11.182399999999999 21.789545178294180 0.000000000000000 - 409 1 0.420 12.580200000000000 21.789545178294180 0.000000000000000 - 410 2 -0.420 13.279100000000000 23.000075465977190 0.000000000000000 - 411 1 0.420 14.676900000000000 23.000075465977190 0.000000000000000 - 412 2 -0.420 15.375800000000000 21.789545178294180 0.000000000000000 - 413 1 0.420 16.773599999999998 21.789545178294180 0.000000000000000 - 414 2 -0.420 17.472500000000000 23.000075465977190 0.000000000000000 - 415 1 0.420 18.870300000000000 23.000075465977190 0.000000000000000 - 416 2 -0.420 19.569199999999999 21.789545178294180 0.000000000000000 - 417 1 0.420 20.966999999999999 21.789545178294180 0.000000000000000 - 418 2 -0.420 21.665900000000001 23.000075465977190 0.000000000000000 - 419 1 0.420 23.063699999999997 23.000075465977190 0.000000000000000 - 420 2 -0.420 23.762599999999999 21.789545178294180 0.000000000000000 - 421 1 0.420 25.160399999999999 21.789545178294180 0.000000000000000 - 422 2 -0.420 25.859299999999998 23.000075465977190 0.000000000000000 - 423 1 0.420 27.257099999999998 23.000075465977190 0.000000000000000 - 424 2 -0.420 27.956000000000000 21.789545178294180 0.000000000000000 - 425 1 0.420 29.353800000000000 21.789545178294180 0.000000000000000 - 426 2 -0.420 30.052699999999998 23.000075465977190 0.000000000000000 - 427 1 0.420 31.450499999999998 23.000075465977190 0.000000000000000 - 428 2 -0.420 32.149400000000000 21.789545178294180 0.000000000000000 - 429 1 0.420 33.547199999999997 21.789545178294180 0.000000000000000 - 430 2 -0.420 34.246099999999998 23.000075465977190 0.000000000000000 - 431 1 0.420 35.643899999999995 23.000075465977190 0.000000000000000 - 432 2 -0.420 36.342799999999997 21.789545178294180 0.000000000000000 - 433 1 0.420 37.740600000000001 21.789545178294180 0.000000000000000 - 434 2 -0.420 38.439499999999995 23.000075465977190 0.000000000000000 - 435 1 0.420 39.837299999999999 23.000075465977190 0.000000000000000 - 436 2 -0.420 40.536200000000001 21.789545178294180 0.000000000000000 - 437 1 0.420 41.933999999999997 21.789545178294180 0.000000000000000 - 438 2 -0.420 42.632899999999999 23.000075465977190 0.000000000000000 - 439 1 0.420 44.030699999999996 23.000075465977190 0.000000000000000 - 440 2 -0.420 44.729599999999998 21.789545178294180 0.000000000000000 - 441 1 0.420 0.000000000000000 24.210605753660200 0.000000000000000 - 442 2 -0.420 0.698900000000000 25.421136041343210 0.000000000000000 - 443 1 0.420 2.096700000000000 25.421136041343210 0.000000000000000 - 444 2 -0.420 2.795600000000000 24.210605753660200 0.000000000000000 - 445 1 0.420 4.193400000000000 24.210605753660200 0.000000000000000 - 446 2 -0.420 4.892300000000000 25.421136041343210 0.000000000000000 - 447 1 0.420 6.290100000000000 25.421136041343210 0.000000000000000 - 448 2 -0.420 6.989000000000000 24.210605753660200 0.000000000000000 - 449 1 0.420 8.386799999999999 24.210605753660200 0.000000000000000 - 450 2 -0.420 9.085699999999999 25.421136041343210 0.000000000000000 - 451 1 0.420 10.483499999999999 25.421136041343210 0.000000000000000 - 452 2 -0.420 11.182399999999999 24.210605753660200 0.000000000000000 - 453 1 0.420 12.580200000000000 24.210605753660200 0.000000000000000 - 454 2 -0.420 13.279100000000000 25.421136041343210 0.000000000000000 - 455 1 0.420 14.676900000000000 25.421136041343210 0.000000000000000 - 456 2 -0.420 15.375800000000000 24.210605753660200 0.000000000000000 - 457 1 0.420 16.773599999999998 24.210605753660200 0.000000000000000 - 458 2 -0.420 17.472500000000000 25.421136041343210 0.000000000000000 - 459 1 0.420 18.870300000000000 25.421136041343210 0.000000000000000 - 460 2 -0.420 19.569199999999999 24.210605753660200 0.000000000000000 - 461 1 0.420 20.966999999999999 24.210605753660200 0.000000000000000 - 462 2 -0.420 21.665900000000001 25.421136041343210 0.000000000000000 - 463 1 0.420 23.063699999999997 25.421136041343210 0.000000000000000 - 464 2 -0.420 23.762599999999999 24.210605753660200 0.000000000000000 - 465 1 0.420 25.160399999999999 24.210605753660200 0.000000000000000 - 466 2 -0.420 25.859299999999998 25.421136041343210 0.000000000000000 - 467 1 0.420 27.257099999999998 25.421136041343210 0.000000000000000 - 468 2 -0.420 27.956000000000000 24.210605753660200 0.000000000000000 - 469 1 0.420 29.353800000000000 24.210605753660200 0.000000000000000 - 470 2 -0.420 30.052699999999998 25.421136041343210 0.000000000000000 - 471 1 0.420 31.450499999999998 25.421136041343210 0.000000000000000 - 472 2 -0.420 32.149400000000000 24.210605753660200 0.000000000000000 - 473 1 0.420 33.547199999999997 24.210605753660200 0.000000000000000 - 474 2 -0.420 34.246099999999998 25.421136041343210 0.000000000000000 - 475 1 0.420 35.643899999999995 25.421136041343210 0.000000000000000 - 476 2 -0.420 36.342799999999997 24.210605753660200 0.000000000000000 - 477 1 0.420 37.740600000000001 24.210605753660200 0.000000000000000 - 478 2 -0.420 38.439499999999995 25.421136041343210 0.000000000000000 - 479 1 0.420 39.837299999999999 25.421136041343210 0.000000000000000 - 480 2 -0.420 40.536200000000001 24.210605753660200 0.000000000000000 - 481 1 0.420 41.933999999999997 24.210605753660200 0.000000000000000 - 482 2 -0.420 42.632899999999999 25.421136041343210 0.000000000000000 - 483 1 0.420 44.030699999999996 25.421136041343210 0.000000000000000 - 484 2 -0.420 44.729599999999998 24.210605753660200 0.000000000000000 - 485 1 0.420 0.000000000000000 26.631666329026221 0.000000000000000 - 486 2 -0.420 0.698900000000000 27.842196616709231 0.000000000000000 - 487 1 0.420 2.096700000000000 27.842196616709231 0.000000000000000 - 488 2 -0.420 2.795600000000000 26.631666329026221 0.000000000000000 - 489 1 0.420 4.193400000000000 26.631666329026221 0.000000000000000 - 490 2 -0.420 4.892300000000000 27.842196616709231 0.000000000000000 - 491 1 0.420 6.290100000000000 27.842196616709231 0.000000000000000 - 492 2 -0.420 6.989000000000000 26.631666329026221 0.000000000000000 - 493 1 0.420 8.386799999999999 26.631666329026221 0.000000000000000 - 494 2 -0.420 9.085699999999999 27.842196616709231 0.000000000000000 - 495 1 0.420 10.483499999999999 27.842196616709231 0.000000000000000 - 496 2 -0.420 11.182399999999999 26.631666329026221 0.000000000000000 - 497 1 0.420 12.580200000000000 26.631666329026221 0.000000000000000 - 498 2 -0.420 13.279100000000000 27.842196616709231 0.000000000000000 - 499 1 0.420 14.676900000000000 27.842196616709231 0.000000000000000 - 500 2 -0.420 15.375800000000000 26.631666329026221 0.000000000000000 - 501 1 0.420 16.773599999999998 26.631666329026221 0.000000000000000 - 502 2 -0.420 17.472500000000000 27.842196616709231 0.000000000000000 - 503 1 0.420 18.870300000000000 27.842196616709231 0.000000000000000 - 504 2 -0.420 19.569199999999999 26.631666329026221 0.000000000000000 - 505 1 0.420 20.966999999999999 26.631666329026221 0.000000000000000 - 506 2 -0.420 21.665900000000001 27.842196616709231 0.000000000000000 - 507 1 0.420 23.063699999999997 27.842196616709231 0.000000000000000 - 508 2 -0.420 23.762599999999999 26.631666329026221 0.000000000000000 - 509 1 0.420 25.160399999999999 26.631666329026221 0.000000000000000 - 510 2 -0.420 25.859299999999998 27.842196616709231 0.000000000000000 - 511 1 0.420 27.257099999999998 27.842196616709231 0.000000000000000 - 512 2 -0.420 27.956000000000000 26.631666329026221 0.000000000000000 - 513 1 0.420 29.353800000000000 26.631666329026221 0.000000000000000 - 514 2 -0.420 30.052699999999998 27.842196616709231 0.000000000000000 - 515 1 0.420 31.450499999999998 27.842196616709231 0.000000000000000 - 516 2 -0.420 32.149400000000000 26.631666329026221 0.000000000000000 - 517 1 0.420 33.547199999999997 26.631666329026221 0.000000000000000 - 518 2 -0.420 34.246099999999998 27.842196616709231 0.000000000000000 - 519 1 0.420 35.643899999999995 27.842196616709231 0.000000000000000 - 520 2 -0.420 36.342799999999997 26.631666329026221 0.000000000000000 - 521 1 0.420 37.740600000000001 26.631666329026221 0.000000000000000 - 522 2 -0.420 38.439499999999995 27.842196616709231 0.000000000000000 - 523 1 0.420 39.837299999999999 27.842196616709231 0.000000000000000 - 524 2 -0.420 40.536200000000001 26.631666329026221 0.000000000000000 - 525 1 0.420 41.933999999999997 26.631666329026221 0.000000000000000 - 526 2 -0.420 42.632899999999999 27.842196616709231 0.000000000000000 - 527 1 0.420 44.030699999999996 27.842196616709231 0.000000000000000 - 528 2 -0.420 44.729599999999998 26.631666329026221 0.000000000000000 - 529 1 0.420 0.000000000000000 29.052726904392237 0.000000000000000 - 530 2 -0.420 0.698900000000000 30.263257192075248 0.000000000000000 - 531 1 0.420 2.096700000000000 30.263257192075248 0.000000000000000 - 532 2 -0.420 2.795600000000000 29.052726904392237 0.000000000000000 - 533 1 0.420 4.193400000000000 29.052726904392237 0.000000000000000 - 534 2 -0.420 4.892300000000000 30.263257192075248 0.000000000000000 - 535 1 0.420 6.290100000000000 30.263257192075248 0.000000000000000 - 536 2 -0.420 6.989000000000000 29.052726904392237 0.000000000000000 - 537 1 0.420 8.386799999999999 29.052726904392237 0.000000000000000 - 538 2 -0.420 9.085699999999999 30.263257192075248 0.000000000000000 - 539 1 0.420 10.483499999999999 30.263257192075248 0.000000000000000 - 540 2 -0.420 11.182399999999999 29.052726904392237 0.000000000000000 - 541 1 0.420 12.580200000000000 29.052726904392237 0.000000000000000 - 542 2 -0.420 13.279100000000000 30.263257192075248 0.000000000000000 - 543 1 0.420 14.676900000000000 30.263257192075248 0.000000000000000 - 544 2 -0.420 15.375800000000000 29.052726904392237 0.000000000000000 - 545 1 0.420 16.773599999999998 29.052726904392237 0.000000000000000 - 546 2 -0.420 17.472500000000000 30.263257192075248 0.000000000000000 - 547 1 0.420 18.870300000000000 30.263257192075248 0.000000000000000 - 548 2 -0.420 19.569199999999999 29.052726904392237 0.000000000000000 - 549 1 0.420 20.966999999999999 29.052726904392237 0.000000000000000 - 550 2 -0.420 21.665900000000001 30.263257192075248 0.000000000000000 - 551 1 0.420 23.063699999999997 30.263257192075248 0.000000000000000 - 552 2 -0.420 23.762599999999999 29.052726904392237 0.000000000000000 - 553 1 0.420 25.160399999999999 29.052726904392237 0.000000000000000 - 554 2 -0.420 25.859299999999998 30.263257192075248 0.000000000000000 - 555 1 0.420 27.257099999999998 30.263257192075248 0.000000000000000 - 556 2 -0.420 27.956000000000000 29.052726904392237 0.000000000000000 - 557 1 0.420 29.353800000000000 29.052726904392237 0.000000000000000 - 558 2 -0.420 30.052699999999998 30.263257192075248 0.000000000000000 - 559 1 0.420 31.450499999999998 30.263257192075248 0.000000000000000 - 560 2 -0.420 32.149400000000000 29.052726904392237 0.000000000000000 - 561 1 0.420 33.547199999999997 29.052726904392237 0.000000000000000 - 562 2 -0.420 34.246099999999998 30.263257192075248 0.000000000000000 - 563 1 0.420 35.643899999999995 30.263257192075248 0.000000000000000 - 564 2 -0.420 36.342799999999997 29.052726904392237 0.000000000000000 - 565 1 0.420 37.740600000000001 29.052726904392237 0.000000000000000 - 566 2 -0.420 38.439499999999995 30.263257192075248 0.000000000000000 - 567 1 0.420 39.837299999999999 30.263257192075248 0.000000000000000 - 568 2 -0.420 40.536200000000001 29.052726904392237 0.000000000000000 - 569 1 0.420 41.933999999999997 29.052726904392237 0.000000000000000 - 570 2 -0.420 42.632899999999999 30.263257192075248 0.000000000000000 - 571 1 0.420 44.030699999999996 30.263257192075248 0.000000000000000 - 572 2 -0.420 44.729599999999998 29.052726904392237 0.000000000000000 - 573 1 0.420 0.000000000000000 31.473787479758258 0.000000000000000 - 574 2 -0.420 0.698900000000000 32.684317767441271 0.000000000000000 - 575 1 0.420 2.096700000000000 32.684317767441271 0.000000000000000 - 576 2 -0.420 2.795600000000000 31.473787479758258 0.000000000000000 - 577 1 0.420 4.193400000000000 31.473787479758258 0.000000000000000 - 578 2 -0.420 4.892300000000000 32.684317767441271 0.000000000000000 - 579 1 0.420 6.290100000000000 32.684317767441271 0.000000000000000 - 580 2 -0.420 6.989000000000000 31.473787479758258 0.000000000000000 - 581 1 0.420 8.386799999999999 31.473787479758258 0.000000000000000 - 582 2 -0.420 9.085699999999999 32.684317767441271 0.000000000000000 - 583 1 0.420 10.483499999999999 32.684317767441271 0.000000000000000 - 584 2 -0.420 11.182399999999999 31.473787479758258 0.000000000000000 - 585 1 0.420 12.580200000000000 31.473787479758258 0.000000000000000 - 586 2 -0.420 13.279100000000000 32.684317767441271 0.000000000000000 - 587 1 0.420 14.676900000000000 32.684317767441271 0.000000000000000 - 588 2 -0.420 15.375800000000000 31.473787479758258 0.000000000000000 - 589 1 0.420 16.773599999999998 31.473787479758258 0.000000000000000 - 590 2 -0.420 17.472500000000000 32.684317767441271 0.000000000000000 - 591 1 0.420 18.870300000000000 32.684317767441271 0.000000000000000 - 592 2 -0.420 19.569199999999999 31.473787479758258 0.000000000000000 - 593 1 0.420 20.966999999999999 31.473787479758258 0.000000000000000 - 594 2 -0.420 21.665900000000001 32.684317767441271 0.000000000000000 - 595 1 0.420 23.063699999999997 32.684317767441271 0.000000000000000 - 596 2 -0.420 23.762599999999999 31.473787479758258 0.000000000000000 - 597 1 0.420 25.160399999999999 31.473787479758258 0.000000000000000 - 598 2 -0.420 25.859299999999998 32.684317767441271 0.000000000000000 - 599 1 0.420 27.257099999999998 32.684317767441271 0.000000000000000 - 600 2 -0.420 27.956000000000000 31.473787479758258 0.000000000000000 - 601 1 0.420 29.353800000000000 31.473787479758258 0.000000000000000 - 602 2 -0.420 30.052699999999998 32.684317767441271 0.000000000000000 - 603 1 0.420 31.450499999999998 32.684317767441271 0.000000000000000 - 604 2 -0.420 32.149400000000000 31.473787479758258 0.000000000000000 - 605 1 0.420 33.547199999999997 31.473787479758258 0.000000000000000 - 606 2 -0.420 34.246099999999998 32.684317767441271 0.000000000000000 - 607 1 0.420 35.643899999999995 32.684317767441271 0.000000000000000 - 608 2 -0.420 36.342799999999997 31.473787479758258 0.000000000000000 - 609 1 0.420 37.740600000000001 31.473787479758258 0.000000000000000 - 610 2 -0.420 38.439499999999995 32.684317767441271 0.000000000000000 - 611 1 0.420 39.837299999999999 32.684317767441271 0.000000000000000 - 612 2 -0.420 40.536200000000001 31.473787479758258 0.000000000000000 - 613 1 0.420 41.933999999999997 31.473787479758258 0.000000000000000 - 614 2 -0.420 42.632899999999999 32.684317767441271 0.000000000000000 - 615 1 0.420 44.030699999999996 32.684317767441271 0.000000000000000 - 616 2 -0.420 44.729599999999998 31.473787479758258 0.000000000000000 - 617 1 0.420 0.000000000000000 33.894848055124278 0.000000000000000 - 618 2 -0.420 0.698900000000000 35.105378342807292 0.000000000000000 - 619 1 0.420 2.096700000000000 35.105378342807292 0.000000000000000 - 620 2 -0.420 2.795600000000000 33.894848055124278 0.000000000000000 - 621 1 0.420 4.193400000000000 33.894848055124278 0.000000000000000 - 622 2 -0.420 4.892300000000000 35.105378342807292 0.000000000000000 - 623 1 0.420 6.290100000000000 35.105378342807292 0.000000000000000 - 624 2 -0.420 6.989000000000000 33.894848055124278 0.000000000000000 - 625 1 0.420 8.386799999999999 33.894848055124278 0.000000000000000 - 626 2 -0.420 9.085699999999999 35.105378342807292 0.000000000000000 - 627 1 0.420 10.483499999999999 35.105378342807292 0.000000000000000 - 628 2 -0.420 11.182399999999999 33.894848055124278 0.000000000000000 - 629 1 0.420 12.580200000000000 33.894848055124278 0.000000000000000 - 630 2 -0.420 13.279100000000000 35.105378342807292 0.000000000000000 - 631 1 0.420 14.676900000000000 35.105378342807292 0.000000000000000 - 632 2 -0.420 15.375800000000000 33.894848055124278 0.000000000000000 - 633 1 0.420 16.773599999999998 33.894848055124278 0.000000000000000 - 634 2 -0.420 17.472500000000000 35.105378342807292 0.000000000000000 - 635 1 0.420 18.870300000000000 35.105378342807292 0.000000000000000 - 636 2 -0.420 19.569199999999999 33.894848055124278 0.000000000000000 - 637 1 0.420 20.966999999999999 33.894848055124278 0.000000000000000 - 638 2 -0.420 21.665900000000001 35.105378342807292 0.000000000000000 - 639 1 0.420 23.063699999999997 35.105378342807292 0.000000000000000 - 640 2 -0.420 23.762599999999999 33.894848055124278 0.000000000000000 - 641 1 0.420 25.160399999999999 33.894848055124278 0.000000000000000 - 642 2 -0.420 25.859299999999998 35.105378342807292 0.000000000000000 - 643 1 0.420 27.257099999999998 35.105378342807292 0.000000000000000 - 644 2 -0.420 27.956000000000000 33.894848055124278 0.000000000000000 - 645 1 0.420 29.353800000000000 33.894848055124278 0.000000000000000 - 646 2 -0.420 30.052699999999998 35.105378342807292 0.000000000000000 - 647 1 0.420 31.450499999999998 35.105378342807292 0.000000000000000 - 648 2 -0.420 32.149400000000000 33.894848055124278 0.000000000000000 - 649 1 0.420 33.547199999999997 33.894848055124278 0.000000000000000 - 650 2 -0.420 34.246099999999998 35.105378342807292 0.000000000000000 - 651 1 0.420 35.643899999999995 35.105378342807292 0.000000000000000 - 652 2 -0.420 36.342799999999997 33.894848055124278 0.000000000000000 - 653 1 0.420 37.740600000000001 33.894848055124278 0.000000000000000 - 654 2 -0.420 38.439499999999995 35.105378342807292 0.000000000000000 - 655 1 0.420 39.837299999999999 35.105378342807292 0.000000000000000 - 656 2 -0.420 40.536200000000001 33.894848055124278 0.000000000000000 - 657 1 0.420 41.933999999999997 33.894848055124278 0.000000000000000 - 658 2 -0.420 42.632899999999999 35.105378342807292 0.000000000000000 - 659 1 0.420 44.030699999999996 35.105378342807292 0.000000000000000 - 660 2 -0.420 44.729599999999998 33.894848055124278 0.000000000000000 - 661 1 0.420 0.000000000000000 36.315908630490298 0.000000000000000 - 662 2 -0.420 0.698900000000000 37.526438918173312 0.000000000000000 - 663 1 0.420 2.096700000000000 37.526438918173312 0.000000000000000 - 664 2 -0.420 2.795600000000000 36.315908630490298 0.000000000000000 - 665 1 0.420 4.193400000000000 36.315908630490298 0.000000000000000 - 666 2 -0.420 4.892300000000000 37.526438918173312 0.000000000000000 - 667 1 0.420 6.290100000000000 37.526438918173312 0.000000000000000 - 668 2 -0.420 6.989000000000000 36.315908630490298 0.000000000000000 - 669 1 0.420 8.386799999999999 36.315908630490298 0.000000000000000 - 670 2 -0.420 9.085699999999999 37.526438918173312 0.000000000000000 - 671 1 0.420 10.483499999999999 37.526438918173312 0.000000000000000 - 672 2 -0.420 11.182399999999999 36.315908630490298 0.000000000000000 - 673 1 0.420 12.580200000000000 36.315908630490298 0.000000000000000 - 674 2 -0.420 13.279100000000000 37.526438918173312 0.000000000000000 - 675 1 0.420 14.676900000000000 37.526438918173312 0.000000000000000 - 676 2 -0.420 15.375800000000000 36.315908630490298 0.000000000000000 - 677 1 0.420 16.773599999999998 36.315908630490298 0.000000000000000 - 678 2 -0.420 17.472500000000000 37.526438918173312 0.000000000000000 - 679 1 0.420 18.870300000000000 37.526438918173312 0.000000000000000 - 680 2 -0.420 19.569199999999999 36.315908630490298 0.000000000000000 - 681 1 0.420 20.966999999999999 36.315908630490298 0.000000000000000 - 682 2 -0.420 21.665900000000001 37.526438918173312 0.000000000000000 - 683 1 0.420 23.063699999999997 37.526438918173312 0.000000000000000 - 684 2 -0.420 23.762599999999999 36.315908630490298 0.000000000000000 - 685 1 0.420 25.160399999999999 36.315908630490298 0.000000000000000 - 686 2 -0.420 25.859299999999998 37.526438918173312 0.000000000000000 - 687 1 0.420 27.257099999999998 37.526438918173312 0.000000000000000 - 688 2 -0.420 27.956000000000000 36.315908630490298 0.000000000000000 - 689 1 0.420 29.353800000000000 36.315908630490298 0.000000000000000 - 690 2 -0.420 30.052699999999998 37.526438918173312 0.000000000000000 - 691 1 0.420 31.450499999999998 37.526438918173312 0.000000000000000 - 692 2 -0.420 32.149400000000000 36.315908630490298 0.000000000000000 - 693 1 0.420 33.547199999999997 36.315908630490298 0.000000000000000 - 694 2 -0.420 34.246099999999998 37.526438918173312 0.000000000000000 - 695 1 0.420 35.643899999999995 37.526438918173312 0.000000000000000 - 696 2 -0.420 36.342799999999997 36.315908630490298 0.000000000000000 - 697 1 0.420 37.740600000000001 36.315908630490298 0.000000000000000 - 698 2 -0.420 38.439499999999995 37.526438918173312 0.000000000000000 - 699 1 0.420 39.837299999999999 37.526438918173312 0.000000000000000 - 700 2 -0.420 40.536200000000001 36.315908630490298 0.000000000000000 - 701 1 0.420 41.933999999999997 36.315908630490298 0.000000000000000 - 702 2 -0.420 42.632899999999999 37.526438918173312 0.000000000000000 - 703 1 0.420 44.030699999999996 37.526438918173312 0.000000000000000 - 704 2 -0.420 44.729599999999998 36.315908630490298 0.000000000000000 - 705 1 0.420 0.000000000000000 38.736969205856319 0.000000000000000 - 706 2 -0.420 0.698900000000000 39.947499493539325 0.000000000000000 - 707 1 0.420 2.096700000000000 39.947499493539325 0.000000000000000 - 708 2 -0.420 2.795600000000000 38.736969205856319 0.000000000000000 - 709 1 0.420 4.193400000000000 38.736969205856319 0.000000000000000 - 710 2 -0.420 4.892300000000000 39.947499493539325 0.000000000000000 - 711 1 0.420 6.290100000000000 39.947499493539325 0.000000000000000 - 712 2 -0.420 6.989000000000000 38.736969205856319 0.000000000000000 - 713 1 0.420 8.386799999999999 38.736969205856319 0.000000000000000 - 714 2 -0.420 9.085699999999999 39.947499493539325 0.000000000000000 - 715 1 0.420 10.483499999999999 39.947499493539325 0.000000000000000 - 716 2 -0.420 11.182399999999999 38.736969205856319 0.000000000000000 - 717 1 0.420 12.580200000000000 38.736969205856319 0.000000000000000 - 718 2 -0.420 13.279100000000000 39.947499493539325 0.000000000000000 - 719 1 0.420 14.676900000000000 39.947499493539325 0.000000000000000 - 720 2 -0.420 15.375800000000000 38.736969205856319 0.000000000000000 - 721 1 0.420 16.773599999999998 38.736969205856319 0.000000000000000 - 722 2 -0.420 17.472500000000000 39.947499493539325 0.000000000000000 - 723 1 0.420 18.870300000000000 39.947499493539325 0.000000000000000 - 724 2 -0.420 19.569199999999999 38.736969205856319 0.000000000000000 - 725 1 0.420 20.966999999999999 38.736969205856319 0.000000000000000 - 726 2 -0.420 21.665900000000001 39.947499493539325 0.000000000000000 - 727 1 0.420 23.063699999999997 39.947499493539325 0.000000000000000 - 728 2 -0.420 23.762599999999999 38.736969205856319 0.000000000000000 - 729 1 0.420 25.160399999999999 38.736969205856319 0.000000000000000 - 730 2 -0.420 25.859299999999998 39.947499493539325 0.000000000000000 - 731 1 0.420 27.257099999999998 39.947499493539325 0.000000000000000 - 732 2 -0.420 27.956000000000000 38.736969205856319 0.000000000000000 - 733 1 0.420 29.353800000000000 38.736969205856319 0.000000000000000 - 734 2 -0.420 30.052699999999998 39.947499493539325 0.000000000000000 - 735 1 0.420 31.450499999999998 39.947499493539325 0.000000000000000 - 736 2 -0.420 32.149400000000000 38.736969205856319 0.000000000000000 - 737 1 0.420 33.547199999999997 38.736969205856319 0.000000000000000 - 738 2 -0.420 34.246099999999998 39.947499493539325 0.000000000000000 - 739 1 0.420 35.643899999999995 39.947499493539325 0.000000000000000 - 740 2 -0.420 36.342799999999997 38.736969205856319 0.000000000000000 - 741 1 0.420 37.740600000000001 38.736969205856319 0.000000000000000 - 742 2 -0.420 38.439499999999995 39.947499493539325 0.000000000000000 - 743 1 0.420 39.837299999999999 39.947499493539325 0.000000000000000 - 744 2 -0.420 40.536200000000001 38.736969205856319 0.000000000000000 - 745 1 0.420 41.933999999999997 38.736969205856319 0.000000000000000 - 746 2 -0.420 42.632899999999999 39.947499493539325 0.000000000000000 - 747 1 0.420 44.030699999999996 39.947499493539325 0.000000000000000 - 748 2 -0.420 44.729599999999998 38.736969205856319 0.000000000000000 - 749 1 0.420 0.000000000000000 41.158029781222339 0.000000000000000 - 750 2 -0.420 0.698900000000000 42.368560068905346 0.000000000000000 - 751 1 0.420 2.096700000000000 42.368560068905346 0.000000000000000 - 752 2 -0.420 2.795600000000000 41.158029781222339 0.000000000000000 - 753 1 0.420 4.193400000000000 41.158029781222339 0.000000000000000 - 754 2 -0.420 4.892300000000000 42.368560068905346 0.000000000000000 - 755 1 0.420 6.290100000000000 42.368560068905346 0.000000000000000 - 756 2 -0.420 6.989000000000000 41.158029781222339 0.000000000000000 - 757 1 0.420 8.386799999999999 41.158029781222339 0.000000000000000 - 758 2 -0.420 9.085699999999999 42.368560068905346 0.000000000000000 - 759 1 0.420 10.483499999999999 42.368560068905346 0.000000000000000 - 760 2 -0.420 11.182399999999999 41.158029781222339 0.000000000000000 - 761 1 0.420 12.580200000000000 41.158029781222339 0.000000000000000 - 762 2 -0.420 13.279100000000000 42.368560068905346 0.000000000000000 - 763 1 0.420 14.676900000000000 42.368560068905346 0.000000000000000 - 764 2 -0.420 15.375800000000000 41.158029781222339 0.000000000000000 - 765 1 0.420 16.773599999999998 41.158029781222339 0.000000000000000 - 766 2 -0.420 17.472500000000000 42.368560068905346 0.000000000000000 - 767 1 0.420 18.870300000000000 42.368560068905346 0.000000000000000 - 768 2 -0.420 19.569199999999999 41.158029781222339 0.000000000000000 - 769 1 0.420 20.966999999999999 41.158029781222339 0.000000000000000 - 770 2 -0.420 21.665900000000001 42.368560068905346 0.000000000000000 - 771 1 0.420 23.063699999999997 42.368560068905346 0.000000000000000 - 772 2 -0.420 23.762599999999999 41.158029781222339 0.000000000000000 - 773 1 0.420 25.160399999999999 41.158029781222339 0.000000000000000 - 774 2 -0.420 25.859299999999998 42.368560068905346 0.000000000000000 - 775 1 0.420 27.257099999999998 42.368560068905346 0.000000000000000 - 776 2 -0.420 27.956000000000000 41.158029781222339 0.000000000000000 - 777 1 0.420 29.353800000000000 41.158029781222339 0.000000000000000 - 778 2 -0.420 30.052699999999998 42.368560068905346 0.000000000000000 - 779 1 0.420 31.450499999999998 42.368560068905346 0.000000000000000 - 780 2 -0.420 32.149400000000000 41.158029781222339 0.000000000000000 - 781 1 0.420 33.547199999999997 41.158029781222339 0.000000000000000 - 782 2 -0.420 34.246099999999998 42.368560068905346 0.000000000000000 - 783 1 0.420 35.643899999999995 42.368560068905346 0.000000000000000 - 784 2 -0.420 36.342799999999997 41.158029781222339 0.000000000000000 - 785 1 0.420 37.740600000000001 41.158029781222339 0.000000000000000 - 786 2 -0.420 38.439499999999995 42.368560068905346 0.000000000000000 - 787 1 0.420 39.837299999999999 42.368560068905346 0.000000000000000 - 788 2 -0.420 40.536200000000001 41.158029781222339 0.000000000000000 - 789 1 0.420 41.933999999999997 41.158029781222339 0.000000000000000 - 790 2 -0.420 42.632899999999999 42.368560068905346 0.000000000000000 - 791 1 0.420 44.030699999999996 42.368560068905346 0.000000000000000 - 792 2 -0.420 44.729599999999998 41.158029781222339 0.000000000000000 - 793 1 0.420 0.000000000000000 43.579090356588360 0.000000000000000 - 794 2 -0.420 0.698900000000000 44.789620644271366 0.000000000000000 - 795 1 0.420 2.096700000000000 44.789620644271366 0.000000000000000 - 796 2 -0.420 2.795600000000000 43.579090356588360 0.000000000000000 - 797 1 0.420 4.193400000000000 43.579090356588360 0.000000000000000 - 798 2 -0.420 4.892300000000000 44.789620644271366 0.000000000000000 - 799 1 0.420 6.290100000000000 44.789620644271366 0.000000000000000 - 800 2 -0.420 6.989000000000000 43.579090356588360 0.000000000000000 - 801 1 0.420 8.386799999999999 43.579090356588360 0.000000000000000 - 802 2 -0.420 9.085699999999999 44.789620644271366 0.000000000000000 - 803 1 0.420 10.483499999999999 44.789620644271366 0.000000000000000 - 804 2 -0.420 11.182399999999999 43.579090356588360 0.000000000000000 - 805 1 0.420 12.580200000000000 43.579090356588360 0.000000000000000 - 806 2 -0.420 13.279100000000000 44.789620644271366 0.000000000000000 - 807 1 0.420 14.676900000000000 44.789620644271366 0.000000000000000 - 808 2 -0.420 15.375800000000000 43.579090356588360 0.000000000000000 - 809 1 0.420 16.773599999999998 43.579090356588360 0.000000000000000 - 810 2 -0.420 17.472500000000000 44.789620644271366 0.000000000000000 - 811 1 0.420 18.870300000000000 44.789620644271366 0.000000000000000 - 812 2 -0.420 19.569199999999999 43.579090356588360 0.000000000000000 - 813 1 0.420 20.966999999999999 43.579090356588360 0.000000000000000 - 814 2 -0.420 21.665900000000001 44.789620644271366 0.000000000000000 - 815 1 0.420 23.063699999999997 44.789620644271366 0.000000000000000 - 816 2 -0.420 23.762599999999999 43.579090356588360 0.000000000000000 - 817 1 0.420 25.160399999999999 43.579090356588360 0.000000000000000 - 818 2 -0.420 25.859299999999998 44.789620644271366 0.000000000000000 - 819 1 0.420 27.257099999999998 44.789620644271366 0.000000000000000 - 820 2 -0.420 27.956000000000000 43.579090356588360 0.000000000000000 - 821 1 0.420 29.353800000000000 43.579090356588360 0.000000000000000 - 822 2 -0.420 30.052699999999998 44.789620644271366 0.000000000000000 - 823 1 0.420 31.450499999999998 44.789620644271366 0.000000000000000 - 824 2 -0.420 32.149400000000000 43.579090356588360 0.000000000000000 - 825 1 0.420 33.547199999999997 43.579090356588360 0.000000000000000 - 826 2 -0.420 34.246099999999998 44.789620644271366 0.000000000000000 - 827 1 0.420 35.643899999999995 44.789620644271366 0.000000000000000 - 828 2 -0.420 36.342799999999997 43.579090356588360 0.000000000000000 - 829 1 0.420 37.740600000000001 43.579090356588360 0.000000000000000 - 830 2 -0.420 38.439499999999995 44.789620644271366 0.000000000000000 - 831 1 0.420 39.837299999999999 44.789620644271366 0.000000000000000 - 832 2 -0.420 40.536200000000001 43.579090356588360 0.000000000000000 - 833 1 0.420 41.933999999999997 43.579090356588360 0.000000000000000 - 834 2 -0.420 42.632899999999999 44.789620644271366 0.000000000000000 - 835 1 0.420 44.030699999999996 44.789620644271366 0.000000000000000 - 836 2 -0.420 44.729599999999998 43.579090356588360 0.000000000000000 - 837 1 0.420 0.000000000000000 46.000150931954380 0.000000000000000 - 838 2 -0.420 0.698900000000000 47.210681219637387 0.000000000000000 - 839 1 0.420 2.096700000000000 47.210681219637387 0.000000000000000 - 840 2 -0.420 2.795600000000000 46.000150931954380 0.000000000000000 - 841 1 0.420 4.193400000000000 46.000150931954380 0.000000000000000 - 842 2 -0.420 4.892300000000000 47.210681219637387 0.000000000000000 - 843 1 0.420 6.290100000000000 47.210681219637387 0.000000000000000 - 844 2 -0.420 6.989000000000000 46.000150931954380 0.000000000000000 - 845 1 0.420 8.386799999999999 46.000150931954380 0.000000000000000 - 846 2 -0.420 9.085699999999999 47.210681219637387 0.000000000000000 - 847 1 0.420 10.483499999999999 47.210681219637387 0.000000000000000 - 848 2 -0.420 11.182399999999999 46.000150931954380 0.000000000000000 - 849 1 0.420 12.580200000000000 46.000150931954380 0.000000000000000 - 850 2 -0.420 13.279100000000000 47.210681219637387 0.000000000000000 - 851 1 0.420 14.676900000000000 47.210681219637387 0.000000000000000 - 852 2 -0.420 15.375800000000000 46.000150931954380 0.000000000000000 - 853 1 0.420 16.773599999999998 46.000150931954380 0.000000000000000 - 854 2 -0.420 17.472500000000000 47.210681219637387 0.000000000000000 - 855 1 0.420 18.870300000000000 47.210681219637387 0.000000000000000 - 856 2 -0.420 19.569199999999999 46.000150931954380 0.000000000000000 - 857 1 0.420 20.966999999999999 46.000150931954380 0.000000000000000 - 858 2 -0.420 21.665900000000001 47.210681219637387 0.000000000000000 - 859 1 0.420 23.063699999999997 47.210681219637387 0.000000000000000 - 860 2 -0.420 23.762599999999999 46.000150931954380 0.000000000000000 - 861 1 0.420 25.160399999999999 46.000150931954380 0.000000000000000 - 862 2 -0.420 25.859299999999998 47.210681219637387 0.000000000000000 - 863 1 0.420 27.257099999999998 47.210681219637387 0.000000000000000 - 864 2 -0.420 27.956000000000000 46.000150931954380 0.000000000000000 - 865 1 0.420 29.353800000000000 46.000150931954380 0.000000000000000 - 866 2 -0.420 30.052699999999998 47.210681219637387 0.000000000000000 - 867 1 0.420 31.450499999999998 47.210681219637387 0.000000000000000 - 868 2 -0.420 32.149400000000000 46.000150931954380 0.000000000000000 - 869 1 0.420 33.547199999999997 46.000150931954380 0.000000000000000 - 870 2 -0.420 34.246099999999998 47.210681219637387 0.000000000000000 - 871 1 0.420 35.643899999999995 47.210681219637387 0.000000000000000 - 872 2 -0.420 36.342799999999997 46.000150931954380 0.000000000000000 - 873 1 0.420 37.740600000000001 46.000150931954380 0.000000000000000 - 874 2 -0.420 38.439499999999995 47.210681219637387 0.000000000000000 - 875 1 0.420 39.837299999999999 47.210681219637387 0.000000000000000 - 876 2 -0.420 40.536200000000001 46.000150931954380 0.000000000000000 - 877 1 0.420 41.933999999999997 46.000150931954380 0.000000000000000 - 878 2 -0.420 42.632899999999999 47.210681219637387 0.000000000000000 - 879 1 0.420 44.030699999999996 47.210681219637387 0.000000000000000 - 880 2 -0.420 44.729599999999998 46.000150931954380 0.000000000000000 diff --git a/examples/in.hBN_shift b/examples/in.hBN_shift deleted file mode 100644 index b3035dc715..0000000000 --- a/examples/in.hBN_shift +++ /dev/null @@ -1,37 +0,0 @@ -# Initialization -units metal -boundary p p p -atom_style charge -processors * * 1 # domain decomposition over x and y - -# System and atom definition -# we use different molecule ids for each layer of hBN -# so that inter- and intra-layer -# interactions can be specified separately -read_data hBN-momolayer-5nm.data -mass 1 10.8110 # boron mass (g/mole) | membrane -mass 2 14.0067 # nitrogen mass (g/mole) | adsorbate - -######################## Potential defition ######################## -pair_style tersoff shift 0.05 -pair_coeff * * BNC.tersoff B N -#################################################################### -# Neighbor update settings -neighbor 2.0 bin -neigh_modify every 1 -neigh_modify delay 0 -neigh_modify check yes - -#### Simulation settings #### -timestep 0.001 -velocity all create 300.0 4928459 loop geom -fix thermostat all nve - -############# Output ############### -thermo 100 -thermo_style custom step etotal pe ke temp -#thermo_modify lost warn -thermo_modify line one format float %20.16g lost warn - -###### Run molecular dynamics ###### -run 1000 From 6909cf9dd5f8696fab2d0684408ab381b11b79f9 Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Mon, 8 Feb 2021 14:14:38 -0700 Subject: [PATCH 177/384] Uncomment Kokkos code --- src/KOKKOS/modify_kokkos.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/KOKKOS/modify_kokkos.cpp b/src/KOKKOS/modify_kokkos.cpp index c3d94f8dc5..40ed1cdfdc 100644 --- a/src/KOKKOS/modify_kokkos.cpp +++ b/src/KOKKOS/modify_kokkos.cpp @@ -399,11 +399,11 @@ void ModifyKokkos::energy_atom(int nlocal, double *energy) int i,j; double *eatom; - //for (i = 0; i < n_energy_atom; i++) { - // eatom = fix[list_energy_atom[i]]->eatom; - // if (!eatom) continue; - // for (j = 0; j < nlocal; j++) energy[j] += eatom[j]; - //} + for (i = 0; i < n_energy_atom; i++) { + eatom = fix[list_energy_atom[i]]->eatom; + if (!eatom) continue; + for (j = 0; j < nlocal; j++) energy[j] += eatom[j]; + } } /* ---------------------------------------------------------------------- From c5bb414c377581b44579654a13a44c4431f513ff Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 8 Feb 2021 17:26:39 -0500 Subject: [PATCH 178/384] remove dead code --- src/USER-REACTION/fix_bond_react.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 657caf1e68..3098a1bd67 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -3273,7 +3273,7 @@ int FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) // inserting atoms based off fix_deposit->pre_exchange int flag; imageint *imageflags; - double **coords,lamda[3],rotmat[3][3],vnew[3]; + double **coords,lamda[3],rotmat[3][3]; double *newcoord; double **v = atom->v; double t,delx,dely,delz,rsq; @@ -3352,7 +3352,7 @@ int FixBondReact::insert_atoms(tagint **my_mega_glove, int iupdate) fit_incr++; } } - double rmsd = superposer.Superpose(xfrozen, xmobile); + superposer.Superpose(xfrozen, xmobile); for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) rotmat[i][j] = superposer.R[i][j]; From 56ae49881467b0aca16ecd6549325a03de1f41c8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 8 Feb 2021 17:27:54 -0500 Subject: [PATCH 179/384] reduce memory leakage in kspace style msm --- src/KSPACE/msm.cpp | 50 ++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/src/KSPACE/msm.cpp b/src/KSPACE/msm.cpp index febf37029b..1e980e856f 100644 --- a/src/KSPACE/msm.cpp +++ b/src/KSPACE/msm.cpp @@ -640,6 +640,7 @@ void MSM::allocate() // create commgrid object for rho and electric field communication if (active_flag[n]) { + delete gc[n]; int **procneigh = procneigh_levels[n]; gc[n] = new GridComm(lmp,world_levels[n],2,nx_msm[n],ny_msm[n],nz_msm[n], nxlo_in[n],nxhi_in[n],nylo_in[n],nyhi_in[n], @@ -655,6 +656,9 @@ void MSM::allocate() memory->create(gc_buf2[n],npergrid*ngc_buf2[n],"msm:gc_buf2"); } else { + delete gc[n]; + memory->destroy(gc_buf1[n]); + memory->destroy(gc_buf2[n]); gc[n] = nullptr; gc_buf1[n] = gc_buf2[n] = nullptr; } @@ -675,28 +679,6 @@ void MSM::deallocate() memory->destroy(gcall_buf2); gcall = nullptr; gcall_buf1 = gcall_buf2 = nullptr; - - for (int n=0; ndestroy3d_offset(qgrid[n],nzlo_out[n],nylo_out[n],nxlo_out[n]); - - if (egrid[n]) - memory->destroy3d_offset(egrid[n],nzlo_out[n],nylo_out[n],nxlo_out[n]); - - if (world_levels) - if (world_levels[n] != MPI_COMM_NULL) - MPI_Comm_free(&world_levels[n]); - - if (gc) { - if (gc[n]) { - delete gc[n]; - memory->destroy(gc_buf1[n]); - memory->destroy(gc_buf2[n]); - gc[n] = nullptr; - gc_buf1[n] = gc_buf2[n] = nullptr; - } - } - } } /* ---------------------------------------------------------------------- @@ -846,6 +828,30 @@ void MSM::allocate_levels() void MSM::deallocate_levels() { + if (world_levels) { + for (int n=0; n < levels; ++n) { + if (qgrid[n]) + memory->destroy3d_offset(qgrid[n],nzlo_out[n],nylo_out[n],nxlo_out[n]); + + if (egrid[n]) + memory->destroy3d_offset(egrid[n],nzlo_out[n],nylo_out[n],nxlo_out[n]); + + if (gc) { + if (gc[n]) { + delete gc[n]; + memory->destroy(gc_buf1[n]); + memory->destroy(gc_buf2[n]); + gc[n] = nullptr; + gc_buf1[n] = gc_buf2[n] = nullptr; + } + } + + if (world_levels[n] != MPI_COMM_NULL) { + MPI_Comm_free(&world_levels[n]); + } + } + } + delete [] ngrid; ngrid = nullptr; From a6aabc0a938d9ab1b29b7ff351d8b6b8ae7d28ce Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 8 Feb 2021 20:03:13 -0500 Subject: [PATCH 180/384] fix typo --- src/compute_stress_atom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compute_stress_atom.cpp b/src/compute_stress_atom.cpp index 5043797233..28abc13453 100644 --- a/src/compute_stress_atom.cpp +++ b/src/compute_stress_atom.cpp @@ -222,7 +222,7 @@ void ComputeStressAtom::compute_peratom() Fix **fix = modify->fix; int nfix = modify->nfix; for (int ifix = 0; ifix < nfix; ifix++) - if (fix[i]->virial_peratom_flag && fix[ifix]->thermo_virial) { + if (fix[ifix]->virial_peratom_flag && fix[ifix]->thermo_virial) { double **vatom = fix[ifix]->vatom; if (vatom) for (i = 0; i < nlocal; i++) From 5e55ab0e9bf0fa90154c37e0bbdc5447382a7d86 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 8 Feb 2021 20:18:37 -0500 Subject: [PATCH 181/384] silence compiler warnings --- src/KOKKOS/compute_orientorder_atom_kokkos.cpp | 4 ++-- src/KOKKOS/fix_neigh_history_kokkos.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/KOKKOS/compute_orientorder_atom_kokkos.cpp b/src/KOKKOS/compute_orientorder_atom_kokkos.cpp index 2325288c8c..65c4737ab4 100644 --- a/src/KOKKOS/compute_orientorder_atom_kokkos.cpp +++ b/src/KOKKOS/compute_orientorder_atom_kokkos.cpp @@ -143,7 +143,7 @@ void ComputeOrientOrderAtomKokkos::compute_peratom() chunk_size = MIN(chunksize,inum); // "chunksize" variable is set by user chunk_offset = 0; - if (chunk_size > d_ncount.extent(0)) { + if (chunk_size > (int)d_ncount.extent(0)) { d_qnm = t_sna_3c("orientorder/atom:qnm",chunk_size,nqlist,2*qmax+1); d_ncount = t_sna_1i("orientorder/atom:ncount",chunk_size); } @@ -155,7 +155,7 @@ void ComputeOrientOrderAtomKokkos::compute_peratom() maxneigh = 0; Kokkos::parallel_reduce("ComputeOrientOrderAtomKokkos::find_max_neighs",inum, FindMaxNumNeighs(k_list), Kokkos::Max(maxneigh)); - if (chunk_size > d_distsq.extent(0) || maxneigh > d_distsq.extent(1)) { + if (chunk_size > (int)d_distsq.extent(0) || maxneigh > (int)d_distsq.extent(1)) { d_distsq = t_sna_2d_lr("orientorder/atom:distsq",chunk_size,maxneigh); d_nearest = t_sna_2i_lr("orientorder/atom:nearest",chunk_size,maxneigh); d_rlist = t_sna_3d_lr("orientorder/atom:rlist",chunk_size,maxneigh,3); diff --git a/src/KOKKOS/fix_neigh_history_kokkos.cpp b/src/KOKKOS/fix_neigh_history_kokkos.cpp index 0f57b67a0e..3d351f7a73 100644 --- a/src/KOKKOS/fix_neigh_history_kokkos.cpp +++ b/src/KOKKOS/fix_neigh_history_kokkos.cpp @@ -182,7 +182,7 @@ void FixNeighHistoryKokkos::post_neighbor() // realloc firstflag and firstvalue if needed - if (maxatom < nlocal || k_list->maxneighs > d_firstflag.extent(1)) { + if (maxatom < nlocal || k_list->maxneighs > (int)d_firstflag.extent(1)) { maxatom = nall; d_firstflag = Kokkos::View("neighbor_history:firstflag",maxatom,k_list->maxneighs); d_firstvalue = Kokkos::View("neighbor_history:firstvalue",maxatom,k_list->maxneighs*dnum); From 6f08e81bf81327f2f46cf8b70b88cc51fecbc89c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 8 Feb 2021 20:19:22 -0500 Subject: [PATCH 182/384] don't access uninitialized data and avoid shadowing a class member variable --- src/KOKKOS/fix_langevin_kokkos.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/KOKKOS/fix_langevin_kokkos.cpp b/src/KOKKOS/fix_langevin_kokkos.cpp index 0dcaabb39c..054302b9c5 100644 --- a/src/KOKKOS/fix_langevin_kokkos.cpp +++ b/src/KOKKOS/fix_langevin_kokkos.cpp @@ -765,11 +765,11 @@ template KOKKOS_INLINE_FUNCTION double FixLangevinKokkos::compute_energy_item(int i) const { - double energy; + double my_energy = 0.0; if (mask[i] & groupbit) - energy = d_flangevin(i,0)*v(i,0) + d_flangevin(i,1)*v(i,1) + + my_energy = d_flangevin(i,0)*v(i,0) + d_flangevin(i,1)*v(i,1) + d_flangevin(i,2)*v(i,2); - return energy; + return my_energy; } /* ---------------------------------------------------------------------- From 82dc03ab3daf58c193e2bddd5664b56f585e07b5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 8 Feb 2021 21:17:52 -0500 Subject: [PATCH 183/384] update examples and log files for cases affected by the fix_modify changes --- examples/hugoniostat/in.hugoniostat | 30 +- .../hugoniostat/log.08Feb21.hugoniostat.g++.1 | 399 +++++++++++++ .../hugoniostat/log.08Feb21.hugoniostat.g++.4 | 399 +++++++++++++ .../hugoniostat/log.27Nov18.hugoniostat.g++.1 | 401 ------------- .../hugoniostat/log.27Nov18.hugoniostat.g++.4 | 401 ------------- .../hugoniostat/log.5Oct16.hugoniostat.g++.1 | 110 ---- .../hugoniostat/log.5Oct16.hugoniostat.g++.4 | 110 ---- examples/msst/in.msst | 5 +- ...un20.msst.g++.1 => log.08Feb21.msst.g++.1} | 87 ++- ...un20.msst.g++.4 => log.08Feb21.msst.g++.4} | 91 ++- examples/threebody/in.threebody | 8 +- .../threebody/log.08Feb21.threebody.g++.1 | 373 ++++++++++++ .../threebody/log.08Feb21.threebody.g++.4 | 373 ++++++++++++ .../threebody/log.13Jan21.threebody.g++.1 | 547 ------------------ .../threebody/log.13Jan21.threebody.g++.4 | 547 ------------------ 15 files changed, 1644 insertions(+), 2237 deletions(-) create mode 100644 examples/hugoniostat/log.08Feb21.hugoniostat.g++.1 create mode 100644 examples/hugoniostat/log.08Feb21.hugoniostat.g++.4 delete mode 100644 examples/hugoniostat/log.27Nov18.hugoniostat.g++.1 delete mode 100644 examples/hugoniostat/log.27Nov18.hugoniostat.g++.4 delete mode 100644 examples/hugoniostat/log.5Oct16.hugoniostat.g++.1 delete mode 100644 examples/hugoniostat/log.5Oct16.hugoniostat.g++.4 rename examples/msst/{log.30Jun20.msst.g++.1 => log.08Feb21.msst.g++.1} (67%) rename examples/msst/{log.30Jun20.msst.g++.4 => log.08Feb21.msst.g++.4} (66%) create mode 100644 examples/threebody/log.08Feb21.threebody.g++.1 create mode 100644 examples/threebody/log.08Feb21.threebody.g++.4 delete mode 100644 examples/threebody/log.13Jan21.threebody.g++.1 delete mode 100644 examples/threebody/log.13Jan21.threebody.g++.4 diff --git a/examples/hugoniostat/in.hugoniostat b/examples/hugoniostat/in.hugoniostat index 571f92b59e..8a36212f53 100644 --- a/examples/hugoniostat/in.hugoniostat +++ b/examples/hugoniostat/in.hugoniostat @@ -1,16 +1,16 @@ # This script reproduces stress trajectories from Fig. 1 in # Ravelo, Holian, Germann, and Lomdahl, PRB 70 014103 (2004) # -# Three thermostatting scenarios are visited: undamped (nodrag), +# Three thermostatting scenarios are visited: undamped (nodrag), # damped (drag) and Nose-Hoover chain (nhchains). # # The axial and shear stress trajectories are printed to the # file "stress_vs_t.dat". For the damped case, the original figure # seems to be a plot of 2*tau, rather than tau. # -# The script also demonstrates how to +# The script also demonstrates how to # orient a crystal along <110>, -# and how to use the lj/cubic pair style. +# and how to use the lj/cubic pair style. units lj boundary p p p @@ -39,7 +39,7 @@ pair_coeff * * 1.0 0.8908987 fix 3 all box/relax aniso 0.0 vmax 1.0e-4 nreset 100 thermo 100 -thermo_style custom step temp pe etotal pxx pyy pzz lx ly lz +thermo_style custom step temp pe etotal pxx pyy pzz lx ly lz min_modify line quadratic minimize 0.0 1.0e-6 10000 100000 @@ -61,16 +61,12 @@ reset_timestep 0 # Pzz = 40.0, drag/damping term off -fix myhug all nphug temp 1.0 1.0 10.0 z 40.0 40.0 70.0 drag 0.0 tchain 1 pchain 0 +fix myhug all nphug temp 1.0 1.0 10.0 z 40.0 40.0 70.0 drag 0.0 tchain 1 pchain 0 # Specify reference state from paper, times 1000 atoms fix_modify myhug e0 -6334.0 p0 0.0 v0 680.73519 -# Add fix energy to output etotal - -fix_modify myhug energy yes - # Define output variable dele equal f_myhug[1] # energy delta [temperature] @@ -81,7 +77,7 @@ variable tau equal 0.5*(pzz-0.5*(pxx+pyy)) # shear stress variable time equal dt*step thermo 1000 -thermo_style custom step temp ke epair etotal pzz v_tau lz f_myhug v_dele v_us v_up +thermo_style custom step temp ke epair econserve pzz v_tau lz f_myhug v_dele v_us v_up fix stress all print 10 "${time} ${pzz} ${tau} " screen no append stress_vs_t.dat title '#time pzz tau (no drag)' @@ -109,16 +105,12 @@ reset_timestep 0 # Pzz = 40.0, drag/damping term on -fix myhug all nphug temp 1.0 1.0 1.0 z 40.0 40.0 70.0 drag 200.0 tchain 1 pchain 0 +fix myhug all nphug temp 1.0 1.0 1.0 z 40.0 40.0 70.0 drag 200.0 tchain 1 pchain 0 # Specify reference state from paper, times 1000 atoms fix_modify myhug e0 -6334.0 p0 0.0 v0 680.73519 -# Add fix energy to output etotal - -fix_modify myhug energy yes - # Define output variable dele equal f_myhug[1] # energy delta [temperature] @@ -129,7 +121,7 @@ variable tau equal 0.5*(pzz-0.5*(pxx+pyy)) # shear stress variable time equal dt*step thermo 1000 -thermo_style custom step temp ke epair etotal pzz v_tau lz f_myhug v_dele v_us v_up +thermo_style custom step temp ke epair econserve pzz v_tau lz f_myhug v_dele v_us v_up fix stress all print 10 "${time} ${pzz} ${tau} " screen no append stress_vs_t.dat title '#time pzz tau (with drag)' @@ -153,10 +145,6 @@ fix myhug all nphug temp 1.0 1.0 1.0 z 40.0 40.0 70.0 fix_modify myhug e0 -6334.0 p0 0.0 v0 680.73519 -# Add fix energy to output etotal - -fix_modify myhug energy yes - # Define output variable dele equal f_myhug[1] # energy delta [temperature] @@ -167,7 +155,7 @@ variable tau equal 0.5*(pzz-0.5*(pxx+pyy)) # shear stress variable time equal dt*step thermo 1000 -thermo_style custom step temp ke epair etotal pzz v_tau lz f_myhug v_dele v_us v_up +thermo_style custom step temp ke epair econserve pzz v_tau lz f_myhug v_dele v_us v_up fix stress all print 10 "${time} ${pzz} ${tau} " screen no append stress_vs_t.dat title '#time pzz tau (Nose-Hoover chain)' diff --git a/examples/hugoniostat/log.08Feb21.hugoniostat.g++.1 b/examples/hugoniostat/log.08Feb21.hugoniostat.g++.1 new file mode 100644 index 0000000000..5641c14048 --- /dev/null +++ b/examples/hugoniostat/log.08Feb21.hugoniostat.g++.1 @@ -0,0 +1,399 @@ +LAMMPS (24 Dec 2020) + using 1 OpenMP thread(s) per MPI task +# This script reproduces stress trajectories from Fig. 1 in +# Ravelo, Holian, Germann, and Lomdahl, PRB 70 014103 (2004) +# +# Three thermostatting scenarios are visited: undamped (nodrag), +# damped (drag) and Nose-Hoover chain (nhchains). +# +# The axial and shear stress trajectories are printed to the +# file "stress_vs_t.dat". For the damped case, the original figure +# seems to be a plot of 2*tau, rather than tau. +# +# The script also demonstrates how to +# orient a crystal along <110>, +# and how to use the lj/cubic pair style. + +units lj +boundary p p p + +atom_style atomic + +# Set up FCC lattice with z axis along <110> + +lattice fcc 1.4142136 orient x 0 0 1 orient y 1 -1 0 orient z 1 1 0 +Lattice spacing in x,y,z = 1.4142135 2.0000000 2.0000000 + +region mycell block 0.0 5.0 0.0 5.0 0.0 5.0 units lattice +create_box 1 mycell +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (7.0710677 9.9999999 9.9999999) + 1 by 1 by 1 MPI processor grid +mass * 1.0 +create_atoms 1 box +Created 1000 atoms + create_atoms CPU = 0.001 seconds + +# Using units of Rmin, so sigma = 2^-1/6 = 0.8908987 + +pair_style lj/cubic +pair_coeff * * 1.0 0.8908987 + +# Relax box dimensions + +fix 3 all box/relax aniso 0.0 vmax 1.0e-4 nreset 100 + +thermo 100 +thermo_style custom step temp pe etotal pxx pyy pzz lx ly lz + +min_modify line quadratic +minimize 0.0 1.0e-6 10000 100000 +WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (src/min.cpp:188) +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.8475372 + ghost atom cutoff = 1.8475372 + binsize = 0.92376862, bins = 8 11 11 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cubic, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 4.247 | 4.247 | 4.247 Mbytes +Step Temp PotEng TotEng Pxx Pyy Pzz Lx Ly Lz + 0 0 -6.2937536 -6.2937536 -2.7722424 -2.7722424 -2.7722424 7.0710677 9.9999999 9.9999999 + 100 0 -6.3319014 -6.3319014 -0.75971257 -0.75971257 -0.75971257 7.0003571 9.8999999 9.8999999 + 134 0 -6.3344253 -6.3344253 -4.3330648e-13 -4.7530261e-13 -4.7130069e-13 6.9780267 9.8684199 9.8684199 +Loop time of 0.200013 on 1 procs for 134 steps with 1000 atoms + +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +Minimization stats: + Stopping criterion = force tolerance + Energy initial, next-to-last, final = + -6.29375358358557 -6.33442531515503 -6.33442531515503 + Force two-norm initial, final = 3395.2895 5.5740327e-10 + Force max component initial, final = 1960.2713 3.2730334e-10 + Final line search alpha, max atom move = 1.0000000 3.2730334e-10 + Iterations, force evaluations = 134 137 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.14357 | 0.14357 | 0.14357 | 0.0 | 71.78 +Neigh | 0.0017562 | 0.0017562 | 0.0017562 | 0.0 | 0.88 +Comm | 0.0049057 | 0.0049057 | 0.0049057 | 0.0 | 2.45 +Output | 5.126e-05 | 5.126e-05 | 5.126e-05 | 0.0 | 0.03 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 0.04973 | | | 24.86 + +Nlocal: 1000.00 ave 1000 max 1000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 1724.00 ave 1724 max 1724 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 21000.0 ave 21000 max 21000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 21000 +Ave neighs/atom = 21.000000 +Neighbor list builds = 1 +Dangerous builds = 0 + +# Define initial velocity + +velocity all create 0.01 87287 mom yes rot yes dist gaussian +write_restart restart.equil +System init for write_restart ... + +# Start Run #1 + +clear + using 1 OpenMP thread(s) per MPI task +read_restart restart.equil +Reading restart file ... + restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 + restoring atom style atomic from restart + orthogonal box = (0.046520549 0.065789991 0.065789991) to (7.0245472 9.9342099 9.9342099) + 1 by 1 by 1 MPI processor grid + restoring pair style lj/cubic from restart + 1000 atoms + read_restart CPU = 0.001 seconds + +neighbor 0.2 bin +neigh_modify every 1 delay 0 check yes +timestep 0.001 +reset_timestep 0 + +# Pzz = 40.0, drag/damping term off + +fix myhug all nphug temp 1.0 1.0 10.0 z 40.0 40.0 70.0 drag 0.0 tchain 1 pchain 0 + +# Specify reference state from paper, times 1000 atoms + +fix_modify myhug e0 -6334.0 p0 0.0 v0 680.73519 + +# Define output + +variable dele equal f_myhug[1] # energy delta [temperature] +variable us equal f_myhug[2] # shock velocity [distance/time] +variable up equal f_myhug[3] # particle velocity [distance/time] +variable pzz equal pzz # axial stress +variable tau equal 0.5*(pzz-0.5*(pxx+pyy)) # shear stress +variable time equal dt*step + +thermo 1000 +thermo_style custom step temp ke epair econserve pzz v_tau lz f_myhug v_dele v_us v_up + +fix stress all print 10 "${time} ${pzz} ${tau} " screen no append stress_vs_t.dat title '#time pzz tau (no drag)' + +#dump id all atom 500 dump.hugoniostat + +#dump 2 all image 500 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 +#dump_modify 2 pad 5 + +#dump 3 all movie 500 movie.mpg type type # axes yes 0.8 0.02 view 60 -30 +#dump_modify 3 pad 5 + +run 10000 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.7475372 + ghost atom cutoff = 1.7475372 + binsize = 0.87376862, bins = 8 12 12 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cubic, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.124 | 3.124 | 3.124 Mbytes +Step Temp KinEng E_pair Econserve Pzz v_tau Lz f_myhug v_dele v_us v_up + 0 0.01 0.014985 -6.3344253 -6.3194403 0.014381062 -0.00023971829 9.8684199 0 -0.004855267 2.3814248 0.0041108563 + 1000 0.0093381492 0.013993217 -2.1704431 -4183.8284 129.15284 58.544409 8.3142517 -4.1816719 0.93744212 23.519052 3.7381985 + 2000 0.24794859 0.37155095 -5.8915826 -528.38691 8.3849811 1.3744297 9.5938806 -0.52286688 -0.24350394 13.910493 0.41033425 + 3000 0.3892042 0.5832225 -3.7686896 -3442.3257 72.742382 28.486576 8.6238082 -3.4391402 0.0038227739 19.697354 2.5139569 + 4000 0.67010303 1.0041494 -4.2080956 -2935.8105 35.596234 3.9346859 8.7508489 -2.9326065 -0.58038927 14.529876 1.6677093 + 5000 0.41845028 0.62704774 -4.8392822 -1894.6664 30.624319 4.6370699 8.7827304 -1.8904542 -0.31998377 13.670423 1.5249748 + 6000 0.22409652 0.33580864 -3.7653422 -2666.4156 50.804071 7.220865 8.25496 -2.6629861 -0.017448126 14.48017 2.3883779 + 7000 0.094832866 0.14210705 -4.5432169 -2337.0271 35.853414 3.4750842 8.4475655 -2.332626 -0.052659776 12.95347 1.8841809 + 8000 0.043338745 0.06494311 -4.6249403 -1687.4892 39.679004 6.7256868 8.4321684 -1.6829292 0.070571417 13.554654 1.9927395 + 9000 0.018233343 0.027322664 -4.425909 -1916.4941 41.680023 5.9079935 8.3470382 -1.9120955 0.090887676 13.502397 2.1013348 + 10000 0.0082616415 0.01238007 -4.6221264 -1723.6542 39.842157 6.5678795 8.41093 -1.7190444 0.099616538 13.484322 2.0113699 +Loop time of 15.2001 on 1 procs for 10000 steps with 1000 atoms + +Performance: 56841.813 tau/day, 657.891 timesteps/s +99.8% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 11.69 | 11.69 | 11.69 | 0.0 | 76.91 +Neigh | 0.34087 | 0.34087 | 0.34087 | 0.0 | 2.24 +Comm | 0.41211 | 0.41211 | 0.41211 | 0.0 | 2.71 +Output | 0.001153 | 0.001153 | 0.001153 | 0.0 | 0.01 +Modify | 2.6404 | 2.6404 | 2.6404 | 0.0 | 17.37 +Other | | 0.1158 | | | 0.76 + +Nlocal: 1000.00 ave 1000 max 1000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 1886.00 ave 1886 max 1886 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 20874.0 ave 20874 max 20874 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 20874 +Ave neighs/atom = 20.874000 +Neighbor list builds = 188 +Dangerous builds = 0 + +# Start Run #2 + +clear + using 1 OpenMP thread(s) per MPI task +read_restart restart.equil +Reading restart file ... + restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 + restoring atom style atomic from restart + orthogonal box = (0.046520549 0.065789991 0.065789991) to (7.0245472 9.9342099 9.9342099) + 1 by 1 by 1 MPI processor grid + restoring pair style lj/cubic from restart + 1000 atoms + read_restart CPU = 0.001 seconds + +neighbor 0.2 bin +neigh_modify every 1 delay 0 check yes +timestep 0.001 +reset_timestep 0 + +# Pzz = 40.0, drag/damping term on + +fix myhug all nphug temp 1.0 1.0 1.0 z 40.0 40.0 70.0 drag 200.0 tchain 1 pchain 0 + +# Specify reference state from paper, times 1000 atoms + +fix_modify myhug e0 -6334.0 p0 0.0 v0 680.73519 + +# Define output + +variable dele equal f_myhug[1] # energy delta [temperature] +variable us equal f_myhug[2] # shock velocity [distance/time] +variable up equal f_myhug[3] # particle velocity [distance/time] +variable pzz equal pzz # axial stress +variable tau equal 0.5*(pzz-0.5*(pxx+pyy)) # shear stress +variable time equal dt*step + +thermo 1000 +thermo_style custom step temp ke epair econserve pzz v_tau lz f_myhug v_dele v_us v_up + +fix stress all print 10 "${time} ${pzz} ${tau} " screen no append stress_vs_t.dat title '#time pzz tau (with drag)' + +run 10000 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.7475372 + ghost atom cutoff = 1.7475372 + binsize = 0.87376862, bins = 8 12 12 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cubic, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.124 | 3.124 | 3.124 Mbytes +Step Temp KinEng E_pair Econserve Pzz v_tau Lz f_myhug v_dele v_us v_up + 0 0.01 0.014985 -6.3344253 -6.3194403 0.014381062 -0.00023971829 9.8684199 0 -0.004855267 2.3814248 0.0041108563 + 1000 0.0062572988 0.0093765623 -5.989087 -1670.9191 18.918118 7.5844401 9.2338165 -1.6649394 0.023419337 13.976997 0.92138738 + 2000 0.0068451081 0.010257394 -5.456581 -2537.81 37.064253 15.537266 8.9496405 -2.5323637 0.10230605 16.325406 1.5455016 + 3000 0.0073276099 0.010980423 -5.3663421 -2643.8751 39.907292 16.807489 8.9154852 -2.6385198 0.11818116 16.63905 1.6326832 + 4000 0.0069296906 0.010384141 -5.36234 -2655.7228 40.010742 16.851482 8.9144328 -2.6503709 0.11868137 16.651571 1.6356847 + 5000 0.0076142461 0.011409948 -5.3631443 -2664.4499 39.997648 16.846756 8.9145416 -2.6590982 0.1184114 16.649779 1.6353254 + 6000 0.0077053831 0.011546517 -5.3628538 -2673.2444 39.991598 16.840314 8.9145803 -2.667893 0.11818361 16.648852 1.6351691 + 7000 0.0077405663 0.011599239 -5.3623531 -2682.1589 40.000448 16.844009 8.9145774 -2.6768081 0.11809899 16.650669 1.6353525 + 8000 0.0080673569 0.012088934 -5.3623755 -2691.0104 39.995327 16.840134 8.9146099 -2.6856601 0.11787103 16.649882 1.6352204 + 9000 0.0083223083 0.012470979 -5.3622988 -2699.8929 40.00571 16.847764 8.9146503 -2.6945431 0.11781523 16.652389 1.6353987 + 10000 0.0091249116 0.01367368 -5.3630138 -2708.966 39.987197 16.837314 8.9146848 -2.7036167 0.11743014 16.648832 1.6349911 +Loop time of 13.6753 on 1 procs for 10000 steps with 1000 atoms + +Performance: 63179.754 tau/day, 731.247 timesteps/s +99.8% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 10.568 | 10.568 | 10.568 | 0.0 | 77.28 +Neigh | 0.019792 | 0.019792 | 0.019792 | 0.0 | 0.14 +Comm | 0.33708 | 0.33708 | 0.33708 | 0.0 | 2.46 +Output | 0.0011928 | 0.0011928 | 0.0011928 | 0.0 | 0.01 +Modify | 2.639 | 2.639 | 2.639 | 0.0 | 19.30 +Other | | 0.1101 | | | 0.81 + +Nlocal: 1000.00 ave 1000 max 1000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 1724.00 ave 1724 max 1724 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 21000.0 ave 21000 max 21000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 21000 +Ave neighs/atom = 21.000000 +Neighbor list builds = 11 +Dangerous builds = 0 + +# Start Run #3 + +clear + using 1 OpenMP thread(s) per MPI task +read_restart restart.equil +Reading restart file ... + restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 + restoring atom style atomic from restart + orthogonal box = (0.046520549 0.065789991 0.065789991) to (7.0245472 9.9342099 9.9342099) + 1 by 1 by 1 MPI processor grid + restoring pair style lj/cubic from restart + 1000 atoms + read_restart CPU = 0.001 seconds + +neighbor 0.2 bin +neigh_modify every 1 delay 0 check yes +timestep 0.001 +reset_timestep 0 + +# Pzz = 40.0, drag/damping term off, Nose-Hoover chains + +fix myhug all nphug temp 1.0 1.0 1.0 z 40.0 40.0 70.0 + +# Specify reference state from paper, times 1000 atoms + +fix_modify myhug e0 -6334.0 p0 0.0 v0 680.73519 + +# Define output + +variable dele equal f_myhug[1] # energy delta [temperature] +variable us equal f_myhug[2] # shock velocity [distance/time] +variable up equal f_myhug[3] # particle velocity [distance/time] +variable pzz equal pzz # axial stress +variable tau equal 0.5*(pzz-0.5*(pxx+pyy)) # shear stress +variable time equal dt*step + +thermo 1000 +thermo_style custom step temp ke epair econserve pzz v_tau lz f_myhug v_dele v_us v_up + +fix stress all print 10 "${time} ${pzz} ${tau} " screen no append stress_vs_t.dat title '#time pzz tau (Nose-Hoover chain)' + +run 10000 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.7475372 + ghost atom cutoff = 1.7475372 + binsize = 0.87376862, bins = 8 12 12 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cubic, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.124 | 3.124 | 3.124 Mbytes +Step Temp KinEng E_pair Econserve Pzz v_tau Lz f_myhug v_dele v_us v_up + 0 0.01 0.014985 -6.3344253 -6.3194403 0.014381062 -0.00023971829 9.8684199 0 -0.004855267 2.3814248 0.0041108563 + 1000 0.0083300318 0.012482553 -5.5023183 -838.99233 35.610078 14.886668 8.9677982 -0.83350249 0.093761717 16.159482 1.500112 + 2000 0.020386436 0.030549075 -5.294934 -1021.4347 41.760404 17.563313 8.8960328 -1.0161703 0.1178086 16.852842 1.6868239 + 3000 0.049693082 0.074465084 -5.3469418 -982.1922 39.030412 16.123502 8.9325589 -0.97691972 0.073097533 16.601991 1.6003728 + 4000 0.11859524 0.17771497 -5.207074 -1299.948 40.941639 16.507821 8.9213137 -1.2949186 0.018189971 16.904165 1.6487306 + 5000 0.130146 0.19502378 -5.261025 -1208.3405 39.059595 15.609328 8.9431689 -1.2032745 -0.00023811036 16.701434 1.5920334 + 6000 0.13812959 0.20698719 -5.1710048 -1334.1421 40.904888 16.242199 8.9222846 -1.329178 -0.0044756362 16.90509 1.6471606 + 7000 0.12107441 0.18143001 -5.2602562 -1170.0585 39.060849 15.577606 8.9397535 -1.1649797 0.005587398 16.671517 1.5949415 + 8000 0.14333426 0.21478639 -5.1717109 -1352.635 40.876285 16.205871 8.9218128 -1.3476781 -0.0069373292 16.895041 1.6469877 + 9000 0.12159783 0.18221435 -5.2591928 -1186.8604 39.22852 15.6778 8.9376658 -1.1817834 0.0077335044 16.68885 1.6001243 + 10000 0.15321647 0.22959488 -5.188176 -1391.2245 40.666599 16.146259 8.9228489 -1.3862659 -0.0091900905 16.860718 1.6418747 +Loop time of 13.963 on 1 procs for 10000 steps with 1000 atoms + +Performance: 61877.846 tau/day, 716.179 timesteps/s +99.8% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 10.667 | 10.667 | 10.667 | 0.0 | 76.40 +Neigh | 0.16763 | 0.16763 | 0.16763 | 0.0 | 1.20 +Comm | 0.36182 | 0.36182 | 0.36182 | 0.0 | 2.59 +Output | 0.0011809 | 0.0011809 | 0.0011809 | 0.0 | 0.01 +Modify | 2.6516 | 2.6516 | 2.6516 | 0.0 | 18.99 +Other | | 0.1135 | | | 0.81 + +Nlocal: 1000.00 ave 1000 max 1000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 1724.00 ave 1724 max 1724 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 20654.0 ave 20654 max 20654 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 20654 +Ave neighs/atom = 20.654000 +Neighbor list builds = 94 +Dangerous builds = 0 + +Total wall time: 0:00:43 diff --git a/examples/hugoniostat/log.08Feb21.hugoniostat.g++.4 b/examples/hugoniostat/log.08Feb21.hugoniostat.g++.4 new file mode 100644 index 0000000000..529407ae2b --- /dev/null +++ b/examples/hugoniostat/log.08Feb21.hugoniostat.g++.4 @@ -0,0 +1,399 @@ +LAMMPS (24 Dec 2020) + using 1 OpenMP thread(s) per MPI task +# This script reproduces stress trajectories from Fig. 1 in +# Ravelo, Holian, Germann, and Lomdahl, PRB 70 014103 (2004) +# +# Three thermostatting scenarios are visited: undamped (nodrag), +# damped (drag) and Nose-Hoover chain (nhchains). +# +# The axial and shear stress trajectories are printed to the +# file "stress_vs_t.dat". For the damped case, the original figure +# seems to be a plot of 2*tau, rather than tau. +# +# The script also demonstrates how to +# orient a crystal along <110>, +# and how to use the lj/cubic pair style. + +units lj +boundary p p p + +atom_style atomic + +# Set up FCC lattice with z axis along <110> + +lattice fcc 1.4142136 orient x 0 0 1 orient y 1 -1 0 orient z 1 1 0 +Lattice spacing in x,y,z = 1.4142135 2.0000000 2.0000000 + +region mycell block 0.0 5.0 0.0 5.0 0.0 5.0 units lattice +create_box 1 mycell +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (7.0710677 9.9999999 9.9999999) + 1 by 2 by 2 MPI processor grid +mass * 1.0 +create_atoms 1 box +Created 1000 atoms + create_atoms CPU = 0.105 seconds + +# Using units of Rmin, so sigma = 2^-1/6 = 0.8908987 + +pair_style lj/cubic +pair_coeff * * 1.0 0.8908987 + +# Relax box dimensions + +fix 3 all box/relax aniso 0.0 vmax 1.0e-4 nreset 100 + +thermo 100 +thermo_style custom step temp pe etotal pxx pyy pzz lx ly lz + +min_modify line quadratic +minimize 0.0 1.0e-6 10000 100000 +WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (src/min.cpp:188) +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.8475372 + ghost atom cutoff = 1.8475372 + binsize = 0.92376862, bins = 8 11 11 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cubic, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 4.211 | 4.211 | 4.211 Mbytes +Step Temp PotEng TotEng Pxx Pyy Pzz Lx Ly Lz + 0 0 -6.2937536 -6.2937536 -2.7722424 -2.7722424 -2.7722424 7.0710677 9.9999999 9.9999999 + 100 0 -6.3319014 -6.3319014 -0.75971257 -0.75971257 -0.75971257 7.0003571 9.8999999 9.8999999 + 134 0 -6.3344253 -6.3344253 -4.303004e-13 -4.72443e-13 -4.7038971e-13 6.9780267 9.8684199 9.8684199 +Loop time of 0.38554 on 4 procs for 134 steps with 1000 atoms + +75.8% CPU use with 4 MPI tasks x 1 OpenMP threads + +Minimization stats: + Stopping criterion = force tolerance + Energy initial, next-to-last, final = + -6.29375358358589 -6.33442531515435 -6.33442531515435 + Force two-norm initial, final = 3395.2895 5.5617370e-10 + Force max component initial, final = 1960.2713 3.2533415e-10 + Final line search alpha, max atom move = 1.0000000 3.2533415e-10 + Iterations, force evaluations = 134 137 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.031873 | 0.042436 | 0.055233 | 4.3 | 11.01 +Neigh | 0.0004189 | 0.00049466 | 0.00058317 | 0.0 | 0.13 +Comm | 0.085755 | 0.095315 | 0.10484 | 2.7 | 24.72 +Output | 2.8372e-05 | 3.0637e-05 | 3.6955e-05 | 0.0 | 0.01 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 0.2473 | | | 64.13 + +Nlocal: 250.000 ave 305 max 205 min +Histogram: 1 0 0 0 2 0 0 0 0 1 +Nghost: 829.000 ave 874 max 774 min +Histogram: 1 0 0 0 0 0 2 0 0 1 +Neighs: 5250.00 ave 6445 max 4305 min +Histogram: 1 0 0 2 0 0 0 0 0 1 + +Total # of neighbors = 21000 +Ave neighs/atom = 21.000000 +Neighbor list builds = 1 +Dangerous builds = 0 + +# Define initial velocity + +velocity all create 0.01 87287 mom yes rot yes dist gaussian +write_restart restart.equil +System init for write_restart ... + +# Start Run #1 + +clear + using 1 OpenMP thread(s) per MPI task +read_restart restart.equil +Reading restart file ... + restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 + restoring atom style atomic from restart + orthogonal box = (0.046520549 0.065789991 0.065789991) to (7.0245472 9.9342099 9.9342099) + 1 by 2 by 2 MPI processor grid + restoring pair style lj/cubic from restart + 1000 atoms + read_restart CPU = 0.006 seconds + +neighbor 0.2 bin +neigh_modify every 1 delay 0 check yes +timestep 0.001 +reset_timestep 0 + +# Pzz = 40.0, drag/damping term off + +fix myhug all nphug temp 1.0 1.0 10.0 z 40.0 40.0 70.0 drag 0.0 tchain 1 pchain 0 + +# Specify reference state from paper, times 1000 atoms + +fix_modify myhug e0 -6334.0 p0 0.0 v0 680.73519 + +# Define output + +variable dele equal f_myhug[1] # energy delta [temperature] +variable us equal f_myhug[2] # shock velocity [distance/time] +variable up equal f_myhug[3] # particle velocity [distance/time] +variable pzz equal pzz # axial stress +variable tau equal 0.5*(pzz-0.5*(pxx+pyy)) # shear stress +variable time equal dt*step + +thermo 1000 +thermo_style custom step temp ke epair econserve pzz v_tau lz f_myhug v_dele v_us v_up + +fix stress all print 10 "${time} ${pzz} ${tau} " screen no append stress_vs_t.dat title '#time pzz tau (no drag)' + +#dump id all atom 500 dump.hugoniostat + +#dump 2 all image 500 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 +#dump_modify 2 pad 5 + +#dump 3 all movie 500 movie.mpg type type # axes yes 0.8 0.02 view 60 -30 +#dump_modify 3 pad 5 + +run 10000 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.7475372 + ghost atom cutoff = 1.7475372 + binsize = 0.87376862, bins = 8 12 12 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cubic, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.086 | 3.086 | 3.086 Mbytes +Step Temp KinEng E_pair Econserve Pzz v_tau Lz f_myhug v_dele v_us v_up + 0 0.01 0.014985 -6.3344253 -6.3194403 0.014347835 -0.00026463907 9.8684199 0 -0.0048552735 2.378672 0.0041061045 + 1000 0.010586669 0.015864123 -2.1721826 -4183.9265 129.03333 58.456619 8.3141284 -4.1817701 0.93542364 23.507245 3.7366151 + 2000 0.33213628 0.49770621 -5.5847928 -972.65689 12.097176 1.2026574 9.4616027 -0.9675698 -0.35714344 13.85823 0.59422982 + 3000 0.46981589 0.70401911 -3.9208694 -3177.4622 63.005615 22.559014 8.6828715 -3.1742453 -0.16959033 18.776506 2.284245 + 4000 0.5486246 0.82211396 -4.170224 -2897.9717 38.4091 4.9062274 8.6573154 -2.8946236 -0.45434723 14.506949 1.8023381 + 5000 0.30607733 0.45865688 -4.73528 -1914.3534 35.002193 6.2096608 8.6658138 -1.9100768 -0.19602135 13.896788 1.714585 + 6000 0.13928238 0.20871465 -4.3038564 -1672.0118 50.372856 12.190245 8.3966652 -1.6679166 0.11455965 15.089171 2.2725288 + 7000 0.055325106 0.082904671 -5.2030895 -1689.3101 30.859753 6.5561993 8.6850199 -1.6841899 0.020593532 13.15254 1.5972063 + 8000 0.02793065 0.041854078 -4.5281755 -966.55101 48.144696 12.229149 8.4107035 -0.96206469 0.19920754 14.821718 2.2112004 + 9000 0.018182543 0.02724654 -4.9847463 -1618.778 37.347471 8.7290944 8.5607031 -1.6138205 0.10912671 13.773572 1.8458347 + 10000 0.0082850143 0.012415094 -5.0129769 -1686.404 36.462176 8.3390717 8.5689886 -1.6814034 0.10655037 13.652105 1.8181142 +Loop time of 22.212 on 4 procs for 10000 steps with 1000 atoms + +Performance: 38897.956 tau/day, 450.208 timesteps/s +76.8% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 3.4702 | 3.5904 | 3.684 | 4.4 | 16.16 +Neigh | 0.1001 | 0.10727 | 0.11784 | 2.0 | 0.48 +Comm | 5.1418 | 5.2862 | 5.3573 | 3.7 | 23.80 +Output | 0.083086 | 0.095493 | 0.11021 | 4.0 | 0.43 +Modify | 11.789 | 11.841 | 11.967 | 2.1 | 53.31 +Other | | 1.292 | | | 5.82 + +Nlocal: 250.000 ave 260 max 240 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Nghost: 927.500 ave 934 max 921 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Neighs: 5049.00 ave 5203 max 4889 min +Histogram: 1 1 0 0 0 0 0 0 0 2 + +Total # of neighbors = 20196 +Ave neighs/atom = 20.196000 +Neighbor list builds = 175 +Dangerous builds = 0 + +# Start Run #2 + +clear + using 1 OpenMP thread(s) per MPI task +read_restart restart.equil +Reading restart file ... + restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 + restoring atom style atomic from restart + orthogonal box = (0.046520549 0.065789991 0.065789991) to (7.0245472 9.9342099 9.9342099) + 1 by 2 by 2 MPI processor grid + restoring pair style lj/cubic from restart + 1000 atoms + read_restart CPU = 0.001 seconds + +neighbor 0.2 bin +neigh_modify every 1 delay 0 check yes +timestep 0.001 +reset_timestep 0 + +# Pzz = 40.0, drag/damping term on + +fix myhug all nphug temp 1.0 1.0 1.0 z 40.0 40.0 70.0 drag 200.0 tchain 1 pchain 0 + +# Specify reference state from paper, times 1000 atoms + +fix_modify myhug e0 -6334.0 p0 0.0 v0 680.73519 + +# Define output + +variable dele equal f_myhug[1] # energy delta [temperature] +variable us equal f_myhug[2] # shock velocity [distance/time] +variable up equal f_myhug[3] # particle velocity [distance/time] +variable pzz equal pzz # axial stress +variable tau equal 0.5*(pzz-0.5*(pxx+pyy)) # shear stress +variable time equal dt*step + +thermo 1000 +thermo_style custom step temp ke epair econserve pzz v_tau lz f_myhug v_dele v_us v_up + +fix stress all print 10 "${time} ${pzz} ${tau} " screen no append stress_vs_t.dat title '#time pzz tau (with drag)' + +run 10000 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.7475372 + ghost atom cutoff = 1.7475372 + binsize = 0.87376862, bins = 8 12 12 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cubic, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.086 | 3.086 | 3.086 Mbytes +Step Temp KinEng E_pair Econserve Pzz v_tau Lz f_myhug v_dele v_us v_up + 0 0.01 0.014985 -6.3344253 -6.3194403 0.014347835 -0.00026463907 9.8684199 0 -0.0048552735 2.378672 0.0041061045 + 1000 0.0063089135 0.0094539069 -5.9892322 -1671.0142 18.914957 7.5823225 9.2337797 -1.6650344 0.02342632 13.975435 0.92133641 + 2000 0.006881368 0.01031173 -5.4566762 -2537.9852 37.064191 15.537213 8.9495783 -2.5325389 0.1023455 16.32485 1.5455517 + 3000 0.0072427308 0.010853232 -5.3662814 -2644.0227 39.906002 16.80569 8.9154322 -2.6386673 0.1182133 16.638326 1.6327015 + 4000 0.0070936511 0.010629836 -5.362616 -2655.9513 40.007995 16.850321 8.9143648 -2.6505993 0.11869211 16.650416 1.6356858 + 5000 0.0074091959 0.01110268 -5.3628939 -2664.5927 39.998199 16.845204 8.9144816 -2.6592409 0.11846407 16.649379 1.6353872 + 6000 0.0077388568 0.011596677 -5.362926 -2673.502 39.995216 16.842807 8.9145056 -2.6681507 0.11826568 16.648964 1.635306 + 7000 0.0076023299 0.011392091 -5.3621079 -2682.3942 39.998343 16.839762 8.9144789 -2.6770435 0.1181081 16.649386 1.6353924 + 8000 0.0076916892 0.011525996 -5.3617056 -2691.2334 40.000701 16.839078 8.9144843 -2.6858832 0.11795298 16.649924 1.635436 + 9000 0.0082153298 0.012310672 -5.3620895 -2700.1796 40.006134 16.845865 8.914544 -2.6948298 0.11785245 16.651566 1.6354968 + 10000 0.0088368733 0.013242055 -5.3625353 -2709.138 39.989575 16.835079 8.914577 -2.7037887 0.11749055 16.648403 1.6351305 +Loop time of 19.325 on 4 procs for 10000 steps with 1000 atoms + +Performance: 44708.822 tau/day, 517.463 timesteps/s +77.5% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 3.3012 | 3.4003 | 3.584 | 5.9 | 17.60 +Neigh | 0.0047636 | 0.0054044 | 0.0072584 | 1.5 | 0.03 +Comm | 4.5282 | 4.5961 | 4.651 | 2.1 | 23.78 +Output | 0.00071692 | 0.0062424 | 0.0086811 | 4.1 | 0.03 +Modify | 10.133 | 10.215 | 10.287 | 1.7 | 52.86 +Other | | 1.102 | | | 5.70 + +Nlocal: 250.000 ave 258 max 239 min +Histogram: 1 0 0 0 1 0 0 0 1 1 +Nghost: 829.000 ave 840 max 821 min +Histogram: 1 1 0 0 0 1 0 0 0 1 +Neighs: 5250.00 ave 5360 max 5090 min +Histogram: 1 0 0 0 1 0 0 0 0 2 + +Total # of neighbors = 21000 +Ave neighs/atom = 21.000000 +Neighbor list builds = 10 +Dangerous builds = 0 + +# Start Run #3 + +clear + using 1 OpenMP thread(s) per MPI task +read_restart restart.equil +Reading restart file ... + restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 + restoring atom style atomic from restart + orthogonal box = (0.046520549 0.065789991 0.065789991) to (7.0245472 9.9342099 9.9342099) + 1 by 2 by 2 MPI processor grid + restoring pair style lj/cubic from restart + 1000 atoms + read_restart CPU = 0.001 seconds + +neighbor 0.2 bin +neigh_modify every 1 delay 0 check yes +timestep 0.001 +reset_timestep 0 + +# Pzz = 40.0, drag/damping term off, Nose-Hoover chains + +fix myhug all nphug temp 1.0 1.0 1.0 z 40.0 40.0 70.0 + +# Specify reference state from paper, times 1000 atoms + +fix_modify myhug e0 -6334.0 p0 0.0 v0 680.73519 + +# Define output + +variable dele equal f_myhug[1] # energy delta [temperature] +variable us equal f_myhug[2] # shock velocity [distance/time] +variable up equal f_myhug[3] # particle velocity [distance/time] +variable pzz equal pzz # axial stress +variable tau equal 0.5*(pzz-0.5*(pxx+pyy)) # shear stress +variable time equal dt*step + +thermo 1000 +thermo_style custom step temp ke epair econserve pzz v_tau lz f_myhug v_dele v_us v_up + +fix stress all print 10 "${time} ${pzz} ${tau} " screen no append stress_vs_t.dat title '#time pzz tau (Nose-Hoover chain)' + +run 10000 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.7475372 + ghost atom cutoff = 1.7475372 + binsize = 0.87376862, bins = 8 12 12 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cubic, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.086 | 3.086 | 3.086 Mbytes +Step Temp KinEng E_pair Econserve Pzz v_tau Lz f_myhug v_dele v_us v_up + 0 0.01 0.014985 -6.3344253 -6.3194403 0.014347835 -0.00026463907 9.8684199 0 -0.0048552735 2.378672 0.0041061045 + 1000 0.0078345757 0.011740112 -5.5017136 -838.78091 35.616593 14.888102 8.9677603 -0.83329094 0.093891841 16.160627 1.5002802 + 2000 0.019260442 0.028861773 -5.2936038 -1018.9574 41.771461 17.563025 8.8958988 -1.0136927 0.11811776 16.853931 1.6871615 + 3000 0.04811126 0.072094723 -5.3454068 -976.69826 39.061528 16.137201 8.9322605 -0.97142494 0.073850795 16.606008 1.6012612 + 4000 0.11854637 0.17764173 -5.2071392 -1296.5766 40.843143 16.426195 8.9202981 -1.2915471 0.017621672 16.874934 1.6476132 + 5000 0.13634185 0.20430827 -5.2645154 -1258.4101 39.098283 15.627986 8.9407719 -1.2533499 -0.00067591716 16.688492 1.5948462 + 6000 0.14222512 0.21312434 -5.1774698 -1369.5986 40.888661 16.260803 8.9214848 -1.3646342 -0.0041700902 16.894723 1.6475174 + 7000 0.12683772 0.19006633 -5.2679854 -1210.973 39.084165 15.633846 8.9393379 -1.2058951 0.00572464 16.672829 1.595768 + 8000 0.14531337 0.21775209 -5.1737911 -1372.667 40.861256 16.19118 8.9199953 -1.367711 -0.0065459838 16.876028 1.648237 + 9000 0.12123505 0.18167072 -5.2546764 -1189.0875 39.276006 15.677923 8.9363537 -1.1840145 0.0075170176 16.687402 1.6022003 + 10000 0.1477113 0.22134539 -5.1833959 -1353.4057 40.578404 16.080238 8.9245614 -1.3484436 -0.0098061873 16.857426 1.6386338 +Loop time of 18.9651 on 4 procs for 10000 steps with 1000 atoms + +Performance: 45557.373 tau/day, 527.284 timesteps/s +77.1% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 3.1152 | 3.3473 | 3.5591 | 10.0 | 17.65 +Neigh | 0.045731 | 0.056706 | 0.066921 | 3.7 | 0.30 +Comm | 3.9563 | 4.1638 | 4.4413 | 9.7 | 21.96 +Output | 0.00067329 | 0.0033167 | 0.011241 | 7.9 | 0.02 +Modify | 10.321 | 10.425 | 10.482 | 2.0 | 54.97 +Other | | 0.9693 | | | 5.11 + +Nlocal: 250.000 ave 257 max 244 min +Histogram: 1 0 0 1 1 0 0 0 0 1 +Nghost: 832.250 ave 840 max 822 min +Histogram: 1 0 0 0 0 0 2 0 0 1 +Neighs: 5144.25 ave 5282 max 4949 min +Histogram: 1 0 0 0 0 1 0 1 0 1 + +Total # of neighbors = 20577 +Ave neighs/atom = 20.577000 +Neighbor list builds = 95 +Dangerous builds = 0 + +Total wall time: 0:01:01 diff --git a/examples/hugoniostat/log.27Nov18.hugoniostat.g++.1 b/examples/hugoniostat/log.27Nov18.hugoniostat.g++.1 deleted file mode 100644 index c1381629eb..0000000000 --- a/examples/hugoniostat/log.27Nov18.hugoniostat.g++.1 +++ /dev/null @@ -1,401 +0,0 @@ -LAMMPS (27 Nov 2018) - using 1 OpenMP thread(s) per MPI task -# This script reproduces stress trajectories from Fig. 1 in -# Ravelo, Holian, Germann, and Lomdahl, PRB 70 014103 (2004) -# -# Three thermostatting scenarios are visited: undamped (nodrag), -# damped (drag) and Nose-Hoover chain (nhchains). -# -# The axial and shear stress trajectories are printed to the -# file "stress_vs_t.dat". For the damped case, the original figure -# seems to be a plot of 2*tau, rather than tau. -# -# The script also demonstrates how to -# orient a crystal along <110>, -# and how to use the lj/cubic pair style. - -units lj -boundary p p p - -atom_style atomic - -# Set up FCC lattice with z axis along <110> - -lattice fcc 1.4142136 orient x 0 0 1 orient y 1 -1 0 orient z 1 1 0 -Lattice spacing in x,y,z = 1.41421 2 2 - -region mycell block 0.0 5.0 0.0 5.0 0.0 5.0 units lattice -create_box 1 mycell -Created orthogonal box = (0 0 0) to (7.07107 10 10) - 1 by 1 by 1 MPI processor grid -mass * 1.0 -create_atoms 1 box -Created 1000 atoms - Time spent = 0.000465155 secs - -# Using units of Rmin, so sigma = 2^-1/6 = 0.8908987 - -pair_style lj/cubic -pair_coeff * * 1.0 0.8908987 - -# Relax box dimensions - -fix 3 all box/relax aniso 0.0 vmax 1.0e-4 nreset 100 - -thermo 100 -thermo_style custom step temp pe etotal pxx pyy pzz lx ly lz - -min_modify line quadratic -minimize 0.0 1.0e-6 10000 100000 -WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (src/min.cpp:168) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.84754 - ghost atom cutoff = 1.84754 - binsize = 0.923769, bins = 8 11 11 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cubic, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 4.247 | 4.247 | 4.247 Mbytes -Step Temp PotEng TotEng Pxx Pyy Pzz Lx Ly Lz - 0 0 -6.2937539 -6.2937539 -2.7722431 -2.7722431 -2.7722431 7.0710677 9.9999999 9.9999999 - 100 0 -6.3319018 -6.3319018 -0.75971321 -0.75971321 -0.75971321 7.0003571 9.8999999 9.8999999 - 134 0 -6.3344257 -6.3344257 -4.5005818e-13 -4.9677973e-13 -4.9219424e-13 6.9780266 9.8684199 9.8684199 -Loop time of 0.0724094 on 1 procs for 134 steps with 1000 atoms - -99.9% CPU use with 1 MPI tasks x 1 OpenMP threads - -Minimization stats: - Stopping criterion = force tolerance - Energy initial, next-to-last, final = - -6.2937539309 -6.33442568056 -6.33442568056 - Force two-norm initial, final = 3395.29 5.83329e-10 - Force max component initial, final = 1960.27 3.42093e-10 - Final line search alpha, max atom move = 1 3.42093e-10 - Iterations, force evaluations = 134 137 - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.054599 | 0.054599 | 0.054599 | 0.0 | 75.40 -Neigh | 0.0011106 | 0.0011106 | 0.0011106 | 0.0 | 1.53 -Comm | 0.002012 | 0.002012 | 0.002012 | 0.0 | 2.78 -Output | 1.955e-05 | 1.955e-05 | 1.955e-05 | 0.0 | 0.03 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 0.01467 | | | 20.26 - -Nlocal: 1000 ave 1000 max 1000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1724 ave 1724 max 1724 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 21000 ave 21000 max 21000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 21000 -Ave neighs/atom = 21 -Neighbor list builds = 1 -Dangerous builds = 0 - -# Define initial velocity - -velocity all create 0.01 87287 mom yes rot yes dist gaussian -write_restart restart.equil - -# Start Run #1 - -clear - using 1 OpenMP thread(s) per MPI task -read_restart restart.equil - restoring atom style atomic from restart - orthogonal box = (0.0465206 0.06579 0.06579) to (7.02455 9.93421 9.93421) - 1 by 1 by 1 MPI processor grid - restoring pair style lj/cubic from restart - 1000 atoms - -neighbor 0.2 bin -neigh_modify every 1 delay 0 check yes -timestep 0.001 -reset_timestep 0 - -# Pzz = 40.0, drag/damping term off - -fix myhug all nphug temp 1.0 1.0 10.0 z 40.0 40.0 70.0 drag 0.0 tchain 1 pchain 0 - -# Specify reference state from paper, times 1000 atoms - -fix_modify myhug e0 -6334.0 p0 0.0 v0 680.73519 - -# Add fix energy to output etotal - -fix_modify myhug energy yes - -# Define output - -variable dele equal f_myhug[1] # energy delta [temperature] -variable us equal f_myhug[2] # shock velocity [distance/time] -variable up equal f_myhug[3] # particle velocity [distance/time] -variable pzz equal pzz # axial stress -variable tau equal 0.5*(pzz-0.5*(pxx+pyy)) # shear stress -variable time equal dt*step - -thermo 1000 -thermo_style custom step temp ke epair etotal pzz v_tau lz f_myhug v_dele v_us v_up - -fix stress all print 10 "${time} ${pzz} ${tau} " screen no append stress_vs_t.dat title '#time pzz tau (no drag)' - -#dump id all atom 500 dump.hugoniostat - -#dump 2 all image 500 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 -#dump_modify 2 pad 5 - -#dump 3 all movie 500 movie.mpg type type # axes yes 0.8 0.02 view 60 -30 -#dump_modify 3 pad 5 - -run 10000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.74754 - ghost atom cutoff = 1.74754 - binsize = 0.873769, bins = 8 12 12 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cubic, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.771 | 2.771 | 2.771 Mbytes -Step Temp KinEng E_pair TotEng Pzz v_tau Lz f_myhug v_dele v_us v_up - 0 0.01 0.014985 -6.3344257 -6.3194407 0.014381062 -0.0002397183 9.8684199 0 -0.0048551451 2.3814196 0.0041108654 - 1000 0.0093381489 0.013993216 -2.170443 -6.3381216 129.15286 58.544417 8.3142516 -4.1816719 0.93744258 23.519053 3.7381989 - 2000 0.24794909 0.37155171 -5.8915802 -6.0429087 8.3850692 1.3744507 9.5938765 -0.5228803 -0.2435043 13.910468 0.4103393 - 3000 0.38920701 0.5832267 -3.768677 -6.6246124 72.742761 28.486747 8.623805 -3.439162 0.003825459 19.697379 2.5139668 - 4000 0.67009971 1.0041444 -4.2080644 -6.1365367 35.596179 3.9344133 8.7508422 -2.9326167 -0.58039603 14.529822 1.6677129 - 5000 0.41848975 0.62710689 -4.8393088 -6.1026724 30.626544 4.6387208 8.7827245 -1.8904705 -0.31996439 13.670884 1.5250343 - 6000 0.22410139 0.33581594 -3.7652941 -6.0923259 50.807437 7.2229456 8.2549488 -2.6628477 -0.017396966 14.4806 2.3884652 - 7000 0.095001485 0.14235972 -4.5436753 -6.7307217 35.8743 3.4938089 8.4476287 -2.3294061 -0.052272192 12.957528 1.8846881 - 8000 0.043277437 0.064851239 -4.6264096 -6.2447456 39.658659 6.7266325 8.4327483 -1.6831873 0.070488482 13.553882 1.9918311 - 9000 0.018271956 0.027380526 -4.4239627 -6.3085661 41.708324 5.9081923 8.3463321 -1.9119839 0.091057512 13.503882 2.1025305 - 10000 0.0082840001 0.012413574 -4.622252 -6.3316699 39.830379 6.5596321 8.4109569 -1.7218314 0.099435465 13.482451 2.0110543 -Loop time of 6.20702 on 1 procs for 10000 steps with 1000 atoms - -Performance: 139197.321 tau/day, 1611.080 timesteps/s -98.8% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 5.0198 | 5.0198 | 5.0198 | 0.0 | 80.87 -Neigh | 0.21405 | 0.21405 | 0.21405 | 0.0 | 3.45 -Comm | 0.16164 | 0.16164 | 0.16164 | 0.0 | 2.60 -Output | 0.00053501 | 0.00053501 | 0.00053501 | 0.0 | 0.01 -Modify | 0.7419 | 0.7419 | 0.7419 | 0.0 | 11.95 -Other | | 0.06911 | | | 1.11 - -Nlocal: 1000 ave 1000 max 1000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1886 ave 1886 max 1886 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 20874 ave 20874 max 20874 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 20874 -Ave neighs/atom = 20.874 -Neighbor list builds = 188 -Dangerous builds = 0 - -# Start Run #2 - -clear - using 1 OpenMP thread(s) per MPI task -read_restart restart.equil - restoring atom style atomic from restart - orthogonal box = (0.0465206 0.06579 0.06579) to (7.02455 9.93421 9.93421) - 1 by 1 by 1 MPI processor grid - restoring pair style lj/cubic from restart - 1000 atoms - -neighbor 0.2 bin -neigh_modify every 1 delay 0 check yes -timestep 0.001 -reset_timestep 0 - -# Pzz = 40.0, drag/damping term on - -fix myhug all nphug temp 1.0 1.0 1.0 z 40.0 40.0 70.0 drag 200.0 tchain 1 pchain 0 - -# Specify reference state from paper, times 1000 atoms - -fix_modify myhug e0 -6334.0 p0 0.0 v0 680.73519 - -# Add fix energy to output etotal - -fix_modify myhug energy yes - -# Define output - -variable dele equal f_myhug[1] # energy delta [temperature] -variable us equal f_myhug[2] # shock velocity [distance/time] -variable up equal f_myhug[3] # particle velocity [distance/time] -variable pzz equal pzz # axial stress -variable tau equal 0.5*(pzz-0.5*(pxx+pyy)) # shear stress -variable time equal dt*step - -thermo 1000 -thermo_style custom step temp ke epair etotal pzz v_tau lz f_myhug v_dele v_us v_up - -fix stress all print 10 "${time} ${pzz} ${tau} " screen no append stress_vs_t.dat title '#time pzz tau (with drag)' - -run 10000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.74754 - ghost atom cutoff = 1.74754 - binsize = 0.873769, bins = 8 12 12 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cubic, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.771 | 2.771 | 2.771 Mbytes -Step Temp KinEng E_pair TotEng Pzz v_tau Lz f_myhug v_dele v_us v_up - 0 0.01 0.014985 -6.3344257 -6.3194407 0.014381062 -0.0002397183 9.8684199 0 -0.0048551451 2.3814196 0.0041108654 - 1000 0.0062572991 0.0093765627 -5.9890874 -7.64465 18.918117 7.5844397 9.2338165 -1.6649392 0.02341947 13.976996 0.92138738 - 2000 0.006845108 0.010257394 -5.4565813 -7.9786876 37.064254 15.537266 8.9496404 -2.5323637 0.1023062 16.325405 1.5455017 - 3000 0.0073276109 0.010980425 -5.3663425 -7.9938818 39.907292 16.807488 8.9154852 -2.6385197 0.11818131 16.639049 1.6326833 - 4000 0.0069296915 0.010384143 -5.3623404 -8.0023271 40.010741 16.851482 8.9144328 -2.6503708 0.11868152 16.651571 1.6356847 - 5000 0.0076142476 0.01140995 -5.3631447 -8.0108329 39.997648 16.846756 8.9145416 -2.6590981 0.11841154 16.649778 1.6353255 - 6000 0.0077053839 0.011546518 -5.3628542 -8.0192007 39.991597 16.840313 8.9145803 -2.6678931 0.11818376 16.648851 1.6351691 - 7000 0.0077405662 0.011599239 -5.3623534 -8.0275624 40.000448 16.844008 8.9145774 -2.6768081 0.11809914 16.650669 1.6353525 - 8000 0.008067359 0.012088937 -5.3623759 -8.0359471 39.995327 16.840134 8.9146099 -2.6856601 0.11787118 16.649881 1.6352204 - 9000 0.0083223114 0.012470984 -5.3622992 -8.0443714 40.00571 16.847763 8.9146503 -2.6945431 0.11781538 16.652389 1.6353987 - 10000 0.0091249143 0.013673684 -5.3630142 -8.0529573 39.987196 16.837314 8.9146848 -2.7036168 0.11743028 16.648831 1.6349911 -Loop time of 5.48047 on 1 procs for 10000 steps with 1000 atoms - -Performance: 157650.687 tau/day, 1824.661 timesteps/s -98.8% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 4.5166 | 4.5166 | 4.5166 | 0.0 | 82.41 -Neigh | 0.012162 | 0.012162 | 0.012162 | 0.0 | 0.22 -Comm | 0.14168 | 0.14168 | 0.14168 | 0.0 | 2.59 -Output | 0.00053787 | 0.00053787 | 0.00053787 | 0.0 | 0.01 -Modify | 0.74394 | 0.74394 | 0.74394 | 0.0 | 13.57 -Other | | 0.06553 | | | 1.20 - -Nlocal: 1000 ave 1000 max 1000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1724 ave 1724 max 1724 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 21000 ave 21000 max 21000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 21000 -Ave neighs/atom = 21 -Neighbor list builds = 11 -Dangerous builds = 0 - -# Start Run #3 - -clear - using 1 OpenMP thread(s) per MPI task -read_restart restart.equil - restoring atom style atomic from restart - orthogonal box = (0.0465206 0.06579 0.06579) to (7.02455 9.93421 9.93421) - 1 by 1 by 1 MPI processor grid - restoring pair style lj/cubic from restart - 1000 atoms - -neighbor 0.2 bin -neigh_modify every 1 delay 0 check yes -timestep 0.001 -reset_timestep 0 - -# Pzz = 40.0, drag/damping term off, Nose-Hoover chains - -fix myhug all nphug temp 1.0 1.0 1.0 z 40.0 40.0 70.0 - -# Specify reference state from paper, times 1000 atoms - -fix_modify myhug e0 -6334.0 p0 0.0 v0 680.73519 - -# Add fix energy to output etotal - -fix_modify myhug energy yes - -# Define output - -variable dele equal f_myhug[1] # energy delta [temperature] -variable us equal f_myhug[2] # shock velocity [distance/time] -variable up equal f_myhug[3] # particle velocity [distance/time] -variable pzz equal pzz # axial stress -variable tau equal 0.5*(pzz-0.5*(pxx+pyy)) # shear stress -variable time equal dt*step - -thermo 1000 -thermo_style custom step temp ke epair etotal pzz v_tau lz f_myhug v_dele v_us v_up - -fix stress all print 10 "${time} ${pzz} ${tau} " screen no append stress_vs_t.dat title '#time pzz tau (Nose-Hoover chain)' - -run 10000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.74754 - ghost atom cutoff = 1.74754 - binsize = 0.873769, bins = 8 12 12 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cubic, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.771 | 2.771 | 2.771 Mbytes -Step Temp KinEng E_pair TotEng Pzz v_tau Lz f_myhug v_dele v_us v_up - 0 0.01 0.014985 -6.3344257 -6.3194407 0.014381062 -0.0002397183 9.8684199 0 -0.0048551451 2.3814196 0.0041108654 - 1000 0.0083300394 0.012482564 -5.5023188 -6.3233387 35.610076 14.886667 8.9677982 -0.83350251 0.093761848 16.159481 1.500112 - 2000 0.020386462 0.030549113 -5.2949349 -6.2805556 41.760388 17.563305 8.896033 -1.0161699 0.11780863 16.85284 1.6868235 - 3000 0.049693152 0.074465188 -5.3469434 -6.2493961 39.030372 16.123483 8.9325594 -0.9769179 0.073097387 16.601986 1.6003716 - 4000 0.11859514 0.17771482 -5.207077 -6.3242752 40.941558 16.507785 8.9213147 -1.2949131 0.018189678 16.904156 1.6487282 - 5000 0.13014573 0.19502337 -5.2610248 -6.269279 39.059628 15.609345 8.9431685 -1.2032776 -0.00023747376 16.701437 1.5920344 - 6000 0.1381307 0.20698886 -5.171005 -6.2931942 40.904837 16.242165 8.9222854 -1.3291781 -0.0044770368 16.905086 1.6471589 - 7000 0.12107326 0.18142828 -5.2602554 -6.2438099 39.060928 15.57765 8.9397525 -1.1649827 0.0055890257 16.671524 1.594944 - 8000 0.14333636 0.21478954 -5.1717123 -6.304602 40.876188 16.205815 8.9218142 -1.3476793 -0.0069396327 16.895033 1.6469846 - 9000 0.12159663 0.18221255 -5.2591911 -6.2587685 39.228648 15.677869 8.9376641 -1.18179 0.0077357066 16.688862 1.6001283 - 10000 0.15321883 0.22959841 -5.1881787 -6.3448453 40.666451 16.146177 8.922851 -1.386265 -0.0091929687 16.860705 1.6418699 -Loop time of 5.6426 on 1 procs for 10000 steps with 1000 atoms - -Performance: 153120.907 tau/day, 1772.233 timesteps/s -98.7% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 4.5653 | 4.5653 | 4.5653 | 0.0 | 80.91 -Neigh | 0.10885 | 0.10885 | 0.10885 | 0.0 | 1.93 -Comm | 0.14695 | 0.14695 | 0.14695 | 0.0 | 2.60 -Output | 0.00055218 | 0.00055218 | 0.00055218 | 0.0 | 0.01 -Modify | 0.75364 | 0.75364 | 0.75364 | 0.0 | 13.36 -Other | | 0.0673 | | | 1.19 - -Nlocal: 1000 ave 1000 max 1000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1724 ave 1724 max 1724 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 20654 ave 20654 max 20654 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 20654 -Ave neighs/atom = 20.654 -Neighbor list builds = 94 -Dangerous builds = 0 - -Total wall time: 0:00:17 diff --git a/examples/hugoniostat/log.27Nov18.hugoniostat.g++.4 b/examples/hugoniostat/log.27Nov18.hugoniostat.g++.4 deleted file mode 100644 index dd0766e81a..0000000000 --- a/examples/hugoniostat/log.27Nov18.hugoniostat.g++.4 +++ /dev/null @@ -1,401 +0,0 @@ -LAMMPS (27 Nov 2018) - using 1 OpenMP thread(s) per MPI task -# This script reproduces stress trajectories from Fig. 1 in -# Ravelo, Holian, Germann, and Lomdahl, PRB 70 014103 (2004) -# -# Three thermostatting scenarios are visited: undamped (nodrag), -# damped (drag) and Nose-Hoover chain (nhchains). -# -# The axial and shear stress trajectories are printed to the -# file "stress_vs_t.dat". For the damped case, the original figure -# seems to be a plot of 2*tau, rather than tau. -# -# The script also demonstrates how to -# orient a crystal along <110>, -# and how to use the lj/cubic pair style. - -units lj -boundary p p p - -atom_style atomic - -# Set up FCC lattice with z axis along <110> - -lattice fcc 1.4142136 orient x 0 0 1 orient y 1 -1 0 orient z 1 1 0 -Lattice spacing in x,y,z = 1.41421 2 2 - -region mycell block 0.0 5.0 0.0 5.0 0.0 5.0 units lattice -create_box 1 mycell -Created orthogonal box = (0 0 0) to (7.07107 10 10) - 1 by 2 by 2 MPI processor grid -mass * 1.0 -create_atoms 1 box -Created 1000 atoms - Time spent = 0.0003438 secs - -# Using units of Rmin, so sigma = 2^-1/6 = 0.8908987 - -pair_style lj/cubic -pair_coeff * * 1.0 0.8908987 - -# Relax box dimensions - -fix 3 all box/relax aniso 0.0 vmax 1.0e-4 nreset 100 - -thermo 100 -thermo_style custom step temp pe etotal pxx pyy pzz lx ly lz - -min_modify line quadratic -minimize 0.0 1.0e-6 10000 100000 -WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (src/min.cpp:168) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.84754 - ghost atom cutoff = 1.84754 - binsize = 0.923769, bins = 8 11 11 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cubic, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 4.211 | 4.211 | 4.211 Mbytes -Step Temp PotEng TotEng Pxx Pyy Pzz Lx Ly Lz - 0 0 -6.2937539 -6.2937539 -2.7722431 -2.7722431 -2.7722431 7.0710677 9.9999999 9.9999999 - 100 0 -6.3319018 -6.3319018 -0.75971321 -0.75971321 -0.75971321 7.0003571 9.8999999 9.8999999 - 134 0 -6.3344257 -6.3344257 -4.5046204e-13 -4.92206e-13 -4.9610344e-13 6.9780266 9.8684199 9.8684199 -Loop time of 0.0269771 on 4 procs for 134 steps with 1000 atoms - -94.3% CPU use with 4 MPI tasks x 1 OpenMP threads - -Minimization stats: - Stopping criterion = force tolerance - Energy initial, next-to-last, final = - -6.2937539309 -6.33442568056 -6.33442568056 - Force two-norm initial, final = 3395.29 5.80609e-10 - Force max component initial, final = 1960.27 3.41627e-10 - Final line search alpha, max atom move = 1 3.41627e-10 - Iterations, force evaluations = 134 137 - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.011534 | 0.013897 | 0.016008 | 1.3 | 51.51 -Neigh | 0.00024176 | 0.00029498 | 0.00035191 | 0.0 | 1.09 -Comm | 0.0029764 | 0.0050126 | 0.0073018 | 2.2 | 18.58 -Output | 1.8835e-05 | 1.9968e-05 | 2.2888e-05 | 0.0 | 0.07 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 0.007753 | | | 28.74 - -Nlocal: 250 ave 305 max 205 min -Histogram: 1 0 0 0 2 0 0 0 0 1 -Nghost: 829 ave 874 max 774 min -Histogram: 1 0 0 0 0 0 2 0 0 1 -Neighs: 5250 ave 6445 max 4305 min -Histogram: 1 0 0 2 0 0 0 0 0 1 - -Total # of neighbors = 21000 -Ave neighs/atom = 21 -Neighbor list builds = 1 -Dangerous builds = 0 - -# Define initial velocity - -velocity all create 0.01 87287 mom yes rot yes dist gaussian -write_restart restart.equil - -# Start Run #1 - -clear - using 1 OpenMP thread(s) per MPI task -read_restart restart.equil - restoring atom style atomic from restart - orthogonal box = (0.0465206 0.06579 0.06579) to (7.02455 9.93421 9.93421) - 1 by 2 by 2 MPI processor grid - restoring pair style lj/cubic from restart - 1000 atoms - -neighbor 0.2 bin -neigh_modify every 1 delay 0 check yes -timestep 0.001 -reset_timestep 0 - -# Pzz = 40.0, drag/damping term off - -fix myhug all nphug temp 1.0 1.0 10.0 z 40.0 40.0 70.0 drag 0.0 tchain 1 pchain 0 - -# Specify reference state from paper, times 1000 atoms - -fix_modify myhug e0 -6334.0 p0 0.0 v0 680.73519 - -# Add fix energy to output etotal - -fix_modify myhug energy yes - -# Define output - -variable dele equal f_myhug[1] # energy delta [temperature] -variable us equal f_myhug[2] # shock velocity [distance/time] -variable up equal f_myhug[3] # particle velocity [distance/time] -variable pzz equal pzz # axial stress -variable tau equal 0.5*(pzz-0.5*(pxx+pyy)) # shear stress -variable time equal dt*step - -thermo 1000 -thermo_style custom step temp ke epair etotal pzz v_tau lz f_myhug v_dele v_us v_up - -fix stress all print 10 "${time} ${pzz} ${tau} " screen no append stress_vs_t.dat title '#time pzz tau (no drag)' - -#dump id all atom 500 dump.hugoniostat - -#dump 2 all image 500 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 -#dump_modify 2 pad 5 - -#dump 3 all movie 500 movie.mpg type type # axes yes 0.8 0.02 view 60 -30 -#dump_modify 3 pad 5 - -run 10000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.74754 - ghost atom cutoff = 1.74754 - binsize = 0.873769, bins = 8 12 12 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cubic, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.717 | 2.809 | 3.086 Mbytes -Step Temp KinEng E_pair TotEng Pzz v_tau Lz f_myhug v_dele v_us v_up - 0 0.01 0.014985 -6.3344257 -6.3194407 0.014347835 -0.00026463907 9.8684199 0 -0.0048551516 2.3786668 0.0041061135 - 1000 0.010586668 0.015864122 -2.1721826 -6.3380886 129.03334 58.456626 8.3141284 -4.1817701 0.93542408 23.507246 3.7366154 - 2000 0.3321368 0.49770699 -5.584787 -6.0546694 12.097343 1.2026972 9.4615963 -0.96758935 -0.3571439 13.858218 0.5942385 - 3000 0.46981685 0.70402055 -3.9208474 -6.3911005 63.005989 22.559106 8.6828663 -3.1742737 -0.16958917 18.776521 2.2842567 - 4000 0.54866493 0.82217439 -4.1703408 -6.2427645 38.408608 4.9066022 8.6573289 -2.894598 -0.45434132 14.506935 1.8023166 - 5000 0.30625495 0.45892304 -4.7355785 -6.186448 35.000599 6.2097986 8.6658098 -1.9097925 -0.19603125 13.896448 1.7145489 - 6000 0.13938196 0.20886386 -4.303964 -5.7629121 50.370681 12.189231 8.3966581 -1.6678119 0.11451271 15.088809 2.2724852 - 7000 0.055349516 0.082941249 -5.2031342 -6.8043199 30.859256 6.5562297 8.6850282 -1.684127 0.020586458 13.152479 1.5971879 - 8000 0.027926794 0.0418483 -4.5281656 -5.4484008 48.145681 12.229919 8.4107051 -0.96208352 0.19922201 14.821877 2.2112219 - 9000 0.018195086 0.027265336 -4.9847444 -6.5712684 37.347655 8.7291385 8.5606968 -1.6137894 0.10912534 13.773573 1.8458438 - 10000 0.0082893467 0.012421586 -5.0130076 -6.6821423 36.46118 8.3386716 8.5689995 -1.6815563 0.1065388 13.651975 1.8180818 -Loop time of 2.01177 on 4 procs for 10000 steps with 1000 atoms - -Performance: 429472.539 tau/day, 4970.747 timesteps/s -98.1% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 1.2437 | 1.2651 | 1.2843 | 1.7 | 62.89 -Neigh | 0.051696 | 0.052503 | 0.053247 | 0.3 | 2.61 -Comm | 0.24826 | 0.26724 | 0.28867 | 3.5 | 13.28 -Output | 0.00058603 | 0.00085759 | 0.0016623 | 0.0 | 0.04 -Modify | 0.37363 | 0.37671 | 0.38189 | 0.5 | 18.73 -Other | | 0.04935 | | | 2.45 - -Nlocal: 250 ave 260 max 240 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Nghost: 927.5 ave 934 max 921 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Neighs: 5048.5 ave 5203 max 4889 min -Histogram: 1 1 0 0 0 0 0 0 1 1 - -Total # of neighbors = 20194 -Ave neighs/atom = 20.194 -Neighbor list builds = 175 -Dangerous builds = 0 - -# Start Run #2 - -clear - using 1 OpenMP thread(s) per MPI task -read_restart restart.equil - restoring atom style atomic from restart - orthogonal box = (0.0465206 0.06579 0.06579) to (7.02455 9.93421 9.93421) - 1 by 2 by 2 MPI processor grid - restoring pair style lj/cubic from restart - 1000 atoms - -neighbor 0.2 bin -neigh_modify every 1 delay 0 check yes -timestep 0.001 -reset_timestep 0 - -# Pzz = 40.0, drag/damping term on - -fix myhug all nphug temp 1.0 1.0 1.0 z 40.0 40.0 70.0 drag 200.0 tchain 1 pchain 0 - -# Specify reference state from paper, times 1000 atoms - -fix_modify myhug e0 -6334.0 p0 0.0 v0 680.73519 - -# Add fix energy to output etotal - -fix_modify myhug energy yes - -# Define output - -variable dele equal f_myhug[1] # energy delta [temperature] -variable us equal f_myhug[2] # shock velocity [distance/time] -variable up equal f_myhug[3] # particle velocity [distance/time] -variable pzz equal pzz # axial stress -variable tau equal 0.5*(pzz-0.5*(pxx+pyy)) # shear stress -variable time equal dt*step - -thermo 1000 -thermo_style custom step temp ke epair etotal pzz v_tau lz f_myhug v_dele v_us v_up - -fix stress all print 10 "${time} ${pzz} ${tau} " screen no append stress_vs_t.dat title '#time pzz tau (with drag)' - -run 10000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.74754 - ghost atom cutoff = 1.74754 - binsize = 0.873769, bins = 8 12 12 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cubic, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.717 | 2.809 | 3.086 Mbytes -Step Temp KinEng E_pair TotEng Pzz v_tau Lz f_myhug v_dele v_us v_up - 0 0.01 0.014985 -6.3344257 -6.3194407 0.014347835 -0.00026463907 9.8684199 0 -0.0048551516 2.3786668 0.0041061135 - 1000 0.0063089138 0.0094539073 -5.9892326 -7.6448129 18.914956 7.5823222 9.2337797 -1.6650342 0.023426454 13.975434 0.92133642 - 2000 0.0068813683 0.01031173 -5.4566765 -7.9789037 37.064192 15.537213 8.9495783 -2.5325388 0.10234565 16.32485 1.5455517 - 3000 0.0072427316 0.010853233 -5.3662818 -7.9940958 39.906002 16.80569 8.9154322 -2.6386672 0.11821344 16.638326 1.6327015 - 4000 0.0070936522 0.010629838 -5.3626164 -8.0025859 40.007994 16.850321 8.9143648 -2.6505993 0.11869226 16.650416 1.6356859 - 5000 0.0074091958 0.01110268 -5.3628943 -8.0110325 39.998199 16.845204 8.9144816 -2.6592409 0.11846422 16.649379 1.6353872 - 6000 0.0077388573 0.011596678 -5.3629264 -8.0194804 39.995216 16.842807 8.9145056 -2.6681507 0.11826582 16.648964 1.635306 - 7000 0.0076023298 0.011392091 -5.3621083 -8.0277598 39.998343 16.839762 8.9144789 -2.6770435 0.11810824 16.649386 1.6353924 - 8000 0.007691692 0.011526001 -5.361706 -8.0360632 40.000701 16.839078 8.9144843 -2.6858833 0.11795313 16.649923 1.6354361 - 9000 0.0082153298 0.012310672 -5.3620899 -8.0446091 40.006134 16.845865 8.914544 -2.6948299 0.11785259 16.651566 1.6354969 - 10000 0.0088368792 0.013242063 -5.3625357 -8.0530825 39.989575 16.835079 8.914577 -2.7037888 0.1174907 16.648402 1.6351306 -Loop time of 1.80214 on 4 procs for 10000 steps with 1000 atoms - -Performance: 479429.980 tau/day, 5548.958 timesteps/s -98.4% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 1.1353 | 1.1591 | 1.1787 | 1.5 | 64.32 -Neigh | 0.0028975 | 0.0029137 | 0.0029218 | 0.0 | 0.16 -Comm | 0.20882 | 0.22752 | 0.25213 | 3.4 | 12.62 -Output | 0.00058103 | 0.0007953 | 0.0014329 | 0.0 | 0.04 -Modify | 0.36598 | 0.36908 | 0.37078 | 0.3 | 20.48 -Other | | 0.04277 | | | 2.37 - -Nlocal: 250 ave 258 max 239 min -Histogram: 1 0 0 0 1 0 0 0 1 1 -Nghost: 829 ave 840 max 821 min -Histogram: 1 1 0 0 0 1 0 0 0 1 -Neighs: 5250 ave 5360 max 5090 min -Histogram: 1 0 0 0 1 0 0 0 0 2 - -Total # of neighbors = 21000 -Ave neighs/atom = 21 -Neighbor list builds = 10 -Dangerous builds = 0 - -# Start Run #3 - -clear - using 1 OpenMP thread(s) per MPI task -read_restart restart.equil - restoring atom style atomic from restart - orthogonal box = (0.0465206 0.06579 0.06579) to (7.02455 9.93421 9.93421) - 1 by 2 by 2 MPI processor grid - restoring pair style lj/cubic from restart - 1000 atoms - -neighbor 0.2 bin -neigh_modify every 1 delay 0 check yes -timestep 0.001 -reset_timestep 0 - -# Pzz = 40.0, drag/damping term off, Nose-Hoover chains - -fix myhug all nphug temp 1.0 1.0 1.0 z 40.0 40.0 70.0 - -# Specify reference state from paper, times 1000 atoms - -fix_modify myhug e0 -6334.0 p0 0.0 v0 680.73519 - -# Add fix energy to output etotal - -fix_modify myhug energy yes - -# Define output - -variable dele equal f_myhug[1] # energy delta [temperature] -variable us equal f_myhug[2] # shock velocity [distance/time] -variable up equal f_myhug[3] # particle velocity [distance/time] -variable pzz equal pzz # axial stress -variable tau equal 0.5*(pzz-0.5*(pxx+pyy)) # shear stress -variable time equal dt*step - -thermo 1000 -thermo_style custom step temp ke epair etotal pzz v_tau lz f_myhug v_dele v_us v_up - -fix stress all print 10 "${time} ${pzz} ${tau} " screen no append stress_vs_t.dat title '#time pzz tau (Nose-Hoover chain)' - -run 10000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.74754 - ghost atom cutoff = 1.74754 - binsize = 0.873769, bins = 8 12 12 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cubic, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.717 | 2.809 | 3.086 Mbytes -Step Temp KinEng E_pair TotEng Pzz v_tau Lz f_myhug v_dele v_us v_up - 0 0.01 0.014985 -6.3344257 -6.3194407 0.014347835 -0.00026463907 9.8684199 0 -0.0048551516 2.3786668 0.0041061135 - 1000 0.0078345827 0.011740122 -5.501714 -6.3232649 35.616592 14.888101 8.9677603 -0.833291 0.093891974 16.160626 1.5002802 - 2000 0.019260469 0.028861813 -5.2936047 -6.2784351 41.771445 17.563018 8.895899 -1.0136922 0.11811779 16.853929 1.687161 - 3000 0.048111305 0.072094791 -5.3454082 -6.2447367 39.061491 16.137184 8.932261 -0.97142325 0.073850675 16.606004 1.6012602 - 4000 0.11854629 0.17764161 -5.2071426 -6.3210422 40.843054 16.426156 8.9202992 -1.2915412 0.017621345 16.874925 1.6476105 - 5000 0.13634167 0.204308 -5.2645153 -6.3135608 39.098316 15.628006 8.9407716 -1.2533534 -0.00067532215 16.688495 1.5948471 - 6000 0.14222646 0.21312635 -5.1774703 -6.3289809 40.888616 16.260775 8.9214855 -1.3646369 -0.0041713956 16.89472 1.6475159 - 7000 0.12683662 0.19006468 -5.2679846 -6.2838171 39.084233 15.633883 8.939337 -1.2058972 0.0057260888 16.672835 1.5957701 - 8000 0.14531516 0.21775476 -5.1737923 -6.3237483 40.861161 16.191124 8.9199968 -1.3677107 -0.0065481979 16.876021 1.6482339 - 9000 0.12123357 0.18166851 -5.2546748 -6.2570254 39.276123 15.677988 8.9363522 -1.1840191 0.0075191856 16.687414 1.6022039 - 10000 0.14771416 0.22134967 -5.1833988 -6.3104954 40.578265 16.080163 8.9245634 -1.3484463 -0.0098090911 16.857414 1.6386293 -Loop time of 1.8702 on 4 procs for 10000 steps with 1000 atoms - -Performance: 461983.152 tau/day, 5347.027 timesteps/s -98.4% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 1.1723 | 1.1812 | 1.1956 | 0.9 | 63.16 -Neigh | 0.028221 | 0.030409 | 0.035555 | 1.7 | 1.63 -Comm | 0.22963 | 0.24139 | 0.25155 | 1.6 | 12.91 -Output | 0.00055218 | 0.00077897 | 0.0014515 | 0.0 | 0.04 -Modify | 0.37165 | 0.37241 | 0.3732 | 0.1 | 19.91 -Other | | 0.04404 | | | 2.35 - -Nlocal: 250 ave 257 max 244 min -Histogram: 1 0 0 1 1 0 0 0 0 1 -Nghost: 832.25 ave 840 max 822 min -Histogram: 1 0 0 0 0 0 2 0 0 1 -Neighs: 5144.25 ave 5282 max 4949 min -Histogram: 1 0 0 0 0 1 0 1 0 1 - -Total # of neighbors = 20577 -Ave neighs/atom = 20.577 -Neighbor list builds = 95 -Dangerous builds = 0 - -Total wall time: 0:00:05 diff --git a/examples/hugoniostat/log.5Oct16.hugoniostat.g++.1 b/examples/hugoniostat/log.5Oct16.hugoniostat.g++.1 deleted file mode 100644 index 4eea651e8e..0000000000 --- a/examples/hugoniostat/log.5Oct16.hugoniostat.g++.1 +++ /dev/null @@ -1,110 +0,0 @@ -LAMMPS (5 Oct 2016) -# This script reproduces stress trajectories from Fig. 1 in -# Ravelo, Holian, Germann, and Lomdahl, PRB 70 014103 (2004) -# -# Three thermostatting scenarios are visited: undamped (nodrag), -# damped (drag) and Nose-Hoover chain (nhchains). -# -# The axial and shear stress trajectories are printed to the -# file "stress_vs_t.dat". For the damped case, the original figure -# seems to be a plot of 2*tau, rather than tau. -# -# The script also demonstrates how to -# orient a crystal along <110>, -# and how to use the lj/cubic pair style. - -units lj -boundary p p p - -atom_style atomic - -# Set up FCC lattice with z axis along <110> - -lattice fcc 1.4142136 orient x 0 0 1 orient y 1 -1 0 orient z 1 1 0 -Lattice spacing in x,y,z = 1.41421 2 2 - -region mycell block 0.0 5.0 0.0 5.0 0.0 5.0 units lattice -create_box 1 mycell -Created orthogonal box = (0 0 0) to (7.07107 10 10) - 1 by 1 by 1 MPI processor grid -mass * 1.0 -create_atoms 1 box -Created 1000 atoms - -# Using units of Rmin, so sigma = 2^-1/6 = 0.8908987 - -pair_style lj/cubic -pair_coeff * * 1.0 0.8908987 - -# Relax box dimensions - -fix 3 all box/relax aniso 0.0 vmax 1.0e-4 nreset 100 - -thermo 100 -thermo_style custom step temp pe etotal pxx pyy pzz lx ly lz - -min_modify line quadratic -minimize 0.0 1.0e-6 10000 100000 -WARNING: Resetting reneighboring criteria during minimization (../min.cpp:168) -Neighbor list info ... - 1 neighbor list requests - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.84754 - ghost atom cutoff = 1.84754 - binsize = 0.923769 -> bins = 8 11 11 -Memory usage per processor = 3.65406 Mbytes -Step Temp PotEng TotEng Pxx Pyy Pzz Lx Ly Lz - 0 0 -6.2937539 -6.2937539 -2.7722431 -2.7722431 -2.7722431 7.0710677 9.9999999 9.9999999 - 100 0 -6.3319018 -6.3319018 -0.75971321 -0.75971321 -0.75971321 7.0003571 9.8999999 9.8999999 - 134 0 -6.3344257 -6.3344257 -4.5005818e-13 -4.9677973e-13 -4.9219424e-13 6.9780266 9.8684199 9.8684199 -Loop time of 0.0817621 on 1 procs for 134 steps with 1000 atoms - -100.3% CPU use with 1 MPI tasks x no OpenMP threads - -Minimization stats: - Stopping criterion = force tolerance - Energy initial, next-to-last, final = - -6.2937539309 -6.33442568056 -6.33442568056 - Force two-norm initial, final = 3395.29 5.83329e-10 - Force max component initial, final = 1960.27 3.42093e-10 - Final line search alpha, max atom move = 1 3.42093e-10 - Iterations, force evaluations = 134 137 - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.066955 | 0.066955 | 0.066955 | 0.0 | 81.89 -Neigh | 0.001004 | 0.001004 | 0.001004 | 0.0 | 1.23 -Comm | 0.0014298 | 0.0014298 | 0.0014298 | 0.0 | 1.75 -Output | 1.5974e-05 | 1.5974e-05 | 1.5974e-05 | 0.0 | 0.02 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 0.01236 | | | 15.11 - -Nlocal: 1000 ave 1000 max 1000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1724 ave 1724 max 1724 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 21000 ave 21000 max 21000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 21000 -Ave neighs/atom = 21 -Neighbor list builds = 1 -Dangerous builds = 0 - -# Define initial velocity - -velocity all create 0.01 87287 mom yes rot yes dist gaussian -write_restart restart.equil -Neighbor list info ... - 1 neighbor list requests - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.84754 - ghost atom cutoff = 1.84754 - binsize = 0.923769 -> bins = 8 11 11 - -# Start Run #1 - -log log.nodrag diff --git a/examples/hugoniostat/log.5Oct16.hugoniostat.g++.4 b/examples/hugoniostat/log.5Oct16.hugoniostat.g++.4 deleted file mode 100644 index 5125160e47..0000000000 --- a/examples/hugoniostat/log.5Oct16.hugoniostat.g++.4 +++ /dev/null @@ -1,110 +0,0 @@ -LAMMPS (5 Oct 2016) -# This script reproduces stress trajectories from Fig. 1 in -# Ravelo, Holian, Germann, and Lomdahl, PRB 70 014103 (2004) -# -# Three thermostatting scenarios are visited: undamped (nodrag), -# damped (drag) and Nose-Hoover chain (nhchains). -# -# The axial and shear stress trajectories are printed to the -# file "stress_vs_t.dat". For the damped case, the original figure -# seems to be a plot of 2*tau, rather than tau. -# -# The script also demonstrates how to -# orient a crystal along <110>, -# and how to use the lj/cubic pair style. - -units lj -boundary p p p - -atom_style atomic - -# Set up FCC lattice with z axis along <110> - -lattice fcc 1.4142136 orient x 0 0 1 orient y 1 -1 0 orient z 1 1 0 -Lattice spacing in x,y,z = 1.41421 2 2 - -region mycell block 0.0 5.0 0.0 5.0 0.0 5.0 units lattice -create_box 1 mycell -Created orthogonal box = (0 0 0) to (7.07107 10 10) - 1 by 2 by 2 MPI processor grid -mass * 1.0 -create_atoms 1 box -Created 1000 atoms - -# Using units of Rmin, so sigma = 2^-1/6 = 0.8908987 - -pair_style lj/cubic -pair_coeff * * 1.0 0.8908987 - -# Relax box dimensions - -fix 3 all box/relax aniso 0.0 vmax 1.0e-4 nreset 100 - -thermo 100 -thermo_style custom step temp pe etotal pxx pyy pzz lx ly lz - -min_modify line quadratic -minimize 0.0 1.0e-6 10000 100000 -WARNING: Resetting reneighboring criteria during minimization (../min.cpp:168) -Neighbor list info ... - 1 neighbor list requests - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.84754 - ghost atom cutoff = 1.84754 - binsize = 0.923769 -> bins = 8 11 11 -Memory usage per processor = 3.63062 Mbytes -Step Temp PotEng TotEng Pxx Pyy Pzz Lx Ly Lz - 0 0 -6.2937539 -6.2937539 -2.7722431 -2.7722431 -2.7722431 7.0710677 9.9999999 9.9999999 - 100 0 -6.3319018 -6.3319018 -0.75971321 -0.75971321 -0.75971321 7.0003571 9.8999999 9.8999999 - 134 0 -6.3344257 -6.3344257 -4.5046204e-13 -4.92206e-13 -4.9610344e-13 6.9780266 9.8684199 9.8684199 -Loop time of 0.0299768 on 4 procs for 134 steps with 1000 atoms - -98.4% CPU use with 4 MPI tasks x no OpenMP threads - -Minimization stats: - Stopping criterion = force tolerance - Energy initial, next-to-last, final = - -6.2937539309 -6.33442568056 -6.33442568056 - Force two-norm initial, final = 3395.29 5.80609e-10 - Force max component initial, final = 1960.27 3.41627e-10 - Final line search alpha, max atom move = 1 3.41627e-10 - Iterations, force evaluations = 134 137 - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.01485 | 0.017638 | 0.020133 | 1.4 | 58.84 -Neigh | 0.00022697 | 0.00027376 | 0.00033092 | 0.2 | 0.91 -Comm | 0.0026414 | 0.0050641 | 0.0078235 | 2.6 | 16.89 -Output | 1.502e-05 | 1.6749e-05 | 2.0027e-05 | 0.0 | 0.06 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 0.006985 | | | 23.30 - -Nlocal: 250 ave 305 max 205 min -Histogram: 1 0 0 0 2 0 0 0 0 1 -Nghost: 829 ave 874 max 774 min -Histogram: 1 0 0 0 0 0 2 0 0 1 -Neighs: 5250 ave 6445 max 4305 min -Histogram: 1 0 0 2 0 0 0 0 0 1 - -Total # of neighbors = 21000 -Ave neighs/atom = 21 -Neighbor list builds = 1 -Dangerous builds = 0 - -# Define initial velocity - -velocity all create 0.01 87287 mom yes rot yes dist gaussian -write_restart restart.equil -Neighbor list info ... - 1 neighbor list requests - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.84754 - ghost atom cutoff = 1.84754 - binsize = 0.923769 -> bins = 8 11 11 - -# Start Run #1 - -log log.nodrag diff --git a/examples/msst/in.msst b/examples/msst/in.msst index d9fee2977e..243d229c79 100644 --- a/examples/msst/in.msst +++ b/examples/msst/in.msst @@ -36,15 +36,12 @@ unfix 2 # MSST fix fix msst all msst z 28.0 q 200 mu 3e2 tscale 0.01 -# this is needed to make etotal equal the MSST conserved quantity -fix_modify msst energy yes - variable dhug equal f_msst[1] variable dray equal f_msst[2] variable lgr_vel equal f_msst[3] variable lgr_pos equal f_msst[4] -thermo_style custom step temp ke pe lx ly lz pxx pyy pzz etotal & +thermo_style custom step temp ke pe lx ly lz pxx pyy pzz econserve & v_dhug v_dray v_lgr_vel v_lgr_pos f_msst #dump id all atom 50 dump.msst diff --git a/examples/msst/log.30Jun20.msst.g++.1 b/examples/msst/log.08Feb21.msst.g++.1 similarity index 67% rename from examples/msst/log.30Jun20.msst.g++.1 rename to examples/msst/log.08Feb21.msst.g++.1 index 1e0e083620..a2964b6955 100644 --- a/examples/msst/log.30Jun20.msst.g++.1 +++ b/examples/msst/log.08Feb21.msst.g++.1 @@ -1,4 +1,4 @@ -LAMMPS (30 Jun 2020) +LAMMPS (24 Dec 2020) using 1 OpenMP thread(s) per MPI task # LJ test of msst shock dynamics @@ -10,18 +10,18 @@ atom_style atomic timestep 1e-03 lattice fcc 5.3589 -Lattice spacing in x,y,z = 5.3589 5.3589 5.3589 +Lattice spacing in x,y,z = 5.3589000 5.3589000 5.3589000 ## Specify the box as a given number of unit cells. region box1 block 0 18 0 18 0 18 units lattice ## Instantiate the system. create_box 1 box1 -Created orthogonal box = (0 0 0) to (96.4602 96.4602 96.4602) +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (96.460200 96.460200 96.460200) 1 by 1 by 1 MPI processor grid create_atoms 1 region box1 Created 23328 atoms - create_atoms CPU = 0.007 seconds + create_atoms CPU = 0.012 seconds mass 1 40.00 @@ -63,30 +63,30 @@ Step Temp E_pair E_mol TotEng Press 80 300.28534 -1056.589 0 -151.15321 8324.8812 90 305.83368 -1073.3097 0 -151.14426 8175.2478 100 304.06857 -1067.9843 0 -151.14112 8191.234 -Loop time of 3.62419 on 1 procs for 100 steps with 23328 atoms +Loop time of 8.29437 on 1 procs for 100 steps with 23328 atoms -Performance: 4.768 ns/day, 5.034 hours/ns, 27.592 timesteps/s +Performance: 2.083 ns/day, 11.520 hours/ns, 12.056 timesteps/s 99.9% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 3.4606 | 3.4606 | 3.4606 | 0.0 | 95.49 -Neigh | 0.065469 | 0.065469 | 0.065469 | 0.0 | 1.81 -Comm | 0.030757 | 0.030757 | 0.030757 | 0.0 | 0.85 -Output | 0.0024359 | 0.0024359 | 0.0024359 | 0.0 | 0.07 -Modify | 0.049582 | 0.049582 | 0.049582 | 0.0 | 1.37 -Other | | 0.01537 | | | 0.42 +Pair | 7.9896 | 7.9896 | 7.9896 | 0.0 | 96.33 +Neigh | 0.13503 | 0.13503 | 0.13503 | 0.0 | 1.63 +Comm | 0.053102 | 0.053102 | 0.053102 | 0.0 | 0.64 +Output | 0.0035691 | 0.0035691 | 0.0035691 | 0.0 | 0.04 +Modify | 0.091417 | 0.091417 | 0.091417 | 0.0 | 1.10 +Other | | 0.02167 | | | 0.26 -Nlocal: 23328.0 ave 23328.0 max 23328.0 min +Nlocal: 23328.0 ave 23328 max 23328 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 22235.0 ave 22235.0 max 22235.0 min +Nghost: 22235.0 ave 22235 max 22235 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 2183715.0 ave 2183715.0 max 2183715.0 min +Neighs: 2.18372e+06 ave 2.18372e+06 max 2.18372e+06 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 2183715 -Ave neighs/atom = 93.60918209876543 +Ave neighs/atom = 93.609182 Neighbor list builds = 1 Dangerous builds = 0 unfix 2 @@ -102,15 +102,12 @@ MSST parameters: Initial volume calculated on first step Initial energy calculated on first step -# this is needed to make etotal equal the MSST conserved quantity -fix_modify msst energy yes - variable dhug equal f_msst[1] variable dray equal f_msst[2] variable lgr_vel equal f_msst[3] variable lgr_pos equal f_msst[4] -thermo_style custom step temp ke pe lx ly lz pxx pyy pzz etotal v_dhug v_dray v_lgr_vel v_lgr_pos f_msst +thermo_style custom step temp ke pe lx ly lz pxx pyy pzz econserve v_dhug v_dray v_lgr_vel v_lgr_pos f_msst #dump id all atom 50 dump.msst @@ -126,42 +123,42 @@ Fix MSST p0 = 8106.7886 Fix MSST e0 = -151.14112 Fix MSST initial strain rate of -0.032011238 established by reducing temperature by factor of 0.01 Per MPI rank memory allocation (min/avg/max) = 18.98 | 18.98 | 18.98 Mbytes -Step Temp KinEng PotEng Lx Ly Lz Pxx Pyy Pzz TotEng v_dhug v_dray v_lgr_vel v_lgr_pos f_msst - 100 301.02788 907.67474 -1058.8159 96.4602 96.4602 96.4602 8242.1214 8202.9779 8095.8693 -151.14112 1.5203428 -10.919311 0 0 9.1684318 - 110 297.71411 897.68288 -1048.8859 96.4602 96.4602 96.399397 8347.6253 8303.7121 8220.7572 -151.20299 1.439058 28.652258 0.017649501 -0.55980494 5.7336721 - 120 295.64308 891.43821 -1042.72 96.4602 96.4602 96.340496 8431.6742 8379.2441 8331.5304 -151.28174 1.3655893 56.776734 0.034747125 -1.119263 2.3808018 - 130 296.02228 892.5816 -1043.9407 96.4602 96.4602 96.283468 8456.2492 8412.6368 8392.5853 -151.35912 1.2945465 37.811981 0.05130089 -1.6783851 -0.87840575 - 140 298.19024 899.11855 -1050.5482 96.4602 96.4602 96.228236 8430.5151 8415.6802 8414.2537 -151.42965 1.2243399 -18.01985 0.067333442 -2.2371818 -4.0330712 - 150 300.86421 907.18122 -1058.6966 96.4602 96.4602 96.174681 8399.4697 8396.2236 8420.9004 -151.51534 1.1598278 -86.5197 0.082879112 -2.7956634 -7.0824881 - 160 303.34119 914.64996 -1066.2388 96.4602 96.4602 96.122673 8388.3438 8360.5024 8428.751 -151.58881 1.0977647 -151.64553 0.097975827 -3.353839 -10.033902 - 170 304.87769 919.28288 -1070.961 96.4602 96.4602 96.072088 8408.8694 8333.4337 8449.5665 -151.67812 1.044322 -201.80899 0.11265931 -3.9117174 -12.897768 - 180 304.99 919.62151 -1071.3588 96.4602 96.4602 96.022824 8461.5542 8343.1436 8484.9824 -151.73733 0.99203387 -235.51793 0.12695926 -4.4693063 -15.685622 - 190 305.1148 919.99782 -1071.7807 96.4602 96.4602 95.9748 8498.7562 8371.4217 8514.4473 -151.78288 0.93937416 -273.43964 0.1408996 -5.0266132 -18.403999 - 200 306.45829 924.0488 -1075.8787 96.4602 96.4602 95.927931 8488.9509 8385.2408 8529.6443 -151.82991 0.88654815 -324.00777 0.15450451 -5.583645 -21.055149 -Loop time of 7.9807 on 1 procs for 100 steps with 23328 atoms +Step Temp KinEng PotEng Lx Ly Lz Pxx Pyy Pzz Econserve v_dhug v_dray v_lgr_vel v_lgr_pos f_msst + 100 301.02788 907.67474 -1067.9843 96.4602 96.4602 96.4602 8242.1214 8202.9779 8095.8693 -151.14112 1.5203428 -10.919311 0 0 9.1684318 + 110 297.71411 897.68288 -1054.6195 96.4602 96.4602 96.399397 8347.6253 8303.7121 8220.7572 -151.20299 1.439058 28.652258 0.017649501 -0.55980494 5.7336721 + 120 295.64308 891.43821 -1045.1008 96.4602 96.4602 96.340496 8431.6742 8379.2441 8331.5304 -151.28174 1.3655893 56.776734 0.034747125 -1.119263 2.3808018 + 130 296.02228 892.5816 -1043.0623 96.4602 96.4602 96.283468 8456.2492 8412.6368 8392.5853 -151.35912 1.2945465 37.811981 0.05130089 -1.6783851 -0.87840575 + 140 298.19024 899.11855 -1046.5151 96.4602 96.4602 96.228236 8430.5151 8415.6802 8414.2537 -151.42965 1.2243399 -18.01985 0.067333442 -2.2371818 -4.0330712 + 150 300.86421 907.18122 -1051.6141 96.4602 96.4602 96.174681 8399.4697 8396.2236 8420.9004 -151.51534 1.1598278 -86.5197 0.082879112 -2.7956634 -7.0824881 + 160 303.34119 914.64996 -1056.2049 96.4602 96.4602 96.122673 8388.3438 8360.5024 8428.751 -151.58881 1.0977647 -151.64553 0.097975827 -3.353839 -10.033902 + 170 304.87769 919.28288 -1058.0632 96.4602 96.4602 96.072088 8408.8694 8333.4337 8449.5665 -151.67812 1.044322 -201.80899 0.11265931 -3.9117174 -12.897768 + 180 304.99 919.62151 -1055.6732 96.4602 96.4602 96.022824 8461.5542 8343.1436 8484.9824 -151.73733 0.99203387 -235.51793 0.12695926 -4.4693063 -15.685622 + 190 305.1148 919.99782 -1053.3767 96.4602 96.4602 95.9748 8498.7562 8371.4217 8514.4473 -151.78288 0.93937416 -273.43964 0.1408996 -5.0266132 -18.403999 + 200 306.45829 924.0488 -1054.8236 96.4602 96.4602 95.927931 8488.9509 8385.2408 8529.6443 -151.82991 0.88654815 -324.00777 0.15450451 -5.583645 -21.055149 +Loop time of 13.2508 on 1 procs for 100 steps with 23328 atoms -Performance: 2.165 ns/day, 11.084 hours/ns, 12.530 timesteps/s +Performance: 1.304 ns/day, 18.404 hours/ns, 7.547 timesteps/s 99.9% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 6.8295 | 6.8295 | 6.8295 | 0.0 | 85.58 -Neigh | 0.13211 | 0.13211 | 0.13211 | 0.0 | 1.66 -Comm | 0.032946 | 0.032946 | 0.032946 | 0.0 | 0.41 -Output | 0.02301 | 0.02301 | 0.02301 | 0.0 | 0.29 -Modify | 0.94857 | 0.94857 | 0.94857 | 0.0 | 11.89 -Other | | 0.01452 | | | 0.18 +Pair | 11.716 | 11.716 | 11.716 | 0.0 | 88.41 +Neigh | 0.26843 | 0.26843 | 0.26843 | 0.0 | 2.03 +Comm | 0.056694 | 0.056694 | 0.056694 | 0.0 | 0.43 +Output | 0.029758 | 0.029758 | 0.029758 | 0.0 | 0.22 +Modify | 1.1599 | 1.1599 | 1.1599 | 0.0 | 8.75 +Other | | 0.02035 | | | 0.15 -Nlocal: 23328.0 ave 23328.0 max 23328.0 min +Nlocal: 23328.0 ave 23328 max 23328 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 22205.0 ave 22205.0 max 22205.0 min +Nghost: 22205.0 ave 22205 max 22205 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 2183494.0 ave 2183494.0 max 2183494.0 min +Neighs: 2.18349e+06 ave 2.18349e+06 max 2.18349e+06 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 2183494 -Ave neighs/atom = 93.5997085048011 +Ave neighs/atom = 93.599709 Neighbor list builds = 2 Dangerous builds = 0 -Total wall time: 0:00:11 +Total wall time: 0:00:22 diff --git a/examples/msst/log.30Jun20.msst.g++.4 b/examples/msst/log.08Feb21.msst.g++.4 similarity index 66% rename from examples/msst/log.30Jun20.msst.g++.4 rename to examples/msst/log.08Feb21.msst.g++.4 index a98b957b50..7b5425d8a4 100644 --- a/examples/msst/log.30Jun20.msst.g++.4 +++ b/examples/msst/log.08Feb21.msst.g++.4 @@ -1,4 +1,4 @@ -LAMMPS (30 Jun 2020) +LAMMPS (24 Dec 2020) using 1 OpenMP thread(s) per MPI task # LJ test of msst shock dynamics @@ -10,18 +10,18 @@ atom_style atomic timestep 1e-03 lattice fcc 5.3589 -Lattice spacing in x,y,z = 5.3589 5.3589 5.3589 +Lattice spacing in x,y,z = 5.3589000 5.3589000 5.3589000 ## Specify the box as a given number of unit cells. region box1 block 0 18 0 18 0 18 units lattice ## Instantiate the system. create_box 1 box1 -Created orthogonal box = (0 0 0) to (96.4602 96.4602 96.4602) +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (96.460200 96.460200 96.460200) 1 by 2 by 2 MPI processor grid create_atoms 1 region box1 Created 23328 atoms - create_atoms CPU = 0.003 seconds + create_atoms CPU = 0.080 seconds mass 1 40.00 @@ -63,30 +63,30 @@ Step Temp E_pair E_mol TotEng Press 80 299.37658 -1053.8476 0 -151.1519 8352.9467 90 304.24026 -1068.4941 0 -151.13319 8218.1594 100 301.9683 -1061.6332 0 -151.12284 8244.1277 -Loop time of 0.995305 on 4 procs for 100 steps with 23328 atoms +Loop time of 5.66225 on 4 procs for 100 steps with 23328 atoms -Performance: 17.362 ns/day, 1.382 hours/ns, 100.472 timesteps/s -98.2% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 3.052 ns/day, 7.864 hours/ns, 17.661 timesteps/s +78.0% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.88957 | 0.90144 | 0.91686 | 1.1 | 90.57 -Neigh | 0.016824 | 0.016945 | 0.017106 | 0.1 | 1.70 -Comm | 0.039949 | 0.054853 | 0.068734 | 4.8 | 5.51 -Output | 0.00076342 | 0.0010425 | 0.0018687 | 1.5 | 0.10 -Modify | 0.012839 | 0.012946 | 0.013153 | 0.1 | 1.30 -Other | | 0.008074 | | | 0.81 +Pair | 2.6416 | 2.7792 | 2.9335 | 6.4 | 49.08 +Neigh | 0.029522 | 0.037458 | 0.054701 | 5.3 | 0.66 +Comm | 2.1998 | 2.4099 | 2.5822 | 8.8 | 42.56 +Output | 0.10457 | 0.10816 | 0.11265 | 1.0 | 1.91 +Modify | 0.023462 | 0.033517 | 0.044696 | 4.9 | 0.59 +Other | | 0.294 | | | 5.19 -Nlocal: 5832.0 ave 5850.0 max 5813.0 min +Nlocal: 5832.00 ave 5850 max 5813 min Histogram: 1 0 0 0 1 1 0 0 0 1 -Nghost: 10571.0 ave 10590.0 max 10553.0 min +Nghost: 10571.0 ave 10590 max 10553 min Histogram: 1 0 0 0 1 1 0 0 0 1 -Neighs: 545761.75 ave 548069.0 max 543643.0 min +Neighs: 545762.0 ave 548069 max 543643 min Histogram: 1 0 0 1 0 1 0 0 0 1 Total # of neighbors = 2183047 -Ave neighs/atom = 93.58054698216735 +Ave neighs/atom = 93.580547 Neighbor list builds = 1 Dangerous builds = 0 unfix 2 @@ -102,15 +102,12 @@ MSST parameters: Initial volume calculated on first step Initial energy calculated on first step -# this is needed to make etotal equal the MSST conserved quantity -fix_modify msst energy yes - variable dhug equal f_msst[1] variable dray equal f_msst[2] variable lgr_vel equal f_msst[3] variable lgr_pos equal f_msst[4] -thermo_style custom step temp ke pe lx ly lz pxx pyy pzz etotal v_dhug v_dray v_lgr_vel v_lgr_pos f_msst +thermo_style custom step temp ke pe lx ly lz pxx pyy pzz econserve v_dhug v_dray v_lgr_vel v_lgr_pos f_msst #dump id all atom 50 dump.msst @@ -126,42 +123,42 @@ Fix MSST p0 = 8186.2393 Fix MSST e0 = -151.12284 Fix MSST initial strain rate of -0.031900492 established by reducing temperature by factor of 0.01 Per MPI rank memory allocation (min/avg/max) = 8.535 | 8.535 | 8.535 Mbytes -Step Temp KinEng PotEng Lx Ly Lz Pxx Pyy Pzz TotEng v_dhug v_dray v_lgr_vel v_lgr_pos f_msst - 100 298.94862 901.40524 -1052.5281 96.4602 96.4602 96.4602 8270.9151 8253.4662 8175.4946 -151.12284 1.5098415 -10.744684 0 0 9.1051034 - 110 296.49826 894.01679 -1045.224 96.4602 96.4602 96.399609 8338.4937 8340.5504 8294.9909 -151.20723 1.4327442 23.73173 0.017588167 -0.55980562 5.6560557 - 120 295.97607 892.44225 -1043.7239 96.4602 96.4602 96.340904 8377.6797 8385.921 8378.3042 -151.28169 1.3584606 24.672199 0.034628719 -1.1192655 2.2953307 - 130 297.34893 896.58179 -1047.945 96.4602 96.4602 96.284029 8379.2516 8394.8806 8416.2669 -151.36322 1.2881444 -17.170168 0.051138087 -1.6783905 -0.96527961 - 140 299.71946 903.72952 -1055.1787 96.4602 96.4602 96.22888 8357.0358 8388.6743 8424.3188 -151.44922 1.221125 -86.501161 0.067146366 -2.2371908 -4.1195182 - 150 301.79241 909.97998 -1061.4976 96.4602 96.4602 96.175327 8332.7118 8393.7027 8434.6177 -151.51765 1.1560248 -151.34689 0.082691635 -2.7956762 -7.172084 - 160 303.18249 914.17141 -1065.7667 96.4602 96.4602 96.123244 8321.1154 8413.1248 8454.5596 -151.59527 1.0977348 -204.4864 0.097810061 -3.3538554 -10.134387 - 170 304.34089 917.66428 -1069.3198 96.4602 96.4602 96.072522 8327.6227 8431.1177 8467.92 -151.65554 1.0390628 -262.29751 0.11253339 -3.9117366 -13.01442 - 180 305.86343 922.25514 -1073.9633 96.4602 96.4602 96.023049 8345.1853 8432.5201 8461.3276 -151.70813 0.97863988 -338.30793 0.12689398 -4.4693274 -15.815462 - 190 307.44054 927.01052 -1078.7892 96.4602 96.4602 95.9747 8368.4081 8427.5109 8450.584 -151.77867 0.92329631 -416.89333 0.1409285 -5.0266346 -18.541801 - 200 308.43619 930.01265 -1081.8521 96.4602 96.4602 95.927349 8393.2058 8443.1265 8454.6733 -151.83947 0.8723277 -479.24592 0.1546734 -5.5836644 -21.20378 -Loop time of 2.16596 on 4 procs for 100 steps with 23328 atoms +Step Temp KinEng PotEng Lx Ly Lz Pxx Pyy Pzz Econserve v_dhug v_dray v_lgr_vel v_lgr_pos f_msst + 100 298.94862 901.40524 -1061.6332 96.4602 96.4602 96.4602 8270.9151 8253.4662 8175.4946 -151.12284 1.5098415 -10.744684 0 0 9.1051034 + 110 296.49826 894.01679 -1050.8801 96.4602 96.4602 96.399609 8338.4937 8340.5504 8294.9909 -151.20723 1.4327442 23.73173 0.017588167 -0.55980562 5.6560557 + 120 295.97607 892.44225 -1046.0193 96.4602 96.4602 96.340904 8377.6797 8385.921 8378.3042 -151.28169 1.3584606 24.672199 0.034628719 -1.1192655 2.2953307 + 130 297.34893 896.58179 -1046.9797 96.4602 96.4602 96.284029 8379.2516 8394.8806 8416.2669 -151.36322 1.2881444 -17.170168 0.051138087 -1.6783905 -0.96527961 + 140 299.71946 903.72952 -1051.0592 96.4602 96.4602 96.22888 8357.0358 8388.6743 8424.3188 -151.44922 1.221125 -86.501161 0.067146366 -2.2371908 -4.1195182 + 150 301.79241 909.97998 -1054.3256 96.4602 96.4602 96.175327 8332.7118 8393.7027 8434.6177 -151.51765 1.1560248 -151.34689 0.082691635 -2.7956762 -7.172084 + 160 303.18249 914.17141 -1055.6323 96.4602 96.4602 96.123244 8321.1154 8413.1248 8454.5596 -151.59527 1.0977348 -204.4864 0.097810061 -3.3538554 -10.134387 + 170 304.34089 917.66428 -1056.3054 96.4602 96.4602 96.072522 8327.6227 8431.1177 8467.92 -151.65554 1.0390628 -262.29751 0.11253339 -3.9117366 -13.01442 + 180 305.86343 922.25514 -1058.1478 96.4602 96.4602 96.023049 8345.1853 8432.5201 8461.3276 -151.70813 0.97863988 -338.30793 0.12689398 -4.4693274 -15.815462 + 190 307.44054 927.01052 -1060.2474 96.4602 96.4602 95.9747 8368.4081 8427.5109 8450.584 -151.77867 0.92329631 -416.89333 0.1409285 -5.0266346 -18.541801 + 200 308.43619 930.01265 -1060.6483 96.4602 96.4602 95.927349 8393.2058 8443.1265 8454.6733 -151.83947 0.8723277 -479.24592 0.1546734 -5.5836644 -21.20378 +Loop time of 11.445 on 4 procs for 100 steps with 23328 atoms -Performance: 7.978 ns/day, 3.008 hours/ns, 46.169 timesteps/s -98.5% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 1.510 ns/day, 15.896 hours/ns, 8.737 timesteps/s +77.1% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 1.7569 | 1.7822 | 1.8059 | 1.6 | 82.28 -Neigh | 0.034235 | 0.03546 | 0.037677 | 0.7 | 1.64 -Comm | 0.065427 | 0.091172 | 0.11833 | 7.4 | 4.21 -Output | 0.0062776 | 0.0065615 | 0.0074117 | 0.6 | 0.30 -Modify | 0.24069 | 0.2423 | 0.24655 | 0.5 | 11.19 -Other | | 0.008271 | | | 0.38 +Pair | 3.7358 | 4.0193 | 4.3315 | 10.5 | 35.12 +Neigh | 0.05921 | 0.078071 | 0.089958 | 4.1 | 0.68 +Comm | 2.3136 | 2.683 | 3.054 | 16.3 | 23.44 +Output | 0.038525 | 0.040035 | 0.044559 | 1.3 | 0.35 +Modify | 4.2814 | 4.3709 | 4.4749 | 4.1 | 38.19 +Other | | 0.2537 | | | 2.22 -Nlocal: 5832.0 ave 5874.0 max 5803.0 min +Nlocal: 5832.00 ave 5874 max 5803 min Histogram: 2 0 0 0 0 1 0 0 0 1 -Nghost: 10563.75 ave 10588.0 max 10526.0 min +Nghost: 10563.8 ave 10588 max 10526 min Histogram: 1 0 0 0 1 0 0 0 0 2 -Neighs: 545708.5 ave 550787.0 max 542668.0 min +Neighs: 545708.0 ave 550787 max 542668 min Histogram: 2 0 0 0 1 0 0 0 0 1 Total # of neighbors = 2182834 -Ave neighs/atom = 93.57141632373114 +Ave neighs/atom = 93.571416 Neighbor list builds = 2 Dangerous builds = 0 -Total wall time: 0:00:03 +Total wall time: 0:00:17 diff --git a/examples/threebody/in.threebody b/examples/threebody/in.threebody index 951a364b57..3d11219a47 100644 --- a/examples/threebody/in.threebody +++ b/examples/threebody/in.threebody @@ -53,9 +53,9 @@ velocity all create $t 5287287 loop geom pair_style sw pair_coeff * * Si.sw Si Si Si Si Si Si Si Si +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes @@ -71,9 +71,9 @@ read_restart restart.equil pair_style sw pair_coeff * * CdTeZnSeHgS0.sw Cd Zn Hg Cd Te S Se Te +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes @@ -87,9 +87,9 @@ read_restart restart.equil pair_style vashishta pair_coeff * * InP.vashishta In In In In P P P P +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes @@ -106,9 +106,9 @@ change_box all x scale ${fac} y scale ${fac} z scale ${fac} remap pair_style tersoff pair_coeff * * BNC.tersoff N N N C B B C B +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes diff --git a/examples/threebody/log.08Feb21.threebody.g++.1 b/examples/threebody/log.08Feb21.threebody.g++.1 new file mode 100644 index 0000000000..51b6dfea05 --- /dev/null +++ b/examples/threebody/log.08Feb21.threebody.g++.1 @@ -0,0 +1,373 @@ +LAMMPS (24 Dec 2020) + using 1 OpenMP thread(s) per MPI task +# Simple regression tests for threebody potentials + +# NOTE: These are not intended to represent real materials + +units metal + +atom_style atomic +atom_modify map array +boundary p p p +atom_modify sort 0 0.0 + +# temperature + +variable t equal 1800.0 + +# cubic diamond unit cell + +variable a equal 5.431 +lattice custom $a a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 1.0 basis 0.0 0.0 0.0 basis 0.0 0.5 0.5 basis 0.5 0.0 0.5 basis 0.5 0.5 0.0 basis 0.25 0.25 0.25 basis 0.25 0.75 0.75 basis 0.75 0.25 0.75 basis 0.75 0.75 0.25 +lattice custom 5.431 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 1.0 basis 0.0 0.0 0.0 basis 0.0 0.5 0.5 basis 0.5 0.0 0.5 basis 0.5 0.5 0.0 basis 0.25 0.25 0.25 basis 0.25 0.75 0.75 basis 0.75 0.25 0.75 basis 0.75 0.75 0.25 +Lattice spacing in x,y,z = 5.4310000 5.4310000 5.4310000 + +region myreg block 0 4 0 4 0 4 + +create_box 8 myreg +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) + 1 by 1 by 1 MPI processor grid +create_atoms 1 region myreg basis 1 1 basis 2 2 basis 3 3 basis 4 4 basis 5 5 basis 6 6 basis 7 7 basis 8 8 +Created 512 atoms + create_atoms CPU = 0.001 seconds + +mass * 28.06 + +velocity all create $t 5287287 loop geom +velocity all create 1800 5287287 loop geom + +# Equilibrate using Stillinger-Weber model for silicon + +pair_style sw +pair_coeff * * Si.sw Si Si Si Si Si Si Si Si +Reading sw potential file Si.sw with DATE: 2007-06-11 + +thermo_style custom step temp epair etotal econserve press +thermo 10 +fix 1 all nvt temp $t $t 0.1 +fix 1 all nvt temp 1800 $t 0.1 +fix 1 all nvt temp 1800 1800 0.1 +timestep 1.0e-3 +neighbor 1.0 bin +neigh_modify every 1 delay 10 check yes +run 100 +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 4.77118 + ghost atom cutoff = 4.77118 + binsize = 2.38559, bins = 10 10 10 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair sw, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 2.983 | 2.983 | 2.983 Mbytes +Step Temp E_pair TotEng Econserve Press + 0 1800 -2220.3392 -2101.4457 -2101.4457 12358.626 + 10 1006.0192 -2167.7053 -2101.2558 -2101.3286 13892.426 + 20 588.26396 -2139.7132 -2100.8573 -2101.3117 11295.566 + 30 990.55956 -2165.2164 -2099.788 -2101.3931 6279.0239 + 40 700.12917 -2144.4279 -2098.183 -2101.3427 5594.2388 + 50 523.64239 -2131.7796 -2097.192 -2101.3122 6013.0994 + 60 989.47092 -2161.3716 -2096.0152 -2101.3839 5819.2688 + 70 877.27433 -2152.4432 -2094.4975 -2101.3461 9116.6569 + 80 800.80221 -2146.1371 -2093.2426 -2101.313 11995.66 + 90 1293.9689 -2176.9021 -2091.4329 -2101.3848 11692.45 + 100 1112.9699 -2162.7259 -2089.2121 -2101.3478 12263.758 +Loop time of 0.157871 on 1 procs for 100 steps with 512 atoms + +Performance: 54.728 ns/day, 0.439 hours/ns, 633.430 timesteps/s +99.8% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.14704 | 0.14704 | 0.14704 | 0.0 | 93.14 +Neigh | 0.00247 | 0.00247 | 0.00247 | 0.0 | 1.56 +Comm | 0.0024729 | 0.0024729 | 0.0024729 | 0.0 | 1.57 +Output | 0.0002656 | 0.0002656 | 0.0002656 | 0.0 | 0.17 +Modify | 0.0050237 | 0.0050237 | 0.0050237 | 0.0 | 3.18 +Other | | 0.0006011 | | | 0.38 + +Nlocal: 512.000 ave 512 max 512 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 1017.00 ave 1017 max 1017 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 13988.0 ave 13988 max 13988 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 13988 +Ave neighs/atom = 27.320312 +Neighbor list builds = 2 +Dangerous builds = 0 + +write_restart restart.equil +System init for write_restart ... + +# Test Stillinger-Weber model for Cd/Te/Zn/Se/Hg/S + +clear + using 1 OpenMP thread(s) per MPI task +read_restart restart.equil +Reading restart file ... + restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 + restoring atom style atomic from restart + orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) + 1 by 1 by 1 MPI processor grid + pair style sw stores no restart info + 512 atoms + read_restart CPU = 0.001 seconds + +pair_style sw +pair_coeff * * CdTeZnSeHgS0.sw Cd Zn Hg Cd Te S Se Te +Reading sw potential file CdTeZnSeHgS0.sw with DATE: 2013-08-09 + +thermo_style custom step temp epair etotal econserve press +thermo 10 +fix 1 all nvt temp $t $t 0.1 +fix 1 all nvt temp 1800 $t 0.1 +fix 1 all nvt temp 1800 1800 0.1 +Resetting global fix info from restart file: + fix style: nvt, fix ID: 1 +timestep 1.0e-3 +neighbor 1.0 bin +neigh_modify every 1 delay 10 check yes +run 100 +All restart file global fix info was re-assigned +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 5.6320004 + ghost atom cutoff = 5.6320004 + binsize = 2.8160002, bins = 8 8 8 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair sw, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.001 | 3.001 | 3.001 Mbytes +Step Temp E_pair TotEng Econserve Press + 100 1112.9699 -625.76163 -552.24781 -564.38354 462129.66 + 110 1502.8461 -649.55768 -550.29179 -564.45814 463413.45 + 120 1926.4523 -674.71265 -547.46675 -564.53612 486338.88 + 130 1152.6663 -621.47264 -545.33681 -564.37203 514892.2 + 140 1762.244 -659.86941 -543.46979 -564.4985 488159.88 + 150 1767.8665 -657.67178 -540.90078 -564.48386 466721.31 + 160 1075.2874 -610.12809 -539.10328 -564.36709 470151.9 + 170 1697.9313 -649.3684 -537.21675 -564.47207 467953.71 + 180 1856.1197 -657.14338 -534.54309 -564.48754 488372.27 + 190 1346.1107 -621.42431 -532.5111 -564.38065 511750.04 + 200 1919.5266 -657.26587 -530.47743 -564.47797 488684.56 +Loop time of 0.455825 on 1 procs for 100 steps with 512 atoms + +Performance: 18.955 ns/day, 1.266 hours/ns, 219.382 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.44091 | 0.44091 | 0.44091 | 0.0 | 96.73 +Neigh | 0.0054555 | 0.0054555 | 0.0054555 | 0.0 | 1.20 +Comm | 0.0035784 | 0.0035784 | 0.0035784 | 0.0 | 0.79 +Output | 0.00024486 | 0.00024486 | 0.00024486 | 0.0 | 0.05 +Modify | 0.0050471 | 0.0050471 | 0.0050471 | 0.0 | 1.11 +Other | | 0.000592 | | | 0.13 + +Nlocal: 512.000 ave 512 max 512 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 1428.00 ave 1428 max 1428 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 17344.0 ave 17344 max 17344 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 17344 +Ave neighs/atom = 33.875000 +Neighbor list builds = 3 +Dangerous builds = 0 + +# Test Vashishta model for In/P + +clear + using 1 OpenMP thread(s) per MPI task +read_restart restart.equil +Reading restart file ... + restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 + restoring atom style atomic from restart + orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) + 1 by 1 by 1 MPI processor grid + pair style sw stores no restart info + 512 atoms + read_restart CPU = 0.001 seconds + +pair_style vashishta +pair_coeff * * InP.vashishta In In In In P P P P +Reading vashishta potential file InP.vashishta with DATE: 2015-10-14 + +thermo_style custom step temp epair etotal econserve press +thermo 10 +fix 1 all nvt temp $t $t 0.1 +fix 1 all nvt temp 1800 $t 0.1 +fix 1 all nvt temp 1800 1800 0.1 +Resetting global fix info from restart file: + fix style: nvt, fix ID: 1 +timestep 1.0e-3 +neighbor 1.0 bin +neigh_modify every 1 delay 10 check yes +run 100 +All restart file global fix info was re-assigned +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 7 + ghost atom cutoff = 7 + binsize = 3.5, bins = 7 7 7 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair vashishta, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.025 | 3.025 | 3.025 Mbytes +Step Temp E_pair TotEng Econserve Press + 100 1112.9699 -1497.2988 -1423.785 -1435.9207 355619.19 + 110 1250.545 -1504.5795 -1421.9785 -1435.9786 345188.52 + 120 1360.2275 -1509.3443 -1419.4986 -1435.9801 333306.3 + 130 1066.4516 -1487.9076 -1417.4664 -1435.9076 334465.11 + 140 1481.0477 -1513.0511 -1415.2251 -1435.988 308725.1 + 150 1216.1167 -1493.0774 -1412.7505 -1435.9217 304249.09 + 160 1211.4398 -1490.7459 -1410.728 -1435.9164 288897.09 + 170 1542.2025 -1510.0774 -1408.212 -1435.9608 260104.14 + 180 1302.9041 -1491.7765 -1405.7172 -1435.8971 249514.04 + 190 1332.3326 -1491.5271 -1403.524 -1435.9213 227537.99 + 200 1352.1813 -1490.4513 -1401.1371 -1435.9049 207626.42 +Loop time of 0.217808 on 1 procs for 100 steps with 512 atoms + +Performance: 39.668 ns/day, 0.605 hours/ns, 459.121 timesteps/s +98.2% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.19635 | 0.19635 | 0.19635 | 0.0 | 90.15 +Neigh | 0.01054 | 0.01054 | 0.01054 | 0.0 | 4.84 +Comm | 0.0051923 | 0.0051923 | 0.0051923 | 0.0 | 2.38 +Output | 0.00027919 | 0.00027919 | 0.00027919 | 0.0 | 0.13 +Modify | 0.0048637 | 0.0048637 | 0.0048637 | 0.0 | 2.23 +Other | | 0.0005858 | | | 0.27 + +Nlocal: 512.000 ave 512 max 512 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 1838.00 ave 1838 max 1838 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 36482.0 ave 36482 max 36482 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 36482 +Ave neighs/atom = 71.253906 +Neighbor list builds = 4 +Dangerous builds = 0 + +# Test Tersoff model for B/N/C + +clear + using 1 OpenMP thread(s) per MPI task +read_restart restart.equil +Reading restart file ... + restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 + restoring atom style atomic from restart + orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) + 1 by 1 by 1 MPI processor grid + pair style sw stores no restart info + 512 atoms + read_restart CPU = 0.001 seconds + +variable fac equal 0.6 +change_box all x scale ${fac} y scale ${fac} z scale ${fac} remap +change_box all x scale 0.6 y scale ${fac} z scale ${fac} remap +change_box all x scale 0.6 y scale 0.6 z scale ${fac} remap +change_box all x scale 0.6 y scale 0.6 z scale 0.6 remap +Changing box ... + orthogonal box = (4.3448000 0.0000000 0.0000000) to (17.379200 21.724000 21.724000) + orthogonal box = (4.3448000 4.3448000 0.0000000) to (17.379200 17.379200 21.724000) + orthogonal box = (4.3448000 4.3448000 4.3448000) to (17.379200 17.379200 17.379200) + +pair_style tersoff +pair_coeff * * BNC.tersoff N N N C B B C B +Reading tersoff potential file BNC.tersoff with DATE: 2013-03-21 + +thermo_style custom step temp epair etotal econserve press +thermo 10 +fix 1 all nvt temp $t $t 0.1 +fix 1 all nvt temp 1800 $t 0.1 +fix 1 all nvt temp 1800 1800 0.1 +Resetting global fix info from restart file: + fix style: nvt, fix ID: 1 +timestep 1.0e-3 +neighbor 1.0 bin +neigh_modify every 1 delay 10 check yes +run 100 +All restart file global fix info was re-assigned +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 3.1 + ghost atom cutoff = 3.1 + binsize = 1.55, bins = 9 9 9 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair tersoff, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 2.982 | 2.982 | 2.982 Mbytes +Step Temp E_pair TotEng Econserve Press + 100 1112.9699 -3259.7676 -3186.2538 -3198.3895 1912461.3 + 110 1772.8268 -3301.5479 -3184.4493 -3198.8218 1885295.6 + 120 1169.7287 -3258.74 -3181.4772 -3197.9294 1898705.2 + 130 1308.5623 -3265.1338 -3178.7007 -3197.5922 1894187.5 + 140 1486.0361 -3274.951 -3176.7954 -3197.776 1871927.6 + 150 1419.0362 -3267.7302 -3174.0002 -3197.2296 1925234.6 + 160 1196.6689 -3250.1492 -3171.1069 -3196.7078 1902235.1 + 170 1707.5846 -3281.7658 -3168.9766 -3196.9721 1863047.3 + 180 1337.4358 -3254.9844 -3166.6442 -3196.8222 1880420.9 + 190 1441.8052 -3259.0364 -3163.8023 -3196.3556 1904512.1 + 200 1569.0317 -3265.0089 -3161.3714 -3196.3328 1899462.7 +Loop time of 0.487425 on 1 procs for 100 steps with 512 atoms + +Performance: 17.726 ns/day, 1.354 hours/ns, 205.160 timesteps/s +99.1% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.47762 | 0.47762 | 0.47762 | 0.0 | 97.99 +Neigh | 0.0014286 | 0.0014286 | 0.0014286 | 0.0 | 0.29 +Comm | 0.0024068 | 0.0024068 | 0.0024068 | 0.0 | 0.49 +Output | 0.00028992 | 0.00028992 | 0.00028992 | 0.0 | 0.06 +Modify | 0.0050635 | 0.0050635 | 0.0050635 | 0.0 | 1.04 +Other | | 0.0006182 | | | 0.13 + +Nlocal: 512.000 ave 512 max 512 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 1028.00 ave 1028 max 1028 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 14604.0 ave 14604 max 14604 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 14604 +Ave neighs/atom = 28.523438 +Neighbor list builds = 1 +Dangerous builds = 0 + +Total wall time: 0:00:01 diff --git a/examples/threebody/log.08Feb21.threebody.g++.4 b/examples/threebody/log.08Feb21.threebody.g++.4 new file mode 100644 index 0000000000..f747be509d --- /dev/null +++ b/examples/threebody/log.08Feb21.threebody.g++.4 @@ -0,0 +1,373 @@ +LAMMPS (24 Dec 2020) + using 1 OpenMP thread(s) per MPI task +# Simple regression tests for threebody potentials + +# NOTE: These are not intended to represent real materials + +units metal + +atom_style atomic +atom_modify map array +boundary p p p +atom_modify sort 0 0.0 + +# temperature + +variable t equal 1800.0 + +# cubic diamond unit cell + +variable a equal 5.431 +lattice custom $a a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 1.0 basis 0.0 0.0 0.0 basis 0.0 0.5 0.5 basis 0.5 0.0 0.5 basis 0.5 0.5 0.0 basis 0.25 0.25 0.25 basis 0.25 0.75 0.75 basis 0.75 0.25 0.75 basis 0.75 0.75 0.25 +lattice custom 5.431 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 1.0 basis 0.0 0.0 0.0 basis 0.0 0.5 0.5 basis 0.5 0.0 0.5 basis 0.5 0.5 0.0 basis 0.25 0.25 0.25 basis 0.25 0.75 0.75 basis 0.75 0.25 0.75 basis 0.75 0.75 0.25 +Lattice spacing in x,y,z = 5.4310000 5.4310000 5.4310000 + +region myreg block 0 4 0 4 0 4 + +create_box 8 myreg +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) + 1 by 2 by 2 MPI processor grid +create_atoms 1 region myreg basis 1 1 basis 2 2 basis 3 3 basis 4 4 basis 5 5 basis 6 6 basis 7 7 basis 8 8 +Created 512 atoms + create_atoms CPU = 0.074 seconds + +mass * 28.06 + +velocity all create $t 5287287 loop geom +velocity all create 1800 5287287 loop geom + +# Equilibrate using Stillinger-Weber model for silicon + +pair_style sw +pair_coeff * * Si.sw Si Si Si Si Si Si Si Si +Reading sw potential file Si.sw with DATE: 2007-06-11 + +thermo_style custom step temp epair etotal econserve press +thermo 10 +fix 1 all nvt temp $t $t 0.1 +fix 1 all nvt temp 1800 $t 0.1 +fix 1 all nvt temp 1800 1800 0.1 +timestep 1.0e-3 +neighbor 1.0 bin +neigh_modify every 1 delay 10 check yes +run 100 +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 4.77118 + ghost atom cutoff = 4.77118 + binsize = 2.38559, bins = 10 10 10 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair sw, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 2.958 | 2.958 | 2.958 Mbytes +Step Temp E_pair TotEng Econserve Press + 0 1800 -2220.3392 -2101.4457 -2101.4457 12358.626 + 10 1006.0192 -2167.7053 -2101.2558 -2101.3286 13892.426 + 20 588.26396 -2139.7132 -2100.8573 -2101.3117 11295.566 + 30 990.55956 -2165.2164 -2099.788 -2101.3931 6279.0239 + 40 700.12917 -2144.4279 -2098.183 -2101.3427 5594.2388 + 50 523.64239 -2131.7796 -2097.192 -2101.3122 6013.0994 + 60 989.47092 -2161.3716 -2096.0152 -2101.3839 5819.2688 + 70 877.27433 -2152.4432 -2094.4975 -2101.3461 9116.6569 + 80 800.80221 -2146.1371 -2093.2426 -2101.313 11995.66 + 90 1293.9689 -2176.9021 -2091.4329 -2101.3848 11692.45 + 100 1112.9699 -2162.7259 -2089.2121 -2101.3478 12263.758 +Loop time of 0.0998364 on 4 procs for 100 steps with 512 atoms + +Performance: 86.542 ns/day, 0.277 hours/ns, 1001.639 timesteps/s +81.4% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.037337 | 0.049389 | 0.069239 | 5.9 | 49.47 +Neigh | 0.00067854 | 0.00068814 | 0.00070286 | 0.0 | 0.69 +Comm | 0.025239 | 0.04504 | 0.056869 | 6.1 | 45.11 +Output | 0.00015712 | 0.00082219 | 0.0028148 | 0.0 | 0.82 +Modify | 0.0014369 | 0.0015754 | 0.0016632 | 0.2 | 1.58 +Other | | 0.002321 | | | 2.33 + +Nlocal: 128.000 ave 132 max 125 min +Histogram: 1 1 0 0 0 1 0 0 0 1 +Nghost: 525.000 ave 528 max 521 min +Histogram: 1 0 0 0 1 0 0 0 1 1 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 3497.00 ave 3619 max 3397 min +Histogram: 1 1 0 0 0 0 1 0 0 1 + +Total # of neighbors = 13988 +Ave neighs/atom = 27.320312 +Neighbor list builds = 2 +Dangerous builds = 0 + +write_restart restart.equil +System init for write_restart ... + +# Test Stillinger-Weber model for Cd/Te/Zn/Se/Hg/S + +clear + using 1 OpenMP thread(s) per MPI task +read_restart restart.equil +Reading restart file ... + restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 + restoring atom style atomic from restart + orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) + 1 by 2 by 2 MPI processor grid + pair style sw stores no restart info + 512 atoms + read_restart CPU = 0.001 seconds + +pair_style sw +pair_coeff * * CdTeZnSeHgS0.sw Cd Zn Hg Cd Te S Se Te +Reading sw potential file CdTeZnSeHgS0.sw with DATE: 2013-08-09 + +thermo_style custom step temp epair etotal econserve press +thermo 10 +fix 1 all nvt temp $t $t 0.1 +fix 1 all nvt temp 1800 $t 0.1 +fix 1 all nvt temp 1800 1800 0.1 +Resetting global fix info from restart file: + fix style: nvt, fix ID: 1 +timestep 1.0e-3 +neighbor 1.0 bin +neigh_modify every 1 delay 10 check yes +run 100 +All restart file global fix info was re-assigned +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 5.6320004 + ghost atom cutoff = 5.6320004 + binsize = 2.8160002, bins = 8 8 8 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair sw, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 2.967 | 2.967 | 2.968 Mbytes +Step Temp E_pair TotEng Econserve Press + 100 1112.9699 -625.76163 -552.24782 -564.38354 462129.66 + 110 1502.8461 -649.55768 -550.29179 -564.45814 463413.45 + 120 1926.4523 -674.71265 -547.46675 -564.53613 486338.88 + 130 1152.6663 -621.47265 -545.33681 -564.37203 514892.19 + 140 1762.244 -659.86941 -543.46979 -564.4985 488159.88 + 150 1767.8665 -657.67179 -540.90079 -564.48386 466721.31 + 160 1075.2874 -610.1281 -539.10328 -564.36709 470151.9 + 170 1697.9313 -649.3684 -537.21676 -564.47208 467953.7 + 180 1856.1197 -657.14338 -534.54309 -564.48754 488372.26 + 190 1346.1107 -621.42432 -532.5111 -564.38065 511750.03 + 200 1919.5266 -657.26587 -530.47743 -564.47797 488684.56 +Loop time of 0.286556 on 4 procs for 100 steps with 512 atoms + +Performance: 30.151 ns/day, 0.796 hours/ns, 348.971 timesteps/s +81.7% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.11093 | 0.139 | 0.16864 | 5.8 | 48.51 +Neigh | 0.0014305 | 0.0014756 | 0.0015156 | 0.1 | 0.51 +Comm | 0.10154 | 0.12374 | 0.16907 | 7.8 | 43.18 +Output | 0.0001862 | 0.00030428 | 0.0006578 | 0.0 | 0.11 +Modify | 0.0038164 | 0.019159 | 0.034146 | 10.8 | 6.69 +Other | | 0.002872 | | | 1.00 + +Nlocal: 128.000 ave 135 max 122 min +Histogram: 1 0 1 0 0 0 1 0 0 1 +Nghost: 759.750 ave 770 max 751 min +Histogram: 1 0 0 1 1 0 0 0 0 1 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 4336.00 ave 4563 max 4128 min +Histogram: 1 0 1 0 0 0 1 0 0 1 + +Total # of neighbors = 17344 +Ave neighs/atom = 33.875000 +Neighbor list builds = 3 +Dangerous builds = 0 + +# Test Vashishta model for In/P + +clear + using 1 OpenMP thread(s) per MPI task +read_restart restart.equil +Reading restart file ... + restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 + restoring atom style atomic from restart + orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) + 1 by 2 by 2 MPI processor grid + pair style sw stores no restart info + 512 atoms + read_restart CPU = 0.001 seconds + +pair_style vashishta +pair_coeff * * InP.vashishta In In In In P P P P +Reading vashishta potential file InP.vashishta with DATE: 2015-10-14 + +thermo_style custom step temp epair etotal econserve press +thermo 10 +fix 1 all nvt temp $t $t 0.1 +fix 1 all nvt temp 1800 $t 0.1 +fix 1 all nvt temp 1800 1800 0.1 +Resetting global fix info from restart file: + fix style: nvt, fix ID: 1 +timestep 1.0e-3 +neighbor 1.0 bin +neigh_modify every 1 delay 10 check yes +run 100 +All restart file global fix info was re-assigned +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 7 + ghost atom cutoff = 7 + binsize = 3.5, bins = 7 7 7 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair vashishta, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 2.988 | 2.988 | 2.988 Mbytes +Step Temp E_pair TotEng Econserve Press + 100 1112.9699 -1497.2988 -1423.785 -1435.9207 355619.19 + 110 1250.545 -1504.5795 -1421.9785 -1435.9786 345188.52 + 120 1360.2275 -1509.3443 -1419.4986 -1435.9801 333306.3 + 130 1066.4516 -1487.9076 -1417.4664 -1435.9076 334465.11 + 140 1481.0477 -1513.0511 -1415.2251 -1435.988 308725.1 + 150 1216.1167 -1493.0774 -1412.7505 -1435.9217 304249.09 + 160 1211.4398 -1490.7459 -1410.728 -1435.9164 288897.09 + 170 1542.2025 -1510.0774 -1408.212 -1435.9608 260104.14 + 180 1302.9041 -1491.7765 -1405.7172 -1435.8971 249514.04 + 190 1332.3326 -1491.5271 -1403.524 -1435.9213 227537.99 + 200 1352.1813 -1490.4513 -1401.1371 -1435.9049 207626.42 +Loop time of 0.14468 on 4 procs for 100 steps with 512 atoms + +Performance: 59.718 ns/day, 0.402 hours/ns, 691.179 timesteps/s +81.2% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.047903 | 0.058669 | 0.086091 | 6.6 | 40.55 +Neigh | 0.0027876 | 0.002852 | 0.0028808 | 0.1 | 1.97 +Comm | 0.034642 | 0.066142 | 0.078599 | 7.1 | 45.72 +Output | 0.00018477 | 0.0049147 | 0.019101 | 11.7 | 3.40 +Modify | 0.0015709 | 0.0022651 | 0.0029545 | 1.4 | 1.57 +Other | | 0.009837 | | | 6.80 + +Nlocal: 128.000 ave 131 max 124 min +Histogram: 1 0 0 0 0 1 0 1 0 1 +Nghost: 1013.25 ave 1025 max 1002 min +Histogram: 1 1 0 0 0 0 0 0 1 1 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 9120.50 ave 9356 max 8868 min +Histogram: 1 0 0 0 1 0 1 0 0 1 + +Total # of neighbors = 36482 +Ave neighs/atom = 71.253906 +Neighbor list builds = 4 +Dangerous builds = 0 + +# Test Tersoff model for B/N/C + +clear + using 1 OpenMP thread(s) per MPI task +read_restart restart.equil +Reading restart file ... + restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 + restoring atom style atomic from restart + orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) + 1 by 2 by 2 MPI processor grid + pair style sw stores no restart info + 512 atoms + read_restart CPU = 0.005 seconds + +variable fac equal 0.6 +change_box all x scale ${fac} y scale ${fac} z scale ${fac} remap +change_box all x scale 0.6 y scale ${fac} z scale ${fac} remap +change_box all x scale 0.6 y scale 0.6 z scale ${fac} remap +change_box all x scale 0.6 y scale 0.6 z scale 0.6 remap +Changing box ... + orthogonal box = (4.3448000 0.0000000 0.0000000) to (17.379200 21.724000 21.724000) + orthogonal box = (4.3448000 4.3448000 0.0000000) to (17.379200 17.379200 21.724000) + orthogonal box = (4.3448000 4.3448000 4.3448000) to (17.379200 17.379200 17.379200) + +pair_style tersoff +pair_coeff * * BNC.tersoff N N N C B B C B +Reading tersoff potential file BNC.tersoff with DATE: 2013-03-21 + +thermo_style custom step temp epair etotal econserve press +thermo 10 +fix 1 all nvt temp $t $t 0.1 +fix 1 all nvt temp 1800 $t 0.1 +fix 1 all nvt temp 1800 1800 0.1 +Resetting global fix info from restart file: + fix style: nvt, fix ID: 1 +timestep 1.0e-3 +neighbor 1.0 bin +neigh_modify every 1 delay 10 check yes +run 100 +All restart file global fix info was re-assigned +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 3.1 + ghost atom cutoff = 3.1 + binsize = 1.55, bins = 9 9 9 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair tersoff, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 2.948 | 2.948 | 2.948 Mbytes +Step Temp E_pair TotEng Econserve Press + 100 1112.9699 -3259.7676 -3186.2538 -3198.3895 1912461.3 + 110 1772.8268 -3301.5479 -3184.4493 -3198.8218 1885295.6 + 120 1169.7287 -3258.74 -3181.4772 -3197.9294 1898705.2 + 130 1308.5623 -3265.1338 -3178.7007 -3197.5922 1894187.5 + 140 1486.0361 -3274.951 -3176.7954 -3197.776 1871927.6 + 150 1419.0362 -3267.7302 -3174.0002 -3197.2296 1925234.6 + 160 1196.6689 -3250.1492 -3171.1069 -3196.7078 1902235.1 + 170 1707.5846 -3281.7658 -3168.9766 -3196.9721 1863047.3 + 180 1337.4358 -3254.9844 -3166.6442 -3196.8222 1880420.9 + 190 1441.8052 -3259.0364 -3163.8023 -3196.3556 1904512.1 + 200 1569.0317 -3265.0089 -3161.3714 -3196.3328 1899462.7 +Loop time of 0.348631 on 4 procs for 100 steps with 512 atoms + +Performance: 24.783 ns/day, 0.968 hours/ns, 286.836 timesteps/s +81.0% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.13281 | 0.15657 | 0.20106 | 6.9 | 44.91 +Neigh | 0.00037527 | 0.00039309 | 0.00040412 | 0.0 | 0.11 +Comm | 0.12177 | 0.16672 | 0.19154 | 6.8 | 47.82 +Output | 0.00019097 | 0.000462 | 0.0012722 | 0.0 | 0.13 +Modify | 0.018353 | 0.020198 | 0.02302 | 1.3 | 5.79 +Other | | 0.004286 | | | 1.23 + +Nlocal: 128.000 ave 132 max 123 min +Histogram: 1 0 0 0 0 1 1 0 0 1 +Nghost: 529.500 ave 533 max 524 min +Histogram: 1 0 0 0 0 0 1 1 0 1 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 3651.00 ave 3783 max 3494 min +Histogram: 1 0 0 0 0 1 1 0 0 1 + +Total # of neighbors = 14604 +Ave neighs/atom = 28.523438 +Neighbor list builds = 1 +Dangerous builds = 0 + +Total wall time: 0:00:01 diff --git a/examples/threebody/log.13Jan21.threebody.g++.1 b/examples/threebody/log.13Jan21.threebody.g++.1 deleted file mode 100644 index 9d84547aa1..0000000000 --- a/examples/threebody/log.13Jan21.threebody.g++.1 +++ /dev/null @@ -1,547 +0,0 @@ -LAMMPS (30 Nov 2020) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) - using 1 OpenMP thread(s) per MPI task -# Simple regression tests for threebody potentials - -# NOTE: These are not intended to represent real materials - -units metal - -atom_style atomic -atom_modify map array -boundary p p p -atom_modify sort 0 0.0 - -# temperature - -variable t equal 1800.0 - -# cubic diamond unit cell - -variable a equal 5.431 -lattice custom $a a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 1.0 basis 0.0 0.0 0.0 basis 0.0 0.5 0.5 basis 0.5 0.0 0.5 basis 0.5 0.5 0.0 basis 0.25 0.25 0.25 basis 0.25 0.75 0.75 basis 0.75 0.25 0.75 basis 0.75 0.75 0.25 -lattice custom 5.431 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 1.0 basis 0.0 0.0 0.0 basis 0.0 0.5 0.5 basis 0.5 0.0 0.5 basis 0.5 0.5 0.0 basis 0.25 0.25 0.25 basis 0.25 0.75 0.75 basis 0.75 0.25 0.75 basis 0.75 0.75 0.25 -Lattice spacing in x,y,z = 5.4310000 5.4310000 5.4310000 - -region myreg block 0 4 0 4 0 4 - -create_box 8 myreg -Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) - 1 by 1 by 1 MPI processor grid -create_atoms 1 region myreg basis 1 1 basis 2 2 basis 3 3 basis 4 4 basis 5 5 basis 6 6 basis 7 7 basis 8 8 -Created 512 atoms - create_atoms CPU = 0.000 seconds - -mass * 28.06 - -velocity all create $t 5287287 loop geom -velocity all create 1800 5287287 loop geom - -# Equilibrate using Stillinger-Weber model for silicon - -pair_style sw -pair_coeff * * Si.sw Si Si Si Si Si Si Si Si -Reading sw potential file Si.sw with DATE: 2007-06-11 - -thermo 10 -fix 1 all nvt temp $t $t 0.1 -fix 1 all nvt temp 1800 $t 0.1 -fix 1 all nvt temp 1800 1800 0.1 -fix_modify 1 energy yes -timestep 1.0e-3 -neighbor 1.0 bin -neigh_modify every 1 delay 10 check yes -run 100 -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 4.77118 - ghost atom cutoff = 4.77118 - binsize = 2.38559, bins = 10 10 10 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair sw, perpetual - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.983 | 2.983 | 2.983 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1800 -2220.3392 0 -2101.4457 12358.626 - 10 1006.0192 -2167.7053 0 -2101.3286 13892.426 - 20 588.26396 -2139.7132 0 -2101.3117 11295.566 - 30 990.55956 -2165.2164 0 -2101.3931 6279.0239 - 40 700.12917 -2144.4279 0 -2101.3427 5594.2388 - 50 523.64239 -2131.7796 0 -2101.3122 6013.0994 - 60 989.47092 -2161.3716 0 -2101.3839 5819.2688 - 70 877.27433 -2152.4432 0 -2101.3461 9116.6569 - 80 800.80221 -2146.1371 0 -2101.313 11995.66 - 90 1293.9689 -2176.9021 0 -2101.3848 11692.45 - 100 1112.9699 -2162.7259 0 -2101.3478 12263.758 -Loop time of 0.092666 on 1 procs for 100 steps with 512 atoms - -Performance: 93.238 ns/day, 0.257 hours/ns, 1079.144 timesteps/s -99.1% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.089633 | 0.089633 | 0.089633 | 0.0 | 96.73 -Neigh | 0.001474 | 0.001474 | 0.001474 | 0.0 | 1.59 -Comm | 0.00041 | 0.00041 | 0.00041 | 0.0 | 0.44 -Output | 0.000153 | 0.000153 | 0.000153 | 0.0 | 0.17 -Modify | 0.000782 | 0.000782 | 0.000782 | 0.0 | 0.84 -Other | | 0.000214 | | | 0.23 - -Nlocal: 512.000 ave 512 max 512 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1017.00 ave 1017 max 1017 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 13988.0 ave 13988 max 13988 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 13988 -Ave neighs/atom = 27.320312 -Neighbor list builds = 2 -Dangerous builds = 0 - -write_restart restart.equil -System init for write_restart ... - -# Test Stillinger-Weber model for Cd/Te/Zn/Se/Hg/S - -clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) - using 1 OpenMP thread(s) per MPI task -read_restart restart.equil -Reading restart file ... - restart file = 30 Nov 2020, LAMMPS = 30 Nov 2020 - restoring atom style atomic from restart - orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) - 1 by 1 by 1 MPI processor grid - pair style sw stores no restart info - 512 atoms - read_restart CPU = 0.002 seconds - -pair_style sw -pair_coeff * * CdTeZnSeHgS0.sw Cd Zn Hg Cd Te S Se Te -Reading sw potential file CdTeZnSeHgS0.sw with DATE: 2013-08-09 - -thermo 10 -fix 1 all nvt temp $t $t 0.1 -fix 1 all nvt temp 1800 $t 0.1 -fix 1 all nvt temp 1800 1800 0.1 -Resetting global fix info from restart file: - fix style: nvt, fix ID: 1 -fix_modify 1 energy yes -timestep 1.0e-3 -neighbor 1.0 bin -neigh_modify every 1 delay 10 check yes -run 100 -All restart file global fix info was re-assigned -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 5.6320004 - ghost atom cutoff = 5.6320004 - binsize = 2.8160002, bins = 8 8 8 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair sw, perpetual - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 3.001 | 3.001 | 3.001 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 1112.9699 -625.76163 0 -564.38354 462129.66 - 110 1502.8461 -649.55768 0 -564.45814 463413.45 - 120 1926.4523 -674.71265 0 -564.53612 486338.88 - 130 1152.6663 -621.47264 0 -564.37203 514892.2 - 140 1762.244 -659.86941 0 -564.4985 488159.88 - 150 1767.8665 -657.67178 0 -564.48386 466721.31 - 160 1075.2874 -610.12809 0 -564.36709 470151.9 - 170 1697.9313 -649.3684 0 -564.47207 467953.71 - 180 1856.1197 -657.14338 0 -564.48754 488372.27 - 190 1346.1107 -621.42431 0 -564.38065 511750.04 - 200 1919.5266 -657.26587 0 -564.47797 488684.56 -Loop time of 0.289193 on 1 procs for 100 steps with 512 atoms - -Performance: 29.876 ns/day, 0.803 hours/ns, 345.790 timesteps/s -98.9% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.28463 | 0.28463 | 0.28463 | 0.0 | 98.42 -Neigh | 0.002821 | 0.002821 | 0.002821 | 0.0 | 0.98 -Comm | 0.000605 | 0.000605 | 0.000605 | 0.0 | 0.21 -Output | 0.000176 | 0.000176 | 0.000176 | 0.0 | 0.06 -Modify | 0.000769 | 0.000769 | 0.000769 | 0.0 | 0.27 -Other | | 0.000188 | | | 0.07 - -Nlocal: 512.000 ave 512 max 512 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1428.00 ave 1428 max 1428 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 17344.0 ave 17344 max 17344 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 17344 -Ave neighs/atom = 33.875000 -Neighbor list builds = 3 -Dangerous builds = 0 - -# Test Vashishta model for In/P - -clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) - using 1 OpenMP thread(s) per MPI task -read_restart restart.equil -Reading restart file ... - restart file = 30 Nov 2020, LAMMPS = 30 Nov 2020 - restoring atom style atomic from restart - orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) - 1 by 1 by 1 MPI processor grid - pair style sw stores no restart info - 512 atoms - read_restart CPU = 0.001 seconds - -pair_style vashishta -pair_coeff * * InP.vashishta In In In In P P P P -Reading vashishta potential file InP.vashishta with DATE: 2015-10-14 - -thermo 10 -fix 1 all nvt temp $t $t 0.1 -fix 1 all nvt temp 1800 $t 0.1 -fix 1 all nvt temp 1800 1800 0.1 -Resetting global fix info from restart file: - fix style: nvt, fix ID: 1 -fix_modify 1 energy yes -timestep 1.0e-3 -neighbor 1.0 bin -neigh_modify every 1 delay 10 check yes -run 100 -All restart file global fix info was re-assigned -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 7 - ghost atom cutoff = 7 - binsize = 3.5, bins = 7 7 7 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair vashishta, perpetual - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 3.025 | 3.025 | 3.025 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 1112.9699 -1497.2988 0 -1435.9207 355619.19 - 110 1250.545 -1504.5795 0 -1435.9786 345188.52 - 120 1360.2275 -1509.3443 0 -1435.9801 333306.3 - 130 1066.4516 -1487.9076 0 -1435.9076 334465.11 - 140 1481.0477 -1513.0511 0 -1435.988 308725.1 - 150 1216.1167 -1493.0774 0 -1435.9217 304249.09 - 160 1211.4398 -1490.7459 0 -1435.9164 288897.09 - 170 1542.2025 -1510.0774 0 -1435.9608 260104.14 - 180 1302.9041 -1491.7765 0 -1435.8971 249514.04 - 190 1332.3326 -1491.5271 0 -1435.9213 227537.99 - 200 1352.1813 -1490.4513 0 -1435.9049 207626.42 -Loop time of 0.126684 on 1 procs for 100 steps with 512 atoms - -Performance: 68.201 ns/day, 0.352 hours/ns, 789.366 timesteps/s -99.3% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.11981 | 0.11981 | 0.11981 | 0.0 | 94.57 -Neigh | 0.004903 | 0.004903 | 0.004903 | 0.0 | 3.87 -Comm | 0.000846 | 0.000846 | 0.000846 | 0.0 | 0.67 -Output | 0.000145 | 0.000145 | 0.000145 | 0.0 | 0.11 -Modify | 0.000772 | 0.000772 | 0.000772 | 0.0 | 0.61 -Other | | 0.000207 | | | 0.16 - -Nlocal: 512.000 ave 512 max 512 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1838.00 ave 1838 max 1838 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 36482.0 ave 36482 max 36482 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 36482 -Ave neighs/atom = 71.253906 -Neighbor list builds = 4 -Dangerous builds = 0 - -# Test Tersoff model for B/N/C - -clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) - using 1 OpenMP thread(s) per MPI task -read_restart restart.equil -Reading restart file ... - restart file = 30 Nov 2020, LAMMPS = 30 Nov 2020 - restoring atom style atomic from restart - orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) - 1 by 1 by 1 MPI processor grid - pair style sw stores no restart info - 512 atoms - read_restart CPU = 0.001 seconds - -variable fac equal 0.6 -change_box all x scale ${fac} y scale ${fac} z scale ${fac} remap -change_box all x scale 0.6 y scale ${fac} z scale ${fac} remap -change_box all x scale 0.6 y scale 0.6 z scale ${fac} remap -change_box all x scale 0.6 y scale 0.6 z scale 0.6 remap -Changing box ... - orthogonal box = (4.3448000 0.0000000 0.0000000) to (17.379200 21.724000 21.724000) - orthogonal box = (4.3448000 4.3448000 0.0000000) to (17.379200 17.379200 21.724000) - orthogonal box = (4.3448000 4.3448000 4.3448000) to (17.379200 17.379200 17.379200) - -pair_style tersoff -pair_coeff * * BNC.tersoff N N N C B B C B -Reading tersoff potential file BNC.tersoff with DATE: 2013-03-21 - -thermo 10 -fix 1 all nvt temp $t $t 0.1 -fix 1 all nvt temp 1800 $t 0.1 -fix 1 all nvt temp 1800 1800 0.1 -Resetting global fix info from restart file: - fix style: nvt, fix ID: 1 -fix_modify 1 energy yes -timestep 1.0e-3 -neighbor 1.0 bin -neigh_modify every 1 delay 10 check yes -run 100 -All restart file global fix info was re-assigned -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 3.1 - ghost atom cutoff = 3.1 - binsize = 1.55, bins = 9 9 9 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair tersoff, perpetual - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.982 | 2.982 | 2.982 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 1112.9699 -3259.7676 0 -3198.3895 1912461.3 - 110 1772.8268 -3301.5479 0 -3198.8218 1885295.6 - 120 1169.7287 -3258.74 0 -3197.9294 1898705.2 - 130 1308.5623 -3265.1338 0 -3197.5922 1894187.5 - 140 1486.0361 -3274.951 0 -3197.776 1871927.6 - 150 1419.0362 -3267.7302 0 -3197.2296 1925234.6 - 160 1196.6689 -3250.1492 0 -3196.7078 1902235.1 - 170 1707.5846 -3281.7658 0 -3196.9721 1863047.3 - 180 1337.4358 -3254.9844 0 -3196.8222 1880420.9 - 190 1441.8052 -3259.0364 0 -3196.3556 1904512.1 - 200 1569.0317 -3265.0089 0 -3196.3328 1899462.7 -Loop time of 0.114312 on 1 procs for 100 steps with 512 atoms - -Performance: 75.583 ns/day, 0.318 hours/ns, 874.799 timesteps/s -99.3% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.1121 | 0.1121 | 0.1121 | 0.0 | 98.06 -Neigh | 0.000773 | 0.000773 | 0.000773 | 0.0 | 0.68 -Comm | 0.000415 | 0.000415 | 0.000415 | 0.0 | 0.36 -Output | 0.000136 | 0.000136 | 0.000136 | 0.0 | 0.12 -Modify | 0.000703 | 0.000703 | 0.000703 | 0.0 | 0.61 -Other | | 0.000186 | | | 0.16 - -Nlocal: 512.000 ave 512 max 512 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1028.00 ave 1028 max 1028 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 14604.0 ave 14604 max 14604 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 14604 -Ave neighs/atom = 28.523438 -Neighbor list builds = 1 -Dangerous builds = 0 - -# Test Tersoff/Mod model for Si - -clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) - using 1 OpenMP thread(s) per MPI task -read_restart restart.equil -Reading restart file ... - restart file = 30 Nov 2020, LAMMPS = 30 Nov 2020 - restoring atom style atomic from restart - orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) - 1 by 1 by 1 MPI processor grid - pair style sw stores no restart info - 512 atoms - read_restart CPU = 0.001 seconds - -pair_style tersoff/mod -pair_coeff * * Si.tersoff.mod Si Si Si Si Si Si Si Si -Reading tersoff/mod potential file Si.tersoff.mod with DATE: 2013-07-26 - -thermo 10 -fix 1 all nvt temp $t $t 0.1 -fix 1 all nvt temp 1800 $t 0.1 -fix 1 all nvt temp 1800 1800 0.1 -Resetting global fix info from restart file: - fix style: nvt, fix ID: 1 -fix_modify 1 energy yes -timestep 1.0e-3 -neighbor 1.0 bin -neigh_modify every 1 delay 10 check yes -run 100 -All restart file global fix info was re-assigned -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 4.3 - ghost atom cutoff = 4.3 - binsize = 2.15, bins = 11 11 11 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair tersoff/mod, perpetual - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.986 | 2.986 | 2.986 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 1112.9699 -2309.6047 0 -2248.2266 17662.891 - 110 835.77436 -2289.6119 0 -2248.1918 19964.211 - 120 1067.0735 -2303.0587 0 -2248.2414 13767.101 - 130 957.60664 -2293.7047 0 -2248.2139 14850.338 - 140 865.12471 -2285.7774 0 -2248.1971 17101.553 - 150 1104.7368 -2299.5468 0 -2248.2286 13031.988 - 160 1077.1682 -2295.3841 0 -2248.2227 13615.019 - 170 843.8591 -2277.9713 0 -2248.1911 18966.532 - 180 1008.7412 -2286.922 0 -2248.2075 17275.649 - 190 1237.9346 -2299.5487 0 -2248.2305 14334.006 - 200 1060.2161 -2285.3352 0 -2248.1952 18999.834 -Loop time of 0.12412 on 1 procs for 100 steps with 512 atoms - -Performance: 69.610 ns/day, 0.345 hours/ns, 805.672 timesteps/s -99.2% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.12079 | 0.12079 | 0.12079 | 0.0 | 97.32 -Neigh | 0.001821 | 0.001821 | 0.001821 | 0.0 | 1.47 -Comm | 0.000407 | 0.000407 | 0.000407 | 0.0 | 0.33 -Output | 0.000159 | 0.000159 | 0.000159 | 0.0 | 0.13 -Modify | 0.000736 | 0.000736 | 0.000736 | 0.0 | 0.59 -Other | | 0.000203 | | | 0.16 - -Nlocal: 512.000 ave 512 max 512 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1007.00 ave 1007 max 1007 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 8884.00 ave 8884 max 8884 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 8884 -Ave neighs/atom = 17.351562 -Neighbor list builds = 3 -Dangerous builds = 0 - -# Test Tersoff/Mod/C model for Si - -clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) - using 1 OpenMP thread(s) per MPI task -read_restart restart.equil -Reading restart file ... - restart file = 30 Nov 2020, LAMMPS = 30 Nov 2020 - restoring atom style atomic from restart - orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) - 1 by 1 by 1 MPI processor grid - pair style sw stores no restart info - 512 atoms - read_restart CPU = 0.001 seconds -newton on on -pair_style tersoff/mod/c -pair_coeff * * Si.tersoff.modc Si Si Si Si Si Si Si Si -Reading tersoff/mod/c potential file Si.tersoff.modc with DATE: 2016-11-09 - -thermo 10 -fix 1 all nvt temp $t $t 0.1 -fix 1 all nvt temp 1800 $t 0.1 -fix 1 all nvt temp 1800 1800 0.1 -Resetting global fix info from restart file: - fix style: nvt, fix ID: 1 -fix_modify 1 energy yes -timestep 1.0e-3 -neighbor 1.0 bin -neigh_modify every 1 delay 10 check yes -run 100 -All restart file global fix info was re-assigned -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 4.205694 - ghost atom cutoff = 4.205694 - binsize = 2.102847, bins = 11 11 11 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair tersoff/mod/c, perpetual - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.980 | 2.980 | 2.980 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 1112.9699 -2309.1331 0 -2247.755 20346.718 - 110 831.93715 -2288.8853 0 -2247.7187 21758.195 - 120 1077.6698 -2303.2846 0 -2247.7693 16036.053 - 130 972.43247 -2294.1847 0 -2247.7467 16614.835 - 140 815.76148 -2282.0495 0 -2247.7194 18310.116 - 150 1072.7096 -2297.0491 0 -2247.7574 13896.767 - 160 1061.8824 -2294.0028 0 -2247.7522 13663.179 - 170 787.17244 -2273.8946 0 -2247.7175 18586.606 - 180 932.5662 -2281.6828 0 -2247.7315 18154.167 - 190 1205.7299 -2297.2769 0 -2247.7608 14504.136 - 200 1022.5285 -2282.7039 0 -2247.7245 18710.495 -Loop time of 0.12973 on 1 procs for 100 steps with 512 atoms - -Performance: 66.600 ns/day, 0.360 hours/ns, 770.832 timesteps/s -99.3% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.12643 | 0.12643 | 0.12643 | 0.0 | 97.45 -Neigh | 0.001798 | 0.001798 | 0.001798 | 0.0 | 1.39 -Comm | 0.000421 | 0.000421 | 0.000421 | 0.0 | 0.32 -Output | 0.00016 | 0.00016 | 0.00016 | 0.0 | 0.12 -Modify | 0.000733 | 0.000733 | 0.000733 | 0.0 | 0.57 -Other | | 0.000192 | | | 0.15 - -Nlocal: 512.000 ave 512 max 512 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 958.000 ave 958 max 958 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 8416.00 ave 8416 max 8416 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 8416 -Ave neighs/atom = 16.437500 -Neighbor list builds = 3 -Dangerous builds = 0 - -Total wall time: 0:00:00 diff --git a/examples/threebody/log.13Jan21.threebody.g++.4 b/examples/threebody/log.13Jan21.threebody.g++.4 deleted file mode 100644 index 621c1cab39..0000000000 --- a/examples/threebody/log.13Jan21.threebody.g++.4 +++ /dev/null @@ -1,547 +0,0 @@ -LAMMPS (30 Nov 2020) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) - using 1 OpenMP thread(s) per MPI task -# Simple regression tests for threebody potentials - -# NOTE: These are not intended to represent real materials - -units metal - -atom_style atomic -atom_modify map array -boundary p p p -atom_modify sort 0 0.0 - -# temperature - -variable t equal 1800.0 - -# cubic diamond unit cell - -variable a equal 5.431 -lattice custom $a a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 1.0 basis 0.0 0.0 0.0 basis 0.0 0.5 0.5 basis 0.5 0.0 0.5 basis 0.5 0.5 0.0 basis 0.25 0.25 0.25 basis 0.25 0.75 0.75 basis 0.75 0.25 0.75 basis 0.75 0.75 0.25 -lattice custom 5.431 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 1.0 basis 0.0 0.0 0.0 basis 0.0 0.5 0.5 basis 0.5 0.0 0.5 basis 0.5 0.5 0.0 basis 0.25 0.25 0.25 basis 0.25 0.75 0.75 basis 0.75 0.25 0.75 basis 0.75 0.75 0.25 -Lattice spacing in x,y,z = 5.4310000 5.4310000 5.4310000 - -region myreg block 0 4 0 4 0 4 - -create_box 8 myreg -Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) - 1 by 2 by 2 MPI processor grid -create_atoms 1 region myreg basis 1 1 basis 2 2 basis 3 3 basis 4 4 basis 5 5 basis 6 6 basis 7 7 basis 8 8 -Created 512 atoms - create_atoms CPU = 0.001 seconds - -mass * 28.06 - -velocity all create $t 5287287 loop geom -velocity all create 1800 5287287 loop geom - -# Equilibrate using Stillinger-Weber model for silicon - -pair_style sw -pair_coeff * * Si.sw Si Si Si Si Si Si Si Si -Reading sw potential file Si.sw with DATE: 2007-06-11 - -thermo 10 -fix 1 all nvt temp $t $t 0.1 -fix 1 all nvt temp 1800 $t 0.1 -fix 1 all nvt temp 1800 1800 0.1 -fix_modify 1 energy yes -timestep 1.0e-3 -neighbor 1.0 bin -neigh_modify every 1 delay 10 check yes -run 100 -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 4.77118 - ghost atom cutoff = 4.77118 - binsize = 2.38559, bins = 10 10 10 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair sw, perpetual - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.958 | 2.958 | 2.958 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1800 -2220.3392 0 -2101.4457 12358.626 - 10 1006.0192 -2167.7053 0 -2101.3286 13892.426 - 20 588.26396 -2139.7132 0 -2101.3117 11295.566 - 30 990.55956 -2165.2164 0 -2101.3931 6279.0239 - 40 700.12917 -2144.4279 0 -2101.3427 5594.2388 - 50 523.64239 -2131.7796 0 -2101.3122 6013.0994 - 60 989.47092 -2161.3716 0 -2101.3839 5819.2688 - 70 877.27433 -2152.4432 0 -2101.3461 9116.6569 - 80 800.80221 -2146.1371 0 -2101.313 11995.66 - 90 1293.9689 -2176.9021 0 -2101.3848 11692.45 - 100 1112.9699 -2162.7259 0 -2101.3478 12263.758 -Loop time of 0.0284905 on 4 procs for 100 steps with 512 atoms - -Performance: 303.259 ns/day, 0.079 hours/ns, 3509.942 timesteps/s -99.0% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.022257 | 0.023383 | 0.025192 | 0.7 | 82.07 -Neigh | 0.00036 | 0.00037475 | 0.000387 | 0.0 | 1.32 -Comm | 0.002084 | 0.0039075 | 0.005034 | 1.8 | 13.72 -Output | 9.9e-05 | 0.00011525 | 0.00016 | 0.0 | 0.40 -Modify | 0.000428 | 0.00043675 | 0.000443 | 0.0 | 1.53 -Other | | 0.0002728 | | | 0.96 - -Nlocal: 128.000 ave 132 max 125 min -Histogram: 1 1 0 0 0 1 0 0 0 1 -Nghost: 525.000 ave 528 max 521 min -Histogram: 1 0 0 0 1 0 0 0 1 1 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -FullNghs: 3497.00 ave 3619 max 3397 min -Histogram: 1 1 0 0 0 0 1 0 0 1 - -Total # of neighbors = 13988 -Ave neighs/atom = 27.320312 -Neighbor list builds = 2 -Dangerous builds = 0 - -write_restart restart.equil -System init for write_restart ... - -# Test Stillinger-Weber model for Cd/Te/Zn/Se/Hg/S - -clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) - using 1 OpenMP thread(s) per MPI task -read_restart restart.equil -Reading restart file ... - restart file = 30 Nov 2020, LAMMPS = 30 Nov 2020 - restoring atom style atomic from restart - orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) - 1 by 2 by 2 MPI processor grid - pair style sw stores no restart info - 512 atoms - read_restart CPU = 0.000 seconds - -pair_style sw -pair_coeff * * CdTeZnSeHgS0.sw Cd Zn Hg Cd Te S Se Te -Reading sw potential file CdTeZnSeHgS0.sw with DATE: 2013-08-09 - -thermo 10 -fix 1 all nvt temp $t $t 0.1 -fix 1 all nvt temp 1800 $t 0.1 -fix 1 all nvt temp 1800 1800 0.1 -Resetting global fix info from restart file: - fix style: nvt, fix ID: 1 -fix_modify 1 energy yes -timestep 1.0e-3 -neighbor 1.0 bin -neigh_modify every 1 delay 10 check yes -run 100 -All restart file global fix info was re-assigned -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 5.6320004 - ghost atom cutoff = 5.6320004 - binsize = 2.8160002, bins = 8 8 8 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair sw, perpetual - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.967 | 2.967 | 2.968 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 1112.9699 -625.76163 0 -564.38354 462129.66 - 110 1502.8461 -649.55768 0 -564.45814 463413.45 - 120 1926.4523 -674.71265 0 -564.53613 486338.88 - 130 1152.6663 -621.47265 0 -564.37203 514892.19 - 140 1762.244 -659.86941 0 -564.4985 488159.88 - 150 1767.8665 -657.67179 0 -564.48386 466721.31 - 160 1075.2874 -610.1281 0 -564.36709 470151.9 - 170 1697.9313 -649.3684 0 -564.47208 467953.7 - 180 1856.1197 -657.14338 0 -564.48754 488372.26 - 190 1346.1107 -621.42432 0 -564.38065 511750.03 - 200 1919.5266 -657.26587 0 -564.47797 488684.56 -Loop time of 0.084576 on 4 procs for 100 steps with 512 atoms - -Performance: 102.157 ns/day, 0.235 hours/ns, 1182.369 timesteps/s -99.2% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.072089 | 0.074912 | 0.076672 | 0.7 | 88.57 -Neigh | 0.000745 | 0.0008125 | 0.000883 | 0.0 | 0.96 -Comm | 0.006054 | 0.0077975 | 0.010598 | 2.1 | 9.22 -Output | 0.000129 | 0.00015525 | 0.000219 | 0.0 | 0.18 -Modify | 0.000523 | 0.000578 | 0.000641 | 0.0 | 0.68 -Other | | 0.0003213 | | | 0.38 - -Nlocal: 128.000 ave 135 max 122 min -Histogram: 1 0 1 0 0 0 1 0 0 1 -Nghost: 759.750 ave 770 max 751 min -Histogram: 1 0 0 1 1 0 0 0 0 1 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -FullNghs: 4336.00 ave 4563 max 4128 min -Histogram: 1 0 1 0 0 0 1 0 0 1 - -Total # of neighbors = 17344 -Ave neighs/atom = 33.875000 -Neighbor list builds = 3 -Dangerous builds = 0 - -# Test Vashishta model for In/P - -clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) - using 1 OpenMP thread(s) per MPI task -read_restart restart.equil -Reading restart file ... - restart file = 30 Nov 2020, LAMMPS = 30 Nov 2020 - restoring atom style atomic from restart - orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) - 1 by 2 by 2 MPI processor grid - pair style sw stores no restart info - 512 atoms - read_restart CPU = 0.001 seconds - -pair_style vashishta -pair_coeff * * InP.vashishta In In In In P P P P -Reading vashishta potential file InP.vashishta with DATE: 2015-10-14 - -thermo 10 -fix 1 all nvt temp $t $t 0.1 -fix 1 all nvt temp 1800 $t 0.1 -fix 1 all nvt temp 1800 1800 0.1 -Resetting global fix info from restart file: - fix style: nvt, fix ID: 1 -fix_modify 1 energy yes -timestep 1.0e-3 -neighbor 1.0 bin -neigh_modify every 1 delay 10 check yes -run 100 -All restart file global fix info was re-assigned -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 7 - ghost atom cutoff = 7 - binsize = 3.5, bins = 7 7 7 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair vashishta, perpetual - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.988 | 2.988 | 2.988 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 1112.9699 -1497.2988 0 -1435.9207 355619.19 - 110 1250.545 -1504.5795 0 -1435.9786 345188.52 - 120 1360.2275 -1509.3443 0 -1435.9801 333306.3 - 130 1066.4516 -1487.9076 0 -1435.9076 334465.11 - 140 1481.0477 -1513.0511 0 -1435.988 308725.1 - 150 1216.1167 -1493.0774 0 -1435.9217 304249.09 - 160 1211.4398 -1490.7459 0 -1435.9164 288897.09 - 170 1542.2025 -1510.0774 0 -1435.9608 260104.14 - 180 1302.9041 -1491.7765 0 -1435.8971 249514.04 - 190 1332.3326 -1491.5271 0 -1435.9213 227537.99 - 200 1352.1813 -1490.4513 0 -1435.9049 207626.42 -Loop time of 0.0404882 on 4 procs for 100 steps with 512 atoms - -Performance: 213.395 ns/day, 0.112 hours/ns, 2469.852 timesteps/s -99.1% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.032713 | 0.033094 | 0.033544 | 0.2 | 81.74 -Neigh | 0.001251 | 0.0012875 | 0.001308 | 0.1 | 3.18 -Comm | 0.004788 | 0.005204 | 0.00557 | 0.4 | 12.85 -Output | 0.000123 | 0.0001385 | 0.000182 | 0.0 | 0.34 -Modify | 0.000492 | 0.00050725 | 0.000533 | 0.0 | 1.25 -Other | | 0.0002565 | | | 0.63 - -Nlocal: 128.000 ave 131 max 124 min -Histogram: 1 0 0 0 0 1 0 1 0 1 -Nghost: 1013.25 ave 1025 max 1002 min -Histogram: 1 1 0 0 0 0 0 0 1 1 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -FullNghs: 9120.50 ave 9356 max 8868 min -Histogram: 1 0 0 0 1 0 1 0 0 1 - -Total # of neighbors = 36482 -Ave neighs/atom = 71.253906 -Neighbor list builds = 4 -Dangerous builds = 0 - -# Test Tersoff model for B/N/C - -clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) - using 1 OpenMP thread(s) per MPI task -read_restart restart.equil -Reading restart file ... - restart file = 30 Nov 2020, LAMMPS = 30 Nov 2020 - restoring atom style atomic from restart - orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) - 1 by 2 by 2 MPI processor grid - pair style sw stores no restart info - 512 atoms - read_restart CPU = 0.001 seconds - -variable fac equal 0.6 -change_box all x scale ${fac} y scale ${fac} z scale ${fac} remap -change_box all x scale 0.6 y scale ${fac} z scale ${fac} remap -change_box all x scale 0.6 y scale 0.6 z scale ${fac} remap -change_box all x scale 0.6 y scale 0.6 z scale 0.6 remap -Changing box ... - orthogonal box = (4.3448000 0.0000000 0.0000000) to (17.379200 21.724000 21.724000) - orthogonal box = (4.3448000 4.3448000 0.0000000) to (17.379200 17.379200 21.724000) - orthogonal box = (4.3448000 4.3448000 4.3448000) to (17.379200 17.379200 17.379200) - -pair_style tersoff -pair_coeff * * BNC.tersoff N N N C B B C B -Reading tersoff potential file BNC.tersoff with DATE: 2013-03-21 - -thermo 10 -fix 1 all nvt temp $t $t 0.1 -fix 1 all nvt temp 1800 $t 0.1 -fix 1 all nvt temp 1800 1800 0.1 -Resetting global fix info from restart file: - fix style: nvt, fix ID: 1 -fix_modify 1 energy yes -timestep 1.0e-3 -neighbor 1.0 bin -neigh_modify every 1 delay 10 check yes -run 100 -All restart file global fix info was re-assigned -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 3.1 - ghost atom cutoff = 3.1 - binsize = 1.55, bins = 9 9 9 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair tersoff, perpetual - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.948 | 2.948 | 2.948 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 1112.9699 -3259.7676 0 -3198.3895 1912461.3 - 110 1772.8268 -3301.5479 0 -3198.8218 1885295.6 - 120 1169.7287 -3258.74 0 -3197.9294 1898705.2 - 130 1308.5623 -3265.1338 0 -3197.5922 1894187.5 - 140 1486.0361 -3274.951 0 -3197.776 1871927.6 - 150 1419.0362 -3267.7302 0 -3197.2296 1925234.6 - 160 1196.6689 -3250.1492 0 -3196.7078 1902235.1 - 170 1707.5846 -3281.7658 0 -3196.9721 1863047.3 - 180 1337.4358 -3254.9844 0 -3196.8222 1880420.9 - 190 1441.8052 -3259.0364 0 -3196.3556 1904512.1 - 200 1569.0317 -3265.0089 0 -3196.3328 1899462.7 -Loop time of 0.03452 on 4 procs for 100 steps with 512 atoms - -Performance: 250.290 ns/day, 0.096 hours/ns, 2896.871 timesteps/s -99.3% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.029269 | 0.029729 | 0.030688 | 0.3 | 86.12 -Neigh | 0.000203 | 0.00023375 | 0.000271 | 0.0 | 0.68 -Comm | 0.00275 | 0.0036492 | 0.004132 | 0.9 | 10.57 -Output | 0.000104 | 0.000121 | 0.000165 | 0.0 | 0.35 -Modify | 0.000456 | 0.0004605 | 0.000463 | 0.0 | 1.33 -Other | | 0.000326 | | | 0.94 - -Nlocal: 128.000 ave 132 max 123 min -Histogram: 1 0 0 0 0 1 1 0 0 1 -Nghost: 529.500 ave 533 max 524 min -Histogram: 1 0 0 0 0 0 1 1 0 1 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -FullNghs: 3651.00 ave 3783 max 3494 min -Histogram: 1 0 0 0 0 1 1 0 0 1 - -Total # of neighbors = 14604 -Ave neighs/atom = 28.523438 -Neighbor list builds = 1 -Dangerous builds = 0 - -# Test Tersoff/Mod model for Si - -clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) - using 1 OpenMP thread(s) per MPI task -read_restart restart.equil -Reading restart file ... - restart file = 30 Nov 2020, LAMMPS = 30 Nov 2020 - restoring atom style atomic from restart - orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) - 1 by 2 by 2 MPI processor grid - pair style sw stores no restart info - 512 atoms - read_restart CPU = 0.001 seconds - -pair_style tersoff/mod -pair_coeff * * Si.tersoff.mod Si Si Si Si Si Si Si Si -Reading tersoff/mod potential file Si.tersoff.mod with DATE: 2013-07-26 - -thermo 10 -fix 1 all nvt temp $t $t 0.1 -fix 1 all nvt temp 1800 $t 0.1 -fix 1 all nvt temp 1800 1800 0.1 -Resetting global fix info from restart file: - fix style: nvt, fix ID: 1 -fix_modify 1 energy yes -timestep 1.0e-3 -neighbor 1.0 bin -neigh_modify every 1 delay 10 check yes -run 100 -All restart file global fix info was re-assigned -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 4.3 - ghost atom cutoff = 4.3 - binsize = 2.15, bins = 11 11 11 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair tersoff/mod, perpetual - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.950 | 2.950 | 2.950 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 1112.9699 -2309.6047 0 -2248.2266 17662.891 - 110 835.77436 -2289.6119 0 -2248.1918 19964.211 - 120 1067.0735 -2303.0587 0 -2248.2414 13767.101 - 130 957.60664 -2293.7047 0 -2248.2139 14850.338 - 140 865.12471 -2285.7774 0 -2248.1971 17101.553 - 150 1104.7368 -2299.5468 0 -2248.2286 13031.988 - 160 1077.1682 -2295.3841 0 -2248.2227 13615.019 - 170 843.8591 -2277.9713 0 -2248.1911 18966.532 - 180 1008.7412 -2286.922 0 -2248.2075 17275.649 - 190 1237.9346 -2299.5487 0 -2248.2305 14334.006 - 200 1060.2161 -2285.3352 0 -2248.1952 18999.834 -Loop time of 0.043388 on 4 procs for 100 steps with 512 atoms - -Performance: 199.133 ns/day, 0.121 hours/ns, 2304.785 timesteps/s -98.9% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.033874 | 0.036197 | 0.037433 | 0.7 | 83.43 -Neigh | 0.000538 | 0.00055575 | 0.000575 | 0.0 | 1.28 -Comm | 0.004381 | 0.0055505 | 0.007783 | 1.8 | 12.79 -Output | 0.000141 | 0.0001635 | 0.000228 | 0.0 | 0.38 -Modify | 0.000532 | 0.000615 | 0.000692 | 0.0 | 1.42 -Other | | 0.000306 | | | 0.71 - -Nlocal: 128.000 ave 135 max 121 min -Histogram: 1 0 0 0 1 1 0 0 0 1 -Nghost: 515.000 ave 518 max 508 min -Histogram: 1 0 0 0 0 0 0 0 1 2 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -FullNghs: 2221.00 ave 2328 max 2103 min -Histogram: 1 0 0 0 1 0 1 0 0 1 - -Total # of neighbors = 8884 -Ave neighs/atom = 17.351562 -Neighbor list builds = 3 -Dangerous builds = 0 - -# Test Tersoff/Mod/C model for Si - -clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) - using 1 OpenMP thread(s) per MPI task -read_restart restart.equil -Reading restart file ... - restart file = 30 Nov 2020, LAMMPS = 30 Nov 2020 - restoring atom style atomic from restart - orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) - 1 by 2 by 2 MPI processor grid - pair style sw stores no restart info - 512 atoms - read_restart CPU = 0.001 seconds -newton on on -pair_style tersoff/mod/c -pair_coeff * * Si.tersoff.modc Si Si Si Si Si Si Si Si -Reading tersoff/mod/c potential file Si.tersoff.modc with DATE: 2016-11-09 - -thermo 10 -fix 1 all nvt temp $t $t 0.1 -fix 1 all nvt temp 1800 $t 0.1 -fix 1 all nvt temp 1800 1800 0.1 -Resetting global fix info from restart file: - fix style: nvt, fix ID: 1 -fix_modify 1 energy yes -timestep 1.0e-3 -neighbor 1.0 bin -neigh_modify every 1 delay 10 check yes -run 100 -All restart file global fix info was re-assigned -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 4.205694 - ghost atom cutoff = 4.205694 - binsize = 2.102847, bins = 11 11 11 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair tersoff/mod/c, perpetual - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.950 | 2.950 | 2.950 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 1112.9699 -2309.1331 0 -2247.755 20346.718 - 110 831.93715 -2288.8853 0 -2247.7187 21758.195 - 120 1077.6698 -2303.2846 0 -2247.7693 16036.053 - 130 972.43247 -2294.1847 0 -2247.7467 16614.835 - 140 815.76148 -2282.0495 0 -2247.7194 18310.116 - 150 1072.7096 -2297.0491 0 -2247.7574 13896.767 - 160 1061.8824 -2294.0028 0 -2247.7522 13663.179 - 170 787.17244 -2273.8946 0 -2247.7175 18586.606 - 180 932.5662 -2281.6828 0 -2247.7315 18154.167 - 190 1205.7299 -2297.2769 0 -2247.7608 14504.136 - 200 1022.5285 -2282.7039 0 -2247.7245 18710.495 -Loop time of 0.0526065 on 4 procs for 100 steps with 512 atoms - -Performance: 164.238 ns/day, 0.146 hours/ns, 1900.906 timesteps/s -98.9% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.044962 | 0.045875 | 0.046737 | 0.3 | 87.20 -Neigh | 0.000603 | 0.00062075 | 0.000646 | 0.0 | 1.18 -Comm | 0.003882 | 0.0047085 | 0.005598 | 1.0 | 8.95 -Output | 0.000159 | 0.0001995 | 0.000321 | 0.0 | 0.38 -Modify | 0.000767 | 0.0007775 | 0.000792 | 0.0 | 1.48 -Other | | 0.0004255 | | | 0.81 - -Nlocal: 128.000 ave 131 max 122 min -Histogram: 1 0 0 0 0 0 1 0 0 2 -Nghost: 483.000 ave 485 max 479 min -Histogram: 1 0 0 0 0 0 1 0 0 2 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -FullNghs: 2104.00 ave 2169 max 2008 min -Histogram: 1 0 0 0 0 1 0 0 1 1 - -Total # of neighbors = 8416 -Ave neighs/atom = 16.437500 -Neighbor list builds = 3 -Dangerous builds = 0 - -Total wall time: 0:00:00 From 11866dfcb41777bf144972d18832e4df7eb54a07 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 8 Feb 2021 21:20:25 -0500 Subject: [PATCH 184/384] avoid segfault when accessing fix compute data before the fix is initialized --- src/SHOCK/fix_msst.cpp | 5 +++++ src/SHOCK/fix_nphug.cpp | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/SHOCK/fix_msst.cpp b/src/SHOCK/fix_msst.cpp index d0dee1af90..10ec0f0351 100644 --- a/src/SHOCK/fix_msst.cpp +++ b/src/SHOCK/fix_msst.cpp @@ -935,6 +935,7 @@ double FixMSST::compute_vector(int n) double FixMSST::compute_hugoniot() { + if (!temperature) return 0.0; double v, e, p; double dhugo; @@ -960,6 +961,8 @@ double FixMSST::compute_hugoniot() double FixMSST::compute_rayleigh() { + if (!temperature) return 0.0; + double v, p; double drayleigh; @@ -1001,6 +1004,8 @@ double FixMSST::compute_lagrangian_position() double FixMSST::compute_etotal() { + if (!pe) return 0.0; + double epot,ekin,etot; epot = pe->compute_scalar(); ekin = temperature->compute_scalar(); diff --git a/src/SHOCK/fix_nphug.cpp b/src/SHOCK/fix_nphug.cpp index c54bc0fa44..1fa7b77f6a 100644 --- a/src/SHOCK/fix_nphug.cpp +++ b/src/SHOCK/fix_nphug.cpp @@ -244,6 +244,8 @@ void FixNPHug::compute_temp_target() double FixNPHug::compute_etotal() { + if (!pe) return 0.0; + double epot,ekin,etot; epot = pe->compute_scalar(); ekin = temperature->compute_scalar(); @@ -269,6 +271,8 @@ double FixNPHug::compute_vol() double FixNPHug::compute_hugoniot() { + if (!temperature) return 0.0; + double v,e,p; double dhugo; @@ -299,6 +303,8 @@ double FixNPHug::compute_hugoniot() double FixNPHug::compute_us() { + if (!temperature) return 0.0; + double v,p; double eps,us; From d2b3677d6fd83b8449eda71e28e83cd86e23c4cd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 8 Feb 2021 21:45:58 -0500 Subject: [PATCH 185/384] whitespace fixes --- doc/src/thermo_style.rst | 6 +++--- src/USER-MISC/pair_agni.h | 2 +- src/fix_ave_correlate.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/src/thermo_style.rst b/doc/src/thermo_style.rst index ac53e575e5..8ea487fd0a 100644 --- a/doc/src/thermo_style.rst +++ b/doc/src/thermo_style.rst @@ -23,7 +23,7 @@ Syntax atoms, temp, press, pe, ke, etotal, evdwl, ecoul, epair, ebond, eangle, edihed, eimp, emol, elong, etail, - enthalpy, ecouple, econserve, + enthalpy, ecouple, econserve, vol, density, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi, xy, xz, yz, xlat, ylat, zlat, bonds, angles, dihedrals, impropers, @@ -61,8 +61,8 @@ Syntax elong = long-range kspace energy etail = van der Waals energy long-range tail correction enthalpy = enthalpy (etotal + press\*vol) - ecouple = cumulative energy change due to thermo/baro statting fixes - econserve = pe + ke + ecouple = etotal + ecouple + ecouple = cumulative energy change due to thermo/baro statting fixes + econserve = pe + ke + ecouple = etotal + ecouple vol = volume density = mass density of system lx,ly,lz = box lengths in x,y,z diff --git a/src/USER-MISC/pair_agni.h b/src/USER-MISC/pair_agni.h index 58adc2002d..6fba506d04 100644 --- a/src/USER-MISC/pair_agni.h +++ b/src/USER-MISC/pair_agni.h @@ -50,7 +50,7 @@ class PairAGNI : public Pair { int *elem2param; // mapping from element pairs to parameters int *map; // mapping from atom types to elements int nparams; // # of stored parameter sets - int atomic_feature_version; // version of fingerprint + int atomic_feature_version; // version of fingerprint Param *params; // parameter set for an I-J interaction virtual void allocate(); void read_file(char *); diff --git a/src/fix_ave_correlate.cpp b/src/fix_ave_correlate.cpp index de0cc0da6f..efd06a182a 100644 --- a/src/fix_ave_correlate.cpp +++ b/src/fix_ave_correlate.cpp @@ -74,7 +74,7 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): int iarg = 0; while (iarg < nargnew) { ArgInfo argi(arg[iarg]); - + if (argi.get_type() == ArgInfo::NONE) break; if ((argi.get_type() == ArgInfo::UNKNOWN) || (argi.get_dim() > 1)) error->all(FLERR,"Invalid fix ave/correlate command"); From 7826b58f7369d5da9e1dba2160b696cab5739227 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 9 Feb 2021 00:38:17 -0500 Subject: [PATCH 186/384] add check to lammps python module to check consistent versions between module and shared library --- python/install.py | 26 +++++++++++++++++++++++++- python/lammps/__init__.py | 4 ++++ python/lammps/core.py | 6 ++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/python/install.py b/python/install.py index 6765c33925..db3fea639d 100644 --- a/python/install.py +++ b/python/install.py @@ -10,7 +10,7 @@ build target in the conventional and CMake based build systems # copy LAMMPS shared library and lammps package to system dirs from __future__ import print_function -import sys,os,shutil +import sys,os,re,shutil from argparse import ArgumentParser parser = ArgumentParser(prog='install.py', @@ -90,11 +90,35 @@ def get_lammps_version(header): verstr = get_lammps_version(args.version) +# convert string version to numeric version +vernum = 0 +vregex = re.compile(r"([0-9]+)([A-Za-z]+)(2[0-9]+)") +m = vregex.match(verstr) +if (m): + month2num = { 'Jan' : 1, 'Feb' : 2, 'Mar' : 3, 'Apr' : 4, 'May' : 5, 'Jun' : 6, + 'Jul' : 7, 'Aug' : 8, 'Sep' : 9, 'Oct' : 10, 'Nov' : 11, 'Dec' : 12 } + try: + vernum = int(m.group(3))*10000 + vernum += month2num[m.group(2)]*100 + vernum += int(m.group(1)) + except: + exit('Failure to parse version string: %s' % verstr) + print("Installing LAMMPS Python package version %s into site-packages folder" % verstr) # we need to switch to the folder of the python package os.chdir(os.path.dirname(args.package)) + + +# update version number in lammps module +vregex = re.compile(r".*(__version__ += +)[0-9]+") +with open(os.path.join('lammps','__init__.py'), "r+") as f: + content = f.read() + f.seek(0) + f.write(re.sub(vregex, lambda match: '{}{}'.format(match.group(1), vernum), content)) + f.truncate() + from distutils.core import setup from distutils.sysconfig import get_python_lib import site diff --git a/python/lammps/__init__.py b/python/lammps/__init__.py index b1c8306617..d79ebe3e9f 100644 --- a/python/lammps/__init__.py +++ b/python/lammps/__init__.py @@ -2,3 +2,7 @@ from .constants import * from .core import * from .data import * from .pylammps import * + +# automatically updated during installation + +__version__ = 20201224 diff --git a/python/lammps/core.py b/python/lammps/core.py index 6c1300ccf2..1ae6ff5286 100644 --- a/python/lammps/core.py +++ b/python/lammps/core.py @@ -381,6 +381,12 @@ class lammps(object): self._installed_packages = None self._available_styles = None + # check if liblammps version matches the installed python module version + import lammps + if lammps.__version__ != self.lib.lammps_version(self.lmp): + raise(AttributeError("LAMMPS Python module installed for LAMMPS version %d, but shared library is version %d" \ + % (lammps.__version__, self.lib.lammps_version(self.lmp)))) + # add way to insert Python callback for fix external self.callback = {} self.FIX_EXTERNAL_CALLBACK_FUNC = CFUNCTYPE(None, py_object, self.c_bigint, c_int, POINTER(self.c_tagint), POINTER(POINTER(c_double)), POINTER(POINTER(c_double))) From 2d1f9646a3a37feca09bad778b8d435fe2885467 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 9 Feb 2021 00:40:55 -0500 Subject: [PATCH 187/384] update src/.gitignore --- src/.gitignore | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/src/.gitignore b/src/.gitignore index ebeb7076da..45ec71e485 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -204,6 +204,8 @@ /pair_spin_dipole_long.h /pair_spin_exchange.cpp /pair_spin_exchange.h +/pair_spin_exchange_biquadratic.cpp +/pair_spin_exchange_biquadratic.h /pair_spin_magelec.cpp /pair_spin_magelec.h /pair_spin_neel.cpp @@ -247,6 +249,8 @@ /angle_fourier.h /angle_fourier_simple.cpp /angle_fourier_simple.h +/angle_gaussian.cpp +/angle_gaussian.h /angle_harmonic.cpp /angle_harmonic.h /angle_mm3.cpp @@ -295,6 +299,8 @@ /bond_fene.h /bond_fene_expand.cpp /bond_fene_expand.h +/bond_gaussian.cpp +/bond_gaussian.h /bond_gromos.cpp /bond_gromos.h /bond_harmonic.cpp @@ -451,24 +457,30 @@ /dump_atom_adios.h /dump_atom_gz.cpp /dump_atom_gz.h -/dump_xyz_gz.cpp -/dump_xyz_gz.h +/dump_atom_zstd.cpp +/dump_atom_zstd.h /dump_atom_mpiio.cpp /dump_atom_mpiio.h /dump_cfg_gz.cpp /dump_cfg_gz.h /dump_cfg_mpiio.cpp /dump_cfg_mpiio.h +/dump_cfg_zstd.cpp +/dump_cfg_zstd.h /dump_custom_adios.cpp /dump_custom_adios.h /dump_custom_gz.cpp /dump_custom_gz.h /dump_custom_mpiio.cpp /dump_custom_mpiio.h +/dump_custom_zstd.cpp +/dump_custom_zstd.h /dump_h5md.cpp /dump_h5md.h /dump_local_gz.cpp /dump_local_gz.h +/dump_local_zstd.cpp +/dump_local_zstd.h /dump_netcdf.cpp /dump_netcdf.h /dump_netcdf_mpiio.cpp @@ -477,8 +489,12 @@ /dump_vtk.h /dump_xtc.cpp /dump_xtc.h +/dump_xyz_gz.cpp +/dump_xyz_gz.h /dump_xyz_mpiio.cpp /dump_xyz_mpiio.h +/dump_xyz_zstd.cpp +/dump_xyz_zstd.h /dynamical_matrix.cpp /dynamical_matrix.h /ewald.cpp @@ -533,6 +549,8 @@ /fix_efield.h /fix_electron_stopping.cpp /fix_electron_stopping.h +/fix_electron_stopping_fit.cpp +/fix_electron_stopping_fit.h /fix_eos_cv.cpp /fix_eos_cv.h /fix_eos_table.cpp @@ -736,6 +754,12 @@ /fix_store_kim.h /fix_temp_rescale_eff.cpp /fix_temp_rescale_eff.h +/fix_tgnh_drude.cpp +/fix_tgnh_drude.h +/fix_tgnpt_drude.cpp +/fix_tgnpt_drude.h +/fix_tgnvt_drude.cpp +/fix_tgnvt_drude.h /fix_thermal_conductivity.cpp /fix_thermal_conductivity.h /fix_ti_rs.cpp @@ -886,6 +910,8 @@ /pair_coul_slater_cut.h /pair_coul_slater_long.cpp /pair_coul_slater_long.h +/pair_coul_tt.cpp +/pair_coul_tt.h /pair_dipole_cut.cpp /pair_dipole_cut.h /pair_dipole_sf.cpp @@ -906,8 +932,8 @@ /pair_eam_cd.h /pair_eam_fs.cpp /pair_eam_fs.h -/fix_electron_stopping.cpp -/fix_electron_stopping.h +/pair_eam_he.cpp +/pair_eam_he.h /pair_lebedeva_z.cpp /pair_lebedeva_z.h /pair_lj_expand_coul_long.cpp @@ -1112,6 +1138,8 @@ /pair_tri_lj.h /pair_yukawa_colloid.cpp /pair_yukawa_colloid.h +/pair_wf_cut.cpp +/pair_wf_cut.h /pair_momb.cpp /pair_momb.h /pppm.cpp @@ -1387,3 +1415,5 @@ /pair_smtbq.h /pair_vashishta*.cpp /pair_vashishta*.h +/zstd_file_writer.cpp +/zstd_file_writer.h From 7f338a17afc1aa7a710a285b7597a8aa3e7aae83 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 9 Feb 2021 00:42:30 -0500 Subject: [PATCH 188/384] fix whitespace --- src/USER-MISC/bond_gaussian.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/USER-MISC/bond_gaussian.cpp b/src/USER-MISC/bond_gaussian.cpp index 350377f5d3..e6460d808e 100644 --- a/src/USER-MISC/bond_gaussian.cpp +++ b/src/USER-MISC/bond_gaussian.cpp @@ -168,7 +168,7 @@ void BondGaussian::coeff(int narg, char **arg) for (int i = ilo; i <= ihi; i++) { bond_temperature[i] = bond_temp_one; nterms[i] = n; - delete[] alpha[i]; + delete[] alpha[i]; alpha[i] = new double [n]; delete[] width[i]; width[i] = new double [n]; From 86b3e8ba2a307a8a8732f53574802ff37e5292fb Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 9 Feb 2021 00:42:37 -0500 Subject: [PATCH 189/384] fix permisssions --- examples/USER/dpd/dpdrx-shardlow/kinetics.dpdrx | 0 examples/USER/dpd/dpdrx-shardlow/params.exp6 | 0 examples/USER/dpd/dpdrx-shardlow/table.eos | 0 examples/USER/dpd/dpdrx-shardlow/thermo.dpdrx | 0 .../USER/dpd/dpdrx-shardlow/thermo.dpdrx.new | 17 ----------------- examples/USER/lb/confined_colloid/results64.out | 0 examples/USER/lb/dragforce/data.one_radius16d2 | 0 .../USER/lb/dragforce/defaultgamma_drag.out | 0 .../USER/lb/dragforce/setgamma13d0_drag.out | 0 examples/USER/lb/fourspheres/data.four | 0 .../fourspheres_velocity0d0001_defaultgamma.out | 0 .../fourspheres_velocity0d0001_setgamma.out | 0 examples/USER/lb/microrheology/data.two | 0 .../microrheology_defaultgamma.out | 0 .../lb/microrheology/microrheology_setgamma.out | 0 examples/USER/lb/planewall/data.one_radius16d2 | 0 .../USER/lb/planewall/wall_defaultgamma.out | 0 examples/USER/lb/planewall/wall_setgamma.out | 0 .../Silicon/ff-silicon.lmp | 0 .../Silicon/lmp_bank/amorphous_silicon.lmp | 0 .../Silicon/lmp_bank/silicon_216.lmp | 0 .../Silicon/lmp_bank/silicon_512.lmp | 0 .../Silicon/lmp_bank/silicon_8.lmp | 0 .../Silicon/silicon_input_file.lmp | 0 .../grow_styrene_post.data_template | 0 .../create_atoms_polystyrene/in.grow_styrene | 0 examples/USER/sph/shock_tube/exact_solution.dat | 0 examples/USER/sph/shock_tube/shock2d.lmp | 0 examples/reax/CHO/ffield.reax.cho | 0 29 files changed, 17 deletions(-) mode change 100755 => 100644 examples/USER/dpd/dpdrx-shardlow/kinetics.dpdrx mode change 100755 => 100644 examples/USER/dpd/dpdrx-shardlow/params.exp6 mode change 100755 => 100644 examples/USER/dpd/dpdrx-shardlow/table.eos mode change 100755 => 100644 examples/USER/dpd/dpdrx-shardlow/thermo.dpdrx delete mode 100755 examples/USER/dpd/dpdrx-shardlow/thermo.dpdrx.new mode change 100755 => 100644 examples/USER/lb/confined_colloid/results64.out mode change 100755 => 100644 examples/USER/lb/dragforce/data.one_radius16d2 mode change 100755 => 100644 examples/USER/lb/dragforce/defaultgamma_drag.out mode change 100755 => 100644 examples/USER/lb/dragforce/setgamma13d0_drag.out mode change 100755 => 100644 examples/USER/lb/fourspheres/data.four mode change 100755 => 100644 examples/USER/lb/fourspheres/fourspheres_velocity0d0001_defaultgamma.out mode change 100755 => 100644 examples/USER/lb/fourspheres/fourspheres_velocity0d0001_setgamma.out mode change 100755 => 100644 examples/USER/lb/microrheology/data.two mode change 100755 => 100644 examples/USER/lb/microrheology/microrheology_defaultgamma.out mode change 100755 => 100644 examples/USER/lb/microrheology/microrheology_setgamma.out mode change 100755 => 100644 examples/USER/lb/planewall/data.one_radius16d2 mode change 100755 => 100644 examples/USER/lb/planewall/wall_defaultgamma.out mode change 100755 => 100644 examples/USER/lb/planewall/wall_setgamma.out mode change 100755 => 100644 examples/USER/phonon/dynamical_matrix_command/Silicon/ff-silicon.lmp mode change 100755 => 100644 examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/amorphous_silicon.lmp mode change 100755 => 100644 examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_216.lmp mode change 100755 => 100644 examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_512.lmp mode change 100755 => 100644 examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_8.lmp mode change 100755 => 100644 examples/USER/phonon/dynamical_matrix_command/Silicon/silicon_input_file.lmp mode change 100755 => 100644 examples/USER/reaction/create_atoms_polystyrene/grow_styrene_post.data_template mode change 100755 => 100644 examples/USER/reaction/create_atoms_polystyrene/in.grow_styrene mode change 100755 => 100644 examples/USER/sph/shock_tube/exact_solution.dat mode change 100755 => 100644 examples/USER/sph/shock_tube/shock2d.lmp mode change 100755 => 100644 examples/reax/CHO/ffield.reax.cho diff --git a/examples/USER/dpd/dpdrx-shardlow/kinetics.dpdrx b/examples/USER/dpd/dpdrx-shardlow/kinetics.dpdrx old mode 100755 new mode 100644 diff --git a/examples/USER/dpd/dpdrx-shardlow/params.exp6 b/examples/USER/dpd/dpdrx-shardlow/params.exp6 old mode 100755 new mode 100644 diff --git a/examples/USER/dpd/dpdrx-shardlow/table.eos b/examples/USER/dpd/dpdrx-shardlow/table.eos old mode 100755 new mode 100644 diff --git a/examples/USER/dpd/dpdrx-shardlow/thermo.dpdrx b/examples/USER/dpd/dpdrx-shardlow/thermo.dpdrx old mode 100755 new mode 100644 diff --git a/examples/USER/dpd/dpdrx-shardlow/thermo.dpdrx.new b/examples/USER/dpd/dpdrx-shardlow/thermo.dpdrx.new deleted file mode 100755 index c55d5065ba..0000000000 --- a/examples/USER/dpd/dpdrx-shardlow/thermo.dpdrx.new +++ /dev/null @@ -1,17 +0,0 @@ -# rx heats of formation for various molecules -# multiple entries can be added to this file, LAMMPS reads the ones it needs -# the entries are in LAMMPS "metal" units (eV) -# Be sure the units are consistent with your input file - -# format of a single entry (one or more lines): -# species DeltaHformation - -rdx 1.989907438211819 -hcn 1.400635733970104 -no2 0.343004076201018 -no 0.935781955892458 -h2o -2.506184777415379 -n2 0.000000000000000 -h2 0.000000000000000 -co -1.145533746031845 -co2 -4.078501848437456 diff --git a/examples/USER/lb/confined_colloid/results64.out b/examples/USER/lb/confined_colloid/results64.out old mode 100755 new mode 100644 diff --git a/examples/USER/lb/dragforce/data.one_radius16d2 b/examples/USER/lb/dragforce/data.one_radius16d2 old mode 100755 new mode 100644 diff --git a/examples/USER/lb/dragforce/defaultgamma_drag.out b/examples/USER/lb/dragforce/defaultgamma_drag.out old mode 100755 new mode 100644 diff --git a/examples/USER/lb/dragforce/setgamma13d0_drag.out b/examples/USER/lb/dragforce/setgamma13d0_drag.out old mode 100755 new mode 100644 diff --git a/examples/USER/lb/fourspheres/data.four b/examples/USER/lb/fourspheres/data.four old mode 100755 new mode 100644 diff --git a/examples/USER/lb/fourspheres/fourspheres_velocity0d0001_defaultgamma.out b/examples/USER/lb/fourspheres/fourspheres_velocity0d0001_defaultgamma.out old mode 100755 new mode 100644 diff --git a/examples/USER/lb/fourspheres/fourspheres_velocity0d0001_setgamma.out b/examples/USER/lb/fourspheres/fourspheres_velocity0d0001_setgamma.out old mode 100755 new mode 100644 diff --git a/examples/USER/lb/microrheology/data.two b/examples/USER/lb/microrheology/data.two old mode 100755 new mode 100644 diff --git a/examples/USER/lb/microrheology/microrheology_defaultgamma.out b/examples/USER/lb/microrheology/microrheology_defaultgamma.out old mode 100755 new mode 100644 diff --git a/examples/USER/lb/microrheology/microrheology_setgamma.out b/examples/USER/lb/microrheology/microrheology_setgamma.out old mode 100755 new mode 100644 diff --git a/examples/USER/lb/planewall/data.one_radius16d2 b/examples/USER/lb/planewall/data.one_radius16d2 old mode 100755 new mode 100644 diff --git a/examples/USER/lb/planewall/wall_defaultgamma.out b/examples/USER/lb/planewall/wall_defaultgamma.out old mode 100755 new mode 100644 diff --git a/examples/USER/lb/planewall/wall_setgamma.out b/examples/USER/lb/planewall/wall_setgamma.out old mode 100755 new mode 100644 diff --git a/examples/USER/phonon/dynamical_matrix_command/Silicon/ff-silicon.lmp b/examples/USER/phonon/dynamical_matrix_command/Silicon/ff-silicon.lmp old mode 100755 new mode 100644 diff --git a/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/amorphous_silicon.lmp b/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/amorphous_silicon.lmp old mode 100755 new mode 100644 diff --git a/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_216.lmp b/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_216.lmp old mode 100755 new mode 100644 diff --git a/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_512.lmp b/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_512.lmp old mode 100755 new mode 100644 diff --git a/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_8.lmp b/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_8.lmp old mode 100755 new mode 100644 diff --git a/examples/USER/phonon/dynamical_matrix_command/Silicon/silicon_input_file.lmp b/examples/USER/phonon/dynamical_matrix_command/Silicon/silicon_input_file.lmp old mode 100755 new mode 100644 diff --git a/examples/USER/reaction/create_atoms_polystyrene/grow_styrene_post.data_template b/examples/USER/reaction/create_atoms_polystyrene/grow_styrene_post.data_template old mode 100755 new mode 100644 diff --git a/examples/USER/reaction/create_atoms_polystyrene/in.grow_styrene b/examples/USER/reaction/create_atoms_polystyrene/in.grow_styrene old mode 100755 new mode 100644 diff --git a/examples/USER/sph/shock_tube/exact_solution.dat b/examples/USER/sph/shock_tube/exact_solution.dat old mode 100755 new mode 100644 diff --git a/examples/USER/sph/shock_tube/shock2d.lmp b/examples/USER/sph/shock_tube/shock2d.lmp old mode 100755 new mode 100644 diff --git a/examples/reax/CHO/ffield.reax.cho b/examples/reax/CHO/ffield.reax.cho old mode 100755 new mode 100644 From b53b993c681ec67af553a0d55dd83f294f8048fd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 9 Feb 2021 02:12:37 -0500 Subject: [PATCH 190/384] recover in-place usage by defaulting to version 0 and changing it back after installation --- python/install.py | 7 +++++++ python/lammps/__init__.py | 2 +- python/lammps/core.py | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/python/install.py b/python/install.py index db3fea639d..bd0874593f 100644 --- a/python/install.py +++ b/python/install.py @@ -150,3 +150,10 @@ if tryuser: setup(**setup_kwargs) except: print("Installation into user site package folder failed.") + +# restore __version__ == 0 for in place usage +with open(os.path.join('lammps','__init__.py'), "r+") as f: + content = f.read() + f.seek(0) + f.write(re.sub(vregex, lambda match: '{}{}'.format(match.group(1), 0), content)) + f.truncate() diff --git a/python/lammps/__init__.py b/python/lammps/__init__.py index d79ebe3e9f..e73e514d8c 100644 --- a/python/lammps/__init__.py +++ b/python/lammps/__init__.py @@ -5,4 +5,4 @@ from .pylammps import * # automatically updated during installation -__version__ = 20201224 +__version__ = 0 diff --git a/python/lammps/core.py b/python/lammps/core.py index 1ae6ff5286..1dc135359d 100644 --- a/python/lammps/core.py +++ b/python/lammps/core.py @@ -382,8 +382,9 @@ class lammps(object): self._available_styles = None # check if liblammps version matches the installed python module version + # but not for in-place usage, i.e. when the version is 0 import lammps - if lammps.__version__ != self.lib.lammps_version(self.lmp): + if lammps.__version__ > 0 and lammps.__version__ != self.lib.lammps_version(self.lmp): raise(AttributeError("LAMMPS Python module installed for LAMMPS version %d, but shared library is version %d" \ % (lammps.__version__, self.lib.lammps_version(self.lmp)))) From d26c744e5467dfb167f7cdff800f912b6dfed959 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 9 Feb 2021 09:17:08 -0500 Subject: [PATCH 191/384] should use ev_init() not ev_setup() --- src/SPIN/pair_spin_dipole_cut.cpp | 3 +-- src/USER-MISC/pair_cosine_squared.cpp | 5 +---- src/USER-MISC/pair_coul_slater_cut.cpp | 3 +-- src/USER-MISC/pair_coul_slater_long.cpp | 6 +----- src/USER-MISC/pair_e3b.cpp | 3 +-- src/USER-MISC/pair_local_density.cpp | 4 +--- src/USER-MISC/pair_wf_cut.cpp | 3 +-- src/USER-OMP/pair_buck_long_coul_long_omp.cpp | 4 +--- src/USER-OMP/pair_lj_long_coul_long_omp.cpp | 4 +--- src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp | 4 +--- 10 files changed, 10 insertions(+), 29 deletions(-) diff --git a/src/SPIN/pair_spin_dipole_cut.cpp b/src/SPIN/pair_spin_dipole_cut.cpp index 7ba81d93f8..2679f0fd6d 100644 --- a/src/SPIN/pair_spin_dipole_cut.cpp +++ b/src/SPIN/pair_spin_dipole_cut.cpp @@ -167,9 +167,8 @@ void PairSpinDipoleCut::compute(int eflag, int vflag) double rinv,r2inv,r3inv,rsq,local_cut2,evdwl,ecoul; double xi[3],rij[3],eij[3],spi[4],spj[4],fi[3],fmi[3]; + ev_init(eflag,vflag); evdwl = ecoul = 0.0; - if (eflag || vflag) ev_setup(eflag,vflag); - else evflag = vflag_fdotr = 0; int *type = atom->type; int nlocal = atom->nlocal; diff --git a/src/USER-MISC/pair_cosine_squared.cpp b/src/USER-MISC/pair_cosine_squared.cpp index 1af0f00c32..684d405f2b 100644 --- a/src/USER-MISC/pair_cosine_squared.cpp +++ b/src/USER-MISC/pair_cosine_squared.cpp @@ -344,11 +344,8 @@ void PairCosineSquared::compute(int eflag, int vflag) double r, rsq, r2inv, r6inv; double factor_lj, force_lj, force_cos, cosone; + ev_init(eflag, vflag); evdwl = 0.0; - if (eflag || vflag) - ev_setup(eflag, vflag); - else - evflag = vflag_fdotr = 0; double **x = atom->x; double **f = atom->f; diff --git a/src/USER-MISC/pair_coul_slater_cut.cpp b/src/USER-MISC/pair_coul_slater_cut.cpp index b4f8bad191..bb32cf1c18 100644 --- a/src/USER-MISC/pair_coul_slater_cut.cpp +++ b/src/USER-MISC/pair_coul_slater_cut.cpp @@ -40,9 +40,8 @@ void PairCoulSlaterCut::compute(int eflag, int vflag) double rsq,r2inv,r,rinv,forcecoul,factor_coul,bracket_term; int *ilist,*jlist,*numneigh,**firstneigh; + ev_init(eflag,vflag); ecoul = 0.0; - if (eflag || vflag) ev_setup(eflag,vflag); - else evflag = vflag_fdotr = 0; double **x = atom->x; double **f = atom->f; diff --git a/src/USER-MISC/pair_coul_slater_long.cpp b/src/USER-MISC/pair_coul_slater_long.cpp index 497520a32d..9c2e9780df 100644 --- a/src/USER-MISC/pair_coul_slater_long.cpp +++ b/src/USER-MISC/pair_coul_slater_long.cpp @@ -59,7 +59,6 @@ PairCoulSlaterLong::~PairCoulSlaterLong() memory->destroy(scale); } - //if (ftable) free_tables(); } } @@ -69,17 +68,14 @@ void PairCoulSlaterLong::compute(int eflag, int vflag) { int i,j,ii,jj,inum,jnum,itype,jtype; double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,ecoul,fpair; -// double fraction,table; double r,r2inv,forcecoul,factor_coul; double grij,expm2,prefactor,t,erfc; int *ilist,*jlist,*numneigh,**firstneigh; double rsq; double slater_term; -// int itable; + ev_init(eflag,vflag); ecoul = 0.0; - if (eflag || vflag) ev_setup(eflag,vflag); - else evflag = vflag_fdotr = 0; double **x = atom->x; double **f = atom->f; diff --git a/src/USER-MISC/pair_e3b.cpp b/src/USER-MISC/pair_e3b.cpp index ae65d68d89..419cd29a2b 100644 --- a/src/USER-MISC/pair_e3b.cpp +++ b/src/USER-MISC/pair_e3b.cpp @@ -97,13 +97,12 @@ void PairE3B::compute(int eflag, int vflag) if (natoms != atom->natoms) error->all(FLERR,"pair E3B requires a fixed number of atoms"); + ev_init(eflag,vflag); //clear sumExp array memset(sumExp,0.0,nbytes); evdwl = 0.0; pvector[0]=pvector[1]=pvector[2]=pvector[3]=0.0; - if (eflag || vflag) ev_setup(eflag,vflag); - else evflag = vflag_fdotr = 0; double **x = atom->x; double **f = atom->f; diff --git a/src/USER-MISC/pair_local_density.cpp b/src/USER-MISC/pair_local_density.cpp index ec3c41a47b..3e5af5f7c3 100644 --- a/src/USER-MISC/pair_local_density.cpp +++ b/src/USER-MISC/pair_local_density.cpp @@ -139,11 +139,9 @@ void PairLocalDensity::compute(int eflag, int vflag) double p, *coeff; int *ilist,*jlist,*numneigh,**firstneigh; + ev_init(eflag,vflag); phi = uLD = evdwl = fpair = rsqinv = 0.0; - if (eflag || vflag) ev_setup(eflag,vflag); - else evflag = vflag_fdotr = eflag_global = eflag_atom = 0; - /* localrho = LD at each atom fp = derivative of embedding energy at each atom for each LD potential uLD = embedding energy of each atom due to each LD potential*/ diff --git a/src/USER-MISC/pair_wf_cut.cpp b/src/USER-MISC/pair_wf_cut.cpp index d29ae2a4fe..e62217aad1 100644 --- a/src/USER-MISC/pair_wf_cut.cpp +++ b/src/USER-MISC/pair_wf_cut.cpp @@ -70,9 +70,8 @@ void PairWFCut::compute(int eflag, int vflag) double forcenm,rminv, rm, rn; int *ilist,*jlist,*numneigh,**firstneigh; + ev_init(eflag,vflag); evdwl = 0.0; - if (eflag || vflag) ev_setup(eflag,vflag); - else evflag = vflag_fdotr = 0; double **x = atom->x; double **f = atom->f; diff --git a/src/USER-OMP/pair_buck_long_coul_long_omp.cpp b/src/USER-OMP/pair_buck_long_coul_long_omp.cpp index 15fb9e69f9..1da7c6db60 100644 --- a/src/USER-OMP/pair_buck_long_coul_long_omp.cpp +++ b/src/USER-OMP/pair_buck_long_coul_long_omp.cpp @@ -367,9 +367,7 @@ void PairBuckLongCoulLongOMP::compute_middle() void PairBuckLongCoulLongOMP::compute_outer(int eflag, int vflag) { - if (eflag || vflag) { - ev_setup(eflag,vflag); - } else evflag = vflag_fdotr = 0; + ev_init(eflag,vflag); const int order1 = ewald_order&(1<<1); const int order6 = ewald_order&(1<<6); diff --git a/src/USER-OMP/pair_lj_long_coul_long_omp.cpp b/src/USER-OMP/pair_lj_long_coul_long_omp.cpp index ca66f3c1c0..980efb7c84 100644 --- a/src/USER-OMP/pair_lj_long_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_long_coul_long_omp.cpp @@ -366,9 +366,7 @@ void PairLJLongCoulLongOMP::compute_middle() void PairLJLongCoulLongOMP::compute_outer(int eflag, int vflag) { - if (eflag || vflag) { - ev_setup(eflag,vflag); - } else evflag = vflag_fdotr = 0; + ev_init(eflag,vflag); const int order1 = ewald_order&(1<<1); const int order6 = ewald_order&(1<<6); diff --git a/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp b/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp index 4dadd0a1ea..bf8ac76740 100644 --- a/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp +++ b/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp @@ -425,9 +425,7 @@ void PairLJLongTIP4PLongOMP::compute_middle() void PairLJLongTIP4PLongOMP::compute_outer(int eflag, int vflag) { - if (eflag || vflag) { - ev_setup(eflag,vflag); - } else evflag = vflag_fdotr = 0; + ev_init(eflag,vflag); const int order1 = ewald_order&(1<<1); const int order6 = ewald_order&(1<<6); From 56467144702b6e32d13cd2e0690a83911682eef7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 9 Feb 2021 11:01:34 -0500 Subject: [PATCH 192/384] update example inputs and logfile for fix_modify energy yes/no changes, where needed --- examples/SPIN/nickel/in.spin.nickel | 8 +- examples/SPIN/nickel/in.spin.nickel_cubic | 72 ++--- examples/USER/misc/gle/in.h2o-quantum | 35 ++- examples/USER/misc/gle/in.h2o-smart | 37 ++- .../in.alpha_quartz_qbmsst | 9 +- ... => log.09Feb21.alpha_quartz_qbmsst.g++.1} | 241 +++++++-------- ... => log.09Feb21.alpha_quartz_qbmsst.g++.4} | 243 +++++++-------- examples/tersoff/in.hBN_shift | 8 +- examples/tersoff/in.tersoff | 59 ++-- ...ersoff.g++.1 => log.09Feb21.tersoff.g++.1} | 279 +++++++++--------- ...ersoff.g++.4 => log.09Feb21.tersoff.g++.4} | 279 +++++++++--------- 11 files changed, 634 insertions(+), 636 deletions(-) rename examples/USER/qtb/alpha_quartz_qbmsst/{log.15Jun20.alpha_quartz_qbmsst.g++.1 => log.09Feb21.alpha_quartz_qbmsst.g++.1} (64%) rename examples/USER/qtb/alpha_quartz_qbmsst/{log.15Jun20.alpha_quartz_qbmsst.g++.4 => log.09Feb21.alpha_quartz_qbmsst.g++.4} (63%) rename examples/tersoff/{log.13Jan21.tersoff.g++.1 => log.09Feb21.tersoff.g++.1} (59%) rename examples/tersoff/{log.13Jan21.tersoff.g++.4 => log.09Feb21.tersoff.g++.4} (60%) diff --git a/examples/SPIN/nickel/in.spin.nickel b/examples/SPIN/nickel/in.spin.nickel index 0fd2e5f345..baa05760a6 100644 --- a/examples/SPIN/nickel/in.spin.nickel +++ b/examples/SPIN/nickel/in.spin.nickel @@ -1,6 +1,6 @@ # fcc nickel in a 3d periodic box -clear +clear units metal atom_style spin @@ -8,7 +8,7 @@ dimension 3 boundary p p p # necessary for the serial algorithm (sametag) -atom_modify map array +atom_modify map array lattice fcc 3.524 region box block 0.0 5.0 0.0 5.0 0.0 5.0 @@ -20,7 +20,7 @@ create_atoms 1 box mass 1 58.69 set group all spin/random 31 0.63 -#set group all spin 0.63 0.0 0.0 1.0 +#set group all spin 0.63 0.0 0.0 1.0 velocity all create 100 4928459 rot yes dist gaussian pair_style hybrid/overlay eam/alloy spin/exchange 4.0 @@ -31,7 +31,7 @@ neighbor 0.1 bin neigh_modify every 10 check yes delay 20 fix 1 all precession/spin zeeman 0.0 0.0 0.0 1.0 -fix_modify 1 energy yes +fix_modify 1 energy yes fix 2 all langevin/spin 0.0 0.0 21 fix 3 all nve/spin lattice moving diff --git a/examples/SPIN/nickel/in.spin.nickel_cubic b/examples/SPIN/nickel/in.spin.nickel_cubic index 88c477132e..6f91b4c8bb 100644 --- a/examples/SPIN/nickel/in.spin.nickel_cubic +++ b/examples/SPIN/nickel/in.spin.nickel_cubic @@ -1,60 +1,60 @@ # fcc nickel in a 3d periodic box -clear -units metal -atom_style spin +clear +units metal +atom_style spin -dimension 3 -boundary p p p +dimension 3 +boundary p p p # necessary for the serial algorithm (sametag) -atom_modify map array +atom_modify map array -lattice fcc 3.524 -region box block 0.0 5.0 0.0 5.0 0.0 5.0 -create_box 1 box -create_atoms 1 box +lattice fcc 3.524 +region box block 0.0 5.0 0.0 5.0 0.0 5.0 +create_box 1 box +create_atoms 1 box # setting mass, mag. moments, and interactions for cobalt -mass 1 58.69 +mass 1 58.69 -set group all spin/random 31 0.63 -#set group all spin 0.63 0.0 0.0 1.0 -velocity all create 100 4928459 rot yes dist gaussian +set group all spin/random 31 0.63 +#set group all spin 0.63 0.0 0.0 1.0 +velocity all create 100 4928459 rot yes dist gaussian -pair_style hybrid/overlay eam/alloy spin/exchange 4.0 -pair_coeff * * eam/alloy Ni99.eam.alloy Ni -pair_coeff * * spin/exchange exchange 4.0 0.50 0.2280246862 1.229983475 +pair_style hybrid/overlay eam/alloy spin/exchange 4.0 +pair_coeff * * eam/alloy Ni99.eam.alloy Ni +pair_coeff * * spin/exchange exchange 4.0 0.50 0.2280246862 1.229983475 -neighbor 0.1 bin -neigh_modify every 10 check yes delay 20 +neighbor 0.1 bin +neigh_modify every 10 check yes delay 20 -fix 1 all precession/spin cubic -0.0001 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 & - zeeman 0.0 0.0 0.0 1.0 -fix_modify 1 energy yes -fix 2 all langevin/spin 0.0 0.0 21 +fix 1 all precession/spin cubic -0.0001 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 & + zeeman 0.0 0.0 0.0 1.0 +fix_modify 1 energy yes +fix 2 all langevin/spin 0.0 0.0 21 -fix 3 all nve/spin lattice moving -timestep 0.0001 +fix 3 all nve/spin lattice moving +timestep 0.0001 # compute and output options -compute out_mag all spin -compute out_pe all pe -compute out_ke all ke -compute out_temp all temp +compute out_mag all spin +compute out_pe all pe +compute out_ke all ke +compute out_temp all temp -variable magz equal c_out_mag[3] -variable magnorm equal c_out_mag[4] -variable emag equal c_out_mag[5] -variable tmag equal c_out_mag[6] +variable magz equal c_out_mag[3] +variable magnorm equal c_out_mag[4] +variable emag equal c_out_mag[5] +variable tmag equal c_out_mag[6] thermo_style custom step time v_magnorm pe v_emag temp v_tmag etotal thermo 50 -compute outsp all property/atom spx spy spz sp fmx fmy fmz -dump 1 all custom 50 dump.lammpstrj type x y z c_outsp[1] c_outsp[2] c_outsp[3] c_outsp[4] c_outsp[5] c_outsp[6] c_outsp[7] +compute outsp all property/atom spx spy spz sp fmx fmy fmz +dump 1 all custom 50 dump.lammpstrj type x y z c_outsp[1] c_outsp[2] c_outsp[3] c_outsp[4] c_outsp[5] c_outsp[6] c_outsp[7] -run 1000 +run 1000 diff --git a/examples/USER/misc/gle/in.h2o-quantum b/examples/USER/misc/gle/in.h2o-quantum index 04f94f219a..ee330e8393 100644 --- a/examples/USER/misc/gle/in.h2o-quantum +++ b/examples/USER/misc/gle/in.h2o-quantum @@ -1,12 +1,12 @@ -units real -atom_style full +units real +atom_style full -pair_style lj/cut/tip4p/long 1 2 1 1 0.14714951 8 -bond_style class2 -angle_style harmonic -kspace_style pppm/tip4p 0.0001 +pair_style lj/cut/tip4p/long 1 2 1 1 0.14714951 8 +bond_style class2 +angle_style harmonic +kspace_style pppm/tip4p 0.0001 -read_data data.h2o-quantum +read_data data.h2o-quantum pair_coeff * 2 0.0 0.0 pair_coeff 1 1 0.1852 3.1589022 @@ -15,7 +15,7 @@ pair_coeff 1 1 0.1852 3.1589022 bond_coeff 1 0.9419 607.19354 -1388.6516 1852.577 angle_coeff 1 43.93 107.4 -timestep 0.5 +timestep 0.5 # mean velocity is higher than target T because of zero point energy velocity all create 800.0 1112 dist gaussian mom yes @@ -24,18 +24,17 @@ thermo 100 thermo_style custom step temp pe ke etotal # some problem -fix 1 all gle 6 300.0 300.0 31415 qt-300k.A noneq qt-300k.C -fix_modify 1 energy no +fix 1 all gle 6 300.0 300.0 31415 qt-300k.A noneq qt-300k.C -#dump 1 all atom 100 h2o-smart.lammpstrj +#dump 1 all atom 100 h2o-smart.lammpstrj -#dump 2 all image 1000 h2o-smart.*.jpg element element & -# zoom 1.4 -#dump_modify 2 pad 5 element O H +#dump 2 all image 1000 h2o-smart.*.jpg element element & +# zoom 1.4 +#dump_modify 2 pad 5 element O H -#dump 3 all movie 100 movie.mp4 element element & -# zoom 1.4 -#dump_modify 3 pad 5 element O H +#dump 3 all movie 100 movie.mp4 element element & +# zoom 1.4 +#dump_modify 3 pad 5 element O H -run 10000 +run 10000 diff --git a/examples/USER/misc/gle/in.h2o-smart b/examples/USER/misc/gle/in.h2o-smart index 37de851f97..9a7d6ef717 100644 --- a/examples/USER/misc/gle/in.h2o-smart +++ b/examples/USER/misc/gle/in.h2o-smart @@ -1,12 +1,12 @@ -units real -atom_style full +units real +atom_style full -pair_style lj/cut/tip4p/long 1 2 1 1 0.14714951 8 -bond_style class2 -angle_style harmonic -kspace_style pppm/tip4p 0.0001 +pair_style lj/cut/tip4p/long 1 2 1 1 0.14714951 8 +bond_style class2 +angle_style harmonic +kspace_style pppm/tip4p 0.0001 -read_data data.h2o-smart +read_data data.h2o-smart pair_coeff * 2 0.0 0.0 pair_coeff 1 1 0.1852 3.1589022 @@ -15,27 +15,26 @@ pair_coeff 1 1 0.1852 3.1589022 bond_coeff 1 0.9419 607.19354 -1388.6516 1852.577 angle_coeff 1 43.93 107.4 -timestep 0.5 +timestep 0.5 -velocity all create 300.0 1112 dist gaussian mom yes +velocity all create 300.0 1112 dist gaussian mom yes thermo 100 thermo_style custom step temp pe ke etotal # smart sampling with GLE: best efficiency on slow diffusive modes, # and as good as possible on higher-frequency modes -fix 1 all gle 6 300.0 300.0 31415 smart.A -fix_modify 1 energy no +fix 1 all gle 6 300.0 300.0 31415 smart.A -#dump 1 all atom 100 h2o-smart.lammpstrj +#dump 1 all atom 100 h2o-smart.lammpstrj -#dump 2 all image 1000 h2o-smart.*.jpg element element & -# zoom 1.4 -#dump_modify 2 pad 5 element O H +#dump 2 all image 1000 h2o-smart.*.jpg element element & +# zoom 1.4 +#dump_modify 2 pad 5 element O H -#dump 3 all movie 100 movie.mp4 element element & -# zoom 1.4 -#dump_modify 3 pad 5 element O H +#dump 3 all movie 100 movie.mp4 element element & +# zoom 1.4 +#dump_modify 3 pad 5 element O H -run 10000 +run 10000 diff --git a/examples/USER/qtb/alpha_quartz_qbmsst/in.alpha_quartz_qbmsst b/examples/USER/qtb/alpha_quartz_qbmsst/in.alpha_quartz_qbmsst index 3ee0bd0ca5..49e89e2bb2 100644 --- a/examples/USER/qtb/alpha_quartz_qbmsst/in.alpha_quartz_qbmsst +++ b/examples/USER/qtb/alpha_quartz_qbmsst/in.alpha_quartz_qbmsst @@ -23,13 +23,12 @@ include alpha_quartz_qtb.mod reset_timestep 0 #Beta is the number of time steps between each update of the quantum bath temperature. Setting a larger beta can reduce thermal flactuations. fix shock all qbmsst z ${v_msst} q ${q_msst} tscale ${tscale_msst} damp ${damp_qtb} f_max 120 N_f 100 seed 35082 eta ${eta_qbmsst} beta 5 T_init ${temperature} -fix_modify shock energy yes variable dhug equal f_shock[1] variable dray equal f_shock[2] variable lgr_vel equal f_shock[3] variable lgr_pos equal f_shock[4] variable T_qm equal f_shock[5] #Temperature with quantum nuclear correction -thermo_style custom step v_T_qm press etotal vol lx ly lz pzz v_dhug v_dray v_lgr_vel v_lgr_pos +thermo_style custom step v_T_qm press econserve vol lx ly lz pzz v_dhug v_dray v_lgr_vel v_lgr_pos thermo 200 timestep ${delta_t} run 1000 @@ -42,14 +41,14 @@ read_restart restart.1000 include alpha_quartz_potential.mod #Use the same fix id and add no tscale if the system is already compressed fix shock all qbmsst z ${v_msst} q ${q_msst} tscale 0.0 damp ${damp_qtb} f_max 120 N_f 100 seed 35082 eta ${eta_qbmsst} beta 5 T_init ${temperature} -fix_modify shock energy yes variable dhug equal f_shock[1] variable dray equal f_shock[2] variable lgr_vel equal f_shock[3] variable lgr_pos equal f_shock[4] variable T_qm equal f_shock[5] #Temperature with quantum nuclear correction -thermo_style custom step v_T_qm press etotal vol lx ly lz pzz v_dhug v_dray v_lgr_vel v_lgr_pos +thermo_style custom step v_T_qm press econserve vol lx ly lz pzz v_dhug v_dray v_lgr_vel v_lgr_pos thermo 500 timestep ${delta_t} -restart 1000 restart +#restart 1000 restart run 10000 #10 ps +shell rm restart.1000 diff --git a/examples/USER/qtb/alpha_quartz_qbmsst/log.15Jun20.alpha_quartz_qbmsst.g++.1 b/examples/USER/qtb/alpha_quartz_qbmsst/log.09Feb21.alpha_quartz_qbmsst.g++.1 similarity index 64% rename from examples/USER/qtb/alpha_quartz_qbmsst/log.15Jun20.alpha_quartz_qbmsst.g++.1 rename to examples/USER/qtb/alpha_quartz_qbmsst/log.09Feb21.alpha_quartz_qbmsst.g++.1 index cb5ebe31a9..977c07b02b 100644 --- a/examples/USER/qtb/alpha_quartz_qbmsst/log.15Jun20.alpha_quartz_qbmsst.g++.1 +++ b/examples/USER/qtb/alpha_quartz_qbmsst/log.09Feb21.alpha_quartz_qbmsst.g++.1 @@ -1,4 +1,4 @@ -LAMMPS (15 Jun 2020) +LAMMPS (24 Dec 2020) using 1 OpenMP thread(s) per MPI task ## This script first uses fix qtb to equilibrate alpha quartz structure to an initial state with quantum nuclear correction and then simulate shock induced phase transition through the quantum thermal bath multi-scale shock technique variable x_rep equal 2 #plot is made with x_rep = 8 #x-direction replication number @@ -29,12 +29,12 @@ atom_style charge #Lattice lattice custom 1.0 a1 4.916000 0.000000 0.000000 a2 -2.45800 4.257381 0.000000 a3 0.000000 0.000000 5.405400 basis 0.469700 0.000000 0.000000 basis 0.000000 0.469700 0.666667 basis 0.530300 0.530300 0.333333 basis 0.413500 0.266900 0.119100 basis 0.266900 0.413500 0.547567 basis 0.733100 0.146600 0.785767 basis 0.586500 0.853400 0.214233 basis 0.853400 0.586500 0.452433 basis 0.146600 0.733100 0.880900 #American Mineralogist 65 920 1980 (Space Group 154) -Lattice spacing in x,y,z = 7.374 4.25738 5.4054 +Lattice spacing in x,y,z = 7.3740000 4.2573810 5.4054000 #Computational Cell region orthorhombic_unit_cell block 0 4.916000 0 8.514762 0 5.405400 units box create_box 2 orthorhombic_unit_cell -Created orthogonal box = (0.0 0.0 0.0) to (4.916 8.514762 5.4054) +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (4.9160000 8.5147620 5.4054000) 1 by 1 by 1 MPI processor grid create_atoms 1 box basis 1 1 basis 2 1 basis 3 1 basis 4 2 basis 5 2 basis 6 2 basis 7 2 basis 8 2 basis 9 2 Created 18 atoms @@ -43,17 +43,20 @@ replicate ${x_rep} ${y_rep} ${z_rep} replicate 2 ${y_rep} ${z_rep} replicate 2 1 ${z_rep} replicate 2 1 4 - orthogonal box = (0.0 0.0 0.0) to (9.832 8.514762 21.6216) +Replicating atoms ... + orthogonal box = (0.0000000 0.0000000 0.0000000) to (9.8320000 8.5147620 21.621600) 1 by 1 by 1 MPI processor grid 144 atoms - replicate CPU = 0.000271082 secs + replicate CPU = 0.001 seconds #Atomic Information mass 1 28.085500 mass 2 15.999400 set type 1 charge +2.4 +Setting atom values ... 48 settings made for charge set type 2 charge -1.2 +Setting atom values ... 96 settings made for charge @@ -72,8 +75,8 @@ pair_coeff 1 2 table potential_SiO2.TPF Si-O ${cut_off} pair_coeff 1 2 table potential_SiO2.TPF Si-O 10 pair_coeff 2 2 table potential_SiO2.TPF O-O ${cut_off} #See the potential file for more information pair_coeff 2 2 table potential_SiO2.TPF O-O 10 -WARNING: 1 of 39901 force values in table are inconsistent with -dE/dr. - Should only be flagged at inflection points (src/pair_table.cpp:471) +WARNING: 1 of 39901 force values in table O-O are inconsistent with -dE/dr. + Should only be flagged at inflection points (src/pair_table.cpp:461) kspace_style pppm 1.0e-4 #Neighbor style @@ -96,12 +99,12 @@ thermo_style custom step temp press etotal vol lx ly lz pxx pyy pzz p thermo 200 run 2000 # 2 ps PPPM initialization ... - using 12-bit tables for long-range coulomb (src/kspace.cpp:332) - G vector (1/distance) = 0.301598 + using 12-bit tables for long-range coulomb (src/kspace.cpp:339) + G vector (1/distance) = 0.30159814 grid = 9 8 15 stencil order = 5 - estimated absolute RMS force accuracy = 0.00117056 - estimated relative force accuracy = 8.12908e-05 + estimated absolute RMS force accuracy = 0.0011705589 + estimated relative force accuracy = 8.1290814e-05 using double precision FFTW3 3d grid and FFT values/proc = 5280 1080 Neighbor list info ... @@ -123,42 +126,42 @@ Neighbor list info ... bin: none Per MPI rank memory allocation (min/avg/max) = 80.09 | 80.09 | 80.09 Mbytes Step Temp Press TotEng Volume Lx Ly Lz Pxx Pyy Pzz Pxy Pyz Pxz - 0 0 -34026.791 -2793.6042 1810.0985 9.832 8.514762 21.6216 -37470.578 -37470.432 -27139.363 -6.4345368e-12 0.94245783 4.2212262e-10 + 0 0 -34026.791 -2793.6042 1810.0985 9.832 8.514762 21.6216 -37470.578 -37470.432 -27139.363 3.7975984e-11 0.94245783 8.5085457e-11 200 170.7381 43248.332 -2790.8398 1879.164 9.9554912 8.6217086 21.89317 39337.624 42979.126 47428.246 324.91326 454.85872 -2034.6053 - 400 258.09921 -28257.8 -2788.3487 1856.1432 9.9146707 8.5863569 21.803402 -19478.873 -29571.375 -35723.152 4633.9026 8487.8103 -626.12005 - 600 277.77032 -22751.351 -2786.2715 1866.9783 9.9339253 8.6030319 21.845744 -21727.335 -29200.027 -17326.692 -4327.8571 -8218.4965 252.30681 - 800 349.8665 30508.003 -2784.2204 1873.4953 9.9454706 8.6130304 21.871134 29929.055 33562.672 28032.281 -3188.5605 12329.482 7558.5678 - 1000 373.67651 -18839.569 -2783.2178 1855.5937 9.9136922 8.5855095 21.80125 -18063.486 -22288.321 -16166.902 -416.09547 -10368.975 9030.4208 - 1200 423.3474 6846.9905 -2781.9271 1896.2131 9.9855083 8.6477041 21.959181 2147.3938 11765.857 6627.7202 -7627.6782 -1297.6517 -4758.4746 - 1400 418.54527 -6416.7506 -2781.4358 1834.2719 9.8755745 8.5524986 21.717425 5693.0543 -19487.901 -5455.405 827.66513 -523.1508 -3890.9919 - 1600 429.42796 3939.8836 -2780.5861 1895.8859 9.984934 8.6472068 21.957918 3755.6959 -1326.4343 9390.3893 1948.1153 4489.8629 1466.0914 - 1800 447.7623 -8344.6306 -2780.1071 1858.4925 9.9188518 8.5899779 21.812596 -17549.498 3336.8135 -10821.208 1643.4226 -644.56065 -8935.9666 - 2000 438.1306 -6691.4691 -2780.7407 1871.3547 9.9416812 8.6097487 21.862801 -6959.2196 -8486.8466 -4628.341 -1019.9006 443.03694 -2751.917 -Loop time of 2.46815 on 1 procs for 2000 steps with 144 atoms + 400 258.09921 -28257.8 -2788.3487 1856.1432 9.9146707 8.5863569 21.803402 -19478.873 -29571.375 -35723.151 4633.9025 8487.8103 -626.12008 + 600 277.77032 -22751.351 -2786.2715 1866.9783 9.9339253 8.6030319 21.845744 -21727.333 -29200.028 -17326.691 -4327.8577 -8218.4994 252.30614 + 800 349.8665 30508.004 -2784.2204 1873.4953 9.9454706 8.6130304 21.871134 29929.053 33562.675 28032.284 -3188.5636 12329.485 7558.5604 + 1000 373.67652 -18839.562 -2783.2178 1855.5937 9.9136922 8.5855095 21.80125 -18063.481 -22288.32 -16166.887 -416.09489 -10368.975 9030.4151 + 1200 423.34739 6846.9842 -2781.9271 1896.2131 9.9855083 8.6477041 21.959181 2147.3919 11765.847 6627.7141 -7627.6762 -1297.649 -4758.4757 + 1400 418.54526 -6416.7547 -2781.4358 1834.2719 9.8755745 8.5524986 21.717425 5693.0508 -19487.901 -5455.4139 827.66188 -523.1469 -3890.9904 + 1600 429.42798 3939.889 -2780.5861 1895.8859 9.984934 8.6472068 21.957918 3755.6972 -1326.4252 9390.395 1948.1084 4489.8536 1466.083 + 1800 447.76215 -8344.6447 -2780.1071 1858.4925 9.9188519 8.5899779 21.812596 -17549.502 3336.8092 -10821.241 1643.4315 -644.54621 -8935.98 + 2000 438.1305 -6691.4324 -2780.7407 1871.3547 9.9416812 8.6097487 21.8628 -6959.1834 -8486.8262 -4628.2877 -1019.8998 443.04638 -2751.9173 +Loop time of 11.2763 on 1 procs for 2000 steps with 144 atoms -Performance: 70.012 ns/day, 0.343 hours/ns, 810.323 timesteps/s -99.8% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 15.324 ns/day, 1.566 hours/ns, 177.363 timesteps/s +99.5% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 2.0003 | 2.0003 | 2.0003 | 0.0 | 81.04 -Kspace | 0.20006 | 0.20006 | 0.20006 | 0.0 | 8.11 +Pair | 7.9085 | 7.9085 | 7.9085 | 0.0 | 70.13 +Kspace | 2.0339 | 2.0339 | 2.0339 | 0.0 | 18.04 Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.023753 | 0.023753 | 0.023753 | 0.0 | 0.96 -Output | 0.0001986 | 0.0001986 | 0.0001986 | 0.0 | 0.01 -Modify | 0.23896 | 0.23896 | 0.23896 | 0.0 | 9.68 -Other | | 0.004907 | | | 0.20 +Comm | 0.15276 | 0.15276 | 0.15276 | 0.0 | 1.35 +Output | 0.00036049 | 0.00036049 | 0.00036049 | 0.0 | 0.00 +Modify | 1.1706 | 1.1706 | 1.1706 | 0.0 | 10.38 +Other | | 0.01023 | | | 0.09 -Nlocal: 144 ave 144 max 144 min +Nlocal: 144.000 ave 144 max 144 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 3943 ave 3943 max 3943 min +Nghost: 3943.00 ave 3943 max 3943 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 41952 ave 41952 max 41952 min +Neighs: 41952.0 ave 41952 max 41952 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 41952 -Ave neighs/atom = 291.333 +Ave neighs/atom = 291.33333 Neighbor list builds = 0 Dangerous builds = 0 unfix quartz_qtb @@ -185,24 +188,23 @@ QBMSST parameters: Initial pressure calculated on first step Initial volume calculated on first step Initial energy calculated on first step -fix_modify shock energy yes variable dhug equal f_shock[1] variable dray equal f_shock[2] variable lgr_vel equal f_shock[3] variable lgr_pos equal f_shock[4] variable T_qm equal f_shock[5] #Temperature with quantum nuclear correction -thermo_style custom step v_T_qm press etotal vol lx ly lz pzz v_dhug v_dray v_lgr_vel v_lgr_pos +thermo_style custom step v_T_qm press econserve vol lx ly lz pzz v_dhug v_dray v_lgr_vel v_lgr_pos thermo 200 timestep ${delta_t} timestep 0.001 run 1000 PPPM initialization ... - using 12-bit tables for long-range coulomb (src/kspace.cpp:332) - G vector (1/distance) = 0.303132 + using 12-bit tables for long-range coulomb (src/kspace.cpp:339) + G vector (1/distance) = 0.30313178 grid = 9 8 16 stencil order = 5 - estimated absolute RMS force accuracy = 0.00104699 - estimated relative force accuracy = 7.27093e-05 + estimated absolute RMS force accuracy = 0.0010469888 + estimated relative force accuracy = 7.2709348e-05 using double precision FFTW3 3d grid and FFT values/proc = 5520 1152 Neighbor list info ... @@ -223,52 +225,53 @@ Neighbor list info ... stencil: none bin: none Fix QBMSST v0 = 1.87135e+03 -Fix QBMSST p0 = -4.62948e+03 +Fix QBMSST p0 = -4.62942e+03 Fix QBMSST e0 = to be -2.78074e+03 -Fix QBMSST initial strain rate of -4.01096e-01 established by reducing temperature by factor of 5.00000e-02 -Per MPI rank memory allocation (min/avg/max) = 80.1 | 80.1 | 80.1 Mbytes -Step v_T_qm Press TotEng Volume Lx Ly Lz Pzz v_dhug v_dray v_lgr_vel v_lgr_pos - 0 300 -6922.9433 -2780.7394 1871.3547 9.9416812 8.6097487 21.862801 -4819.9907 10.953265 -190.51273 0 0 - 200 294.95797 54876.416 -2779.2988 1723.7621 9.9416812 8.6097487 20.138495 108897.19 -29.773973 -9271.7281 6.1518102 -15.057867 - 400 288.3711 139521.03 -2778.7321 1628.5574 9.9416812 8.6097487 19.026231 222107.71 8.0682073 24727.575 10.120041 -28.714693 - 600 280.56521 98070.281 -2779.8934 1687.2434 9.9416812 8.6097487 19.711852 164558.51 2.6076928 16005.656 7.6739491 -42.705007 - 800 274.94701 106060.26 -2779.2916 1651.0723 9.9416812 8.6097487 19.289269 176842.6 -39.645354 -1804.9466 9.1815975 -56.628078 - 1000 268.47106 189695.34 -2779.4951 1492.6355 9.9416812 8.6097487 17.438272 277351.5 -84.834482 -33116.996 15.785409 -69.870519 -Loop time of 2.05219 on 1 procs for 1000 steps with 144 atoms +Fix QBMSST initial strain rate of -4.01095e-01 established by reducing temperature by factor of 5.00000e-02 +Per MPI rank memory allocation (min/avg/max) = 80.10 | 80.10 | 80.10 Mbytes +Step v_T_qm Press Econserve Volume Lx Ly Lz Pzz v_dhug v_dray v_lgr_vel v_lgr_pos + 0 300 -6922.9066 -2780.7394 1871.3547 9.9416812 8.6097487 21.8628 -4819.9374 10.953262 -190.5127 0 0 + 200 294.95802 54876.628 -2779.2988 1723.7617 9.9416812 8.6097487 20.13849 108897.62 -29.773363 -9271.7016 6.1518278 -15.057866 + 400 288.37122 139520.66 -2778.7321 1628.5573 9.9416812 8.6097487 19.02623 222107.14 8.0673735 24726.892 10.120044 -28.714689 + 600 280.56538 98072.818 -2779.8934 1687.2396 9.9416812 8.6097487 19.711808 164562.57 2.6099747 16006.563 7.6741039 -42.704989 + 800 274.9472 106058.35 -2779.2916 1651.0755 9.9416812 8.6097487 19.289307 176839.13 -39.647552 -1805.8176 9.1814643 -56.628046 + 1000 268.4714 189679.65 -2779.4952 1492.6558 9.9416812 8.6097487 17.43851 277332.66 -84.846841 -33118.917 15.784559 -69.870561 +Loop time of 8.7779 on 1 procs for 1000 steps with 144 atoms -Performance: 42.101 ns/day, 0.570 hours/ns, 487.284 timesteps/s -99.8% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 9.843 ns/day, 2.438 hours/ns, 113.922 timesteps/s +99.2% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 1.6815 | 1.6815 | 1.6815 | 0.0 | 81.94 -Kspace | 0.10373 | 0.10373 | 0.10373 | 0.0 | 5.05 -Neigh | 0.0061183 | 0.0061183 | 0.0061183 | 0.0 | 0.30 -Comm | 0.012444 | 0.012444 | 0.012444 | 0.0 | 0.61 -Output | 0.00014687 | 0.00014687 | 0.00014687 | 0.0 | 0.01 -Modify | 0.24529 | 0.24529 | 0.24529 | 0.0 | 11.95 -Other | | 0.002948 | | | 0.14 +Pair | 6.8031 | 6.8031 | 6.8031 | 0.0 | 77.50 +Kspace | 1.0505 | 1.0505 | 1.0505 | 0.0 | 11.97 +Neigh | 0.024976 | 0.024976 | 0.024976 | 0.0 | 0.28 +Comm | 0.082612 | 0.082612 | 0.082612 | 0.0 | 0.94 +Output | 0.00032592 | 0.00032592 | 0.00032592 | 0.0 | 0.00 +Modify | 0.8108 | 0.8108 | 0.8108 | 0.0 | 9.24 +Other | | 0.005632 | | | 0.06 -Nlocal: 144 ave 144 max 144 min +Nlocal: 144.000 ave 144 max 144 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 4243 ave 4243 max 4243 min +Nghost: 4243.00 ave 4243 max 4243 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 48210 ave 48210 max 48210 min +Neighs: 48210.0 ave 48210 max 48210 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 48210 -Ave neighs/atom = 334.792 +Ave neighs/atom = 334.79167 Neighbor list builds = 8 Dangerous builds = 0 write_restart restart.1000 +System init for write_restart ... PPPM initialization ... - using 12-bit tables for long-range coulomb (src/kspace.cpp:332) - G vector (1/distance) = 0.306435 + using 12-bit tables for long-range coulomb (src/kspace.cpp:339) + G vector (1/distance) = 0.30643517 grid = 9 8 15 stencil order = 5 - estimated absolute RMS force accuracy = 0.000955688 - estimated relative force accuracy = 6.63689e-05 + estimated absolute RMS force accuracy = 0.0009556927 + estimated relative force accuracy = 6.6369185e-05 using double precision FFTW3 3d grid and FFT values/proc = 5280 1080 Neighbor list info ... @@ -294,12 +297,14 @@ Neighbor list info ... clear using 1 OpenMP thread(s) per MPI task read_restart restart.1000 +Reading restart file ... + restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 restoring atom style charge from restart - orthogonal box = (-0.05484062286382799 -0.04749337384227555 2.0916641327653274) to (9.886840622863804 8.562255373842252 19.52993586723476) + orthogonal box = (-0.054840605 -0.047493358 2.0915450) to (9.8868406 8.5622554 19.530055) 1 by 1 by 1 MPI processor grid restoring pair style hybrid/overlay from restart 144 atoms - read_restart CPU = 0.0002563 secs + read_restart CPU = 0.001 seconds include alpha_quartz_potential.mod #This script implements the BKS pair potential for various silicon dioxide compounds. Inner part is fixed with a harmonic potential. Long range Coulomb interactions are evaluated with the pppm method. @@ -314,8 +319,8 @@ pair_coeff 1 2 table potential_SiO2.TPF Si-O ${cut_off} pair_coeff 1 2 table potential_SiO2.TPF Si-O 10 pair_coeff 2 2 table potential_SiO2.TPF O-O ${cut_off} #See the potential file for more information pair_coeff 2 2 table potential_SiO2.TPF O-O 10 -WARNING: 1 of 39901 force values in table are inconsistent with -dE/dr. - Should only be flagged at inflection points (src/pair_table.cpp:471) +WARNING: 1 of 39901 force values in table O-O are inconsistent with -dE/dr. + Should only be flagged at inflection points (src/pair_table.cpp:461) kspace_style pppm 1.0e-4 #Neighbor style @@ -338,25 +343,24 @@ QBMSST parameters: Initial energy calculated on first step Resetting global fix info from restart file: fix style: qbmsst, fix ID: shock -fix_modify shock energy yes variable dhug equal f_shock[1] variable dray equal f_shock[2] variable lgr_vel equal f_shock[3] variable lgr_pos equal f_shock[4] variable T_qm equal f_shock[5] #Temperature with quantum nuclear correction -thermo_style custom step v_T_qm press etotal vol lx ly lz pzz v_dhug v_dray v_lgr_vel v_lgr_pos +thermo_style custom step v_T_qm press econserve vol lx ly lz pzz v_dhug v_dray v_lgr_vel v_lgr_pos thermo 500 timestep ${delta_t} timestep 0.001 -restart 1000 restart +#restart 1000 restart run 10000 #10 ps PPPM initialization ... - using 12-bit tables for long-range coulomb (src/kspace.cpp:332) - G vector (1/distance) = 0.306435 + using 12-bit tables for long-range coulomb (src/kspace.cpp:339) + G vector (1/distance) = 0.30643517 grid = 9 8 15 stencil order = 5 - estimated absolute RMS force accuracy = 0.000955688 - estimated relative force accuracy = 6.63689e-05 + estimated absolute RMS force accuracy = 0.0009556927 + estimated relative force accuracy = 6.6369185e-05 using double precision FFTW3 3d grid and FFT values/proc = 5280 1080 All restart file global fix info was re-assigned @@ -378,53 +382,54 @@ Neighbor list info ... stencil: none bin: none Per MPI rank memory allocation (min/avg/max) = 80.12 | 80.12 | 80.12 Mbytes -Step v_T_qm Press TotEng Volume Lx Ly Lz Pzz v_dhug v_dray v_lgr_vel v_lgr_pos - 1000 268.47106 189686.77 -2781.5194 1492.6355 9.9416812 8.6097487 17.438272 277378.37 -84.692548 -33090.129 15.785409 0 - 1500 362.13476 692245.96 -2800.9352 1011.2037 9.9416812 8.6097487 11.813766 661095.53 188.71833 -49928.712 35.851981 -24.11484 - 2000 860.78914 714816.8 -2830.893 997.64749 9.9416812 8.6097487 11.65539 653537.64 852.68158 -68765.537 36.41702 -44.978484 - 2500 1620.8281 709511.19 -2840.8217 1000.3425 9.9416812 8.6097487 11.686875 660030.01 1184.3105 -60030.892 36.304689 -65.69966 - 3000 2395.6824 649526.84 -2832.6859 995.56591 9.9416812 8.6097487 11.631071 660984.37 939.07209 -63050.693 36.503782 -86.383242 - 3500 3034.6774 715794.56 -2822.6098 995.8622 9.9416812 8.6097487 11.634532 712849.74 1055.7295 -10938.816 36.491433 -106.99315 - 4000 3487.9039 736791.25 -2804.1216 994.13867 9.9416812 8.6097487 11.614397 765817.85 943.15747 40595.305 36.563271 -127.76315 - 4500 3718.6279 813775.8 -2788.1942 995.82514 9.9416812 8.6097487 11.634099 881961.06 1370.5559 158141.68 36.492977 -148.68649 - 5000 3691.4947 750146.58 -2770.5541 1018.4785 9.9416812 8.6097487 11.898756 770500.36 196.2793 65528.786 35.548762 -169.8589 - 5500 3585.8602 831522.51 -2766.0198 1005.6834 9.9416812 8.6097487 11.749273 916093.67 1088.1987 200476.48 36.082073 -190.89436 - 6000 3431.6405 749891.94 -2771.6404 1011.9077 9.9416812 8.6097487 11.82199 781321.11 268.24344 70882.55 35.82264 -212.20913 - 6500 3350.2876 666113.16 -2780.4124 1028.8353 9.9416812 8.6097487 12.019753 749294.32 371.38231 52939.676 35.117081 -233.59556 - 7000 3339.2397 675783.2 -2782.7559 1022.6541 9.9416812 8.6097487 11.947539 690109.39 -26.949124 -11388.054 35.374719 -254.95868 - 7500 3395.582 726601.74 -2784.7652 1018.1439 9.9416812 8.6097487 11.894846 759167.86 506.5811 53917.852 35.56271 -276.24361 - 8000 3393.2372 625141.93 -2771.6398 1035.4915 9.9416812 8.6097487 12.097517 598674.46 -895.80046 -92142.112 34.839641 -297.61681 - 8500 3272.9752 659367.77 -2776.608 1031.8188 9.9416812 8.6097487 12.054609 688358.42 -142.30814 -5513.8593 34.992722 -318.94541 - 9000 3277.8848 724828.76 -2777.6502 1017.6314 9.9416812 8.6097487 11.888859 724452.11 58.574942 18775.738 35.58407 -340.1718 - 9500 3273.7854 620652.38 -2780.0794 1023.5922 9.9416812 8.6097487 11.958499 747175.42 317.3826 46458.505 35.335617 -361.41643 - 10000 3329.1766 668606.38 -2786.3493 1022.9534 9.9416812 8.6097487 11.951035 703351.81 168.14538 2103.38 35.362244 -382.64609 - 10500 3398.9956 642919.16 -2784.2833 1016.2587 9.9416812 8.6097487 11.872822 661298.16 -230.03577 -45520.34 35.641287 -403.78721 - 11000 3418.7053 675754.06 -2782.6318 1005.7483 9.9416812 8.6097487 11.75003 689789.84 -136.97148 -25773.422 36.079372 -424.97556 -Loop time of 32.4277 on 1 procs for 10000 steps with 144 atoms +Step v_T_qm Press Econserve Volume Lx Ly Lz Pzz v_dhug v_dray v_lgr_vel v_lgr_pos + 1000 268.4714 189671.09 -2781.5189 1492.6558 9.9416812 8.6097487 17.43851 277359.52 -84.704915 -33092.054 15.784559 0 + 1500 362.24943 690690.88 -2801.3189 1013.1871 9.9416812 8.6097487 11.836938 660912.81 210.15736 -48461.278 35.76931 -24.117097 + 2000 851.29288 687202.75 -2829.28 998.92158 9.9416812 8.6097487 11.670275 702779.72 1177.175 -18463.457 36.363914 -45.102068 + 2500 1584.7231 702373.6 -2840.9926 998.47448 9.9416812 8.6097487 11.665052 685551.65 1366.7769 -36063.512 36.382549 -65.966813 + 3000 2369.1915 765783.04 -2835.3495 994.53954 9.9416812 8.6097487 11.61908 742616.98 1609.2532 17727.912 36.546562 -86.541922 + 3500 3092.3052 829161.44 -2827.8974 977.82563 9.9416812 8.6097487 11.423814 768559.05 1500.9858 29763.85 37.243215 -107.10048 + 4000 3627.1538 773057.81 -2813.687 988.31955 9.9416812 8.6097487 11.546413 738541.81 959.39292 8477.6525 36.805818 -127.75274 + 4500 3910.5455 753799.74 -2790.7863 1002.749 9.9416812 8.6097487 11.71499 763069.75 602.0127 45010.991 36.204385 -148.51594 + 5000 3976.7913 761978.62 -2782.0448 998.85434 9.9416812 8.6097487 11.669489 780709.6 482.34112 59410.482 36.366717 -169.42341 + 5500 3928.0113 702739.91 -2765.8379 1008.695 9.9416812 8.6097487 11.784456 632171.28 -991.2791 -80940.344 35.956549 -190.30951 + 6000 3731.5486 654300.14 -2763.1253 1032.1476 9.9416812 8.6097487 12.05845 642590.19 -832.8417 -51008.602 34.979018 -211.41573 + 6500 3505.5984 713092.19 -2767.3169 1010.6873 9.9416812 8.6097487 11.807732 735218.98 -176.4579 23764.995 35.873507 -232.57305 + 7000 3348.5047 762624.48 -2769.0996 1010.8032 9.9416812 8.6097487 11.809086 662703.98 -667.90587 -48653.562 35.868676 -253.64668 + 7500 3197.2839 689038.79 -2770.7583 1036.994 9.9416812 8.6097487 12.11507 679188.92 -330.37222 -10377.635 34.777016 -275.06425 + 8000 3117.1867 765531.79 -2775.0143 1023.9741 9.9416812 8.6097487 11.96296 681640.02 -288.82226 -18759.215 35.319699 -296.38453 + 8500 3053.5599 667992.24 -2772.057 1027.6458 9.9416812 8.6097487 12.005857 657921.43 -507.92809 -39422.884 35.166657 -317.64367 + 9000 2997.4957 704542.99 -2780.9279 1020.074 9.9416812 8.6097487 11.917396 647510.98 -398.1601 -56133.168 35.482259 -338.8598 + 9500 2990.5818 810181.5 -2783.2413 1002.8927 9.9416812 8.6097487 11.716669 859476.58 1107.5241 141537.42 36.198393 -359.85577 + 10000 3055.8298 792271.02 -2786.5277 991.62826 9.9416812 8.6097487 11.585068 847298.17 1051.5369 119986.89 36.667907 -380.83279 + 10500 3159.7134 706528.08 -2793.5555 1009.9173 9.9416812 8.6097487 11.798737 673106.83 67.67511 -38987.761 35.905599 -401.74903 + 11000 3261.7609 748345.85 -2783.0699 1017.8806 9.9416812 8.6097487 11.891771 656140.32 -267.8786 -49328.779 35.573683 -422.65593 +Loop time of 130.289 on 1 procs for 10000 steps with 144 atoms -Performance: 26.644 ns/day, 0.901 hours/ns, 308.378 timesteps/s -99.5% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 6.631 ns/day, 3.619 hours/ns, 76.752 timesteps/s +99.6% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 28.397 | 28.397 | 28.397 | 0.0 | 87.57 -Kspace | 1.0225 | 1.0225 | 1.0225 | 0.0 | 3.15 -Neigh | 0.27594 | 0.27594 | 0.27594 | 0.0 | 0.85 -Comm | 0.1797 | 0.1797 | 0.1797 | 0.0 | 0.55 -Output | 0.10409 | 0.10409 | 0.10409 | 0.0 | 0.32 -Modify | 2.4112 | 2.4112 | 2.4112 | 0.0 | 7.44 -Other | | 0.03707 | | | 0.11 +Pair | 109.8 | 109.8 | 109.8 | 0.0 | 84.27 +Kspace | 10.328 | 10.328 | 10.328 | 0.0 | 7.93 +Neigh | 1.0855 | 1.0855 | 1.0855 | 0.0 | 0.83 +Comm | 1.2041 | 1.2041 | 1.2041 | 0.0 | 0.92 +Output | 0.0012848 | 0.0012848 | 0.0012848 | 0.0 | 0.00 +Modify | 7.8094 | 7.8094 | 7.8094 | 0.0 | 5.99 +Other | | 0.06511 | | | 0.05 -Nlocal: 144 ave 144 max 144 min +Nlocal: 144.000 ave 144 max 144 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 5541 ave 5541 max 5541 min +Nghost: 5430.00 ave 5430 max 5430 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 74662 ave 74662 max 74662 min +Neighs: 72807.0 ave 72807 max 72807 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Total # of neighbors = 74662 -Ave neighs/atom = 518.486 -Neighbor list builds = 207 +Total # of neighbors = 72807 +Ave neighs/atom = 505.60417 +Neighbor list builds = 206 Dangerous builds = 0 -Total wall time: 0:00:37 +shell rm restart.1000 +Total wall time: 0:02:32 diff --git a/examples/USER/qtb/alpha_quartz_qbmsst/log.15Jun20.alpha_quartz_qbmsst.g++.4 b/examples/USER/qtb/alpha_quartz_qbmsst/log.09Feb21.alpha_quartz_qbmsst.g++.4 similarity index 63% rename from examples/USER/qtb/alpha_quartz_qbmsst/log.15Jun20.alpha_quartz_qbmsst.g++.4 rename to examples/USER/qtb/alpha_quartz_qbmsst/log.09Feb21.alpha_quartz_qbmsst.g++.4 index 58738cd639..024ca3cc3f 100644 --- a/examples/USER/qtb/alpha_quartz_qbmsst/log.15Jun20.alpha_quartz_qbmsst.g++.4 +++ b/examples/USER/qtb/alpha_quartz_qbmsst/log.09Feb21.alpha_quartz_qbmsst.g++.4 @@ -1,4 +1,4 @@ -LAMMPS (15 Jun 2020) +LAMMPS (24 Dec 2020) using 1 OpenMP thread(s) per MPI task ## This script first uses fix qtb to equilibrate alpha quartz structure to an initial state with quantum nuclear correction and then simulate shock induced phase transition through the quantum thermal bath multi-scale shock technique variable x_rep equal 2 #plot is made with x_rep = 8 #x-direction replication number @@ -29,12 +29,12 @@ atom_style charge #Lattice lattice custom 1.0 a1 4.916000 0.000000 0.000000 a2 -2.45800 4.257381 0.000000 a3 0.000000 0.000000 5.405400 basis 0.469700 0.000000 0.000000 basis 0.000000 0.469700 0.666667 basis 0.530300 0.530300 0.333333 basis 0.413500 0.266900 0.119100 basis 0.266900 0.413500 0.547567 basis 0.733100 0.146600 0.785767 basis 0.586500 0.853400 0.214233 basis 0.853400 0.586500 0.452433 basis 0.146600 0.733100 0.880900 #American Mineralogist 65 920 1980 (Space Group 154) -Lattice spacing in x,y,z = 7.374 4.25738 5.4054 +Lattice spacing in x,y,z = 7.3740000 4.2573810 5.4054000 #Computational Cell region orthorhombic_unit_cell block 0 4.916000 0 8.514762 0 5.405400 units box create_box 2 orthorhombic_unit_cell -Created orthogonal box = (0.0 0.0 0.0) to (4.916 8.514762 5.4054) +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (4.9160000 8.5147620 5.4054000) 1 by 2 by 2 MPI processor grid create_atoms 1 box basis 1 1 basis 2 1 basis 3 1 basis 4 2 basis 5 2 basis 6 2 basis 7 2 basis 8 2 basis 9 2 Created 18 atoms @@ -43,17 +43,20 @@ replicate ${x_rep} ${y_rep} ${z_rep} replicate 2 ${y_rep} ${z_rep} replicate 2 1 ${z_rep} replicate 2 1 4 - orthogonal box = (0.0 0.0 0.0) to (9.832 8.514762 21.6216) +Replicating atoms ... + orthogonal box = (0.0000000 0.0000000 0.0000000) to (9.8320000 8.5147620 21.621600) 1 by 1 by 4 MPI processor grid 144 atoms - replicate CPU = 0.000225782 secs + replicate CPU = 0.001 seconds #Atomic Information mass 1 28.085500 mass 2 15.999400 set type 1 charge +2.4 +Setting atom values ... 48 settings made for charge set type 2 charge -1.2 +Setting atom values ... 96 settings made for charge @@ -72,8 +75,8 @@ pair_coeff 1 2 table potential_SiO2.TPF Si-O ${cut_off} pair_coeff 1 2 table potential_SiO2.TPF Si-O 10 pair_coeff 2 2 table potential_SiO2.TPF O-O ${cut_off} #See the potential file for more information pair_coeff 2 2 table potential_SiO2.TPF O-O 10 -WARNING: 1 of 39901 force values in table are inconsistent with -dE/dr. - Should only be flagged at inflection points (src/pair_table.cpp:471) +WARNING: 1 of 39901 force values in table O-O are inconsistent with -dE/dr. + Should only be flagged at inflection points (src/pair_table.cpp:461) kspace_style pppm 1.0e-4 #Neighbor style @@ -96,12 +99,12 @@ thermo_style custom step temp press etotal vol lx ly lz pxx pyy pzz p thermo 200 run 2000 # 2 ps PPPM initialization ... - using 12-bit tables for long-range coulomb (src/kspace.cpp:332) - G vector (1/distance) = 0.301598 + using 12-bit tables for long-range coulomb (src/kspace.cpp:339) + G vector (1/distance) = 0.30159814 grid = 9 8 15 stencil order = 5 - estimated absolute RMS force accuracy = 0.00117056 - estimated relative force accuracy = 8.12908e-05 + estimated absolute RMS force accuracy = 0.0011705589 + estimated relative force accuracy = 8.1290814e-05 using double precision FFTW3 3d grid and FFT values/proc = 2400 288 Neighbor list info ... @@ -121,44 +124,44 @@ Neighbor list info ... pair build: skip stencil: none bin: none -Per MPI rank memory allocation (min/avg/max) = 79.7 | 79.7 | 79.7 Mbytes +Per MPI rank memory allocation (min/avg/max) = 79.70 | 79.70 | 79.70 Mbytes Step Temp Press TotEng Volume Lx Ly Lz Pxx Pyy Pzz Pxy Pyz Pxz - 0 0 -34026.791 -2793.6042 1810.0985 9.832 8.514762 21.6216 -37470.578 -37470.432 -27139.363 1.0530512e-10 0.94245783 4.0087238e-10 + 0 0 -34026.791 -2793.6042 1810.0985 9.832 8.514762 21.6216 -37470.578 -37470.432 -27139.363 -3.2012455e-11 0.94245783 1.6892124e-10 200 153.57631 45538.205 -2790.8177 1873.0866 9.9447472 8.612404 21.869543 41721.016 44095.248 50798.351 -3961.4596 1223.325 2871.656 400 234.74785 -34404.175 -2789.0189 1850.2127 9.9041 8.5772024 21.780156 -28329.333 -39376.313 -35506.88 -1154.5043 -5411.1071 2246.6749 - 600 265.24833 -20905.145 -2786.2727 1874.9981 9.948129 8.6153326 21.87698 -22753.886 -21091.083 -18870.468 -4645.5548 2968.2945 1415.0311 - 800 297.79035 32990.58 -2784.8247 1853.6946 9.910309 8.5825796 21.79381 30061.364 35359.18 33551.195 -3092.2971 1525.52 -6461.0249 - 1000 367.71884 -27539.239 -2783.0102 1864.7161 9.9299114 8.5995557 21.836917 -20273.387 -38720.429 -23623.901 7639.0334 -866.35665 543.52723 - 1200 399.77109 3807.7814 -2781.511 1893.4978 9.9807399 8.6435745 21.948695 1625.8226 7441.2236 2356.298 -4057.1674 3814.9305 1528.4567 - 1400 466.57962 -4148.235 -2780.1546 1851.5925 9.9065614 8.5793341 21.785568 -10883.19 1816.768 -3378.2828 896.25296 -7208.541 -42.253127 - 1600 497.86539 14505.31 -2778.9409 1882.2616 9.9609584 8.6264432 21.905193 8268.1103 20614.738 14633.082 -2690.5669 6807.3187 11995.878 - 1800 557.31182 -108.04462 -2778.1875 1875.514 9.9490413 8.6161228 21.878986 948.68308 -1929.7575 656.94053 -1628.2172 -6594.5909 -4423.4368 - 2000 480.39449 -8852.2243 -2778.4963 1862.9552 9.9267847 8.596848 21.830042 -18274.307 3038.8369 -11321.203 -5002.1016 12023.282 6845.2769 -Loop time of 1.42181 on 4 procs for 2000 steps with 144 atoms + 600 265.24834 -20905.145 -2786.2727 1874.9981 9.948129 8.6153326 21.87698 -22753.885 -21091.083 -18870.467 -4645.5539 2968.2936 1415.0335 + 800 297.79036 32990.577 -2784.8247 1853.6946 9.910309 8.5825796 21.79381 30061.366 35359.175 33551.191 -3092.2938 1525.518 -6461.029 + 1000 367.71885 -27539.237 -2783.0102 1864.7161 9.9299114 8.5995557 21.836917 -20273.384 -38720.43 -23623.895 7639.0325 -866.34777 543.5312 + 1200 399.7711 3807.785 -2781.511 1893.4978 9.9807399 8.6435745 21.948695 1625.8297 7441.2317 2356.2937 -4057.1659 3814.9292 1528.4637 + 1400 466.57958 -4148.2231 -2780.1546 1851.5925 9.9065614 8.5793341 21.785568 -10883.182 1816.778 -3378.2653 896.24645 -7208.5417 -42.262464 + 1600 497.86536 14505.308 -2778.9409 1882.2616 9.9609584 8.6264432 21.905193 8268.1088 20614.74 14633.075 -2690.5703 6807.3188 11995.875 + 1800 557.31178 -108.02787 -2778.1875 1875.514 9.9490413 8.6161228 21.878986 948.70277 -1929.753 656.96663 -1628.2124 -6594.6026 -4423.4256 + 2000 480.39444 -8852.2282 -2778.4963 1862.9552 9.9267847 8.596848 21.830042 -18274.302 3038.8276 -11321.21 -5002.1095 12023.298 6845.2631 +Loop time of 4.1373 on 4 procs for 2000 steps with 144 atoms -Performance: 121.535 ns/day, 0.197 hours/ns, 1406.656 timesteps/s -87.5% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 41.766 ns/day, 0.575 hours/ns, 483.407 timesteps/s +96.8% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.72578 | 0.80093 | 0.87518 | 6.1 | 56.33 -Kspace | 0.33737 | 0.41245 | 0.48642 | 8.4 | 29.01 +Pair | 2.2821 | 2.4503 | 2.7881 | 12.7 | 59.22 +Kspace | 0.81032 | 1.1413 | 1.306 | 18.2 | 27.59 Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.066098 | 0.071334 | 0.076039 | 1.6 | 5.02 -Output | 0.00021172 | 0.00039291 | 0.00093484 | 0.0 | 0.03 -Modify | 0.090105 | 0.1077 | 0.11384 | 3.1 | 7.58 -Other | | 0.029 | | | 2.04 +Comm | 0.16143 | 0.16964 | 0.17659 | 1.3 | 4.10 +Output | 0.00026584 | 0.00061899 | 0.0016773 | 0.0 | 0.01 +Modify | 0.29943 | 0.33639 | 0.34927 | 3.7 | 8.13 +Other | | 0.03911 | | | 0.95 -Nlocal: 36 ave 36 max 36 min +Nlocal: 36.0000 ave 36 max 36 min Histogram: 4 0 0 0 0 0 0 0 0 0 -Nghost: 2614 ave 2614 max 2614 min +Nghost: 2614.00 ave 2614 max 2614 min Histogram: 4 0 0 0 0 0 0 0 0 0 -Neighs: 10488 ave 11326 max 9404 min +Neighs: 10488.0 ave 11326 max 9404 min Histogram: 1 0 0 0 0 0 2 0 0 1 Total # of neighbors = 41952 -Ave neighs/atom = 291.333 +Ave neighs/atom = 291.33333 Neighbor list builds = 0 Dangerous builds = 0 unfix quartz_qtb @@ -185,24 +188,23 @@ QBMSST parameters: Initial pressure calculated on first step Initial volume calculated on first step Initial energy calculated on first step -fix_modify shock energy yes variable dhug equal f_shock[1] variable dray equal f_shock[2] variable lgr_vel equal f_shock[3] variable lgr_pos equal f_shock[4] variable T_qm equal f_shock[5] #Temperature with quantum nuclear correction -thermo_style custom step v_T_qm press etotal vol lx ly lz pzz v_dhug v_dray v_lgr_vel v_lgr_pos +thermo_style custom step v_T_qm press econserve vol lx ly lz pzz v_dhug v_dray v_lgr_vel v_lgr_pos thermo 200 timestep ${delta_t} timestep 0.001 run 1000 PPPM initialization ... - using 12-bit tables for long-range coulomb (src/kspace.cpp:332) - G vector (1/distance) = 0.30088 + using 12-bit tables for long-range coulomb (src/kspace.cpp:339) + G vector (1/distance) = 0.30087967 grid = 9 8 15 stencil order = 5 - estimated absolute RMS force accuracy = 0.00120534 - estimated relative force accuracy = 8.37062e-05 + estimated absolute RMS force accuracy = 0.0012053392 + estimated relative force accuracy = 8.3706174e-05 using double precision FFTW3 3d grid and FFT values/proc = 2400 288 Neighbor list info ... @@ -225,50 +227,51 @@ Neighbor list info ... Fix QBMSST v0 = 1.86296e+03 Fix QBMSST p0 = -1.13219e+04 Fix QBMSST e0 = to be -2.77850e+03 -Fix QBMSST initial strain rate of -4.21890e-01 established by reducing temperature by factor of 5.00000e-02 -Per MPI rank memory allocation (min/avg/max) = 79.7 | 79.7 | 79.7 Mbytes -Step v_T_qm Press TotEng Volume Lx Ly Lz Pzz v_dhug v_dray v_lgr_vel v_lgr_pos - 0 300 -9106.318 -2778.4963 1862.9552 9.9267847 8.596848 21.830042 -11562.002 12.009862 -240.0699 0 0 - 200 296.47213 25984.111 -2777.5178 1770.2164 9.9267847 8.596848 20.743332 64970.204 -25.305765 -1564.7673 3.8828772 -15.16768 - 400 291.06707 69977.517 -2777.6325 1684.893 9.9267847 8.596848 19.743515 144833.82 -12.184734 6667.384 7.4552796 -29.607028 - 600 287.21118 39706.699 -2778.0322 1716.9533 9.9267847 8.596848 20.119196 87971.152 -38.593844 -23279.741 6.1129484 -43.751298 - 800 284.33611 18833.281 -2778.1637 1792.7576 9.9267847 8.596848 21.007468 43725.433 -8.1267799 -3885.5802 2.9391022 -58.454556 - 1000 281.98328 -6030.6935 -2778.3314 1881.8369 9.9267847 8.596848 22.051297 -14118.602 1.3183874 13055.078 -0.79055793 -73.780965 -Loop time of 1.25215 on 4 procs for 1000 steps with 144 atoms +Fix QBMSST initial strain rate of -4.21889e-01 established by reducing temperature by factor of 5.00000e-02 +Per MPI rank memory allocation (min/avg/max) = 79.70 | 79.70 | 79.70 Mbytes +Step v_T_qm Press Econserve Volume Lx Ly Lz Pzz v_dhug v_dray v_lgr_vel v_lgr_pos + 0 300 -9106.3219 -2778.4963 1862.9552 9.9267847 8.596848 21.830042 -11562.009 12.009861 -240.06987 0 0 + 200 296.47212 25984.099 -2777.5178 1770.2165 9.9267847 8.596848 20.743332 64970.178 -25.305804 -1564.7427 3.8828751 -15.16768 + 400 291.06704 69977.415 -2777.6325 1684.8932 9.9267847 8.596848 19.743517 144833.61 -12.18477 6667.3264 7.4552723 -29.607029 + 600 287.21114 39706.769 -2778.0322 1716.9533 9.9267847 8.596848 20.119196 87971.211 -38.594057 -23279.705 6.1129499 -43.7513 + 800 284.33606 18833.325 -2778.1637 1792.7575 9.9267847 8.596848 21.007467 43725.516 -8.1270751 -3885.5508 2.9391052 -58.454557 + 1000 281.98323 -6030.7047 -2778.3314 1881.8368 9.9267847 8.596848 22.051295 -14118.589 1.3182589 13054.989 -0.79055248 -73.780966 +Loop time of 3.32539 on 4 procs for 1000 steps with 144 atoms -Performance: 69.001 ns/day, 0.348 hours/ns, 798.628 timesteps/s -90.6% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 25.982 ns/day, 0.924 hours/ns, 300.717 timesteps/s +97.0% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.67979 | 0.73665 | 0.8091 | 5.4 | 58.83 -Kspace | 0.18687 | 0.25893 | 0.31544 | 9.1 | 20.68 -Neigh | 0.0011306 | 0.0012404 | 0.0013735 | 0.3 | 0.10 -Comm | 0.040339 | 0.041345 | 0.042296 | 0.4 | 3.30 -Output | 0.00020051 | 0.00035506 | 0.00081801 | 0.0 | 0.03 -Modify | 0.19595 | 0.2007 | 0.20253 | 0.6 | 16.03 -Other | | 0.01292 | | | 1.03 +Pair | 1.9626 | 2.0842 | 2.2541 | 7.9 | 62.68 +Kspace | 0.44255 | 0.61231 | 0.73369 | 14.5 | 18.41 +Neigh | 0.0050733 | 0.0052404 | 0.0053804 | 0.2 | 0.16 +Comm | 0.077084 | 0.077385 | 0.077714 | 0.1 | 2.33 +Output | 0.00029039 | 0.00046909 | 0.0010037 | 0.0 | 0.01 +Modify | 0.50853 | 0.52962 | 0.53724 | 1.7 | 15.93 +Other | | 0.01615 | | | 0.49 -Nlocal: 36 ave 38 max 34 min +Nlocal: 36.0000 ave 38 max 34 min Histogram: 1 0 1 0 0 0 0 1 0 1 -Nghost: 2527.75 ave 2547 max 2518 min +Nghost: 2527.75 ave 2547 max 2518 min Histogram: 2 0 0 1 0 0 0 0 0 1 -Neighs: 10194.8 ave 11177 max 9437 min +Neighs: 10194.8 ave 11177 max 9437 min Histogram: 2 0 0 0 0 0 1 0 0 1 Total # of neighbors = 40779 -Ave neighs/atom = 283.188 +Ave neighs/atom = 283.18750 Neighbor list builds = 6 Dangerous builds = 0 write_restart restart.1000 +System init for write_restart ... PPPM initialization ... - using 12-bit tables for long-range coulomb (src/kspace.cpp:332) - G vector (1/distance) = 0.302953 + using 12-bit tables for long-range coulomb (src/kspace.cpp:339) + G vector (1/distance) = 0.30295266 grid = 9 8 16 stencil order = 5 - estimated absolute RMS force accuracy = 0.00105569 - estimated relative force accuracy = 7.33134e-05 + estimated absolute RMS force accuracy = 0.0010556863 + estimated relative force accuracy = 7.3313358e-05 using double precision FFTW3 3d grid and FFT values/proc = 2640 288 Neighbor list info ... @@ -294,12 +297,14 @@ Neighbor list info ... clear using 1 OpenMP thread(s) per MPI task read_restart restart.1000 +Reading restart file ... + restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 restoring atom style charge from restart - orthogonal box = (-0.04739235907204603 -0.041042988010289584 -0.21484841641189512) to (9.879392359072014 8.555804988010294 21.83644841641206) + orthogonal box = (-0.047392358 -0.041042987 -0.21484765) to (9.8793924 8.5558050 21.836448) 1 by 1 by 4 MPI processor grid restoring pair style hybrid/overlay from restart 144 atoms - read_restart CPU = 0.000472307 secs + read_restart CPU = 0.009 seconds include alpha_quartz_potential.mod #This script implements the BKS pair potential for various silicon dioxide compounds. Inner part is fixed with a harmonic potential. Long range Coulomb interactions are evaluated with the pppm method. @@ -314,8 +319,8 @@ pair_coeff 1 2 table potential_SiO2.TPF Si-O ${cut_off} pair_coeff 1 2 table potential_SiO2.TPF Si-O 10 pair_coeff 2 2 table potential_SiO2.TPF O-O ${cut_off} #See the potential file for more information pair_coeff 2 2 table potential_SiO2.TPF O-O 10 -WARNING: 1 of 39901 force values in table are inconsistent with -dE/dr. - Should only be flagged at inflection points (src/pair_table.cpp:471) +WARNING: 1 of 39901 force values in table O-O are inconsistent with -dE/dr. + Should only be flagged at inflection points (src/pair_table.cpp:461) kspace_style pppm 1.0e-4 #Neighbor style @@ -338,25 +343,24 @@ QBMSST parameters: Initial energy calculated on first step Resetting global fix info from restart file: fix style: qbmsst, fix ID: shock -fix_modify shock energy yes variable dhug equal f_shock[1] variable dray equal f_shock[2] variable lgr_vel equal f_shock[3] variable lgr_pos equal f_shock[4] variable T_qm equal f_shock[5] #Temperature with quantum nuclear correction -thermo_style custom step v_T_qm press etotal vol lx ly lz pzz v_dhug v_dray v_lgr_vel v_lgr_pos +thermo_style custom step v_T_qm press econserve vol lx ly lz pzz v_dhug v_dray v_lgr_vel v_lgr_pos thermo 500 timestep ${delta_t} timestep 0.001 -restart 1000 restart +#restart 1000 restart run 10000 #10 ps PPPM initialization ... - using 12-bit tables for long-range coulomb (src/kspace.cpp:332) - G vector (1/distance) = 0.302953 + using 12-bit tables for long-range coulomb (src/kspace.cpp:339) + G vector (1/distance) = 0.30295266 grid = 9 8 16 stencil order = 5 - estimated absolute RMS force accuracy = 0.00105569 - estimated relative force accuracy = 7.33134e-05 + estimated absolute RMS force accuracy = 0.0010556863 + estimated relative force accuracy = 7.3313358e-05 using double precision FFTW3 3d grid and FFT values/proc = 2640 288 All restart file global fix info was re-assigned @@ -378,53 +382,54 @@ Neighbor list info ... stencil: none bin: none Per MPI rank memory allocation (min/avg/max) = 79.71 | 79.71 | 79.71 Mbytes -Step v_T_qm Press TotEng Volume Lx Ly Lz Pzz v_dhug v_dray v_lgr_vel v_lgr_pos - 1000 281.98328 -6031.2395 -2778.6227 1881.8369 9.9267847 8.596848 22.051297 -14113.621 1.3373278 13060.059 -0.79055793 0 - 1500 266.12746 44405.573 -2777.9815 1739.6543 9.9267847 8.596848 20.385206 92590.239 -12.06041 397.47049 5.1624821 -37.823748 - 2000 255.79411 17620.408 -2777.9685 1785.7619 9.9267847 8.596848 20.925494 48670.364 -16.082827 -4813.6764 3.2320016 -73.974437 - 2500 256.8887 40153.833 -2778.4337 1752.9461 9.9267847 8.596848 20.540959 79665.002 7.7413878 -1368.8927 4.6059671 -112.35254 - 3000 261.55251 5315.4799 -2779.0755 1834.3375 9.9267847 8.596848 21.4947 15896.368 22.588205 3192.882 1.1981949 -148.36068 - 3500 261.57101 57911.809 -2778.1223 1713.3956 9.9267847 8.596848 20.077507 110996.8 -9.4471543 -3240.9018 6.2619064 -186.41261 - 4000 254.88665 13952.95 -2778.4816 1818.2782 9.9267847 8.596848 21.306518 26833.588 2.2818412 647.88057 1.8705799 -222.72504 - 4500 240.08908 73322.997 -2776.7382 1668.6666 9.9267847 8.596848 19.553375 151978.11 -43.917346 189.1572 8.1346613 -260.52885 - 5000 214.49084 1925.2557 -2777.0657 1890.0985 9.9267847 8.596848 22.148106 -5218.7292 -44.5537 28890.787 -1.1364617 -297.26329 - 5500 194.6515 71804.842 -2777.3417 1669.7297 9.9267847 8.596848 19.565832 146911.42 -34.911593 -3985.0635 8.0901523 -334.1879 - 6000 186.23814 10196.007 -2777.1394 1837.3793 9.9267847 8.596848 21.530344 23550.907 -18.381207 13401.096 1.0708382 -371.9208 - 6500 172.53603 5474.3725 -2777.4502 1818.0038 9.9267847 8.596848 21.303303 18389.825 -22.65951 -8026.2088 1.8820667 -407.83084 - 7000 160.91186 107908.64 -2777.6746 1621.7378 9.9267847 8.596848 19.003464 196841.27 -8.6606903 5654.1938 10.099523 -444.9925 - 7500 146.01905 147030.69 -2777.2543 1539.7536 9.9267847 8.596848 18.042777 253089.02 -43.928324 -6926.1018 13.532114 -478.63113 - 8000 207.17758 837859.1 -2796.8957 989.32874 9.9267847 8.596848 11.592918 811765.11 1172.3778 89652.363 36.577833 -503.41923 - 8500 725.15657 853732.89 -2832.3144 974.18299 9.9267847 8.596848 11.415441 773926.64 1749.5702 39098.598 37.21197 -524.17835 - 9000 1554.6089 807867.74 -2843.0063 990.10922 9.9267847 8.596848 11.602064 749697.22 1959.0322 28239.71 36.545155 -544.77354 - 9500 2440.1194 748145.05 -2839.2364 992.38871 9.9267847 8.596848 11.628775 691503.58 1437.0708 -28040.223 36.449715 -565.41198 - 10000 3112.1817 823862.43 -2820.0495 982.35471 9.9267847 8.596848 11.511197 754954.89 1330.6807 26987.244 36.869828 -586.12357 - 10500 3550.0273 868916.79 -2803.7678 983.70386 9.9267847 8.596848 11.527006 867368.45 1727.9058 140533.46 36.813341 -607.00946 - 11000 3839.7527 830581.55 -2795.3804 995.31485 9.9267847 8.596848 11.663063 811740 1150.0462 94652.768 36.327201 -628.02229 -Loop time of 15.1476 on 4 procs for 10000 steps with 144 atoms +Step v_T_qm Press Econserve Volume Lx Ly Lz Pzz v_dhug v_dray v_lgr_vel v_lgr_pos + 1000 281.98323 -6031.2507 -2778.6227 1881.8368 9.9267847 8.596848 22.051295 -14113.608 1.3371988 13059.97 -0.79055248 0 + 1500 266.12743 44405.252 -2777.9815 1739.6551 9.9267847 8.596848 20.385215 92589.619 -12.060756 397.55607 5.1624473 -37.823753 + 2000 255.79412 17620.89 -2777.9685 1785.7605 9.9267847 8.596848 20.925477 48671.42 -16.082485 -4813.8454 3.2320631 -73.974438 + 2500 257.13592 39692.462 -2778.6986 1751.4095 9.9267847 8.596848 20.522952 80667.315 15.746345 -1656.6275 4.6703047 -112.35088 + 3000 248.95332 9617.5633 -2778.937 1830.5557 9.9267847 8.596848 21.450385 25275.769 19.730704 9397.3972 1.3565331 -148.37113 + 3500 247.70025 100159.87 -2778.0604 1610.8047 9.9267847 8.596848 18.875351 189849.69 -33.726976 -10516.027 10.557281 -185.61862 + 4000 266.07224 848367.31 -2787.9052 992.46097 9.9267847 8.596848 11.629622 880163.37 1477.3994 160680.23 36.44669 -213.83067 + 4500 645.86948 789169.63 -2822.9559 992.40405 9.9267847 8.596848 11.628955 696879.41 1039.4139 -22651.518 36.449073 -234.79958 + 5000 1369.4257 735014.89 -2838.4571 1002.6048 9.9267847 8.596848 11.748487 648785.76 1170.3517 -62181.314 36.021977 -255.55776 + 5500 2156.7632 768865.28 -2835.9297 995.94989 9.9267847 8.596848 11.670505 678013.94 1271.734 -38540.152 36.300612 -276.42588 + 6000 2864.2837 773631.53 -2828.0627 993.01727 9.9267847 8.596848 11.63614 749067.81 1567.7659 30051.708 36.423398 -297.26898 + 6500 3422.632 861319.73 -2810.1415 985.48363 9.9267847 8.596848 11.547861 816792.18 1535.8348 91451.363 36.738824 -318.12934 + 7000 3798.2073 791521.73 -2801.7757 993.1961 9.9267847 8.596848 11.638236 677215.78 330.09854 -41650.204 36.415911 -338.86015 + 7500 4060.7728 836165.25 -2789.6215 984.13658 9.9267847 8.596848 11.532077 780101.5 698.84908 53629.791 36.795223 -359.64284 + 8000 4122.5641 754871.86 -2776.0049 1006.6266 9.9267847 8.596848 11.795613 699610.84 -124.86381 -7979.8848 35.853592 -380.58907 + 8500 4087.3529 769727.63 -2775.3629 1018.2197 9.9267847 8.596848 11.931461 767853.09 415.9984 69995.141 35.368199 -401.90058 + 9000 3958.4459 615996.33 -2758.7864 1058.0696 9.9267847 8.596848 12.398422 641295.34 -689.82578 -23107.426 33.699723 -423.43203 + 9500 3746.2013 643366.31 -2767.1851 1043.1232 9.9267847 8.596848 12.22328 610176.19 -767.67823 -66774.534 34.325515 -445.14544 + 10000 3723.8623 659730.11 -2781.6634 1034.0441 9.9267847 8.596848 12.116891 671355.25 0.037615796 -13217.642 34.705647 -466.9448 + 10500 3705.48 637406.18 -2776.4898 1041.5851 9.9267847 8.596848 12.205256 725619.7 274.78304 47377.665 34.389914 -488.75102 + 11000 3678.0139 648116.35 -2779.0968 1049.9523 9.9267847 8.596848 12.303303 723144.21 382.51198 51926.71 34.039587 -510.63944 +Loop time of 51.3151 on 4 procs for 10000 steps with 144 atoms -Performance: 57.039 ns/day, 0.421 hours/ns, 660.171 timesteps/s -91.3% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 16.837 ns/day, 1.425 hours/ns, 194.874 timesteps/s +94.1% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 7.7228 | 9.085 | 10.626 | 36.0 | 59.98 -Kspace | 1.6343 | 3.1795 | 4.5467 | 61.0 | 20.99 -Neigh | 0.02063 | 0.027076 | 0.034395 | 3.1 | 0.18 -Comm | 0.54719 | 0.57781 | 0.60468 | 2.8 | 3.81 -Output | 0.10128 | 0.1019 | 0.10373 | 0.3 | 0.67 -Modify | 2.0819 | 2.1159 | 2.1495 | 1.8 | 13.97 -Other | | 0.06035 | | | 0.40 +Pair | 26.662 | 32.362 | 38.05 | 70.9 | 63.07 +Kspace | 5.8733 | 11.582 | 17.302 | 118.9 | 22.57 +Neigh | 0.18541 | 0.22229 | 0.25113 | 5.0 | 0.43 +Comm | 1.4273 | 1.4501 | 1.483 | 1.9 | 2.83 +Output | 0.0011935 | 0.0018681 | 0.003891 | 2.7 | 0.00 +Modify | 5.4539 | 5.5056 | 5.5294 | 1.3 | 10.73 +Other | | 0.1916 | | | 0.37 -Nlocal: 36 ave 38 max 33 min +Nlocal: 36.0000 ave 37 max 35 min +Histogram: 1 0 0 0 0 2 0 0 0 1 +Nghost: 4159.50 ave 4171 max 4140 min Histogram: 1 0 0 0 0 0 1 0 1 1 -Nghost: 4267 ave 4304 max 4239 min -Histogram: 1 0 1 0 1 0 0 0 0 1 -Neighs: 18859.2 ave 25108 max 12333 min -Histogram: 1 0 0 1 0 0 1 0 0 1 +Neighs: 17967.8 ave 20291 max 15710 min +Histogram: 2 0 0 0 0 0 0 0 0 2 -Total # of neighbors = 75437 -Ave neighs/atom = 523.868 -Neighbor list builds = 95 +Total # of neighbors = 71871 +Ave neighs/atom = 499.10417 +Neighbor list builds = 161 Dangerous builds = 0 -Total wall time: 0:00:17 +shell rm restart.1000 +Total wall time: 0:01:01 diff --git a/examples/tersoff/in.hBN_shift b/examples/tersoff/in.hBN_shift index 0a72235278..82e71e7b39 100644 --- a/examples/tersoff/in.hBN_shift +++ b/examples/tersoff/in.hBN_shift @@ -23,9 +23,9 @@ neigh_modify delay 0 neigh_modify check yes #### Simulation settings #### -timestep 0.001 -velocity all create 300.0 4928459 loop geom -fix thermostat all nve +timestep 0.001 +velocity all create 300.0 4928459 loop geom +fix thermostat all nve ############# Output ############### thermo 100 @@ -34,4 +34,4 @@ thermo_style custom step etotal pe ke temp thermo_modify line one format float %20.16g lost warn ###### Run molecular dynamics ###### -run 1000 +run 1000 diff --git a/examples/tersoff/in.tersoff b/examples/tersoff/in.tersoff index f2be2ae761..90b18fa0a1 100644 --- a/examples/tersoff/in.tersoff +++ b/examples/tersoff/in.tersoff @@ -7,7 +7,7 @@ units metal atom_style atomic atom_modify map array boundary p p p -atom_modify sort 0 0.0 +atom_modify sort 0 0.0 # temperature @@ -35,45 +35,45 @@ region myreg block 0 4 & create_box 8 myreg create_atoms 1 region myreg & - basis 1 1 & - basis 2 2 & - basis 3 3 & - basis 4 4 & - basis 5 5 & - basis 6 6 & - basis 7 7 & - basis 8 8 + basis 1 1 & + basis 2 2 & + basis 3 3 & + basis 4 4 & + basis 5 5 & + basis 6 6 & + basis 7 7 & + basis 8 8 mass * 28.06 -velocity all create $t 5287287 loop geom +velocity all create $t 5287287 loop geom # Equilibrate using Tersoff model for silicon pair_style tersoff -pair_coeff * * Si.tersoff Si Si Si Si Si Si Si Si +pair_coeff * * Si.tersoff Si Si Si Si Si Si Si Si +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes run 100 -write_restart restart.equil +write_restart restart.equil # Test Tersoff/Mod model for Si clear -read_restart restart.equil +read_restart restart.equil pair_style tersoff/mod -pair_coeff * * Si.tersoff.mod Si Si Si Si Si Si Si Si +pair_coeff * * Si.tersoff.mod Si Si Si Si Si Si Si Si +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes @@ -82,14 +82,14 @@ run 100 # Test Tersoff/Mod/C model for Si clear -read_restart restart.equil +read_restart restart.equil newton on on pair_style tersoff/mod/c -pair_coeff * * Si.tersoff.modc Si Si Si Si Si Si Si Si +pair_coeff * * Si.tersoff.modc Si Si Si Si Si Si Si Si +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes @@ -98,17 +98,17 @@ run 100 # Test Tersoff model for B/N/C clear -read_restart restart.equil +read_restart restart.equil -variable fac equal 0.6 -change_box all x scale ${fac} y scale ${fac} z scale ${fac} remap +variable fac equal 0.6 +change_box all x scale ${fac} y scale ${fac} z scale ${fac} remap pair_style tersoff -pair_coeff * * BNC.tersoff N N N C B B C B +pair_coeff * * BNC.tersoff N N N C B B C B +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes @@ -117,19 +117,20 @@ run 100 # Test Tersoff model for B/N/C clear -read_restart restart.equil +read_restart restart.equil -variable fac equal 0.6 -change_box all x scale ${fac} y scale ${fac} z scale ${fac} remap +variable fac equal 0.6 +change_box all x scale ${fac} y scale ${fac} z scale ${fac} remap pair_style tersoff shift 0.05 -pair_coeff * * BNC.tersoff N N N C B B C B +pair_coeff * * BNC.tersoff N N N C B B C B +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes run 100 +shell rm restart.equil diff --git a/examples/tersoff/log.13Jan21.tersoff.g++.1 b/examples/tersoff/log.09Feb21.tersoff.g++.1 similarity index 59% rename from examples/tersoff/log.13Jan21.tersoff.g++.1 rename to examples/tersoff/log.09Feb21.tersoff.g++.1 index b8833a2586..d636f28ae5 100644 --- a/examples/tersoff/log.13Jan21.tersoff.g++.1 +++ b/examples/tersoff/log.09Feb21.tersoff.g++.1 @@ -1,5 +1,4 @@ LAMMPS (24 Dec 2020) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) using 1 OpenMP thread(s) per MPI task # Simple regression tests for Tersoff potentials @@ -10,7 +9,7 @@ units metal atom_style atomic atom_modify map array boundary p p p -atom_modify sort 0 0.0 +atom_modify sort 0 0.0 # temperature @@ -28,26 +27,26 @@ region myreg block 0 4 0 4 create_box 8 myreg Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) 1 by 1 by 1 MPI processor grid -create_atoms 1 region myreg basis 1 1 basis 2 2 basis 3 3 basis 4 4 basis 5 5 basis 6 6 basis 7 7 basis 8 8 +create_atoms 1 region myreg basis 1 1 basis 2 2 basis 3 3 basis 4 4 basis 5 5 basis 6 6 basis 7 7 basis 8 8 Created 512 atoms - create_atoms CPU = 0.000 seconds + create_atoms CPU = 0.001 seconds mass * 28.06 -velocity all create $t 5287287 loop geom -velocity all create 1800 5287287 loop geom +velocity all create $t 5287287 loop geom +velocity all create 1800 5287287 loop geom # Equilibrate using Tersoff model for silicon pair_style tersoff -pair_coeff * * Si.tersoff Si Si Si Si Si Si Si Si +pair_coeff * * Si.tersoff Si Si Si Si Si Si Si Si Reading tersoff potential file Si.tersoff with DATE: 2007-10-25 +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 fix 1 all nvt temp 1800 $t 0.1 fix 1 all nvt temp 1800 1800 0.1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes @@ -65,32 +64,32 @@ Neighbor list info ... stencil: full/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 2.985 | 2.985 | 2.985 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1800 -2370.771 0 -2251.8775 12511.419 - 10 1144.7447 -2327.3227 0 -2251.7759 21852.599 - 20 770.19243 -2302.1547 0 -2251.7633 22286.587 - 30 1059.4324 -2320.1988 0 -2251.8159 6242.222 - 40 1000.972 -2314.6531 0 -2251.796 -3069.9273 - 50 803.91758 -2300.1702 0 -2251.7834 -7154.1383 - 60 761.38639 -2296.1731 0 -2251.7928 -14520.921 - 70 750.57677 -2294.3086 0 -2251.7965 -21400.198 - 80 676.66672 -2288.2634 0 -2251.7899 -23480.201 - 90 640.24103 -2284.6678 0 -2251.7848 -20659.983 - 100 742.67188 -2290.0616 0 -2251.7855 -16211.799 -Loop time of 0.107338 on 1 procs for 100 steps with 512 atoms +Step Temp E_pair TotEng Econserve Press + 0 1800 -2370.771 -2251.8775 -2251.8775 12511.419 + 10 1144.7447 -2327.3227 -2251.7101 -2251.7759 21852.599 + 20 770.19243 -2302.1547 -2251.282 -2251.7633 22286.587 + 30 1059.4324 -2320.1988 -2250.2213 -2251.8159 6242.222 + 40 1000.972 -2314.6531 -2248.5369 -2251.796 -3069.9273 + 50 803.91758 -2300.1702 -2247.0699 -2251.7834 -7154.1383 + 60 761.38639 -2296.1731 -2245.882 -2251.7928 -14520.921 + 70 750.57677 -2294.3086 -2244.7316 -2251.7965 -21400.198 + 80 676.66672 -2288.2634 -2243.5683 -2251.7899 -23480.201 + 90 640.24103 -2284.6678 -2242.3786 -2251.7848 -20659.983 + 100 742.67188 -2290.0616 -2241.0067 -2251.7855 -16211.799 +Loop time of 0.447105 on 1 procs for 100 steps with 512 atoms -Performance: 80.493 ns/day, 0.298 hours/ns, 931.637 timesteps/s -98.6% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 19.324 ns/day, 1.242 hours/ns, 223.661 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.10455 | 0.10455 | 0.10455 | 0.0 | 97.40 -Neigh | 0.001115 | 0.001115 | 0.001115 | 0.0 | 1.04 -Comm | 0.000482 | 0.000482 | 0.000482 | 0.0 | 0.45 -Output | 0.000194 | 0.000194 | 0.000194 | 0.0 | 0.18 -Modify | 0.000787 | 0.000787 | 0.000787 | 0.0 | 0.73 -Other | | 0.000209 | | | 0.19 +Pair | 0.4373 | 0.4373 | 0.4373 | 0.0 | 97.81 +Neigh | 0.0021279 | 0.0021279 | 0.0021279 | 0.0 | 0.48 +Comm | 0.0021732 | 0.0021732 | 0.0021732 | 0.0 | 0.49 +Output | 0.00020552 | 0.00020552 | 0.00020552 | 0.0 | 0.05 +Modify | 0.0047524 | 0.0047524 | 0.0047524 | 0.0 | 1.06 +Other | | 0.0005488 | | | 0.12 Nlocal: 512.000 ave 512 max 512 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -106,15 +105,14 @@ Ave neighs/atom = 16.414062 Neighbor list builds = 2 Dangerous builds = 0 -write_restart restart.equil +write_restart restart.equil System init for write_restart ... # Test Tersoff/Mod model for Si clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) using 1 OpenMP thread(s) per MPI task -read_restart restart.equil +read_restart restart.equil Reading restart file ... restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 restoring atom style atomic from restart @@ -122,19 +120,19 @@ Reading restart file ... 1 by 1 by 1 MPI processor grid pair style tersoff stores no restart info 512 atoms - read_restart CPU = 0.006 seconds + read_restart CPU = 0.001 seconds pair_style tersoff/mod -pair_coeff * * Si.tersoff.mod Si Si Si Si Si Si Si Si +pair_coeff * * Si.tersoff.mod Si Si Si Si Si Si Si Si Reading tersoff/mod potential file Si.tersoff.mod with DATE: 2013-07-26 +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 fix 1 all nvt temp 1800 $t 0.1 fix 1 all nvt temp 1800 1800 0.1 Resetting global fix info from restart file: fix style: nvt, fix ID: 1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes @@ -153,32 +151,32 @@ Neighbor list info ... stencil: full/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 2.979 | 2.979 | 2.979 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 742.67188 -2210.6446 0 -2172.3685 -6444.2163 - 110 1135.5853 -2234.6974 0 -2172.3908 113.80404 - 120 1462.8415 -2253.8186 0 -2172.3853 10922.229 - 130 1755.9617 -2270.5152 0 -2172.3964 18780.707 - 140 1895.1939 -2277.1484 0 -2172.3965 22357.106 - 150 1869.5375 -2273.2734 0 -2172.3851 22616.492 - 160 1824.0448 -2268.4342 0 -2172.393 19254.299 - 170 1637.9038 -2254.5219 0 -2172.3815 15904.928 - 180 1451.9871 -2240.7199 0 -2172.3771 12064.754 - 190 1362.8248 -2233.1942 0 -2172.3789 7970.534 - 200 1341.1467 -2229.8951 0 -2172.3717 6244.8542 -Loop time of 0.128972 on 1 procs for 100 steps with 512 atoms +Step Temp E_pair TotEng Econserve Press + 100 742.67188 -2210.6446 -2161.5897 -2172.3685 -6444.2163 + 110 1135.5853 -2234.6974 -2159.6898 -2172.3908 113.80404 + 120 1462.8415 -2253.8186 -2157.1951 -2172.3853 10922.229 + 130 1755.9617 -2270.5152 -2154.5306 -2172.3964 18780.707 + 140 1895.1939 -2277.1484 -2151.9672 -2172.3965 22357.106 + 150 1869.5375 -2273.2734 -2149.7868 -2172.3851 22616.492 + 160 1824.0448 -2268.4342 -2147.9525 -2172.393 19254.299 + 170 1637.9038 -2254.5219 -2146.3352 -2172.3815 15904.928 + 180 1451.9871 -2240.7199 -2144.8134 -2172.3771 12064.754 + 190 1362.8248 -2233.1942 -2143.177 -2172.3789 7970.534 + 200 1341.1467 -2229.8951 -2141.3097 -2172.3717 6244.8542 +Loop time of 0.428851 on 1 procs for 100 steps with 512 atoms -Performance: 66.991 ns/day, 0.358 hours/ns, 775.362 timesteps/s -98.6% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 20.147 ns/day, 1.191 hours/ns, 233.181 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.12498 | 0.12498 | 0.12498 | 0.0 | 96.91 -Neigh | 0.002322 | 0.002322 | 0.002322 | 0.0 | 1.80 -Comm | 0.000537 | 0.000537 | 0.000537 | 0.0 | 0.42 -Output | 0.000177 | 0.000177 | 0.000177 | 0.0 | 0.14 -Modify | 0.000761 | 0.000761 | 0.000761 | 0.0 | 0.59 -Other | | 0.000192 | | | 0.15 +Pair | 0.41656 | 0.41656 | 0.41656 | 0.0 | 97.13 +Neigh | 0.0043387 | 0.0043387 | 0.0043387 | 0.0 | 1.01 +Comm | 0.0025339 | 0.0025339 | 0.0025339 | 0.0 | 0.59 +Output | 0.00019503 | 0.00019503 | 0.00019503 | 0.0 | 0.05 +Modify | 0.0047224 | 0.0047224 | 0.0047224 | 0.0 | 1.10 +Other | | 0.0004995 | | | 0.12 Nlocal: 512.000 ave 512 max 512 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -197,9 +195,8 @@ Dangerous builds = 0 # Test Tersoff/Mod/C model for Si clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) using 1 OpenMP thread(s) per MPI task -read_restart restart.equil +read_restart restart.equil Reading restart file ... restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 restoring atom style atomic from restart @@ -210,16 +207,16 @@ Reading restart file ... read_restart CPU = 0.001 seconds newton on on pair_style tersoff/mod/c -pair_coeff * * Si.tersoff.modc Si Si Si Si Si Si Si Si +pair_coeff * * Si.tersoff.modc Si Si Si Si Si Si Si Si Reading tersoff/mod/c potential file Si.tersoff.modc with DATE: 2016-11-09 +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 fix 1 all nvt temp 1800 $t 0.1 fix 1 all nvt temp 1800 1800 0.1 Resetting global fix info from restart file: fix style: nvt, fix ID: 1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes @@ -238,32 +235,32 @@ Neighbor list info ... stencil: full/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 2.976 | 2.976 | 2.976 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 742.67188 -2221.9308 0 -2183.6547 -11721.269 - 110 1106.895 -2244.1196 0 -2183.6843 -2359.7819 - 120 1327.6674 -2256.3155 0 -2183.6767 7904.6604 - 130 1487.0219 -2264.3656 0 -2183.6707 14660.783 - 140 1709.1746 -2276.4761 0 -2183.6886 19298.791 - 150 1710.6528 -2274.1129 0 -2183.6764 22026.559 - 160 1651.0659 -2267.9877 0 -2183.6699 20916.722 - 170 1632.7705 -2264.7081 0 -2183.6777 17339.031 - 180 1477.693 -2252.4683 0 -2183.6706 12563.594 - 190 1310.8768 -2239.5419 0 -2183.6581 9591.0484 - 200 1356.7172 -2240.5315 0 -2183.668 5584.6734 -Loop time of 0.133106 on 1 procs for 100 steps with 512 atoms +Step Temp E_pair TotEng Econserve Press + 100 742.67188 -2221.9308 -2172.8759 -2183.6547 -11721.269 + 110 1106.895 -2244.1196 -2171.007 -2183.6843 -2359.7819 + 120 1327.6674 -2256.3155 -2168.6205 -2183.6767 7904.6604 + 130 1487.0219 -2264.3656 -2166.1449 -2183.6707 14660.783 + 140 1709.1746 -2276.4761 -2163.5818 -2183.6886 19298.791 + 150 1710.6528 -2274.1129 -2161.1209 -2183.6764 22026.559 + 160 1651.0659 -2267.9877 -2158.9316 -2183.6699 20916.722 + 170 1632.7705 -2264.7081 -2156.8605 -2183.6777 17339.031 + 180 1477.693 -2252.4683 -2154.8638 -2183.6706 12563.594 + 190 1310.8768 -2239.5419 -2152.9559 -2183.6581 9591.0484 + 200 1356.7172 -2240.5315 -2150.9177 -2183.668 5584.6734 +Loop time of 0.444872 on 1 procs for 100 steps with 512 atoms -Performance: 64.911 ns/day, 0.370 hours/ns, 751.281 timesteps/s -96.0% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 19.421 ns/day, 1.236 hours/ns, 224.784 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.1291 | 0.1291 | 0.1291 | 0.0 | 96.99 -Neigh | 0.002343 | 0.002343 | 0.002343 | 0.0 | 1.76 -Comm | 0.0005 | 0.0005 | 0.0005 | 0.0 | 0.38 -Output | 0.000186 | 0.000186 | 0.000186 | 0.0 | 0.14 -Modify | 0.000786 | 0.000786 | 0.000786 | 0.0 | 0.59 -Other | | 0.000191 | | | 0.14 +Pair | 0.43275 | 0.43275 | 0.43275 | 0.0 | 97.28 +Neigh | 0.0042851 | 0.0042851 | 0.0042851 | 0.0 | 0.96 +Comm | 0.0024009 | 0.0024009 | 0.0024009 | 0.0 | 0.54 +Output | 0.00019312 | 0.00019312 | 0.00019312 | 0.0 | 0.04 +Modify | 0.0047414 | 0.0047414 | 0.0047414 | 0.0 | 1.07 +Other | | 0.0004966 | | | 0.11 Nlocal: 512.000 ave 512 max 512 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -282,9 +279,8 @@ Dangerous builds = 0 # Test Tersoff model for B/N/C clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) using 1 OpenMP thread(s) per MPI task -read_restart restart.equil +read_restart restart.equil Reading restart file ... restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 restoring atom style atomic from restart @@ -294,27 +290,27 @@ Reading restart file ... 512 atoms read_restart CPU = 0.001 seconds -variable fac equal 0.6 -change_box all x scale ${fac} y scale ${fac} z scale ${fac} remap -change_box all x scale 0.6 y scale ${fac} z scale ${fac} remap -change_box all x scale 0.6 y scale 0.6 z scale ${fac} remap -change_box all x scale 0.6 y scale 0.6 z scale 0.6 remap +variable fac equal 0.6 +change_box all x scale ${fac} y scale ${fac} z scale ${fac} remap +change_box all x scale 0.6 y scale ${fac} z scale ${fac} remap +change_box all x scale 0.6 y scale 0.6 z scale ${fac} remap +change_box all x scale 0.6 y scale 0.6 z scale 0.6 remap Changing box ... orthogonal box = (4.3448000 0.0000000 0.0000000) to (17.379200 21.724000 21.724000) orthogonal box = (4.3448000 4.3448000 0.0000000) to (17.379200 17.379200 21.724000) orthogonal box = (4.3448000 4.3448000 4.3448000) to (17.379200 17.379200 17.379200) pair_style tersoff -pair_coeff * * BNC.tersoff N N N C B B C B +pair_coeff * * BNC.tersoff N N N C B B C B Reading tersoff potential file BNC.tersoff with DATE: 2013-03-21 +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 fix 1 all nvt temp 1800 $t 0.1 fix 1 all nvt temp 1800 1800 0.1 Resetting global fix info from restart file: fix style: nvt, fix ID: 1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes @@ -333,32 +329,32 @@ Neighbor list info ... stencil: full/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 2.985 | 2.985 | 2.985 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 742.67188 -2973.8527 0 -2935.5766 3438975.9 - 110 4061.1085 -3183.2489 0 -2930.1208 2211712.7 - 120 4120.3231 -3187.0108 0 -2928.3047 2166764.3 - 130 3602.7602 -3158.5939 0 -2926.6167 2244475.7 - 140 3222.7773 -3141.7275 0 -2925.5369 2161607 - 150 3487.4703 -3163.7495 0 -2921.2462 2222150.2 - 160 3436.3009 -3169.4234 0 -2920.8775 2144368.7 - 170 3308.1796 -3170.3773 0 -2920.8967 2223612.9 - 180 3304.3776 -3178.7805 0 -2920.102 2072546.6 - 190 3217.3561 -3180.7963 0 -2918.4548 2118776.2 - 200 3041.6832 -3176.1794 0 -2916.5787 2130124.6 -Loop time of 0.134621 on 1 procs for 100 steps with 512 atoms +Step Temp E_pair TotEng Econserve Press + 100 742.67188 -2973.8527 -2924.7978 -2935.5766 3438975.9 + 110 4061.1085 -3183.2489 -2915.0049 -2930.1208 2211712.7 + 120 4120.3231 -3187.0108 -2914.8555 -2928.3047 2166764.3 + 130 3602.7602 -3158.5939 -2920.6246 -2926.6167 2244475.7 + 140 3222.7773 -3141.7275 -2928.8568 -2925.5369 2161607 + 150 3487.4703 -3163.7495 -2933.3954 -2921.2462 2222150.2 + 160 3436.3009 -3169.4234 -2942.449 -2920.8775 2144368.7 + 170 3308.1796 -3170.3773 -2951.8656 -2920.8967 2223612.9 + 180 3304.3776 -3178.7805 -2960.52 -2920.102 2072546.6 + 190 3217.3561 -3180.7963 -2968.2837 -2918.4548 2118776.2 + 200 3041.6832 -3176.1794 -2975.2703 -2916.5787 2130124.6 +Loop time of 0.55964 on 1 procs for 100 steps with 512 atoms -Performance: 64.180 ns/day, 0.374 hours/ns, 742.826 timesteps/s -98.6% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 15.438 ns/day, 1.555 hours/ns, 178.686 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.12837 | 0.12837 | 0.12837 | 0.0 | 95.35 -Neigh | 0.004553 | 0.004553 | 0.004553 | 0.0 | 3.38 -Comm | 0.000601 | 0.000601 | 0.000601 | 0.0 | 0.45 -Output | 0.000177 | 0.000177 | 0.000177 | 0.0 | 0.13 -Modify | 0.000742 | 0.000742 | 0.000742 | 0.0 | 0.55 -Other | | 0.000181 | | | 0.13 +Pair | 0.54187 | 0.54187 | 0.54187 | 0.0 | 96.83 +Neigh | 0.0087171 | 0.0087171 | 0.0087171 | 0.0 | 1.56 +Comm | 0.0036685 | 0.0036685 | 0.0036685 | 0.0 | 0.66 +Output | 0.00019526 | 0.00019526 | 0.00019526 | 0.0 | 0.03 +Modify | 0.0047348 | 0.0047348 | 0.0047348 | 0.0 | 0.85 +Other | | 0.0004504 | | | 0.08 Nlocal: 512.000 ave 512 max 512 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -377,9 +373,8 @@ Dangerous builds = 0 # Test Tersoff model for B/N/C clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) using 1 OpenMP thread(s) per MPI task -read_restart restart.equil +read_restart restart.equil Reading restart file ... restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 restoring atom style atomic from restart @@ -389,27 +384,27 @@ Reading restart file ... 512 atoms read_restart CPU = 0.001 seconds -variable fac equal 0.6 -change_box all x scale ${fac} y scale ${fac} z scale ${fac} remap -change_box all x scale 0.6 y scale ${fac} z scale ${fac} remap -change_box all x scale 0.6 y scale 0.6 z scale ${fac} remap -change_box all x scale 0.6 y scale 0.6 z scale 0.6 remap +variable fac equal 0.6 +change_box all x scale ${fac} y scale ${fac} z scale ${fac} remap +change_box all x scale 0.6 y scale ${fac} z scale ${fac} remap +change_box all x scale 0.6 y scale 0.6 z scale ${fac} remap +change_box all x scale 0.6 y scale 0.6 z scale 0.6 remap Changing box ... orthogonal box = (4.3448000 0.0000000 0.0000000) to (17.379200 21.724000 21.724000) orthogonal box = (4.3448000 4.3448000 0.0000000) to (17.379200 17.379200 21.724000) orthogonal box = (4.3448000 4.3448000 4.3448000) to (17.379200 17.379200 17.379200) pair_style tersoff shift 0.05 -pair_coeff * * BNC.tersoff N N N C B B C B +pair_coeff * * BNC.tersoff N N N C B B C B Reading tersoff potential file BNC.tersoff with DATE: 2013-03-21 +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 fix 1 all nvt temp 1800 $t 0.1 fix 1 all nvt temp 1800 1800 0.1 Resetting global fix info from restart file: fix style: nvt, fix ID: 1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes @@ -428,32 +423,32 @@ Neighbor list info ... stencil: full/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 2.985 | 2.985 | 2.985 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 742.67188 -3294.0266 0 -3255.7505 1615779.4 - 110 2870.7114 -3432.8485 0 -3257.629 1053310.6 - 120 2898.0798 -3431.4968 0 -3256.6851 1223402.3 - 130 2708.4483 -3419.0142 0 -3256.436 1105893.8 - 140 2307.8661 -3394.1268 0 -3256.1686 1148075.8 - 150 2215.3423 -3390.1427 0 -3255.8733 1138540 - 160 2515.488 -3412.6704 0 -3255.1731 1122902.8 - 170 2485.7109 -3415.0402 0 -3255.3787 1097748.5 - 180 2327.476 -3408.2463 0 -3254.6537 1061602.6 - 190 2339.5966 -3413.3961 0 -3254.7496 1088059 - 200 2260.5961 -3411.477 0 -3254.0771 1104581.5 -Loop time of 0.120764 on 1 procs for 100 steps with 512 atoms +Step Temp E_pair TotEng Econserve Press + 100 742.67188 -3294.0266 -3244.9717 -3255.7505 1615779.4 + 110 2870.7114 -3432.8485 -3243.2324 -3257.629 1053310.6 + 120 2898.0798 -3431.4968 -3240.0731 -3256.6851 1223402.3 + 130 2708.4483 -3419.0142 -3240.1159 -3256.436 1105893.8 + 140 2307.8661 -3394.1268 -3241.6877 -3256.1686 1148075.8 + 150 2215.3423 -3390.1427 -3243.8151 -3255.8733 1138540 + 160 2515.488 -3412.6704 -3246.5175 -3255.1731 1122902.8 + 170 2485.7109 -3415.0402 -3250.8542 -3255.3787 1097748.5 + 180 2327.476 -3408.2463 -3254.512 -3254.6537 1061602.6 + 190 2339.5966 -3413.3961 -3258.8612 -3254.7496 1088059 + 200 2260.5961 -3411.477 -3262.1603 -3254.0771 1104581.5 +Loop time of 0.511812 on 1 procs for 100 steps with 512 atoms -Performance: 71.545 ns/day, 0.335 hours/ns, 828.061 timesteps/s -98.6% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 16.881 ns/day, 1.422 hours/ns, 195.384 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.11521 | 0.11521 | 0.11521 | 0.0 | 95.40 -Neigh | 0.003874 | 0.003874 | 0.003874 | 0.0 | 3.21 -Comm | 0.000542 | 0.000542 | 0.000542 | 0.0 | 0.45 -Output | 0.000177 | 0.000177 | 0.000177 | 0.0 | 0.15 -Modify | 0.000774 | 0.000774 | 0.000774 | 0.0 | 0.64 -Other | | 0.00019 | | | 0.16 +Pair | 0.49628 | 0.49628 | 0.49628 | 0.0 | 96.96 +Neigh | 0.0072167 | 0.0072167 | 0.0072167 | 0.0 | 1.41 +Comm | 0.0029061 | 0.0029061 | 0.0029061 | 0.0 | 0.57 +Output | 0.00019026 | 0.00019026 | 0.00019026 | 0.0 | 0.04 +Modify | 0.0047674 | 0.0047674 | 0.0047674 | 0.0 | 0.93 +Other | | 0.0004566 | | | 0.09 Nlocal: 512.000 ave 512 max 512 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -469,4 +464,4 @@ Ave neighs/atom = 28.664062 Neighbor list builds = 5 Dangerous builds = 0 -Total wall time: 0:00:00 +Total wall time: 0:00:02 diff --git a/examples/tersoff/log.13Jan21.tersoff.g++.4 b/examples/tersoff/log.09Feb21.tersoff.g++.4 similarity index 60% rename from examples/tersoff/log.13Jan21.tersoff.g++.4 rename to examples/tersoff/log.09Feb21.tersoff.g++.4 index 07431ff1eb..829ef0c452 100644 --- a/examples/tersoff/log.13Jan21.tersoff.g++.4 +++ b/examples/tersoff/log.09Feb21.tersoff.g++.4 @@ -1,5 +1,4 @@ LAMMPS (24 Dec 2020) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) using 1 OpenMP thread(s) per MPI task # Simple regression tests for Tersoff potentials @@ -10,7 +9,7 @@ units metal atom_style atomic atom_modify map array boundary p p p -atom_modify sort 0 0.0 +atom_modify sort 0 0.0 # temperature @@ -28,26 +27,26 @@ region myreg block 0 4 0 4 create_box 8 myreg Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (21.724000 21.724000 21.724000) 1 by 2 by 2 MPI processor grid -create_atoms 1 region myreg basis 1 1 basis 2 2 basis 3 3 basis 4 4 basis 5 5 basis 6 6 basis 7 7 basis 8 8 +create_atoms 1 region myreg basis 1 1 basis 2 2 basis 3 3 basis 4 4 basis 5 5 basis 6 6 basis 7 7 basis 8 8 Created 512 atoms - create_atoms CPU = 0.000 seconds + create_atoms CPU = 0.001 seconds mass * 28.06 -velocity all create $t 5287287 loop geom -velocity all create 1800 5287287 loop geom +velocity all create $t 5287287 loop geom +velocity all create 1800 5287287 loop geom # Equilibrate using Tersoff model for silicon pair_style tersoff -pair_coeff * * Si.tersoff Si Si Si Si Si Si Si Si +pair_coeff * * Si.tersoff Si Si Si Si Si Si Si Si Reading tersoff potential file Si.tersoff with DATE: 2007-10-25 +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 fix 1 all nvt temp 1800 $t 0.1 fix 1 all nvt temp 1800 1800 0.1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes @@ -65,32 +64,32 @@ Neighbor list info ... stencil: full/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 2.958 | 2.958 | 2.958 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1800 -2370.771 0 -2251.8775 12511.419 - 10 1144.7447 -2327.3227 0 -2251.7759 21852.599 - 20 770.19243 -2302.1547 0 -2251.7633 22286.587 - 30 1059.4324 -2320.1988 0 -2251.8159 6242.222 - 40 1000.972 -2314.6531 0 -2251.796 -3069.9273 - 50 803.91758 -2300.1702 0 -2251.7834 -7154.1383 - 60 761.38639 -2296.1731 0 -2251.7928 -14520.921 - 70 750.57677 -2294.3086 0 -2251.7965 -21400.198 - 80 676.66672 -2288.2634 0 -2251.7899 -23480.201 - 90 640.24103 -2284.6678 0 -2251.7848 -20659.983 - 100 742.67188 -2290.0616 0 -2251.7855 -16211.799 -Loop time of 0.0321762 on 4 procs for 100 steps with 512 atoms +Step Temp E_pair TotEng Econserve Press + 0 1800 -2370.771 -2251.8775 -2251.8775 12511.419 + 10 1144.7447 -2327.3227 -2251.7101 -2251.7759 21852.599 + 20 770.19243 -2302.1547 -2251.282 -2251.7633 22286.587 + 30 1059.4324 -2320.1988 -2250.2213 -2251.8159 6242.222 + 40 1000.972 -2314.6531 -2248.5369 -2251.796 -3069.9273 + 50 803.91758 -2300.1702 -2247.0699 -2251.7834 -7154.1383 + 60 761.38639 -2296.1731 -2245.882 -2251.7928 -14520.921 + 70 750.57677 -2294.3086 -2244.7316 -2251.7965 -21400.198 + 80 676.66672 -2288.2634 -2243.5683 -2251.7899 -23480.201 + 90 640.24103 -2284.6678 -2242.3786 -2251.7848 -20659.983 + 100 742.67188 -2290.0616 -2241.0067 -2251.7855 -16211.799 +Loop time of 0.130429 on 4 procs for 100 steps with 512 atoms -Performance: 268.521 ns/day, 0.089 hours/ns, 3107.882 timesteps/s -98.4% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 66.243 ns/day, 0.362 hours/ns, 766.701 timesteps/s +96.2% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.026599 | 0.02712 | 0.027602 | 0.2 | 84.28 -Neigh | 0.000285 | 0.00028875 | 0.000294 | 0.0 | 0.90 -Comm | 0.003471 | 0.0039375 | 0.004446 | 0.6 | 12.24 -Output | 0.000112 | 0.00013675 | 0.000203 | 0.0 | 0.43 -Modify | 0.000443 | 0.0004555 | 0.000471 | 0.0 | 1.42 -Other | | 0.000238 | | | 0.74 +Pair | 0.10994 | 0.11386 | 0.11991 | 1.1 | 87.30 +Neigh | 0.0005877 | 0.00059474 | 0.00059915 | 0.0 | 0.46 +Comm | 0.0072911 | 0.013476 | 0.017439 | 3.4 | 10.33 +Output | 0.00014305 | 0.00022113 | 0.00045156 | 0.0 | 0.17 +Modify | 0.0015786 | 0.0016485 | 0.0017092 | 0.1 | 1.26 +Other | | 0.0006239 | | | 0.48 Nlocal: 128.000 ave 131 max 126 min Histogram: 2 0 0 0 0 0 1 0 0 1 @@ -106,15 +105,14 @@ Ave neighs/atom = 16.414062 Neighbor list builds = 2 Dangerous builds = 0 -write_restart restart.equil +write_restart restart.equil System init for write_restart ... # Test Tersoff/Mod model for Si clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) using 1 OpenMP thread(s) per MPI task -read_restart restart.equil +read_restart restart.equil Reading restart file ... restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 restoring atom style atomic from restart @@ -122,19 +120,19 @@ Reading restart file ... 1 by 2 by 2 MPI processor grid pair style tersoff stores no restart info 512 atoms - read_restart CPU = 0.002 seconds + read_restart CPU = 0.001 seconds pair_style tersoff/mod -pair_coeff * * Si.tersoff.mod Si Si Si Si Si Si Si Si +pair_coeff * * Si.tersoff.mod Si Si Si Si Si Si Si Si Reading tersoff/mod potential file Si.tersoff.mod with DATE: 2013-07-26 +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 fix 1 all nvt temp 1800 $t 0.1 fix 1 all nvt temp 1800 1800 0.1 Resetting global fix info from restart file: fix style: nvt, fix ID: 1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes @@ -153,32 +151,32 @@ Neighbor list info ... stencil: full/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 2.949 | 2.950 | 2.950 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 742.67188 -2210.6446 0 -2172.3685 -6444.2163 - 110 1135.5853 -2234.6974 0 -2172.3908 113.80404 - 120 1462.8415 -2253.8186 0 -2172.3853 10922.229 - 130 1755.9617 -2270.5152 0 -2172.3964 18780.707 - 140 1895.1939 -2277.1484 0 -2172.3965 22357.106 - 150 1869.5375 -2273.2734 0 -2172.3851 22616.492 - 160 1824.0448 -2268.4342 0 -2172.393 19254.299 - 170 1637.9038 -2254.5219 0 -2172.3815 15904.928 - 180 1451.9871 -2240.7199 0 -2172.3771 12064.754 - 190 1362.8248 -2233.1942 0 -2172.3789 7970.534 - 200 1341.1467 -2229.8951 0 -2172.3717 6244.8542 -Loop time of 0.0389003 on 4 procs for 100 steps with 512 atoms +Step Temp E_pair TotEng Econserve Press + 100 742.67188 -2210.6446 -2161.5897 -2172.3685 -6444.2163 + 110 1135.5853 -2234.6974 -2159.6898 -2172.3908 113.80404 + 120 1462.8415 -2253.8186 -2157.1951 -2172.3853 10922.229 + 130 1755.9617 -2270.5152 -2154.5306 -2172.3964 18780.707 + 140 1895.1939 -2277.1484 -2151.9672 -2172.3965 22357.106 + 150 1869.5375 -2273.2734 -2149.7868 -2172.3851 22616.492 + 160 1824.0448 -2268.4342 -2147.9525 -2172.393 19254.299 + 170 1637.9038 -2254.5219 -2146.3352 -2172.3815 15904.928 + 180 1451.9871 -2240.7199 -2144.8134 -2172.3771 12064.754 + 190 1362.8248 -2233.1942 -2143.177 -2172.3789 7970.534 + 200 1341.1467 -2229.8951 -2141.3097 -2172.3717 6244.8542 +Loop time of 0.128801 on 4 procs for 100 steps with 512 atoms -Performance: 222.107 ns/day, 0.108 hours/ns, 2570.678 timesteps/s -98.6% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 67.080 ns/day, 0.358 hours/ns, 776.389 timesteps/s +97.2% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.031362 | 0.032656 | 0.033605 | 0.5 | 83.95 -Neigh | 0.000575 | 0.000599 | 0.000613 | 0.0 | 1.54 -Comm | 0.003768 | 0.004733 | 0.006014 | 1.2 | 12.17 -Output | 0.000207 | 0.00022525 | 0.000276 | 0.0 | 0.58 -Modify | 0.000445 | 0.00047975 | 0.0005 | 0.0 | 1.23 -Other | | 0.0002077 | | | 0.53 +Pair | 0.10866 | 0.11135 | 0.1163 | 0.9 | 86.45 +Neigh | 0.0011961 | 0.001219 | 0.0012498 | 0.1 | 0.95 +Comm | 0.0087612 | 0.013886 | 0.016597 | 2.6 | 10.78 +Output | 0.00013447 | 0.00028586 | 0.000736 | 0.0 | 0.22 +Modify | 0.0014391 | 0.0015088 | 0.0015388 | 0.1 | 1.17 +Other | | 0.0005538 | | | 0.43 Nlocal: 128.000 ave 135 max 123 min Histogram: 1 1 0 0 0 1 0 0 0 1 @@ -197,9 +195,8 @@ Dangerous builds = 0 # Test Tersoff/Mod/C model for Si clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) using 1 OpenMP thread(s) per MPI task -read_restart restart.equil +read_restart restart.equil Reading restart file ... restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 restoring atom style atomic from restart @@ -210,16 +207,16 @@ Reading restart file ... read_restart CPU = 0.001 seconds newton on on pair_style tersoff/mod/c -pair_coeff * * Si.tersoff.modc Si Si Si Si Si Si Si Si +pair_coeff * * Si.tersoff.modc Si Si Si Si Si Si Si Si Reading tersoff/mod/c potential file Si.tersoff.modc with DATE: 2016-11-09 +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 fix 1 all nvt temp 1800 $t 0.1 fix 1 all nvt temp 1800 1800 0.1 Resetting global fix info from restart file: fix style: nvt, fix ID: 1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes @@ -238,32 +235,32 @@ Neighbor list info ... stencil: full/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 2.949 | 2.949 | 2.949 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 742.67188 -2221.9308 0 -2183.6547 -11721.269 - 110 1106.895 -2244.1196 0 -2183.6843 -2359.7819 - 120 1327.6674 -2256.3155 0 -2183.6767 7904.6604 - 130 1487.0219 -2264.3656 0 -2183.6707 14660.783 - 140 1709.1746 -2276.4761 0 -2183.6886 19298.791 - 150 1710.6528 -2274.1129 0 -2183.6764 22026.559 - 160 1651.0659 -2267.9877 0 -2183.6699 20916.722 - 170 1632.7705 -2264.7081 0 -2183.6777 17339.031 - 180 1477.693 -2252.4683 0 -2183.6706 12563.594 - 190 1310.8768 -2239.5419 0 -2183.6581 9591.0484 - 200 1356.7172 -2240.5315 0 -2183.668 5584.6734 -Loop time of 0.039244 on 4 procs for 100 steps with 512 atoms +Step Temp E_pair TotEng Econserve Press + 100 742.67188 -2221.9308 -2172.8759 -2183.6547 -11721.269 + 110 1106.895 -2244.1196 -2171.007 -2183.6843 -2359.7819 + 120 1327.6674 -2256.3155 -2168.6205 -2183.6767 7904.6604 + 130 1487.0219 -2264.3656 -2166.1449 -2183.6707 14660.783 + 140 1709.1746 -2276.4761 -2163.5818 -2183.6886 19298.791 + 150 1710.6528 -2274.1129 -2161.1209 -2183.6764 22026.559 + 160 1651.0659 -2267.9877 -2158.9316 -2183.6699 20916.722 + 170 1632.7705 -2264.7081 -2156.8605 -2183.6777 17339.031 + 180 1477.693 -2252.4683 -2154.8638 -2183.6706 12563.594 + 190 1310.8768 -2239.5419 -2152.9559 -2183.6581 9591.0484 + 200 1356.7172 -2240.5315 -2150.9177 -2183.668 5584.6734 +Loop time of 0.131975 on 4 procs for 100 steps with 512 atoms -Performance: 220.161 ns/day, 0.109 hours/ns, 2548.160 timesteps/s -98.5% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 65.467 ns/day, 0.367 hours/ns, 757.717 timesteps/s +97.2% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.03126 | 0.032782 | 0.033915 | 0.5 | 83.53 -Neigh | 0.000599 | 0.000707 | 0.000821 | 0.0 | 1.80 -Comm | 0.00363 | 0.004893 | 0.006493 | 1.5 | 12.47 -Output | 0.000122 | 0.0001425 | 0.000192 | 0.0 | 0.36 -Modify | 0.000497 | 0.00050925 | 0.000522 | 0.0 | 1.30 -Other | | 0.0002105 | | | 0.54 +Pair | 0.11186 | 0.11507 | 0.11812 | 0.7 | 87.19 +Neigh | 0.0011823 | 0.0011939 | 0.0012088 | 0.0 | 0.90 +Comm | 0.010214 | 0.0134 | 0.016663 | 2.0 | 10.15 +Output | 0.000139 | 0.000296 | 0.00076294 | 0.0 | 0.22 +Modify | 0.0014501 | 0.0014552 | 0.0014606 | 0.0 | 1.10 +Other | | 0.0005632 | | | 0.43 Nlocal: 128.000 ave 133 max 124 min Histogram: 1 0 1 0 0 1 0 0 0 1 @@ -282,9 +279,8 @@ Dangerous builds = 0 # Test Tersoff model for B/N/C clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) using 1 OpenMP thread(s) per MPI task -read_restart restart.equil +read_restart restart.equil Reading restart file ... restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 restoring atom style atomic from restart @@ -292,29 +288,29 @@ Reading restart file ... 1 by 2 by 2 MPI processor grid pair style tersoff stores no restart info 512 atoms - read_restart CPU = 0.001 seconds + read_restart CPU = 0.007 seconds -variable fac equal 0.6 -change_box all x scale ${fac} y scale ${fac} z scale ${fac} remap -change_box all x scale 0.6 y scale ${fac} z scale ${fac} remap -change_box all x scale 0.6 y scale 0.6 z scale ${fac} remap -change_box all x scale 0.6 y scale 0.6 z scale 0.6 remap +variable fac equal 0.6 +change_box all x scale ${fac} y scale ${fac} z scale ${fac} remap +change_box all x scale 0.6 y scale ${fac} z scale ${fac} remap +change_box all x scale 0.6 y scale 0.6 z scale ${fac} remap +change_box all x scale 0.6 y scale 0.6 z scale 0.6 remap Changing box ... orthogonal box = (4.3448000 0.0000000 0.0000000) to (17.379200 21.724000 21.724000) orthogonal box = (4.3448000 4.3448000 0.0000000) to (17.379200 17.379200 21.724000) orthogonal box = (4.3448000 4.3448000 4.3448000) to (17.379200 17.379200 17.379200) pair_style tersoff -pair_coeff * * BNC.tersoff N N N C B B C B +pair_coeff * * BNC.tersoff N N N C B B C B Reading tersoff potential file BNC.tersoff with DATE: 2013-03-21 +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 fix 1 all nvt temp 1800 $t 0.1 fix 1 all nvt temp 1800 1800 0.1 Resetting global fix info from restart file: fix style: nvt, fix ID: 1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes @@ -333,32 +329,32 @@ Neighbor list info ... stencil: full/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 2.952 | 2.952 | 2.952 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 742.67188 -2973.8527 0 -2935.5766 3438975.9 - 110 4061.1085 -3183.2489 0 -2930.1208 2211712.7 - 120 4120.3231 -3187.0108 0 -2928.3047 2166764.3 - 130 3602.7602 -3158.5939 0 -2926.6167 2244475.7 - 140 3222.7773 -3141.7275 0 -2925.5369 2161607 - 150 3487.4703 -3163.7495 0 -2921.2462 2222150.2 - 160 3436.3009 -3169.4234 0 -2920.8775 2144368.7 - 170 3308.1796 -3170.3773 0 -2920.8967 2223612.9 - 180 3304.3776 -3178.7805 0 -2920.102 2072546.6 - 190 3217.3561 -3180.7963 0 -2918.4548 2118776.2 - 200 3041.6832 -3176.1794 0 -2916.5787 2130124.6 -Loop time of 0.0488862 on 4 procs for 100 steps with 512 atoms +Step Temp E_pair TotEng Econserve Press + 100 742.67188 -2973.8527 -2924.7978 -2935.5766 3438975.9 + 110 4061.1085 -3183.2489 -2915.0049 -2930.1208 2211712.7 + 120 4120.3231 -3187.0108 -2914.8555 -2928.3047 2166764.3 + 130 3602.7602 -3158.5939 -2920.6246 -2926.6167 2244475.7 + 140 3222.7773 -3141.7275 -2928.8568 -2925.5369 2161607 + 150 3487.4703 -3163.7495 -2933.3954 -2921.2462 2222150.2 + 160 3436.3009 -3169.4234 -2942.449 -2920.8775 2144368.7 + 170 3308.1796 -3170.3773 -2951.8656 -2920.8967 2223612.9 + 180 3304.3776 -3178.7805 -2960.52 -2920.102 2072546.6 + 190 3217.3561 -3180.7963 -2968.2837 -2918.4548 2118776.2 + 200 3041.6832 -3176.1794 -2975.2703 -2916.5787 2130124.6 +Loop time of 0.171186 on 4 procs for 100 steps with 512 atoms -Performance: 176.737 ns/day, 0.136 hours/ns, 2045.565 timesteps/s -93.6% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 50.471 ns/day, 0.476 hours/ns, 584.160 timesteps/s +96.4% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.037364 | 0.039346 | 0.041066 | 0.8 | 80.49 -Neigh | 0.001207 | 0.0012568 | 0.00136 | 0.2 | 2.57 -Comm | 0.005218 | 0.007064 | 0.009117 | 1.9 | 14.45 -Output | 0.000173 | 0.00020325 | 0.000277 | 0.0 | 0.42 -Modify | 0.000709 | 0.000715 | 0.000723 | 0.0 | 1.46 -Other | | 0.0003008 | | | 0.62 +Pair | 0.14009 | 0.14402 | 0.15181 | 1.2 | 84.13 +Neigh | 0.0023134 | 0.0024782 | 0.0026977 | 0.3 | 1.45 +Comm | 0.013972 | 0.02211 | 0.026362 | 3.3 | 12.92 +Output | 0.00015235 | 0.0003258 | 0.00084186 | 0.0 | 0.19 +Modify | 0.0016432 | 0.0017257 | 0.0018435 | 0.2 | 1.01 +Other | | 0.0005236 | | | 0.31 Nlocal: 128.000 ave 132 max 123 min Histogram: 1 0 0 0 1 0 0 1 0 1 @@ -377,9 +373,8 @@ Dangerous builds = 0 # Test Tersoff model for B/N/C clear -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) using 1 OpenMP thread(s) per MPI task -read_restart restart.equil +read_restart restart.equil Reading restart file ... restart file = 24 Dec 2020, LAMMPS = 24 Dec 2020 restoring atom style atomic from restart @@ -389,27 +384,27 @@ Reading restart file ... 512 atoms read_restart CPU = 0.001 seconds -variable fac equal 0.6 -change_box all x scale ${fac} y scale ${fac} z scale ${fac} remap -change_box all x scale 0.6 y scale ${fac} z scale ${fac} remap -change_box all x scale 0.6 y scale 0.6 z scale ${fac} remap -change_box all x scale 0.6 y scale 0.6 z scale 0.6 remap +variable fac equal 0.6 +change_box all x scale ${fac} y scale ${fac} z scale ${fac} remap +change_box all x scale 0.6 y scale ${fac} z scale ${fac} remap +change_box all x scale 0.6 y scale 0.6 z scale ${fac} remap +change_box all x scale 0.6 y scale 0.6 z scale 0.6 remap Changing box ... orthogonal box = (4.3448000 0.0000000 0.0000000) to (17.379200 21.724000 21.724000) orthogonal box = (4.3448000 4.3448000 0.0000000) to (17.379200 17.379200 21.724000) orthogonal box = (4.3448000 4.3448000 4.3448000) to (17.379200 17.379200 17.379200) pair_style tersoff shift 0.05 -pair_coeff * * BNC.tersoff N N N C B B C B +pair_coeff * * BNC.tersoff N N N C B B C B Reading tersoff potential file BNC.tersoff with DATE: 2013-03-21 +thermo_style custom step temp epair etotal econserve press thermo 10 fix 1 all nvt temp $t $t 0.1 fix 1 all nvt temp 1800 $t 0.1 fix 1 all nvt temp 1800 1800 0.1 Resetting global fix info from restart file: fix style: nvt, fix ID: 1 -fix_modify 1 energy yes timestep 1.0e-3 neighbor 1.0 bin neigh_modify every 1 delay 10 check yes @@ -428,32 +423,32 @@ Neighbor list info ... stencil: full/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 2.952 | 2.952 | 2.952 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 742.67188 -3294.0266 0 -3255.7505 1615779.4 - 110 2870.7114 -3432.8485 0 -3257.629 1053310.6 - 120 2898.0798 -3431.4968 0 -3256.6851 1223402.3 - 130 2708.4483 -3419.0142 0 -3256.436 1105893.8 - 140 2307.8661 -3394.1268 0 -3256.1686 1148075.8 - 150 2215.3423 -3390.1427 0 -3255.8733 1138540 - 160 2515.488 -3412.6704 0 -3255.1731 1122902.8 - 170 2485.7109 -3415.0402 0 -3255.3787 1097748.5 - 180 2327.476 -3408.2463 0 -3254.6537 1061602.6 - 190 2339.5966 -3413.3961 0 -3254.7496 1088059 - 200 2260.5961 -3411.477 0 -3254.0771 1104581.5 -Loop time of 0.0409132 on 4 procs for 100 steps with 512 atoms +Step Temp E_pair TotEng Econserve Press + 100 742.67188 -3294.0266 -3244.9717 -3255.7505 1615779.4 + 110 2870.7114 -3432.8485 -3243.2324 -3257.629 1053310.6 + 120 2898.0798 -3431.4968 -3240.0731 -3256.6851 1223402.3 + 130 2708.4483 -3419.0142 -3240.1159 -3256.436 1105893.8 + 140 2307.8661 -3394.1268 -3241.6877 -3256.1686 1148075.8 + 150 2215.3423 -3390.1427 -3243.8151 -3255.8733 1138540 + 160 2515.488 -3412.6704 -3246.5175 -3255.1731 1122902.8 + 170 2485.7109 -3415.0402 -3250.8542 -3255.3787 1097748.5 + 180 2327.476 -3408.2463 -3254.512 -3254.6537 1061602.6 + 190 2339.5966 -3413.3961 -3258.8612 -3254.7496 1088059 + 200 2260.5961 -3411.477 -3262.1603 -3254.0771 1104581.5 +Loop time of 0.15156 on 4 procs for 100 steps with 512 atoms -Performance: 211.179 ns/day, 0.114 hours/ns, 2444.196 timesteps/s -97.1% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 57.007 ns/day, 0.421 hours/ns, 659.806 timesteps/s +96.9% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.03285 | 0.033327 | 0.03406 | 0.3 | 81.46 -Neigh | 0.000975 | 0.0010677 | 0.001184 | 0.2 | 2.61 -Comm | 0.004915 | 0.005528 | 0.006044 | 0.7 | 13.51 -Output | 0.000129 | 0.0001535 | 0.000226 | 0.0 | 0.38 -Modify | 0.000564 | 0.0005885 | 0.000604 | 0.0 | 1.44 -Other | | 0.0002483 | | | 0.61 +Pair | 0.12637 | 0.13067 | 0.13398 | 0.8 | 86.22 +Neigh | 0.0019262 | 0.0020029 | 0.0021148 | 0.2 | 1.32 +Comm | 0.012843 | 0.01629 | 0.020752 | 2.2 | 10.75 +Output | 0.00014877 | 0.00030798 | 0.00078011 | 0.0 | 0.20 +Modify | 0.0015197 | 0.0016043 | 0.0017824 | 0.3 | 1.06 +Other | | 0.0006804 | | | 0.45 Nlocal: 128.000 ave 133 max 123 min Histogram: 1 0 0 1 0 0 0 1 0 1 From e706f75d179ce4aabd9a6834be9dba5db2010c8c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 9 Feb 2021 11:44:26 -0500 Subject: [PATCH 193/384] fix permissions --- examples/USER/reaction/create_atoms_polystyrene/in.grow_styrene | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 examples/USER/reaction/create_atoms_polystyrene/in.grow_styrene diff --git a/examples/USER/reaction/create_atoms_polystyrene/in.grow_styrene b/examples/USER/reaction/create_atoms_polystyrene/in.grow_styrene old mode 100755 new mode 100644 From 653c29624658154f09cda260aa1a0585f38d6520 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 9 Feb 2021 12:29:14 -0500 Subject: [PATCH 194/384] document __version__ module member and version check --- doc/src/Python_module.rst | 17 +++++++++++++++++ doc/src/fix_flow_gauss.rst | 5 +++-- python/lammps/__init__.py | 10 ++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/doc/src/Python_module.rst b/doc/src/Python_module.rst index 8b4fbe1c2e..59be645cbd 100644 --- a/doc/src/Python_module.rst +++ b/doc/src/Python_module.rst @@ -26,6 +26,23 @@ There are multiple Python interface classes in the :py:mod:`lammps` module: .. _mpi4py_url: https://mpi4py.readthedocs.io +.. admonition:: Version check + :class: note + + The :py:mod:`lammps` module stores the version number of the LAMMPS + version it is installed from. When initializing the + :py:class:`lammps ` class, this version is checked to + be the same as the result from :py:func:`lammps.version`, the version + of the LAMMPS shared library that the module interfaces to. If the + they are not the same an AttributeError exception is raised since a + mismatch of versions (e.g. due to incorrect use of the + ``LD_LIBRARY_PATH`` or ``PYTHONPATH`` environment variables can lead + to crashes or data corruption and otherwise incorrect behavior. + +.. automodule:: lammps + :members: + :noindex: + ---------- The ``lammps`` class API diff --git a/doc/src/fix_flow_gauss.rst b/doc/src/fix_flow_gauss.rst index c7907432dc..67a0218c9b 100644 --- a/doc/src/fix_flow_gauss.rst +++ b/doc/src/fix_flow_gauss.rst @@ -165,8 +165,9 @@ LAMMPS was built with that package. See the :doc:`Build package Related commands """""""""""""""" -:doc:`fix addforce `, :doc:`compute temp/profile - `, :doc:`velocity ` +:doc:`fix addforce `, +:doc:`compute temp/profile `, +:doc:`velocity ` Default """"""" diff --git a/python/lammps/__init__.py b/python/lammps/__init__.py index e73e514d8c..be496167e8 100644 --- a/python/lammps/__init__.py +++ b/python/lammps/__init__.py @@ -1,3 +1,13 @@ +""" +LAMMPS module global members: + +.. data:: __version__ + + Numerical representation of the LAMMPS version this + module was taken from. Has the same format as the + result of :py:func:`lammps.version`. +""" + from .constants import * from .core import * from .data import * From 418135667fdd7341963995bd307b4435ead73b89 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 9 Feb 2021 12:38:46 -0500 Subject: [PATCH 195/384] address a whole bunch of spelling issues that suddenly popped up. --- doc/src/Developer_notes.rst | 2 +- doc/src/fix_cmap.rst | 2 +- doc/src/fix_colvars.rst | 2 +- doc/src/fix_modify.rst | 4 ++-- doc/src/fix_orient.rst | 2 +- doc/src/fix_orient_eco.rst | 2 +- doc/src/fix_precession_spin.rst | 2 +- doc/src/fix_tgnh_drude.rst | 2 +- doc/src/fix_wall_ees.rst | 2 +- doc/utils/sphinx-config/false_positives.txt | 4 ++++ 10 files changed, 14 insertions(+), 10 deletions(-) diff --git a/doc/src/Developer_notes.rst b/doc/src/Developer_notes.rst index d4fee7b9a0..ab2e3826f2 100644 --- a/doc/src/Developer_notes.rst +++ b/doc/src/Developer_notes.rst @@ -90,7 +90,7 @@ The fix must also do the following: The fix must also specify whether (by default) to include or exclude these contributions to the global/peratom energy/virial of the system. For the fix to include the contributions, set either of both of these -variables in the contructor: +variables in the constructor: * *thermo_energy* = 1, for global and peratom energy * *thermo_virial* = 1, for global and peratom virial diff --git a/doc/src/fix_cmap.rst b/doc/src/fix_cmap.rst index 94f8a903e9..892fd4ab41 100644 --- a/doc/src/fix_cmap.rst +++ b/doc/src/fix_cmap.rst @@ -103,7 +103,7 @@ uninterrupted fashion. The :doc:`fix_modify ` *energy* option is supported by this fix to add the potential energy of the CMAP interactions to both the global potential energy and peratom potential energies of the -sysstem as part of :doc:`thermodynamic output ` or +system as part of :doc:`thermodynamic output ` or output by the :doc:`compute pe/atom ` command. The default setting for this fix is :doc:`fix_modify energy yes `. diff --git a/doc/src/fix_colvars.rst b/doc/src/fix_colvars.rst index 7a238d3242..3f503410d3 100644 --- a/doc/src/fix_colvars.rst +++ b/doc/src/fix_colvars.rst @@ -115,7 +115,7 @@ in a pair of double quotes ("), or can span multiple lines when bracketed by a pair of triple double quotes (""", like python embedded documentation). This fix computes a global scalar which can be accessed by various -:doc:`output commands `. The scalar is the Covars +:doc:`output commands `. The scalar is the Colvars energy mentioned above. The scalar value calculated by this fix is "extensive". diff --git a/doc/src/fix_modify.rst b/doc/src/fix_modify.rst index 3f97b158e2..a6bac6ac44 100644 --- a/doc/src/fix_modify.rst +++ b/doc/src/fix_modify.rst @@ -83,7 +83,7 @@ appropriate fix. .. note:: - For most fixes that suppport the *energy* keyword, the default + For most fixes that support the *energy* keyword, the default setting is *no*. For a few it is *yes*, when a user would expect that to be the case. The doc page of each fix gives the default. @@ -108,7 +108,7 @@ option to include or exclude the contribution from fixes. .. note:: - For most fixes that suppport the *virial* keyword, the default + For most fixes that support the *virial* keyword, the default setting is *no*. For a few it is *yes*, when a user would expect that to be the case. The doc page of each fix gives the default. diff --git a/doc/src/fix_orient.rst b/doc/src/fix_orient.rst index 12f22403cd..3397261552 100644 --- a/doc/src/fix_orient.rst +++ b/doc/src/fix_orient.rst @@ -149,7 +149,7 @@ No information about this fix is written to :doc:`binary restart files The :doc:`fix_modify ` *energy* option is supported by this fix to add the potential energy of atom interactions with the -grain bounadry driving force to the global potential energy of the +grain boundary driving force to the global potential energy of the system as part of :doc:`thermodynamic output `. The default setting for this fix is :doc:`fix_modify energy no `. diff --git a/doc/src/fix_orient_eco.rst b/doc/src/fix_orient_eco.rst index 71d5a6de86..1db83338d4 100644 --- a/doc/src/fix_orient_eco.rst +++ b/doc/src/fix_orient_eco.rst @@ -103,7 +103,7 @@ files `. The :doc:`fix_modify ` *energy* option is supported by this fix to add the potential energy of atom interactions with the -grain bounadry driving force to the global potential energy of the +grain boundary driving force to the global potential energy of the system as part of :doc:`thermodynamic output `. The default setting for this fix is :doc:`fix_modify energy no `. diff --git a/doc/src/fix_precession_spin.rst b/doc/src/fix_precession_spin.rst index 17231d5686..5e818374a0 100644 --- a/doc/src/fix_precession_spin.rst +++ b/doc/src/fix_precession_spin.rst @@ -141,7 +141,7 @@ No information about this fix is written to :doc:`binary restart files `. The :doc:`fix_modify ` *energy* option is supported by -this fix to add the energy assocatiated with the spin precession +this fix to add the energy associated with the spin precession torque to the global potential energy of the system as part of :doc:`thermodynamic output `. The default setting for this fix is :doc:`fix_modify energy no `. diff --git a/doc/src/fix_tgnh_drude.rst b/doc/src/fix_tgnh_drude.rst index 6d11539dd2..1854655a82 100644 --- a/doc/src/fix_tgnh_drude.rst +++ b/doc/src/fix_tgnh_drude.rst @@ -240,7 +240,7 @@ compute temperature on a subset of atoms. keyword will be unaffected by the *temp* setting. The cumulative energy change in the system imposed by these fixes, due -to thermostatting and/or barostating, are included in the +to thermostatting and/or barostatting, are included in the :doc:`thermodynamic output ` keywords *ecouple* and *econserve*. See the :doc:`thermo_style ` doc page for details. diff --git a/doc/src/fix_wall_ees.rst b/doc/src/fix_wall_ees.rst index fde9fe7234..cf689f3a77 100644 --- a/doc/src/fix_wall_ees.rst +++ b/doc/src/fix_wall_ees.rst @@ -131,7 +131,7 @@ The :doc:`fix_modify ` *energy* option is supported by these fixes to add the energy of interaction between atoms and all the specified walls or region wall to the global potential energy of the system as part of :doc:`thermodynamic output `. The -default settings for thes fixes are :doc:`fix_modify energy no +default settings for these fixes are :doc:`fix_modify energy no `. The :doc:`fix_modify ` *respa* option is supported by diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index a2f8764aee..13282ebe9c 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -508,6 +508,7 @@ cpp cpu createatoms createAtoms +CreateIDs crespi Crespi Critchley @@ -788,6 +789,7 @@ ees eFF efield effm +eflag eflux eg Eggebrecht @@ -2681,6 +2683,7 @@ rfile rg Rg Rhaphson +Rhe rheological rheology rhodo @@ -3335,6 +3338,7 @@ verlet Verlet versa ves +vflag vhi vibrational Vij From f92e07185b0ef544786f7d22f5085fb9b410f6f7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 9 Feb 2021 13:21:04 -0500 Subject: [PATCH 196/384] initialize arrays for per-level gridcomm buffers to NULL --- src/KSPACE/msm.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/KSPACE/msm.cpp b/src/KSPACE/msm.cpp index 1e980e856f..490fbae0e0 100644 --- a/src/KSPACE/msm.cpp +++ b/src/KSPACE/msm.cpp @@ -654,7 +654,6 @@ void MSM::allocate() npergrid = 1; memory->create(gc_buf1[n],npergrid*ngc_buf1[n],"msm:gc_buf1"); memory->create(gc_buf2[n],npergrid*ngc_buf2[n],"msm:gc_buf2"); - } else { delete gc[n]; memory->destroy(gc_buf1[n]); @@ -808,6 +807,10 @@ void MSM::allocate_levels() for (int n=0; n Date: Tue, 9 Feb 2021 14:12:43 -0500 Subject: [PATCH 197/384] must purge python/build folder so we don't inherit outdated files --- cmake/CMakeLists.txt | 4 ++-- src/Makefile | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index c1fef4d4e1..2d259791f2 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -662,8 +662,8 @@ if(BUILD_SHARED_LIBS) endif() if (Python_EXECUTABLE) add_custom_target( - install-python - ${Python_EXECUTABLE} install.py -v ${LAMMPS_SOURCE_DIR}/version.h + install-python ${CMAKE_COMMAND} -E remove_directory build + COMMAND ${Python_EXECUTABLE} install.py -v ${LAMMPS_SOURCE_DIR}/version.h -p ${LAMMPS_PYTHON_DIR}/lammps -l ${CMAKE_BINARY_DIR}/liblammps${LAMMPS_MACHINE}${CMAKE_SHARED_LIBRARY_SUFFIX} WORKING_DIRECTORY ${LAMMPS_PYTHON_DIR} diff --git a/src/Makefile b/src/Makefile index 7a5e1aa728..679cbe7b97 100644 --- a/src/Makefile +++ b/src/Makefile @@ -272,11 +272,13 @@ mpi-stubs: @cd STUBS; $(MAKE) clean; $(MAKE) # install LAMMPS shared lib and Python wrapper for Python usage -# include python package settings to -# automatically adapt name of python interpreter +# include python package settings to automatically adapt name of +# the python interpreter. must purge build folder to not install +# unwanted outdated files. sinclude ../lib/python/Makefile.lammps install-python: + @rm -rf ../python/build @$(PYTHON) ../python/install.py -v ../src/version.h \ -p ../python/lammps -l ../src/liblammps.so From 62a152e4a2a5767d20edd637e9b02fb1b095d66f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 9 Feb 2021 14:13:18 -0500 Subject: [PATCH 198/384] get version number from package version instead of rewriting the __init__.py file --- python/install.py | 33 +-------------------------------- python/lammps/__init__.py | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/python/install.py b/python/install.py index bd0874593f..6765c33925 100644 --- a/python/install.py +++ b/python/install.py @@ -10,7 +10,7 @@ build target in the conventional and CMake based build systems # copy LAMMPS shared library and lammps package to system dirs from __future__ import print_function -import sys,os,re,shutil +import sys,os,shutil from argparse import ArgumentParser parser = ArgumentParser(prog='install.py', @@ -90,35 +90,11 @@ def get_lammps_version(header): verstr = get_lammps_version(args.version) -# convert string version to numeric version -vernum = 0 -vregex = re.compile(r"([0-9]+)([A-Za-z]+)(2[0-9]+)") -m = vregex.match(verstr) -if (m): - month2num = { 'Jan' : 1, 'Feb' : 2, 'Mar' : 3, 'Apr' : 4, 'May' : 5, 'Jun' : 6, - 'Jul' : 7, 'Aug' : 8, 'Sep' : 9, 'Oct' : 10, 'Nov' : 11, 'Dec' : 12 } - try: - vernum = int(m.group(3))*10000 - vernum += month2num[m.group(2)]*100 - vernum += int(m.group(1)) - except: - exit('Failure to parse version string: %s' % verstr) - print("Installing LAMMPS Python package version %s into site-packages folder" % verstr) # we need to switch to the folder of the python package os.chdir(os.path.dirname(args.package)) - - -# update version number in lammps module -vregex = re.compile(r".*(__version__ += +)[0-9]+") -with open(os.path.join('lammps','__init__.py'), "r+") as f: - content = f.read() - f.seek(0) - f.write(re.sub(vregex, lambda match: '{}{}'.format(match.group(1), vernum), content)) - f.truncate() - from distutils.core import setup from distutils.sysconfig import get_python_lib import site @@ -150,10 +126,3 @@ if tryuser: setup(**setup_kwargs) except: print("Installation into user site package folder failed.") - -# restore __version__ == 0 for in place usage -with open(os.path.join('lammps','__init__.py'), "r+") as f: - content = f.read() - f.seek(0) - f.write(re.sub(vregex, lambda match: '{}{}'.format(match.group(1), 0), content)) - f.truncate() diff --git a/python/lammps/__init__.py b/python/lammps/__init__.py index be496167e8..89ff30ead9 100644 --- a/python/lammps/__init__.py +++ b/python/lammps/__init__.py @@ -13,6 +13,37 @@ from .core import * from .data import * from .pylammps import * -# automatically updated during installation +# convert module string version to numeric version +def get_version_number(): + import re + from sys import version_info + vstring = None + if version_info.major == 3 and version_info.minor >= 8: + from importlib.metadata import version + try: + vstring = version('lammps') + except: pass + else: + from pkg_resources import get_distribution + try: + vstring = get_distribution('lammps').version + except: pass -__version__ = 0 + if not vstring: + return 0 + + vregex = re.compile(r"([0-9]+)([A-Za-z]+)(2[0-9]+)") + m = vregex.match(vstring) + + if (m): + month2num = { 'Jan' : 1, 'Feb' : 2, 'Mar' : 3, 'Apr' : 4, 'May' : 5, 'Jun' : 6, + 'Jul' : 7, 'Aug' : 8, 'Sep' : 9, 'Oct' : 10, 'Nov' : 11, 'Dec' : 12 } + try: + vernum = int(m.group(3))*10000 + vernum += month2num[m.group(2)]*100 + vernum += int(m.group(1)) + except: + exit('Failure to parse version string: %s' % verstr) + return vernum + +__version__ = get_version_number() From 903433d9dd7aca6f8989b917c0d10801d96c4541 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 9 Feb 2021 14:22:30 -0500 Subject: [PATCH 199/384] use datetime module to convert string date to numeric date --- python/lammps/__init__.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/python/lammps/__init__.py b/python/lammps/__init__.py index 89ff30ead9..48839273c5 100644 --- a/python/lammps/__init__.py +++ b/python/lammps/__init__.py @@ -15,7 +15,7 @@ from .pylammps import * # convert module string version to numeric version def get_version_number(): - import re + from datetime import datetime from sys import version_info vstring = None if version_info.major == 3 and version_info.minor >= 8: @@ -32,18 +32,7 @@ def get_version_number(): if not vstring: return 0 - vregex = re.compile(r"([0-9]+)([A-Za-z]+)(2[0-9]+)") - m = vregex.match(vstring) - - if (m): - month2num = { 'Jan' : 1, 'Feb' : 2, 'Mar' : 3, 'Apr' : 4, 'May' : 5, 'Jun' : 6, - 'Jul' : 7, 'Aug' : 8, 'Sep' : 9, 'Oct' : 10, 'Nov' : 11, 'Dec' : 12 } - try: - vernum = int(m.group(3))*10000 - vernum += month2num[m.group(2)]*100 - vernum += int(m.group(1)) - except: - exit('Failure to parse version string: %s' % verstr) - return vernum + d = datetime.strptime(vstring, "%d%b%Y") + return d.year*10000 + d.month*100 + d.day __version__ = get_version_number() From fff1c0c9a7dc5873f1ffb1bd897aebb201919265 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 9 Feb 2021 20:56:33 -0500 Subject: [PATCH 200/384] rename numpy.py to numpy_wrapper.py to avoid lookup conflicts with python2.7 --- python/lammps/core.py | 2 +- python/lammps/{numpy.py => numpy_wrapper.py} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename python/lammps/{numpy.py => numpy_wrapper.py} (100%) diff --git a/python/lammps/core.py b/python/lammps/core.py index 1dc135359d..d1bc7bc138 100644 --- a/python/lammps/core.py +++ b/python/lammps/core.py @@ -416,7 +416,7 @@ class lammps(object): :rtype: numpy_wrapper """ if not self._numpy: - from .numpy import numpy_wrapper + from .numpy_wrapper import numpy_wrapper self._numpy = numpy_wrapper(self) return self._numpy diff --git a/python/lammps/numpy.py b/python/lammps/numpy_wrapper.py similarity index 100% rename from python/lammps/numpy.py rename to python/lammps/numpy_wrapper.py From 2dd3b368cd7abc16ec3950d0cc14e5bdc13a6a12 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 9 Feb 2021 20:57:08 -0500 Subject: [PATCH 201/384] do not install mliap python support for python 2.x --- python/install.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/install.py b/python/install.py index 6765c33925..6e4c509f07 100644 --- a/python/install.py +++ b/python/install.py @@ -98,6 +98,12 @@ os.chdir(os.path.dirname(args.package)) from distutils.core import setup from distutils.sysconfig import get_python_lib import site +from sys import version_info + +if version_info.major >= 3: + pkgs = ['lammps', 'lammps.mliap'] +else: + pkgs = ['lammps'] #Arguments common to global or user install -- everything but data_files setup_kwargs= dict(name="lammps", @@ -107,7 +113,7 @@ setup_kwargs= dict(name="lammps", url="https://lammps.sandia.gov", description="LAMMPS Molecular Dynamics Python package", license="GPL", - packages=["lammps","lammps.mliap"], + packages=pkgs, ) tryuser=False From 71139ffc9c3f0c7e82e789dde04b5d0523bc08df Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 9 Feb 2021 21:34:08 -0500 Subject: [PATCH 202/384] change version strings to 10 Feb 2021 --- doc/lammps.1 | 2 +- src/version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/lammps.1 b/doc/lammps.1 index 12cff4eeec..9351ba5636 100644 --- a/doc/lammps.1 +++ b/doc/lammps.1 @@ -1,4 +1,4 @@ -.TH LAMMPS "9 February 2021" "2021-02-09" +.TH LAMMPS "10 February 2021" "2021-02-10" .SH NAME .B LAMMPS \- Molecular Dynamics Simulator. diff --git a/src/version.h b/src/version.h index c04929c145..84541d4456 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define LAMMPS_VERSION "9 Feb 2021" +#define LAMMPS_VERSION "10 Feb 2021" From bbb355b1f5efdf0225e6d44f1893fcdfd32e4f61 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 10 Feb 2021 00:29:39 -0500 Subject: [PATCH 203/384] check error status of calls to Python and if they failed print error and terminate --- src/PYTHON/fix_python_invoke.cpp | 23 ++++++++----- src/PYTHON/fix_python_move.cpp | 55 +++++++++++++++++++++----------- 2 files changed, 51 insertions(+), 27 deletions(-) diff --git a/src/PYTHON/fix_python_invoke.cpp b/src/PYTHON/fix_python_invoke.cpp index 6fbd43cbd9..23c4197dca 100644 --- a/src/PYTHON/fix_python_invoke.cpp +++ b/src/PYTHON/fix_python_invoke.cpp @@ -17,6 +17,7 @@ #include "fix_python_invoke.h" +#include "comm.h" #include "error.h" #include "lmppython.h" #include "python_compat.h" @@ -52,14 +53,14 @@ FixPythonInvoke::FixPythonInvoke(LAMMPS *lmp, int narg, char **arg) : // get Python function PyGILState_STATE gstate = PyGILState_Ensure(); - PyObject * pyMain = PyImport_AddModule("__main__"); + PyObject *pyMain = PyImport_AddModule("__main__"); if (!pyMain) { PyGILState_Release(gstate); error->all(FLERR,"Could not initialize embedded Python"); } - char * fname = arg[5]; + char *fname = arg[5]; pFunc = PyObject_GetAttrString(pyMain, fname); if (!pFunc) { @@ -83,13 +84,16 @@ void FixPythonInvoke::end_of_step() { PyGILState_STATE gstate = PyGILState_Ensure(); - PyObject * ptr = PY_VOID_POINTER(lmp); - PyObject * arglist = Py_BuildValue("(O)", ptr); + PyObject *ptr = PY_VOID_POINTER(lmp); + PyObject *arglist = Py_BuildValue("(O)", ptr); - PyObject * result = PyEval_CallObject((PyObject*)pFunc, arglist); + PyObject *result = PyEval_CallObject((PyObject*)pFunc, arglist); Py_DECREF(arglist); + if (!result && (comm->me == 0)) PyErr_Print(); PyGILState_Release(gstate); + if (!result) + error->all(FLERR,"Fix python/invoke end_of_step() method failed"); } /* ---------------------------------------------------------------------- */ @@ -100,11 +104,14 @@ void FixPythonInvoke::post_force(int vflag) PyGILState_STATE gstate = PyGILState_Ensure(); - PyObject * ptr = PY_VOID_POINTER(lmp); - PyObject * arglist = Py_BuildValue("(Oi)", ptr, vflag); + PyObject *ptr = PY_VOID_POINTER(lmp); + PyObject *arglist = Py_BuildValue("(Oi)", ptr, vflag); - PyObject * result = PyEval_CallObject((PyObject*)pFunc, arglist); + PyObject *result = PyEval_CallObject((PyObject*)pFunc, arglist); Py_DECREF(arglist); + if (!result && (comm->me == 0)) PyErr_Print(); PyGILState_Release(gstate); + if (!result) + error->all(FLERR,"Fix python/invoke post_force() method failed"); } diff --git a/src/PYTHON/fix_python_move.cpp b/src/PYTHON/fix_python_move.cpp index 18047b794e..5425b78193 100644 --- a/src/PYTHON/fix_python_move.cpp +++ b/src/PYTHON/fix_python_move.cpp @@ -17,6 +17,7 @@ #include "fix_python_move.h" +#include "comm.h" #include "error.h" #include "lmppython.h" #include "python_compat.h" @@ -42,13 +43,13 @@ FixPythonMove::FixPythonMove(LAMMPS *lmp, int narg, char **arg) : PyGILState_STATE gstate = PyGILState_Ensure(); // add current directory to PYTHONPATH - PyObject * py_path = PySys_GetObject((char *)"path"); + PyObject *py_path = PySys_GetObject((char *)"path"); PyList_Append(py_path, PY_STRING_FROM_STRING(".")); // create integrator instance - char * full_cls_name = arg[3]; - char * lastpos = strrchr(full_cls_name, '.'); + char *full_cls_name = arg[3]; + char *lastpos = strrchr(full_cls_name, '.'); if (lastpos == nullptr) { error->all(FLERR,"Fix python/integrate requires fully qualified class name"); @@ -57,14 +58,14 @@ FixPythonMove::FixPythonMove(LAMMPS *lmp, int narg, char **arg) : size_t module_name_length = strlen(full_cls_name) - strlen(lastpos); size_t cls_name_length = strlen(lastpos)-1; - char * module_name = new char[module_name_length+1]; - char * cls_name = new char[cls_name_length+1]; + char *module_name = new char[module_name_length+1]; + char *cls_name = new char[cls_name_length+1]; strncpy(module_name, full_cls_name, module_name_length); module_name[module_name_length] = 0; strcpy(cls_name, lastpos+1); - PyObject * pModule = PyImport_ImportModule(module_name); + PyObject *pModule = PyImport_ImportModule(module_name); if (!pModule) { PyErr_Print(); PyErr_Clear(); @@ -86,9 +87,9 @@ FixPythonMove::FixPythonMove(LAMMPS *lmp, int narg, char **arg) : delete [] module_name; delete [] cls_name; - PyObject * ptr = PY_VOID_POINTER(lmp); - PyObject * arglist = Py_BuildValue("(O)", ptr); - PyObject * py_move_obj = PyObject_CallObject(py_move_type, arglist); + PyObject *ptr = PY_VOID_POINTER(lmp); + PyObject *arglist = Py_BuildValue("(O)", ptr); + PyObject *py_move_obj = PyObject_CallObject(py_move_type, arglist); Py_DECREF(arglist); if (!py_move_obj) { @@ -136,10 +137,12 @@ void FixPythonMove::init() PyErr_Print(); PyErr_Clear(); PyGILState_Release(gstate); - error->all(FLERR,"Could not find 'init' method'"); + error->all(FLERR,"Could not find 'init()' method'"); } - PyObject * result = PyEval_CallObject(py_init, nullptr); + PyObject *result = PyEval_CallObject(py_init, nullptr); + if (!result && (comm->me == 0)) PyErr_Print(); PyGILState_Release(gstate); + if (!result) error->all(FLERR,"Fix python/move init() method failed"); } /* ---------------------------------------------------------------------- */ @@ -155,10 +158,13 @@ void FixPythonMove::initial_integrate(int vflag) PyGILState_Release(gstate); error->all(FLERR,"Could not find 'initial_integrate' method'"); } - PyObject * arglist = Py_BuildValue("(i)", vflag); - PyObject * result = PyEval_CallObject(py_initial_integrate, arglist); + PyObject *arglist = Py_BuildValue("(i)", vflag); + PyObject *result = PyEval_CallObject(py_initial_integrate, arglist); Py_DECREF(arglist); + if (!result && (comm->me == 0)) PyErr_Print(); PyGILState_Release(gstate); + if (!result) error->all(FLERR,"Fix python/move initial_integrate() " + "method failed"); } /* ---------------------------------------------------------------------- */ @@ -174,8 +180,11 @@ void FixPythonMove::final_integrate() PyGILState_Release(gstate); error->all(FLERR,"Could not find 'final_integrate' method'"); } - PyObject * result = PyEval_CallObject(py_final_integrate, nullptr); + PyObject *result = PyEval_CallObject(py_final_integrate, nullptr); + if (!result && (comm->me == 0)) PyErr_Print(); PyGILState_Release(gstate); + if (!result) error->all(FLERR,"Fix python/move final_integrate() method " + "failed"); } /* ---------------------------------------------------------------------- */ @@ -191,10 +200,13 @@ void FixPythonMove::initial_integrate_respa(int vflag, int ilevel, int iloop) PyGILState_Release(gstate); error->all(FLERR,"Could not find 'initial_integrate_respa' method'"); } - PyObject * arglist = Py_BuildValue("(iii)", vflag, ilevel, iloop); - PyObject * result = PyEval_CallObject(py_initial_integrate_respa, arglist); + PyObject *arglist = Py_BuildValue("(iii)", vflag, ilevel, iloop); + PyObject *result = PyEval_CallObject(py_initial_integrate_respa, arglist); Py_DECREF(arglist); + if (!result && (comm->me == 0)) PyErr_Print(); PyGILState_Release(gstate); + if (!result) error->all(FLERR,"Fix python/move initial_integrate_respa() " + "method failed"); } /* ---------------------------------------------------------------------- */ @@ -210,10 +222,13 @@ void FixPythonMove::final_integrate_respa(int ilevel, int iloop) PyGILState_Release(gstate); error->all(FLERR,"Could not find 'final_integrate_respa' method'"); } - PyObject * arglist = Py_BuildValue("(ii)", ilevel, iloop); - PyObject * result = PyEval_CallObject(py_final_integrate_respa, arglist); + PyObject *arglist = Py_BuildValue("(ii)", ilevel, iloop); + PyObject *result = PyEval_CallObject(py_final_integrate_respa, arglist); Py_DECREF(arglist); + if (!result && (comm->me == 0)) PyErr_Print(); PyGILState_Release(gstate); + if (!result) error->all(FLERR,"Fix python/move final_integrate_respa() " + "method failed"); } /* ---------------------------------------------------------------------- */ @@ -229,6 +244,8 @@ void FixPythonMove::reset_dt() PyGILState_Release(gstate); error->all(FLERR,"Could not find 'reset_dt' method'"); } - PyObject * result = PyEval_CallObject(py_reset_dt, nullptr); + PyObject *result = PyEval_CallObject(py_reset_dt, nullptr); + if (!result && (comm->me == 0)) PyErr_Print(); PyGILState_Release(gstate); + if (!result) error->all(FLERR,"Fix python/move reset_dt() method failed"); } From 11341a5b6651cbdab242a6ea1a195fc3357fe55b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 10 Feb 2021 08:57:14 -0500 Subject: [PATCH 204/384] enforce documented Python version requirement for MLIAP with Python --- cmake/Modules/Packages/MLIAP.cmake | 11 ++++++++++- doc/src/Packages_details.rst | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cmake/Modules/Packages/MLIAP.cmake b/cmake/Modules/Packages/MLIAP.cmake index d3f601a1e1..81bb10cb8f 100644 --- a/cmake/Modules/Packages/MLIAP.cmake +++ b/cmake/Modules/Packages/MLIAP.cmake @@ -1,7 +1,7 @@ # if PYTHON package is included we may also include Python support in MLIAP set(MLIAP_ENABLE_PYTHON_DEFAULT OFF) if(PKG_PYTHON) - find_package(Cythonize) + find_package(Cythonize QUIET) if(Cythonize_FOUND) set(MLIAP_ENABLE_PYTHON_DEFAULT ON) endif() @@ -14,6 +14,15 @@ if(MLIAP_ENABLE_PYTHON) if(NOT PKG_PYTHON) message(FATAL_ERROR "Must enable PYTHON package for including Python support in MLIAP") endif() + if(CMAKE_VERSION VERSION_LESS 3.12) + if(PYTHONLIBS_VERSION_STRING VERSION_LESS 3.6) + message(FATAL_ERROR "Python support in MLIAP requires Python 3.6 or later") + endif() + else() + if(Python_VERSION VERSION_LESS 3.6) + message(FATAL_ERROR "Python support in MLIAP requires Python 3.6 or later") + endif() + endif() set(MLIAP_BINARY_DIR ${CMAKE_BINARY_DIR}/cython) set(MLIAP_CYTHON_SRC ${LAMMPS_SOURCE_DIR}/MLIAP/mliap_model_python_couple.pyx) diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index e044adfcb3..455df083e4 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -668,8 +668,8 @@ A general interface for machine-learning interatomic potentials, including PyTor To use this package, also the :ref:`SNAP package ` package needs to be installed. To make the *mliappy* model available, also the -:ref:`PYTHON package ` package needs to be installed, the version of -Python must be 3.6 or later, and the `cython `_ software +:ref:`PYTHON package ` package needs to be installed, the version +of Python must be 3.6 or later, and the `cython `_ software must be installed. **Author:** Aidan Thompson (Sandia), Nicholas Lubbers (LANL). From 761527e5634e9b240801b645ec4efb64d68c5427 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Wed, 10 Feb 2021 09:55:28 -0700 Subject: [PATCH 205/384] clarified Voigt ordering and non-Voigt ordering for virial[6] --- doc/src/compute_pressure.rst | 7 +++++-- doc/src/compute_stress_atom.rst | 5 +++++ src/angle.h | 2 +- src/bond.h | 2 +- src/compute_pressure.h | 2 +- src/dihedral.h | 2 +- src/domain.h | 1 + src/improper.h | 2 +- src/kspace.h | 2 +- src/pair.h | 2 +- 10 files changed, 18 insertions(+), 9 deletions(-) diff --git a/doc/src/compute_pressure.rst b/doc/src/compute_pressure.rst index b89d17bc5a..f69f70daba 100644 --- a/doc/src/compute_pressure.rst +++ b/doc/src/compute_pressure.rst @@ -122,8 +122,11 @@ Output info This compute calculates a global scalar (the pressure) and a global vector of length 6 (pressure tensor), which can be accessed by indices 1-6. These values can be used by any command that uses global scalar -or vector values from a compute as input. See the :doc:`Howto output ` doc page for an overview of LAMMPS output -options. +or vector values from a compute as input. See the :doc:`Howto output +` doc page for an overview of LAMMPS output options. + +The ordering of values in the symmetric pressure tensor is as follows: +pxx, pyy, pzz, pxy, pxz, pyz. The scalar and vector values calculated by this compute are "intensive". The scalar and vector values will be in pressure diff --git a/doc/src/compute_stress_atom.rst b/doc/src/compute_stress_atom.rst index 08f1c5f1ba..393d3b2ffb 100644 --- a/doc/src/compute_stress_atom.rst +++ b/doc/src/compute_stress_atom.rst @@ -216,6 +216,11 @@ an identical manner to compute *stress/atom*. See the :doc:`Howto output ` doc page for an overview of LAMMPS output options. +The ordering of the 6 columns for *stress/atom* is as follows: xx, yy, +zz, xy, xz, yz. The ordering of the 9 columns for +*centroid/stress/atom* is as follows: xx, yy, zz, xy, xz, yz, yx, zx, +zy. + The per-atom array values will be in pressure\*volume :doc:`units ` as discussed above. diff --git a/src/angle.h b/src/angle.h index ffed437743..c8af8202f0 100644 --- a/src/angle.h +++ b/src/angle.h @@ -26,7 +26,7 @@ class Angle : protected Pointers { int *setflag; int writedata; // 1 if writes coeffs to data file double energy; // accumulated energies - double virial[6]; // accumulated virial + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz double *eatom,**vatom; // accumulated per-atom energy/virial double **cvatom; // accumulated per-atom centroid virial diff --git a/src/bond.h b/src/bond.h index 5406aa3f02..74f38ad455 100644 --- a/src/bond.h +++ b/src/bond.h @@ -26,7 +26,7 @@ class Bond : protected Pointers { int *setflag; int writedata; // 1 if writes coeffs to data file double energy; // accumulated energies - double virial[6]; // accumulated virial + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz double *eatom,**vatom; // accumulated per-atom energy/virial int reinitflag; // 1 if compatible with fix adapt and alike diff --git a/src/compute_pressure.h b/src/compute_pressure.h index 8d0ec4aa04..235ccbe1eb 100644 --- a/src/compute_pressure.h +++ b/src/compute_pressure.h @@ -40,7 +40,7 @@ class ComputePressure : public Compute { double *kspace_virial; Compute *temperature; char *id_temp; - double virial[6]; + double virial[6]; // ordering: xx,yy,zz,xy,xz,yz int pairhybridflag; class Pair *pairhybrid; int keflag,pairflag,bondflag,angleflag,dihedralflag,improperflag; diff --git a/src/dihedral.h b/src/dihedral.h index c571a74dd4..c7fd459f1e 100644 --- a/src/dihedral.h +++ b/src/dihedral.h @@ -26,7 +26,7 @@ class Dihedral : protected Pointers { int *setflag; int writedata; // 1 if writes coeffs to data file double energy; // accumulated energy - double virial[6]; // accumulated virial + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz double *eatom,**vatom; // accumulated per-atom energy/virial double **cvatom; // accumulated per-atom centroid virial diff --git a/src/domain.h b/src/domain.h index d807463bf3..12a5558594 100644 --- a/src/domain.h +++ b/src/domain.h @@ -76,6 +76,7 @@ class Domain : protected Pointers { // triclinic box double xy,xz,yz; // 3 tilt factors double h[6],h_inv[6]; // shape matrix in Voigt notation + // Voigt = xx,yy,zz,yz,xz,xy double h_rate[6],h_ratelo[3]; // rate of box size/shape change int box_change; // 1 if any of next 3 flags are set, else 0 diff --git a/src/improper.h b/src/improper.h index 9e73be931c..1b3c9b6786 100644 --- a/src/improper.h +++ b/src/improper.h @@ -26,7 +26,7 @@ class Improper : protected Pointers { int *setflag; int writedata; // 1 if writes coeffs to data file double energy; // accumulated energies - double virial[6]; // accumulated virial + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz double *eatom,**vatom; // accumulated per-atom energy/virial double **cvatom; // accumulated per-atom centroid virial diff --git a/src/kspace.h b/src/kspace.h index 978daeace1..4777963d8a 100644 --- a/src/kspace.h +++ b/src/kspace.h @@ -32,7 +32,7 @@ class KSpace : protected Pointers { public: double energy; // accumulated energies double energy_1,energy_6; - double virial[6]; // accumulated virial + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz double *eatom,**vatom; // accumulated per-atom energy/virial double e2group; // accumulated group-group energy double f2group[3]; // accumulated group-group force diff --git a/src/pair.h b/src/pair.h index 5801941458..9bca64fbf3 100644 --- a/src/pair.h +++ b/src/pair.h @@ -35,7 +35,7 @@ class Pair : protected Pointers { static int instance_total; // # of Pair classes ever instantiated double eng_vdwl,eng_coul; // accumulated energies - double virial[6]; // accumulated virial + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz double *eatom,**vatom; // accumulated per-atom energy/virial double **cvatom; // accumulated per-atom centroid virial From 5fecd9ed72b4fdd031f4c44ca19f154d8a58ba3f Mon Sep 17 00:00:00 2001 From: Plimpton Date: Wed, 10 Feb 2021 09:58:53 -0700 Subject: [PATCH 206/384] more Voigt clarifications --- src/atom_vec_tri.cpp | 2 +- src/domain.h | 2 +- src/math_extra.cpp | 8 ++++---- src/math_extra.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/atom_vec_tri.cpp b/src/atom_vec_tri.cpp index e9477a7d41..44a0986cb8 100644 --- a/src/atom_vec_tri.cpp +++ b/src/atom_vec_tri.cpp @@ -539,7 +539,7 @@ void AtomVecTri::data_atom_bonus(int m, char **values) double area = 0.5 * MathExtra::len3(norm); rmass[m] *= area; - // inertia = inertia tensor of triangle as 6-vector in Voigt notation + // inertia = inertia tensor of triangle as 6-vector in Voigt ordering double inertia[6]; MathExtra::inertia_triangle(c1,c2,c3,rmass[m],inertia); diff --git a/src/domain.h b/src/domain.h index 12a5558594..c3ea9e2bea 100644 --- a/src/domain.h +++ b/src/domain.h @@ -75,7 +75,7 @@ class Domain : protected Pointers { // triclinic box double xy,xz,yz; // 3 tilt factors - double h[6],h_inv[6]; // shape matrix in Voigt notation + double h[6],h_inv[6]; // shape matrix in Voigt ordering // Voigt = xx,yy,zz,yz,xz,xy double h_rate[6],h_ratelo[3]; // rate of box size/shape change diff --git a/src/math_extra.cpp b/src/math_extra.cpp index 2116324494..df74ad5be2 100644 --- a/src/math_extra.cpp +++ b/src/math_extra.cpp @@ -396,7 +396,7 @@ void quat_to_mat_trans(const double *quat, double mat[3][3]) compute space-frame inertia tensor of an ellipsoid radii = 3 radii of ellipsoid quat = orientiation quaternion of ellipsoid - return symmetric inertia tensor as 6-vector in Voigt notation + return symmetric inertia tensor as 6-vector in Voigt ordering ------------------------------------------------------------------------- */ void inertia_ellipsoid(double *radii, double *quat, double mass, @@ -424,7 +424,7 @@ void inertia_ellipsoid(double *radii, double *quat, double mass, compute space-frame inertia tensor of a line segment in 2d length = length of line theta = orientiation of line - return symmetric inertia tensor as 6-vector in Voigt notation + return symmetric inertia tensor as 6-vector in Voigt ordering ------------------------------------------------------------------------- */ void inertia_line(double length, double theta, double mass, double *inertia) @@ -462,7 +462,7 @@ void inertia_line(double length, double theta, double mass, double *inertia) S = 1/24 [2 1 1] [1 2 1] [1 1 2] - return symmetric inertia tensor as 6-vector in Voigt notation + return symmetric inertia tensor as 6-vector in Voigt ordering ------------------------------------------------------------------------- */ void inertia_triangle(double *v0, double *v1, double *v2, @@ -503,7 +503,7 @@ void inertia_triangle(double *v0, double *v1, double *v2, compute space-frame inertia tensor of a triangle idiag = previously computed diagonal inertia tensor quat = orientiation quaternion of triangle - return symmetric inertia tensor as 6-vector in Voigt notation + return symmetric inertia tensor as 6-vector in Voigt ordering ------------------------------------------------------------------------- */ void inertia_triangle(double *idiag, double *quat, double /*mass*/, diff --git a/src/math_extra.h b/src/math_extra.h index 390538efdb..767ae3f531 100644 --- a/src/math_extra.h +++ b/src/math_extra.h @@ -95,7 +95,7 @@ namespace MathExtra { double dt); // shape matrix operations - // upper-triangular 3x3 matrix stored in Voigt notation as 6-vector + // upper-triangular 3x3 matrix stored in Voigt ordering as 6-vector inline void multiply_shape_shape(const double *one, const double *two, double *ans); @@ -593,7 +593,7 @@ inline void MathExtra::scalar_times3(const double f, double m[3][3]) /* ---------------------------------------------------------------------- multiply 2 shape matrices - upper-triangular 3x3, stored as 6-vector in Voigt notation + upper-triangular 3x3, stored as 6-vector in Voigt ordering ------------------------------------------------------------------------- */ inline void MathExtra::multiply_shape_shape(const double *one, From 006de01c053c29250d12a3aa5c0668bd25c136f6 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 10 Feb 2021 12:20:04 -0500 Subject: [PATCH 207/384] update false positives list for spell checking --- doc/utils/sphinx-config/false_positives.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 13282ebe9c..9937a98850 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -2540,6 +2540,8 @@ Px pxx Pxx Pxy +pxy +pxz py Py pydir @@ -2551,10 +2553,13 @@ pymol pypar pythonic pytorch +pyy Pyy +pyz pz Pz Pzz +pzz qbmsst qcore qdist From 95a4ac157b46f847aef1ed80b0429d849ed8aca7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 10 Feb 2021 14:27:17 -0500 Subject: [PATCH 208/384] update a few more comments --- src/fix_box_relax.cpp | 2 +- src/fix_nh.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fix_box_relax.cpp b/src/fix_box_relax.cpp index 0200f8ed03..ef3032fe0c 100644 --- a/src/fix_box_relax.cpp +++ b/src/fix_box_relax.cpp @@ -738,7 +738,7 @@ void FixBoxRelax::couple() if (!std::isfinite(p_current[0]) || !std::isfinite(p_current[1]) || !std::isfinite(p_current[2])) error->all(FLERR,"Non-numeric pressure - simulation unstable"); - // switch order from xy-xz-yz to Voigt + // switch order from xy-xz-yz to Voigt ordering if (pstyle == TRICLINIC) { p_current[3] = tensor[5]; diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index d1a2cb1463..46afe7b2d7 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -1063,7 +1063,7 @@ void FixNH::couple() if (!std::isfinite(p_current[0]) || !std::isfinite(p_current[1]) || !std::isfinite(p_current[2])) error->all(FLERR,"Non-numeric pressure - simulation unstable"); - // switch order from xy-xz-yz to Voigt + // switch order from xy-xz-yz to Voigt ordering if (pstyle == TRICLINIC) { p_current[3] = tensor[5]; @@ -1118,7 +1118,7 @@ void FixNH::remap() // h_dot = omega_dot * h // // where h_dot, omega_dot and h are all upper-triangular - // 3x3 tensors. In Voigt notation, the elements of the + // 3x3 tensors. In Voigt ordering, the elements of the // RHS product tensor are: // h_dot = [0*0, 1*1, 2*2, 1*3+3*2, 0*4+5*3+4*2, 0*5+5*1] // From d23755085467590d5382322139f6cd933b64c302 Mon Sep 17 00:00:00 2001 From: Evan Weinberg Date: Wed, 10 Feb 2021 14:33:52 -0500 Subject: [PATCH 209/384] Replace runtime direction in Kokkos SNAP ComputeFusedDeidrj with compile time templated version. --- src/KOKKOS/pair_snap_kokkos.h | 4 +++- src/KOKKOS/pair_snap_kokkos_impl.h | 26 ++++++++++++++++---------- src/KOKKOS/sna_kokkos.h | 8 +------- src/KOKKOS/sna_kokkos_impl.h | 12 ++---------- 4 files changed, 22 insertions(+), 28 deletions(-) diff --git a/src/KOKKOS/pair_snap_kokkos.h b/src/KOKKOS/pair_snap_kokkos.h index 416cc1b888..0426893c88 100644 --- a/src/KOKKOS/pair_snap_kokkos.h +++ b/src/KOKKOS/pair_snap_kokkos.h @@ -50,6 +50,7 @@ struct TagPairSNAPBeta{}; struct TagPairSNAPComputeBi{}; struct TagPairSNAPTransformBi{}; // re-order blist from AoSoA to AoS struct TagPairSNAPComputeYi{}; +template struct TagPairSNAPComputeFusedDeidrj{}; // CPU backend only @@ -139,8 +140,9 @@ public: KOKKOS_INLINE_FUNCTION void operator() (TagPairSNAPComputeYi,const int iatom_mod, const int idxz, const int iatom_div) const; + template KOKKOS_INLINE_FUNCTION - void operator() (TagPairSNAPComputeFusedDeidrj,const typename Kokkos::TeamPolicy::member_type& team) const; + void operator() (TagPairSNAPComputeFusedDeidrj,const typename Kokkos::TeamPolicy >::member_type& team) const; // CPU backend only KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/pair_snap_kokkos_impl.h b/src/KOKKOS/pair_snap_kokkos_impl.h index b1352446fa..15c880c10b 100644 --- a/src/KOKKOS/pair_snap_kokkos_impl.h +++ b/src/KOKKOS/pair_snap_kokkos_impl.h @@ -279,7 +279,6 @@ void PairSNAPKokkos::compute(int eflag_in, int team_size = team_size_default; typename Kokkos::TeamPolicy policy_duidrj_cpu(((chunk_size+team_size-1)/team_size)*max_neighs,team_size,vector_length); - snaKK.set_dir(-1); // technically doesn't do anything Kokkos::parallel_for("ComputeDuidrjCPU",policy_duidrj_cpu,*this); typename Kokkos::TeamPolicy policy_deidrj_cpu(((chunk_size+team_size-1)/team_size)*max_neighs,team_size,vector_length); @@ -375,7 +374,6 @@ void PairSNAPKokkos::compute(int eflag_in, Kokkos::parallel_for("TransformBi",policy_transform_bi,*this); } - //ComputeYi in AoSoA data layout, transform to AoS for ComputeFusedDeidrj //Note zeroing `ylist` is fused into `TransformUi`. { //Compute beta = dE_i/dB_i for all i in list @@ -411,13 +409,20 @@ void PairSNAPKokkos::compute(int eflag_in, int n_teams = chunk_size_div * max_neighs * (twojmax + 1); int n_teams_div = (n_teams + team_size - 1) / team_size; - typename Kokkos::TeamPolicy policy_fused_deidrj(n_teams_div,team_size,vector_length); - policy_fused_deidrj = policy_fused_deidrj.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); + // x direction + typename Kokkos::TeamPolicy > policy_fused_deidrj_x(n_teams_div,team_size,vector_length); + policy_fused_deidrj_x = policy_fused_deidrj_x.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); + Kokkos::parallel_for("ComputeFusedDeidrj<0>",policy_fused_deidrj_x,*this); - for (int k = 0; k < 3; k++) { - snaKK.set_dir(k); - Kokkos::parallel_for("ComputeFusedDeidrj",policy_fused_deidrj,*this); - } + // y direction + typename Kokkos::TeamPolicy > policy_fused_deidrj_y(n_teams_div,team_size,vector_length); + policy_fused_deidrj_y = policy_fused_deidrj_y.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); + Kokkos::parallel_for("ComputeFusedDeidrj<1>",policy_fused_deidrj_y,*this); + + // z direction + typename Kokkos::TeamPolicy > policy_fused_deidrj_z(n_teams_div,team_size,vector_length); + policy_fused_deidrj_z = policy_fused_deidrj_z.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); + Kokkos::parallel_for("ComputeFusedDeidrj<2>",policy_fused_deidrj_z,*this); } @@ -853,8 +858,9 @@ void PairSNAPKokkos::operator() (TagPairSN } template +template KOKKOS_INLINE_FUNCTION -void PairSNAPKokkos::operator() (TagPairSNAPComputeFusedDeidrj,const typename Kokkos::TeamPolicy::member_type& team) const { +void PairSNAPKokkos::operator() (TagPairSNAPComputeFusedDeidrj,const typename Kokkos::TeamPolicy >::member_type& team) const { SNAKokkos my_sna = snaKK; // extract flattened atom_div / neighbor number / bend location @@ -874,7 +880,7 @@ void PairSNAPKokkos::operator() (TagPairSN const int ninside = d_ninside(ii); if (jj >= ninside) return; - my_sna.compute_fused_deidrj(team, iatom_mod, jbend, jj, iatom_div); + my_sna.template compute_fused_deidrj(team, iatom_mod, jbend, jj, iatom_div); }); diff --git a/src/KOKKOS/sna_kokkos.h b/src/KOKKOS/sna_kokkos.h index f183acdb57..55983f2a90 100644 --- a/src/KOKKOS/sna_kokkos.h +++ b/src/KOKKOS/sna_kokkos.h @@ -141,6 +141,7 @@ inline void compute_bi_cpu(const typename Kokkos::TeamPolicy::member_type& team, int); // ForceSNAP // functions for derivatives, GPU only + template KOKKOS_INLINE_FUNCTION void compute_fused_deidrj(const typename Kokkos::TeamPolicy::member_type& team, const int, const int, const int, const int); //ForceSNAP @@ -164,10 +165,6 @@ inline static KOKKOS_FORCEINLINE_FUNCTION void sincos_wrapper(float x, float* sin_, float *cos_) { sincosf(x, sin_, cos_); } - // Set the direction for split ComputeDuidrj - KOKKOS_INLINE_FUNCTION - void set_dir(int); - #ifdef TIMING_INFO double* timers; timespec starttime, endtime; @@ -298,9 +295,6 @@ inline int bzero_flag; // 1 if bzero subtracted from barray Kokkos::View bzero; // array of B values for isolated atoms - - // for per-direction dulist calculation, specify the direction. - int dir; }; } diff --git a/src/KOKKOS/sna_kokkos_impl.h b/src/KOKKOS/sna_kokkos_impl.h index cd560d2665..667cc60690 100644 --- a/src/KOKKOS/sna_kokkos_impl.h +++ b/src/KOKKOS/sna_kokkos_impl.h @@ -886,8 +886,9 @@ void SNAKokkos::compute_yi(int iatom_mod, ------------------------------------------------------------------------- */ template +template KOKKOS_INLINE_FUNCTION -void SNAKokkos::compute_fused_deidrj(const typename Kokkos::TeamPolicy::member_type& team, const int iatom_mod, const int j_bend, const int jnbor, const int iatom_div) +void SNAKokkos::compute_fused_deidrj(const typename Kokkos::TeamPolicy::member_type& team, const int iatom_mod, const int j_bend, const int jnbor, const int iatom_div) { // get shared memory offset // scratch size: 32 atoms * (twojmax+1) cached values, no double buffer @@ -2160,15 +2161,6 @@ void SNAKokkos::compute_s_dsfac(const real } else { sfac = zero; dsfac = zero; } } -/* ---------------------------------------------------------------------- */ - -// set direction of batched Duidrj -template -KOKKOS_FORCEINLINE_FUNCTION -void SNAKokkos::set_dir(int dir_) { - dir = dir_; -} - /* ---------------------------------------------------------------------- memory usage of arrays ------------------------------------------------------------------------- */ From fc572a0ca8a6cd0e711899896dff2431c9b790fa Mon Sep 17 00:00:00 2001 From: Evan Weinberg Date: Wed, 10 Feb 2021 15:16:06 -0500 Subject: [PATCH 210/384] Cleanup of "magic" numbers in Kokkos SNAP, making team and tile sizes `static constexpr int` in a centralized place. Various other cleanup. --- src/KOKKOS/pair_snap_kokkos.h | 15 +++- src/KOKKOS/pair_snap_kokkos_impl.h | 106 +++++++++++++---------------- 2 files changed, 62 insertions(+), 59 deletions(-) diff --git a/src/KOKKOS/pair_snap_kokkos.h b/src/KOKKOS/pair_snap_kokkos.h index 0426893c88..ec59df49aa 100644 --- a/src/KOKKOS/pair_snap_kokkos.h +++ b/src/KOKKOS/pair_snap_kokkos.h @@ -79,8 +79,16 @@ public: using real_type = real_type_; using complex = SNAComplex; - // type-dependent team sizes + // Static team/tile sizes for device offload + static constexpr int team_size_compute_neigh = 4; + static constexpr int tile_size_compute_ck = 4; + static constexpr int tile_size_pre_ui = 4; static constexpr int team_size_compute_ui = sizeof(real_type) == 4 ? 8 : 4; + static constexpr int tile_size_transform_ui = 4; + static constexpr int tile_size_compute_zi = 4; + static constexpr int tile_size_compute_bi = 4; + static constexpr int tile_size_transform_bi = 4; + static constexpr int tile_size_compute_yi = 4; static constexpr int team_size_compute_fused_deidrj = sizeof(real_type) == 4 ? 4 : 2; PairSNAPKokkos(class LAMMPS *); @@ -254,6 +262,11 @@ inline double dist2(double* x,double* y); friend void pair_virial_fdotr_compute(PairSNAPKokkos*); + // Utility routine which wraps computing per-team scratch size requirements for + // ComputeNeigh, ComputeUi, and ComputeFusedDeidrj + template + int scratch_size_helper(int values_per_team); + }; diff --git a/src/KOKKOS/pair_snap_kokkos_impl.h b/src/KOKKOS/pair_snap_kokkos_impl.h index 15c880c10b..d9ab2420dc 100644 --- a/src/KOKKOS/pair_snap_kokkos_impl.h +++ b/src/KOKKOS/pair_snap_kokkos_impl.h @@ -290,87 +290,77 @@ void PairSNAPKokkos::compute(int eflag_in, #ifdef LMP_KOKKOS_GPU + // Pre-compute ceil(chunk_size / vector_length) for code cleanliness + const int chunk_size_div = (chunk_size + vector_length - 1) / vector_length; + //ComputeNeigh { - constexpr int team_size = 4; + // team_size_compute_neigh is defined in `pair_snap_kokkos.h` + int scratch_size = scratch_size_helper(team_size_compute_neigh * max_neighs); - // scratch size: max_neighs * sizeof(int) * number of threads per team - typedef Kokkos::View< int*, - Kokkos::DefaultExecutionSpace::scratch_memory_space, - Kokkos::MemoryTraits > - ScratchViewType; - int scratch_size = ScratchViewType::shmem_size(team_size * max_neighs); - - typename Kokkos::TeamPolicy policy_neigh(chunk_size,team_size,vector_length); + typename Kokkos::TeamPolicy policy_neigh(chunk_size,team_size_compute_neigh,vector_length); policy_neigh = policy_neigh.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); Kokkos::parallel_for("ComputeNeigh",policy_neigh,*this); } //ComputeCayleyKlein { + // tile_size_compute_ck is defined in `pair_snap_kokkos.h` typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPComputeCayleyKlein> - policy_compute_ck({0,0,0},{vector_length,max_neighs,(chunk_size + vector_length - 1) / vector_length},{vector_length,4,1}); + policy_compute_ck({0,0,0},{vector_length,max_neighs,chunk_size_div},{vector_length,tile_size_compute_ck,1}); Kokkos::parallel_for("ComputeCayleyKlein",policy_compute_ck,*this); } //PreUi { + // tile_size_pre_ui is defined in `pair_snap_kokkos.h` typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPPreUi> - policy_preui({0,0,0},{vector_length,twojmax+1,(chunk_size + vector_length - 1) / vector_length},{vector_length,4,1}); + policy_preui({0,0,0},{vector_length,twojmax+1,chunk_size_div},{vector_length,tile_size_pre_ui,1}); Kokkos::parallel_for("PreUi",policy_preui,*this); - } // ComputeUi w/vector parallelism, shared memory, direct atomicAdd into ulisttot { - // new AoSoA form - // team_size_compute_ui is defined in `pair_snap_kokkos.h` - constexpr int team_size = team_size_compute_ui; - + // scratch size: 32 atoms * (twojmax+1) cached values, no double buffer const int tile_size = vector_length * (twojmax + 1); - typedef Kokkos::View< complex*, - Kokkos::DefaultExecutionSpace::scratch_memory_space, - Kokkos::MemoryTraits > - ScratchViewType; - int scratch_size = ScratchViewType::shmem_size(team_size * tile_size); + const int scratch_size = scratch_size_helper(team_size_compute_ui * tile_size); - // total number of teams needed - int chunk_size_div = (chunk_size + vector_length - 1) / vector_length; + // total number of teams needed: (natoms / 32) * (max_neighs) * ("bend" locations) + const int n_teams = chunk_size_div * max_neighs * (twojmax + 1); + const int n_teams_div = (n_teams + team_size_compute_ui - 1) / team_size_compute_ui; - // (natoms / 32) * (max_neighs) * ("bend" locations) - int n_teams = chunk_size_div * max_neighs * (twojmax + 1); - int n_teams_div = (n_teams + team_size - 1) / team_size; - - typename Kokkos::TeamPolicy policy_ui(n_teams_div, team_size, vector_length); + typename Kokkos::TeamPolicy policy_ui(n_teams_div, team_size_compute_ui, vector_length); policy_ui = policy_ui.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); - Kokkos::parallel_for("ComputeUi",policy_ui,*this); + } - // un-"fold" ulisttot, zero ylist - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPTransformUi> policy_transform_ui({0,0,0},{vector_length,snaKK.idxu_max,(chunk_size + vector_length - 1) / vector_length},{vector_length,4,1}); + //TransformUi: un-"fold" ulisttot, zero ylist + { + // team_size_transform_ui is defined in `pair_snap_kokkos.h` + typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPTransformUi> policy_transform_ui({0,0,0},{vector_length,snaKK.idxu_max,chunk_size_div},{vector_length,tile_size_transform_ui,1}); Kokkos::parallel_for("TransformUi",policy_transform_ui,*this); - } //Compute bispectrum in AoSoA data layout, transform Bi if (quadraticflag || eflag) { + // team_size_[compute_zi, compute_bi, transform_bi] are defined in `pair_snap_kokkos.h` + //ComputeZi - int idxz_max = snaKK.idxz_max; - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPComputeZi> policy_compute_zi({0,0,0},{vector_length,idxz_max,(chunk_size + vector_length - 1) / vector_length},{vector_length,4,1}); + const int idxz_max = snaKK.idxz_max; + typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPComputeZi> policy_compute_zi({0,0,0},{vector_length,idxz_max,chunk_size_div},{vector_length,tile_size_compute_zi,1}); Kokkos::parallel_for("ComputeZi",policy_compute_zi,*this); //ComputeBi - int idxb_max = snaKK.idxb_max; - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPComputeBi> policy_compute_bi({0,0,0},{vector_length,idxb_max,(chunk_size + vector_length - 1) / vector_length},{vector_length,4,1}); + const int idxb_max = snaKK.idxb_max; + typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPComputeBi> policy_compute_bi({0,0,0},{vector_length,idxb_max,chunk_size_div},{vector_length,tile_size_compute_bi,1}); Kokkos::parallel_for("ComputeBi",policy_compute_bi,*this); //Transform data layout of blist out of AoSoA - //We need this b/c `blist` gets used in ComputeForce which doesn't - //take advantage of AoSoA (which at best would only be beneficial - //on the margins) - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPTransformBi> policy_transform_bi({0,0,0},{vector_length,idxb_max,(chunk_size + vector_length - 1) / vector_length},{vector_length,4,1}); + //We need this because `blist` gets used in ComputeForce which doesn't + //take advantage of AoSoA, which at best would only be beneficial on the margins + typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPTransformBi> policy_transform_bi({0,0,0},{vector_length,idxb_max,chunk_size_div},{vector_length,tile_size_transform_bi,1}); Kokkos::parallel_for("TransformBi",policy_transform_bi,*this); } @@ -381,46 +371,37 @@ void PairSNAPKokkos::compute(int eflag_in, Kokkos::parallel_for("ComputeBeta",policy_beta,*this); //ComputeYi + // team_size_compute_yi is defined in `pair_snap_kokkos.h` const int idxz_max = snaKK.idxz_max; - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPComputeYi> policy_compute_yi({0,0,0},{vector_length,idxz_max,(chunk_size + vector_length - 1) / vector_length},{vector_length,4,1}); + typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPComputeYi> policy_compute_yi({0,0,0},{vector_length,idxz_max,chunk_size_div},{vector_length,tile_size_compute_yi,1}); Kokkos::parallel_for("ComputeYi",policy_compute_yi,*this); } // Fused ComputeDuidrj, ComputeDeidrj { - // new AoSoA form - // team_size_compute_fused_deidrj is defined in `pair_snap_kokkos.h` - constexpr int team_size = team_size_compute_fused_deidrj; // scratch size: 32 atoms * (twojmax+1) cached values * 2 for u, du, no double buffer const int tile_size = vector_length * (twojmax + 1); - typedef Kokkos::View< complex*, - Kokkos::DefaultExecutionSpace::scratch_memory_space, - Kokkos::MemoryTraits > - ScratchViewType; - int scratch_size = ScratchViewType::shmem_size(2 * team_size * tile_size); + const int scratch_size = scratch_size_helper(2 * team_size_compute_fused_deidrj * tile_size); - // total number of teams needed - int chunk_size_div = (chunk_size + vector_length - 1) / vector_length; - - // (natoms / 32) * (max_neighs) * ("bend" locations) - int n_teams = chunk_size_div * max_neighs * (twojmax + 1); - int n_teams_div = (n_teams + team_size - 1) / team_size; + // total number of teams needed: (natoms / 32) * (max_neighs) * ("bend" locations) + const int n_teams = chunk_size_div * max_neighs * (twojmax + 1); + const int n_teams_div = (n_teams + team_size_compute_fused_deidrj - 1) / team_size_compute_fused_deidrj; // x direction - typename Kokkos::TeamPolicy > policy_fused_deidrj_x(n_teams_div,team_size,vector_length); + typename Kokkos::TeamPolicy > policy_fused_deidrj_x(n_teams_div,team_size_compute_fused_deidrj,vector_length); policy_fused_deidrj_x = policy_fused_deidrj_x.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); Kokkos::parallel_for("ComputeFusedDeidrj<0>",policy_fused_deidrj_x,*this); // y direction - typename Kokkos::TeamPolicy > policy_fused_deidrj_y(n_teams_div,team_size,vector_length); + typename Kokkos::TeamPolicy > policy_fused_deidrj_y(n_teams_div,team_size_compute_fused_deidrj,vector_length); policy_fused_deidrj_y = policy_fused_deidrj_y.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); Kokkos::parallel_for("ComputeFusedDeidrj<1>",policy_fused_deidrj_y,*this); // z direction - typename Kokkos::TeamPolicy > policy_fused_deidrj_z(n_teams_div,team_size,vector_length); + typename Kokkos::TeamPolicy > policy_fused_deidrj_z(n_teams_div,team_size_compute_fused_deidrj,vector_length); policy_fused_deidrj_z = policy_fused_deidrj_z.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); Kokkos::parallel_for("ComputeFusedDeidrj<2>",policy_fused_deidrj_z,*this); @@ -1344,6 +1325,15 @@ void PairSNAPKokkos::check_team_size_reduc team_size = team_size_max/vector_length; } +template +template +int PairSNAPKokkos::scratch_size_helper(int values_per_team) { + typedef Kokkos::View > ScratchViewType; + + return ScratchViewType::shmem_size(values_per_team); +} + + /* ---------------------------------------------------------------------- routines used by template reference classes From dd2fc5df62f1406a61b842aaf5d8931ef26a9573 Mon Sep 17 00:00:00 2001 From: Evan Weinberg Date: Wed, 10 Feb 2021 15:40:22 -0500 Subject: [PATCH 211/384] Introduction of Kokkos::LaunchBounds in Kokkos SNAP. --- src/KOKKOS/pair_snap_kokkos_impl.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/KOKKOS/pair_snap_kokkos_impl.h b/src/KOKKOS/pair_snap_kokkos_impl.h index d9ab2420dc..c72793d789 100644 --- a/src/KOKKOS/pair_snap_kokkos_impl.h +++ b/src/KOKKOS/pair_snap_kokkos_impl.h @@ -298,7 +298,7 @@ void PairSNAPKokkos::compute(int eflag_in, // team_size_compute_neigh is defined in `pair_snap_kokkos.h` int scratch_size = scratch_size_helper(team_size_compute_neigh * max_neighs); - typename Kokkos::TeamPolicy policy_neigh(chunk_size,team_size_compute_neigh,vector_length); + typename Kokkos::TeamPolicy,TagPairSNAPComputeNeigh> policy_neigh(chunk_size,team_size_compute_neigh,vector_length); policy_neigh = policy_neigh.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); Kokkos::parallel_for("ComputeNeigh",policy_neigh,*this); } @@ -306,7 +306,7 @@ void PairSNAPKokkos::compute(int eflag_in, //ComputeCayleyKlein { // tile_size_compute_ck is defined in `pair_snap_kokkos.h` - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPComputeCayleyKlein> + typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, Kokkos::LaunchBounds, TagPairSNAPComputeCayleyKlein> policy_compute_ck({0,0,0},{vector_length,max_neighs,chunk_size_div},{vector_length,tile_size_compute_ck,1}); Kokkos::parallel_for("ComputeCayleyKlein",policy_compute_ck,*this); } @@ -314,7 +314,7 @@ void PairSNAPKokkos::compute(int eflag_in, //PreUi { // tile_size_pre_ui is defined in `pair_snap_kokkos.h` - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPPreUi> + typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, Kokkos::LaunchBounds, TagPairSNAPPreUi> policy_preui({0,0,0},{vector_length,twojmax+1,chunk_size_div},{vector_length,tile_size_pre_ui,1}); Kokkos::parallel_for("PreUi",policy_preui,*this); } @@ -322,7 +322,7 @@ void PairSNAPKokkos::compute(int eflag_in, // ComputeUi w/vector parallelism, shared memory, direct atomicAdd into ulisttot { // team_size_compute_ui is defined in `pair_snap_kokkos.h` - + // scratch size: 32 atoms * (twojmax+1) cached values, no double buffer const int tile_size = vector_length * (twojmax + 1); const int scratch_size = scratch_size_helper(team_size_compute_ui * tile_size); @@ -331,7 +331,7 @@ void PairSNAPKokkos::compute(int eflag_in, const int n_teams = chunk_size_div * max_neighs * (twojmax + 1); const int n_teams_div = (n_teams + team_size_compute_ui - 1) / team_size_compute_ui; - typename Kokkos::TeamPolicy policy_ui(n_teams_div, team_size_compute_ui, vector_length); + typename Kokkos::TeamPolicy,TagPairSNAPComputeUi> policy_ui(n_teams_div, team_size_compute_ui, vector_length); policy_ui = policy_ui.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); Kokkos::parallel_for("ComputeUi",policy_ui,*this); } @@ -339,7 +339,7 @@ void PairSNAPKokkos::compute(int eflag_in, //TransformUi: un-"fold" ulisttot, zero ylist { // team_size_transform_ui is defined in `pair_snap_kokkos.h` - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPTransformUi> policy_transform_ui({0,0,0},{vector_length,snaKK.idxu_max,chunk_size_div},{vector_length,tile_size_transform_ui,1}); + typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, Kokkos::LaunchBounds, TagPairSNAPTransformUi> policy_transform_ui({0,0,0},{vector_length,snaKK.idxu_max,chunk_size_div},{vector_length,tile_size_transform_ui,1}); Kokkos::parallel_for("TransformUi",policy_transform_ui,*this); } @@ -349,18 +349,18 @@ void PairSNAPKokkos::compute(int eflag_in, //ComputeZi const int idxz_max = snaKK.idxz_max; - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPComputeZi> policy_compute_zi({0,0,0},{vector_length,idxz_max,chunk_size_div},{vector_length,tile_size_compute_zi,1}); + typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, Kokkos::LaunchBounds, TagPairSNAPComputeZi> policy_compute_zi({0,0,0},{vector_length,idxz_max,chunk_size_div},{vector_length,tile_size_compute_zi,1}); Kokkos::parallel_for("ComputeZi",policy_compute_zi,*this); //ComputeBi const int idxb_max = snaKK.idxb_max; - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPComputeBi> policy_compute_bi({0,0,0},{vector_length,idxb_max,chunk_size_div},{vector_length,tile_size_compute_bi,1}); + typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, Kokkos::LaunchBounds, TagPairSNAPComputeBi> policy_compute_bi({0,0,0},{vector_length,idxb_max,chunk_size_div},{vector_length,tile_size_compute_bi,1}); Kokkos::parallel_for("ComputeBi",policy_compute_bi,*this); //Transform data layout of blist out of AoSoA //We need this because `blist` gets used in ComputeForce which doesn't //take advantage of AoSoA, which at best would only be beneficial on the margins - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPTransformBi> policy_transform_bi({0,0,0},{vector_length,idxb_max,chunk_size_div},{vector_length,tile_size_transform_bi,1}); + typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, Kokkos::LaunchBounds, TagPairSNAPTransformBi> policy_transform_bi({0,0,0},{vector_length,idxb_max,chunk_size_div},{vector_length,tile_size_transform_bi,1}); Kokkos::parallel_for("TransformBi",policy_transform_bi,*this); } @@ -373,7 +373,7 @@ void PairSNAPKokkos::compute(int eflag_in, //ComputeYi // team_size_compute_yi is defined in `pair_snap_kokkos.h` const int idxz_max = snaKK.idxz_max; - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPComputeYi> policy_compute_yi({0,0,0},{vector_length,idxz_max,chunk_size_div},{vector_length,tile_size_compute_yi,1}); + typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, Kokkos::LaunchBounds, TagPairSNAPComputeYi> policy_compute_yi({0,0,0},{vector_length,idxz_max,chunk_size_div},{vector_length,tile_size_compute_yi,1}); Kokkos::parallel_for("ComputeYi",policy_compute_yi,*this); } @@ -391,17 +391,17 @@ void PairSNAPKokkos::compute(int eflag_in, const int n_teams_div = (n_teams + team_size_compute_fused_deidrj - 1) / team_size_compute_fused_deidrj; // x direction - typename Kokkos::TeamPolicy > policy_fused_deidrj_x(n_teams_div,team_size_compute_fused_deidrj,vector_length); + typename Kokkos::TeamPolicy,TagPairSNAPComputeFusedDeidrj<0> > policy_fused_deidrj_x(n_teams_div,team_size_compute_fused_deidrj,vector_length); policy_fused_deidrj_x = policy_fused_deidrj_x.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); Kokkos::parallel_for("ComputeFusedDeidrj<0>",policy_fused_deidrj_x,*this); // y direction - typename Kokkos::TeamPolicy > policy_fused_deidrj_y(n_teams_div,team_size_compute_fused_deidrj,vector_length); + typename Kokkos::TeamPolicy,TagPairSNAPComputeFusedDeidrj<1> > policy_fused_deidrj_y(n_teams_div,team_size_compute_fused_deidrj,vector_length); policy_fused_deidrj_y = policy_fused_deidrj_y.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); Kokkos::parallel_for("ComputeFusedDeidrj<1>",policy_fused_deidrj_y,*this); // z direction - typename Kokkos::TeamPolicy > policy_fused_deidrj_z(n_teams_div,team_size_compute_fused_deidrj,vector_length); + typename Kokkos::TeamPolicy,TagPairSNAPComputeFusedDeidrj<2> > policy_fused_deidrj_z(n_teams_div,team_size_compute_fused_deidrj,vector_length); policy_fused_deidrj_z = policy_fused_deidrj_z.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); Kokkos::parallel_for("ComputeFusedDeidrj<2>",policy_fused_deidrj_z,*this); From ca39dea58bb657893322ce68f446b9e32ec1e644 Mon Sep 17 00:00:00 2001 From: Evan Weinberg Date: Wed, 10 Feb 2021 16:07:11 -0500 Subject: [PATCH 212/384] Various cleanup in Kokkos SNAP, replacing verbose Kokkos MDRangePolicy and TeamPolicy types with simpler `using` definitions. No performance implications. --- src/KOKKOS/pair_snap_kokkos.h | 13 +++++++++++++ src/KOKKOS/pair_snap_kokkos_impl.h | 29 +++++++++++++++++------------ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/KOKKOS/pair_snap_kokkos.h b/src/KOKKOS/pair_snap_kokkos.h index ec59df49aa..e4da89edec 100644 --- a/src/KOKKOS/pair_snap_kokkos.h +++ b/src/KOKKOS/pair_snap_kokkos.h @@ -91,6 +91,19 @@ public: static constexpr int tile_size_compute_yi = 4; static constexpr int team_size_compute_fused_deidrj = sizeof(real_type) == 4 ? 4 : 2; + // Custom MDRangePolicy, Rank3, to reduce verbosity of kernel launches + // This hides the Kokkos::IndexType and Kokkos::Rank<3...> + // and reduces the verbosity of the LaunchBound by hiding the explicit + // multiplication by vector_length + template + using Snap3DRangePolicy = typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, Kokkos::LaunchBounds, TagPairSNAP>; + + // Custom SnapAoSoATeamPolicy to reduce the verbosity of kernel launches + // This hides the LaunchBounds abstraction by hiding the explicit + // multiplication by vector length + template + using SnapAoSoATeamPolicy = typename Kokkos::TeamPolicy, TagPairSNAP>; + PairSNAPKokkos(class LAMMPS *); ~PairSNAPKokkos(); diff --git a/src/KOKKOS/pair_snap_kokkos_impl.h b/src/KOKKOS/pair_snap_kokkos_impl.h index c72793d789..2578f3d47c 100644 --- a/src/KOKKOS/pair_snap_kokkos_impl.h +++ b/src/KOKKOS/pair_snap_kokkos_impl.h @@ -298,7 +298,7 @@ void PairSNAPKokkos::compute(int eflag_in, // team_size_compute_neigh is defined in `pair_snap_kokkos.h` int scratch_size = scratch_size_helper(team_size_compute_neigh * max_neighs); - typename Kokkos::TeamPolicy,TagPairSNAPComputeNeigh> policy_neigh(chunk_size,team_size_compute_neigh,vector_length); + SnapAoSoATeamPolicy policy_neigh(chunk_size,team_size_compute_neigh,vector_length); policy_neigh = policy_neigh.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); Kokkos::parallel_for("ComputeNeigh",policy_neigh,*this); } @@ -306,7 +306,7 @@ void PairSNAPKokkos::compute(int eflag_in, //ComputeCayleyKlein { // tile_size_compute_ck is defined in `pair_snap_kokkos.h` - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, Kokkos::LaunchBounds, TagPairSNAPComputeCayleyKlein> + Snap3DRangePolicy policy_compute_ck({0,0,0},{vector_length,max_neighs,chunk_size_div},{vector_length,tile_size_compute_ck,1}); Kokkos::parallel_for("ComputeCayleyKlein",policy_compute_ck,*this); } @@ -314,7 +314,7 @@ void PairSNAPKokkos::compute(int eflag_in, //PreUi { // tile_size_pre_ui is defined in `pair_snap_kokkos.h` - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, Kokkos::LaunchBounds, TagPairSNAPPreUi> + Snap3DRangePolicy policy_preui({0,0,0},{vector_length,twojmax+1,chunk_size_div},{vector_length,tile_size_pre_ui,1}); Kokkos::parallel_for("PreUi",policy_preui,*this); } @@ -331,7 +331,7 @@ void PairSNAPKokkos::compute(int eflag_in, const int n_teams = chunk_size_div * max_neighs * (twojmax + 1); const int n_teams_div = (n_teams + team_size_compute_ui - 1) / team_size_compute_ui; - typename Kokkos::TeamPolicy,TagPairSNAPComputeUi> policy_ui(n_teams_div, team_size_compute_ui, vector_length); + SnapAoSoATeamPolicy policy_ui(n_teams_div, team_size_compute_ui, vector_length); policy_ui = policy_ui.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); Kokkos::parallel_for("ComputeUi",policy_ui,*this); } @@ -339,7 +339,8 @@ void PairSNAPKokkos::compute(int eflag_in, //TransformUi: un-"fold" ulisttot, zero ylist { // team_size_transform_ui is defined in `pair_snap_kokkos.h` - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, Kokkos::LaunchBounds, TagPairSNAPTransformUi> policy_transform_ui({0,0,0},{vector_length,snaKK.idxu_max,chunk_size_div},{vector_length,tile_size_transform_ui,1}); + Snap3DRangePolicy + policy_transform_ui({0,0,0},{vector_length,snaKK.idxu_max,chunk_size_div},{vector_length,tile_size_transform_ui,1}); Kokkos::parallel_for("TransformUi",policy_transform_ui,*this); } @@ -349,18 +350,21 @@ void PairSNAPKokkos::compute(int eflag_in, //ComputeZi const int idxz_max = snaKK.idxz_max; - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, Kokkos::LaunchBounds, TagPairSNAPComputeZi> policy_compute_zi({0,0,0},{vector_length,idxz_max,chunk_size_div},{vector_length,tile_size_compute_zi,1}); + Snap3DRangePolicy + policy_compute_zi({0,0,0},{vector_length,idxz_max,chunk_size_div},{vector_length,tile_size_compute_zi,1}); Kokkos::parallel_for("ComputeZi",policy_compute_zi,*this); //ComputeBi const int idxb_max = snaKK.idxb_max; - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, Kokkos::LaunchBounds, TagPairSNAPComputeBi> policy_compute_bi({0,0,0},{vector_length,idxb_max,chunk_size_div},{vector_length,tile_size_compute_bi,1}); + Snap3DRangePolicy + policy_compute_bi({0,0,0},{vector_length,idxb_max,chunk_size_div},{vector_length,tile_size_compute_bi,1}); Kokkos::parallel_for("ComputeBi",policy_compute_bi,*this); //Transform data layout of blist out of AoSoA //We need this because `blist` gets used in ComputeForce which doesn't //take advantage of AoSoA, which at best would only be beneficial on the margins - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, Kokkos::LaunchBounds, TagPairSNAPTransformBi> policy_transform_bi({0,0,0},{vector_length,idxb_max,chunk_size_div},{vector_length,tile_size_transform_bi,1}); + Snap3DRangePolicy + policy_transform_bi({0,0,0},{vector_length,idxb_max,chunk_size_div},{vector_length,tile_size_transform_bi,1}); Kokkos::parallel_for("TransformBi",policy_transform_bi,*this); } @@ -373,7 +377,8 @@ void PairSNAPKokkos::compute(int eflag_in, //ComputeYi // team_size_compute_yi is defined in `pair_snap_kokkos.h` const int idxz_max = snaKK.idxz_max; - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, Kokkos::LaunchBounds, TagPairSNAPComputeYi> policy_compute_yi({0,0,0},{vector_length,idxz_max,chunk_size_div},{vector_length,tile_size_compute_yi,1}); + Snap3DRangePolicy + policy_compute_yi({0,0,0},{vector_length,idxz_max,chunk_size_div},{vector_length,tile_size_compute_yi,1}); Kokkos::parallel_for("ComputeYi",policy_compute_yi,*this); } @@ -391,17 +396,17 @@ void PairSNAPKokkos::compute(int eflag_in, const int n_teams_div = (n_teams + team_size_compute_fused_deidrj - 1) / team_size_compute_fused_deidrj; // x direction - typename Kokkos::TeamPolicy,TagPairSNAPComputeFusedDeidrj<0> > policy_fused_deidrj_x(n_teams_div,team_size_compute_fused_deidrj,vector_length); + SnapAoSoATeamPolicy > policy_fused_deidrj_x(n_teams_div,team_size_compute_fused_deidrj,vector_length); policy_fused_deidrj_x = policy_fused_deidrj_x.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); Kokkos::parallel_for("ComputeFusedDeidrj<0>",policy_fused_deidrj_x,*this); // y direction - typename Kokkos::TeamPolicy,TagPairSNAPComputeFusedDeidrj<1> > policy_fused_deidrj_y(n_teams_div,team_size_compute_fused_deidrj,vector_length); + SnapAoSoATeamPolicy > policy_fused_deidrj_y(n_teams_div,team_size_compute_fused_deidrj,vector_length); policy_fused_deidrj_y = policy_fused_deidrj_y.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); Kokkos::parallel_for("ComputeFusedDeidrj<1>",policy_fused_deidrj_y,*this); // z direction - typename Kokkos::TeamPolicy,TagPairSNAPComputeFusedDeidrj<2> > policy_fused_deidrj_z(n_teams_div,team_size_compute_fused_deidrj,vector_length); + SnapAoSoATeamPolicy > policy_fused_deidrj_z(n_teams_div,team_size_compute_fused_deidrj,vector_length); policy_fused_deidrj_z = policy_fused_deidrj_z.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); Kokkos::parallel_for("ComputeFusedDeidrj<2>",policy_fused_deidrj_z,*this); From 4ee614b5c268693fb9fbc16dae289c3f42f2b170 Mon Sep 17 00:00:00 2001 From: Evan Weinberg Date: Wed, 10 Feb 2021 16:16:09 -0500 Subject: [PATCH 213/384] fix whitespace --- src/KOKKOS/pair_snap_kokkos.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KOKKOS/pair_snap_kokkos.h b/src/KOKKOS/pair_snap_kokkos.h index e4da89edec..2665c3c2ac 100644 --- a/src/KOKKOS/pair_snap_kokkos.h +++ b/src/KOKKOS/pair_snap_kokkos.h @@ -278,7 +278,7 @@ inline double dist2(double* x,double* y); // Utility routine which wraps computing per-team scratch size requirements for // ComputeNeigh, ComputeUi, and ComputeFusedDeidrj template - int scratch_size_helper(int values_per_team); + int scratch_size_helper(int values_per_team); }; From 8e8ef0cf63330504b2a71602fbeb293648bcf3b1 Mon Sep 17 00:00:00 2001 From: Evan Weinberg Date: Wed, 10 Feb 2021 16:51:06 -0500 Subject: [PATCH 214/384] Re-tune tile size for Kokkos SNAP ComputeYi/Zi. --- src/KOKKOS/pair_snap_kokkos.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/KOKKOS/pair_snap_kokkos.h b/src/KOKKOS/pair_snap_kokkos.h index 2665c3c2ac..9acf3011ce 100644 --- a/src/KOKKOS/pair_snap_kokkos.h +++ b/src/KOKKOS/pair_snap_kokkos.h @@ -85,10 +85,10 @@ public: static constexpr int tile_size_pre_ui = 4; static constexpr int team_size_compute_ui = sizeof(real_type) == 4 ? 8 : 4; static constexpr int tile_size_transform_ui = 4; - static constexpr int tile_size_compute_zi = 4; + static constexpr int tile_size_compute_zi = 8; static constexpr int tile_size_compute_bi = 4; static constexpr int tile_size_transform_bi = 4; - static constexpr int tile_size_compute_yi = 4; + static constexpr int tile_size_compute_yi = 8; static constexpr int team_size_compute_fused_deidrj = sizeof(real_type) == 4 ? 4 : 2; // Custom MDRangePolicy, Rank3, to reduce verbosity of kernel launches From f8a5991416ddcc2a4b8622c6ab7657b2d9c11cf1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 10 Feb 2021 17:09:56 -0500 Subject: [PATCH 215/384] rearrange output a little bit --- src/citeme.cpp | 52 ++++++++++++++++++++------------------------------ 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/src/citeme.cpp b/src/citeme.cpp index a3bbef2f3c..fdd1ee867d 100644 --- a/src/citeme.cpp +++ b/src/citeme.cpp @@ -18,21 +18,13 @@ using namespace LAMMPS_NS; static const char cite_separator[] = - "\nCITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE\n\n"; + "CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE\n\n"; static const char cite_nagline[] = - "Your LAMMPS simulation uses code contributions which should be cited.\n" - "Please see https://lammps.sandia.gov/doc/Intro_citing.html for more\n" - "information on citing LAMMPS itself.\n"; + "Your simulation uses code contributions which should be cited:\n"; -static const char cite_short[] = - "A short list of the features is given below.\n\n"; - -static const char cite_full[] = - "Below is a list of the full references in BibTeX format.\n\n"; - -static const char cite_file[] = "Please see the {} {} " - "for detailed references in BibTeX format.\n"; +static const char cite_file[] = "The {} {} lists these citations in " + "BibTeX format.\n\n"; /* ---------------------------------------------------------------------- */ @@ -52,7 +44,6 @@ CiteMe::CiteMe(LAMMPS *lmp, int _screen, int _logfile, const char *_file) fp = fopen(_file,"w"); if (fp) { fputs(cite_nagline,fp); - fputs(cite_full,fp); fflush(fp); } else { utils::logmesg(lmp, "Unable to open citation file '" + citefile @@ -89,46 +80,45 @@ void CiteMe::add(const char *ref) } if (scrbuffer.empty()) { + scrbuffer += "\n"; scrbuffer += cite_separator; scrbuffer += cite_nagline; - if (!citefile.empty()) scrbuffer += fmt::format(cite_file,"file",citefile); - if (screen_flag == VERBOSE) scrbuffer += cite_full; - if (screen_flag == TERSE) { - if (logfile_flag == VERBOSE) - scrbuffer += fmt::format(cite_file,"log","file"); - scrbuffer += cite_short; - } + if (screen_flag == VERBOSE) scrbuffer += "\n"; } + if (logbuffer.empty()) { + logbuffer += "\n"; logbuffer += cite_separator; logbuffer += cite_nagline; - if (!citefile.empty()) logbuffer += fmt::format(cite_file,"file",citefile); - if (logfile_flag == VERBOSE) logbuffer += cite_full; - if (logfile_flag == TERSE) { - if (screen_flag == VERBOSE) - scrbuffer += fmt::format(cite_file,"screen","output"); - logbuffer += cite_short; - } + if (logfile_flag == VERBOSE) logbuffer += "\n"; } std::string reference = ref; std::size_t found = reference.find_first_of("\n"); std::string header = reference.substr(0,found+1); - if (screen_flag == VERBOSE) scrbuffer += reference; - if (screen_flag == TERSE) scrbuffer += header; - if (logfile_flag == VERBOSE) logbuffer += reference; - if (logfile_flag == TERSE) logbuffer += header; + if (screen_flag == VERBOSE) scrbuffer += "- " + reference; + if (screen_flag == TERSE) scrbuffer += "- " + header; + if (logfile_flag == VERBOSE) logbuffer += "- " + reference; + if (logfile_flag == TERSE) logbuffer += "- " + header; } void CiteMe::flush() { if (comm->me == 0) { if (!scrbuffer.empty()) { + if (!citefile.empty()) + scrbuffer += fmt::format(cite_file,"file",citefile); + if (logfile_flag == VERBOSE) + scrbuffer += fmt::format(cite_file,"log","file"); scrbuffer += cite_separator; if (screen) fputs(scrbuffer.c_str(),screen); scrbuffer.clear(); } if (!logbuffer.empty()) { + if (!citefile.empty()) + logbuffer += fmt::format(cite_file,"file",citefile); + if (screen_flag == VERBOSE) + scrbuffer += fmt::format(cite_file,"screen","output"); logbuffer += cite_separator; if (logfile) fputs(logbuffer.c_str(),logfile); logbuffer.clear(); From cb7e68644fe1a9e9500c7e0b748a7c5cccb06a90 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Wed, 10 Feb 2021 16:21:25 -0700 Subject: [PATCH 216/384] fix issues with multiple uses of create_bonds command --- doc/src/create_bonds.rst | 10 ++++++++++ src/create_bonds.cpp | 2 +- src/neigh_request.cpp | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/src/create_bonds.rst b/doc/src/create_bonds.rst index b69fd909f0..056b60c7aa 100644 --- a/doc/src/create_bonds.rst +++ b/doc/src/create_bonds.rst @@ -125,6 +125,16 @@ cannot appear in the neighbor list, to avoid creation of duplicate bonds. The neighbor list for all atom type pairs must also extend to a distance that encompasses the *rmax* for new bonds to create. +.. note:: + + If you want to create bonds between pairs of 1-3 or 1-4 atoms in + the current bond topology, then you need to use :doc:`special_bonds + lj 0 1 1 ` to insure those pairs appear in the + neighbor list. They will not appear with the default special_bonds + settings which are zero for 1-2, 1-3, and 1-4 atoms. 1-3 or 1-4 + atoms are those which are 2 hops or 3 hops apart in the bond + topology. + An additional requirement for this style is that your system must be ready to perform a simulation. This means, for example, that all :doc:`pair_style ` coefficients be set via the diff --git a/src/create_bonds.cpp b/src/create_bonds.cpp index 7ee17bcfcc..e5274d2cf8 100644 --- a/src/create_bonds.cpp +++ b/src/create_bonds.cpp @@ -233,7 +233,7 @@ void CreateBonds::many() // build neighbor list this command needs based on earlier request NeighList *list = neighbor->lists[irequest]; - neighbor->build_one(list); + neighbor->build_one(list,1); // loop over all neighs of each atom // compute distance between two atoms consistently on both procs diff --git a/src/neigh_request.cpp b/src/neigh_request.cpp index 0d4818fbe1..2339783d14 100644 --- a/src/neigh_request.cpp +++ b/src/neigh_request.cpp @@ -225,6 +225,8 @@ void NeighRequest::copy_request(NeighRequest *other, int skipflag) int i,j; int ntypes = atom->ntypes; + skip = other->skip; + if (other->iskip) { iskip = new int[ntypes+1]; for (i = 1; i <= ntypes; i++) From 697f82c145694b21944fab0f4075a461fbe09962 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 10 Feb 2021 18:40:25 -0500 Subject: [PATCH 217/384] whitespace --- src/neigh_request.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neigh_request.cpp b/src/neigh_request.cpp index 2339783d14..8c8168952e 100644 --- a/src/neigh_request.cpp +++ b/src/neigh_request.cpp @@ -226,7 +226,7 @@ void NeighRequest::copy_request(NeighRequest *other, int skipflag) int ntypes = atom->ntypes; skip = other->skip; - + if (other->iskip) { iskip = new int[ntypes+1]; for (i = 1; i <= ntypes; i++) From 5c415a1ba39073c37dfdebf13eeb4c355b52e231 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 10 Feb 2021 20:14:19 -0500 Subject: [PATCH 218/384] use neighbor->nrequest to be safer, since neighbor->nlist may be larger --- src/USER-INTEL/npair_skip_intel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/USER-INTEL/npair_skip_intel.cpp b/src/USER-INTEL/npair_skip_intel.cpp index 4f6648ddc1..53900f116f 100644 --- a/src/USER-INTEL/npair_skip_intel.cpp +++ b/src/USER-INTEL/npair_skip_intel.cpp @@ -55,8 +55,8 @@ void NPairSkipIntel::copy_neighbor_info() { NPair::copy_neighbor_info(); if (_full_props) delete []_full_props; - _full_props = new int[neighbor->nlist]; - for (int i = 0; i < neighbor->nlist; i++) + _full_props = new int[neighbor->nrequest]; + for (int i = 0; i < neighbor->nrequest; i++) _full_props[i] = neighbor->requests[i]->full; } From 334c0d9969a1c164b39654258cbd083a85c5ca46 Mon Sep 17 00:00:00 2001 From: Evan Weinberg Date: Wed, 10 Feb 2021 22:26:40 -0500 Subject: [PATCH 219/384] Fix compiler error uncovered by a host-only Kokkos build --- src/KOKKOS/sna_kokkos_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KOKKOS/sna_kokkos_impl.h b/src/KOKKOS/sna_kokkos_impl.h index 667cc60690..2a44f943d3 100644 --- a/src/KOKKOS/sna_kokkos_impl.h +++ b/src/KOKKOS/sna_kokkos_impl.h @@ -888,7 +888,7 @@ void SNAKokkos::compute_yi(int iatom_mod, template template KOKKOS_INLINE_FUNCTION -void SNAKokkos::compute_fused_deidrj(const typename Kokkos::TeamPolicy::member_type& team, const int iatom_mod, const int j_bend, const int jnbor, const int iatom_div) +void SNAKokkos::compute_fused_deidrj(const typename Kokkos::TeamPolicy::member_type& team, const int iatom_mod, const int j_bend, const int jnbor, const int iatom_div) { // get shared memory offset // scratch size: 32 atoms * (twojmax+1) cached values, no double buffer From d3712787651da28e62bf83f4cf8c88af91c111ad Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 11 Feb 2021 07:54:28 -0500 Subject: [PATCH 220/384] correct dump style cfg label generation --- src/dump_cfg.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp index ed8df72096..b4e6af90cf 100644 --- a/src/dump_cfg.cpp +++ b/src/dump_cfg.cpp @@ -75,7 +75,8 @@ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) : if (argi.get_dim() == 1) { std::string newarg(std::to_string(earg[iarg][0])); - newarg += '_' + argi.get_name() + '_' + std::to_string(argi.get_index1()); + newarg += std::string("_") + argi.get_name(); + newarg += std::string("_") + std::to_string(argi.get_index1()); auxname[i] = new char[newarg.size()+1]; strcpy(auxname[i],newarg.c_str()); } else { From 7da64cba891b4e3272655f9a6bc367402f01a6e7 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Wed, 10 Feb 2021 16:21:25 -0700 Subject: [PATCH 221/384] fix issues with multiple uses of create_bonds command --- doc/src/create_bonds.rst | 10 ++++++++++ src/create_bonds.cpp | 2 +- src/neigh_request.cpp | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/src/create_bonds.rst b/doc/src/create_bonds.rst index b69fd909f0..056b60c7aa 100644 --- a/doc/src/create_bonds.rst +++ b/doc/src/create_bonds.rst @@ -125,6 +125,16 @@ cannot appear in the neighbor list, to avoid creation of duplicate bonds. The neighbor list for all atom type pairs must also extend to a distance that encompasses the *rmax* for new bonds to create. +.. note:: + + If you want to create bonds between pairs of 1-3 or 1-4 atoms in + the current bond topology, then you need to use :doc:`special_bonds + lj 0 1 1 ` to insure those pairs appear in the + neighbor list. They will not appear with the default special_bonds + settings which are zero for 1-2, 1-3, and 1-4 atoms. 1-3 or 1-4 + atoms are those which are 2 hops or 3 hops apart in the bond + topology. + An additional requirement for this style is that your system must be ready to perform a simulation. This means, for example, that all :doc:`pair_style ` coefficients be set via the diff --git a/src/create_bonds.cpp b/src/create_bonds.cpp index 7ee17bcfcc..e5274d2cf8 100644 --- a/src/create_bonds.cpp +++ b/src/create_bonds.cpp @@ -233,7 +233,7 @@ void CreateBonds::many() // build neighbor list this command needs based on earlier request NeighList *list = neighbor->lists[irequest]; - neighbor->build_one(list); + neighbor->build_one(list,1); // loop over all neighs of each atom // compute distance between two atoms consistently on both procs diff --git a/src/neigh_request.cpp b/src/neigh_request.cpp index 0d4818fbe1..2339783d14 100644 --- a/src/neigh_request.cpp +++ b/src/neigh_request.cpp @@ -225,6 +225,8 @@ void NeighRequest::copy_request(NeighRequest *other, int skipflag) int i,j; int ntypes = atom->ntypes; + skip = other->skip; + if (other->iskip) { iskip = new int[ntypes+1]; for (i = 1; i <= ntypes; i++) From 258452d1d4ba18604ed4e413996eb525a44a0d09 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 10 Feb 2021 18:40:25 -0500 Subject: [PATCH 222/384] whitespace --- src/neigh_request.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neigh_request.cpp b/src/neigh_request.cpp index 2339783d14..8c8168952e 100644 --- a/src/neigh_request.cpp +++ b/src/neigh_request.cpp @@ -226,7 +226,7 @@ void NeighRequest::copy_request(NeighRequest *other, int skipflag) int ntypes = atom->ntypes; skip = other->skip; - + if (other->iskip) { iskip = new int[ntypes+1]; for (i = 1; i <= ntypes; i++) From d83827508fd4c66737318f44c1e21728651d22af Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 10 Feb 2021 20:14:19 -0500 Subject: [PATCH 223/384] use neighbor->nrequest to be safer, since neighbor->nlist may be larger --- src/USER-INTEL/npair_skip_intel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/USER-INTEL/npair_skip_intel.cpp b/src/USER-INTEL/npair_skip_intel.cpp index 4f6648ddc1..53900f116f 100644 --- a/src/USER-INTEL/npair_skip_intel.cpp +++ b/src/USER-INTEL/npair_skip_intel.cpp @@ -55,8 +55,8 @@ void NPairSkipIntel::copy_neighbor_info() { NPair::copy_neighbor_info(); if (_full_props) delete []_full_props; - _full_props = new int[neighbor->nlist]; - for (int i = 0; i < neighbor->nlist; i++) + _full_props = new int[neighbor->nrequest]; + for (int i = 0; i < neighbor->nrequest; i++) _full_props[i] = neighbor->requests[i]->full; } From bd547a3c4285549d822aaf30c23636a442898ad7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 6 Feb 2021 18:28:18 -0500 Subject: [PATCH 224/384] Step version strings for next patch release --- doc/lammps.1 | 2 +- src/version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/lammps.1 b/doc/lammps.1 index 299f8538b0..12cff4eeec 100644 --- a/doc/lammps.1 +++ b/doc/lammps.1 @@ -1,4 +1,4 @@ -.TH LAMMPS "24 December 2020" "2020-12-24" +.TH LAMMPS "9 February 2021" "2021-02-09" .SH NAME .B LAMMPS \- Molecular Dynamics Simulator. diff --git a/src/version.h b/src/version.h index f812b62821..c04929c145 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define LAMMPS_VERSION "24 Dec 2020" +#define LAMMPS_VERSION "9 Feb 2021" From a742935817e891e99a672befae9ba999e0a21528 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 9 Feb 2021 21:34:08 -0500 Subject: [PATCH 225/384] change version strings to 10 Feb 2021 --- doc/lammps.1 | 2 +- src/version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/lammps.1 b/doc/lammps.1 index 12cff4eeec..9351ba5636 100644 --- a/doc/lammps.1 +++ b/doc/lammps.1 @@ -1,4 +1,4 @@ -.TH LAMMPS "9 February 2021" "2021-02-09" +.TH LAMMPS "10 February 2021" "2021-02-10" .SH NAME .B LAMMPS \- Molecular Dynamics Simulator. diff --git a/src/version.h b/src/version.h index c04929c145..84541d4456 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define LAMMPS_VERSION "9 Feb 2021" +#define LAMMPS_VERSION "10 Feb 2021" From 45ba0bd3133c265f3020aab7d89654496114ef0f Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 05:24:29 -0600 Subject: [PATCH 226/384] refactor kim commands by @akohlmey --- src/KIM/kim_init.h | 7 ------- src/KIM/kim_interactions.h | 7 ------- src/KIM/kim_param.h | 7 ------- src/KIM/kim_property.cpp | 4 ++-- src/KIM/kim_property.h | 11 ++--------- src/KIM/kim_query.h | 7 ------- 6 files changed, 4 insertions(+), 39 deletions(-) diff --git a/src/KIM/kim_init.h b/src/KIM/kim_init.h index 8fa3247b22..6937ab7677 100644 --- a/src/KIM/kim_init.h +++ b/src/KIM/kim_init.h @@ -56,12 +56,6 @@ Designed for use with the kim-api-2.1.0 (and newer) package ------------------------------------------------------------------------- */ -#ifdef COMMAND_CLASS - -CommandStyle(kim_init,KimInit) - -#else - #ifndef LMP_KIM_INIT_H #define LMP_KIM_INIT_H @@ -89,7 +83,6 @@ class KimInit : protected Pointers { } -#endif #endif /* ERROR/WARNING messages: diff --git a/src/KIM/kim_interactions.h b/src/KIM/kim_interactions.h index 071e5b284f..8790f2df14 100644 --- a/src/KIM/kim_interactions.h +++ b/src/KIM/kim_interactions.h @@ -56,12 +56,6 @@ Designed for use with the kim-api-2.1.0 (and newer) package ------------------------------------------------------------------------- */ -#ifdef COMMAND_CLASS - -CommandStyle(kim_interactions,KimInteractions) - -#else - #ifndef LMP_KIM_INTERACTIONS_H #define LMP_KIM_INTERACTIONS_H @@ -81,7 +75,6 @@ class KimInteractions : protected Pointers { } -#endif #endif /* ERROR/WARNING messages: diff --git a/src/KIM/kim_param.h b/src/KIM/kim_param.h index 3e20207cca..bfc27a71bf 100644 --- a/src/KIM/kim_param.h +++ b/src/KIM/kim_param.h @@ -55,12 +55,6 @@ Designed for use with the kim-api-2.1.0 (and newer) package ------------------------------------------------------------------------- */ -#ifdef COMMAND_CLASS - -CommandStyle(kim_param, KimParam) - -#else - #ifndef LMP_KIM_PARAM_H #define LMP_KIM_PARAM_H @@ -82,7 +76,6 @@ public: } // namespace LAMMPS_NS #endif // LMP_KIM_PARAM_H -#endif // COMMAND_CLASS /* ERROR/WARNING messages: diff --git a/src/KIM/kim_property.cpp b/src/KIM/kim_property.cpp index 17d8778c7a..3fb46d442f 100644 --- a/src/KIM/kim_property.cpp +++ b/src/KIM/kim_property.cpp @@ -70,7 +70,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -kimProperty::kimProperty(LAMMPS *lmp) : Pointers(lmp) +KimProperty::KimProperty(LAMMPS *lmp) : Pointers(lmp) { // one-time initialization of Python interpreter python->init(); @@ -82,7 +82,7 @@ kimProperty::kimProperty(LAMMPS *lmp) : Pointers(lmp) } } -void kimProperty::command(int narg, char **arg) +void KimProperty::command(int narg, char **arg) { #if LMP_PYTHON #if PY_MAJOR_VERSION >= 3 diff --git a/src/KIM/kim_property.h b/src/KIM/kim_property.h index ff5faa6781..11729433b5 100644 --- a/src/KIM/kim_property.h +++ b/src/KIM/kim_property.h @@ -53,12 +53,6 @@ Designed for use with the kim-api-2.1.0 (and newer) package ------------------------------------------------------------------------- */ -#ifdef COMMAND_CLASS - -CommandStyle(kim_property, kimProperty) - -#else - #ifndef LMP_KIM_PROPERTY_H #define LMP_KIM_PROPERTY_H @@ -67,10 +61,10 @@ CommandStyle(kim_property, kimProperty) namespace LAMMPS_NS { -class kimProperty : protected Pointers +class KimProperty : protected Pointers { public: - kimProperty(class LAMMPS *lmp); + KimProperty(class LAMMPS *lmp); void command(int, char **); }; @@ -78,7 +72,6 @@ public: } // namespace LAMMPS_NS #endif // LMP_KIM_PROPERTY_H -#endif // COMMAND_CLASS /* ERROR/WARNING messages: diff --git a/src/KIM/kim_query.h b/src/KIM/kim_query.h index f2523f5a98..ce59e2f67f 100644 --- a/src/KIM/kim_query.h +++ b/src/KIM/kim_query.h @@ -55,12 +55,6 @@ Designed for use with the kim-api-2.1.0 (and newer) package ------------------------------------------------------------------------- */ -#ifdef COMMAND_CLASS - -CommandStyle(kim_query,KimQuery) - -#else - #ifndef LMP_KIM_QUERY_H #define LMP_KIM_QUERY_H @@ -76,7 +70,6 @@ class KimQuery : protected Pointers { } -#endif #endif /* ERROR/WARNING messages: From 856c9064fb9633629dfd3882c2a549175b9585e8 Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 06:16:19 -0600 Subject: [PATCH 227/384] prototype implementation for KIM wrapper command by @akohlmey --- src/KIM/kim_command.cpp | 96 +++++++++++++++++++++++++++++++++++++++++ src/KIM/kim_command.h | 83 +++++++++++++++++++++++++++++++++++ 2 files changed, 179 insertions(+) create mode 100644 src/KIM/kim_command.cpp create mode 100644 src/KIM/kim_command.h diff --git a/src/KIM/kim_command.cpp b/src/KIM/kim_command.cpp new file mode 100644 index 0000000000..699aa4371b --- /dev/null +++ b/src/KIM/kim_command.cpp @@ -0,0 +1,96 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://lammps.sandia.gov/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing authors: Axel Kohlmeyer (Temple U) +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this program; if not, see . + + Linking LAMMPS statically or dynamically with other modules is making a + combined work based on LAMMPS. Thus, the terms and conditions of the GNU + General Public License cover the whole combination. + + In addition, as a special exception, the copyright holders of LAMMPS give + you permission to combine LAMMPS with free software programs or libraries + that are released under the GNU LGPL and with code included in the standard + release of the "kim-api" under the CDDL (or modified versions of such code, + with unchanged license). You may copy and distribute such a system following + the terms of the GNU GPL for LAMMPS and the licenses of the other code + concerned, provided that you include the source code of that other code + when and as the GNU GPL requires distribution of source code. + + Note that people who make modified versions of LAMMPS are not obligated to + grant this special exception for their modified versions; it is their choice + whether to do so. The GNU General Public License gives permission to release + a modified version without this exception; this exception also makes it + possible to release a modified version which carries forward this exception. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Designed for use with the kim-api-2.1.0 (and newer) package +------------------------------------------------------------------------- */ + +#include "kim_command.h" + +#include "error.h" + +// include KIM sub-command headers here +#include "kim_init.h" +#include "kim_interactions.h" +#include "kim_param.h" +#include "kim_property.h" +#include "kim_query.h" + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +void KimCommand::command(int narg, char **arg) +{ + if (narg < 1) error->all(FLERR,"Illegal kim command"); + + const std::string subcmd(arg[0]); + narg--; + arg++; + + if (subcmd == "init") { + KimInit *cmd = new KimInit(lmp); + cmd->command(narg,arg); + } else if (subcmd == "interactions") { + KimInteractions *cmd = new KimInteractions(lmp); + cmd->command(narg,arg); + } else if (subcmd == "param") { + KimParam *cmd = new KimParam(lmp); + cmd->command(narg,arg); + } else if (subcmd == "property") { + KimProperty *cmd = new KimProperty(lmp); + cmd->command(narg,arg); + } else if (subcmd == "query") { + KimQuery *cmd = new KimQuery(lmp); + cmd->command(narg,arg); + } else error->all(FLERR,fmt::format("Unknown kim subcommand {}",subcmd)); +} + diff --git a/src/KIM/kim_command.h b/src/KIM/kim_command.h new file mode 100644 index 0000000000..f327e4f2f3 --- /dev/null +++ b/src/KIM/kim_command.h @@ -0,0 +1,83 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing authors: Axel Kohlmeyer (Temple U) +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this program; if not, see . + + Linking LAMMPS statically or dynamically with other modules is making a + combined work based on LAMMPS. Thus, the terms and conditions of the GNU + General Public License cover the whole combination. + + In addition, as a special exception, the copyright holders of LAMMPS give + you permission to combine LAMMPS with free software programs or libraries + that are released under the GNU LGPL and with code included in the standard + release of the "kim-api" under the CDDL (or modified versions of such code, + with unchanged license). You may copy and distribute such a system following + the terms of the GNU GPL for LAMMPS and the licenses of the other code + concerned, provided that you include the source code of that other code + when and as the GNU GPL requires distribution of source code. + + Note that people who make modified versions of LAMMPS are not obligated to + grant this special exception for their modified versions; it is their choice + whether to do so. The GNU General Public License gives permission to release + a modified version without this exception; this exception also makes it + possible to release a modified version which carries forward this exception. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Designed for use with the kim-api-2.1.0 (and newer) package +------------------------------------------------------------------------- */ + +#ifdef COMMAND_CLASS + +CommandStyle(kim,KimCommand) + +#else + +#ifndef LMP_KIM_COMMAND_H +#define LMP_KIM_COMMAND_H + +#include "pointers.h" + +namespace LAMMPS_NS { + +class KimCommand : protected Pointers { + public: + KimCommand(class LAMMPS *lmp) : Pointers(lmp) {}; + void command(int, char **); +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + + +*/ From 0c5b3bc611a0a68e4336f41d5c5c23edc2dc3325 Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 05:28:41 -0600 Subject: [PATCH 228/384] clean up and remove unnecessary comments --- src/KIM/kim_param.cpp | 2 -- src/KIM/kim_param.h | 7 ++----- src/KIM/kim_property.h | 5 ++--- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/KIM/kim_param.cpp b/src/KIM/kim_param.cpp index 1628bb56d9..cef1dea642 100644 --- a/src/KIM/kim_param.cpp +++ b/src/KIM/kim_param.cpp @@ -134,8 +134,6 @@ void get_kim_unit_names( KimParam::KimParam(LAMMPS *lmp) : Pointers(lmp) {} -KimParam::~KimParam() {} - void KimParam::command(int narg, char **arg) { // kim_param is a command for diff --git a/src/KIM/kim_param.h b/src/KIM/kim_param.h index bfc27a71bf..7988e494be 100644 --- a/src/KIM/kim_param.h +++ b/src/KIM/kim_param.h @@ -67,15 +67,12 @@ class KimParam : protected Pointers { public: KimParam(class LAMMPS *lmp); - - ~KimParam(); - void command(int, char **); }; -} // namespace LAMMPS_NS +} -#endif // LMP_KIM_PARAM_H +#endif /* ERROR/WARNING messages: diff --git a/src/KIM/kim_property.h b/src/KIM/kim_property.h index 11729433b5..a804ad573c 100644 --- a/src/KIM/kim_property.h +++ b/src/KIM/kim_property.h @@ -65,13 +65,12 @@ class KimProperty : protected Pointers { public: KimProperty(class LAMMPS *lmp); - void command(int, char **); }; -} // namespace LAMMPS_NS +} -#endif // LMP_KIM_PROPERTY_H +#endif /* ERROR/WARNING messages: From dac21e5c76e92a5eb4b9e47bd8065c9cd883acbb Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 05:31:48 -0600 Subject: [PATCH 229/384] using unique_ptr to prevent memory leak --- src/KIM/kim_command.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/KIM/kim_command.cpp b/src/KIM/kim_command.cpp index 699aa4371b..bce1e0d929 100644 --- a/src/KIM/kim_command.cpp +++ b/src/KIM/kim_command.cpp @@ -12,7 +12,8 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing authors: Axel Kohlmeyer (Temple U) + Contributing authors: Axel Kohlmeyer (Temple U), + Yaser Afshar (UMN) ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- @@ -64,6 +65,8 @@ #include "kim_property.h" #include "kim_query.h" +#include + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -77,20 +80,19 @@ void KimCommand::command(int narg, char **arg) arg++; if (subcmd == "init") { - KimInit *cmd = new KimInit(lmp); - cmd->command(narg,arg); + std::unique_ptr cmd(new KimInit(lmp)); + cmd->command(narg, arg); } else if (subcmd == "interactions") { - KimInteractions *cmd = new KimInteractions(lmp); - cmd->command(narg,arg); + std::unique_ptr cmd(new KimInteractions(lmp)); + cmd->command(narg, arg); } else if (subcmd == "param") { - KimParam *cmd = new KimParam(lmp); - cmd->command(narg,arg); + std::unique_ptr cmd(new KimParam(lmp)); + cmd->command(narg, arg); } else if (subcmd == "property") { - KimProperty *cmd = new KimProperty(lmp); - cmd->command(narg,arg); + std::unique_ptr cmd(new KimProperty(lmp)); + cmd->command(narg, arg); } else if (subcmd == "query") { - KimQuery *cmd = new KimQuery(lmp); - cmd->command(narg,arg); - } else error->all(FLERR,fmt::format("Unknown kim subcommand {}",subcmd)); + std::unique_ptr cmd(new KimQuery(lmp)); + cmd->command(narg, arg); + } else error->all(FLERR, fmt::format("Unknown kim subcommand {}", subcmd)); } - From c3393cfc4bdea96a08fd2090a95652674a25535e Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 05:38:44 -0600 Subject: [PATCH 230/384] update the error messages to 'kim init' and clean up --- src/KIM/kim_init.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/KIM/kim_init.cpp b/src/KIM/kim_init.cpp index 2d639ede4c..c4e9955ac4 100644 --- a/src/KIM/kim_init.cpp +++ b/src/KIM/kim_init.cpp @@ -81,17 +81,17 @@ using namespace LAMMPS_NS; void KimInit::command(int narg, char **arg) { - if ((narg < 2) || (narg > 3)) error->all(FLERR,"Illegal kim_init command"); + if ((narg < 2) || (narg > 3)) error->all(FLERR,"Illegal 'kim init' command"); if (domain->box_exist) - error->all(FLERR,"Must use 'kim_init' command before " + error->all(FLERR,"Must use 'kim init' command before " "simulation box is defined"); char *model_name = utils::strdup(arg[0]); char *user_units = utils::strdup(arg[1]); if (narg == 3) { if (strcmp(arg[2],"unit_conversion_mode")==0) unit_conversion_mode = true; else { - error->all(FLERR,fmt::format("Illegal kim_init command.\nThe argument " + error->all(FLERR,fmt::format("Illegal 'kim init' command.\nThe argument " "followed by unit_style {} is an optional " "argument and when is used must " "be unit_conversion_mode", user_units)); @@ -283,7 +283,8 @@ void KimInit::determine_model_type_and_units(char * model_name, /* ---------------------------------------------------------------------- */ -void KimInit::do_init(char *model_name, char *user_units, char *model_units, KIM_Model *&pkim) +void KimInit::do_init(char *model_name, char *user_units, char *model_units, + KIM_Model *&pkim) { // create storage proxy fix. delete existing fix, if needed. @@ -298,7 +299,8 @@ void KimInit::do_init(char *model_name, char *user_units, char *model_units, KIM fix_store->setptr("model_units", (void *) model_units); // Begin output to log file - input->write_echo("#=== BEGIN kim-init ==========================================\n"); + input->write_echo("#=== BEGIN kim init ===================================" + "=======\n"); KIM_SimulatorModel * simulatorModel; if (model_type == SM) { @@ -407,7 +409,8 @@ void KimInit::do_init(char *model_name, char *user_units, char *model_units, KIM } // End output to log file - input->write_echo("#=== END kim-init ============================================\n\n"); + input->write_echo("#=== END kim init =====================================" + "=======\n\n"); } /* ---------------------------------------------------------------------- */ From c36a52a8f95d703fd58cb85730c85d50ccd2a2a8 Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 05:45:25 -0600 Subject: [PATCH 231/384] clean up and add extra space after comma --- src/KIM/kim_init.cpp | 106 +++++++++++++++++++++---------------------- 1 file changed, 51 insertions(+), 55 deletions(-) diff --git a/src/KIM/kim_init.cpp b/src/KIM/kim_init.cpp index c4e9955ac4..43ccfda155 100644 --- a/src/KIM/kim_init.cpp +++ b/src/KIM/kim_init.cpp @@ -81,30 +81,28 @@ using namespace LAMMPS_NS; void KimInit::command(int narg, char **arg) { - if ((narg < 2) || (narg > 3)) error->all(FLERR,"Illegal 'kim init' command"); + if ((narg < 2) || (narg > 3)) error->all(FLERR, "Illegal 'kim init' command"); if (domain->box_exist) - error->all(FLERR,"Must use 'kim init' command before " - "simulation box is defined"); + error->all(FLERR, "Must use 'kim init' command before " + "simulation box is defined"); char *model_name = utils::strdup(arg[0]); char *user_units = utils::strdup(arg[1]); if (narg == 3) { - if (strcmp(arg[2],"unit_conversion_mode")==0) unit_conversion_mode = true; + if (strcmp(arg[2], "unit_conversion_mode")==0) unit_conversion_mode = true; else { - error->all(FLERR,fmt::format("Illegal 'kim init' command.\nThe argument " - "followed by unit_style {} is an optional " - "argument and when is used must " - "be unit_conversion_mode", user_units)); + error->all(FLERR, fmt::format("Illegal 'kim init' command.\nThe argument " + "followed by unit_style {} is an optional " + "argument and when is used must " + "be unit_conversion_mode", user_units)); } } else unit_conversion_mode = false; char *model_units; KIM_Model *pkim = nullptr; - if (universe->me == 0) - std::remove("kim.log"); - if (universe->nprocs > 1) - MPI_Barrier(universe->uworld); + if (universe->me == 0) std::remove("kim.log"); + if (universe->nprocs > 1) MPI_Barrier(universe->uworld); determine_model_type_and_units(model_name, user_units, &model_units, pkim); @@ -125,43 +123,43 @@ void get_kim_unit_names( KIM_TimeUnit & timeUnit, Error * error) { - if (strcmp(system,"real") == 0) { + if (strcmp(system, "real") == 0) { lengthUnit = KIM_LENGTH_UNIT_A; energyUnit = KIM_ENERGY_UNIT_kcal_mol; chargeUnit = KIM_CHARGE_UNIT_e; temperatureUnit = KIM_TEMPERATURE_UNIT_K; timeUnit = KIM_TIME_UNIT_fs; - } else if (strcmp(system,"metal") == 0) { + } else if (strcmp(system, "metal") == 0) { lengthUnit = KIM_LENGTH_UNIT_A; energyUnit = KIM_ENERGY_UNIT_eV; chargeUnit = KIM_CHARGE_UNIT_e; temperatureUnit = KIM_TEMPERATURE_UNIT_K; timeUnit = KIM_TIME_UNIT_ps; - } else if (strcmp(system,"si") == 0) { + } else if (strcmp(system, "si") == 0) { lengthUnit = KIM_LENGTH_UNIT_m; energyUnit = KIM_ENERGY_UNIT_J; chargeUnit = KIM_CHARGE_UNIT_C; temperatureUnit = KIM_TEMPERATURE_UNIT_K; timeUnit = KIM_TIME_UNIT_s; - } else if (strcmp(system,"cgs") == 0) { + } else if (strcmp(system, "cgs") == 0) { lengthUnit = KIM_LENGTH_UNIT_cm; energyUnit = KIM_ENERGY_UNIT_erg; chargeUnit = KIM_CHARGE_UNIT_statC; temperatureUnit = KIM_TEMPERATURE_UNIT_K; timeUnit = KIM_TIME_UNIT_s; - } else if (strcmp(system,"electron") == 0) { + } else if (strcmp(system, "electron") == 0) { lengthUnit = KIM_LENGTH_UNIT_Bohr; energyUnit = KIM_ENERGY_UNIT_Hartree; chargeUnit = KIM_CHARGE_UNIT_e; temperatureUnit = KIM_TEMPERATURE_UNIT_K; timeUnit = KIM_TIME_UNIT_fs; - } else if (strcmp(system,"lj") == 0 || - strcmp(system,"micro") ==0 || - strcmp(system,"nano")==0) { - error->all(FLERR,fmt::format("LAMMPS unit_style {} not supported " - "by KIM models", system)); + } else if (strcmp(system, "lj") == 0 || + strcmp(system, "micro") ==0 || + strcmp(system, "nano")==0) { + error->all(FLERR, fmt::format("LAMMPS unit_style {} not supported " + "by KIM models", system)); } else { - error->all(FLERR,"Unknown unit_style"); + error->all(FLERR, "Unknown unit_style"); } } } // namespace @@ -182,13 +180,13 @@ void KimInit::determine_model_type_and_units(char * model_name, int kim_error = KIM_Collections_Create(&collections); if (kim_error) - error->all(FLERR,"Unable to access KIM Collections to find Model"); + error->all(FLERR, "Unable to access KIM Collections to find Model"); auto logID = fmt::format("{}_Collections", comm->me); KIM_Collections_SetLogID(collections, logID.c_str()); kim_error = KIM_Collections_GetItemType(collections, model_name, &itemType); - if (kim_error) error->all(FLERR,"KIM Model name not found"); + if (kim_error) error->all(FLERR, "KIM Model name not found"); KIM_Collections_Destroy(&collections); if (KIM_CollectionItemType_Equal(itemType, @@ -205,7 +203,7 @@ void KimInit::determine_model_type_and_units(char * model_name, &units_accepted, &pkim); - if (kim_error) error->all(FLERR,"Unable to load KIM Simulator Model"); + if (kim_error) error->all(FLERR, "Unable to load KIM Simulator Model"); model_type = MO; @@ -239,17 +237,17 @@ void KimInit::determine_model_type_and_units(char * model_name, } KIM_Model_Destroy(&pkim); } - error->all(FLERR,"KIM Model does not support any lammps unit system"); + error->all(FLERR, "KIM Model does not support any lammps unit system"); } else { KIM_Model_Destroy(&pkim); - error->all(FLERR,"KIM Model does not support the requested unit system"); + error->all(FLERR, "KIM Model does not support the requested unit system"); } } else if (KIM_CollectionItemType_Equal( itemType, KIM_COLLECTION_ITEM_TYPE_simulatorModel)) { KIM_SimulatorModel * simulatorModel; kim_error = KIM_SimulatorModel_Create(model_name, &simulatorModel); if (kim_error) - error->all(FLERR,"Unable to load KIM Simulator Model"); + error->all(FLERR, "Unable to load KIM Simulator Model"); model_type = SM; logID = fmt::format("{}_SimulatorModel", comm->me); @@ -265,7 +263,7 @@ void KimInit::determine_model_type_and_units(char * model_name, KIM_SimulatorModel_GetSimulatorFieldMetadata( simulatorModel, i, &sim_lines, &sim_field); - if (0 == strcmp(sim_field,"units")) { + if (0 == strcmp(sim_field, "units")) { KIM_SimulatorModel_GetSimulatorFieldLine( simulatorModel, i, 0, &sim_value); *model_units = utils::strdup(sim_value); @@ -275,8 +273,8 @@ void KimInit::determine_model_type_and_units(char * model_name, KIM_SimulatorModel_Destroy(&simulatorModel); if ((! unit_conversion_mode) && (strcmp(*model_units, user_units)!=0)) { - error->all(FLERR,fmt::format("Incompatible units for KIM Simulator Model" - ", required units = {}", *model_units)); + error->all(FLERR, fmt::format("Incompatible units for KIM Simulator Model" + ", required units = {}", *model_units)); } } } @@ -307,7 +305,7 @@ void KimInit::do_init(char *model_name, char *user_units, char *model_units, int kim_error = KIM_SimulatorModel_Create(model_name, &simulatorModel); if (kim_error) - error->all(FLERR,"Unable to load KIM Simulator Model"); + error->all(FLERR, "Unable to load KIM Simulator Model"); auto logID = fmt::format("{}_SimulatorModel", comm->me); KIM_SimulatorModel_SetLogID(simulatorModel, logID.c_str()); @@ -316,8 +314,8 @@ void KimInit::do_init(char *model_name, char *user_units, char *model_units, KIM_SimulatorModel_GetSimulatorNameAndVersion( simulatorModel, &sim_name, &sim_version); - if (0 != strcmp(sim_name,"LAMMPS")) - error->all(FLERR,"Incompatible KIM Simulator Model"); + if (0 != strcmp(sim_name, "LAMMPS")) + error->all(FLERR, "Incompatible KIM Simulator Model"); if (comm->me == 0) { std::string mesg("# Using KIM Simulator Model : "); @@ -330,7 +328,7 @@ void KimInit::do_init(char *model_name, char *user_units, char *model_units, mesg += "\n"; mesg += "#\n"; - utils::logmesg(lmp,mesg); + utils::logmesg(lmp, mesg); } fix_store->setptr("simulator_model", (void *) simulatorModel); @@ -358,11 +356,11 @@ void KimInit::do_init(char *model_name, char *user_units, char *model_units, for (int i=0; i < sim_fields; ++i) { KIM_SimulatorModel_GetSimulatorFieldMetadata( - simulatorModel,i,&sim_lines,&sim_field); - if (0 == strcmp(sim_field,"model-init")) { + simulatorModel, i, &sim_lines, &sim_field); + if (0 == strcmp(sim_field, "model-init")) { for (int j=0; j < sim_lines; ++j) { KIM_SimulatorModel_GetSimulatorFieldLine( - simulatorModel,i,j,&sim_value); + simulatorModel, i, j, &sim_value); input->one(sim_value); } break; @@ -390,17 +388,17 @@ void KimInit::do_init(char *model_name, char *user_units, char *model_units, &extent, &str_name, &str_desc); max_len = MAX(max_len, (int)strlen(str_name)); } - max_len = MAX(18,max_len+1); + max_len = MAX(18, max_len + 1); mesg += fmt::format(" No. | {:<{}} | data type | extent\n", "Parameter name", max_len); - mesg += fmt::format("{:-<{}}\n","-",max_len+35); + mesg += fmt::format("{:-<{}}\n", "-", max_len + 35); for (int i = 0; i < numberOfParameters; ++i) { KIM_Model_GetParameterMetadata(pkim, i, &kim_DataType, &extent, &str_name, &str_desc); auto data_type = std::string("\""); data_type += KIM_DataType_ToString(kim_DataType) + std::string("\""); - mesg += fmt::format(" {:<8} | {:<{}} | {:<10} | {}\n",i+1,str_name, - max_len,data_type,extent); + mesg += fmt::format(" {:<8} | {:<{}} | {:<10} | {}\n", i + 1, str_name, + max_len, data_type, extent); } } else mesg += "No mutable parameters.\n"; @@ -420,7 +418,7 @@ void KimInit::do_variables(const std::string &from, const std::string &to) // refuse conversion from or to reduced units if ((from == "lj") || (to == "lj")) - error->all(FLERR,"Cannot set up conversion variables for 'lj' units"); + error->all(FLERR, "Cannot set up conversion variables for 'lj' units"); // get index to internal style variables. create, if needed. // set conversion factors for newly created variables. @@ -445,7 +443,7 @@ void KimInit::do_variables(const std::string &from, const std::string &to) nullptr}; input->write_echo(fmt::format("# Conversion factors from {} to {}:\n", - from,to)); + from, to)); auto variable = input->variable; for (int i = 0; units[i] != nullptr; ++i) { @@ -455,16 +453,14 @@ void KimInit::do_variables(const std::string &from, const std::string &to) variable->set(var_str + " internal 1.0"); v_unit = variable->find(var_str.c_str()); } - ier = lammps_unit_conversion(units[i], - from, - to, + ier = lammps_unit_conversion(units[i], from, to, conversion_factor); if (ier != 0) - error->all(FLERR,fmt::format("Unable to obtain conversion factor: " - "unit = {}; from = {}; to = {}", - units[i], from, to)); + error->all(FLERR, fmt::format("Unable to obtain conversion factor: " + "unit = {}; from = {}; to = {}", + units[i], from, to)); - variable->internal_set(v_unit,conversion_factor); + variable->internal_set(v_unit, conversion_factor); input->write_echo(fmt::format("variable {:<15s} internal {:<15.12e}\n", var_str, conversion_factor)); } @@ -486,13 +482,13 @@ void KimInit::write_log_cite(char *model_name) if (model_type == MO) { err = KIM_Collections_CacheListOfItemMetadataFiles( collections, KIM_COLLECTION_ITEM_TYPE_portableModel, - model_name,&extent); + model_name, &extent); } else if (model_type == SM) { err = KIM_Collections_CacheListOfItemMetadataFiles( collections, KIM_COLLECTION_ITEM_TYPE_simulatorModel, model_name, &extent); } else { - error->all(FLERR,"Unknown model type"); + error->all(FLERR, "Unknown model type"); } if (err) { @@ -509,7 +505,7 @@ void KimInit::write_log_cite(char *model_name) &availableAsString, &fileString); if (err) continue; - if (0 == strncmp("kimcite",fileName,7)) { + if (0 == strncmp("kimcite", fileName, 7)) { if ((lmp->citeme) && (availableAsString)) lmp->citeme->add(fileString); } } From e5efe21d90e44f819de531e78b361ea4a89fe99e Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 05:46:50 -0600 Subject: [PATCH 232/384] update the error messages to 'kim interactions' and clean up the code --- src/KIM/kim_interactions.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/KIM/kim_interactions.cpp b/src/KIM/kim_interactions.cpp index afb1391606..626fd2b4ba 100644 --- a/src/KIM/kim_interactions.cpp +++ b/src/KIM/kim_interactions.cpp @@ -83,10 +83,10 @@ using namespace LAMMPS_NS; void KimInteractions::command(int narg, char **arg) { - if (narg < 1) error->all(FLERR,"Illegal kim_interactions command"); + if (narg < 1) error->all(FLERR,"Illegal 'kim interactions' command"); if (!domain->box_exist) - error->all(FLERR,"Must use 'kim_interactions' command after " + error->all(FLERR,"Must use 'kim interactions' command after " "simulation box is defined"); do_setup(narg,arg); @@ -100,10 +100,10 @@ void KimInteractions::do_setup(int narg, char **arg) if ((narg == 1) && (0 == strcmp("fixed_types",arg[0]))) { fixed_types = true; } else if (narg != atom->ntypes) { - error->all(FLERR,fmt::format("Illegal kim_interactions command.\nThe " + error->all(FLERR,fmt::format("Illegal 'kim interactions' command.\nThe " "LAMMPS simulation has {} atom type(s), but " "{} chemical species passed to the " - "kim_interactions command", + "'kim interactions' command", atom->ntypes, narg)); } else { fixed_types = false; @@ -112,7 +112,7 @@ void KimInteractions::do_setup(int narg, char **arg) char *model_name = nullptr; KIM_SimulatorModel *simulatorModel(nullptr); - // check if we had a kim_init command by finding fix STORE/KIM + // check if we had a kim init command by finding fix STORE/KIM // retrieve model name and pointer to simulator model class instance. // validate model name if not given as null pointer. @@ -121,10 +121,11 @@ void KimInteractions::do_setup(int narg, char **arg) FixStoreKIM *fix_store = (FixStoreKIM *) modify->fix[ifix]; model_name = (char *)fix_store->getptr("model_name"); simulatorModel = (KIM_SimulatorModel *)fix_store->getptr("simulator_model"); - } else error->all(FLERR,"Must use 'kim_init' before 'kim_interactions'"); + } else error->all(FLERR,"Must use 'kim init' before 'kim interactions'"); // Begin output to log file - input->write_echo("#=== BEGIN kim_interactions ==================================\n"); + input->write_echo("#=== BEGIN kim interactions ===========================" + "=======\n"); if (simulatorModel) { if (!fixed_types) { @@ -211,7 +212,7 @@ void KimInteractions::do_setup(int narg, char **arg) // * This is an INTERNAL command. // * It is intended for use only by KIM Simulator Models. // * It is not possible to use this command outside of the context - // of the kim_interactions command and KIM Simulator Models. + // of the kim interactions command and KIM Simulator Models. // * The command performs a transformation from symbolic // string-based atom types to lammps numeric atom types for // the pair_coeff and charge settings. @@ -250,7 +251,8 @@ void KimInteractions::do_setup(int narg, char **arg) } // End output to log file - input->write_echo("#=== END kim_interactions ====================================\n\n"); + input->write_echo("#=== END kim interactions =============================" + "=======\n\n"); } /* ---------------------------------------------------------------------- */ From 98e734845eb21e7ad5e801206b247c0b7911856e Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 05:49:35 -0600 Subject: [PATCH 233/384] clean up and add extra space after comma --- src/KIM/kim_interactions.cpp | 66 ++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/KIM/kim_interactions.cpp b/src/KIM/kim_interactions.cpp index 626fd2b4ba..59fc4d3f25 100644 --- a/src/KIM/kim_interactions.cpp +++ b/src/KIM/kim_interactions.cpp @@ -83,13 +83,13 @@ using namespace LAMMPS_NS; void KimInteractions::command(int narg, char **arg) { - if (narg < 1) error->all(FLERR,"Illegal 'kim interactions' command"); + if (narg < 1) error->all(FLERR, "Illegal 'kim interactions' command"); if (!domain->box_exist) - error->all(FLERR,"Must use 'kim interactions' command after " - "simulation box is defined"); + error->all(FLERR, "Must use 'kim interactions' command after " + "simulation box is defined"); - do_setup(narg,arg); + do_setup(narg, arg); } /* ---------------------------------------------------------------------- */ @@ -97,14 +97,14 @@ void KimInteractions::command(int narg, char **arg) void KimInteractions::do_setup(int narg, char **arg) { bool fixed_types; - if ((narg == 1) && (0 == strcmp("fixed_types",arg[0]))) { + if ((narg == 1) && (0 == strcmp("fixed_types", arg[0]))) { fixed_types = true; } else if (narg != atom->ntypes) { - error->all(FLERR,fmt::format("Illegal 'kim interactions' command.\nThe " - "LAMMPS simulation has {} atom type(s), but " - "{} chemical species passed to the " - "'kim interactions' command", - atom->ntypes, narg)); + error->all(FLERR, fmt::format("Illegal 'kim interactions' command.\nThe " + "LAMMPS simulation has {} atom type(s), but " + "{} chemical species passed to the " + "'kim interactions' command", + atom->ntypes, narg)); } else { fixed_types = false; } @@ -121,7 +121,7 @@ void KimInteractions::do_setup(int narg, char **arg) FixStoreKIM *fix_store = (FixStoreKIM *) modify->fix[ifix]; model_name = (char *)fix_store->getptr("model_name"); simulatorModel = (KIM_SimulatorModel *)fix_store->getptr("simulator_model"); - } else error->all(FLERR,"Must use 'kim init' before 'kim interactions'"); + } else error->all(FLERR, "Must use 'kim init' before 'kim interactions'"); // Begin output to log file input->write_echo("#=== BEGIN kim interactions ===========================" @@ -150,7 +150,7 @@ void KimInteractions::do_setup(int narg, char **arg) bool species_is_supported; char const *sim_species; KIM_SimulatorModel_GetNumberOfSupportedSpecies( - simulatorModel,&sim_num_species); + simulatorModel, &sim_num_species); for (auto atom_type_sym : utils::split_words(atom_type_sym_list)) { species_is_supported = false; @@ -161,8 +161,8 @@ void KimInteractions::do_setup(int narg, char **arg) if (atom_type_sym == sim_species) species_is_supported = true; } if (!species_is_supported) { - error->all(FLERR,fmt::format("Species '{}' is not supported by this " - "KIM Simulator Model", atom_type_sym)); + error->all(FLERR, fmt::format("Species '{}' is not supported by this " + "KIM Simulator Model", atom_type_sym)); } } } else { @@ -178,10 +178,10 @@ void KimInteractions::do_setup(int narg, char **arg) KIM_SimulatorModel_GetSimulatorFieldMetadata( simulatorModel, i, &sim_lines, &sim_field); - if (strcmp(sim_field,"units") == 0) { + if (strcmp(sim_field, "units") == 0) { KIM_SimulatorModel_GetSimulatorFieldLine( simulatorModel, i, 0, &sim_value); - if (strcmp(sim_value,update->unit_style) != 0) + if (strcmp(sim_value, update->unit_style) != 0) error->all(FLERR,"Incompatible units for KIM Simulator Model"); } } @@ -190,7 +190,7 @@ void KimInteractions::do_setup(int narg, char **arg) for (int i = 0; i < sim_fields; ++i) { KIM_SimulatorModel_GetSimulatorFieldMetadata( simulatorModel, i, &sim_lines, &sim_field); - if (strcmp(sim_field,"model-defn") == 0) { + if (strcmp(sim_field, "model-defn") == 0) { if (domain->periodicity[0]&& domain->periodicity[1]&& domain->periodicity[2]) @@ -207,7 +207,7 @@ void KimInteractions::do_setup(int narg, char **arg) for (int j = 0; j < sim_lines; ++j) { KIM_SimulatorModel_GetSimulatorFieldLine( simulatorModel, i, j, &sim_value); - if (utils::strmatch(sim_value,"^KIM_SET_TYPE_PARAMETERS")) { + if (utils::strmatch(sim_value, "^KIM_SET_TYPE_PARAMETERS")) { // Notes regarding the KIM_SET_TYPE_PARAMETERS command // * This is an INTERNAL command. // * It is intended for use only by KIM Simulator Models. @@ -228,7 +228,7 @@ void KimInteractions::do_setup(int narg, char **arg) } if (no_model_definition) - error->all(FLERR,"KIM Simulator Model has no Model definition"); + error->all(FLERR, "KIM Simulator Model has no Model definition"); KIM_SimulatorModel_OpenAndInitializeTemplateMap(simulatorModel); @@ -237,7 +237,7 @@ void KimInteractions::do_setup(int narg, char **arg) // not a simulator model. issue pair_style and pair_coeff commands. if (fixed_types) - error->all(FLERR,"fixed_types cannot be used with a KIM Portable Model"); + error->all(FLERR, "fixed_types cannot be used with a KIM Portable Model"); // NOTE: all references to arg must appear before calls to input->one() // as that will reset the argument vector. @@ -263,18 +263,18 @@ void KimInteractions::KIM_SET_TYPE_PARAMETERS(const std::string &input_line) con const std::string key = words[1]; if (key != "pair" && key != "charge") - error->one(FLERR,fmt::format("Unrecognized KEY {} for " - "KIM_SET_TYPE_PARAMETERS command", key)); + error->one(FLERR, fmt::format("Unrecognized KEY {} for " + "KIM_SET_TYPE_PARAMETERS command", key)); std::string filename = words[2]; - std::vector species(words.begin()+3,words.end()); + std::vector species(words.begin() + 3, words.end()); if ((int)species.size() != atom->ntypes) - error->one(FLERR,"Incorrect args for KIM_SET_TYPE_PARAMETERS command"); + error->one(FLERR, "Incorrect args for KIM_SET_TYPE_PARAMETERS command"); FILE *fp = nullptr; if (comm->me == 0) { - fp = fopen(filename.c_str(),"r"); - if (fp == nullptr) error->one(FLERR,"Parameter file not found"); + fp = fopen(filename.c_str(), "r"); + if (fp == nullptr) error->one(FLERR, "Parameter file not found"); } char line[MAXLINE], *ptr; @@ -282,16 +282,16 @@ void KimInteractions::KIM_SET_TYPE_PARAMETERS(const std::string &input_line) con while (1) { if (comm->me == 0) { - ptr = fgets(line,MAXLINE,fp); + ptr = fgets(line, MAXLINE,fp); if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; } - MPI_Bcast(&eof,1,MPI_INT,0,world); + MPI_Bcast(&eof, 1, MPI_INT, 0, world); if (eof) break; - MPI_Bcast(&n,1,MPI_INT,0,world); - MPI_Bcast(line,n,MPI_CHAR,0,world); + MPI_Bcast(&n, 1, MPI_INT, 0, world); + MPI_Bcast(line, n, MPI_CHAR, 0, world); auto trimmed = utils::trim_comment(line); if (trimmed.find_first_not_of(" \t\n\r") == std::string::npos) continue; @@ -302,13 +302,13 @@ void KimInteractions::KIM_SET_TYPE_PARAMETERS(const std::string &input_line) con for (int ib = ia; ib < atom->ntypes; ++ib) if (((species[ia] == words[0]) && (species[ib] == words[1])) || ((species[ib] == words[0]) && (species[ia] == words[1]))) - input->one(fmt::format("pair_coeff {} {} {}",ia+1,ib+1, - fmt::join(words.begin()+2,words.end()," "))); + input->one(fmt::format("pair_coeff {} {} {}", ia + 1, ib + 1, + fmt::join(words.begin() + 2, words.end(), " "))); } } else { for (int ia = 0; ia < atom->ntypes; ++ia) if (species[ia] == words[0]) - input->one(fmt::format("set type {} charge {}",ia+1,words[1])); + input->one(fmt::format("set type {} charge {}", ia + 1, words[1])); } } } From 265650d97cd04667d680284fef8d33e06fd1e00c Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 05:50:37 -0600 Subject: [PATCH 234/384] update the error messages to 'kim param' and clean up the code --- src/KIM/kim_param.cpp | 56 +++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/KIM/kim_param.cpp b/src/KIM/kim_param.cpp index cef1dea642..9b9909b623 100644 --- a/src/KIM/kim_param.cpp +++ b/src/KIM/kim_param.cpp @@ -136,30 +136,29 @@ KimParam::KimParam(LAMMPS *lmp) : Pointers(lmp) {} void KimParam::command(int narg, char **arg) { - // kim_param is a command for + // kim param is a command for // getting/setting the value of a %KIM PM parameter // - // kim_param get param_name index_range variables formatarg - // kim_param set param_name index_range values + // kim param get param_name index_range variables formatarg + // kim param set param_name index_range values + // + // kim param get paramname 1 varname + // kim param get paramname index_range varname_1, ..., varname_N + // kim param get paramname index_range varname_base split + // kim param get paramname index_range varname_base list + // kim param set paramname index_range values - // kim_param get paramname 1 varname - // kim_param get paramname index_range varname_1, ..., varname_N - // kim_param get paramname index_range varname_base split - // kim_param get paramname index_range varname_base list - // kim_param set paramname index_range values - - if (narg < 4) - error->all(FLERR, "Illegal kim_param command"); + if (narg < 4) error->all(FLERR, "Illegal 'kim param' command"); std::string kim_param_get_set = arg[0]; if ((kim_param_get_set != "get") && (kim_param_get_set != "set")) { - std::string msg("Incorrect arguments in kim_param command.\n"); - msg += "'kim_param get/set' is mandatory"; + std::string msg("Incorrect arguments in 'kim param' command.\n"); + msg += "'kim param get/set' is mandatory"; error->all(FLERR, msg); } - // Check if we called a kim_init command + // Check if we called a kim init command // by finding fix STORE/KIM // retrieve model name and model units. @@ -178,15 +177,16 @@ void KimParam::command(int narg, char **arg) isPortableModel = simulatorModel ? false : true; if (!isPortableModel) - error->all(FLERR, "kim_param can only be used with a KIM Portable Model"); + error->all(FLERR, + "'kim param' can only be used with a KIM Portable Model"); model_name = (char *)fix_store->getptr("model_name"); model_units = (char *)fix_store->getptr("model_units"); } else - error->all(FLERR, "Must use 'kim_init' before 'kim_param'"); + error->all(FLERR, "Must use 'kim init' before 'kim param'"); - input->write_echo(fmt::format("#=== BEGIN kim-param {} ===================" - "==================\n",kim_param_get_set)); + input->write_echo(fmt::format("#=== BEGIN kim param {} ===================" + "==================\n", kim_param_get_set)); KIM_Model *pkim = nullptr; @@ -214,10 +214,10 @@ void KimParam::command(int narg, char **arg) "no match for kim style in lammps"); } else { if (kim_param_get_set == "set") { - std::string msg("Wrong 'kim_param set' command.\n"); + std::string msg("Wrong 'kim param set' command.\n"); msg += "To set the new parameter values, pair style must "; - msg += "be assigned.\nMust use 'kim_interactions' or"; - msg += "'pair_style kim' before 'kim_param set'"; + msg += "be assigned.\nMust use 'kim interactions' or"; + msg += "'pair_style kim' before 'kim param set'"; error->all(FLERR, msg); } else { KIM_LengthUnit lengthUnit; @@ -287,7 +287,7 @@ void KimParam::command(int narg, char **arg) } if (param_index >= numberOfParameters) { - auto msg = fmt::format("Wrong argument in kim_param get command.\n" + auto msg = fmt::format("Wrong argument in 'kim param get' command.\n" "This Model does not have the requested '{}' " "parameter", paramname); error->all(FLERR, msg); @@ -336,7 +336,7 @@ void KimParam::command(int narg, char **arg) nubound = nlbound; } } else { - std::string msg("Wrong number of arguments in 'kim_param get' "); + std::string msg("Wrong number of arguments in 'kim param get' "); msg += "command.\nIndex range after parameter name is mandatory"; error->all(FLERR, msg); } @@ -348,7 +348,7 @@ void KimParam::command(int narg, char **arg) // Get the variable/variable_base name varname = arg[i++]; } else { - std::string msg("Wrong number of arguments in 'kim_param get' "); + std::string msg("Wrong number of arguments in 'kim param get' "); msg += "command.\nThe LAMMPS variable name is mandatory"; error->all(FLERR, msg); } @@ -377,14 +377,14 @@ void KimParam::command(int narg, char **arg) } } else { auto msg = - fmt::format("Wrong number of arguments in 'kim_param get' " + fmt::format("Wrong number of arguments in 'kim param get' " "command.\nThe LAMMPS '{}' variable names or " "'{} split' is mandatory", nvars, varname); error->all(FLERR, msg); } } else { auto msg = - fmt::format("Wrong number of arguments in 'kim_param get' " + fmt::format("Wrong number of arguments in 'kim param get' " "command.\nThe LAMMPS '{}' variable names or " "'{} split/list' is mandatory", nvars, varname); error->all(FLERR, msg); @@ -498,6 +498,6 @@ void KimParam::command(int narg, char **arg) if (!isPairStyleAssigned) KIM_Model_Destroy(&pkim); - input->write_echo(fmt::format("#=== END kim-param {} =====================" - "==================\n",kim_param_get_set)); + input->write_echo(fmt::format("#=== END kim param {} =====================" + "==================\n", kim_param_get_set)); } From 2d9dcf4e8d24875f9589e842c139c54898eec480 Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 05:52:10 -0600 Subject: [PATCH 235/384] clean up and add extra space after comma --- src/KIM/kim_param.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/KIM/kim_param.cpp b/src/KIM/kim_param.cpp index 9b9909b623..1ebbed62f6 100644 --- a/src/KIM/kim_param.cpp +++ b/src/KIM/kim_param.cpp @@ -120,11 +120,11 @@ void get_kim_unit_names( chargeUnit = KIM_CHARGE_UNIT_e; temperatureUnit = KIM_TEMPERATURE_UNIT_K; timeUnit = KIM_TIME_UNIT_fs; - } else if (strcmp(system,"lj") == 0 || - strcmp(system,"micro") ==0 || - strcmp(system,"nano")==0) { - error->all(FLERR,fmt::format("LAMMPS unit_style {} not supported " - "by KIM models", system)); + } else if (strcmp(system, "lj") == 0 || + strcmp(system, "micro") ==0 || + strcmp(system, "nano")==0) { + error->all(FLERR, fmt::format("LAMMPS unit_style {} not supported " + "by KIM models", system)); } else error->all(FLERR, "Unknown unit_style"); } @@ -227,8 +227,7 @@ void KimParam::command(int narg, char **arg) KIM_TimeUnit timeUnit; get_kim_unit_names(model_units, lengthUnit, energyUnit, - chargeUnit, temperatureUnit, timeUnit, - error); + chargeUnit, temperatureUnit, timeUnit, error); int units_accepted; From a859643bac717e5ee51c61be0b6c36a36f8cbb7d Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 05:53:00 -0600 Subject: [PATCH 236/384] update the error messages to 'kim property' and clean up the code --- src/KIM/kim_property.cpp | 120 ++++++++++++++++++++------------------- 1 file changed, 62 insertions(+), 58 deletions(-) diff --git a/src/KIM/kim_property.cpp b/src/KIM/kim_property.cpp index 3fb46d442f..d620356caf 100644 --- a/src/KIM/kim_property.cpp +++ b/src/KIM/kim_property.cpp @@ -75,32 +75,28 @@ KimProperty::KimProperty(LAMMPS *lmp) : Pointers(lmp) // one-time initialization of Python interpreter python->init(); - if (!python->has_minimum_version(3, 6)) { - error->all(FLERR, "Invalid Python version.\n" - "The kim-property Python package requires Python " - "3 >= 3.6 support."); - } + if (!python->has_minimum_version(3, 6)) + error->all(FLERR, "Invalid Python version.\nThe kim-property Python " + "package requires Python 3 >= 3.6 support"); } void KimProperty::command(int narg, char **arg) { #if LMP_PYTHON #if PY_MAJOR_VERSION >= 3 - if (narg < 2) - error->all(FLERR, "Invalid kim_property command."); - + if (narg < 2) error->all(FLERR, "Invalid 'kim property' command"); if (!(strcmp(arg[0], "create") == 0) && !(strcmp(arg[0], "destroy") == 0) && !(strcmp(arg[0], "modify") == 0) && !(strcmp(arg[0], "remove") == 0) && !(strcmp(arg[0], "dump") == 0)) { - std::string msg("Incorrect arguments in kim_property command.\n"); - msg += "'kim_property create/destroy/modify/remove/dump' "; - msg += "is mandatory."; + std::string msg("Incorrect arguments in 'kim property' command.\n"); + msg += "'kim property create/destroy/modify/remove/dump' is mandatory"; error->all(FLERR, msg); } - input->write_echo("#=== kim-property ===========================================\n"); + input->write_echo("#=== kim property =====================================" + "======\n"); // Get the kim_str ptr to the data associated with a kim_property_str // variable @@ -115,18 +111,18 @@ void KimProperty::command(int narg, char **arg) PyObject *obj = PyUnicode_FromString("kim_property"); if (!obj) { PyGILState_Release(gstate); - error->all(FLERR, "Creating a 'PyObject'!"); + error->all(FLERR, "Failed to create a 'PyObject'"); } kim_property = PyImport_Import(obj); if (!kim_property) { PyGILState_Release(gstate); - error->all(FLERR, "Unable to import Python kim_property module!" - "\nkim-property Python package can be installed " - "with pip:\n'pip install kim-property'\n" - "See the installation instructions at\n" - "https://github.com/openkim/kim-property#installing-kim-property\n" - "for detailed information."); + std::string msg("Unable to import Python kim_property module!"); + msg += "\nkim-property Python package can be installed with pip:\n"; + msg += "'pip install kim-property'\nSee the installation instructions "; + msg += "at\nhttps://github.com/openkim/kim-property#installing-kim-"; + msg += "property\nfor detailed information"; + error->all(FLERR, msg); } // Decrementing of the reference count @@ -137,7 +133,7 @@ void KimProperty::command(int narg, char **arg) if (strcmp(arg[0], "create") == 0) { if (narg != 3) { PyGILState_Release(gstate); - error->all(FLERR, "Invalid 'kim_property create' command."); + error->all(FLERR, "Invalid 'kim property create' command"); } int const ID = utils::inumeric(FLERR, arg[1], true, lmp); @@ -151,8 +147,9 @@ void KimProperty::command(int narg, char **arg) PyObject_GetAttrString(kim_property, "kim_property_create"); if (!pFunc) { PyGILState_Release(gstate); - error->all(FLERR, "Unable to get an attribute named " - "'kim_property_create' from a kim_property object!"); + std::string msg("Unable to get an attribute named "); + msg += "'kim_property_create' from a kim_property object"; + error->all(FLERR, msg); } // Decrementing of the reference count @@ -162,7 +159,7 @@ void KimProperty::command(int narg, char **arg) PyObject *pArgs = PyTuple_New(nSize); if (!pArgs) { PyGILState_Release(gstate); - error->all(FLERR, "Could not create Python function arguments."); + error->all(FLERR, "Could not create Python function arguments"); } // Python object to set the tuple @@ -185,15 +182,16 @@ void KimProperty::command(int narg, char **arg) if (!pValue) { PyErr_Print(); PyGILState_Release(gstate); - error->one(FLERR, "Python 'kim_property_create' function " - "evaluation failed!"); + std::string msg("Python 'kim_property_create' function "); + msg += "evaluation failed"; + error->one(FLERR, msg); } // Python function returned a string value const char *pystr = PyUnicode_AsUTF8(pValue); if (kim_str) input->variable->set_string("kim_property_str", pystr); - else input->variable->set(std::string("kim_property_str string '") - + pystr + std::string("'")); + else + input->variable->set(fmt::format("kim_property_str string '{}'", pystr)); Py_XDECREF(pArgs); Py_XDECREF(pFunc); @@ -201,7 +199,7 @@ void KimProperty::command(int narg, char **arg) } else if (strcmp(arg[0], "destroy") == 0) { if (narg != 2) { PyGILState_Release(gstate); - error->all(FLERR, "Invalid 'kim_property destroy' command."); + error->all(FLERR, "Invalid 'kim property destroy' command"); } if (!kim_str) { @@ -212,13 +210,15 @@ void KimProperty::command(int narg, char **arg) int const ID = utils::inumeric(FLERR, arg[1], true, lmp); // Python function - // This is the equivalent of the Python expression kim_property.kim_property_destroy + // This is the equivalent of the Python expression + // kim_property.kim_property_destroy PyObject *pFunc = PyObject_GetAttrString(kim_property, "kim_property_destroy"); if (!pFunc) { PyGILState_Release(gstate); - error->all(FLERR, "Unable to get an attribute named " - "'kim_property_destroy' from a kim_property object!"); + std::string msg("Unable to get an attribute named "); + msg += "'kim_property_destroy' from a kim_property object"; + error->all(FLERR, msg); } // Decrementing of the reference count @@ -228,7 +228,7 @@ void KimProperty::command(int narg, char **arg) PyObject *pArgs = PyTuple_New(2); if (!pArgs) { PyGILState_Release(gstate); - error->all(FLERR, "Could not create Python function arguments."); + error->all(FLERR, "Could not create Python function arguments"); } // Python object to set the tuple @@ -244,8 +244,9 @@ void KimProperty::command(int narg, char **arg) if (!pValue) { PyErr_Print(); PyGILState_Release(gstate); - error->one(FLERR, "Python 'kim_property_destroy' function " - "evaluation failed!"); + std::string msg("Python 'kim_property_destroy' function "); + msg += "evaluation failed"; + error->one(FLERR, msg); } // Python function returned a string value @@ -258,13 +259,12 @@ void KimProperty::command(int narg, char **arg) } else if (strcmp(arg[0], "modify") == 0) { if (narg < 6) { PyGILState_Release(gstate); - error->all(FLERR, "Invalid 'kim_property modify' command."); + error->all(FLERR, "Invalid 'kim property modify' command"); } if (!kim_str) { PyGILState_Release(gstate); - error->all(FLERR, "There is no property instance to modify " - "the content."); + error->all(FLERR, "There is no property instance to modify the content"); } int const ID = utils::inumeric(FLERR, arg[1], true, lmp); @@ -276,8 +276,9 @@ void KimProperty::command(int narg, char **arg) PyObject_GetAttrString(kim_property, "kim_property_modify"); if (!pFunc) { PyGILState_Release(gstate); - error->all(FLERR, "Unable to get an attribute named " - "'kim_property_modify' from a kim_property object!"); + std::string msg("Unable to get an attribute named "); + msg += "'kim_property_modify' from a kim_property object"; + error->all(FLERR, msg); } // Decrementing of the reference count @@ -287,7 +288,7 @@ void KimProperty::command(int narg, char **arg) PyObject *pArgs = PyTuple_New(static_cast(narg)); if (!pArgs) { PyGILState_Release(gstate); - error->all(FLERR, "Could not create Python function arguments."); + error->all(FLERR, "Could not create Python function arguments"); } // Python object to set the tuple @@ -308,8 +309,9 @@ void KimProperty::command(int narg, char **arg) if (!pValue) { PyErr_Print(); PyGILState_Release(gstate); - error->one(FLERR, "Python 'kim_property_modify' function " - "evaluation failed!"); + std::string msg("Python 'kim_property_modify' function "); + msg += "evaluation failed"; + error->one(FLERR, msg); } // Python function returned a string value @@ -322,13 +324,12 @@ void KimProperty::command(int narg, char **arg) } else if (strcmp(arg[0], "remove") == 0) { if (narg < 4) { PyGILState_Release(gstate); - error->all(FLERR, "Invalid 'kim_property remove' command."); + error->all(FLERR, "Invalid 'kim property remove' command"); } if (!kim_str) { PyGILState_Release(gstate); - error->all(FLERR, "There is no property instance to remove " - "the content."); + error->all(FLERR, "There is no property instance to remove the content"); } int const ID = utils::inumeric(FLERR, arg[1], true, lmp); @@ -340,8 +341,9 @@ void KimProperty::command(int narg, char **arg) PyObject_GetAttrString(kim_property, "kim_property_remove"); if (!pFunc) { PyGILState_Release(gstate); - error->all(FLERR, "Unable to get an attribute named " - "'kim_property_remove' from a kim_property object!"); + std::string msg("Unable to get an attribute named "); + msg += "'kim_property_remove' from a kim_property object"; + error->all(FLERR, msg); } // Decrementing of the reference count @@ -351,7 +353,7 @@ void KimProperty::command(int narg, char **arg) PyObject *pArgs = PyTuple_New(static_cast(narg)); if (!pArgs) { PyGILState_Release(gstate); - error->all(FLERR, "Could not create Python function arguments."); + error->all(FLERR, "Could not create Python function arguments"); } // Python object to set the tuple @@ -372,8 +374,9 @@ void KimProperty::command(int narg, char **arg) if (!pValue) { PyErr_Print(); PyGILState_Release(gstate); - error->one(FLERR, "Python 'kim_property_remove' function " - "evaluation failed!"); + std::string msg("Python 'kim_property_remove' function "); + msg += "evaluation failed"; + error->one(FLERR, msg); } // Python function returned a string value @@ -386,13 +389,12 @@ void KimProperty::command(int narg, char **arg) } else if (strcmp(arg[0], "dump") == 0) { if (narg != 2) { PyGILState_Release(gstate); - error->all(FLERR, "Invalid 'kim_property dump' command."); + error->all(FLERR, "Invalid 'kim property dump' command"); } if (!kim_str) { PyGILState_Release(gstate); - error->all(FLERR, "There is no property instance to dump " - "the content."); + error->all(FLERR, "There is no property instance to dump the content."); } // Python function @@ -402,8 +404,9 @@ void KimProperty::command(int narg, char **arg) PyObject_GetAttrString(kim_property, "kim_property_dump"); if (!pFunc) { PyGILState_Release(gstate); - error->all(FLERR, "Unable to get an attribute named " - "'kim_property_dump' from a kim_property object!"); + std::string msg("Unable to get an attribute named "); + msg += "'kim_property_dump' from a kim_property object"; + error->all(FLERR, msg); } // Decrementing of the reference count @@ -413,7 +416,7 @@ void KimProperty::command(int narg, char **arg) PyObject *pArgs = PyTuple_New(2); if (!pArgs) { PyGILState_Release(gstate); - error->all(FLERR, "Could not create Python function arguments."); + error->all(FLERR, "Could not create Python function arguments"); } // Python object to set the tuple @@ -430,8 +433,9 @@ void KimProperty::command(int narg, char **arg) if (!pValue) { PyErr_Print(); PyGILState_Release(gstate); - error->one(FLERR, "Python 'kim_property_dump' function " - "evaluation failed!"); + std::string msg("Python 'kim_property_dump' function "); + msg += "evaluation failed"; + error->one(FLERR, msg); } } else pValue = nullptr; From 7d7c433fd7c815fed0d3a519ffa2cbca6002cfd4 Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 05:54:33 -0600 Subject: [PATCH 237/384] update the error messages to 'kim query' and clean up the code --- src/KIM/kim_query.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/KIM/kim_query.cpp b/src/KIM/kim_query.cpp index faf1d26909..ef4b7572d3 100644 --- a/src/KIM/kim_query.cpp +++ b/src/KIM/kim_query.cpp @@ -96,9 +96,9 @@ static size_t write_callback(void *, size_t, size_t, void *); void KimQuery::command(int narg, char **arg) { - if (narg < 2) error->all(FLERR,"Illegal kim_query command"); + if (narg < 2) error->all(FLERR,"Illegal 'kim query' command"); - // check if we had a kim_init command by finding fix STORE/KIM + // check if we had a kim init command by finding fix STORE/KIM // retrieve model name. char *model_name; @@ -106,17 +106,17 @@ void KimQuery::command(int narg, char **arg) if (ifix >= 0) { FixStoreKIM *fix_store = (FixStoreKIM *) modify->fix[ifix]; model_name = (char *)fix_store->getptr("model_name"); - } else error->all(FLERR,"Must use 'kim_init' before 'kim_query'"); + } else error->all(FLERR,"Must use 'kim init' before 'kim query'"); char *varname = arg[0]; bool split = false; if (strcmp("split",arg[1]) == 0) { - if (narg == 2) error->all(FLERR,"Illegal kim_query command.\nThe keyword " + if (narg == 2) error->all(FLERR,"Illegal 'kim query' command.\nThe keyword " "'split' must be followed by the name of " "the query function"); if (strcmp("list",arg[2]) == 0) - error->all(FLERR,"Illegal kim_query command.\nThe 'list' keyword " + error->all(FLERR,"Illegal 'kim query' command.\nThe 'list' keyword " "can not be used after 'split'"); split = true; arg++; @@ -126,7 +126,7 @@ void KimQuery::command(int narg, char **arg) // The “list” is the default setting // the result is returned as a space-separated list of values in variable if (strcmp("list",arg[1]) == 0) { - if (narg == 2) error->all(FLERR,"Illegal kim_query command.\nThe 'list' " + if (narg == 2) error->all(FLERR,"Illegal 'kim query' command.\nThe 'list' " "keyword must be followed by ('split' " "and) the name of the query function"); arg++; @@ -136,11 +136,11 @@ void KimQuery::command(int narg, char **arg) char *function = arg[1]; for (int i = 2; i < narg; ++i) { if (strncmp("model=",arg[i],6) == 0) - error->all(FLERR,"Illegal 'model' key in kim_query command"); + error->all(FLERR,"Illegal 'model' key in 'kim query' command"); if (!strchr(arg[i], '=') || !strchr(arg[i], '[') || !strchr(arg[i], ']')) error->all(FLERR,fmt::format("Illegal query format.\nInput argument of " - "`{}` to kim_query is wrong. The query " + "`{}` to 'kim query' is wrong. The query " "format is the keyword=[value], where value " "is always an array of one or more " "comma-separated items", arg[i])); @@ -161,7 +161,8 @@ void KimQuery::command(int narg, char **arg) error->all(FLERR,fmt::format("OpenKIM query returned no results")); } - input->write_echo("#=== BEGIN kim-query =========================================\n"); + input->write_echo("#=== BEGIN kim query ==================================" + "=======\n"); ValueTokenizer values(value, ","); if (split) { int counter = 1; @@ -182,11 +183,12 @@ void KimQuery::command(int narg, char **arg) input->variable->set(setcmd); input->write_echo(fmt::format("variable {}\n", setcmd)); } - input->write_echo("#=== END kim-query ===========================================\n\n"); + input->write_echo("#=== END kim query ====================================" + "=======\n\n"); delete[] value; #else - error->all(FLERR,"Cannot use 'kim_query' command when KIM package " + error->all(FLERR,"Cannot use 'kim query' command when KIM package " "is compiled without support for libcurl"); #endif } @@ -292,7 +294,7 @@ char *do_query(char *qfunction, char * model_name, int narg, char **arg, } } - std::string user_agent = fmt::format("kim_query--LAMMPS/{} ({})", + std::string user_agent = fmt::format("kim query--LAMMPS/{} ({})", LAMMPS_VERSION, Info::get_os_info()); curl_easy_setopt(handle, CURLOPT_USERAGENT, user_agent.c_str()); From 6769ded03c87aebabe773d5777b31908e2f88bf5 Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 05:55:36 -0600 Subject: [PATCH 238/384] update the unittests with the latest interface changes --- unittest/commands/test_kim_commands.cpp | 334 ++++++++++++------------ 1 file changed, 173 insertions(+), 161 deletions(-) diff --git a/unittest/commands/test_kim_commands.cpp b/unittest/commands/test_kim_commands.cpp index 275a9eae3a..5ea458de59 100644 --- a/unittest/commands/test_kim_commands.cpp +++ b/unittest/commands/test_kim_commands.cpp @@ -79,31 +79,51 @@ protected: } }; +TEST_F(KimCommandsTest, kim) +{ + if (!LAMMPS::is_installed_pkg("KIM")) GTEST_SKIP(); + + TEST_FAILURE(".*ERROR: Illegal kim command.*", + lmp->input->one("kim");); + TEST_FAILURE(".*ERROR: Unknown kim subcommand.*", + lmp->input->one("kim unknown");); + TEST_FAILURE(".*ERROR: Unknown command: kim_init.*", + lmp->input->one("kim_init");); + TEST_FAILURE(".*ERROR: Unknown command: kim_interactions.*", + lmp->input->one("kim_interactions");); + TEST_FAILURE(".*ERROR: Unknown command: kim_param.*", + lmp->input->one("kim_param");); + TEST_FAILURE(".*ERROR: Unknown command: kim_property.*", + lmp->input->one("kim_property");); + TEST_FAILURE(".*ERROR: Unknown command: kim_query.*", + lmp->input->one("kim_query");); +} + TEST_F(KimCommandsTest, kim_init) { if (!LAMMPS::is_installed_pkg("KIM")) GTEST_SKIP(); - TEST_FAILURE(".*ERROR: Illegal kim_init command.*", - lmp->input->one("kim_init");); - TEST_FAILURE(".*ERROR: Illegal kim_init command.*", - lmp->input->one("kim_init LennardJones_Ar real si");); + TEST_FAILURE(".*ERROR: Illegal 'kim init' command.*", + lmp->input->one("kim init");); + TEST_FAILURE(".*ERROR: Illegal 'kim init' command.*", + lmp->input->one("kim init LennardJones_Ar real si");); TEST_FAILURE(".*ERROR: LAMMPS unit_style lj not supported by KIM models.*", - lmp->input->one("kim_init LennardJones_Ar lj");); + lmp->input->one("kim init LennardJones_Ar lj");); TEST_FAILURE(".*ERROR: LAMMPS unit_style micro not supported by KIM models.*", - lmp->input->one("kim_init LennardJones_Ar micro");); + lmp->input->one("kim init LennardJones_Ar micro");); TEST_FAILURE(".*ERROR: LAMMPS unit_style nano not supported by KIM models.*", - lmp->input->one("kim_init LennardJones_Ar nano");); + lmp->input->one("kim init LennardJones_Ar nano");); TEST_FAILURE(".*ERROR: Unknown unit_style.*", - lmp->input->one("kim_init LennardJones_Ar new_style");); + lmp->input->one("kim init LennardJones_Ar new_style");); TEST_FAILURE(".*ERROR: KIM Model name not found.*", - lmp->input->one("kim_init Unknown_Model real");); + lmp->input->one("kim init Unknown_Model real");); TEST_FAILURE(".*ERROR: Incompatible units for KIM Simulator Model, required units = metal.*", - lmp->input->one("kim_init Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu real");); + lmp->input->one("kim init Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu real");); // TEST_FAILURE(".*ERROR: KIM Model does not support the requested unit system.*", - // lmp->input->one("kim_init ex_model_Ar_P_Morse real");); + // lmp->input->one("kim init ex_model_Ar_P_Morse real");); if (!verbose) ::testing::internal::CaptureStdout(); - lmp->input->one("kim_init LennardJones_Ar real"); + lmp->input->one("kim init LennardJones_Ar real"); if (!verbose) ::testing::internal::GetCapturedStdout(); int ifix = lmp->modify->find_fix("KIM_MODEL_STORE"); @@ -114,27 +134,27 @@ TEST_F(KimCommandsTest, kim_interactions) { if (!LAMMPS::is_installed_pkg("KIM")) GTEST_SKIP(); - TEST_FAILURE(".*ERROR: Illegal kim_interactions command.*", - lmp->input->one("kim_interactions");); + TEST_FAILURE(".*ERROR: Illegal 'kim interactions' command.*", + lmp->input->one("kim interactions");); if (!verbose) ::testing::internal::CaptureStdout(); - lmp->input->one("kim_init LennardJones_Ar real"); + lmp->input->one("kim init LennardJones_Ar real"); if (!verbose) ::testing::internal::GetCapturedStdout(); - TEST_FAILURE(".*ERROR: Must use 'kim_interactions' command " + TEST_FAILURE(".*ERROR: Must use 'kim interactions' command " "after simulation box is defined.*", - lmp->input->one("kim_interactions Ar");); + lmp->input->one("kim interactions Ar");); if (!verbose) ::testing::internal::CaptureStdout(); - lmp->input->one("kim_init LennardJones_Ar real"); + lmp->input->one("kim init LennardJones_Ar real"); lmp->input->one("lattice fcc 4.4300"); lmp->input->one("region box block 0 10 0 10 0 10"); lmp->input->one("create_box 1 box"); lmp->input->one("create_atoms 1 box"); if (!verbose) ::testing::internal::GetCapturedStdout(); - TEST_FAILURE(".*ERROR: Illegal kim_interactions command.*", - lmp->input->one("kim_interactions Ar Ar");); + TEST_FAILURE(".*ERROR: Illegal 'kim interactions' command.*", + lmp->input->one("kim interactions Ar Ar");); if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); @@ -144,8 +164,8 @@ TEST_F(KimCommandsTest, kim_interactions) lmp->input->one("create_atoms 4 box"); if (!verbose) ::testing::internal::GetCapturedStdout(); - TEST_FAILURE(".*ERROR: Illegal kim_interactions command.*", - lmp->input->one("kim_interactions Ar Ar");); + TEST_FAILURE(".*ERROR: Illegal 'kim interactions' command.*", + lmp->input->one("kim interactions Ar Ar");); if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); @@ -155,12 +175,12 @@ TEST_F(KimCommandsTest, kim_interactions) lmp->input->one("create_atoms 1 box"); if (!verbose) ::testing::internal::GetCapturedStdout(); - TEST_FAILURE(".*ERROR: Must use 'kim_init' before 'kim_interactions'.*", - lmp->input->one("kim_interactions Ar");); + TEST_FAILURE(".*ERROR: Must use 'kim init' before 'kim interactions'.*", + lmp->input->one("kim interactions Ar");); if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); - lmp->input->one("kim_init LennardJones_Ar real"); + lmp->input->one("kim init LennardJones_Ar real"); lmp->input->one("lattice fcc 4.4300"); lmp->input->one("region box block 0 10 0 10 0 10"); lmp->input->one("create_box 1 box"); @@ -168,7 +188,7 @@ TEST_F(KimCommandsTest, kim_interactions) if (!verbose) ::testing::internal::GetCapturedStdout(); TEST_FAILURE(".*ERROR: fixed_types cannot be used with a KIM Portable Model.*", - lmp->input->one("kim_interactions fixed_types");); + lmp->input->one("kim interactions fixed_types");); if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); @@ -181,7 +201,7 @@ TEST_F(KimCommandsTest, kim_interactions) if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); - lmp->input->one("kim_init Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu metal"); + lmp->input->one("kim init Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu metal"); lmp->input->one("lattice fcc 4.920"); lmp->input->one("region box block 0 10 0 10 0 10"); lmp->input->one("create_box 1 box"); @@ -189,31 +209,31 @@ TEST_F(KimCommandsTest, kim_interactions) if (!verbose) ::testing::internal::GetCapturedStdout(); TEST_FAILURE(".*ERROR: Species 'Ar' is not supported by this KIM Simulator Model.*", - lmp->input->one("kim_interactions Ar");); + lmp->input->one("kim interactions Ar");); if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); - lmp->input->one("kim_init Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu metal"); + lmp->input->one("kim init Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu metal"); lmp->input->one("lattice fcc 4.08"); lmp->input->one("region box block 0 10 0 10 0 10"); lmp->input->one("create_box 1 box"); lmp->input->one("create_atoms 1 box"); - lmp->input->one("kim_interactions Au"); + lmp->input->one("kim interactions Au"); if (!verbose) ::testing::internal::GetCapturedStdout(); // ASSERT_EQ(lmp->output->var_kim_periodic, 1); // TEST_FAILURE(".*ERROR: Incompatible units for KIM Simulator Model.*", - // lmp->input->one("kim_interactions Au");); + // lmp->input->one("kim interactions Au");); if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); - lmp->input->one("kim_init LennardJones_Ar real"); + lmp->input->one("kim init LennardJones_Ar real"); lmp->input->one("lattice fcc 4.4300"); lmp->input->one("region box block 0 10 0 10 0 10"); lmp->input->one("create_box 1 box"); lmp->input->one("create_atoms 1 box"); - lmp->input->one("kim_interactions Ar"); + lmp->input->one("kim interactions Ar"); lmp->input->one("mass 1 39.95"); if (!verbose) ::testing::internal::GetCapturedStdout(); @@ -222,15 +242,15 @@ TEST_F(KimCommandsTest, kim_interactions) if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); - lmp->input->one("kim_init LennardJones_Ar real"); + lmp->input->one("kim init LennardJones_Ar real"); lmp->input->one("lattice fcc 4.4300"); lmp->input->one("region box block 0 10 0 10 0 10"); lmp->input->one("create_box 1 box"); lmp->input->one("create_atoms 1 box"); - lmp->input->one("kim_interactions Ar"); + lmp->input->one("kim interactions Ar"); lmp->input->one("mass 1 39.95"); lmp->input->one("run 1"); - lmp->input->one("kim_interactions Ar"); + lmp->input->one("kim interactions Ar"); lmp->input->one("run 1"); if (!verbose) ::testing::internal::GetCapturedStdout(); } @@ -239,94 +259,95 @@ TEST_F(KimCommandsTest, kim_param) { if (!LAMMPS::is_installed_pkg("KIM")) GTEST_SKIP(); - TEST_FAILURE(".*ERROR: Illegal kim_param command.*", lmp->input->one("kim_param");); - TEST_FAILURE(".*ERROR: Incorrect arguments in kim_param command.\n" - "'kim_param get/set' is mandatory.*", - lmp->input->one("kim_param unknown shift 1 shift");); - TEST_FAILURE(".*ERROR: Must use 'kim_init' before 'kim_param'.*", - lmp->input->one("kim_param get shift 1 shift");); + TEST_FAILURE(".*ERROR: Illegal 'kim param' command.*", + lmp->input->one("kim param");); + TEST_FAILURE(".*ERROR: Incorrect arguments in 'kim param' command.\n" + "'kim param get/set' is mandatory.*", + lmp->input->one("kim param unknown shift 1 shift");); + TEST_FAILURE(".*ERROR: Must use 'kim init' before 'kim param'.*", + lmp->input->one("kim param get shift 1 shift");); if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); - lmp->input->one("kim_init Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu metal"); + lmp->input->one("kim init Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu metal"); if (!verbose) ::testing::internal::GetCapturedStdout(); - TEST_FAILURE(".*ERROR: kim_param can only be used with a KIM Portable Model.*", - lmp->input->one("kim_param get shift 1 shift");); + TEST_FAILURE(".*ERROR: 'kim param' can only be used with a KIM Portable Model.*", + lmp->input->one("kim param get shift 1 shift");); if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); - lmp->input->one("kim_init LennardJones612_UniversalShifted__MO_959249795837_003 real"); + lmp->input->one("kim init LennardJones612_UniversalShifted__MO_959249795837_003 real"); if (!verbose) ::testing::internal::GetCapturedStdout(); TEST_FAILURE(".*ERROR: Illegal index '0' for " "'shift' parameter with the extent of '1'.*", - lmp->input->one("kim_param get shift 0 shift");); + lmp->input->one("kim param get shift 0 shift");); TEST_FAILURE(".*ERROR: Illegal index '2' for " "'shift' parameter with the extent of '1'.*", - lmp->input->one("kim_param get shift 2 shift");); + lmp->input->one("kim param get shift 2 shift");); TEST_FAILURE(".*ERROR: Illegal index_range.\nExpected integer " "parameter\\(s\\) instead of '1.' in index_range.*", - lmp->input->one("kim_param get shift 1. shift");); + lmp->input->one("kim param get shift 1. shift");); TEST_FAILURE(".*ERROR: Illegal index_range '1-2' for 'shift' " "parameter with the extent of '1'.*", - lmp->input->one("kim_param get shift 1:2 shift");); + lmp->input->one("kim param get shift 1:2 shift");); TEST_FAILURE(".*ERROR: Illegal index_range.\nExpected integer " "parameter\\(s\\) instead of '1-2' in index_range.*", - lmp->input->one("kim_param get shift 1-2 shift");); - TEST_FAILURE(".*ERROR: Wrong number of arguments in 'kim_param " + lmp->input->one("kim param get shift 1-2 shift");); + TEST_FAILURE(".*ERROR: Wrong number of arguments in 'kim param " "get' command.\nThe LAMMPS '3' variable names or " "'s1 split' is mandatory.*", - lmp->input->one("kim_param get sigmas 1:3 s1 s2");); - TEST_FAILURE(".*ERROR: Wrong argument in kim_param get command.\nThis " + lmp->input->one("kim param get sigmas 1:3 s1 s2");); + TEST_FAILURE(".*ERROR: Wrong argument in 'kim param get' command.\nThis " "Model does not have the requested 'unknown' parameter.*", - lmp->input->one("kim_param get unknown 1 unknown");); - TEST_FAILURE(".*ERROR: Wrong 'kim_param set' command.\n" + lmp->input->one("kim param get unknown 1 unknown");); + TEST_FAILURE(".*ERROR: Wrong 'kim param set' command.\n" "To set the new parameter values, pair style must " - "be assigned.\nMust use 'kim_interactions' or" - "'pair_style kim' before 'kim_param set'.*", - lmp->input->one("kim_param set shift 1 2");); + "be assigned.\nMust use 'kim interactions' or" + "'pair_style kim' before 'kim param set'.*", + lmp->input->one("kim param set shift 1 2");); if (!verbose) ::testing::internal::CaptureStdout(); - lmp->input->one("kim_param get shift 1 shift"); + lmp->input->one("kim param get shift 1 shift"); if (!verbose) ::testing::internal::GetCapturedStdout(); ASSERT_FALSE(lmp->input->variable->find("shift") == -1); - ASSERT_TRUE(std::string(lmp->input->variable->retrieve("shift")) == std::string("1")); + ASSERT_TRUE(std::string(lmp->input->variable->retrieve("shift")) == "1"); if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); - lmp->input->one("kim_init LennardJones612_UniversalShifted__MO_959249795837_003 real"); + lmp->input->one("kim init LennardJones612_UniversalShifted__MO_959249795837_003 real"); lmp->input->one("lattice fcc 4.4300"); lmp->input->one("region box block 0 10 0 10 0 10"); lmp->input->one("create_box 1 box"); lmp->input->one("create_atoms 1 box"); - lmp->input->one("kim_interactions Ar"); + lmp->input->one("kim interactions Ar"); lmp->input->one("mass 1 39.95"); if (!verbose) ::testing::internal::GetCapturedStdout(); TEST_FAILURE(".*ERROR: Illegal index '2' for " "'shift' parameter with the extent of '1'.*", - lmp->input->one("kim_param set shift 2 2");); + lmp->input->one("kim param set shift 2 2");); TEST_FAILURE(".*ERROR: Illegal index_range.\nExpected integer " "parameter\\(s\\) instead of '1.' in index_range.*", - lmp->input->one("kim_param set shift 1. shift");); + lmp->input->one("kim param set shift 1. shift");); TEST_FAILURE(".*ERROR: Illegal index_range '1-2' for " "'shift' parameter with the extent of '1'.*", - lmp->input->one("kim_param set shift 1:2 2");); + lmp->input->one("kim param set shift 1:2 2");); TEST_FAILURE(".*ERROR: Wrong number of variable values for pair coefficients.*", - lmp->input->one("kim_param set sigmas 1:3 0.5523570 0.4989030");); + lmp->input->one("kim param set sigmas 1:3 0.5523570 0.4989030");); TEST_FAILURE(".*ERROR: Wrong argument for pair coefficients.\nThis " "Model does not have the requested '0.4989030' parameter.*", - lmp->input->one("kim_param set sigmas 1:1 0.5523570 0.4989030");); + lmp->input->one("kim param set sigmas 1:1 0.5523570 0.4989030");); if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("variable new_shift equal 2"); - lmp->input->one("kim_param set shift 1 ${new_shift}"); - lmp->input->one("kim_param get shift 1 shift"); + lmp->input->one("kim param set shift 1 ${new_shift}"); + lmp->input->one("kim param get shift 1 shift"); if (!verbose) ::testing::internal::GetCapturedStdout(); - ASSERT_TRUE(std::string(lmp->input->variable->retrieve("shift")) == std::string("2")); + ASSERT_TRUE(std::string(lmp->input->variable->retrieve("shift")) == "2"); } TEST_F(KimCommandsTest, kim_property) @@ -338,168 +359,159 @@ TEST_F(KimCommandsTest, kim_property) TEST_FAILURE(".*ERROR: Invalid Python version.\n" "The kim-property Python package requires Python " "3 >= 3.6 support.*", - lmp->input->one("kim_property");); + lmp->input->one("kim property");); } else { - TEST_FAILURE(".*ERROR: Invalid kim_property command.*", - lmp->input->one("kim_property");); - TEST_FAILURE(".*ERROR: Invalid kim_property command.*", - lmp->input->one("kim_property create");); - TEST_FAILURE(".*ERROR: Incorrect arguments in kim_property command.\n" - "'kim_property create/destroy/modify/remove/dump' " + TEST_FAILURE(".*ERROR: Invalid 'kim property' command.*", + lmp->input->one("kim property");); + TEST_FAILURE(".*ERROR: Invalid 'kim property' command.*", + lmp->input->one("kim property create");); + TEST_FAILURE(".*ERROR: Incorrect arguments in 'kim property' command." + "\n'kim property create/destroy/modify/remove/dump' " "is mandatory.*", - lmp->input->one("kim_property unknown 1 atomic-mass");); + lmp->input->one("kim property unknown 1 atomic-mass");); } #if defined(KIM_EXTRA_UNITTESTS) - TEST_FAILURE(".*ERROR: Invalid 'kim_property create' command.*", - lmp->input->one("kim_property create 1");); - TEST_FAILURE(".*ERROR: Invalid 'kim_property destroy' command.*", - lmp->input->one("kim_property destroy 1 cohesive-potential-energy-cubic-crystal");); - TEST_FAILURE(".*ERROR: Invalid 'kim_property modify' command.*", - lmp->input->one("kim_property modify 1 key short-name");); - TEST_FAILURE(".*ERROR: There is no property instance to modify the content.*", - lmp->input->one("kim_property modify 1 key short-name source-value 1 fcc");); - TEST_FAILURE(".*ERROR: Invalid 'kim_property remove' command.*", - lmp->input->one("kim_property remove 1 key");); - TEST_FAILURE(".*ERROR: There is no property instance to remove the content.*", - lmp->input->one("kim_property remove 1 key short-name");); - TEST_FAILURE(".*ERROR: There is no property instance to dump the content.*", - lmp->input->one("kim_property dump results.edn");); - if (!verbose) ::testing::internal::CaptureStdout(); - lmp->input->one("clear"); - lmp->input->one("kim_init LennardJones612_UniversalShifted__MO_959249795837_003 real"); - lmp->input->one("kim_property create 1 cohesive-potential-energy-cubic-crystal"); - lmp->input->one("kim_property modify 1 key short-name source-value 1 fcc"); - lmp->input->one("kim_property destroy 1"); - if (!verbose) ::testing::internal::GetCapturedStdout(); + TEST_FAILURE(".*ERROR: Invalid 'kim property create' command.*", + lmp->input->one("kim property create 1");); + TEST_FAILURE(".*ERROR: Invalid 'kim property destroy' command.*", + lmp->input->one("kim property destroy 1 cohesive-potential-energy-cubic-crystal");); + TEST_FAILURE(".*ERROR: Invalid 'kim property modify' command.*", + lmp->input->one("kim property modify 1 key short-name");); + TEST_FAILURE(".*ERROR: There is no property instance to modify the content.*", + lmp->input->one("kim property modify 1 key short-name source-value 1 fcc");); + TEST_FAILURE(".*ERROR: Invalid 'kim property remove' command.*", + lmp->input->one("kim property remove 1 key");); + TEST_FAILURE(".*ERROR: There is no property instance to remove the content.*", + lmp->input->one("kim property remove 1 key short-name");); + TEST_FAILURE(".*ERROR: There is no property instance to dump the content.*", + lmp->input->one("kim property dump results.edn");); + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("clear"); + lmp->input->one("kim init LennardJones612_UniversalShifted__MO_959249795837_003 real"); + lmp->input->one("kim property create 1 cohesive-potential-energy-cubic-crystal"); + lmp->input->one("kim property modify 1 key short-name source-value 1 fcc"); + lmp->input->one("kim property destroy 1"); + if (!verbose) ::testing::internal::GetCapturedStdout(); #endif } TEST_F(KimCommandsTest, kim_query) { if (!LAMMPS::is_installed_pkg("KIM")) GTEST_SKIP(); - - TEST_FAILURE(".*ERROR: Illegal kim_query command.*", - lmp->input->one("kim_query");); - TEST_FAILURE(".*ERROR: Must use 'kim_init' before 'kim_query'.*", - lmp->input->one("kim_query a0 get_lattice_constant_cubic");); + + TEST_FAILURE(".*ERROR: Illegal 'kim query' command.*", + lmp->input->one("kim query");); + TEST_FAILURE(".*ERROR: Must use 'kim init' before 'kim query'.*", + lmp->input->one("kim query a0 get_lattice_constant_cubic");); if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); - lmp->input->one("kim_init LennardJones612_UniversalShifted__MO_959249795837_003 real"); + lmp->input->one("kim init LennardJones612_UniversalShifted__MO_959249795837_003 real"); if (!verbose) ::testing::internal::GetCapturedStdout(); - TEST_FAILURE(".*ERROR: Illegal kim_query command.\nThe keyword 'split' " - "must be followed by the name of the query function.*", - lmp->input->one("kim_query a0 split");); - - TEST_FAILURE(".*ERROR: Illegal kim_query command.\nThe 'list' keyword " - "can not be used after 'split'.*", - lmp->input->one("kim_query a0 split list");); - - TEST_FAILURE(".*ERROR: Illegal kim_query command.\nThe 'list' keyword " + TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe keyword 'split' " + "must be followed by the name of the query function.*", + lmp->input->one("kim query a0 split");); + TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe 'list' keyword " + "can not be used after 'split'.*", + lmp->input->one("kim query a0 split list");); + TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe 'list' keyword " "must be followed by \\('split' and\\) the name of the query " - "function.*", lmp->input->one("kim_query a0 list");); - - TEST_FAILURE(".*ERROR: Illegal 'model' key in kim_query command.*", - lmp->input->one("kim_query a0 get_lattice_constant_cubic " + "function.*", lmp->input->one("kim query a0 list");); + TEST_FAILURE(".*ERROR: Illegal 'model' key in 'kim query' command.*", + lmp->input->one("kim query a0 get_lattice_constant_cubic " "model=[MO_959249795837_003]");); - TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `crystal` " - "to kim_query is wrong. The query format is the " + "to 'kim query' is wrong. The query format is the " "keyword=\\[value\\], where value is always an array of one " - "or more comma-separated items.*", - lmp->input->one("kim_query a0 get_lattice_constant_cubic " + "or more comma-separated items.*", + lmp->input->one("kim query a0 get_lattice_constant_cubic " "crystal");); - TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `" - "crystal=fcc` to kim_query is wrong. The query format is the " - "keyword=\\[value\\], where value is always an array of one " - "or more comma-separated items.*", - lmp->input->one("kim_query a0 get_lattice_constant_cubic " + "crystal=fcc` to 'kim query' is wrong. The query format is " + "the keyword=\\[value\\], where value is always an array of " + "one or more comma-separated items.*", + lmp->input->one("kim query a0 get_lattice_constant_cubic " "crystal=fcc");); - TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `" - "crystal=\\[fcc` to kim_query is wrong. The query format is " + "crystal=\\[fcc` to 'kim query' is wrong. The query format is " "the keyword=\\[value\\], where value is always an array of " - "one or more comma-separated items.*", - lmp->input->one("kim_query a0 get_lattice_constant_cubic " + "one or more comma-separated items.*", + lmp->input->one("kim query a0 get_lattice_constant_cubic " "crystal=[fcc");); - TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `" - "crystal=fcc\\]` to kim_query is wrong. The query format is " + "crystal=fcc\\]` to 'kim query' is wrong. The query format is " "the keyword=\\[value\\], where value is always an array of " - "one or more comma-separated items.*", - lmp->input->one("kim_query a0 get_lattice_constant_cubic " + "one or more comma-separated items.*", + lmp->input->one("kim query a0 get_lattice_constant_cubic " "crystal=fcc]");); - - std::string squery("kim_query a0 get_lattice_constant_cubic "); + + std::string squery("kim query a0 get_lattice_constant_cubic "); squery += "crystal=[\"fcc\"] species=\"Al\",\"Ni\" units=[\"angstrom\"]"; - TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `species=" - "\"Al\",\"Ni\"` to kim_query is wrong. The query format is " + "\"Al\",\"Ni\"` to 'kim query' is wrong. The query format is " "the keyword=\\[value\\], where value is always an array of " - "one or more comma-separated items.*", + "one or more comma-separated items.*", lmp->input->one(squery);); - squery = "kim_query a0 get_lattice_constant_cubic "; + squery = "kim query a0 get_lattice_constant_cubic "; squery += "crystal=[\"fcc\"] species=\"Al\",\"Ni\", units=[\"angstrom\"]"; - TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `species=" - "\"Al\",\"Ni\",` to kim_query is wrong. The query format is " + "\"Al\",\"Ni\",` to 'kim query' is wrong. The query format is " "the keyword=\\[value\\], where value is always an array of " - "one or more comma-separated items.*", + "one or more comma-separated items.*", lmp->input->one(squery);); - squery = "kim_query a0 get_lattice_constant_cubic crystal=[fcc] " + squery = "kim query a0 get_lattice_constant_cubic crystal=[fcc] " "species=[Al]"; TEST_FAILURE(".*ERROR: OpenKIM query failed:.*", lmp->input->one(squery);); - squery = "kim_query a0 get_lattice_constant_cubic crystal=[fcc] " + squery = "kim query a0 get_lattice_constant_cubic crystal=[fcc] " "units=[\"angstrom\"]"; TEST_FAILURE(".*ERROR: OpenKIM query failed:.*", lmp->input->one(squery);); #if defined(KIM_EXTRA_UNITTESTS) if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); - lmp->input->one("kim_init EAM_Dynamo_Mendelev_2007_Zr__MO_848899341753_000 metal"); - - squery = "kim_query latconst split get_lattice_constant_hexagonal "; + lmp->input->one("kim init EAM_Dynamo_Mendelev_2007_Zr__MO_848899341753_000 metal"); + + squery = "kim query latconst split get_lattice_constant_hexagonal "; squery += "crystal=[\"hcp\"] species=[\"Zr\"] units=[\"angstrom\"]"; lmp->input->one(squery); if (!verbose) ::testing::internal::GetCapturedStdout(); - ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst_1")) == + ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst_1")) == std::string("3.234055244384789"))); - ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst_2")) == + ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst_2")) == std::string("5.167650199630013"))); if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); - lmp->input->one("kim_init EAM_Dynamo_Mendelev_2007_Zr__MO_848899341753_000 metal"); - - squery = "kim_query latconst list get_lattice_constant_hexagonal "; + lmp->input->one("kim init EAM_Dynamo_Mendelev_2007_Zr__MO_848899341753_000 metal"); + + squery = "kim query latconst list get_lattice_constant_hexagonal "; squery += "crystal=[hcp] species=[Zr] units=[angstrom]"; lmp->input->one(squery); if (!verbose) ::testing::internal::GetCapturedStdout(); - ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst")) == + ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst")) == std::string("3.234055244384789 5.167650199630013"))); - squery = "kim_query latconst list get_lattice_constant_hexagonal "; + squery = "kim query latconst list get_lattice_constant_hexagonal "; squery += "crystal=[bcc] species=[Zr] units=[angstrom]"; TEST_FAILURE(".*ERROR: OpenKIM query failed:.*", lmp->input->one(squery);); if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); - lmp->input->one("kim_init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal"); - - squery = "kim_query alpha get_linear_thermal_expansion_coefficient_cubic "; + lmp->input->one("kim init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal"); + + squery = "kim query alpha get_linear_thermal_expansion_coefficient_cubic "; squery += "crystal=[fcc] species=[Al] units=[1/K] temperature=[293.15] "; squery += "temperature_units=[K]"; lmp->input->one(squery); if (!verbose) ::testing::internal::GetCapturedStdout(); - ASSERT_TRUE((std::string(lmp->input->variable->retrieve("alpha")) == + ASSERT_TRUE((std::string(lmp->input->variable->retrieve("alpha")) == std::string("1.654960564704273e-05"))); #endif } From 10a48f18d0db17682513c4315d54e73df16c1bf1 Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 08:03:21 -0600 Subject: [PATCH 239/384] update kim command examples --- examples/kim/in.kim-ex.melt | 42 +++++++++++----------- examples/kim/in.kim-pm-property | 58 +++++++++++++++---------------- examples/kim/in.kim-pm-query.melt | 44 +++++++++++------------ examples/kim/in.kim-pm.melt | 42 +++++++++++----------- examples/kim/in.kim-sm.melt | 44 +++++++++++------------ examples/kim/in.lammps.melt | 44 +++++++++++------------ 6 files changed, 137 insertions(+), 137 deletions(-) diff --git a/examples/kim/in.kim-ex.melt b/examples/kim/in.kim-ex.melt index 5cc3dbc61b..200e2c3dcd 100644 --- a/examples/kim/in.kim-ex.melt +++ b/examples/kim/in.kim-ex.melt @@ -1,35 +1,35 @@ # 3d Lennard-Jones melt # # This example requires that the example models provided with -# the kim-api package are installed. see the ./lib/kim/README or -# ./lib/kim/Install.py files for details on how to install these +# the kim-api package are installed. see the `./lib/kim/README` or +# `./lib/kim/Install.py` files for details on how to install these # example models. # -variable x index 1 -variable y index 1 -variable z index 1 +variable x index 1 +variable y index 1 +variable z index 1 -variable xx equal 20*$x -variable yy equal 20*$y -variable zz equal 20*$z +variable xx equal 20*$x +variable yy equal 20*$y +variable zz equal 20*$z -kim_init LennardJones_Ar real +kim init LennardJones_Ar real -lattice fcc 4.4300 -region box block 0 ${xx} 0 ${yy} 0 ${zz} -create_box 1 box -create_atoms 1 box +lattice fcc 4.4300 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +create_box 1 box +create_atoms 1 box -kim_interactions Ar +kim interactions Ar -mass 1 39.95 -velocity all create 200.0 232345 loop geom +mass 1 39.95 +velocity all create 200.0 232345 loop geom -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes -fix 1 all nve -#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 -run 100 +run 100 diff --git a/examples/kim/in.kim-pm-property b/examples/kim/in.kim-pm-property index fea1527820..d69879c728 100644 --- a/examples/kim/in.kim-pm-property +++ b/examples/kim/in.kim-pm-property @@ -1,34 +1,34 @@ -# kim-property example +# kim property example # # For detailed information of this example please refer to: -# https://openkim.org/doc/evaluation/tutorial-lammps/ +# `https://openkim.org/doc/evaluation/tutorial-lammps/` # # Description: # -# This example is designed to calculate the cohesive energy corresponding to -# the equilibrium FCC lattice constant for -# `LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004` model for -# argon. The material properties computed in LAMMPS are represented as a -# standard KIM property instance format. (See -# https://openkim.org/doc/schema/properties-framework/ and -# https://lammps.sandia.gov/doc/kim_commands.html for further details). -# Then the created property instance is written to a file named results.edn -# using the `kim_property dump` commands. +# This example is designed to calculate the cohesive energy corresponding to +# the equilibrium FCC lattice constant for +# `LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004` model for +# argon. The material properties computed in LAMMPS are represented as a +# standard KIM property instance format. (See +# `https://openkim.org/doc/schema/properties-framework/` and +# `https://lammps.sandia.gov/doc/kim_commands.html` for further details). +# Then the created property instance is written to a file named `results.edn` +# using the `kim property dump` command. # # Requirement: -# -# This example requires LAMMPS built with the Python 3.6 or later package -# installed. See the `https://lammps.sandia.gov/doc/python.html` doc page for +# +# This example requires LAMMPS built with the Python 3.6 or later package +# installed. See the `https://lammps.sandia.gov/doc/python.html` doc page for # more info on building LAMMPS with the version of Python on your system. -# After successfully building LAMMPS with Python, you need to install the -# kim-property Python package, See the -# `https://lammps.sandia.gov/doc/Build_extras.html#kim` doc page for +# After successfully building LAMMPS with Python, you need to install the +# kim-property Python package, See the +# `https://lammps.sandia.gov/doc/Build_extras.html#kim` doc page for # further details. # # This example requires that the KIM Portable Model (PM) # `LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004` -# is installed. This can be done with the command -# `kim-api-collections-management install user LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004` +# is installed. This can be done with the command +# kim-api-collections-management install user LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004 # If this command does not work, you may need to setup your PATH to find the utility. # If you installed the kim-api using the LAMMPS CMake build, you can do the following # (where the current working directory is assumed to be the LAMMPS build directory) @@ -38,14 +38,14 @@ # source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate # (where you should relplace X.Y.Z with the appropriate kim-api version number). # -# Or, see https://openkim.org/doc/obtaining-models for alternative options. +# Or, see `https://openkim.org/doc/obtaining-models` for alternative options. # # Initialize interatomic potential (KIM model) and units atom_style atomic # Set the OpenKIM model that will be used -kim_init LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004 metal +kim init LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004 metal # the equilibrium lattice constant for the fcc structure variable lattice_constant equal 5.248509056866169 @@ -55,14 +55,14 @@ boundary p p p # Create an FCC lattice with the lattice spacing # using a single conventional (orthogonal) unit cell -lattice fcc ${lattice_constant} -region box block 0 1 0 1 0 1 units lattice -create_box 1 box +lattice fcc ${lattice_constant} +region box block 0 1 0 1 0 1 units lattice +create_box 1 box create_atoms 1 box -mass 1 39.948 +mass 1 39.948 # Specify the KIM interactions -kim_interactions Ar +kim interactions Ar # Compute energy run 0 @@ -72,10 +72,10 @@ variable natoms equal "count(all)" variable ecohesive equal "-pe/v_natoms" # Create a property instance -kim_property create 1 cohesive-potential-energy-cubic-crystal +kim property create 1 cohesive-potential-energy-cubic-crystal # Set all the key-value pairs for this property instance -kim_property modify 1 key short-name source-value 1 fcc & +kim property modify 1 key short-name source-value 1 fcc & key species source-value 1 Ar & key a source-value ${lattice_constant} & source-unit angstrom & @@ -88,4 +88,4 @@ kim_property modify 1 key short-name source-value 1 fcc source-unit eV # Dump the results in a file -kim_property dump "results.edn" +kim property dump "results.edn" diff --git a/examples/kim/in.kim-pm-query.melt b/examples/kim/in.kim-pm-query.melt index fa04d90436..9e1e04000d 100644 --- a/examples/kim/in.kim-pm-query.melt +++ b/examples/kim/in.kim-pm-query.melt @@ -1,7 +1,7 @@ # 3d Lennard-Jones melt # # This example requires that the KIM Portable Model (PM) -# SW_StillingerWeber_1985_Si__MO_405512056662_005 +# `SW_StillingerWeber_1985_Si__MO_405512056662_005` # is installed. This can be done with the command # kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005 # If this command does not work, you may need to setup your PATH to find the utility. @@ -13,34 +13,34 @@ # source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate # (where you should relplace X.Y.Z with the appropriate kim-api version number). # -# Or, see https://openkim.org/doc/obtaining-models for alternative options. +# Or, see `https://openkim.org/doc/obtaining-models` for alternative options. # -variable x index 1 -variable y index 1 -variable z index 1 +variable x index 1 +variable y index 1 +variable z index 1 -variable xx equal 20*$x -variable yy equal 20*$y -variable zz equal 20*$z +variable xx equal 20*$x +variable yy equal 20*$y +variable zz equal 20*$z -kim_init SW_StillingerWeber_1985_Si__MO_405512056662_005 real -kim_query a0 get_lattice_constant_cubic crystal=["fcc"] species=["Si"] units=["angstrom"] +kim init SW_StillingerWeber_1985_Si__MO_405512056662_005 real +kim query a0 get_lattice_constant_cubic crystal=["fcc"] species=["Si"] units=["angstrom"] -lattice fcc ${a0} -region box block 0 ${xx} 0 ${yy} 0 ${zz} -create_box 1 box -create_atoms 1 box +lattice fcc ${a0} +region box block 0 ${xx} 0 ${yy} 0 ${zz} +create_box 1 box +create_atoms 1 box -kim_interactions Si +kim interactions Si -mass 1 39.95 -velocity all create 200.0 232345 loop geom +mass 1 39.95 +velocity all create 200.0 232345 loop geom -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes -fix 1 all nve -#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 -run 100 +run 100 diff --git a/examples/kim/in.kim-pm.melt b/examples/kim/in.kim-pm.melt index 9959a66793..46150d8c54 100644 --- a/examples/kim/in.kim-pm.melt +++ b/examples/kim/in.kim-pm.melt @@ -1,7 +1,7 @@ # 3d Lennard-Jones melt # # This example requires that the KIM Portable Model (PM) -# SW_StillingerWeber_1985_Si__MO_405512056662_005 +# `SW_StillingerWeber_1985_Si__MO_405512056662_005` # is installed. This can be done with the command # kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005 # If this command does not work, you may need to setup your PATH to find the utility. @@ -13,33 +13,33 @@ # source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate # (where you should relplace X.Y.Z with the appropriate kim-api version number). # -# Or, see https://openkim.org/doc/obtaining-models for alternative options. +# Or, see `https://openkim.org/doc/obtaining-models` for alternative options. # -variable x index 1 -variable y index 1 -variable z index 1 +variable x index 1 +variable y index 1 +variable z index 1 -variable xx equal 20*$x -variable yy equal 20*$y -variable zz equal 20*$z +variable xx equal 20*$x +variable yy equal 20*$y +variable zz equal 20*$z -kim_init SW_StillingerWeber_1985_Si__MO_405512056662_005 real +kim init SW_StillingerWeber_1985_Si__MO_405512056662_005 real -lattice fcc 4.4300 -region box block 0 ${xx} 0 ${yy} 0 ${zz} -create_box 1 box -create_atoms 1 box +lattice fcc 4.4300 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +create_box 1 box +create_atoms 1 box -kim_interactions Si +kim interactions Si -mass 1 39.95 -velocity all create 200.0 232345 loop geom +mass 1 39.95 +velocity all create 200.0 232345 loop geom -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes -fix 1 all nve -#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 -run 100 +run 100 diff --git a/examples/kim/in.kim-sm.melt b/examples/kim/in.kim-sm.melt index 0ee8e9a857..1c49ead229 100644 --- a/examples/kim/in.kim-sm.melt +++ b/examples/kim/in.kim-sm.melt @@ -1,8 +1,8 @@ # 3d Lennard-Jones melt # # This example requires that the KIM Simulator Model (PM) -# Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 -# is installed. This can be done with the command +# `Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000` +# is installed. This can be done with the command # kim-api-collections-management install user Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 # If this command does not work, you may need to setup your PATH to find the utility. # If you installed the kim-api using the LAMMPS CMake build, you can do the following @@ -13,33 +13,33 @@ # source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate # (where you should relplace X.Y.Z with the appropriate kim-api version number). # -# See https://openkim.org/doc/obtaining-models for alternative options. +# See `https://openkim.org/doc/obtaining-models` for alternative options. # -variable x index 1 -variable y index 1 -variable z index 1 +variable x index 1 +variable y index 1 +variable z index 1 -variable xx equal 20*$x -variable yy equal 20*$y -variable zz equal 20*$z +variable xx equal 20*$x +variable yy equal 20*$y +variable zz equal 20*$z -kim_init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 real +kim init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 real -lattice fcc 4.4300 -region box block 0 ${xx} 0 ${yy} 0 ${zz} -create_box 1 box -create_atoms 1 box +lattice fcc 4.4300 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +create_box 1 box +create_atoms 1 box -kim_interactions O +kim interactions O -mass 1 39.95 -velocity all create 200.0 232345 loop geom +mass 1 39.95 +velocity all create 200.0 232345 loop geom -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes -fix 1 all nve -#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 -run 100 +run 100 diff --git a/examples/kim/in.lammps.melt b/examples/kim/in.lammps.melt index 5792f3a5db..fbedb61985 100644 --- a/examples/kim/in.lammps.melt +++ b/examples/kim/in.lammps.melt @@ -1,33 +1,33 @@ # 3d Lennard-Jones melt -variable x index 1 -variable y index 1 -variable z index 1 +variable x index 1 +variable y index 1 +variable z index 1 -variable xx equal 20*$x -variable yy equal 20*$y -variable zz equal 20*$z +variable xx equal 20*$x +variable yy equal 20*$y +variable zz equal 20*$z -units real +units real -lattice fcc 4.4300 -region box block 0 ${xx} 0 ${yy} 0 ${zz} -create_box 1 box -create_atoms 1 box +lattice fcc 4.4300 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +create_box 1 box +create_atoms 1 box -pair_style lj/cut 8.1500 -pair_coeff 1 1 0.0104 3.4000 +pair_style lj/cut 8.1500 +pair_coeff 1 1 0.0104 3.4000 -#pair_style kim LennardJones_Ar -#pair_coeff * * Ar +#pair_style kim LennardJones_Ar +#pair_coeff * * Ar -mass 1 39.95 -velocity all create 200.0 232345 loop geom +mass 1 39.95 +velocity all create 200.0 232345 loop geom -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes -fix 1 all nve -#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 -run 100 +run 100 From 12a9b6165a0da00f67279fd8271ff9fcb904a325 Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 06:01:38 -0600 Subject: [PATCH 240/384] remove old log files --- .../kim/log.7Aug19.in.kim-ex.melt.clang.1 | 107 --------------- .../kim/log.7Aug19.in.kim-ex.melt.clang.4 | 113 ---------------- .../log.7Aug19.in.kim-pm-query.melt.clang.1 | 124 ------------------ .../log.7Aug19.in.kim-pm-query.melt.clang.4 | 124 ------------------ .../kim/log.7Aug19.in.kim-pm.melt.clang.1 | 118 ----------------- .../kim/log.7Aug19.in.kim-pm.melt.clang.4 | 118 ----------------- .../kim/log.7Aug19.in.kim-sm.melt.clang.1 | 71 ---------- .../kim/log.7Aug19.in.kim-sm.melt.clang.4 | 60 --------- .../kim/log.7Aug19.in.lammps.melt.clang.1 | 92 ------------- .../kim/log.7Aug19.in.lammps.melt.clang.4 | 92 ------------- 10 files changed, 1019 deletions(-) delete mode 100644 examples/kim/log.7Aug19.in.kim-ex.melt.clang.1 delete mode 100644 examples/kim/log.7Aug19.in.kim-ex.melt.clang.4 delete mode 100644 examples/kim/log.7Aug19.in.kim-pm-query.melt.clang.1 delete mode 100644 examples/kim/log.7Aug19.in.kim-pm-query.melt.clang.4 delete mode 100644 examples/kim/log.7Aug19.in.kim-pm.melt.clang.1 delete mode 100644 examples/kim/log.7Aug19.in.kim-pm.melt.clang.4 delete mode 100644 examples/kim/log.7Aug19.in.kim-sm.melt.clang.1 delete mode 100644 examples/kim/log.7Aug19.in.kim-sm.melt.clang.4 delete mode 100644 examples/kim/log.7Aug19.in.lammps.melt.clang.1 delete mode 100644 examples/kim/log.7Aug19.in.lammps.melt.clang.4 diff --git a/examples/kim/log.7Aug19.in.kim-ex.melt.clang.1 b/examples/kim/log.7Aug19.in.kim-ex.melt.clang.1 deleted file mode 100644 index 17fa1bc534..0000000000 --- a/examples/kim/log.7Aug19.in.kim-ex.melt.clang.1 +++ /dev/null @@ -1,107 +0,0 @@ -LAMMPS (7 Aug 2019) -# 3d Lennard-Jones melt -# -# This example requires that the example models provided with -# the kim-api package are installed. see the ./lib/kim/README or -# ./lib/kim/Install.py files for details on how to install these -# example models. -# - -variable x index 1 -variable y index 1 -variable z index 1 - -variable xx equal 20*$x -variable xx equal 20*1 -variable yy equal 20*$y -variable yy equal 20*1 -variable zz equal 20*$z -variable zz equal 20*1 - -kim_init LennardJones_Ar real -#=== BEGIN kim-init ========================================== -units real -#=== END kim-init ============================================ - - -lattice fcc 4.4300 -Lattice spacing in x,y,z = 4.43 4.43 4.43 -region box block 0 ${xx} 0 ${yy} 0 ${zz} -region box block 0 20 0 ${yy} 0 ${zz} -region box block 0 20 0 20 0 ${zz} -region box block 0 20 0 20 0 20 -create_box 1 box -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 32000 atoms - create_atoms CPU = 0.004321 secs - -kim_interactions Ar -#=== BEGIN kim_interactions ================================== -pair_style kim LennardJones_Ar -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:974) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:979) -pair_coeff * * Ar -#=== END kim_interactions ==================================== - - -mass 1 39.95 -velocity all create 200.0 232345 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 - -run 100 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 8.45 - ghost atom cutoff = 8.45 - binsize = 4.225, bins = 21 21 21 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair kim, perpetual - attributes: full, newton off, cut 8.45 - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Setting up Verlet run ... - Unit style : real - Current step : 0 - Time step : 1 -Per MPI rank memory allocation (min/avg/max) = 28.12 | 28.12 | 28.12 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 145069.63 0 164146.22 128015.94 - 100 95.179703 154939.42 0 164017.94 131602.75 -Loop time of 3.48256 on 1 procs for 100 steps with 32000 atoms - -Performance: 2.481 ns/day, 9.674 hours/ns, 28.715 timesteps/s -98.3% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 3.0502 | 3.0502 | 3.0502 | 0.0 | 87.59 -Neigh | 0.3646 | 0.3646 | 0.3646 | 0.0 | 10.47 -Comm | 0.01783 | 0.01783 | 0.01783 | 0.0 | 0.51 -Output | 6.8e-05 | 6.8e-05 | 6.8e-05 | 0.0 | 0.00 -Modify | 0.034349 | 0.034349 | 0.034349 | 0.0 | 0.99 -Other | | 0.01547 | | | 0.44 - -Nlocal: 32000 ave 32000 max 32000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 19911 ave 19911 max 19911 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 4.25375e+06 ave 4.25375e+06 max 4.25375e+06 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 4253750 -Ave neighs/atom = 132.93 -Neighbor list builds = 3 -Dangerous builds = 0 -Total wall time: 0:00:03 diff --git a/examples/kim/log.7Aug19.in.kim-ex.melt.clang.4 b/examples/kim/log.7Aug19.in.kim-ex.melt.clang.4 deleted file mode 100644 index 8e076815fc..0000000000 --- a/examples/kim/log.7Aug19.in.kim-ex.melt.clang.4 +++ /dev/null @@ -1,113 +0,0 @@ -LAMMPS (7 Aug 2019) -# 3d Lennard-Jones melt -# -# This example requires that the example models provided with -# the kim-api package are installed. see the ./lib/kim/README or -# ./lib/kim/Install.py files for details on how to install these -# example models. -# - -variable x index 1 -variable y index 1 -variable z index 1 - -variable xx equal 20*$x -variable xx equal 20*1 -variable yy equal 20*$y -variable yy equal 20*1 -variable zz equal 20*$z -variable zz equal 20*1 - -kim_init LennardJones_Ar real -#=== BEGIN kim-init ========================================== -units real -#=== END kim-init ============================================ - - -lattice fcc 4.4300 -Lattice spacing in x,y,z = 4.43 4.43 4.43 -region box block 0 ${xx} 0 ${yy} 0 ${zz} -region box block 0 20 0 ${yy} 0 ${zz} -region box block 0 20 0 20 0 ${zz} -region box block 0 20 0 20 0 20 -create_box 1 box -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 2 by 2 MPI processor grid -create_atoms 1 box -Created 32000 atoms - create_atoms CPU = 0.000989 secs - -kim_interactions Ar -#=== BEGIN kim_interactions ================================== -pair_style kim LennardJones_Ar -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:974) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:979) -pair_coeff * * Ar -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:974) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:979) -#=== END kim_interactions ==================================== - - -mass 1 39.95 -velocity all create 200.0 232345 loop geom -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:974) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:979) -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:974) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:979) - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 - -run 100 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 8.45 - ghost atom cutoff = 8.45 - binsize = 4.225, bins = 21 21 21 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair kim, perpetual - attributes: full, newton off, cut 8.45 - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Setting up Verlet run ... - Unit style : real - Current step : 0 - Time step : 1 -Per MPI rank memory allocation (min/avg/max) = 9.791 | 9.791 | 9.791 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 145069.63 0 164146.22 128015.94 - 100 95.179703 154939.42 0 164017.94 131602.75 -Loop time of 0.924494 on 4 procs for 100 steps with 32000 atoms - -Performance: 9.346 ns/day, 2.568 hours/ns, 108.167 timesteps/s -99.6% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.76434 | 0.76847 | 0.77207 | 0.3 | 83.12 -Neigh | 0.09089 | 0.094446 | 0.099911 | 1.1 | 10.22 -Comm | 0.038599 | 0.044759 | 0.051381 | 2.1 | 4.84 -Output | 3.5e-05 | 4e-05 | 4.9e-05 | 0.0 | 0.00 -Modify | 0.009396 | 0.009685 | 0.009941 | 0.2 | 1.05 -Other | | 0.00709 | | | 0.77 - -Nlocal: 8000 ave 8018 max 7967 min -Histogram: 1 0 0 0 0 0 1 0 0 2 -Nghost: 9131 ave 9164 max 9113 min -Histogram: 2 0 0 1 0 0 0 0 0 1 -Neighs: 0 ave 0 max 0 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -FullNghs: 1.06344e+06 ave 1.06594e+06 max 1.05881e+06 min -Histogram: 1 0 0 0 0 0 1 0 0 2 - -Total # of neighbors = 4253750 -Ave neighs/atom = 132.93 -Neighbor list builds = 3 -Dangerous builds = 0 -Total wall time: 0:00:00 diff --git a/examples/kim/log.7Aug19.in.kim-pm-query.melt.clang.1 b/examples/kim/log.7Aug19.in.kim-pm-query.melt.clang.1 deleted file mode 100644 index 1ca44c98ef..0000000000 --- a/examples/kim/log.7Aug19.in.kim-pm-query.melt.clang.1 +++ /dev/null @@ -1,124 +0,0 @@ -LAMMPS (7 Aug 2019) -# 3d Lennard-Jones melt -# -# This example requires that the KIM Portable Model (PM) -# SW_StillingerWeber_1985_Si__MO_405512056662_005 -# is installed. This can be done with the command -# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005 -# If this command does not work, you may need to setup your PATH to find the utility. -# If you installed the kim-api using the LAMMPS CMake build, you can do the following -# (where the current working directory is assumed to be the LAMMPS build directory) -# source ./kim_build-prefix/bin/kim-api-activate -# If you installed the kim-api using the LAMMPS Make build, you can do the following -# (where the current working directory is assumed to be the LAMMPS src directory) -# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate -# (where you should relplace X.Y.Z with the appropriate kim-api version number). -# -# Or, see https://openkim.org/doc/obtaining-models for alternative options. -# - -variable x index 1 -variable y index 1 -variable z index 1 - -variable xx equal 20*$x -variable xx equal 20*1 -variable yy equal 20*$y -variable yy equal 20*1 -variable zz equal 20*$z -variable zz equal 20*1 - -kim_init SW_StillingerWeber_1985_Si__MO_405512056662_005 real -#=== BEGIN kim-init ========================================== -units real -#=== END kim-init ============================================ - -kim_query a0 get_lattice_constant_cubic crystal=["fcc"] species=["Si"] units=["angstrom"] -#=== BEGIN kim-query ========================================= -variable a0 string 4.146581932902336 -#=== END kim-query =========================================== - - -lattice fcc ${a0} -lattice fcc 4.146581932902336 -Lattice spacing in x,y,z = 4.14658 4.14658 4.14658 -region box block 0 ${xx} 0 ${yy} 0 ${zz} -region box block 0 20 0 ${yy} 0 ${zz} -region box block 0 20 0 20 0 ${zz} -region box block 0 20 0 20 0 20 -create_box 1 box -Created orthogonal box = (0 0 0) to (82.9316 82.9316 82.9316) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 32000 atoms - create_atoms CPU = 0.005415 secs - -kim_interactions Si -#=== BEGIN kim_interactions ================================== -pair_style kim SW_StillingerWeber_1985_Si__MO_405512056662_005 -pair_coeff * * Si -#=== END kim_interactions ==================================== - - -mass 1 39.95 -velocity all create 200.0 232345 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 - -run 100 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 4.07118 - ghost atom cutoff = 4.07118 - binsize = 2.03559, bins = 41 41 41 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair kim, perpetual - attributes: full, newton off, cut 4.07118 - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Setting up Verlet run ... - Unit style : real - Current step : 0 - Time step : 1 -Per MPI rank memory allocation (min/avg/max) = 10.36 | 10.36 | 10.36 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 -126084.25 0 -107007.66 1528.8768 - 100 94.450495 -116016.03 0 -107007.07 2282.2685 -Loop time of 74.6055 on 1 procs for 100 steps with 32000 atoms - -Performance: 0.116 ns/day, 207.238 hours/ns, 1.340 timesteps/s -98.6% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 74.446 | 74.446 | 74.446 | 0.0 | 99.79 -Neigh | 0.096611 | 0.096611 | 0.096611 | 0.0 | 0.13 -Comm | 0.014594 | 0.014594 | 0.014594 | 0.0 | 0.02 -Output | 7.9e-05 | 7.9e-05 | 7.9e-05 | 0.0 | 0.00 -Modify | 0.03454 | 0.03454 | 0.03454 | 0.0 | 0.05 -Other | | 0.01396 | | | 0.02 - -Nlocal: 32000 ave 32000 max 32000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 9667 ave 9667 max 9667 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 450192 ave 450192 max 450192 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 450192 -Ave neighs/atom = 14.0685 -Neighbor list builds = 3 -Dangerous builds = 0 - -Please see the log.cite file for references relevant to this simulation - -Total wall time: 0:01:16 diff --git a/examples/kim/log.7Aug19.in.kim-pm-query.melt.clang.4 b/examples/kim/log.7Aug19.in.kim-pm-query.melt.clang.4 deleted file mode 100644 index 8c4148ce15..0000000000 --- a/examples/kim/log.7Aug19.in.kim-pm-query.melt.clang.4 +++ /dev/null @@ -1,124 +0,0 @@ -LAMMPS (7 Aug 2019) -# 3d Lennard-Jones melt -# -# This example requires that the KIM Portable Model (PM) -# SW_StillingerWeber_1985_Si__MO_405512056662_005 -# is installed. This can be done with the command -# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005 -# If this command does not work, you may need to setup your PATH to find the utility. -# If you installed the kim-api using the LAMMPS CMake build, you can do the following -# (where the current working directory is assumed to be the LAMMPS build directory) -# source ./kim_build-prefix/bin/kim-api-activate -# If you installed the kim-api using the LAMMPS Make build, you can do the following -# (where the current working directory is assumed to be the LAMMPS src directory) -# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate -# (where you should relplace X.Y.Z with the appropriate kim-api version number). -# -# Or, see https://openkim.org/doc/obtaining-models for alternative options. -# - -variable x index 1 -variable y index 1 -variable z index 1 - -variable xx equal 20*$x -variable xx equal 20*1 -variable yy equal 20*$y -variable yy equal 20*1 -variable zz equal 20*$z -variable zz equal 20*1 - -kim_init SW_StillingerWeber_1985_Si__MO_405512056662_005 real -#=== BEGIN kim-init ========================================== -units real -#=== END kim-init ============================================ - -kim_query a0 get_lattice_constant_cubic crystal=["fcc"] species=["Si"] units=["angstrom"] -#=== BEGIN kim-query ========================================= -variable a0 string 4.146581932902336 -#=== END kim-query =========================================== - - -lattice fcc ${a0} -lattice fcc 4.146581932902336 -Lattice spacing in x,y,z = 4.14658 4.14658 4.14658 -region box block 0 ${xx} 0 ${yy} 0 ${zz} -region box block 0 20 0 ${yy} 0 ${zz} -region box block 0 20 0 20 0 ${zz} -region box block 0 20 0 20 0 20 -create_box 1 box -Created orthogonal box = (0 0 0) to (82.9316 82.9316 82.9316) - 1 by 2 by 2 MPI processor grid -create_atoms 1 box -Created 32000 atoms - create_atoms CPU = 0.000946 secs - -kim_interactions Si -#=== BEGIN kim_interactions ================================== -pair_style kim SW_StillingerWeber_1985_Si__MO_405512056662_005 -pair_coeff * * Si -#=== END kim_interactions ==================================== - - -mass 1 39.95 -velocity all create 200.0 232345 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 - -run 100 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 4.07118 - ghost atom cutoff = 4.07118 - binsize = 2.03559, bins = 41 41 41 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair kim, perpetual - attributes: full, newton off, cut 4.07118 - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Setting up Verlet run ... - Unit style : real - Current step : 0 - Time step : 1 -Per MPI rank memory allocation (min/avg/max) = 3.489 | 3.489 | 3.489 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 -126084.25 0 -107007.66 1528.8768 - 100 94.450495 -116016.03 0 -107007.07 2282.2685 -Loop time of 19.0792 on 4 procs for 100 steps with 32000 atoms - -Performance: 0.453 ns/day, 52.998 hours/ns, 5.241 timesteps/s -99.4% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 18.78 | 18.855 | 18.937 | 1.5 | 98.83 -Neigh | 0.026047 | 0.026274 | 0.0266 | 0.1 | 0.14 -Comm | 0.09039 | 0.17196 | 0.24675 | 15.9 | 0.90 -Output | 3.9e-05 | 4.975e-05 | 6.1e-05 | 0.0 | 0.00 -Modify | 0.015667 | 0.015819 | 0.016008 | 0.1 | 0.08 -Other | | 0.01008 | | | 0.05 - -Nlocal: 8000 ave 8029 max 7968 min -Histogram: 1 1 0 0 0 0 0 0 0 2 -Nghost: 4259 ave 4303 max 4202 min -Histogram: 1 0 0 0 0 0 2 0 0 1 -Neighs: 0 ave 0 max 0 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -FullNghs: 112548 ave 113091 max 111995 min -Histogram: 1 0 0 1 0 0 0 1 0 1 - -Total # of neighbors = 450192 -Ave neighs/atom = 14.0685 -Neighbor list builds = 3 -Dangerous builds = 0 - -Please see the log.cite file for references relevant to this simulation - -Total wall time: 0:00:20 diff --git a/examples/kim/log.7Aug19.in.kim-pm.melt.clang.1 b/examples/kim/log.7Aug19.in.kim-pm.melt.clang.1 deleted file mode 100644 index f5845d7fc4..0000000000 --- a/examples/kim/log.7Aug19.in.kim-pm.melt.clang.1 +++ /dev/null @@ -1,118 +0,0 @@ -LAMMPS (7 Aug 2019) -# 3d Lennard-Jones melt -# -# This example requires that the KIM Portable Model (PM) -# SW_StillingerWeber_1985_Si__MO_405512056662_005 -# is installed. This can be done with the command -# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005 -# If this command does not work, you may need to setup your PATH to find the utility. -# If you installed the kim-api using the LAMMPS CMake build, you can do the following -# (where the current working directory is assumed to be the LAMMPS build directory) -# source ./kim_build-prefix/bin/kim-api-activate -# If you installed the kim-api using the LAMMPS Make build, you can do the following -# (where the current working directory is assumed to be the LAMMPS src directory) -# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate -# (where you should relplace X.Y.Z with the appropriate kim-api version number). -# -# Or, see https://openkim.org/doc/obtaining-models for alternative options. -# - -variable x index 1 -variable y index 1 -variable z index 1 - -variable xx equal 20*$x -variable xx equal 20*1 -variable yy equal 20*$y -variable yy equal 20*1 -variable zz equal 20*$z -variable zz equal 20*1 - -kim_init SW_StillingerWeber_1985_Si__MO_405512056662_005 real -#=== BEGIN kim-init ========================================== -units real -#=== END kim-init ============================================ - - -lattice fcc 4.4300 -Lattice spacing in x,y,z = 4.43 4.43 4.43 -region box block 0 ${xx} 0 ${yy} 0 ${zz} -region box block 0 20 0 ${yy} 0 ${zz} -region box block 0 20 0 20 0 ${zz} -region box block 0 20 0 20 0 20 -create_box 1 box -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 32000 atoms - create_atoms CPU = 0.003591 secs - -kim_interactions Si -#=== BEGIN kim_interactions ================================== -pair_style kim SW_StillingerWeber_1985_Si__MO_405512056662_005 -pair_coeff * * Si -#=== END kim_interactions ==================================== - - -mass 1 39.95 -velocity all create 200.0 232345 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 - -run 100 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 4.07118 - ghost atom cutoff = 4.07118 - binsize = 2.03559, bins = 44 44 44 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair kim, perpetual - attributes: full, newton off, cut 4.07118 - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Setting up Verlet run ... - Unit style : real - Current step : 0 - Time step : 1 -Per MPI rank memory allocation (min/avg/max) = 10.44 | 10.44 | 10.44 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 -85249.847 0 -66173.259 -33302.387 - 100 253.43357 -90346.68 0 -66173.441 -14888.698 -Loop time of 74.248 on 1 procs for 100 steps with 32000 atoms - -Performance: 0.116 ns/day, 206.244 hours/ns, 1.347 timesteps/s -98.8% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 74.118 | 74.118 | 74.118 | 0.0 | 99.83 -Neigh | 0.069623 | 0.069623 | 0.069623 | 0.0 | 0.09 -Comm | 0.0137 | 0.0137 | 0.0137 | 0.0 | 0.02 -Output | 7.6e-05 | 7.6e-05 | 7.6e-05 | 0.0 | 0.00 -Modify | 0.031883 | 0.031883 | 0.031883 | 0.0 | 0.04 -Other | | 0.01433 | | | 0.02 - -Nlocal: 32000 ave 32000 max 32000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 7760 ave 7760 max 7760 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 402352 ave 402352 max 402352 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 402352 -Ave neighs/atom = 12.5735 -Neighbor list builds = 4 -Dangerous builds = 0 - -Please see the log.cite file for references relevant to this simulation - -Total wall time: 0:01:14 diff --git a/examples/kim/log.7Aug19.in.kim-pm.melt.clang.4 b/examples/kim/log.7Aug19.in.kim-pm.melt.clang.4 deleted file mode 100644 index 0b4632b999..0000000000 --- a/examples/kim/log.7Aug19.in.kim-pm.melt.clang.4 +++ /dev/null @@ -1,118 +0,0 @@ -LAMMPS (7 Aug 2019) -# 3d Lennard-Jones melt -# -# This example requires that the KIM Portable Model (PM) -# SW_StillingerWeber_1985_Si__MO_405512056662_005 -# is installed. This can be done with the command -# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005 -# If this command does not work, you may need to setup your PATH to find the utility. -# If you installed the kim-api using the LAMMPS CMake build, you can do the following -# (where the current working directory is assumed to be the LAMMPS build directory) -# source ./kim_build-prefix/bin/kim-api-activate -# If you installed the kim-api using the LAMMPS Make build, you can do the following -# (where the current working directory is assumed to be the LAMMPS src directory) -# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate -# (where you should relplace X.Y.Z with the appropriate kim-api version number). -# -# Or, see https://openkim.org/doc/obtaining-models for alternative options. -# - -variable x index 1 -variable y index 1 -variable z index 1 - -variable xx equal 20*$x -variable xx equal 20*1 -variable yy equal 20*$y -variable yy equal 20*1 -variable zz equal 20*$z -variable zz equal 20*1 - -kim_init SW_StillingerWeber_1985_Si__MO_405512056662_005 real -#=== BEGIN kim-init ========================================== -units real -#=== END kim-init ============================================ - - -lattice fcc 4.4300 -Lattice spacing in x,y,z = 4.43 4.43 4.43 -region box block 0 ${xx} 0 ${yy} 0 ${zz} -region box block 0 20 0 ${yy} 0 ${zz} -region box block 0 20 0 20 0 ${zz} -region box block 0 20 0 20 0 20 -create_box 1 box -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 2 by 2 MPI processor grid -create_atoms 1 box -Created 32000 atoms - create_atoms CPU = 0.000997 secs - -kim_interactions Si -#=== BEGIN kim_interactions ================================== -pair_style kim SW_StillingerWeber_1985_Si__MO_405512056662_005 -pair_coeff * * Si -#=== END kim_interactions ==================================== - - -mass 1 39.95 -velocity all create 200.0 232345 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 - -run 100 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 4.07118 - ghost atom cutoff = 4.07118 - binsize = 2.03559, bins = 44 44 44 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair kim, perpetual - attributes: full, newton off, cut 4.07118 - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Setting up Verlet run ... - Unit style : real - Current step : 0 - Time step : 1 -Per MPI rank memory allocation (min/avg/max) = 3.517 | 3.517 | 3.517 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 -85249.847 0 -66173.259 -33302.387 - 100 253.43357 -90346.68 0 -66173.441 -14888.698 -Loop time of 19.0287 on 4 procs for 100 steps with 32000 atoms - -Performance: 0.454 ns/day, 52.857 hours/ns, 5.255 timesteps/s -99.1% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 18.81 | 18.838 | 18.883 | 0.6 | 99.00 -Neigh | 0.018598 | 0.01914 | 0.020732 | 0.7 | 0.10 -Comm | 0.10341 | 0.1475 | 0.17393 | 7.1 | 0.78 -Output | 6e-05 | 6.225e-05 | 6.7e-05 | 0.0 | 0.00 -Modify | 0.014839 | 0.014925 | 0.015047 | 0.1 | 0.08 -Other | | 0.008997 | | | 0.05 - -Nlocal: 8000 ave 8014 max 7988 min -Histogram: 1 1 0 0 0 0 1 0 0 1 -Nghost: 3374.75 ave 3389 max 3361 min -Histogram: 1 0 1 0 0 0 0 1 0 1 -Neighs: 0 ave 0 max 0 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -FullNghs: 100588 ave 100856 max 100392 min -Histogram: 1 0 1 0 1 0 0 0 0 1 - -Total # of neighbors = 402352 -Ave neighs/atom = 12.5735 -Neighbor list builds = 4 -Dangerous builds = 0 - -Please see the log.cite file for references relevant to this simulation - -Total wall time: 0:00:19 diff --git a/examples/kim/log.7Aug19.in.kim-sm.melt.clang.1 b/examples/kim/log.7Aug19.in.kim-sm.melt.clang.1 deleted file mode 100644 index 1b77e58a3a..0000000000 --- a/examples/kim/log.7Aug19.in.kim-sm.melt.clang.1 +++ /dev/null @@ -1,71 +0,0 @@ -LAMMPS (7 Aug 2019) -# 3d Lennard-Jones melt -# -# This example requires that the KIM Simulator Model (PM) -# Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 -# is installed. This can be done with the command -# kim-api-collections-management install user Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 -# If this command does not work, you may need to setup your PATH to find the utility. -# If you installed the kim-api using the LAMMPS CMake build, you can do the following -# (where the current working directory is assumed to be the LAMMPS build directory) -# source ./kim_build-prefix/bin/kim-api-activate -# If you installed the kim-api using the LAMMPS Make build, you can do the following -# (where the current working directory is assumed to be the LAMMPS src directory) -# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate -# (where you should relplace X.Y.Z with the appropriate kim-api version number). -# -# See https://openkim.org/doc/obtaining-models for alternative options. -# - -variable x index 1 -variable y index 1 -variable z index 1 - -variable xx equal 20*$x -variable xx equal 20*1 -variable yy equal 20*$y -variable yy equal 20*1 -variable zz equal 20*$z -variable zz equal 20*1 - -kim_init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 real -#=== BEGIN kim-init ========================================== -# Using KIM Simulator Model : Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 -# For Simulator : LAMMPS 28 Feb 2019 -# Running on : LAMMPS 7 Aug 2019 -# -units real -atom_style charge -neigh_modify one 4000 -#=== END kim-init ============================================ - - -lattice fcc 4.4300 -Lattice spacing in x,y,z = 4.43 4.43 4.43 -region box block 0 ${xx} 0 ${yy} 0 ${zz} -region box block 0 20 0 ${yy} 0 ${zz} -region box block 0 20 0 20 0 ${zz} -region box block 0 20 0 20 0 20 -create_box 1 box -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 32000 atoms - create_atoms CPU = 0.003447 secs - -kim_interactions O -#=== BEGIN kim_interactions ================================== -pair_style reax/c /var/tmp/kim-simulator-model-parameter-file-directory-6Acs1QDbXgBx/lmp_control safezone 2.0 mincap 100 -ERROR: Unrecognized pair style 'reax/c' is part of the USER-REAXC package which is not enabled in this LAMMPS binary. (../force.cpp:262) -Last command: pair_style reax/c /var/tmp/kim-simulator-model-parameter-file-directory-6Acs1QDbXgBx/lmp_control safezone 2.0 mincap 100 --------------------------------------------------------------------------- -Primary job terminated normally, but 1 process returned -a non-zero exit code. Per user-direction, the job has been aborted. --------------------------------------------------------------------------- --------------------------------------------------------------------------- -mpirun detected that one or more processes exited with non-zero status, thus causing -the job to be terminated. The first process to do so was: - - Process name: [[33054,1],0] - Exit code: 1 --------------------------------------------------------------------------- diff --git a/examples/kim/log.7Aug19.in.kim-sm.melt.clang.4 b/examples/kim/log.7Aug19.in.kim-sm.melt.clang.4 deleted file mode 100644 index 72b62beffb..0000000000 --- a/examples/kim/log.7Aug19.in.kim-sm.melt.clang.4 +++ /dev/null @@ -1,60 +0,0 @@ -LAMMPS (7 Aug 2019) -# 3d Lennard-Jones melt -# -# This example requires that the KIM Simulator Model (PM) -# Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 -# is installed. This can be done with the command -# kim-api-collections-management install user Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 -# If this command does not work, you may need to setup your PATH to find the utility. -# If you installed the kim-api using the LAMMPS CMake build, you can do the following -# (where the current working directory is assumed to be the LAMMPS build directory) -# source ./kim_build-prefix/bin/kim-api-activate -# If you installed the kim-api using the LAMMPS Make build, you can do the following -# (where the current working directory is assumed to be the LAMMPS src directory) -# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate -# (where you should relplace X.Y.Z with the appropriate kim-api version number). -# -# See https://openkim.org/doc/obtaining-models for alternative options. -# - -variable x index 1 -variable y index 1 -variable z index 1 - -variable xx equal 20*$x -variable xx equal 20*1 -variable yy equal 20*$y -variable yy equal 20*1 -variable zz equal 20*$z -variable zz equal 20*1 - -kim_init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 real -#=== BEGIN kim-init ========================================== -# Using KIM Simulator Model : Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 -# For Simulator : LAMMPS 28 Feb 2019 -# Running on : LAMMPS 7 Aug 2019 -# -units real -atom_style charge -neigh_modify one 4000 -#=== END kim-init ============================================ - - -lattice fcc 4.4300 -Lattice spacing in x,y,z = 4.43 4.43 4.43 -region box block 0 ${xx} 0 ${yy} 0 ${zz} -region box block 0 20 0 ${yy} 0 ${zz} -region box block 0 20 0 20 0 ${zz} -region box block 0 20 0 20 0 20 -create_box 1 box -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 2 by 2 MPI processor grid -create_atoms 1 box -Created 32000 atoms - create_atoms CPU = 0.001307 secs - -kim_interactions O -#=== BEGIN kim_interactions ================================== -pair_style reax/c /var/tmp/kim-simulator-model-parameter-file-directory-6tmKtZEXzhgv/lmp_control safezone 2.0 mincap 100 -ERROR: Unrecognized pair style 'reax/c' is part of the USER-REAXC package which is not enabled in this LAMMPS binary. (../force.cpp:262) -Last command: pair_style reax/c /var/tmp/kim-simulator-model-parameter-file-directory-6tmKtZEXzhgv/lmp_control safezone 2.0 mincap 100 diff --git a/examples/kim/log.7Aug19.in.lammps.melt.clang.1 b/examples/kim/log.7Aug19.in.lammps.melt.clang.1 deleted file mode 100644 index f697504777..0000000000 --- a/examples/kim/log.7Aug19.in.lammps.melt.clang.1 +++ /dev/null @@ -1,92 +0,0 @@ -LAMMPS (7 Aug 2019) -# 3d Lennard-Jones melt - -variable x index 1 -variable y index 1 -variable z index 1 - -variable xx equal 20*$x -variable xx equal 20*1 -variable yy equal 20*$y -variable yy equal 20*1 -variable zz equal 20*$z -variable zz equal 20*1 - -units real - -lattice fcc 4.4300 -Lattice spacing in x,y,z = 4.43 4.43 4.43 -region box block 0 ${xx} 0 ${yy} 0 ${zz} -region box block 0 20 0 ${yy} 0 ${zz} -region box block 0 20 0 20 0 ${zz} -region box block 0 20 0 20 0 20 -create_box 1 box -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 32000 atoms - create_atoms CPU = 0.003037 secs - -pair_style lj/cut 8.1500 -pair_coeff 1 1 0.0104 3.4000 - -#pair_style kim LennardJones_Ar -#pair_coeff * * Ar - -mass 1 39.95 -velocity all create 200.0 232345 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 - -run 100 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 8.45 - ghost atom cutoff = 8.45 - binsize = 4.225, bins = 21 21 21 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Setting up Verlet run ... - Unit style : real - Current step : 0 - Time step : 1 -Per MPI rank memory allocation (min/avg/max) = 19.23 | 19.23 | 19.23 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 6290.8194 0 25367.408 6750.7421 - 100 98.747096 15900.676 0 25319.465 10184.453 -Loop time of 2.43768 on 1 procs for 100 steps with 32000 atoms - -Performance: 3.544 ns/day, 6.771 hours/ns, 41.023 timesteps/s -97.8% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 2.1895 | 2.1895 | 2.1895 | 0.0 | 89.82 -Neigh | 0.17546 | 0.17546 | 0.17546 | 0.0 | 7.20 -Comm | 0.021001 | 0.021001 | 0.021001 | 0.0 | 0.86 -Output | 7.9e-05 | 7.9e-05 | 7.9e-05 | 0.0 | 0.00 -Modify | 0.034253 | 0.034253 | 0.034253 | 0.0 | 1.41 -Other | | 0.01735 | | | 0.71 - -Nlocal: 32000 ave 32000 max 32000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 19911 ave 19911 max 19911 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 1.96027e+06 ave 1.96027e+06 max 1.96027e+06 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 1960266 -Ave neighs/atom = 61.2583 -Neighbor list builds = 3 -Dangerous builds = 0 -Total wall time: 0:00:02 diff --git a/examples/kim/log.7Aug19.in.lammps.melt.clang.4 b/examples/kim/log.7Aug19.in.lammps.melt.clang.4 deleted file mode 100644 index 2d25348b06..0000000000 --- a/examples/kim/log.7Aug19.in.lammps.melt.clang.4 +++ /dev/null @@ -1,92 +0,0 @@ -LAMMPS (7 Aug 2019) -# 3d Lennard-Jones melt - -variable x index 1 -variable y index 1 -variable z index 1 - -variable xx equal 20*$x -variable xx equal 20*1 -variable yy equal 20*$y -variable yy equal 20*1 -variable zz equal 20*$z -variable zz equal 20*1 - -units real - -lattice fcc 4.4300 -Lattice spacing in x,y,z = 4.43 4.43 4.43 -region box block 0 ${xx} 0 ${yy} 0 ${zz} -region box block 0 20 0 ${yy} 0 ${zz} -region box block 0 20 0 20 0 ${zz} -region box block 0 20 0 20 0 20 -create_box 1 box -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 2 by 2 MPI processor grid -create_atoms 1 box -Created 32000 atoms - create_atoms CPU = 0.001194 secs - -pair_style lj/cut 8.1500 -pair_coeff 1 1 0.0104 3.4000 - -#pair_style kim LennardJones_Ar -#pair_coeff * * Ar - -mass 1 39.95 -velocity all create 200.0 232345 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 - -run 100 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 8.45 - ghost atom cutoff = 8.45 - binsize = 4.225, bins = 21 21 21 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Setting up Verlet run ... - Unit style : real - Current step : 0 - Time step : 1 -Per MPI rank memory allocation (min/avg/max) = 7.633 | 7.633 | 7.633 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 6290.8194 0 25367.408 6750.7421 - 100 98.747096 15900.676 0 25319.465 10184.453 -Loop time of 0.726239 on 4 procs for 100 steps with 32000 atoms - -Performance: 11.897 ns/day, 2.017 hours/ns, 137.696 timesteps/s -98.7% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.57617 | 0.5835 | 0.59084 | 0.9 | 80.34 -Neigh | 0.046682 | 0.047783 | 0.048641 | 0.3 | 6.58 -Comm | 0.065469 | 0.071509 | 0.07899 | 2.3 | 9.85 -Output | 3.9e-05 | 4.6e-05 | 6.1e-05 | 0.0 | 0.01 -Modify | 0.013205 | 0.01363 | 0.014044 | 0.3 | 1.88 -Other | | 0.009775 | | | 1.35 - -Nlocal: 8000 ave 8012 max 7989 min -Histogram: 1 0 0 0 2 0 0 0 0 1 -Nghost: 9131 ave 9142 max 9119 min -Histogram: 1 0 0 0 0 2 0 0 0 1 -Neighs: 490066 ave 491443 max 489273 min -Histogram: 2 0 0 0 1 0 0 0 0 1 - -Total # of neighbors = 1960266 -Ave neighs/atom = 61.2583 -Neighbor list builds = 3 -Dangerous builds = 0 -Total wall time: 0:00:00 From 7c102a6096671026a775574d0dcf5bc1e9a357d3 Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 06:02:21 -0600 Subject: [PATCH 241/384] Extend the 'kim query' command Extend the 'kim query' command to get all available models meeting certain requirements. To query for KIM models the query function is `get_available_models`. Now, the 'kim query' works with the `model` argument and can also be used with no 'kim init' call requirement. --- src/KIM/kim_query.cpp | 233 +++++++++++++++++++++++++----------------- 1 file changed, 137 insertions(+), 96 deletions(-) diff --git a/src/KIM/kim_query.cpp b/src/KIM/kim_query.cpp index ef4b7572d3..db2bd47f94 100644 --- a/src/KIM/kim_query.cpp +++ b/src/KIM/kim_query.cpp @@ -81,125 +81,161 @@ using namespace LAMMPS_NS; #if defined(LMP_KIM_CURL) +namespace { +static constexpr int kBufSize{10240}; struct WriteBuf { char *dataptr; size_t sizeleft; }; -static char *do_query(char *, char *, int, char **, int, MPI_Comm); -static size_t write_callback(void *, size_t, size_t, void *); +static char *do_query(const std::string &, const std::string &, + int, char **, int, MPI_Comm); +static size_t write_callback(void *, size_t, size_t, void *); +} // namespace #endif /* ---------------------------------------------------------------------- */ void KimQuery::command(int narg, char **arg) { - if (narg < 2) error->all(FLERR,"Illegal 'kim query' command"); + if (narg < 2) error->all(FLERR, "Illegal 'kim query' command"); - // check if we had a kim init command by finding fix STORE/KIM - // retrieve model name. - char *model_name; - - const int ifix = modify->find_fix("KIM_MODEL_STORE"); - if (ifix >= 0) { - FixStoreKIM *fix_store = (FixStoreKIM *) modify->fix[ifix]; - model_name = (char *)fix_store->getptr("model_name"); - } else error->all(FLERR,"Must use 'kim init' before 'kim query'"); - - char *varname = arg[0]; - - bool split = false; - if (strcmp("split",arg[1]) == 0) { - if (narg == 2) error->all(FLERR,"Illegal 'kim query' command.\nThe keyword " - "'split' must be followed by the name of " - "the query function"); - if (strcmp("list",arg[2]) == 0) - error->all(FLERR,"Illegal 'kim query' command.\nThe 'list' keyword " - "can not be used after 'split'"); - split = true; - arg++; - narg--; - } + std::string var_name{arg[0]}; + // format_arg = list, split, or index (optional): + std::string format_arg{arg[1]}; + if (format_arg == "split" || format_arg == "list" || format_arg == "index") { + if (narg == 2) { + auto msg = fmt::format("Illegal 'kim query' command.\nThe keyword '{}' " + "must be followed by the name of the query function", format_arg); + error->all(FLERR, msg); + } + ++arg; + --narg; // The “list” is the default setting - // the result is returned as a space-separated list of values in variable - if (strcmp("list",arg[1]) == 0) { - if (narg == 2) error->all(FLERR,"Illegal 'kim query' command.\nThe 'list' " - "keyword must be followed by ('split' " - "and) the name of the query function"); - arg++; - narg--; + // the result is returned as a space-separated list of values in a variable + } else format_arg = "list"; + + std::string query_function{arg[1]}; + if (query_function == "split" || query_function == "list" || + query_function == "index") { + auto msg = fmt::format("Illegal 'kim query' command.\nThe '{}' keyword " + "can not be used after '{}'", query_function, format_arg); + error->all(FLERR, msg); } - char *function = arg[1]; - for (int i = 2; i < narg; ++i) { - if (strncmp("model=",arg[i],6) == 0) - error->all(FLERR,"Illegal 'model' key in 'kim query' command"); + std::string model_name; - if (!strchr(arg[i], '=') || !strchr(arg[i], '[') || !strchr(arg[i], ']')) - error->all(FLERR,fmt::format("Illegal query format.\nInput argument of " - "`{}` to 'kim query' is wrong. The query " - "format is the keyword=[value], where value " - "is always an array of one or more " - "comma-separated items", arg[i])); + // check the query_args format (a series of keyword=value pairs) + for (int i = 2; i < narg; ++i) { + if (!strchr(arg[i], '=') || !strchr(arg[i], '[') || !strchr(arg[i], ']')) { + auto msg = fmt::format("Illegal query format.\nInput argument " + "of `{}` to 'kim query' is wrong. The query format is the " + "keyword=[value], where value is always an array of one or " + "more comma-separated items", arg[i]); + error->all(FLERR, msg); + } + } + + if (query_function != "get_available_models") { + for (int i = 2; i < narg; ++i) { + // check if the model is specified as an argument + if (strncmp("model=", arg[i], 6) == 0) { + ValueTokenizer values(arg[i], "=[]"); + std::string key = values.next_string(); + model_name = values.next_string(); + break; + } + } + // if the model name is not provided by the user + if (model_name.empty()) { + // check if we had a kim init command by finding fix STORE/KIM + const int ifix = modify->find_fix("KIM_MODEL_STORE"); + if (ifix >= 0) { + FixStoreKIM *fix_store = (FixStoreKIM *) modify->fix[ifix]; + char *model_name_c = (char *) fix_store->getptr("model_name"); + model_name = fmt::format("{}", model_name_c); + } else { + auto msg = fmt::format("Illegal query format.\nMust use 'kim init' " + "before 'kim query' or must provide the model name after query " + "function with the format of 'model=[model_name]'"); + error->all(FLERR, msg); + } + } } #if defined(LMP_KIM_CURL) - - char *value = do_query(function, model_name, narg-2, arg+2, comm->me, world); + char *value = do_query(query_function, model_name, + narg - 2, arg + 2, comm->me, world); // check for valid result - // on error the content of "value" is a '\0' byte - // as the first element, and then the error message - // that was returned by the web server + // on error the content of "value" is a '\0' byte as the first element, + // and then the error message that was returned by the web server if (strlen(value) == 0) { - error->all(FLERR,fmt::format("OpenKIM query failed: {}", value+1)); - } else if (strcmp(value,"EMPTY") == 0) { - error->all(FLERR,fmt::format("OpenKIM query returned no results")); + auto msg = fmt::format("OpenKIM query failed: {}", value + 1); + delete [] value; + error->all(FLERR, msg); + } else if (strcmp(value, "EMPTY") == 0) { + delete [] value; + error->all(FLERR, fmt::format("OpenKIM query returned no results")); } - input->write_echo("#=== BEGIN kim query ==================================" + input->write_echo("#=== BEGIN kim-query ==================================" "=======\n"); ValueTokenizer values(value, ","); - if (split) { + if (format_arg == "split") { int counter = 1; while (values.has_next()) { auto svalue = values.next_string(); - auto setcmd = fmt::format("{}_{} string {}", varname, counter++, svalue); + auto setcmd = fmt::format("{}_{} string {}", var_name, counter++, svalue); input->variable->set(setcmd); input->write_echo(fmt::format("variable {}\n", setcmd)); } } else { - auto svalue = values.next_string(); - std::string setcmd = fmt::format("{} string \"{}", varname, svalue); - while (values.has_next()) { - svalue = values.next_string(); - setcmd += fmt::format(" {}", svalue); + std::string setcmd; + auto svalue = utils::trim(values.next_string()); + if (format_arg == "list") { + setcmd = fmt::format("{} string \"", var_name); + setcmd += (svalue.front() == '"' && svalue.back() == '"') + ? fmt::format("{}", svalue.substr(1, svalue.size() - 2)) + : fmt::format("{}", svalue); + while (values.has_next()) { + svalue = utils::trim(values.next_string()); + setcmd += (svalue.front() == '"' && svalue.back() == '"') + ? fmt::format(" {}", svalue.substr(1, svalue.size() - 2)) + : fmt::format(" {}", svalue); + } + setcmd += "\""; + } else { + // format_arg == "index" + setcmd = fmt::format("{} index {}", var_name, svalue); + while (values.has_next()) { + svalue = values.next_string(); + setcmd += fmt::format(" {}", svalue); + } } - setcmd += "\""; input->variable->set(setcmd); input->write_echo(fmt::format("variable {}\n", setcmd)); } - input->write_echo("#=== END kim query ====================================" + input->write_echo("#=== END kim-query ====================================" "=======\n\n"); - delete[] value; + delete [] value; #else - error->all(FLERR,"Cannot use 'kim query' command when KIM package " - "is compiled without support for libcurl"); + error->all(FLERR, "Cannot use 'kim query' command when KIM package " + "is compiled without support for libcurl"); #endif } #if defined(LMP_KIM_CURL) - +namespace { // copy data to the user provided data structure, optionally in increments - size_t write_callback(void *data, size_t size, size_t nmemb, void *userp) { - struct WriteBuf *buf = (struct WriteBuf *)userp; + WriteBuf *buf = (WriteBuf *) userp; // copy chunks into the buffer for as long as there is space left if (buf->sizeleft) { @@ -211,25 +247,23 @@ size_t write_callback(void *data, size_t size, size_t nmemb, void *userp) buf->dataptr += copy_this_much; buf->sizeleft -= copy_this_much; - return copy_this_much; } return 0; // done } -char *do_query(char *qfunction, char * model_name, int narg, char **arg, - int rank, MPI_Comm comm) +char *do_query(const std::string &qfunction, const std::string &mname, + int narg, char **arg, int rank, MPI_Comm comm) { - char value[512]; + char value[kBufSize]; // run the web query from rank 0 only - if (rank == 0) { // set up and clear receive buffer - struct WriteBuf buf; + WriteBuf buf; buf.dataptr = value; - buf.sizeleft = 511; - memset(value,0,512); + buf.sizeleft = kBufSize - 1; + memset(value, 0, kBufSize); // create curl web query instance curl_global_init(CURL_GLOBAL_DEFAULT); @@ -237,17 +271,21 @@ char *do_query(char *qfunction, char * model_name, int narg, char **arg, if (handle) { auto url = fmt::format("https://query.openkim.org/api/{}", qfunction); - auto query = fmt::format("model=[\"{}\"]", model_name); + auto query = mname.empty() + ? fmt::format("") + : (mname.front() == '"' && mname.back() == '"') + ? fmt::format("model=[{}]", mname) + : fmt::format("model=[\"{}\"]", mname); for (int i = 0; i < narg; ++i) { ValueTokenizer values(arg[i], "=[]"); std::string key = values.next_string(); + if (key == "model") continue; std::string val = values.next_string(); std::string::size_type n = val.find(","); if (n == std::string::npos) { if (utils::is_integer(val) || utils::is_double(val) || - (val.front() == '"' && - val.back() == '"')) { + (val.front() == '"' && val.back() == '"')) { query += fmt::format("&{}", arg[i]); } else { query += fmt::format("&{}=[\"{}\"]", key, val); @@ -258,8 +296,7 @@ char *do_query(char *qfunction, char * model_name, int narg, char **arg, std::string sval = val.substr(0, n); if (utils::is_integer(sval) || utils::is_double(sval) || - (val.front() == '"' && - val.back() == '"')) { + (val.front() == '"' && val.back() == '"')) { query += fmt::format("{},", sval); } else { query += fmt::format("\"{}\",", sval); @@ -267,8 +304,11 @@ char *do_query(char *qfunction, char * model_name, int narg, char **arg, val = val.substr(n + 1); n = val.find(","); } - if (val.size()) query += fmt::format("\"{}\"]", val); - else query[query.size() - 1]=']'; + if (val.size()) { + query += (val.front() == '"' && val.back() == '"') + ? fmt::format("{}]", val) + : fmt::format("\"{}\"]", val); + } else query.back() = ']'; } } @@ -294,28 +334,28 @@ char *do_query(char *qfunction, char * model_name, int narg, char **arg, } } - std::string user_agent = fmt::format("kim query--LAMMPS/{} ({})", - LAMMPS_VERSION, Info::get_os_info()); + auto user_agent = fmt::format("kim query--LAMMPS/{} ({})", + LAMMPS_VERSION, Info::get_os_info()); curl_easy_setopt(handle, CURLOPT_USERAGENT, user_agent.c_str()); curl_easy_setopt(handle, CURLOPT_URL, url.c_str()); curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(handle, CURLOPT_POSTFIELDS, query.c_str()); curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, write_callback); - curl_easy_setopt(handle, CURLOPT_WRITEDATA,&buf); + curl_easy_setopt(handle, CURLOPT_WRITEDATA, &buf); // perform OpenKIM query and check for errors CURLcode res = curl_easy_perform(handle); if (res != CURLE_OK) { // on error we return an "empty" string but add error message after it value[0] = '\0'; - strcpy(value+1,curl_easy_strerror(res)); + strcpy(value + 1, curl_easy_strerror(res)); } curl_easy_cleanup(handle); } curl_global_cleanup(); } - MPI_Bcast(value, 512, MPI_CHAR, 0, comm); + MPI_Bcast(value, kBufSize, MPI_CHAR, 0, comm); // we must make a proper copy of the query, as the stack allocation // for "value" will go out of scope. a valid query has a '[' as @@ -330,27 +370,28 @@ char *do_query(char *qfunction, char * model_name, int narg, char **arg, if (value[len] == ']') { value[len] = '\0'; retval = new char[len]; - if (strcmp(value+1, "") == 0) strcpy(retval,"EMPTY"); - else strcpy(retval,value+1); + if (strcmp(value + 1, "") == 0) strcpy(retval, "EMPTY"); + else strcpy(retval, value + 1); } else { - retval = new char[len+2]; + retval = new char[len + 2]; retval[0] = '\0'; - strcpy(retval+1,value); + strcpy(retval + 1, value); } // an error message starts with a '\0' character } else if (value[0] == '\0') { - int len = strlen(value+1)+2; + int len = strlen(value + 1) + 2; retval = new char[len]; retval[0] = '\0'; - strcpy(retval+1,value+1); + strcpy(retval + 1, value + 1); // unknown response type. we should not get here. } else { // we return an "empty" string but add error message after it - int len = strlen(value)+2; + int len = strlen(value) + 2; retval = new char[len]; retval[0] = '\0'; - strcpy(retval+1,value); + strcpy(retval + 1, value); } return retval; } +} // namespace #endif From 90e748aa5cf7fda58c57036a5cbfde1f53a93c78 Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 06:03:45 -0600 Subject: [PATCH 242/384] Update the 'kim query' unittest Update the unittest with the latest extension. Replace the discontinued model of `EAM_Dynamo_Mendelev_2007_Zr__MO_848899341753_000` and replace it with the identical version, `EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000` --- unittest/commands/test_kim_commands.cpp | 166 ++++++++++++++++++------ 1 file changed, 127 insertions(+), 39 deletions(-) diff --git a/unittest/commands/test_kim_commands.cpp b/unittest/commands/test_kim_commands.cpp index 5ea458de59..9d02cdb74c 100644 --- a/unittest/commands/test_kim_commands.cpp +++ b/unittest/commands/test_kim_commands.cpp @@ -38,7 +38,6 @@ const bool have_openmpi = false; using LAMMPS_NS::utils::split_words; namespace LAMMPS_NS { -using ::testing::ExitedWithCode; using ::testing::MatchesRegex; using ::testing::StrEq; @@ -401,26 +400,33 @@ TEST_F(KimCommandsTest, kim_query) TEST_FAILURE(".*ERROR: Illegal 'kim query' command.*", lmp->input->one("kim query");); - TEST_FAILURE(".*ERROR: Must use 'kim init' before 'kim query'.*", - lmp->input->one("kim query a0 get_lattice_constant_cubic");); - - if (!verbose) ::testing::internal::CaptureStdout(); - lmp->input->one("clear"); - lmp->input->one("kim init LennardJones612_UniversalShifted__MO_959249795837_003 real"); - if (!verbose) ::testing::internal::GetCapturedStdout(); - TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe keyword 'split' " "must be followed by the name of the query function.*", lmp->input->one("kim query a0 split");); + TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe keyword 'list' " + "must be followed by the name of the query function.*", + lmp->input->one("kim query a0 list");); + TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe keyword 'index' " + "must be followed by the name of the query function.*", + lmp->input->one("kim query a0 index");); TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe 'list' keyword " "can not be used after 'split'.*", lmp->input->one("kim query a0 split list");); + TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe 'index' keyword " + "can not be used after 'split'.*", + lmp->input->one("kim query a0 split index");); + TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe 'split' keyword " + "can not be used after 'list'.*", + lmp->input->one("kim query a0 list split");); + TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe 'index' keyword " + "can not be used after 'list'.*", + lmp->input->one("kim query a0 list index");); TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe 'list' keyword " - "must be followed by \\('split' and\\) the name of the query " - "function.*", lmp->input->one("kim query a0 list");); - TEST_FAILURE(".*ERROR: Illegal 'model' key in 'kim query' command.*", - lmp->input->one("kim query a0 get_lattice_constant_cubic " - "model=[MO_959249795837_003]");); + "can not be used after 'index'.*", + lmp->input->one("kim query a0 index list");); + TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe 'split' keyword " + "can not be used after 'index'.*", + lmp->input->one("kim query a0 index split");); TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `crystal` " "to 'kim query' is wrong. The query format is the " "keyword=\\[value\\], where value is always an array of one " @@ -428,9 +434,9 @@ TEST_F(KimCommandsTest, kim_query) lmp->input->one("kim query a0 get_lattice_constant_cubic " "crystal");); TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `" - "crystal=fcc` to 'kim query' is wrong. The query format is " - "the keyword=\\[value\\], where value is always an array of " - "one or more comma-separated items.*", + "crystal=fcc` to 'kim query' is wrong. The query format is the " + "keyword=\\[value\\], where value is always an array of one " + "or more comma-separated items.*", lmp->input->one("kim query a0 get_lattice_constant_cubic " "crystal=fcc");); TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `" @@ -448,46 +454,111 @@ TEST_F(KimCommandsTest, kim_query) std::string squery("kim query a0 get_lattice_constant_cubic "); squery += "crystal=[\"fcc\"] species=\"Al\",\"Ni\" units=[\"angstrom\"]"; - TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `species=" + TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `species=" "\"Al\",\"Ni\"` to 'kim query' is wrong. The query format is " "the keyword=\\[value\\], where value is always an array of " "one or more comma-separated items.*", lmp->input->one(squery);); squery = "kim query a0 get_lattice_constant_cubic "; - squery += "crystal=[\"fcc\"] species=\"Al\",\"Ni\", units=[\"angstrom\"]"; - TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `species=" - "\"Al\",\"Ni\",` to 'kim query' is wrong. The query format is " + squery += "crystal=[fcc] species=Al,Ni units=[angstrom]"; + TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `species=" + "Al,Ni` to 'kim query' is wrong. The query format is " "the keyword=\\[value\\], where value is always an array of " "one or more comma-separated items.*", lmp->input->one(squery);); - squery = "kim query a0 get_lattice_constant_cubic crystal=[fcc] " - "species=[Al]"; - TEST_FAILURE(".*ERROR: OpenKIM query failed:.*", lmp->input->one(squery);); + squery = "kim query a0 get_lattice_constant_cubic "; + squery += "crystal=[fcc] species=Al,Ni, units=[angstrom]"; + TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `species=" + "Al,Ni,` to 'kim query' is wrong. The query format is " + "the keyword=\\[value\\], where value is always an array of " + "one or more comma-separated items.*", + lmp->input->one(squery);); + + squery = "kim query a0 get_lattice_constant_cubic crystal=[\"fcc\"] " + "species=[\"Al\"]"; + TEST_FAILURE(".*ERROR: Illegal query format.\nMust use 'kim init' before " + "'kim query' or must provide the model name after query " + "function with the format of 'model=\\[model_name\\]'.*", + lmp->input->one(squery);); squery = "kim query a0 get_lattice_constant_cubic crystal=[fcc] " - "units=[\"angstrom\"]"; - TEST_FAILURE(".*ERROR: OpenKIM query failed:.*", lmp->input->one(squery);); + "species=[Al]"; + TEST_FAILURE(".*ERROR: Illegal query format.\nMust use 'kim init' before " + "'kim query' or must provide the model name after query " + "function with the format of 'model=\\[model_name\\]'.*", + lmp->input->one(squery);); + + squery = "kim query a0 get_lattice_constant_cubic crystal=[\"fcc\"] " + "species=[Al]"; + TEST_FAILURE(".*ERROR: Illegal query format.\nMust use 'kim init' before " + "'kim query' or must provide the model name after query " + "function with the format of 'model=\\[model_name\\]'.*", + lmp->input->one(squery);); #if defined(KIM_EXTRA_UNITTESTS) if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); - lmp->input->one("kim init EAM_Dynamo_Mendelev_2007_Zr__MO_848899341753_000 metal"); - squery = "kim query latconst split get_lattice_constant_hexagonal "; - squery += "crystal=[\"hcp\"] species=[\"Zr\"] units=[\"angstrom\"]"; + squery = "kim query latconst_1 get_lattice_constant_cubic "; + squery += "crystal=[fcc] species=[Al] units=[angstrom] "; + squery += "model=[EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005]"; lmp->input->one(squery); if (!verbose) ::testing::internal::GetCapturedStdout(); ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst_1")) == - std::string("3.234055244384789"))); - ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst_2")) == - std::string("5.167650199630013"))); + "4.032082033157349")); if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); - lmp->input->one("kim init EAM_Dynamo_Mendelev_2007_Zr__MO_848899341753_000 metal"); + lmp->input->one("kim init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal"); + + squery = "kim query latconst_1 get_lattice_constant_cubic "; + squery += "crystal=[fcc] species=[Al] units=[angstrom]"; + lmp->input->one(squery); + + squery = "kim query latconst_2 get_lattice_constant_cubic "; + squery += "crystal=[fcc] species=[Al] units=[angstrom] "; + squery += "model=[LennardJones612_UniversalShifted__MO_959249795837_003]"; + lmp->input->one(squery); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst_1")) == + "4.032082033157349")); + ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst_2")) == + "3.328125931322575")); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("clear"); + lmp->input->one("kim init EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000 metal"); + + squery = "kim query latconst split get_lattice_constant_hexagonal "; + squery += "crystal=[hcp] species=[Zr] units=[angstrom]"; + lmp->input->one(squery); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst_1")) == + "3.234055244384789")); + ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst_2")) == + "5.167650199630013")); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("clear"); + + squery = "kim query latconst index get_lattice_constant_hexagonal "; + squery += "crystal=[hcp] species=[Zr] units=[angstrom] "; + squery += "model=[EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000]"; + lmp->input->one(squery); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst")) == + "3.234055244384789")); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("variable latconst delete"); + lmp->input->one("clear"); + lmp->input->one("kim init EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000 metal"); squery = "kim query latconst list get_lattice_constant_hexagonal "; squery += "crystal=[hcp] species=[Zr] units=[angstrom]"; @@ -495,11 +566,7 @@ TEST_F(KimCommandsTest, kim_query) if (!verbose) ::testing::internal::GetCapturedStdout(); ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst")) == - std::string("3.234055244384789 5.167650199630013"))); - - squery = "kim query latconst list get_lattice_constant_hexagonal "; - squery += "crystal=[bcc] species=[Zr] units=[angstrom]"; - TEST_FAILURE(".*ERROR: OpenKIM query failed:.*", lmp->input->one(squery);); + "3.234055244384789 5.167650199630013")); if (!verbose) ::testing::internal::CaptureStdout(); lmp->input->one("clear"); @@ -512,7 +579,28 @@ TEST_F(KimCommandsTest, kim_query) if (!verbose) ::testing::internal::GetCapturedStdout(); ASSERT_TRUE((std::string(lmp->input->variable->retrieve("alpha")) == - std::string("1.654960564704273e-05"))); + "1.654960564704273e-05")); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("clear"); + + squery = "kim query model_list list get_available_models "; + squery += "species=[Al]"; + lmp->input->one(squery); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + std::string model_list = lmp->input->variable->retrieve("model_list"); + auto n = model_list.find("EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005"); + ASSERT_TRUE(n != std::string::npos); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("clear"); + + squery = "kim query model_name index get_available_models "; + squery += "species=[Al]"; + lmp->input->one(squery); + lmp->input->one("variable model_name delete"); + if (!verbose) ::testing::internal::GetCapturedStdout(); #endif } } // namespace LAMMPS_NS From 8f55701da85bc28794412390a65eb3a06df72d28 Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Fri, 12 Feb 2021 06:05:41 -0600 Subject: [PATCH 243/384] adding 'kim query' command examples --- examples/kim/in.kim-query | 76 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 examples/kim/in.kim-query diff --git a/examples/kim/in.kim-query b/examples/kim/in.kim-query new file mode 100644 index 0000000000..a0d1379372 --- /dev/null +++ b/examples/kim/in.kim-query @@ -0,0 +1,76 @@ +# kim query example +# +# Requirement: +# +# This example requires LAMMPS is built with KIM package. A requirement for +# the KIM package, is the KIM API library that must be downloaded from the +# OpenKIM website and installed before LAMMPS is compiled. The 'kim query' +# command requires the libcurl library to be installed. See the +# `https://lammps.sandia.gov/doc/Build_extras.html#kim` doc page for further +# details +# +# This example requires that the KIM Models +# `EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005` +# and +# `EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000` +# are installed. +# +# This can be done with the commands +# `kim-api-collections-management install user `EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005` +# `kim-api-collections-management install user `EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000` +# +# If these commands do not work, you may need to setup your PATH to find the utility. +# If you installed the kim-api using the LAMMPS CMake build, you can do the following +# (where the current working directory is assumed to be the LAMMPS build directory) +# source ./kim_build-prefix/bin/kim-api-activate +# If you installed the kim-api using the LAMMPS Make build, you can do the following +# (where the current working directory is assumed to be the LAMMPS src directory) +# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate +# (where you should relplace X.Y.Z with the appropriate kim-api version number). +# +# Or, see https://openkim.org/doc/obtaining-models for alternative options. +# + +# ----------------------------------------------- +# Get an equilibrium fcc crystal lattice constant +# ----------------------------------------------- +kim init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal +kim query latconst_1 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] +print "FCC lattice constant (EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005) = ${latconst_1}" +# Get the lattice contant from a different model +kim query latconst_2 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005] +print "FCC lattice constant (EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005) = ${latconst_2}" +clear + + +# ----------------------------------------------- +# Get an equilibrium fcc crystal lattice constant +# ----------------------------------------------- +kim query latconst_1 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005] +kim query latconst_2 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005] +print "FCC lattice constant (EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005) = ${latconst_1}" +print "FCC lattice constant (EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005) = ${latconst_2}" +clear + + +# ----------------------------------------------- +# Get an equilibrium hcp crystal lattice constant +# ----------------------------------------------- +kim init EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000 metal +kim query latconst split get_lattice_constant_hexagonal crystal=["hcp"] species=["Zr"] units=["angstrom"] +print "HCP lattice constants = ${latconst_1}, ${latconst_2}" +clear + + +# ----------------------------------------------- +# Query for KIM models from openkim.org +# Get all the EAM models that support Al +# ----------------------------------------------- +kim query model index get_available_models species=[Al] potential_type=[eam] +label model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +print "FCC lattice constant (${model}) = ${latconst}" +next model +jump SELF model_loop +clear + From 2aa326c8273c144d0bb0f8aaee27ac432db3dc7d Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Fri, 12 Feb 2021 10:56:48 -0500 Subject: [PATCH 244/384] bond/react: same-type initiators fix previously, if/when a reaction happens could depend on the order of listed initiator atoms, if they have the same type, in some cases --- src/USER-REACTION/fix_bond_react.cpp | 17 +++++++++++------ src/USER-REACTION/fix_bond_react.h | 0 2 files changed, 11 insertions(+), 6 deletions(-) mode change 100644 => 100755 src/USER-REACTION/fix_bond_react.cpp mode change 100644 => 100755 src/USER-REACTION/fix_bond_react.h diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp old mode 100644 new mode 100755 index 3098a1bd67..c4ffbea4fc --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -1031,23 +1031,28 @@ void FixBondReact::post_integrate() if (finalpartner[i] == 0) continue; j = atom->map(finalpartner[i]); - // if (j < 0 || tag[i] < tag[j]) { - if (tag[i] < tag[j]) { //atom->map(std::min(tag[i],tag[j])) <= nlocal && - if (nattempt[rxnID] == maxattempt) { + if (tag[i] < tag[j]) { + if (nattempt[rxnID] > maxattempt-2) { maxattempt += DELTA; - // third column of 'attempt': bond/react integer ID + // third dim of 'attempt': bond/react integer ID memory->grow(attempt,maxattempt,2,nreacts,"bond/react:attempt"); } // to ensure types remain in same order - // unnecessary now taken from reaction map file if (iatomtype[rxnID] == type[i]) { attempt[nattempt[rxnID]][0][rxnID] = tag[i]; attempt[nattempt[rxnID]][1][rxnID] = finalpartner[i]; + nattempt[rxnID]++; + // add another attempt if initiator atoms are same type + if (iatomtype[rxnID] == jatomtype[rxnID]) { + attempt[nattempt[rxnID]][0][rxnID] = finalpartner[i]; + attempt[nattempt[rxnID]][1][rxnID] = tag[i]; + nattempt[rxnID]++; + } } else { attempt[nattempt[rxnID]][0][rxnID] = finalpartner[i]; attempt[nattempt[rxnID]][1][rxnID] = tag[i]; + nattempt[rxnID]++; } - nattempt[rxnID]++; } } } diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h old mode 100644 new mode 100755 From a60853cca6c85e0dc6f5626c1d8d47f9b41c5a9d Mon Sep 17 00:00:00 2001 From: jrgissing Date: Sat, 13 Feb 2021 14:39:28 -0500 Subject: [PATCH 245/384] memory leak introduced in recent 'create atoms' feature --- src/USER-REACTION/fix_bond_react.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index c4ffbea4fc..1ec29efacd 100755 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -2710,7 +2710,7 @@ update molecule IDs, charges, types, special lists and all topology void FixBondReact::update_everything() { - int nlocal; // must be defined after create_atoms + int nlocal = atom->nlocal; // must be redefined after create atoms int *type = atom->type; int **nspecial = atom->nspecial; tagint **special = atom->special; @@ -2722,6 +2722,9 @@ void FixBondReact::update_everything() // used when deleting atoms int ndel,ndelone; int *mark; + int nmark = nlocal; + memory->create(mark,nmark,"bond/react:mark"); + for (int i = 0; i < nmark; i++) mark[i] = 0; tagint *tag = atom->tag; AtomVec *avec = atom->avec; @@ -2783,8 +2786,11 @@ void FixBondReact::update_everything() // mark to-delete atoms nlocal = atom->nlocal; - mark = new int[nlocal]; - for (int i = 0; i < nlocal; i++) mark[i] = 0; + if (nlocal > nmark) { + memory->grow(mark,nlocal,"bond/react:mark"); + for (int i = nmark; i < nlocal; i++) mark[i] = 0; + nmark = nlocal; + } for (int i = 0; i < update_num_mega; i++) { rxnID = update_mega_glove[0][i]; onemol = atom->molecules[unreacted_mol[rxnID]]; @@ -3233,7 +3239,7 @@ void FixBondReact::update_everything() } } } - delete [] mark; + memory->destroy(mark); MPI_Allreduce(&ndelone,&ndel,1,MPI_INT,MPI_SUM,world); From 91f74cf9569f796dad61ec0e5eadb70c492ffac0 Mon Sep 17 00:00:00 2001 From: jrgissing Date: Sat, 13 Feb 2021 20:48:31 +0000 Subject: [PATCH 246/384] permissions! --- src/USER-REACTION/fix_bond_react.cpp | 0 src/USER-REACTION/fix_bond_react.h | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 src/USER-REACTION/fix_bond_react.cpp mode change 100755 => 100644 src/USER-REACTION/fix_bond_react.h diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp old mode 100755 new mode 100644 diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h old mode 100755 new mode 100644 From e7e2d2323be2885eb2e496f08ff6fb6de47ab1f7 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 15 Feb 2021 08:20:50 -0800 Subject: [PATCH 247/384] Feb2021 GPU Package Update - GPU Package Files --- lib/gpu/Makefile.cuda_mps | 2 +- lib/gpu/Makefile.hip | 2 +- lib/gpu/Makefile.lammps.mac_ocl | 2 +- lib/gpu/Makefile.linux_opencl | 15 +- lib/gpu/Makefile.mac_opencl | 10 +- lib/gpu/Makefile.mac_opencl_mpi | 23 + lib/gpu/Makefile.oneapi | 26 + lib/gpu/Nvidia.makefile | 13 +- lib/gpu/Opencl.makefile | 78 +- lib/gpu/README | 361 ++++--- lib/gpu/geryon/hip_device.h | 44 +- lib/gpu/geryon/hip_kernel.h | 4 +- lib/gpu/geryon/hip_texture.h | 31 + lib/gpu/geryon/nvd_device.h | 44 +- lib/gpu/geryon/nvd_kernel.h | 24 +- lib/gpu/geryon/nvd_texture.h | 42 +- lib/gpu/geryon/ocl_device.h | 320 +++++- lib/gpu/geryon/ocl_kernel.h | 115 +- lib/gpu/geryon/ocl_macros.h | 8 - lib/gpu/geryon/ocl_memory.h | 50 +- lib/gpu/geryon/ocl_texture.h | 53 + lib/gpu/geryon/ocl_timer.h | 7 +- lib/gpu/geryon/ucl_basemat.h | 10 +- lib/gpu/geryon/ucl_d_vec.h | 2 +- lib/gpu/geryon/ucl_get_devices.cpp | 4 +- lib/gpu/geryon/ucl_h_mat.h | 2 +- lib/gpu/geryon/ucl_h_vec.h | 8 +- lib/gpu/geryon/ucl_vector.h | 4 +- lib/gpu/lal_answer.cpp | 173 ++- lib/gpu/lal_answer.h | 16 +- lib/gpu/lal_atom.cpp | 4 +- lib/gpu/lal_atom.h | 75 +- lib/gpu/lal_aux_fun1.h | 599 ++++++++--- lib/gpu/lal_base_atomic.cpp | 137 ++- lib/gpu/lal_base_atomic.h | 25 +- lib/gpu/lal_base_charge.cpp | 128 ++- lib/gpu/lal_base_charge.h | 16 +- lib/gpu/lal_base_dipole.cpp | 105 +- lib/gpu/lal_base_dipole.h | 17 +- lib/gpu/lal_base_dpd.cpp | 134 ++- lib/gpu/lal_base_dpd.h | 23 +- lib/gpu/lal_base_ellipsoid.cpp | 153 ++- lib/gpu/lal_base_ellipsoid.h | 41 +- lib/gpu/lal_base_three.cpp | 220 ++-- lib/gpu/lal_base_three.h | 58 +- lib/gpu/lal_beck.cpp | 18 +- lib/gpu/lal_beck.cu | 42 +- lib/gpu/lal_beck.h | 2 +- lib/gpu/lal_beck_ext.cpp | 4 +- lib/gpu/lal_born.cpp | 18 +- lib/gpu/lal_born.cu | 44 +- lib/gpu/lal_born.h | 2 +- lib/gpu/lal_born_coul_long.cpp | 18 +- lib/gpu/lal_born_coul_long.cu | 48 +- lib/gpu/lal_born_coul_long.h | 2 +- lib/gpu/lal_born_coul_long_cs.cu | 48 +- lib/gpu/lal_born_coul_long_cs_ext.cpp | 4 +- lib/gpu/lal_born_coul_long_ext.cpp | 4 +- lib/gpu/lal_born_coul_wolf.cpp | 18 +- lib/gpu/lal_born_coul_wolf.cu | 53 +- lib/gpu/lal_born_coul_wolf.h | 2 +- lib/gpu/lal_born_coul_wolf_cs.cu | 52 +- lib/gpu/lal_born_coul_wolf_cs_ext.cpp | 4 +- lib/gpu/lal_born_coul_wolf_ext.cpp | 4 +- lib/gpu/lal_born_ext.cpp | 4 +- lib/gpu/lal_buck.cpp | 18 +- lib/gpu/lal_buck.cu | 44 +- lib/gpu/lal_buck.h | 2 +- lib/gpu/lal_buck_coul.cpp | 18 +- lib/gpu/lal_buck_coul.cu | 48 +- lib/gpu/lal_buck_coul.h | 2 +- lib/gpu/lal_buck_coul_ext.cpp | 4 +- lib/gpu/lal_buck_coul_long.cpp | 18 +- lib/gpu/lal_buck_coul_long.cu | 48 +- lib/gpu/lal_buck_coul_long.h | 2 +- lib/gpu/lal_buck_coul_long_ext.cpp | 4 +- lib/gpu/lal_buck_ext.cpp | 4 +- lib/gpu/lal_charmm.cpp | 166 +++ lib/gpu/lal_charmm.cu | 303 ++++++ lib/gpu/lal_charmm.h | 89 ++ lib/gpu/lal_charmm_ext.cpp | 137 +++ lib/gpu/lal_charmm_long.cpp | 18 +- lib/gpu/lal_charmm_long.cu | 47 +- lib/gpu/lal_charmm_long.h | 2 +- lib/gpu/lal_charmm_long_ext.cpp | 4 +- lib/gpu/lal_colloid.cpp | 18 +- lib/gpu/lal_colloid.cu | 44 +- lib/gpu/lal_colloid.h | 2 +- lib/gpu/lal_colloid_ext.cpp | 4 +- lib/gpu/lal_coul.cpp | 18 +- lib/gpu/lal_coul.cu | 46 +- lib/gpu/lal_coul.h | 2 +- lib/gpu/lal_coul_debye.cpp | 18 +- lib/gpu/lal_coul_debye.cu | 47 +- lib/gpu/lal_coul_debye.h | 2 +- lib/gpu/lal_coul_debye_ext.cpp | 4 +- lib/gpu/lal_coul_dsf.cpp | 18 +- lib/gpu/lal_coul_dsf.cu | 51 +- lib/gpu/lal_coul_dsf.h | 2 +- lib/gpu/lal_coul_dsf_ext.cpp | 4 +- lib/gpu/lal_coul_ext.cpp | 4 +- lib/gpu/lal_coul_long.cpp | 18 +- lib/gpu/lal_coul_long.cu | 140 +-- lib/gpu/lal_coul_long.h | 2 +- lib/gpu/lal_coul_long_cs.cu | 141 +-- lib/gpu/lal_coul_long_cs_ext.cpp | 4 +- lib/gpu/lal_coul_long_ext.cpp | 4 +- lib/gpu/lal_device.cpp | 594 ++++++++--- lib/gpu/lal_device.cu | 42 +- lib/gpu/lal_device.h | 114 +- lib/gpu/lal_dipole_lj.cpp | 18 +- lib/gpu/lal_dipole_lj.cu | 297 ++++-- lib/gpu/lal_dipole_lj.h | 2 +- lib/gpu/lal_dipole_lj_ext.cpp | 4 +- lib/gpu/lal_dipole_lj_sf.cpp | 18 +- lib/gpu/lal_dipole_lj_sf.cu | 298 ++++-- lib/gpu/lal_dipole_lj_sf.h | 2 +- lib/gpu/lal_dipole_lj_sf_ext.cpp | 4 +- lib/gpu/lal_dipole_long_lj.cpp | 18 +- lib/gpu/lal_dipole_long_lj.cu | 297 ++++-- lib/gpu/lal_dipole_long_lj.h | 2 +- lib/gpu/lal_dipole_long_lj_ext.cpp | 4 +- lib/gpu/lal_dpd.cpp | 38 +- lib/gpu/lal_dpd.cu | 88 +- lib/gpu/lal_dpd.h | 2 +- lib/gpu/lal_dpd_ext.cpp | 4 +- lib/gpu/lal_eam.cpp | 89 +- lib/gpu/lal_eam.cu | 213 ++-- lib/gpu/lal_eam.h | 6 +- lib/gpu/lal_eam_alloy_ext.cpp | 4 +- lib/gpu/lal_eam_ext.cpp | 6 +- lib/gpu/lal_eam_fs_ext.cpp | 4 +- lib/gpu/lal_ellipsoid_extra.h | 122 ++- lib/gpu/lal_ellipsoid_nbor.cu | 27 +- lib/gpu/lal_gauss.cpp | 20 +- lib/gpu/lal_gauss.cu | 51 +- lib/gpu/lal_gauss.h | 2 +- lib/gpu/lal_gauss_ext.cpp | 4 +- lib/gpu/lal_gayberne.cpp | 36 +- lib/gpu/lal_gayberne.cu | 34 +- lib/gpu/lal_gayberne.h | 2 +- lib/gpu/lal_gayberne_lj.cu | 94 +- lib/gpu/lal_lj.cpp | 39 +- lib/gpu/lal_lj.cu | 96 +- lib/gpu/lal_lj.h | 2 +- lib/gpu/lal_lj96.cpp | 18 +- lib/gpu/lal_lj96.cu | 44 +- lib/gpu/lal_lj96.h | 2 +- lib/gpu/lal_lj96_ext.cpp | 4 +- lib/gpu/lal_lj_class2_long.cpp | 18 +- lib/gpu/lal_lj_class2_long.cu | 48 +- lib/gpu/lal_lj_class2_long.h | 2 +- lib/gpu/lal_lj_class2_long_ext.cpp | 4 +- lib/gpu/lal_lj_coul.cpp | 18 +- lib/gpu/lal_lj_coul.cu | 48 +- lib/gpu/lal_lj_coul.h | 2 +- lib/gpu/lal_lj_coul_debye.cpp | 18 +- lib/gpu/lal_lj_coul_debye.cu | 48 +- lib/gpu/lal_lj_coul_debye.h | 2 +- lib/gpu/lal_lj_coul_debye_ext.cpp | 4 +- lib/gpu/lal_lj_coul_ext.cpp | 4 +- lib/gpu/lal_lj_coul_long.cpp | 18 +- lib/gpu/lal_lj_coul_long.cu | 48 +- lib/gpu/lal_lj_coul_long.h | 2 +- lib/gpu/lal_lj_coul_long_ext.cpp | 4 +- lib/gpu/lal_lj_coul_msm.cpp | 18 +- lib/gpu/lal_lj_coul_msm.cu | 53 +- lib/gpu/lal_lj_coul_msm.h | 2 +- lib/gpu/lal_lj_coul_msm_ext.cpp | 4 +- lib/gpu/lal_lj_cubic.cpp | 18 +- lib/gpu/lal_lj_cubic.cu | 44 +- lib/gpu/lal_lj_cubic.h | 2 +- lib/gpu/lal_lj_cubic_ext.cpp | 4 +- lib/gpu/lal_lj_dsf.cpp | 18 +- lib/gpu/lal_lj_dsf.cu | 53 +- lib/gpu/lal_lj_dsf.h | 2 +- lib/gpu/lal_lj_dsf_ext.cpp | 4 +- lib/gpu/lal_lj_expand.cpp | 18 +- lib/gpu/lal_lj_expand.cu | 44 +- lib/gpu/lal_lj_expand.h | 2 +- lib/gpu/lal_lj_expand_coul_long.cpp | 18 +- lib/gpu/lal_lj_expand_coul_long.cu | 46 +- lib/gpu/lal_lj_expand_coul_long.h | 2 +- lib/gpu/lal_lj_expand_coul_long_ext.cpp | 4 +- lib/gpu/lal_lj_expand_ext.cpp | 4 +- lib/gpu/lal_lj_ext.cpp | 4 +- lib/gpu/lal_lj_gromacs.cpp | 18 +- lib/gpu/lal_lj_gromacs.cu | 43 +- lib/gpu/lal_lj_gromacs.h | 2 +- lib/gpu/lal_lj_gromacs_ext.cpp | 4 +- lib/gpu/lal_lj_sdk.cpp | 18 +- lib/gpu/lal_lj_sdk.cu | 45 +- lib/gpu/lal_lj_sdk.h | 2 +- lib/gpu/lal_lj_sdk_ext.cpp | 4 +- lib/gpu/lal_lj_sdk_long.cpp | 18 +- lib/gpu/lal_lj_sdk_long.cu | 47 +- lib/gpu/lal_lj_sdk_long.h | 2 +- lib/gpu/lal_lj_sdk_long_ext.cpp | 4 +- lib/gpu/lal_lj_tip4p_long.cpp | 93 +- lib/gpu/lal_lj_tip4p_long.cu | 192 ++-- lib/gpu/lal_lj_tip4p_long.h | 17 +- lib/gpu/lal_lj_tip4p_long_ext.cpp | 6 +- lib/gpu/lal_mie.cpp | 18 +- lib/gpu/lal_mie.cu | 43 +- lib/gpu/lal_mie.h | 2 +- lib/gpu/lal_mie_ext.cpp | 4 +- lib/gpu/lal_morse.cpp | 18 +- lib/gpu/lal_morse.cu | 45 +- lib/gpu/lal_morse.h | 2 +- lib/gpu/lal_morse_ext.cpp | 4 +- lib/gpu/lal_neighbor.cpp | 414 ++++++-- lib/gpu/lal_neighbor.h | 120 ++- lib/gpu/lal_neighbor_cpu.cu | 4 +- lib/gpu/lal_neighbor_gpu.cu | 238 ++++- lib/gpu/lal_neighbor_shared.cpp | 44 +- lib/gpu/lal_neighbor_shared.h | 40 + lib/gpu/lal_pppm.cpp | 20 +- lib/gpu/lal_pppm.cu | 3 + lib/gpu/lal_pppm_ext.cpp | 6 +- lib/gpu/lal_pre_cuda_hip.h | 355 +++++++ lib/gpu/lal_pre_ocl_config.h | 53 + lib/gpu/lal_precision.h | 63 +- lib/gpu/lal_preprocessor.h | 778 ++++---------- lib/gpu/lal_re_squared.cpp | 39 +- lib/gpu/lal_re_squared.cu | 42 +- lib/gpu/lal_re_squared.h | 2 +- lib/gpu/lal_re_squared_lj.cu | 232 ++-- lib/gpu/lal_soft.cpp | 18 +- lib/gpu/lal_soft.cu | 42 +- lib/gpu/lal_soft.h | 2 +- lib/gpu/lal_soft_ext.cpp | 4 +- lib/gpu/lal_sw.cpp | 266 ++--- lib/gpu/lal_sw.cu | 912 ++++++++-------- lib/gpu/lal_sw.h | 40 +- lib/gpu/lal_sw_ext.cpp | 35 +- lib/gpu/lal_table.cpp | 91 +- lib/gpu/lal_table.cu | 169 +-- lib/gpu/lal_table.h | 9 +- lib/gpu/lal_table_ext.cpp | 4 +- lib/gpu/lal_tersoff.cpp | 260 ++--- lib/gpu/lal_tersoff.cu | 1108 ++++++++++---------- lib/gpu/lal_tersoff.h | 27 +- lib/gpu/lal_tersoff_ext.cpp | 6 +- lib/gpu/lal_tersoff_extra.h | 238 ++--- lib/gpu/lal_tersoff_mod.cpp | 224 ++-- lib/gpu/lal_tersoff_mod.cu | 708 ++++++------- lib/gpu/lal_tersoff_mod.h | 10 +- lib/gpu/lal_tersoff_mod_ext.cpp | 6 +- lib/gpu/lal_tersoff_zbl.cpp | 237 +++-- lib/gpu/lal_tersoff_zbl.cu | 692 ++++++------ lib/gpu/lal_tersoff_zbl.h | 10 +- lib/gpu/lal_tersoff_zbl_ext.cpp | 6 +- lib/gpu/lal_ufm.cpp | 18 +- lib/gpu/lal_ufm.cu | 44 +- lib/gpu/lal_ufm.h | 2 +- lib/gpu/lal_ufm_ext.cpp | 4 +- lib/gpu/lal_vashishta.cpp | 102 +- lib/gpu/lal_vashishta.cu | 520 ++++----- lib/gpu/lal_vashishta.h | 7 +- lib/gpu/lal_vashishta_ext.cpp | 14 +- lib/gpu/lal_yukawa.cpp | 18 +- lib/gpu/lal_yukawa.cu | 42 +- lib/gpu/lal_yukawa.h | 2 +- lib/gpu/lal_yukawa_colloid.cpp | 67 +- lib/gpu/lal_yukawa_colloid.cu | 47 +- lib/gpu/lal_yukawa_colloid.h | 2 +- lib/gpu/lal_yukawa_colloid_ext.cpp | 4 +- lib/gpu/lal_yukawa_ext.cpp | 4 +- lib/gpu/lal_zbl.cpp | 18 +- lib/gpu/lal_zbl.cu | 42 +- lib/gpu/lal_zbl.h | 2 +- lib/gpu/lal_zbl_ext.cpp | 4 +- src/GPU/Install.sh | 13 + src/GPU/fix_gpu.cpp | 70 +- src/GPU/fix_gpu.h | 11 + src/GPU/fix_nh_gpu.cpp | 552 ++++++++++ src/GPU/fix_nh_gpu.h | 164 +++ src/GPU/fix_npt_gpu.cpp | 68 ++ src/GPU/fix_npt_gpu.h | 52 + src/GPU/fix_nve_asphere_gpu.cpp | 440 ++++++++ src/GPU/fix_nve_asphere_gpu.h | 63 ++ src/GPU/fix_nve_gpu.cpp | 291 +++++ src/GPU/fix_nve_gpu.h | 60 ++ src/GPU/fix_nvt_gpu.cpp | 50 + src/GPU/fix_nvt_gpu.h | 52 + src/GPU/gpu_extra.h | 41 +- src/GPU/pair_beck_gpu.cpp | 9 +- src/GPU/pair_born_coul_long_cs_gpu.cpp | 21 +- src/GPU/pair_born_coul_long_gpu.cpp | 3 +- src/GPU/pair_born_coul_wolf_cs_gpu.cpp | 39 +- src/GPU/pair_born_coul_wolf_gpu.cpp | 11 +- src/GPU/pair_born_gpu.cpp | 15 +- src/GPU/pair_buck_coul_cut_gpu.cpp | 3 +- src/GPU/pair_buck_coul_long_gpu.cpp | 3 +- src/GPU/pair_buck_gpu.cpp | 7 +- src/GPU/pair_colloid_gpu.cpp | 21 +- src/GPU/pair_coul_cut_gpu.cpp | 29 +- src/GPU/pair_coul_debye_gpu.cpp | 29 +- src/GPU/pair_coul_dsf_gpu.cpp | 9 +- src/GPU/pair_coul_long_cs_gpu.cpp | 37 +- src/GPU/pair_coul_long_gpu.cpp | 3 +- src/GPU/pair_dpd_gpu.cpp | 7 +- src/GPU/pair_dpd_tstat_gpu.cpp | 25 +- src/GPU/pair_eam_alloy_gpu.cpp | 33 +- src/GPU/pair_eam_fs_gpu.cpp | 26 +- src/GPU/pair_eam_gpu.cpp | 14 +- src/GPU/pair_gauss_gpu.cpp | 18 +- src/GPU/pair_gayberne_gpu.cpp | 9 +- src/GPU/pair_lj96_cut_gpu.cpp | 3 +- src/GPU/pair_lj_charmm_coul_charmm_gpu.cpp | 309 ++++++ src/GPU/pair_lj_charmm_coul_charmm_gpu.h | 62 ++ src/GPU/pair_lj_charmm_coul_long_gpu.cpp | 3 +- src/GPU/pair_lj_class2_coul_long_gpu.cpp | 3 +- src/GPU/pair_lj_class2_gpu.cpp | 3 +- src/GPU/pair_lj_cubic_gpu.cpp | 25 +- src/GPU/pair_lj_cut_coul_cut_gpu.cpp | 11 +- src/GPU/pair_lj_cut_coul_debye_gpu.cpp | 21 +- src/GPU/pair_lj_cut_coul_dsf_gpu.cpp | 9 +- src/GPU/pair_lj_cut_coul_long_gpu.cpp | 7 +- src/GPU/pair_lj_cut_coul_msm_gpu.cpp | 15 +- src/GPU/pair_lj_cut_dipole_cut_gpu.cpp | 3 +- src/GPU/pair_lj_cut_dipole_long_gpu.cpp | 44 +- src/GPU/pair_lj_cut_gpu.cpp | 13 +- src/GPU/pair_lj_cut_tip4p_long_gpu.cpp | 3 +- src/GPU/pair_lj_expand_coul_long_gpu.cpp | 45 +- src/GPU/pair_lj_expand_gpu.cpp | 7 +- src/GPU/pair_lj_gromacs_gpu.cpp | 20 +- src/GPU/pair_lj_sdk_coul_long_gpu.cpp | 3 +- src/GPU/pair_lj_sdk_gpu.cpp | 3 +- src/GPU/pair_lj_sf_dipole_sf_gpu.cpp | 23 +- src/GPU/pair_mie_cut_gpu.cpp | 9 +- src/GPU/pair_morse_gpu.cpp | 9 +- src/GPU/pair_resquared_gpu.cpp | 17 +- src/GPU/pair_soft_gpu.cpp | 17 +- src/GPU/pair_sw_gpu.cpp | 146 +-- src/GPU/pair_table_gpu.cpp | 4 +- src/GPU/pair_tersoff_gpu.cpp | 6 +- src/GPU/pair_tersoff_mod_gpu.cpp | 13 +- src/GPU/pair_tersoff_zbl_gpu.cpp | 6 +- src/GPU/pair_ufm_gpu.cpp | 36 +- src/GPU/pair_vashishta_gpu.cpp | 48 +- src/GPU/pair_yukawa_colloid_gpu.cpp | 36 +- src/GPU/pair_yukawa_gpu.cpp | 11 +- src/GPU/pair_zbl_gpu.cpp | 9 +- src/GPU/pppm_gpu.cpp | 34 +- 345 files changed, 13424 insertions(+), 7708 deletions(-) create mode 100644 lib/gpu/Makefile.mac_opencl_mpi create mode 100644 lib/gpu/Makefile.oneapi create mode 100644 lib/gpu/lal_charmm.cpp create mode 100644 lib/gpu/lal_charmm.cu create mode 100644 lib/gpu/lal_charmm.h create mode 100644 lib/gpu/lal_charmm_ext.cpp create mode 100644 lib/gpu/lal_pre_cuda_hip.h create mode 100644 lib/gpu/lal_pre_ocl_config.h create mode 100644 src/GPU/fix_nh_gpu.cpp create mode 100644 src/GPU/fix_nh_gpu.h create mode 100644 src/GPU/fix_npt_gpu.cpp create mode 100644 src/GPU/fix_npt_gpu.h create mode 100644 src/GPU/fix_nve_asphere_gpu.cpp create mode 100644 src/GPU/fix_nve_asphere_gpu.h create mode 100644 src/GPU/fix_nve_gpu.cpp create mode 100644 src/GPU/fix_nve_gpu.h create mode 100644 src/GPU/fix_nvt_gpu.cpp create mode 100644 src/GPU/fix_nvt_gpu.h create mode 100644 src/GPU/pair_lj_charmm_coul_charmm_gpu.cpp create mode 100644 src/GPU/pair_lj_charmm_coul_charmm_gpu.h diff --git a/lib/gpu/Makefile.cuda_mps b/lib/gpu/Makefile.cuda_mps index 172640ce6a..baffe99b47 100644 --- a/lib/gpu/Makefile.cuda_mps +++ b/lib/gpu/Makefile.cuda_mps @@ -51,7 +51,7 @@ BIN2C = $(CUDA_HOME)/bin/bin2c # host code compiler and settings -CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC +CUDR_CPP = mpicxx -fopenmp -fopenmp-simd -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC CUDR_OPTS = -O2 $(LMP_INC) CUDR = $(CUDR_CPP) $(CUDR_OPTS) $(CUDA_PROXY) $(CUDA_PRECISION) $(CUDA_INCLUDE) \ $(CUDPP_OPT) diff --git a/lib/gpu/Makefile.hip b/lib/gpu/Makefile.hip index e2fd3c22d7..c34823d471 100644 --- a/lib/gpu/Makefile.hip +++ b/lib/gpu/Makefile.hip @@ -17,7 +17,7 @@ LMP_INC = -DLAMMPS_SMALLBIG HIP_PRECISION = -D_SINGLE_DOUBLE HIP_OPTS = -O3 -HIP_HOST_OPTS = -Wno-deprecated-declarations +HIP_HOST_OPTS = -Wno-deprecated-declarations -fopenmp -fopenmp-sim HIP_HOST_INCLUDE = # use device sort diff --git a/lib/gpu/Makefile.lammps.mac_ocl b/lib/gpu/Makefile.lammps.mac_ocl index f6c8a36430..0073efa2ba 100644 --- a/lib/gpu/Makefile.lammps.mac_ocl +++ b/lib/gpu/Makefile.lammps.mac_ocl @@ -1,5 +1,5 @@ # Settings that the LAMMPS build will import when this package library is used -gpu_SYSINC = +gpu_SYSINC = -DFFT_SINGLE gpu_SYSLIB = -framework OpenCL gpu_SYSPATH = diff --git a/lib/gpu/Makefile.linux_opencl b/lib/gpu/Makefile.linux_opencl index 2aea7f5a46..c20e26b1f3 100644 --- a/lib/gpu/Makefile.linux_opencl +++ b/lib/gpu/Makefile.linux_opencl @@ -1,25 +1,21 @@ # /* ---------------------------------------------------------------------- -# Generic Linux Makefile for OpenCL +# Generic Linux Makefile for OpenCL - Mixed precision # ------------------------------------------------------------------------- */ # which file will be copied to Makefile.lammps EXTRAMAKE = Makefile.lammps.opencl -# OCL_TUNE = -DFERMI_OCL # -- Uncomment for NVIDIA Fermi -# OCL_TUNE = -DKEPLER_OCL # -- Uncomment for NVIDIA Kepler -# OCL_TUNE = -DCYPRESS_OCL # -- Uncomment for AMD Cypress -OCL_TUNE = -DGENERIC_OCL # -- Uncomment for generic device - # this setting should match LAMMPS Makefile # one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL LMP_INC = -DLAMMPS_SMALLBIG -OCL_INC = -I/usr/local/cuda/include # Path to CL directory -OCL_CPP = mpic++ $(DEFAULT_DEVICE) -O3 -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK $(LMP_INC) $(OCL_INC) -std=c++11 -OCL_LINK = -L/usr/local/cuda/lib64 -lOpenCL +OCL_INC = +OCL_CPP = mpic++ -std=c++11 -O3 -DMPICH_IGNORE_CXX_SEEK $(LMP_INC) $(OCL_INC) +OCL_LINK = -lOpenCL OCL_PREC = -D_SINGLE_DOUBLE +OCL_TUNE = -fopenmp -fopenmp-simd -DMPI_GERYON -DGERYON_NUMA_FISSION -DUCL_NO_EXIT BIN_DIR = ./ OBJ_DIR = ./ @@ -28,4 +24,3 @@ AR = ar BSH = /bin/sh include Opencl.makefile - diff --git a/lib/gpu/Makefile.mac_opencl b/lib/gpu/Makefile.mac_opencl index 62b58c1cef..ae7e8ca6fd 100644 --- a/lib/gpu/Makefile.mac_opencl +++ b/lib/gpu/Makefile.mac_opencl @@ -1,19 +1,17 @@ # /* ---------------------------------------------------------------------- -# Generic Mac Makefile for OpenCL +# Generic Mac Makefile for OpenCL - Single precision with FFT_SINGLE # ------------------------------------------------------------------------- */ # which file will be copied to Makefile.lammps EXTRAMAKE = Makefile.lammps.mac_ocl -OCL_TUNE = -DFERMI_OCL # -- Uncomment for NVIDIA Fermi -# OCL_TUNE = -DKEPLER_OCL # -- Uncomment for NVIDIA Kepler -# OCL_TUNE = -DCYPRESS_OCL # -- Uncomment for AMD Cypress -# OCL_TUNE = -DGENERIC_OCL # -- Uncomment for generic device +LMP_INC = -DLAMMPS_SMALLBIG -OCL_CPP = mpic++ -O3 -DMPI_GERYON -DUCL_NO_EXIT +OCL_CPP = clang++ -std=c++11 -O3 -I../../src/STUBS OCL_LINK = -framework OpenCL OCL_PREC = -D_SINGLE_SINGLE +OCL_TUNE = -DUCL_NO_EXIT BIN_DIR = ./ OBJ_DIR = ./ diff --git a/lib/gpu/Makefile.mac_opencl_mpi b/lib/gpu/Makefile.mac_opencl_mpi new file mode 100644 index 0000000000..9be9f07e93 --- /dev/null +++ b/lib/gpu/Makefile.mac_opencl_mpi @@ -0,0 +1,23 @@ +# /* ---------------------------------------------------------------------- +# Generic Mac Makefile for OpenCL - Single precision with FFT_SINGLE +# ------------------------------------------------------------------------- */ + +# which file will be copied to Makefile.lammps + +EXTRAMAKE = Makefile.lammps.mac_ocl + +LMP_INC = -DLAMMPS_SMALLBIG + +OCL_CPP = mpicxx -std=c++11 -O3 -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 +OCL_LINK = -framework OpenCL +OCL_PREC = -D_SINGLE_SINGLE +OCL_TUNE = -DUCL_NO_EXIT -DMPI_GERYON + +BIN_DIR = ./ +OBJ_DIR = ./ +LIB_DIR = ./ +AR = ar +BSH = /bin/sh + +include Opencl.makefile + diff --git a/lib/gpu/Makefile.oneapi b/lib/gpu/Makefile.oneapi new file mode 100644 index 0000000000..015ab47057 --- /dev/null +++ b/lib/gpu/Makefile.oneapi @@ -0,0 +1,26 @@ +# /* ---------------------------------------------------------------------- +# Generic Linux Makefile for OpenCL +# ------------------------------------------------------------------------- */ + +# which file will be copied to Makefile.lammps + +EXTRAMAKE = Makefile.lammps.opencl + +# this setting should match LAMMPS Makefile +# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL + +LMP_INC = -DLAMMPS_SMALLBIG + +OCL_INC = +OCL_CPP = mpiicpc -std=c++11 -xHost -O2 -qopenmp -qopenmp-simd -DMPICH_IGNORE_CXX_SEEK $(LMP_INC) $(OCL_INC) +OCL_LINK = -lOpenCL +OCL_PREC = -D_SINGLE_DOUBLE +OCL_TUNE = -DMPI_GERYON -DGERYON_NUMA_FISSION -DUCL_NO_EXIT -fp-model fast=2 -no-prec-div + +BIN_DIR = ./ +OBJ_DIR = ./ +LIB_DIR = ./ +AR = ar +BSH = /bin/sh + +include Opencl.makefile diff --git a/lib/gpu/Nvidia.makefile b/lib/gpu/Nvidia.makefile index 6716388562..d3275b890f 100644 --- a/lib/gpu/Nvidia.makefile +++ b/lib/gpu/Nvidia.makefile @@ -1,6 +1,7 @@ # Headers for Geryon UCL_H = $(wildcard ./geryon/ucl*.h) -NVD_H = $(wildcard ./geryon/nvd*.h) $(UCL_H) lal_preprocessor.h +NVD_H = $(wildcard ./geryon/nvd*.h) $(UCL_H) lal_preprocessor.h \ + lal_pre_cuda_hip.h ALL_H = $(NVD_H) $(wildcard ./lal_*.h) # Source files @@ -39,17 +40,21 @@ BIN2C = $(CUDA_HOME)/bin/bin2c # device code compilation -$(OBJ_DIR)/pppm_f.cubin: lal_pppm.cu lal_precision.h lal_preprocessor.h +$(OBJ_DIR)/pppm_f.cubin: lal_pppm.cu lal_precision.h lal_preprocessor.h \ + lal_pre_cuda_hip.h $(CUDA) --fatbin -DNV_KERNEL -Dgrdtyp=float -Dgrdtyp4=float4 -o $@ lal_pppm.cu $(OBJ_DIR)/pppm_f_cubin.h: $(OBJ_DIR)/pppm_f.cubin $(BIN2C) -c -n pppm_f $(OBJ_DIR)/pppm_f.cubin > $(OBJ_DIR)/pppm_f_cubin.h + rm $(OBJ_DIR)/pppm_f.cubin -$(OBJ_DIR)/pppm_d.cubin: lal_pppm.cu lal_precision.h lal_preprocessor.h +$(OBJ_DIR)/pppm_d.cubin: lal_pppm.cu lal_precision.h lal_preprocessor.h \ + lal_pre_cuda_hip.h $(CUDA) --fatbin -DNV_KERNEL -Dgrdtyp=double -Dgrdtyp4=double4 -o $@ lal_pppm.cu $(OBJ_DIR)/pppm_d_cubin.h: $(OBJ_DIR)/pppm_d.cubin $(BIN2C) -c -n pppm_d $(OBJ_DIR)/pppm_d.cubin > $(OBJ_DIR)/pppm_d_cubin.h + rm $(OBJ_DIR)/pppm_d.cubin $(OBJ_DIR)/%_cubin.h: lal_%.cu $(ALL_H) $(CUDA) --fatbin -DNV_KERNEL -o $(OBJ_DIR)/$*.cubin $(OBJ_DIR)/lal_$*.cu @@ -93,7 +98,7 @@ $(BIN_DIR)/nvc_get_devices: ./geryon/ucl_get_devices.cpp $(NVD_H) $(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda clean: - -rm -f $(EXECS) $(GPU_LIB) $(OBJS) $(CUDPP) $(CUHS) *.linkinfo + -rm -f $(EXECS) $(GPU_LIB) $(OBJS) $(CUDPP) $(CUHS) *.cubin *.linkinfo veryclean: clean -rm -rf *~ *.linkinfo diff --git a/lib/gpu/Opencl.makefile b/lib/gpu/Opencl.makefile index 996a564998..2ff98827d4 100644 --- a/lib/gpu/Opencl.makefile +++ b/lib/gpu/Opencl.makefile @@ -1,8 +1,15 @@ +# Common headers for kernels +PRE1_H = lal_preprocessor.h lal_aux_fun1.h + # Headers for Geryon UCL_H = $(wildcard ./geryon/ucl*.h) -OCL_H = $(wildcard ./geryon/ocl*.h) $(UCL_H) lal_preprocessor.h -PRE1_H = lal_preprocessor.h lal_aux_fun1.h -ALL_H = $(OCL_H) $(wildcard ./lal_*.h) +OCL_H = $(wildcard ./geryon/ocl*.h) $(UCL_H) lal_precision.h + +# Headers for Host files +HOST_H = lal_answer.h lal_atom.h lal_balance.h lal_base_atomic.h \ + lal_base_charge.h lal_base_dipole.h lal_base_dpd.h \ + lal_base_ellipsoid.h lal_base_three.h lal_device.h lal_neighbor.h \ + lal_neighbor_shared.h lal_pre_ocl_config.h $(OCL_H) # Source files SRCS := $(wildcard ./lal_*.cpp) @@ -28,12 +35,75 @@ OCL = $(OCL_CPP) $(OCL_PREC) $(OCL_TUNE) -DUSE_OPENCL # device code compilation +$(OBJ_DIR)/atom_cl.h: lal_atom.cu lal_preprocessor.h + $(BSH) ./geryon/file_to_cstr.sh atom lal_preprocessor.h lal_atom.cu $(OBJ_DIR)/atom_cl.h + +$(OBJ_DIR)/neighbor_cpu_cl.h: lal_neighbor_cpu.cu lal_preprocessor.h + $(BSH) ./geryon/file_to_cstr.sh neighbor_cpu lal_preprocessor.h lal_neighbor_cpu.cu $(OBJ_DIR)/neighbor_cpu_cl.h + +$(OBJ_DIR)/neighbor_gpu_cl.h: lal_neighbor_gpu.cu lal_preprocessor.h + $(BSH) ./geryon/file_to_cstr.sh neighbor_gpu lal_preprocessor.h lal_neighbor_gpu.cu $(OBJ_DIR)/neighbor_gpu_cl.h + +$(OBJ_DIR)/device_cl.h: lal_device.cu lal_preprocessor.h + $(BSH) ./geryon/file_to_cstr.sh device lal_preprocessor.h lal_device.cu $(OBJ_DIR)/device_cl.h + +$(OBJ_DIR)/pppm_cl.h: lal_pppm.cu lal_preprocessor.h + $(BSH) ./geryon/file_to_cstr.sh pppm lal_preprocessor.h lal_pppm.cu $(OBJ_DIR)/pppm_cl.h; + +$(OBJ_DIR)/ellipsoid_nbor_cl.h: lal_ellipsoid_nbor.cu lal_preprocessor.h + $(BSH) ./geryon/file_to_cstr.sh ellipsoid_nbor lal_preprocessor.h lal_ellipsoid_nbor.cu $(OBJ_DIR)/ellipsoid_nbor_cl.h + +$(OBJ_DIR)/gayberne_cl.h: lal_gayberne.cu $(PRE1_H) lal_ellipsoid_extra.h + $(BSH) ./geryon/file_to_cstr.sh gayberne $(PRE1_H) lal_ellipsoid_extra.h lal_gayberne.cu $(OBJ_DIR)/gayberne_cl.h; + +$(OBJ_DIR)/gayberne_lj_cl.h: lal_gayberne_lj.cu $(PRE1_H) lal_ellipsoid_extra.h + $(BSH) ./geryon/file_to_cstr.sh gayberne_lj $(PRE1_H) lal_ellipsoid_extra.h lal_gayberne_lj.cu $(OBJ_DIR)/gayberne_lj_cl.h; + +$(OBJ_DIR)/re_squared_cl.h: lal_re_squared.cu $(PRE1_H) lal_ellipsoid_extra.h + $(BSH) ./geryon/file_to_cstr.sh re_squared $(PRE1_H) lal_ellipsoid_extra.h lal_re_squared.cu $(OBJ_DIR)/re_squared_cl.h; + +$(OBJ_DIR)/re_squared_lj_cl.h: lal_re_squared_lj.cu $(PRE1_H) lal_ellipsoid_extra.h + $(BSH) ./geryon/file_to_cstr.sh re_squared_lj $(PRE1_H) lal_ellipsoid_extra.h lal_re_squared_lj.cu $(OBJ_DIR)/re_squared_lj_cl.h; + +$(OBJ_DIR)/tersoff_cl.h: lal_tersoff.cu $(PRE1_H) lal_tersoff_extra.h + $(BSH) ./geryon/file_to_cstr.sh tersoff $(PRE1_H) lal_tersoff_extra.h lal_tersoff.cu $(OBJ_DIR)/tersoff_cl.h; + +$(OBJ_DIR)/tersoff_mod_cl.h: lal_tersoff_mod.cu $(PRE1_H) lal_tersoff_mod_extra.h + $(BSH) ./geryon/file_to_cstr.sh tersoff_mod $(PRE1_H) lal_tersoff_mod_extra.h lal_tersoff_mod.cu $(OBJ_DIR)/tersoff_mod_cl.h; + +$(OBJ_DIR)/tersoff_zbl_cl.h: lal_tersoff_zbl.cu $(PRE1_H) lal_tersoff_zbl_extra.h + $(BSH) ./geryon/file_to_cstr.sh tersoff_zbl $(PRE1_H) lal_tersoff_zbl_extra.h lal_tersoff_zbl.cu $(OBJ_DIR)/tersoff_zbl_cl.h; + $(OBJ_DIR)/%_cl.h: lal_%.cu $(PRE1_H) $(BSH) ./geryon/file_to_cstr.sh $* $(PRE1_H) $< $@; # host code compilation -$(OBJ_DIR)/lal_%.o: lal_%.cpp $(KERS) +$(OBJ_DIR)/lal_answer.o: lal_answer.cpp $(HOST_H) + $(OCL) -o $@ -c lal_answer.cpp -I$(OBJ_DIR) + +$(OBJ_DIR)/lal_dpd_tstat_ext.o: lal_dpd_tstat_ext.cpp lal_dpd.h $(HOST_H) + $(OCL) -o $@ -c lal_dpd_tstat_ext.cpp -I$(OBJ_DIR) + +$(OBJ_DIR)/lal_eam_alloy_ext.o: lal_eam_alloy_ext.cpp lal_eam.h $(HOST_H) + $(OCL) -o $@ -c lal_eam_alloy_ext.cpp -I$(OBJ_DIR) + +$(OBJ_DIR)/lal_eam_fs_ext.o: lal_eam_fs_ext.cpp lal_eam.h $(HOST_H) + $(OCL) -o $@ -c lal_eam_fs_ext.cpp -I$(OBJ_DIR) + +$(OBJ_DIR)/lal_neighbor.o: lal_neighbor.cpp $(HOST_H) + $(OCL) -o $@ -c lal_neighbor.cpp -I$(OBJ_DIR) + +$(OBJ_DIR)/lal_neighbor_shared.o: lal_neighbor_shared.cpp $(HOST_H) + $(OCL) -o $@ -c lal_neighbor_shared.cpp -I$(OBJ_DIR) + +$(OBJ_DIR)/lal_%_ext.o: lal_%_ext.cpp lal_%.h $(HOST_H) + $(OCL) -o $@ -c $< -I$(OBJ_DIR) + +$(OBJ_DIR)/lal_base_%.o: lal_base_%.cpp $(HOST_H) + $(OCL) -o $@ -c $< -I$(OBJ_DIR) + +$(OBJ_DIR)/lal_%.o: lal_%.cpp %_cl.h $(HOST_H) $(OCL) -o $@ -c $< -I$(OBJ_DIR) $(BIN_DIR)/ocl_get_devices: ./geryon/ucl_get_devices.cpp $(OCL_H) diff --git a/lib/gpu/README b/lib/gpu/README index dfa8dcf7ff..28655836f4 100644 --- a/lib/gpu/README +++ b/lib/gpu/README @@ -1,21 +1,110 @@ -------------------------------- LAMMPS ACCELERATOR LIBRARY -------------------------------- - + W. Michael Brown (ORNL) Trung Dac Nguyen (ORNL/Northwestern) - Peng Wang (NVIDIA) + Nitin Dhamankar (Intel) Axel Kohlmeyer (Temple) + Peng Wang (NVIDIA) + Anders Hafreager (UiO) + V. Nikolskiy (HSE) + Maurice de Koning (Unicamp/Brazil) + Rodolfo Paula Leite (Unicamp/Brazil) Steve Plimpton (SNL) Inderaj Bains (NVIDIA) -------------------------------------------------------------------- -This directory has source files to build a library that LAMMPS -links against when using the GPU package. +------------------------------------------------------------------------------ -This library must be built with a C++ compiler, before LAMMPS is -built, so LAMMPS can link against it. +This directory has source files to build a library that LAMMPS links against +when using the GPU package. + +This library must be built with a C++ compiler along with CUDA, HIP, or OpenCL +before LAMMPS is built, so LAMMPS can link against it. + +This library, libgpu.a, provides routines for acceleration of certain +LAMMPS styles and neighbor list builds using CUDA, OpenCL, or ROCm HIP. + +Pair styles supported by this library are marked in the list of Pair style +potentials with a "g". See the online version at: + +https://lammps.sandia.gov/doc/Commands_pair.html + +In addition the (plain) pppm kspace style is supported as well. + +------------------------------------------------------------------------------ + DEVICE QUERY +------------------------------------------------------------------------------ +The gpu library includes binaries to check for available GPUs and their +properties. It is a good idea to run this on first use to make sure the +system and build is setup properly. Additionally, the GPU numbering for +specific selection of devices should be taking from this output. The GPU +library may split some accelerators into separate virtual accelerators for +efficient use with MPI. + +After building the GPU library, for OpenCL: + ./ocl_get_devices +and for CUDA + ./nvc_get_devices + +------------------------------------------------------------------------------ + QUICK START +------------------------------------------------------------------------------ +OpenCL: Mac without MPI: + make -f Makefile.mac_opencl -j; cd ../../src/; make mpi-stubs + make g++_serial -j + ./lmp_g++_serial -in ../bench/in.lj -log none -sf gpu + +OpenCL: Mac with MPI: + make -f Makefile.mac_opencl_mpi -j; cd ../../src/; make g++_openmpi -j + mpirun -np $NUM_MPI ./lmp_g++_openmpi -in ../bench/in.lj -log none -sf gpu + +OpenCL: Linux with Intel oneAPI: + make -f Makefile.oneapi -j; cd ../../src; make oneapi -j + export OMP_NUM_THREADS=$NUM_THREADS + mpirun -np $NUM_MPI ./lmp_oneapi -in ../bench/in.lj -log none -sf gpu + +OpenCL: Linux with MPI: + make -f Makefile.linux_opencl -j; cd ../../src; make omp -j + export OMP_NUM_THREADS=$NUM_THREADS + mpirun -np $NUM_MPI ./lmp_omp -in ../bench/in.lj -log none -sf gpu + +NVIDIA CUDA: + make -f Makefile.cuda_mps -j; cd ../../src; make omp -j + export CUDA_MPS_LOG_DIRECTORY=/tmp; export CUDA_MPS_PIPE_DIRECTORY=/tmp + nvidia-smi -i 0 -c EXCLUSIVE_PROCESS + export OMP_NUM_THREADS=$NUM_THREADS + mpirun -np $NUM_MPI ./lmp_omp -in ../bench/in.lj -log none -sf gpu + echo quit | /usr/bin/nvidia-cuda-mps-control + +AMD HIP: + make -f Makefile.hip -j; cd ../../src; make omp -j + export OMP_NUM_THREADS=$NUM_THREADS + mpirun -np $NUM_MPI ./lmp_omp -in ../bench/in.lj -log none -sf gpu + +------------------------------------------------------------------------------ + Installing oneAPI, OpenCl, CUDA, or ROCm +------------------------------------------------------------------------------ +The easiest approach is to use the linux package manger to perform the +installation from Intel, NVIDIA, etc. repositories. All are available for +free. The oneAPI installation includes Intel optimized MPI and C++ compilers, +along with many libraries. Alternatively, Intel OpenCL can also be installed +separately from the Intel repository. + +NOTE: Installation of the CUDA SDK is not required, only the CUDA toolkit. + +See: + +https://software.intel.com/content/www/us/en/develop/tools/oneapi/hpc-toolkit.html + +https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html + +https://github.com/RadeonOpenCompute/ROCm + +------------------------------------------------------------------------------ + Build Intro +------------------------------------------------------------------------------ You can type "make lib-gpu" from the src directory to see help on how to build this library via make commands, or you can do the same thing @@ -25,13 +114,13 @@ do it manually by following the instructions below. Build the library using one of the provided Makefile.* files or create your own, specific to your compiler and system. For example: -make -f Makefile.linux +make -f Makefile.linux_opencl When you are done building this library, two files should exist in this directory: -libgpu.a the library LAMMPS will link against -Makefile.lammps settings the LAMMPS Makefile will import +libgpu.a the library LAMMPS will link against +Makefile.lammps settings the LAMMPS Makefile will import Makefile.lammps is created by the make command, by copying one of the Makefile.lammps.* files. See the EXTRAMAKE setting at the top of the @@ -45,77 +134,52 @@ IMPORTANT: If you re-build the library, e.g. for a different precision Makefile.linux clean, to insure all previous derived files are removed before the new build is done. -Makefile.lammps has settings for 3 variables: - -user-gpu_SYSINC = leave blank for this package -user-gpu_SYSLIB = CUDA libraries needed by this package -user-gpu_SYSPATH = path(s) to where those libraries are - -Because you have the CUDA compilers on your system, you should have -the needed libraries. If the CUDA development tools were installed -in the standard manner, the settings in the Makefile.lammps.standard -file should work. - -------------------------------------------------------------------- - - GENERAL NOTES - -------------------------------- - -This library, libgpu.a, provides routines for GPU acceleration -of certain LAMMPS styles and neighbor list builds. Compilation of this -library requires installing the CUDA GPU driver and CUDA toolkit for -your operating system. Installation of the CUDA SDK is not necessary. -In addition to the LAMMPS library, the binary nvc_get_devices will also -be built. This can be used to query the names and properties of GPU -devices on your system. A Makefile for OpenCL and ROCm HIP compilation -is provided, but support for it is not currently provided by the developers. -Details of the implementation are provided in: - ----- - -Brown, W.M., Wang, P. Plimpton, S.J., Tharrington, A.N. Implementing -Molecular Dynamics on Hybrid High Performance Computers - Short Range -Forces. Computer Physics Communications. 2011. 182: p. 898-911. - -and - -Brown, W.M., Kohlmeyer, A. Plimpton, S.J., Tharrington, A.N. Implementing -Molecular Dynamics on Hybrid High Performance Computers - Particle-Particle -Particle-Mesh. Computer Physics Communications. 2012. 183: p. 449-459. - -and - -Brown, W.M., Masako, Y. Implementing Molecular Dynamics on Hybrid High -Performance Computers - Three-Body Potentials. Computer Physics Communications. -2013. 184: p. 2785–2793. - ----- - -NOTE: Installation of the CUDA SDK is not required, only the CUDA -toolkit itself or an OpenCL 1.2 compatible header and library. - -Pair styles supporting GPU acceleration this this library -are marked in the list of Pair style potentials with a "g". -See the online version at: https://lammps.sandia.gov/doc/Commands_pair.html - -In addition the (plain) pppm kspace style is supported as well. +NOTE: The system-specific setting LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG, + or LAMMPS_SMALLSMALL if specified when building LAMMPS (i.e. in + src/MAKE/Makefile.foo) should be consistent with that specified + when building libgpu.a (i.e. by LMP_INC in the lib/gpu/Makefile.bar). - MULTIPLE LAMMPS PROCESSES - -------------------------------- - -Multiple LAMMPS MPI processes can share GPUs on the system, but multiple -GPUs cannot be utilized by a single MPI process. In many cases, the -best performance will be obtained by running as many MPI processes as -CPU cores available with the condition that the number of MPI processes -is an integer multiple of the number of GPUs being used. See the -LAMMPS user manual for details on running with GPU acceleration. +------------------------------------------------------------------------------ + PRECISION MODES +------------------------------------------------------------------------------ +The GPU library supports 3 precision modes: single, double, and mixed, with +the latter being the default for most Makefiles aside from Mac specific +Makefiles due to the more restrictive nature of the Apple OpenCL for some +devices. + +To specify the precision mode (output to the screen before LAMMPS runs for +verification), set either CUDA_PRECISION, OCL_PREC, or HIP_PRECISION to one +of -D_SINGLE_SINGLE, -D_DOUBLE_DOUBLE, or -D_SINGLE_DOUBLE. + +Some accelerators or OpenCL implementations only support single precision. +This mode should be used with care and appropriate validation as the errors +can scale with system size in this implementation. This can be useful for +accelerating test runs when setting up a simulation for production runs on +another machine. In the case where only single precision is supported, either +LAMMPS must be compiled with -DFFT_SINGLE to use PPPM with GPU acceleration +or GPU acceleration should be disabled for PPPM (e.g. suffix off or pair/only +as described in the LAMMPS documentation). - BUILDING AND PRECISION MODES - -------------------------------- +------------------------------------------------------------------------------ + CUDA BUILD NOTES +------------------------------------------------------------------------------ +NOTE: when compiling with CMake, all of the considerations listed below +are considered within the CMake configuration process, so no separate +compilation of the gpu library is required. Also this will build in support +for all compute architecture that are supported by the CUDA toolkit version +used to build the gpu library. -To build, edit the CUDA_ARCH, CUDA_PRECISION, CUDA_HOME variables in one of +If you do not want to use a fat binary, that supports multiple CUDA +architectures, the CUDA_ARCH must be set to match the GPU architecture. This +is reported by nvc_get_devices executable created by the build process and +a detailed list of GPU architectures and CUDA compatible GPUs can be found +e.g. here: https://en.wikipedia.org/wiki/CUDA#GPUs_supported + +The CUDA_HOME variable should be set to the location of the CUDA toolkit. + +To build, edit the CUDA_ARCH, CUDA_PRECISION, CUDA_HOME variables in one of the Makefiles. CUDA_ARCH should be set based on the compute capability of your GPU. This can be verified by running the nvc_get_devices executable after the build is complete. Additionally, the GPU package must be installed and @@ -123,82 +187,93 @@ compiled for LAMMPS. This may require editing the gpu_SYSPATH variable in the LAMMPS makefile. Please note that the GPU library accesses the CUDA driver library directly, -so it needs to be linked not only to the CUDA runtime library (libcudart.so) -that ships with the CUDA toolkit, but also with the CUDA driver library -(libcuda.so) that ships with the Nvidia driver. If you are compiling LAMMPS -on the head node of a GPU cluster, this library may not be installed, -so you may need to copy it over from one of the compute nodes (best into -this directory). Recent CUDA toolkits starting from CUDA 9 provide a dummy -libcuda.so library (typically under $(CUDA_HOME)/lib64/stubs), that can be used for -linking. +so it needs to be linked with the CUDA driver library (libcuda.so) that ships +with the Nvidia driver. If you are compiling LAMMPS on the head node of a GPU +cluster, this library may not be installed, so you may need to copy it over +from one of the compute nodes (best into this directory). Recent CUDA toolkits +starting from CUDA 9 provide a dummy libcuda.so library (typically under +$(CUDA_HOME)/lib64/stubs), that can be used for linking. -The gpu library supports 3 precision modes as determined by -the CUDA_PRECISION variable: +Best performance with the GPU library is typically with multiple MPI processes +sharing the same GPU cards. For NVIDIA, this is most efficient with CUDA +MPS enabled. To prevent runtime errors for GPUs configured in exclusive process +mode with MPS, the GPU library should be build with either of the equivalent +-DCUDA_MPS_SUPPORT or -DCUDA_PROXY flags. - CUDA_PRECISION = -D_SINGLE_SINGLE # Single precision for all calculations - CUDA_PRECISION = -D_DOUBLE_DOUBLE # Double precision for all calculations - CUDA_PRECISION = -D_SINGLE_DOUBLE # Accumulation of forces, etc. in double +------------------------------------------------------------------------------ + HIP BUILD NOTES +------------------------------------------------------------------------------ -As of CUDA 7.5 only GPUs with compute capability 2.0 (Fermi) or newer are -supported and as of CUDA 9.0 only compute capability 3.0 (Kepler) or newer -are supported. There are some limitations of this library for GPUs older -than that, which require additional preprocessor flag, and limit features, -but they are kept for historical reasons. There is no value in trying to -use those GPUs for production calculations. - -You have to make sure that you set a CUDA_ARCH line suitable for your -hardware and CUDA toolkit version: e.g. -arch=sm_35 for Tesla K20 or K40 -or -arch=sm_52 GeForce GTX Titan X. A detailed list of GPU architectures -and CUDA compatible GPUs can be found e.g. here: -https://en.wikipedia.org/wiki/CUDA#GPUs_supported - -NOTE: when compiling with CMake, all of the considerations listed below -are considered within the CMake configuration process, so no separate -compilation of the gpu library is required. Also this will build in support -for all compute architecture that are supported by the CUDA toolkit version -used to build the gpu library. - -Please note the CUDA_CODE settings in Makefile.linux_multi, which allows -to compile this library with support for multiple GPUs. This list can be -extended for newer GPUs with newer CUDA toolkits and should allow to build -a single GPU library compatible with all GPUs that are worth using for -GPU acceleration and supported by the current CUDA toolkits and drivers. - -NOTE: The system-specific setting LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG, - or LAMMPS_SMALLSMALL if specified when building LAMMPS (i.e. in - src/MAKE/Makefile.foo) should be consistent with that specified - when building libgpu.a (i.e. by LMP_INC in the lib/gpu/Makefile.bar). - - BUILDING FOR HIP FRAMEWORK - -------------------------------- -1. Install the latest ROCm framework (https://github.com/RadeonOpenCompute/ROCm). -2. GPU sorting requires installing hipcub +1. GPU sorting requires installing hipcub (https://github.com/ROCmSoftwarePlatform/hipCUB). The HIP CUDA-backend additionally requires cub (https://nvlabs.github.io/cub). Download and extract the cub directory to lammps/lib/gpu/ or specify an appropriate path in lammps/lib/gpu/Makefile.hip. -3. In Makefile.hip it is possible to specify the target platform via -export HIP_PLATFORM=hcc or HIP_PLATFORM=nvcc as well as the target +2. In Makefile.hip it is possible to specify the target platform via +export HIP_PLATFORM=hcc or HIP_PLATFORM=nvcc as well as the target architecture (gfx803, gfx900, gfx906 etc.) -4. If your MPI implementation does not support `mpicxx --showme` command, +3. If your MPI implementation does not support `mpicxx --showme` command, it is required to specify the corresponding MPI compiler and linker flags in lammps/lib/gpu/Makefile.hip and in lammps/src/MAKE/OPTIONS/Makefile.hip. -5. Building the GPU library (libgpu.a): - cd lammps/lib/gpu; make -f Makefile.hip -j -6. Building the LAMMPS executable (lmp_hip): - cd ../../src; make hip -j - EXAMPLE CONVENTIONAL BUILD PROCESS - -------------------------------- - -cd ~/lammps/lib/gpu -emacs Makefile.linux -make -f Makefile.linux -./nvc_get_devices -cd ../../src -emacs ./MAKE/Makefile.linux -make yes-asphere -make yes-kspace -make yes-gpu -make linux +------------------------------------------------------------------------------ + OPENCL BUILD NOTES +------------------------------------------------------------------------------ +If GERYON_NUMA_FISSION is defined at build time, LAMMPS will consider separate +NUMA nodes on GPUs or accelerators as separate devices. For example, a 2-socket +CPU would appear as two separate devices for OpenCL (and LAMMPS would require +two MPI processes to use both sockets with the GPU library - each with its +own device ID as output by ocl_get_devices). + +For a debug build, use "-DUCL_DEBUG -DGERYON_KERNEL_DUMP" and remove +"-DUCL_NO_EXIT" and "-DMPI_GERYON" from the build options. + +------------------------------------------------------------------------------ + ALL PREPROCESSOR OPTIONS (For Advanced Users) +------------------------------------------------------------------------------ +_SINGLE_SINGLE Build library for single precision mode +_SINGLE_DOUBLE Build library for mixed precision mode +_DOUBLE_DOUBLE Build library for double precision mode +CUDA_MPS_SUPPORT Do not generate errors for exclusive mode for CUDA +CUDA_PROXY Same as above +MPI_GERYON Library should use MPI_Abort for unhandled errors +GERYON_NUMA_FISSION Accelerators with main memory NUMA are split into + multiple virtual accelerators for each NUMA node +LAL_USE_OMP=0 Disable OpenMP in lib, regardless of compiler setting +LAL_USE_OMP_SIMD=0 Disable OpenMP SIMD in lib, regardless of compiler set +GERYON_OCL_FLUSH For OpenCL, flush queue after every enqueue +LAL_NO_OCL_EV_JIT Turn off JIT specialization for kernels in OpenCL +LAL_USE_OLD_NEIGHBOR Use old neighbor list algorithm +USE_CUDPP Enable GPU binning in neighbor builds (not recommended) +USE_HIP_DEVICE_SORT Enable GPU binning for HIP builds + (only w/ LAL_USE_OLD_NEIGHBOR) +LAL_NO_BLOCK_REDUCE Use host for energy/virial accumulation +LAL_OCL_EXTRA_ARGS Supply extra args for OpenCL compiler delimited with : +UCL_NO_EXIT LAMMPS should handle errors instead of Geryon lib +UCL_DEBUG Debug build for Geryon +GERYON_KERNEL_DUMP Dump all compiled OpenCL programs with compiler + flags and build logs +GPU_CAST Casting performed on GPU, untested recently +THREE_CONCURRENT Concurrent 3-body calcs in separate queues, untested + + +------------------------------------------------------------------------------ + References for Details +------------------------------------------------------------------------------ + +Brown, W.M., Wang, P. Plimpton, S.J., Tharrington, A.N. Implementing +Molecular Dynamics on Hybrid High Performance Computers - Short Range +Forces. Computer Physics Communications. 2011. 182: p. 898-911. + +and + +Brown, W.M., Kohlmeyer, A. Plimpton, S.J., Tharrington, A.N. Implementing +Molecular Dynamics on Hybrid High Performance Computers - Particle-Particle +Particle-Mesh. Computer Physics Communications. 2012. 183: p. 449-459. + +and + +Brown, W.M., Masako, Y. Implementing Molecular Dynamics on Hybrid High +Performance Computers - Three-Body Potentials. Computer Physics Communications. +2013. 184: p. 2785–2793. diff --git a/lib/gpu/geryon/hip_device.h b/lib/gpu/geryon/hip_device.h index d2fb1919b7..373b3783b0 100644 --- a/lib/gpu/geryon/hip_device.h +++ b/lib/gpu/geryon/hip_device.h @@ -24,6 +24,8 @@ namespace ucl_hip { // -------------------------------------------------------------------------- typedef hipStream_t command_queue; +inline void ucl_flush(command_queue &cq) {} + inline void ucl_sync(hipStream_t &stream) { CU_SAFE_CALL(hipStreamSynchronize(stream)); } @@ -143,15 +145,26 @@ class UCL_Device { inline std::string device_type_name(const int i) { return "GPU"; } /// Get current device type (UCL_CPU, UCL_GPU, UCL_ACCELERATOR, UCL_DEFAULT) - inline int device_type() { return device_type(_device); } + inline enum UCL_DEVICE_TYPE device_type() { return device_type(_device); } /// Get device type (UCL_CPU, UCL_GPU, UCL_ACCELERATOR, UCL_DEFAULT) - inline int device_type(const int i) { return UCL_GPU; } + inline enum UCL_DEVICE_TYPE device_type(const int i) { return UCL_GPU; } /// Returns true if host memory is efficiently addressable from device inline bool shared_memory() { return shared_memory(_device); } /// Returns true if host memory is efficiently addressable from device inline bool shared_memory(const int i) { return device_type(i)==UCL_CPU; } + /// Returns preferred vector width + inline int preferred_fp32_width() { return preferred_fp32_width(_device); } + /// Returns preferred vector width + inline int preferred_fp32_width(const int i) + {return _properties[i].SIMDWidth;} + /// Returns preferred vector width + inline int preferred_fp64_width() { return preferred_fp64_width(_device); } + /// Returns preferred vector width + inline int preferred_fp64_width(const int i) + {return _properties[i].SIMDWidth;} + /// Returns true if double precision is support for the current device inline bool double_precision() { return double_precision(_device); } /// Returns true if double precision is support for the device @@ -215,7 +228,19 @@ class UCL_Device { /// Get the maximum number of threads per block inline size_t group_size(const int i) { return _properties[i].maxThreadsPerBlock; } - + /// Get the maximum number of threads per block in dimension 'dim' + inline size_t group_size_dim(const int dim) + { return group_size_dim(_device, dim); } + /// Get the maximum number of threads per block in dimension 'dim' + inline size_t group_size_dim(const int i, const int dim) + { return _properties[i].maxThreadsDim[dim];} + + /// Get the shared local memory size in bytes + inline size_t slm_size() { return slm_size(_device); } + /// Get the shared local memory size in bytes + inline size_t slm_size(const int i) + { return _properties[i].sharedMemPerBlock; } + /// Return the maximum memory pitch in bytes for current device inline size_t max_pitch() { return max_pitch(_device); } /// Return the maximum memory pitch in bytes @@ -255,11 +280,20 @@ class UCL_Device { inline int max_sub_devices(const int i) { return 0; } + /// True if the device supports shuffle intrinsics + inline bool has_shuffle_support() + { return has_shuffle_support(_device); } + /// True if the device supports shuffle intrinsics + inline bool has_shuffle_support(const int i) + { return arch(i)>=3.0; } + /// List all devices along with all properties inline void print_all(std::ostream &out); - /// Select the platform that has accelerators (for compatibility with OpenCL) - inline int set_platform_accelerator(int pid=-1) { return UCL_SUCCESS; } + /// For compatability with OCL API + inline int auto_set_platform(const enum UCL_DEVICE_TYPE type=UCL_GPU, + const std::string vendor="") + { return set_platform(0); } inline int load_module(const void* program, hipModule_t& module, std::string *log=nullptr){ auto it = _loaded_modules.emplace(program, hipModule_t()); diff --git a/lib/gpu/geryon/hip_kernel.h b/lib/gpu/geryon/hip_kernel.h index c5014b52e7..10bc9f1334 100644 --- a/lib/gpu/geryon/hip_kernel.h +++ b/lib/gpu/geryon/hip_kernel.h @@ -14,6 +14,7 @@ #include #include #include +#include namespace ucl_hip { @@ -64,7 +65,7 @@ class UCL_Program { } /// Load a program from a string and compile with flags - inline int load_string(const void *program, const char *flags="", std::string *log=nullptr) { + inline int load_string(const void *program, const char *flags="", std::string *log=nullptr, FILE* foutput=nullptr) { return _device_ptr->load_module(program, _module, log); } @@ -73,6 +74,7 @@ class UCL_Program { hipModule_t _module; hipStream_t _cq; friend class UCL_Texture; + friend class UCL_Const; }; /// Class for dealing with CUDA Driver kernels diff --git a/lib/gpu/geryon/hip_texture.h b/lib/gpu/geryon/hip_texture.h index ae16bee900..9117adc879 100644 --- a/lib/gpu/geryon/hip_texture.h +++ b/lib/gpu/geryon/hip_texture.h @@ -107,6 +107,37 @@ class UCL_Texture { } }; +/// Class storing a const global memory reference +class UCL_Const { + public: + UCL_Const() {} + ~UCL_Const() {} + /// Construct with a specified global reference + inline UCL_Const(UCL_Program &prog, const char *global_name) + { get_global(prog,global_name); } + /// Set the global reference for this object + inline void get_global(UCL_Program &prog, const char *global_name) { + _cq=prog.cq(); + CU_SAFE_CALL(hipModuleGetGlobal(&_global, &_global_bytes, prog._module, + global_name)); + } + /// Copy from array on host to const memory + template + inline void update_device(UCL_H_Vec &src, const int numel) { + CU_SAFE_CALL(hipMemcpyHtoDAsync(_global, src.begin(), numel*sizeof(numtyp), + _cq)); + } + /// Get device ptr associated with object + inline const void* begin() const { return &_global; } + inline void clear() {} + + private: + hipStream_t _cq; + void* _global; + size_t _global_bytes; + friend class UCL_Kernel; +}; + } // namespace #endif diff --git a/lib/gpu/geryon/nvd_device.h b/lib/gpu/geryon/nvd_device.h index 42f176bcbf..52b2ed478e 100644 --- a/lib/gpu/geryon/nvd_device.h +++ b/lib/gpu/geryon/nvd_device.h @@ -37,6 +37,8 @@ namespace ucl_cudadr { // -------------------------------------------------------------------------- typedef CUstream command_queue; +inline void ucl_flush(command_queue &cq) {} + inline void ucl_sync(CUstream &stream) { CU_SAFE_CALL(cuStreamSynchronize(stream)); } @@ -156,15 +158,26 @@ class UCL_Device { inline std::string device_type_name(const int i) { return "GPU"; } /// Get current device type (UCL_CPU, UCL_GPU, UCL_ACCELERATOR, UCL_DEFAULT) - inline int device_type() { return device_type(_device); } + inline enum UCL_DEVICE_TYPE device_type() { return device_type(_device); } /// Get device type (UCL_CPU, UCL_GPU, UCL_ACCELERATOR, UCL_DEFAULT) - inline int device_type(const int i) { return UCL_GPU; } + inline enum UCL_DEVICE_TYPE device_type(const int i) { return UCL_GPU; } /// Returns true if host memory is efficiently addressable from device inline bool shared_memory() { return shared_memory(_device); } /// Returns true if host memory is efficiently addressable from device inline bool shared_memory(const int i) { return device_type(i)==UCL_CPU; } + /// Returns preferred vector width + inline int preferred_fp32_width() { return preferred_fp32_width(_device); } + /// Returns preferred vector width + inline int preferred_fp32_width(const int i) + {return _properties[i].SIMDWidth;} + /// Returns preferred vector width + inline int preferred_fp64_width() { return preferred_fp64_width(_device); } + /// Returns preferred vector width + inline int preferred_fp64_width(const int i) + {return _properties[i].SIMDWidth;} + /// Returns true if double precision is support for the current device inline bool double_precision() { return double_precision(_device); } /// Returns true if double precision is support for the device @@ -228,6 +241,18 @@ class UCL_Device { /// Get the maximum number of threads per block inline size_t group_size(const int i) { return _properties[i].maxThreadsPerBlock; } + /// Get the maximum number of threads per block in dimension 'dim' + inline size_t group_size_dim(const int dim) + { return group_size_dim(_device, dim); } + /// Get the maximum number of threads per block in dimension 'dim' + inline size_t group_size_dim(const int i, const int dim) + { return _properties[i].maxThreadsDim[dim]; } + + /// Get the shared local memory size in bytes + inline size_t slm_size() { return slm_size(_device); } + /// Get the shared local memory size in bytes + inline size_t slm_size(const int i) + { return _properties[i].sharedMemPerBlock; } /// Return the maximum memory pitch in bytes for current device inline size_t max_pitch() { return max_pitch(_device); } @@ -268,11 +293,22 @@ class UCL_Device { inline int max_sub_devices(const int i) { return 0; } + /// True if the device supports shuffle intrinsics + inline bool has_shuffle_support() + { return has_shuffle_support(_device); } + /// True if the device supports shuffle intrinsics + inline bool has_shuffle_support(const int i) + { return arch(i)>=3.0; } + /// List all devices along with all properties inline void print_all(std::ostream &out); - /// Select the platform that has accelerators (for compatibility with OpenCL) - inline int set_platform_accelerator(int pid=-1) { return UCL_SUCCESS; } + /// For compatability with OCL API + inline int auto_set_platform(const enum UCL_DEVICE_TYPE type=UCL_GPU, + const std::string vendor="", + const int ndevices=-1, + const int first_device=-1) + { return set_platform(0); } private: int _device, _num_devices; diff --git a/lib/gpu/geryon/nvd_kernel.h b/lib/gpu/geryon/nvd_kernel.h index d74b0e2dc1..c31b8cdf9b 100644 --- a/lib/gpu/geryon/nvd_kernel.h +++ b/lib/gpu/geryon/nvd_kernel.h @@ -26,6 +26,7 @@ #include "nvd_device.h" #include +#include namespace ucl_cudadr { @@ -77,7 +78,7 @@ class UCL_Program { /// Load a program from a string and compile with flags inline int load_string(const void *program, const char *flags="", - std::string *log=nullptr) { + std::string *log=nullptr, FILE* foutput=nullptr) { if (std::string(flags)=="BINARY") return load_binary((const char *)program); const unsigned int num_opts=2; @@ -100,12 +101,25 @@ class UCL_Program { if (err != CUDA_SUCCESS) { #ifndef UCL_NO_EXIT - std::cerr << std::endl + std::cerr << std::endl << std::endl << "----------------------------------------------------------\n" << " UCL Error: Error compiling PTX Program...\n" << "----------------------------------------------------------\n"; - std::cerr << log << std::endl; + std::cerr << log << std::endl + << "----------------------------------------------------------\n\n"; #endif + if (foutput != NULL) { + fprintf(foutput,"\n\n"); + fprintf(foutput, + "----------------------------------------------------------\n"); + fprintf(foutput," UCL Error: Error compiling PTX Program...\n"); + fprintf(foutput, + "----------------------------------------------------------\n"); + fprintf(foutput,"%s\n",log); + fprintf(foutput, + "----------------------------------------------------------\n"); + fprintf(foutput,"\n\n"); + } return UCL_COMPILE_ERROR; } @@ -139,11 +153,15 @@ class UCL_Program { return UCL_SUCCESS; } + /// Return the default command queue/stream associated with this data + inline command_queue & cq() { return _cq; } + friend class UCL_Kernel; private: CUmodule _module; CUstream _cq; friend class UCL_Texture; + friend class UCL_Const; }; /// Class for dealing with CUDA Driver kernels diff --git a/lib/gpu/geryon/nvd_texture.h b/lib/gpu/geryon/nvd_texture.h index c766af826c..65f4ad9ef5 100644 --- a/lib/gpu/geryon/nvd_texture.h +++ b/lib/gpu/geryon/nvd_texture.h @@ -38,8 +38,11 @@ class UCL_Texture { inline UCL_Texture(UCL_Program &prog, const char *texture_name) { get_texture(prog,texture_name); } /// Set the texture reference for this object - inline void get_texture(UCL_Program &prog, const char *texture_name) - { CU_SAFE_CALL(cuModuleGetTexRef(&_tex, prog._module, texture_name)); } + inline void get_texture(UCL_Program &prog, const char *texture_name) { + #if (CUDA_VERSION < 11000) + CU_SAFE_CALL(cuModuleGetTexRef(&_tex, prog._module, texture_name)); + #endif + } /// Bind a float array where each fetch grabs a vector of length numel template @@ -72,11 +75,14 @@ class UCL_Texture { } private: + #if (CUDA_VERSION < 11000) CUtexref _tex; + #endif friend class UCL_Kernel; template inline void _bind_float(mat_typ &vec, const unsigned numel) { + #if (CUDA_VERSION < 11000) #ifdef UCL_DEBUG assert(numel!=0 && numel<5); #endif @@ -90,10 +96,42 @@ class UCL_Texture { else CU_SAFE_CALL(cuTexRefSetFormat(_tex,CU_AD_FORMAT_SIGNED_INT32,numel*2)); } + #endif } }; +/// Class storing a const global memory reference +class UCL_Const { + public: + UCL_Const() {} + ~UCL_Const() {} + /// Construct with a specified global reference + inline UCL_Const(UCL_Program &prog, const char *global_name) + { get_global(prog,global_name); } + /// Set the global reference for this object + inline void get_global(UCL_Program &prog, const char *global_name) { + _cq=prog.cq(); + CU_SAFE_CALL(cuModuleGetGlobal(&_global, &_global_bytes, prog._module, + global_name)); + } + /// Copy from array on host to const memory + template + inline void update_device(UCL_H_Vec &src, const int numel) { + CU_SAFE_CALL(cuMemcpyHtoDAsync(_global, src.begin(), numel*sizeof(numtyp), + _cq)); + } + /// Get device ptr associated with object + inline const CUdeviceptr * begin() const { return &_global; } + inline void clear() {} + + private: + CUstream _cq; + CUdeviceptr _global; + size_t _global_bytes; + friend class UCL_Kernel; +}; + } // namespace #endif diff --git a/lib/gpu/geryon/ocl_device.h b/lib/gpu/geryon/ocl_device.h index de4def0bc1..b0a3e3d583 100644 --- a/lib/gpu/geryon/ocl_device.h +++ b/lib/gpu/geryon/ocl_device.h @@ -28,14 +28,6 @@ #include #include -/* We default to OpenCL 1.2 as target version for now as - * there are known issues with OpenCL 2.0 and later. - * This is also to silence warnings from generic OpenCL headers */ - -#if !defined(CL_TARGET_OPENCL_VERSION) -#define CL_TARGET_OPENCL_VERSION 120 -#endif - #ifdef __APPLE__ #include #include @@ -55,17 +47,36 @@ namespace ucl_opencl { typedef cl_command_queue command_queue; typedef cl_context context_type; +inline void ucl_flush(command_queue &cq) { CL_SAFE_CALL(clFlush(cq)); } + inline void ucl_sync(cl_command_queue &cq) { CL_SAFE_CALL(clFinish(cq)); } -inline bool _shared_mem_device(cl_device_type &device_type) { +#if defined(GERYON_FORCE_SHARED_MAIN_MEM_ON) +inline bool _shared_mem_device(cl_device_id &device) { return true; } +#elif defined(GERYON_FORCE_SHARED_MAIN_MEM_OFF) +inline bool _shared_mem_device(cl_device_id &device) { return false; } +#else +inline bool _shared_mem_device(cl_device_id &device) { + #ifdef CL_VERSION_1_2 + cl_bool br; + CL_SAFE_CALL(clGetDeviceInfo(device, CL_DEVICE_HOST_UNIFIED_MEMORY, + sizeof(cl_bool), &br,NULL)); + return (br == CL_TRUE); + #else + cl_device_type device_type; + CL_SAFE_CALL(clGetDeviceInfo(device,CL_DEVICE_TYPE, + sizeof(device_type),&device_type,NULL)); return (device_type==CL_DEVICE_TYPE_CPU); + #endif } +#endif struct OCLProperties { std::string name; cl_device_type device_type; + bool is_subdevice; cl_ulong global_mem; cl_ulong shared_mem; cl_ulong const_mem; @@ -74,12 +85,16 @@ struct OCLProperties { size_t work_group_size; size_t work_item_size[3]; bool double_precision; + int preferred_vector_width32, preferred_vector_width64; int alignment; size_t timer_resolution; bool ecc_support; std::string c_version; bool partition_equal, partition_counts, partition_affinity; cl_uint max_sub_devices; + int cl_device_version; + bool has_subgroup_support; + bool has_shuffle_support; }; /// Class for looking at data parallel device properties @@ -182,16 +197,27 @@ class UCL_Device { inline std::string device_type_name(const int i); /// Get current device type (UCL_CPU, UCL_GPU, UCL_ACCELERATOR, UCL_DEFAULT) - inline int device_type() { return device_type(_device); } + inline enum UCL_DEVICE_TYPE device_type() { return device_type(_device); } /// Get device type (UCL_CPU, UCL_GPU, UCL_ACCELERATOR, UCL_DEFAULT) - inline int device_type(const int i); + inline enum UCL_DEVICE_TYPE device_type(const int i); /// Returns true if host memory is efficiently addressable from device inline bool shared_memory() { return shared_memory(_device); } /// Returns true if host memory is efficiently addressable from device inline bool shared_memory(const int i) - { return _shared_mem_device(_properties[i].device_type); } + { return _shared_mem_device(_cl_devices[i]); } + /// Returns preferred vector width + inline int preferred_fp32_width() { return preferred_fp32_width(_device); } + /// Returns preferred vector width + inline int preferred_fp32_width(const int i) + {return _properties[i].preferred_vector_width32;} + /// Returns preferred vector width + inline int preferred_fp64_width() { return preferred_fp64_width(_device); } + /// Returns preferred vector width + inline int preferred_fp64_width(const int i) + {return _properties[i].preferred_vector_width64;} + /// Returns true if double precision is support for the current device inline bool double_precision() { return double_precision(_device); } /// Returns true if double precision is support for the device @@ -242,6 +268,18 @@ class UCL_Device { /// Get the maximum number of threads per block inline size_t group_size(const int i) { return _properties[i].work_group_size; } + /// Get the maximum number of threads per block in dimension 'dim' + inline size_t group_size_dim(const int dim) + { return group_size_dim(_device, dim); } + /// Get the maximum number of threads per block in dimension 'dim' + inline size_t group_size_dim(const int i, const int dim) + { return _properties[i].work_item_size[dim]; } + + /// Get the shared local memory size in bytes + inline size_t slm_size() { return slm_size(_device); } + /// Get the shared local memory size in bytes + inline size_t slm_size(const int i) + { return _properties[i].shared_mem; } /// Return the maximum memory pitch in bytes for current device inline size_t max_pitch() { return max_pitch(_device); } @@ -256,6 +294,12 @@ class UCL_Device { inline bool sharing_supported(const int i) { return true; } + /// True if the device is a sub-device + inline bool is_subdevice() + { return is_subdevice(_device); } + /// True if the device is a sub-device + inline bool is_subdevice(const int i) + { return _properties[i].is_subdevice; } /// True if splitting device into equal subdevices supported inline bool fission_equal() { return fission_equal(_device); } @@ -274,6 +318,18 @@ class UCL_Device { /// True if splitting device into subdevices by affinity domains supported inline bool fission_by_affinity(const int i) { return _properties[i].partition_affinity; } + /// True if the device has subgroup support + inline bool has_subgroup_support() + { return has_subgroup_support(_device); } + /// True if the device has subgroup support + inline bool has_subgroup_support(const int i) + { return _properties[i].has_subgroup_support; } + /// True if the device supports shuffle intrinsics + inline bool has_shuffle_support() + { return has_shuffle_support(_device); } + /// True if the device supports shuffle intrinsics + inline bool has_shuffle_support(const int i) + { return _properties[i].has_shuffle_support; } /// Maximum number of subdevices allowed from device fission inline int max_sub_devices() @@ -281,6 +337,12 @@ class UCL_Device { /// Maximum number of subdevices allowed from device fission inline int max_sub_devices(const int i) { return _properties[i].max_sub_devices; } + /// OpenCL version supported by the device + inline int cl_device_version() + { return cl_device_version(_device); } + /// OpenCL version supported by the device + inline int cl_device_version(const int i) + { return _properties[i].cl_device_version; } /// List all devices along with all properties inline void print_all(std::ostream &out); @@ -288,8 +350,14 @@ class UCL_Device { /// Return the OpenCL type for the device inline cl_device_id & cl_device() { return _cl_device; } - /// Select the platform that has accelerators - inline int set_platform_accelerator(int pid=-1); + /// Automatically set the platform by type, vendor, and/or CU count + /** If first_device is positive, search restricted to platforms containing + * this device IDs. If ndevices is positive, search is restricted + * to platforms with at least that many devices **/ + inline int auto_set_platform(const enum UCL_DEVICE_TYPE type=UCL_GPU, + const std::string vendor="", + const int ndevices=-1, + const int first_device=-1); private: int _num_platforms; // Number of platforms @@ -322,8 +390,7 @@ UCL_Device::UCL_Device() { return; } else _num_platforms=static_cast(nplatforms); - // note that platform 0 may not necessarily be associated with accelerators - set_platform_accelerator(); + set_platform(0); } UCL_Device::~UCL_Device() { @@ -332,6 +399,14 @@ UCL_Device::~UCL_Device() { void UCL_Device::clear() { _properties.clear(); + + #ifdef GERYON_NUMA_FISSION + #ifdef CL_VERSION_1_2 + for (int i=0; i<_cl_devices.size(); i++) + CL_DESTRUCT_CALL(clReleaseDevice(_cl_devices[i])); + #endif + #endif + _cl_devices.clear(); if (_device>-1) { for (size_t i=0; i<_cq.size(); i++) { @@ -341,6 +416,7 @@ void UCL_Device::clear() { CL_DESTRUCT_CALL(clReleaseContext(_context)); } _device=-1; + _num_devices=0; } int UCL_Device::set_platform(int pid) { @@ -370,11 +446,51 @@ int UCL_Device::set_platform(int pid) { CL_SAFE_CALL(clGetDeviceIDs(_cl_platform,CL_DEVICE_TYPE_ALL,n,device_list, &n)); + #ifndef GERYON_NUMA_FISSION // --- Store properties for each device for (int i=0; i<_num_devices; i++) { _cl_devices.push_back(device_list[i]); add_properties(device_list[i]); } + #else + // --- Create sub-devices for anything partitionable by NUMA and store props + int num_unpart = _num_devices; + _num_devices = 0; + for (int i=0; i 1) { + subdevice_list = new cl_device_id[num_subdevices]; + CL_SAFE_CALL(clCreateSubDevices(device_list[i], props, num_subdevices, + subdevice_list, &num_subdevices)); + } + #endif + + for (int j=0; j 1) delete[] subdevice_list; + } // for i + #endif + delete[] device_list; return UCL_SUCCESS; } @@ -429,11 +545,18 @@ void UCL_Device::add_properties(cl_device_id device_list) { sizeof(cl_uint),&op.alignment,nullptr)); op.alignment/=8; + cl_uint float_width; + CL_SAFE_CALL(clGetDeviceInfo(device_list, + CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT, + sizeof(float_width),&float_width,nullptr)); + op.preferred_vector_width32=float_width; + // Determine if double precision is supported cl_uint double_width; CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE, sizeof(double_width),&double_width,nullptr)); + op.preferred_vector_width64=double_width; if (double_width==0) op.double_precision=false; else @@ -452,9 +575,14 @@ void UCL_Device::add_properties(cl_device_id device_list) { op.ecc_support=true; op.c_version=""; + op.is_subdevice=false; op.partition_equal=false; op.partition_counts=false; op.partition_affinity=false; + op.max_sub_devices=1; + op.cl_device_version=0; + op.has_subgroup_support=false; + op.has_shuffle_support=false; #ifdef CL_VERSION_1_2 size_t return_bytes; @@ -463,6 +591,13 @@ void UCL_Device::add_properties(cl_device_id device_list) { op.c_version=buffer; cl_device_partition_property pinfo[4]; + CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_PARTITION_TYPE, + 4*sizeof(cl_device_partition_property), + &pinfo, &return_bytes)); + if (return_bytes == 0) op.is_subdevice=false; + else if (pinfo[0]) op.is_subdevice=true; + else op.is_subdevice=false; + CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_PARTITION_PROPERTIES, 4*sizeof(cl_device_partition_property), @@ -480,6 +615,46 @@ void UCL_Device::add_properties(cl_device_id device_list) { CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_PARTITION_MAX_SUB_DEVICES, sizeof(cl_uint),&op.max_sub_devices,nullptr)); + + CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_VERSION,1024,buffer,nullptr)); + int cl_version_maj = buffer[7] - '0'; + int cl_version_min = buffer[9] - '0'; + op.cl_device_version = cl_version_maj * 100 + cl_version_min * 10; + + size_t ext_str_size_ret; + CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_EXTENSIONS, 0, nullptr, + &ext_str_size_ret)); + char buffer2[ext_str_size_ret]; + CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_EXTENSIONS, + ext_str_size_ret, buffer2, nullptr)); + #if defined(CL_VERSION_2_1) || defined(CL_VERSION_3_0) + if (op.cl_device_version >= 210) { + if ((std::string(buffer2).find("cl_khr_subgroups") != std::string::npos) || + (std::string(buffer2).find("cl_intel_subgroups") != std::string::npos)) + op.has_subgroup_support=true; + if (std::string(buffer2).find("cl_intel_subgroups") != std::string::npos) + op.has_shuffle_support=true; + } + #endif + if (std::string(buffer2).find("cl_nv_device_attribute_query") != + std::string::npos) { + #ifndef CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV + #define CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV 0x4000 + #endif + #ifndef CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV + #define CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV 0x4001 + #endif + cl_uint major, minor; + CL_SAFE_CALL(clGetDeviceInfo(device_list, + CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV, + sizeof(cl_uint), &major, nullptr)); + CL_SAFE_CALL(clGetDeviceInfo(device_list, + CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV, + sizeof(cl_uint), &minor, nullptr)); + double arch = static_cast(minor)/10+major; + if (arch >= 3.0) + op.has_shuffle_support=true; + } #endif _properties.push_back(op); @@ -516,7 +691,7 @@ std::string UCL_Device::device_type_name(const int i) { } // Get a string telling the type of the device -int UCL_Device::device_type(const int i) { +enum UCL_DEVICE_TYPE UCL_Device::device_type(const int i) { if (_properties[i].device_type==CL_DEVICE_TYPE_CPU) return UCL_CPU; else if (_properties[i].device_type==CL_DEVICE_TYPE_GPU) @@ -529,14 +704,8 @@ int UCL_Device::device_type(const int i) { // Set the CUDA device to the specified device number int UCL_Device::set(int num) { - cl_device_id *device_list = new cl_device_id[_num_devices]; - cl_uint n; - CL_SAFE_CALL(clGetDeviceIDs(_cl_platform,CL_DEVICE_TYPE_ALL,_num_devices, - device_list,&n)); - _device=num; - _cl_device=device_list[_device]; - delete[] device_list; + _cl_device=_cl_devices[_device]; return create_context(); } @@ -555,6 +724,11 @@ void UCL_Device::print_all(std::ostream &out) { out << "\nDevice " << i << ": \"" << name(i).c_str() << "\"\n"; out << " Type of device: " << device_type_name(i).c_str() << std::endl; + out << " Is a subdevice: "; + if (is_subdevice(i)) + out << "Yes\n"; + else + out << "No\n"; out << " Double precision support: "; if (double_precision(i)) out << "Yes\n"; @@ -613,33 +787,93 @@ void UCL_Device::print_all(std::ostream &out) { out << "No\n"; out << " Maximum subdevices from fission: " << max_sub_devices(i) << std::endl; + out << " Shared memory system: "; + if (shared_memory(i)) + out << "Yes\n"; + else + out << "No\n"; } } } -// Select the platform that is associated with accelerators -// if pid < 0, select the first platform -int UCL_Device::set_platform_accelerator(int pid) { - if (pid < 0) { - int found = 0; - for (int n=0; n<_num_platforms; n++) { - set_platform(n); - for (int i=0; i -1) { + if (ndevices) + last_device = first_device + ndevices - 1; + else + last_device = first_device; + } + + bool vendor_match=false; + bool type_match=false; + int max_cus=0; + int best_platform=0; + + std::string vendor_upper=vendor; + for (int i=0; i='a') + vendor_upper[i]=toupper(vendor_upper[i]); + + for (int n=0; n<_num_platforms; n++) { + set_platform(n); + if (last_device > -1 && last_device >= num_devices()) continue; + if (ndevices > num_devices()) continue; + + int first_id=0; + int last_id=num_devices()-1; + if (last_device > -1) { + first_id=first_device; + last_id=last_device; + } + + if (vendor_upper!="") { + std::string pname = platform_name(); + for (int i=0; i='a') + pname[i]=toupper(pname[i]); + + if (pname.find(vendor_upper)!=std::string::npos) { + if (vendor_match == false) { + best_platform=n; + max_cus=0; + vendor_match=true; + } + } else if (vendor_match) + continue; + } + + if (type != UCL_DEFAULT) { + bool ptype_matched=false; + for (int d=first_id; d<=last_id; d++) { + if (type==device_type(d)) { + if (type_match == false) { + best_platform=n; + max_cus=0; + type_match=true; + ptype_matched=true; + } + } + } + if (type_match==true && ptype_matched==false) + continue; + } + + for (int d=first_id; d<=last_id; d++) { + if (cus(d) > max_cus) { + best_platform=n; + max_cus=cus(d); } - if (found) return UCL_SUCCESS; } - return UCL_ERROR; - } else { - return set_platform(pid); } + return set_platform(best_platform); } -} // namespace ucl_opencl +} // namespace ucl_opencl #endif diff --git a/lib/gpu/geryon/ocl_kernel.h b/lib/gpu/geryon/ocl_kernel.h index 77593f4515..23f9baa09e 100644 --- a/lib/gpu/geryon/ocl_kernel.h +++ b/lib/gpu/geryon/ocl_kernel.h @@ -2,6 +2,7 @@ ocl_kernel.h ------------------- W. Michael Brown + Nitin Dhamankar (Intel) Utilities for dealing with OpenCL kernels @@ -26,6 +27,7 @@ #include "ocl_device.h" #include +#include namespace ucl_opencl { @@ -93,7 +95,7 @@ class UCL_Program { /// Load a program from a string and compile with flags inline int load_string(const void *program, const char *flags="", - std::string *log=nullptr) { + std::string *log=nullptr, FILE* foutput=nullptr) { cl_int error_flag; const char *prog=(const char *)program; _program=clCreateProgramWithSource(_context,1,&prog,nullptr,&error_flag); @@ -107,27 +109,66 @@ class UCL_Program { sizeof(cl_build_status),&build_status, nullptr)); - if (build_status != CL_SUCCESS || log!=nullptr) { + #ifdef GERYON_KERNEL_DUMP + { size_t ms; - CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device,CL_PROGRAM_BUILD_LOG,0, - nullptr, &ms)); + CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device,CL_PROGRAM_BUILD_LOG, + 0,NULL,&ms)); char *build_log = new char[ms]; - CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device,CL_PROGRAM_BUILD_LOG,ms, - build_log, nullptr)); + CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device,CL_PROGRAM_BUILD_LOG, + ms,build_log, NULL)); + std::cout << std::endl << std::endl + << "--------------------------------------------------------\n" + << " UCL PROGRAM DUMP\n" + << "--------------------------------------------------------\n" + << flags << std::endl + << "--------------------------------------------------------\n" + << prog << std::endl + << "--------------------------------------------------------\n" + << build_log + << "--------------------------------------------------------\n" + << std::endl << std::endl; + } + #endif + + if (build_status != CL_SUCCESS || log!=NULL) { + size_t ms; + CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device,CL_PROGRAM_BUILD_LOG, + 0,NULL,&ms)); + char *build_log = new char[ms]; + CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device,CL_PROGRAM_BUILD_LOG, + ms,build_log, NULL)); if (log!=nullptr) *log=std::string(build_log); if (build_status != CL_SUCCESS) { #ifndef UCL_NO_EXIT - std::cerr << std::endl - << "----------------------------------------------------------\n" - << " UCL Error: Error compiling OpenCL Program (" - << build_status << ") ...\n" - << "----------------------------------------------------------\n"; + std::cerr << std::endl << std::endl + << "----------------------------------------------------------\n" + << " UCL Error: Error compiling OpenCL Program (" + << build_status << ") ...\n" + << "----------------------------------------------------------\n"; std::cerr << build_log << std::endl; + std::cerr << + "----------------------------------------------------------\n" + << std::endl << std::endl; #endif - delete[] build_log; + if (foutput != NULL) { + fprintf(foutput,"\n\n"); + fprintf(foutput, + "----------------------------------------------------------\n"); + fprintf(foutput, + " UCL Error: Error compiling OpenCL Program (%d) ...\n", + build_status); + fprintf(foutput, + "----------------------------------------------------------\n"); + fprintf(foutput,"%s\n",build_log); + fprintf(foutput, + "----------------------------------------------------------\n"); + fprintf(foutput,"\n\n"); + } + delete[] build_log; return UCL_COMPILE_ERROR; } else delete[] build_log; } @@ -141,6 +182,7 @@ class UCL_Program { inline void cq(command_queue &cq_in) { _cq=cq_in; } friend class UCL_Kernel; + friend class UCL_Const; private: bool _init_done; cl_program _program; @@ -322,9 +364,45 @@ class UCL_Kernel { inline void cq(command_queue &cq_in) { _cq=cq_in; } #include "ucl_arg_kludge.h" + #if defined(CL_VERSION_2_1) || defined(CL_VERSION_3_0) + inline size_t max_subgroup_size(const size_t block_size_x) { + size_t block_size = block_size_x; + CL_SAFE_CALL(clGetKernelSubGroupInfo(_kernel, _device, + CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE, + sizeof(block_size), (void *) &block_size, + sizeof(size_t), (void *) &_mx_subgroup_sz, + NULL)); + return _mx_subgroup_sz; + } + + inline size_t max_subgroup_size(const size_t block_size_x, + const size_t block_size_y) { + size_t block_size[2] { block_size_x, block_size_y }; + CL_SAFE_CALL(clGetKernelSubGroupInfo(_kernel, _device, + CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE, + sizeof(block_size), (void *) &block_size, + sizeof(size_t), (void *) &_mx_subgroup_sz, + NULL)); + return _mx_subgroup_sz; + } + + inline size_t max_subgroup_size(const size_t block_size_x, + const size_t block_size_y, + const size_t block_size_z) { + size_t block_size[3] { block_size_x, block_size_y, block_size_z }; + CL_SAFE_CALL(clGetKernelSubGroupInfo(_kernel, _device, + CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE, + sizeof(block_size), (void *) &block_size, + sizeof(size_t), (void *) &_mx_subgroup_sz, + NULL)); + return _mx_subgroup_sz; + } + #endif + private: cl_kernel _kernel; cl_program _program; + cl_device_id _device; cl_uint _dimensions; size_t _block_size[3]; size_t _num_blocks[3]; @@ -338,6 +416,11 @@ class UCL_Kernel { unsigned _kernel_info_nargs; //std::string _kernel_info_args[256]; #endif + + #ifdef CL_VERSION_2_1 + size_t _mx_subgroup_sz; // Maximum sub-group size for this kernel + #endif + }; inline int UCL_Kernel::set_function(UCL_Program &program, const char *function) { @@ -347,6 +430,7 @@ inline int UCL_Kernel::set_function(UCL_Program &program, const char *function) CL_SAFE_CALL(clRetainCommandQueue(_cq)); _program=program._program; CL_SAFE_CALL(clRetainProgram(_program)); + _device=program._device; cl_int error_flag; _kernel=clCreateKernel(program._program,function,&error_flag); @@ -380,8 +464,11 @@ inline int UCL_Kernel::set_function(UCL_Program &program, const char *function) } void UCL_Kernel::run() { - CL_SAFE_CALL(clEnqueueNDRangeKernel(_cq,_kernel,_dimensions,nullptr, - _num_blocks,_block_size,0,nullptr,nullptr)); + CL_SAFE_CALL(clEnqueueNDRangeKernel(_cq,_kernel,_dimensions,NULL, + _num_blocks,_block_size,0,NULL,NULL)); + #ifdef GERYON_OCL_FLUSH + ucl_flush(_cq); + #endif } } // namespace diff --git a/lib/gpu/geryon/ocl_macros.h b/lib/gpu/geryon/ocl_macros.h index aeff689859..5fb7665817 100644 --- a/lib/gpu/geryon/ocl_macros.h +++ b/lib/gpu/geryon/ocl_macros.h @@ -4,14 +4,6 @@ #include #include -/* We default to OpenCL 1.2 as target version for now as - * there are known issues with OpenCL 2.0 and later. - * This is also to silence warnings from generic OpenCL headers */ - -#if !defined(CL_TARGET_OPENCL_VERSION) -#define CL_TARGET_OPENCL_VERSION 120 -#endif - #ifdef __APPLE__ #include #else diff --git a/lib/gpu/geryon/ocl_memory.h b/lib/gpu/geryon/ocl_memory.h index 740020ab18..8937d4145a 100644 --- a/lib/gpu/geryon/ocl_memory.h +++ b/lib/gpu/geryon/ocl_memory.h @@ -106,9 +106,9 @@ inline int _host_alloc(mat_type &mat, copy_type &cm, const size_t n, mat.cbegin()=clCreateBuffer(context,buffer_perm,n,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; - *mat.host_ptr() = (typename mat_type::data_type*) - clEnqueueMapBuffer(cm.cq(),mat.cbegin(),CL_TRUE, - map_perm,0,n,0,nullptr,nullptr,nullptr); + *mat.host_ptr() = (typename mat_type::data_type*) + clEnqueueMapBuffer(cm.cq(),mat.cbegin(),CL_TRUE, + map_perm,0,n,0,NULL,NULL,NULL); mat.cq()=cm.cq(); CL_SAFE_CALL(clRetainCommandQueue(mat.cq())); @@ -116,18 +116,15 @@ inline int _host_alloc(mat_type &mat, copy_type &cm, const size_t n, } template -inline int _host_view(mat_type &mat, copy_type &cm, const size_t n) { +inline int _host_view(mat_type &mat, copy_type &cm, const size_t o, + const size_t n) { cl_int error_flag; - cl_context context; - CL_SAFE_CALL(clGetMemObjectInfo(cm.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,nullptr)); - cl_mem_flags orig_flags; - CL_SAFE_CALL(clGetMemObjectInfo(cm.cbegin(),CL_MEM_FLAGS,sizeof(orig_flags), - &orig_flags,nullptr)); - orig_flags=orig_flags & ~CL_MEM_ALLOC_HOST_PTR; - - mat.cbegin()=clCreateBuffer(context, CL_MEM_USE_HOST_PTR | orig_flags, n, - *mat.host_ptr(), &error_flag); + cl_buffer_region subbuffer; + subbuffer.origin = o; + subbuffer.size = n; + mat.cbegin()=clCreateSubBuffer(cm.cbegin(), 0, + CL_BUFFER_CREATE_TYPE_REGION, &subbuffer, + &error_flag); CL_CHECK_ERR(error_flag); CL_SAFE_CALL(clRetainCommandQueue(mat.cq())); @@ -470,6 +467,9 @@ inline void _device_zero(mat_type &mat, const size_t n, command_queue &cq) { size_t kn=n/sizeof(typename mat_type::data_type); CL_SAFE_CALL(clEnqueueNDRangeKernel(cq,kzero,1,0,&kn,0,0,0,0)); #endif + #ifdef GERYON_OCL_FLUSH + ucl_flush(cq); + #endif } // -------------------------------------------------------------------------- @@ -585,7 +585,10 @@ template <> struct _ucl_memcpy<1,0> { std::cerr << "UCL_COPY 1NS\n"; #endif CL_SAFE_CALL(clEnqueueReadBuffer(cq,src.cbegin(),block,src_offset,n, - dst.begin(),0,nullptr,nullptr)); + dst.begin(),0,NULL,NULL)); + #ifdef GERYON_OCL_FLUSH + if (block==CL_FALSE) ucl_flush(cq); + #endif } template static inline void mc(p1 &dst, const size_t dpitch, const p2 &src, @@ -617,6 +620,9 @@ template <> struct _ucl_memcpy<1,0> { src_offset+=spitch; dst_offset+=dpitch; } + #ifdef GERYON_OCL_FLUSH + if (block==CL_FALSE) ucl_flush(cq); + #endif } }; @@ -637,7 +643,10 @@ template <> struct _ucl_memcpy<0,1> { std::cerr << "UCL_COPY 3NS\n"; #endif CL_SAFE_CALL(clEnqueueWriteBuffer(cq,dst.cbegin(),block,dst_offset,n, - src.begin(),0,nullptr,nullptr)); + src.begin(),0,NULL,NULL)); + #ifdef GERYON_OCL_FLUSH + if (block==CL_FALSE) ucl_flush(cq); + #endif } template static inline void mc(p1 &dst, const size_t dpitch, const p2 &src, @@ -669,6 +678,9 @@ template <> struct _ucl_memcpy<0,1> { src_offset+=spitch; dst_offset+=dpitch; } + #ifdef GERYON_OCL_FLUSH + if (block==CL_FALSE) ucl_flush(cq); + #endif } }; @@ -690,6 +702,9 @@ template struct _ucl_memcpy { #endif if (block==CL_TRUE) ucl_sync(cq); + #ifdef GERYON_OCL_FLUSH + else ucl_flush(cq); + #endif } template static inline void mc(p1 &dst, const size_t dpitch, const p2 &src, @@ -720,6 +735,9 @@ template struct _ucl_memcpy { #endif if (block==CL_TRUE) ucl_sync(cq); + #ifdef GERYON_OCL_FLUSH + else ucl_flush(cq); + #endif } }; diff --git a/lib/gpu/geryon/ocl_texture.h b/lib/gpu/geryon/ocl_texture.h index 0e60045f55..43de4b258c 100644 --- a/lib/gpu/geryon/ocl_texture.h +++ b/lib/gpu/geryon/ocl_texture.h @@ -53,6 +53,59 @@ class UCL_Texture { friend class UCL_Kernel; }; +/// Class storing a const global memory reference +class UCL_Const { + public: + UCL_Const() : _global_bytes(0), _active(false) {} + ~UCL_Const() { clear(); } + /// Construct with a specified global reference + inline UCL_Const(UCL_Program &prog, const char *global_name) + { get_global(prog,global_name); } + /// Set the global reference for this object + inline void get_global(UCL_Program &prog, const char *global_name) { + if (_active) { + CL_DESTRUCT_CALL(clReleaseContext(_context)); + CL_DESTRUCT_CALL(clReleaseCommandQueue(_cq)); + } + _active = true; + _context = prog._context; + _cq = prog._cq; + CL_SAFE_CALL(clRetainContext(_context)); + CL_SAFE_CALL(clRetainCommandQueue(_cq)); + } + /// Copy from array on host to const memory + template + inline void update_device(UCL_H_Vec &src, const int numel) { + const int bytes=numel*sizeof(numtyp); + if (_global_bytes < bytes) { + if (_global_bytes) CL_SAFE_CALL(clReleaseMemObject(_global)); + cl_int e; + _global = clCreateBuffer(_context, CL_MEM_READ_ONLY, bytes, NULL, &e); + CL_SAFE_CALL(e); + } + CL_SAFE_CALL(clEnqueueWriteBuffer(_cq, _global, CL_FALSE, 0, bytes, + (void *)src.begin(), 0, NULL, NULL)); + } + /// Get device ptr associated with object + inline const cl_mem * begin() const { return &_global; } + inline void clear() { + if (_global_bytes) CL_SAFE_CALL(clReleaseMemObject(_global)); + if (_active) { + CL_DESTRUCT_CALL(clReleaseContext(_context)); + CL_DESTRUCT_CALL(clReleaseCommandQueue(_cq)); + } + _global_bytes=0; + _active=false; + } + + private: + cl_mem _global; + size_t _global_bytes; + cl_context _context; + cl_command_queue _cq; + bool _active; +}; + } // namespace #endif diff --git a/lib/gpu/geryon/ocl_timer.h b/lib/gpu/geryon/ocl_timer.h index 8e8ffa929e..ca74312d51 100644 --- a/lib/gpu/geryon/ocl_timer.h +++ b/lib/gpu/geryon/ocl_timer.h @@ -61,7 +61,6 @@ class UCL_Timer { /// Initialize command queue for timing inline void init(UCL_Device &dev, command_queue &cq) { clear(); - t_factor=dev.timer_resolution()/1000000000.0; _cq=cq; clRetainCommandQueue(_cq); _initialized=true; @@ -124,17 +123,17 @@ class UCL_Timer { clReleaseEvent(start_event); clReleaseEvent(stop_event); has_measured_time = false; - return (tend-tstart)*t_factor; + return (tend-tstart)*1e-6; } /// Return the time (s) of last start to stop - Forces synchronization - inline double seconds() { return time()/1000.0; } + inline double seconds() { return time()*1e-3; } /// Return the total time in ms inline double total_time() { return _total_time; } /// Return the total time in seconds - inline double total_seconds() { return _total_time/1000.0; } + inline double total_seconds() { return _total_time*1e-3; } private: cl_event start_event, stop_event; diff --git a/lib/gpu/geryon/ucl_basemat.h b/lib/gpu/geryon/ucl_basemat.h index 07e23aebe7..51fd33d623 100644 --- a/lib/gpu/geryon/ucl_basemat.h +++ b/lib/gpu/geryon/ucl_basemat.h @@ -69,17 +69,17 @@ class UCL_BaseMat { /// Return the type/permissions of memory allocation /** Returns UCL_READ_WRITE, UCL_WRITE_ONLY, UCL_READ_ONLY, UCL_NOT_PINNED * or UCL_VIEW **/ + /// Assert that any ops in associate command queue have been issued to device + inline void flush() { ucl_flush(_cq); } + inline enum UCL_MEMOPT kind() const { return _kind; } inline bool shared_mem_device() { #ifdef _OCL_MAT cl_device_id device; CL_SAFE_CALL(clGetCommandQueueInfo(_cq,CL_QUEUE_DEVICE, - sizeof(cl_device_id),&device,nullptr)); - cl_device_type device_type; - CL_SAFE_CALL(clGetDeviceInfo(device,CL_DEVICE_TYPE, - sizeof(device_type),&device_type,nullptr)); - return _shared_mem_device(device_type); + sizeof(cl_device_id),&device,NULL)); + return _shared_mem_device(device); #else return false; #endif diff --git a/lib/gpu/geryon/ucl_d_vec.h b/lib/gpu/geryon/ucl_d_vec.h index cd2a90fe2d..e791f18f29 100644 --- a/lib/gpu/geryon/ucl_d_vec.h +++ b/lib/gpu/geryon/ucl_d_vec.h @@ -39,7 +39,7 @@ class UCL_D_Vec : public UCL_BaseMat { }; typedef numtyp data_type; - UCL_D_Vec() : _cols(0) {} + UCL_D_Vec() : _cols(0), _row_bytes(0) {} ~UCL_D_Vec() { _device_free(*this); } /// Construct with n columns diff --git a/lib/gpu/geryon/ucl_get_devices.cpp b/lib/gpu/geryon/ucl_get_devices.cpp index b8dfc6f7b1..5654bb40bd 100644 --- a/lib/gpu/geryon/ucl_get_devices.cpp +++ b/lib/gpu/geryon/ucl_get_devices.cpp @@ -44,10 +44,8 @@ using namespace ucl_hip; int main(int argc, char** argv) { UCL_Device cop; std::cout << "Found " << cop.num_platforms() << " platform(s).\n"; - if (cop.num_platforms()>0) { - std::cout << "Using platform: " << cop.platform_name() << std::endl; + if (cop.num_platforms()>0) cop.print_all(std::cout); - } return 0; } diff --git a/lib/gpu/geryon/ucl_h_mat.h b/lib/gpu/geryon/ucl_h_mat.h index 1df3c2de4b..41dad2b285 100644 --- a/lib/gpu/geryon/ucl_h_mat.h +++ b/lib/gpu/geryon/ucl_h_mat.h @@ -241,7 +241,7 @@ class UCL_H_Mat : public UCL_BaseMat { _array=input.begin()+offset; _end=_array+_cols; #ifdef _OCL_MAT - _host_view(*this,input,_row_bytes*_rows); + _host_view(*this,input,offset*sizeof(numtyp),_row_bytes*_rows); #endif } diff --git a/lib/gpu/geryon/ucl_h_vec.h b/lib/gpu/geryon/ucl_h_vec.h index a9d64349d9..5de0c312b0 100644 --- a/lib/gpu/geryon/ucl_h_vec.h +++ b/lib/gpu/geryon/ucl_h_vec.h @@ -39,7 +39,7 @@ class UCL_H_Vec : public UCL_BaseMat { }; typedef numtyp data_type; - UCL_H_Vec() : _cols(0) { + UCL_H_Vec() : _cols(0), _row_bytes(0) { #ifdef _OCL_MAT _carray=(cl_mem)(0); #endif @@ -135,7 +135,7 @@ class UCL_H_Vec : public UCL_BaseMat { _cols=cols; _row_bytes=_cols*sizeof(numtyp); this->_cq=input.cq(); - _array=input.begin(); + _array=(numtyp *)input.begin(); _end=_array+_cols; #ifdef _OCL_MAT _carray=input.cbegin(); @@ -240,10 +240,10 @@ class UCL_H_Vec : public UCL_BaseMat { _cols=cols; _row_bytes=_cols*sizeof(numtyp); this->_cq=input.cq(); - _array=input.begin()+offset; + _array=(numtyp *)input.begin()+offset; _end=_array+_cols; #ifdef _OCL_MAT - _host_view(*this,input,_row_bytes); + _host_view(*this,input,offset*sizeof(numtyp),_row_bytes); #endif } diff --git a/lib/gpu/geryon/ucl_vector.h b/lib/gpu/geryon/ucl_vector.h index 7fe2604de6..c03fd31fce 100644 --- a/lib/gpu/geryon/ucl_vector.h +++ b/lib/gpu/geryon/ucl_vector.h @@ -162,7 +162,9 @@ class UCL_Vector { inline void cq(command_queue &cq_in) { host.cq(cq_in); device.cq(cq_in); } /// Block until command_queue associated with matrix is complete inline void sync() { host.sync(); } - + /// Assert that any ops in associate command queue have been issued to device + inline void flush() { ucl_flush(host.cq()); } + ///Get the size of a row on the host (including any padding) in elements inline size_t row_size() const { return host.row_size(); } /// Get the size of a row on the host(including any padding) in bytes diff --git a/lib/gpu/lal_answer.cpp b/lib/gpu/lal_answer.cpp index 803b781286..e2478a64e5 100644 --- a/lib/gpu/lal_answer.cpp +++ b/lib/gpu/lal_answer.cpp @@ -14,6 +14,9 @@ ***************************************************************************/ #include "lal_answer.h" +#if (LAL_USE_OMP == 1) +#include +#endif namespace LAMMPS_AL { #define AnswerT Answer @@ -56,7 +59,7 @@ bool AnswerT::alloc(const int inum) { template bool AnswerT::init(const int inum, const bool charge, const bool rot, - UCL_Device &devi) { + UCL_Device &devi) { clear(); bool success=true; @@ -81,6 +84,10 @@ bool AnswerT::init(const int inum, const bool charge, const bool rot, _time_cast=0.0; _time_cpu_idle=0.0; + success=success && (error_flag.alloc(1,*dev,UCL_READ_WRITE, + UCL_WRITE_ONLY)==UCL_SUCCESS); + if (success) error_flag.zero(); + return success && alloc(ef_inum); } @@ -111,6 +118,7 @@ bool AnswerT::add_fields(const bool charge, const bool rot) { template void AnswerT::clear() { _gpu_bytes=0; + error_flag.clear(); if (!_allocated) return; _allocated=false; @@ -138,12 +146,21 @@ double AnswerT::host_memory_usage() const { template void AnswerT::copy_answers(const bool eflag, const bool vflag, - const bool ef_atom, const bool vf_atom) { + const bool ef_atom, const bool vf_atom, + const int red_blocks) { time_answer.start(); _eflag=eflag; _vflag=vflag; _ef_atom=ef_atom; _vf_atom=vf_atom; + #ifdef LAL_NO_BLOCK_REDUCE + _ev_stride=_inum; + #else + if (ef_atom || vf_atom) + _ev_stride=_inum; + else + _ev_stride=red_blocks; + #endif int csize=_ev_fields; if (!eflag) @@ -152,20 +169,24 @@ void AnswerT::copy_answers(const bool eflag, const bool vflag, csize-=6; if (csize>0) - engv.update_host(_inum*csize,true); + engv.update_host(_ev_stride*csize,true); if (_rot) force.update_host(_inum*4*2,true); else force.update_host(_inum*4,true); time_answer.stop(); + + #ifndef GERYON_OCL_FLUSH + force.flush(); + #endif } template void AnswerT::copy_answers(const bool eflag, const bool vflag, - const bool ef_atom, const bool vf_atom, - int *ilist) { + const bool ef_atom, const bool vf_atom, + int *ilist, const int red_blocks) { _ilist=ilist; - copy_answers(eflag,vflag,ef_atom,vf_atom); + copy_answers(eflag,vflag,ef_atom,vf_atom,red_blocks); } template @@ -177,21 +198,24 @@ double AnswerT::energy_virial(double *eatom, double **vatom, double evdwl=0.0; int vstart=0; if (_eflag) { - for (int i=0; i<_inum; i++) + #if (LAL_USE_OMP_SIMD == 1) + #pragma omp simd reduction(+:evdwl) + #endif + for (int i=0; i<_ev_stride; i++) evdwl+=engv[i]; if (_ef_atom) { if (_ilist==nullptr) { - for (int i=0; i<_inum; i++) + for (int i=0; i<_ev_stride; i++) eatom[i]+=engv[i]; } else { - for (int i=0; i<_inum; i++) + for (int i=0; i<_ev_stride; i++) eatom[_ilist[i]]+=engv[i]; } } - vstart=_inum; + vstart=_ev_stride; } if (_vflag) { - int iend=vstart+_inum; + int iend=vstart+_ev_stride; for (int j=0; j<6; j++) { for (int i=vstart; i void AnswerT::get_answers(double **f, double **tor) { - int fl=0; if (_ilist==nullptr) { - for (int i=0; i<_inum; i++) { - f[i][0]+=force[fl]; - f[i][1]+=force[fl+1]; - f[i][2]+=force[fl+2]; - fl+=4; - } - if (_rot) { - for (int i=0; i<_inum; i++) { - tor[i][0]+=force[fl]; - tor[i][1]+=force[fl+1]; - tor[i][2]+=force[fl+2]; - fl+=4; + typedef struct { double x,y,z; } vec3d; + typedef struct { acctyp x,y,z,w; } vec4d_t; + vec3d *fp=reinterpret_cast(&(f[0][0])); + vec4d_t *forcep=reinterpret_cast(&(force[0])); + + #if (LAL_USE_OMP == 1) + #pragma omp parallel + #endif + { + #if (LAL_USE_OMP == 1) + const int nthreads = omp_get_num_threads(); + const int tid = omp_get_thread_num(); + const int idelta = _inum / nthreads + 1; + const int ifrom = tid * idelta; + const int ito = std::min(ifrom + idelta, _inum); + #else + const int tid = 0; + const int ifrom = 0; + const int ito = _inum; + #endif + + for (int i=ifrom; i(&(tor[0][0])); + forcep=reinterpret_cast(&(force[_inum*4])); + for (int i=ifrom; i force; /// Energy and virial per-atom storage UCL_Vector engv; + /// Error flag + UCL_Vector error_flag; /// Device timers UCL_Timer time_answer; @@ -162,7 +166,7 @@ class Answer { bool alloc(const int inum); bool _allocated, _eflag, _vflag, _ef_atom, _vf_atom, _rot, _charge, _other; - int _max_local, _inum, _e_fields, _ev_fields, _ans_fields; + int _max_local, _inum, _e_fields, _ev_fields, _ans_fields, _ev_stride; int *_ilist; double _time_cast, _time_cpu_idle; diff --git a/lib/gpu/lal_atom.cpp b/lib/gpu/lal_atom.cpp index 7ce3e3e7ff..cda4d383b5 100644 --- a/lib/gpu/lal_atom.cpp +++ b/lib/gpu/lal_atom.cpp @@ -414,9 +414,9 @@ const char *atom=0; template void AtomT::compile_kernels(UCL_Device &dev) { - std::string flags = "-D"+std::string(OCL_VENDOR); + std::string flags = ""; atom_program=new UCL_Program(dev); - atom_program->load_string(atom,flags); + atom_program->load_string(atom,flags,nullptr,screen); k_cast_x.set_function(*atom_program,"kernel_cast_x"); _compiled=true; } diff --git a/lib/gpu/lal_atom.h b/lib/gpu/lal_atom.h index e39740d6c8..3cf97d94a0 100644 --- a/lib/gpu/lal_atom.h +++ b/lib/gpu/lal_atom.h @@ -24,6 +24,9 @@ #include "geryon/ocl_mat.h" #include "geryon/ocl_kernel.h" using namespace ucl_opencl; +#ifndef LAL_NO_OCL_EV_JIT +#define LAL_OCL_EV_JIT +#endif #elif defined(USE_CUDART) #include "geryon/nvc_timer.h" #include "geryon/nvc_mat.h" @@ -178,7 +181,7 @@ class Atom { ii+=m_size-n; } UCL_H_Vec view; - view.view((dev_typ*)buffer.begin(),m_size*m_size,*dev); + view.view_offset(0,buffer,m_size*m_size); ucl_copy(dev_v,view,false); } @@ -197,7 +200,26 @@ class Atom { ii+=m_size-n; } UCL_H_Vec view; - view.view((dev_typ*)buffer.begin(),m_size*m_size,*dev); + view.view_offset(0,buffer,m_size*m_size); + ucl_copy(dev_v,view,false); + } + + /// Pack LAMMPS atom type constants into 2 vectors and copy to device + template + inline void type_pack2(const int n, UCL_D_Vec &dev_v, + UCL_H_Vec &buffer, t1 ***one, t2 ***two) { + int ii=0; + for (int i=0; i(one[i][j][k]); + buffer[ii*2+1]=static_cast(two[i][j][k]); + ii++; + } + } + } + UCL_H_Vec view; + view.view_offset(0,buffer,n*n*n); ucl_copy(dev_v,view,false); } @@ -217,7 +239,7 @@ class Atom { ii+=m_size-n; } UCL_H_Vec view; - view.view((dev_typ*)buffer.begin(),m_size*m_size,*dev); + view.view_offset(0,buffer,m_size*m_size); ucl_copy(dev_v,view,false); } @@ -238,7 +260,7 @@ class Atom { ii+=m_size-n; } UCL_H_Vec view; - view.view((dev_typ*)buffer.begin(),m_size*m_size,*dev); + view.view_offset(0,buffer,m_size*m_size); ucl_copy(dev_v,view,false); } @@ -251,7 +273,7 @@ class Atom { buffer[i*2+1]=static_cast(two[i][i]); } UCL_H_Vec view; - view.view((dev_typ*)buffer.begin(),n,*dev); + view.view_offset(0,buffer,n); ucl_copy(dev_v,view,false); } @@ -261,6 +283,9 @@ class Atom { inline void data_unavail() { _x_avail=false; _q_avail=false; _quat_avail=false; _v_avail=false; _resized=false; } + typedef struct { double x,y,z; } vec3d; + typedef struct { numtyp x,y,z,w; } vec4d_t; + /// Cast positions and types to write buffer inline void cast_x_data(double **host_ptr, const int *host_type) { if (_x_avail==false) { @@ -269,13 +294,16 @@ class Atom { memcpy(host_x_cast.begin(),host_ptr[0],_nall*3*sizeof(double)); memcpy(host_type_cast.begin(),host_type,_nall*sizeof(int)); #else - int wl=0; + vec3d *host_p=reinterpret_cast(&(host_ptr[0][0])); + vec4d_t *xp=reinterpret_cast(&(x[0])); + #if (LAL_USE_OMP == 1) + #pragma omp parallel for schedule(static) + #endif for (int i=0; i<_nall; i++) { - x[wl]=host_ptr[i][0]; - x[wl+1]=host_ptr[i][1]; - x[wl+2]=host_ptr[i][2]; - x[wl+3]=host_type[i]; - wl+=4; + xp[i].x=host_p[i].x; + xp[i].y=host_p[i].y; + xp[i].z=host_p[i].z; + xp[i].w=host_type[i]; } #endif _time_cast+=MPI_Wtime()-t; @@ -320,6 +348,11 @@ class Atom { } else if (sizeof(numtyp)==sizeof(double)) memcpy(q.host.begin(),host_ptr,_nall*sizeof(numtyp)); else + #if (LAL_USE_OMP == 1) && (LAL_USE_OMP_SIMD == 1) + #pragma omp parallel for simd schedule(static) + #elif (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif for (int i=0; i<_nall; i++) q[i]=host_ptr[i]; _time_cast+=MPI_Wtime()-t; } @@ -346,6 +379,11 @@ class Atom { } else if (sizeof(numtyp)==sizeof(double)) memcpy(quat.host.begin(),host_ptr,_nall*4*sizeof(numtyp)); else + #if (LAL_USE_OMP == 1) && (LAL_USE_OMP_SIMD == 1) + #pragma omp parallel for simd schedule(static) + #elif (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif for (int i=0; i<_nall*4; i++) quat[i]=host_ptr[i]; _time_cast+=MPI_Wtime()-t; } @@ -370,13 +408,16 @@ class Atom { memcpy(host_v_cast.begin(),host_ptr[0],_nall*3*sizeof(double)); memcpy(host_tag_cast.begin(),host_tag,_nall*sizeof(int)); #else - int wl=0; + vec3d *host_p=reinterpret_cast(&(host_ptr[0][0])); + vec4d_t *vp=reinterpret_cast(&(v[0])); + #if (LAL_USE_OMP == 1) + #pragma omp parallel for schedule(static) + #endif for (int i=0; i<_nall; i++) { - v[wl]=host_ptr[i][0]; - v[wl+1]=host_ptr[i][1]; - v[wl+2]=host_ptr[i][2]; - v[wl+3]=host_tag[i]; - wl+=4; + vp[i].x=host_p[i].x; + vp[i].y=host_p[i].y; + vp[i].z=host_p[i].z; + vp[i].w=host_tag[i]; } #endif _time_cast+=MPI_Wtime()-t; diff --git a/lib/gpu/lal_aux_fun1.h b/lib/gpu/lal_aux_fun1.h index 5b7150d950..be00abbcef 100644 --- a/lib/gpu/lal_aux_fun1.h +++ b/lib/gpu/lal_aux_fun1.h @@ -40,170 +40,521 @@ nbor_begin+=offset; \ } -#if (ARCH < 300) +#define nbor_info_p(nbor_mem, nbor_stride, t_per_atom, ii, offset, \ + i, numj, stride, nbor_end, nbor_begin) \ + i=nbor_mem[ii]; \ + nbor_begin=ii+nbor_stride; \ + numj=nbor_mem[nbor_begin]; \ + nbor_begin+=nbor_stride+ii*(t_per_atom-1); \ + stride=fast_mul(t_per_atom,nbor_stride); \ + nbor_end=nbor_begin+fast_mul(numj/t_per_atom,stride)+(numj & \ + (t_per_atom-1)); \ + nbor_begin+=offset; -#define store_answers(f, energy, virial, ii, inum, tid, t_per_atom, offset, \ - eflag, vflag, ans, engv) \ - if (t_per_atom>1) { \ - __local acctyp red_acc[6][BLOCK_PAIR]; \ - red_acc[0][tid]=f.x; \ - red_acc[1][tid]=f.y; \ - red_acc[2][tid]=f.z; \ - red_acc[3][tid]=energy; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<4; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ - } \ - f.x=red_acc[0][tid]; \ - f.y=red_acc[1][tid]; \ - f.z=red_acc[2][tid]; \ - energy=red_acc[3][tid]; \ - if (vflag>0) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid]=virial[r]; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ - } \ - for (int r=0; r<6; r++) \ - virial[r]=red_acc[r][tid]; \ +#if (SHUFFLE_AVAIL == 0) + +#define simd_reduce_add1(width, local, offset, tid, one) \ + local[0][tid]=one; \ + for (unsigned int s=width/2; s>0; s>>=1) { \ + simdsync(); \ + if (offset < s) local[0][tid] += local[0][tid+s]; \ + } \ + if (offset==0) one=local[0][tid]; + +#define simd_reduce_add2(width, local, offset, tid, one, two) \ + local[0][tid]=one; \ + local[1][tid]=two; \ + for (unsigned int s=width/2; s>0; s>>=1) { \ + simdsync(); \ + if (offset < s) { \ + local[0][tid] += local[0][tid+s]; \ + local[1][tid] += local[1][tid+s]; \ } \ } \ if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]=energy*(acctyp)0.5; \ - ei+=inum; \ + one=local[0][tid]; \ + two=local[1][tid]; \ + } + +#define simd_reduce_add3(width, local, offset, tid, one, two, three) \ + local[0][tid]=one; \ + local[1][tid]=two; \ + local[2][tid]=three; \ + for (unsigned int s=width/2; s>0; s>>=1) { \ + simdsync(); \ + if (offset < s) { \ + local[0][tid] += local[0][tid+s]; \ + local[1][tid] += local[1][tid+s]; \ + local[2][tid] += local[2][tid+s]; \ } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]=virial[i]*(acctyp)0.5; \ - ei+=inum; \ + } \ + if (offset==0) { \ + one=local[0][tid]; \ + two=local[1][tid]; \ + three=local[2][tid]; \ + } + +#define simd_reduce_add6(width, local, offset, tid, one, two, three, \ + four, five, six) \ + local[0][tid]=one; \ + local[1][tid]=two; \ + local[2][tid]=three; \ + local[3][tid]=four; \ + local[4][tid]=five; \ + local[5][tid]=six; \ + for (unsigned int s=width/2; s>0; s>>=1) { \ + simdsync(); \ + if (offset < s) { \ + local[0][tid] += local[0][tid+s]; \ + local[1][tid] += local[1][tid+s]; \ + local[2][tid] += local[2][tid+s]; \ + local[3][tid] += local[3][tid+s]; \ + local[4][tid] += local[4][tid+s]; \ + local[5][tid] += local[5][tid+s]; \ + } \ + } \ + if (offset==0) { \ + one=local[0][tid]; \ + two=local[1][tid]; \ + three=local[2][tid]; \ + four=local[3][tid]; \ + five=local[4][tid]; \ + six=local[5][tid]; \ + } + +#define simd_reduce_arr(trip, width, local, offset, tid, arr) \ + for (int r=0; r0; s>>=1) { \ + simdsync(); \ + if (offset < s) { \ + for (int r=0; rwidth/2; s>>=1) { \ + __syncthreads(); \ + if (tid < s) local[0][tid] += local[0][tid+s]; \ + } \ + if (tid0; s>>=1) { \ + simdsync(); \ + if (tid < s) local[0][tid] += local[0][tid+s]; \ + } \ + if (tid==0) one=local[0][tid]; \ + } + +#define block_reduce_add2(width, local, tid, one, two) \ + local[0][tid]=one; \ + local[1][tid]=two; \ + for (unsigned int s=BLOCK_SIZE_X/2; s>width/2; s>>=1) { \ + __syncthreads(); \ + if (tid < s) { \ + local[0][tid] += local[0][tid+s]; \ + local[1][tid] += local[1][tid+s]; \ + } \ + } \ + if (tid0; s>>=1) { \ + simdsync(); \ + if (tid < s) { \ + local[0][tid] += local[0][tid+s]; \ + local[1][tid] += local[1][tid+s]; \ + } \ + } \ + if (tid==0) { \ + one=local[0][tid]; \ + two=local[1][tid]; \ + } \ + } + +#define block_reduce_arr(trip, width, local, tid, arr) \ + for (int r=0; rwidth/2; s>>=1) { \ + __syncthreads(); \ + if (tid < s) { \ + for (int r=0; r0; s>>=1) { \ + simdsync(); \ + if (tid < s) { \ + for (int r=0; r1) { \ + simd_reduce_add3(t_per_atom, red_acc, offset, tid, f.x, f.y, f.z); \ + if (EVFLAG && (vflag==2 || eflag==2)) { \ + if (eflag) { \ + simdsync(); \ + simd_reduce_add1(t_per_atom, red_acc, offset, tid, energy); \ + } \ + if (vflag) { \ + simdsync(); \ + simd_reduce_arr(6, t_per_atom, red_acc, offset, tid, virial); \ + } \ + } \ + } \ + if (offset==0 && ii1) { \ - __local acctyp red_acc[6][BLOCK_PAIR]; \ - red_acc[0][tid]=f.x; \ - red_acc[1][tid]=f.y; \ - red_acc[2][tid]=f.z; \ - red_acc[3][tid]=energy; \ - red_acc[4][tid]=e_coul; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<5; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ + simd_reduce_add3(t_per_atom, red_acc, offset, tid, f.x, f.y, f.z); \ + if (EVFLAG && (vflag==2 || eflag==2)) { \ + if (eflag) { \ + simdsync(); \ + simd_reduce_add2(t_per_atom, red_acc, offset, tid, energy, e_coul); \ } \ - } \ - f.x=red_acc[0][tid]; \ - f.y=red_acc[1][tid]; \ - f.z=red_acc[2][tid]; \ - energy=red_acc[3][tid]; \ - e_coul=red_acc[4][tid]; \ - if (vflag>0) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid]=virial[r]; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ + if (vflag) { \ + simdsync(); \ + simd_reduce_arr(6, t_per_atom, red_acc, offset, tid, virial); \ } \ - for (int r=0; r<6; r++) \ - virial[r]=red_acc[r][tid]; \ } \ } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]=energy*(acctyp)0.5; \ - ei+=inum; \ - engv[ei]=e_coul*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]=virial[i]*(acctyp)0.5; \ + if (offset==0 && ii0; s>>=1) one += shfl_down(one, s, width); + +#define simd_reduce_add2(width, one, two) \ + for (unsigned int s=width/2; s>0; s>>=1) { \ + one += shfl_down(one, s, width); \ + two += shfl_down(two, s, width); \ + } + +#define simd_reduce_add3(width, one, two, three) \ + for (unsigned int s=width/2; s>0; s>>=1) { \ + one += shfl_down(one, s, width); \ + two += shfl_down(two, s, width); \ + three += shfl_down(three, s, width); \ + } + +#define simd_reduce_add6(width, one, two, three, four, five, six) \ + for (unsigned int s=width/2; s>0; s>>=1) { \ + one += shfl_down(one, s, width); \ + two += shfl_down(two, s, width); \ + three += shfl_down(three, s, width); \ + four += shfl_down(four, s, width); \ + five += shfl_down(five, s, width); \ + six += shfl_down(six, s, width); \ + } + +#define simd_reduce_arr(trip, width, arr) \ + for (unsigned int s=width/2; s>0; s>>=1) { \ + for (int r=0; r1) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - f.x += shfl_xor(f.x, s, t_per_atom); \ - f.y += shfl_xor(f.y, s, t_per_atom); \ - f.z += shfl_xor(f.z, s, t_per_atom); \ - energy += shfl_xor(energy, s, t_per_atom); \ - } \ - if (vflag>0) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - for (int r=0; r<6; r++) \ - virial[r] += shfl_xor(virial[r], s, t_per_atom); \ - } \ + simd_reduce_add3(t_per_atom, f.x, f.y, f.z); \ + if (vflag==2 || eflag==2) { \ + if (eflag) \ + simd_reduce_add1(t_per_atom,energy); \ + if (vflag) \ + simd_reduce_arr(6, t_per_atom,virial); \ } \ } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]=energy*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]=virial[i]*(acctyp)0.5; \ + if (offset==0 && ii 1; active_subgs /= vwidth) { \ + if (active_subgs < BLOCK_SIZE_X/simd_size()) __syncthreads(); \ + if (bnum < active_subgs) { \ + if (eflag) { \ + simd_reduce_add1(vwidth, energy); \ + if (voffset==0) red_acc[6][bnum] = energy; \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (voffset==0) \ + for (int r=0; r<6; r++) red_acc[r][bnum]=virial[r]; \ + } \ + } \ + \ + __syncthreads(); \ + if (tid < active_subgs) { \ + if (eflag) energy = red_acc[6][tid]; \ + if (vflag) \ + for (int r = 0; r < 6; r++) virial[r] = red_acc[r][tid]; \ + } else { \ + if (eflag) energy = (acctyp)0; \ + if (vflag) for (int r = 0; r < 6; r++) virial[r] = (acctyp)0; \ + } \ + } \ + \ + if (bnum == 0) { \ + int ei=BLOCK_ID_X; \ + const int ev_stride=NUM_BLOCKS_X; \ + if (eflag) { \ + simd_reduce_add1(vwidth, energy); \ + if (tid==0) { \ + engv[ei]=energy*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (tid==0) { \ + for (int r=0; r<6; r++) { \ + engv[ei]=virial[r]*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + } \ + } \ + } else if (offset==0 && ii1) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - f.x += shfl_xor(f.x, s, t_per_atom); \ - f.y += shfl_xor(f.y, s, t_per_atom); \ - f.z += shfl_xor(f.z, s, t_per_atom); \ - energy += shfl_xor(energy, s, t_per_atom); \ - e_coul += shfl_xor(e_coul, s, t_per_atom); \ - } \ - if (vflag>0) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - for (int r=0; r<6; r++) \ - virial[r] += shfl_xor(virial[r], s, t_per_atom); \ - } \ + simd_reduce_add3(t_per_atom, f.x, f.y, f.z); \ + if (vflag==2 || eflag==2) { \ + if (eflag) \ + simd_reduce_add2(t_per_atom,energy,e_coul); \ + if (vflag) \ + simd_reduce_arr(6, t_per_atom,virial); \ } \ } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]=energy*(acctyp)0.5; \ - ei+=inum; \ - engv[ei]=e_coul*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]=virial[i]*(acctyp)0.5; \ + if (offset==0 && ii 1; active_subgs /= vwidth) { \ + if (active_subgs < BLOCK_SIZE_X/simd_size()) __syncthreads(); \ + if (bnum < active_subgs) { \ + if (eflag) { \ + simd_reduce_add2(vwidth, energy, e_coul); \ + if (voffset==0) { \ + red_acc[6][bnum] = energy; \ + red_acc[7][bnum] = e_coul; \ + } \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (voffset==0) \ + for (int r=0; r<6; r++) red_acc[r][bnum]=virial[r]; \ + } \ + } \ + \ + __syncthreads(); \ + if (tid < active_subgs) { \ + if (eflag) { \ + energy = red_acc[6][tid]; \ + e_coul = red_acc[7][tid]; \ + } \ + if (vflag) \ + for (int r = 0; r < 6; r++) virial[r] = red_acc[r][tid]; \ + } else { \ + if (eflag) energy = e_coul = (acctyp)0; \ + if (vflag) for (int r = 0; r < 6; r++) virial[r] = (acctyp)0; \ + } \ + } \ + \ + if (bnum == 0) { \ + int ei=BLOCK_ID_X; \ + const int ev_stride=NUM_BLOCKS_X; \ + if (eflag) { \ + simd_reduce_add2(vwidth, energy, e_coul); \ + if (tid==0) { \ + engv[ei]=energy*(acctyp)0.5; \ + ei+=ev_stride; \ + engv[ei]=e_coul*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (tid==0) { \ + for (int r=0; r<6; r++) { \ + engv[ei]=virial[r]*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + } \ + } \ + } else if (offset==0 && ii1) \ + simd_reduce_add3(t_per_atom, f.x, f.y, f.z); \ + if (offset==0 && ii1) \ + simd_reduce_add3(t_per_atom, f.x, f.y, f.z); \ + if (offset==0 && ii global_device; template -BaseAtomicT::BaseAtomic() : _compiled(false), _max_bytes(0) { +BaseAtomicT::BaseAtomic() : _compiled(false), _max_bytes(0), _onetype(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); pair_program=nullptr; ucl_device=nullptr; + #if defined(LAL_OCL_EV_JIT) + pair_program_noev=nullptr; + #endif } template @@ -36,6 +39,10 @@ BaseAtomicT::~BaseAtomic() { k_pair_fast.clear(); k_pair.clear(); if (pair_program) delete pair_program; + #if defined(LAL_OCL_EV_JIT) + k_pair_noev.clear(); + if (pair_program_noev) delete pair_program_noev; + #endif } template @@ -49,7 +56,7 @@ int BaseAtomicT::init_atomic(const int nlocal, const int nall, const int max_nbors, const int maxspecial, const double cell_size, const double gpu_split, FILE *_screen, const void *pair_program, - const char *k_name) { + const char *k_name, const int onetype) { screen=_screen; int gpu_nbor=0; @@ -64,28 +71,29 @@ int BaseAtomicT::init_atomic(const int nlocal, const int nall, _gpu_host=1; _threads_per_atom=device->threads_per_atom(); - if (_threads_per_atom>1 && gpu_nbor==0) { - nbor->packing(true); - _nbor_data=&(nbor->dev_packed); - } else - _nbor_data=&(nbor->dev_nbor); int success=device->init(*ans,false,false,nlocal,nall,maxspecial); if (success!=0) return success; - success = device->init_nbor(nbor,nlocal,host_nlocal,nall,maxspecial,_gpu_host, - max_nbors,cell_size,false,_threads_per_atom); - if (success!=0) - return success; - if (ucl_device!=device->gpu) _compiled=false; ucl_device=device->gpu; atom=&device->atom; _block_size=device->pair_block_size(); - compile_kernels(*ucl_device,pair_program,k_name); + compile_kernels(*ucl_device,pair_program,k_name,onetype); + + if (_threads_per_atom>1 && gpu_nbor==0) { + nbor->packing(true); + _nbor_data=&(nbor->dev_packed); + } else + _nbor_data=&(nbor->dev_nbor); + + success = device->init_nbor(nbor,nlocal,host_nlocal,nall,maxspecial,_gpu_host, + max_nbors,cell_size,false,_threads_per_atom); + if (success!=0) + return success; // Initialize host-device load balancer hd_balancer.init(device,gpu_nbor,gpu_split); @@ -102,8 +110,8 @@ int BaseAtomicT::init_atomic(const int nlocal, const int nall, } template -void BaseAtomicT::estimate_gpu_overhead() { - device->estimate_gpu_overhead(1,_gpu_overhead,_driver_overhead); +void BaseAtomicT::estimate_gpu_overhead(const int add_kernels) { + device->estimate_gpu_overhead(1+add_kernels,_gpu_overhead,_driver_overhead); } template @@ -164,8 +172,8 @@ inline void BaseAtomicT::build_nbor_list(const int inum, const int host_inum, atom->cast_copy_x(host_x,host_type); int mn; - nbor->build_nbor_list(host_x, inum, host_inum, nall, *atom, sublo, subhi, tag, - nspecial, special, success, mn); + nbor->build_nbor_list(host_x, inum, host_inum, nall, *atom, sublo, subhi, + tag, nspecial, special, success, mn, ans->error_flag); double bytes=ans->gpu_bytes()+nbor->gpu_bytes(); if (bytes>_max_an_bytes) @@ -177,13 +185,27 @@ inline void BaseAtomicT::build_nbor_list(const int inum, const int host_inum, // --------------------------------------------------------------------------- template void BaseAtomicT::compute(const int f_ago, const int inum_full, - const int nall, double **host_x, int *host_type, - int *ilist, int *numj, int **firstneigh, - const bool eflag, const bool vflag, - const bool eatom, const bool vatom, - int &host_start, const double cpu_time, - bool &success) { + const int nall, double **host_x, int *host_type, + int *ilist, int *numj, int **firstneigh, + const bool eflag_in, const bool vflag_in, + const bool eatom, const bool vatom, + int &host_start, const double cpu_time, + bool &success) { acc_timers(); + int eflag, vflag; + if (eatom) eflag=2; + else if (eflag_in) eflag=1; + else eflag=0; + if (vatom) vflag=2; + else if (vflag_in) vflag=1; + else vflag=0; + + #ifdef LAL_NO_BLOCK_REDUCE + if (eflag) eflag=2; + if (vflag) vflag=2; + #endif + + set_kernel(eflag,vflag); if (inum_full==0) { host_start=0; // Make sure textures are correct if realloc by a different hybrid style @@ -207,8 +229,8 @@ void BaseAtomicT::compute(const int f_ago, const int inum_full, hd_balancer.start_timer(); atom->add_x_data(host_x,host_type); - loop(eflag,vflag); - ans->copy_answers(eflag,vflag,eatom,vatom,ilist); + const int red_blocks=loop(eflag,vflag); + ans->copy_answers(eflag_in,vflag_in,eatom,vatom,ilist,red_blocks); device->add_ans_object(ans); hd_balancer.stop_timer(); } @@ -218,14 +240,28 @@ void BaseAtomicT::compute(const int f_ago, const int inum_full, // --------------------------------------------------------------------------- template int ** BaseAtomicT::compute(const int ago, const int inum_full, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, - int **nspecial, tagint **special, const bool eflag, - const bool vflag, const bool eatom, - const bool vatom, int &host_start, - int **ilist, int **jnum, - const double cpu_time, bool &success) { + const int nall, double **host_x, int *host_type, + double *sublo, double *subhi, tagint *tag, + int **nspecial, tagint **special, + const bool eflag_in, const bool vflag_in, + const bool eatom, const bool vatom, + int &host_start, int **ilist, int **jnum, + const double cpu_time, bool &success) { acc_timers(); + int eflag, vflag; + if (eatom) eflag=2; + else if (eflag_in) eflag=1; + else eflag=0; + if (vatom) vflag=2; + else if (vflag_in) vflag=1; + else vflag=0; + + #ifdef LAL_NO_BLOCK_REDUCE + if (eflag) eflag=2; + if (vflag) vflag=2; + #endif + + set_kernel(eflag,vflag); if (inum_full==0) { host_start=0; // Make sure textures are correct if realloc by a different hybrid style @@ -254,8 +290,8 @@ int ** BaseAtomicT::compute(const int ago, const int inum_full, *ilist=nbor->host_ilist.begin(); *jnum=nbor->host_acc.begin(); - loop(eflag,vflag); - ans->copy_answers(eflag,vflag,eatom,vatom); + const int red_blocks=loop(eflag,vflag); + ans->copy_answers(eflag_in,vflag_in,eatom,vatom,red_blocks); device->add_ans_object(ans); hd_balancer.stop_timer(); @@ -270,19 +306,46 @@ double BaseAtomicT::host_memory_usage_atomic() const { template void BaseAtomicT::compile_kernels(UCL_Device &dev, const void *pair_str, - const char *kname) { - if (_compiled) + const char *kname, const int onetype) { + if (_compiled && _onetype==onetype) return; + _onetype=onetype; std::string s_fast=std::string(kname)+"_fast"; if (pair_program) delete pair_program; pair_program=new UCL_Program(dev); - pair_program->load_string(pair_str,device->compile_string().c_str()); + std::string oclstring = device->compile_string()+" -DEVFLAG=1"; + if (_onetype) oclstring+=" -DONETYPE="+device->toa(_onetype); + pair_program->load_string(pair_str,oclstring.c_str(),nullptr,screen); k_pair_fast.set_function(*pair_program,s_fast.c_str()); k_pair.set_function(*pair_program,kname); pos_tex.get_texture(*pair_program,"pos_tex"); + #if defined(LAL_OCL_EV_JIT) + oclstring = device->compile_string()+" -DEVFLAG=0"; + if (_onetype) oclstring+=" -DONETYPE="+device->toa(_onetype); + if (pair_program_noev) delete pair_program_noev; + pair_program_noev=new UCL_Program(dev); + pair_program_noev->load_string(pair_str,oclstring.c_str(),nullptr,screen); + k_pair_noev.set_function(*pair_program_noev,s_fast.c_str()); + #else + k_pair_sel = &k_pair_fast; + #endif + _compiled=true; + + #if defined(USE_OPENCL) && (defined(CL_VERSION_2_1) || defined(CL_VERSION_3_0)) + if (dev.cl_device_version() >= 210) { + size_t mx_subgroup_sz = k_pair_fast.max_subgroup_size(_block_size); + #if defined(LAL_OCL_EV_JIT) + mx_subgroup_sz = std::min(mx_subgroup_sz, k_pair_noev.max_subgroup_size(_block_size)); + #endif + if (_threads_per_atom > mx_subgroup_sz) + _threads_per_atom = mx_subgroup_sz; + device->set_simd_size(mx_subgroup_sz); + } + #endif + } template class BaseAtomic; diff --git a/lib/gpu/lal_base_atomic.h b/lib/gpu/lal_base_atomic.h index c97f42c50e..701675390f 100644 --- a/lib/gpu/lal_base_atomic.h +++ b/lib/gpu/lal_base_atomic.h @@ -53,10 +53,11 @@ class BaseAtomic { int init_atomic(const int nlocal, const int nall, const int max_nbors, const int maxspecial, const double cell_size, const double gpu_split, FILE *screen, - const void *pair_program, const char *k_name); + const void *pair_program, const char *k_name, + const int onetype=0); /// Estimate the overhead for GPU context changes and CPU driver - void estimate_gpu_overhead(); + void estimate_gpu_overhead(const int add_kernels=0); /// Check if there is enough storage for atom arrays and realloc if not /** \param success set to false if insufficient memory **/ @@ -100,7 +101,7 @@ class BaseAtomic { /// Accumulate timers inline void acc_timers() { if (device->time_device()) { - nbor->acc_timers(); + nbor->acc_timers(screen); time_pair.add_to_total(); atom->acc_timers(); ans->acc_timers(); @@ -179,23 +180,31 @@ class BaseAtomic { Neighbor *nbor; // ------------------------- DEVICE KERNELS ------------------------- - UCL_Program *pair_program; - UCL_Kernel k_pair_fast, k_pair; + UCL_Program *pair_program, *pair_program_noev; + UCL_Kernel k_pair_fast, k_pair, k_pair_noev, *k_pair_sel; inline int block_size() { return _block_size; } + inline void set_kernel(const int eflag, const int vflag) { + #if defined(LAL_OCL_EV_JIT) + if (eflag || vflag) k_pair_sel = &k_pair_fast; + else k_pair_sel = &k_pair_noev; + #endif + } + // --------------------------- TEXTURES ----------------------------- UCL_Texture pos_tex; protected: bool _compiled; - int _block_size, _threads_per_atom; + int _block_size, _threads_per_atom, _onetype; double _max_bytes, _max_an_bytes; double _gpu_overhead, _driver_overhead; UCL_D_Vec *_nbor_data; - void compile_kernels(UCL_Device &dev, const void *pair_string, const char *k); + void compile_kernels(UCL_Device &dev, const void *pair_string, const char *k, + const int onetype); - virtual void loop(const bool _eflag, const bool _vflag) = 0; + virtual int loop(const int eflag, const int vflag) = 0; }; } diff --git a/lib/gpu/lal_base_charge.cpp b/lib/gpu/lal_base_charge.cpp index d5a6e06222..b0d08e4df7 100644 --- a/lib/gpu/lal_base_charge.cpp +++ b/lib/gpu/lal_base_charge.cpp @@ -27,6 +27,9 @@ BaseChargeT::BaseCharge() : _compiled(false), _max_bytes(0) { nbor=new Neighbor(); pair_program=nullptr; ucl_device=nullptr; + #if defined(LAL_OCL_EV_JIT) + pair_program_noev=nullptr; + #endif } template @@ -36,6 +39,10 @@ BaseChargeT::~BaseCharge() { k_pair_fast.clear(); k_pair.clear(); if (pair_program) delete pair_program; + #if defined(LAL_OCL_EV_JIT) + k_pair_noev.clear(); + if (pair_program_noev) delete pair_program_noev; + #endif } template @@ -64,21 +71,11 @@ int BaseChargeT::init_atomic(const int nlocal, const int nall, _gpu_host=1; _threads_per_atom=device->threads_per_charge(); - if (_threads_per_atom>1 && gpu_nbor==0) { - nbor->packing(true); - _nbor_data=&(nbor->dev_packed); - } else - _nbor_data=&(nbor->dev_nbor); int success=device->init(*ans,true,false,nlocal,nall,maxspecial); if (success!=0) return success; - success = device->init_nbor(nbor,nlocal,host_nlocal,nall,maxspecial,_gpu_host, - max_nbors,cell_size,false,_threads_per_atom); - if (success!=0) - return success; - if (ucl_device!=device->gpu) _compiled=false; ucl_device=device->gpu; @@ -88,6 +85,17 @@ int BaseChargeT::init_atomic(const int nlocal, const int nall, _block_bio_size=device->block_bio_pair(); compile_kernels(*ucl_device,pair_program,k_name); + if (_threads_per_atom>1 && gpu_nbor==0) { + nbor->packing(true); + _nbor_data=&(nbor->dev_packed); + } else + _nbor_data=&(nbor->dev_nbor); + + success = device->init_nbor(nbor,nlocal,host_nlocal,nall,maxspecial,_gpu_host, + max_nbors,cell_size,false,_threads_per_atom); + if (success!=0) + return success; + // Initialize host-device load balancer hd_balancer.init(device,gpu_nbor,gpu_split); @@ -104,8 +112,8 @@ int BaseChargeT::init_atomic(const int nlocal, const int nall, } template -void BaseChargeT::estimate_gpu_overhead() { - device->estimate_gpu_overhead(1,_gpu_overhead,_driver_overhead); +void BaseChargeT::estimate_gpu_overhead(const int add_kernels) { + device->estimate_gpu_overhead(1+add_kernels,_gpu_overhead,_driver_overhead); } template @@ -166,8 +174,8 @@ inline void BaseChargeT::build_nbor_list(const int inum, const int host_inum, atom->cast_copy_x(host_x,host_type); int mn; - nbor->build_nbor_list(host_x, inum, host_inum, nall, *atom, sublo, subhi, tag, - nspecial, special, success, mn); + nbor->build_nbor_list(host_x, inum, host_inum, nall, *atom, sublo, subhi, + tag, nspecial, special, success, mn, ans->error_flag); double bytes=ans->gpu_bytes()+nbor->gpu_bytes(); if (bytes>_max_an_bytes) @@ -179,14 +187,28 @@ inline void BaseChargeT::build_nbor_list(const int inum, const int host_inum, // --------------------------------------------------------------------------- template void BaseChargeT::compute(const int f_ago, const int inum_full, - const int nall, double **host_x, int *host_type, - int *ilist, int *numj, int **firstneigh, - const bool eflag, const bool vflag, - const bool eatom, const bool vatom, - int &host_start, const double cpu_time, - bool &success, double *host_q, - const int nlocal, double *boxlo, double *prd) { + const int nall, double **host_x, int *host_type, + int *ilist, int *numj, int **firstneigh, + const bool eflag_in, const bool vflag_in, + const bool eatom, const bool vatom, + int &host_start, const double cpu_time, + bool &success, double *host_q, + const int nlocal, double *boxlo, double *prd) { acc_timers(); + int eflag, vflag; + if (eatom) eflag=2; + else if (eflag_in) eflag=1; + else eflag=0; + if (vatom) vflag=2; + else if (vflag_in) vflag=1; + else vflag=0; + + #ifdef LAL_NO_BLOCK_REDUCE + if (eflag) eflag=2; + if (vflag) vflag=2; + #endif + + set_kernel(eflag,vflag); if (inum_full==0) { host_start=0; // Make sure textures are correct if realloc by a different hybrid style @@ -215,8 +237,8 @@ void BaseChargeT::compute(const int f_ago, const int inum_full, device->precompute(f_ago,nlocal,nall,host_x,host_type,success,host_q, boxlo, prd); - loop(eflag,vflag); - ans->copy_answers(eflag,vflag,eatom,vatom,ilist); + const int red_blocks=loop(eflag,vflag); + ans->copy_answers(eflag_in,vflag_in,eatom,vatom,ilist,red_blocks); device->add_ans_object(ans); hd_balancer.stop_timer(); } @@ -226,15 +248,29 @@ void BaseChargeT::compute(const int f_ago, const int inum_full, // --------------------------------------------------------------------------- template int** BaseChargeT::compute(const int ago, const int inum_full, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, - int **nspecial, tagint **special, const bool eflag, - const bool vflag, const bool eatom, - const bool vatom, int &host_start, - int **ilist, int **jnum, - const double cpu_time, bool &success, - double *host_q, double *boxlo, double *prd) { + const int nall, double **host_x, int *host_type, + double *sublo, double *subhi, tagint *tag, + int **nspecial, tagint **special, + const bool eflag_in, const bool vflag_in, + const bool eatom, const bool vatom, int &host_start, + int **ilist, int **jnum, + const double cpu_time, bool &success, + double *host_q, double *boxlo, double *prd) { acc_timers(); + int eflag, vflag; + if (eatom) eflag=2; + else if (eflag_in) eflag=1; + else eflag=0; + if (vatom) vflag=2; + else if (vflag_in) vflag=1; + else vflag=0; + + #ifdef LAL_NO_BLOCK_REDUCE + if (eflag) eflag=2; + if (vflag) vflag=2; + #endif + + set_kernel(eflag,vflag); if (inum_full==0) { host_start=0; // Make sure textures are correct if realloc by a different hybrid style @@ -269,8 +305,8 @@ int** BaseChargeT::compute(const int ago, const int inum_full, device->precompute(ago,inum_full,nall,host_x,host_type,success,host_q, boxlo, prd); - loop(eflag,vflag); - ans->copy_answers(eflag,vflag,eatom,vatom); + const int red_blocks=loop(eflag,vflag); + ans->copy_answers(eflag_in,vflag_in,eatom,vatom,red_blocks); device->add_ans_object(ans); hd_balancer.stop_timer(); @@ -292,13 +328,37 @@ void BaseChargeT::compile_kernels(UCL_Device &dev, const void *pair_str, std::string s_fast=std::string(kname)+"_fast"; if (pair_program) delete pair_program; pair_program=new UCL_Program(dev); - pair_program->load_string(pair_str,device->compile_string().c_str()); + std::string oclstring = device->compile_string()+" -DEVFLAG=1"; + pair_program->load_string(pair_str,oclstring.c_str(),nullptr,screen); k_pair_fast.set_function(*pair_program,s_fast.c_str()); k_pair.set_function(*pair_program,kname); pos_tex.get_texture(*pair_program,"pos_tex"); q_tex.get_texture(*pair_program,"q_tex"); + #if defined(LAL_OCL_EV_JIT) + oclstring = device->compile_string()+" -DEVFLAG=0"; + if (pair_program_noev) delete pair_program_noev; + pair_program_noev=new UCL_Program(dev); + pair_program_noev->load_string(pair_str,oclstring.c_str(),nullptr,screen); + k_pair_noev.set_function(*pair_program_noev,s_fast.c_str()); + #else + k_pair_sel = &k_pair_fast; + #endif + _compiled=true; + + #if defined(USE_OPENCL) && (defined(CL_VERSION_2_1) || defined(CL_VERSION_3_0)) + if (dev.cl_device_version() >= 210) { + size_t mx_subgroup_sz = k_pair_fast.max_subgroup_size(_block_size); + #if defined(LAL_OCL_EV_JIT) + mx_subgroup_sz = std::min(mx_subgroup_sz, k_pair_noev.max_subgroup_size(_block_size)); + #endif + if (_threads_per_atom > mx_subgroup_sz) + _threads_per_atom = mx_subgroup_sz; + device->set_simd_size(mx_subgroup_sz); + } + #endif + } template class BaseCharge; diff --git a/lib/gpu/lal_base_charge.h b/lib/gpu/lal_base_charge.h index b6d3e9e3f8..6b8761092a 100644 --- a/lib/gpu/lal_base_charge.h +++ b/lib/gpu/lal_base_charge.h @@ -57,7 +57,7 @@ class BaseCharge { const void *pair_program, const char *k_name); /// Estimate the overhead for GPU context changes and CPU driver - void estimate_gpu_overhead(); + void estimate_gpu_overhead(const int add_kernels=0); /// Check if there is enough storage for atom arrays and realloc if not /** \param success set to false if insufficient memory **/ @@ -103,7 +103,7 @@ class BaseCharge { /// Accumulate timers inline void acc_timers() { if (device->time_device()) { - nbor->acc_timers(); + nbor->acc_timers(screen); time_pair.add_to_total(); atom->acc_timers(); ans->acc_timers(); @@ -177,9 +177,15 @@ class BaseCharge { Neighbor *nbor; // ------------------------- DEVICE KERNELS ------------------------- - UCL_Program *pair_program; - UCL_Kernel k_pair_fast, k_pair; + UCL_Program *pair_program, *pair_program_noev; + UCL_Kernel k_pair_fast, k_pair, k_pair_noev, *k_pair_sel; inline int block_size() { return _block_size; } + inline void set_kernel(const int eflag, const int vflag) { + #if defined(LAL_OCL_EV_JIT) + if (eflag || vflag) k_pair_sel = &k_pair_fast; + else k_pair_sel = &k_pair_noev; + #endif + } // --------------------------- TEXTURES ----------------------------- UCL_Texture pos_tex; @@ -194,7 +200,7 @@ class BaseCharge { void compile_kernels(UCL_Device &dev, const void *pair_string, const char *k); - virtual void loop(const bool _eflag, const bool _vflag) = 0; + virtual int loop(const int eflag, const int vflag) = 0; }; } diff --git a/lib/gpu/lal_base_dipole.cpp b/lib/gpu/lal_base_dipole.cpp index 57773a3b80..9781065b13 100644 --- a/lib/gpu/lal_base_dipole.cpp +++ b/lib/gpu/lal_base_dipole.cpp @@ -27,6 +27,9 @@ BaseDipoleT::BaseDipole() : _compiled(false), _max_bytes(0) { nbor=new Neighbor(); pair_program=nullptr; ucl_device=nullptr; + #if defined(LAL_OCL_EV_JIT) + pair_program_noev=nullptr; + #endif } template @@ -36,6 +39,10 @@ BaseDipoleT::~BaseDipole() { k_pair_fast.clear(); k_pair.clear(); if (pair_program) delete pair_program; + #if defined(LAL_OCL_EV_JIT) + k_pair_noev.clear(); + if (pair_program_noev) delete pair_program_noev; + #endif } template @@ -65,30 +72,30 @@ int BaseDipoleT::init_atomic(const int nlocal, const int nall, _gpu_host=1; _threads_per_atom=device->threads_per_charge(); - if (_threads_per_atom>1 && gpu_nbor==0) { - nbor->packing(true); - _nbor_data=&(nbor->dev_packed); - } else - _nbor_data=&(nbor->dev_nbor); int success=device->init(*ans,true,true,nlocal,nall,maxspecial); if (success!=0) return success; - success = device->init_nbor(nbor,nlocal,host_nlocal,nall,maxspecial,_gpu_host, - max_nbors,cell_size,false,_threads_per_atom); - if (success!=0) - return success; - if (ucl_device!=device->gpu) _compiled=false; ucl_device=device->gpu; atom=&device->atom; _block_size=device->pair_block_size(); - _block_bio_size=device->block_bio_pair(); compile_kernels(*ucl_device,pair_program,k_name); + if (_threads_per_atom>1 && gpu_nbor==0) { + nbor->packing(true); + _nbor_data=&(nbor->dev_packed); + } else + _nbor_data=&(nbor->dev_nbor); + + success = device->init_nbor(nbor,nlocal,host_nlocal,nall,maxspecial,_gpu_host, + max_nbors,cell_size,false,_threads_per_atom); + if (success!=0) + return success; + // Initialize host-device load balancer hd_balancer.init(device,gpu_nbor,gpu_split); @@ -168,8 +175,8 @@ inline void BaseDipoleT::build_nbor_list(const int inum, const int host_inum, atom->cast_copy_x(host_x,host_type); int mn; - nbor->build_nbor_list(host_x, inum, host_inum, nall, *atom, sublo, subhi, tag, - nspecial, special, success, mn); + nbor->build_nbor_list(host_x, inum, host_inum, nall, *atom, sublo, subhi, + tag, nspecial, special, success, mn, ans->error_flag); double bytes=ans->gpu_bytes()+nbor->gpu_bytes(); if (bytes>_max_an_bytes) @@ -183,12 +190,26 @@ template void BaseDipoleT::compute(const int f_ago, const int inum_full, const int nall, double **host_x, int *host_type, int *ilist, int *numj, int **firstneigh, - const bool eflag, const bool vflag, + const bool eflag_in, const bool vflag_in, const bool eatom, const bool vatom, int &host_start, const double cpu_time, bool &success, double *host_q, double **host_mu, const int nlocal, double *boxlo, double *prd) { acc_timers(); + int eflag, vflag; + if (eatom) eflag=2; + else if (eflag_in) eflag=1; + else eflag=0; + if (vatom) vflag=2; + else if (vflag_in) vflag=1; + else vflag=0; + + #ifdef LAL_NO_BLOCK_REDUCE + if (eflag) eflag=2; + if (vflag) vflag=2; + #endif + + set_kernel(eflag,vflag); if (inum_full==0) { host_start=0; // Make sure textures are correct if realloc by a different hybrid style @@ -219,8 +240,8 @@ void BaseDipoleT::compute(const int f_ago, const int inum_full, device->precompute(f_ago,nlocal,nall,host_x,host_type,success,host_q, boxlo, prd); - loop(eflag,vflag); - ans->copy_answers(eflag,vflag,eatom,vatom,ilist); + const int red_blocks=loop(eflag,vflag); + ans->copy_answers(eflag_in,vflag_in,eatom,vatom,ilist,red_blocks); device->add_ans_object(ans); hd_balancer.stop_timer(); } @@ -232,14 +253,28 @@ template int** BaseDipoleT::compute(const int ago, const int inum_full, const int nall, double **host_x, int *host_type, double *sublo, double *subhi, tagint *tag, - int **nspecial, tagint **special, const bool eflag, - const bool vflag, const bool eatom, - const bool vatom, int &host_start, - int **ilist, int **jnum, + int **nspecial, tagint **special, + const bool eflag_in, const bool vflag_in, + const bool eatom, const bool vatom, + int &host_start, int **ilist, int **jnum, const double cpu_time, bool &success, double *host_q, double **host_mu, double *boxlo, double *prd) { acc_timers(); + int eflag, vflag; + if (eatom) eflag=2; + else if (eflag_in) eflag=1; + else eflag=0; + if (vatom) vflag=2; + else if (vflag_in) vflag=1; + else vflag=0; + + #ifdef LAL_NO_BLOCK_REDUCE + if (eflag) eflag=2; + if (vflag) vflag=2; + #endif + + set_kernel(eflag,vflag); if (inum_full==0) { host_start=0; // Make sure textures are correct if realloc by a different hybrid style @@ -277,8 +312,8 @@ int** BaseDipoleT::compute(const int ago, const int inum_full, device->precompute(ago,inum_full,nall,host_x,host_type,success,host_q, boxlo, prd); - loop(eflag,vflag); - ans->copy_answers(eflag,vflag,eatom,vatom); + const int red_blocks=loop(eflag,vflag); + ans->copy_answers(eflag_in,vflag_in,eatom,vatom,red_blocks); device->add_ans_object(ans); hd_balancer.stop_timer(); @@ -300,14 +335,38 @@ void BaseDipoleT::compile_kernels(UCL_Device &dev, const void *pair_str, std::string s_fast=std::string(kname)+"_fast"; if (pair_program) delete pair_program; pair_program=new UCL_Program(dev); - pair_program->load_string(pair_str,device->compile_string().c_str()); + std::string oclstring = device->compile_string()+" -DEVFLAG=1"; + pair_program->load_string(pair_str,oclstring.c_str(),nullptr,screen); k_pair_fast.set_function(*pair_program,s_fast.c_str()); k_pair.set_function(*pair_program,kname); pos_tex.get_texture(*pair_program,"pos_tex"); q_tex.get_texture(*pair_program,"q_tex"); mu_tex.get_texture(*pair_program,"mu_tex"); + #if defined(LAL_OCL_EV_JIT) + oclstring = device->compile_string()+" -DEVFLAG=0"; + if (pair_program_noev) delete pair_program_noev; + pair_program_noev=new UCL_Program(dev); + pair_program_noev->load_string(pair_str,oclstring.c_str(),nullptr,screen); + k_pair_noev.set_function(*pair_program_noev,s_fast.c_str()); + #else + k_pair_sel = &k_pair_fast; + #endif + _compiled=true; + + #if defined(USE_OPENCL) && (defined(CL_VERSION_2_1) || defined(CL_VERSION_3_0)) + if (dev.cl_device_version() >= 210) { + size_t mx_subgroup_sz = k_pair_fast.max_subgroup_size(_block_size); + #if defined(LAL_OCL_EV_JIT) + mx_subgroup_sz = std::min(mx_subgroup_sz, k_pair_noev.max_subgroup_size(_block_size)); + #endif + if (_threads_per_atom > mx_subgroup_sz) + _threads_per_atom = mx_subgroup_sz; + device->set_simd_size(mx_subgroup_sz); + } + #endif + } template class BaseDipole; diff --git a/lib/gpu/lal_base_dipole.h b/lib/gpu/lal_base_dipole.h index 856b69b56b..f7cefd9066 100644 --- a/lib/gpu/lal_base_dipole.h +++ b/lib/gpu/lal_base_dipole.h @@ -102,7 +102,7 @@ class BaseDipole { /// Accumulate timers inline void acc_timers() { if (device->time_device()) { - nbor->acc_timers(); + nbor->acc_timers(screen); time_pair.add_to_total(); atom->acc_timers(); ans->acc_timers(); @@ -176,9 +176,16 @@ class BaseDipole { Neighbor *nbor; // ------------------------- DEVICE KERNELS ------------------------- - UCL_Program *pair_program; - UCL_Kernel k_pair_fast, k_pair; + UCL_Program *pair_program, *pair_program_noev; + UCL_Kernel k_pair_fast, k_pair, k_pair_noev, *k_pair_sel; inline int block_size() { return _block_size; } + inline void set_kernel(const int eflag, const int vflag) { + #if defined(LAL_OCL_EV_JIT) + if (eflag || vflag) k_pair_sel = &k_pair_fast; + else k_pair_sel = &k_pair_noev; + #endif + } + // --------------------------- TEXTURES ----------------------------- UCL_Texture pos_tex; @@ -187,14 +194,14 @@ class BaseDipole { protected: bool _compiled; - int _block_size, _block_bio_size, _threads_per_atom; + int _block_size, _threads_per_atom; double _max_bytes, _max_an_bytes; double _gpu_overhead, _driver_overhead; UCL_D_Vec *_nbor_data; void compile_kernels(UCL_Device &dev, const void *pair_string, const char *k); - virtual void loop(const bool _eflag, const bool _vflag) = 0; + virtual int loop(const int eflag, const int vflag) = 0; }; } diff --git a/lib/gpu/lal_base_dpd.cpp b/lib/gpu/lal_base_dpd.cpp index e4fd80fcc3..4b6a964bfb 100644 --- a/lib/gpu/lal_base_dpd.cpp +++ b/lib/gpu/lal_base_dpd.cpp @@ -27,6 +27,9 @@ BaseDPDT::BaseDPD() : _compiled(false), _max_bytes(0) { nbor=new Neighbor(); pair_program=nullptr; ucl_device=nullptr; + #if defined(LAL_OCL_EV_JIT) + pair_program_noev=nullptr; + #endif } template @@ -36,6 +39,10 @@ BaseDPDT::~BaseDPD() { k_pair_fast.clear(); k_pair.clear(); if (pair_program) delete pair_program; + #if defined(LAL_OCL_EV_JIT) + k_pair_noev.clear(); + if (pair_program_noev) delete pair_program_noev; + #endif } template @@ -47,9 +54,9 @@ int BaseDPDT::bytes_per_atom_atomic(const int max_nbors) const { template int BaseDPDT::init_atomic(const int nlocal, const int nall, const int max_nbors, const int maxspecial, - const double cell_size, - const double gpu_split, FILE *_screen, - const void *pair_program, const char *k_name) { + const double cell_size, const double gpu_split, + FILE *_screen, const void *pair_program, + const char *k_name, const int onetype) { screen=_screen; int gpu_nbor=0; @@ -63,31 +70,30 @@ int BaseDPDT::init_atomic(const int nlocal, const int nall, if (host_nlocal>0) _gpu_host=1; - _threads_per_atom=device->threads_per_charge(); - if (_threads_per_atom>1 && gpu_nbor==0) { - nbor->packing(true); - _nbor_data=&(nbor->dev_packed); - } else - _nbor_data=&(nbor->dev_nbor); + _threads_per_atom=device->threads_per_atom(); int success=device->init(*ans,false,false,nlocal,nall,maxspecial,true); if (success!=0) return success; - success = device->init_nbor(nbor,nlocal,host_nlocal,nall,maxspecial,_gpu_host, - max_nbors,cell_size,false,_threads_per_atom); - - if (success!=0) - return success; - if (ucl_device!=device->gpu) _compiled=false; ucl_device=device->gpu; atom=&device->atom; _block_size=device->pair_block_size(); - _block_bio_size=device->block_bio_pair(); - compile_kernels(*ucl_device,pair_program,k_name); + compile_kernels(*ucl_device,pair_program,k_name,onetype); + + if (_threads_per_atom>1 && gpu_nbor==0) { + nbor->packing(true); + _nbor_data=&(nbor->dev_packed); + } else + _nbor_data=&(nbor->dev_nbor); + + success = device->init_nbor(nbor,nlocal,host_nlocal,nall,maxspecial,_gpu_host, + max_nbors,cell_size,false,_threads_per_atom); + if (success!=0) + return success; // Initialize host-device load balancer hd_balancer.init(device,gpu_nbor,gpu_split); @@ -167,8 +173,8 @@ inline void BaseDPDT::build_nbor_list(const int inum, const int host_inum, atom->cast_copy_x(host_x,host_type); int mn; - nbor->build_nbor_list(host_x, inum, host_inum, nall, *atom, sublo, subhi, tag, - nspecial, special, success, mn); + nbor->build_nbor_list(host_x, inum, host_inum, nall, *atom, sublo, subhi, + tag, nspecial, special, success, mn, ans->error_flag); double bytes=ans->gpu_bytes()+nbor->gpu_bytes(); if (bytes>_max_an_bytes) @@ -179,16 +185,30 @@ inline void BaseDPDT::build_nbor_list(const int inum, const int host_inum, // Copy nbor list from host if necessary and then calculate forces, virials,.. // --------------------------------------------------------------------------- template -void BaseDPDT::compute(const int f_ago, const int inum_full, - const int nall, double **host_x, int *host_type, - int *ilist, int *numj, int **firstneigh, - const bool eflag, const bool vflag, - const bool eatom, const bool vatom, - int &host_start, const double cpu_time, - bool &success, tagint *tag, double **host_v, - const double dtinvsqrt, const int seed, const int timestep, +void BaseDPDT::compute(const int f_ago, const int inum_full, const int nall, + double **host_x, int *host_type, int *ilist, int *numj, + int **firstneigh, const bool eflag_in, + const bool vflag_in, const bool eatom, + const bool vatom, int &host_start, + const double cpu_time, bool &success, tagint *tag, + double **host_v, const double dtinvsqrt, + const int seed, const int timestep, const int nlocal, double *boxlo, double *prd) { acc_timers(); + int eflag, vflag; + if (eatom) eflag=2; + else if (eflag_in) eflag=1; + else eflag=0; + if (vatom) vflag=2; + else if (vflag_in) vflag=1; + else vflag=0; + + #ifdef LAL_NO_BLOCK_REDUCE + if (eflag) eflag=2; + if (vflag) vflag=2; + #endif + + set_kernel(eflag,vflag); if (inum_full==0) { host_start=0; // Make sure textures are correct if realloc by a different hybrid style @@ -218,8 +238,8 @@ void BaseDPDT::compute(const int f_ago, const int inum_full, _seed = seed; _timestep = timestep; - loop(eflag,vflag); - ans->copy_answers(eflag,vflag,eatom,vatom,ilist); + const int red_blocks=loop(eflag,vflag); + ans->copy_answers(eflag_in,vflag_in,eatom,vatom,ilist,red_blocks); device->add_ans_object(ans); hd_balancer.stop_timer(); } @@ -231,8 +251,8 @@ template int** BaseDPDT::compute(const int ago, const int inum_full, const int nall, double **host_x, int *host_type, double *sublo, double *subhi, tagint *tag, - int **nspecial, tagint **special, const bool eflag, - const bool vflag, const bool eatom, + int **nspecial, tagint **special, const bool eflag_in, + const bool vflag_in, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, bool &success, @@ -240,6 +260,20 @@ int** BaseDPDT::compute(const int ago, const int inum_full, const int seed, const int timestep, double *boxlo, double *prd) { acc_timers(); + int eflag, vflag; + if (eatom) eflag=2; + else if (eflag_in) eflag=1; + else eflag=0; + if (vatom) vflag=2; + else if (vflag_in) vflag=1; + else vflag=0; + + #ifdef LAL_NO_BLOCK_REDUCE + if (eflag) eflag=2; + if (vflag) vflag=2; + #endif + + set_kernel(eflag,vflag); if (inum_full==0) { host_start=0; // Make sure textures are correct if realloc by a different hybrid style @@ -275,8 +309,8 @@ int** BaseDPDT::compute(const int ago, const int inum_full, _seed = seed; _timestep = timestep; - loop(eflag,vflag); - ans->copy_answers(eflag,vflag,eatom,vatom); + const int red_blocks=loop(eflag,vflag); + ans->copy_answers(eflag_in,vflag_in,eatom,vatom,red_blocks); device->add_ans_object(ans); hd_balancer.stop_timer(); @@ -291,20 +325,48 @@ double BaseDPDT::host_memory_usage_atomic() const { template void BaseDPDT::compile_kernels(UCL_Device &dev, const void *pair_str, - const char *kname) { - if (_compiled) + const char *kname, const int onetype) { + if (_compiled && _onetype==onetype) return; + _onetype=onetype; + std::string s_fast=std::string(kname)+"_fast"; if (pair_program) delete pair_program; pair_program=new UCL_Program(dev); - pair_program->load_string(pair_str,device->compile_string().c_str()); + std::string oclstring = device->compile_string()+" -DEVFLAG=1"; + if (_onetype) oclstring+=" -DONETYPE="+device->toa(_onetype); + pair_program->load_string(pair_str,oclstring.c_str(),nullptr,screen); k_pair_fast.set_function(*pair_program,s_fast.c_str()); k_pair.set_function(*pair_program,kname); pos_tex.get_texture(*pair_program,"pos_tex"); vel_tex.get_texture(*pair_program,"vel_tex"); + #if defined(LAL_OCL_EV_JIT) + oclstring = device->compile_string()+" -DEVFLAG=0"; + if (_onetype) oclstring+=" -DONETYPE="+device->toa(_onetype); + if (pair_program_noev) delete pair_program_noev; + pair_program_noev=new UCL_Program(dev); + pair_program_noev->load_string(pair_str,oclstring.c_str(),nullptr,screen); + k_pair_noev.set_function(*pair_program_noev,s_fast.c_str()); + #else + k_pair_sel = &k_pair_fast; + #endif + _compiled=true; + + #if defined(USE_OPENCL) && (defined(CL_VERSION_2_1) || defined(CL_VERSION_3_0)) + if (dev.cl_device_version() >= 210) { + size_t mx_subgroup_sz = k_pair_fast.max_subgroup_size(_block_size); + #if defined(LAL_OCL_EV_JIT) + mx_subgroup_sz = std::min(mx_subgroup_sz, k_pair_noev.max_subgroup_size(_block_size)); + #endif + if (_threads_per_atom > mx_subgroup_sz) + _threads_per_atom = mx_subgroup_sz; + device->set_simd_size(mx_subgroup_sz); + } + #endif + } template class BaseDPD; diff --git a/lib/gpu/lal_base_dpd.h b/lib/gpu/lal_base_dpd.h index 5d1573c1a9..9eb56993af 100644 --- a/lib/gpu/lal_base_dpd.h +++ b/lib/gpu/lal_base_dpd.h @@ -52,7 +52,8 @@ class BaseDPD { int init_atomic(const int nlocal, const int nall, const int max_nbors, const int maxspecial, const double cell_size, const double gpu_split, FILE *screen, - const void *pair_program, const char *k_name); + const void *pair_program, const char *k_name, + const int onetype=0); /// Estimate the overhead for GPU context changes and CPU driver void estimate_gpu_overhead(); @@ -101,7 +102,7 @@ class BaseDPD { /// Accumulate timers inline void acc_timers() { if (device->time_device()) { - nbor->acc_timers(); + nbor->acc_timers(screen); time_pair.add_to_total(); atom->acc_timers(); ans->acc_timers(); @@ -177,9 +178,16 @@ class BaseDPD { Neighbor *nbor; // ------------------------- DEVICE KERNELS ------------------------- - UCL_Program *pair_program; - UCL_Kernel k_pair_fast, k_pair; + UCL_Program *pair_program, *pair_program_noev; + UCL_Kernel k_pair_fast, k_pair, k_pair_noev, *k_pair_sel; inline int block_size() { return _block_size; } + inline void set_kernel(const int eflag, const int vflag) { + #if defined(LAL_OCL_EV_JIT) + if (eflag || vflag) k_pair_sel = &k_pair_fast; + else k_pair_sel = &k_pair_noev; + #endif + } + // --------------------------- TEXTURES ----------------------------- UCL_Texture pos_tex; @@ -191,13 +199,14 @@ class BaseDPD { protected: bool _compiled; - int _block_size, _block_bio_size, _threads_per_atom; + int _block_size, _threads_per_atom, _onetype; double _max_bytes, _max_an_bytes; double _gpu_overhead, _driver_overhead; UCL_D_Vec *_nbor_data; - void compile_kernels(UCL_Device &dev, const void *pair_string, const char *k); - virtual void loop(const bool _eflag, const bool _vflag) = 0; + void compile_kernels(UCL_Device &dev, const void *pair_string, + const char *k, const int onetype); + virtual int loop(const int eflag, const int vflag) = 0; }; } diff --git a/lib/gpu/lal_base_ellipsoid.cpp b/lib/gpu/lal_base_ellipsoid.cpp index 524705ed41..87bfe14751 100644 --- a/lib/gpu/lal_base_ellipsoid.cpp +++ b/lib/gpu/lal_base_ellipsoid.cpp @@ -29,7 +29,8 @@ const char *ellipsoid_nbor=0; extern Device global_device; template -BaseEllipsoidT::BaseEllipsoid() : _compiled(false), _max_bytes(0) { +BaseEllipsoidT::BaseEllipsoid() : _compiled(false), _max_bytes(0), + host_olist_size(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); @@ -37,6 +38,10 @@ BaseEllipsoidT::BaseEllipsoid() : _compiled(false), _max_bytes(0) { ellipsoid_program=nullptr; lj_program=nullptr; ucl_device=nullptr; + #if defined(LAL_OCL_EV_JIT) + ellipsoid_program_noev=nullptr; + lj_program_noev=nullptr; + #endif } template @@ -53,6 +58,14 @@ BaseEllipsoidT::~BaseEllipsoid() { if (nbor_program) delete nbor_program; if (ellipsoid_program) delete ellipsoid_program; if (lj_program) delete lj_program; + #if defined(LAL_OCL_EV_JIT) + k_ellipsoid_noev.clear(); + k_ellipsoid_sphere_noev.clear(); + k_sphere_ellipsoid_noev.clear(); + k_lj_fast.clear(); + if (ellipsoid_program_noev) delete ellipsoid_program_noev; + if (lj_program_noev) delete lj_program_noev; + #endif } template @@ -89,11 +102,6 @@ int BaseEllipsoidT::init_base(const int nlocal, const int nall, if (success!=0) return success; - success = device->init_nbor(nbor,nlocal,host_nlocal,nall,maxspecial,_gpu_host, - max_nbors,cell_size,true,1); - if (success!=0) - return success; - if (ucl_device!=device->gpu) _compiled=false; ucl_device=device->gpu; @@ -102,6 +110,11 @@ int BaseEllipsoidT::init_base(const int nlocal, const int nall, _block_size=device->block_ellipse(); compile_kernels(*ucl_device,ellipsoid_program,lj_program,k_name,ellip_sphere); + success = device->init_nbor(nbor,nlocal,host_nlocal,nall,maxspecial,_gpu_host, + max_nbors,cell_size,true,1); + if (success!=0) + return success; + // Initialize host-device load balancer hd_balancer.init(device,gpu_nbor,gpu_split); @@ -133,12 +146,11 @@ int BaseEllipsoidT::init_base(const int nlocal, const int nall, if (_multiple_forms && gpu_nbor!=0) return -9; - if (_multiple_forms) + if (_multiple_forms) { ans->force.zero(); - - // Memory for ilist ordered by particle type - if (host_olist.alloc(nbor->max_atoms(),*ucl_device)!=UCL_SUCCESS) - return -3; + host_olist_size = nbor->max_atoms(); + host_olist = new int[nbor->max_atoms()]; + } _max_an_bytes=ans->gpu_bytes()+nbor->gpu_bytes(); @@ -160,7 +172,10 @@ template void BaseEllipsoidT::clear_base() { // Output any timing information output_times(); - host_olist.clear(); + if (host_olist_size) { + host_olist_size = 0; + delete []host_olist; + } time_nbor1.clear(); time_ellipsoid.clear(); @@ -206,10 +221,14 @@ void BaseEllipsoidT::output_times() { MPI_Reduce(&_max_bytes,&mpi_max_bytes,1,MPI_DOUBLE,MPI_MAX,0, device->replica()); double max_mb=mpi_max_bytes/(1024*1024); - double t_time=times[0]+times[1]+times[2]+times[3]+times[4]+times[5]; + + #ifdef USE_OPENCL + // Workaround for timing issue on Intel OpenCL + if (times[3] > 80e6) times[3]=0.0; + #endif if (device->replica_me()==0) - if (screen && times[5]>0.0) { + if (screen && times[7]>0.0) { int replica_size=device->replica_size(); fprintf(screen,"\n\n-------------------------------------"); @@ -218,9 +237,8 @@ void BaseEllipsoidT::output_times() { fprintf(screen,"\n-------------------------------------"); fprintf(screen,"--------------------------------\n"); - if (device->procs_per_gpu()==1 && t_time>0) { + if (device->procs_per_gpu()==1 && times[3]>0) { fprintf(screen,"Data Transfer: %.4f s.\n",times[0]/replica_size); - fprintf(screen,"Data Cast/Pack: %.4f s.\n",times[5]/replica_size); fprintf(screen,"Neighbor copy: %.4f s.\n",times[1]/replica_size); if (nbor->gpu_nbor()>0) fprintf(screen,"Neighbor build: %.4f s.\n",times[2]/replica_size); @@ -229,13 +247,15 @@ void BaseEllipsoidT::output_times() { fprintf(screen,"Force calc: %.4f s.\n",times[3]/replica_size); fprintf(screen,"LJ calc: %.4f s.\n",times[4]/replica_size); } - if (nbor->gpu_nbor()==2) - fprintf(screen,"Neighbor (CPU): %.4f s.\n",times[9]/replica_size); if (times[6]>0) fprintf(screen,"Device Overhead: %.4f s.\n",times[6]/replica_size); fprintf(screen,"Average split: %.4f.\n",avg_split); fprintf(screen,"Threads / atom: %d.\n",_threads_per_atom); + fprintf(screen,"Vector width: %d.\n", device->simd_size()); fprintf(screen,"Max Mem / Proc: %.2f MB.\n",max_mb); + if (nbor->gpu_nbor()==2) + fprintf(screen,"CPU Neighbor: %.4f s.\n",times[9]/replica_size); + fprintf(screen,"CPU Cast/Pack: %.4f s.\n",times[5]/replica_size); fprintf(screen,"CPU Driver_Time: %.4f s.\n",times[7]/replica_size); fprintf(screen,"CPU Idle_Time: %.4f s.\n",times[8]/replica_size); fprintf(screen,"-------------------------------------"); @@ -256,11 +276,13 @@ void BaseEllipsoidT::pack_nbors(const int GX, const int BX, const int start, if (shared_types) { k_nbor_fast.set_size(GX,BX); k_nbor_fast.run(&atom->x, &cut_form, &nbor->dev_nbor, &stride, &start, - &inum, &nbor->dev_packed, &form_low, &form_high); + &inum, &nbor->dev_packed, &form_low, &form_high, + &_threads_per_atom); } else { k_nbor.set_size(GX,BX); k_nbor.run(&atom->x, &cut_form, &ntypes, &nbor->dev_nbor, &stride, - &start, &inum, &nbor->dev_packed, &form_low, &form_high); + &start, &inum, &nbor->dev_packed, &form_low, &form_high, + &_threads_per_atom); } } @@ -298,7 +320,7 @@ void BaseEllipsoidT::reset_nbors(const int nall, const int inum, p++; } } - nbor->get_host(inum,host_olist.begin(),numj,firstneigh,block_size()); + nbor->get_host(inum,host_olist,numj,firstneigh,block_size()); nbor->copy_unpacked(inum,mn); return; } @@ -330,8 +352,8 @@ inline void BaseEllipsoidT::build_nbor_list(const int inum, const int host_inum, atom->cast_copy_x(host_x,host_type); int mn; - nbor->build_nbor_list(host_x, inum, host_inum, nall, *atom, sublo, subhi, tag, - nspecial, special, success, mn); + nbor->build_nbor_list(host_x, inum, host_inum, nall, *atom, sublo, subhi, + tag, nspecial, special, success, mn, ans->error_flag); nbor->copy_unpacked(inum,mn); _last_ellipse=inum; _max_last_ellipse=inum; @@ -348,11 +370,18 @@ template int* BaseEllipsoidT::compute(const int f_ago, const int inum_full, const int nall, double **host_x, int *host_type, int *ilist, int *numj, int **firstneigh, - const bool eflag, const bool vflag, + const bool eflag_in, const bool vflag_in, const bool eatom, const bool vatom, int &host_start, const double cpu_time, bool &success, double **host_quat) { acc_timers(); + int eflag, vflag; + if (eflag_in) eflag=2; + else eflag=0; + if (vflag_in) vflag=2; + else vflag=0; + + set_kernel(eflag,vflag); if (inum_full==0) { host_start=0; zero_timers(); @@ -373,7 +402,7 @@ int* BaseEllipsoidT::compute(const int f_ago, const int inum_full, } int *list; if (_multiple_forms) - list=host_olist.begin(); + list=host_olist; else list=ilist; @@ -384,7 +413,7 @@ int* BaseEllipsoidT::compute(const int f_ago, const int inum_full, atom->add_quat_data(); loop(eflag,vflag); - ans->copy_answers(eflag,vflag,eatom,vatom,list); + ans->copy_answers(eflag_in,vflag_in,eatom,vatom,list,inum); device->add_ans_object(ans); hd_balancer.stop_timer(); return list; @@ -394,15 +423,23 @@ int* BaseEllipsoidT::compute(const int f_ago, const int inum_full, // Reneighbor on GPU if necessary and then compute forces, virials, energies // --------------------------------------------------------------------------- template -int** BaseEllipsoidT::compute(const int ago, const int inum_full, const int nall, - double **host_x, int *host_type, double *sublo, - double *subhi, tagint *tag, int **nspecial, - tagint **special, const bool eflag, const bool vflag, +int** BaseEllipsoidT::compute(const int ago, const int inum_full, + const int nall, double **host_x, int *host_type, + double *sublo, double *subhi, tagint *tag, + int **nspecial, tagint **special, + const bool eflag_in, const bool vflag_in, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, bool &success, double **host_quat) { acc_timers(); + int eflag, vflag; + if (eflag_in) eflag=2; + else eflag=0; + if (vflag_in) vflag=2; + else vflag=0; + + set_kernel(eflag,vflag); if (inum_full==0) { host_start=0; zero_timers(); @@ -435,7 +472,7 @@ int** BaseEllipsoidT::compute(const int ago, const int inum_full, const int nall *jnum=nbor->host_acc.begin(); loop(eflag,vflag); - ans->copy_answers(eflag,vflag,eatom,vatom); + ans->copy_answers(eflag_in,vflag_in,eatom,vatom,inum); device->add_ans_object(ans); hd_balancer.stop_timer(); @@ -462,25 +499,26 @@ void BaseEllipsoidT::compile_kernels(UCL_Device &dev, std::string s_lj=kns+"_lj"; std::string s_lj_fast=kns+"_lj_fast"; - std::string flags=device->compile_string(); + std::string oclstring = device->compile_string()+" -DEVFLAG=1"; if (nbor_program) delete nbor_program; nbor_program=new UCL_Program(dev); - nbor_program->load_string(ellipsoid_nbor,flags.c_str()); + nbor_program->load_string(ellipsoid_nbor,oclstring.c_str(),nullptr,screen); k_nbor_fast.set_function(*nbor_program,"kernel_nbor_fast"); k_nbor.set_function(*nbor_program,"kernel_nbor"); neigh_tex.get_texture(*nbor_program,"pos_tex"); if (ellipsoid_program) delete ellipsoid_program; ellipsoid_program=new UCL_Program(dev); - ellipsoid_program->load_string(ellipsoid_string,flags.c_str()); + ellipsoid_program->load_string(ellipsoid_string,oclstring.c_str(), + nullptr,screen); k_ellipsoid.set_function(*ellipsoid_program,kname); pos_tex.get_texture(*ellipsoid_program,"pos_tex"); quat_tex.get_texture(*ellipsoid_program,"quat_tex"); if (lj_program) delete lj_program; lj_program=new UCL_Program(dev); - lj_program->load_string(lj_string,flags.c_str()); + lj_program->load_string(lj_string,oclstring.c_str(),nullptr,screen); k_sphere_ellipsoid.set_function(*lj_program,s_sphere_ellipsoid.c_str()); k_lj_fast.set_function(*lj_program,s_lj_fast.c_str()); k_lj.set_function(*lj_program,s_lj.c_str()); @@ -489,7 +527,52 @@ void BaseEllipsoidT::compile_kernels(UCL_Device &dev, lj_pos_tex.get_texture(*lj_program,"pos_tex"); lj_quat_tex.get_texture(*lj_program,"quat_tex"); + #if defined(LAL_OCL_EV_JIT) + oclstring = device->compile_string()+" -DEVFLAG=0"; + if (ellipsoid_program_noev) delete ellipsoid_program_noev; + ellipsoid_program_noev=new UCL_Program(dev); + ellipsoid_program_noev->load_string(ellipsoid_string,oclstring.c_str(), + nullptr,screen); + k_ellipsoid_noev.set_function(*ellipsoid_program_noev,kname); + + if (lj_program_noev) delete lj_program_noev; + lj_program_noev=new UCL_Program(dev); + lj_program_noev->load_string(lj_string,oclstring.c_str(),nullptr,screen); + k_sphere_ellipsoid_noev.set_function(*lj_program_noev, + s_sphere_ellipsoid.c_str()); + k_lj_fast_noev.set_function(*lj_program_noev,s_lj_fast.c_str()); + if (e_s) + k_ellipsoid_sphere_noev.set_function(*lj_program_noev, + s_ellipsoid_sphere.c_str()); + #else + k_elps_sel = &k_ellipsoid; + k_elps_sphere_sel = &k_ellipsoid_sphere; + k_sphere_elps_sel = &k_sphere_ellipsoid; + k_lj_sel = &k_lj_fast; + #endif + _compiled=true; + + #if defined(USE_OPENCL) && (defined(CL_VERSION_2_1) || defined(CL_VERSION_3_0)) + if (dev.cl_device_version() >= 210) { + size_t mx_subgroup_sz = k_lj_fast.max_subgroup_size(_block_size); + mx_subgroup_sz = std::min(mx_subgroup_sz, k_ellipsoid.max_subgroup_size(_block_size)); + mx_subgroup_sz = std::min(mx_subgroup_sz, k_sphere_ellipsoid.max_subgroup_size(_block_size)); + if (e_s) + mx_subgroup_sz = std::min(mx_subgroup_sz, k_ellipsoid_sphere.max_subgroup_size(_block_size)); + #if defined(LAL_OCL_EV_JIT) + mx_subgroup_sz = std::min(mx_subgroup_sz, k_lj_fast_noev.max_subgroup_size(_block_size)); + mx_subgroup_sz = std::min(mx_subgroup_sz, k_ellipsoid_noev.max_subgroup_size(_block_size)); + mx_subgroup_sz = std::min(mx_subgroup_sz, k_sphere_ellipsoid_noev.max_subgroup_size(_block_size)); + if (e_s) + mx_subgroup_sz = std::min(mx_subgroup_sz, k_ellipsoid_sphere_noev.max_subgroup_size(_block_size)); + #endif + if (_threads_per_atom > mx_subgroup_sz) + _threads_per_atom = mx_subgroup_sz; + device->set_simd_size(mx_subgroup_sz); + } + #endif + } template class BaseEllipsoid; diff --git a/lib/gpu/lal_base_ellipsoid.h b/lib/gpu/lal_base_ellipsoid.h index dc1e624a2f..f30a0062d2 100644 --- a/lib/gpu/lal_base_ellipsoid.h +++ b/lib/gpu/lal_base_ellipsoid.h @@ -88,10 +88,10 @@ class BaseEllipsoid { ans->resize(nlocal, success); if (_multiple_forms) ans->force.zero(); - if (olist_size>static_cast(host_olist.numel())) { - host_olist.clear(); - int new_size=static_cast(static_cast(olist_size)*1.10); - success=success && (host_olist.alloc(new_size,*ucl_device)==UCL_SUCCESS); + if (olist_size>host_olist_size) { + if (host_olist_size) delete []host_olist; + host_olist_size=static_cast(static_cast(olist_size)*1.10); + host_olist = new int[host_olist_size]; } nbor->resize(nlocal,host_inum,max_nbors,success); @@ -116,7 +116,7 @@ class BaseEllipsoid { /// Accumulate timers inline void acc_timers() { if (device->time_device()) { - nbor->acc_timers(); + nbor->acc_timers(screen); time_nbor1.add_to_total(); time_ellipsoid.add_to_total(); if (_multiple_forms) { @@ -223,14 +223,40 @@ class BaseEllipsoid { /// Neighbor data Neighbor *nbor; /// ilist with particles sorted by type - UCL_H_Vec host_olist; + int *host_olist; + int host_olist_size; // ------------------------- DEVICE KERNELS ------------------------- UCL_Program *nbor_program, *ellipsoid_program, *lj_program; + UCL_Program *ellipsoid_program_noev, *lj_program_noev; UCL_Kernel k_nbor_fast, k_nbor; UCL_Kernel k_ellipsoid, k_ellipsoid_sphere, k_sphere_ellipsoid; UCL_Kernel k_lj_fast, k_lj; + UCL_Kernel k_ellipsoid_noev, k_ellipsoid_sphere_noev; + UCL_Kernel k_sphere_ellipsoid_noev, k_lj_fast_noev; + UCL_Kernel *k_elps_sel, *k_elps_sphere_sel, *k_sphere_elps_sel, *k_lj_sel; inline int block_size() { return _block_size; } + inline void set_kernel(const int eflag, const int vflag) { + #if defined(LAL_OCL_EV_JIT) + if (_multiple_forms == false) { + if (eflag || vflag) k_elps_sel = &k_ellipsoid; + else k_elps_sel = &k_ellipsoid_noev; + } else { + if (eflag || vflag) { + k_elps_sel = &k_ellipsoid; + k_elps_sphere_sel = &k_ellipsoid_sphere; + k_sphere_elps_sel = &k_sphere_ellipsoid; + k_lj_sel = &k_lj_fast; + } else { + k_elps_sel = &k_ellipsoid_noev; + k_elps_sphere_sel = &k_ellipsoid_sphere_noev; + k_sphere_elps_sel = &k_sphere_ellipsoid_noev; + k_lj_sel = &k_lj_fast_noev; + } + } + #endif + } + // --------------------------- TEXTURES ----------------------------- UCL_Texture pos_tex, quat_tex, lj_pos_tex, lj_quat_tex, neigh_tex; @@ -240,7 +266,6 @@ class BaseEllipsoid { int _block_size, _threads_per_atom; double _max_bytes, _max_an_bytes; double _gpu_overhead, _driver_overhead; - UCL_D_Vec *_nbor_data; // True if we want to use fast GB-sphere or sphere-sphere calculations bool _multiple_forms; @@ -250,7 +275,7 @@ class BaseEllipsoid { void compile_kernels(UCL_Device &dev, const void *ellipsoid_string, const void *lj_string, const char *kname,const bool e_s); - virtual void loop(const bool _eflag, const bool _vflag) = 0; + virtual int loop(const int eflag, const int vflag) = 0; }; } diff --git a/lib/gpu/lal_base_three.cpp b/lib/gpu/lal_base_three.cpp index cfc138aea2..660385eb56 100644 --- a/lib/gpu/lal_base_three.cpp +++ b/lib/gpu/lal_base_three.cpp @@ -20,7 +20,7 @@ namespace LAMMPS_AL { extern Device global_device; template -BaseThreeT::BaseThree() : _compiled(false), _max_bytes(0) { +BaseThreeT::BaseThree() : _compiled(false), _max_bytes(0), _onetype(-1) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); @@ -29,6 +29,9 @@ BaseThreeT::BaseThree() : _compiled(false), _max_bytes(0) { #endif pair_program=nullptr; ucl_device=nullptr; + #if defined(LAL_OCL_EV_JIT) + pair_program_noev=nullptr; + #endif } template @@ -44,12 +47,18 @@ BaseThreeT::~BaseThree() { k_pair.clear(); k_short_nbor.clear(); if (pair_program) delete pair_program; + #if defined(LAL_OCL_EV_JIT) + k_three_center_noev.clear(); + k_three_end_noev.clear(); + k_pair_noev.clear(); + if (pair_program_noev) delete pair_program_noev; + #endif } template int BaseThreeT::bytes_per_atom_atomic(const int max_nbors) const { int b=device->atom.bytes_per_atom()+ans->bytes_per_atom()+ - nbor->bytes_per_atom(max_nbors); + nbor->bytes_per_atom(max_nbors); #ifdef THREE_CONCURRENT b+=ans2->bytes_per_atom(); #endif @@ -62,7 +71,9 @@ int BaseThreeT::init_three(const int nlocal, const int nall, const double cell_size, const double gpu_split, FILE *_screen, const void *pair_program, const char *two, const char *three_center, - const char *three_end, const char *short_nbor) { + const char *three_end, const char *short_nbor, + const int onetype, const int onetype3, + const int spq, const int tpa_override) { screen=_screen; int gpu_nbor=0; @@ -77,24 +88,16 @@ int BaseThreeT::init_three(const int nlocal, const int nall, if (host_nlocal>0) _gpu_host=1; - _threads_per_atom=device->threads_per_atom(); - if (_threads_per_atom>1 && gpu_nbor==0) { // neigh no and tpa > 1 - nbor->packing(true); - _nbor_data=&(nbor->dev_packed); - } else // neigh yes or tpa == 1 - _nbor_data=&(nbor->dev_nbor); - if (_threads_per_atom*_threads_per_atom>device->warp_size()) - return -10; + // Allow forcing threads per atom to 1 for tersoff due to subg sync issue + if (tpa_override) + _threads_per_atom=tpa_override; + else + _threads_per_atom=device->threads_per_three(); int success=device->init(*ans,false,false,nlocal,nall,maxspecial); if (success!=0) return success; - success = device->init_nbor(nbor,nlocal,host_nlocal,nall,maxspecial,_gpu_host, - max_nbors,cell_size,false,_threads_per_atom); - if (success!=0) - return success; - if (ucl_device!=device->gpu) _compiled=false; ucl_device=device->gpu; @@ -110,7 +113,19 @@ int BaseThreeT::init_three(const int nlocal, const int nall, _block_pair=device->pair_block_size(); _block_size=device->block_ellipse(); - compile_kernels(*ucl_device,pair_program,two,three_center,three_end,short_nbor); + compile_kernels(*ucl_device,pair_program,two,three_center,three_end, + short_nbor,onetype,onetype3,spq); + + while (_threads_per_atom*_threads_per_atom>device->simd_size()) + _threads_per_atom = _threads_per_atom / 2; + + if (_threads_per_atom*_threads_per_atom>device->simd_size()) + return -10; + + success = device->init_nbor(nbor,nall,host_nlocal,nall,maxspecial, + _gpu_host,max_nbors,cell_size,true,1,true); + if (success!=0) + return success; // Initialize host-device load balancer hd_balancer.init(device,gpu_nbor,gpu_split); @@ -121,22 +136,21 @@ int BaseThreeT::init_three(const int nlocal, const int nall, pos_tex.bind_float(atom->x,4); + int ef_nall=nall; + if (ef_nall==0) + ef_nall=2000; + _max_an_bytes=ans->gpu_bytes()+nbor->gpu_bytes(); #ifdef THREE_CONCURRENT _max_an_bytes+=ans2->gpu_bytes(); #endif - int ef_nall=nall; - if (ef_nall==0) - ef_nall=2000; - dev_short_nbor.alloc(ef_nall*(2+max_nbors),*(this->ucl_device),UCL_READ_WRITE); - return 0; } template -void BaseThreeT::estimate_gpu_overhead() { - device->estimate_gpu_overhead(1,_gpu_overhead,_driver_overhead); +void BaseThreeT::estimate_gpu_overhead(const int add_kernels) { + device->estimate_gpu_overhead(4+add_kernels,_gpu_overhead,_driver_overhead); } template @@ -152,7 +166,6 @@ void BaseThreeT::clear_atomic() { time_pair.clear(); hd_balancer.clear(); - dev_short_nbor.clear(); nbor->clear(); ans->clear(); #ifdef THREE_CONCURRENT @@ -186,6 +199,7 @@ int * BaseThreeT::reset_nbors(const int nall, const int inum, const int nlist, // now the requirement is removed, allowing to work within pair hybrid nbor->get_host(nlist,ilist,numj,firstneigh,block_size()); + nbor->copy_unpacked(nlist,mn); double bytes=ans->gpu_bytes()+nbor->gpu_bytes(); #ifdef THREE_CONCURRENT @@ -201,24 +215,32 @@ int * BaseThreeT::reset_nbors(const int nall, const int inum, const int nlist, // Build neighbor list on device // --------------------------------------------------------------------------- template -inline int BaseThreeT::build_nbor_list(const int inum, const int host_inum, - const int nall, double **host_x, - int *host_type, double *sublo, - double *subhi, tagint *tag, - int **nspecial, tagint **special, - bool &success) { +inline void BaseThreeT::build_nbor_list(const int inum, const int host_inum, + const int nall, double **host_x, + int *host_type, double *sublo, + double *subhi, tagint *tag, + int **nspecial, tagint **special, + bool &success) { success=true; resize_atom(inum,nall,success); resize_local(nall,host_inum,nbor->max_nbors(),success); if (!success) - return 0; + return; atom->cast_copy_x(host_x,host_type); _nall = nall; + // Increase the effective sub-domain size for neighbors of ghosts + // This is still inefficient because we are calculating neighbors for more + // ghosts than necessary due to increased ghost cutoff + const double ncut=nbor->cutoff()*2.0; + for (int i=0; i<3; i++) sublo[i]-=ncut; + for (int i=0; i<3; i++) subhi[i]+=ncut; + int mn; - nbor->build_nbor_list(host_x, nall, host_inum, nall, *atom, sublo, subhi, tag, - nspecial, special, success, mn); + nbor->build_nbor_list(host_x, nall, host_inum, nall, *atom, sublo, subhi, + tag, nspecial, special, success, mn, ans->error_flag); + nbor->copy_unpacked(nall,mn); double bytes=ans->gpu_bytes()+nbor->gpu_bytes(); #ifdef THREE_CONCURRENT @@ -226,7 +248,6 @@ inline int BaseThreeT::build_nbor_list(const int inum, const int host_inum, #endif if (bytes>_max_an_bytes) _max_an_bytes=bytes; - return mn; } // --------------------------------------------------------------------------- @@ -236,10 +257,24 @@ template void BaseThreeT::compute(const int f_ago, const int inum_full, const int nall, const int nlist, double **host_x, int *host_type, int *ilist, int *numj, int **firstneigh, - const bool eflag, const bool vflag, const bool eatom, - const bool vatom, int &host_start, + const bool eflag_in, const bool vflag_in, + const bool eatom, const bool vatom, int &host_start, const double cpu_time, bool &success) { acc_timers(); + int eflag, vflag; + if (eatom) eflag=2; + else if (eflag_in) eflag=1; + else eflag=0; + if (vatom) vflag=2; + else if (vflag_in) vflag=1; + else vflag=0; + + #ifdef LAL_NO_BLOCK_REDUCE + if (eflag) eflag=2; + if (vflag) vflag=2; + #endif + + set_kernel(eflag,vflag); if (inum_full==0) { host_start=0; // Make sure textures are correct if realloc by a different hybrid style @@ -260,19 +295,12 @@ void BaseThreeT::compute(const int f_ago, const int inum_full, const int nall, reset_nbors(nall, inum, nlist, ilist, numj, firstneigh, success); if (!success) return; - _max_nbors = nbor->max_nbor_loop(nlist,numj,ilist); } atom->cast_x_data(host_x,host_type); hd_balancer.start_timer(); atom->add_x_data(host_x,host_type); - // re-allocate dev_short_nbor if necessary - if (nall*(2+_max_nbors) > dev_short_nbor.cols()) { - int _nmax=static_cast(static_cast(nall)*1.10); - dev_short_nbor.resize((2+_max_nbors)*_nmax); - } - // _ainum to be used in loop() for short neighbor list build _ainum = nlist; @@ -282,11 +310,11 @@ void BaseThreeT::compute(const int f_ago, const int inum_full, const int nall, #ifdef THREE_CONCURRENT ucl_device->sync(); #endif - loop(eflag,vflag,evatom); - ans->copy_answers(eflag,vflag,eatom,vatom,ilist); + const int red_blocks=loop(eflag,vflag,evatom,success); + ans->copy_answers(eflag_in,vflag_in,eatom,vatom,ilist,red_blocks); device->add_ans_object(ans); #ifdef THREE_CONCURRENT - ans2->copy_answers(eflag,vflag,eatom,vatom,ilist); + ans2->copy_answers(eflag_in,vflag_in,eatom,vatom,ilist,red_blocks); device->add_ans_object(ans2); #endif hd_balancer.stop_timer(); @@ -296,15 +324,29 @@ void BaseThreeT::compute(const int f_ago, const int inum_full, const int nall, // Reneighbor on GPU if necessary and then compute forces, virials, energies // --------------------------------------------------------------------------- template -int ** BaseThreeT::compute(const int ago, const int inum_full, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, - int **nspecial, tagint **special, const bool eflag, - const bool vflag, const bool eatom, - const bool vatom, int &host_start, - int **ilist, int **jnum, - const double cpu_time, bool &success) { +int ** BaseThreeT::compute(const int ago, const int inum_full, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, + tagint **special, const bool eflag_in, + const bool vflag_in, const bool eatom, + const bool vatom, int &host_start, + int **ilist, int **jnum, + const double cpu_time, bool &success) { acc_timers(); + int eflag, vflag; + if (eatom) eflag=2; + else if (eflag_in) eflag=1; + else eflag=0; + if (vatom) vflag=2; + else if (vflag_in) vflag=1; + else vflag=0; + + #ifdef LAL_NO_BLOCK_REDUCE + if (eflag) eflag=2; + if (vflag) vflag=2; + #endif + + set_kernel(eflag,vflag); if (inum_full==0) { host_start=0; // Make sure textures are correct if realloc by a different hybrid style @@ -323,7 +365,7 @@ int ** BaseThreeT::compute(const int ago, const int inum_full, // Build neighbor list on GPU if necessary if (ago==0) { - _max_nbors = build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, + build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) return nullptr; @@ -336,12 +378,6 @@ int ** BaseThreeT::compute(const int ago, const int inum_full, *ilist=nbor->host_ilist.begin(); *jnum=nbor->host_acc.begin(); - // re-allocate dev_short_nbor if necessary - if (nall*(2+_max_nbors) > dev_short_nbor.cols()) { - int _nmax=static_cast(static_cast(nall)*1.10); - dev_short_nbor.resize((2+_max_nbors)*_nmax); - } - // _ainum to be used in loop() for short neighbor list build _ainum = nall; @@ -351,11 +387,11 @@ int ** BaseThreeT::compute(const int ago, const int inum_full, #ifdef THREE_CONCURRENT ucl_device->sync(); #endif - loop(eflag,vflag,evatom); - ans->copy_answers(eflag,vflag,eatom,vatom); + const int red_blocks=loop(eflag,vflag,evatom,success); + ans->copy_answers(eflag_in,vflag_in,eatom,vatom,red_blocks); device->add_ans_object(ans); #ifdef THREE_CONCURRENT - ans2->copy_answers(eflag,vflag,eatom,vatom); + ans2->copy_answers(eflag_in,vflag_in,eatom,vatom,red_blocks); device->add_ans_object(ans2); #endif hd_balancer.stop_timer(); @@ -372,14 +408,24 @@ double BaseThreeT::host_memory_usage_atomic() const { template void BaseThreeT::compile_kernels(UCL_Device &dev, const void *pair_str, const char *two, const char *three_center, - const char *three_end, const char* short_nbor) { - if (_compiled) + const char *three_end, const char* short_nbor, + const int onetype, const int onetype3, + const int spq) { + if (_compiled && _onetype==onetype && _onetype3==onetype3 && _spq==spq) return; + _onetype=onetype; + _onetype3=onetype3; + _spq=spq; + std::string vatom_name=std::string(three_end)+"_vatom"; if (pair_program) delete pair_program; pair_program=new UCL_Program(dev); - pair_program->load_string(pair_str,device->compile_string().c_str()); + std::string oclstring = device->compile_string()+" -DEVFLAG=1"; + if (_onetype>=0) oclstring+=" -DONETYPE="+device->toa(_onetype)+ + " -DONETYPE3="+device->toa(_onetype3); + if (_spq) oclstring+=" -DSPQ="+device->toa(_spq); + pair_program->load_string(pair_str,oclstring.c_str(),nullptr,screen); k_three_center.set_function(*pair_program,three_center); k_three_end.set_function(*pair_program,three_end); k_three_end_vatom.set_function(*pair_program,vatom_name.c_str()); @@ -387,12 +433,50 @@ void BaseThreeT::compile_kernels(UCL_Device &dev, const void *pair_str, k_short_nbor.set_function(*pair_program,short_nbor); pos_tex.get_texture(*pair_program,"pos_tex"); + #if defined(LAL_OCL_EV_JIT) + oclstring = device->compile_string()+" -DEVFLAG=0"; + if (_onetype>=0) oclstring+=" -DONETYPE="+device->toa(_onetype)+ + " -DONETYPE3="+device->toa(_onetype3); + if (_spq) oclstring+=" -DSPQ="+device->toa(_spq); + if (pair_program_noev) delete pair_program_noev; + pair_program_noev=new UCL_Program(dev); + pair_program_noev->load_string(pair_str,oclstring.c_str(),nullptr,screen); + k_three_center_noev.set_function(*pair_program_noev,three_center); + k_three_end_noev.set_function(*pair_program_noev,three_end); + k_pair_noev.set_function(*pair_program_noev,two); + #else + k_sel = &k_pair; + k_3center_sel = &k_three_center; + k_3end_sel = &k_three_end; + #endif + #ifdef THREE_CONCURRENT k_three_end.cq(ucl_device->cq(_end_command_queue)); k_three_end_vatom.cq(ucl_device->cq(_end_command_queue)); + #if defined(LAL_OCL_EV_JIT) + k_three_end_noev.cq(ucl_device->cq(_end_command_queue)); + #endif #endif _compiled=true; + + #if defined(USE_OPENCL) && (defined(CL_VERSION_2_1) || defined(CL_VERSION_3_0)) + if (dev.cl_device_version() >= 210) { + size_t mx_subgroup_sz = k_pair.max_subgroup_size(_block_size); + mx_subgroup_sz = std::min(mx_subgroup_sz, k_three_center.max_subgroup_size(_block_size)); + mx_subgroup_sz = std::min(mx_subgroup_sz, k_three_end.max_subgroup_size(_block_size)); + mx_subgroup_sz = std::min(mx_subgroup_sz, k_three_end_vatom.max_subgroup_size(_block_size)); + #if defined(LAL_OCL_EV_JIT) + mx_subgroup_sz = std::min(mx_subgroup_sz, k_pair_noev.max_subgroup_size(_block_size)); + mx_subgroup_sz = std::min(mx_subgroup_sz, k_three_center_noev.max_subgroup_size(_block_size)); + mx_subgroup_sz = std::min(mx_subgroup_sz, k_three_end_noev.max_subgroup_size(_block_size)); + #endif + if (_threads_per_atom > mx_subgroup_sz) + _threads_per_atom = mx_subgroup_sz; + device->set_simd_size(mx_subgroup_sz); + } + #endif + } template class BaseThree; diff --git a/lib/gpu/lal_base_three.h b/lib/gpu/lal_base_three.h index 36129e6168..3e830d4217 100644 --- a/lib/gpu/lal_base_three.h +++ b/lib/gpu/lal_base_three.h @@ -59,10 +59,12 @@ class BaseThree { const double gpu_split, FILE *screen, const void *pair_program, const char *k_two, const char *k_three_center, const char *k_three_end, - const char *k_short_nbor=nullptr); + const char *k_short_nbor=nullptr, const int onetype=-1, + const int onetype3=-1, const int spq=0, + const int tpa_override=0); /// Estimate the overhead for GPU context changes and CPU driver - void estimate_gpu_overhead(); + void estimate_gpu_overhead(const int add_kernels=0); /// Check if there is enough storage for atom arrays and realloc if not /** \param success set to false if insufficient memory **/ @@ -109,7 +111,7 @@ class BaseThree { /// Accumulate timers inline void acc_timers() { if (device->time_device()) { - nbor->acc_timers(); + nbor->acc_timers(screen); time_pair.add_to_total(); atom->acc_timers(); ans->acc_timers(); @@ -134,9 +136,9 @@ class BaseThree { int *numj, int **firstneigh, bool &success); /// Build neighbor list on device - int build_nbor_list(const int inum, const int host_inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, + void build_nbor_list(const int inum, const int host_inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, bool &success); /// Pair loop with host neighboring @@ -147,12 +149,12 @@ class BaseThree { int &host_start, const double cpu_time, bool &success); /// Pair loop with device neighboring - int ** compute(const int ago, const int inum_full, - const int nall, double **host_x, int *host_type, double *sublo, - double *subhi, tagint *tag, int **nspecial, - tagint **special, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - int **ilist, int **numj, const double cpu_time, bool &success); + int ** compute(const int ago, const int inum_full, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, + const bool eflag, const bool vflag, const bool eatom, + const bool vatom, int &host_start, int **ilist, + int **numj, const double cpu_time, bool &success); // -------------------------- DEVICE DATA ------------------------- @@ -188,14 +190,29 @@ class BaseThree { /// Neighbor data Neighbor *nbor; - UCL_D_Vec dev_short_nbor; UCL_Kernel k_short_nbor; // ------------------------- DEVICE KERNELS ------------------------- - UCL_Program *pair_program; + UCL_Program *pair_program, *pair_program_noev; UCL_Kernel k_pair, k_three_center, k_three_end, k_three_end_vatom; + UCL_Kernel k_pair_noev, k_three_center_noev, k_three_end_noev; + UCL_Kernel *k_sel, *k_3center_sel, *k_3end_sel; inline int block_pair() { return _block_pair; } inline int block_size() { return _block_size; } + inline void set_kernel(const int eflag, const int vflag) { + #if defined(LAL_OCL_EV_JIT) + if (eflag || vflag) { + k_sel = &k_pair; + k_3center_sel = &k_three_center; + k_3end_sel = &k_three_end; + } else { + k_sel = &k_pair_noev; + k_3center_sel = &k_three_center_noev; + k_3end_sel = &k_three_end_noev; + } + #endif + } + // --------------------------- TEXTURES ----------------------------- UCL_Texture pos_tex; @@ -203,18 +220,19 @@ class BaseThree { protected: bool _compiled; int _block_pair, _block_size, _threads_per_atom, _end_command_queue; - int _gpu_nbor; + int _gpu_nbor, _onetype, _onetype3, _spq; double _max_bytes, _max_an_bytes; - int _max_nbors, _ainum, _nall; + int _ainum, _nall; double _gpu_overhead, _driver_overhead; - UCL_D_Vec *_nbor_data; void compile_kernels(UCL_Device &dev, const void *pair_string, const char *two, const char *three_center, - const char *three_end, const char* short_nbor); + const char *three_end, const char* short_nbor, + const int onetype, const int onetype3, + const int spq); - virtual void loop(const bool _eflag, const bool _vflag, - const int evatom) = 0; + virtual int loop(const int eflag, const int vflag, const int evatom, + bool &success) = 0; }; } diff --git a/lib/gpu/lal_beck.cpp b/lib/gpu/lal_beck.cpp index be1722c32c..57551d9787 100644 --- a/lib/gpu/lal_beck.cpp +++ b/lib/gpu/lal_beck.cpp @@ -113,20 +113,9 @@ double BeckT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void BeckT::loop(const bool _eflag, const bool _vflag) { +int BeckT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -134,8 +123,8 @@ void BeckT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &beck1, &beck2, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &beck1, &beck2, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->_threads_per_atom); @@ -147,6 +136,7 @@ void BeckT::loop(const bool _eflag, const bool _vflag) { &ainum, &nbor_pitch, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class Beck; diff --git a/lib/gpu/lal_beck.cu b/lib/gpu/lal_beck.cu index f24132b9a2..a2a15e4d21 100644 --- a/lib/gpu/lal_beck.cu +++ b/lib/gpu/lal_beck.cu @@ -39,22 +39,25 @@ __kernel void k_beck(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp term6 = pow(term1,(numtyp)-3); numtyp term1inv = ucl_recip(term1); numtyp e = beck2[mtype].x*ucl_exp((numtyp)-1.0*r*term4); e -= beck2[mtype].y*term6*((numtyp)1.0+((numtyp)2.709+(numtyp)3.0*aaij*aaij)*term1inv); energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -116,9 +119,9 @@ __kernel void k_beck(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_beck_fast(const __global numtyp4 *restrict x_, @@ -137,6 +140,9 @@ __kernel void k_beck_fast(const __global numtyp4 *restrict x_, __local numtyp4 beck1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 beck2[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) { + if (EVFLAG && eflag) { numtyp term6 = pow(term1,(numtyp)-3); numtyp term1inv = ucl_recip(term1); numtyp e = beck2[mtype].x*ucl_exp((numtyp)-1.0*r*term4); e -= beck2[mtype].y*term6*((numtyp)1.0+((numtyp)2.709+(numtyp)3.0*aaij*aaij)*term1inv); energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -218,8 +224,8 @@ __kernel void k_beck_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } diff --git a/lib/gpu/lal_beck.h b/lib/gpu/lal_beck.h index 638f1bf626..c6413ed766 100644 --- a/lib/gpu/lal_beck.h +++ b/lib/gpu/lal_beck.h @@ -72,7 +72,7 @@ class Beck : public BaseAtomic { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_beck_ext.cpp b/lib/gpu/lal_beck_ext.cpp index dcba4e4f40..ab65237e27 100644 --- a/lib/gpu/lal_beck_ext.cpp +++ b/lib/gpu/lal_beck_ext.cpp @@ -55,7 +55,7 @@ int beck_gpu_init(const int ntypes, double **cutsq, double **aa, int init_ok=0; if (world_me==0) init_ok=BLMF.init(ntypes, cutsq, aa, alpha, beta, - AA, BB, special_lj, inum, nall, 300, + AA, BB, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); BLMF.device->world_barrier(); @@ -73,7 +73,7 @@ int beck_gpu_init(const int ntypes, double **cutsq, double **aa, } if (gpu_rank==i && world_me!=0) init_ok=BLMF.init(ntypes, cutsq, aa, alpha, beta, AA, BB, - special_lj, inum, nall, 300, maxspecial, + special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); BLMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_born.cpp b/lib/gpu/lal_born.cpp index 4a6b789687..c4796b3450 100644 --- a/lib/gpu/lal_born.cpp +++ b/lib/gpu/lal_born.cpp @@ -138,20 +138,9 @@ double BornT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void BornT::loop(const bool _eflag, const bool _vflag) { +int BornT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -159,8 +148,8 @@ void BornT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &coeff1,&coeff2, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &coeff1,&coeff2, &cutsq_sigma, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), @@ -176,6 +165,7 @@ void BornT::loop(const bool _eflag, const bool _vflag) { &nbor_pitch, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class Born; diff --git a/lib/gpu/lal_born.cu b/lib/gpu/lal_born.cu index f9fea6d618..825175af8f 100644 --- a/lib/gpu/lal_born.cu +++ b/lib/gpu/lal_born.cu @@ -40,22 +40,25 @@ __kernel void k_born(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e=coeff2[mtype].x*rexp - coeff2[mtype].y*r6inv + coeff2[mtype].z*r2inv*r6inv; energy+=factor_lj*(e-coeff2[mtype].w); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -108,9 +111,9 @@ __kernel void k_born(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_born_fast(const __global numtyp4 *restrict x_, @@ -130,27 +133,30 @@ __kernel void k_born_fast(const __global numtyp4 *restrict x_, __local numtyp4 coeff1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 coeff2[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) coeff2[tid]=coeff2_in[tid]; } - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { numtyp e=coeff2[mtype].x*rexp - coeff2[mtype].y*r6inv + coeff2[mtype].z*r2inv*r6inv; energy+=factor_lj*(e-coeff2[mtype].w); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -203,8 +209,8 @@ __kernel void k_born_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } diff --git a/lib/gpu/lal_born.h b/lib/gpu/lal_born.h index 2a7f355d69..3f5277b682 100644 --- a/lib/gpu/lal_born.h +++ b/lib/gpu/lal_born.h @@ -82,7 +82,7 @@ class Born : public BaseAtomic { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_born_coul_long.cpp b/lib/gpu/lal_born_coul_long.cpp index 1b147395f6..8c7084f4a4 100644 --- a/lib/gpu/lal_born_coul_long.cpp +++ b/lib/gpu/lal_born_coul_long.cpp @@ -129,20 +129,9 @@ double BornCoulLongT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void BornCoulLongT::loop(const bool _eflag, const bool _vflag) { +int BornCoulLongT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -150,8 +139,8 @@ void BornCoulLongT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &coeff1, &coeff2, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &coeff1, &coeff2, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, @@ -170,6 +159,7 @@ void BornCoulLongT::loop(const bool _eflag, const bool _vflag) { &_qqrd2e, &_g_ewald, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class BornCoulLong; diff --git a/lib/gpu/lal_born_coul_long.cu b/lib/gpu/lal_born_coul_long.cu index 14e644b45a..d38a101c30 100644 --- a/lib/gpu/lal_born_coul_long.cu +++ b/lib/gpu/lal_born_coul_long.cu @@ -48,6 +48,9 @@ __kernel void k_born_coul_long(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; @@ -57,18 +60,18 @@ __kernel void k_born_coul_long(const __global numtyp4 *restrict x_, sp_lj[6]=sp_lj_in[6]; sp_lj[7]=sp_lj_in[7]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) e_coul += prefactor*(_erfc-factor_coul); if (rsq < cutsq_sigma[mtype].y) { @@ -133,7 +136,7 @@ __kernel void k_born_coul_long(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-coeff2[mtype].w); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -144,9 +147,9 @@ __kernel void k_born_coul_long(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_born_coul_long_fast(const __global numtyp4 *restrict x_, @@ -169,28 +172,31 @@ __kernel void k_born_coul_long_fast(const __global numtyp4 *restrict x_, __local numtyp4 coeff1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 coeff2[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) coeff2[tid]=coeff2_in[tid]; } - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) e_coul += prefactor*(_erfc-factor_coul); if (rsq < cutsq_sigma[mtype].y) { @@ -255,7 +261,7 @@ __kernel void k_born_coul_long_fast(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-coeff2[mtype].w); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -266,8 +272,8 @@ __kernel void k_born_coul_long_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } diff --git a/lib/gpu/lal_born_coul_long.h b/lib/gpu/lal_born_coul_long.h index e383d18e0c..a33b8f436a 100644 --- a/lib/gpu/lal_born_coul_long.h +++ b/lib/gpu/lal_born_coul_long.h @@ -80,7 +80,7 @@ class BornCoulLong : public BaseCharge { protected: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_born_coul_long_cs.cu b/lib/gpu/lal_born_coul_long_cs.cu index 6f04fcea94..077ec2f74f 100644 --- a/lib/gpu/lal_born_coul_long_cs.cu +++ b/lib/gpu/lal_born_coul_long_cs.cu @@ -63,6 +63,9 @@ __kernel void k_born_coul_long_cs(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; @@ -72,18 +75,18 @@ __kernel void k_born_coul_long_cs(const __global numtyp4 *restrict x_, sp_lj[6]=sp_lj_in[6]; sp_lj[7]=sp_lj_in[7]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) { numtyp e = prefactor*_erfc; if (factor_coul<(numtyp)1.0) e -= ((numtyp)1.0-factor_coul)*prefactor; @@ -167,7 +170,7 @@ __kernel void k_born_coul_long_cs(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-coeff2[mtype].w); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -178,9 +181,9 @@ __kernel void k_born_coul_long_cs(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_born_coul_long_cs_fast(const __global numtyp4 *restrict x_, @@ -203,28 +206,31 @@ __kernel void k_born_coul_long_cs_fast(const __global numtyp4 *restrict x_, __local numtyp4 coeff1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 coeff2[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) coeff2[tid]=coeff2_in[tid]; } - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) { numtyp e = prefactor*_erfc; if (factor_coul<(numtyp)1.0) e -= ((numtyp)1.0-factor_coul)*prefactor; @@ -308,7 +314,7 @@ __kernel void k_born_coul_long_cs_fast(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-coeff2[mtype].w); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -319,8 +325,8 @@ __kernel void k_born_coul_long_cs_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } diff --git a/lib/gpu/lal_born_coul_long_cs_ext.cpp b/lib/gpu/lal_born_coul_long_cs_ext.cpp index badc8b0808..fc6b89692f 100644 --- a/lib/gpu/lal_born_coul_long_cs_ext.cpp +++ b/lib/gpu/lal_born_coul_long_cs_ext.cpp @@ -60,7 +60,7 @@ int bornclcs_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, if (world_me==0) init_ok=BCLCSMF.init(ntypes, cutsq, host_rhoinv, host_born1, host_born2, host_born3, host_a, host_c, host_d, sigma, offset, - special_lj, inum, nall, 300, maxspecial, cell_size, + special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); @@ -80,7 +80,7 @@ int bornclcs_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, if (gpu_rank==i && world_me!=0) init_ok=BCLCSMF.init(ntypes, cutsq, host_rhoinv, host_born1, host_born2, host_born3, host_a, host_c, host_d, sigma, offset, - special_lj, inum, nall, 300, maxspecial, cell_size, + special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); diff --git a/lib/gpu/lal_born_coul_long_ext.cpp b/lib/gpu/lal_born_coul_long_ext.cpp index d0825529b1..9d17f2fa7d 100644 --- a/lib/gpu/lal_born_coul_long_ext.cpp +++ b/lib/gpu/lal_born_coul_long_ext.cpp @@ -60,7 +60,7 @@ int borncl_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, if (world_me==0) init_ok=BORNCLMF.init(ntypes, cutsq, host_rhoinv, host_born1, host_born2, host_born3, host_a, host_c, host_d, sigma, offset, - special_lj, inum, nall, 300, maxspecial, cell_size, + special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); @@ -80,7 +80,7 @@ int borncl_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, if (gpu_rank==i && world_me!=0) init_ok=BORNCLMF.init(ntypes, cutsq, host_rhoinv, host_born1, host_born2, host_born3, host_a, host_c, host_d, sigma, offset, - special_lj, inum, nall, 300, maxspecial, cell_size, + special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); diff --git a/lib/gpu/lal_born_coul_wolf.cpp b/lib/gpu/lal_born_coul_wolf.cpp index 1624dd9d50..e6caebbab8 100644 --- a/lib/gpu/lal_born_coul_wolf.cpp +++ b/lib/gpu/lal_born_coul_wolf.cpp @@ -131,20 +131,9 @@ double BornCoulWolfT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void BornCoulWolfT::loop(const bool _eflag, const bool _vflag) { +int BornCoulWolfT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -152,8 +141,8 @@ void BornCoulWolfT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &coeff1, &coeff2, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &coeff1, &coeff2, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->q, @@ -171,6 +160,7 @@ void BornCoulWolfT::loop(const bool _eflag, const bool _vflag) { &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class BornCoulWolf; diff --git a/lib/gpu/lal_born_coul_wolf.cu b/lib/gpu/lal_born_coul_wolf.cu index 0eeda48ec0..aefcac8127 100644 --- a/lib/gpu/lal_born_coul_wolf.cu +++ b/lib/gpu/lal_born_coul_wolf.cu @@ -51,6 +51,9 @@ __kernel void k_born_coul_wolf(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; @@ -60,18 +63,18 @@ __kernel void k_born_coul_wolf(const __global numtyp4 *restrict x_, sp_lj[6]=sp_lj_in[6]; sp_lj[7]=sp_lj_in[7]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { acctyp e_self = -((acctyp)0.5*e_shift + alf/MY_PIS) * qtmp*qtmp*qqrd2e/(acctyp)t_per_atom; e_coul += (acctyp)2.0*e_self; @@ -137,7 +140,7 @@ __kernel void k_born_coul_wolf(const __global numtyp4 *restrict x_, f.y+=dely*force; f.z+=delz*force; - if (eflag>0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) { numtyp e=v_sh; if (factor_coul < (numtyp)1.0) e -= ((numtyp)1.0-factor_coul)*prefactor; @@ -149,7 +152,7 @@ __kernel void k_born_coul_wolf(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-coeff2[mtype].w); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -160,9 +163,9 @@ __kernel void k_born_coul_wolf(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_born_coul_wolf_fast(const __global numtyp4 *restrict x_, @@ -186,28 +189,31 @@ __kernel void k_born_coul_wolf_fast(const __global numtyp4 *restrict x_, __local numtyp4 coeff1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 coeff2[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) coeff2[tid]=coeff2_in[tid]; } - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { acctyp e_self = -((acctyp)0.5*e_shift + alf/MY_PIS) * qtmp*qtmp*qqrd2e/(acctyp)t_per_atom; e_coul += (acctyp)2.0*e_self; @@ -273,7 +279,7 @@ __kernel void k_born_coul_wolf_fast(const __global numtyp4 *restrict x_, f.y+=dely*force; f.z+=delz*force; - if (eflag>0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) { numtyp e=v_sh; if (factor_coul < (numtyp)1.0) e -= ((numtyp)1.0-factor_coul)*prefactor; @@ -285,7 +291,7 @@ __kernel void k_born_coul_wolf_fast(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-coeff2[mtype].w); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -296,8 +302,7 @@ __kernel void k_born_coul_wolf_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } - diff --git a/lib/gpu/lal_born_coul_wolf.h b/lib/gpu/lal_born_coul_wolf.h index fa53f48939..0aad07dfa5 100644 --- a/lib/gpu/lal_born_coul_wolf.h +++ b/lib/gpu/lal_born_coul_wolf.h @@ -81,7 +81,7 @@ class BornCoulWolf : public BaseCharge { protected: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_born_coul_wolf_cs.cu b/lib/gpu/lal_born_coul_wolf_cs.cu index b957b8be69..866d256f33 100644 --- a/lib/gpu/lal_born_coul_wolf_cs.cu +++ b/lib/gpu/lal_born_coul_wolf_cs.cu @@ -52,6 +52,9 @@ __kernel void k_born_coul_wolf_cs(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; @@ -61,18 +64,18 @@ __kernel void k_born_coul_wolf_cs(const __global numtyp4 *restrict x_, sp_lj[6]=sp_lj_in[6]; sp_lj[7]=sp_lj_in[7]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { acctyp e_self = -((acctyp)0.5*e_shift + alf/MY_PIS) * qtmp*qtmp*qqrd2e/(acctyp)t_per_atom; e_coul += (acctyp)2.0*e_self; @@ -139,7 +142,7 @@ __kernel void k_born_coul_wolf_cs(const __global numtyp4 *restrict x_, f.y+=dely*force; f.z+=delz*force; - if (eflag>0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) { acctyp e=v_sh; if (factor_coul < (numtyp)1.0) e -= ((numtyp)1.0-factor_coul)*prefactor; @@ -151,7 +154,7 @@ __kernel void k_born_coul_wolf_cs(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-coeff2[mtype].w); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -162,9 +165,9 @@ __kernel void k_born_coul_wolf_cs(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_born_coul_wolf_cs_fast(const __global numtyp4 *restrict x_, @@ -188,28 +191,31 @@ __kernel void k_born_coul_wolf_cs_fast(const __global numtyp4 *restrict x_, __local numtyp4 coeff1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 coeff2[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) coeff2[tid]=coeff2_in[tid]; } - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { acctyp e_self = -((acctyp)0.5*e_shift + alf/MY_PIS) * qtmp*qtmp*qqrd2e/(acctyp)t_per_atom; e_coul += (acctyp)2.0*e_self; @@ -276,7 +282,7 @@ __kernel void k_born_coul_wolf_cs_fast(const __global numtyp4 *restrict x_, f.y+=dely*force; f.z+=delz*force; - if (eflag>0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) { acctyp e=v_sh; if (factor_coul < (numtyp)1.0) e -= ((numtyp)1.0-factor_coul)*prefactor; @@ -288,7 +294,7 @@ __kernel void k_born_coul_wolf_cs_fast(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-coeff2[mtype].w); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -299,8 +305,8 @@ __kernel void k_born_coul_wolf_cs_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } diff --git a/lib/gpu/lal_born_coul_wolf_cs_ext.cpp b/lib/gpu/lal_born_coul_wolf_cs_ext.cpp index e2211644af..ae162a7c52 100644 --- a/lib/gpu/lal_born_coul_wolf_cs_ext.cpp +++ b/lib/gpu/lal_born_coul_wolf_cs_ext.cpp @@ -60,7 +60,7 @@ int borncwcs_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, if (world_me==0) init_ok=BornCWCST.init(ntypes, cutsq, host_rhoinv, host_born1, host_born2, host_born3, host_a, host_c, host_d, sigma, - offset, special_lj, inum, nall, 300, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, alf, e_shift, f_shift); @@ -81,7 +81,7 @@ int borncwcs_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, if (gpu_rank==i && world_me!=0) init_ok=BornCWCST.init(ntypes, cutsq, host_rhoinv, host_born1, host_born2, host_born3, host_a, host_c, host_d, sigma, - offset, special_lj, inum, nall, 300, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, alf, e_shift, f_shift); diff --git a/lib/gpu/lal_born_coul_wolf_ext.cpp b/lib/gpu/lal_born_coul_wolf_ext.cpp index d664f30212..bc38db1b9c 100644 --- a/lib/gpu/lal_born_coul_wolf_ext.cpp +++ b/lib/gpu/lal_born_coul_wolf_ext.cpp @@ -60,7 +60,7 @@ int borncw_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, if (world_me==0) init_ok=BORNCWMF.init(ntypes, cutsq, host_rhoinv, host_born1, host_born2, host_born3, host_a, host_c, host_d, sigma, - offset, special_lj, inum, nall, 300, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, alf, e_shift, f_shift); @@ -81,7 +81,7 @@ int borncw_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, if (gpu_rank==i && world_me!=0) init_ok=BORNCWMF.init(ntypes, cutsq, host_rhoinv, host_born1, host_born2, host_born3, host_a, host_c, host_d, sigma, - offset, special_lj, inum, nall, 300, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, alf, e_shift, f_shift); diff --git a/lib/gpu/lal_born_ext.cpp b/lib/gpu/lal_born_ext.cpp index 63991889d9..2321a1264d 100644 --- a/lib/gpu/lal_born_ext.cpp +++ b/lib/gpu/lal_born_ext.cpp @@ -58,7 +58,7 @@ int born_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, if (world_me==0) init_ok=BORNMF.init(ntypes, cutsq, host_rhoinv, host_born1, host_born2, host_born3, host_a, host_c, host_d, sigma, - offset, special_lj, inum, nall, 300, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); BORNMF.device->world_barrier(); @@ -77,7 +77,7 @@ int born_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, if (gpu_rank==i && world_me!=0) init_ok=BORNMF.init(ntypes, cutsq, host_rhoinv, host_born1, host_born2, host_born3, host_a, host_c, host_d, sigma, - offset, special_lj, inum, nall, 300, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); BORNMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_buck.cpp b/lib/gpu/lal_buck.cpp index 5a335a1e51..01411775e1 100644 --- a/lib/gpu/lal_buck.cpp +++ b/lib/gpu/lal_buck.cpp @@ -130,20 +130,9 @@ double BuckT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void BuckT::loop(const bool _eflag, const bool _vflag) { +int BuckT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -151,8 +140,8 @@ void BuckT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &coeff1, &coeff2, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &coeff1, &coeff2, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, @@ -165,6 +154,7 @@ void BuckT::loop(const bool _eflag, const bool _vflag) { &ainum, &nbor_pitch, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class Buck; diff --git a/lib/gpu/lal_buck.cu b/lib/gpu/lal_buck.cu index 0f9044cefc..958c7bdd4d 100644 --- a/lib/gpu/lal_buck.cu +++ b/lib/gpu/lal_buck.cu @@ -39,22 +39,25 @@ __kernel void k_buck(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e=coeff2[mtype].x*rexp - coeff2[mtype].y*r6inv; energy+=factor_lj*(e-coeff2[mtype].z); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -106,9 +109,9 @@ __kernel void k_buck(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_buck_fast(const __global numtyp4 *restrict x_, @@ -127,27 +130,30 @@ __kernel void k_buck_fast(const __global numtyp4 *restrict x_, __local numtyp4 coeff1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 coeff2[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) coeff2[tid]=coeff2_in[tid]; } - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { numtyp e=coeff2[mtype].x*rexp - coeff2[mtype].y*r6inv; energy+=factor_lj*(e-coeff2[mtype].z); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -199,8 +205,8 @@ __kernel void k_buck_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } diff --git a/lib/gpu/lal_buck.h b/lib/gpu/lal_buck.h index 7a09fae5dd..5755dea230 100644 --- a/lib/gpu/lal_buck.h +++ b/lib/gpu/lal_buck.h @@ -77,7 +77,7 @@ class Buck : public BaseAtomic { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_buck_coul.cpp b/lib/gpu/lal_buck_coul.cpp index 25607eae17..c3c70e6d4d 100644 --- a/lib/gpu/lal_buck_coul.cpp +++ b/lib/gpu/lal_buck_coul.cpp @@ -122,20 +122,9 @@ double BuckCoulT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void BuckCoulT::loop(const bool _eflag, const bool _vflag) { +int BuckCoulT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -143,8 +132,8 @@ void BuckCoulT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &coeff1, &coeff2, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &coeff1, &coeff2, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->q, @@ -158,6 +147,7 @@ void BuckCoulT::loop(const bool _eflag, const bool _vflag) { &cutsq, &_qqrd2e, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class BuckCoul; diff --git a/lib/gpu/lal_buck_coul.cu b/lib/gpu/lal_buck_coul.cu index 163c8e4362..2aaa9c9b3d 100644 --- a/lib/gpu/lal_buck_coul.cu +++ b/lib/gpu/lal_buck_coul.cu @@ -47,6 +47,9 @@ __kernel void k_buck_coul(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; @@ -56,18 +59,18 @@ __kernel void k_buck_coul(const __global numtyp4 *restrict x_, sp_lj[6]=sp_lj_in[6]; sp_lj[7]=sp_lj_in[7]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { e_coul += forcecoul; if (rsq < cutsq[mtype].y) { numtyp e=coeff2[mtype].x*rexp - coeff2[mtype].y*r6inv; energy+=factor_lj*(e-coeff2[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -137,9 +140,9 @@ __kernel void k_buck_coul(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_buck_coul_fast(const __global numtyp4 *restrict x_, @@ -162,29 +165,32 @@ __kernel void k_buck_coul_fast(const __global numtyp4 *restrict x_, __local numtyp4 coeff2[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 cutsq[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) coeff2[tid]=coeff2_in[tid]; } - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { e_coul += forcecoul; if (rsq < cutsq[mtype].y) { numtyp e=coeff2[mtype].x*rexp - coeff2[mtype].y*r6inv; energy+=factor_lj*(e-coeff2[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -254,8 +260,8 @@ __kernel void k_buck_coul_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } diff --git a/lib/gpu/lal_buck_coul.h b/lib/gpu/lal_buck_coul.h index eebba78eb0..bd2afcf9d8 100644 --- a/lib/gpu/lal_buck_coul.h +++ b/lib/gpu/lal_buck_coul.h @@ -78,7 +78,7 @@ class BuckCoul : public BaseCharge { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_buck_coul_ext.cpp b/lib/gpu/lal_buck_coul_ext.cpp index 2a089e2040..9cf8f9b00e 100644 --- a/lib/gpu/lal_buck_coul_ext.cpp +++ b/lib/gpu/lal_buck_coul_ext.cpp @@ -58,7 +58,7 @@ int buckc_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, int init_ok=0; if (world_me==0) init_ok=BUCKCMF.init(ntypes, cutsq, host_rhoinv, host_buck1, host_buck2, - host_a, host_c, offset, special_lj, inum, nall, 300, + host_a, host_c, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e); @@ -78,7 +78,7 @@ int buckc_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, } if (gpu_rank==i && world_me!=0) init_ok=BUCKCMF.init(ntypes, cutsq, host_rhoinv, host_buck1, host_buck2, - host_a, host_c, offset, special_lj, inum, nall, 300, + host_a, host_c, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e); diff --git a/lib/gpu/lal_buck_coul_long.cpp b/lib/gpu/lal_buck_coul_long.cpp index 1c0288c2d8..60205a2ad6 100644 --- a/lib/gpu/lal_buck_coul_long.cpp +++ b/lib/gpu/lal_buck_coul_long.cpp @@ -126,20 +126,9 @@ double BuckCoulLongT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void BuckCoulLongT::loop(const bool _eflag, const bool _vflag) { +int BuckCoulLongT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -147,8 +136,8 @@ void BuckCoulLongT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &coeff1, &coeff2, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &coeff1, &coeff2, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->q, @@ -163,6 +152,7 @@ void BuckCoulLongT::loop(const bool _eflag, const bool _vflag) { &_cut_coulsq, &_qqrd2e, &_g_ewald, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class BuckCoulLong; diff --git a/lib/gpu/lal_buck_coul_long.cu b/lib/gpu/lal_buck_coul_long.cu index b1bbf67bc2..f5ce3a7d11 100644 --- a/lib/gpu/lal_buck_coul_long.cu +++ b/lib/gpu/lal_buck_coul_long.cu @@ -48,6 +48,9 @@ __kernel void k_buck_coul_long(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; @@ -57,18 +60,18 @@ __kernel void k_buck_coul_long(const __global numtyp4 *restrict x_, sp_lj[6]=sp_lj_in[6]; sp_lj[7]=sp_lj_in[7]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) e_coul += prefactor*(_erfc-factor_coul); if (rsq < coeff1[mtype].w) { @@ -134,7 +137,7 @@ __kernel void k_buck_coul_long(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-coeff2[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -145,9 +148,9 @@ __kernel void k_buck_coul_long(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_buck_coul_long_fast(const __global numtyp4 *restrict x_, @@ -171,28 +174,31 @@ __kernel void k_buck_coul_long_fast(const __global numtyp4 *restrict x_, __local numtyp4 coeff1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 coeff2[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) coeff2[tid]=coeff2_in[tid]; } - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) e_coul += prefactor*(_erfc-factor_coul); if (rsq < coeff1[mtype].w) { @@ -258,7 +264,7 @@ __kernel void k_buck_coul_long_fast(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-coeff2[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -269,8 +275,8 @@ __kernel void k_buck_coul_long_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } diff --git a/lib/gpu/lal_buck_coul_long.h b/lib/gpu/lal_buck_coul_long.h index e2d69475cf..fa978a70be 100644 --- a/lib/gpu/lal_buck_coul_long.h +++ b/lib/gpu/lal_buck_coul_long.h @@ -78,7 +78,7 @@ class BuckCoulLong : public BaseCharge { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_buck_coul_long_ext.cpp b/lib/gpu/lal_buck_coul_long_ext.cpp index c7e1cd1e35..393ccc3feb 100644 --- a/lib/gpu/lal_buck_coul_long_ext.cpp +++ b/lib/gpu/lal_buck_coul_long_ext.cpp @@ -59,7 +59,7 @@ int buckcl_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, int init_ok=0; if (world_me==0) init_ok=BUCKCLMF.init(ntypes, cutsq, host_rhoinv, host_buck1, host_buck2, - host_a, host_c, offset, special_lj, inum, nall, 300, + host_a, host_c, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); @@ -78,7 +78,7 @@ int buckcl_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, } if (gpu_rank==i && world_me!=0) init_ok=BUCKCLMF.init(ntypes, cutsq, host_rhoinv, host_buck1, host_buck2, - host_a, host_c, offset, special_lj, inum, nall, 300, + host_a, host_c, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); diff --git a/lib/gpu/lal_buck_ext.cpp b/lib/gpu/lal_buck_ext.cpp index cc8b77c0a9..738b33337d 100644 --- a/lib/gpu/lal_buck_ext.cpp +++ b/lib/gpu/lal_buck_ext.cpp @@ -56,7 +56,7 @@ int buck_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, int init_ok=0; if (world_me==0) init_ok=BUCKMF.init(ntypes, cutsq, host_rhoinv, host_buck1, host_buck2, - host_a, host_c, offset, special_lj, inum, nall, 300, + host_a, host_c, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); BUCKMF.device->world_barrier(); @@ -74,7 +74,7 @@ int buck_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, } if (gpu_rank==i && world_me!=0) init_ok=BUCKMF.init(ntypes, cutsq, host_rhoinv, host_buck1, host_buck2, - host_a, host_c, offset, special_lj, inum, nall, 300, + host_a, host_c, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); BUCKMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_charmm.cpp b/lib/gpu/lal_charmm.cpp new file mode 100644 index 0000000000..811a431cc7 --- /dev/null +++ b/lib/gpu/lal_charmm.cpp @@ -0,0 +1,166 @@ +/*************************************************************************** + charmm.cpp + ------------------- + W. Michael Brown (ORNL) + + Class for acceleration of the charmm/coul pair style. + + __________________________________________________________________________ + This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) + __________________________________________________________________________ + + begin : + email : brownw@ornl.gov + ***************************************************************************/ + +#if defined(USE_OPENCL) +#include "charmm_cl.h" +#elif defined(USE_CUDART) +const char *charmm_long=0; +#else +#include "charmm_cubin.h" +#endif + +#include "lal_charmm.h" +#include +namespace LAMMPS_AL { +#define CHARMMT CHARMM + +extern Device device; + +template +CHARMMT::CHARMM() : BaseCharge(), + _allocated(false) { +} + +template +CHARMMT::~CHARMM() { + clear(); +} + +template +int CHARMMT::bytes_per_atom(const int max_nbors) const { + return this->bytes_per_atom_atomic(max_nbors); +} + +template +int CHARMMT::init(const int ntypes, double host_cut_bothsq, double **host_lj1, + double **host_lj2, double **host_lj3, double **host_lj4, + double *host_special_lj, const int nlocal, const int nall, + const int max_nbors, const int maxspecial, + const double cell_size, const double gpu_split, + FILE *_screen, double host_cut_ljsq, + const double host_cut_coulsq, double *host_special_coul, + const double qqrd2e, const double cut_lj_innersq, + const double cut_coul_innersq, const double denom_lj, + const double denom_coul, double **epsilon, + double **sigma, const bool mix_arithmetic) { + int success; + success=this->init_atomic(nlocal,nall,max_nbors,maxspecial,cell_size, + gpu_split,_screen,charmm,"k_charmm"); + if (success!=0) + return success; + + // If atom type constants fit in shared memory use fast kernel + int lj_types=ntypes; + shared_types=false; + int max_bio_shared_types=this->device->max_bio_shared_types(); + if (this->_block_bio_size>=64 && mix_arithmetic && + lj_types<=max_bio_shared_types) + shared_types=true; + _lj_types=lj_types; + + // Allocate a host write buffer for data initialization + int h_size=lj_types*lj_types; + if (h_size host_write(h_size*32,*(this->ucl_device), + UCL_WRITE_ONLY); + for (int i=0; iucl_device),UCL_READ_ONLY); + this->atom->type_pack4(ntypes,lj_types,lj1,host_write,host_lj1,host_lj2, + host_lj3,host_lj4); + + if (shared_types) { + ljd.alloc(max_bio_shared_types,*(this->ucl_device),UCL_READ_ONLY); + this->atom->self_pack2(ntypes,ljd,host_write,epsilon,sigma); + } + + sp_lj.alloc(8,*(this->ucl_device),UCL_READ_ONLY); + for (int i=0; i<4; i++) { + host_write[i]=host_special_lj[i]; + host_write[i+4]=host_special_coul[i]; + } + ucl_copy(sp_lj,host_write,8,false); + + _cut_bothsq = host_cut_bothsq; + _cut_coulsq = host_cut_coulsq; + _cut_ljsq = host_cut_ljsq; + _cut_lj_innersq = cut_lj_innersq; + _cut_coul_innersq = cut_coul_innersq; + _qqrd2e=qqrd2e; + _denom_lj=denom_lj; + _denom_coul=denom_coul; + + _allocated=true; + this->_max_bytes=lj1.row_bytes()+ljd.row_bytes()+sp_lj.row_bytes(); + return 0; +} + +template +void CHARMMT::clear() { + if (!_allocated) + return; + _allocated=false; + + lj1.clear(); + ljd.clear(); + sp_lj.clear(); + this->clear_atomic(); +} + +template +double CHARMMT::host_memory_usage() const { + return this->host_memory_usage_atomic()+sizeof(CHARMM); +} + +// --------------------------------------------------------------------------- +// Calculate energies, forces, and torques +// --------------------------------------------------------------------------- +template +int CHARMMT::loop(const int eflag, const int vflag) { + // Compute the block size and grid size to keep all cores busy + const int BX=this->_block_bio_size; + int GX=static_cast(ceil(static_cast(this->ans->inum())/ + (BX/this->_threads_per_atom))); + + int ainum=this->ans->inum(); + int nbor_pitch=this->nbor->nbor_pitch(); + this->time_pair.start(); + if (shared_types) { + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &ljd, &sp_lj, + &this->nbor->dev_nbor, this->_nbor_data, + &this->ans->force, &this->ans->engv, &eflag, + &vflag, &ainum, &nbor_pitch, &this->atom->q, + &_cut_coulsq, &_qqrd2e, &_denom_lj, &_denom_coul, + &_cut_bothsq, &_cut_ljsq, &_cut_lj_innersq, + &_cut_coul_innersq, &this->_threads_per_atom); + } else { + this->k_pair.set_size(GX,BX); + this->k_pair.run(&this->atom->x, &ljd, &sp_lj, + &this->nbor->dev_nbor, this->_nbor_data, + &this->ans->force, &this->ans->engv, &eflag, + &vflag, &ainum, &nbor_pitch, &this->atom->q, + &_cut_coulsq, &_qqrd2e, &_denom_lj, &_denom_coul, + &_cut_bothsq, &_cut_ljsq, &_cut_lj_innersq, + &_cut_coul_innersq, &this->_threads_per_atom); + } + this->time_pair.stop(); + return GX; +} + +template class CHARMM; +} diff --git a/lib/gpu/lal_charmm.cu b/lib/gpu/lal_charmm.cu new file mode 100644 index 0000000000..42fb810796 --- /dev/null +++ b/lib/gpu/lal_charmm.cu @@ -0,0 +1,303 @@ +// ************************************************************************** +// charmm.cu +// ------------------- +// W. Michael Brown (ORNL) +// +// Device code for acceleration of the charmm/coul pair style +// +// __________________________________________________________________________ +// This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) +// __________________________________________________________________________ +// +// begin : +// email : brownw@ornl.gov +// ***************************************************************************/ + +#ifdef NV_KERNEL + +#include "lal_aux_fun1.h" +#ifndef _DOUBLE_DOUBLE +texture pos_tex; +texture q_tex; +#else +texture pos_tex; +texture q_tex; +#endif + +#else +#define pos_tex x_ +#define q_tex q_ +#endif + +__kernel void k_charmm(const __global numtyp4 *restrict x_, + const __global numtyp2 *restrict ljd, + const __global numtyp *restrict sp_lj, + const __global int *dev_nbor, + const __global int *dev_packed, + __global acctyp4 *restrict ans, + __global acctyp *restrict engv, + const int eflag, const int vflag, + const int inum, const int nbor_pitch, + const __global numtyp *restrict q_, + const numtyp cut_coulsq, const numtyp qqrd2e, + const numtyp denom_lj, + const numtyp denom_coul, + const numtyp cut_bothsq, + const numtyp cut_ljsq, + const numtyp cut_lj_innersq, + const numtyp cut_coul_innersq, + const int t_per_atom) { + int tid, ii, offset; + atom_info(t_per_atom,ii,tid,offset); + + int n_stride; + local_allocate_store_bio(); + + acctyp4 f; + f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } + + if (ii cut_lj_innersq) { + switch1 = (cut_ljsq-rsq); + numtyp switch2 = (numtyp)12.0*rsq*switch1*(rsq-cut_lj_innersq)* + denom_lj; + switch1 *= switch1; + switch1 *= (cut_ljsq+(numtyp)2.0*rsq-(numtyp)3.0*cut_lj_innersq)* + denom_lj; + switch2 *= lj3-lj4; + force_lj = force_lj*switch1+switch2; + } + } else + force_lj = (numtyp)0.0; + + if (rsq < cut_coulsq) { + numtyp rinv = ucl_rsqrt(rsq); + fetch(forcecoul,j,q_tex); + forcecoul *= factor_coul * qqrd2e * qtmp * rinv; + if (rsq > cut_coul_innersq) { + numtyp switch3 = (cut_coulsq-rsq) * (cut_coulsq-rsq) * + (cut_coulsq + (numtyp)2.0*rsq - (numtyp)3.0*cut_coul_innersq) * + denom_coul; + forcecoul *= switch3; + } + } else + forcecoul = (numtyp)0.0; + + force = (force_lj + forcecoul) * r2inv; + + f.x+=delx*force; + f.y+=dely*force; + f.z+=delz*force; + + if (EVFLAG && eflag) { + e_coul += forcecoul; + if (rsq < cut_ljsq) { + numtyp e=lj3-lj4; + if (rsq > cut_lj_innersq) + e *= switch1; + energy+=factor_lj*e; + } + } + if (EVFLAG && vflag) { + virial[0] += delx*delx*force; + virial[1] += dely*dely*force; + virial[2] += delz*delz*force; + virial[3] += delx*dely*force; + virial[4] += delx*delz*force; + virial[5] += dely*delz*force; + } + } + + } // for nbor + } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); +} + +__kernel void k_charmm_fast(const __global numtyp4 *restrict x_, + const __global numtyp2 *restrict ljd_in, + const __global numtyp *restrict sp_lj_in, + const __global int *dev_nbor, + const __global int *dev_packed, + __global acctyp4 *restrict ans, + __global acctyp *restrict engv, + const int eflag, const int vflag, + const int inum, const int nbor_pitch, + const __global numtyp *restrict q_, + const numtyp cut_coulsq, const numtyp qqrd2e, + const numtyp denom_lj, + const numtyp denom_coul, + const numtyp cut_bothsq, + const numtyp cut_ljsq, + const numtyp cut_lj_innersq, + const numtyp cut_coul_innersq, + const int t_per_atom) { + int tid, ii, offset; + atom_info(t_per_atom,ii,tid,offset); + + __local numtyp2 ljd[MAX_BIO_SHARED_TYPES]; + __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_bio(); + + if (tid<8) + sp_lj[tid]=sp_lj_in[tid]; + if (tid cut_lj_innersq) { + switch1 = (cut_ljsq-rsq); + numtyp switch2 = (numtyp)12.0*rsq*switch1*(rsq-cut_lj_innersq)* + denom_lj; + switch1 *= switch1; + switch1 *= (cut_ljsq+(numtyp)2.0*rsq-(numtyp)3.0*cut_lj_innersq)* + denom_lj; + switch2 *= lj3-lj4; + force_lj = force_lj*switch1+switch2; + } + } else + force_lj = (numtyp)0.0; + + if (rsq < cut_coulsq) { + numtyp rinv = ucl_rsqrt(rsq); + fetch(forcecoul,j,q_tex); + forcecoul *= factor_coul * qqrd2e * qtmp * rinv; + if (rsq > cut_coul_innersq) { + numtyp switch3 = (cut_coulsq-rsq) * (cut_coulsq-rsq) * + (cut_coulsq + (numtyp)2.0*rsq - (numtyp)3.0*cut_coul_innersq) * + denom_coul; + forcecoul *= switch3; + } + } else + forcecoul = (numtyp)0.0; + + force = (force_lj + forcecoul) * r2inv; + + f.x+=delx*force; + f.y+=dely*force; + f.z+=delz*force; + + if (EVFLAG && eflag) { + e_coul += forcecoul; + if (rsq < cut_ljsq) { + numtyp e=lj3-lj4; + if (rsq > cut_lj_innersq) + e *= switch1; + energy+=factor_lj*e; + } + } + if (EVFLAG && vflag) { + virial[0] += delx*delx*force; + virial[1] += dely*dely*force; + virial[2] += delz*delz*force; + virial[3] += delx*dely*force; + virial[4] += delx*delz*force; + virial[5] += dely*delz*force; + } + } + + } // for nbor + } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); +} diff --git a/lib/gpu/lal_charmm.h b/lib/gpu/lal_charmm.h new file mode 100644 index 0000000000..0793d7ca0f --- /dev/null +++ b/lib/gpu/lal_charmm.h @@ -0,0 +1,89 @@ +/*************************************************************************** + charmm.h + ------------------- + W. Michael Brown (ORNL) + + Class for acceleration of the charmm/coul pair style. + + __________________________________________________________________________ + This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) + __________________________________________________________________________ + + begin : + email : brownw@ornl.gov + ***************************************************************************/ + +#ifndef LAL_CHARMM_ +#define LAL_CHARMM_ + +#include "lal_base_charge.h" + +namespace LAMMPS_AL { + +template +class CHARMM : public BaseCharge { + public: + CHARMM(); + ~CHARMM(); + + /// Clear any previous data and set up for a new LAMMPS run + /** \param max_nbors initial number of rows in the neighbor matrix + * \param cell_size cutoff + skin + * \param gpu_split fraction of particles handled by device + * + * Returns: + * - 0 if successfull + * - -1 if fix gpu not found + * - -3 if there is an out of memory error + * - -4 if the GPU library was not compiled for GPU + * - -5 Double precision is not supported on card **/ + int init(const int ntypes, double host_cut_bothsq, + double **host_lj1, double **host_lj2, double **host_lj3, + double **host_lj4, double *host_special_lj, + const int nlocal, const int nall, const int max_nbors, + const int maxspecial, const double cell_size, + const double gpu_split, FILE *screen, double host_cut_ljsq, + const double host_cut_coulsq, double *host_special_coul, + const double qqrd2e, const double cut_lj_innersq, + const double cut_coul_innersq, const double denom_lj, + const double denom_coul, double **epsilon, double **sigma, + const bool mix_arithmetic); + + /// Clear all host and device data + /** \note This is called at the beginning of the init() routine **/ + void clear(); + + /// Returns memory usage on device per atom + int bytes_per_atom(const int max_nbors) const; + + /// Total host memory used by library for pair style + double host_memory_usage() const; + + // --------------------------- TYPE DATA -------------------------- + + /// x = lj1, y = lj2, z = lj3, w = lj4 + UCL_D_Vec lj1; + /// x = epsilon, y = sigma + UCL_D_Vec ljd; + /// Special LJ values [0-3] and Special Coul values [4-7] + UCL_D_Vec sp_lj; + + /// If atom type constants fit in shared memory, use fast kernels + bool shared_types; + + /// Number of atom types + int _lj_types; + + numtyp _qqrd2e, _denom_lj, _denom_coul; + + numtyp _cut_coulsq, _cut_bothsq, _cut_ljsq, _cut_lj_innersq; + numtyp _cut_coul_innersq; + + private: + bool _allocated; + int loop(const int eflag, const int vflag); +}; + +} + +#endif diff --git a/lib/gpu/lal_charmm_ext.cpp b/lib/gpu/lal_charmm_ext.cpp new file mode 100644 index 0000000000..bed2f21933 --- /dev/null +++ b/lib/gpu/lal_charmm_ext.cpp @@ -0,0 +1,137 @@ +/*************************************************************************** + charmm_long_ext.cpp + ------------------- + W. Michael Brown (ORNL) + + Functions for LAMMPS access to charmm/coul/long acceleration routines. + + __________________________________________________________________________ + This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) + __________________________________________________________________________ + + begin : + email : brownw@ornl.gov + ***************************************************************************/ + +#include +#include +#include + +#include "lal_charmm.h" + +using namespace std; +using namespace LAMMPS_AL; + +static CHARMM CRMMF; + +// --------------------------------------------------------------------------- +// Allocate memory on host and device and copy constants to device +// --------------------------------------------------------------------------- +int crm_gpu_init(const int ntypes, double cut_bothsq, double **host_lj1, + double **host_lj2, double **host_lj3, double **host_lj4, + double *special_lj, const int inum, + const int nall, const int max_nbors, const int maxspecial, + const double cell_size, int &gpu_mode, FILE *screen, + double host_cut_ljsq, double host_cut_coulsq, + double *host_special_coul, const double qqrd2e, + const double cut_lj_innersq, const double cut_coul_innersq, + const double denom_lj, const double denom_coul, + double **epsilon, double **sigma, + const bool mix_arithmetic) { + CRMMF.clear(); + gpu_mode=CRMMF.device->gpu_mode(); + double gpu_split=CRMMF.device->particle_split(); + int first_gpu=CRMMF.device->first_device(); + int last_gpu=CRMMF.device->last_device(); + int world_me=CRMMF.device->world_me(); + int gpu_rank=CRMMF.device->gpu_rank(); + int procs_per_gpu=CRMMF.device->procs_per_gpu(); + + CRMMF.device->init_message(screen,"lj/charmm/coul/charmm",first_gpu, + last_gpu); + + bool message=false; + if (CRMMF.device->replica_me()==0 && screen) + message=true; + + if (message) { + fprintf(screen,"Initializing Device and compiling on process 0..."); + fflush(screen); + } + + int init_ok=0; + if (world_me==0) + CRMMF.init(ntypes, cut_bothsq, host_lj1, host_lj2, host_lj3, host_lj4, + special_lj, inum, nall, max_nbors, maxspecial, cell_size, + gpu_split, screen, host_cut_ljsq, host_cut_coulsq, + host_special_coul, qqrd2e, cut_lj_innersq, cut_coul_innersq, + denom_lj, denom_coul, epsilon, sigma, mix_arithmetic); + + CRMMF.device->world_barrier(); + if (message) + fprintf(screen,"Done.\n"); + + for (int i=0; igpu_barrier(); + if (message) + fprintf(screen,"Done.\n"); + } + if (message) + fprintf(screen,"\n"); + + if (init_ok==0) + CRMMF.estimate_gpu_overhead(); + + return init_ok; +} + +void crm_gpu_clear() { + CRMMF.clear(); +} + +int** crm_gpu_compute_n(const int ago, const int inum_full, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, + tagint **special, const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, + int **ilist, int **jnum, const double cpu_time, + bool &success, double *host_q, double *boxlo, + double *prd) { + return CRMMF.compute(ago, inum_full, nall, host_x, host_type, sublo, + subhi, tag, nspecial, special, eflag, vflag, eatom, + vatom, host_start, ilist, jnum, cpu_time, success, + host_q, boxlo, prd); +} + +void crm_gpu_compute(const int ago, const int inum_full, const int nall, + double **host_x, int *host_type, int *ilist, int *numj, + int **firstneigh, const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, + const double cpu_time, bool &success, double *host_q, + const int nlocal, double *boxlo, double *prd) { + CRMMF.compute(ago,inum_full,nall,host_x,host_type,ilist,numj,firstneigh, + eflag,vflag,eatom,vatom,host_start,cpu_time,success,host_q, + nlocal,boxlo,prd); +} + +double crm_gpu_bytes() { + return CRMMF.host_memory_usage(); +} + + diff --git a/lib/gpu/lal_charmm_long.cpp b/lib/gpu/lal_charmm_long.cpp index a78996a7d5..8008b1fbb3 100644 --- a/lib/gpu/lal_charmm_long.cpp +++ b/lib/gpu/lal_charmm_long.cpp @@ -131,20 +131,9 @@ double CHARMMLongT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void CHARMMLongT::loop(const bool _eflag, const bool _vflag) { +int CHARMMLongT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->_block_bio_size; - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -152,8 +141,8 @@ void CHARMMLongT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &ljd, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &ljd, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->q, @@ -171,6 +160,7 @@ void CHARMMLongT::loop(const bool _eflag, const bool _vflag) { &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class CHARMMLong; diff --git a/lib/gpu/lal_charmm_long.cu b/lib/gpu/lal_charmm_long.cu index 4e9802f368..77793d0e83 100644 --- a/lib/gpu/lal_charmm_long.cu +++ b/lib/gpu/lal_charmm_long.cu @@ -47,18 +47,21 @@ __kernel void k_charmm_long(const __global numtyp4 *restrict x_, int tid, ii, offset; atom_info(t_per_atom,ii,tid,offset); - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; + int n_stride; + local_allocate_store_bio(); + acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) e_coul += prefactor*(_erfc-factor_coul); if (rsq < cut_ljsq) { @@ -132,7 +135,7 @@ __kernel void k_charmm_long(const __global numtyp4 *restrict x_, energy+=factor_lj*e; } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -143,9 +146,9 @@ __kernel void k_charmm_long(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_charmm_long_fast(const __global numtyp4 *restrict x_, @@ -168,6 +171,9 @@ __kernel void k_charmm_long_fast(const __global numtyp4 *restrict x_, __local numtyp2 ljd[MAX_BIO_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_bio(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) e_coul += prefactor*(_erfc-factor_coul); if (rsq < cut_ljsq) { @@ -268,7 +274,7 @@ __kernel void k_charmm_long_fast(const __global numtyp4 *restrict x_, energy+=factor_lj*e; } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -277,10 +283,9 @@ __kernel void k_charmm_long_fast(const __global numtyp4 *restrict x_, virial[5] += dely*delz*force; } } - } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } diff --git a/lib/gpu/lal_charmm_long.h b/lib/gpu/lal_charmm_long.h index 5d9d9ea50b..69f1a0734a 100644 --- a/lib/gpu/lal_charmm_long.h +++ b/lib/gpu/lal_charmm_long.h @@ -79,7 +79,7 @@ class CHARMMLong : public BaseCharge { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_charmm_long_ext.cpp b/lib/gpu/lal_charmm_long_ext.cpp index 743b510825..13565f5682 100644 --- a/lib/gpu/lal_charmm_long_ext.cpp +++ b/lib/gpu/lal_charmm_long_ext.cpp @@ -60,7 +60,7 @@ int crml_gpu_init(const int ntypes, double cut_bothsq, double **host_lj1, int init_ok=0; if (world_me==0) CRMLMF.init(ntypes, cut_bothsq, host_lj1, host_lj2, host_lj3, host_lj4, - offset, special_lj, inum, nall, 300, maxspecial, cell_size, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald, cut_lj_innersq, denom_lj, epsilon,sigma,mix_arithmetic); @@ -80,7 +80,7 @@ int crml_gpu_init(const int ntypes, double cut_bothsq, double **host_lj1, } if (gpu_rank==i && world_me!=0) init_ok=CRMLMF.init(ntypes, cut_bothsq, host_lj1, host_lj2, host_lj3, - host_lj4, offset, special_lj, inum, nall, 300, + host_lj4, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald, cut_lj_innersq, denom_lj, epsilon, diff --git a/lib/gpu/lal_colloid.cpp b/lib/gpu/lal_colloid.cpp index c441d50968..fec7a3ad5f 100644 --- a/lib/gpu/lal_colloid.cpp +++ b/lib/gpu/lal_colloid.cpp @@ -140,20 +140,9 @@ double ColloidT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void ColloidT::loop(const bool _eflag, const bool _vflag) { +int ColloidT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -161,8 +150,8 @@ void ColloidT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &sp_lj, &colloid1, &colloid2, &form, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, @@ -176,6 +165,7 @@ void ColloidT::loop(const bool _eflag, const bool _vflag) { &ainum, &nbor_pitch, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class Colloid; diff --git a/lib/gpu/lal_colloid.cu b/lib/gpu/lal_colloid.cu index 4983142aa0..8a20f0c400 100644 --- a/lib/gpu/lal_colloid.cu +++ b/lib/gpu/lal_colloid.cu @@ -42,22 +42,25 @@ __kernel void k_colloid(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e=(numtyp)0.0; if (form[mtype]==0) { e=r6inv*(lj3[mtype].x*r6inv-lj3[mtype].y); @@ -160,7 +163,7 @@ __kernel void k_colloid(const __global numtyp4 *restrict x_, } energy+=factor_lj*(e-lj3[mtype].z); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -171,9 +174,9 @@ __kernel void k_colloid(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_colloid_fast(const __global numtyp4 *restrict x_, @@ -198,6 +201,9 @@ __kernel void k_colloid_fast(const __global numtyp4 *restrict x_, __local numtyp4 colloid2[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local int form[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { numtyp e=(numtyp)0.0; if (form[mtype]==0) { e=r6inv*(lj3[mtype].x*r6inv-lj3[mtype].y); @@ -325,7 +331,7 @@ __kernel void k_colloid_fast(const __global numtyp4 *restrict x_, } energy+=factor_lj*(e-lj3[mtype].z); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -336,8 +342,8 @@ __kernel void k_colloid_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } diff --git a/lib/gpu/lal_colloid.h b/lib/gpu/lal_colloid.h index 35426007d8..43f14cd354 100644 --- a/lib/gpu/lal_colloid.h +++ b/lib/gpu/lal_colloid.h @@ -81,7 +81,7 @@ class Colloid : public BaseAtomic { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_colloid_ext.cpp b/lib/gpu/lal_colloid_ext.cpp index 961ad75925..dcfd1a6d34 100644 --- a/lib/gpu/lal_colloid_ext.cpp +++ b/lib/gpu/lal_colloid_ext.cpp @@ -60,7 +60,7 @@ int colloid_gpu_init(const int ntypes, double **cutsq, double **host_lj1, init_ok=COLLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, offset, special_lj, host_a12, host_a1, host_a2, host_d1, host_d2, host_sigma3, - host_sigma6, host_form, inum, nall, 300, + host_sigma6, host_form, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); COLLMF.device->world_barrier(); @@ -80,7 +80,7 @@ int colloid_gpu_init(const int ntypes, double **cutsq, double **host_lj1, init_ok=COLLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, offset, special_lj, host_a12, host_a1, host_a2, host_d1, host_d2, host_sigma3, host_sigma6, host_form, - inum, nall, 300, maxspecial, + inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); COLLMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_coul.cpp b/lib/gpu/lal_coul.cpp index 3e29215c91..df9eeae667 100644 --- a/lib/gpu/lal_coul.cpp +++ b/lib/gpu/lal_coul.cpp @@ -125,20 +125,9 @@ double CoulT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void CoulT::loop(const bool _eflag, const bool _vflag) { +int CoulT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -146,8 +135,8 @@ void CoulT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &scale, &sp_cl, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &scale, &sp_cl, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->q, @@ -161,6 +150,7 @@ void CoulT::loop(const bool _eflag, const bool _vflag) { &cutsq, &_qqrd2e, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class Coul; diff --git a/lib/gpu/lal_coul.cu b/lib/gpu/lal_coul.cu index 03fc568c77..c4da81a3a2 100644 --- a/lib/gpu/lal_coul.cu +++ b/lib/gpu/lal_coul.cu @@ -46,22 +46,25 @@ __kernel void k_coul(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_cl[8]; + int n_stride; + local_allocate_store_charge(); + sp_cl[0]=sp_cl_in[0]; sp_cl[1]=sp_cl_in[1]; sp_cl[2]=sp_cl_in[2]; sp_cl[3]=sp_cl_in[3]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { e_coul += forcecoul; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -112,9 +115,9 @@ __kernel void k_coul(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_coul_fast(const __global numtyp4 *restrict x_, @@ -134,25 +137,28 @@ __kernel void k_coul_fast(const __global numtyp4 *restrict x_, __local numtyp cutsq[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_cl[4]; + int n_stride; + local_allocate_store_charge(); + if (tid<4) sp_cl[tid]=sp_cl_in[tid]; if (tid0) { + if (EVFLAG && eflag) { e_coul += forcecoul; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -203,8 +209,8 @@ __kernel void k_coul_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } diff --git a/lib/gpu/lal_coul.h b/lib/gpu/lal_coul.h index 38472375fb..7298536dea 100644 --- a/lib/gpu/lal_coul.h +++ b/lib/gpu/lal_coul.h @@ -75,7 +75,7 @@ class Coul : public BaseCharge { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_coul_debye.cpp b/lib/gpu/lal_coul_debye.cpp index 08ceb99300..1107708ca8 100644 --- a/lib/gpu/lal_coul_debye.cpp +++ b/lib/gpu/lal_coul_debye.cpp @@ -126,20 +126,9 @@ double CoulDebyeT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void CoulDebyeT::loop(const bool _eflag, const bool _vflag) { +int CoulDebyeT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -147,8 +136,8 @@ void CoulDebyeT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &scale, &sp_cl, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &scale, &sp_cl, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->q, &cutsq, @@ -162,6 +151,7 @@ void CoulDebyeT::loop(const bool _eflag, const bool _vflag) { &_qqrd2e, &_kappa, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class CoulDebye; diff --git a/lib/gpu/lal_coul_debye.cu b/lib/gpu/lal_coul_debye.cu index e7f0b97e23..ba922f04a6 100644 --- a/lib/gpu/lal_coul_debye.cu +++ b/lib/gpu/lal_coul_debye.cu @@ -47,22 +47,25 @@ __kernel void k_coul_debye(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_cl[4]; + int n_stride; + local_allocate_store_charge(); + sp_cl[0]=sp_cl_in[0]; sp_cl[1]=sp_cl_in[1]; sp_cl[2]=sp_cl_in[2]; sp_cl[3]=sp_cl_in[3]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { e_coul+=qqrd2e*scale[mtype]*qtmp*rinv*screening*factor_coul; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -116,9 +119,9 @@ __kernel void k_coul_debye(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_coul_debye_fast(const __global numtyp4 *restrict x_, @@ -140,6 +143,9 @@ __kernel void k_coul_debye_fast(const __global numtyp4 *restrict x_, __local numtyp scale[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp cutsq[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_cl[4]; + int n_stride; + local_allocate_store_charge(); + if (tid<4) sp_cl[tid]=sp_cl_in[tid]; if (tid0) { + if (EVFLAG && eflag) { e_coul+=qqrd2e*scale[mtype]*qtmp*rinv*screening*factor_coul; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -213,8 +219,7 @@ __kernel void k_coul_debye_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } - diff --git a/lib/gpu/lal_coul_debye.h b/lib/gpu/lal_coul_debye.h index 13e4c5b0c6..9054df1995 100644 --- a/lib/gpu/lal_coul_debye.h +++ b/lib/gpu/lal_coul_debye.h @@ -76,7 +76,7 @@ class CoulDebye : public BaseCharge { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_coul_debye_ext.cpp b/lib/gpu/lal_coul_debye_ext.cpp index af54746def..516dca5df8 100644 --- a/lib/gpu/lal_coul_debye_ext.cpp +++ b/lib/gpu/lal_coul_debye_ext.cpp @@ -54,7 +54,7 @@ int cdebye_gpu_init(const int ntypes, double **host_scale, double **cutsq, int init_ok=0; if (world_me==0) - init_ok=CDEMF.init(ntypes, host_scale, cutsq, host_special_coul, inum, nall, 300, + init_ok=CDEMF.init(ntypes, host_scale, cutsq, host_special_coul, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, qqrd2e, kappa); CDEMF.device->world_barrier(); @@ -71,7 +71,7 @@ int cdebye_gpu_init(const int ntypes, double **host_scale, double **cutsq, fflush(screen); } if (gpu_rank==i && world_me!=0) - init_ok=CDEMF.init(ntypes, host_scale, cutsq, host_special_coul, inum, nall, 300, + init_ok=CDEMF.init(ntypes, host_scale, cutsq, host_special_coul, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, qqrd2e, kappa); CDEMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_coul_dsf.cpp b/lib/gpu/lal_coul_dsf.cpp index fe1fbfede7..1a56e84b52 100644 --- a/lib/gpu/lal_coul_dsf.cpp +++ b/lib/gpu/lal_coul_dsf.cpp @@ -110,20 +110,9 @@ double CoulDSFT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void CoulDSFT::loop(const bool _eflag, const bool _vflag) { +int CoulDSFT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -131,8 +120,8 @@ void CoulDSFT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->q, @@ -148,6 +137,7 @@ void CoulDSFT::loop(const bool _eflag, const bool _vflag) { &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class CoulDSF; diff --git a/lib/gpu/lal_coul_dsf.cu b/lib/gpu/lal_coul_dsf.cu index 190fb5b7fd..5241cb5097 100644 --- a/lib/gpu/lal_coul_dsf.cu +++ b/lib/gpu/lal_coul_dsf.cu @@ -48,30 +48,33 @@ __kernel void k_coul_dsf(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_charge(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { acctyp e_self = -((acctyp)0.5*e_shift + alpha/MY_PIS) * qtmp*qtmp*qqrd2e/(acctyp)t_per_atom; e_coul += (acctyp)2.0*e_self; @@ -111,11 +114,11 @@ __kernel void k_coul_dsf(const __global numtyp4 *restrict x_, f.y+=dely*force; f.z+=delz*force; - if (eflag>0) { + if (EVFLAG && eflag) { numtyp e=prefactor*(erfcc-r*e_shift-rsq*f_shift-factor_coul); e_coul += e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -126,9 +129,9 @@ __kernel void k_coul_dsf(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_coul_dsf_fast(const __global numtyp4 *restrict x_, @@ -147,30 +150,33 @@ __kernel void k_coul_dsf_fast(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_charge(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { acctyp e_self = -((acctyp)0.5*e_shift + alpha/MY_PIS) * qtmp*qtmp*qqrd2e/(acctyp)t_per_atom; e_coul += (acctyp)2.0*e_self; @@ -210,11 +216,11 @@ __kernel void k_coul_dsf_fast(const __global numtyp4 *restrict x_, f.y+=dely*force; f.z+=delz*force; - if (eflag>0) { + if (EVFLAG && eflag) { numtyp e=prefactor*(erfcc-r*e_shift-rsq*f_shift-factor_coul); e_coul += e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -225,8 +231,7 @@ __kernel void k_coul_dsf_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } - diff --git a/lib/gpu/lal_coul_dsf.h b/lib/gpu/lal_coul_dsf.h index 3d57898f81..a33e98f836 100644 --- a/lib/gpu/lal_coul_dsf.h +++ b/lib/gpu/lal_coul_dsf.h @@ -70,7 +70,7 @@ class CoulDSF : public BaseCharge { private: bool _allocated; numtyp _e_shift, _f_shift, _alpha, _cut_coulsq; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_coul_dsf_ext.cpp b/lib/gpu/lal_coul_dsf_ext.cpp index 2d18f9f94d..e21c70ae4b 100644 --- a/lib/gpu/lal_coul_dsf_ext.cpp +++ b/lib/gpu/lal_coul_dsf_ext.cpp @@ -55,7 +55,7 @@ int cdsf_gpu_init(const int ntypes, const int inum, const int nall, int init_ok=0; if (world_me==0) - init_ok=CDMF.init(ntypes, inum, nall, 300, maxspecial, cell_size, + init_ok=CDMF.init(ntypes, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_coulsq, host_special_coul, qqrd2e, e_shift, f_shift, alpha); @@ -73,7 +73,7 @@ int cdsf_gpu_init(const int ntypes, const int inum, const int nall, fflush(screen); } if (gpu_rank==i && world_me!=0) - init_ok=CDMF.init(ntypes, inum, nall, 300, maxspecial, cell_size, + init_ok=CDMF.init(ntypes, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_coulsq, host_special_coul, qqrd2e, e_shift, f_shift, alpha); diff --git a/lib/gpu/lal_coul_ext.cpp b/lib/gpu/lal_coul_ext.cpp index 9779526d62..370c186123 100644 --- a/lib/gpu/lal_coul_ext.cpp +++ b/lib/gpu/lal_coul_ext.cpp @@ -54,7 +54,7 @@ int coul_gpu_init(const int ntypes, double **host_scale, int init_ok=0; if (world_me==0) - init_ok=COULMF.init(ntypes, host_scale, cutsq, special_coul, inum, nall, 300, + init_ok=COULMF.init(ntypes, host_scale, cutsq, special_coul, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, qqrd2e); COULMF.device->world_barrier(); @@ -71,7 +71,7 @@ int coul_gpu_init(const int ntypes, double **host_scale, fflush(screen); } if (gpu_rank==i && world_me!=0) - init_ok=COULMF.init(ntypes, host_scale, cutsq, special_coul, inum, nall, 300, + init_ok=COULMF.init(ntypes, host_scale, cutsq, special_coul, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, qqrd2e); COULMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_coul_long.cpp b/lib/gpu/lal_coul_long.cpp index 02097a2c61..36c1cd751f 100644 --- a/lib/gpu/lal_coul_long.cpp +++ b/lib/gpu/lal_coul_long.cpp @@ -116,20 +116,9 @@ double CoulLongT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void CoulLongT::loop(const bool _eflag, const bool _vflag) { +int CoulLongT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -137,8 +126,8 @@ void CoulLongT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &scale, &sp_cl, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &scale, &sp_cl, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, @@ -153,6 +142,7 @@ void CoulLongT::loop(const bool _eflag, const bool _vflag) { &_qqrd2e, &_g_ewald, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class CoulLong; diff --git a/lib/gpu/lal_coul_long.cu b/lib/gpu/lal_coul_long.cu index 7adcdbbabc..f8a33e90a2 100644 --- a/lib/gpu/lal_coul_long.cu +++ b/lib/gpu/lal_coul_long.cu @@ -29,100 +29,6 @@ _texture( q_tex,int2); #define q_tex q_ #endif -#if (ARCH < 300) - -#define store_answers_lq(f, e_coul, virial, ii, inum, tid, \ - t_per_atom, offset, eflag, vflag, ans, engv) \ - if (t_per_atom>1) { \ - __local acctyp red_acc[6][BLOCK_PAIR]; \ - \ - red_acc[0][tid]=f.x; \ - red_acc[1][tid]=f.y; \ - red_acc[2][tid]=f.z; \ - red_acc[3][tid]=e_coul; \ - \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<4; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ - } \ - \ - f.x=red_acc[0][tid]; \ - f.y=red_acc[1][tid]; \ - f.z=red_acc[2][tid]; \ - e_coul=red_acc[3][tid]; \ - \ - if (vflag>0) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid]=virial[r]; \ - \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ - } \ - \ - for (int r=0; r<6; r++) \ - virial[r]=red_acc[r][tid]; \ - } \ - } \ - \ - if (offset==0) { \ - __global acctyp *ap1=engv+ii; \ - if (eflag>0) { \ - *ap1=(acctyp)0; \ - ap1+=inum; \ - *ap1=e_coul*(acctyp)0.5; \ - ap1+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - *ap1=virial[i]*(acctyp)0.5; \ - ap1+=inum; \ - } \ - } \ - ans[ii]=f; \ - } - -#else - -#define store_answers_lq(f, e_coul, virial, ii, inum, tid, \ - t_per_atom, offset, eflag, vflag, ans, engv) \ - if (t_per_atom>1) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - f.x += shfl_xor(f.x, s, t_per_atom); \ - f.y += shfl_xor(f.y, s, t_per_atom); \ - f.z += shfl_xor(f.z, s, t_per_atom); \ - e_coul += shfl_xor(e_coul, s, t_per_atom); \ - } \ - if (vflag>0) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - for (int r=0; r<6; r++) \ - virial[r] += shfl_xor(virial[r], s, t_per_atom); \ - } \ - } \ - } \ - if (offset==0) { \ - __global acctyp *ap1=engv+ii; \ - if (eflag>0) { \ - *ap1=(acctyp)0; \ - ap1+=inum; \ - *ap1=e_coul*(acctyp)0.5; \ - ap1+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - *ap1=virial[i]*(acctyp)0.5; \ - ap1+=inum; \ - } \ - } \ - ans[ii]=f; \ - } - -#endif - __kernel void k_coul_long(const __global numtyp4 *restrict x_, const __global numtyp *restrict scale, const int lj_types, @@ -140,22 +46,25 @@ __kernel void k_coul_long(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_cl[4]; + int n_stride; + local_allocate_store_charge(); + sp_cl[0]=sp_cl_in[0]; sp_cl[1]=sp_cl_in[1]; sp_cl[2]=sp_cl_in[2]; sp_cl[3]=sp_cl_in[3]; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp e_coul, virial[6]; + if (EVFLAG) { + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { e_coul += prefactor*(_erfc-factor_coul); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -211,9 +120,11 @@ __kernel void k_coul_long(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_lq(f,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + acctyp energy; + if (EVFLAG) energy=(acctyp)0.0; + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_coul_long_fast(const __global numtyp4 *restrict x_, @@ -233,24 +144,27 @@ __kernel void k_coul_long_fast(const __global numtyp4 *restrict x_, __local numtyp scale[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_cl[4]; + int n_stride; + local_allocate_store_charge(); + if (tid<4) sp_cl[tid]=sp_cl_in[tid]; if (tid0) { + if (EVFLAG && eflag) { e_coul += prefactor*(_erfc-factor_coul); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -306,8 +220,10 @@ __kernel void k_coul_long_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_lq(f,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + acctyp energy; + if (EVFLAG) energy=(acctyp)0.0; + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } diff --git a/lib/gpu/lal_coul_long.h b/lib/gpu/lal_coul_long.h index 0668e0fd02..a89b8e447c 100644 --- a/lib/gpu/lal_coul_long.h +++ b/lib/gpu/lal_coul_long.h @@ -74,7 +74,7 @@ class CoulLong : public BaseCharge { protected: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_coul_long_cs.cu b/lib/gpu/lal_coul_long_cs.cu index 85c9d84bdb..dfbc771adc 100644 --- a/lib/gpu/lal_coul_long_cs.cu +++ b/lib/gpu/lal_coul_long_cs.cu @@ -43,100 +43,6 @@ _texture( q_tex,int2); #define EPS_EWALD (acctyp)(1.0e-6) #define EPS_EWALD_SQR (acctyp)(1.0e-12) -#if (ARCH < 300) - -#define store_answers_lq(f, e_coul, virial, ii, inum, tid, \ - t_per_atom, offset, eflag, vflag, ans, engv) \ - if (t_per_atom>1) { \ - __local acctyp red_acc[6][BLOCK_PAIR]; \ - \ - red_acc[0][tid]=f.x; \ - red_acc[1][tid]=f.y; \ - red_acc[2][tid]=f.z; \ - red_acc[3][tid]=e_coul; \ - \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<4; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ - } \ - \ - f.x=red_acc[0][tid]; \ - f.y=red_acc[1][tid]; \ - f.z=red_acc[2][tid]; \ - e_coul=red_acc[3][tid]; \ - \ - if (vflag>0) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid]=virial[r]; \ - \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ - } \ - \ - for (int r=0; r<6; r++) \ - virial[r]=red_acc[r][tid]; \ - } \ - } \ - \ - if (offset==0) { \ - __global acctyp *ap1=engv+ii; \ - if (eflag>0) { \ - *ap1=(acctyp)0; \ - ap1+=inum; \ - *ap1=e_coul*(acctyp)0.5; \ - ap1+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - *ap1=virial[i]*(acctyp)0.5; \ - ap1+=inum; \ - } \ - } \ - ans[ii]=f; \ - } - -#else - -#define store_answers_lq(f, e_coul, virial, ii, inum, tid, \ - t_per_atom, offset, eflag, vflag, ans, engv) \ - if (t_per_atom>1) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - f.x += shfl_xor(f.x, s, t_per_atom); \ - f.y += shfl_xor(f.y, s, t_per_atom); \ - f.z += shfl_xor(f.z, s, t_per_atom); \ - e_coul += shfl_xor(e_coul, s, t_per_atom); \ - } \ - if (vflag>0) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - for (int r=0; r<6; r++) \ - virial[r] += shfl_xor(virial[r], s, t_per_atom); \ - } \ - } \ - } \ - if (offset==0) { \ - __global acctyp *ap1=engv+ii; \ - if (eflag>0) { \ - *ap1=(acctyp)0; \ - ap1+=inum; \ - *ap1=e_coul*(acctyp)0.5; \ - ap1+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - *ap1=virial[i]*(acctyp)0.5; \ - ap1+=inum; \ - } \ - } \ - ans[ii]=f; \ - } - -#endif - __kernel void k_coul_long_cs(const __global numtyp4 *restrict x_, const __global numtyp *restrict scale, const int lj_types, @@ -154,22 +60,25 @@ __kernel void k_coul_long_cs(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_cl[4]; + int n_stride; + local_allocate_store_charge(); + sp_cl[0]=sp_cl_in[0]; sp_cl[1]=sp_cl_in[1]; sp_cl[2]=sp_cl_in[2]; sp_cl[3]=sp_cl_in[3]; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp e_coul, virial[6]; + if (EVFLAG) { + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e = prefactor*_erfc; if (factor_coul<(numtyp)1.0) e -= ((numtyp)1.0-factor_coul)*prefactor; e_coul += e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -245,9 +154,11 @@ __kernel void k_coul_long_cs(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_lq(f,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + acctyp energy; + if (EVFLAG) energy=(acctyp)0.0; + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_coul_long_cs_fast(const __global numtyp4 *restrict x_, @@ -267,24 +178,27 @@ __kernel void k_coul_long_cs_fast(const __global numtyp4 *restrict x_, __local numtyp scale[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_cl[4]; + int n_stride; + local_allocate_store_charge(); + if (tid<4) sp_cl[tid]=sp_cl_in[tid]; if (tid0) { + if (EVFLAG && eflag) { numtyp e = prefactor*_erfc; if (factor_coul<(numtyp)1.0) e -= ((numtyp)1.0-factor_coul)*prefactor; e_coul += e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -360,8 +274,9 @@ __kernel void k_coul_long_cs_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_lq(f,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + acctyp energy; + if (EVFLAG) energy=(acctyp)0.0; + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } - diff --git a/lib/gpu/lal_coul_long_cs_ext.cpp b/lib/gpu/lal_coul_long_cs_ext.cpp index ae57eb2038..df92619f2f 100644 --- a/lib/gpu/lal_coul_long_cs_ext.cpp +++ b/lib/gpu/lal_coul_long_cs_ext.cpp @@ -54,7 +54,7 @@ int clcs_gpu_init(const int ntypes, double **host_scale, int init_ok=0; if (world_me==0) - init_ok=CLCSMF.init(ntypes, host_scale, inum, nall, 300, maxspecial, + init_ok=CLCSMF.init(ntypes, host_scale, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); @@ -72,7 +72,7 @@ int clcs_gpu_init(const int ntypes, double **host_scale, fflush(screen); } if (gpu_rank==i && world_me!=0) - init_ok=CLCSMF.init(ntypes, host_scale, inum, nall, 300, maxspecial, + init_ok=CLCSMF.init(ntypes, host_scale, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); diff --git a/lib/gpu/lal_coul_long_ext.cpp b/lib/gpu/lal_coul_long_ext.cpp index 653b4be4f3..1d9dcfdeca 100644 --- a/lib/gpu/lal_coul_long_ext.cpp +++ b/lib/gpu/lal_coul_long_ext.cpp @@ -54,7 +54,7 @@ int cl_gpu_init(const int ntypes, double **host_scale, int init_ok=0; if (world_me==0) - init_ok=CLMF.init(ntypes, host_scale, inum, nall, 300, maxspecial, + init_ok=CLMF.init(ntypes, host_scale, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); @@ -72,7 +72,7 @@ int cl_gpu_init(const int ntypes, double **host_scale, fflush(screen); } if (gpu_rank==i && world_me!=0) - init_ok=CLMF.init(ntypes, host_scale, inum, nall, 300, maxspecial, + init_ok=CLMF.init(ntypes, host_scale, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); diff --git a/lib/gpu/lal_device.cpp b/lib/gpu/lal_device.cpp index 911cdda383..5ba9185e6f 100644 --- a/lib/gpu/lal_device.cpp +++ b/lib/gpu/lal_device.cpp @@ -18,12 +18,18 @@ #include #include #include -#ifdef _OPENMP +#if (LAL_USE_OMP == 1) #include #endif #if defined(USE_OPENCL) #include "device_cl.h" + +#ifdef LAL_OCL_EXTRA_ARGS +#define LAL_DM_STRINGIFY(x) #x +#define LAL_PRE_STRINGIFY(x) LAL_DM_STRINGIFY(x) +#endif + #elif defined(USE_CUDART) const char *device=0; #else @@ -45,40 +51,48 @@ DeviceT::~Device() { } template -int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int first_gpu, - const int last_gpu, const int gpu_mode, +int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int ngpu, + const int first_gpu_id, const int gpu_mode, const double p_split, const int nthreads, - const int t_per_atom, const double cell_size, - char *ocl_vendor, const int block_pair) { + const int t_per_atom, const double user_cell_size, + char *ocl_args, const int ocl_platform, + char *device_type_flags, const int block_pair) { _nthreads=nthreads; - #ifdef _OPENMP + #if (LAL_USE_OMP == 1) omp_set_num_threads(nthreads); #endif _threads_per_atom=t_per_atom; _threads_per_charge=t_per_atom; + _threads_per_three=t_per_atom; if (_device_init) return 0; _device_init=true; _comm_world=replica; //world; _comm_replica=replica; - _first_device=first_gpu; - _last_device=last_gpu; + int ndevices=ngpu; + _first_device=first_gpu_id; _gpu_mode=gpu_mode; _particle_split=p_split; - _cell_size=cell_size; + _user_cell_size=user_cell_size; _block_pair=block_pair; - // support selecting platform though "package device" keyword. - // "0:generic" will select platform 0 and tune for generic device - // "1:fermi" will select platform 1 and tune for Nvidia Fermi gpu - if (ocl_vendor) { - char *sep = nullptr; - if ((sep = strstr(ocl_vendor,":"))) { - *sep = '\0'; - _platform_id = atoi(ocl_vendor); - ocl_vendor = sep+1; - } - } + + // support selecting OpenCL platform id with "package platform" keyword + if (ocl_platform >= 0) + _platform_id = ocl_platform; + + gpu=new UCL_Device(); + + // ---------------------- OpenCL Compiler Args ------------------------- + std::string extra_args=""; + if (ocl_args) extra_args+=":"+std::string(ocl_args); + #ifdef LAL_OCL_EXTRA_ARGS + extra_args+=":" LAL_PRE_STRINGIFY(LAL_OCL_EXTRA_ARGS); + #endif + for (int i=0; i procs_per_node) + ndevices = procs_per_node; + + // --------------------- OCL Platform Selection ----------------------- + + // Setup OpenCL platform and parameters based on platform + // and device type specifications + std::string ocl_vstring=""; + if (device_type_flags != nullptr) ocl_vstring=device_type_flags; + + // Setup the OpenCL platform + // If multiple platforms and no user platform specified, + // try to match platform from config matching any user specified + // device type. Give preference to platforms with GPUs. + // Priority under these conditions to platform with device with + // highest compute unit count. + int pres; + enum UCL_DEVICE_TYPE type=UCL_GPU; + #ifndef USE_OPENCL + pres=gpu->set_platform(0); + #else + if (_platform_id>=0) + pres=gpu->set_platform(_platform_id); + else { + std::string vendor=""; + if (device_type_flags!=nullptr) { + if (ocl_vstring=="intelgpu") + vendor="intel"; + else if (ocl_vstring=="intelcpu") { + vendor="intel"; + type=UCL_CPU; + } else if (ocl_vstring=="nvidiagpu") + vendor="nvidia"; + else if (ocl_vstring=="amdgpu") + vendor="amd"; + else if (ocl_vstring=="applegpu") + vendor="apple"; + } + pres=gpu->auto_set_platform(type,vendor,ndevices,_first_device); + } + #endif + if (pres != UCL_SUCCESS) + return -12; + + // ------------------------ Device Selection --------------------------- + if (_first_device > -1 && _first_device >= gpu->num_devices()) + return -2; + if (ndevices > gpu->num_devices()) + return -2; + if (_first_device + ndevices > gpu->num_devices()) + return -2; + if (gpu->num_devices()==0) + return -2; + + // Fully specified deviceIDs + if (_first_device > -1 && ndevices > 0) + _last_device = _first_device + ndevices - 1; + + // Find deviceID with most CUs (priority given to the accelerator type) + if (_first_device < 0) { + int best_device = 0; + int best_cus = gpu->cus(0); + bool type_match = (gpu->device_type(0) == type); + for (int i = 1; i < gpu->num_devices(); i++) { + if (type_match==true && gpu->device_type(i)!=type) + continue; + if (type_match == false && gpu->device_type(i) == type) { + type_match = true; + best_cus = gpu->cus(i); + best_device = i; + } + if (gpu->cus(i) > best_cus) { + best_cus = gpu->cus(i); + best_device = i; + } + } + _first_device = _last_device = best_device; + type = gpu->device_type(_first_device); + + if (ndevices > 0) { + // Expand range to meet specified number of devices + while (_last_device - _first_device < ndevices - 1) { + if (_last_device + 1 == gpu->num_devices()) + _first_device--; + else if (_first_device == 0) + _last_device++; + else { + if (gpu->device_type(_last_device+1)==type && + gpu->device_type(_first_device-1)!=type) + _last_device++; + else if (gpu->device_type(_last_device+1)!=type && + gpu->device_type(_first_device-1)==type) + _first_device--; + else if (gpu->cus(_last_device+1) > gpu->cus(_first_device-1)) + _last_device++; + else + _first_device--; + } + } + } + } + + // If ngpus not specified, expand range to include matching devices + if (ndevices == 0) { + for (int i = _first_device; i < gpu->num_devices(); i++) { + if (gpu->device_type(i)==gpu->device_type(_first_device) && + gpu->cus(i)==gpu->cus(_first_device)) + _last_device = i; + else + break; + } + ndevices = _last_device - _first_device + 1; + if (ndevices > procs_per_node) { + ndevices = procs_per_node; + _last_device=_first_device + ndevices - 1; + } + } + + // ------------------------ MPI Device ID Setup ----------------------- + // set the device ID _procs_per_gpu=static_cast(ceil(static_cast(procs_per_node)/ - (last_gpu-first_gpu+1))); - int my_gpu=node_rank/_procs_per_gpu+first_gpu; + ndevices)); + int my_gpu=node_rank/_procs_per_gpu+_first_device; // Time on the device only if 1 proc per gpu _time_device=true; @@ -146,27 +282,51 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int first_gpu, MPI_Comm_split(node_comm,my_gpu,0,&_comm_gpu); MPI_Comm_rank(_comm_gpu,&_gpu_rank); - gpu=new UCL_Device(); - if (my_gpu>=gpu->num_devices()) - return -2; - - #ifndef CUDA_PROXY + #if !defined(CUDA_PROXY) && !defined(CUDA_MPS_SUPPORT) if (_procs_per_gpu>1 && gpu->sharing_supported(my_gpu)==false) return -7; #endif - if (gpu->set_platform_accelerator(_platform_id)!=UCL_SUCCESS) - return -12; + // --------------- Device Configuration and Setup ------------------------- if (gpu->set(my_gpu)!=UCL_SUCCESS) return -6; - gpu->push_command_queue(); - gpu->set_command_queue(1); + #if !defined(USE_OPENCL) && !defined(USE_HIP) + if (gpu->arch()<7.0) { + gpu->push_command_queue(); + gpu->set_command_queue(1); + } + #endif _long_range_precompute=0; - if (set_ocl_params(ocl_vendor)!=0) + // If OpenCL parameters not specified by user, try to auto detect + // best option from the platform config + #ifdef USE_OPENCL + if (device_type_flags==nullptr) { + std::string pname = gpu->platform_name(); + for (int i=0; i='a') + pname[i]=toupper(pname[i]); + if (pname.find("NVIDIA")!=std::string::npos) + ocl_vstring="nvidiagpu"; + else if (pname.find("INTEL")!=std::string::npos) { + if (gpu->device_type()==UCL_GPU) + ocl_vstring="intelgpu"; + else if (gpu->device_type()==UCL_CPU) + ocl_vstring="intelcpu"; + } else if (pname.find("AMD")!=std::string::npos) { + if (gpu->device_type()==UCL_GPU) + ocl_vstring="amdgpu"; + } else if (pname.find("APPLE")!=std::string::npos) { + if (gpu->device_type()==UCL_GPU) + ocl_vstring="applegpu"; + } + } + #endif + + if (set_ocl_params(ocl_vstring, extra_args)!=0) return -11; int flag=0; @@ -175,71 +335,90 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int first_gpu, flag=compile_kernels(); gpu_barrier(); } + + // Setup auto bin size calculation for calls from atom::sort + // - This is repeated in neighbor init with additional info + if (_user_cell_size<0.0) { + #ifndef LAL_USE_OLD_NEIGHBOR + _neighbor_shared.setup_auto_cell_size(true,0,_simd_size); + #else + _neighbor_shared.setup_auto_cell_size(false,0,_simd_size); + #endif + } else + _neighbor_shared.setup_auto_cell_size(false,_user_cell_size,_simd_size); + return flag; } template -int DeviceT::set_ocl_params(char *ocl_vendor) { +int DeviceT::set_ocl_params(std::string s_config, std::string extra_args) { #ifdef USE_OPENCL - std::string s_vendor=OCL_DEFAULT_VENDOR; - if (ocl_vendor!=nullptr) - s_vendor=ocl_vendor; - if (s_vendor=="none") - s_vendor="generic"; - if (s_vendor=="kepler") { - _ocl_vendor_name="NVIDIA Kepler"; - #if defined (__APPLE__) || defined(MACOSX) - _ocl_vendor_string="-DKEPLER_OCL -DNO_OCL_PTX"; - #else - _ocl_vendor_string="-DKEPLER_OCL"; - #endif - } else if (s_vendor=="fermi") { - _ocl_vendor_name="NVIDIA Fermi"; - _ocl_vendor_string="-DFERMI_OCL"; - } else if (s_vendor=="cypress") { - _ocl_vendor_name="AMD Cypress"; - _ocl_vendor_string="-DCYPRESS_OCL"; - } else if (s_vendor=="phi") { - _ocl_vendor_name="Intel Phi"; - _ocl_vendor_string="-DPHI_OCL"; - } else if (s_vendor=="intel") { - _ocl_vendor_name="Intel CPU"; - _ocl_vendor_string="-DINTEL_OCL"; - } else if (s_vendor=="generic") { - _ocl_vendor_name="GENERIC"; - _ocl_vendor_string="-DGENERIC_OCL"; - } else { - _ocl_vendor_name="CUSTOM"; - _ocl_vendor_string="-DUSE_OPENCL"; - int token_count=0; - std::string params[13]; - char *pch = strtok(ocl_vendor,","); + #include "lal_pre_ocl_config.h" + + if (s_config=="" || s_config=="none") + s_config="generic"; + + int config_index=-1; + for (int i=0; ihas_subgroup_support()) + _ocl_compile_string+=" -DUSE_OPENCL_SUBGROUPS"; + #ifdef LAL_USE_OLD_NEIGHBOR + _ocl_compile_string+=" -DLAL_USE_OLD_NEIGHBOR"; + #endif + + _ocl_compile_string += " -DCONFIG_ID="+params[0]+ + " -DSIMD_SIZE="+params[1]+ + " -DMEM_THREADS="+params[2]; + if (gpu->has_shuffle_support()==false) + _ocl_compile_string+=" -DSHUFFLE_AVAIL=0"; + else + _ocl_compile_string+=" -DSHUFFLE_AVAIL="+params[3]; + _ocl_compile_string += " -DFAST_MATH="+params[4]+ + + " -DTHREADS_PER_ATOM="+params[5]+ + " -DTHREADS_PER_CHARGE="+params[6]+ + " -DTHREADS_PER_THREE="+params[7]+ + + " -DBLOCK_PAIR="+params[8]+ + " -DBLOCK_BIO_PAIR="+params[9]+ + " -DBLOCK_ELLIPSE="+params[10]+ + " -DPPPM_BLOCK_1D="+params[11]+ + " -DBLOCK_NBOR_BUILD="+params[12]+ + " -DBLOCK_CELL_2D="+params[13]+ + " -DBLOCK_CELL_ID="+params[14]+ + + " -DMAX_SHARED_TYPES="+params[15]+ + " -DMAX_BIO_SHARED_TYPES="+params[16]+ + " -DPPPM_MAX_SPLINE="+params[17]; + _ocl_compile_string += extra_args; #endif return 0; } @@ -269,8 +448,10 @@ int DeviceT::init(Answer &ans, const bool charge, else if (_gpu_mode==Device::GPU_HYB_NEIGH) gpu_nbor=2; #if !defined(USE_CUDPP) && !defined(USE_HIP_DEVICE_SORT) - if (gpu_nbor==1) - gpu_nbor=2; + if (gpu_nbor==1) gpu_nbor=2; + #endif + #ifndef LAL_USE_OLD_NEIGHBOR + if (gpu_nbor==1) gpu_nbor=2; #endif if (_init_count==0) { @@ -328,14 +509,15 @@ int DeviceT::init(Answer &ans, const int nlocal, template int DeviceT::init_nbor(Neighbor *nbor, const int nlocal, - const int host_nlocal, const int nall, - const int maxspecial, const int gpu_host, - const int max_nbors, const double cell_size, - const bool pre_cut, const int threads_per_atom) { + const int host_nlocal, const int nall, + const int maxspecial, const int gpu_host, + const int max_nbors, const double cutoff, + const bool pre_cut, const int threads_per_atom, + const bool ilist_map) { int ef_nlocal=nlocal; if (_particle_split<1.0 && _particle_split>0.0) ef_nlocal=static_cast(_particle_split*nlocal); - + int gpu_nbor=0; if (_gpu_mode==Device::GPU_NEIGH) gpu_nbor=1; @@ -345,16 +527,27 @@ int DeviceT::init_nbor(Neighbor *nbor, const int nlocal, if (gpu_nbor==1) gpu_nbor=2; #endif + #ifndef LAL_USE_OLD_NEIGHBOR + if (gpu_nbor==1) + gpu_nbor=2; + #endif if (!nbor->init(&_neighbor_shared,ef_nlocal,host_nlocal,max_nbors,maxspecial, *gpu,gpu_nbor,gpu_host,pre_cut,_block_cell_2d, _block_cell_id, _block_nbor_build, threads_per_atom, - _warp_size, _time_device, compile_string())) + _simd_size, _time_device, compile_string(), ilist_map)) return -3; - if (_cell_size<0.0) - nbor->cell_size(cell_size,cell_size); - else - nbor->cell_size(_cell_size,cell_size); + + if (_user_cell_size<0.0) { + #ifndef LAL_USE_OLD_NEIGHBOR + _neighbor_shared.setup_auto_cell_size(true,cutoff,nbor->simd_size()); + #else + _neighbor_shared.setup_auto_cell_size(false,cutoff,nbor->simd_size()); + #endif + } else + _neighbor_shared.setup_auto_cell_size(false,_user_cell_size, + nbor->simd_size()); + nbor->set_cutoff(cutoff); return 0; } @@ -389,13 +582,21 @@ void DeviceT::init_message(FILE *screen, const char *name, fprintf(screen,"-------------------------------------\n"); fprintf(screen,"- Using acceleration for %s:\n",name); fprintf(screen,"- with %d proc(s) per device.\n",_procs_per_gpu); - #ifdef _OPENMP + #if (LAL_USE_OMP == 1) fprintf(screen,"- with %d thread(s) per proc.\n",_nthreads); #endif #ifdef USE_OPENCL - fprintf(screen,"- with OpenCL Parameters for: %s\n", - _ocl_vendor_name.c_str()); + fprintf(screen,"- with OpenCL Parameters for: %s (%d)\n", + _ocl_config_name.c_str(),_config_id); #endif + if (shuffle_avail()) + fprintf(screen,"- Horizontal vector operations: ENABLED\n"); + else + fprintf(screen,"- Horizontal vector operations: DISABLED\n"); + if (gpu->shared_memory(first_gpu)) + fprintf(screen,"- Shared memory system: Yes\n"); + else + fprintf(screen,"- Shared memory system: No\n"); fprintf(screen,"-------------------------------------"); fprintf(screen,"-------------------------------------\n"); @@ -431,7 +632,8 @@ void DeviceT::estimate_gpu_overhead(const int kernel_calls, double &gpu_overhead, double &gpu_driver_overhead) { UCL_H_Vec *host_data_in=nullptr, *host_data_out=nullptr; - UCL_D_Vec *dev_data_in=nullptr, *dev_data_out=nullptr, *kernel_data=nullptr; + UCL_D_Vec *dev_data_in=nullptr, *dev_data_out=nullptr, + *kernel_data=nullptr; UCL_Timer *timers_in=nullptr, *timers_out=nullptr, *timers_kernel=nullptr; UCL_Timer over_timer(*gpu); @@ -472,7 +674,7 @@ void DeviceT::estimate_gpu_overhead(const int kernel_calls, gpu_overhead=0.0; gpu_driver_overhead=0.0; - for (int i=0; i<10; i++) { + for (int z=0; z<11; z++) { gpu->sync(); gpu_barrier(); over_timer.start(); @@ -486,9 +688,11 @@ void DeviceT::estimate_gpu_overhead(const int kernel_calls, timers_in[i].stop(); } + const int numel=1; for (int i=0; i0) { + gpu_overhead+=mpi_time; + gpu_driver_overhead+=mpi_driver_time; + } } gpu_overhead/=10.0; gpu_driver_overhead/=10.0; @@ -567,19 +777,22 @@ void DeviceT::output_times(UCL_Timer &time_pair, Answer &ans, double mpi_max_bytes; MPI_Reduce(&my_max_bytes,&mpi_max_bytes,1,MPI_DOUBLE,MPI_MAX,0,_comm_replica); double max_mb=mpi_max_bytes/(1024.0*1024.0); - double t_time=times[0]+times[1]+times[2]+times[3]+times[4]; + + #ifdef USE_OPENCL + // Workaround for timing issue on Intel OpenCL + if (times[3] > 80e6) times[3]=0.0; + #endif if (replica_me()==0) - if (screen && times[5]>0.0) { + if (screen && times[6]>0.0) { fprintf(screen,"\n\n-------------------------------------"); fprintf(screen,"--------------------------------\n"); fprintf(screen," Device Time Info (average): "); fprintf(screen,"\n-------------------------------------"); fprintf(screen,"--------------------------------\n"); - if (time_device() && t_time>0) { + if (time_device() && times[3]>0) { fprintf(screen,"Data Transfer: %.4f s.\n",times[0]/_replica_size); - fprintf(screen,"Data Cast/Pack: %.4f s.\n",times[4]/_replica_size); fprintf(screen,"Neighbor copy: %.4f s.\n",times[1]/_replica_size); if (nbor.gpu_nbor()>0) fprintf(screen,"Neighbor build: %.4f s.\n",times[2]/_replica_size); @@ -587,13 +800,15 @@ void DeviceT::output_times(UCL_Timer &time_pair, Answer &ans, fprintf(screen,"Neighbor unpack: %.4f s.\n",times[2]/_replica_size); fprintf(screen,"Force calc: %.4f s.\n",times[3]/_replica_size); } - if (nbor.gpu_nbor()==2) - fprintf(screen,"Neighbor (CPU): %.4f s.\n",times[8]/_replica_size); if (times[5]>0) fprintf(screen,"Device Overhead: %.4f s.\n",times[5]/_replica_size); fprintf(screen,"Average split: %.4f.\n",avg_split); fprintf(screen,"Threads / atom: %d.\n",threads_per_atom); + fprintf(screen,"Vector width: %d.\n", simd_size()); fprintf(screen,"Max Mem / Proc: %.2f MB.\n",max_mb); + if (nbor.gpu_nbor()==2) + fprintf(screen,"CPU Neighbor: %.4f s.\n",times[8]/_replica_size); + fprintf(screen,"CPU Cast/Pack: %.4f s.\n",times[4]/_replica_size); fprintf(screen,"CPU Driver_Time: %.4f s.\n",times[6]/_replica_size); fprintf(screen,"CPU Idle_Time: %.4f s.\n",times[7]/_replica_size); @@ -612,24 +827,29 @@ void DeviceT::output_kspace_times(UCL_Timer &time_in, const double max_bytes, const double cpu_time, const double idle_time, FILE *screen) { - double single[8], times[8]; + double single[9], times[9]; single[0]=time_out.total_seconds(); single[1]=time_in.total_seconds()+atom.transfer_time()+atom.cast_time(); single[2]=time_map.total_seconds(); single[3]=time_rho.total_seconds(); single[4]=time_interp.total_seconds(); - single[5]=ans.transfer_time()+ans.cast_time(); + single[5]=ans.transfer_time(); single[6]=cpu_time; single[7]=idle_time; + single[8]=ans.cast_time(); - MPI_Reduce(single,times,8,MPI_DOUBLE,MPI_SUM,0,_comm_replica); + MPI_Reduce(single,times,9,MPI_DOUBLE,MPI_SUM,0,_comm_replica); double my_max_bytes=max_bytes+atom.max_gpu_bytes(); double mpi_max_bytes; MPI_Reduce(&my_max_bytes,&mpi_max_bytes,1,MPI_DOUBLE,MPI_MAX,0,_comm_replica); double max_mb=mpi_max_bytes/(1024.0*1024.0); - double t_time=times[0]+times[1]+times[2]+times[3]+times[4]+times[5]; + #ifdef USE_OPENCL + // Workaround for timing issue on Intel OpenCL + if (times[3] > 80e6) times[3]=0.0; + #endif + if (replica_me()==0) if (screen && times[6]>0.0) { @@ -639,7 +859,7 @@ void DeviceT::output_kspace_times(UCL_Timer &time_in, fprintf(screen,"\n-------------------------------------"); fprintf(screen,"--------------------------------\n"); - if (time_device() && t_time>0) { + if (time_device() && times[3]>0) { fprintf(screen,"Data Out: %.4f s.\n",times[0]/_replica_size); fprintf(screen,"Data In: %.4f s.\n",times[1]/_replica_size); fprintf(screen,"Kernel (map): %.4f s.\n",times[2]/_replica_size); @@ -649,12 +869,13 @@ void DeviceT::output_kspace_times(UCL_Timer &time_in, (times[0]+times[2]+times[3])/_replica_size); fprintf(screen,"Total interp: %.4f s.\n", (times[1]+times[4])/_replica_size); - fprintf(screen,"Force copy/cast: %.4f s.\n",times[5]/_replica_size); + fprintf(screen,"Force copy: %.4f s.\n",times[5]/_replica_size); fprintf(screen,"Total: %.4f s.\n", (times[0]+times[1]+times[2]+times[3]+times[4]+times[5])/ _replica_size); } fprintf(screen,"CPU Poisson: %.4f s.\n",times[6]/_replica_size); + fprintf(screen,"CPU Data Cast: %.4f s.\n",times[8]/_replica_size); fprintf(screen,"CPU Idle Time: %.4f s.\n",times[7]/_replica_size); fprintf(screen,"Max Mem / Proc: %.2f MB.\n",max_mb); @@ -699,14 +920,15 @@ int DeviceT::compile_kernels() { return flag; dev_program=new UCL_Program(*gpu); - int success=dev_program->load_string(device,compile_string().c_str()); + int success=dev_program->load_string(device,compile_string().c_str(), + nullptr,stderr); if (success!=UCL_SUCCESS) return -6; k_zero.set_function(*dev_program,"kernel_zero"); k_info.set_function(*dev_program,"kernel_info"); _compiled=true; - UCL_Vector gpu_lib_data(15,*gpu,UCL_NOT_PINNED); + UCL_Vector gpu_lib_data(19,*gpu,UCL_NOT_PINNED); k_info.set_size(1,1); k_info.run(&gpu_lib_data); gpu_lib_data.update_host(false); @@ -717,39 +939,81 @@ int DeviceT::compile_kernels() { return -4; #endif - _num_mem_threads=gpu_lib_data[1]; - _warp_size=gpu_lib_data[2]; - if (_threads_per_atom<1) - _threads_per_atom=gpu_lib_data[3]; - if (_threads_per_charge<1) - _threads_per_charge=gpu_lib_data[13]; - _pppm_max_spline=gpu_lib_data[4]; - _pppm_block=gpu_lib_data[5]; - if (_block_pair == -1) _block_pair=gpu_lib_data[6]; - _max_shared_types=gpu_lib_data[7]; - _block_cell_2d=gpu_lib_data[8]; - _block_cell_id=gpu_lib_data[9]; - _block_nbor_build=gpu_lib_data[10]; - _block_bio_pair=gpu_lib_data[11]; - _max_bio_shared_types=gpu_lib_data[12]; - _block_ellipse=gpu_lib_data[14]; + _config_id=gpu_lib_data[1]; - if (static_cast(_block_pair)>gpu->group_size()) - _block_pair=gpu->group_size(); - if (static_cast(_block_bio_pair)>gpu->group_size()) - _block_bio_pair=gpu->group_size(); - if (_threads_per_atom>_warp_size) - _threads_per_atom=_warp_size; - if (_warp_size%_threads_per_atom!=0) + if (sizeof(numtyp)==sizeof(float)) + _simd_size=std::max(gpu_lib_data[2],gpu->preferred_fp32_width()); + else + _simd_size=std::max(gpu_lib_data[2],gpu->preferred_fp64_width()); + + _num_mem_threads=gpu_lib_data[3]; + _shuffle_avail=gpu_lib_data[4]; + _fast_math=gpu_lib_data[5]; + + if (_threads_per_atom<1) + _threads_per_atom=gpu_lib_data[6]; + if (_threads_per_charge<1) + _threads_per_charge=gpu_lib_data[7]; + if (_threads_per_three<1) + _threads_per_three=gpu_lib_data[8]; + + if (_block_pair == -1) { + _block_pair=gpu_lib_data[9]; + _block_bio_pair=gpu_lib_data[10]; + _block_ellipse=gpu_lib_data[11]; + } else { + _block_bio_pair=_block_pair; + _block_ellipse=_block_pair; + } + _pppm_block=gpu_lib_data[12]; + _block_nbor_build=gpu_lib_data[13]; + _block_cell_2d=gpu_lib_data[14]; + _block_cell_id=gpu_lib_data[15]; + + _max_shared_types=gpu_lib_data[16]; + _max_bio_shared_types=gpu_lib_data[17]; + _pppm_max_spline=gpu_lib_data[18]; + + if (static_cast(_block_pair)>gpu->group_size_dim(0) || + static_cast(_block_bio_pair)>gpu->group_size_dim(0) || + static_cast(_block_ellipse)>gpu->group_size_dim(0) || + static_cast(_pppm_block)>gpu->group_size_dim(0) || + static_cast(_block_nbor_build)>gpu->group_size_dim(0) || + static_cast(_block_cell_2d)>gpu->group_size_dim(0) || + static_cast(_block_cell_2d)>gpu->group_size_dim(1) || + static_cast(_block_cell_id)>gpu->group_size_dim(0) || + static_cast(_max_shared_types*_max_shared_types* + sizeof(numtyp)*17 > gpu->slm_size()) || + static_cast(_max_bio_shared_types*2*sizeof(numtyp) > + gpu->slm_size())) + return -13; + + if (_block_pair % _simd_size != 0 || _block_bio_pair % _simd_size != 0 || + _block_ellipse % _simd_size != 0 || _pppm_block % _simd_size != 0 || + _block_nbor_build % _simd_size != 0 || + _block_pair < _max_shared_types * _max_shared_types || + _block_bio_pair * 2 < _max_bio_shared_types || + _pppm_block < _pppm_max_spline * _pppm_max_spline) + return -11; + + if (_threads_per_atom>_simd_size) + _threads_per_atom=_simd_size; + if (_simd_size%_threads_per_atom!=0) _threads_per_atom=1; if (_threads_per_atom & (_threads_per_atom - 1)) _threads_per_atom=1; - if (_threads_per_charge>_warp_size) - _threads_per_charge=_warp_size; - if (_warp_size%_threads_per_charge!=0) + if (_threads_per_charge>_simd_size) + _threads_per_charge=_simd_size; + if (_simd_size%_threads_per_charge!=0) _threads_per_charge=1; if (_threads_per_charge & (_threads_per_charge - 1)) _threads_per_charge=1; + if (_threads_per_three>_simd_size) + _threads_per_three=_simd_size; + if (_simd_size%_threads_per_three!=0) + _threads_per_three=1; + if (_threads_per_three & (_threads_per_three - 1)) + _threads_per_three=1; return flag; } @@ -765,14 +1029,16 @@ Device global_device; } using namespace LAMMPS_AL; -int lmp_init_device(MPI_Comm world, MPI_Comm replica, const int first_gpu, - const int last_gpu, const int gpu_mode, +int lmp_init_device(MPI_Comm world, MPI_Comm replica, const int ngpu, + const int first_gpu_id, const int gpu_mode, const double particle_split, const int nthreads, - const int t_per_atom, const double cell_size, - char *opencl_vendor, const int block_pair) { - return global_device.init_device(world,replica,first_gpu,last_gpu,gpu_mode, + const int t_per_atom, const double user_cell_size, + char *opencl_config, const int ocl_platform, + char *device_type_flags, const int block_pair) { + return global_device.init_device(world,replica,ngpu,first_gpu_id,gpu_mode, particle_split,nthreads,t_per_atom, - cell_size,opencl_vendor,block_pair); + user_cell_size,opencl_config,ocl_platform, + device_type_flags,block_pair); } void lmp_clear_device() { @@ -780,8 +1046,16 @@ void lmp_clear_device() { } double lmp_gpu_forces(double **f, double **tor, double *eatom, - double **vatom, double *virial, double &ecoul) { - return global_device.fix_gpu(f,tor,eatom,vatom,virial,ecoul); + double **vatom, double *virial, double &ecoul, + int &error_flag) { + return global_device.fix_gpu(f,tor,eatom,vatom,virial,ecoul,error_flag); +} + +double lmp_gpu_update_bin_size(const double subx, const double suby, + const double subz, const int nlocal, + const double cut) { + return global_device._neighbor_shared.update_cell_size(subx, suby, + subz, nlocal, cut); } bool lmp_gpu_config(const std::string &category, const std::string &setting) diff --git a/lib/gpu/lal_device.cu b/lib/gpu/lal_device.cu index afc7a0b988..61341964b2 100644 --- a/lib/gpu/lal_device.cu +++ b/lib/gpu/lal_device.cu @@ -26,20 +26,30 @@ __kernel void kernel_zero(__global int *restrict mem, } __kernel void kernel_info(__global int *info) { - info[0]=ARCH; - info[1]=MEM_THREADS; - info[2]=WARP_SIZE; - info[3]=THREADS_PER_ATOM; - info[4]=PPPM_MAX_SPLINE; - info[5]=PPPM_BLOCK_1D; - info[6]=BLOCK_PAIR; - info[7]=MAX_SHARED_TYPES; - info[8]=BLOCK_CELL_2D; - info[9]=BLOCK_CELL_ID; - info[10]=BLOCK_NBOR_BUILD; - info[11]=BLOCK_BIO_PAIR; - info[12]=MAX_BIO_SHARED_TYPES; - info[13]=THREADS_PER_CHARGE; - info[14]=BLOCK_ELLIPSE; -} + #ifdef __CUDA_ARCH__ + info[0]=__CUDA_ARCH__; + #else + info[0]=0; + #endif + info[1]=CONFIG_ID; + info[2]=SIMD_SIZE; + info[3]=MEM_THREADS; + info[4]=SHUFFLE_AVAIL; + info[5]=FAST_MATH; + info[6]=THREADS_PER_ATOM; + info[7]=THREADS_PER_CHARGE; + info[8]=THREADS_PER_THREE; + + info[9]=BLOCK_PAIR; + info[10]=BLOCK_BIO_PAIR; + info[11]=BLOCK_ELLIPSE; + info[12]=PPPM_BLOCK_1D; + info[13]=BLOCK_NBOR_BUILD; + info[14]=BLOCK_CELL_2D; + info[15]=BLOCK_CELL_ID; + + info[16]=MAX_SHARED_TYPES; + info[17]=MAX_BIO_SHARED_TYPES; + info[18]=PPPM_MAX_SPLINE; +} diff --git a/lib/gpu/lal_device.h b/lib/gpu/lal_device.h index 21bd039c42..bd5b81558c 100644 --- a/lib/gpu/lal_device.h +++ b/lib/gpu/lal_device.h @@ -39,22 +39,23 @@ class Device { /// Initialize the device for use by this process /** Sets up a per-device MPI communicator for load balancing and initializes - * the device (>=first_gpu and <=last_gpu) that this proc will be using + * the device (ngpu starting at first_gpu_id) that this proc will be using * Returns: * - 0 if successful * - -2 if GPU not found * - -4 if GPU library not compiled for GPU * - -6 if GPU could not be initialized for use * - -7 if accelerator sharing is not currently allowed on system - * - -11 if vendor_string has the wrong number of parameters **/ - int init_device(MPI_Comm world, MPI_Comm replica, const int first_gpu, - const int last_gpu, const int gpu_mode, + * - -11 if config_string has the wrong number of parameters **/ + int init_device(MPI_Comm world, MPI_Comm replica, const int ngpu, + const int first_gpu_id, const int gpu_mode, const double particle_split, const int nthreads, - const int t_per_atom, const double cell_size, - char *vendor_string, const int block_pair); + const int t_per_atom, const double user_cell_size, + char *config_string, const int ocl_platform, + char *device_type_flags, const int block_pair); /// Initialize the device for Atom storage - /** \param charge True if charges need to be stored + /** \param charge True if charges need to be stored * \param rot True if quaternions need to be stored * \param nlocal Total number of local particles to allocate memory for * \param nall Total number of local+ghost particles @@ -94,10 +95,11 @@ class Device { * 1 if gpu_nbor is true, and host needs a half nbor list, * 2 if gpu_nbor is true, and host needs a full nbor list * \param max_nbors Initial number of rows in the neighbor matrix - * \param cell_size cutoff+skin + * \param cutoff cutoff+skin * \param pre_cut True if cutoff test will be performed in separate kernel * than the force kernel * \param threads_per_atom value to be used by the neighbor list only + * \param ilist_map true if ilist mapping data structures used (3-body) * * Returns: * - 0 if successful @@ -108,8 +110,9 @@ class Device { int init_nbor(Neighbor *nbor, const int nlocal, const int host_nlocal, const int nall, const int maxspecial, const int gpu_host, - const int max_nbors, const double cell_size, - const bool pre_cut, const int threads_per_atom); + const int max_nbors, const double cutoff, + const bool pre_cut, const int threads_per_atom, + const bool ilist_map = false); /// Output a message for pair_style acceleration with device stats void init_message(FILE *screen, const char *name, @@ -161,13 +164,16 @@ class Device { /// Add "answers" (force,energies,etc.) into LAMMPS structures inline double fix_gpu(double **f, double **tor, double *eatom, - double **vatom, double *virial, double &ecoul) { + double **vatom, double *virial, double &ecoul, + int &error_flag) { + error_flag=0; atom.data_unavail(); if (ans_queue.empty()==false) { stop_host_timer(); double evdw=0.0; while (ans_queue.empty()==false) { - evdw+=ans_queue.front()->get_answers(f,tor,eatom,vatom,virial,ecoul); + evdw+=ans_queue.front()->get_answers(f,tor,eatom,vatom,virial,ecoul, + error_flag); ans_queue.pop(); } return evdw; @@ -228,45 +234,49 @@ class Device { /// True if device is being timed inline bool time_device() const { return _time_device; } + /// Accelerator device configuration id + inline int config_id() const { return _config_id; } + /// Number of threads executing concurrently on same multiproc + inline int simd_size() const { return _simd_size; } /// Return the number of threads accessing memory simulatenously inline int num_mem_threads() const { return _num_mem_threads; } + /// 1 if horizontal vector operations enabled, 0 otherwise + inline int shuffle_avail() const { return _shuffle_avail; } + /// For OpenCL, 0 if fast-math options disabled, 1 enabled + inline int fast_math() const { return _fast_math; } + /// Return the number of threads per atom for pair styles inline int threads_per_atom() const { return _threads_per_atom; } /// Return the number of threads per atom for pair styles using charge inline int threads_per_charge() const { return _threads_per_charge; } + /// Return the number of threads per atom for 3-body pair styles + inline int threads_per_three() const { return _threads_per_three; } + /// Return the min of the pair block size or the device max block size inline int pair_block_size() const { return _block_pair; } - /// Return the maximum number of atom types that can be used with shared mem - inline int max_shared_types() const { return _max_shared_types; } - /// Return the maximum order for PPPM splines - inline int pppm_max_spline() const { return _pppm_max_spline; } - /// Return the block size for PPPM kernels - inline int pppm_block() const { return _pppm_block; } - /// Return the block size for neighbor binning - inline int block_cell_2d() const { return _block_cell_2d; } - /// Return the block size for atom mapping for neighbor builds - inline int block_cell_id() const { return _block_cell_id; } - /// Return the block size for neighbor build kernel - inline int block_nbor_build() const { return _block_nbor_build; } /// Return the block size for "bio" pair styles inline int block_bio_pair() const { return _block_bio_pair; } /// Return the block size for "ellipse" pair styles inline int block_ellipse() const { return _block_ellipse; } + /// Return the block size for PPPM kernels + inline int pppm_block() const { return _pppm_block; } + /// Return the block size for neighbor build kernel + inline int block_nbor_build() const { return _block_nbor_build; } + /// Return the block size for neighbor binning + inline int block_cell_2d() const { return _block_cell_2d; } + /// Return the block size for atom mapping for neighbor builds + inline int block_cell_id() const { return _block_cell_id; } + + /// Return the maximum number of atom types that can be used with shared mem + inline int max_shared_types() const { return _max_shared_types; } /// Return the maximum number of atom types for shared mem with "bio" styles inline int max_bio_shared_types() const { return _max_bio_shared_types; } + /// Return the maximum order for PPPM splines + inline int pppm_max_spline() const { return _pppm_max_spline; } + /// Architecture gpu code compiled for (returns 0 for OpenCL) inline double ptx_arch() const { return _ptx_arch; } - /// Number of threads executing concurrently on same multiproc - inline int warp_size() const { return _warp_size; } - - // -------------------- SHARED DEVICE ROUTINES -------------------- - // Perform asynchronous zero of integer array - void zero(UCL_D_Vec &mem, const int numel) { - int num_blocks=static_cast(ceil(static_cast(numel)/ - _block_pair)); - k_zero.set_size(num_blocks,_block_pair); - k_zero.run(&mem,&numel); - } + inline void set_simd_size(int simd_sz) { _simd_size = simd_sz; } // -------------------------- DEVICE DATA ------------------------- @@ -304,6 +314,15 @@ class Device { } inline std::string compile_string() { return _ocl_compile_string; } + inline std::string ocl_config_name() { return _ocl_config_name; } + + template + inline std::string toa(const t& in) { + std::ostringstream o; + o.precision(2); + o << in; + return o.str(); + } private: std::queue *> ans_queue; @@ -316,13 +335,13 @@ class Device { double _particle_split; double _cpu_full; double _ptx_arch; - double _cell_size; // -1 if the cutoff is used + double _user_cell_size; // -1 if the cutoff is used - int _num_mem_threads, _warp_size, _threads_per_atom, _threads_per_charge; - int _pppm_max_spline, _pppm_block; - int _block_pair, _block_ellipse, _max_shared_types; - int _block_cell_2d, _block_cell_id, _block_nbor_build; - int _block_bio_pair, _max_bio_shared_types; + int _config_id, _simd_size, _num_mem_threads, _shuffle_avail, _fast_math; + int _threads_per_atom, _threads_per_charge, _threads_per_three; + int _block_pair, _block_bio_pair, _block_ellipse; + int _pppm_block, _block_nbor_build, _block_cell_2d, _block_cell_id; + int _max_shared_types, _max_bio_shared_types, _pppm_max_spline; UCL_Program *dev_program; UCL_Kernel k_zero, k_info; @@ -331,17 +350,8 @@ class Device { int _data_in_estimate, _data_out_estimate; - std::string _ocl_vendor_name, _ocl_vendor_string, _ocl_compile_string; - int set_ocl_params(char *); - - template - inline std::string toa(const t& in) { - std::ostringstream o; - o.precision(2); - o << in; - return o.str(); - } - + std::string _ocl_config_name, _ocl_config_string, _ocl_compile_string; + int set_ocl_params(std::string, std::string); }; } diff --git a/lib/gpu/lal_dipole_lj.cpp b/lib/gpu/lal_dipole_lj.cpp index b0929e2ffb..ffdeb41ca8 100644 --- a/lib/gpu/lal_dipole_lj.cpp +++ b/lib/gpu/lal_dipole_lj.cpp @@ -125,20 +125,9 @@ double DipoleLJT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void DipoleLJT::loop(const bool _eflag, const bool _vflag) { +int DipoleLJT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -146,8 +135,8 @@ void DipoleLJT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, @@ -165,6 +154,7 @@ void DipoleLJT::loop(const bool _eflag, const bool _vflag) { &_qqrd2e, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class DipoleLJ; diff --git a/lib/gpu/lal_dipole_lj.cu b/lib/gpu/lal_dipole_lj.cu index a3ed0d8d40..cbe68ff692 100644 --- a/lib/gpu/lal_dipole_lj.cu +++ b/lib/gpu/lal_dipole_lj.cu @@ -31,106 +31,178 @@ _texture_2d( mu_tex,int4); #define mu_tex mu_ #endif -#if (ARCH < 300) +#if (SHUFFLE_AVAIL == 0) -#define store_answers_tq(f, tor, energy, ecoul, virial, ii, inum, tid, \ - t_per_atom, offset, eflag, vflag, ans, engv) \ +#define store_answers_tq(f, tor, energy, e_coul, virial, ii, inum, tid, \ + t_per_atom, offset, eflag, vflag, ans, engv) \ if (t_per_atom>1) { \ - __local acctyp red_acc[8][BLOCK_PAIR]; \ - red_acc[0][tid]=f.x; \ - red_acc[1][tid]=f.y; \ - red_acc[2][tid]=f.z; \ - red_acc[3][tid]=tor.x; \ - red_acc[4][tid]=tor.y; \ - red_acc[5][tid]=tor.z; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ + simd_reduce_add6(t_per_atom, red_acc, offset, tid, f.x, f.y, f.z, \ + tor.x, tor.y, tor.z); \ + if (EVFLAG && (vflag==2 || eflag==2)) { \ + if (eflag) { \ + simdsync(); \ + simd_reduce_add2(t_per_atom, red_acc, offset, tid, energy, e_coul); \ } \ - } \ - f.x=red_acc[0][tid]; \ - f.y=red_acc[1][tid]; \ - f.z=red_acc[2][tid]; \ - tor.x=red_acc[3][tid]; \ - tor.y=red_acc[4][tid]; \ - tor.z=red_acc[5][tid]; \ - if (eflag>0 || vflag>0) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid]=virial[r]; \ - red_acc[6][tid]=energy; \ - red_acc[7][tid]=ecoul; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<8; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ + if (vflag) { \ + simdsync(); \ + simd_reduce_arr(6, t_per_atom, red_acc, offset, tid, virial); \ } \ - for (int r=0; r<6; r++) \ - virial[r]=red_acc[r][tid]; \ - energy=red_acc[6][tid]; \ - ecoul=red_acc[7][tid]; \ } \ } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]=energy*(acctyp)0.5; \ - ei+=inum; \ - engv[ei]=e_coul*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]=virial[i]*(acctyp)0.5; \ - ei+=inum; \ - } \ - } \ + if (offset==0 && ii1) { \ + simd_reduce_add6(t_per_atom, f.x, f.y, f.z, tor.x, tor.y, tor.z); \ + if (vflag==2 || eflag==2) { \ + if (eflag) \ + simd_reduce_add2(t_per_atom,energy,e_coul); \ + if (vflag) \ + simd_reduce_arr(6, t_per_atom,virial); \ + } \ + } \ + if (offset==0 && ii 1; active_subgs /= vwidth) { \ + if (active_subgs < BLOCK_SIZE_X/simd_size()) __syncthreads(); \ + if (bnum < active_subgs) { \ + if (eflag) { \ + simd_reduce_add2(vwidth, energy, e_coul); \ + if (voffset==0) { \ + red_acc[6][bnum] = energy; \ + red_acc[7][bnum] = e_coul; \ + } \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (voffset==0) \ + for (int r=0; r<6; r++) red_acc[r][bnum]=virial[r]; \ + } \ + } \ + \ + __syncthreads(); \ + if (tid < active_subgs) { \ + if (eflag) { \ + energy = red_acc[6][tid]; \ + e_coul = red_acc[7][tid]; \ + } \ + if (vflag) \ + for (int r = 0; r < 6; r++) virial[r] = red_acc[r][tid]; \ + } else { \ + if (eflag) energy = e_coul = (acctyp)0; \ + if (vflag) for (int r = 0; r < 6; r++) virial[r] = (acctyp)0; \ + } \ + } \ + \ + if (bnum == 0) { \ + int ei=BLOCK_ID_X; \ + const int ev_stride=NUM_BLOCKS_X; \ + if (eflag) { \ + simd_reduce_add2(vwidth, energy, e_coul); \ + if (tid==0) { \ + engv[ei]=energy*(acctyp)0.5; \ + ei+=ev_stride; \ + engv[ei]=e_coul*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (tid==0) { \ + for (int r=0; r<6; r++) { \ + engv[ei]=virial[r]*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + } \ + } \ + } else if (offset==0 && ii1) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - f.x += shfl_xor(f.x, s, t_per_atom); \ - f.y += shfl_xor(f.y, s, t_per_atom); \ - f.z += shfl_xor(f.z, s, t_per_atom); \ - tor.x += shfl_xor(tor.x, s, t_per_atom); \ - tor.y += shfl_xor(tor.y, s, t_per_atom); \ - tor.z += shfl_xor(tor.z, s, t_per_atom); \ - energy += shfl_xor(energy, s, t_per_atom); \ - e_coul += shfl_xor(e_coul, s, t_per_atom); \ - } \ - if (vflag>0) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - for (int r=0; r<6; r++) \ - virial[r] += shfl_xor(virial[r], s, t_per_atom); \ - } \ - } \ - } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]=energy*(acctyp)0.5; \ - ei+=inum; \ - engv[ei]=e_coul*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]=virial[i]*(acctyp)0.5; \ - ei+=inum; \ - } \ - } \ + if (t_per_atom>1) \ + simd_reduce_add6(t_per_atom, f.x, f.y, f.z, tor.x, tor.y, tor.z); \ + if (offset==0 && ii0) { + if (EVFLAG && eflag) { acctyp e = (acctyp)0.0; if (rsq < lj1[mtype].w) { e = qtmp*qj*rinv; @@ -324,7 +396,7 @@ __kernel void k_dipole_lj(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-lj3[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*force.x; virial[1] += dely*force.y; virial[2] += delz*force.z; @@ -335,9 +407,9 @@ __kernel void k_dipole_lj(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_tq(f,tor,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_tq(f,tor,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset, + eflag,vflag,ans,engv); } __kernel void k_dipole_lj_fast(const __global numtyp4 *restrict x_, @@ -361,33 +433,33 @@ __kernel void k_dipole_lj_fast(const __global numtyp4 *restrict x_, __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp cutsq[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; - acctyp4 f; + acctyp4 f, tor; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp4 tor; - tor.x=(acctyp)0; - tor.y=(acctyp)0; - tor.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + tor.x=(acctyp)0; tor.y=(acctyp)0; tor.z=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { acctyp e = (acctyp)0; if (rsq < lj1[mtype].w) { e = qtmp*qj*rinv; @@ -537,7 +609,7 @@ __kernel void k_dipole_lj_fast(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-lj3[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*force.x; virial[1] += dely*force.y; virial[2] += delz*force.z; @@ -548,8 +620,7 @@ __kernel void k_dipole_lj_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_tq(f,tor,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_tq(f,tor,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset, + eflag,vflag,ans,engv); } - diff --git a/lib/gpu/lal_dipole_lj.h b/lib/gpu/lal_dipole_lj.h index bd312324c6..395a7472ba 100644 --- a/lib/gpu/lal_dipole_lj.h +++ b/lib/gpu/lal_dipole_lj.h @@ -77,7 +77,7 @@ class DipoleLJ : public BaseDipole { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_dipole_lj_ext.cpp b/lib/gpu/lal_dipole_lj_ext.cpp index 0a94969c8b..90c9935913 100644 --- a/lib/gpu/lal_dipole_lj_ext.cpp +++ b/lib/gpu/lal_dipole_lj_ext.cpp @@ -57,7 +57,7 @@ int dpl_gpu_init(const int ntypes, double **cutsq, double **host_lj1, int init_ok=0; if (world_me==0) init_ok=DPLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, - host_lj4, offset, special_lj, inum, nall, 300, + host_lj4, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e); @@ -76,7 +76,7 @@ int dpl_gpu_init(const int ntypes, double **cutsq, double **host_lj1, } if (gpu_rank==i && world_me!=0) init_ok=DPLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - offset, special_lj, inum, nall, 300, maxspecial, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e); diff --git a/lib/gpu/lal_dipole_lj_sf.cpp b/lib/gpu/lal_dipole_lj_sf.cpp index dcf95bb126..6b40ffaa11 100644 --- a/lib/gpu/lal_dipole_lj_sf.cpp +++ b/lib/gpu/lal_dipole_lj_sf.cpp @@ -125,20 +125,9 @@ double DipoleLJSFT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void DipoleLJSFT::loop(const bool _eflag, const bool _vflag) { +int DipoleLJSFT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -146,8 +135,8 @@ void DipoleLJSFT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, @@ -165,6 +154,7 @@ void DipoleLJSFT::loop(const bool _eflag, const bool _vflag) { &_qqrd2e, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class DipoleLJSF; diff --git a/lib/gpu/lal_dipole_lj_sf.cu b/lib/gpu/lal_dipole_lj_sf.cu index 8032ae82ed..717d8959ba 100644 --- a/lib/gpu/lal_dipole_lj_sf.cu +++ b/lib/gpu/lal_dipole_lj_sf.cu @@ -32,106 +32,178 @@ _texture_2d( mu_tex,int4); #define mu_tex mu_ #endif -#if (ARCH < 300) +#if (SHUFFLE_AVAIL == 0) -#define store_answers_tq(f, tor, energy, ecoul, virial, ii, inum, tid, \ - t_per_atom, offset, eflag, vflag, ans, engv) \ +#define store_answers_tq(f, tor, energy, e_coul, virial, ii, inum, tid, \ + t_per_atom, offset, eflag, vflag, ans, engv) \ if (t_per_atom>1) { \ - __local acctyp red_acc[8][BLOCK_PAIR]; \ - red_acc[0][tid]=f.x; \ - red_acc[1][tid]=f.y; \ - red_acc[2][tid]=f.z; \ - red_acc[3][tid]=tor.x; \ - red_acc[4][tid]=tor.y; \ - red_acc[5][tid]=tor.z; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ + simd_reduce_add6(t_per_atom, red_acc, offset, tid, f.x, f.y, f.z, \ + tor.x, tor.y, tor.z); \ + if (EVFLAG && (vflag==2 || eflag==2)) { \ + if (eflag) { \ + simdsync(); \ + simd_reduce_add2(t_per_atom, red_acc, offset, tid, energy, e_coul); \ } \ - } \ - f.x=red_acc[0][tid]; \ - f.y=red_acc[1][tid]; \ - f.z=red_acc[2][tid]; \ - tor.x=red_acc[3][tid]; \ - tor.y=red_acc[4][tid]; \ - tor.z=red_acc[5][tid]; \ - if (eflag>0 || vflag>0) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid]=virial[r]; \ - red_acc[6][tid]=energy; \ - red_acc[7][tid]=ecoul; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<8; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ + if (vflag) { \ + simdsync(); \ + simd_reduce_arr(6, t_per_atom, red_acc, offset, tid, virial); \ } \ - for (int r=0; r<6; r++) \ - virial[r]=red_acc[r][tid]; \ - energy=red_acc[6][tid]; \ - ecoul=red_acc[7][tid]; \ } \ } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]=energy*(acctyp)0.5; \ - ei+=inum; \ - engv[ei]=e_coul*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]=virial[i]*(acctyp)0.5; \ - ei+=inum; \ - } \ - } \ + if (offset==0 && ii1) { \ + simd_reduce_add6(t_per_atom, f.x, f.y, f.z, tor.x, tor.y, tor.z); \ + if (vflag==2 || eflag==2) { \ + if (eflag) \ + simd_reduce_add2(t_per_atom,energy,e_coul); \ + if (vflag) \ + simd_reduce_arr(6, t_per_atom,virial); \ + } \ + } \ + if (offset==0 && ii 1; active_subgs /= vwidth) { \ + if (active_subgs < BLOCK_SIZE_X/simd_size()) __syncthreads(); \ + if (bnum < active_subgs) { \ + if (eflag) { \ + simd_reduce_add2(vwidth, energy, e_coul); \ + if (voffset==0) { \ + red_acc[6][bnum] = energy; \ + red_acc[7][bnum] = e_coul; \ + } \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (voffset==0) \ + for (int r=0; r<6; r++) red_acc[r][bnum]=virial[r]; \ + } \ + } \ + \ + __syncthreads(); \ + if (tid < active_subgs) { \ + if (eflag) { \ + energy = red_acc[6][tid]; \ + e_coul = red_acc[7][tid]; \ + } \ + if (vflag) \ + for (int r = 0; r < 6; r++) virial[r] = red_acc[r][tid]; \ + } else { \ + if (eflag) energy = e_coul = (acctyp)0; \ + if (vflag) for (int r = 0; r < 6; r++) virial[r] = (acctyp)0; \ + } \ + } \ + \ + if (bnum == 0) { \ + int ei=BLOCK_ID_X; \ + const int ev_stride=NUM_BLOCKS_X; \ + if (eflag) { \ + simd_reduce_add2(vwidth, energy, e_coul); \ + if (tid==0) { \ + engv[ei]=energy*(acctyp)0.5; \ + ei+=ev_stride; \ + engv[ei]=e_coul*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (tid==0) { \ + for (int r=0; r<6; r++) { \ + engv[ei]=virial[r]*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + } \ + } \ + } else if (offset==0 && ii1) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - f.x += shfl_xor(f.x, s, t_per_atom); \ - f.y += shfl_xor(f.y, s, t_per_atom); \ - f.z += shfl_xor(f.z, s, t_per_atom); \ - tor.x += shfl_xor(tor.x, s, t_per_atom); \ - tor.y += shfl_xor(tor.y, s, t_per_atom); \ - tor.z += shfl_xor(tor.z, s, t_per_atom); \ - energy += shfl_xor(energy, s, t_per_atom); \ - e_coul += shfl_xor(e_coul, s, t_per_atom); \ - } \ - if (vflag>0) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - for (int r=0; r<6; r++) \ - virial[r] += shfl_xor(virial[r], s, t_per_atom); \ - } \ - } \ - } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]=energy*(acctyp)0.5; \ - ei+=inum; \ - engv[ei]=e_coul*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]=virial[i]*(acctyp)0.5; \ - ei+=inum; \ - } \ - } \ + t_per_atom, offset, eflag, vflag, ans, engv) \ + if (t_per_atom>1) \ + simd_reduce_add6(t_per_atom, f.x, f.y, f.z, tor.x, tor.y, tor.z); \ + if (offset==0 && ii0) { + if (EVFLAG && eflag) { acctyp e = (acctyp)0.0; if (rsq < lj1[mtype].w) { numtyp fac = (numtyp)1.0-ucl_sqrt(rsq*rcutcoul2inv); @@ -357,7 +429,7 @@ __kernel void k_dipole_lj_sf(const __global numtyp4 *restrict x_, energy+=factor_lj*e; } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*force.x; virial[1] += dely*force.y; virial[2] += delz*force.z; @@ -367,9 +439,9 @@ __kernel void k_dipole_lj_sf(const __global numtyp4 *restrict x_, } } } // for nbor - store_answers_tq(f,tor,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_tq(f,tor,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset, + eflag,vflag,ans,engv); } __kernel void k_dipole_lj_sf_fast(const __global numtyp4 *restrict x_, @@ -394,33 +466,33 @@ __kernel void k_dipole_lj_sf_fast(const __global numtyp4 *restrict x_, __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp cutsq[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; - acctyp4 f; + acctyp4 f, tor; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp4 tor; - tor.x=(acctyp)0; - tor.y=(acctyp)0; - tor.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + tor.x=(acctyp)0; tor.y=(acctyp)0; tor.z=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { acctyp e = (acctyp)0.0; if (rsq < lj1[mtype].w) { numtyp fac = (numtyp)1.0-ucl_sqrt(rsq*rcutcoul2inv); @@ -600,7 +672,7 @@ __kernel void k_dipole_lj_sf_fast(const __global numtyp4 *restrict x_, energy+=factor_lj*e; } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*force.x; virial[1] += dely*force.y; virial[2] += delz*force.z; @@ -611,8 +683,8 @@ __kernel void k_dipole_lj_sf_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_tq(f,tor,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_tq(f,tor,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset, + eflag,vflag,ans,engv); } diff --git a/lib/gpu/lal_dipole_lj_sf.h b/lib/gpu/lal_dipole_lj_sf.h index ae73508065..088d8df03e 100644 --- a/lib/gpu/lal_dipole_lj_sf.h +++ b/lib/gpu/lal_dipole_lj_sf.h @@ -77,7 +77,7 @@ class DipoleLJSF : public BaseDipole { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_dipole_lj_sf_ext.cpp b/lib/gpu/lal_dipole_lj_sf_ext.cpp index 3626e8305e..0879702887 100644 --- a/lib/gpu/lal_dipole_lj_sf_ext.cpp +++ b/lib/gpu/lal_dipole_lj_sf_ext.cpp @@ -57,7 +57,7 @@ int dplsf_gpu_init(const int ntypes, double **cutsq, double **host_lj1, int init_ok=0; if (world_me==0) init_ok=DPLSFMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, - host_lj4, special_lj, inum, nall, 300, + host_lj4, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e); @@ -76,7 +76,7 @@ int dplsf_gpu_init(const int ntypes, double **cutsq, double **host_lj1, } if (gpu_rank==i && world_me!=0) init_ok=DPLSFMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - special_lj, inum, nall, 300, maxspecial, + special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e); diff --git a/lib/gpu/lal_dipole_long_lj.cpp b/lib/gpu/lal_dipole_long_lj.cpp index 9648e9b15e..5531fa0dc9 100644 --- a/lib/gpu/lal_dipole_long_lj.cpp +++ b/lib/gpu/lal_dipole_long_lj.cpp @@ -128,20 +128,9 @@ double DipoleLongLJT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void DipoleLongLJT::loop(const bool _eflag, const bool _vflag) { +int DipoleLongLJT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -149,8 +138,8 @@ void DipoleLongLJT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, @@ -168,6 +157,7 @@ void DipoleLongLJT::loop(const bool _eflag, const bool _vflag) { &_qqrd2e, &_g_ewald, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class DipoleLongLJ; diff --git a/lib/gpu/lal_dipole_long_lj.cu b/lib/gpu/lal_dipole_long_lj.cu index 3aafba43aa..407b63f93e 100644 --- a/lib/gpu/lal_dipole_long_lj.cu +++ b/lib/gpu/lal_dipole_long_lj.cu @@ -31,106 +31,178 @@ _texture_2d( mu_tex,int4); #define mu_tex mu_ #endif -#if (ARCH < 300) +#if (SHUFFLE_AVAIL == 0) -#define store_answers_tq(f, tor, energy, ecoul, virial, ii, inum, tid, \ - t_per_atom, offset, eflag, vflag, ans, engv) \ +#define store_answers_tq(f, tor, energy, e_coul, virial, ii, inum, tid, \ + t_per_atom, offset, eflag, vflag, ans, engv) \ if (t_per_atom>1) { \ - __local acctyp red_acc[8][BLOCK_PAIR]; \ - red_acc[0][tid]=f.x; \ - red_acc[1][tid]=f.y; \ - red_acc[2][tid]=f.z; \ - red_acc[3][tid]=tor.x; \ - red_acc[4][tid]=tor.y; \ - red_acc[5][tid]=tor.z; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ + simd_reduce_add6(t_per_atom, red_acc, offset, tid, f.x, f.y, f.z, \ + tor.x, tor.y, tor.z); \ + if (EVFLAG && (vflag==2 || eflag==2)) { \ + if (eflag) { \ + simdsync(); \ + simd_reduce_add2(t_per_atom, red_acc, offset, tid, energy, e_coul); \ } \ - } \ - f.x=red_acc[0][tid]; \ - f.y=red_acc[1][tid]; \ - f.z=red_acc[2][tid]; \ - tor.x=red_acc[3][tid]; \ - tor.y=red_acc[4][tid]; \ - tor.z=red_acc[5][tid]; \ - if (eflag>0 || vflag>0) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid]=virial[r]; \ - red_acc[6][tid]=energy; \ - red_acc[7][tid]=ecoul; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<8; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ + if (vflag) { \ + simdsync(); \ + simd_reduce_arr(6, t_per_atom, red_acc, offset, tid, virial); \ } \ - for (int r=0; r<6; r++) \ - virial[r]=red_acc[r][tid]; \ - energy=red_acc[6][tid]; \ - ecoul=red_acc[7][tid]; \ } \ } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]=energy*(acctyp)0.5; \ - ei+=inum; \ - engv[ei]=e_coul*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]=virial[i]*(acctyp)0.5; \ - ei+=inum; \ - } \ - } \ + if (offset==0 && ii1) { \ + simd_reduce_add6(t_per_atom, f.x, f.y, f.z, tor.x, tor.y, tor.z); \ + if (vflag==2 || eflag==2) { \ + if (eflag) \ + simd_reduce_add2(t_per_atom,energy,e_coul); \ + if (vflag) \ + simd_reduce_arr(6, t_per_atom,virial); \ + } \ + } \ + if (offset==0 && ii 1; active_subgs /= vwidth) { \ + if (active_subgs < BLOCK_SIZE_X/simd_size()) __syncthreads(); \ + if (bnum < active_subgs) { \ + if (eflag) { \ + simd_reduce_add2(vwidth, energy, e_coul); \ + if (voffset==0) { \ + red_acc[6][bnum] = energy; \ + red_acc[7][bnum] = e_coul; \ + } \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (voffset==0) \ + for (int r=0; r<6; r++) red_acc[r][bnum]=virial[r]; \ + } \ + } \ + \ + __syncthreads(); \ + if (tid < active_subgs) { \ + if (eflag) { \ + energy = red_acc[6][tid]; \ + e_coul = red_acc[7][tid]; \ + } \ + if (vflag) \ + for (int r = 0; r < 6; r++) virial[r] = red_acc[r][tid]; \ + } else { \ + if (eflag) energy = e_coul = (acctyp)0; \ + if (vflag) for (int r = 0; r < 6; r++) virial[r] = (acctyp)0; \ + } \ + } \ + \ + if (bnum == 0) { \ + int ei=BLOCK_ID_X; \ + const int ev_stride=NUM_BLOCKS_X; \ + if (eflag) { \ + simd_reduce_add2(vwidth, energy, e_coul); \ + if (tid==0) { \ + engv[ei]=energy*(acctyp)0.5; \ + ei+=ev_stride; \ + engv[ei]=e_coul*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (tid==0) { \ + for (int r=0; r<6; r++) { \ + engv[ei]=virial[r]*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + } \ + } \ + } else if (offset==0 && ii1) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - f.x += shfl_xor(f.x, s, t_per_atom); \ - f.y += shfl_xor(f.y, s, t_per_atom); \ - f.z += shfl_xor(f.z, s, t_per_atom); \ - tor.x += shfl_xor(tor.x, s, t_per_atom); \ - tor.y += shfl_xor(tor.y, s, t_per_atom); \ - tor.z += shfl_xor(tor.z, s, t_per_atom); \ - energy += shfl_xor(energy, s, t_per_atom); \ - e_coul += shfl_xor(e_coul, s, t_per_atom); \ - } \ - if (vflag>0) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - for (int r=0; r<6; r++) \ - virial[r] += shfl_xor(virial[r], s, t_per_atom); \ - } \ - } \ - } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]=energy*(acctyp)0.5; \ - ei+=inum; \ - engv[ei]=e_coul*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]=virial[i]*(acctyp)0.5; \ - ei+=inum; \ - } \ - } \ + if (t_per_atom>1) \ + simd_reduce_add6(t_per_atom, f.x, f.y, f.z, tor.x, tor.y, tor.z); \ + if (offset==0 && ii0) { + if (EVFLAG && eflag) { acctyp e = (acctyp)0.0; if (rsq < cut_coulsq && factor_coul > (numtyp)0.0) { e = qqrd2e*(b0*g0 + b1*g1 + b2*g2); @@ -368,7 +440,7 @@ __kernel void k_dipole_long_lj(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-lj3[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*force.x; virial[1] += dely*force.y; virial[2] += delz*force.z; @@ -379,9 +451,9 @@ __kernel void k_dipole_long_lj(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_tq(f,tor,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_tq(f,tor,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset, + eflag,vflag,ans,engv); } __kernel void k_dipole_long_lj_fast(const __global numtyp4 *restrict x_, @@ -406,26 +478,27 @@ __kernel void k_dipole_long_lj_fast(const __global numtyp4 *restrict x_, __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp cutsq[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; - acctyp4 f; + acctyp4 f, tor; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp4 tor; - tor.x=(acctyp)0; - tor.y=(acctyp)0; - tor.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + tor.x=(acctyp)0; tor.y=(acctyp)0; tor.z=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); @@ -436,7 +509,6 @@ __kernel void k_dipole_long_lj_fast(const __global numtyp4 *restrict x_, if (ii0) { + if (EVFLAG && eflag) { acctyp e = (acctyp)0.0; if (rsq < cut_coulsq && factor_coul > (numtyp)0.0) { e = qqrd2e*(b0*g0 + b1*g1 + b2*g2); @@ -622,7 +694,7 @@ __kernel void k_dipole_long_lj_fast(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-lj3[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*force.x; virial[1] += dely*force.y; virial[2] += delz*force.z; @@ -633,8 +705,7 @@ __kernel void k_dipole_long_lj_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_tq(f,tor,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_tq(f,tor,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset, + eflag,vflag,ans,engv); } - diff --git a/lib/gpu/lal_dipole_long_lj.h b/lib/gpu/lal_dipole_long_lj.h index 77e22a10a7..c8f37efd2b 100644 --- a/lib/gpu/lal_dipole_long_lj.h +++ b/lib/gpu/lal_dipole_long_lj.h @@ -77,7 +77,7 @@ class DipoleLongLJ : public BaseDipole { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_dipole_long_lj_ext.cpp b/lib/gpu/lal_dipole_long_lj_ext.cpp index b2751e8a82..fd61706ba9 100644 --- a/lib/gpu/lal_dipole_long_lj_ext.cpp +++ b/lib/gpu/lal_dipole_long_lj_ext.cpp @@ -58,7 +58,7 @@ int dplj_gpu_init(const int ntypes, double **cutsq, double **host_lj1, int init_ok=0; if (world_me==0) init_ok=DPLJMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, - host_lj4, offset, special_lj, inum, nall, 300, + host_lj4, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); @@ -77,7 +77,7 @@ int dplj_gpu_init(const int ntypes, double **cutsq, double **host_lj1, } if (gpu_rank==i && world_me!=0) init_ok=DPLJMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - offset, special_lj, inum, nall, 300, maxspecial, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); diff --git a/lib/gpu/lal_dpd.cpp b/lib/gpu/lal_dpd.cpp index c5cbc7eb53..f890fb53a3 100644 --- a/lib/gpu/lal_dpd.cpp +++ b/lib/gpu/lal_dpd.cpp @@ -52,15 +52,31 @@ int DPDT::init(const int ntypes, const int max_nbors, const int maxspecial, const double cell_size, const double gpu_split, FILE *_screen) { + const int max_shared_types=this->device->max_shared_types(); + + int onetype=0; + #ifdef USE_OPENCL + if (maxspecial==0) + for (int i=1; i0) { + if (onetype>0) + onetype=-1; + else if (onetype==0) + onetype=i*max_shared_types+j; + } + if (onetype<0) onetype=0; + #endif + int success; - success=this->init_atomic(nlocal,nall,max_nbors,maxspecial,cell_size,gpu_split,_screen,dpd,"k_dpd"); + success=this->init_atomic(nlocal,nall,max_nbors,maxspecial,cell_size, + gpu_split,_screen,dpd,"k_dpd",onetype); if (success!=0) return success; // If atom type constants fit in shared memory use fast kernel int lj_types=ntypes; shared_types=false; - int max_shared_types=this->device->max_shared_types(); if (lj_types<=max_shared_types && this->_block_size>=max_shared_types) { lj_types=max_shared_types; shared_types=true; @@ -117,20 +133,9 @@ double DPDT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void DPDT::loop(const bool _eflag, const bool _vflag) { +int DPDT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -138,8 +143,8 @@ void DPDT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &coeff, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &coeff, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->v, &cutsq, @@ -155,6 +160,7 @@ void DPDT::loop(const bool _eflag, const bool _vflag) { &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template diff --git a/lib/gpu/lal_dpd.cu b/lib/gpu/lal_dpd.cu index a29e04fc7f..2794110a92 100644 --- a/lib/gpu/lal_dpd.cu +++ b/lib/gpu/lal_dpd.cu @@ -179,16 +179,19 @@ __kernel void k_dpd(const __global numtyp4 *restrict x_, int tid, ii, offset; atom_info(t_per_atom,ii,tid,offset); - acctyp energy=(acctyp)0; + int n_stride; + local_allocate_store_pair(); + acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { // unshifted eng of conservative term: // evdwl = -a0[itype][jtype]*r * (1.0-0.5*r/cut[itype][jtype]); // eng shifted to 0.0 at cutoff numtyp e = (numtyp)0.5*coeff[mtype].x*coeff[mtype].w * wd*wd; energy+=factor_dpd*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -267,9 +270,9 @@ __kernel void k_dpd(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_dpd_fast(const __global numtyp4 *restrict x_, @@ -289,6 +292,7 @@ __kernel void k_dpd_fast(const __global numtyp4 *restrict x_, int tid, ii, offset; atom_info(t_per_atom,ii,tid,offset); + #ifndef ONETYPE __local numtyp4 coeff[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; if (tid<4) @@ -296,25 +300,36 @@ __kernel void k_dpd_fast(const __global numtyp4 *restrict x_, if (tid tag2) { @@ -359,24 +382,37 @@ __kernel void k_dpd_fast(const __global numtyp4 *restrict x_, // drag force = -gamma * wd^2 * (delx dot delv) / r // random force = sigma * wd * rnd * dtinvsqrt; + #ifndef ONETYPE + const numtyp coeffx=coeff[mtype].x; + const numtyp coeffy=coeff[mtype].y; + const numtyp coeffz=coeff[mtype].z; + #endif numtyp force = (numtyp)0.0; - if (!tstat_only) force = coeff[mtype].x*wd; - force -= coeff[mtype].y*wd*wd*dot*rinv; - force += coeff[mtype].z*wd*randnum*dtinvsqrt; + if (!tstat_only) force = coeffx*wd; + force -= coeffy*wd*wd*dot*rinv; + force += coeffz*wd*randnum*dtinvsqrt; + #ifndef ONETYPE force*=factor_dpd*rinv; + #else + force*=rinv; + #endif f.x+=delx*force; f.y+=dely*force; f.z+=delz*force; - if (eflag>0) { + if (EVFLAG && eflag) { // unshifted eng of conservative term: // evdwl = -a0[itype][jtype]*r * (1.0-0.5*r/cut[itype][jtype]); // eng shifted to 0.0 at cutoff - numtyp e = (numtyp)0.5*coeff[mtype].x*coeff[mtype].w * wd*wd; + numtyp e = (numtyp)0.5*coeffx*coeffw * wd*wd; + #ifndef ONETYPE energy+=factor_dpd*e; + #else + energy+=e; + #endif } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -387,8 +423,8 @@ __kernel void k_dpd_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } diff --git a/lib/gpu/lal_dpd.h b/lib/gpu/lal_dpd.h index 3c36c39e05..be93d988a3 100644 --- a/lib/gpu/lal_dpd.h +++ b/lib/gpu/lal_dpd.h @@ -78,7 +78,7 @@ class DPD : public BaseDPD { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_dpd_ext.cpp b/lib/gpu/lal_dpd_ext.cpp index d727a87319..7637ff03c0 100644 --- a/lib/gpu/lal_dpd_ext.cpp +++ b/lib/gpu/lal_dpd_ext.cpp @@ -55,7 +55,7 @@ int dpd_gpu_init(const int ntypes, double **cutsq, double **host_a0, int init_ok=0; if (world_me==0) init_ok=DPDMF.init(ntypes, cutsq, host_a0, host_gamma, host_sigma, - host_cut, special_lj, false, inum, nall, 300, + host_cut, special_lj, false, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); DPDMF.device->world_barrier(); @@ -73,7 +73,7 @@ int dpd_gpu_init(const int ntypes, double **cutsq, double **host_a0, } if (gpu_rank==i && world_me!=0) init_ok=DPDMF.init(ntypes, cutsq, host_a0, host_gamma, host_sigma, - host_cut, special_lj, false, inum, nall, 300, + host_cut, special_lj, false, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); DPDMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_eam.cpp b/lib/gpu/lal_eam.cpp index 03479cd16a..cdafe72898 100644 --- a/lib/gpu/lal_eam.cpp +++ b/lib/gpu/lal_eam.cpp @@ -52,9 +52,23 @@ int EAMT::init(const int ntypes, double host_cutforcesq, int **host_type2rhor, const int maxspecial, const double cell_size, const double gpu_split, FILE *_screen) { + int max_shared_types=this->device->max_shared_types(); + + int onetype=0; + #ifdef USE_OPENCL + for (int i=1; i=0 && host_type2frho[i]<=nfrho-1) { + if (onetype>0) + onetype=-1; + else if (onetype==0) + onetype=i*max_shared_types+i; + } + if (onetype<0) onetype=0; + #endif + int success; success=this->init_atomic(nlocal,nall,max_nbors,maxspecial,cell_size, - gpu_split,_screen,eam,"k_eam"); + gpu_split,_screen,eam,"k_eam",onetype); if (success!=0) return success; @@ -72,6 +86,13 @@ int EAMT::init(const int ntypes, double host_cutforcesq, int **host_type2rhor, k_energy_fast.set_function(*(this->pair_program),"k_energy_fast"); fp_tex.get_texture(*(this->pair_program),"fp_tex"); fp_tex.bind_float(_fp,1); + + #if defined(LAL_OCL_EV_JIT) + k_energy_fast_noev.set_function(*(this->pair_program_noev),"k_energy_fast"); + #else + k_energy_sel = &k_energy_fast; + #endif + _compiled_energy = true; // Initialize timers for selected GPU @@ -88,7 +109,6 @@ int EAMT::init(const int ntypes, double host_cutforcesq, int **host_type2rhor, int lj_types=ntypes; shared_types=false; - int max_shared_types=this->device->max_shared_types(); if (lj_types<=max_shared_types && this->_block_size>=max_shared_types) { lj_types=max_shared_types; shared_types=true; @@ -260,6 +280,9 @@ void EAMT::clear() { if (_compiled_energy) { k_energy_fast.clear(); k_energy.clear(); + #if defined(LAL_OCL_EV_JIT) + k_energy_fast_noev.clear(); + #endif _compiled_energy=false; } @@ -278,11 +301,18 @@ template void EAMT::compute(const int f_ago, const int inum_full, const int nlocal, const int nall, double **host_x, int *host_type, int *ilist, int *numj, int **firstneigh, - const bool eflag, const bool vflag, + const bool eflag_in, const bool vflag_in, const bool eatom, const bool vatom, int &host_start, const double cpu_time, bool &success, void **fp_ptr) { this->acc_timers(); + int eflag, vflag; + if (eflag_in) eflag=2; + else eflag=0; + if (vflag_in) vflag=2; + else vflag=0; + + this->set_kernel(eflag,vflag); if (this->device->time_device()) { // Put time from the second part to the total time_pair @@ -346,12 +376,20 @@ void EAMT::compute(const int f_ago, const int inum_full, const int nlocal, template int** EAMT::compute(const int ago, const int inum_full, const int nall, double **host_x, int *host_type, double *sublo, - double *subhi, tagint *tag, int **nspecial, tagint **special, - const bool eflag, const bool vflag, const bool eatom, + double *subhi, tagint *tag, int **nspecial, + tagint **special, const bool eflag_in, + const bool vflag_in, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, bool &success, int &inum, void **fp_ptr) { this->acc_timers(); + int eflag, vflag; + if (eflag_in) eflag=2; + else eflag=0; + if (vflag_in) vflag=2; + else vflag=0; + + this->set_kernel(eflag,vflag); if (this->device->time_device()) { // Put time from the second part to the total time_pair @@ -430,9 +468,9 @@ void EAMT::compute2(int *ilist, const bool eflag, const bool vflag, loop2(eflag,vflag); if (ilist == nullptr) - this->ans->copy_answers(eflag,vflag,eatom,vatom); + this->ans->copy_answers(eflag,vflag,eatom,vatom, this->ans->inum()); else - this->ans->copy_answers(eflag,vflag,eatom,vatom, ilist); + this->ans->copy_answers(eflag,vflag,eatom,vatom, ilist, this->ans->inum()); this->device->add_ans_object(this->ans); this->hd_balancer.stop_timer(); @@ -442,20 +480,9 @@ void EAMT::compute2(int *ilist, const bool eflag, const bool vflag, // Calculate per-atom energies and forces // --------------------------------------------------------------------------- template -void EAMT::loop(const bool _eflag, const bool _vflag) { +int EAMT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -464,13 +491,18 @@ void EAMT::loop(const bool _eflag, const bool _vflag) { this->time_pair.start(); if (shared_types) { - this->k_energy_fast.set_size(GX,BX); - this->k_energy_fast.run(&this->atom->x, &type2rhor_z2r, &type2frho, - &rhor_spline2, &frho_spline1,&frho_spline2, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &_fp, &this->ans->engv, &eflag, &ainum, - &nbor_pitch, &_ntypes, &_cutforcesq, &_rdr, &_rdrho, - &_rhomax, &_nrho, &_nr, &this->_threads_per_atom); + #if defined(LAL_OCL_EV_JIT) + if (eflag || vflag) k_energy_sel = &k_energy_fast; + else k_energy_sel = &k_energy_fast_noev; + #endif + + k_energy_sel->set_size(GX,BX); + k_energy_sel->run(&this->atom->x, &type2rhor_z2r, &type2frho, + &rhor_spline2, &frho_spline1,&frho_spline2, + &this->nbor->dev_nbor, &this->_nbor_data->begin(), + &_fp, &this->ans->engv, &eflag, &ainum, + &nbor_pitch, &_ntypes, &_cutforcesq, &_rdr, &_rdrho, + &_rhomax, &_nrho, &_nr, &this->_threads_per_atom); } else { this->k_energy.set_size(GX,BX); this->k_energy.run(&this->atom->x, &type2rhor_z2r, &type2frho, @@ -482,6 +514,7 @@ void EAMT::loop(const bool _eflag, const bool _vflag) { } this->time_pair.stop(); + return ainum; } // --------------------------------------------------------------------------- @@ -510,8 +543,8 @@ void EAMT::loop2(const bool _eflag, const bool _vflag) { this->time_pair2.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &_fp, &type2rhor_z2r, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &_fp, &type2rhor_z2r, &rhor_spline1, &z2r_spline1, &z2r_spline2, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, diff --git a/lib/gpu/lal_eam.cu b/lib/gpu/lal_eam.cu index b22ce7b575..3955f3cc8a 100644 --- a/lib/gpu/lal_eam.cu +++ b/lib/gpu/lal_eam.cu @@ -36,6 +36,16 @@ _texture( z2r_sp1_tex,int4); _texture( z2r_sp2_tex,int4); #endif +#if (__CUDACC_VER_MAJOR__ >= 11) +#define fp_tex fp_ +#define rhor_sp1_tex rhor_spline1 +#define rhor_sp2_tex rhor_spline2 +#define frho_sp1_tex frho_spline1 +#define frho_sp2_tex frho_spline2 +#define z2r_sp1_tex z2r_spline1 +#define z2r_sp2_tex z2r_spline2 +#endif + #else #define pos_tex x_ @@ -52,30 +62,33 @@ _texture( z2r_sp2_tex,int4); #define MIN(A,B) ((A) < (B) ? (A) : (B)) #define MAX(A,B) ((A) > (B) ? (A) : (B)) -#if (ARCH < 300) +#if (SHUFFLE_AVAIL == 0) + +#define local_allocate_store_energy_fp() \ + __local acctyp red_acc[BLOCK_PAIR]; #define store_energy_fp(rho,energy,ii,inum,tid,t_per_atom,offset, \ - eflag,vflag,engv,rdrho,nrho,i,rhomax) \ + eflag,vflag,engv,rdrho,nrho,i,rhomax,tfrho) \ if (t_per_atom>1) { \ - __local acctyp red_acc[BLOCK_PAIR]; \ red_acc[tid]=rho; \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + simdsync(); \ if (offset < s) \ red_acc[tid] += red_acc[tid+s]; \ } \ rho=red_acc[tid]; \ } \ - if (offset==0) { \ + if (offset==0 && ii0) { \ + if (EVFLAG && eflag) { \ fetch4(coeff,index,frho_sp2_tex); \ energy = ((coeff.x*p + coeff.y)*p + coeff.z)*p + coeff.w; \ if (rho > rhomax) energy += fp*(rho-rhomax); \ @@ -83,15 +96,18 @@ _texture( z2r_sp2_tex,int4); } \ } +#define local_allocate_store_answers_eam() \ + __local acctyp red_acc[6][BLOCK_PAIR]; + #define store_answers_eam(f, energy, virial, ii, inum, tid, t_per_atom, \ offset, elag, vflag, ans, engv) \ if (t_per_atom>1) { \ - __local acctyp red_acc[6][BLOCK_PAIR]; \ red_acc[0][tid]=f.x; \ red_acc[1][tid]=f.y; \ red_acc[2][tid]=f.z; \ red_acc[3][tid]=energy; \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + simdsync(); \ if (offset < s) { \ for (int r=0; r<4; r++) \ red_acc[r][tid] += red_acc[r][tid+s]; \ @@ -101,10 +117,12 @@ _texture( z2r_sp2_tex,int4); f.y=red_acc[1][tid]; \ f.z=red_acc[2][tid]; \ energy=red_acc[3][tid]; \ - if (vflag>0) { \ + if (EVFLAG && vflag) { \ + simdsync(); \ for (int r=0; r<6; r++) \ red_acc[r][tid]=virial[r]; \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + simdsync(); \ if (offset < s) { \ for (int r=0; r<6; r++) \ red_acc[r][tid] += red_acc[r][tid+s]; \ @@ -114,13 +132,13 @@ _texture( z2r_sp2_tex,int4); virial[r]=red_acc[r][tid]; \ } \ } \ - if (offset==0) { \ + if (offset==0 && ii0) { \ + if (EVFLAG && eflag) { \ engv[ei]+=energy*(acctyp)0.5; \ ei+=inum; \ } \ - if (vflag>0) { \ + if (EVFLAG && vflag) { \ for (int i=0; i<6; i++) { \ engv[ei]=virial[i]*(acctyp)0.5; \ ei+=inum; \ @@ -131,53 +149,57 @@ _texture( z2r_sp2_tex,int4); #else +#define local_allocate_store_energy_fp() + #define store_energy_fp(rho,energy,ii,inum,tid,t_per_atom,offset, \ - eflag,vflag,engv,rdrho,nrho,i,rhomax) \ + eflag,vflag,engv,rdrho,nrho,i,rhomax,tfrho) \ if (t_per_atom>1) { \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) \ - rho += shfl_xor(rho, s, t_per_atom); \ + rho += shfl_down(rho, s, t_per_atom); \ } \ - if (offset==0) { \ + if (offset==0 && ii0) { \ + if (EVFLAG && eflag) { \ fetch4(coeff,index,frho_sp2_tex); \ energy = ((coeff.x*p + coeff.y)*p + coeff.z)*p + coeff.w; \ if (rho > rhomax) energy += fp*(rho-rhomax); \ - engv[ii]=energy; \ + engv[ii]=energy; \ } \ } +#define local_allocate_store_answers_eam() + #define store_answers_eam(f, energy, virial, ii, inum, tid, t_per_atom, \ offset, eflag, vflag, ans, engv) \ if (t_per_atom>1) { \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - f.x += shfl_xor(f.x, s, t_per_atom); \ - f.y += shfl_xor(f.y, s, t_per_atom); \ - f.z += shfl_xor(f.z, s, t_per_atom); \ - energy += shfl_xor(energy, s, t_per_atom); \ + f.x += shfl_down(f.x, s, t_per_atom); \ + f.y += shfl_down(f.y, s, t_per_atom); \ + f.z += shfl_down(f.z, s, t_per_atom); \ + if (EVFLAG) energy += shfl_down(energy, s, t_per_atom); \ } \ - if (vflag>0) { \ + if (EVFLAG && vflag) { \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - for (int r=0; r<6; r++) \ - virial[r] += shfl_xor(virial[r], s, t_per_atom); \ + for (int r=0; r<6; r++) \ + virial[r] += shfl_down(virial[r], s, t_per_atom); \ } \ } \ } \ - if (offset==0) { \ + if (offset==0 && ii0) { \ + if (EVFLAG && eflag) { \ engv[ei]+=energy*(acctyp)0.5; \ ei+=inum; \ } \ - if (vflag>0) { \ + if (EVFLAG && vflag) { \ for (int i=0; i<6; i++) { \ engv[ei]=virial[i]*(acctyp)0.5; \ ei+=inum; \ @@ -203,21 +225,23 @@ __kernel void k_energy(const __global numtyp4 *restrict x_, const numtyp rdr, const numtyp rdrho, const numtyp rhomax, const int nrho, const int nr, const int t_per_atom) { - int tid, ii, offset; + int tid, ii, offset, i, itype; atom_info(t_per_atom,ii,tid,offset); + int n_stride; + local_allocate_store_energy_fp(); + acctyp rho = (acctyp)0; - acctyp energy = (acctyp)0; + acctyp energy; + if (EVFLAG && eflag) energy=(acctyp)0; if (ii0) { + if (EVFLAG && eflag) { energy += phi; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -431,10 +469,9 @@ __kernel void k_eam(const __global numtyp4 *restrict x_, } } } // for nbor - store_answers_eam(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii - + store_answers_eam(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_eam_fast(const __global numtyp4 *x_, @@ -453,40 +490,51 @@ __kernel void k_eam_fast(const __global numtyp4 *x_, int tid, ii, offset; atom_info(t_per_atom,ii,tid,offset); + #ifndef ONETYPE __local int2 type2rhor_z2r[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; - if (tid0) { + if (EVFLAG && eflag) { energy += phi; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -547,8 +610,8 @@ __kernel void k_eam_fast(const __global numtyp4 *x_, } } } // for nbor - store_answers_eam(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers_eam(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } diff --git a/lib/gpu/lal_eam.h b/lib/gpu/lal_eam.h index fa05075883..3cbaeac0b8 100644 --- a/lib/gpu/lal_eam.h +++ b/lib/gpu/lal_eam.h @@ -90,7 +90,7 @@ class EAM : public BaseAtomic { const bool eatom, const bool vatom); // ------------------------- DEVICE KERNELS ------------------------- - UCL_Kernel k_energy, k_energy_fast; + UCL_Kernel k_energy, k_energy_fast, k_energy_fast_noev, *k_energy_sel; // --------------------------- TEXTURES ----------------------------- UCL_Texture fp_tex; @@ -133,8 +133,8 @@ class EAM : public BaseAtomic { protected: bool _allocated; int _nlocal; - void loop(const bool _eflag, const bool _vflag); - void loop2(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); + void loop2(const bool eflag, const bool vflag); }; } diff --git a/lib/gpu/lal_eam_alloy_ext.cpp b/lib/gpu/lal_eam_alloy_ext.cpp index e5f1010e76..f7c4986e68 100644 --- a/lib/gpu/lal_eam_alloy_ext.cpp +++ b/lib/gpu/lal_eam_alloy_ext.cpp @@ -67,7 +67,7 @@ int eam_alloy_gpu_init(const int ntypes, double host_cutforcesq, init_ok=EAMALMF.init(ntypes, host_cutforcesq, host_type2rhor, host_type2z2r, host_type2frho, host_rhor_spline, host_z2r_spline, host_frho_spline, rdr, rdrho, rhomax, nrhor, nrho, nz2r, - nfrho, nr, nlocal, nall, 300, maxspecial, cell_size, + nfrho, nr, nlocal, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); EAMALMF.device->world_barrier(); @@ -87,7 +87,7 @@ int eam_alloy_gpu_init(const int ntypes, double host_cutforcesq, init_ok=EAMALMF.init(ntypes, host_cutforcesq, host_type2rhor, host_type2z2r, host_type2frho, host_rhor_spline, host_z2r_spline, host_frho_spline, rdr, rdrho, rhomax, nrhor, nrho, - nz2r, nfrho, nr, nlocal, nall, 300, maxspecial, + nz2r, nfrho, nr, nlocal, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); EAMALMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_eam_ext.cpp b/lib/gpu/lal_eam_ext.cpp index 78f2e3c1f8..3010e0ea7f 100644 --- a/lib/gpu/lal_eam_ext.cpp +++ b/lib/gpu/lal_eam_ext.cpp @@ -67,7 +67,7 @@ int eam_gpu_init(const int ntypes, double host_cutforcesq, init_ok=EAMMF.init(ntypes, host_cutforcesq, host_type2rhor, host_type2z2r, host_type2frho, host_rhor_spline, host_z2r_spline, host_frho_spline, rdr, rdrho, rhomax, nrhor, nrho, nz2r, - nfrho, nr, nlocal, nall, 300, maxspecial, cell_size, + nfrho, nr, nlocal, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); EAMMF.device->world_barrier(); @@ -87,7 +87,7 @@ int eam_gpu_init(const int ntypes, double host_cutforcesq, init_ok=EAMMF.init(ntypes, host_cutforcesq, host_type2rhor, host_type2z2r, host_type2frho, host_rhor_spline, host_z2r_spline, host_frho_spline, rdr, rdrho, rhomax, nrhor, nrho, - nz2r, nfrho, nr, nlocal, nall, 300, maxspecial, + nz2r, nfrho, nr, nlocal, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); EAMMF.device->gpu_barrier(); @@ -98,7 +98,7 @@ int eam_gpu_init(const int ntypes, double host_cutforcesq, fprintf(screen,"\n"); if (init_ok==0) - EAMMF.estimate_gpu_overhead(); + EAMMF.estimate_gpu_overhead(1); return init_ok; } diff --git a/lib/gpu/lal_eam_fs_ext.cpp b/lib/gpu/lal_eam_fs_ext.cpp index 37208e54f8..205b601562 100644 --- a/lib/gpu/lal_eam_fs_ext.cpp +++ b/lib/gpu/lal_eam_fs_ext.cpp @@ -67,7 +67,7 @@ int eam_fs_gpu_init(const int ntypes, double host_cutforcesq, init_ok=EAMFSMF.init(ntypes, host_cutforcesq, host_type2rhor, host_type2z2r, host_type2frho, host_rhor_spline, host_z2r_spline, host_frho_spline, rdr, rdrho, rhomax, nrhor, nrho, nz2r, - nfrho, nr, nlocal, nall, 300, maxspecial, cell_size, + nfrho, nr, nlocal, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); EAMFSMF.device->world_barrier(); @@ -87,7 +87,7 @@ int eam_fs_gpu_init(const int ntypes, double host_cutforcesq, init_ok=EAMFSMF.init(ntypes, host_cutforcesq, host_type2rhor, host_type2z2r, host_type2frho, host_rhor_spline, host_z2r_spline, host_frho_spline, rdr, rdrho, rhomax, nrhor, nrho, - nz2r, nfrho, nr, nlocal, nall, 300, maxspecial, + nz2r, nfrho, nr, nlocal, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); EAMFSMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_ellipsoid_extra.h b/lib/gpu/lal_ellipsoid_extra.h index e6122c7404..1c549ab6a6 100644 --- a/lib/gpu/lal_ellipsoid_extra.h +++ b/lib/gpu/lal_ellipsoid_extra.h @@ -32,22 +32,21 @@ _texture_2d( quat_tex,int4); #define quat_tex qif #endif -#define nbor_info_e(nbor_mem, nbor_stride, t_per_atom, ii, offset, \ - i, numj, stride, nbor_end, nbor_begin) \ - i=nbor_mem[ii]; \ - nbor_begin=ii+nbor_stride; \ - numj=nbor_mem[nbor_begin]; \ - nbor_begin+=nbor_stride; \ - nbor_end=nbor_begin+fast_mul(nbor_stride,numj); \ - nbor_begin+=fast_mul(offset,nbor_stride); \ - stride=fast_mul(t_per_atom,nbor_stride); +#define nbor_info_e_ss(nbor_mem, nbor_stride, t_per_atom, ii, offset, \ + i, numj, stride, nbor_end, nbor_begin) \ + i=nbor_mem[ii]; \ + nbor_begin=ii+nbor_stride; \ + numj=nbor_mem[nbor_begin]; \ + nbor_begin+=nbor_stride; \ + nbor_end=nbor_begin+fast_mul(nbor_stride,numj); \ + nbor_begin+=fast_mul(offset,nbor_stride); \ + stride=fast_mul(t_per_atom,nbor_stride); -#if (ARCH < 300) +#if (SHUFFLE_AVAIL == 0) #define store_answers_t(f, tor, energy, virial, ii, astride, tid, \ - t_per_atom, offset, eflag, vflag, ans, engv) \ + t_per_atom, offset, eflag, vflag, ans, engv, inum) \ if (t_per_atom>1) { \ - __local acctyp red_acc[7][BLOCK_PAIR]; \ red_acc[0][tid]=f.x; \ red_acc[1][tid]=f.y; \ red_acc[2][tid]=f.z; \ @@ -55,6 +54,7 @@ _texture_2d( quat_tex,int4); red_acc[4][tid]=tor.y; \ red_acc[5][tid]=tor.z; \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + simdsync(); \ if (offset < s) { \ for (int r=0; r<6; r++) \ red_acc[r][tid] += red_acc[r][tid+s]; \ @@ -66,28 +66,39 @@ _texture_2d( quat_tex,int4); tor.x=red_acc[3][tid]; \ tor.y=red_acc[4][tid]; \ tor.z=red_acc[5][tid]; \ - if (eflag>0 || vflag>0) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid]=virial[r]; \ - red_acc[6][tid]=energy; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<7; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ + if (EVFLAG && (eflag || vflag)) { \ + if (vflag) { \ + simdsync(); \ + for (int r=0; r<6; r++) \ + red_acc[r][tid]=virial[r]; \ + for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + simdsync(); \ + if (offset < s) { \ + for (int r=0; r<6; r++) \ + red_acc[r][tid] += red_acc[r][tid+s]; \ + } \ + } \ + for (int r=0; r<6; r++) \ + virial[r]=red_acc[r][tid]; \ + } \ + if (eflag) { \ + simdsync(); \ + red_acc[0][tid]=energy; \ + for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + simdsync(); \ + if (offset < s) red_acc[0][tid] += red_acc[0][tid+s]; \ } \ } \ - for (int r=0; r<6; r++) \ - virial[r]=red_acc[r][tid]; \ - energy=red_acc[6][tid]; \ + energy=red_acc[0][tid]; \ } \ } \ - if (offset==0) { \ + if (offset==0 && ii0) { \ + if (EVFLAG && eflag) { \ *ap1=energy*(acctyp)0.5; \ ap1+=astride; \ } \ - if (vflag>0) { \ + if (EVFLAG && vflag) { \ for (int i=0; i<6; i++) { \ *ap1=virial[i]*(acctyp)0.5; \ ap1+=astride; \ @@ -100,12 +111,12 @@ _texture_2d( quat_tex,int4); #define acc_answers(f, energy, virial, ii, inum, tid, t_per_atom, offset, \ eflag, vflag, ans, engv) \ if (t_per_atom>1) { \ - __local acctyp red_acc[6][BLOCK_PAIR]; \ red_acc[0][tid]=f.x; \ red_acc[1][tid]=f.y; \ red_acc[2][tid]=f.z; \ red_acc[3][tid]=energy; \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + simdsync(); \ if (offset < s) { \ for (int r=0; r<4; r++) \ red_acc[r][tid] += red_acc[r][tid+s]; \ @@ -115,10 +126,11 @@ _texture_2d( quat_tex,int4); f.y=red_acc[1][tid]; \ f.z=red_acc[2][tid]; \ energy=red_acc[3][tid]; \ - if (vflag>0) { \ + if (EVFLAG && vflag) { \ for (int r=0; r<6; r++) \ red_acc[r][tid]=virial[r]; \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + simdsync(); \ if (offset < s) { \ for (int r=0; r<6; r++) \ red_acc[r][tid] += red_acc[r][tid+s]; \ @@ -128,13 +140,13 @@ _texture_2d( quat_tex,int4); virial[r]=red_acc[r][tid]; \ } \ } \ - if (offset==0) { \ + if (offset==0 && ii0) { \ + if (EVFLAG && eflag) { \ *engv+=energy*(acctyp)0.5; \ engv+=inum; \ } \ - if (vflag>0) { \ + if (EVFLAG && vflag) { \ for (int i=0; i<6; i++) { \ *engv+=virial[i]*(acctyp)0.5; \ engv+=inum; \ @@ -150,31 +162,31 @@ _texture_2d( quat_tex,int4); #else #define store_answers_t(f, tor, energy, virial, ii, astride, tid, \ - t_per_atom, offset, eflag, vflag, ans, engv) \ + t_per_atom, offset, eflag, vflag, ans, engv, inum) \ if (t_per_atom>1) { \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - f.x += shfl_xor(f.x, s, t_per_atom); \ - f.y += shfl_xor(f.y, s, t_per_atom); \ - f.z += shfl_xor(f.z, s, t_per_atom); \ - tor.x += shfl_xor(tor.x, s, t_per_atom); \ - tor.y += shfl_xor(tor.y, s, t_per_atom); \ - tor.z += shfl_xor(tor.z, s, t_per_atom); \ - energy += shfl_xor(energy, s, t_per_atom); \ + f.x += shfl_down(f.x, s, t_per_atom); \ + f.y += shfl_down(f.y, s, t_per_atom); \ + f.z += shfl_down(f.z, s, t_per_atom); \ + tor.x += shfl_down(tor.x, s, t_per_atom); \ + tor.y += shfl_down(tor.y, s, t_per_atom); \ + tor.z += shfl_down(tor.z, s, t_per_atom); \ + if (EVFLAG) energy += shfl_down(energy, s, t_per_atom); \ } \ - if (vflag>0) { \ + if (EVFLAG && vflag) { \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - for (int r=0; r<6; r++) \ - virial[r] += shfl_xor(virial[r], s, t_per_atom); \ + for (int r=0; r<6; r++) \ + virial[r] += shfl_down(virial[r], s, t_per_atom); \ } \ } \ } \ - if (offset==0) { \ + if (offset==0 && ii0) { \ + if (EVFLAG && eflag) { \ *ap1=energy*(acctyp)0.5; \ ap1+=astride; \ } \ - if (vflag>0) { \ + if (EVFLAG && vflag) { \ for (int i=0; i<6; i++) { \ *ap1=virial[i]*(acctyp)0.5; \ ap1+=astride; \ @@ -188,25 +200,25 @@ _texture_2d( quat_tex,int4); eflag, vflag, ans, engv) \ if (t_per_atom>1) { \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - f.x += shfl_xor(f.x, s, t_per_atom); \ - f.y += shfl_xor(f.y, s, t_per_atom); \ - f.z += shfl_xor(f.z, s, t_per_atom); \ - energy += shfl_xor(energy, s, t_per_atom); \ + f.x += shfl_down(f.x, s, t_per_atom); \ + f.y += shfl_down(f.y, s, t_per_atom); \ + f.z += shfl_down(f.z, s, t_per_atom); \ + if (EVFLAG) energy += shfl_down(energy, s, t_per_atom); \ } \ - if (vflag>0) { \ + if (EVFLAG && vflag) { \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - for (int r=0; r<6; r++) \ - virial[r] += shfl_xor(virial[r], s, t_per_atom); \ + for (int r=0; r<6; r++) \ + virial[r] += shfl_down(virial[r], s, t_per_atom); \ } \ } \ } \ - if (offset==0) { \ + if (offset==0 && ii0) { \ + if (EVFLAG && eflag) { \ *engv+=energy*(acctyp)0.5; \ engv+=inum; \ } \ - if (vflag>0) { \ + if (EVFLAG && vflag) { \ for (int i=0; i<6; i++) { \ *engv+=virial[i]*(acctyp)0.5; \ engv+=inum; \ diff --git a/lib/gpu/lal_ellipsoid_nbor.cu b/lib/gpu/lal_ellipsoid_nbor.cu index 5ad935ba9b..9b9d03914c 100644 --- a/lib/gpu/lal_ellipsoid_nbor.cu +++ b/lib/gpu/lal_ellipsoid_nbor.cu @@ -34,7 +34,8 @@ __kernel void kernel_nbor(const __global numtyp4 *restrict x_, __global int *dev_nbor, const int nbor_pitch, const int start, const int inum, const __global int *dev_ij, - const int form_low, const int form_high) { + const int form_low, const int form_high, + const int t_per_atom) { // ii indexes the two interacting particles in gi int ii=GLOBAL_ID_X+start; @@ -45,12 +46,15 @@ __kernel void kernel_nbor(const __global numtyp4 *restrict x_, int numj=dev_ij[nbor]; nbor+=nbor_pitch; int nbor_end=nbor+fast_mul(numj,nbor_pitch); - int packed=ii+nbor_pitch+nbor_pitch; numtyp4 ix; fetch4(ix,i,pos_tex); //x_[i]; int iw=ix.w; int itype=fast_mul(iw,ntypes); int newj=0; + + __global int *out_list=dev_nbor+2*nbor_pitch+ii*t_per_atom; + const int out_stride=nbor_pitch*t_per_atom-t_per_atom; + for ( ; nbor -void GaussT::loop(const bool _eflag, const bool _vflag) { +int GaussT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -143,19 +132,20 @@ void GaussT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &gauss1, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &gauss1, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->_threads_per_atom); } else { this->k_pair.set_size(GX,BX); - this->k_pair.run(&this->atom->x, &gauss1, &_lj_types, &sp_lj, + this->k_pair.run(&this->atom->x, &gauss1, &_lj_types, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class Gauss; diff --git a/lib/gpu/lal_gauss.cu b/lib/gpu/lal_gauss.cu index 2192fb39ca..2540b8492f 100644 --- a/lib/gpu/lal_gauss.cu +++ b/lib/gpu/lal_gauss.cu @@ -27,7 +27,6 @@ _texture_2d( pos_tex,int4); __kernel void k_gauss(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict gauss1, const int lj_types, - const __global numtyp *restrict sp_lj_in, const __global int *dev_nbor, const __global int *dev_packed, __global acctyp4 *restrict ans, @@ -37,23 +36,20 @@ __kernel void k_gauss(const __global numtyp4 *restrict x_, int tid, ii, offset; atom_info(t_per_atom,ii,tid,offset); - __local numtyp sp_lj[4]; - sp_lj[0]=sp_lj_in[0]; - sp_lj[1]=sp_lj_in[1]; - sp_lj[2]=sp_lj_in[2]; - sp_lj[3]=sp_lj_in[3]; + int n_stride; + local_allocate_store_pair(); - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e=-(gauss1[mtype].x*ucl_exp(-gauss1[mtype].y*rsq) - gauss1[mtype].w); energy+=e; //factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -101,14 +97,13 @@ __kernel void k_gauss(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_gauss_fast(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict gauss1_in, - const __global numtyp *restrict sp_lj_in, const __global int *dev_nbor, const __global int *dev_packed, __global acctyp4 *restrict ans, @@ -119,26 +114,26 @@ __kernel void k_gauss_fast(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp4 gauss1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; - __local numtyp sp_lj[4]; - if (tid<4) - sp_lj[tid]=sp_lj_in[tid]; + int n_stride; + local_allocate_store_pair(); + if (tid0) { + if (EVFLAG && eflag) { numtyp e=-(gauss1[mtype].x*ucl_exp(-gauss1[mtype].y*rsq) - gauss1[mtype].w); energy+=e; //factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -186,8 +181,8 @@ __kernel void k_gauss_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } diff --git a/lib/gpu/lal_gauss.h b/lib/gpu/lal_gauss.h index 1399b82d03..ecb04c49b2 100644 --- a/lib/gpu/lal_gauss.h +++ b/lib/gpu/lal_gauss.h @@ -73,7 +73,7 @@ class Gauss : public BaseAtomic { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_gauss_ext.cpp b/lib/gpu/lal_gauss_ext.cpp index a2804ce3cf..afec2e86f2 100644 --- a/lib/gpu/lal_gauss_ext.cpp +++ b/lib/gpu/lal_gauss_ext.cpp @@ -55,7 +55,7 @@ int gauss_gpu_init(const int ntypes, double **cutsq, double **host_a, int init_ok=0; if (world_me==0) init_ok=GLMF.init(ntypes, cutsq, host_a, host_b, - offset, special_lj, inum, nall, 300, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); GLMF.device->world_barrier(); @@ -73,7 +73,7 @@ int gauss_gpu_init(const int ntypes, double **cutsq, double **host_a, } if (gpu_rank==i && world_me!=0) init_ok=GLMF.init(ntypes, cutsq, host_a, host_b, - offset, special_lj, inum, nall, 300, maxspecial, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); GLMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_gayberne.cpp b/lib/gpu/lal_gayberne.cpp index f17fc50f5f..2b1a190e5a 100644 --- a/lib/gpu/lal_gayberne.cpp +++ b/lib/gpu/lal_gayberne.cpp @@ -127,7 +127,7 @@ int GayBerneT::init(const int ntypes, const double gamma, host_write[i*4+2]=host_shape[i][2]; } UCL_H_Vec view4; - view4.view((numtyp4*)host_write.begin(),shape.numel(),*(this->ucl_device)); + view4.view(host_write,shape.numel()); ucl_copy(shape,view4,false); well.alloc(ntypes,*(this->ucl_device),UCL_READ_ONLY); @@ -136,7 +136,7 @@ int GayBerneT::init(const int ntypes, const double gamma, host_write[i*4+1]=host_well[i][1]; host_write[i*4+2]=host_well[i][2]; } - view4.view((numtyp4*)host_write.begin(),well.numel(),*(this->ucl_device)); + view4.view(host_write,well.numel()); ucl_copy(well,view4,false); _allocated=true; @@ -184,19 +184,8 @@ double GayBerneT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void GayBerneT::loop(const bool _eflag, const bool _vflag) { +int GayBerneT::loop(const int eflag, const int vflag) { const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=0, NGX; int stride=this->nbor->nbor_pitch(); int ainum=this->ans->inum(); @@ -213,8 +202,8 @@ void GayBerneT::loop(const bool _eflag, const bool _vflag) { this->time_nbor1.stop(); this->time_ellipsoid.start(); - this->k_ellipsoid.set_size(GX,BX); - this->k_ellipsoid.run(&this->atom->x, &this->atom->quat, + this->k_elps_sel->set_size(GX,BX); + this->k_elps_sel->run(&this->atom->x, &this->atom->quat, &this->shape, &this->well, &this->gamma_upsilon_mu, &this->sigma_epsilon, &this->_lj_types, &this->lshape, &this->nbor->dev_nbor, &stride, @@ -230,7 +219,7 @@ void GayBerneT::loop(const bool _eflag, const bool _vflag) { this->time_ellipsoid2.stop(); this->time_lj.start(); this->time_lj.stop(); - return; + return ainum; } // ------------ SPHERE_ELLIPSE --------------- @@ -246,8 +235,8 @@ void GayBerneT::loop(const bool _eflag, const bool _vflag) { this->time_nbor2.stop(); this->time_ellipsoid2.start(); - this->k_sphere_ellipsoid.set_size(GX,BX); - this->k_sphere_ellipsoid.run(&this->atom->x, &this->atom->quat, + this->k_sphere_elps_sel->set_size(GX,BX); + this->k_sphere_elps_sel->run(&this->atom->x, &this->atom->quat, &this->shape, &this->well, &this->gamma_upsilon_mu, &this->sigma_epsilon, &this->_lj_types, @@ -276,8 +265,8 @@ void GayBerneT::loop(const bool _eflag, const bool _vflag) { this->time_lj.start(); if (this->_last_ellipseans->inum()) { if (this->_shared_types) { - this->k_lj_fast.set_size(GX,BX); - this->k_lj_fast.run(&this->atom->x, &this->lj1, &this->lj3, + this->k_lj_sel->set_size(GX,BX); + this->k_lj_sel->run(&this->atom->x, &this->lj1, &this->lj3, &this->gamma_upsilon_mu, &stride, &this->nbor->dev_packed, &this->ans->force, &this->ans->engv, &this->dev_error, &eflag, @@ -303,8 +292,8 @@ void GayBerneT::loop(const bool _eflag, const bool _vflag) { ELLIPSE_ELLIPSE,_shared_types,_lj_types); this->time_nbor1.stop(); this->time_ellipsoid.start(); - this->k_ellipsoid.set_size(GX,BX); - this->k_ellipsoid.run(&this->atom->x, &this->atom->quat, + this->k_elps_sel->set_size(GX,BX); + this->k_elps_sel->run(&this->atom->x, &this->atom->quat, &this->shape, &this->well, &this->gamma_upsilon_mu, &this->sigma_epsilon, &this->_lj_types, &this->lshape, &this->nbor->dev_nbor, &stride, &this->ans->force, @@ -312,6 +301,7 @@ void GayBerneT::loop(const bool _eflag, const bool _vflag) { &eflag, &vflag, &ainum, &this->_threads_per_atom); this->time_ellipsoid.stop(); } + return ainum; } template class GayBerne; diff --git a/lib/gpu/lal_gayberne.cu b/lib/gpu/lal_gayberne.cu index c9d0353ca8..9267dfd85d 100644 --- a/lib/gpu/lal_gayberne.cu +++ b/lib/gpu/lal_gayberne.cu @@ -100,29 +100,27 @@ __kernel void k_gayberne(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_ellipse(); + sp_lj[0]=gum[3]; sp_lj[1]=gum[4]; sp_lj[2]=gum[5]; sp_lj[3]=gum[6]; - acctyp energy=(acctyp)0; - acctyp4 f; - f.x=(acctyp)0; - f.y=(acctyp)0; - f.z=(acctyp)0; - acctyp4 tor; - tor.x=(acctyp)0; - tor.y=(acctyp)0; - tor.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp4 f, tor; + f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; + tor.x=(acctyp)0; tor.y=(acctyp)0; tor.z=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) + if (EVFLAG && eflag) energy+=u_r*temp2; numtyp temp1 = -eta*u_r*factor_lj; - if (vflag>0) { + if (EVFLAG && vflag) { r12[0]*=-r; r12[1]*=-r; r12[2]*=-r; @@ -356,8 +354,8 @@ __kernel void k_gayberne(const __global numtyp4 *restrict x_, tor.z+=temp1*tchi[2]+temp2*teta[2]+temp3*tUr[2]; } // for nbor - store_answers_t(f,tor,energy,virial,ii,astride,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_t(f,tor,energy,virial,ii,astride,tid,t_per_atom,offset,eflag, + vflag,ans,engv,inum); } diff --git a/lib/gpu/lal_gayberne.h b/lib/gpu/lal_gayberne.h index 750c739cec..5cdc6bcd67 100644 --- a/lib/gpu/lal_gayberne.h +++ b/lib/gpu/lal_gayberne.h @@ -86,7 +86,7 @@ class GayBerne : public BaseEllipsoid { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_gayberne_lj.cu b/lib/gpu/lal_gayberne_lj.cu index fdf40720aa..4582f0d411 100644 --- a/lib/gpu/lal_gayberne_lj.cu +++ b/lib/gpu/lal_gayberne_lj.cu @@ -17,6 +17,13 @@ #include "lal_ellipsoid_extra.h" #endif +#if (SHUFFLE_AVAIL == 0) +#define local_allocate_store_ellipse_lj local_allocate_store_ellipse +#else +#define local_allocate_store_ellipse_lj() \ + __local acctyp red_acc[7][BLOCK_ELLIPSE / SIMD_SIZE]; +#endif + __kernel void k_gayberne_sphere_ellipsoid(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict q, const __global numtyp4 *restrict shape, @@ -38,25 +45,26 @@ __kernel void k_gayberne_sphere_ellipsoid(const __global numtyp4 *restrict x_, ii+=start; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_ellipse_lj(); + sp_lj[0]=gum[3]; sp_lj[1]=gum[4]; sp_lj[2]=gum[5]; sp_lj[3]=gum[6]; - acctyp energy=(acctyp)0; acctyp4 f; - f.x=(acctyp)0; - f.y=(acctyp)0; - f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) + if (EVFLAG && eflag) energy+=u_r*temp2; numtyp temp1 = -eta*u_r*factor_lj; - if (vflag>0) { + if (EVFLAG && vflag) { r12[0]*=-1; r12[1]*=-1; r12[2]*=-1; @@ -239,9 +247,9 @@ __kernel void k_gayberne_sphere_ellipsoid(const __global numtyp4 *restrict x_, f.z+=temp1*dchi[2]-temp2*dUr[2]; } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_gayberne_lj(const __global numtyp4 *restrict x_, @@ -261,26 +269,27 @@ __kernel void k_gayberne_lj(const __global numtyp4 *restrict x_, ii+=start; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_ellipse(); + sp_lj[0]=gum[3]; sp_lj[1]=gum[4]; sp_lj[2]=gum[5]; sp_lj[3]=gum[6]; - acctyp energy=(acctyp)0; acctyp4 f; - f.x=(acctyp)0; - f.y=(acctyp)0; - f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e=r6inv*(lj3[ii].x*r6inv-lj3[ii].y); energy+=factor_lj*(e-lj3[ii].z); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -327,9 +336,9 @@ __kernel void k_gayberne_lj(const __global numtyp4 *restrict x_, } } // for nbor - acc_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + acc_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_gayberne_lj_fast(const __global numtyp4 *restrict x_, @@ -351,31 +360,32 @@ __kernel void k_gayberne_lj_fast(const __global numtyp4 *restrict x_, __local numtyp sp_lj[4]; __local numtyp4 lj1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; + int n_stride; + local_allocate_store_ellipse(); + if (tid<4) sp_lj[tid]=gum[tid+3]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } - acctyp energy=(acctyp)0; acctyp4 f; - f.x=(acctyp)0; - f.y=(acctyp)0; - f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { numtyp e=r6inv*(lj3[mtype].x*r6inv-lj3[mtype].y); energy+=factor_lj*(e-lj3[mtype].z); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -421,8 +431,8 @@ __kernel void k_gayberne_lj_fast(const __global numtyp4 *restrict x_, } } // for nbor - acc_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + acc_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } diff --git a/lib/gpu/lal_lj.cpp b/lib/gpu/lal_lj.cpp index 5bd015e364..40fefe28b3 100644 --- a/lib/gpu/lal_lj.cpp +++ b/lib/gpu/lal_lj.cpp @@ -51,16 +51,31 @@ int LJT::init(const int ntypes, const int nall, const int max_nbors, const int maxspecial, const double cell_size, const double gpu_split, FILE *_screen) { + const int max_shared_types=this->device->max_shared_types(); + + int onetype=0; + #ifdef USE_OPENCL + if (maxspecial==0) + for (int i=1; i0) { + if (onetype>0) + onetype=-1; + else if (onetype==0) + onetype=i*max_shared_types+j; + } + if (onetype<0) onetype=0; + #endif + int success; - success=this->init_atomic(nlocal,nall,max_nbors,maxspecial,cell_size,gpu_split, - _screen,lj,"k_lj"); + success=this->init_atomic(nlocal,nall,max_nbors,maxspecial,cell_size, + gpu_split,_screen,lj,"k_lj",onetype); if (success!=0) return success; // If atom type constants fit in shared memory use fast kernel int lj_types=ntypes; shared_types=false; - int max_shared_types=this->device->max_shared_types(); if (lj_types<=max_shared_types && this->_block_size>=max_shared_types) { lj_types=max_shared_types; shared_types=true; @@ -130,20 +145,9 @@ double LJT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void LJT::loop(const bool _eflag, const bool _vflag) { +int LJT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -151,8 +155,8 @@ void LJT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, @@ -165,6 +169,7 @@ void LJT::loop(const bool _eflag, const bool _vflag) { &ainum, &nbor_pitch, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class LJ; diff --git a/lib/gpu/lal_lj.cu b/lib/gpu/lal_lj.cu index 7297a287e6..382cd140d9 100644 --- a/lib/gpu/lal_lj.cu +++ b/lib/gpu/lal_lj.cu @@ -38,16 +38,19 @@ __kernel void k_lj(const __global numtyp4 *restrict x_, int tid, ii, offset; atom_info(t_per_atom,ii,tid,offset); - acctyp energy=(acctyp)0; + int n_stride; + local_allocate_store_pair(); + acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e=r6inv*(lj3[mtype].x*r6inv-lj3[mtype].y); energy+=factor_lj*(e-lj3[mtype].z); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -96,9 +99,9 @@ __kernel void k_lj(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_lj_fast(const __global numtyp4 *restrict x_, @@ -114,6 +117,7 @@ __kernel void k_lj_fast(const __global numtyp4 *restrict x_, int tid, ii, offset; atom_info(t_per_atom,ii,tid,offset); + #ifndef ONETYPE __local numtyp4 lj1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; @@ -121,38 +125,58 @@ __kernel void k_lj_fast(const __global numtyp4 *restrict x_, sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } + __syncthreads(); + #else + const numtyp lj1x=lj1_in[ONETYPE].x; + const numtyp lj1y=lj1_in[ONETYPE].y; + const numtyp cutsq=lj1_in[ONETYPE].z; + numtyp lj3x, lj3y, lj3z; + if (EVFLAG && eflag) { + lj3x=lj3_in[ONETYPE].x; + lj3y=lj3_in[ONETYPE].y; + lj3z=lj3_in[ONETYPE].z; + } + #endif + + int n_stride; + local_allocate_store_pair(); - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; - - __syncthreads(); + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { - numtyp e=r6inv*(lj3[mtype].x*r6inv-lj3[mtype].y); - energy+=factor_lj*(e-lj3[mtype].z); + if (EVFLAG && eflag) { + #ifndef ONETYPE + numtyp lj3x=lj3[mtype].x; + numtyp lj3y=lj3[mtype].y; + numtyp lj3z=lj3[mtype].z; + #endif + numtyp e=r6inv*(lj3x*r6inv-lj3y); + #ifndef ONETYPE + energy+=factor_lj*(e-lj3z); + #else + energy+=(e-lj3z); + #endif } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -182,10 +223,9 @@ __kernel void k_lj_fast(const __global numtyp4 *restrict x_, virial[5] += dely*delz*force; } } - } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } diff --git a/lib/gpu/lal_lj.h b/lib/gpu/lal_lj.h index c6fec0d159..cdf850efd7 100644 --- a/lib/gpu/lal_lj.h +++ b/lib/gpu/lal_lj.h @@ -76,7 +76,7 @@ class LJ : public BaseAtomic { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_lj96.cpp b/lib/gpu/lal_lj96.cpp index 6f74cd0f19..df7dc11558 100644 --- a/lib/gpu/lal_lj96.cpp +++ b/lib/gpu/lal_lj96.cpp @@ -113,20 +113,9 @@ double LJ96T::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void LJ96T::loop(const bool _eflag, const bool _vflag) { +int LJ96T::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -134,8 +123,8 @@ void LJ96T::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, @@ -149,6 +138,7 @@ void LJ96T::loop(const bool _eflag, const bool _vflag) { &nbor_pitch, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class LJ96; diff --git a/lib/gpu/lal_lj96.cu b/lib/gpu/lal_lj96.cu index c602e7555e..d1f7e3791f 100644 --- a/lib/gpu/lal_lj96.cu +++ b/lib/gpu/lal_lj96.cu @@ -39,22 +39,25 @@ __kernel void k_lj96(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e=r6inv*(lj3[mtype].x*r3inv-lj3[mtype].y); energy+=factor_lj*(e-lj3[mtype].z); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -104,9 +107,9 @@ __kernel void k_lj96(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_lj96_fast(const __global numtyp4 *restrict x_, @@ -125,27 +128,30 @@ __kernel void k_lj96_fast(const __global numtyp4 *restrict x_, __local numtyp4 lj1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { numtyp e=r6inv*(lj3[mtype].x*r3inv-lj3[mtype].y); energy+=factor_lj*(e-lj3[mtype].z); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -195,8 +201,8 @@ __kernel void k_lj96_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } diff --git a/lib/gpu/lal_lj96.h b/lib/gpu/lal_lj96.h index eef6863f37..535e32a580 100644 --- a/lib/gpu/lal_lj96.h +++ b/lib/gpu/lal_lj96.h @@ -71,7 +71,7 @@ class LJ96 : public BaseAtomic { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_lj96_ext.cpp b/lib/gpu/lal_lj96_ext.cpp index f68b35de57..be7ffc5a09 100644 --- a/lib/gpu/lal_lj96_ext.cpp +++ b/lib/gpu/lal_lj96_ext.cpp @@ -55,7 +55,7 @@ int lj96_gpu_init(const int ntypes, double **cutsq, double **host_lj1, int init_ok=0; if (world_me==0) init_ok=LJ96MF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, - host_lj4, offset, special_lj, inum, nall, 300, + host_lj4, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); LJ96MF.device->world_barrier(); @@ -73,7 +73,7 @@ int lj96_gpu_init(const int ntypes, double **cutsq, double **host_lj1, } if (gpu_rank==i && world_me!=0) init_ok=LJ96MF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - offset, special_lj, inum, nall, 300, maxspecial, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); LJ96MF.device->gpu_barrier(); diff --git a/lib/gpu/lal_lj_class2_long.cpp b/lib/gpu/lal_lj_class2_long.cpp index 24b07212ed..31e03a2a82 100644 --- a/lib/gpu/lal_lj_class2_long.cpp +++ b/lib/gpu/lal_lj_class2_long.cpp @@ -123,20 +123,9 @@ double LJClass2LongT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void LJClass2LongT::loop(const bool _eflag, const bool _vflag) { +int LJClass2LongT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -144,8 +133,8 @@ void LJClass2LongT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->q, @@ -161,6 +150,7 @@ void LJClass2LongT::loop(const bool _eflag, const bool _vflag) { &_qqrd2e, &_g_ewald, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class LJClass2Long; diff --git a/lib/gpu/lal_lj_class2_long.cu b/lib/gpu/lal_lj_class2_long.cu index 65f0bf993c..5c8a2d46b2 100644 --- a/lib/gpu/lal_lj_class2_long.cu +++ b/lib/gpu/lal_lj_class2_long.cu @@ -47,6 +47,9 @@ __kernel void k_lj_class2_long(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; @@ -56,18 +59,18 @@ __kernel void k_lj_class2_long(const __global numtyp4 *restrict x_, sp_lj[6]=sp_lj_in[6]; sp_lj[7]=sp_lj_in[7]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) e_coul += prefactor*(_erfc-factor_coul); if (rsq < lj1[mtype].w) { @@ -131,7 +134,7 @@ __kernel void k_lj_class2_long(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-lj3[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -142,9 +145,9 @@ __kernel void k_lj_class2_long(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_lj_class2_long_fast(const __global numtyp4 *restrict x_, @@ -168,28 +171,31 @@ __kernel void k_lj_class2_long_fast(const __global numtyp4 *restrict x_, __local numtyp4 lj1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) e_coul += prefactor*(_erfc-factor_coul); if (rsq < lj1[mtype].w) { @@ -253,7 +259,7 @@ __kernel void k_lj_class2_long_fast(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-lj3[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -264,8 +270,8 @@ __kernel void k_lj_class2_long_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } diff --git a/lib/gpu/lal_lj_class2_long.h b/lib/gpu/lal_lj_class2_long.h index eac6451b2e..84e07bf7cd 100644 --- a/lib/gpu/lal_lj_class2_long.h +++ b/lib/gpu/lal_lj_class2_long.h @@ -75,7 +75,7 @@ class LJClass2Long : public BaseCharge { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_lj_class2_long_ext.cpp b/lib/gpu/lal_lj_class2_long_ext.cpp index f669a81189..311b027536 100644 --- a/lib/gpu/lal_lj_class2_long_ext.cpp +++ b/lib/gpu/lal_lj_class2_long_ext.cpp @@ -58,7 +58,7 @@ int c2cl_gpu_init(const int ntypes, double **cutsq, double **host_lj1, int init_ok=0; if (world_me==0) init_ok=C2CLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - offset, special_lj, inum, nall, 300, maxspecial, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); @@ -77,7 +77,7 @@ int c2cl_gpu_init(const int ntypes, double **cutsq, double **host_lj1, } if (gpu_rank==i && world_me!=0) init_ok=C2CLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - offset, special_lj, inum, nall, 300, maxspecial, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); diff --git a/lib/gpu/lal_lj_coul.cpp b/lib/gpu/lal_lj_coul.cpp index 59ce9c5e61..cd8a411a79 100644 --- a/lib/gpu/lal_lj_coul.cpp +++ b/lib/gpu/lal_lj_coul.cpp @@ -125,20 +125,9 @@ double LJCoulT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void LJCoulT::loop(const bool _eflag, const bool _vflag) { +int LJCoulT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -146,8 +135,8 @@ void LJCoulT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->q, @@ -161,6 +150,7 @@ void LJCoulT::loop(const bool _eflag, const bool _vflag) { &cutsq, &_qqrd2e, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class LJCoul; diff --git a/lib/gpu/lal_lj_coul.cu b/lib/gpu/lal_lj_coul.cu index afbb972942..c728967bc5 100644 --- a/lib/gpu/lal_lj_coul.cu +++ b/lib/gpu/lal_lj_coul.cu @@ -47,6 +47,9 @@ __kernel void k_lj_coul(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; @@ -56,18 +59,18 @@ __kernel void k_lj_coul(const __global numtyp4 *restrict x_, sp_lj[6]=sp_lj_in[6]; sp_lj[7]=sp_lj_in[7]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { e_coul += forcecoul; if (rsq < lj1[mtype].z) { numtyp e=r6inv*(lj3[mtype].x*r6inv-lj3[mtype].y); energy+=factor_lj*(e-lj3[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -133,9 +136,9 @@ __kernel void k_lj_coul(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_lj_coul_fast(const __global numtyp4 *restrict x_, @@ -158,29 +161,32 @@ __kernel void k_lj_coul_fast(const __global numtyp4 *restrict x_, __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp cutsq[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { e_coul += forcecoul; if (rsq < lj1[mtype].z) { numtyp e=r6inv*(lj3[mtype].x*r6inv-lj3[mtype].y); energy+=factor_lj*(e-lj3[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -246,8 +252,8 @@ __kernel void k_lj_coul_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } diff --git a/lib/gpu/lal_lj_coul.h b/lib/gpu/lal_lj_coul.h index 0e11162aa5..eb490d5820 100644 --- a/lib/gpu/lal_lj_coul.h +++ b/lib/gpu/lal_lj_coul.h @@ -77,7 +77,7 @@ class LJCoul : public BaseCharge { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_lj_coul_debye.cpp b/lib/gpu/lal_lj_coul_debye.cpp index 556a0a5cd3..78ef1bf3f7 100644 --- a/lib/gpu/lal_lj_coul_debye.cpp +++ b/lib/gpu/lal_lj_coul_debye.cpp @@ -127,20 +127,9 @@ double LJCoulDebyeT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void LJCoulDebyeT::loop(const bool _eflag, const bool _vflag) { +int LJCoulDebyeT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -148,8 +137,8 @@ void LJCoulDebyeT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->q, &cutsq, @@ -163,6 +152,7 @@ void LJCoulDebyeT::loop(const bool _eflag, const bool _vflag) { &_qqrd2e, &_kappa, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class LJCoulDebye; diff --git a/lib/gpu/lal_lj_coul_debye.cu b/lib/gpu/lal_lj_coul_debye.cu index 053fbeccc8..1804625649 100644 --- a/lib/gpu/lal_lj_coul_debye.cu +++ b/lib/gpu/lal_lj_coul_debye.cu @@ -48,6 +48,9 @@ __kernel void k_lj_debye(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; @@ -57,18 +60,18 @@ __kernel void k_lj_debye(const __global numtyp4 *restrict x_, sp_lj[6]=sp_lj_in[6]; sp_lj[7]=sp_lj_in[7]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { if (rsq < lj1[mtype].z) { numtyp e=r6inv*(lj3[mtype].x*r6inv-lj3[mtype].y); energy+=factor_lj*(e-lj3[mtype].z); @@ -129,7 +132,7 @@ __kernel void k_lj_debye(const __global numtyp4 *restrict x_, e_coul+=qqrd2e*qtmp*rinv*screening*factor_coul; } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -140,9 +143,9 @@ __kernel void k_lj_debye(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_lj_debye_fast(const __global numtyp4 *restrict x_, @@ -166,29 +169,32 @@ __kernel void k_lj_debye_fast(const __global numtyp4 *restrict x_, __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp cutsq[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { if (rsq < lj1[mtype].z) { numtyp e=r6inv*(lj3[mtype].x*r6inv-lj3[mtype].y); energy+=factor_lj*(e-lj3[mtype].z); @@ -249,7 +255,7 @@ __kernel void k_lj_debye_fast(const __global numtyp4 *restrict x_, e_coul+=qqrd2e*qtmp*rinv*screening*factor_coul; } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -260,8 +266,8 @@ __kernel void k_lj_debye_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } diff --git a/lib/gpu/lal_lj_coul_debye.h b/lib/gpu/lal_lj_coul_debye.h index 22fcf7234b..19abf32169 100644 --- a/lib/gpu/lal_lj_coul_debye.h +++ b/lib/gpu/lal_lj_coul_debye.h @@ -77,7 +77,7 @@ class LJCoulDebye : public BaseCharge { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_lj_coul_debye_ext.cpp b/lib/gpu/lal_lj_coul_debye_ext.cpp index 95588eb95a..4f81b01457 100644 --- a/lib/gpu/lal_lj_coul_debye_ext.cpp +++ b/lib/gpu/lal_lj_coul_debye_ext.cpp @@ -58,7 +58,7 @@ int ljcd_gpu_init(const int ntypes, double **cutsq, double **host_lj1, int init_ok=0; if (world_me==0) init_ok=LJCDMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, - host_lj4, offset, special_lj, inum, nall, 300, + host_lj4, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, kappa); @@ -77,7 +77,7 @@ int ljcd_gpu_init(const int ntypes, double **cutsq, double **host_lj1, } if (gpu_rank==i && world_me!=0) init_ok=LJCDMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - offset, special_lj, inum, nall, 300, maxspecial, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, kappa); diff --git a/lib/gpu/lal_lj_coul_ext.cpp b/lib/gpu/lal_lj_coul_ext.cpp index 060088a7cb..5b7f97e630 100644 --- a/lib/gpu/lal_lj_coul_ext.cpp +++ b/lib/gpu/lal_lj_coul_ext.cpp @@ -57,7 +57,7 @@ int ljc_gpu_init(const int ntypes, double **cutsq, double **host_lj1, int init_ok=0; if (world_me==0) init_ok=LJCMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, - host_lj4, offset, special_lj, inum, nall, 300, + host_lj4, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e); @@ -76,7 +76,7 @@ int ljc_gpu_init(const int ntypes, double **cutsq, double **host_lj1, } if (gpu_rank==i && world_me!=0) init_ok=LJCMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - offset, special_lj, inum, nall, 300, maxspecial, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e); diff --git a/lib/gpu/lal_lj_coul_long.cpp b/lib/gpu/lal_lj_coul_long.cpp index 66897a4aa7..e6be361abb 100644 --- a/lib/gpu/lal_lj_coul_long.cpp +++ b/lib/gpu/lal_lj_coul_long.cpp @@ -140,20 +140,9 @@ double LJCoulLongT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void LJCoulLongT::loop(const bool _eflag, const bool _vflag) { +int LJCoulLongT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -161,8 +150,8 @@ void LJCoulLongT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->q, @@ -178,6 +167,7 @@ void LJCoulLongT::loop(const bool _eflag, const bool _vflag) { &_qqrd2e, &_g_ewald, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class LJCoulLong; diff --git a/lib/gpu/lal_lj_coul_long.cu b/lib/gpu/lal_lj_coul_long.cu index ac3479421f..85af3c3433 100644 --- a/lib/gpu/lal_lj_coul_long.cu +++ b/lib/gpu/lal_lj_coul_long.cu @@ -47,6 +47,9 @@ __kernel void k_lj_coul_long(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; @@ -56,18 +59,18 @@ __kernel void k_lj_coul_long(const __global numtyp4 *restrict x_, sp_lj[6]=sp_lj_in[6]; sp_lj[7]=sp_lj_in[7]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) e_coul += prefactor*(_erfc-factor_coul); if (rsq < lj1[mtype].w) { @@ -129,7 +132,7 @@ __kernel void k_lj_coul_long(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-lj3[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -140,9 +143,9 @@ __kernel void k_lj_coul_long(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_lj_coul_long_fast(const __global numtyp4 *restrict x_, @@ -164,28 +167,31 @@ __kernel void k_lj_coul_long_fast(const __global numtyp4 *restrict x_, __local numtyp4 lj1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) e_coul += prefactor*(_erfc-factor_coul); if (rsq < lj1[mtype].w) { @@ -247,7 +253,7 @@ __kernel void k_lj_coul_long_fast(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-lj3[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -258,8 +264,8 @@ __kernel void k_lj_coul_long_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } diff --git a/lib/gpu/lal_lj_coul_long.h b/lib/gpu/lal_lj_coul_long.h index 8f77671dc0..bc4fce40a5 100644 --- a/lib/gpu/lal_lj_coul_long.h +++ b/lib/gpu/lal_lj_coul_long.h @@ -80,7 +80,7 @@ class LJCoulLong : public BaseCharge { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_lj_coul_long_ext.cpp b/lib/gpu/lal_lj_coul_long_ext.cpp index 33771af53c..6a027bdc7e 100644 --- a/lib/gpu/lal_lj_coul_long_ext.cpp +++ b/lib/gpu/lal_lj_coul_long_ext.cpp @@ -58,7 +58,7 @@ int ljcl_gpu_init(const int ntypes, double **cutsq, double **host_lj1, int init_ok=0; if (world_me==0) init_ok=LJCLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - offset, special_lj, inum, nall, 300, maxspecial, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); @@ -77,7 +77,7 @@ int ljcl_gpu_init(const int ntypes, double **cutsq, double **host_lj1, } if (gpu_rank==i && world_me!=0) init_ok=LJCLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - offset, special_lj, inum, nall, 300, maxspecial, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); diff --git a/lib/gpu/lal_lj_coul_msm.cpp b/lib/gpu/lal_lj_coul_msm.cpp index 9a17d068ec..656736865b 100644 --- a/lib/gpu/lal_lj_coul_msm.cpp +++ b/lib/gpu/lal_lj_coul_msm.cpp @@ -157,20 +157,9 @@ double LJCoulMSMT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void LJCoulMSMT::loop(const bool _eflag, const bool _vflag) { +int LJCoulMSMT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -178,8 +167,8 @@ void LJCoulMSMT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &gcons, &dgcons, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &gcons, &dgcons, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->q, @@ -195,6 +184,7 @@ void LJCoulMSMT::loop(const bool _eflag, const bool _vflag) { &_qqrd2e, &_order, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class LJCoulMSM; diff --git a/lib/gpu/lal_lj_coul_msm.cu b/lib/gpu/lal_lj_coul_msm.cu index a3c36eed85..39fc723736 100644 --- a/lib/gpu/lal_lj_coul_msm.cu +++ b/lib/gpu/lal_lj_coul_msm.cu @@ -28,6 +28,11 @@ _texture( gcons_tex,int2); _texture( dgcons_tex,int2); #endif +#if (__CUDACC_VER_MAJOR__ >= 11) +#define gcons_tex gcons +#define dgcons_tex dgcons +#endif + #else #define pos_tex x_ #define q_tex q_ @@ -100,6 +105,9 @@ __kernel void k_lj_coul_msm(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; @@ -109,18 +117,18 @@ __kernel void k_lj_coul_msm(const __global numtyp4 *restrict x_, sp_lj[6]=sp_lj_in[6]; sp_lj[7]=sp_lj_in[7]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) e_coul += prefactor*(egamma-factor_coul); if (rsq < lj1[mtype].w) { @@ -183,7 +191,7 @@ __kernel void k_lj_coul_msm(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-lj3[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -194,9 +202,9 @@ __kernel void k_lj_coul_msm(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_lj_coul_msm_fast(const __global numtyp4 *restrict x_, @@ -220,28 +228,31 @@ __kernel void k_lj_coul_msm_fast(const __global numtyp4 *restrict x_, __local numtyp4 lj1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) e_coul += prefactor*(egamma-factor_coul); if (rsq < lj1[mtype].w) { @@ -304,7 +315,7 @@ __kernel void k_lj_coul_msm_fast(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-lj3[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -315,8 +326,8 @@ __kernel void k_lj_coul_msm_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } diff --git a/lib/gpu/lal_lj_coul_msm.h b/lib/gpu/lal_lj_coul_msm.h index 6369ce8cb5..a929848aaf 100644 --- a/lib/gpu/lal_lj_coul_msm.h +++ b/lib/gpu/lal_lj_coul_msm.h @@ -80,7 +80,7 @@ class LJCoulMSM : public BaseCharge { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_lj_coul_msm_ext.cpp b/lib/gpu/lal_lj_coul_msm_ext.cpp index d957cbe376..2d9d77fe77 100644 --- a/lib/gpu/lal_lj_coul_msm_ext.cpp +++ b/lib/gpu/lal_lj_coul_msm_ext.cpp @@ -59,7 +59,7 @@ int ljcm_gpu_init(const int ntypes, double **cutsq, double **host_lj1, if (world_me==0) init_ok=LJCMLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, host_gcons, host_dgcons, offset, - special_lj, inum, nall, 300, maxspecial, + special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, order, qqrd2e); @@ -79,7 +79,7 @@ int ljcm_gpu_init(const int ntypes, double **cutsq, double **host_lj1, if (gpu_rank==i && world_me!=0) init_ok=LJCMLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, host_gcons, host_dgcons, offset, - special_lj, inum, nall, 300, maxspecial, + special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, order, qqrd2e); diff --git a/lib/gpu/lal_lj_cubic.cpp b/lib/gpu/lal_lj_cubic.cpp index f8200ec037..fa5073d409 100644 --- a/lib/gpu/lal_lj_cubic.cpp +++ b/lib/gpu/lal_lj_cubic.cpp @@ -119,20 +119,9 @@ double LJCubicT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void LJCubicT::loop(const bool _eflag, const bool _vflag) { +int LJCubicT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -140,8 +129,8 @@ void LJCubicT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj2, &lj3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj2, &lj3, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, @@ -154,6 +143,7 @@ void LJCubicT::loop(const bool _eflag, const bool _vflag) { &ainum, &nbor_pitch, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class LJCubic; diff --git a/lib/gpu/lal_lj_cubic.cu b/lib/gpu/lal_lj_cubic.cu index f93013fe75..a91326d521 100644 --- a/lib/gpu/lal_lj_cubic.cu +++ b/lib/gpu/lal_lj_cubic.cu @@ -46,16 +46,19 @@ __kernel void k_lj_cubic(const __global numtyp4 *restrict x_, int tid, ii, offset; atom_info(t_per_atom,ii,tid,offset); - acctyp energy=(acctyp)0; + int n_stride; + local_allocate_store_pair(); + acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e; if (rsq <= lj2[mtype].x) e = r6inv*(lj3[mtype].x*r6inv-lj3[mtype].y); @@ -106,7 +109,7 @@ __kernel void k_lj_cubic(const __global numtyp4 *restrict x_, e = lj2[mtype].w*(_PHIS + _DPHIDS*t - _A3*t*t*t/6.0); energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -117,9 +120,9 @@ __kernel void k_lj_cubic(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_lj_cubic_fast(const __global numtyp4 *restrict x_, @@ -140,27 +143,30 @@ __kernel void k_lj_cubic_fast(const __global numtyp4 *restrict x_, __local numtyp4 lj2[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp2 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { numtyp e; if (rsq <= lj2[mtype].x) e = r6inv*(lj3[mtype].x*r6inv-lj3[mtype].y); @@ -211,7 +217,7 @@ __kernel void k_lj_cubic_fast(const __global numtyp4 *restrict x_, e = lj2[mtype].w*(_PHIS + _DPHIDS*t - _A3*t*t*t/6.0); energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -222,8 +228,8 @@ __kernel void k_lj_cubic_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } diff --git a/lib/gpu/lal_lj_cubic.h b/lib/gpu/lal_lj_cubic.h index 9578ca27e4..a37044b279 100644 --- a/lib/gpu/lal_lj_cubic.h +++ b/lib/gpu/lal_lj_cubic.h @@ -73,7 +73,7 @@ class LJCubic : public BaseAtomic { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_lj_cubic_ext.cpp b/lib/gpu/lal_lj_cubic_ext.cpp index f02ce0f184..2f8ebac37b 100644 --- a/lib/gpu/lal_lj_cubic_ext.cpp +++ b/lib/gpu/lal_lj_cubic_ext.cpp @@ -58,7 +58,7 @@ int ljcb_gpu_init(const int ntypes, double **cutsq, double **cut_inner_sq, if (world_me==0) init_ok=LJCubicLMF.init(ntypes, cutsq, cut_inner_sq, cut_inner, sigma, epsilon, host_lj1, host_lj2, host_lj3, host_lj4, - special_lj, inum, nall, 300, maxspecial, + special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); LJCubicLMF.device->world_barrier(); @@ -77,7 +77,7 @@ int ljcb_gpu_init(const int ntypes, double **cutsq, double **cut_inner_sq, if (gpu_rank==i && world_me!=0) init_ok=LJCubicLMF.init(ntypes, cutsq, cut_inner_sq, cut_inner, sigma, epsilon, host_lj1, host_lj2, host_lj3, host_lj4, - special_lj, inum, nall, 300, maxspecial, + special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); LJCubicLMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_lj_dsf.cpp b/lib/gpu/lal_lj_dsf.cpp index b888f33f00..d41aa13deb 100644 --- a/lib/gpu/lal_lj_dsf.cpp +++ b/lib/gpu/lal_lj_dsf.cpp @@ -125,20 +125,9 @@ double LJDSFT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void LJDSFT::loop(const bool _eflag, const bool _vflag) { +int LJDSFT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -146,8 +135,8 @@ void LJDSFT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->q, @@ -163,6 +152,7 @@ void LJDSFT::loop(const bool _eflag, const bool _vflag) { &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class LJDSF; diff --git a/lib/gpu/lal_lj_dsf.cu b/lib/gpu/lal_lj_dsf.cu index c1bb197148..5beedb0bbb 100644 --- a/lib/gpu/lal_lj_dsf.cu +++ b/lib/gpu/lal_lj_dsf.cu @@ -50,6 +50,9 @@ __kernel void k_lj_dsf(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; @@ -59,18 +62,18 @@ __kernel void k_lj_dsf(const __global numtyp4 *restrict x_, sp_lj[6]=sp_lj_in[6]; sp_lj[7]=sp_lj_in[7]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { acctyp e_self = -((acctyp)0.5*e_shift + alpha/MY_PIS) * qtmp*qtmp*qqrd2e/(acctyp)t_per_atom; e_coul += (acctyp)2.0*e_self; @@ -130,7 +133,7 @@ __kernel void k_lj_dsf(const __global numtyp4 *restrict x_, f.y+=dely*force; f.z+=delz*force; - if (eflag>0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) { numtyp e=prefactor*(erfcc-r*e_shift-rsq*f_shift-factor_coul); e_coul += e; @@ -140,7 +143,7 @@ __kernel void k_lj_dsf(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-lj3[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -151,9 +154,9 @@ __kernel void k_lj_dsf(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_lj_dsf_fast(const __global numtyp4 *restrict x_, @@ -176,28 +179,31 @@ __kernel void k_lj_dsf_fast(const __global numtyp4 *restrict x_, __local numtyp4 lj1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { acctyp e_self = -((acctyp)0.5*e_shift + alpha/MY_PIS) * qtmp*qtmp*qqrd2e/(acctyp)t_per_atom; e_coul += (acctyp)2.0*e_self; @@ -257,7 +263,7 @@ __kernel void k_lj_dsf_fast(const __global numtyp4 *restrict x_, f.y+=dely*force; f.z+=delz*force; - if (eflag>0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) { numtyp e=prefactor*(erfcc-r*e_shift-rsq*f_shift-factor_coul); e_coul += e; @@ -267,7 +273,7 @@ __kernel void k_lj_dsf_fast(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-lj3[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -278,8 +284,7 @@ __kernel void k_lj_dsf_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } - diff --git a/lib/gpu/lal_lj_dsf.h b/lib/gpu/lal_lj_dsf.h index b176e087db..b303285e9c 100644 --- a/lib/gpu/lal_lj_dsf.h +++ b/lib/gpu/lal_lj_dsf.h @@ -77,7 +77,7 @@ class LJDSF : public BaseCharge { private: bool _allocated; numtyp _e_shift, _f_shift, _alpha, _cut_coulsq; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_lj_dsf_ext.cpp b/lib/gpu/lal_lj_dsf_ext.cpp index 6d53896a11..e70059261c 100644 --- a/lib/gpu/lal_lj_dsf_ext.cpp +++ b/lib/gpu/lal_lj_dsf_ext.cpp @@ -59,7 +59,7 @@ int ljd_gpu_init(const int ntypes, double **cutsq, double **host_lj1, int init_ok=0; if (world_me==0) init_ok=LJDMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, - host_lj4, offset, special_lj, inum, nall, 300, + host_lj4, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, e_shift, f_shift, alpha); @@ -79,7 +79,7 @@ int ljd_gpu_init(const int ntypes, double **cutsq, double **host_lj1, } if (gpu_rank==i && world_me!=0) init_ok=LJDMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - offset, special_lj, inum, nall, 300, maxspecial, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, e_shift, f_shift, alpha); diff --git a/lib/gpu/lal_lj_expand.cpp b/lib/gpu/lal_lj_expand.cpp index 1c58cecfae..3d9e526d0c 100644 --- a/lib/gpu/lal_lj_expand.cpp +++ b/lib/gpu/lal_lj_expand.cpp @@ -133,20 +133,9 @@ double LJExpandT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void LJExpandT::loop(const bool _eflag, const bool _vflag) { +int LJExpandT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -154,8 +143,8 @@ void LJExpandT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, @@ -168,6 +157,7 @@ void LJExpandT::loop(const bool _eflag, const bool _vflag) { &ainum, &nbor_pitch, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class LJExpand; diff --git a/lib/gpu/lal_lj_expand.cu b/lib/gpu/lal_lj_expand.cu index 46ed9e2a31..2eff2cd89b 100644 --- a/lib/gpu/lal_lj_expand.cu +++ b/lib/gpu/lal_lj_expand.cu @@ -41,22 +41,25 @@ __kernel void k_lj_expand(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e=r6inv*(lj3[mtype].x*r6inv-lj3[mtype].y); energy+=factor_lj*(e-lj3[mtype].z); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -108,9 +111,9 @@ __kernel void k_lj_expand(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_lj_expand_fast(const __global numtyp4 *restrict x_, @@ -129,27 +132,30 @@ __kernel void k_lj_expand_fast(const __global numtyp4 *restrict x_, __local numtyp4 lj1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(numtyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { numtyp e=r6inv*(lj3[mtype].x*r6inv-lj3[mtype].y); energy+=factor_lj*(e-lj3[mtype].z); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -201,8 +207,8 @@ __kernel void k_lj_expand_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } diff --git a/lib/gpu/lal_lj_expand.h b/lib/gpu/lal_lj_expand.h index 2560d166c7..94448a871d 100644 --- a/lib/gpu/lal_lj_expand.h +++ b/lib/gpu/lal_lj_expand.h @@ -76,7 +76,7 @@ class LJExpand : public BaseAtomic { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_lj_expand_coul_long.cpp b/lib/gpu/lal_lj_expand_coul_long.cpp index 3e5e00ef6a..41c2ff6229 100644 --- a/lib/gpu/lal_lj_expand_coul_long.cpp +++ b/lib/gpu/lal_lj_expand_coul_long.cpp @@ -140,20 +140,9 @@ double LJExpandCoulLongT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void LJExpandCoulLongT::loop(const bool _eflag, const bool _vflag) { +int LJExpandCoulLongT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -161,8 +150,8 @@ void LJExpandCoulLongT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->q, @@ -178,6 +167,7 @@ void LJExpandCoulLongT::loop(const bool _eflag, const bool _vflag) { &_qqrd2e, &_g_ewald, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class LJExpandCoulLong; diff --git a/lib/gpu/lal_lj_expand_coul_long.cu b/lib/gpu/lal_lj_expand_coul_long.cu index 0f0fe4c2fb..abb3d5ca3f 100644 --- a/lib/gpu/lal_lj_expand_coul_long.cu +++ b/lib/gpu/lal_lj_expand_coul_long.cu @@ -47,6 +47,9 @@ __kernel void k_lj_expand_coul_long(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; @@ -56,18 +59,18 @@ __kernel void k_lj_expand_coul_long(const __global numtyp4 *restrict x_, sp_lj[6]=sp_lj_in[6]; sp_lj[7]=sp_lj_in[7]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) e_coul += prefactor*(_erfc-factor_coul); if (rsq < lj1[mtype].w) { @@ -133,7 +136,7 @@ __kernel void k_lj_expand_coul_long(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-lj3[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -144,9 +147,9 @@ __kernel void k_lj_expand_coul_long(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_lj_expand_coul_long_fast(const __global numtyp4 *restrict x_, @@ -168,6 +171,9 @@ __kernel void k_lj_expand_coul_long_fast(const __global numtyp4 *restrict x_, __local numtyp4 lj1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) e_coul += prefactor*(_erfc-factor_coul); if (rsq < lj1[mtype].w) { @@ -254,7 +260,7 @@ __kernel void k_lj_expand_coul_long_fast(const __global numtyp4 *restrict x_, energy+=factor_lj*(e-lj3[mtype].z); } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -265,8 +271,8 @@ __kernel void k_lj_expand_coul_long_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } diff --git a/lib/gpu/lal_lj_expand_coul_long.h b/lib/gpu/lal_lj_expand_coul_long.h index 404a36e5bc..44f7aff3fe 100644 --- a/lib/gpu/lal_lj_expand_coul_long.h +++ b/lib/gpu/lal_lj_expand_coul_long.h @@ -80,7 +80,7 @@ class LJExpandCoulLong : public BaseCharge { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_lj_expand_coul_long_ext.cpp b/lib/gpu/lal_lj_expand_coul_long_ext.cpp index 3ff1bef701..e5506dd7aa 100644 --- a/lib/gpu/lal_lj_expand_coul_long_ext.cpp +++ b/lib/gpu/lal_lj_expand_coul_long_ext.cpp @@ -58,7 +58,7 @@ int ljecl_gpu_init(const int ntypes, double **cutsq, double **host_lj1, int init_ok=0; if (world_me==0) init_ok=LJECLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - offset, shift, special_lj, inum, nall, 300, maxspecial, + offset, shift, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); @@ -77,7 +77,7 @@ int ljecl_gpu_init(const int ntypes, double **cutsq, double **host_lj1, } if (gpu_rank==i && world_me!=0) init_ok=LJECLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - offset, shift, special_lj, inum, nall, 300, maxspecial, + offset, shift, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); diff --git a/lib/gpu/lal_lj_expand_ext.cpp b/lib/gpu/lal_lj_expand_ext.cpp index 603e425d3f..02decf2712 100644 --- a/lib/gpu/lal_lj_expand_ext.cpp +++ b/lib/gpu/lal_lj_expand_ext.cpp @@ -56,7 +56,7 @@ int lje_gpu_init(const int ntypes, double **cutsq, double **host_lj1, int init_ok=0; if (world_me==0) init_ok=LJEMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, - host_lj4, offset, shift, special_lj, inum, nall, 300, + host_lj4, offset, shift, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); LJEMF.device->world_barrier(); @@ -74,7 +74,7 @@ int lje_gpu_init(const int ntypes, double **cutsq, double **host_lj1, } if (gpu_rank==i && world_me!=0) init_ok=LJEMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - offset, shift, special_lj, inum, nall, 300, maxspecial, + offset, shift, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split,screen); LJEMF.device->world_barrier(); diff --git a/lib/gpu/lal_lj_ext.cpp b/lib/gpu/lal_lj_ext.cpp index 124cf46c8c..fa00fc4f64 100644 --- a/lib/gpu/lal_lj_ext.cpp +++ b/lib/gpu/lal_lj_ext.cpp @@ -55,7 +55,7 @@ int ljl_gpu_init(const int ntypes, double **cutsq, double **host_lj1, int init_ok=0; if (world_me==0) init_ok=LJLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, - host_lj4, offset, special_lj, inum, nall, 300, + host_lj4, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); LJLMF.device->world_barrier(); @@ -73,7 +73,7 @@ int ljl_gpu_init(const int ntypes, double **cutsq, double **host_lj1, } if (gpu_rank==i && world_me!=0) init_ok=LJLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - offset, special_lj, inum, nall, 300, maxspecial, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); LJLMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_lj_gromacs.cpp b/lib/gpu/lal_lj_gromacs.cpp index 0563151ddd..8a385ece6b 100644 --- a/lib/gpu/lal_lj_gromacs.cpp +++ b/lib/gpu/lal_lj_gromacs.cpp @@ -121,20 +121,9 @@ double LJGROMACST::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void LJGROMACST::loop(const bool _eflag, const bool _vflag) { +int LJGROMACST::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -142,8 +131,8 @@ void LJGROMACST::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &ljsw, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &ljsw, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, @@ -159,6 +148,7 @@ void LJGROMACST::loop(const bool _eflag, const bool _vflag) { &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class LJGROMACS; diff --git a/lib/gpu/lal_lj_gromacs.cu b/lib/gpu/lal_lj_gromacs.cu index 21381bef30..4117cc1440 100644 --- a/lib/gpu/lal_lj_gromacs.cu +++ b/lib/gpu/lal_lj_gromacs.cu @@ -42,21 +42,24 @@ __kernel void k_lj_gromacs(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e=r6inv*(lj3[mtype].x*r6inv-lj3[mtype].y); e += lj3[mtype].w; if (rsq > lj1[mtype].w) { @@ -108,7 +111,7 @@ __kernel void k_lj_gromacs(const __global numtyp4 *restrict x_, } energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -119,9 +122,9 @@ __kernel void k_lj_gromacs(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_lj_gromacs_fast(const __global numtyp4 *restrict x_, @@ -142,6 +145,9 @@ __kernel void k_lj_gromacs_fast(const __global numtyp4 *restrict x_, __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 ljsw[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) { + if (EVFLAG && eflag) { numtyp e=r6inv*(lj3[mtype].x*r6inv-lj3[mtype].y); e += lj3[mtype].w; if (rsq > lj1[mtype].w) { @@ -213,7 +219,7 @@ __kernel void k_lj_gromacs_fast(const __global numtyp4 *restrict x_, } energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -224,8 +230,7 @@ __kernel void k_lj_gromacs_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } - diff --git a/lib/gpu/lal_lj_gromacs.h b/lib/gpu/lal_lj_gromacs.h index 3dec13c6d7..8fedaf07a1 100644 --- a/lib/gpu/lal_lj_gromacs.h +++ b/lib/gpu/lal_lj_gromacs.h @@ -76,7 +76,7 @@ class LJGROMACS : public BaseAtomic { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_lj_gromacs_ext.cpp b/lib/gpu/lal_lj_gromacs_ext.cpp index 99d32ab09a..19d1d12513 100644 --- a/lib/gpu/lal_lj_gromacs_ext.cpp +++ b/lib/gpu/lal_lj_gromacs_ext.cpp @@ -58,7 +58,7 @@ int ljgrm_gpu_init(const int ntypes, double **cutsq, double **host_lj1, int init_ok=0; if (world_me==0) LJGRMMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - special_lj, inum, nall, 300, maxspecial, cell_size, + special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_ljsw1, host_ljsw2, host_ljsw3, host_ljsw4, host_ljsw5, cut_inner, cut_inner_sq); @@ -77,7 +77,7 @@ int ljgrm_gpu_init(const int ntypes, double **cutsq, double **host_lj1, } if (gpu_rank==i && world_me!=0) init_ok=LJGRMMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - special_lj, inum, nall, 300, maxspecial, cell_size, + special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_ljsw1, host_ljsw2, host_ljsw3, host_ljsw4, host_ljsw5, cut_inner, cut_inner_sq); diff --git a/lib/gpu/lal_lj_sdk.cpp b/lib/gpu/lal_lj_sdk.cpp index c6a282576c..0da094c953 100644 --- a/lib/gpu/lal_lj_sdk.cpp +++ b/lib/gpu/lal_lj_sdk.cpp @@ -113,20 +113,9 @@ double CGCMMT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void CGCMMT::loop(const bool _eflag, const bool _vflag) { +int CGCMMT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -134,8 +123,8 @@ void CGCMMT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, @@ -149,6 +138,7 @@ void CGCMMT::loop(const bool _eflag, const bool _vflag) { &nbor_pitch, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class CGCMM; diff --git a/lib/gpu/lal_lj_sdk.cu b/lib/gpu/lal_lj_sdk.cu index 249b29a4b2..1bd9a93d5e 100644 --- a/lib/gpu/lal_lj_sdk.cu +++ b/lib/gpu/lal_lj_sdk.cu @@ -39,22 +39,25 @@ __kernel void k_lj_sdk(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) + if (EVFLAG && eflag) energy += factor_lj*inv1*(lj3[mtype].x*inv2-lj3[mtype].y)- lj3[mtype].z; - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -111,9 +114,9 @@ __kernel void k_lj_sdk(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_lj_sdk_fast(const __global numtyp4 *restrict x_, @@ -132,27 +135,30 @@ __kernel void k_lj_sdk_fast(const __global numtyp4 *restrict x_, __local numtyp4 lj1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) + if (EVFLAG && eflag) energy += factor_lj*inv1*(lj3[mtype].x*inv2-lj3[mtype].y)- lj3[mtype].z; - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -209,8 +215,7 @@ __kernel void k_lj_sdk_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } - diff --git a/lib/gpu/lal_lj_sdk.h b/lib/gpu/lal_lj_sdk.h index fc50756a3f..043bafdda8 100644 --- a/lib/gpu/lal_lj_sdk.h +++ b/lib/gpu/lal_lj_sdk.h @@ -71,7 +71,7 @@ class CGCMM : public BaseAtomic { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_lj_sdk_ext.cpp b/lib/gpu/lal_lj_sdk_ext.cpp index de0c5fef4f..4497233861 100644 --- a/lib/gpu/lal_lj_sdk_ext.cpp +++ b/lib/gpu/lal_lj_sdk_ext.cpp @@ -56,7 +56,7 @@ int sdk_gpu_init(const int ntypes, double **cutsq, int **cg_types, int init_ok=0; if (world_me==0) init_ok=CMMMF.init(ntypes,cutsq,cg_types,host_lj1,host_lj2,host_lj3, - host_lj4, offset, special_lj, inum, nall, 300, + host_lj4, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); CMMMF.device->world_barrier(); @@ -74,7 +74,7 @@ int sdk_gpu_init(const int ntypes, double **cutsq, int **cg_types, } if (gpu_rank==i && world_me!=0) init_ok=CMMMF.init(ntypes,cutsq,cg_types,host_lj1,host_lj2,host_lj3, - host_lj4, offset, special_lj, inum, nall, 300, + host_lj4, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); CMMMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_lj_sdk_long.cpp b/lib/gpu/lal_lj_sdk_long.cpp index 74dbfc40e3..d78e8d84da 100644 --- a/lib/gpu/lal_lj_sdk_long.cpp +++ b/lib/gpu/lal_lj_sdk_long.cpp @@ -124,20 +124,9 @@ double CGCMMLongT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void CGCMMLongT::loop(const bool _eflag, const bool _vflag) { +int CGCMMLongT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -145,8 +134,8 @@ void CGCMMLongT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->q, @@ -161,6 +150,7 @@ void CGCMMLongT::loop(const bool _eflag, const bool _vflag) { &_qqrd2e, &_g_ewald, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class CGCMMLong; diff --git a/lib/gpu/lal_lj_sdk_long.cu b/lib/gpu/lal_lj_sdk_long.cu index 6dd1829c71..3972ed2076 100644 --- a/lib/gpu/lal_lj_sdk_long.cu +++ b/lib/gpu/lal_lj_sdk_long.cu @@ -47,6 +47,9 @@ __kernel void k_lj_sdk_long(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; @@ -56,18 +59,18 @@ __kernel void k_lj_sdk_long(const __global numtyp4 *restrict x_, sp_lj[6]=sp_lj_in[6]; sp_lj[7]=sp_lj_in[7]; - acctyp energy=(acctyp)0; - acctyp e_coul=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, e_coul, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + e_coul=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) e_coul += prefactor*(_erfc-factor_coul); if (rsq < lj1[mtype].y) { @@ -138,7 +141,7 @@ __kernel void k_lj_sdk_long(const __global numtyp4 *restrict x_, lj3[mtype].w; } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -149,9 +152,9 @@ __kernel void k_lj_sdk_long(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_lj_sdk_long_fast(const __global numtyp4 *restrict x_, @@ -173,6 +176,9 @@ __kernel void k_lj_sdk_long_fast(const __global numtyp4 *restrict x_, __local numtyp4 lj1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) { + if (EVFLAG && eflag) { if (rsq < cut_coulsq) e_coul += prefactor*(_erfc-factor_coul); if (rsq < lj1[mtype].y) { @@ -264,7 +270,7 @@ __kernel void k_lj_sdk_long_fast(const __global numtyp4 *restrict x_, lj3[mtype].w; } } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -275,8 +281,7 @@ __kernel void k_lj_sdk_long_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } - diff --git a/lib/gpu/lal_lj_sdk_long.h b/lib/gpu/lal_lj_sdk_long.h index 608488bd30..102b007b59 100644 --- a/lib/gpu/lal_lj_sdk_long.h +++ b/lib/gpu/lal_lj_sdk_long.h @@ -75,7 +75,7 @@ class CGCMMLong : public BaseCharge { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_lj_sdk_long_ext.cpp b/lib/gpu/lal_lj_sdk_long_ext.cpp index f293487282..3170ac8b52 100644 --- a/lib/gpu/lal_lj_sdk_long_ext.cpp +++ b/lib/gpu/lal_lj_sdk_long_ext.cpp @@ -58,7 +58,7 @@ int sdkl_gpu_init(const int ntypes, double **cutsq, int **cg_type, int init_ok=0; if (world_me==0) init_ok=CMMLMF.init(ntypes, cutsq, cg_type, host_lj1, host_lj2, host_lj3, - host_lj4, offset, special_lj, inum, nall, 300, + host_lj4, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e,g_ewald); @@ -77,7 +77,7 @@ int sdkl_gpu_init(const int ntypes, double **cutsq, int **cg_type, } if (gpu_rank==i && world_me!=0) init_ok=CMMLMF.init(ntypes, cutsq, cg_type, host_lj1, host_lj2, host_lj3, - host_lj4, offset, special_lj, inum, nall, 300, + host_lj4, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_special_coul, qqrd2e, g_ewald); diff --git a/lib/gpu/lal_lj_tip4p_long.cpp b/lib/gpu/lal_lj_tip4p_long.cpp index 1f3b32248c..66477d1fb4 100644 --- a/lib/gpu/lal_lj_tip4p_long.cpp +++ b/lib/gpu/lal_lj_tip4p_long.cpp @@ -65,6 +65,12 @@ int LJTIP4PLongT::init(const int ntypes, k_pair_distrib.set_function(*this->pair_program,"k_lj_tip4p_long_distrib"); k_pair_reneigh.set_function(*this->pair_program,"k_lj_tip4p_reneigh"); k_pair_newsite.set_function(*this->pair_program,"k_lj_tip4p_newsite"); + #if defined(LAL_OCL_EV_JIT) + k_pair_distrib_noev.set_function(*this->pair_program_noev, + "k_lj_tip4p_long_distrib"); + #else + k_pair_dt_sel = &k_pair_distrib; + #endif TypeH = tH; TypeO = tO; @@ -151,6 +157,9 @@ void LJTIP4PLongT::clear() { k_pair_distrib.clear(); k_pair_reneigh.clear(); k_pair_newsite.clear(); + #if defined(LAL_OCL_EV_JIT) + k_pair_distrib_noev.clear(); + #endif this->clear_atomic(); } @@ -164,19 +173,9 @@ double LJTIP4PLongT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void LJTIP4PLongT::loop(const bool _eflag, const bool _vflag) { +int LJTIP4PLongT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; int ainum=this->ans->inum(); const int nall = this->atom->nall(); @@ -210,8 +209,8 @@ void LJTIP4PLongT::loop(const bool _eflag, const bool _vflag) { this->ansO.zero(); this->device->gpu->sync(); if(shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &lj1, &lj3, &_lj_types, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &lj1, &lj3, &_lj_types, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->_threads_per_atom, @@ -228,12 +227,19 @@ void LJTIP4PLongT::loop(const bool _eflag, const bool _vflag) { &this->atom->q, &cutsq, &_qqrd2e, &_g_ewald, &cut_coulsq, &cut_coulsqplus, &this->ansO); } + #if defined(LAL_OCL_EV_JIT) + if (eflag || vflag) k_pair_dt_sel = &k_pair_distrib; + else k_pair_dt_sel = &k_pair_distrib_noev; + #endif + GX=static_cast(ceil(static_cast(this->ans->inum())/BX)); - this->k_pair_distrib.set_size(GX,BX); - this->k_pair_distrib.run(&this->atom->x, &this->ans->force, &this->ans->engv, - &eflag, &vflag, &ainum, &nbor_pitch, &this->_threads_per_atom, - &hneight, &m, &TypeO, &TypeH, &alpha,&this->atom->q, &this->ansO); + k_pair_dt_sel->set_size(GX,BX); + k_pair_dt_sel->run(&this->atom->x, &this->ans->force, &this->ans->engv, + &eflag, &vflag, &ainum, &nbor_pitch, + &this->_threads_per_atom, &hneight, &m, &TypeO, &TypeH, + &alpha,&this->atom->q, &this->ansO); this->time_pair.stop(); + return GX; } @@ -269,22 +275,26 @@ void LJTIP4PLongT::copy_relations_data(int n, tagint *tag, int *map_array, } } - - - // --------------------------------------------------------------------------- // Copy nbor list from host if necessary and then calculate forces, virials,.. // --------------------------------------------------------------------------- template void LJTIP4PLongT::compute(const int f_ago, const int inum_full, - const int nall, double **host_x, int *host_type, - int *ilist, int *numj, int **firstneigh, - const bool eflag, const bool vflag, - const bool eatom, const bool vatom, - int &host_start, const double cpu_time, - bool &success, double *host_q, - const int nlocal, double *boxlo, double *prd) { + const int nall, double **host_x, int *host_type, + int *ilist, int *numj, int **firstneigh, + const bool eflag_in, const bool vflag_in, + const bool eatom, const bool vatom, + int &host_start, const double cpu_time, + bool &success, double *host_q, + const int nlocal, double *boxlo, double *prd) { this->acc_timers(); + int eflag, vflag; + if (eflag_in) eflag=2; + else eflag=0; + if (vflag_in) vflag=2; + else vflag=0; + + this->set_kernel(eflag,vflag); if (inum_full==0) { host_start=0; // Make sure textures are correct if realloc by a different hybrid style @@ -315,7 +325,7 @@ void LJTIP4PLongT::compute(const int f_ago, const int inum_full, t_ago = ago; loop(eflag,vflag); - this->ans->copy_answers(eflag,vflag,eatom,vatom,ilist); + this->ans->copy_answers(eflag_in,vflag_in,eatom,vatom,ilist,inum); this->device->add_ans_object(this->ans); this->hd_balancer.stop_timer(); } @@ -325,16 +335,23 @@ void LJTIP4PLongT::compute(const int f_ago, const int inum_full, // --------------------------------------------------------------------------- template int** LJTIP4PLongT::compute(const int ago, const int inum_full, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, - int *map_array, int map_size, int *sametag, int max_same, - int **nspecial, tagint **special, const bool eflag, - const bool vflag, const bool eatom, - const bool vatom, int &host_start, - int **ilist, int **jnum, - const double cpu_time, bool &success, - double *host_q, double *boxlo, double *prd) { + const int nall, double **host_x, int *host_type, + double *sublo, double *subhi, tagint *tag, + int *map_array, int map_size, int *sametag, + int max_same, int **nspecial, tagint **special, + const bool eflag_in, const bool vflag_in, + const bool eatom, const bool vatom, + int &host_start, int **ilist, int **jnum, + const double cpu_time, bool &success, + double *host_q, double *boxlo, double *prd) { this->acc_timers(); + int eflag, vflag; + if (eflag_in) eflag=2; + else eflag=0; + if (vflag_in) vflag=2; + else vflag=0; + + this->set_kernel(eflag,vflag); if (inum_full==0) { host_start=0; // Make sure textures are correct if realloc by a different hybrid style @@ -373,7 +390,7 @@ int** LJTIP4PLongT::compute(const int ago, const int inum_full, t_ago = ago; loop(eflag,vflag); - this->ans->copy_answers(eflag,vflag,eatom,vatom); + this->ans->copy_answers(eflag_in,vflag_in,eatom,vatom,inum); this->device->add_ans_object(this->ans); this->hd_balancer.stop_timer(); diff --git a/lib/gpu/lal_lj_tip4p_long.cu b/lib/gpu/lal_lj_tip4p_long.cu index 782ae43662..bd900d9244 100644 --- a/lib/gpu/lal_lj_tip4p_long.cu +++ b/lib/gpu/lal_lj_tip4p_long.cu @@ -129,7 +129,7 @@ __kernel void k_lj_tip4p_long_distrib(const __global numtyp4 *restrict x_, f.x += fM.x * (acctyp)0.5 * alpha; f.y += fM.y * (acctyp)0.5 * alpha; f.z += fM.z * (acctyp)0.5 * alpha; - if (vflag > 0) { + if (EVFLAG && vflag) { vM = ansO[inum +iO]; engv[inum*engv_iter + i] += vM.x * (acctyp)0.5 * alpha; engv_iter++; engv[inum*engv_iter + i] += vM.y * (acctyp)0.5 * alpha; engv_iter++; @@ -147,13 +147,13 @@ __kernel void k_lj_tip4p_long_distrib(const __global numtyp4 *restrict x_, f.x += fM.x * (acctyp)(1 - alpha); f.y += fM.y * (acctyp)(1 - alpha); f.z += fM.z * (acctyp)(1 - alpha); - if (eflag > 0) { + if (EVFLAG && eflag) { eM = engv[i+inum]; engv[inum+i] = eM*(acctyp)(1 - alpha); if (iH1 < inum) engv[inum+iH1] += eM * (acctyp)0.5 * alpha; if (iH2 < inum) engv[inum+iH2] += eM * (acctyp)0.5 * alpha; } - if (vflag > 0) { + if (EVFLAG && vflag) { vM = ansO[inum + i]; engv[inum*engv_iter + i] += vM.x * (acctyp)(1 - alpha); engv_iter++; engv[inum*engv_iter + i] += vM.y * (acctyp)(1 - alpha); engv_iter++; @@ -276,22 +276,27 @@ __kernel void k_lj_tip4p_long(const __global numtyp4 *restrict x_, int tid, ii, offset; atom_info(t_per_atom,ii,tid,offset); - acctyp energy = (acctyp)0; - acctyp e_coul = (acctyp)0; + int n_stride; + local_allocate_store_charge(); + acctyp4 f, fO; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; fO.x=(acctyp)0; fO.y=(acctyp)0; fO.z=(acctyp)0; - acctyp virial[6],vO[6]; - for (int i=0; i<6; i++) { - virial[i]=(acctyp)0; - vO[i]=(acctyp)0; + acctyp energy, e_coul, virial[6], vO[6]; + if (EVFLAG) { + energy = (acctyp)0; + e_coul = (acctyp)0; + for (int i=0; i<6; i++) { + virial[i]=(acctyp)0; + vO[i]=(acctyp)0; + } } + int i; if (ii0) { + if (EVFLAG && eflag) { numtyp e = r6inv * (lj3[mtype].x*r6inv-lj3[mtype].y); energy += factor_lj * (e - lj3[mtype].z); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*forcelj; virial[1] += dely*dely*forcelj; virial[2] += delz*delz*forcelj; @@ -396,10 +401,10 @@ __kernel void k_lj_tip4p_long(const __global numtyp4 *restrict x_, fO.z += delz * force_coul; fO.w += 0; } - if (eflag>0) { + if (EVFLAG && eflag) { e_coul += prefactor*(_erfc-factor_coul); } - if (vflag>0) { + if (EVFLAG && vflag) { acctyp4 fd; fd.x = delx*force_coul; fd.y = dely*force_coul; @@ -489,10 +494,10 @@ __kernel void k_lj_tip4p_long(const __global numtyp4 *restrict x_, f.y += fd.y; f.z += fd.z; - if (eflag>0) { + if (EVFLAG && eflag) { e_coul += prefactor*(_erfc-factor_coul) * (acctyp)0.5 * alpha; } - if (vflag>0) { + if (EVFLAG && vflag) { numtyp4 xH1; fetch4(xH1,iH1,pos_tex); numtyp4 xH2; fetch4(xH2,iH2,pos_tex); numtyp4 xO; fetch4(xO,iO,pos_tex); @@ -508,62 +513,64 @@ __kernel void k_lj_tip4p_long(const __global numtyp4 *restrict x_, } } // if cut_coulsqplus } // for nbor - if (t_per_atom>1) { -#if (ARCH < 300) - __local acctyp red_acc[6][BLOCK_PAIR]; - red_acc[0][tid]=fO.x; - red_acc[1][tid]=fO.y; - red_acc[2][tid]=fO.z; - red_acc[3][tid]=fO.w; + } // if ii + if (t_per_atom>1) { +#if (SHUFFLE_AVAIL == 0) + red_acc[0][tid]=fO.x; + red_acc[1][tid]=fO.y; + red_acc[2][tid]=fO.z; + red_acc[3][tid]=fO.w; + for (unsigned int s=t_per_atom/2; s>0; s>>=1) { + simdsync(); + if (offset < s) { + for (int r=0; r<4; r++) + red_acc[r][tid] += red_acc[r][tid+s]; + } + } + fO.x=red_acc[0][tid]; + fO.y=red_acc[1][tid]; + fO.z=red_acc[2][tid]; + fO.w=red_acc[3][tid]; + if (EVFLAG && vflag) { + simdsync(); + for (int r=0; r<6; r++) red_acc[r][tid]=vO[r]; for (unsigned int s=t_per_atom/2; s>0; s>>=1) { + simdsync(); if (offset < s) { - for (int r=0; r<4; r++) + for (int r=0; r<6; r++) red_acc[r][tid] += red_acc[r][tid+s]; } } - fO.x=red_acc[0][tid]; - fO.y=red_acc[1][tid]; - fO.z=red_acc[2][tid]; - fO.w=red_acc[3][tid]; - if (vflag>0) { - for (int r=0; r<6; r++) red_acc[r][tid]=vO[r]; - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { - if (offset < s) { - for (int r=0; r<6; r++) - red_acc[r][tid] += red_acc[r][tid+s]; - } - } - for (int r=0; r<6; r++) vO[r]=red_acc[r][tid]; - } + for (int r=0; r<6; r++) vO[r]=red_acc[r][tid]; + } #else + for (unsigned int s=t_per_atom/2; s>0; s>>=1) { + fO.x += shfl_down(fO.x, s, t_per_atom); + fO.y += shfl_down(fO.y, s, t_per_atom); + fO.z += shfl_down(fO.z, s, t_per_atom); + fO.w += shfl_down(fO.w, s, t_per_atom); + } + if (EVFLAG && vflag) { for (unsigned int s=t_per_atom/2; s>0; s>>=1) { - fO.x += shfl_xor(fO.x, s, t_per_atom); - fO.y += shfl_xor(fO.y, s, t_per_atom); - fO.z += shfl_xor(fO.z, s, t_per_atom); - fO.w += shfl_xor(fO.w, s, t_per_atom); - } - if (vflag>0) { - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { - for (int r=0; r<6; r++) - vO[r] += shfl_xor(vO[r], s, t_per_atom); - } + for (int r=0; r<6; r++) + vO[r] += shfl_down(vO[r], s, t_per_atom); } + } #endif + } + if(offset == 0 && ii0) { - ansO[inum + i].x = vO[0]; - ansO[inum + i].y = vO[1]; - ansO[inum + i].z = vO[2]; - ansO[inum*2 + i].x = vO[3]; - ansO[inum*2 + i].y = vO[4]; - ansO[inum*2 + i].z = vO[5]; - } - } - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); - } // if ii + } + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } __kernel void k_lj_tip4p_long_fast(const __global numtyp4 *restrict x_, @@ -592,28 +599,32 @@ __kernel void k_lj_tip4p_long_fast(const __global numtyp4 *restrict x_, __local numtyp4 lj1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[8]; + int n_stride; + local_allocate_store_charge(); + if (tid<8) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } - acctyp energy = (acctyp)0; - acctyp e_coul = (acctyp)0; acctyp4 f, fO; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; fO.x=(acctyp)0; fO.y=(acctyp)0; fO.z=(acctyp)0; - acctyp virial[6],vO[6]; - for (int i=0; i<6; i++) { - virial[i]=(acctyp)0; - vO[i]=(acctyp)0; + acctyp energy, e_coul, virial[6], vO[6]; + if (EVFLAG) { + energy = (acctyp)0; + e_coul = (acctyp)0; + for (int i=0; i<6; i++) { + virial[i]=(acctyp)0; + vO[i]=(acctyp)0; + } } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { numtyp e = r6inv * (lj3[mtype].x*r6inv-lj3[mtype].y); energy += factor_lj * (e - lj3[mtype].z); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*forcelj; virial[1] += dely*dely*forcelj; virial[2] += delz*delz*forcelj; @@ -720,10 +731,10 @@ __kernel void k_lj_tip4p_long_fast(const __global numtyp4 *restrict x_, fO.z += delz * force_coul; fO.w += 0; } - if (eflag>0) { + if (EVFLAG && eflag) { e_coul += prefactor*(_erfc-factor_coul); } - if (vflag>0) { + if (EVFLAG && vflag) { acctyp4 fd; fd.x = delx*force_coul; fd.y = dely*force_coul; @@ -813,10 +824,10 @@ __kernel void k_lj_tip4p_long_fast(const __global numtyp4 *restrict x_, f.y += fd.y; f.z += fd.z; - if (eflag>0) { + if (EVFLAG && eflag) { e_coul += prefactor*(_erfc-factor_coul) * (acctyp)0.5 * alpha; } - if (vflag>0) { + if (EVFLAG && vflag) { numtyp4 xH1; fetch4(xH1,iH1,pos_tex); numtyp4 xH2; fetch4(xH2,iH2,pos_tex); numtyp4 xO; fetch4(xO,iO,pos_tex); @@ -833,13 +844,13 @@ __kernel void k_lj_tip4p_long_fast(const __global numtyp4 *restrict x_, } // if cut_coulsqplus } // for nbor if (t_per_atom>1) { -#if (ARCH < 300) - __local acctyp red_acc[6][BLOCK_PAIR]; +#if (SHUFFLE_AVAIL == 0) red_acc[0][tid]=fO.x; red_acc[1][tid]=fO.y; red_acc[2][tid]=fO.z; red_acc[3][tid]=fO.w; for (unsigned int s=t_per_atom/2; s>0; s>>=1) { + simdsync(); if (offset < s) { for (int r=0; r<4; r++) red_acc[r][tid] += red_acc[r][tid+s]; @@ -849,9 +860,10 @@ __kernel void k_lj_tip4p_long_fast(const __global numtyp4 *restrict x_, fO.y=red_acc[1][tid]; fO.z=red_acc[2][tid]; fO.w=red_acc[3][tid]; - if (vflag>0) { + if (EVFLAG && vflag) { for (int r=0; r<6; r++) red_acc[r][tid]=vO[r]; for (unsigned int s=t_per_atom/2; s>0; s>>=1) { + simdsync(); if (offset < s) { for (int r=0; r<6; r++) red_acc[r][tid] += red_acc[r][tid+s]; @@ -861,22 +873,22 @@ __kernel void k_lj_tip4p_long_fast(const __global numtyp4 *restrict x_, } #else for (unsigned int s=t_per_atom/2; s>0; s>>=1) { - fO.x += shfl_xor(fO.x, s, t_per_atom); - fO.y += shfl_xor(fO.y, s, t_per_atom); - fO.z += shfl_xor(fO.z, s, t_per_atom); - fO.w += shfl_xor(fO.w, s, t_per_atom); + fO.x += shfl_down(fO.x, s, t_per_atom); + fO.y += shfl_down(fO.y, s, t_per_atom); + fO.z += shfl_down(fO.z, s, t_per_atom); + fO.w += shfl_down(fO.w, s, t_per_atom); } - if (vflag>0) { + if (EVFLAG && vflag) { for (unsigned int s=t_per_atom/2; s>0; s>>=1) { for (int r=0; r<6; r++) - vO[r] += shfl_xor(vO[r], s, t_per_atom); + vO[r] += shfl_down(vO[r], s, t_per_atom); } } #endif } if(offset == 0) { ansO[i] = fO; - if (vflag>0) { + if (EVFLAG && vflag) { ansO[inum + i].x = vO[0]; ansO[inum + i].y = vO[1]; ansO[inum + i].z = vO[2]; @@ -885,7 +897,7 @@ __kernel void k_lj_tip4p_long_fast(const __global numtyp4 *restrict x_, ansO[inum*2 + i].z = vO[5]; } } - store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag, + vflag,ans,engv); } diff --git a/lib/gpu/lal_lj_tip4p_long.h b/lib/gpu/lal_lj_tip4p_long.h index 90c342e246..b163a62309 100644 --- a/lib/gpu/lal_lj_tip4p_long.h +++ b/lib/gpu/lal_lj_tip4p_long.h @@ -74,13 +74,13 @@ public: /// Reimplement BaseCharge pair loop with device neighboring int** compute(const int ago, const int inum_full, const int nall, - double **host_x, int *host_type, double *sublo, - double *subhi, tagint *tag,int *map_array, int map_size, int *sametag, int max_same, - int **nspecial, - tagint **special, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - int **ilist, int **numj, const double cpu_time, bool &success, - double *charge, double *boxlo, double *prd); + double **host_x, int *host_type, double *sublo, double *subhi, + tagint *tag,int *map_array, int map_size, int *sametag, + int max_same, int **nspecial, tagint **special, + const bool eflag, const bool vflag, const bool eatom, + const bool vatom, int &host_start, int **ilist, int **numj, + const double cpu_time, bool &success, double *charge, + double *boxlo, double *prd); // --------------------------- TYPE DATA -------------------------- @@ -115,11 +115,12 @@ public: UCL_D_Vec atom_sametag; UCL_Kernel k_pair_distrib, k_pair_reneigh, k_pair_newsite; + UCL_Kernel k_pair_distrib_noev, *k_pair_dt_sel; private: bool _allocated; int t_ago; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_lj_tip4p_long_ext.cpp b/lib/gpu/lal_lj_tip4p_long_ext.cpp index d0d6c7a3d2..7395506c2d 100644 --- a/lib/gpu/lal_lj_tip4p_long_ext.cpp +++ b/lib/gpu/lal_lj_tip4p_long_ext.cpp @@ -62,7 +62,7 @@ int ljtip4p_long_gpu_init(const int ntypes, double **cutsq, double **host_lj1, if (world_me==0) init_ok=LJTIP4PLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, offset, special_lj, inum, - tH, tO, alpha, qdist, nall, 300, + tH, tO, alpha, qdist, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_cut_coulsqplus, host_special_coul, qqrd2e, g_ewald, map_size, max_same); @@ -83,7 +83,7 @@ int ljtip4p_long_gpu_init(const int ntypes, double **cutsq, double **host_lj1, if (gpu_rank==i && world_me!=0) init_ok=LJTIP4PLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, offset, special_lj, inum, - tH, tO, alpha, qdist, nall, 300, maxspecial, + tH, tO, alpha, qdist, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, host_cut_ljsq, host_cut_coulsq, host_cut_coulsqplus, host_special_coul, qqrd2e, @@ -97,7 +97,7 @@ int ljtip4p_long_gpu_init(const int ntypes, double **cutsq, double **host_lj1, fprintf(screen,"\n"); if (init_ok==0) - LJTIP4PLMF.estimate_gpu_overhead(); + LJTIP4PLMF.estimate_gpu_overhead(2); return init_ok; } diff --git a/lib/gpu/lal_mie.cpp b/lib/gpu/lal_mie.cpp index 394d1f8a2f..e370b7bde5 100644 --- a/lib/gpu/lal_mie.cpp +++ b/lib/gpu/lal_mie.cpp @@ -113,20 +113,9 @@ double MieT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void MieT::loop(const bool _eflag, const bool _vflag) { +int MieT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -134,8 +123,8 @@ void MieT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &mie1, &mie3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &mie1, &mie3, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->_threads_per_atom); @@ -147,6 +136,7 @@ void MieT::loop(const bool _eflag, const bool _vflag) { &ainum, &nbor_pitch, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class Mie; diff --git a/lib/gpu/lal_mie.cu b/lib/gpu/lal_mie.cu index 36ec8a496b..fedfaf157a 100644 --- a/lib/gpu/lal_mie.cu +++ b/lib/gpu/lal_mie.cu @@ -39,22 +39,25 @@ __kernel void k_mie(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e=(mie3[mtype].x*rgamR - mie3[mtype].y*rgamA) - mie3[mtype].z; energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -105,9 +108,9 @@ __kernel void k_mie(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_mie_fast(const __global numtyp4 *restrict x_, @@ -126,6 +129,9 @@ __kernel void k_mie_fast(const __global numtyp4 *restrict x_, __local numtyp4 mie1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 mie3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) { + if (EVFLAG && eflag) { numtyp e=(mie3[mtype].x*rgamR - mie3[mtype].y*rgamA) - mie3[mtype].z; energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -196,8 +202,7 @@ __kernel void k_mie_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } - diff --git a/lib/gpu/lal_mie.h b/lib/gpu/lal_mie.h index dfc2ee6e53..9a41596ccb 100644 --- a/lib/gpu/lal_mie.h +++ b/lib/gpu/lal_mie.h @@ -72,7 +72,7 @@ class Mie : public BaseAtomic { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_mie_ext.cpp b/lib/gpu/lal_mie_ext.cpp index f612de4336..5cbb9c29d2 100644 --- a/lib/gpu/lal_mie_ext.cpp +++ b/lib/gpu/lal_mie_ext.cpp @@ -58,7 +58,7 @@ int mie_gpu_init(const int ntypes, double **cutsq, double **host_mie1, if (world_me==0) init_ok=MLMF.init(ntypes, cutsq, host_mie1, host_mie2, host_mie3, host_mie4, host_gamA, host_gamR, - offset, special_lj, inum, nall, 300, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); MLMF.device->world_barrier(); @@ -77,7 +77,7 @@ int mie_gpu_init(const int ntypes, double **cutsq, double **host_mie1, if (gpu_rank==i && world_me!=0) init_ok=MLMF.init(ntypes, cutsq, host_mie1, host_mie2, host_mie3, host_mie4, host_gamA, host_gamR, - offset, special_lj, inum, nall, 300, maxspecial, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); MLMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_morse.cpp b/lib/gpu/lal_morse.cpp index 09da65d252..4bedc67ed7 100644 --- a/lib/gpu/lal_morse.cpp +++ b/lib/gpu/lal_morse.cpp @@ -112,20 +112,9 @@ double MorseT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void MorseT::loop(const bool _eflag, const bool _vflag) { +int MorseT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -133,8 +122,8 @@ void MorseT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &mor1, &mor2, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &mor1, &mor2, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, @@ -147,6 +136,7 @@ void MorseT::loop(const bool _eflag, const bool _vflag) { &ainum, &nbor_pitch, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class Morse; diff --git a/lib/gpu/lal_morse.cu b/lib/gpu/lal_morse.cu index d6bab1e131..b1c8f2673b 100644 --- a/lib/gpu/lal_morse.cu +++ b/lib/gpu/lal_morse.cu @@ -41,22 +41,25 @@ __kernel void k_morse(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e=mor2[mtype].x*(dexp*dexp - 2.0*dexp) - mor2[mtype].y; energy+=e*factor_lj; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -106,9 +109,9 @@ __kernel void k_morse(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_morse_fast(const __global numtyp4 *restrict x_, @@ -127,27 +130,30 @@ __kernel void k_morse_fast(const __global numtyp4 *restrict x_, __local numtyp4 mor1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp2 mor2[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) mor2[tid]=mor2_in[tid]; } - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { numtyp e=mor2[mtype].x*(dm-dexp)-mor2[mtype].y; energy+=e*factor_lj; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -197,8 +203,7 @@ __kernel void k_morse_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } - diff --git a/lib/gpu/lal_morse.h b/lib/gpu/lal_morse.h index bf5f1c0f8f..c5948d8be8 100644 --- a/lib/gpu/lal_morse.h +++ b/lib/gpu/lal_morse.h @@ -71,7 +71,7 @@ class Morse : public BaseAtomic { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_morse_ext.cpp b/lib/gpu/lal_morse_ext.cpp index 3b62d10305..f43676a1b5 100644 --- a/lib/gpu/lal_morse_ext.cpp +++ b/lib/gpu/lal_morse_ext.cpp @@ -56,7 +56,7 @@ int mor_gpu_init(const int ntypes, double **cutsq, int init_ok=0; if (world_me==0) init_ok=MORMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, - host_lj4, offset, special_lj, inum, nall, 300, + host_lj4, offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); MORMF.device->world_barrier(); @@ -74,7 +74,7 @@ int mor_gpu_init(const int ntypes, double **cutsq, } if (gpu_rank==i && world_me!=0) init_ok=MORMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4, - offset, special_lj, inum, nall, 300, maxspecial, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); MORMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_neighbor.cpp b/lib/gpu/lal_neighbor.cpp index 6c4890ef47..aabba49575 100644 --- a/lib/gpu/lal_neighbor.cpp +++ b/lib/gpu/lal_neighbor.cpp @@ -1,6 +1,7 @@ /*************************************************************************** neighbor.cpp ------------------- + Nitin Dhamankar (Intel) W. Michael Brown (ORNL) Peng Wang (Nvidia) @@ -32,22 +33,25 @@ int Neighbor::bytes_per_atom(const int max_nbors) const { } bool Neighbor::init(NeighborShared *shared, const int inum, - const int host_inum, const int max_nbors, - const int maxspecial, UCL_Device &devi, - const int gpu_nbor, const int gpu_host, - const bool pre_cut, const int block_cell_2d, - const int block_cell_id, const int block_nbor_build, - const int threads_per_atom, const int warp_size, - const bool time_device, - const std::string compile_flags) { + const int host_inum, const int max_nbors, + const int maxspecial, UCL_Device &devi, const int gpu_nbor, + const int gpu_host, const bool pre_cut, + const int block_cell_2d, const int block_cell_id, + const int block_nbor_build, const int threads_per_atom, + const int simd_size, const bool time_device, + const std::string compile_flags, const bool ilist_map) { clear(); + _ilist_map = ilist_map; _threads_per_atom=threads_per_atom; _block_cell_2d=block_cell_2d; _block_cell_id=block_cell_id; - _max_block_nbor_build=block_nbor_build; _block_nbor_build=block_nbor_build; - _warp_size=warp_size; + _simd_size=simd_size; + #ifndef LAL_USE_OLD_NEIGHBOR + if (_block_nbor_build < _simd_size) + _block_nbor_build = _simd_size; + #endif _shared=shared; dev=&devi; _gpu_nbor=gpu_nbor; @@ -90,7 +94,13 @@ bool Neighbor::init(NeighborShared *shared, const int inum, _max_atoms=1000; _max_host=static_cast(static_cast(host_inum)*1.10); - _max_nbors=(max_nbors/threads_per_atom+1)*threads_per_atom; + + _max_neighbor_factor=1.0e-2*max_nbors*1.1; + if (_gpu_nbor != 1) + _max_nbors=0; + else + _max_nbors=300; + if (_old_max_nbors) _max_nbors=_old_max_nbors; _maxspecial=maxspecial; if (gpu_nbor==0) @@ -103,8 +113,36 @@ bool Neighbor::init(NeighborShared *shared, const int inum, if (!success) return false; - if (_use_packing==false) - _shared->compile_kernels(devi,gpu_nbor,compile_flags); + if (_use_packing==false) { + #ifndef LAL_USE_OLD_NEIGHBOR + _shared->compile_kernels(devi, gpu_nbor, compile_flags+ + " -DMAX_SUBGROUPS_PER_BLOCK="+toa(_block_nbor_build/_simd_size)); + #else + _shared->compile_kernels(devi,gpu_nbor,compile_flags); + #endif + + #ifndef LAL_USE_OLD_NEIGHBOR + if (_gpu_nbor) { + #if defined(USE_OPENCL) && (defined(CL_VERSION_2_1) || \ + defined(CL_VERSION_3_0)) + if (dev->has_subgroup_support()) { + int simd_size_kernel= + _shared->k_build_nbor.max_subgroup_size(_block_nbor_build); + if (_simd_size != simd_size_kernel) { + _simd_size = simd_size_kernel; + if (_block_nbor_build < _simd_size) + _block_nbor_build = _simd_size; + _shared->clear(); + _shared->compile_kernels(devi, gpu_nbor, compile_flags+ + " -DMAX_SUBGROUPS_PER_BLOCK="+toa(_block_nbor_build/_simd_size)); + } + } + #endif + _bin_stencil.get_global(*(_shared->build_program),"bin_stencil"); + } + #endif + } + _max_block_nbor_build=_block_nbor_build; return success; } @@ -113,24 +151,44 @@ void Neighbor::alloc(bool &success) { dev_nbor.clear(); host_acc.clear(); int nt=_max_atoms+_max_host; - if (_use_packing==false || _gpu_nbor>0) - success=success && - (dev_nbor.alloc((_max_nbors+2)*_max_atoms,*dev)==UCL_SUCCESS); - else + if (_max_nbors) + _max_nbors = ((_max_nbors-1)/_threads_per_atom+1)*_threads_per_atom; + if (_use_packing==false || _gpu_nbor>0) { + if (_max_nbors) + success=success && + (dev_nbor.alloc((_max_nbors+2)*_max_atoms,*dev)==UCL_SUCCESS); + } else success=success && (dev_nbor.alloc(3*_max_atoms,*dev, UCL_READ_ONLY)==UCL_SUCCESS); - success=success && (host_acc.alloc(nt*2,*dev, - UCL_READ_WRITE)==UCL_SUCCESS); + if (_gpu_nbor != 2 || _max_host>0) + success=success && (host_acc.alloc(nt*2,*dev, + UCL_READ_WRITE)==UCL_SUCCESS); _c_bytes=dev_nbor.row_bytes(); if (_alloc_packed) { + if (_use_packing==false) { + dev_packed_begin.clear(); + success=success && (dev_packed_begin.alloc(_max_atoms,*dev, + _packed_permissions)==UCL_SUCCESS); + } + dev_packed.clear(); - success=success && (dev_packed.alloc((_max_nbors+2)*_max_atoms,*dev, - _packed_permissions)==UCL_SUCCESS); - dev_ilist.clear(); - success=success && (dev_ilist.alloc(_max_atoms,*dev, - UCL_READ_WRITE)==UCL_SUCCESS); - _c_bytes+=dev_packed.row_bytes()+dev_ilist.row_bytes(); + if (_max_nbors) + success=success && (dev_packed.alloc((_max_nbors+2)*_max_atoms,*dev, + _packed_permissions)==UCL_SUCCESS); + if (_ilist_map) { + if (_gpu_nbor) { + if (three_ilist.numel()==0) + success=success && (three_ilist.alloc(16,*dev,UCL_READ_WRITE, + UCL_READ_ONLY)==UCL_SUCCESS); + } else { + three_ilist.clear(); + success=success && (three_ilist.alloc(_max_atoms,*dev,UCL_READ_WRITE, + UCL_READ_ONLY)==UCL_SUCCESS); + } + _c_bytes+=three_ilist.row_bytes(); + } + _c_bytes+=dev_packed.row_bytes()+dev_packed_begin.row_bytes(); } if (_max_host>0) { nbor_host.clear(); @@ -138,8 +196,9 @@ void Neighbor::alloc(bool &success) { host_ilist.clear(); host_jlist.clear(); - success=(nbor_host.alloc(_max_nbors*_max_host,*dev,UCL_READ_WRITE, - UCL_READ_WRITE)==UCL_SUCCESS) && success; + if (_max_nbors) + success=(nbor_host.alloc(_max_nbors*_max_host,*dev,UCL_READ_WRITE, + UCL_READ_WRITE)==UCL_SUCCESS) && success; success=success && (dev_numj_host.alloc(_max_host,*dev, UCL_READ_WRITE)==UCL_SUCCESS); success=success && (host_ilist.alloc(nt,*dev,UCL_NOT_PINNED)==UCL_SUCCESS); @@ -157,7 +216,8 @@ void Neighbor::alloc(bool &success) { ptr+=_max_nbors; } _c_bytes+=nbor_host.device.row_bytes()+dev_numj_host.row_bytes(); - } else { + } else if (dev_nbor.numel()) { + if (!success) return; // Some OpenCL implementations return errors for nullptr pointers as args nbor_host.device.view(dev_nbor); dev_numj_host.view(dev_nbor); @@ -188,6 +248,12 @@ void Neighbor::clear() { if (_ncells>0) { _ncells=0; cell_counts.clear(); +#ifndef LAL_USE_OLD_NEIGHBOR + cell_subgroup_counts.clear(); + subgroup2cell.clear(); + _host_bin_stencil.clear(); + _bin_stencil.clear(); +#endif if (_gpu_nbor==2) delete [] cell_iter; } @@ -195,12 +261,15 @@ void Neighbor::clear() { _allocated=false; _nbor_time_avail=false; + _old_max_nbors=_max_nbors; + _max_nbors=0; host_packed.clear(); host_acc.clear(); - dev_ilist.clear(); + three_ilist.clear(); dev_nbor.clear(); nbor_host.clear(); dev_packed.clear(); + dev_packed_begin.clear(); dev_numj_host.clear(); host_ilist.clear(); host_jlist.clear(); @@ -236,9 +305,9 @@ void Neighbor::get_host(const int inum, int *ilist, int *numj, UCL_H_Vec ilist_view; ilist_view.view(ilist,inum,*dev); ucl_copy(dev_nbor,ilist_view,false); - - UCL_D_Vec nbor_offset; - UCL_H_Vec host_offset; + #ifndef GERYON_OCL_FLUSH + dev_nbor.flush(); + #endif int copy_count=0; int ij_count=0; @@ -263,9 +332,12 @@ void Neighbor::get_host(const int inum, int *ilist, int *numj, if (ij_count==IJ_SIZE) { dev_nbor.sync(); - host_offset.view_offset(IJ_SIZE*(copy_count%2),host_packed,IJ_SIZE); - nbor_offset.view_offset(dev_count,dev_packed,IJ_SIZE); - ucl_copy(nbor_offset,host_offset,true); + _host_offset.view_offset(IJ_SIZE*(copy_count%2),host_packed,IJ_SIZE); + _nbor_offset.view_offset(dev_count,dev_packed,IJ_SIZE); + ucl_copy(_nbor_offset,_host_offset,true); + #ifndef GERYON_OCL_FLUSH + _nbor_offset.flush(); + #endif copy_count++; ij_count=0; dev_count+=IJ_SIZE; @@ -275,21 +347,29 @@ void Neighbor::get_host(const int inum, int *ilist, int *numj, } if (ij_count!=0) { dev_nbor.sync(); - host_offset.view_offset(IJ_SIZE*(copy_count%2),host_packed,ij_count); - nbor_offset.view_offset(dev_count,dev_packed,ij_count); - ucl_copy(nbor_offset,host_offset,true); + _host_offset.view_offset(IJ_SIZE*(copy_count%2),host_packed,ij_count); + _nbor_offset.view_offset(dev_count,dev_packed,ij_count); + ucl_copy(_nbor_offset,_host_offset,true); + } + _acc_view.view_offset(inum,dev_nbor,inum*2); + if (_use_packing) + ucl_copy(_acc_view,host_acc,inum*2,true); + else { + ucl_copy(_acc_view,host_acc,inum,true); + _host_offset.view_offset(inum,host_acc,inum); + ucl_copy(dev_packed_begin,_host_offset,inum,true); } - UCL_D_Vec acc_view; - acc_view.view_offset(inum,dev_nbor,inum*2); - ucl_copy(acc_view,host_acc,inum*2,true); - UCL_H_Vec host_view; - host_view.alloc(_max_atoms,*dev,UCL_READ_WRITE); - for (int ii=0; ii(ceil(static_cast(inum)*_threads_per_atom/ block_size)); _shared->k_nbor.set_size(GX,block_size); - _shared->k_nbor.run(&dev_nbor, &dev_packed, &inum, &_threads_per_atom); + _shared->k_nbor.run(&dev_nbor, &dev_packed, &dev_packed_begin, &inum, + &_threads_per_atom); time_kernel.stop(); } } @@ -315,9 +396,6 @@ void Neighbor::get_host3(const int inum, const int nlist, int *ilist, int *numj, ilist_view.view(ilist,inum,*dev); ucl_copy(dev_nbor,ilist_view,false); - UCL_D_Vec nbor_offset; - UCL_H_Vec host_offset; - int copy_count=0; int ij_count=0; int acc_count=0; @@ -346,9 +424,9 @@ void Neighbor::get_host3(const int inum, const int nlist, int *ilist, int *numj, if (ij_count==IJ_SIZE) { dev_nbor.sync(); - host_offset.view_offset(IJ_SIZE*(copy_count%2),host_packed,IJ_SIZE); - nbor_offset.view_offset(dev_count,dev_packed,IJ_SIZE); - ucl_copy(nbor_offset,host_offset,true); + _host_offset.view_offset(IJ_SIZE*(copy_count%2),host_packed,IJ_SIZE); + _nbor_offset.view_offset(dev_count,dev_packed,IJ_SIZE); + ucl_copy(_nbor_offset,_host_offset,true); copy_count++; ij_count=0; dev_count+=IJ_SIZE; @@ -358,13 +436,18 @@ void Neighbor::get_host3(const int inum, const int nlist, int *ilist, int *numj, } if (ij_count!=0) { dev_nbor.sync(); - host_offset.view_offset(IJ_SIZE*(copy_count%2),host_packed,ij_count); - nbor_offset.view_offset(dev_count,dev_packed,ij_count); - ucl_copy(nbor_offset,host_offset,true); + _host_offset.view_offset(IJ_SIZE*(copy_count%2),host_packed,ij_count); + _nbor_offset.view_offset(dev_count,dev_packed,ij_count); + ucl_copy(_nbor_offset,_host_offset,true); + } + _acc_view.view_offset(inum,dev_nbor,inum*2); + if (_use_packing) + ucl_copy(_acc_view,host_acc,inum*2,true); + else { + ucl_copy(_acc_view,host_acc,inum,true); + _host_offset.view_offset(inum,host_acc,inum); + ucl_copy(dev_packed_begin,_host_offset,inum,true); } - UCL_D_Vec acc_view; - acc_view.view_offset(inum,dev_nbor,inum*2); - ucl_copy(acc_view,host_acc,inum*2,true); time_nbor.stop(); if (_use_packing==false) { @@ -372,20 +455,28 @@ void Neighbor::get_host3(const int inum, const int nlist, int *ilist, int *numj, int GX=static_cast(ceil(static_cast(inum)*_threads_per_atom/ block_size)); _shared->k_nbor.set_size(GX,block_size); - _shared->k_nbor.run(&dev_nbor, &dev_packed, &inum, &_threads_per_atom); + _shared->k_nbor.run(&dev_nbor, &dev_packed, &dev_packed_begin, &inum, + &_threads_per_atom); time_kernel.stop(); } } template -void Neighbor::resize_max_neighbors(const int maxn, bool &success) { +void Neighbor::resize_max_neighbors(int maxn, bool &success) { + if (maxn == 0) maxn = 1; if (maxn>_max_nbors) { int mn=static_cast(static_cast(maxn)*1.10); - mn=(mn/_threads_per_atom+1)*_threads_per_atom; - success=success && (dev_nbor.resize((mn+1)*_max_atoms)==UCL_SUCCESS); + mn = ((mn-1)/_threads_per_atom+1)*_threads_per_atom; + dev_nbor.clear(); + success=success && + (dev_nbor.alloc((mn+2)*_max_atoms,*dev)==UCL_SUCCESS); + if (!success) return; _gpu_bytes=dev_nbor.row_bytes(); if (_max_host>0) { - success=success && (nbor_host.resize(mn*_max_host)==UCL_SUCCESS); + nbor_host.clear(); + success=(nbor_host.alloc(mn*_max_host,*dev,UCL_READ_WRITE, + UCL_READ_WRITE)==UCL_SUCCESS) && success; + if (!success) return; int *ptr=nbor_host.host.begin(); for (int i=0; i<_max_host; i++) { host_jlist[i]=ptr; @@ -397,7 +488,9 @@ void Neighbor::resize_max_neighbors(const int maxn, bool &success) { dev_numj_host.view(dev_nbor); } if (_alloc_packed) { - success=success && (dev_packed.resize((mn+2)*_max_atoms)==UCL_SUCCESS); + dev_packed.clear(); + success=success && (dev_packed.alloc((mn+2)*_max_atoms,*dev, + _packed_permissions)==UCL_SUCCESS); _gpu_bytes+=dev_packed.row_bytes(); } _max_nbors=mn; @@ -409,32 +502,66 @@ void Neighbor::build_nbor_list(double **x, const int inum, const int host_inum, const int nall, Atom &atom, double *sublo, double *subhi, tagint *tag, int **nspecial, tagint **special, bool &success, - int &mn) { + int &mn, UCL_Vector &error_flag) { _nbor_time_avail=true; const int nt=inum+host_inum; + const double subx = subhi[0]-sublo[0]; + const double suby = subhi[1]-sublo[1]; + const double subz = subhi[2]-sublo[2]; + // Calculate number of cells and allocate storage for binning as necessary - int ncellx, ncelly, ncellz, ncell_3d; - int ghost_cells=2*_cells_in_cutoff; - ncellx = static_cast(ceil((subhi[0]-sublo[0])/_cell_size))+ghost_cells; - ncelly = static_cast(ceil((subhi[1]-sublo[1])/_cell_size))+ghost_cells; - ncellz = static_cast(ceil((subhi[2]-sublo[2])/_cell_size))+ghost_cells; - ncell_3d = ncellx * ncelly * ncellz; + int ncellx, ncelly, ncellz; + int cells_in_cutoff=static_cast(ceil(_cutoff/_cell_size)); + int ghost_cells=2*cells_in_cutoff; + ncellx = static_cast(ceil(subx/_cell_size))+ghost_cells; + ncelly = static_cast(ceil(suby/_cell_size))+ghost_cells; + ncellz = static_cast(ceil(subz/_cell_size))+ghost_cells; + + #ifndef LAL_USE_OLD_NEIGHBOR + if (_auto_cell_size && subz>0.0) { + if (_old_ncellx!=ncellx || _old_ncelly!=ncelly || _old_ncellz!=ncellz) { + _cell_size = _shared->best_cell_size(subx, suby, subz, nt, _cutoff); + cells_in_cutoff=static_cast(ceil(_cutoff/_cell_size)); + ghost_cells=2*cells_in_cutoff; + ncellx = static_cast(ceil(subx/_cell_size))+ghost_cells; + ncelly = static_cast(ceil(suby/_cell_size))+ghost_cells; + ncellz = static_cast(ceil(subz/_cell_size))+ghost_cells; + } + } + #endif + + int ncell_3d = ncellx * ncelly * ncellz; if (ncell_3d+1>_ncells) { cell_counts.clear(); +#ifndef LAL_USE_OLD_NEIGHBOR + cell_subgroup_counts.clear(); +#endif if (_gpu_nbor==2) { if (_ncells>0) delete [] cell_iter; cell_iter = new int[ncell_3d+1]; - cell_counts.alloc(ncell_3d+1,dev_nbor,UCL_READ_WRITE,UCL_READ_ONLY); + success = success && (cell_counts.alloc(ncell_3d+1,*dev, + UCL_READ_WRITE,UCL_READ_ONLY) == UCL_SUCCESS); +#ifndef LAL_USE_OLD_NEIGHBOR + success = success && (cell_subgroup_counts.alloc(ncell_3d+1,*dev, + UCL_READ_WRITE,UCL_READ_ONLY) == UCL_SUCCESS); + if (!success) return; + cell_subgroup_counts.host[0]=0; +#endif } else { cell_counts.device.clear(); - cell_counts.device.alloc(ncell_3d+1,dev_nbor); + success = success && (cell_counts.device.alloc(ncell_3d+1, + *dev) == UCL_SUCCESS); } + if (!success) return; _ncells=ncell_3d+1; _cell_bytes=cell_counts.device.row_bytes(); +#ifndef LAL_USE_OLD_NEIGHBOR + _cell_bytes+=cell_subgroup_counts.row_bytes()+subgroup2cell.row_bytes(); +#endif } const numtyp cutoff_cast=static_cast(_cutoff); @@ -463,7 +590,13 @@ void Neighbor::build_nbor_list(double **x, const int inum, const int host_inum, } // If binning on CPU, do this now +#ifndef LAL_USE_OLD_NEIGHBOR + int subgroup_count = 0; +#endif if (_gpu_nbor==2) { + #ifndef GERYON_OCL_FLUSH + dev_nbor.flush(); + #endif double stime = MPI_Wtime(); int *cell_id=atom.host_cell_id.begin(); int *particle_id=atom.host_particle_id.begin(); @@ -472,21 +605,21 @@ void Neighbor::build_nbor_list(double **x, const int inum, const int host_inum, cell_counts.host.zero(); double i_cell_size=1.0/_cell_size; - int offset_hi=_cells_in_cutoff+1; + int offset_hi=cells_in_cutoff+1; for (int i=0; i(px*i_cell_size+1); - ix = std::max(ix,_cells_in_cutoff); + int ix = static_cast(px*i_cell_size+cells_in_cutoff); + ix = std::max(ix,cells_in_cutoff); ix = std::min(ix,ncellx-offset_hi); - int iy = static_cast(py*i_cell_size+1); - iy = std::max(iy,_cells_in_cutoff); + int iy = static_cast(py*i_cell_size+cells_in_cutoff); + iy = std::max(iy,cells_in_cutoff); iy = std::min(iy,ncelly-offset_hi); - int iz = static_cast(pz*i_cell_size+1); - iz = std::max(iz,_cells_in_cutoff); + int iz = static_cast(pz*i_cell_size+cells_in_cutoff); + iz = std::max(iz,cells_in_cutoff); iz = std::min(iz,ncellz-offset_hi); int id = ix+iy*ncellx+iz*ncellx*ncelly; @@ -494,19 +627,40 @@ void Neighbor::build_nbor_list(double **x, const int inum, const int host_inum, cell_counts[id+1]++; } +#ifndef LAL_USE_OLD_NEIGHBOR + // populate subgroup counts only for the local atoms + for (int i=1; i<_ncells; i++) { + cell_subgroup_counts[i] = ceil(static_cast(cell_counts[i]) / + _simd_size); + subgroup_count += cell_subgroup_counts[i]; + cell_subgroup_counts[i] += cell_subgroup_counts[i-1]; + } + if (subgroup_count > subgroup2cell.numel()) { + subgroup2cell.clear(); + success = success && (subgroup2cell.alloc(1.1*subgroup_count,*dev, + UCL_READ_WRITE,UCL_READ_ONLY) == UCL_SUCCESS); + if (!success) return; + _cell_bytes=cell_counts.device.row_bytes() + + cell_subgroup_counts.row_bytes()+subgroup2cell.row_bytes(); + } + for (int i=1; i<_ncells; i++) + for (int j=cell_subgroup_counts[i-1]; j(px*i_cell_size+1); + int ix = static_cast(px*i_cell_size); ix = std::max(ix,0); ix = std::min(ix,ncellx-1); - int iy = static_cast(py*i_cell_size+1); + int iy = static_cast(py*i_cell_size); iy = std::max(iy,0); iy = std::min(iy,ncelly-1); - int iz = static_cast(pz*i_cell_size+1); + int iz = static_cast(pz*i_cell_size); iz = std::max(iz,0); iz = std::min(iz,ncellz-1); @@ -518,21 +672,54 @@ void Neighbor::build_nbor_list(double **x, const int inum, const int host_inum, mn=0; for (int i=0; i<_ncells; i++) mn=std::max(mn,cell_counts[i]); - mn*=8; - set_nbor_block_size(mn/2); - + double mind=std::min(subx,suby); + mind=std::min(mind,subz) + _cutoff; + double ics; + if (mind >= _cell_size) ics = i_cell_size; + else ics = 1.0 / mind; + double vadjust=_cutoff*ics; + vadjust*=vadjust*vadjust*4.1888; + if (_cutoff < _cell_size) vadjust*=1.46; + mn=std::max(mn,static_cast(ceil(_max_neighbor_factor*vadjust*mn))); + if (mn<33) mn+=3; resize_max_neighbors(mn,success); + set_nbor_block_size(mn/2); if (!success) return; _total_atoms=nt; + // For neighbor builds for host atoms, _max_nbors is used for neighbor + // allocation offsets. + if (_max_host > 0) mn=_max_nbors; + cell_iter[0]=0; for (int i=1; i<_ncells; i++) { cell_counts[i]+=cell_counts[i-1]; cell_iter[i]=cell_counts[i]; } time_hybrid1.start(); - cell_counts.update_device(true); + #ifndef LAL_USE_OLD_NEIGHBOR + if (_old_ncellx!=ncellx || _old_ncelly!=ncelly || _old_ncellz!=ncellz) { + _old_ncellx = ncellx; + _old_ncelly = ncelly; + _old_ncellz = ncellz; + const int bin_stencil_stride = cells_in_cutoff * 2 + 1; + const int bin_stencil_size = bin_stencil_stride * bin_stencil_stride; + if (bin_stencil_size > _host_bin_stencil.numel()) + _host_bin_stencil.alloc(bin_stencil_size,*dev); + for (int s = 0; sk_cell_id.run(&atom.x, &atom.dev_cell_id, &atom.dev_particle_id, &sublo0, &sublo1, &sublo2, &i_cell_size, &ncellx, &ncelly, &ncellz, - &nt, &nall, &_cells_in_cutoff); + &nt, &nall, &cells_in_cutoff); atom.sort_neighbor(nall); @@ -575,22 +762,37 @@ void Neighbor::build_nbor_list(double **x, const int inum, const int host_inum, /* build the neighbor list */ const int cell_block=_block_nbor_build; +#ifndef LAL_USE_OLD_NEIGHBOR + int nblocks = (subgroup_count-1)/(cell_block/_simd_size)+1; + _shared->k_build_nbor.set_size(nblocks, cell_block); + _shared->k_build_nbor.run(&atom.x, &atom.dev_particle_id, + &cell_counts, &dev_nbor, &nbor_host, + &dev_numj_host, &mn, &cutoff_cast, &ncellx, + &ncelly, &ncellz, &inum, &nt, &nall, + &_threads_per_atom, &cells_in_cutoff, + &cell_subgroup_counts, &subgroup2cell, + &subgroup_count, _bin_stencil.begin(), + &error_flag); + error_flag.update_host(); +#else _shared->k_build_nbor.set_size(ncellx-ghost_cells,(ncelly-ghost_cells)* (ncellz-ghost_cells),cell_block,1); _shared->k_build_nbor.run(&atom.x, &atom.dev_particle_id, &cell_counts, &dev_nbor, &nbor_host, - &dev_numj_host, &_max_nbors, &cutoff_cast, &ncellx, + &dev_numj_host, &mn, &cutoff_cast, &ncellx, &ncelly, &ncellz, &inum, &nt, &nall, - &_threads_per_atom, &_cells_in_cutoff); + &_threads_per_atom, &cells_in_cutoff); +#endif /* Get the maximum number of nbors and realloc if necessary */ - UCL_D_Vec numj; - numj.view_offset(inum,dev_nbor,inum); - ucl_copy(host_acc,numj,inum,true); - if (nt>inum) { - UCL_H_Vec host_offset; - host_offset.view_offset(inum,host_acc,nt-inum); - ucl_copy(host_offset,dev_numj_host,nt-inum,true); + UCL_D_Vec _numj_view; + if (_gpu_nbor!=2 || inuminum) { + _host_offset.view_offset(inum,host_acc,nt-inum); + ucl_copy(_host_offset,dev_numj_host,nt-inum,true); + } } if (_gpu_nbor!=2) { @@ -608,7 +810,7 @@ void Neighbor::build_nbor_list(double **x, const int inum, const int host_inum, if (_time_device) time_kernel.add_to_total(); build_nbor_list(x, inum, host_inum, nall, atom, sublo, subhi, tag, - nspecial, special, success, mn); + nspecial, special, success, mn, error_flag); return; } } @@ -634,5 +836,5 @@ void Neighbor::build_nbor_list(double **x, const int inum, const int host_inum, template void Neighbor::build_nbor_list (double **x, const int inum, const int host_inum, const int nall, Atom &atom, double *sublo, double *subhi, - tagint *, int **, tagint **, bool &success, int &mn); - + tagint *, int **, tagint **, bool &success, int &mn, + UCL_Vector &error_flag); diff --git a/lib/gpu/lal_neighbor.h b/lib/gpu/lal_neighbor.h index 996deaff6d..5939567a41 100644 --- a/lib/gpu/lal_neighbor.h +++ b/lib/gpu/lal_neighbor.h @@ -1,6 +1,7 @@ /*************************************************************************** neighbor.h ------------------- + Nitin Dhamankar (Intel) W. Michael Brown (ORNL) Peng Wang (Nvidia) @@ -19,14 +20,25 @@ #include "lal_atom.h" #include "lal_neighbor_shared.h" +#include #define IJ_SIZE 131072 +#if !defined(USE_OPENCL) && !defined(USE_HIP) +#ifndef LAL_USE_OLD_NEIGHBOR +// Issue with incorrect results with CUDA 11.2 +#if (CUDA_VERSION > 11019) && (CUDA_VERSION < 11030) +#define LAL_USE_OLD_NEIGHBOR +#endif +#endif +#endif + namespace LAMMPS_AL { class Neighbor { public: - Neighbor() : _allocated(false), _use_packing(false), _ncells(0) {} + Neighbor() : _allocated(false), _use_packing(false), _ncells(0), + _old_max_nbors(0) {} ~Neighbor() { clear(); } /// Determine whether neighbor unpacking should be used @@ -37,7 +49,7 @@ class Neighbor { /// Clear any old data and setup for new LAMMPS run /** \param inum Initial number of particles whose neighbors stored on device * \param host_inum Initial number of particles whose nbors copied to host - * \param max_nbors Initial number of rows in the neighbor matrix + * \param max_nbors Factor (in percentage) applied to density calculated max * \param gpu_nbor 0 if neighboring will be performed on host * gpu_nbor 1 if neighboring will be performed on device * gpu_nbor 2 if binning on host and neighboring on device @@ -48,33 +60,41 @@ class Neighbor { * than the force kernel * \param threads_per_atom Number of threads used per atom for force * calculation - * \param compile_flags Flags for JIT compiling **/ + * \param compile_flags Flags for JIT compiling + * \param ilist_map true if ilist mapping data structures used (3-body) **/ bool init(NeighborShared *shared, const int inum, const int host_inum, const int max_nbors, const int maxspecial, UCL_Device &dev, const int gpu_nbor, const int gpu_host, const bool pre_cut, const int block_cell_2d, const int block_cell_id, const int block_nbor_build, const int threads_per_atom, - const int warp_size, const bool time_device, - const std::string compile_flags); + const int simd_size, const bool time_device, + const std::string compile_flags, const bool ilist_map); - /// Set the size of the cutoff+skin - inline void cell_size(const double size, const double cutoff) { - _cell_size=size; + /// Set the cutoff+skin + inline void set_cutoff(const double cutoff) { _cutoff=cutoff; - if (cutoff>size) - _cells_in_cutoff=static_cast(ceil(cutoff/size)); - else - _cells_in_cutoff=1; + + #ifndef LAL_USE_OLD_NEIGHBOR + _cell_size=_shared->cell_size(); + _auto_cell_size=_shared->auto_cell_size(); + const int cells_in_cutoff=static_cast(ceil(_cutoff/_cell_size)); + if (cells_in_cutoff > 2) _cell_size=_cutoff*0.5; + _old_ncellx = _old_ncelly = _old_ncellz = -1; + #else + _cell_size=cutoff; + _auto_cell_size=false; + #endif } - /// Get the size of the cutoff+skin - inline double cell_size() const { return _cell_size; } + /// Get the cutoff+skin + inline double cutoff() { return _cutoff; } /// Check if there is enough memory for neighbor data and realloc if not /** \param inum Number of particles whose nbors will be stored on device * \param max_nbor Current max number of neighbors for a particle * \param success False if insufficient memory **/ - inline void resize(const int inum, const int max_nbor, bool &success) { + inline void resize(const int inum, int max_nbor, bool &success) { + if (max_nbor == 0) max_nbor = 1; if (inum>_max_atoms || max_nbor>_max_nbors) { _max_atoms=static_cast(static_cast(inum)*1.10); if (max_nbor>_max_nbors) @@ -88,8 +108,9 @@ class Neighbor { * \param host_inum Number of particles whose nbors will be copied to host * \param max_nbor Current max number of neighbors for a particle * \param success False if insufficient memory **/ - inline void resize(const int inum, const int host_inum, const int max_nbor, + inline void resize(const int inum, const int host_inum, int max_nbor, bool &success) { + if (max_nbor == 0) max_nbor = 1; if (inum>_max_atoms || max_nbor>_max_nbors || host_inum>_max_host) { _max_atoms=static_cast(static_cast(inum)*1.10); _max_host=static_cast(static_cast(host_inum)*1.10); @@ -99,15 +120,8 @@ class Neighbor { } } - inline void acc_timers() { + inline void acc_timers(FILE *screen) { if (_nbor_time_avail) { - if (_gpu_nbor==2) { - int mn=0; - for (int i=0; i<_total_atoms; i++) - mn=std::max(mn,host_acc[i]); - if (mn>_max_nbors) - assert(0==1); - } if (_time_device) { time_nbor.add_to_total(); if (_use_packing==false) time_kernel.add_to_total(); @@ -172,9 +186,10 @@ class Neighbor { /// Build nbor list on the device template void build_nbor_list(double **x, const int inum, const int host_inum, - const int nall, Atom &atom, double *sublo, - double *subhi, tagint *tag, int **nspecial, tagint **special, - bool &success, int &max_nbors); + const int nall, Atom &atom, + double *sublo, double *subhi, tagint *tag, + int **nspecial, tagint **special, bool &success, + int &max_nbors, UCL_Vector &error_flag); /// Return the number of bytes used on device inline double gpu_bytes() { @@ -193,14 +208,16 @@ class Neighbor { * - 3rd row is starting location in packed nbors * - Remaining rows are the neighbors arranged for coalesced access **/ UCL_D_Vec dev_nbor; + /// Starting location in packed neighbors used only by unpack kernel + UCL_D_Vec dev_packed_begin; /// Packed storage for neighbor lists copied from host UCL_D_Vec dev_packed; /// Host buffer for copying neighbor lists UCL_H_Vec host_packed; /// Host storage for nbor counts (row 1) & accumulated neighbor counts (row2) UCL_H_Vec host_acc; - /// Device storage for accessing atom indices from the neighbor list (3-body) - UCL_D_Vec dev_ilist; + /// Storage for accessing atom indices from the neighbor list (3-body) + UCL_Vector three_ilist; // ----------------- Data for GPU Neighbor Calculation --------------- @@ -217,18 +234,36 @@ class Neighbor { UCL_D_Vec dev_special, dev_special_t; /// Host/Device storage for number of particles per cell UCL_Vector cell_counts; + #ifndef LAL_USE_OLD_NEIGHBOR + /// Host/Device storage for number of subgroups per cell + UCL_Vector cell_subgroup_counts; + /// Host/Device storage for subgroup to cell mapping + UCL_Vector subgroup2cell; + #endif int *cell_iter; /// Device timers UCL_Timer time_nbor, time_kernel, time_hybrid1, time_hybrid2, time_transpose; + /// Effective SIMD width of neighbor build kernel + inline int simd_size() { return _simd_size; } + + template + inline std::string toa(const t& in) { + std::ostringstream o; + o.precision(2); + o << in; + return o.str(); + } + private: NeighborShared *_shared; UCL_Device *dev; bool _allocated, _use_packing, _nbor_time_avail, _time_device; int _gpu_nbor, _max_atoms, _max_nbors, _max_host, _nbor_pitch, _maxspecial; - bool _gpu_host, _alloc_packed; - double _cutoff, _cell_size, _bin_time; + int _old_max_nbors; + bool _gpu_host, _alloc_packed, _ilist_map, _auto_cell_size; + double _cutoff, _bin_time, _max_neighbor_factor, _cell_size; enum UCL_MEMOPT _packed_permissions; double _gpu_bytes, _c_bytes, _cell_bytes; @@ -236,18 +271,29 @@ class Neighbor { int _block_cell_2d, _block_cell_id, _max_block_nbor_build, _block_nbor_build; int _ncells, _threads_per_atom, _total_atoms; - int _cells_in_cutoff; template - inline void resize_max_neighbors(const int maxn, bool &success); + inline void resize_max_neighbors(int maxn, bool &success); - int _warp_size; + // For viewing host arrays for data copy operations + UCL_H_Vec _host_offset; + UCL_D_Vec _nbor_offset, _acc_view, _numj_view; + + #ifndef LAL_USE_OLD_NEIGHBOR + UCL_H_Vec _host_bin_stencil; + UCL_Const _bin_stencil; + int _old_ncellx, _old_ncelly, _old_ncellz; + #endif + + int _simd_size; inline void set_nbor_block_size(const int mn) { - int desired=mn/(2*_warp_size); - desired*=_warp_size; - if (desired<_warp_size) desired=_warp_size; + #ifdef LAL_USE_OLD_NEIGHBOR + int desired=mn/(2*_simd_size); + desired*=_simd_size; + if (desired<_simd_size) desired=_simd_size; else if (desired>_max_block_nbor_build) desired=_max_block_nbor_build; _block_nbor_build=desired; + #endif } }; diff --git a/lib/gpu/lal_neighbor_cpu.cu b/lib/gpu/lal_neighbor_cpu.cu index f8b32e1746..3dfe23bdc2 100644 --- a/lib/gpu/lal_neighbor_cpu.cu +++ b/lib/gpu/lal_neighbor_cpu.cu @@ -19,6 +19,7 @@ __kernel void kernel_unpack(__global int *dev_nbor, const __global int *dev_ij, + const __global int *dev_ij_begin, const int inum, const int t_per_atom) { int tid=THREAD_ID_X; int offset=tid & (t_per_atom-1); @@ -28,7 +29,7 @@ __kernel void kernel_unpack(__global int *dev_nbor, int nbor=ii+inum; int numj=dev_nbor[nbor]; nbor+=inum; - int list=dev_nbor[nbor]; + int list=dev_ij_begin[ii]; int list_end=list+numj; list+=offset; nbor+=fast_mul(ii,t_per_atom-1)+offset; @@ -40,4 +41,3 @@ __kernel void kernel_unpack(__global int *dev_nbor, } } // if ii } - diff --git a/lib/gpu/lal_neighbor_gpu.cu b/lib/gpu/lal_neighbor_gpu.cu index f1da437c86..2aca505396 100644 --- a/lib/gpu/lal_neighbor_gpu.cu +++ b/lib/gpu/lal_neighbor_gpu.cu @@ -1,6 +1,7 @@ // ************************************************************************** // neighbor_gpu.cu // ------------------- +// Nitin Dhamankar (Intel) // Peng Wang (Nvidia) // W. Michael Brown (ORNL) // @@ -32,7 +33,14 @@ _texture( pos_tex,float4); _texture_2d( pos_tex,int4); #endif -__kernel void calc_cell_id(const numtyp4 *restrict pos, +#ifdef NV_KERNEL +#if (__CUDACC_VER_MAJOR__ == 11) && (__CUDACC_VER_MINOR__ == 2) +// Issue with incorrect results in CUDA 11.2 +#define LAL_USE_OLD_NEIGHBOR +#endif +#endif + +__kernel void calc_cell_id(const numtyp4 *restrict x_, unsigned *restrict cell_id, int *restrict particle_id, numtyp boxlo0, numtyp boxlo1, numtyp boxlo2, @@ -43,7 +51,7 @@ __kernel void calc_cell_id(const numtyp4 *restrict pos, if (i < nall) { numtyp4 p; - fetch4(p,i,pos_tex); //pos[i]; + fetch4(p,i,pos_tex); //x_[i]; p.x -= boxlo0; p.y -= boxlo1; @@ -138,16 +146,219 @@ __kernel void transpose(__global tagint *restrict out, out[j*rows_in+i] = block[ti][tj]; } +#ifndef LAL_USE_OLD_NEIGHBOR + +#define MAX_STENCIL_SIZE 25 +#if !defined(MAX_SUBGROUPS_PER_BLOCK) +#define MAX_SUBGROUPS_PER_BLOCK 8 +#endif + +#if defined(NV_KERNEL) || defined(USE_HIP) +__device__ __constant__ int bin_stencil[MAX_STENCIL_SIZE]; +#endif + __kernel void calc_neigh_list_cell(const __global numtyp4 *restrict x_, - const __global int *restrict cell_particle_id, - const __global int *restrict cell_counts, - __global int *nbor_list, - __global int *host_nbor_list, - __global int *host_numj, - int neigh_bin_size, numtyp cell_size, - int ncellx, int ncelly, int ncellz, - int inum, int nt, int nall, int t_per_atom, - int cells_in_cutoff) + const __global int *restrict cell_particle_id, + const __global int *restrict cell_counts, + __global int *nbor_list, + __global int *host_nbor_list, + __global int *host_numj, + int neigh_bin_size, numtyp cutoff_neigh, + int ncellx, int ncelly, int ncellz, + int inum, int nt, int nall, int t_per_atom, + int cells_in_cutoff, + const __global int *restrict cell_subgroup_counts, + const __global int *restrict subgroup2cell, + int subgroup_count, +#if defined(NV_KERNEL) || defined(USE_HIP) + int *not_used, __global int *error_flag) +#else + __constant int *bin_stencil, + __global int *error_flag) +#endif +{ + int tid = THREAD_ID_X; + int bsx = BLOCK_SIZE_X; + int simd_size = simd_size(); + int subgroup_id_local = tid / simd_size; + int subgroup_id_global = BLOCK_ID_X * bsx / simd_size + subgroup_id_local; + int lane_id = tid % simd_size; + +#if (SHUFFLE_AVAIL == 0) + __local int cell_list_sh[BLOCK_NBOR_BUILD]; + __local numtyp4 pos_sh[BLOCK_NBOR_BUILD]; + __local int local_cell_counts[BLOCK_NBOR_BUILD]; +#endif + __local int local_begin[(MAX_STENCIL_SIZE+1)*MAX_SUBGROUPS_PER_BLOCK]; + __local int local_counts[(MAX_STENCIL_SIZE+1)*MAX_SUBGROUPS_PER_BLOCK]; + + if (subgroup_id_global < subgroup_count) { + // identify own cell for subgroup (icell) and local atom (i) for the lane + int icell = subgroup2cell[subgroup_id_global]; + int icell_end = cell_counts[icell+1]; + int i = cell_counts[icell] + (subgroup_id_global - + cell_subgroup_counts[icell]) * + simd_size + lane_id; + + // Get count of the number of iterations to finish all cells + const int bin_stencil_stride = cells_in_cutoff * 2 + 1; + const int bin_stencil_size = bin_stencil_stride * bin_stencil_stride; + int offset = 0; + int cell_count = 0, jcellyz, jcell_begin; + const int offset2 = subgroup_id_local * (MAX_STENCIL_SIZE+1); + const int niter = (bin_stencil_size - 1)/simd_size + 1; + int end_idx = simd_size; + for (int ni = 0; ni < niter; ni++) { + if (ni == niter - 1) + end_idx = bin_stencil_size - offset; + if (lane_id < end_idx) { + jcellyz = icell + bin_stencil[lane_id + offset]; + jcell_begin = cell_counts[jcellyz - cells_in_cutoff]; + local_begin[lane_id + offset2 + offset] = jcell_begin; + const int local_count = cell_counts[jcellyz + cells_in_cutoff + 1] - + jcell_begin; + cell_count += local_count; + local_counts[lane_id + offset2 + offset] = local_count; + } + offset += simd_size; + } + +#if (SHUFFLE_AVAIL == 0) + local_cell_counts[tid] = cell_count; + offset = subgroup_id_local * simd_size; + for (unsigned int mask=simd_size/2; mask>0; mask>>=1) { + simdsync(); + local_cell_counts[tid] += local_cell_counts[ offset + lane_id^mask ]; + } + simdsync(); + cell_count = local_cell_counts[tid]; +#else + #pragma unroll + for (unsigned int s=simd_size/2; s>0; s>>=1) + cell_count += shfl_xor(cell_count, s, simd_size); +#endif + + int num_iter = cell_count; + int remainder = num_iter % simd_size; + if (remainder == 0) remainder = simd_size; + if (num_iter) num_iter = (num_iter - 1) / simd_size + 1; + + numtyp4 diff; + numtyp r2; + + int pid_i = nall, lpid_j, stride; + numtyp4 atom_i, atom_j; + int cnt = 0; + __global int *neigh_counts, *neigh_list; + + if (i < icell_end) + pid_i = cell_particle_id[i]; + + if (pid_i < nt) { + fetch4(atom_i,pid_i,pos_tex); //pos[i]; + } + + if (pid_i < inum) { + stride=inum; + neigh_counts=nbor_list+stride+pid_i; + neigh_list=neigh_counts+stride+pid_i*(t_per_atom-1); + stride=stride*t_per_atom-t_per_atom; + nbor_list[pid_i]=pid_i; + } else { + stride=0; + neigh_counts=host_numj+pid_i-inum; + neigh_list=host_nbor_list+(pid_i-inum)*neigh_bin_size; + } + + // loop through neighbors + int bin_shift = 0; + int zy = -1; + int num_atom_cell = 0; + int cell_pos = lane_id; + end_idx = simd_size; + for (int ci = 0; ci < num_iter; ci++) { + cell_pos += simd_size; + while (cell_pos >= num_atom_cell && zy < bin_stencil_size) { + // Shift lane index into atom bins based on remainder from last bin + bin_shift += num_atom_cell % simd_size; + if (bin_shift >= simd_size) bin_shift -= simd_size; + cell_pos = lane_id - bin_shift; + if (cell_pos < 0) cell_pos += simd_size; + // Move to next bin + zy++; + jcell_begin = local_begin[offset2 + zy]; + num_atom_cell = local_counts[offset2 + zy]; + } + + if (zy < bin_stencil_size) { + lpid_j = cell_particle_id[jcell_begin + cell_pos]; + fetch4(atom_j,lpid_j,pos_tex); +#if (SHUFFLE_AVAIL == 0) + cell_list_sh[tid] = lpid_j; + pos_sh[tid].x = atom_j.x; + pos_sh[tid].y = atom_j.y; + pos_sh[tid].z = atom_j.z; + } + simdsync(); +#else + } +#endif + + if (ci == num_iter-1) end_idx = remainder; + + for (int j = 0; j < end_idx; j++) { +#if (SHUFFLE_AVAIL == 0) + int pid_j = cell_list_sh[offset+j]; // gather from shared memory + diff.x = atom_i.x - pos_sh[offset+j].x; + diff.y = atom_i.y - pos_sh[offset+j].y; + diff.z = atom_i.z - pos_sh[offset+j].z; +#else + int pid_j = simd_broadcast_i(lpid_j, j, simd_size); +#ifdef _DOUBLE_DOUBLE + diff.x = atom_i.x - simd_broadcast_d(atom_j.x, j, simd_size); + diff.y = atom_i.y - simd_broadcast_d(atom_j.y, j, simd_size); + diff.z = atom_i.z - simd_broadcast_d(atom_j.z, j, simd_size); +#else + diff.x = atom_i.x - simd_broadcast_f(atom_j.x, j, simd_size); + diff.y = atom_i.y - simd_broadcast_f(atom_j.y, j, simd_size); + diff.z = atom_i.z - simd_broadcast_f(atom_j.z, j, simd_size); +#endif +#endif + + r2 = diff.x*diff.x + diff.y*diff.y + diff.z*diff.z; +//USE CUTOFFSQ? + if (r2 < cutoff_neigh*cutoff_neigh && pid_j != pid_i && pid_i < nt) { + if (cnt < neigh_bin_size) { + cnt++; + *neigh_list = pid_j; + neigh_list++; + if ((cnt & (t_per_atom-1))==0) + neigh_list=neigh_list+stride; + } else + *error_flag=1; + } + } // for j +#if (SHUFFLE_AVAIL == 0) + simdsync(); +#endif + } // for (ci) + if (pid_i < nt) + *neigh_counts = cnt; + } // if (subgroup_id_global < subgroup_count) +} + +#else + +__kernel void calc_neigh_list_cell(const __global numtyp4 *restrict x_, + const __global int *restrict cell_particle_id, + const __global int *restrict cell_counts, + __global int *nbor_list, + __global int *host_nbor_list, + __global int *host_numj, + int neigh_bin_size, numtyp cell_size, + int ncellx, int ncelly, int ncellz, + int inum, int nt, int nall, int t_per_atom, + int cells_in_cutoff) { int tid = THREAD_ID_X; int ix = BLOCK_ID_X + cells_in_cutoff; @@ -232,7 +443,7 @@ __kernel void calc_neigh_list_cell(const __global numtyp4 *restrict x_, diff.z = atom_i.z - pos_sh[j].z; r2 = diff.x*diff.x + diff.y*diff.y + diff.z*diff.z; - if (r2 < cell_size*cell_size && pid_j != pid_i) { // && r2 > 1e-5 + if (r2 < cell_size*cell_size && pid_j != pid_i) { cnt++; if (cnt <= neigh_bin_size) { *neigh_list = pid_j; @@ -253,6 +464,8 @@ __kernel void calc_neigh_list_cell(const __global numtyp4 *restrict x_, } // for (i) } +#endif + __kernel void kernel_special(__global int *dev_nbor, __global int *host_nbor_list, const __global int *host_numj, @@ -310,4 +523,3 @@ __kernel void kernel_special(__global int *dev_nbor, } } // if ii } - diff --git a/lib/gpu/lal_neighbor_shared.cpp b/lib/gpu/lal_neighbor_shared.cpp index f1458b35be..e1c3f5ca68 100644 --- a/lib/gpu/lal_neighbor_shared.cpp +++ b/lib/gpu/lal_neighbor_shared.cpp @@ -13,6 +13,7 @@ email : brownw@ornl.gov ***************************************************************************/ +#include #include "lal_precision.h" #include "lal_neighbor_shared.h" @@ -48,6 +49,45 @@ void NeighborShared::clear() { } } +double NeighborShared::best_cell_size(const double subx, const double suby, + const double subz, const int nlocal, + const double cut) { + if (_cached_cell_size && _cut_sort==cut) { + _cached_cell_size=false; + return _cell_size; + } + + const double box_density = static_cast(nlocal) / (subx*suby*subz); + const double density=box_density*cut*cut*cut; + if (density >= 4.0 * _simd_size) return cut*0.5; + else if (density >= 0.5 * _simd_size) return cut; + + const double iters = 60; + const double inc = cut/(iters-1); + const double iss = 1.0 / _simd_size; + double test_size = cut; + double best_iters = 1e200; + double best_size; + for (int i = 0; i < iters; i++) { + const double i_test_size = 1.0/test_size; + const int ncellx = static_cast(ceil(subx*i_test_size)); + const int ncelly = static_cast(ceil(suby*i_test_size)); + const int ncellz = static_cast(ceil(subz*i_test_size)); + const double density = box_density*test_size*test_size*test_size; + const double iters_per_cell = ceil(iss*density); + const double iters = ncellx*ncelly*ncellz*iters_per_cell* + ceil(density*27.0*iss); + if (iters < best_iters) { + best_iters = iters; + best_size = test_size; + } + test_size += inc; + } + const int cells_in_cutoff=static_cast(ceil(cut/best_size)); + if (cells_in_cutoff > 2) best_size=cut*0.5; + return best_size; +} + void NeighborShared::compile_kernels(UCL_Device &dev, const int gpu_nbor, const std::string flags) { if (_compiled) @@ -56,11 +96,11 @@ void NeighborShared::compile_kernels(UCL_Device &dev, const int gpu_nbor, _gpu_nbor=gpu_nbor; if (_gpu_nbor==0) { nbor_program=new UCL_Program(dev); - nbor_program->load_string(neighbor_cpu,flags.c_str()); + nbor_program->load_string(neighbor_cpu,flags.c_str(),nullptr,stderr); k_nbor.set_function(*nbor_program,"kernel_unpack"); } else { build_program=new UCL_Program(dev); - build_program->load_string(neighbor_gpu,flags.c_str()); + build_program->load_string(neighbor_gpu,flags.c_str(),nullptr,stderr); if (_gpu_nbor==1) { k_cell_id.set_function(*build_program,"calc_cell_id"); diff --git a/lib/gpu/lal_neighbor_shared.h b/lib/gpu/lal_neighbor_shared.h index 5cfc4e4767..e574aaeaeb 100644 --- a/lib/gpu/lal_neighbor_shared.h +++ b/lib/gpu/lal_neighbor_shared.h @@ -47,6 +47,44 @@ class NeighborShared { /// Texture for cached position/type access with CUDA UCL_Texture neigh_tex; + /// Use a heuristic to approximate best bin size assuming uniform density + /** This is only called by core LAMMPS for atom sort sizes **/ + inline double update_cell_size(const double subx, const double suby, + const double subz, const int nlocal, + const double cut) { + if (_auto_cell_size==false || subz==0.0) return cut; + else { + _cell_size=best_cell_size(subx, suby, subz, nlocal, cut); + _cached_cell_size=true; + _cut_sort=cut; + return _cell_size; + } + } + + /// Use a heuristic to approximate best bin size assuming uniform density + double best_cell_size(const double subx, const double suby, + const double subz, const int nlocal, + const double cut); + + /// Current cutoff used for cell size determination + inline double neighbor_cutoff() { return _neighbor_cutoff; } + + /// Current neighbor cell size + inline double cell_size() { return _cell_size; } + + /// Return setting for auto cell size + inline bool auto_cell_size() { return _auto_cell_size; } + + inline void setup_auto_cell_size(const bool autosize, const double cut, + const int simd_size) { + _auto_cell_size = autosize; + _cached_cell_size = false; + _neighbor_cutoff = cut; + _cell_size = cut; + _simd_size = simd_size; + if (_simd_size < 2) _auto_cell_size = false; + } + /// Compile kernels for neighbor lists void compile_kernels(UCL_Device &dev, const int gpu_nbor, const std::string flags); @@ -59,6 +97,8 @@ class NeighborShared { private: bool _compiled; int _gpu_nbor; + bool _auto_cell_size, _cached_cell_size; + double _neighbor_cutoff, _cell_size, _simd_size, _cut_sort; }; } diff --git a/lib/gpu/lal_pppm.cpp b/lib/gpu/lal_pppm.cpp index 6b5bf88ea5..6e8fe237a6 100644 --- a/lib/gpu/lal_pppm.cpp +++ b/lib/gpu/lal_pppm.cpp @@ -71,7 +71,7 @@ grdtyp * PPPMT::init(const int nlocal, const int nall, FILE *_screen, if (flag!=0) return 0; if (sizeof(grdtyp)==sizeof(double) && device->double_precision()==false) { - flag=-5; + flag=-15; return 0; } if (device->ptx_arch()>0.0 && device->ptx_arch()<1.1) { @@ -133,7 +133,7 @@ grdtyp * PPPMT::init(const int nlocal, const int nall, FILE *_screen, UCL_SUCCESS); UCL_H_Vec view; view.view(rho_coeff[0]+n2lo,numel,*ucl_device); - ucl_copy(d_rho_coeff,view,true); + ucl_copy(d_rho_coeff,view,false); _max_bytes+=d_rho_coeff.row_bytes(); // Allocate storage for grid @@ -191,6 +191,7 @@ void PPPMT::clear(const double cpu_time) { d_brick_counts.clear(); error_flag.clear(); d_brick_atoms.clear(); + d_rho_coeff.clear(); acc_timers(); device->output_kspace_times(time_in,time_out,time_map,time_rho,time_interp, @@ -261,7 +262,7 @@ void PPPMT::_precompute(const int ago, const int nlocal, const int nall, double delvolinv = delxinv*delyinv*delzinv; grdtyp f_delvolinv = delvolinv; - device->zero(d_brick_counts,d_brick_counts.numel()); + d_brick_counts.zero(); k_particle_map.set_size(GX,BX); k_particle_map.run(&atom->x, &atom->q, &f_delvolinv, &ainum, &d_brick_counts, &d_brick_atoms, &_brick_x, &_brick_y, @@ -286,6 +287,10 @@ void PPPMT::_precompute(const int ago, const int nlocal, const int nall, error_flag.update_host(true); time_out.stop(); + #ifndef GERYON_OCL_FLUSH + error_flag.flush(); + #endif + _precompute_done=true; } @@ -351,7 +356,7 @@ void PPPMT::interp(const grdtyp qqrd2e_scale) { &ans->force); time_interp.stop(); - ans->copy_answers(false,false,false,false); + ans->copy_answers(false,false,false,false,0); if (_kspace_split==false) device->add_ans_object(ans); } @@ -374,18 +379,19 @@ void PPPMT::compile_kernels(UCL_Device &dev) { #ifdef USE_OPENCL flags+=std::string(" -Dgrdtyp=")+ucl_template_name()+" -Dgrdtyp4="+ ucl_template_name()+"4"; + if (sizeof(grdtyp)==sizeof(double)) flags+=std::string(" -DGRD_DBL"); #endif if (pppm_program) delete pppm_program; pppm_program=new UCL_Program(dev); #ifdef USE_OPENCL - pppm_program->load_string(pppm,flags.c_str()); + pppm_program->load_string(pppm,flags.c_str(),nullptr,screen); #else if (sizeof(grdtyp)==sizeof(float)) - pppm_program->load_string(pppm_f,flags.c_str()); + pppm_program->load_string(pppm_f,flags.c_str(),nullptr,screen); else - pppm_program->load_string(pppm_d,flags.c_str()); + pppm_program->load_string(pppm_d,flags.c_str(),nullptr,screen); #endif k_particle_map.set_function(*pppm_program,"particle_map"); diff --git a/lib/gpu/lal_pppm.cu b/lib/gpu/lal_pppm.cu index ee9f1b61d6..e17df5b88c 100644 --- a/lib/gpu/lal_pppm.cu +++ b/lib/gpu/lal_pppm.cu @@ -35,11 +35,14 @@ _texture( q_tex,int2); #define pos_tex x_ #define q_tex q_ #pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics: enable + +#ifdef GRD_DBL #if defined(cl_amd_fp64) #pragma OPENCL EXTENSION cl_amd_fp64 : enable #else #pragma OPENCL EXTENSION cl_khr_fp64 : enable #endif +#endif #endif diff --git a/lib/gpu/lal_pppm_ext.cpp b/lib/gpu/lal_pppm_ext.cpp index b826881392..d548b94be1 100644 --- a/lib/gpu/lal_pppm_ext.cpp +++ b/lib/gpu/lal_pppm_ext.cpp @@ -129,7 +129,8 @@ double pppm_gpu_bytes_f() { void pppm_gpu_forces_f(double **f) { double etmp; PPPMF.atom->data_unavail(); - PPPMF.ans->get_answers(f,nullptr,nullptr,nullptr,nullptr,etmp); + int error_flag; + PPPMF.ans->get_answers(f,nullptr,nullptr,nullptr,nullptr,etmp,error_flag); } double * pppm_gpu_init_d(const int nlocal, const int nall, FILE *screen, @@ -173,6 +174,7 @@ double pppm_gpu_bytes_d() { void pppm_gpu_forces_d(double **f) { double etmp; PPPMD.atom->data_unavail(); - PPPMD.ans->get_answers(f,nullptr,nullptr,nullptr,nullptr,etmp); + int error_flag; + PPPMD.ans->get_answers(f,nullptr,nullptr,nullptr,nullptr,etmp,error_flag); } diff --git a/lib/gpu/lal_pre_cuda_hip.h b/lib/gpu/lal_pre_cuda_hip.h new file mode 100644 index 0000000000..d37b4a94c2 --- /dev/null +++ b/lib/gpu/lal_pre_cuda_hip.h @@ -0,0 +1,355 @@ +// ************************************************************************** +// pre_cuda_hip.h +// ------------------- +// W. Michael Brown (ORNL) +// Nitin Dhamankar (Intel) +// +// Device-side preprocessor definitions for CUDA and HIP builds +// +// __________________________________________________________________________ +// This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) +// __________________________________________________________________________ +// +// begin : +// email : brownw@ornl.gov +// ***************************************************************************/ + +//************************************************************************* +// Device Configuration Definitions +// See lal_preprocessor.h for definitions +//*************************************************************************/ + +// ------------------------------------------------------------------------- +// CUDA and HIP DEFINITIONS +// ------------------------------------------------------------------------- + +#if defined(NV_KERNEL) || defined(USE_HIP) + +// ------------------------------------------------------------------------- +// DEVICE CONFIGURATION +// ------------------------------------------------------------------------- + + +#ifdef __HIP_PLATFORM_HCC__ +#define CONFIG_ID 303 +#define SIMD_SIZE 64 +#else +#define CONFIG_ID 103 +#define SIMD_SIZE 32 +#endif + +#define MEM_THREADS SIMD_SIZE +#define SHUFFLE_AVAIL 1 +#define FAST_MATH 1 + +#define THREADS_PER_ATOM 4 +#define THREADS_PER_CHARGE 8 +#define THREADS_PER_THREE 2 + +#define BLOCK_PAIR 256 +#define BLOCK_BIO_PAIR 256 +#define BLOCK_ELLIPSE 128 +#define PPPM_BLOCK_1D 64 +#define BLOCK_NBOR_BUILD 128 +#define BLOCK_CELL_2D 8 +#define BLOCK_CELL_ID 128 + +#define MAX_SHARED_TYPES 11 +#define MAX_BIO_SHARED_TYPES 128 +#define PPPM_MAX_SPLINE 8 + +// ------------------------------------------------------------------------- +// LEGACY DEVICE CONFIGURATION +// ------------------------------------------------------------------------- + +#ifdef __CUDA_ARCH__ + +#if (__CUDA_ARCH__ < 200) + +#undef CONFIG_ID +#define CONFIG_ID 101 +#define MEM_THREADS 16 +#undef THREADS_PER_ATOM +#define THREADS_PER_ATOM 1 +#undef THREADS_PER_CHARGE +#define THREADS_PER_CHARGE 16 +#undef BLOCK_PAIR +#define BLOCK_PAIR 64 +#undef BLOCK_BIO_PAIR +#define BLOCK_BIO_PAIR 64 +#undef BLOCK_NBOR_BUILD +#define BLOCK_NBOR_BUILD 64 +#undef MAX_SHARED_TYPES +#define MAX_SHARED_TYPES 8 +#undef SHUFFLE_AVAIL +#define SHUFFLE_AVAIL 0 + +#elseif (__CUDA_ARCH__ < 300) + +#undef CONFIG_ID +#define CONFIG_ID 102 +#undef BLOCK_PAIR +#define BLOCK_PAIR 128 +#undef BLOCK_BIO_PAIR +#define BLOCK_BIO_PAIR 128 +#undef MAX_SHARED_TYPES +#define MAX_SHARED_TYPES 8 +#undef SHUFFLE_AVAIL +#define SHUFFLE_AVAIL 0 + +#endif + +#endif + +// ------------------------------------------------------------------------- +// KERNEL MACROS +// ------------------------------------------------------------------------- + +#ifdef USE_HIP +#include +#endif + +#define fast_mul(X,Y) (X)*(Y) + +#ifdef __CUDA_ARCH__ +#if (__CUDA_ARCH__ < 200) +#define fast_mul __mul24 +#endif +#endif + +#define EVFLAG 1 +#define NOUNROLL +#define GLOBAL_ID_X threadIdx.x+fast_mul(blockIdx.x,blockDim.x) +#define GLOBAL_ID_Y threadIdx.y+fast_mul(blockIdx.y,blockDim.y) +#define GLOBAL_SIZE_X fast_mul(gridDim.x,blockDim.x); +#define GLOBAL_SIZE_Y fast_mul(gridDim.y,blockDim.y); +#define THREAD_ID_X threadIdx.x +#define THREAD_ID_Y threadIdx.y +#define BLOCK_ID_X blockIdx.x +#define BLOCK_ID_Y blockIdx.y +#define BLOCK_SIZE_X blockDim.x +#define BLOCK_SIZE_Y blockDim.y +#define NUM_BLOCKS_X gridDim.x + +#define __kernel extern "C" __global__ +#ifdef __local +#undef __local +#endif +#define __local __shared__ +#define __global +#define restrict __restrict__ +#define atom_add atomicAdd +#define ucl_inline static __inline__ __device__ + +#define simd_size() SIMD_SIZE + +#define simdsync() + +#ifdef NV_KERNEL +#if (__CUDACC_VER_MAJOR__ >= 9) +#undef simdsync +#define simdsync() __syncwarp(0xffffffff) +#endif +#endif + +#ifdef __HIP_PLATFORM_NVCC__ +#undef simdsync() +#define simdsync() __syncwarp(0xffffffff) +#endif + +// ------------------------------------------------------------------------- +// KERNEL MACROS - TEXTURES +// ------------------------------------------------------------------------- + +#ifdef __HIP_PLATFORM_HCC__ +#define _texture(name, type) __device__ type* name +#define _texture_2d(name, type) __device__ type* name +#else +#define _texture(name, type) texture name +#define _texture_2d(name, type) texture name +#endif + +#if (__CUDACC_VER_MAJOR__ < 11) + #ifdef _DOUBLE_DOUBLE + #define fetch4(ans,i,pos_tex) { \ + int4 xy = tex1Dfetch(pos_tex,i*2); \ + int4 zt = tex1Dfetch(pos_tex,i*2+1); \ + ans.x=__hiloint2double(xy.y, xy.x); \ + ans.y=__hiloint2double(xy.w, xy.z); \ + ans.z=__hiloint2double(zt.y, zt.x); \ + ans.w=__hiloint2double(zt.w, zt.z); \ + } + #define fetch(ans,i,q_tex) { \ + int2 qt = tex1Dfetch(q_tex,i); \ + ans=__hiloint2double(qt.y, qt.x); \ + } + #else + #define fetch4(ans,i,pos_tex) ans=tex1Dfetch(pos_tex, i); + #define fetch(ans,i,q_tex) ans=tex1Dfetch(q_tex,i); + #endif +#else + #define fetch4(ans,i,x) ans=x[i] + #define fetch(ans,i,q) ans=q[i] + #undef _texture + #undef _texture_2d + #define _texture(name, type) + #define _texture_2d(name, type) + #define pos_tex x_ + #define quat_tex qif + #define q_tex q_ + #define vel_tex v_ + #define mu_tex mu_ +#endif + +#ifdef __HIP_PLATFORM_HCC__ + +#undef fetch4 +#undef fetch + +#ifdef _DOUBLE_DOUBLE +#define fetch4(ans,i,pos_tex) (ans=*(((double4*)pos_tex) + i)) +#define fetch(ans,i,q_tex) (ans=*(((double *) q_tex) + i)) +#else +#define fetch4(ans,i,pos_tex) (ans=*(((float4*)pos_tex) + i)) +#define fetch(ans,i,q_tex) (ans=*(((float *) q_tex) + i)) +#endif + +#endif + +// ------------------------------------------------------------------------- +// KERNEL MACROS - MATH +// ------------------------------------------------------------------------- + +#ifdef CUDA_PRE_THREE +struct __builtin_align__(16) _double4 +{ + double x, y, z, w; +}; +typedef struct _double4 double4; +#endif + +#ifdef _DOUBLE_DOUBLE + +#define ucl_exp exp +#define ucl_powr pow +#define ucl_atan atan +#define ucl_cbrt cbrt +#define ucl_ceil ceil +#define ucl_abs fabs +#define ucl_rsqrt rsqrt +#define ucl_sqrt sqrt +#define ucl_recip(x) ((numtyp)1.0/(x)) + +#else + +#define ucl_atan atanf +#define ucl_cbrt cbrtf +#define ucl_ceil ceilf +#define ucl_abs fabsf +#define ucl_recip(x) ((numtyp)1.0/(x)) +#define ucl_rsqrt rsqrtf +#define ucl_sqrt sqrtf +#define ucl_exp expf +#define ucl_powr powf + +#endif + +// ------------------------------------------------------------------------- +// KERNEL MACROS - SHUFFLE +// ------------------------------------------------------------------------- + +#if SHUFFLE_AVAIL == 1 + +#ifndef USE_HIP +#if (__CUDACC_VER_MAJOR__ < 9) +#define CUDA_PRE_NINE +#endif +#endif + +#if defined(CUDA_PRE_NINE) || defined(__HIP_PLATFORM_HCC__) + + #ifdef _SINGLE_SINGLE + #define shfl_down __shfl_down + #define shfl_xor __shfl_xor + #else + ucl_inline double shfl_down(double var, unsigned int delta, int width) { + int2 tmp; + tmp.x = __double2hiint(var); + tmp.y = __double2loint(var); + tmp.x = __shfl_down(tmp.x,delta,width); + tmp.y = __shfl_down(tmp.y,delta,width); + return __hiloint2double(tmp.x,tmp.y); + } + ucl_inline double shfl_xor(double var, unsigned int lanemask, int width) { + int2 tmp; + tmp.x = __double2hiint(var); + tmp.y = __double2loint(var); + tmp.x = __shfl_xor(tmp.x,lanemask,width); + tmp.y = __shfl_xor(tmp.y,lanemask,width); + return __hiloint2double(tmp.x,tmp.y); + } + #endif + #define simd_broadcast_i __shfl + #define simd_broadcast_f __shfl + #ifdef _DOUBLE_DOUBLE + ucl_inline double simd_broadcast_d(double var, unsigned int src, + int width) { + int2 tmp; + tmp.x = __double2hiint(var); + tmp.y = __double2loint(var); + tmp.x = __shfl(tmp.x,src,width); + tmp.y = __shfl(tmp.y,src,width); + return __hiloint2double(tmp.x,tmp.y); + } + #endif + +#else + + #ifdef _SINGLE_SINGLE + ucl_inline float shfl_down(float var, unsigned int delta, int width) { + return __shfl_down_sync(0xffffffff, var, delta, width); + } + ucl_inline float shfl_xor(float var, unsigned int lanemask, int width) { + return __shfl_xor_sync(0xffffffff, var, lanemask, width); + } + #else + ucl_inline double shfl_down(double var, unsigned int delta, int width) { + int2 tmp; + tmp.x = __double2hiint(var); + tmp.y = __double2loint(var); + tmp.x = __shfl_down_sync(0xffffffff,tmp.x,delta,width); + tmp.y = __shfl_down_sync(0xffffffff,tmp.y,delta,width); + return __hiloint2double(tmp.x,tmp.y); + } + ucl_inline double shfl_xor(double var, unsigned int lanemask, int width) { + int2 tmp; + tmp.x = __double2hiint(var); + tmp.y = __double2loint(var); + tmp.x = __shfl_xor_sync(0xffffffff,tmp.x,lanemask,width); + tmp.y = __shfl_xor_sync(0xffffffff,tmp.y,lanemask,width); + return __hiloint2double(tmp.x,tmp.y); + } + #endif + #define simd_broadcast_i(var, src, width) \ + __shfl_sync(0xffffffff, var, src, width) + #define simd_broadcast_f(var, src, width) \ + __shfl_sync(0xffffffff, var, src, width) + #ifdef _DOUBLE_DOUBLE + ucl_inline double simd_broadcast_d(double var, unsigned int src, int width) { + int2 tmp; + tmp.x = __double2hiint(var); + tmp.y = __double2loint(var); + tmp.x = __shfl_sync(0xffffffff,tmp.x,src,width); + tmp.y = __shfl_sync(0xffffffff,tmp.y,src,width); + return __hiloint2double(tmp.x,tmp.y); + } + #endif +#endif + +#endif + +// ------------------------------------------------------------------------- +// END CUDA / HIP DEFINITIONS +// ------------------------------------------------------------------------- + +#endif diff --git a/lib/gpu/lal_pre_ocl_config.h b/lib/gpu/lal_pre_ocl_config.h new file mode 100644 index 0000000000..15c503c942 --- /dev/null +++ b/lib/gpu/lal_pre_ocl_config.h @@ -0,0 +1,53 @@ +// ************************************************************************** +// pre_ocl_config.h +// ------------------- +// W. Michael Brown (ORNL) +// Nitin Dhamankar (Intel) +// +// Device-side preprocessor definitions +// +// __________________________________________________________________________ +// This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) +// __________________________________________________________________________ +// +// begin : +// email : brownw@ornl.gov +// ***************************************************************************/ + +//************************************************************************* +// Device Configuration Definitions +// See lal_preprocessor.h for definitions +// Configuration order: +// +// {CONFIG_NAME, CONFIG_ID, SIMD_SIZE, MEM_THREADS, SHUFFLE_AVAIL, FAST_MATH, +// THREADS_PER_ATOM, THREADS_PER_CHARGE, THREADS_PER_THREE, BLOCK_PAIR, +// BLOCK_BIO_PAIR, BLOCK_ELLIPSE, PPPM_BLOCK_1D, BLOCK_NBOR_BUILD, +// BLOCK_CELL_2D, BLOCK_CELL_ID, MAX_SHARED_TYPES, MAX_BIO_SHARED_TYPES, +// PPPM_MAX_SPLINE} +// +//*************************************************************************/ + +const int nconfigs=6; +const char * ocl_config_names[] = + { + "generic", + "nvidiagpu", + "amdgpu", + "intelgpu", + "applegpu", + "intelcpu" + }; +const char * ocl_config_strings[] = + { + "GENERIC,1,1,16,0,1,1,1,1,64,64,64,64,64,8,128,8,128,8", + "NVIDIA_GPU,203,32,32,1,1,4,8,2,256,256,128,64,128,8,128,11,128,8", + "AMD_GPU,403,64,64,0,1,4,8,2,256,256,128,64,128,8,128,11,128,8", +#ifdef _SINGLE_SINGLE + "INTEL_GPU,500,8,16,1,1,4,8,1,64,64,64,64,64,8,128,8,128,8", + "APPLE_GPU,600,16,16,0,1,4,8,1,64,64,64,64,64,8,128,8,128,8", +#else + "INTEL_GPU,500,8,16,1,1,2,8,1,64,64,64,64,64,8,128,8,128,8", + "APPLE_GPU,600,16,16,0,1,2,8,1,64,64,64,64,64,8,128,8,128,8", +#endif + "INTEL_CPU,1500,8,8,1,1,1,1,1,64,64,64,64,64,8,64,8,128,8" + }; diff --git a/lib/gpu/lal_precision.h b/lib/gpu/lal_precision.h index 7f82ba18aa..bb2423198f 100644 --- a/lib/gpu/lal_precision.h +++ b/lib/gpu/lal_precision.h @@ -20,6 +20,29 @@ #include #endif +// ---------------------- OPENMP PREPROCESSOR STUFF ------------------ +#if defined(_OPENMP) + #if !defined(LAL_USE_OMP) + #define LAL_USE_OMP 1 + #endif + + #if !defined(LAL_USE_OMP_SIMD) + #if (_OPENMP >= 201307) + #define LAL_USE_OMP_SIMD 1 + #else + #define LAL_USE_OMP_SIMD 0 + #endif + #endif +#else + #if !defined(LAL_USE_OMP) + #define LAL_USE_OMP 0 + #endif + + #if !defined(LAL_USE_OMP_SIMD) + #define LAL_USE_OMP_SIMD 0 + #endif +#endif + struct _lgpu_int2 { int x; int y; }; @@ -75,6 +98,7 @@ inline std::ostream & operator<<(std::ostream &out, const _lgpu_double4 &v) { #define ACC_PRECISION double #define numtyp2 _lgpu_float2 #define numtyp4 _lgpu_float4 +#define acctyp2 _lgpu_double2 #define acctyp4 _lgpu_double4 #endif @@ -84,6 +108,7 @@ inline std::ostream & operator<<(std::ostream &out, const _lgpu_double4 &v) { #define ACC_PRECISION double #define numtyp2 _lgpu_double2 #define numtyp4 _lgpu_double4 +#define acctyp2 _lgpu_double2 #define acctyp4 _lgpu_double4 #endif @@ -93,44 +118,16 @@ inline std::ostream & operator<<(std::ostream &out, const _lgpu_double4 &v) { #define ACC_PRECISION float #define numtyp2 _lgpu_float2 #define numtyp4 _lgpu_float4 +#define acctyp2 _lgpu_float2 #define acctyp4 _lgpu_float4 #endif enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE}; -// OCL_DEFAULT_VENDOR: preprocessor define for hardware -// specific sizes of OpenCL kernel related constants - -#ifdef FERMI_OCL -#define OCL_DEFAULT_VENDOR "fermi" -#endif - -#ifdef KEPLER_OCL -#define OCL_DEFAULT_VENDOR "kepler" -#endif - -#ifdef CYPRESS_OCL -#define OCL_DEFAULT_VENDOR "cypress" -#endif - -#ifdef GENERIC_OCL -#define OCL_DEFAULT_VENDOR "generic" -#endif - -#ifdef INTEL_OCL -#define OCL_DEFAULT_VENDOR "intel" -#endif - -#ifdef PHI_OCL -#define OCL_DEFAULT_VENDOR "phi" -#endif - -#ifndef OCL_DEFAULT_VENDOR -#define OCL_DEFAULT_VENDOR "none" -#endif - -// default to 32-bit smallint and other ints, 64-bit bigint: same as defined in src/lmptype.h -#if !defined(LAMMPS_SMALLSMALL) && !defined(LAMMPS_BIGBIG) && !defined(LAMMPS_SMALLBIG) +// default to 32-bit smallint and other ints, 64-bit bigint: +// same as defined in src/lmptype.h +#if !defined(LAMMPS_SMALLSMALL) && !defined(LAMMPS_BIGBIG) && \ + !defined(LAMMPS_SMALLBIG) #define LAMMPS_SMALLBIG #endif diff --git a/lib/gpu/lal_preprocessor.h b/lib/gpu/lal_preprocessor.h index 7c94438272..12cf6345c2 100644 --- a/lib/gpu/lal_preprocessor.h +++ b/lib/gpu/lal_preprocessor.h @@ -1,9 +1,10 @@ // ************************************************************************** -// preprocessor.cu +// preprocessor.h // ------------------- // W. Michael Brown (ORNL) +// Nitin Dhamankar (Intel) // -// Device code for CUDA-specific preprocessor definitions +// Device-side preprocessor definitions // // __________________________________________________________________________ // This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) @@ -14,566 +15,136 @@ // ***************************************************************************/ //************************************************************************* -// Preprocessor Definitions +// Device Configuration Definitions // -// Note: It is assumed that constants with the same names are defined with -// the same values in all files. +// For OpenCL, the configuration is a string (optionally controlled at +// runtime) where tokens specify the values below in order) // -// ARCH -// Definition: Architecture number for accelerator +// CONFIG_ID: +// Definition: Unique ID for a configuration +// 100-199 for NVIDIA GPUs with CUDA / HIP +// 200-299 for NVIDIA GPUs with OpenCL +// 300-399 for AMD GPUs with HIP +// 400-499 for AMD GPUs with OpenCL +// 500-599 for Intel GPUs with OpenCL +// SIMD_SIZE: +// Definition: For CUDA this is the warp size. +// For AMD this is the wavefront size. +// For OpenCL < 2.1 this is the number of workitems +// guarenteed to have the same instruction pointer +// For OpenCL >= 2.1 this is the smallest expected subgroup +// size. Actually subgroup sizes are determined per kernel. // MEM_THREADS -// Definition: Number of threads with sequential ids accessing memory -// simultaneously on multiprocessor -// WARP_SIZE: -// Definition: Number of threads guaranteed to be on the same instruction +// Definition: Number of elements in main memory transaction. Used in +// PPPM. If unknown, set to SIMD_SIZE. +// SHUFFLE_AVAIL +// Definition: Controls the use of instructions for horizontal vector +// operations. 0 disables and will increase shared memory +// usage. 1 enables for CUDA, HIP, and OpenCL >= 2.1 on +// NVIDIA and Intel devices. +// FAST_MATH +// Definition: 0: do not use -cl-fast-relaxed-math optimization flag or +// native transcendentals for OpenCL (fused multiply-add +// still enabled). For CUDA and HIP, this is controlled by +// the Makefile at compile time. 1: enable fast math opts +// // THREADS_PER_ATOM -// Definition: Default number of threads assigned per atom for pair styles -// Restructions: Must be power of 2; THREADS_PER_ATOM<=WARP_SIZE +// Definition: Default number of work items or CUDA threads assigned per +// per atom for pair styles +// Restrictions: Must be power of 2; THREADS_PER_ATOM<=SIMD_SIZE // THREADS_PER_CHARGE -// Definition: Default number of threads assigned per atom for pair styles -// with charge -// Restructions: Must be power of 2; THREADS_PER_ATOM<=WARP_SIZE -// PPPM_MAX_SPLINE -// Definition: Maximum order for splines in PPPM -// PPPM_BLOCK_1D -// Definition: Thread block size for PPPM kernels -// Restrictions: PPPM_BLOCK_1D>=PPPM_MAX_SPLINE*PPPM_MAX_SPLINE -// PPPM_BLOCK_1D%32==0 +// Definition: Default number of work items or CUDA threads assigned per +// per atom for pair styles using charge +// Restrictions: Must be power of 2; THREADS_PER_ATOM<=SIMD_SIZE +// THREADS_PER_THREE +// Definition: Default number of work items or CUDA threads assigned per +// per atom for 3-body styles +// Restrictions: Must be power of 2; THREADS_PER_ATOM^2<=SIMD_SIZE +// // BLOCK_PAIR -// Definition: Default thread block size for pair styles -// Restrictions: +// Definition: Default block size for pair styles +// Restrictions: Must be integer multiple of SIMD_SIZE +// BLOCK_BIO_PAIR +// Definition: Default block size for CHARMM styles +// Restrictions: Must be integer multiple of SIMD_SIZE +// BLOCK_ELLIPSE +// Definition: Default block size for ellipsoidal models and some 3-body +// styles +// Restrictions: Must be integer multiple of SIMD_SIZE +// PPPM_BLOCK_1D +// Definition: Default block size for PPPM kernels +// Restrictions: Must be integer multiple of SIMD_SIZE +// BLOCK_NBOR_BUILD +// Definition: Default block size for neighbor list builds +// Restrictions: Must be integer multiple of SIMD_SIZE +// BLOCK_CELL_2D +// Definition: Default block size in each dimension for matrix transpose +// BLOCK_CELL_ID +// Definition: Unused in current implementation; Maintained for legacy +// purposes and specialized builds +// // MAX_SHARED_TYPES 8 // Definition: Max # of atom type params can be stored in shared memory // Restrictions: MAX_SHARED_TYPES*MAX_SHARED_TYPES<=BLOCK_PAIR -// BLOCK_CELL_2D -// Definition: Default block size in each dimension for cell list builds -// and matrix transpose -// BLOCK_CELL_ID -// Definition: Default block size for binning atoms in cell list builds -// BLOCK_NBOR_BUILD -// Definition: Default block size for neighbor list builds -// BLOCK_BIO_PAIR -// Definition: Default thread block size for "bio" pair styles // MAX_BIO_SHARED_TYPES // Definition: Max # of atom type params can be stored in shared memory -// Restrictions: MAX_BIO_SHARED_TYPES<=BLOCK_BIO_PAIR*2 +// Restrictions: MAX_BIO_SHARED_TYPES<=BLOCK_BIO_PAIR*2 +// PPPM_MAX_SPLINE +// Definition: Maximum order for splines in PPPM +// Restrictions: PPPM_BLOCK_1D>=PPPM_MAX_SPLINE*PPPM_MAX_SPLINE // //*************************************************************************/ -#define _texture(name, type) texture name -#define _texture_2d(name, type) texture name - // ------------------------------------------------------------------------- -// HIP DEFINITIONS +// CUDA and HIP DEFINITIONS // ------------------------------------------------------------------------- -#ifdef USE_HIP - #include - #ifdef __HIP_PLATFORM_HCC__ - #define mul24(x, y) __mul24(x, y) - #undef _texture - #undef _texture_2d - #define _texture(name, type) __device__ type* name - #define _texture_2d(name, type) __device__ type* name - #endif - #define GLOBAL_ID_X threadIdx.x+mul24(blockIdx.x,blockDim.x) - #define GLOBAL_ID_Y threadIdx.y+mul24(blockIdx.y,blockDim.y) - #define GLOBAL_SIZE_X mul24(gridDim.x,blockDim.x); - #define GLOBAL_SIZE_Y mul24(gridDim.y,blockDim.y); - #define THREAD_ID_X threadIdx.x - #define THREAD_ID_Y threadIdx.y - #define BLOCK_ID_X blockIdx.x - #define BLOCK_ID_Y blockIdx.y - #define BLOCK_SIZE_X blockDim.x - #define BLOCK_SIZE_Y blockDim.y - #define __kernel extern "C" __global__ - #ifdef __local - #undef __local - #endif - #define __local __shared__ - #define __global - #define restrict __restrict__ - #define atom_add atomicAdd - #define ucl_inline static __inline__ __device__ - - #define THREADS_PER_ATOM 4 - #define THREADS_PER_CHARGE 8 - #define BLOCK_NBOR_BUILD 128 - #define BLOCK_PAIR 256 - #define BLOCK_BIO_PAIR 256 - #define BLOCK_ELLIPSE 128 - #define MAX_SHARED_TYPES 11 - - #ifdef _SINGLE_SINGLE - ucl_inline double shfl_xor(double var, int laneMask, int width) { - #ifdef __HIP_PLATFORM_HCC__ - return __shfl_xor(var, laneMask, width); - #else - return __shfl_xor_sync(0xffffffff, var, laneMask, width); - #endif - } - #else - ucl_inline double shfl_xor(double var, int laneMask, int width) { - int2 tmp; - tmp.x = __double2hiint(var); - tmp.y = __double2loint(var); - #ifdef __HIP_PLATFORM_HCC__ - tmp.x = __shfl_xor(tmp.x,laneMask,width); - tmp.y = __shfl_xor(tmp.y,laneMask,width); - #else - tmp.x = __shfl_xor_sync(0xffffffff, tmp.x,laneMask,width); - tmp.y = __shfl_xor_sync(0xffffffff, tmp.y,laneMask,width); - #endif - return __hiloint2double(tmp.x,tmp.y); - } - #endif - - #ifdef __HIP_PLATFORM_HCC__ - #define ARCH 600 - #define WARP_SIZE 64 - #endif - - #ifdef __HIP_PLATFORM_NVCC__ - #define ARCH __CUDA_ARCH__ - #define WARP_SIZE 32 - #endif - - #define fast_mul(X,Y) (X)*(Y) - - #define MEM_THREADS WARP_SIZE - #define PPPM_BLOCK_1D 64 - #define BLOCK_CELL_2D 8 - #define BLOCK_CELL_ID 128 - #define MAX_BIO_SHARED_TYPES 128 - - #ifdef __HIP_PLATFORM_NVCC__ - #ifdef _DOUBLE_DOUBLE - #define fetch4(ans,i,pos_tex) { \ - int4 xy = tex1Dfetch(pos_tex,i*2); \ - int4 zt = tex1Dfetch(pos_tex,i*2+1); \ - ans.x=__hiloint2double(xy.y, xy.x); \ - ans.y=__hiloint2double(xy.w, xy.z); \ - ans.z=__hiloint2double(zt.y, zt.x); \ - ans.w=__hiloint2double(zt.w, zt.z); \ - } - #define fetch(ans,i,q_tex) { \ - int2 qt = tex1Dfetch(q_tex,i); \ - ans=__hiloint2double(qt.y, qt.x); \ - } - #else - #define fetch4(ans,i,pos_tex) ans=tex1Dfetch(pos_tex, i); - #define fetch(ans,i,q_tex) ans=tex1Dfetch(q_tex,i); - #endif - #else - #ifdef _DOUBLE_DOUBLE - #define fetch4(ans,i,pos_tex) (ans=*(((double4*)pos_tex) + i)) - #define fetch(ans,i,q_tex) (ans=*(((double *) q_tex) + i)) - #else - #define fetch4(ans,i,pos_tex) (ans=*(((float4*)pos_tex) + i)) - #define fetch(ans,i,q_tex) (ans=*(((float *) q_tex) + i)) - #endif - #endif - - #ifdef _DOUBLE_DOUBLE - #define ucl_exp exp - #define ucl_powr pow - #define ucl_atan atan - #define ucl_cbrt cbrt - #define ucl_ceil ceil - #define ucl_abs fabs - #define ucl_rsqrt rsqrt - #define ucl_sqrt sqrt - #define ucl_recip(x) ((numtyp)1.0/(x)) - - #else - #define ucl_atan atanf - #define ucl_cbrt cbrtf - #define ucl_ceil ceilf - #define ucl_abs fabsf - #define ucl_recip(x) ((numtyp)1.0/(x)) - #define ucl_rsqrt rsqrtf - #define ucl_sqrt sqrtf - - #ifdef NO_HARDWARE_TRANSCENDENTALS - #define ucl_exp expf - #define ucl_powr powf - #else - #define ucl_exp __expf - #define ucl_powr __powf - #endif - #endif -#endif - -// ------------------------------------------------------------------------- -// CUDA DEFINITIONS -// ------------------------------------------------------------------------- - -#ifdef NV_KERNEL - -#define GLOBAL_ID_X threadIdx.x+mul24(blockIdx.x,blockDim.x) -#define GLOBAL_ID_Y threadIdx.y+mul24(blockIdx.y,blockDim.y) -#define GLOBAL_SIZE_X mul24(gridDim.x,blockDim.x); -#define GLOBAL_SIZE_Y mul24(gridDim.y,blockDim.y); -#define THREAD_ID_X threadIdx.x -#define THREAD_ID_Y threadIdx.y -#define BLOCK_ID_X blockIdx.x -#define BLOCK_ID_Y blockIdx.y -#define BLOCK_SIZE_X blockDim.x -#define BLOCK_SIZE_Y blockDim.y -#define __kernel extern "C" __global__ -#define __local __shared__ -#define __global -#define restrict __restrict__ -#define atom_add atomicAdd -#define ucl_inline static __inline__ __device__ - -#ifdef __CUDA_ARCH__ -#define ARCH __CUDA_ARCH__ -#else -#define ARCH 100 -#endif - -#if (ARCH < 200) - -#define THREADS_PER_ATOM 1 -#define THREADS_PER_CHARGE 16 -#define BLOCK_NBOR_BUILD 64 -#define BLOCK_PAIR 64 -#define BLOCK_BIO_PAIR 64 -#define MAX_SHARED_TYPES 8 - -#else - -#if (ARCH < 300) - -#define THREADS_PER_ATOM 4 -#define THREADS_PER_CHARGE 8 -#define BLOCK_NBOR_BUILD 128 -#define BLOCK_PAIR 128 -#define BLOCK_BIO_PAIR 128 -#define MAX_SHARED_TYPES 8 - -#else - -#define THREADS_PER_ATOM 4 -#define THREADS_PER_CHARGE 8 -#define BLOCK_NBOR_BUILD 128 -#define BLOCK_PAIR 256 -#define BLOCK_BIO_PAIR 256 -#define BLOCK_ELLIPSE 128 -#define MAX_SHARED_TYPES 11 - -#if (__CUDACC_VER_MAJOR__ < 9) - -#ifdef _SINGLE_SINGLE -#define shfl_xor __shfl_xor -#else -ucl_inline double shfl_xor(double var, int laneMask, int width) { - int2 tmp; - tmp.x = __double2hiint(var); - tmp.y = __double2loint(var); - tmp.x = __shfl_xor(tmp.x,laneMask,width); - tmp.y = __shfl_xor(tmp.y,laneMask,width); - return __hiloint2double(tmp.x,tmp.y); -} -#endif - -#else - -#ifdef _SINGLE_SINGLE -ucl_inline double shfl_xor(double var, int laneMask, int width) { - return __shfl_xor_sync(0xffffffff, var, laneMask, width); -} -#else -ucl_inline double shfl_xor(double var, int laneMask, int width) { - int2 tmp; - tmp.x = __double2hiint(var); - tmp.y = __double2loint(var); - tmp.x = __shfl_xor_sync(0xffffffff,tmp.x,laneMask,width); - tmp.y = __shfl_xor_sync(0xffffffff,tmp.y,laneMask,width); - return __hiloint2double(tmp.x,tmp.y); -} -#endif - -#endif - -#endif - -#endif - -#define WARP_SIZE 32 -#define PPPM_BLOCK_1D 64 -#define BLOCK_CELL_2D 8 -#define BLOCK_CELL_ID 128 -#define MAX_BIO_SHARED_TYPES 128 - -#ifdef _DOUBLE_DOUBLE -#define fetch4(ans,i,pos_tex) { \ - int4 xy = tex1Dfetch(pos_tex,i*2); \ - int4 zt = tex1Dfetch(pos_tex,i*2+1); \ - ans.x=__hiloint2double(xy.y, xy.x); \ - ans.y=__hiloint2double(xy.w, xy.z); \ - ans.z=__hiloint2double(zt.y, zt.x); \ - ans.w=__hiloint2double(zt.w, zt.z); \ -} -#define fetch(ans,i,q_tex) { \ - int2 qt = tex1Dfetch(q_tex,i); \ - ans=__hiloint2double(qt.y, qt.x); \ -} -#else -#define fetch4(ans,i,pos_tex) ans=tex1Dfetch(pos_tex, i); -#define fetch(ans,i,q_tex) ans=tex1Dfetch(q_tex,i); -#endif - -#if (__CUDA_ARCH__ < 200) -#define fast_mul __mul24 -#define MEM_THREADS 16 -#else -#define fast_mul(X,Y) (X)*(Y) -#define MEM_THREADS 32 -#endif - -#ifdef CUDA_PRE_THREE -struct __builtin_align__(16) _double4 -{ - double x, y, z, w; -}; -typedef struct _double4 double4; -#endif - -#ifdef _DOUBLE_DOUBLE - -#define ucl_exp exp -#define ucl_powr pow -#define ucl_atan atan -#define ucl_cbrt cbrt -#define ucl_ceil ceil -#define ucl_abs fabs -#define ucl_rsqrt rsqrt -#define ucl_sqrt sqrt -#define ucl_recip(x) ((numtyp)1.0/(x)) - -#else - -#define ucl_atan atanf -#define ucl_cbrt cbrtf -#define ucl_ceil ceilf -#define ucl_abs fabsf -#define ucl_recip(x) ((numtyp)1.0/(x)) -#define ucl_rsqrt rsqrtf -#define ucl_sqrt sqrtf - -#ifdef NO_HARDWARE_TRANSCENDENTALS - -#define ucl_exp expf -#define ucl_powr powf - -#else - -#define ucl_exp __expf -#define ucl_powr __powf - -#endif - -#endif - +#if defined(NV_KERNEL) || defined(USE_HIP) +#include "lal_pre_cuda_hip.h" #endif // ------------------------------------------------------------------------- -// NVIDIA GENERIC OPENCL DEFINITIONS +// OPENCL DEVICE CONFIGURATAIONS // ------------------------------------------------------------------------- -#ifdef NV_GENERIC_OCL +// See lal_pre_ocl_config.h for OpenCL device configurations + +#if !defined(NV_KERNEL) && !defined(USE_HIP) #define USE_OPENCL -#define fast_mul mul24 -#define MEM_THREADS 16 -#define THREADS_PER_ATOM 1 -#define THREADS_PER_CHARGE 1 -#define BLOCK_PAIR 64 -#define MAX_SHARED_TYPES 8 -#define BLOCK_NBOR_BUILD 64 -#define BLOCK_BIO_PAIR 64 - -#define WARP_SIZE 32 -#define PPPM_BLOCK_1D 64 -#define BLOCK_CELL_2D 8 -#define BLOCK_CELL_ID 128 -#define MAX_BIO_SHARED_TYPES 128 - -#endif // ------------------------------------------------------------------------- -// NVIDIA FERMI OPENCL DEFINITIONS +// OPENCL KERNEL MACROS // ------------------------------------------------------------------------- -#ifdef FERMI_OCL - -#define USE_OPENCL -#define MEM_THREADS 32 -#define THREADS_PER_ATOM 4 -#define THREADS_PER_CHARGE 8 -#define BLOCK_PAIR 128 -#define MAX_SHARED_TYPES 11 -#define BLOCK_NBOR_BUILD 128 -#define BLOCK_BIO_PAIR 128 - -#define WARP_SIZE 32 -#define PPPM_BLOCK_1D 64 -#define BLOCK_CELL_2D 8 -#define BLOCK_CELL_ID 128 -#define MAX_BIO_SHARED_TYPES 128 - -#endif - -// ------------------------------------------------------------------------- -// NVIDIA KEPLER OPENCL DEFINITIONS -// ------------------------------------------------------------------------- - -#ifdef KEPLER_OCL - -#define USE_OPENCL -#define MEM_THREADS 32 -#define THREADS_PER_ATOM 4 -#define THREADS_PER_CHARGE 8 -#define BLOCK_PAIR 256 -#define MAX_SHARED_TYPES 11 -#define BLOCK_NBOR_BUILD 128 -#define BLOCK_BIO_PAIR 256 -#define BLOCK_ELLIPSE 128 - -#define WARP_SIZE 32 -#define PPPM_BLOCK_1D 64 -#define BLOCK_CELL_2D 8 -#define BLOCK_CELL_ID 128 -#define MAX_BIO_SHARED_TYPES 128 - -#ifndef NO_OCL_PTX -#define ARCH 300 -#ifdef _SINGLE_SINGLE -inline float shfl_xor(float var, int laneMask, int width) { - float ret; - int c; - c = ((WARP_SIZE-width) << 8) | 0x1f; - asm volatile ("shfl.bfly.b32 %0, %1, %2, %3;" : "=f"(ret) : "f"(var), "r"(laneMask), "r"(c)); - return ret; -} +#if (__OPENCL_VERSION__ > 199) +#define NOUNROLL __attribute__((opencl_unroll_hint(1))) #else -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -inline double shfl_xor(double var, int laneMask, int width) { - int c = ((WARP_SIZE-width) << 8) | 0x1f; - int x,y,x2,y2; - double ans; - asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(y), "=r"(x) : "d"(var)); - asm volatile ("shfl.bfly.b32 %0, %1, %2, %3;" : "=r"(x2) : "r"(x), "r"(laneMask), "r"(c)); - asm volatile ("shfl.bfly.b32 %0, %1, %2, %3;" : "=r"(y2) : "r"(y), "r"(laneMask), "r"(c)); - asm volatile ("mov.b64 %0, {%1, %2};" : "=d"(ans) : "r"(y2), "r"(x2)); - return ans; -} -#endif +#define NOUNROLL #endif -#endif +#define GLOBAL_ID_X get_global_id(0) +#define THREAD_ID_X get_local_id(0) +#define BLOCK_ID_X get_group_id(0) +#define BLOCK_SIZE_X get_local_size(0) +#define GLOBAL_SIZE_X get_global_size(0) +#define THREAD_ID_Y get_local_id(1) +#define BLOCK_ID_Y get_group_id(1) +#define NUM_BLOCKS_X get_num_groups(0) +#define __syncthreads() barrier(CLK_LOCAL_MEM_FENCE) +#define ucl_inline inline // ------------------------------------------------------------------------- -// AMD CYPRESS OPENCL DEFINITIONS +// OPENCL KERNEL MACROS - TEXTURES // ------------------------------------------------------------------------- -#ifdef CYPRESS_OCL - -#define USE_OPENCL -#define MEM_THREADS 32 -#define THREADS_PER_ATOM 4 -#define THREADS_PER_CHARGE 8 -#define BLOCK_PAIR 128 -#define MAX_SHARED_TYPES 8 -#define BLOCK_NBOR_BUILD 64 -#define BLOCK_BIO_PAIR 64 - -#define WARP_SIZE 64 -#define PPPM_BLOCK_1D 64 -#define BLOCK_CELL_2D 8 -#define BLOCK_CELL_ID 128 -#define MAX_BIO_SHARED_TYPES 128 - -#endif +#define fetch4(ans,i,x) ans=x[i] +#define fetch(ans,i,q) ans=q[i] // ------------------------------------------------------------------------- -// INTEL CPU OPENCL DEFINITIONS +// OPENCL KERNEL MACROS - MATH // ------------------------------------------------------------------------- -#ifdef INTEL_OCL - -#define USE_OPENCL -#define MEM_THREADS 16 -#define THREADS_PER_ATOM 1 -#define THREADS_PER_CHARGE 1 -#define BLOCK_PAIR 1 -#define MAX_SHARED_TYPES 0 -#define BLOCK_NBOR_BUILD 4 -#define BLOCK_BIO_PAIR 2 -#define BLOCK_ELLIPSE 2 - -#define WARP_SIZE 1 -#define PPPM_BLOCK_1D 32 -#define BLOCK_CELL_2D 1 -#define BLOCK_CELL_ID 2 -#define MAX_BIO_SHARED_TYPES 0 - -#endif - -// ------------------------------------------------------------------------- -// INTEL PHI OPENCL DEFINITIONS -// ------------------------------------------------------------------------- - -#ifdef PHI_OCL - -#define USE_OPENCL -#define MEM_THREADS 16 -#define THREADS_PER_ATOM 1 -#define THREADS_PER_CHARGE 1 -#define BLOCK_PAIR 16 -#define MAX_SHARED_TYPES 0 -#define BLOCK_NBOR_BUILD 16 -#define BLOCK_BIO_PAIR 16 -#define BLOCK_ELLIPSE 16 - -#define WARP_SIZE 1 -#define PPPM_BLOCK_1D 32 -#define BLOCK_CELL_2D 4 -#define BLOCK_CELL_ID 16 -#define MAX_BIO_SHARED_TYPES 0 - -#endif - -// ------------------------------------------------------------------------- -// GENERIC OPENCL DEFINITIONS -// ------------------------------------------------------------------------- - -#ifdef GENERIC_OCL - -#define USE_OPENCL -#define MEM_THREADS 16 -#define THREADS_PER_ATOM 1 -#define THREADS_PER_CHARGE 1 -#define BLOCK_PAIR 64 -#define MAX_SHARED_TYPES 8 -#define BLOCK_NBOR_BUILD 64 -#define BLOCK_BIO_PAIR 64 - -#define WARP_SIZE 1 -#define PPPM_BLOCK_1D 64 -#define BLOCK_CELL_2D 8 -#define BLOCK_CELL_ID 128 -#define MAX_BIO_SHARED_TYPES 128 - -#endif - -// ------------------------------------------------------------------------- -// OPENCL Stuff for All Hardware -// ------------------------------------------------------------------------- -#ifdef USE_OPENCL - #ifndef _SINGLE_SINGLE #ifndef cl_khr_fp64 @@ -589,48 +160,14 @@ inline double shfl_xor(double var, int laneMask, int width) { #endif -#ifndef fast_mul #define fast_mul(X,Y) (X)*(Y) -#endif - -#ifndef ARCH -#define ARCH 0 -#endif - -#ifndef DRIVER -#define DRIVER 0 -#endif - -#define GLOBAL_ID_X get_global_id(0) -#define THREAD_ID_X get_local_id(0) -#define BLOCK_ID_X get_group_id(0) -#define BLOCK_SIZE_X get_local_size(0) -#define GLOBAL_SIZE_X get_global_size(0) -#define THREAD_ID_Y get_local_id(1) -#define BLOCK_ID_Y get_group_id(1) -#define __syncthreads() barrier(CLK_LOCAL_MEM_FENCE) -#define ucl_inline inline -#define fetch4(ans,i,x) ans=x[i] -#define fetch(ans,i,q) ans=q[i] #define ucl_atan atan #define ucl_cbrt cbrt #define ucl_ceil ceil #define ucl_abs fabs -#ifdef _DOUBLE_DOUBLE -#define NO_HARDWARE_TRANSCENDENTALS -#endif - -#ifdef NO_HARDWARE_TRANSCENDENTALS - -#define ucl_exp exp -#define ucl_powr powr -#define ucl_rsqrt rsqrt -#define ucl_sqrt sqrt -#define ucl_recip(x) ((numtyp)1.0/(x)) - -#else +#if defined(FAST_MATH) && !defined(_DOUBLE_DOUBLE) #define ucl_exp native_exp #define ucl_powr native_powr @@ -638,23 +175,128 @@ inline double shfl_xor(double var, int laneMask, int width) { #define ucl_sqrt native_sqrt #define ucl_recip native_recip +#else + +#define ucl_exp exp +#define ucl_powr powr +#define ucl_rsqrt rsqrt +#define ucl_sqrt sqrt +#define ucl_recip(x) ((numtyp)1.0/(x)) + #endif +// ------------------------------------------------------------------------- +// OPENCL KERNEL MACROS - SHUFFLE +// ------------------------------------------------------------------------- + +#if (SHUFFLE_AVAIL == 1) + #ifdef cl_intel_subgroups + #pragma OPENCL EXTENSION cl_intel_subgroups : enable + #define shfl_down(var, delta, width) \ + intel_sub_group_shuffle_down(var, var, delta) + #define shfl_xor(var, lanemask, width) \ + intel_sub_group_shuffle_xor(var, lanemask) + #define simd_broadcast_i(var, src, width) sub_group_broadcast(var, src) + #define simd_broadcast_f(var, src, width) sub_group_broadcast(var, src) + #define simd_broadcast_d(var, src, width) sub_group_broadcast(var, src) + #else + #ifdef _SINGLE_SINGLE + inline float shfl_down(float var, unsigned int delta, int width) { + float ret; + int c; + c = ((SIMD_SIZE-width) << 8) | 0x1f; + asm volatile ("shfl.sync.down.b32 %0, %1, %2, %3, %4;" : "=f"(ret) : "f"(var), "r"(delta), "r"(c), "r"(0xffffffff)); + return ret; + } + inline float shfl_xor(float var, unsigned int lanemask, int width) { + float ret; + int c; + c = ((SIMD_SIZE-width) << 8) | 0x1f; + asm volatile ("shfl.sync.bfly.b32 %0, %1, %2, %3, %4;" : "=f"(ret) : "f"(var), "r"(lanemask), "r"(c), "r"(0xffffffff)); + return ret; + } + #else + inline double shfl_down(double var, unsigned int delta, int width) { + int c = ((SIMD_SIZE-width) << 8) | 0x1f; + int x,y,x2,y2; + double ans; + asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(y), "=r"(x) : "d"(var)); + asm volatile ("shfl.sync.down.b32 %0, %1, %2, %3, %4;" : "=r"(x2) : "r"(x), "r"(delta), "r"(c), "r"(0xffffffff)); + asm volatile ("shfl.sync.down.b32 %0, %1, %2, %3, %4;" : "=r"(y2) : "r"(y), "r"(delta), "r"(c), "r"(0xffffffff)); + asm volatile ("mov.b64 %0, {%1, %2};" : "=d"(ans) : "r"(y2), "r"(x2)); + return ans; + } + inline double shfl_xor(double var, unsigned int lanemask, int width) { + int c = ((SIMD_SIZE-width) << 8) | 0x1f; + int x,y,x2,y2; + double ans; + asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(y), "=r"(x) : "d"(var)); + asm volatile ("shfl.sync.bfly.b32 %0, %1, %2, %3, %4;" : "=r"(x2) : "r"(x), "r"(lanemask), "r"(c), "r"(0xffffffff)); + asm volatile ("shfl.sync.bfly.b32 %0, %1, %2, %3, %4;" : "=r"(y2) : "r"(y), "r"(lanemask), "r"(c), "r"(0xffffffff)); + asm volatile ("mov.b64 %0, {%1, %2};" : "=d"(ans) : "r"(y2), "r"(x2)); + return ans; + } + #endif + inline int simd_broadcast_i(int var, unsigned int src, int width) { + int ret; + int c; + c = ((SIMD_SIZE-width) << 8) | 0x1f; + asm volatile ("shfl.sync.idx.b32 %0, %1, %2, %3, %4;" : "=f"(ret) : "f"(var), "r"(src), "r"(c), "r"(0xffffffff)); + return ret; + } + inline float simd_broadcast_f(float var, unsigned int src, int width) { + float ret; + int c; + c = ((SIMD_SIZE-width) << 8) | 0x1f; + asm volatile ("shfl.sync.idx.b32 %0, %1, %2, %3, %4;" : "=f"(ret) : "f"(var), "r"(src), "r"(c), "r"(0xffffffff)); + return ret; + } + #ifdef _DOUBLE_DOUBLE + inline double simd_broadcast_d(double var, unsigned int src, int width) { + int c = ((SIMD_SIZE-width) << 8) | 0x1f; + int x,y,x2,y2; + double ans; + asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(y), "=r"(x) : "d"(var)); + asm volatile ("shfl.sync.idx.b32 %0, %1, %2, %3, %4;" : "=r"(x2) : "r"(x), "r"(src), "r"(c), "r"(0xffffffff)); + asm volatile ("shfl.sync.idx.b32 %0, %1, %2, %3, %4;" : "=r"(y2) : "r"(y), "r"(src), "r"(c), "r"(0xffffffff)); + asm volatile ("mov.b64 %0, {%1, %2};" : "=d"(ans) : "r"(y2), "r"(x2)); + return ans; + } + #endif + #endif +#endif + +// ------------------------------------------------------------------------- +// OPENCL KERNEL MACROS - SUBGROUPS +// ------------------------------------------------------------------------- + +#ifdef USE_OPENCL_SUBGROUPS + #ifndef cl_intel_subgroups + #pragma OPENCL EXTENSION cl_khr_subgroups : enable + #endif + #define simdsync() sub_group_barrier(CLK_LOCAL_MEM_FENCE) + #define simd_size() get_max_sub_group_size() +#else + #define simdsync() + #define simd_size() SIMD_SIZE +#endif + +// ------------------------------------------------------------------------- +// END OPENCL DEFINITIONS +// ------------------------------------------------------------------------- + #endif // ------------------------------------------------------------------------- // ARCHITECTURE INDEPENDENT DEFINITIONS // ------------------------------------------------------------------------- -#ifndef PPPM_MAX_SPLINE -#define PPPM_MAX_SPLINE 8 -#endif - #ifdef _DOUBLE_DOUBLE #define numtyp double #define numtyp2 double2 #define numtyp4 double4 #define acctyp double +#define acctyp2 double2 #define acctyp4 double4 #endif @@ -663,6 +305,7 @@ inline double shfl_xor(double var, int laneMask, int width) { #define numtyp2 float2 #define numtyp4 float4 #define acctyp double +#define acctyp2 double2 #define acctyp4 double4 #endif @@ -671,6 +314,7 @@ inline double shfl_xor(double var, int laneMask, int width) { #define numtyp2 float2 #define numtyp4 float4 #define acctyp float +#define acctyp2 float2 #define acctyp4 float4 #endif @@ -686,11 +330,9 @@ inline double shfl_xor(double var, int laneMask, int width) { #define NEIGHMASK 0x3FFFFFFF ucl_inline int sbmask(int j) { return j >> SBBITS & 3; }; -#ifndef BLOCK_ELLIPSE -#define BLOCK_ELLIPSE BLOCK_PAIR -#endif - -// default to 32-bit smallint and other ints, 64-bit bigint: same as defined in src/lmptype.h -#if !defined(LAMMPS_SMALLSMALL) && !defined(LAMMPS_BIGBIG) && !defined(LAMMPS_SMALLBIG) +// default to 32-bit smallint and other ints, 64-bit bigint: +// same as defined in src/lmptype.h +#if !defined(LAMMPS_SMALLSMALL) && !defined(LAMMPS_BIGBIG) && \ + !defined(LAMMPS_SMALLBIG) #define LAMMPS_SMALLBIG #endif diff --git a/lib/gpu/lal_re_squared.cpp b/lib/gpu/lal_re_squared.cpp index 81dc3b13a4..aabfb9d39f 100644 --- a/lib/gpu/lal_re_squared.cpp +++ b/lib/gpu/lal_re_squared.cpp @@ -116,7 +116,7 @@ int RESquaredT::init(const int ntypes, double **host_shape, double **host_well, host_write[i*4+2]=host_shape[i][2]; } UCL_H_Vec view4; - view4.view((numtyp4*)host_write.begin(),shape.numel(),*(this->ucl_device)); + view4.view(host_write,shape.numel()); ucl_copy(shape,view4,false); well.alloc(ntypes,*(this->ucl_device),UCL_READ_ONLY); @@ -125,7 +125,7 @@ int RESquaredT::init(const int ntypes, double **host_shape, double **host_well, host_write[i*4+1]=host_well[i][1]; host_write[i*4+2]=host_well[i][2]; } - view4.view((numtyp4*)host_write.begin(),well.numel(),*(this->ucl_device)); + view4.view(host_write,well.numel()); ucl_copy(well,view4,false); _allocated=true; @@ -172,18 +172,8 @@ double RESquaredT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void RESquaredT::loop(const bool _eflag, const bool _vflag) { +int RESquaredT::loop(const int eflag, const int vflag) { const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; int GX=0, NGX; int stride=this->nbor->nbor_pitch(); @@ -201,8 +191,8 @@ void RESquaredT::loop(const bool _eflag, const bool _vflag) { this->time_nbor1.stop(); this->time_ellipsoid.start(); - this->k_ellipsoid.set_size(GX,BX); - this->k_ellipsoid.run(&this->atom->x, &this->atom->quat, + this->k_elps_sel->set_size(GX,BX); + this->k_elps_sel->run(&this->atom->x, &this->atom->quat, &this->shape, &this->well, &this->special_lj, &this->sigma_epsilon, &this->_lj_types, &this->nbor->dev_nbor, &stride, @@ -218,8 +208,8 @@ void RESquaredT::loop(const bool _eflag, const bool _vflag) { this->time_nbor2.stop(); this->time_ellipsoid2.start(); - this->k_ellipsoid_sphere.set_size(GX,BX); - this->k_ellipsoid_sphere.run(&this->atom->x, &this->atom->quat, + this->k_elps_sphere_sel->set_size(GX,BX); + this->k_elps_sphere_sel->run(&this->atom->x, &this->atom->quat, &this->shape, &this->well, &this->special_lj, &this->sigma_epsilon, &this->_lj_types, &this->nbor->dev_nbor, &stride, @@ -233,7 +223,7 @@ void RESquaredT::loop(const bool _eflag, const bool _vflag) { this->time_nbor3.zero(); this->time_ellipsoid3.zero(); this->time_lj.zero(); - return; + return ainum; } // ------------ SPHERE_ELLIPSE --------------- @@ -249,8 +239,8 @@ void RESquaredT::loop(const bool _eflag, const bool _vflag) { this->time_nbor3.stop(); this->time_ellipsoid3.start(); - this->k_sphere_ellipsoid.set_size(GX,BX); - this->k_sphere_ellipsoid.run(&this->atom->x, &this->atom->quat, + this->k_sphere_elps_sel->set_size(GX,BX); + this->k_sphere_elps_sel->run(&this->atom->x, &this->atom->quat, &this->shape, &this->well, &this->special_lj, &this->sigma_epsilon, &this->_lj_types, &this->nbor->dev_nbor, &stride, @@ -277,8 +267,8 @@ void RESquaredT::loop(const bool _eflag, const bool _vflag) { this->time_lj.start(); if (this->_last_ellipseans->inum()) { if (this->_shared_types) { - this->k_lj_fast.set_size(GX,BX); - this->k_lj_fast.run(&this->atom->x, &this->lj1, &this->lj3, + this->k_lj_sel->set_size(GX,BX); + this->k_lj_sel->run(&this->atom->x, &this->lj1, &this->lj3, &this->special_lj, &stride, &this->nbor->dev_packed, &this->ans->force, &this->ans->engv, &this->dev_error, @@ -303,8 +293,8 @@ void RESquaredT::loop(const bool _eflag, const bool _vflag) { ELLIPSE_ELLIPSE,_shared_types,_lj_types); this->time_nbor1.stop(); this->time_ellipsoid.start(); - this->k_ellipsoid.set_size(GX,BX); - this->k_ellipsoid.run(&this->atom->x, &this->atom->quat, + this->k_elps_sel->set_size(GX,BX); + this->k_elps_sel->run(&this->atom->x, &this->atom->quat, &this->shape, &this->well, &this->special_lj, &this->sigma_epsilon, &this->_lj_types, &this->nbor->dev_nbor, &stride, &this->ans->force, @@ -312,6 +302,7 @@ void RESquaredT::loop(const bool _eflag, const bool _vflag) { &eflag, &vflag, &ainum, &this->_threads_per_atom); this->time_ellipsoid.stop(); } + return ainum; } template class RESquared; diff --git a/lib/gpu/lal_re_squared.cu b/lib/gpu/lal_re_squared.cu index 8852a46913..c69a338749 100644 --- a/lib/gpu/lal_re_squared.cu +++ b/lib/gpu/lal_re_squared.cu @@ -51,33 +51,30 @@ __kernel void k_resquared(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_ellipse(); + sp_lj[0]=splj[0]; sp_lj[1]=splj[1]; sp_lj[2]=splj[2]; sp_lj[3]=splj[3]; - __local numtyp b_alpha, cr60; - b_alpha=(numtyp)45.0/(numtyp)56.0; - cr60=ucl_cbrt((numtyp)60.0); + const numtyp b_alpha=(numtyp)45.0/(numtyp)56.0; + const numtyp cr60=ucl_cbrt((numtyp)60.0); - acctyp energy=(acctyp)0; - acctyp4 f; - f.x=(acctyp)0; - f.y=(acctyp)0; - f.z=(acctyp)0; - acctyp4 tor; - tor.x=(acctyp)0; - tor.y=(acctyp)0; - tor.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp4 f, tor; + f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; + tor.x=(acctyp)0; tor.y=(acctyp)0; tor.z=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) + if (EVFLAG && vflag) virial[0]+=-r[0]*force; } else if (i==1) { f.y+=force; - if (vflag>0) { + if (EVFLAG && vflag) { virial[1]+=-r[1]*force; virial[3]+=-r[0]*force; } } else { f.z+=force; - if (vflag>0) { + if (EVFLAG && vflag) { virial[2]+=-r[2]*force; virial[4]+=-r[0]*force; virial[5]+=-r[1]*force; @@ -452,8 +449,7 @@ __kernel void k_resquared(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_t(f,tor,energy,virial,ii,astride,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_t(f,tor,energy,virial,ii,astride,tid,t_per_atom,offset,eflag, + vflag,ans,engv,inum); } - diff --git a/lib/gpu/lal_re_squared.h b/lib/gpu/lal_re_squared.h index 9e4f4af67a..1b0a837764 100644 --- a/lib/gpu/lal_re_squared.h +++ b/lib/gpu/lal_re_squared.h @@ -82,7 +82,7 @@ class RESquared : public BaseEllipsoid { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_re_squared_lj.cu b/lib/gpu/lal_re_squared_lj.cu index 112a4db8d9..ca1b08facd 100644 --- a/lib/gpu/lal_re_squared_lj.cu +++ b/lib/gpu/lal_re_squared_lj.cu @@ -17,12 +17,18 @@ #include "lal_ellipsoid_extra.h" #endif -#if (ARCH < 300) +#if (SHUFFLE_AVAIL == 0) +#define local_allocate_store_ellipse_lj local_allocate_store_ellipse +#else +#define local_allocate_store_ellipse_lj() \ + __local acctyp red_acc[7][BLOCK_ELLIPSE / SIMD_SIZE]; +#endif + +#if (SHUFFLE_AVAIL == 0) #define store_answers_rt(f, tor, energy, virial, ii, astride, tid, \ - t_per_atom, offset, eflag, vflag, ans, engv) \ + t_per_atom, offset, eflag, vflag, ans, engv, inum) \ if (t_per_atom>1) { \ - __local acctyp red_acc[7][BLOCK_PAIR]; \ red_acc[0][tid]=f.x; \ red_acc[1][tid]=f.y; \ red_acc[2][tid]=f.z; \ @@ -30,6 +36,7 @@ red_acc[4][tid]=tor.y; \ red_acc[5][tid]=tor.z; \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + simdsync(); \ if (offset < s) { \ for (int r=0; r<6; r++) \ red_acc[r][tid] += red_acc[r][tid+s]; \ @@ -41,28 +48,39 @@ tor.x=red_acc[3][tid]; \ tor.y=red_acc[4][tid]; \ tor.z=red_acc[5][tid]; \ - if (eflag>0 || vflag>0) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid]=virial[r]; \ - red_acc[6][tid]=energy; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<7; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ + if (EVFLAG && (eflag || vflag)) { \ + if (vflag) { \ + simdsync(); \ + for (int r=0; r<6; r++) \ + red_acc[r][tid]=virial[r]; \ + for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + simdsync(); \ + if (offset < s) { \ + for (int r=0; r<6; r++) \ + red_acc[r][tid] += red_acc[r][tid+s]; \ + } \ + } \ + for (int r=0; r<6; r++) \ + virial[r]=red_acc[r][tid]; \ + } \ + if (eflag) { \ + simdsync(); \ + red_acc[0][tid]=energy; \ + for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + simdsync(); \ + if (offset < s) red_acc[0][tid] += red_acc[0][tid+s]; \ } \ } \ - for (int r=0; r<6; r++) \ - virial[r]=red_acc[r][tid]; \ - energy=red_acc[6][tid]; \ + energy=red_acc[0][tid]; \ } \ } \ - if (offset==0) { \ + if (offset==0 && ii0) { \ + if (EVFLAG && eflag) { \ *ap1+=energy*(acctyp)0.5; \ ap1+=astride; \ } \ - if (vflag>0) { \ + if (EVFLAG && vflag) { \ for (int i=0; i<6; i++) { \ *ap1+=virial[i]*(acctyp)0.5; \ ap1+=astride; \ @@ -82,32 +100,32 @@ #else -#define store_answers_rt(f, tor, energy, virial, ii, astride, tid, \ - t_per_atom, offset, eflag, vflag, ans, engv) \ - if (t_per_atom>1) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - f.x += shfl_xor(f.x, s, t_per_atom); \ - f.y += shfl_xor(f.y, s, t_per_atom); \ - f.z += shfl_xor(f.z, s, t_per_atom); \ - tor.x += shfl_xor(tor.x, s, t_per_atom); \ - tor.y += shfl_xor(tor.y, s, t_per_atom); \ - tor.z += shfl_xor(tor.z, s, t_per_atom); \ - energy += shfl_xor(energy, s, t_per_atom); \ +#define store_answers_rt(f, tor, energy, virial, ii, astride, tid, \ + t_per_atom, offset, eflag, vflag, ans, engv, inum) \ + if (t_per_atom>1) { \ + for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + f.x += shfl_down(f.x, s, t_per_atom); \ + f.y += shfl_down(f.y, s, t_per_atom); \ + f.z += shfl_down(f.z, s, t_per_atom); \ + tor.x += shfl_down(tor.x, s, t_per_atom); \ + tor.y += shfl_down(tor.y, s, t_per_atom); \ + tor.z += shfl_down(tor.z, s, t_per_atom); \ + energy += shfl_down(energy, s, t_per_atom); \ } \ - if (vflag>0) { \ + if (EVFLAG && vflag) { \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ for (int r=0; r<6; r++) \ - virial[r] += shfl_xor(virial[r], s, t_per_atom); \ + virial[r] += shfl_down(virial[r], s, t_per_atom); \ } \ } \ } \ - if (offset==0) { \ + if (offset==0 && ii0) { \ + if (EVFLAG && eflag) { \ *ap1+=energy*(acctyp)0.5; \ ap1+=astride; \ } \ - if (vflag>0) { \ + if (EVFLAG && vflag) { \ for (int i=0; i<6; i++) { \ *ap1+=virial[i]*(acctyp)0.5; \ ap1+=astride; \ @@ -147,35 +165,34 @@ __kernel void k_resquared_ellipsoid_sphere(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_ellipse(); + sp_lj[0]=splj[0]; sp_lj[1]=splj[1]; sp_lj[2]=splj[2]; sp_lj[3]=splj[3]; - __local numtyp b_alpha, cr60, solv_f_a, solv_f_r; - b_alpha=(numtyp)45.0/(numtyp)56.0; - cr60=ucl_cbrt((numtyp)60.0); - solv_f_a = (numtyp)3.0/((numtyp)16.0*ucl_atan((numtyp)1.0)*-(numtyp)36.0); - solv_f_r = (numtyp)3.0/((numtyp)16.0*ucl_atan((numtyp)1.0)*(numtyp)2025.0); + const numtyp b_alpha=(numtyp)45.0/(numtyp)56.0; + const numtyp cr60=ucl_cbrt((numtyp)60.0); + const numtyp solv_f_a = + (numtyp)3.0/((numtyp)16.0*ucl_atan((numtyp)1.0)*-(numtyp)36.0); + const numtyp solv_f_r = + (numtyp)3.0/((numtyp)16.0*ucl_atan((numtyp)1.0)*(numtyp)2025.0); - acctyp energy=(acctyp)0; - acctyp4 f; - f.x=(acctyp)0; - f.y=(acctyp)0; - f.z=(acctyp)0; - acctyp4 tor; - tor.x=(acctyp)0; - tor.y=(acctyp)0; - tor.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp4 f, tor; + f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; + tor.x=(acctyp)0; tor.y=(acctyp)0; tor.z=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) + if (EVFLAG && vflag) virial[0]+=-r[0]*force; } else if (i==1) { f.y+=force; - if (vflag>0) { + if (EVFLAG && vflag) { virial[1]+=-r[1]*force; virial[3]+=-r[0]*force; } } else { f.z+=force; - if (vflag>0) { + if (EVFLAG && vflag) { virial[2]+=-r[2]*force; virial[4]+=-r[0]*force; virial[5]+=-r[1]*force; @@ -378,9 +395,9 @@ __kernel void k_resquared_ellipsoid_sphere(const __global numtyp4 *restrict x_, } } // for nbor - store_answers_rt(f,tor,energy,virial,ii,astride,tid,t_per_atom,offset,eflag, - vflag,ans,engv); } // if ii + store_answers_rt(f,tor,energy,virial,ii,astride,tid,t_per_atom,offset, + eflag,vflag,ans,engv,inum); } __kernel void k_resquared_sphere_ellipsoid(const __global numtyp4 *restrict x_, @@ -403,31 +420,33 @@ __kernel void k_resquared_sphere_ellipsoid(const __global numtyp4 *restrict x_, ii+=start; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_ellipse_lj(); + sp_lj[0]=splj[0]; sp_lj[1]=splj[1]; sp_lj[2]=splj[2]; sp_lj[3]=splj[3]; - __local numtyp b_alpha, cr60, solv_f_a, solv_f_r; - b_alpha=(numtyp)45.0/(numtyp)56.0; - cr60=ucl_cbrt((numtyp)60.0); - solv_f_a = (numtyp)3.0/((numtyp)16.0*ucl_atan((numtyp)1.0)*-(numtyp)36.0); - solv_f_r = (numtyp)3.0/((numtyp)16.0*ucl_atan((numtyp)1.0)*(numtyp)2025.0); + const numtyp b_alpha=(numtyp)45.0/(numtyp)56.0; + const numtyp cr60=ucl_cbrt((numtyp)60.0); + const numtyp solv_f_a = + (numtyp)3.0/((numtyp)16.0*ucl_atan((numtyp)1.0)*-(numtyp)36.0); + const numtyp solv_f_r = + (numtyp)3.0/((numtyp)16.0*ucl_atan((numtyp)1.0)*(numtyp)2025.0); - acctyp energy=(acctyp)0; acctyp4 f; - f.x=(acctyp)0; - f.y=(acctyp)0; - f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) + if (EVFLAG && vflag) virial[0]+=-r[0]*force; } else if (i==1) { f.y+=force; - if (vflag>0) { + if (EVFLAG && vflag) { virial[1]+=-r[1]*force; virial[3]+=-r[0]*force; } } else { f.z+=force; - if (vflag>0) { + if (EVFLAG && vflag) { virial[2]+=-r[2]*force; virial[4]+=-r[0]*force; virial[5]+=-r[1]*force; @@ -579,9 +598,9 @@ __kernel void k_resquared_sphere_ellipsoid(const __global numtyp4 *restrict x_, } } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_resquared_lj(const __global numtyp4 *restrict x_, @@ -601,26 +620,27 @@ __kernel void k_resquared_lj(const __global numtyp4 *restrict x_, ii+=start; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_ellipse(); + sp_lj[0]=gum[0]; sp_lj[1]=gum[1]; sp_lj[2]=gum[2]; sp_lj[3]=gum[3]; - acctyp energy=(acctyp)0; acctyp4 f; - f.x=(acctyp)0; - f.y=(acctyp)0; - f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e=r6inv*(lj3[ii].x*r6inv-lj3[ii].y); energy+=factor_lj*(e-lj3[ii].z); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -666,9 +686,9 @@ __kernel void k_resquared_lj(const __global numtyp4 *restrict x_, } } } // for nbor - acc_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + acc_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_resquared_lj_fast(const __global numtyp4 *restrict x_, @@ -690,31 +710,32 @@ __kernel void k_resquared_lj_fast(const __global numtyp4 *restrict x_, __local numtyp sp_lj[4]; __local numtyp4 lj1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 lj3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; + int n_stride; + local_allocate_store_ellipse(); + if (tid<4) sp_lj[tid]=gum[tid]; if (tid0) + if (EVFLAG && eflag) lj3[tid]=lj3_in[tid]; } - acctyp energy=(acctyp)0; acctyp4 f; - f.x=(acctyp)0; - f.y=(acctyp)0; - f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { numtyp e=r6inv*(lj3[mtype].x*r6inv-lj3[mtype].y); energy+=factor_lj*(e-lj3[mtype].z); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -760,8 +781,7 @@ __kernel void k_resquared_lj_fast(const __global numtyp4 *restrict x_, } } // for nbor - acc_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + acc_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } - diff --git a/lib/gpu/lal_soft.cpp b/lib/gpu/lal_soft.cpp index 8e944fa0a5..e77be5a011 100644 --- a/lib/gpu/lal_soft.cpp +++ b/lib/gpu/lal_soft.cpp @@ -121,20 +121,9 @@ double SoftT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void SoftT::loop(const bool _eflag, const bool _vflag) { +int SoftT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -142,8 +131,8 @@ void SoftT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &coeff, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &coeff, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->_threads_per_atom); @@ -155,6 +144,7 @@ void SoftT::loop(const bool _eflag, const bool _vflag) { &ainum, &nbor_pitch, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class Soft; diff --git a/lib/gpu/lal_soft.cu b/lib/gpu/lal_soft.cu index 5df34e7b1d..74ac0e0c97 100644 --- a/lib/gpu/lal_soft.cu +++ b/lib/gpu/lal_soft.cu @@ -40,22 +40,25 @@ __kernel void k_soft(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e=coeff[mtype].x * ((numtyp)1.0+cos(arg)); energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -106,9 +109,9 @@ __kernel void k_soft(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_soft_fast(const __global numtyp4 *restrict x_, @@ -125,25 +128,28 @@ __kernel void k_soft_fast(const __global numtyp4 *restrict x_, __local numtyp4 coeff[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) { + if (EVFLAG && eflag) { numtyp e=coeff[mtype].x * ((numtyp)1.0+cos(arg)); energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -194,8 +200,8 @@ __kernel void k_soft_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } diff --git a/lib/gpu/lal_soft.h b/lib/gpu/lal_soft.h index b33314ee03..fd86f62927 100644 --- a/lib/gpu/lal_soft.h +++ b/lib/gpu/lal_soft.h @@ -73,7 +73,7 @@ class Soft : public BaseAtomic { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_soft_ext.cpp b/lib/gpu/lal_soft_ext.cpp index 7c0cbe7973..a32a5e5a00 100644 --- a/lib/gpu/lal_soft_ext.cpp +++ b/lib/gpu/lal_soft_ext.cpp @@ -55,7 +55,7 @@ int soft_gpu_init(const int ntypes, double **cutsq, double **host_prefactor, int init_ok=0; if (world_me==0) init_ok=SLMF.init(ntypes, cutsq, host_prefactor, host_cut, - special_lj, inum, nall, 300, + special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); SLMF.device->world_barrier(); @@ -73,7 +73,7 @@ int soft_gpu_init(const int ntypes, double **cutsq, double **host_prefactor, } if (gpu_rank==i && world_me!=0) init_ok=SLMF.init(ntypes, cutsq, host_prefactor, host_cut, - special_lj, inum, nall, 300, maxspecial, + special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); SLMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_sw.cpp b/lib/gpu/lal_sw.cpp index 5c7bd45c76..eb42c710cc 100644 --- a/lib/gpu/lal_sw.cpp +++ b/lib/gpu/lal_sw.cpp @@ -43,114 +43,83 @@ int SWT::bytes_per_atom(const int max_nbors) const { } template -int SWT::init(const int ntypes, const int nlocal, const int nall, const int max_nbors, - const double cell_size, const double gpu_split, FILE *_screen, - int* host_map, const int nelements, int*** host_elem2param, const int nparams, - const double* epsilon, const double* sigma, - const double* lambda, const double* gamma, - const double* costheta, const double* biga, - const double* bigb, const double* powerp, - const double* powerq, const double* cut, const double* cutsq) -{ +int SWT::init(const int ntypes, const int nlocal, const int nall, + const int max_nbors, const double cell_size, + const double gpu_split, FILE *_screen, double **ncutsq, + double **ncut, double **sigma, double **powerp, double **powerq, + double **sigma_gamma, double **c1, double **c2, double **c3, + double **c4, double **c5, double **c6, double ***lambda_epsilon, + double ***costheta, const int *map, int ***e2param) { + _lj_types=ntypes; + + int oldparam=-1; + int onetype=-1; + int onetype3=0; + int spq=1; + int mtypes=0; + #ifdef USE_OPENCL + for (int ii=1; ii1) onetype=-1; + #endif + int success; success=this->init_three(nlocal,nall,max_nbors,0,cell_size,gpu_split, _screen,sw,"k_sw","k_sw_three_center", - "k_sw_three_end","k_sw_short_nbor"); + "k_sw_three_end","k_sw_short_nbor",onetype, + onetype3,spq); if (success!=0) return success; - // If atom type constants fit in shared memory use fast kernel - int lj_types=ntypes; - shared_types=false; - int max_shared_types=this->device->max_shared_types(); - if (lj_types<=max_shared_types && this->_block_size>=max_shared_types) { - lj_types=max_shared_types; - shared_types=true; - } - _lj_types=lj_types; + UCL_H_Vec host_write(ntypes*ntypes*ntypes*4,*(this->ucl_device), + UCL_WRITE_ONLY); + host_write.zero(); - _nparams = nparams; - _nelements = nelements; - - UCL_H_Vec dview(nparams,*(this->ucl_device), - UCL_WRITE_ONLY); - - for (int i=0; i 0.0 && ncutsq[i][j]>=ccutsq) + ncutsq[i][j]=ccutsq*0.98; } // pack coefficients into arrays - sw1.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); - - for (int i=0; i(epsilon[i]); - dview[i].y=static_cast(sigma[i]); - dview[i].z=static_cast(lambda[i]); - dview[i].w=static_cast(gamma[i]); - } - - ucl_copy(sw1,dview,false); - sw1_tex.get_texture(*(this->pair_program),"sw1_tex"); - sw1_tex.bind_float(sw1,4); - - sw2.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); - - for (int i=0; i(biga[i]); - dview[i].y=static_cast(bigb[i]); - dview[i].z=static_cast(powerp[i]); - dview[i].w=static_cast(powerq[i]); - } - - ucl_copy(sw2,dview,false); - sw2_tex.get_texture(*(this->pair_program),"sw2_tex"); - sw2_tex.bind_float(sw2,4); - - sw3.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); - - for (int i=0; i=sw_cut*sw_cut) - sw_cutsq=sw_cut*sw_cut-1e-4; - dview[i].x=static_cast(sw_cut); - dview[i].y=static_cast(sw_cutsq); - dview[i].z=static_cast(costheta[i]); - dview[i].w=(numtyp)0; - } - - ucl_copy(sw3,dview,false); - sw3_tex.get_texture(*(this->pair_program),"sw3_tex"); - sw3_tex.bind_float(sw3,4); - - UCL_H_Vec dview_elem2param(nelements*nelements*nelements, - *(this->ucl_device), UCL_WRITE_ONLY); - - elem2param.alloc(nelements*nelements*nelements,*(this->ucl_device), - UCL_READ_ONLY); - - for (int i = 0; i < nelements; i++) - for (int j = 0; j < nelements; j++) - for (int k = 0; k < nelements; k++) { - int idx = i*nelements*nelements+j*nelements+k; - dview_elem2param[idx] = host_elem2param[i][j][k]; - } - - ucl_copy(elem2param,dview_elem2param,false); - - UCL_H_Vec dview_map(lj_types, *(this->ucl_device), UCL_WRITE_ONLY); - for (int i = 0; i < ntypes; i++) - dview_map[i] = host_map[i]; - - map.alloc(lj_types,*(this->ucl_device), UCL_READ_ONLY); - ucl_copy(map,dview_map,false); + cutsq.alloc(ntypes*ntypes,*(this->ucl_device),UCL_READ_ONLY); + this->atom->type_pack1(ntypes,ntypes,cutsq,host_write,ncutsq); + sw_pre.alloc(ntypes*ntypes,*(this->ucl_device),UCL_READ_ONLY); + this->atom->type_pack4(ntypes,ntypes,sw_pre,host_write,ncut,sigma, + powerp,powerq); + c_14.alloc(ntypes*ntypes,*(this->ucl_device),UCL_READ_ONLY); + this->atom->type_pack4(ntypes,ntypes,c_14,host_write,c1,c2,c3,c4); + c_56.alloc(ntypes*ntypes,*(this->ucl_device),UCL_READ_ONLY); + this->atom->type_pack2(ntypes,ntypes,c_56,host_write,c5,c6); + cut_sigma_gamma.alloc(ntypes*ntypes,*(this->ucl_device),UCL_READ_ONLY); + this->atom->type_pack2(ntypes,ntypes,cut_sigma_gamma,host_write,ncut, + sigma_gamma); + sw_pre3.alloc(ntypes*ntypes*ntypes,*(this->ucl_device),UCL_READ_ONLY); + this->atom->type_pack2(ntypes,sw_pre3,host_write,lambda_epsilon,costheta); _allocated=true; - this->_max_bytes=sw1.row_bytes()+sw2.row_bytes()+sw3.row_bytes()+ - map.row_bytes()+elem2param.row_bytes(); + this->_max_bytes=cutsq.row_bytes()+sw_pre.row_bytes()+c_14.row_bytes()+ + c_56.row_bytes()+cut_sigma_gamma.row_bytes()+sw_pre3.row_bytes(); return 0; } @@ -160,11 +129,12 @@ void SWT::clear() { return; _allocated=false; - sw1.clear(); - sw2.clear(); - sw3.clear(); - map.clear(); - elem2param.clear(); + cutsq.clear(); + sw_pre.clear(); + c_14.clear(); + c_56.clear(); + cut_sigma_gamma.clear(); + sw_pre3.clear(); this->clear_atomic(); } @@ -179,58 +149,33 @@ double SWT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void SWT::loop(const bool _eflag, const bool _vflag, const int evatom) { - // Compute the block size and grid size to keep all cores busy - int BX=this->block_pair(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; +int SWT::loop(const int eflag, const int vflag, const int evatom, + bool &success) { + const int nbor_pitch=this->nbor->nbor_pitch(); // build the short neighbor list int ainum=this->_ainum; - int nbor_pitch=this->nbor->nbor_pitch(); - int GX=static_cast(ceil(static_cast(ainum)/ - (BX/this->_threads_per_atom))); + this->time_pair.start(); + + int BX=this->block_pair(); + int GX=static_cast(ceil(static_cast(ainum)/BX)); this->k_short_nbor.set_size(GX,BX); - this->k_short_nbor.run(&this->atom->x, &sw3, &map, &elem2param, &_nelements, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->dev_short_nbor, &ainum, - &nbor_pitch, &this->_threads_per_atom); + this->k_short_nbor.run(&this->atom->x, &cutsq, &_lj_types, + &this->nbor->dev_nbor, &this->nbor->dev_packed, + &ainum, &nbor_pitch, &this->_threads_per_atom); // this->_nbor_data == nbor->dev_packed for gpu_nbor == 0 and tpa > 1 // this->_nbor_data == nbor->dev_nbor for gpu_nbor == 1 or tpa == 1 ainum=this->ans->inum(); - nbor_pitch=this->nbor->nbor_pitch(); - GX=static_cast(ceil(static_cast(this->ans->inum())/ - (BX/this->_threads_per_atom))); - this->time_pair.start(); - - this->k_pair.set_size(GX,BX); - this->k_pair.run(&this->atom->x, &sw1, &sw2, &sw3, - &map, &elem2param, &_nelements, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->dev_short_nbor, - &this->ans->force, &this->ans->engv, - &eflag, &vflag, &ainum, &nbor_pitch, - &this->_threads_per_atom); - BX=this->block_size(); GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/(KTHREADS*JTHREADS)))); - this->k_three_center.set_size(GX,BX); - this->k_three_center.run(&this->atom->x, &sw1, &sw2, &sw3, - &map, &elem2param, &_nelements, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->dev_short_nbor, - &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, - &nbor_pitch, &this->_threads_per_atom, &evatom); + this->k_3center_sel->set_size(GX,BX); + this->k_3center_sel->run(&this->atom->x, &cut_sigma_gamma, &sw_pre3, + &_lj_types, &this->nbor->dev_nbor, + &this->ans->force, &this->ans->engv, &eflag, + &vflag, &ainum, &nbor_pitch, + &this->_threads_per_atom, &evatom); Answer *end_ans; #ifdef THREE_CONCURRENT @@ -240,25 +185,32 @@ void SWT::loop(const bool _eflag, const bool _vflag, const int evatom) { #endif if (evatom!=0) { this->k_three_end_vatom.set_size(GX,BX); - this->k_three_end_vatom.run(&this->atom->x, &sw1, &sw2, &sw3, - &map, &elem2param, &_nelements, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->nbor->dev_ilist, &this->dev_short_nbor, - &end_ans->force, &end_ans->engv, &eflag, &vflag, &ainum, - &nbor_pitch, &this->_threads_per_atom, &this->_gpu_nbor); - + this->k_three_end_vatom.run(&this->atom->x, &cut_sigma_gamma, + &sw_pre3, &_lj_types, &this->nbor->dev_nbor, + &this->nbor->three_ilist, &end_ans->force, + &end_ans->engv, &eflag, &vflag, &ainum, + &nbor_pitch,&this->_threads_per_atom, + &this->_gpu_nbor); } else { - this->k_three_end.set_size(GX,BX); - this->k_three_end.run(&this->atom->x, &sw1, &sw2, &sw3, - &map, &elem2param, &_nelements, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->nbor->dev_ilist, &this->dev_short_nbor, - &end_ans->force, &end_ans->engv, &eflag, &vflag, &ainum, - &nbor_pitch, &this->_threads_per_atom, &this->_gpu_nbor); - + this->k_3end_sel->set_size(GX,BX); + this->k_3end_sel->run(&this->atom->x, &cut_sigma_gamma, &sw_pre3, + &_lj_types, &this->nbor->dev_nbor, + &this->nbor->three_ilist, &end_ans->force, + &end_ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, + &this->_threads_per_atom, &this->_gpu_nbor); } + BX=this->block_pair(); + int GXT=static_cast(ceil(static_cast(this->ans->inum())/ + (BX/this->_threads_per_atom))); + this->k_sel->set_size(GXT,BX); + this->k_sel->run(&this->atom->x, &sw_pre, &c_14, &c_56, + &_lj_types, &this->nbor->dev_nbor, + &this->ans->force, &this->ans->engv, &eflag, &vflag, + &ainum, &nbor_pitch, &this->_threads_per_atom, &GX); + this->time_pair.stop(); + return GX; } template class SW; diff --git a/lib/gpu/lal_sw.cu b/lib/gpu/lal_sw.cu index 2b38bd02dc..621ba87208 100644 --- a/lib/gpu/lal_sw.cu +++ b/lib/gpu/lal_sw.cu @@ -39,88 +39,161 @@ _texture( sw3_tex,int4); //#define THREE_CONCURRENT -#if (ARCH < 300) +#if (SHUFFLE_AVAIL == 0) -#define store_answers_p(f, energy, virial, ii, inum, tid, t_per_atom, offset, \ - eflag, vflag, ans, engv) \ +#define store_answers_p(f, energy, virial, ii, inum, tid, t_per_atom, \ + offset, eflag, vflag, ans, engv, ev_stride) \ if (t_per_atom>1) { \ - __local acctyp red_acc[6][BLOCK_ELLIPSE]; \ - red_acc[0][tid]=f.x; \ - red_acc[1][tid]=f.y; \ - red_acc[2][tid]=f.z; \ - red_acc[3][tid]=energy; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<4; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ + simd_reduce_add3(t_per_atom, red_acc, offset, tid, f.x, f.y, f.z); \ + if (EVFLAG && (vflag==2 || eflag==2)) { \ + if (eflag) { \ + simdsync(); \ + simd_reduce_add1(t_per_atom, red_acc, offset, tid, energy); \ } \ - } \ - f.x=red_acc[0][tid]; \ - f.y=red_acc[1][tid]; \ - f.z=red_acc[2][tid]; \ - energy=red_acc[3][tid]; \ - if (vflag>0) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid]=virial[r]; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ + if (vflag) { \ + simdsync(); \ + simd_reduce_arr(6, t_per_atom, red_acc, offset, tid, virial); \ } \ - for (int r=0; r<6; r++) \ - virial[r]=red_acc[r][tid]; \ } \ } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]+=energy*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]+=virial[i]*(acctyp)0.5; \ - ei+=inum; \ - } \ - } \ + if (offset==0 && ii1) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - f.x += shfl_xor(f.x, s, t_per_atom); \ - f.y += shfl_xor(f.y, s, t_per_atom); \ - f.z += shfl_xor(f.z, s, t_per_atom); \ - energy += shfl_xor(energy, s, t_per_atom); \ - } \ - if (vflag>0) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - for (int r=0; r<6; r++) \ - virial[r] += shfl_xor(virial[r], s, t_per_atom); \ - } \ + simd_reduce_add3(t_per_atom, f.x, f.y, f.z); \ + if (vflag==2 || eflag==2) { \ + if (eflag) \ + simd_reduce_add1(t_per_atom,energy); \ + if (vflag) \ + simd_reduce_arr(6, t_per_atom,virial); \ } \ } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]+=energy*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]+=virial[i]*(acctyp)0.5; \ + if (offset==0 && ii 1; active_subgs /= vwidth) { \ + if (active_subgs < BLOCK_SIZE_X/simd_size()) __syncthreads(); \ + if (bnum < active_subgs) { \ + if (eflag) { \ + simd_reduce_add1(vwidth, energy); \ + if (voffset==0) red_acc[6][bnum] = energy; \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (voffset==0) \ + for (int r=0; r<6; r++) red_acc[r][bnum]=virial[r]; \ + } \ + } \ + \ + __syncthreads(); \ + if (tid < active_subgs) { \ + if (eflag) energy = red_acc[6][tid]; \ + if (vflag) \ + for (int r = 0; r < 6; r++) virial[r] = red_acc[r][tid]; \ + } else { \ + if (eflag) energy = (acctyp)0; \ + if (vflag) for (int r = 0; r < 6; r++) virial[r] = (acctyp)0; \ + } \ + } \ + \ + if (bnum == 0) { \ + int ei=BLOCK_ID_X; \ + if (eflag) { \ + simd_reduce_add1(vwidth, energy); \ + if (tid==0) { \ + engv[ei]+=energy*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (tid==0) { \ + for (int r=0; r<6; r++) { \ + engv[ei]+=virial[r]*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + } \ + } \ + } else if (offset==0 && ii1) \ + simd_reduce_add3(t_per_atom, f.x, f.y, f.z); \ + if (offset==0 && ii0) - energy+=(pre_sw_c5*rp - pre_sw_c6*rq) * expsrainv; - - if (vflag>0) { - virial[0] += delx*delx*force; - virial[1] += dely*dely*force; - virial[2] += delz*delz*force; - virial[3] += delx*dely*force; - virial[4] += delx*delz*force; - virial[5] += dely*delz*force; - } + if (EVFLAG && vflag) { + virial[0] += delx*delx*force; + virial[1] += dely*dely*force; + virial[2] += delz*delz*force; + virial[3] += delx*dely*force; + virial[4] += delx*delz*force; + virial[5] += dely*delz*force; } } // for nbor - - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii - + store_answers_p(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv,ev_stride); } #define threebody(delr1x,delr1y,delr1z,delr2x,delr2y,delr2z, eflag, energy) \ @@ -334,7 +389,7 @@ __kernel void k_sw(const __global numtyp4 *restrict x_, numtyp facrad = sw_lambda_epsilon_ijk * facexp*delcssq; \ numtyp frad1 = facrad*gsrainvsq1; \ numtyp frad2 = facrad*gsrainvsq2; \ - numtyp facang = sw_lambda_epsilon2_ijk * facexp*delcs; \ + numtyp facang = (numtyp)2.0 * sw_lambda_epsilon_ijk * facexp*delcs; \ numtyp facang12 = rinv12*facang; \ numtyp csfacang = cs*facang; \ numtyp csfac1 = rinvsq1*csfacang; \ @@ -349,9 +404,9 @@ __kernel void k_sw(const __global numtyp4 *restrict x_, fky = delr2y*(frad2+csfac2)-delr1y*facang12; \ fkz = delr2z*(frad2+csfac2)-delr1z*facang12; \ \ - if (eflag>0) \ + if (EVFLAG && eflag) \ energy+=facrad; \ - if (vflag>0) { \ + if (EVFLAG && vflag) { \ virial[0] += delr1x*fjx + delr2x*fkx; \ virial[1] += delr1y*fjy + delr2y*fky; \ virial[2] += delr1z*fjz + delr2z*fkz; \ @@ -384,7 +439,7 @@ __kernel void k_sw(const __global numtyp4 *restrict x_, \ numtyp facrad = sw_lambda_epsilon_ijk * facexp*delcssq; \ numtyp frad1 = facrad*gsrainvsq1; \ - numtyp facang = sw_lambda_epsilon2_ijk * facexp*delcs; \ + numtyp facang = (numtyp)2.0 * sw_lambda_epsilon_ijk * facexp*delcs; \ numtyp facang12 = rinv12*facang; \ numtyp csfacang = cs*facang; \ numtyp csfac1 = rinvsq1*csfacang; \ @@ -394,67 +449,68 @@ __kernel void k_sw(const __global numtyp4 *restrict x_, fjz = delr1z*(frad1+csfac1)-delr2z*facang12; \ } +#ifdef ONETYPE +#define sw_cut_ij sw_cut +#define sw_cut_ik sw_cut +#define sw_sigma_gamma_ij sw_sigma_gamma +#define sw_sigma_gamma_ik sw_sigma_gamma +#endif + __kernel void k_sw_three_center(const __global numtyp4 *restrict x_, - const __global numtyp4 *restrict sw1, - const __global numtyp4 *restrict sw2, - const __global numtyp4 *restrict sw3, - const __global int *restrict map, - const __global int *restrict elem2param, - const int nelements, + const __global numtyp2 *restrict cut_sig_gamma, + const __global numtyp2 *restrict sw_pre3, + const int ntypes, const __global int * dev_nbor, - const __global int * dev_packed, - const __global int * dev_short_nbor, __global acctyp4 *restrict ans, __global acctyp *restrict engv, const int eflag, const int vflag, const int inum, const int nbor_pitch, const int t_per_atom, const int evatom) { - __local int tpa_sq, n_stride; - tpa_sq=fast_mul(t_per_atom,t_per_atom); - numtyp sw_sigma_gamma_ij, sw_cut_ij, sw_sigma_gamma_ik, sw_cut_ik; - numtyp sw_costheta_ijk, sw_lambda_epsilon_ijk, sw_lambda_epsilon2_ijk; + int n_stride; + const int tpa_sq=fast_mul(t_per_atom,t_per_atom); + local_allocate_store_three(); int tid, ii, offset; atom_info(tpa_sq,ii,tid,offset); - acctyp energy=(acctyp)0; + #ifdef ONETYPE + const numtyp sw_cut=cut_sig_gamma[ONETYPE].x; + const numtyp sw_sigma_gamma=cut_sig_gamma[ONETYPE].y; + const numtyp sw_lambda_epsilon_ijk=sw_pre3[ONETYPE3].x; + const numtyp sw_costheta_ijk=sw_pre3[ONETYPE3].y; + #endif + acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; - - __syncthreads(); + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii sw3_ijparam.y) continue; + int nbor_k; + nbor_k = nbor_j-offset_j+offset_k; + if (nbor_k<=nbor_j) nbor_k += n_stride; - numtyp4 sw1_ijparam; fetch4(sw1_ijparam,ijparam,sw1_tex); - sw_sigma_gamma_ij=sw1_ijparam.y*sw1_ijparam.w; //sw_sigma*sw_gamma; - sw_cut_ij=sw3_ijparam.x; - - int nbor_k,k_end; - if (dev_packed==dev_nbor) { - nbor_k=nborj_start-offset_j+offset_k; - int numk = dev_short_nbor[nbor_k-n_stride]; - k_end = nbor_k+fast_mul(numk,n_stride); - } else { - nbor_k = nbor_j-offset_j+offset_k; - if (nbor_k<=nbor_j) nbor_k += n_stride; - k_end = nbor_end; - } - - for ( ; nbor_k sw3_ijparam.y) continue; - - numtyp4 sw1_ijparam; fetch4(sw1_ijparam,ijparam,sw1_tex); - sw_sigma_gamma_ij=sw1_ijparam.y*sw1_ijparam.w; //sw_sigma*sw_gamma; - sw_cut_ij=sw3_ijparam.x; - - int nbor_k,numk; - if (dev_nbor==dev_packed) { - if (gpu_nbor) nbor_k=j+nbor_pitch; - else nbor_k=dev_ilist[j]+nbor_pitch; - numk=dev_nbor[nbor_k]; - nbor_k+=nbor_pitch+fast_mul(j,t_per_atom-1); - k_end=nbor_k+fast_mul(numk/t_per_atom,n_stride)+(numk & (t_per_atom-1)); - nbor_k+=offset_k; - } else { - nbor_k=dev_ilist[j]+nbor_pitch; - numk=dev_nbor[nbor_k]; - nbor_k+=nbor_pitch; - nbor_k=dev_nbor[nbor_k]; - k_end=nbor_k+numk; - nbor_k+=offset_k; - } - - // recalculate numk and k_end for the use of short neighbor list - if (dev_packed==dev_nbor) { - numk = dev_short_nbor[nbor_k]; - nbor_k += n_stride; - k_end = nbor_k+fast_mul(numk,n_stride); - } + int nbor_k; + if (gpu_nbor) nbor_k=j+nbor_pitch; + else nbor_k=dev_ilist[j]+nbor_pitch; + const int numk=dev_nbor[nbor_k]; + nbor_k+=nbor_pitch+fast_mul(j,t_per_atom-1); + k_end=nbor_k+fast_mul(numk/t_per_atom,n_stride)+(numk&(t_per_atom-1)); + nbor_k+=offset_k; for ( ; nbor_k sw3_ijparam.y) continue; - - numtyp4 sw1_ijparam; fetch4(sw1_ijparam,ijparam,sw1_tex); - sw_sigma_gamma_ij=sw1_ijparam.y*sw1_ijparam.w; //sw_sigma*sw_gamma; - sw_cut_ij=sw3_ijparam.x; - - int nbor_k,numk; - if (dev_nbor==dev_packed) { - if (gpu_nbor) nbor_k=j+nbor_pitch; - else nbor_k=dev_ilist[j]+nbor_pitch; - numk=dev_nbor[nbor_k]; - nbor_k+=nbor_pitch+fast_mul(j,t_per_atom-1); - k_end=nbor_k+fast_mul(numk/t_per_atom,n_stride)+(numk & (t_per_atom-1)); - nbor_k+=offset_k; - } else { - nbor_k=dev_ilist[j]+nbor_pitch; - numk=dev_nbor[nbor_k]; - nbor_k+=nbor_pitch; - nbor_k=dev_nbor[nbor_k]; - k_end=nbor_k+numk; - nbor_k+=offset_k; - } - - // recalculate numk and k_end for the use of short neighbor list - if (dev_packed==dev_nbor) { - numk = dev_short_nbor[nbor_k]; - nbor_k += n_stride; - k_end = nbor_k+fast_mul(numk,n_stride); - } + int nbor_k; + if (gpu_nbor) nbor_k=j+nbor_pitch; + else nbor_k=dev_ilist[j]+nbor_pitch; + const int numk=dev_nbor[nbor_k]; + nbor_k+=nbor_pitch+fast_mul(j,t_per_atom-1); + k_end=nbor_k+fast_mul(numk/t_per_atom,n_stride)+(numk&(t_per_atom-1)); + nbor_k+=offset_k; for ( ; nbor_k { * - -3 if there is an out of memory error * - -4 if the GPU library was not compiled for GPU * - -5 Double precision is not supported on card **/ - int init(const int ntypes, const int nlocal, const int nall, const int max_nbors, - const double cell_size, const double gpu_split, FILE *screen, - int* host_map, const int nelements, int*** host_elem2param, const int nparams, - const double* epsilon, const double* sigma, - const double* lambda, const double* gamma, - const double* costheta, const double* biga, - const double* bigb, const double* powerp, - const double* powerq, const double* cut, const double* cutsq); + int init(const int ntypes, const int nlocal, const int nall, + const int max_nbors, const double cell_size, + const double gpu_split, FILE *screen, double **ncutsq, + double **ncut, double **sigma, double **powerp, double **powerq, + double **sigma_gamma, double **c1, double **c2, double **c3, + double **c4, double **c5, double **c6, double ***lambda_epsilon, + double ***costheta, const int *map, int ***e2param); /// Clear all host and device data /** \note This is called at the beginning of the init() routine **/ @@ -64,22 +63,21 @@ class SW : public BaseThree { /// Number of atom types int _lj_types; - /// sw1.x = epsilon, sw1.y = sigma, sw1.z = lambda, sw1.w = gamma - UCL_D_Vec sw1; - /// sw2.x = biga, sw2.y = bigb, sw2.z = powerp, sw2.w = powerq - UCL_D_Vec sw2; - /// sw3.x = cut, sw3.y = cutsq, sw3.z = costheta - UCL_D_Vec sw3; - - UCL_D_Vec elem2param; - UCL_D_Vec map; - int _nparams,_nelements; - - UCL_Texture sw1_tex, sw2_tex, sw3_tex; + UCL_D_Vec cutsq; + /// sw_pre.x = cut, sw_pre.y = sigma, sw_pre.z = powerp, sw_pre.w = powerq + UCL_D_Vec sw_pre; + /// c_14.x = c1, c_14.y = c2, c_14.z = c3, c_14.w = c4 + UCL_D_Vec c_14; + /// c_56.x = c5, c_56.y = c6 + UCL_D_Vec c_56; + /// cut_sigma_gamma.x = cut, cut_sigma_gamma.y = sigma_gamma + UCL_D_Vec cut_sigma_gamma; + /// sw_pre3.x = lambda_epsilon, sw_pre3.y = costheta + UCL_D_Vec sw_pre3; private: bool _allocated; - void loop(const bool _eflag, const bool _vflag, const int evatom); + int loop(const int eflag, const int vflag, const int evatom, bool &success); }; diff --git a/lib/gpu/lal_sw_ext.cpp b/lib/gpu/lal_sw_ext.cpp index 1935ed615b..5158f135a3 100644 --- a/lib/gpu/lal_sw_ext.cpp +++ b/lib/gpu/lal_sw_ext.cpp @@ -27,15 +27,13 @@ static SW SWMF; // --------------------------------------------------------------------------- // Allocate memory on host and device and copy constants to device // --------------------------------------------------------------------------- -int sw_gpu_init(const int ntypes, const int inum, const int nall, const int max_nbors, - const double cell_size, int &gpu_mode, FILE *screen, - int* host_map, const int nelements, int*** host_elem2param, const int nparams, - const double* sw_epsilon, const double* sw_sigma, - const double* sw_lambda, const double* sw_gamma, - const double* sw_costheta, const double* sw_biga, - const double* sw_bigb, const double* sw_powerp, - const double* sw_powerq, const double* sw_cut, - const double* sw_cutsq) { +int sw_gpu_init(const int ntypes, const int inum, const int nall, + const int max_nbors, const double cell_size, int &gpu_mode, + FILE *screen, double **ncutsq, double **ncut, double **sigma, + double **powerp, double **powerq, double **sigma_gamma, + double **c1, double **c2, double **c3, double **c4, + double **c5, double **c6, double ***lambda_epsilon, + double ***costheta, const int *map, int ***e2param) { SWMF.clear(); gpu_mode=SWMF.device->gpu_mode(); double gpu_split=SWMF.device->particle_split(); @@ -62,10 +60,10 @@ int sw_gpu_init(const int ntypes, const int inum, const int nall, const int max_ int init_ok=0; if (world_me==0) - init_ok=SWMF.init(ntypes, inum, nall, 300, cell_size, gpu_split, screen, - host_map, nelements, host_elem2param, nparams, - sw_epsilon, sw_sigma, sw_lambda, sw_gamma, sw_costheta, - sw_biga, sw_bigb, sw_powerp, sw_powerq, sw_cut, sw_cutsq); + init_ok=SWMF.init(ntypes, inum, nall, max_nbors, cell_size, gpu_split, + screen, ncutsq, ncut, sigma, powerp, powerq, + sigma_gamma, c1, c2, c3, c4, c5, c6, lambda_epsilon, + costheta, map, e2param); SWMF.device->world_barrier(); if (message) @@ -81,11 +79,10 @@ int sw_gpu_init(const int ntypes, const int inum, const int nall, const int max_ fflush(screen); } if (gpu_rank==i && world_me!=0) - init_ok=SWMF.init(ntypes, inum, nall, 300, cell_size, gpu_split, screen, - host_map, nelements, host_elem2param, nparams, - sw_epsilon, sw_sigma, sw_lambda, sw_gamma, sw_costheta, - sw_biga, sw_bigb, sw_powerp, sw_powerq, sw_cut, - sw_cutsq); + init_ok=SWMF.init(ntypes, inum, nall, max_nbors, cell_size, gpu_split, + screen, ncutsq, ncut, sigma, powerp, powerq, + sigma_gamma, c1, c2, c3, c4, c5, c6, lambda_epsilon, + costheta, map, e2param); SWMF.device->gpu_barrier(); if (message) @@ -127,5 +124,3 @@ void sw_gpu_compute(const int ago, const int nlocal, const int nall, double sw_gpu_bytes() { return SWMF.host_memory_usage(); } - - diff --git a/lib/gpu/lal_table.cpp b/lib/gpu/lal_table.cpp index d07b2716e4..0c336c6990 100644 --- a/lib/gpu/lal_table.cpp +++ b/lib/gpu/lal_table.cpp @@ -69,6 +69,20 @@ int TableT::init(const int ntypes, k_pair_spline_fast.set_function(*(this->pair_program),"k_table_spline_fast"); k_pair_bitmap.set_function(*(this->pair_program),"k_table_bitmap"); k_pair_bitmap_fast.set_function(*(this->pair_program),"k_table_bitmap_fast"); + + #if defined(LAL_OCL_EV_JIT) + k_pair_linear_noev.set_function(*(this->pair_program_noev), + "k_table_linear_fast"); + k_pair_spline_noev.set_function(*(this->pair_program_noev), + "k_table_spline_fast"); + k_pair_bitmap_noev.set_function(*(this->pair_program_noev), + "k_table_bitmap_fast"); + #else + k_pair_linear_sel = &k_pair_linear_fast; + k_pair_spline_sel = &k_pair_spline_fast; + k_pair_bitmap_sel = &k_pair_bitmap_fast; + #endif + _compiled_styles = true; // If atom type constants fit in shared memory use fast kernel @@ -228,6 +242,11 @@ void TableT::clear() { k_pair_spline.clear(); k_pair_bitmap_fast.clear(); k_pair_bitmap.clear(); + #if defined(LAL_OCL_EV_JIT) + k_pair_linear_noev.clear(); + k_pair_spline_noev.clear(); + k_pair_bitmap_noev.clear(); + #endif _compiled_styles=false; } @@ -243,19 +262,22 @@ double TableT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void TableT::loop(const bool _eflag, const bool _vflag) { +int TableT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - if (_vflag) - vflag=1; - else - vflag=0; + #if defined(LAL_OCL_EV_JIT) + if (eflag || vflag) { + k_pair_linear_sel = &k_pair_linear_fast; + k_pair_spline_sel = &k_pair_spline_fast; + k_pair_bitmap_sel = &k_pair_bitmap_fast; + } else { + k_pair_linear_sel = &k_pair_linear_noev; + k_pair_spline_sel = &k_pair_spline_noev; + k_pair_bitmap_sel = &k_pair_bitmap_noev; + } + #endif + int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -265,37 +287,37 @@ void TableT::loop(const bool _eflag, const bool _vflag) { this->time_pair.start(); if (shared_types) { if (_tabstyle == LOOKUP) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &tabindex, &coeff2, &coeff3, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &tabindex, &coeff2, &coeff3, &coeff4, &cutsq, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->_threads_per_atom, &_tablength); } else if (_tabstyle == LINEAR) { - this->k_pair_linear_fast.set_size(GX,BX); - this->k_pair_linear_fast.run(&this->atom->x, &tabindex, &coeff2, - &coeff3, &coeff4, &cutsq, &sp_lj, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->ans->force, &this->ans->engv, - &eflag, &vflag, &ainum, &nbor_pitch, - &this->_threads_per_atom, &_tablength); + k_pair_linear_sel->set_size(GX,BX); + k_pair_linear_sel->run(&this->atom->x, &tabindex, &coeff2, + &coeff3, &coeff4, &cutsq, &sp_lj, + &this->nbor->dev_nbor, &this->_nbor_data->begin(), + &this->ans->force, &this->ans->engv, + &eflag, &vflag, &ainum, &nbor_pitch, + &this->_threads_per_atom, &_tablength); } else if (_tabstyle == SPLINE) { - this->k_pair_spline_fast.set_size(GX,BX); - this->k_pair_spline_fast.run(&this->atom->x, &tabindex, &coeff2, - &coeff3, &coeff4, &cutsq, &sp_lj, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->ans->force, &this->ans->engv, - &eflag, &vflag, &ainum, &nbor_pitch, - &this->_threads_per_atom, &_tablength); + k_pair_spline_sel->set_size(GX,BX); + k_pair_spline_sel->run(&this->atom->x, &tabindex, &coeff2, + &coeff3, &coeff4, &cutsq, &sp_lj, + &this->nbor->dev_nbor, &this->_nbor_data->begin(), + &this->ans->force, &this->ans->engv, + &eflag, &vflag, &ainum, &nbor_pitch, + &this->_threads_per_atom, &_tablength); } else if (_tabstyle == BITMAP) { - this->k_pair_bitmap_fast.set_size(GX,BX); - this->k_pair_bitmap_fast.run(&this->atom->x, &tabindex, &nshiftbits, - &nmask, &coeff2, &coeff3, &coeff4, &cutsq, - &sp_lj, &this->nbor->dev_nbor, - &this->_nbor_data->begin(), &this->ans->force, - &this->ans->engv, &eflag, &vflag, - &ainum, &nbor_pitch, - &this->_threads_per_atom, &_tablength); + k_pair_bitmap_sel->set_size(GX,BX); + k_pair_bitmap_sel->run(&this->atom->x, &tabindex, &nshiftbits, + &nmask, &coeff2, &coeff3, &coeff4, &cutsq, + &sp_lj, &this->nbor->dev_nbor, + &this->_nbor_data->begin(), &this->ans->force, + &this->ans->engv, &eflag, &vflag, + &ainum, &nbor_pitch, + &this->_threads_per_atom, &_tablength); } } else { if (_tabstyle == LOOKUP) { @@ -334,6 +356,7 @@ void TableT::loop(const bool _eflag, const bool _vflag) { } } this->time_pair.stop(); + return GX; } template class Table; diff --git a/lib/gpu/lal_table.cu b/lib/gpu/lal_table.cu index 0cf0de2af0..eb29218712 100644 --- a/lib/gpu/lal_table.cu +++ b/lib/gpu/lal_table.cu @@ -58,24 +58,27 @@ __kernel void k_table(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } int tlm1 = tablength - 1; if (ii0) { + if (EVFLAG && eflag) { numtyp e = (numtyp)0.0; if (itable < tlm1) e = coeff3[idx].y; energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -129,9 +132,9 @@ __kernel void k_table(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_table_fast(const __global numtyp4 *restrict x_, @@ -153,18 +156,22 @@ __kernel void k_table_fast(const __global numtyp4 *restrict x_, __local numtyp cutsq[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) { + if (EVFLAG && eflag) { numtyp e = (numtyp)0.0; if (itable < tlm1) e = coeff3[idx].y; energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -228,9 +234,9 @@ __kernel void k_table_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } /// ---------------- LINEAR ------------------------------------------------- @@ -254,24 +260,27 @@ __kernel void k_table_linear(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } int tlm1 = tablength - 1; if (ii0) { + if (EVFLAG && eflag) { numtyp e = (numtyp)0.0; if (itable < tlm1) e = coeff3[idx].y + fraction*coeff4[idx].y; energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -329,9 +338,9 @@ __kernel void k_table_linear(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_table_linear_fast(const __global numtyp4 *restrict x_, @@ -353,18 +362,22 @@ __kernel void k_table_linear_fast(const __global numtyp4 *restrict x_, __local numtyp cutsq[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) { + if (EVFLAG && eflag) { numtyp e = (numtyp)0.0; if (itable < tlm1) e = coeff3[idx].y + fraction*coeff4[idx].y; energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -432,9 +444,9 @@ __kernel void k_table_linear_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } /// ---------------- SPLINE ------------------------------------------------- @@ -458,24 +470,27 @@ __kernel void k_table_spline(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } int tlm1 = tablength - 1; if (ii0) { + if (EVFLAG && eflag) { numtyp e = (numtyp)0.0; if (itable < tlm1) { e = a * coeff3[idx].y + b * coeff3[idx+1].y + @@ -529,7 +544,7 @@ __kernel void k_table_spline(const __global numtyp4 *restrict x_, } energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -540,9 +555,9 @@ __kernel void k_table_spline(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_table_spline_fast(const __global numtyp4 *x_, @@ -564,19 +579,22 @@ __kernel void k_table_spline_fast(const __global numtyp4 *x_, __local numtyp cutsq[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) { + if (EVFLAG && eflag) { numtyp e = (numtyp)0.0; if (itable < tlm1) { e = a * coeff3[idx].y + b * coeff3[idx+1].y + @@ -639,7 +656,7 @@ __kernel void k_table_spline_fast(const __global numtyp4 *x_, } energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -650,9 +667,9 @@ __kernel void k_table_spline_fast(const __global numtyp4 *x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } /// ---------------- BITMAP ------------------------------------------------- @@ -678,24 +695,27 @@ __kernel void k_table_bitmap(const __global numtyp4 *x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } int tlm1 = tablength - 1; if (ii0) { + if (EVFLAG && eflag) { numtyp e = (numtyp)0.0; if (itable <= tlm1) e = coeff3[idx].y + fraction*coeff4[idx].y; energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -756,9 +776,9 @@ __kernel void k_table_bitmap(const __global numtyp4 *x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_table_bitmap_fast(const __global numtyp4 *x_, @@ -782,18 +802,22 @@ __kernel void k_table_bitmap_fast(const __global numtyp4 *x_, __local numtyp cutsq[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) { + if (EVFLAG && eflag) { numtyp e = (numtyp)0.0; if (itable <= tlm1) e = coeff3[idx].y + fraction*coeff4[idx].y; energy+=factor_lj*e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -864,7 +887,7 @@ __kernel void k_table_bitmap_fast(const __global numtyp4 *x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } diff --git a/lib/gpu/lal_table.h b/lib/gpu/lal_table.h index 38ae012bee..b67a369dad 100644 --- a/lib/gpu/lal_table.h +++ b/lib/gpu/lal_table.h @@ -56,9 +56,10 @@ class Table : public BaseAtomic { double host_memory_usage() const; // ------------------------- DEVICE KERNELS ------------------------- - UCL_Kernel k_pair_linear, k_pair_linear_fast; - UCL_Kernel k_pair_spline, k_pair_spline_fast; - UCL_Kernel k_pair_bitmap, k_pair_bitmap_fast; + UCL_Kernel k_pair_linear, k_pair_linear_fast, k_pair_linear_noev; + UCL_Kernel k_pair_spline, k_pair_spline_fast, k_pair_spline_noev; + UCL_Kernel k_pair_bitmap, k_pair_bitmap_fast, k_pair_bitmap_noev; + UCL_Kernel *k_pair_linear_sel, *k_pair_spline_sel, *k_pair_bitmap_sel; // --------------------------- TYPE DATA -------------------------- @@ -90,7 +91,7 @@ class Table : public BaseAtomic { private: bool _allocated, _compiled_styles; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_table_ext.cpp b/lib/gpu/lal_table_ext.cpp index f067881b88..6237c4d7cd 100644 --- a/lib/gpu/lal_table_ext.cpp +++ b/lib/gpu/lal_table_ext.cpp @@ -55,7 +55,7 @@ int table_gpu_init(const int ntypes, double **cutsq, double ***table_coeffs, int init_ok=0; if (world_me==0) init_ok=TBMF.init(ntypes, cutsq, table_coeffs, table_data, - special_lj, inum, nall, 300, maxspecial, cell_size, + special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, tabstyle, ntables, tablength); TBMF.device->world_barrier(); @@ -73,7 +73,7 @@ int table_gpu_init(const int ntypes, double **cutsq, double ***table_coeffs, } if (gpu_rank==i && world_me!=0) init_ok=TBMF.init(ntypes, cutsq, table_coeffs, table_data, - special_lj, inum, nall, 300, maxspecial, cell_size, + special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, tabstyle, ntables, tablength); TBMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_tersoff.cpp b/lib/gpu/lal_tersoff.cpp index 63691a2047..e0e87d9148 100644 --- a/lib/gpu/lal_tersoff.cpp +++ b/lib/gpu/lal_tersoff.cpp @@ -39,7 +39,7 @@ TersoffT::~Tersoff() { template int TersoffT::bytes_per_atom(const int max_nbors) const { - return this->bytes_per_atom_atomic(max_nbors); + return this->bytes_per_atom_atomic(max_nbors)+max_nbors*sizeof(acctyp)*4; } template @@ -52,34 +52,82 @@ int TersoffT::init(const int ntypes, const int nlocal, const int nall, const int const double* c, const double* d, const double* h, const double* gamma, const double* beta, const double* powern, const double* host_cutsq) { + int oldparam=-1; + int onetype=-1; + int onetype3=0; + int spq=0; + int mtypes=0; + #ifdef USE_OPENCL + for (int ii=1; ii1) onetype=-1; + if (onetype>=0) spq=powermint[onetype3]; + #endif + int success; success=this->init_three(nlocal,nall,max_nbors,0,cell_size,gpu_split, _screen,tersoff,"k_tersoff_repulsive", "k_tersoff_three_center", "k_tersoff_three_end", - "k_tersoff_short_nbor"); + "k_tersoff_short_nbor",onetype,onetype3,spq,1); if (success!=0) return success; int ef_nall=nall; if (ef_nall==0) ef_nall=2000; - _zetaij.alloc(ef_nall*max_nbors,*(this->ucl_device),UCL_READ_WRITE); + if (this->nbor->max_nbors()) { + _zetaij.alloc(ef_nall*this->nbor->max_nbors(),*(this->ucl_device), + UCL_READ_WRITE); + _zetaij_eng.alloc(ef_nall*this->nbor->max_nbors(),*(this->ucl_device), + UCL_READ_WRITE); + } k_zeta.set_function(*(this->pair_program),"k_tersoff_zeta"); + #if defined(LAL_OCL_EV_JIT) + k_zeta_noev.set_function(*(this->pair_program_noev),"k_tersoff_zeta"); + #else + k_zeta_selt = &k_zeta; + #endif - // If atom type constants fit in shared memory use fast kernel - int lj_types=ntypes; - shared_types=false; - int max_shared_types=this->device->max_shared_types(); - if (lj_types<=max_shared_types && this->_block_size>=max_shared_types) { - lj_types=max_shared_types; - shared_types=true; - } - _lj_types=lj_types; - + _ntypes=ntypes; _nparams = nparams; _nelements = nelements; + UCL_H_Vec host_write(ntypes*ntypes,*(this->ucl_device), + UCL_READ_WRITE); + host_write.zero(); + cutsq_pair.alloc(ntypes*ntypes,*(this->ucl_device),UCL_READ_ONLY); + for (int ii=1; iihost_write[ii*ntypes+jj]) + host_write[ii*ntypes+jj]=host_cutsq[ijkparam]; + } + } + } + ucl_copy(cutsq_pair,host_write,ntypes*ntypes); + + // -------------------------------------------------------------------- UCL_H_Vec dview(nparams,*(this->ucl_device), UCL_WRITE_ONLY); @@ -90,32 +138,29 @@ int TersoffT::init(const int ntypes, const int nlocal, const int nall, const int dview[i].w=(numtyp)0; } + // pack coefficients into arrays // pack coefficients into arrays ts1.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); for (int i=0; i(lam1[i]); - dview[i].y=static_cast(lam2[i]); - dview[i].z=static_cast(lam3[i]); - dview[i].w=static_cast(powermint[i]); + dview[i].x=static_cast(lam3[i]); + dview[i].y=static_cast(powermint[i]); + dview[i].z=static_cast(bigr[i]); + dview[i].w=static_cast(bigd[i]); } ucl_copy(ts1,dview,false); - ts1_tex.get_texture(*(this->pair_program),"ts1_tex"); - ts1_tex.bind_float(ts1,4); ts2.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); for (int i=0; i(biga[i]); - dview[i].y=static_cast(bigb[i]); + dview[i].y=static_cast(lam1[i]); dview[i].z=static_cast(bigr[i]); dview[i].w=static_cast(bigd[i]); } ucl_copy(ts2,dview,false); - ts2_tex.get_texture(*(this->pair_program),"ts2_tex"); - ts2_tex.bind_float(ts2,4); ts3.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); @@ -127,46 +172,28 @@ int TersoffT::init(const int ntypes, const int nlocal, const int nall, const int } ucl_copy(ts3,dview,false); - ts3_tex.get_texture(*(this->pair_program),"ts3_tex"); - ts3_tex.bind_float(ts3,4); ts4.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); for (int i=0; i(c[i]); - dview[i].y=static_cast(d[i]); + dview[i].x=static_cast(c[i]*c[i]); + dview[i].y=static_cast(d[i]*d[i]); dview[i].z=static_cast(h[i]); dview[i].w=static_cast(gamma[i]); } ucl_copy(ts4,dview,false); - ts4_tex.get_texture(*(this->pair_program),"ts4_tex"); - ts4_tex.bind_float(ts4,4); ts5.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); for (int i=0; i(beta[i]); dview[i].y=static_cast(powern[i]); - dview[i].z=(numtyp)0; - dview[i].w=(numtyp)0; + dview[i].z=static_cast(lam2[i]); + dview[i].w=static_cast(bigb[i]); } ucl_copy(ts5,dview,false); - ts5_tex.get_texture(*(this->pair_program),"ts5_tex"); - ts5_tex.bind_float(ts5,4); - - UCL_H_Vec cutsq_view(nparams,*(this->ucl_device), - UCL_WRITE_ONLY); - double cutsqmax = 0.0; - for (int i=0; i(host_cutsq[i]); - if (cutsqmax < host_cutsq[i]) cutsqmax = host_cutsq[i]; - } - cutsq.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); - ucl_copy(cutsq,cutsq_view,false); - - _cutshortsq = static_cast(cutsqmax); UCL_H_Vec dview_elem2param(nelements*nelements*nelements, *(this->ucl_device), UCL_WRITE_ONLY); @@ -183,17 +210,17 @@ int TersoffT::init(const int ntypes, const int nlocal, const int nall, const int ucl_copy(elem2param,dview_elem2param,false); - UCL_H_Vec dview_map(lj_types, *(this->ucl_device), UCL_WRITE_ONLY); + UCL_H_Vec dview_map(ntypes, *(this->ucl_device), UCL_WRITE_ONLY); for (int i = 0; i < ntypes; i++) dview_map[i] = host_map[i]; - map.alloc(lj_types,*(this->ucl_device), UCL_READ_ONLY); + map.alloc(ntypes,*(this->ucl_device), UCL_READ_ONLY); ucl_copy(map,dview_map,false); _allocated=true; this->_max_bytes=ts1.row_bytes()+ts2.row_bytes()+ts3.row_bytes()+ - ts4.row_bytes()+ts5.row_bytes()+cutsq.row_bytes()+ - map.row_bytes()+elem2param.row_bytes()+_zetaij.row_bytes(); + ts4.row_bytes()+ts5.row_bytes()+map.row_bytes()+ + elem2param.row_bytes()+_zetaij.row_bytes()+_zetaij_eng.row_bytes(); return 0; } @@ -208,12 +235,16 @@ void TersoffT::clear() { ts3.clear(); ts4.clear(); ts5.clear(); - cutsq.clear(); + cutsq_pair.clear(); map.clear(); elem2param.clear(); _zetaij.clear(); + _zetaij_eng.clear(); k_zeta.clear(); + #if defined(LAL_OCL_EV_JIT) + k_zeta_noev.clear(); + #endif this->clear_atomic(); } @@ -229,75 +260,60 @@ double TersoffT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void TersoffT::loop(const bool _eflag, const bool _vflag, const int evatom) { - // Compute the block size and grid size to keep all cores busy - int BX=this->block_pair(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - - // build the short neighbor list - int ainum=this->_ainum; - int nbor_pitch=this->nbor->nbor_pitch(); - int GX=static_cast(ceil(static_cast(ainum)/ - (BX/this->_threads_per_atom))); - - this->k_short_nbor.set_size(GX,BX); - this->k_short_nbor.run(&this->atom->x, &this->nbor->dev_nbor, - &this->_nbor_data->begin(), - &this->dev_short_nbor, &_cutshortsq, &ainum, - &nbor_pitch, &this->_threads_per_atom); +int TersoffT::loop(const int eflag, const int vflag, const int evatom, + bool &success) { + const int nbor_pitch=this->nbor->nbor_pitch(); // re-allocate zetaij if necessary int nall = this->_nall; - if (nall*this->_max_nbors > _zetaij.cols()) { + if (nall*this->nbor->max_nbors() > _zetaij.cols()) { int _nmax=static_cast(static_cast(nall)*1.10); - _zetaij.resize(this->_max_nbors*_nmax); + _zetaij.clear(); + _zetaij_eng.clear(); + success = success && (_zetaij.alloc(this->nbor->max_nbors()*_nmax, + *(this->ucl_device), + UCL_READ_WRITE) == UCL_SUCCESS); + success = success && (_zetaij_eng.alloc(this->nbor->max_nbors()*_nmax, + *(this->ucl_device), + UCL_READ_WRITE) == UCL_SUCCESS); + if (!success) return 0; } - nbor_pitch=this->nbor->nbor_pitch(); + // build the short neighbor list + int ainum=this->_ainum; + this->time_pair.start(); + + int BX=this->block_pair(); + int GX=static_cast(ceil(static_cast(ainum)/BX)); + this->k_short_nbor.set_size(GX,BX); + this->k_short_nbor.run(&this->atom->x, &cutsq_pair, &_ntypes, + &this->nbor->dev_nbor, &this->nbor->dev_packed, + &ainum, &nbor_pitch, &this->_threads_per_atom); + + #if defined(LAL_OCL_EV_JIT) + if (eflag || vflag) k_zeta_selt = &k_zeta; + else k_zeta_selt = &k_zeta_noev; + #endif + GX=static_cast(ceil(static_cast(this->_ainum)/ (BX/(JTHREADS*KTHREADS)))); - - this->k_zeta.set_size(GX,BX); - this->k_zeta.run(&this->atom->x, &ts1, &ts2, &ts3, &ts4, &ts5, &cutsq, + k_zeta_selt->set_size(GX,BX); + k_zeta_selt->run(&this->atom->x, &ts1, &ts3, &ts4, &ts5, &map, &elem2param, &_nelements, &_nparams, &_zetaij, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->dev_short_nbor, - &eflag, &this->_ainum, &nbor_pitch, &this->_threads_per_atom); + &_zetaij_eng, &this->nbor->dev_nbor, &eflag, &this->_ainum, + &nbor_pitch, &this->_threads_per_atom); ainum=this->ans->inum(); - nbor_pitch=this->nbor->nbor_pitch(); - GX=static_cast(ceil(static_cast(this->ans->inum())/ - (BX/this->_threads_per_atom))); - - this->time_pair.start(); - this->k_pair.set_size(GX,BX); - this->k_pair.run(&this->atom->x, &ts1, &ts2, &cutsq, - &map, &elem2param, &_nelements, &_nparams, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->dev_short_nbor, - &this->ans->force, &this->ans->engv, - &eflag, &vflag, &ainum, &nbor_pitch, - &this->_threads_per_atom); - BX=this->block_size(); GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/(KTHREADS*JTHREADS)))); - this->k_three_center.set_size(GX,BX); - this->k_three_center.run(&this->atom->x, &ts1, &ts2, &ts4, &cutsq, - &map, &elem2param, &_nelements, &_nparams, &_zetaij, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->dev_short_nbor, - &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, - &nbor_pitch, &this->_threads_per_atom, &evatom); + this->k_3center_sel->set_size(GX,BX); + this->k_3center_sel->run(&this->atom->x, &ts1, &ts4, &map, + &elem2param, &_nelements, &_nparams, &_zetaij, + &_zetaij_eng, &this->nbor->dev_nbor, + &this->ans->force, &this->ans->engv, &eflag, + &vflag, &ainum, &nbor_pitch, + &this->_threads_per_atom, &evatom); Answer *end_ans; #ifdef THREE_CONCURRENT @@ -307,24 +323,34 @@ void TersoffT::loop(const bool _eflag, const bool _vflag, const int evatom) { #endif if (evatom!=0) { this->k_three_end_vatom.set_size(GX,BX); - this->k_three_end_vatom.run(&this->atom->x, &ts1, &ts2, &ts4, &cutsq, - &map, &elem2param, &_nelements, &_nparams, &_zetaij, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->nbor->dev_ilist, &this->dev_short_nbor, - &end_ans->force, &end_ans->engv, &eflag, &vflag, &ainum, - &nbor_pitch, &this->_threads_per_atom, &this->_gpu_nbor); + this->k_three_end_vatom.run(&this->atom->x, &ts1, &ts4, &map, &elem2param, + &_nelements, &_nparams, &_zetaij, &_zetaij_eng, + &this->nbor->dev_nbor, &this->nbor->three_ilist, + &end_ans->force, &end_ans->engv, &eflag, &vflag, + &ainum, &nbor_pitch, &this->_threads_per_atom, + &this->_gpu_nbor); } else { - this->k_three_end.set_size(GX,BX); - this->k_three_end.run(&this->atom->x, &ts1, &ts2, &ts4, &cutsq, - &map, &elem2param, &_nelements, &_nparams, &_zetaij, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->nbor->dev_ilist, &this->dev_short_nbor, - &end_ans->force, &end_ans->engv, &eflag, &vflag, &ainum, - &nbor_pitch, &this->_threads_per_atom, &this->_gpu_nbor); + this->k_3end_sel->set_size(GX,BX); + this->k_3end_sel->run(&this->atom->x, &ts1, &ts4, &map, &elem2param, + &_nelements, &_nparams, &_zetaij, &_zetaij_eng, + &this->nbor->dev_nbor, &this->nbor->three_ilist, + &end_ans->force, &end_ans->engv, &eflag, &vflag, + &ainum, &nbor_pitch, &this->_threads_per_atom, + &this->_gpu_nbor); } + BX=this->block_pair(); + int GXT=static_cast(ceil(static_cast(this->ans->inum())/ + (BX/this->_threads_per_atom))); + this->k_sel->set_size(GXT,BX); + this->k_sel->run(&this->atom->x, &ts2, &map, &elem2param, &_nelements, + &_nparams, &this->nbor->dev_nbor, &this->ans->force, + &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, + &this->_threads_per_atom, &GX); + this->time_pair.stop(); + return GX; } template class Tersoff; diff --git a/lib/gpu/lal_tersoff.cu b/lib/gpu/lal_tersoff.cu index b08fddfd6e..03ce68be77 100644 --- a/lib/gpu/lal_tersoff.cu +++ b/lib/gpu/lal_tersoff.cu @@ -18,99 +18,28 @@ #ifndef _DOUBLE_DOUBLE _texture( pos_tex,float4); -_texture( ts1_tex,float4); -_texture( ts2_tex,float4); -_texture( ts3_tex,float4); -_texture( ts4_tex,float4); -_texture( ts5_tex,float4); #else _texture_2d( pos_tex,int4); -_texture( ts1_tex,int4); -_texture( ts2_tex,int4); -_texture( ts3_tex,int4); -_texture( ts4_tex,int4); -_texture( ts5_tex,int4); #endif #else #define pos_tex x_ -#define ts1_tex ts1 -#define ts2_tex ts2 -#define ts3_tex ts3 -#define ts4_tex ts4 -#define ts5_tex ts5 #endif //#define THREE_CONCURRENT #define TWOTHIRD (numtyp)0.66666666666666666667 -#define zeta_idx(nbor_mem, packed_mem, nbor_pitch, n_stride, t_per_atom, \ - i, nbor_j, offset_j, idx) \ - if (nbor_mem==packed_mem) { \ - int jj = (nbor_j-offset_j-2*nbor_pitch)/n_stride; \ - idx = jj*n_stride + i*t_per_atom + offset_j; \ - } else { \ - idx = nbor_j; \ - } +#if (SHUFFLE_AVAIL == 0) -#if (ARCH < 300) - -#define store_answers_p(f, energy, virial, ii, inum, tid, t_per_atom, \ - offset, eflag, vflag, ans, engv) \ - if (t_per_atom>1) { \ - __local acctyp red_acc[6][BLOCK_PAIR]; \ - red_acc[0][tid]=f.x; \ - red_acc[1][tid]=f.y; \ - red_acc[2][tid]=f.z; \ - red_acc[3][tid]=energy; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<4; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ - } \ - f.x=red_acc[0][tid]; \ - f.y=red_acc[1][tid]; \ - f.z=red_acc[2][tid]; \ - energy=red_acc[3][tid]; \ - if (vflag>0) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid]=virial[r]; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ - } \ - for (int r=0; r<6; r++) \ - virial[r]=red_acc[r][tid]; \ - } \ - } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]+=energy*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]+=virial[i]*(acctyp)0.5; \ - ei+=inum; \ - } \ - } \ - acctyp4 old=ans[ii]; \ - old.x+=f.x; \ - old.y+=f.y; \ - old.z+=f.z; \ - ans[ii]=old; \ - } +#define local_allocate_acc_zeta() \ + __local acctyp red_acc[BLOCK_PAIR]; #define acc_zeta(z, tid, t_per_atom, offset) \ if (t_per_atom>1) { \ - __local acctyp red_acc[BLOCK_PAIR]; \ red_acc[tid]=z; \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + simdsync(); \ if (offset < s) { \ red_acc[tid] += red_acc[tid+s]; \ } \ @@ -118,36 +47,168 @@ _texture( ts5_tex,int4); z=red_acc[tid]; \ } -#else - #define store_answers_p(f, energy, virial, ii, inum, tid, t_per_atom, \ - offset, eflag, vflag, ans, engv) \ + offset, eflag, vflag, ans, engv, ev_stride) \ if (t_per_atom>1) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - f.x += shfl_xor(f.x, s, t_per_atom); \ - f.y += shfl_xor(f.y, s, t_per_atom); \ - f.z += shfl_xor(f.z, s, t_per_atom); \ - energy += shfl_xor(energy, s, t_per_atom); \ - } \ - if (vflag>0) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - for (int r=0; r<6; r++) \ - virial[r] += shfl_xor(virial[r], s, t_per_atom); \ + simd_reduce_add3(t_per_atom, red_acc, offset, tid, f.x, f.y, f.z); \ + if (EVFLAG && (vflag==2 || eflag==2)) { \ + if (eflag) { \ + simdsync(); \ + simd_reduce_add1(t_per_atom, red_acc, offset, tid, energy); \ + } \ + if (vflag) { \ + simdsync(); \ + simd_reduce_arr(6, t_per_atom, red_acc, offset, tid, virial); \ } \ } \ } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]+=energy*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]+=virial[i]*(acctyp)0.5; \ + if (offset==0 && ii1) { \ + for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + z += shfl_down(z, s, t_per_atom); \ + } \ + } + +#if (EVFLAG == 1) + +#define store_answers_p(f, energy, virial, ii, inum, tid, t_per_atom, \ + offset, eflag, vflag, ans, engv, ev_stride) \ + if (t_per_atom>1) { \ + simd_reduce_add3(t_per_atom, f.x, f.y, f.z); \ + if (vflag==2 || eflag==2) { \ + if (eflag) \ + simd_reduce_add1(t_per_atom,energy); \ + if (vflag) \ + simd_reduce_arr(6, t_per_atom,virial); \ + } \ + } \ + if (offset==0 && ii 1; active_subgs /= vwidth) { \ + if (active_subgs < BLOCK_SIZE_X/simd_size()) __syncthreads(); \ + if (bnum < active_subgs) { \ + if (eflag) { \ + simd_reduce_add1(vwidth, energy); \ + if (voffset==0) red_acc[6][bnum] = energy; \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (voffset==0) \ + for (int r=0; r<6; r++) red_acc[r][bnum]=virial[r]; \ + } \ + } \ + \ + __syncthreads(); \ + if (tid < active_subgs) { \ + if (eflag) energy = red_acc[6][tid]; \ + if (vflag) \ + for (int r = 0; r < 6; r++) virial[r] = red_acc[r][tid]; \ + } else { \ + if (eflag) energy = (acctyp)0; \ + if (vflag) for (int r = 0; r < 6; r++) virial[r] = (acctyp)0; \ + } \ + } \ + \ + if (bnum == 0) { \ + int ei=BLOCK_ID_X; \ + if (eflag) { \ + simd_reduce_add1(vwidth, energy); \ + if (tid==0) { \ + engv[ei]+=energy*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (tid==0) { \ + for (int r=0; r<6; r++) { \ + engv[ei]+=virial[r]*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + } \ + } \ + } else if (offset==0 && ii1) \ + simd_reduce_add3(t_per_atom, f.x, f.y, f.z); \ + if (offset==0 && ii1) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - z += shfl_xor(z, s, t_per_atom); \ - } \ - } +#endif +#endif +#ifdef LAL_SIMD_IP_SYNC +#define t_per_atom t_per_atom_in +#else +#define t_per_atom 1 #endif __kernel void k_tersoff_short_nbor(const __global numtyp4 *restrict x_, - const __global int * dev_nbor, + const __global numtyp *restrict cutsq_pair, + const int ntypes, __global int * dev_nbor, const __global int * dev_packed, - __global int * dev_short_nbor, - const numtyp _cutshortsq, const int inum, const int nbor_pitch, - const int t_per_atom) { - __local int n_stride; - int tid, ii, offset; - atom_info(t_per_atom,ii,tid,offset); + const int t_per_atom_in) { + const int ii=GLOBAL_ID_X; + + #ifdef ONETYPE + const numtyp cutsq=cutsq_pair[ONETYPE]; + #endif if (ii cutsq[ijkparam]) continue; - - numtyp4 ts1_ijkparam = ts1[ijkparam]; //fetch4(ts1_ijkparam,ijkparam,ts1_tex); - numtyp ijkparam_lam3 = ts1_ijkparam.z; - numtyp ijkparam_powermint = ts1_ijkparam.w; - numtyp4 ts2_ijkparam = ts2[ijkparam]; //fetch4(ts2_ijkparam,ijkparam,ts2_tex); - numtyp ijkparam_bigr = ts2_ijkparam.z; - numtyp ijkparam_bigd = ts2_ijkparam.w; - numtyp4 ts4_ijkparam = ts4[ijkparam]; //fetch4(ts4_ijkparam,ijkparam,ts4_tex); - numtyp ijkparam_c = ts4_ijkparam.x; - numtyp ijkparam_d = ts4_ijkparam.y; - numtyp ijkparam_h = ts4_ijkparam.z; - numtyp ijkparam_gamma = ts4_ijkparam.w; - z += zeta(ijkparam_powermint, ijkparam_lam3, ijkparam_bigr, ijkparam_bigd, - ijkparam_c, ijkparam_d, ijkparam_h, ijkparam_gamma, - rsq1, rsq2, delr1, delr2); + #ifndef ONETYPE + const numtyp4 ts1_ijkparam = ts1[ijkparam]; + const numtyp ijkparam_lam3 = ts1_ijkparam.x; + const int ijkparam_powermint = ts1_ijkparam.y; + const numtyp ijkparam_bigr = ts1_ijkparam.z; + const numtyp ijkparam_bigd = ts1_ijkparam.w; + const numtyp4 ts4_ijkparam = ts4[ijkparam]; + const numtyp ijkparam_c = ts4_ijkparam.x; + const numtyp ijkparam_d = ts4_ijkparam.y; + const numtyp ijkparam_h = ts4_ijkparam.z; + const numtyp ijkparam_gamma = ts4_ijkparam.w; + #endif + z += zeta(ijkparam_powermint, ijkparam_lam3, ijkparam_bigr, + ijkparam_bigd, ijkparam_c, ijkparam_d, ijkparam_h, + ijkparam_gamma, r1, rsq2, delr1, delr2); } - // idx to zetaij is shifted by n_stride relative to nbor_j in dev_short_nbor - int idx = nbor_j; - if (dev_packed==dev_nbor) idx -= n_stride; acc_zeta(z, tid, t_per_atom, offset_k); - numtyp4 ts1_ijparam = ts1[ijparam]; //fetch4(ts1_ijparam,ijparam,ts1_tex); - numtyp ijparam_lam2 = ts1_ijparam.y; - numtyp4 ts2_ijparam = ts2[ijparam]; //fetch4(ts2_ijparam,ijparam,ts2_tex); - numtyp ijparam_bigb = ts2_ijparam.y; - numtyp ijparam_bigr = ts2_ijparam.z; - numtyp ijparam_bigd = ts2_ijparam.w; - numtyp4 ts3_ijparam = ts3[ijparam]; //fetch4(ts3_ijparam,ijparam,ts3_tex); - numtyp ijparam_c1 = ts3_ijparam.x; - numtyp ijparam_c2 = ts3_ijparam.y; - numtyp ijparam_c3 = ts3_ijparam.z; - numtyp ijparam_c4 = ts3_ijparam.w; - numtyp4 ts5_ijparam = ts5[ijparam]; //fetch4(ts5_ijparam,ijparam,ts5_tex); - numtyp ijparam_beta = ts5_ijparam.x; - numtyp ijparam_powern = ts5_ijparam.y; + #ifndef ONETYPE + const numtyp ijparam_bigr = ts1[ijparam].z; + const numtyp ijparam_bigd = ts1[ijparam].w; + const numtyp4 ts3_ijparam = ts3[ijparam]; + const numtyp ijparam_c1 = ts3_ijparam.x; + const numtyp ijparam_c2 = ts3_ijparam.y; + const numtyp ijparam_c3 = ts3_ijparam.z; + const numtyp ijparam_c4 = ts3_ijparam.w; + const numtyp4 ts5_ijparam = ts5[ijparam]; + const numtyp ijparam_beta = ts5_ijparam.x; + const numtyp ijparam_powern = ts5_ijparam.y; + const numtyp ijparam_lam2 = ts5_ijparam.z; + const numtyp ijparam_bigb = ts5_ijparam.w; + #else + const numtyp ijparam_bigr = ijkparam_bigr; + const numtyp ijparam_bigd = ijkparam_bigd; + #endif if (offset_k == 0) { numtyp fpfeng[4]; force_zeta(ijparam_bigb, ijparam_bigr, ijparam_bigd, ijparam_lam2, - ijparam_beta, ijparam_powern, ijparam_c1, ijparam_c2, ijparam_c3, - ijparam_c4, rsq1, z, eflag, fpfeng); - acctyp4 zij; + ijparam_beta, ijparam_powern, ijparam_c1, ijparam_c2, + ijparam_c3, ijparam_c4, r1, z, eflag, fpfeng); + acctyp2 zij; zij.x = fpfeng[0]; zij.y = fpfeng[1]; - zij.z = fpfeng[2]; - zij.w = z; - zetaij[idx] = zij; + zetaij[nbor_j-2*nbor_pitch] = zij; + if (EVFLAG && eflag) zetaij_eng[nbor_j-2*nbor_pitch] = fpfeng[2]; } - } // for nbor } // if ii } __kernel void k_tersoff_repulsive(const __global numtyp4 *restrict x_, - const __global numtyp4 *restrict ts1_in, const __global numtyp4 *restrict ts2_in, - const __global numtyp *restrict cutsq, const __global int *restrict map, const __global int *restrict elem2param, const int nelements, const int nparams, const __global int * dev_nbor, - const __global int * dev_packed, - const __global int * dev_short_nbor, __global acctyp4 *restrict ans, __global acctyp *restrict engv, const int eflag, const int vflag, const int inum, const int nbor_pitch, - const int t_per_atom) { - __local int n_stride; - int tid, ii, offset; + const int t_per_atom_in, + const int ev_stride) { + int tid, ii, offset, n_stride; atom_info(t_per_atom,ii,tid,offset); - __local numtyp4 ts1[SHARED_SIZE]; + local_allocate_store_pair(); + + #ifndef ONETYPE __local numtyp4 ts2[SHARED_SIZE]; if (tid= cutsq[ijparam]) continue; + #ifndef ONETYPE + numtyp4 ts2_ijparam = ts2[ijparam]; + const numtyp ijparam_biga = ts2_ijparam.x; + const numtyp ijparam_lam1 = ts2_ijparam.y; + const numtyp ijparam_bigr = ts2_ijparam.z; + const numtyp ijparam_bigd = ts2_ijparam.w; + #endif numtyp feng[2]; - numtyp ijparam_lam1 = ts1[ijparam].x; - numtyp4 ts2_ijparam = ts2[ijparam]; - numtyp ijparam_biga = ts2_ijparam.x; - numtyp ijparam_bigr = ts2_ijparam.z; - numtyp ijparam_bigd = ts2_ijparam.w; repulsive(ijparam_bigr, ijparam_bigd, ijparam_lam1, ijparam_biga, rsq, eflag, feng); @@ -469,9 +538,9 @@ __kernel void k_tersoff_repulsive(const __global numtyp4 *restrict x_, f.y+=dely*force; f.z+=delz*force; - if (eflag>0) + if (EVFLAG && eflag) energy+=feng[1]; - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -480,86 +549,85 @@ __kernel void k_tersoff_repulsive(const __global numtyp4 *restrict x_, virial[5] += dely*delz*force; } } // for nbor - - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii - + store_answers_p(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv,ev_stride); } __kernel void k_tersoff_three_center(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict ts1_in, - const __global numtyp4 *restrict ts2_in, const __global numtyp4 *restrict ts4_in, - const __global numtyp *restrict cutsq, const __global int *restrict map, const __global int *restrict elem2param, const int nelements, const int nparams, - const __global acctyp4 *restrict zetaij, + const __global acctyp2 *restrict zetaij, + const __global acctyp *restrict zetaij_e, const __global int * dev_nbor, - const __global int * dev_packed, - const __global int * dev_short_nbor, __global acctyp4 *restrict ans, __global acctyp *restrict engv, const int eflag, const int vflag, const int inum, const int nbor_pitch, - const int t_per_atom, const int evatom) { - __local int tpa_sq, n_stride; - tpa_sq=fast_mul(t_per_atom,t_per_atom); - numtyp lam3, powermint, bigr, bigd, c, d, h, gamma; + const int t_per_atom_in, + const int evatom) { + const int tpa_sq=fast_mul(t_per_atom,t_per_atom); - int tid, ii, offset; + int tid, ii, offset, n_stride; atom_info(tpa_sq,ii,tid,offset); // offset ranges from 0 to tpa_sq-1 + local_allocate_store_three(); + + #ifndef ONETYPE __local numtyp4 ts1[SHARED_SIZE]; - __local numtyp4 ts2[SHARED_SIZE]; __local numtyp4 ts4[SHARED_SIZE]; if (tid= cutsq[ijparam]) continue; numtyp r1 = ucl_sqrt(rsq1); numtyp r1inv = ucl_rsqrt(rsq1); // look up for zeta_ij - // idx to zetaij is shifted by n_stride relative to nbor_j in dev_short_nbor - int idx = nbor_j; - if (dev_packed==dev_nbor) idx -= n_stride; - acctyp4 zeta_ij = zetaij[idx]; // fetch(zeta_ij,idx,zeta_tex); + acctyp2 zeta_ij = zetaij[nbor_j-2*nbor_pitch]; numtyp force = zeta_ij.x*tpainv; numtyp prefactor = zeta_ij.y; f.x += delr1[0]*force; f.y += delr1[1]*force; f.z += delr1[2]*force; - if (eflag>0) { - energy+=zeta_ij.z*tpainv; + if (EVFLAG && eflag) { + energy+=zetaij_e[nbor_j-2*nbor_pitch]*tpainv; } - if (vflag>0) { + if (EVFLAG && vflag) { numtyp mforce = -force; virial[0] += delr1[0]*delr1[0]*mforce; virial[1] += delr1[1]*delr1[1]*mforce; @@ -597,48 +661,45 @@ __kernel void k_tersoff_three_center(const __global numtyp4 *restrict x_, } int nbor_k = nborj_start-offset_j+offset_k; - int k_end = nbor_end; - if (dev_packed==dev_nbor) { - int numk = dev_short_nbor[nbor_k-n_stride]; - k_end = nbor_k+fast_mul(numk,n_stride); - } - - for ( ; nbor_k cutsq[ijkparam]) continue; + #ifndef ONETYPE + const numtyp4 ts1_ijkparam = ts1[ijkparam]; + const numtyp lam3 = ts1_ijkparam.x; + const int powermint = ts1_ijkparam.y; + const numtyp bigr = ts1_ijkparam.z; + const numtyp bigd = ts1_ijkparam.w; + const numtyp4 ts4_ijkparam = ts4[ijkparam]; + const numtyp c = ts4_ijkparam.x; + const numtyp d = ts4_ijkparam.y; + const numtyp h = ts4_ijkparam.z; + const numtyp gamma = ts4_ijkparam.w; + #endif numtyp r2 = ucl_sqrt(rsq2); numtyp r2inv = ucl_rsqrt(rsq2); numtyp fi[3], fj[3], fk[3]; - numtyp4 ts1_ijkparam = ts1[ijkparam]; //fetch4(ts1_ijkparam,ijkparam,ts1_tex); - lam3 = ts1_ijkparam.z; - powermint = ts1_ijkparam.w; - numtyp4 ts2_ijkparam = ts2[ijkparam]; //fetch4(ts2_ijkparam,ijkparam,ts2_tex); - bigr = ts2_ijkparam.z; - bigd = ts2_ijkparam.w; - numtyp4 ts4_ijkparam = ts4[ijkparam]; //fetch4(ts4_ijkparam,ijkparam,ts4_tex); - c = ts4_ijkparam.x; - d = ts4_ijkparam.y; - h = ts4_ijkparam.z; - gamma = ts4_ijkparam.w; - if (vflag>0) - attractive(bigr, bigd, powermint, lam3, c, d, h, gamma, - prefactor, r1, r1inv, r2, r2inv, delr1, delr2, fi, fj, fk); + if (EVFLAG && vflag) + attractive(bigr, bigd, powermint, lam3, c, d, h, gamma, prefactor, + r1, r1inv, r2, r2inv, delr1, delr2, fi, fj, fk); else attractive_fi(bigr, bigd, powermint, lam3, c, d, h, gamma, prefactor, r1, r1inv, r2, r2inv, delr1, delr2, fi); @@ -646,7 +707,7 @@ __kernel void k_tersoff_three_center(const __global numtyp4 *restrict x_, f.y += fi[1]; f.z += fi[2]; - if (vflag>0) { + if (EVFLAG && vflag) { acctyp v[6]; numtyp pre = (numtyp)2.0; if (evatom==1) pre = TWOTHIRD; @@ -662,87 +723,90 @@ __kernel void k_tersoff_three_center(const __global numtyp4 *restrict x_, } } // nbor_k } // for nbor_j - - store_answers_p(f,energy,virial,ii,inum,tid,tpa_sq, - offset,eflag,vflag,ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,tpa_sq, + offset,eflag,vflag,ans,engv); } __kernel void k_tersoff_three_end(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict ts1_in, - const __global numtyp4 *restrict ts2_in, const __global numtyp4 *restrict ts4_in, - const __global numtyp *restrict cutsq, const __global int *restrict map, const __global int *restrict elem2param, const int nelements, const int nparams, - const __global acctyp4 *restrict zetaij, + const __global acctyp2 *restrict zetaij, + const __global acctyp *restrict zetaij_e, const __global int * dev_nbor, - const __global int * dev_packed, const __global int * dev_ilist, - const __global int * dev_short_nbor, __global acctyp4 *restrict ans, __global acctyp *restrict engv, const int eflag, const int vflag, const int inum, const int nbor_pitch, - const int t_per_atom, const int gpu_nbor) { - __local int tpa_sq, n_stride; - tpa_sq=fast_mul(t_per_atom,t_per_atom); - numtyp lam3, powermint, bigr, bigd, c, d, h, gamma; + const int t_per_atom_in, + const int gpu_nbor) { + const int tpa_sq=fast_mul(t_per_atom,t_per_atom); - int tid, ii, offset; + int tid, ii, offset, n_stride; atom_info(tpa_sq,ii,tid,offset); + local_allocate_store_three(); + + #ifndef ONETYPE __local numtyp4 ts1[SHARED_SIZE]; - __local numtyp4 ts2[SHARED_SIZE]; __local numtyp4 ts4[SHARED_SIZE]; if (tid0) { - energy+=zeta_ji.z*tpainv; + if (EVFLAG && eflag) { + energy+=zetaij_e[ijnum-2*nbor_pitch]*tpainv; } - if (vflag>0) { + if (EVFLAG && vflag) { numtyp mforce = -force; virial[0] += mdelr1[0]*mdelr1[0]*mforce; virial[1] += mdelr1[1]*mdelr1[1]*mforce; @@ -823,62 +877,62 @@ __kernel void k_tersoff_three_end(const __global numtyp4 *restrict x_, // attractive forces for (nbor_k = nbork_start ; nbor_k0) { - energy+=zeta_ji.z*tpainv; + if (EVFLAG && eflag) { + energy+=zetaij_e[ijnum-2*nbor_pitch]*tpainv; } - if (vflag>0) { + if (EVFLAG && vflag) { numtyp mforce = -force; virial[0] += mdelr1[0]*mdelr1[0]*mforce; virial[1] += mdelr1[1]*mdelr1[1]*mforce; @@ -1052,41 +1099,44 @@ __kernel void k_tersoff_three_end_vatom(const __global numtyp4 *restrict x_, // attractive forces for (nbor_k = nbork_start; nbor_k cutsq[jikparam]) continue; numtyp r2 = ucl_sqrt(rsq2); numtyp r2inv = ucl_rsqrt(rsq2); - numtyp fi[3], fj[3], fk[3]; - numtyp4 ts1_param, ts2_param, ts4_param; - ts1_param = ts1[jikparam]; //fetch4(ts1_jikparam,jikparam,ts1_tex); - lam3 = ts1_param.z; - powermint = ts1_param.w; - ts2_param = ts2[jikparam]; //fetch4(ts2_jikparam,jikparam,ts2_tex); - bigr = ts2_param.z; - bigd = ts2_param.w; - ts4_param = ts4[jikparam]; //fetch4(ts4_jikparam,jikparam,ts4_tex); - c = ts4_param.x; - d = ts4_param.y; - h = ts4_param.z; - gamma = ts4_param.w; attractive(bigr, bigd, powermint, lam3, c, d, h, gamma, - prefactor_ji, r1, r1inv, r2, r2inv, mdelr1, delr2, fi, fj, fk); + prefactor_ji, r1, r1inv, r2, r2inv, mdelr1, delr2, fi, fj, + fk); f.x += fj[0]; f.y += fj[1]; f.z += fj[2]; @@ -1098,26 +1148,25 @@ __kernel void k_tersoff_three_end_vatom(const __global numtyp4 *restrict x_, virial[4] += TWOTHIRD*(mdelr1[0]*fj[2] + delr2[0]*fk[2]); virial[5] += TWOTHIRD*(mdelr1[1]*fj[2] + delr2[1]*fk[2]); - // idx to zetaij is shifted by n_stride relative to nbor_k in dev_short_nbor - int idx = nbor_k; - if (dev_packed==dev_nbor) idx -= n_stride; - acctyp4 zeta_jk = zetaij[idx]; // fetch(zeta_jk,idx,zeta_tex); - numtyp prefactor_jk = zeta_jk.y; + numtyp prefactor_jk = zetaij[nbor_k-2*nbor_pitch].y; - int jkiparam=elem2param[jtype*nelements*nelements+ktype*nelements+itype]; - ts1_param = ts1[jkiparam]; //fetch4(ts1_jkiparam,jkiparam,ts1_tex); - lam3 = ts1_param.z; - powermint = ts1_param.w; - ts2_param = ts2[jkiparam]; //fetch4(ts2_jkiparam,jkiparam,ts2_tex); - bigr = ts2_param.z; - bigd = ts2_param.w; + #ifndef ONETYPE + int jkiparam=elem2param[jtype*nelements*nelements+ktype*nelements+ + itype]; + ts1_param = ts1[jkiparam]; + lam3 = ts1_param.x; + powermint = ts1_param.y; + bigr = ts1_param.z; + bigd = ts1_param.w; ts4_param = ts4[jkiparam]; //fetch4(ts4_jkiparam,jkiparam,ts4_tex); c = ts4_param.x; d = ts4_param.y; h = ts4_param.z; gamma = ts4_param.w; attractive(bigr, bigd, powermint, lam3, c, d, h, gamma, - prefactor_jk, r2, r2inv, r1, r1inv, delr2, mdelr1, fi, fj, fk); + prefactor_jk, r2, r2inv, r1, r1inv, delr2, mdelr1, fi, fj, + fk); + #endif f.x += fk[0]; f.y += fk[1]; f.z += fk[2]; @@ -1130,14 +1179,13 @@ __kernel void k_tersoff_three_end_vatom(const __global numtyp4 *restrict x_, virial[5] += TWOTHIRD*(delr2[1]*fj[2] + mdelr1[1]*fk[2]); } } // for nbor - - #ifdef THREE_CONCURRENT - store_answers(f,energy,virial,ii,inum,tid,tpa_sq,offset, - eflag,vflag,ans,engv); - #else - store_answers_p(f,energy,virial,ii,inum,tid,tpa_sq,offset, - eflag,vflag,ans,engv); - #endif } // if ii + #ifdef THREE_CONCURRENT + store_answers(f,energy,virial,ii,inum,tid,tpa_sq,offset, + eflag,vflag,ans,engv); + #else + store_answers_p(f,energy,virial,ii,inum,tid,tpa_sq,offset, + eflag,vflag,ans,engv,NUM_BLOCKS_X); + #endif } diff --git a/lib/gpu/lal_tersoff.h b/lib/gpu/lal_tersoff.h index 51e64c987b..8f99569162 100644 --- a/lib/gpu/lal_tersoff.h +++ b/lib/gpu/lal_tersoff.h @@ -59,41 +59,36 @@ class Tersoff : public BaseThree { // --------------------------- TYPE DATA -------------------------- - /// If atom type constants fit in shared memory, use fast kernels - bool shared_types; - /// Number of atom types - int _lj_types; + int _ntypes; - /// ts1.x = lam1, ts1.y = lam2, ts1.z = lam3, ts1.w = powermint + /// ts1.x = lam3, ts1.y = powermint, ts1.z = c3, ts1.w = c4 UCL_D_Vec ts1; - /// ts2.x = biga, ts2.y = bigb, ts2.z = bigr, ts2.w = bigd + /// ts2.x = biga, ts2.y = lam1, ts2.z = bigr, ts2.w = bigd UCL_D_Vec ts2; /// ts3.x = c1, ts3.y = c2, ts3.z = c3, ts3.w = c4 UCL_D_Vec ts3; - /// ts4.x = c, ts4.y = d, ts4.z = h, ts4.w = gamma + /// ts4.x = c*c, ts4.y = d*d, ts4.z = h, ts4.w = gamma UCL_D_Vec ts4; - /// ts5.x = beta, ts5.y = powern + /// ts5.x = beta, ts5.y = powern, ts5.z = lam2, ts5.w = bigb UCL_D_Vec ts5; - UCL_D_Vec cutsq; + UCL_D_Vec cutsq_pair; UCL_D_Vec elem2param; UCL_D_Vec map; int _nparams,_nelements; /// Per-atom arrays: - /// zetaij.x = force, zetaij.y = prefactor, zetaij.z = evdwl, - /// zetaij.w = zetaij - UCL_D_Vec _zetaij; + /// zetaij.x = force, zetaij.y = prefactor + UCL_D_Vec _zetaij; + UCL_D_Vec _zetaij_eng; - UCL_Kernel k_zeta; - UCL_Texture ts1_tex, ts2_tex, ts3_tex, ts4_tex, ts5_tex; - numtyp _cutshortsq; + UCL_Kernel k_zeta, k_zeta_noev, *k_zeta_selt; private: bool _allocated; - void loop(const bool _eflag, const bool _vflag, const int evatom); + int loop(const int eflag, const int vflag, const int evatom, bool &success); }; } diff --git a/lib/gpu/lal_tersoff_ext.cpp b/lib/gpu/lal_tersoff_ext.cpp index 749842864f..ac700d014a 100644 --- a/lib/gpu/lal_tersoff_ext.cpp +++ b/lib/gpu/lal_tersoff_ext.cpp @@ -63,7 +63,7 @@ int tersoff_gpu_init(const int ntypes, const int inum, const int nall, const int int init_ok=0; if (world_me==0) - init_ok=TSMF.init(ntypes, inum, nall, 300, cell_size, gpu_split, screen, + init_ok=TSMF.init(ntypes, inum, nall, max_nbors, cell_size, gpu_split, screen, host_map, nelements, host_elem2param, nparams, ts_lam1, ts_lam2, ts_lam3, ts_powermint, ts_biga, ts_bigb, ts_bigr, ts_bigd, @@ -84,7 +84,7 @@ int tersoff_gpu_init(const int ntypes, const int inum, const int nall, const int fflush(screen); } if (gpu_rank==i && world_me!=0) - init_ok=TSMF.init(ntypes, inum, nall, 300, cell_size, gpu_split, screen, + init_ok=TSMF.init(ntypes, inum, nall, max_nbors, cell_size, gpu_split, screen, host_map, nelements, host_elem2param, nparams, ts_lam1, ts_lam2, ts_lam3, ts_powermint, ts_biga, ts_bigb, ts_bigr, ts_bigd, @@ -99,7 +99,7 @@ int tersoff_gpu_init(const int ntypes, const int inum, const int nall, const int fprintf(screen,"\n"); if (init_ok==0) - TSMF.estimate_gpu_overhead(); + TSMF.estimate_gpu_overhead(1); return init_ok; } diff --git a/lib/gpu/lal_tersoff_extra.h b/lib/gpu/lal_tersoff_extra.h index 7ee29751b7..da2568aa1b 100644 --- a/lib/gpu/lal_tersoff_extra.h +++ b/lib/gpu/lal_tersoff_extra.h @@ -55,11 +55,9 @@ ucl_inline numtyp ters_gijk(const numtyp costheta, const numtyp param_h, const numtyp param_gamma) { - const numtyp ters_c = param_c * param_c; - const numtyp ters_d = param_d * param_d; const numtyp hcth = param_h - costheta; - return param_gamma*((numtyp)1.0 + ters_c*ucl_recip(ters_d) - - ters_c *ucl_recip(ters_d + hcth*hcth)); + return param_gamma*((numtyp)1.0 + param_c*ucl_recip(param_d) - + param_c *ucl_recip(param_d + hcth*hcth)); } /* ---------------------------------------------------------------------- */ @@ -68,19 +66,20 @@ ucl_inline numtyp ters_gijk_d(const numtyp costheta, const numtyp param_c, const numtyp param_d, const numtyp param_h, - const numtyp param_gamma) + const numtyp param_gamma, + numtyp *ans_d) { - const numtyp ters_c = param_c * param_c; - const numtyp ters_d = param_d * param_d; const numtyp hcth = param_h - costheta; - const numtyp numerator = (numtyp)-2.0 * ters_c * hcth; - const numtyp denominator = ucl_recip(ters_d + hcth*hcth); - return param_gamma*numerator*denominator*denominator; + const numtyp idhh=ucl_recip(param_d + hcth*hcth); + const numtyp numerator = (numtyp)-2.0 * param_c * hcth; + *ans_d=param_gamma*numerator*idhh*idhh; + return param_gamma*((numtyp)1.0+param_c*ucl_recip(param_d)-param_c*idhh); } /* ---------------------------------------------------------------------- */ -ucl_inline void costheta_d(const numtyp rij_hat[3], +ucl_inline void costheta_d(const numtyp cos_theta, + const numtyp rij_hat[3], const numtyp rij, const numtyp rik_hat[3], const numtyp rik, @@ -89,9 +88,6 @@ ucl_inline void costheta_d(const numtyp rij_hat[3], numtyp *drk) { // first element is derivative wrt Ri, second wrt Rj, third wrt Rk - - numtyp cos_theta = vec3_dot(rij_hat,rik_hat); - vec3_scaleadd(-cos_theta,rij_hat,rik_hat,drj); vec3_scale(ucl_recip(rij),drj,drj); vec3_scaleadd(-cos_theta,rik_hat,rij_hat,drk); @@ -107,7 +103,9 @@ ucl_inline numtyp ters_fc(const numtyp r, const numtyp param_bigd) { if (r < param_bigr-param_bigd) return (numtyp)1.0; + #ifndef ONETYPE if (r > param_bigr+param_bigd) return (numtyp)0.0; + #endif return (numtyp)0.5*((numtyp)1.0 - sin(MY_PI2*(r - param_bigr)/param_bigd)); } @@ -115,24 +113,23 @@ ucl_inline numtyp ters_fc(const numtyp r, ucl_inline numtyp ters_fc_d(const numtyp r, const numtyp param_bigr, - const numtyp param_bigd) + const numtyp param_bigd, + numtyp *ans_d) { - if (r < param_bigr-param_bigd) return (numtyp)0.0; - if (r > param_bigr+param_bigd) return (numtyp)0.0; - return -(MY_PI4/param_bigd) * cos(MY_PI2*(r - param_bigr)/param_bigd); -} - -/* ---------------------------------------------------------------------- */ - -ucl_inline numtyp ters_fa(const numtyp r, - const numtyp param_bigb, - const numtyp param_bigr, - const numtyp param_bigd, - const numtyp param_lam2) -{ - if (r > param_bigr + param_bigd) return (numtyp)0.0; - return -param_bigb * ucl_exp(-param_lam2 * r) * - ters_fc(r,param_bigr,param_bigd); + if (r < param_bigr-param_bigd) { + *ans_d=(numtyp)0.0; + return (numtyp)1.0; + } + #ifndef ONETYPE + if (r > param_bigr+param_bigd) { + *ans_d=(numtyp)0.0; + return (numtyp)0.0; + } + #endif + const numtyp ibigd = ucl_recip(param_bigd); + const numtyp angle = MY_PI2*(r - param_bigr)*ibigd; + *ans_d=-(MY_PI4*ibigd) * cos(angle); + return (numtyp)0.5*((numtyp)1.0 - sin(angle)); } /* ---------------------------------------------------------------------- */ @@ -141,33 +138,17 @@ ucl_inline numtyp ters_fa_d(const numtyp r, const numtyp param_bigb, const numtyp param_bigr, const numtyp param_bigd, - const numtyp param_lam2) + const numtyp param_lam2, + numtyp *ans_d) { + #ifndef ONETYPE if (r > param_bigr + param_bigd) return (numtyp)0.0; - return param_bigb * ucl_exp(-param_lam2 * r) * (param_lam2 * - ters_fc(r,param_bigr,param_bigd) - ters_fc_d(r,param_bigr,param_bigd)); -} - -/* ---------------------------------------------------------------------- */ - -ucl_inline numtyp ters_bij(const numtyp zeta, - const numtyp param_beta, - const numtyp param_powern, - const numtyp param_c1, - const numtyp param_c2, - const numtyp param_c3, - const numtyp param_c4) -{ - numtyp tmp = param_beta * zeta; - if (tmp > param_c1) return ucl_rsqrt(tmp); - if (tmp > param_c2) - return ((numtyp)1.0 - ucl_powr(tmp,-param_powern) / - ((numtyp)2.0*param_powern))*ucl_rsqrt(tmp); - if (tmp < param_c4) return (numtyp)1.0; - if (tmp < param_c3) - return (numtyp)1.0 - ucl_powr(tmp,param_powern)/((numtyp)2.0*param_powern); - return ucl_powr((numtyp)1.0 + ucl_powr(tmp,param_powern), - (numtyp)-1.0/((numtyp)2.0*param_powern)); + #endif + numtyp dfc; + const numtyp fc=ters_fc_d(r,param_bigr,param_bigd,&dfc); + const numtyp blr = param_bigb * ucl_exp(-param_lam2 * r); + *ans_d = blr * (param_lam2 * fc - dfc); + return -blr * fc; } /* ---------------------------------------------------------------------- */ @@ -178,24 +159,35 @@ ucl_inline numtyp ters_bij_d(const numtyp zeta, const numtyp param_c1, const numtyp param_c2, const numtyp param_c3, - const numtyp param_c4) + const numtyp param_c4, + numtyp *ans_d) { - numtyp tmp = param_beta * zeta; - if (tmp > param_c1) - return param_beta * (numtyp)-0.5*ucl_powr(tmp,(numtyp)-1.5); - if (tmp > param_c2) - return param_beta * ((numtyp)-0.5*ucl_powr(tmp,(numtyp)-1.5) * - // error in negligible 2nd term fixed 9/30/2015 - // (1.0 - 0.5*(1.0 + 1.0/(2.0*param->powern)) * - ((numtyp)1.0 - ((numtyp)1.0 + (numtyp)1.0 /((numtyp)2.0 * param_powern)) * - ucl_powr(tmp,-param_powern))); - if (tmp < param_c4) return (numtyp)0.0; - if (tmp < param_c3) - return (numtyp)-0.5*param_beta * ucl_powr(tmp,param_powern-(numtyp)1.0); - - numtyp tmp_n = ucl_powr(tmp,param_powern); - return (numtyp)-0.5 * ucl_powr((numtyp)1.0+tmp_n, (numtyp) - - (numtyp)1.0-((numtyp)1.0 / ((numtyp)2.0 * param_powern)))*tmp_n / zeta; + const numtyp tmp = param_beta * zeta; + if (tmp > param_c1) { + *ans_d = param_beta * (numtyp)-0.5*ucl_powr(tmp,(numtyp)-1.5); + return ucl_rsqrt(tmp); + } + if (tmp > param_c2) { + const numtyp ptmp = ucl_powr(tmp,-param_powern); + const numtyp i2n = ucl_recip((numtyp)2.0 * param_powern); + *ans_d = param_beta * ((numtyp)-0.5*ucl_powr(tmp,(numtyp)-1.5) * + ((numtyp)1.0 - ((numtyp)1.0 + (numtyp)1.0 * i2n) * + ptmp)); + return ((numtyp)1.0 - ptmp * i2n)*ucl_rsqrt(tmp); + } + if (tmp < param_c4) { + *ans_d = (numtyp)0.0; + return (numtyp)1.0; + } + if (tmp < param_c3) { + *ans_d = (numtyp)-0.5*param_beta * ucl_powr(tmp,param_powern-(numtyp)1.0); + return (numtyp)1.0 - ucl_powr(tmp,param_powern)/((numtyp)2.0*param_powern); + } + const numtyp tmp_n = (numtyp)1.0+ucl_powr(tmp,param_powern); + const numtyp i2n = -ucl_recip((numtyp)2.0*param_powern); + *ans_d = (numtyp)-0.5*ucl_powr(tmp_n,(numtyp)-1.0+i2n)*(tmp_n-(numtyp)1.0)/ + zeta; + return ucl_powr(tmp_n, i2n); } /* ---------------------------------------------------------------------- */ @@ -207,7 +199,7 @@ ucl_inline void ters_zetaterm_d(const numtyp prefactor, const numtyp rik, const numtyp param_bigr, const numtyp param_bigd, - const numtyp param_powermint, + const int param_powermint, const numtyp param_lam3, const numtyp param_c, const numtyp param_d, @@ -220,25 +212,23 @@ ucl_inline void ters_zetaterm_d(const numtyp prefactor, numtyp gijk,gijk_d,ex_delr,ex_delr_d,fc,dfc,cos_theta,tmp; numtyp dcosdri[3],dcosdrj[3],dcosdrk[3]; - fc = ters_fc(rik,param_bigr,param_bigd); - dfc = ters_fc_d(rik,param_bigr,param_bigd); + fc = ters_fc_d(rik,param_bigr,param_bigd,&dfc); numtyp t = param_lam3*(rij-rik); - if ((int)param_powermint == 3) tmp = t*t*t; + if (param_powermint == 3) tmp = t*t*t; else tmp = t; if (tmp > (numtyp)69.0776) ex_delr = (numtyp)1.e30; else if (tmp < (numtyp)-69.0776) ex_delr = (numtyp)0.0; else ex_delr = ucl_exp(tmp); - if ((int)param_powermint == 3) + if (param_powermint == 3) ex_delr_d = (numtyp)3.0*param_lam3*t*t*ex_delr; else ex_delr_d = param_lam3 * ex_delr; cos_theta = vec3_dot(rij_hat,rik_hat); - gijk = ters_gijk(cos_theta,param_c,param_d,param_h,param_gamma); - gijk_d = ters_gijk_d(cos_theta,param_c,param_d,param_h,param_gamma); - costheta_d(rij_hat,rij,rik_hat,rik,dcosdri,dcosdrj,dcosdrk); + gijk = ters_gijk_d(cos_theta,param_c,param_d,param_h,param_gamma,&gijk_d); + costheta_d(cos_theta,rij_hat,rij,rik_hat,rik,dcosdri,dcosdrj,dcosdrk); // compute the derivative wrt Ri // dri = -dfc*gijk*ex_delr*rik_hat; @@ -277,7 +267,7 @@ ucl_inline void ters_zetaterm_d_fi(const numtyp prefactor, const numtyp rik, const numtyp param_bigr, const numtyp param_bigd, - const numtyp param_powermint, + const int param_powermint, const numtyp param_lam3, const numtyp param_c, const numtyp param_d, @@ -288,25 +278,23 @@ ucl_inline void ters_zetaterm_d_fi(const numtyp prefactor, numtyp gijk,gijk_d,ex_delr,ex_delr_d,fc,dfc,cos_theta,tmp; numtyp dcosdri[3],dcosdrj[3],dcosdrk[3]; - fc = ters_fc(rik,param_bigr,param_bigd); - dfc = ters_fc_d(rik,param_bigr,param_bigd); + fc = ters_fc_d(rik,param_bigr,param_bigd,&dfc); numtyp t = param_lam3*(rij-rik); - if ((int)param_powermint == 3) tmp = t*t*t; + if (param_powermint == 3) tmp = t*t*t; else tmp = t; if (tmp > (numtyp)69.0776) ex_delr = (numtyp)1.e30; else if (tmp < (numtyp)-69.0776) ex_delr = (numtyp)0.0; else ex_delr = ucl_exp(tmp); - if ((int)param_powermint == 3) + if (param_powermint == 3) ex_delr_d = (numtyp)3.0*param_lam3*t*t*ex_delr; else ex_delr_d = param_lam3 * ex_delr; cos_theta = vec3_dot(rij_hat,rik_hat); - gijk = ters_gijk(cos_theta,param_c,param_d,param_h,param_gamma); - gijk_d = ters_gijk_d(cos_theta,param_c,param_d,param_h,param_gamma); - costheta_d(rij_hat,rij,rik_hat,rik,dcosdri,dcosdrj,dcosdrk); + gijk = ters_gijk_d(cos_theta,param_c,param_d,param_h,param_gamma,&gijk_d); + costheta_d(cos_theta,rij_hat,rij,rik_hat,rik,dcosdri,dcosdrj,dcosdrk); // compute the derivative wrt Ri // dri = -dfc*gijk*ex_delr*rik_hat; @@ -327,7 +315,7 @@ ucl_inline void ters_zetaterm_d_fj(const numtyp prefactor, const numtyp rik, const numtyp param_bigr, const numtyp param_bigd, - const numtyp param_powermint, + const int param_powermint, const numtyp param_lam3, const numtyp param_c, const numtyp param_d, @@ -341,21 +329,20 @@ ucl_inline void ters_zetaterm_d_fj(const numtyp prefactor, fc = ters_fc(rik,param_bigr,param_bigd); numtyp t = param_lam3*(rij-rik); - if ((int)param_powermint == 3) tmp = t*t*t; + if (param_powermint == 3) tmp = t*t*t; else tmp = t; if (tmp > (numtyp)69.0776) ex_delr = (numtyp)1.e30; else if (tmp < (numtyp)-69.0776) ex_delr = (numtyp)0.0; else ex_delr = ucl_exp(tmp); - if ((int)param_powermint == 3) + if (param_powermint == 3) ex_delr_d = (numtyp)3.0*param_lam3*t*t*ex_delr; else ex_delr_d = param_lam3 * ex_delr; cos_theta = vec3_dot(rij_hat,rik_hat); - gijk = ters_gijk(cos_theta,param_c,param_d,param_h,param_gamma); - gijk_d = ters_gijk_d(cos_theta,param_c,param_d,param_h,param_gamma); - costheta_d(rij_hat,rij,rik_hat,rik,dcosdri,dcosdrj,dcosdrk); + gijk = ters_gijk_d(cos_theta,param_c,param_d,param_h,param_gamma,&gijk_d); + costheta_d(cos_theta,rij_hat,rij,rik_hat,rik,dcosdri,dcosdrj,dcosdrk); // compute the derivative wrt Rj // drj = fc*gijk_d*ex_delr*dcosdrj; @@ -373,7 +360,7 @@ ucl_inline void ters_zetaterm_d_fk(const numtyp prefactor, const numtyp rik, const numtyp param_bigr, const numtyp param_bigd, - const numtyp param_powermint, + const int param_powermint, const numtyp param_lam3, const numtyp param_c, const numtyp param_d, @@ -384,25 +371,23 @@ ucl_inline void ters_zetaterm_d_fk(const numtyp prefactor, numtyp gijk,gijk_d,ex_delr,ex_delr_d,fc,dfc,cos_theta,tmp; numtyp dcosdri[3],dcosdrj[3],dcosdrk[3]; - fc = ters_fc(rik,param_bigr,param_bigd); - dfc = ters_fc_d(rik,param_bigr,param_bigd); + fc = ters_fc_d(rik,param_bigr,param_bigd,&dfc); numtyp t = param_lam3*(rij-rik); - if ((int)param_powermint == 3) tmp = t*t*t; + if (param_powermint == 3) tmp = t*t*t; else tmp = t; if (tmp > (numtyp)69.0776) ex_delr = (numtyp)1.e30; else if (tmp < (numtyp)-69.0776) ex_delr = (numtyp)0.0; else ex_delr = ucl_exp(tmp); - if ((int)param_powermint == 3) + if (param_powermint == 3) ex_delr_d = (numtyp)3.0*param_lam3*t*t*ex_delr; else ex_delr_d = param_lam3 * ex_delr; cos_theta = vec3_dot(rij_hat,rik_hat); - gijk = ters_gijk(cos_theta,param_c,param_d,param_h,param_gamma); - gijk_d = ters_gijk_d(cos_theta,param_c,param_d,param_h,param_gamma); - costheta_d(rij_hat,rij,rik_hat,rik,dcosdri,dcosdrj,dcosdrk); + gijk = ters_gijk_d(cos_theta,param_c,param_d,param_h,param_gamma,&gijk_d); + costheta_d(cos_theta,rij_hat,rij,rik_hat,rik,dcosdri,dcosdrj,dcosdrk); // compute the derivative wrt Rk // drk = dfc*gijk*ex_delr*rik_hat; @@ -427,18 +412,17 @@ ucl_inline void repulsive(const numtyp param_bigr, { numtyp r,tmp_fc,tmp_fc_d,tmp_exp; r = ucl_sqrt(rsq); - tmp_fc = ters_fc(r,param_bigr,param_bigd); - tmp_fc_d = ters_fc_d(r,param_bigr,param_bigd); - tmp_exp = ucl_exp(-param_lam1 * r); + tmp_fc = ters_fc_d(r,param_bigr,param_bigd,&tmp_fc_d); + tmp_exp = param_biga * ucl_exp(-param_lam1 * r); // fforce - ans[0] = -param_biga*tmp_exp*(tmp_fc_d - tmp_fc*param_lam1)*ucl_recip(r); + ans[0] = -tmp_exp*(tmp_fc_d - tmp_fc*param_lam1)*ucl_recip(r); // eng - if (eflag) ans[1] = tmp_fc * param_biga * tmp_exp; + if (EVFLAG && eflag) ans[1] = tmp_fc * tmp_exp; } /* ---------------------------------------------------------------------- */ -ucl_inline numtyp zeta(const numtyp param_powermint, +ucl_inline numtyp zeta(const int param_powermint, const numtyp param_lam3, const numtyp param_bigr, const numtyp param_bigd, @@ -446,20 +430,19 @@ ucl_inline numtyp zeta(const numtyp param_powermint, const numtyp param_d, const numtyp param_h, const numtyp param_gamma, - const numtyp rsqij, + const numtyp rij, const numtyp rsqik, const numtyp4 delrij, const numtyp4 delrik) { - numtyp rij,rik,costheta,arg,ex_delr; + numtyp rik,costheta,arg,ex_delr; - rij = ucl_sqrt(rsqij); rik = ucl_sqrt(rsqik); costheta = (delrij.x*delrik.x + delrij.y*delrik.y + delrij.z*delrik.z) / (rij*rik); numtyp t = param_lam3*(rij-rik); - if ((int)param_powermint == 3) arg = t*t*t; + if (param_powermint == 3) arg = t*t*t; else arg = t; if (arg > (numtyp)69.0776) ex_delr = (numtyp)1.e30; @@ -482,22 +465,19 @@ ucl_inline void force_zeta(const numtyp param_bigb, const numtyp param_c2, const numtyp param_c3, const numtyp param_c4, - const numtyp rsq, + const numtyp r, const numtyp zeta_ij, const int eflag, numtyp fpfeng[4]) { - numtyp r,fa,fa_d,bij; + numtyp fa,fa_d,bij,bij_d; - r = ucl_sqrt(rsq); - fa = ters_fa(r,param_bigb,param_bigr,param_bigd,param_lam2); - fa_d = ters_fa_d(r,param_bigb,param_bigr,param_bigd,param_lam2); - bij = ters_bij(zeta_ij,param_beta,param_powern, - param_c1,param_c2, param_c3, param_c4); - fpfeng[0] = (numtyp)0.5*bij*fa_d * ucl_recip(r); // fforce - fpfeng[1] = (numtyp)-0.5*fa * ters_bij_d(zeta_ij,param_beta, param_powern, - param_c1,param_c2, param_c3, param_c4); // prefactor - if (eflag) fpfeng[2] = (numtyp)0.5*bij*fa; // eng + fa = ters_fa_d(r,param_bigb,param_bigr,param_bigd,param_lam2,&fa_d); + bij = ters_bij_d(zeta_ij,param_beta,param_powern, + param_c1,param_c2, param_c3, param_c4, &bij_d); + fpfeng[0] = (numtyp)0.5*bij*fa_d*ucl_recip(r); // fforce + fpfeng[1] = (numtyp)-0.5*fa*bij_d; // prefactor + if (EVFLAG && eflag) fpfeng[2] = (numtyp)0.5*bij*fa; // eng } /* ---------------------------------------------------------------------- @@ -508,7 +488,7 @@ ucl_inline void force_zeta(const numtyp param_bigb, ucl_inline void attractive(const numtyp param_bigr, const numtyp param_bigd, - const numtyp param_powermint, + const int param_powermint, const numtyp param_lam3, const numtyp param_c, const numtyp param_d, @@ -535,7 +515,7 @@ ucl_inline void attractive(const numtyp param_bigr, ucl_inline void attractive_fi(const numtyp param_bigr, const numtyp param_bigd, - const numtyp param_powermint, + const int param_powermint, const numtyp param_lam3, const numtyp param_c, const numtyp param_d, @@ -560,7 +540,7 @@ ucl_inline void attractive_fi(const numtyp param_bigr, ucl_inline void attractive_fj(const numtyp param_bigr, const numtyp param_bigd, - const numtyp param_powermint, + const int param_powermint, const numtyp param_lam3, const numtyp param_c, const numtyp param_d, @@ -585,7 +565,7 @@ ucl_inline void attractive_fj(const numtyp param_bigr, ucl_inline void attractive_fk(const numtyp param_bigr, const numtyp param_bigd, - const numtyp param_powermint, + const int param_powermint, const numtyp param_lam3, const numtyp param_c, const numtyp param_d, @@ -610,5 +590,3 @@ ucl_inline void attractive_fk(const numtyp param_bigr, #endif - - diff --git a/lib/gpu/lal_tersoff_mod.cpp b/lib/gpu/lal_tersoff_mod.cpp index 2b56991cc6..b7b0fff1b9 100644 --- a/lib/gpu/lal_tersoff_mod.cpp +++ b/lib/gpu/lal_tersoff_mod.cpp @@ -39,7 +39,7 @@ TersoffMT::~TersoffMod() { template int TersoffMT::bytes_per_atom(const int max_nbors) const { - return this->bytes_per_atom_atomic(max_nbors); + return this->bytes_per_atom_atomic(max_nbors)+max_nbors*sizeof(acctyp)*4; } template @@ -52,34 +52,78 @@ int TersoffMT::init(const int ntypes, const int nlocal, const int nall, const in const double* c5, const double* h, const double* beta, const double* powern, const double* powern_del, const double* ca1, const double* host_cutsq) { + int oldparam=-1; + int onetype=-1; + int onetype3=0; + int spq=1; + int mtypes=0; + #ifdef USE_OPENCL + for (int ii=1; ii1) onetype=-1; + #endif + int success; success=this->init_three(nlocal,nall,max_nbors,0,cell_size,gpu_split, _screen,tersoff_mod,"k_tersoff_mod_repulsive", - "k_tersoff_mod_three_center", "k_tersoff_mod_three_end", - "k_tersoff_mod_short_nbor"); + "k_tersoff_mod_three_center", + "k_tersoff_mod_three_end", + "k_tersoff_mod_short_nbor",onetype,onetype3,0,1); if (success!=0) return success; int ef_nall=nall; if (ef_nall==0) ef_nall=2000; - _zetaij.alloc(ef_nall*max_nbors,*(this->ucl_device),UCL_READ_WRITE); + if (this->nbor->max_nbors()) + _zetaij.alloc(ef_nall*this->nbor->max_nbors(),*(this->ucl_device), + UCL_READ_WRITE); k_zeta.set_function(*(this->pair_program),"k_tersoff_mod_zeta"); + #if defined(LAL_OCL_EV_JIT) + k_zeta_noev.set_function(*(this->pair_program_noev),"k_tersoff_mod_zeta"); + #else + k_zeta_selt = &k_zeta; + #endif - // If atom type constants fit in shared memory use fast kernel - int lj_types=ntypes; - shared_types=false; - int max_shared_types=this->device->max_shared_types(); - if (lj_types<=max_shared_types && this->_block_size>=max_shared_types) { - lj_types=max_shared_types; - shared_types=true; - } - _lj_types=lj_types; - + _ntypes=ntypes; _nparams = nparams; _nelements = nelements; + UCL_H_Vec host_write(ntypes*ntypes,*(this->ucl_device), + UCL_READ_WRITE); + host_write.zero(); + cutsq_pair.alloc(ntypes*ntypes,*(this->ucl_device),UCL_READ_ONLY); + for (int ii=1; iihost_write[ii*ntypes+jj]) + host_write[ii*ntypes+jj]=host_cutsq[ijkparam]; + } + } + } + ucl_copy(cutsq_pair,host_write,ntypes*ntypes); + UCL_H_Vec dview(nparams,*(this->ucl_device), UCL_WRITE_ONLY); @@ -101,8 +145,6 @@ int TersoffMT::init(const int ntypes, const int nlocal, const int nall, const in } ucl_copy(ts1,dview,false); - ts1_tex.get_texture(*(this->pair_program),"ts1_tex"); - ts1_tex.bind_float(ts1,4); ts2.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); @@ -114,8 +156,6 @@ int TersoffMT::init(const int ntypes, const int nlocal, const int nall, const in } ucl_copy(ts2,dview,false); - ts2_tex.get_texture(*(this->pair_program),"ts2_tex"); - ts2_tex.bind_float(ts2,4); ts3.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); @@ -127,8 +167,6 @@ int TersoffMT::init(const int ntypes, const int nlocal, const int nall, const in } ucl_copy(ts3,dview,false); - ts3_tex.get_texture(*(this->pair_program),"ts3_tex"); - ts3_tex.bind_float(ts3,4); ts4.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); @@ -140,8 +178,6 @@ int TersoffMT::init(const int ntypes, const int nlocal, const int nall, const in } ucl_copy(ts4,dview,false); - ts4_tex.get_texture(*(this->pair_program),"ts4_tex"); - ts4_tex.bind_float(ts4,4); ts5.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); @@ -153,20 +189,6 @@ int TersoffMT::init(const int ntypes, const int nlocal, const int nall, const in } ucl_copy(ts5,dview,false); - ts5_tex.get_texture(*(this->pair_program),"ts5_tex"); - ts5_tex.bind_float(ts5,4); - - UCL_H_Vec cutsq_view(nparams,*(this->ucl_device), - UCL_WRITE_ONLY); - double cutsqmax = 0.0; - for (int i=0; i(host_cutsq[i]); - if (cutsqmax < host_cutsq[i]) cutsqmax = host_cutsq[i]; - } - cutsq.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); - ucl_copy(cutsq,cutsq_view,false); - - _cutshortsq = static_cast(cutsqmax); UCL_H_Vec dview_elem2param(nelements*nelements*nelements, *(this->ucl_device), UCL_WRITE_ONLY); @@ -183,17 +205,16 @@ int TersoffMT::init(const int ntypes, const int nlocal, const int nall, const in ucl_copy(elem2param,dview_elem2param,false); - UCL_H_Vec dview_map(lj_types, *(this->ucl_device), UCL_WRITE_ONLY); + UCL_H_Vec dview_map(ntypes, *(this->ucl_device), UCL_WRITE_ONLY); for (int i = 0; i < ntypes; i++) dview_map[i] = host_map[i]; - map.alloc(lj_types,*(this->ucl_device), UCL_READ_ONLY); + map.alloc(ntypes,*(this->ucl_device), UCL_READ_ONLY); ucl_copy(map,dview_map,false); _allocated=true; this->_max_bytes=ts1.row_bytes()+ts2.row_bytes()+ts3.row_bytes()+ - ts4.row_bytes()+ts5.row_bytes()+cutsq.row_bytes()+ - map.row_bytes()+elem2param.row_bytes()+_zetaij.row_bytes(); + ts4.row_bytes()+map.row_bytes()+elem2param.row_bytes()+_zetaij.row_bytes(); return 0; } @@ -208,12 +229,15 @@ void TersoffMT::clear() { ts3.clear(); ts4.clear(); ts5.clear(); - cutsq.clear(); + cutsq_pair.clear(); map.clear(); elem2param.clear(); _zetaij.clear(); k_zeta.clear(); + #if defined(LAL_OCL_EV_JIT) + k_zeta_noev.clear(); + #endif this->clear_atomic(); } @@ -229,74 +253,54 @@ double TersoffMT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void TersoffMT::loop(const bool _eflag, const bool _vflag, const int evatom) { - // Compute the block size and grid size to keep all cores busy - int BX=this->block_pair(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - - // build the short neighbor list - int ainum=this->_ainum; - int nbor_pitch=this->nbor->nbor_pitch(); - int GX=static_cast(ceil(static_cast(ainum)/ - (BX/this->_threads_per_atom))); - - this->k_short_nbor.set_size(GX,BX); - this->k_short_nbor.run(&this->atom->x, &this->nbor->dev_nbor, - &this->_nbor_data->begin(), - &this->dev_short_nbor, &_cutshortsq, &ainum, - &nbor_pitch, &this->_threads_per_atom); +int TersoffMT::loop(const int eflag, const int vflag, const int evatom, + bool &success) { + const int nbor_pitch=this->nbor->nbor_pitch(); // re-allocate zetaij if necessary int nall = this->_nall; - if (nall*this->_max_nbors > _zetaij.cols()) { + if (nall*this->nbor->max_nbors() > _zetaij.cols()) { int _nmax=static_cast(static_cast(nall)*1.10); - _zetaij.resize(this->_max_nbors*_nmax); + _zetaij.clear(); + success = success && (_zetaij.alloc(this->nbor->max_nbors()*_nmax, + *(this->ucl_device), + UCL_READ_WRITE) == UCL_SUCCESS); + if (!success) return 0; } - nbor_pitch=this->nbor->nbor_pitch(); + // build the short neighbor list + int ainum=this->_ainum; + this->time_pair.start(); + + int BX=this->block_pair(); + int GX=static_cast(ceil(static_cast(ainum)/BX)); + this->k_short_nbor.set_size(GX,BX); + this->k_short_nbor.run(&this->atom->x, &cutsq_pair, &_ntypes, + &this->nbor->dev_nbor, &this->nbor->dev_packed, + &ainum, &nbor_pitch, &this->_threads_per_atom); + + #if defined(LAL_OCL_EV_JIT) + if (eflag || vflag) k_zeta_selt = &k_zeta; + else k_zeta_selt = &k_zeta_noev; + #endif + GX=static_cast(ceil(static_cast(this->_ainum)/ (BX/(JTHREADS*KTHREADS)))); - - this->k_zeta.set_size(GX,BX); - this->k_zeta.run(&this->atom->x, &ts1, &ts2, &ts3, &ts4, &ts5, &cutsq, + k_zeta_selt->set_size(GX,BX); + k_zeta_selt->run(&this->atom->x, &ts1, &ts2, &ts3, &ts4, &ts5, &map, &elem2param, &_nelements, &_nparams, &_zetaij, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->dev_short_nbor, - &eflag, &this->_ainum, &nbor_pitch, &this->_threads_per_atom); - - ainum=this->ans->inum(); - nbor_pitch=this->nbor->nbor_pitch(); - GX=static_cast(ceil(static_cast(this->ans->inum())/ - (BX/this->_threads_per_atom))); - - this->time_pair.start(); - this->k_pair.set_size(GX,BX); - this->k_pair.run(&this->atom->x, &ts1, &ts2, &cutsq, - &map, &elem2param, &_nelements, &_nparams, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->dev_short_nbor, - &this->ans->force, &this->ans->engv, - &eflag, &vflag, &ainum, &nbor_pitch, + &this->nbor->dev_nbor,&eflag, &this->_ainum, &nbor_pitch, &this->_threads_per_atom); + ainum=this->ans->inum(); BX=this->block_size(); GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/(KTHREADS*JTHREADS)))); - this->k_three_center.set_size(GX,BX); - this->k_three_center.run(&this->atom->x, &ts1, &ts2, &ts4, &ts5, &cutsq, + this->k_3center_sel->set_size(GX,BX); + this->k_3center_sel->run(&this->atom->x, &ts1, &ts2, &ts4, &ts5, &map, &elem2param, &_nelements, &_nparams, &_zetaij, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->dev_short_nbor, - &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, + &this->nbor->dev_nbor, &this->ans->force, + &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->_threads_per_atom, &evatom); Answer *end_ans; @@ -307,24 +311,34 @@ void TersoffMT::loop(const bool _eflag, const bool _vflag, const int evatom) { #endif if (evatom!=0) { this->k_three_end_vatom.set_size(GX,BX); - this->k_three_end_vatom.run(&this->atom->x, &ts1, &ts2, &ts4, &ts5, &cutsq, + this->k_three_end_vatom.run(&this->atom->x, &ts1, &ts2, &ts4, &ts5, &map, &elem2param, &_nelements, &_nparams, &_zetaij, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->nbor->dev_ilist, &this->dev_short_nbor, - &end_ans->force, &end_ans->engv, &eflag, &vflag, &ainum, - &nbor_pitch, &this->_threads_per_atom, &this->_gpu_nbor); + &this->nbor->dev_nbor, &this->nbor->three_ilist, + &end_ans->force, &end_ans->engv, &eflag, &vflag, + &ainum, &nbor_pitch, &this->_threads_per_atom, + &this->_gpu_nbor); } else { - this->k_three_end.set_size(GX,BX); - this->k_three_end.run(&this->atom->x, &ts1, &ts2, &ts4, &ts5, &cutsq, + this->k_3end_sel->set_size(GX,BX); + this->k_3end_sel->run(&this->atom->x, &ts1, &ts2, &ts4, &ts5, &map, &elem2param, &_nelements, &_nparams, &_zetaij, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->nbor->dev_ilist, &this->dev_short_nbor, - &end_ans->force, &end_ans->engv, &eflag, &vflag, &ainum, - &nbor_pitch, &this->_threads_per_atom, &this->_gpu_nbor); + &this->nbor->dev_nbor, &this->nbor->three_ilist, + &end_ans->force, &end_ans->engv, &eflag, &vflag, + &ainum, &nbor_pitch, &this->_threads_per_atom, + &this->_gpu_nbor); } + BX=this->block_pair(); + int GXT=static_cast(ceil(static_cast(this->ans->inum())/ + (BX/this->_threads_per_atom))); + this->k_sel->set_size(GXT,BX); + this->k_sel->run(&this->atom->x, &ts1, &ts2, &map, &elem2param, + &_nelements, &_nparams, &this->nbor->dev_nbor, + &this->ans->force, &this->ans->engv, &eflag, &vflag, + &ainum, &nbor_pitch, &this->_threads_per_atom, &GX); + this->time_pair.stop(); + return GX; } template class TersoffMod; diff --git a/lib/gpu/lal_tersoff_mod.cu b/lib/gpu/lal_tersoff_mod.cu index 0f45653264..44b04c6933 100644 --- a/lib/gpu/lal_tersoff_mod.cu +++ b/lib/gpu/lal_tersoff_mod.cu @@ -18,99 +18,28 @@ #ifndef _DOUBLE_DOUBLE _texture( pos_tex,float4); -_texture( ts1_tex,float4); -_texture( ts2_tex,float4); -_texture( ts3_tex,float4); -_texture( ts4_tex,float4); -_texture( ts5_tex,float4); #else _texture_2d( pos_tex,int4); -_texture( ts1_tex,int4); -_texture( ts2_tex,int4); -_texture( ts3_tex,int4); -_texture( ts4_tex,int4); -_texture( ts5_tex,int4); #endif #else #define pos_tex x_ -#define ts1_tex ts1 -#define ts2_tex ts2 -#define ts3_tex ts3 -#define ts4_tex ts4 -#define ts5_tex ts5 #endif //#define THREE_CONCURRENT #define TWOTHIRD (numtyp)0.66666666666666666667 -#define zeta_idx(nbor_mem, packed_mem, nbor_pitch, n_stride, t_per_atom, \ - i, nbor_j, offset_j, idx) \ - if (nbor_mem==packed_mem) { \ - int jj = (nbor_j-offset_j-2*nbor_pitch)/n_stride; \ - idx = jj*n_stride + i*t_per_atom + offset_j; \ - } else { \ - idx = nbor_j; \ - } +#if (SHUFFLE_AVAIL == 0) -#if (ARCH < 300) - -#define store_answers_p(f, energy, virial, ii, inum, tid, t_per_atom, \ - offset, eflag, vflag, ans, engv) \ - if (t_per_atom>1) { \ - __local acctyp red_acc[6][BLOCK_PAIR]; \ - red_acc[0][tid]=f.x; \ - red_acc[1][tid]=f.y; \ - red_acc[2][tid]=f.z; \ - red_acc[3][tid]=energy; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<4; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ - } \ - f.x=red_acc[0][tid]; \ - f.y=red_acc[1][tid]; \ - f.z=red_acc[2][tid]; \ - energy=red_acc[3][tid]; \ - if (vflag>0) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid]=virial[r]; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ - } \ - for (int r=0; r<6; r++) \ - virial[r]=red_acc[r][tid]; \ - } \ - } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]+=energy*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]+=virial[i]*(acctyp)0.5; \ - ei+=inum; \ - } \ - } \ - acctyp4 old=ans[ii]; \ - old.x+=f.x; \ - old.y+=f.y; \ - old.z+=f.z; \ - ans[ii]=old; \ - } +#define local_allocate_acc_zeta() \ + __local acctyp red_acc[BLOCK_PAIR]; #define acc_zeta(z, tid, t_per_atom, offset) \ if (t_per_atom>1) { \ - __local acctyp red_acc[BLOCK_PAIR]; \ red_acc[tid]=z; \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + simdsync(); \ if (offset < s) { \ red_acc[tid] += red_acc[tid+s]; \ } \ @@ -118,36 +47,168 @@ _texture( ts5_tex,int4); z=red_acc[tid]; \ } -#else - #define store_answers_p(f, energy, virial, ii, inum, tid, t_per_atom, \ - offset, eflag, vflag, ans, engv) \ + offset, eflag, vflag, ans, engv, ev_stride) \ if (t_per_atom>1) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - f.x += shfl_xor(f.x, s, t_per_atom); \ - f.y += shfl_xor(f.y, s, t_per_atom); \ - f.z += shfl_xor(f.z, s, t_per_atom); \ - energy += shfl_xor(energy, s, t_per_atom); \ - } \ - if (vflag>0) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - for (int r=0; r<6; r++) \ - virial[r] += shfl_xor(virial[r], s, t_per_atom); \ + simd_reduce_add3(t_per_atom, red_acc, offset, tid, f.x, f.y, f.z); \ + if (EVFLAG && (vflag==2 || eflag==2)) { \ + if (eflag) { \ + simdsync(); \ + simd_reduce_add1(t_per_atom, red_acc, offset, tid, energy); \ + } \ + if (vflag) { \ + simdsync(); \ + simd_reduce_arr(6, t_per_atom, red_acc, offset, tid, virial); \ } \ } \ } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]+=energy*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]+=virial[i]*(acctyp)0.5; \ + if (offset==0 && ii1) { \ + for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + z += shfl_down(z, s, t_per_atom); \ + } \ + } + +#if (EVFLAG == 1) + +#define store_answers_p(f, energy, virial, ii, inum, tid, t_per_atom, \ + offset, eflag, vflag, ans, engv, ev_stride) \ + if (t_per_atom>1) { \ + simd_reduce_add3(t_per_atom, f.x, f.y, f.z); \ + if (vflag==2 || eflag==2) { \ + if (eflag) \ + simd_reduce_add1(t_per_atom,energy); \ + if (vflag) \ + simd_reduce_arr(6, t_per_atom,virial); \ + } \ + } \ + if (offset==0 && ii 1; active_subgs /= vwidth) { \ + if (active_subgs < BLOCK_SIZE_X/simd_size()) __syncthreads(); \ + if (bnum < active_subgs) { \ + if (eflag) { \ + simd_reduce_add1(vwidth, energy); \ + if (voffset==0) red_acc[6][bnum] = energy; \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (voffset==0) \ + for (int r=0; r<6; r++) red_acc[r][bnum]=virial[r]; \ + } \ + } \ + \ + __syncthreads(); \ + if (tid < active_subgs) { \ + if (eflag) energy = red_acc[6][tid]; \ + if (vflag) \ + for (int r = 0; r < 6; r++) virial[r] = red_acc[r][tid]; \ + } else { \ + if (eflag) energy = (acctyp)0; \ + if (vflag) for (int r = 0; r < 6; r++) virial[r] = (acctyp)0; \ + } \ + } \ + \ + if (bnum == 0) { \ + int ei=BLOCK_ID_X; \ + if (eflag) { \ + simd_reduce_add1(vwidth, energy); \ + if (tid==0) { \ + engv[ei]+=energy*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (tid==0) { \ + for (int r=0; r<6; r++) { \ + engv[ei]+=virial[r]*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + } \ + } \ + } else if (offset==0 && ii1) \ + simd_reduce_add3(t_per_atom, f.x, f.y, f.z); \ + if (offset==0 && ii1) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - z += shfl_xor(z, s, t_per_atom); \ - } \ - } - +#endif #endif __kernel void k_tersoff_mod_short_nbor(const __global numtyp4 *restrict x_, - const __global int * dev_nbor, + const __global numtyp *restrict cutsq_pair, + const int ntypes, __global int * dev_nbor, const __global int * dev_packed, - __global int * dev_short_nbor, - const numtyp _cutshortsq, const int inum, const int nbor_pitch, const int t_per_atom) { - __local int n_stride; - int tid, ii, offset; - atom_info(t_per_atom,ii,tid,offset); + const int ii=GLOBAL_ID_X; + + #ifdef ONETYPE + const numtyp cutsq=cutsq_pair[ONETYPE]; + #endif if (ii cutsq[ijkparam]) continue; - numtyp4 ts1_ijkparam = ts1[ijkparam]; //fetch4(ts1_ijkparam,ijkparam,ts1_tex); numtyp ijkparam_lam3 = ts1_ijkparam.z; numtyp ijkparam_powermint = ts1_ijkparam.w; @@ -348,9 +390,6 @@ __kernel void k_tersoff_mod_zeta(const __global numtyp4 *restrict x_, ijkparam_c5, rsq1, rsq2, delr1, delr2); } - // idx to zetaij is shifted by n_stride relative to nbor_j in dev_short_nbor - int idx = nbor_j; - if (dev_packed==dev_nbor) idx -= n_stride; acc_zeta(z, tid, t_per_atom, offset_k); numtyp4 ts1_ijparam = ts1[ijparam]; //fetch4(ts1_ijparam,ijparam,ts1_tex); @@ -376,7 +415,7 @@ __kernel void k_tersoff_mod_zeta(const __global numtyp4 *restrict x_, zij.y = fpfeng[1]; zij.z = fpfeng[2]; zij.w = z; - zetaij[idx] = zij; + zetaij[nbor_j-2*nbor_pitch] = zij; } } // for nbor @@ -386,22 +425,20 @@ __kernel void k_tersoff_mod_zeta(const __global numtyp4 *restrict x_, __kernel void k_tersoff_mod_repulsive(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict ts1_in, const __global numtyp4 *restrict ts2_in, - const __global numtyp *restrict cutsq, const __global int *restrict map, const __global int *restrict elem2param, const int nelements, const int nparams, const __global int * dev_nbor, - const __global int * dev_packed, - const __global int * dev_short_nbor, __global acctyp4 *restrict ans, __global acctyp *restrict engv, const int eflag, const int vflag, const int inum, const int nbor_pitch, - const int t_per_atom) { - __local int n_stride; - int tid, ii, offset; + const int t_per_atom, const int ev_stride) { + int tid, ii, offset, n_stride; atom_info(t_per_atom,ii,tid,offset); + local_allocate_store_pair(); + __local numtyp4 ts1[SHARED_SIZE]; __local numtyp4 ts2[SHARED_SIZE]; if (tid= cutsq[ijparam]) continue; - numtyp feng[2]; numtyp ijparam_lam1 = ts1[ijparam].x; numtyp4 ts2_ijparam = ts2[ijparam]; @@ -470,9 +497,9 @@ __kernel void k_tersoff_mod_repulsive(const __global numtyp4 *restrict x_, f.y+=dely*force; f.z+=delz*force; - if (eflag>0) + if (EVFLAG && eflag) energy+=feng[1]; - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -481,11 +508,9 @@ __kernel void k_tersoff_mod_repulsive(const __global numtyp4 *restrict x_, virial[5] += dely*delz*force; } } // for nbor - - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii - + store_answers_p(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv,ev_stride); } __kernel void k_tersoff_mod_three_center(const __global numtyp4 *restrict x_, @@ -493,26 +518,24 @@ __kernel void k_tersoff_mod_three_center(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict ts2_in, const __global numtyp4 *restrict ts4_in, const __global numtyp4 *restrict ts5_in, - const __global numtyp *restrict cutsq, const __global int *restrict map, const __global int *restrict elem2param, const int nelements, const int nparams, const __global acctyp4 *restrict zetaij, const __global int * dev_nbor, - const __global int * dev_packed, - const __global int * dev_short_nbor, __global acctyp4 *restrict ans, __global acctyp *restrict engv, const int eflag, const int vflag, const int inum, const int nbor_pitch, const int t_per_atom, const int evatom) { - __local int tpa_sq, n_stride; - tpa_sq=fast_mul(t_per_atom,t_per_atom); + const int tpa_sq=fast_mul(t_per_atom,t_per_atom); numtyp lam3, powermint, bigr, bigd, c1, c2, c3, c4, c5, h; - int tid, ii, offset; + int tid, ii, offset, n_stride; atom_info(tpa_sq,ii,tid,offset); // offset ranges from 0 to tpa_sq-1 + local_allocate_store_three(); + __local numtyp4 ts1[SHARED_SIZE]; __local numtyp4 ts2[SHARED_SIZE]; __local numtyp4 ts4[SHARED_SIZE]; @@ -524,46 +547,37 @@ __kernel void k_tersoff_mod_three_center(const __global numtyp4 *restrict x_, ts5[tid]=ts5_in[tid]; } - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } numtyp tpainv = ucl_recip((numtyp)t_per_atom); __syncthreads(); if (ii= cutsq[ijparam]) continue; numtyp r1 = ucl_sqrt(rsq1); numtyp r1inv = ucl_rsqrt(rsq1); // look up for zeta_ij - // idx to zetaij is shifted by n_stride relative to nbor_j in dev_short_nbor - int idx = nbor_j; - if (dev_packed==dev_nbor) idx -= n_stride; - acctyp4 zeta_ij = zetaij[idx]; // fetch(zeta_ij,idx,zeta_tex); + acctyp4 zeta_ij = zetaij[nbor_j-2*nbor_pitch]; numtyp force = zeta_ij.x*tpainv; numtyp prefactor = zeta_ij.y; f.x += delr1[0]*force; f.y += delr1[1]*force; f.z += delr1[2]*force; - if (eflag>0) { + if (EVFLAG && eflag) { energy+=zeta_ij.z*tpainv; } - if (vflag>0) { + if (EVFLAG && vflag) { numtyp mforce = -force; virial[0] += delr1[0]*delr1[0]*mforce; virial[1] += delr1[1]*delr1[1]*mforce; @@ -601,14 +611,8 @@ __kernel void k_tersoff_mod_three_center(const __global numtyp4 *restrict x_, } int nbor_k = nborj_start-offset_j+offset_k; - int k_end = nbor_end; - if (dev_packed==dev_nbor) { - int numk = dev_short_nbor[nbor_k-n_stride]; - k_end = nbor_k+fast_mul(numk,n_stride); - } - - for ( ; nbor_k cutsq[ijkparam]) continue; numtyp r2 = ucl_sqrt(rsq2); numtyp r2inv = ucl_rsqrt(rsq2); @@ -643,7 +646,7 @@ __kernel void k_tersoff_mod_three_center(const __global numtyp4 *restrict x_, numtyp4 ts5_ijkparam = ts5[ijkparam]; //fetch4(ts5_ijkparam,ijkparam,ts5_tex); c5 = ts5_ijkparam.x; h = ts5_ijkparam.y; - if (vflag>0) + if (EVFLAG && vflag) attractive(bigr, bigd, powermint, lam3, h, c1, c2, c3, c4, c5, prefactor, r1, r1inv, r2, r2inv, delr1, delr2, fi, fj, fk); else @@ -653,7 +656,7 @@ __kernel void k_tersoff_mod_three_center(const __global numtyp4 *restrict x_, f.y += fi[1]; f.z += fi[2]; - if (vflag>0) { + if (EVFLAG && vflag) { acctyp v[6]; numtyp pre = (numtyp)2.0; if (evatom==1) pre = TWOTHIRD; @@ -669,10 +672,9 @@ __kernel void k_tersoff_mod_three_center(const __global numtyp4 *restrict x_, } } // nbor_k } // for nbor_j - - store_answers_p(f,energy,virial,ii,inum,tid,tpa_sq, - offset,eflag,vflag,ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,tpa_sq, + offset,eflag,vflag,ans,engv); } __kernel void k_tersoff_mod_three_end(const __global numtyp4 *restrict x_, @@ -680,27 +682,25 @@ __kernel void k_tersoff_mod_three_end(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict ts2_in, const __global numtyp4 *restrict ts4_in, const __global numtyp4 *restrict ts5_in, - const __global numtyp *restrict cutsq, const __global int *restrict map, const __global int *restrict elem2param, const int nelements, const int nparams, const __global acctyp4 *restrict zetaij, const __global int * dev_nbor, - const __global int * dev_packed, const __global int * dev_ilist, - const __global int * dev_short_nbor, __global acctyp4 *restrict ans, __global acctyp *restrict engv, const int eflag, const int vflag, const int inum, const int nbor_pitch, const int t_per_atom, const int gpu_nbor) { - __local int tpa_sq, n_stride; - tpa_sq=fast_mul(t_per_atom,t_per_atom); + const int tpa_sq=fast_mul(t_per_atom,t_per_atom); numtyp lam3, powermint, bigr, bigd, c1, c2, c3, c4, c5, h; - int tid, ii, offset; + int tid, ii, offset, n_stride; atom_info(tpa_sq,ii,tid,offset); + local_allocate_store_three(); + __local numtyp4 ts1[SHARED_SIZE]; __local numtyp4 ts2[SHARED_SIZE]; __local numtyp4 ts4[SHARED_SIZE]; @@ -712,23 +712,25 @@ __kernel void k_tersoff_mod_three_end(const __global numtyp4 *restrict x_, ts5[tid]=ts5_in[tid]; } - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } - __local int ijnum_shared[BLOCK_PAIR]; + #ifdef LAL_SIMD_IP_SYNC + __local int localk[BLOCK_PAIR]; + #endif __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { energy+=zeta_ji.z*tpainv; } - if (vflag>0) { + if (EVFLAG && vflag) { numtyp mforce = -force; virial[0] += mdelr1[0]*mdelr1[0]*mforce; virial[1] += mdelr1[1]*mdelr1[1]*mforce; @@ -833,7 +816,7 @@ __kernel void k_tersoff_mod_three_end(const __global numtyp4 *restrict x_, // attractive forces for (nbor_k = nbork_start ; nbor_k0) { + if (EVFLAG && eflag) { energy+=zeta_ji.z*tpainv; } - if (vflag>0) { + if (EVFLAG && vflag) { numtyp mforce = -force; virial[0] += mdelr1[0]*mdelr1[0]*mforce; virial[1] += mdelr1[1]*mdelr1[1]*mforce; @@ -1071,7 +1031,7 @@ __kernel void k_tersoff_mod_three_end_vatom(const __global numtyp4 *restrict x_, // attractive forces for (nbor_k = nbork_start; nbor_k cutsq[jikparam]) continue; numtyp r2 = ucl_sqrt(rsq2); numtyp r2inv = ucl_rsqrt(rsq2); @@ -1120,10 +1078,7 @@ __kernel void k_tersoff_mod_three_end_vatom(const __global numtyp4 *restrict x_, virial[4] += TWOTHIRD*(mdelr1[0]*fj[2] + delr2[0]*fk[2]); virial[5] += TWOTHIRD*(mdelr1[1]*fj[2] + delr2[1]*fk[2]); - // idx to zetaij is shifted by n_stride relative to nbor_k in dev_short_nbor - int idx = nbor_k; - if (dev_packed==dev_nbor) idx -= n_stride; - acctyp4 zeta_jk = zetaij[idx]; // fetch(zeta_jk,idx,zeta_tex); + acctyp4 zeta_jk = zetaij[nbor_k-2*nbor_pitch]; numtyp prefactor_jk = zeta_jk.y; int jkiparam=elem2param[jtype*nelements*nelements+ktype*nelements+itype]; @@ -1155,14 +1110,13 @@ __kernel void k_tersoff_mod_three_end_vatom(const __global numtyp4 *restrict x_, virial[5] += TWOTHIRD*(delr2[1]*fj[2] + mdelr1[1]*fk[2]); } } // for nbor - - #ifdef THREE_CONCURRENT - store_answers(f,energy,virial,ii,inum,tid,tpa_sq,offset, - eflag,vflag,ans,engv); - #else - store_answers_p(f,energy,virial,ii,inum,tid,tpa_sq,offset, - eflag,vflag,ans,engv); - #endif } // if ii + #ifdef THREE_CONCURRENT + store_answers(f,energy,virial,ii,inum,tid,tpa_sq,offset, + eflag,vflag,ans,engv); + #else + store_answers_p(f,energy,virial,ii,inum,tid,tpa_sq,offset, + eflag,vflag,ans,engv,NUM_BLOCKS_X); + #endif } diff --git a/lib/gpu/lal_tersoff_mod.h b/lib/gpu/lal_tersoff_mod.h index 29a561c71d..0baa1307cb 100644 --- a/lib/gpu/lal_tersoff_mod.h +++ b/lib/gpu/lal_tersoff_mod.h @@ -63,7 +63,7 @@ class TersoffMod : public BaseThree { bool shared_types; /// Number of atom types - int _lj_types; + int _ntypes; /// ts1.x = lam1, ts1.y = lam2, ts1.z = lam3, ts1.w = powermint UCL_D_Vec ts1; @@ -76,7 +76,7 @@ class TersoffMod : public BaseThree { /// ts5.x = c5, ts5.y = h UCL_D_Vec ts5; - UCL_D_Vec cutsq; + UCL_D_Vec cutsq_pair; UCL_D_Vec elem2param; UCL_D_Vec map; @@ -87,13 +87,11 @@ class TersoffMod : public BaseThree { /// zetaij.w = zetaij UCL_D_Vec _zetaij; - UCL_Kernel k_zeta; - UCL_Texture ts1_tex, ts2_tex, ts3_tex, ts4_tex, ts5_tex; - numtyp _cutshortsq; + UCL_Kernel k_zeta, k_zeta_noev, *k_zeta_selt; private: bool _allocated; - void loop(const bool _eflag, const bool _vflag, const int evatom); + int loop(const int eflag, const int vflag, const int evatom, bool &success); }; } diff --git a/lib/gpu/lal_tersoff_mod_ext.cpp b/lib/gpu/lal_tersoff_mod_ext.cpp index cce9df8713..cac284fb70 100644 --- a/lib/gpu/lal_tersoff_mod_ext.cpp +++ b/lib/gpu/lal_tersoff_mod_ext.cpp @@ -63,7 +63,7 @@ int tersoff_mod_gpu_init(const int ntypes, const int inum, const int nall, int init_ok=0; if (world_me==0) - init_ok=TSMMF.init(ntypes, inum, nall, 300, cell_size, gpu_split, screen, + init_ok=TSMMF.init(ntypes, inum, nall, max_nbors, cell_size, gpu_split, screen, host_map, nelements, host_elem2param, nparams, ts_lam1, ts_lam2, ts_lam3, ts_powermint, ts_biga, ts_bigb, ts_bigr, ts_bigd, ts_c1, ts_c2, @@ -84,7 +84,7 @@ int tersoff_mod_gpu_init(const int ntypes, const int inum, const int nall, fflush(screen); } if (gpu_rank==i && world_me!=0) - init_ok=TSMMF.init(ntypes, inum, nall, 300, cell_size, gpu_split, screen, + init_ok=TSMMF.init(ntypes, inum, nall, max_nbors, cell_size, gpu_split, screen, host_map, nelements, host_elem2param, nparams, ts_lam1, ts_lam2, ts_lam3, ts_powermint, ts_biga, ts_bigb, ts_bigr, ts_bigd, ts_c1, ts_c2, @@ -99,7 +99,7 @@ int tersoff_mod_gpu_init(const int ntypes, const int inum, const int nall, fprintf(screen,"\n"); if (init_ok==0) - TSMMF.estimate_gpu_overhead(); + TSMMF.estimate_gpu_overhead(1); return init_ok; } diff --git a/lib/gpu/lal_tersoff_zbl.cpp b/lib/gpu/lal_tersoff_zbl.cpp index 7d254d568d..4456712b0a 100644 --- a/lib/gpu/lal_tersoff_zbl.cpp +++ b/lib/gpu/lal_tersoff_zbl.cpp @@ -39,7 +39,7 @@ TersoffZT::~TersoffZBL() { template int TersoffZT::bytes_per_atom(const int max_nbors) const { - return this->bytes_per_atom_atomic(max_nbors); + return this->bytes_per_atom_atomic(max_nbors)+max_nbors*sizeof(acctyp)*4; } template @@ -59,34 +59,78 @@ int TersoffZT::init(const int ntypes, const int nlocal, const int nall, const double global_a_0, const double global_epsilon_0, const double* host_cutsq) { + int oldparam=-1; + int onetype=-1; + int onetype3=0; + int spq=1; + int mtypes=0; + #ifdef USE_OPENCL + for (int ii=1; ii1) onetype=-1; + #endif + int success; success=this->init_three(nlocal,nall,max_nbors,0,cell_size,gpu_split, _screen,tersoff_zbl,"k_tersoff_zbl_repulsive", - "k_tersoff_zbl_three_center", "k_tersoff_zbl_three_end", - "k_tersoff_zbl_short_nbor"); + "k_tersoff_zbl_three_center", + "k_tersoff_zbl_three_end", + "k_tersoff_zbl_short_nbor",onetype,onetype3,0,1); if (success!=0) return success; int ef_nall=nall; if (ef_nall==0) ef_nall=2000; - _zetaij.alloc(ef_nall*max_nbors,*(this->ucl_device),UCL_READ_WRITE); + if (this->nbor->max_nbors()) + _zetaij.alloc(ef_nall*this->nbor->max_nbors(),*(this->ucl_device), + UCL_READ_WRITE); k_zeta.set_function(*(this->pair_program),"k_tersoff_zbl_zeta"); + #if defined(LAL_OCL_EV_JIT) + k_zeta_noev.set_function(*(this->pair_program_noev),"k_tersoff_zbl_zeta"); + #else + k_zeta_selt = &k_zeta; + #endif - // If atom type constants fit in shared memory use fast kernel - int lj_types=ntypes; - shared_types=false; - int max_shared_types=this->device->max_shared_types(); - if (lj_types<=max_shared_types && this->_block_size>=max_shared_types) { - lj_types=max_shared_types; - shared_types=true; - } - _lj_types=lj_types; - + _ntypes = ntypes; _nparams = nparams; _nelements = nelements; + UCL_H_Vec host_write(ntypes*ntypes,*(this->ucl_device), + UCL_READ_WRITE); + host_write.zero(); + cutsq_pair.alloc(ntypes*ntypes,*(this->ucl_device),UCL_READ_ONLY); + for (int ii=1; iihost_write[ii*ntypes+jj]) + host_write[ii*ntypes+jj]=host_cutsq[ijkparam]; + } + } + } + ucl_copy(cutsq_pair,host_write,ntypes*ntypes); + UCL_H_Vec dview(nparams,*(this->ucl_device), UCL_WRITE_ONLY); @@ -108,8 +152,6 @@ int TersoffZT::init(const int ntypes, const int nlocal, const int nall, } ucl_copy(ts1,dview,false); - ts1_tex.get_texture(*(this->pair_program),"ts1_tex"); - ts1_tex.bind_float(ts1,4); ts2.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); @@ -121,8 +163,6 @@ int TersoffZT::init(const int ntypes, const int nlocal, const int nall, } ucl_copy(ts2,dview,false); - ts2_tex.get_texture(*(this->pair_program),"ts2_tex"); - ts2_tex.bind_float(ts2,4); ts3.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); @@ -134,8 +174,6 @@ int TersoffZT::init(const int ntypes, const int nlocal, const int nall, } ucl_copy(ts3,dview,false); - ts3_tex.get_texture(*(this->pair_program),"ts3_tex"); - ts3_tex.bind_float(ts3,4); ts4.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); @@ -147,8 +185,6 @@ int TersoffZT::init(const int ntypes, const int nlocal, const int nall, } ucl_copy(ts4,dview,false); - ts4_tex.get_texture(*(this->pair_program),"ts4_tex"); - ts4_tex.bind_float(ts4,4); ts5.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); @@ -160,8 +196,6 @@ int TersoffZT::init(const int ntypes, const int nlocal, const int nall, } ucl_copy(ts5,dview,false); - ts5_tex.get_texture(*(this->pair_program),"ts5_tex"); - ts5_tex.bind_float(ts5,4); ts6.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); @@ -173,20 +207,6 @@ int TersoffZT::init(const int ntypes, const int nlocal, const int nall, } ucl_copy(ts6,dview,false); - ts6_tex.get_texture(*(this->pair_program),"ts6_tex"); - ts6_tex.bind_float(ts6,4); - - UCL_H_Vec cutsq_view(nparams,*(this->ucl_device), - UCL_WRITE_ONLY); - double cutsqmax = 0.0; - for (int i=0; i(host_cutsq[i]); - if (cutsqmax < host_cutsq[i]) cutsqmax = host_cutsq[i]; - } - cutsq.alloc(nparams,*(this->ucl_device),UCL_READ_ONLY); - ucl_copy(cutsq,cutsq_view,false); - - _cutshortsq = static_cast(cutsqmax); UCL_H_Vec dview_elem2param(nelements*nelements*nelements, *(this->ucl_device), UCL_WRITE_ONLY); @@ -203,11 +223,11 @@ int TersoffZT::init(const int ntypes, const int nlocal, const int nall, ucl_copy(elem2param,dview_elem2param,false); - UCL_H_Vec dview_map(lj_types, *(this->ucl_device), UCL_WRITE_ONLY); + UCL_H_Vec dview_map(ntypes, *(this->ucl_device), UCL_WRITE_ONLY); for (int i = 0; i < ntypes; i++) dview_map[i] = host_map[i]; - map.alloc(lj_types,*(this->ucl_device), UCL_READ_ONLY); + map.alloc(ntypes,*(this->ucl_device), UCL_READ_ONLY); ucl_copy(map,dview_map,false); _global_e = global_e; @@ -216,8 +236,8 @@ int TersoffZT::init(const int ntypes, const int nlocal, const int nall, _allocated=true; this->_max_bytes=ts1.row_bytes()+ts2.row_bytes()+ts3.row_bytes()+ - ts4.row_bytes()+ts5.row_bytes()+cutsq.row_bytes()+ - map.row_bytes()+elem2param.row_bytes()+_zetaij.row_bytes(); + ts4.row_bytes()+ts5.row_bytes()+map.row_bytes()+elem2param.row_bytes()+ + _zetaij.row_bytes(); return 0; } @@ -233,12 +253,15 @@ void TersoffZT::clear() { ts4.clear(); ts5.clear(); ts6.clear(); - cutsq.clear(); + cutsq_pair.clear(); map.clear(); elem2param.clear(); _zetaij.clear(); k_zeta.clear(); + #if defined(LAL_OCL_EV_JIT) + k_zeta_noev.clear(); + #endif this->clear_atomic(); } @@ -254,75 +277,54 @@ double TersoffZT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void TersoffZT::loop(const bool _eflag, const bool _vflag, const int evatom) { - // Compute the block size and grid size to keep all cores busy - int BX=this->block_pair(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - - // build the short neighbor list - int ainum=this->_ainum; - int nbor_pitch=this->nbor->nbor_pitch(); - int GX=static_cast(ceil(static_cast(ainum)/ - (BX/this->_threads_per_atom))); - - this->k_short_nbor.set_size(GX,BX); - this->k_short_nbor.run(&this->atom->x, &this->nbor->dev_nbor, - &this->_nbor_data->begin(), - &this->dev_short_nbor, &_cutshortsq, &ainum, - &nbor_pitch, &this->_threads_per_atom); +int TersoffZT::loop(const int eflag, const int vflag, const int evatom, + bool &success) { + const int nbor_pitch=this->nbor->nbor_pitch(); // re-allocate zetaij if necessary int nall = this->_nall; - if (nall*this->_max_nbors > _zetaij.cols()) { + if (nall*this->nbor->max_nbors() > _zetaij.cols()) { int _nmax=static_cast(static_cast(nall)*1.10); - _zetaij.resize(this->_max_nbors*_nmax); + _zetaij.clear(); + success = success && (_zetaij.alloc(this->nbor->max_nbors()*_nmax, + *(this->ucl_device), + UCL_READ_WRITE) == UCL_SUCCESS); + if (!success) return 0; } - nbor_pitch=this->nbor->nbor_pitch(); - GX=static_cast(ceil(static_cast(this->_ainum)/ - (BX/(JTHREADS*KTHREADS)))); - - this->k_zeta.set_size(GX,BX); - this->k_zeta.run(&this->atom->x, &ts1, &ts2, &ts3, &ts4, &ts5, &ts6, &cutsq, - &map, &elem2param, &_nelements, &_nparams, &_zetaij, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->dev_short_nbor, - &eflag, &this->_ainum, &nbor_pitch, &this->_threads_per_atom); - - ainum=this->ans->inum(); - nbor_pitch=this->nbor->nbor_pitch(); - GX=static_cast(ceil(static_cast(this->ans->inum())/ - (BX/this->_threads_per_atom))); - + // build the short neighbor list + int ainum=this->_ainum; this->time_pair.start(); - this->k_pair.set_size(GX,BX); - this->k_pair.run(&this->atom->x, &ts1, &ts2, &ts6, - &_global_e, &_global_a_0, &_global_epsilon_0, &cutsq, - &map, &elem2param, &_nelements, &_nparams, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->dev_short_nbor, - &this->ans->force, &this->ans->engv, - &eflag, &vflag, &ainum, &nbor_pitch, + + int BX=this->block_pair(); + int GX=static_cast(ceil(static_cast(ainum)/BX)); + this->k_short_nbor.set_size(GX,BX); + this->k_short_nbor.run(&this->atom->x, &cutsq_pair, &_ntypes, + &this->nbor->dev_nbor, &this->nbor->dev_packed, + &ainum, &nbor_pitch, &this->_threads_per_atom); + + #if defined(LAL_OCL_EV_JIT) + if (eflag || vflag) k_zeta_selt = &k_zeta; + else k_zeta_selt = &k_zeta_noev; + #endif + + GX=static_cast(ceil(static_cast(this->_ainum)/ + (BX/(JTHREADS*KTHREADS)))); + k_zeta_selt->set_size(GX,BX); + k_zeta_selt->run(&this->atom->x, &ts1, &ts2, &ts3, &ts4, &ts5, &ts6, + &map, &elem2param, &_nelements, &_nparams, &_zetaij, + &this->nbor->dev_nbor, &eflag, &this->_ainum, &nbor_pitch, &this->_threads_per_atom); + ainum=this->ans->inum(); BX=this->block_size(); GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/(KTHREADS*JTHREADS)))); - this->k_three_center.set_size(GX,BX); - this->k_three_center.run(&this->atom->x, &ts1, &ts2, &ts4, &cutsq, - &map, &elem2param, &_nelements, &_nparams, &_zetaij, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->dev_short_nbor, - &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, + this->k_3center_sel->set_size(GX,BX); + this->k_3center_sel->run(&this->atom->x, &ts1, &ts2, &ts4, &map, + &elem2param, &_nelements, &_nparams, &_zetaij, + &this->nbor->dev_nbor, &this->ans->force, + &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->_threads_per_atom, &evatom); Answer *end_ans; @@ -333,24 +335,35 @@ void TersoffZT::loop(const bool _eflag, const bool _vflag, const int evatom) { #endif if (evatom!=0) { this->k_three_end_vatom.set_size(GX,BX); - this->k_three_end_vatom.run(&this->atom->x, &ts1, &ts2, &ts4, &cutsq, + this->k_three_end_vatom.run(&this->atom->x, &ts1, &ts2, &ts4, &map, &elem2param, &_nelements, &_nparams, &_zetaij, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->nbor->dev_ilist, &this->dev_short_nbor, - &end_ans->force, &end_ans->engv, &eflag, &vflag, &ainum, - &nbor_pitch, &this->_threads_per_atom, &this->_gpu_nbor); + &this->nbor->dev_nbor, &this->nbor->three_ilist, + &end_ans->force, &end_ans->engv, &eflag, &vflag, + &ainum, &nbor_pitch, &this->_threads_per_atom, + &this->_gpu_nbor); } else { - this->k_three_end.set_size(GX,BX); - this->k_three_end.run(&this->atom->x, &ts1, &ts2, &ts4, &cutsq, - &map, &elem2param, &_nelements, &_nparams, &_zetaij, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->nbor->dev_ilist, &this->dev_short_nbor, - &end_ans->force, &end_ans->engv, &eflag, &vflag, &ainum, - &nbor_pitch, &this->_threads_per_atom, &this->_gpu_nbor); + this->k_3end_sel->set_size(GX,BX); + this->k_3end_sel->run(&this->atom->x, &ts1, &ts2, &ts4, &map, + &elem2param, &_nelements, &_nparams, &_zetaij, + &this->nbor->dev_nbor, &this->nbor->three_ilist, + &end_ans->force, &end_ans->engv, &eflag, &vflag, + &ainum, &nbor_pitch, &this->_threads_per_atom, + &this->_gpu_nbor); } + BX=this->block_pair(); + int GXT=static_cast(ceil(static_cast(this->ans->inum())/ + (BX/this->_threads_per_atom))); + this->k_sel->set_size(GXT,BX); + this->k_sel->run(&this->atom->x, &ts1, &ts2, &ts6, &_global_e, &_global_a_0, + &_global_epsilon_0, &map, &elem2param, &_nelements, + &_nparams, &this->nbor->dev_nbor, &this->ans->force, + &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, + &this->_threads_per_atom, &GX); + this->time_pair.stop(); + return GX; } template class TersoffZBL; diff --git a/lib/gpu/lal_tersoff_zbl.cu b/lib/gpu/lal_tersoff_zbl.cu index f631cab91f..fce1ccc406 100644 --- a/lib/gpu/lal_tersoff_zbl.cu +++ b/lib/gpu/lal_tersoff_zbl.cu @@ -48,72 +48,16 @@ _texture( ts6_tex,int4); #define TWOTHIRD (numtyp)0.66666666666666666667 -#define zeta_idx(nbor_mem, packed_mem, nbor_pitch, n_stride, t_per_atom, \ - i, nbor_j, offset_j, idx) \ - if (nbor_mem==packed_mem) { \ - int jj = (nbor_j-offset_j-2*nbor_pitch)/n_stride; \ - idx = jj*n_stride + i*t_per_atom + offset_j; \ - } else { \ - idx = nbor_j; \ - } +#if (SHUFFLE_AVAIL == 0) -#if (ARCH < 300) - -#define store_answers_p(f, energy, virial, ii, inum, tid, t_per_atom, \ - offset, eflag, vflag, ans, engv) \ - if (t_per_atom>1) { \ - __local acctyp red_acc[6][BLOCK_PAIR]; \ - red_acc[0][tid]=f.x; \ - red_acc[1][tid]=f.y; \ - red_acc[2][tid]=f.z; \ - red_acc[3][tid]=energy; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<4; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ - } \ - f.x=red_acc[0][tid]; \ - f.y=red_acc[1][tid]; \ - f.z=red_acc[2][tid]; \ - energy=red_acc[3][tid]; \ - if (vflag>0) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid]=virial[r]; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ - } \ - for (int r=0; r<6; r++) \ - virial[r]=red_acc[r][tid]; \ - } \ - } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]+=energy*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]+=virial[i]*(acctyp)0.5; \ - ei+=inum; \ - } \ - } \ - acctyp4 old=ans[ii]; \ - old.x+=f.x; \ - old.y+=f.y; \ - old.z+=f.z; \ - ans[ii]=old; \ - } +#define local_allocate_acc_zeta() \ + __local acctyp red_acc[BLOCK_PAIR]; #define acc_zeta(z, tid, t_per_atom, offset) \ if (t_per_atom>1) { \ - __local acctyp red_acc[BLOCK_PAIR]; \ red_acc[tid]=z; \ for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + simdsync(); \ if (offset < s) { \ red_acc[tid] += red_acc[tid+s]; \ } \ @@ -121,36 +65,168 @@ _texture( ts6_tex,int4); z=red_acc[tid]; \ } -#else - #define store_answers_p(f, energy, virial, ii, inum, tid, t_per_atom, \ - offset, eflag, vflag, ans, engv) \ + offset, eflag, vflag, ans, engv, ev_stride) \ if (t_per_atom>1) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - f.x += shfl_xor(f.x, s, t_per_atom); \ - f.y += shfl_xor(f.y, s, t_per_atom); \ - f.z += shfl_xor(f.z, s, t_per_atom); \ - energy += shfl_xor(energy, s, t_per_atom); \ - } \ - if (vflag>0) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - for (int r=0; r<6; r++) \ - virial[r] += shfl_xor(virial[r], s, t_per_atom); \ + simd_reduce_add3(t_per_atom, red_acc, offset, tid, f.x, f.y, f.z); \ + if (EVFLAG && (vflag==2 || eflag==2)) { \ + if (eflag) { \ + simdsync(); \ + simd_reduce_add1(t_per_atom, red_acc, offset, tid, energy); \ + } \ + if (vflag) { \ + simdsync(); \ + simd_reduce_arr(6, t_per_atom, red_acc, offset, tid, virial); \ } \ } \ } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]+=energy*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]+=virial[i]*(acctyp)0.5; \ + if (offset==0 && ii1) { \ + for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ + z += shfl_down(z, s, t_per_atom); \ + } \ + } + +#if (EVFLAG == 1) + +#define store_answers_p(f, energy, virial, ii, inum, tid, t_per_atom, \ + offset, eflag, vflag, ans, engv, ev_stride) \ + if (t_per_atom>1) { \ + simd_reduce_add3(t_per_atom, f.x, f.y, f.z); \ + if (vflag==2 || eflag==2) { \ + if (eflag) \ + simd_reduce_add1(t_per_atom,energy); \ + if (vflag) \ + simd_reduce_arr(6, t_per_atom,virial); \ + } \ + } \ + if (offset==0 && ii 1; active_subgs /= vwidth) { \ + if (active_subgs < BLOCK_SIZE_X/simd_size()) __syncthreads(); \ + if (bnum < active_subgs) { \ + if (eflag) { \ + simd_reduce_add1(vwidth, energy); \ + if (voffset==0) red_acc[6][bnum] = energy; \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (voffset==0) \ + for (int r=0; r<6; r++) red_acc[r][bnum]=virial[r]; \ + } \ + } \ + \ + __syncthreads(); \ + if (tid < active_subgs) { \ + if (eflag) energy = red_acc[6][tid]; \ + if (vflag) \ + for (int r = 0; r < 6; r++) virial[r] = red_acc[r][tid]; \ + } else { \ + if (eflag) energy = (acctyp)0; \ + if (vflag) for (int r = 0; r < 6; r++) virial[r] = (acctyp)0; \ + } \ + } \ + \ + if (bnum == 0) { \ + int ei=BLOCK_ID_X; \ + if (eflag) { \ + simd_reduce_add1(vwidth, energy); \ + if (tid==0) { \ + engv[ei]+=energy*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (tid==0) { \ + for (int r=0; r<6; r++) { \ + engv[ei]+=virial[r]*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + } \ + } \ + } else if (offset==0 && ii1) \ + simd_reduce_add3(t_per_atom, f.x, f.y, f.z); \ + if (offset==0 && ii1) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - z += shfl_xor(z, s, t_per_atom); \ - } \ - } - +#endif #endif __kernel void k_tersoff_zbl_short_nbor(const __global numtyp4 *restrict x_, - const __global int * dev_nbor, + const __global numtyp *restrict cutsq_pair, + const int ntypes, __global int * dev_nbor, const __global int * dev_packed, - __global int * dev_short_nbor, - const numtyp _cutshortsq, const int inum, const int nbor_pitch, const int t_per_atom) { - __local int n_stride; - int tid, ii, offset; - atom_info(t_per_atom,ii,tid,offset); + const int ii=GLOBAL_ID_X; + + #ifdef ONETYPE + const numtyp cutsq=cutsq_pair[ONETYPE]; + #endif if (ii cutsq[ijkparam]) continue; - numtyp4 ts1_ijkparam = ts1[ijkparam]; //fetch4(ts1_ijkparam,ijkparam,ts1_tex); numtyp ijkparam_lam3 = ts1_ijkparam.z; numtyp ijkparam_powermint = ts1_ijkparam.w; @@ -351,9 +408,6 @@ __kernel void k_tersoff_zbl_zeta(const __global numtyp4 *restrict x_, rsq1, rsq2, delr1, delr2); } - // idx to zetaij is shifted by n_stride relative to nbor_j in dev_short_nbor - int idx = nbor_j; - if (dev_packed==dev_nbor) idx -= n_stride; acc_zeta(z, tid, t_per_atom, offset_k); numtyp4 ts1_ijparam = ts1[ijparam]; //fetch4(ts1_ijparam,ijparam,ts1_tex); @@ -384,7 +438,7 @@ __kernel void k_tersoff_zbl_zeta(const __global numtyp4 *restrict x_, zij.y = fpfeng[1]; zij.z = fpfeng[2]; zij.w = z; - zetaij[idx] = zij; + zetaij[nbor_j-2*nbor_pitch] = zij; } } // for nbor @@ -397,22 +451,20 @@ __kernel void k_tersoff_zbl_repulsive(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict ts6_in, const numtyp global_e, const numtyp global_a_0, const numtyp global_epsilon_0, - const __global numtyp *restrict cutsq, const __global int *restrict map, const __global int *restrict elem2param, const int nelements, const int nparams, const __global int * dev_nbor, - const __global int * dev_packed, - const __global int * dev_short_nbor, __global acctyp4 *restrict ans, __global acctyp *restrict engv, const int eflag, const int vflag, const int inum, const int nbor_pitch, - const int t_per_atom) { - __local int n_stride; - int tid, ii, offset; + const int t_per_atom, const int ev_stride) { + int tid, ii, offset, n_stride; atom_info(t_per_atom,ii,tid,offset); + local_allocate_store_pair(); + __local numtyp4 ts1[SHARED_SIZE]; __local numtyp4 ts2[SHARED_SIZE]; __local numtyp4 ts6[SHARED_SIZE]; @@ -422,36 +474,28 @@ __kernel void k_tersoff_zbl_repulsive(const __global numtyp4 *restrict x_, ts6[tid]=ts6_in[tid]; } - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii= cutsq[ijparam]) continue; - numtyp feng[2]; numtyp ijparam_lam1 = ts1[ijparam].x; numtyp4 ts2_ijparam = ts2[ijparam]; @@ -489,9 +531,9 @@ __kernel void k_tersoff_zbl_repulsive(const __global numtyp4 *restrict x_, f.y+=dely*force; f.z+=delz*force; - if (eflag>0) + if (EVFLAG && eflag) energy+=feng[1]; - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -500,37 +542,33 @@ __kernel void k_tersoff_zbl_repulsive(const __global numtyp4 *restrict x_, virial[5] += dely*delz*force; } } // for nbor - - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii - + store_answers_p(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv,ev_stride); } __kernel void k_tersoff_zbl_three_center(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict ts1_in, const __global numtyp4 *restrict ts2_in, const __global numtyp4 *restrict ts4_in, - const __global numtyp *restrict cutsq, const __global int *restrict map, const __global int *restrict elem2param, const int nelements, const int nparams, const __global acctyp4 *restrict zetaij, const __global int * dev_nbor, - const __global int * dev_packed, - const __global int * dev_short_nbor, __global acctyp4 *restrict ans, __global acctyp *restrict engv, const int eflag, const int vflag, const int inum, const int nbor_pitch, const int t_per_atom, const int evatom) { - __local int tpa_sq, n_stride; - tpa_sq=fast_mul(t_per_atom,t_per_atom); + const int tpa_sq=fast_mul(t_per_atom,t_per_atom); numtyp lam3, powermint, bigr, bigd, c, d, h, gamma; - int tid, ii, offset; + int tid, ii, offset, n_stride; atom_info(tpa_sq,ii,tid,offset); // offset ranges from 0 to tpa_sq-1 + local_allocate_store_three(); + __local numtyp4 ts1[SHARED_SIZE]; __local numtyp4 ts2[SHARED_SIZE]; __local numtyp4 ts4[SHARED_SIZE]; @@ -540,46 +578,37 @@ __kernel void k_tersoff_zbl_three_center(const __global numtyp4 *restrict x_, ts4[tid]=ts4_in[tid]; } - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } numtyp tpainv = ucl_recip((numtyp)t_per_atom); __syncthreads(); if (ii= cutsq[ijparam]) continue; numtyp r1 = ucl_sqrt(rsq1); numtyp r1inv = ucl_rsqrt(rsq1); // look up for zeta_ij - // idx to zetaij is shifted by n_stride relative to nbor_j in dev_short_nbor - int idx = nbor_j; - if (dev_packed==dev_nbor) idx -= n_stride; - acctyp4 zeta_ij = zetaij[idx]; // fetch(zeta_ij,idx,zeta_tex); + acctyp4 zeta_ij = zetaij[nbor_j-2*nbor_pitch]; numtyp force = zeta_ij.x*tpainv; numtyp prefactor = zeta_ij.y; f.x += delr1[0]*force; f.y += delr1[1]*force; f.z += delr1[2]*force; - if (eflag>0) { + if (EVFLAG && eflag) { energy+=zeta_ij.z*tpainv; } - if (vflag>0) { + if (EVFLAG && vflag) { numtyp mforce = -force; virial[0] += delr1[0]*delr1[0]*mforce; virial[1] += delr1[1]*delr1[1]*mforce; @@ -617,14 +642,8 @@ __kernel void k_tersoff_zbl_three_center(const __global numtyp4 *restrict x_, } int nbor_k = nborj_start-offset_j+offset_k; - int k_end = nbor_end; - if (dev_packed==dev_nbor) { - int numk = dev_short_nbor[nbor_k-n_stride]; - k_end = nbor_k+fast_mul(numk,n_stride); - } - - for ( ; nbor_k cutsq[ijkparam]) continue; numtyp r2 = ucl_sqrt(rsq2); numtyp r2inv = ucl_rsqrt(rsq2); @@ -656,7 +674,7 @@ __kernel void k_tersoff_zbl_three_center(const __global numtyp4 *restrict x_, d = ts4_ijkparam.y; h = ts4_ijkparam.z; gamma = ts4_ijkparam.w; - if (vflag>0) + if (EVFLAG && vflag) attractive(bigr, bigd, powermint, lam3, c, d, h, gamma, prefactor, r1, r1inv, r2, r2inv, delr1, delr2, fi, fj, fk); else @@ -666,7 +684,7 @@ __kernel void k_tersoff_zbl_three_center(const __global numtyp4 *restrict x_, f.y += fi[1]; f.z += fi[2]; - if (vflag>0) { + if (EVFLAG && vflag) { acctyp v[6]; numtyp pre = (numtyp)2.0; if (evatom==1) pre = TWOTHIRD; @@ -682,37 +700,34 @@ __kernel void k_tersoff_zbl_three_center(const __global numtyp4 *restrict x_, } } // nbor_k } // for nbor_j - - store_answers_p(f,energy,virial,ii,inum,tid,tpa_sq, - offset,eflag,vflag,ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,tpa_sq, + offset,eflag,vflag,ans,engv); } __kernel void k_tersoff_zbl_three_end(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict ts1_in, const __global numtyp4 *restrict ts2_in, const __global numtyp4 *restrict ts4_in, - const __global numtyp *restrict cutsq, const __global int *restrict map, const __global int *restrict elem2param, const int nelements, const int nparams, const __global acctyp4 *restrict zetaij, const __global int * dev_nbor, - const __global int * dev_packed, const __global int * dev_ilist, - const __global int * dev_short_nbor, __global acctyp4 *restrict ans, __global acctyp *restrict engv, const int eflag, const int vflag, const int inum, const int nbor_pitch, const int t_per_atom, const int gpu_nbor) { - __local int tpa_sq, n_stride; - tpa_sq=fast_mul(t_per_atom,t_per_atom); + const int tpa_sq=fast_mul(t_per_atom,t_per_atom); numtyp lam3, powermint, bigr, bigd, c, d, h, gamma; - int tid, ii, offset; + int tid, ii, offset, n_stride; atom_info(tpa_sq,ii,tid,offset); + local_allocate_store_three(); + __local numtyp4 ts1[SHARED_SIZE]; __local numtyp4 ts2[SHARED_SIZE]; __local numtyp4 ts4[SHARED_SIZE]; @@ -722,23 +737,25 @@ __kernel void k_tersoff_zbl_three_end(const __global numtyp4 *restrict x_, ts4[tid]=ts4_in[tid]; } - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } - __local int ijnum_shared[BLOCK_PAIR]; + #ifdef LAL_SIMD_IP_SYNC + __local int localk[BLOCK_PAIR]; + #endif __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { energy+=zeta_ji.z*tpainv; } - if (vflag>0) { + if (EVFLAG && vflag) { numtyp mforce = -force; virial[0] += mdelr1[0]*mdelr1[0]*mforce; virial[1] += mdelr1[1]*mdelr1[1]*mforce; @@ -843,7 +841,7 @@ __kernel void k_tersoff_zbl_three_end(const __global numtyp4 *restrict x_, // attractive forces for (nbor_k = nbork_start ; nbor_k0) { + if (EVFLAG && eflag) { energy+=zeta_ji.z*tpainv; } - if (vflag>0) { + if (EVFLAG && vflag) { numtyp mforce = -force; virial[0] += mdelr1[0]*mdelr1[0]*mforce; virial[1] += mdelr1[1]*mdelr1[1]*mforce; @@ -1072,7 +1047,7 @@ __kernel void k_tersoff_zbl_three_end_vatom(const __global numtyp4 *restrict x_, // attractive forces for (nbor_k = nbork_start; nbor_k cutsq[jikparam]) continue; numtyp r2 = ucl_sqrt(rsq2); numtyp r2inv = ucl_rsqrt(rsq2); @@ -1118,10 +1092,7 @@ __kernel void k_tersoff_zbl_three_end_vatom(const __global numtyp4 *restrict x_, virial[4] += TWOTHIRD*(mdelr1[0]*fj[2] + delr2[0]*fk[2]); virial[5] += TWOTHIRD*(mdelr1[1]*fj[2] + delr2[1]*fk[2]); - // idx to zetaij is shifted by n_stride relative to nbor_k in dev_short_nbor - int idx = nbor_k; - if (dev_packed==dev_nbor) idx -= n_stride; - acctyp4 zeta_jk = zetaij[idx]; // fetch(zeta_jk,idx,zeta_tex); + acctyp4 zeta_jk = zetaij[nbor_k-2*nbor_pitch]; numtyp prefactor_jk = zeta_jk.y; int jkiparam=elem2param[jtype*nelements*nelements+ktype*nelements+itype]; @@ -1150,14 +1121,13 @@ __kernel void k_tersoff_zbl_three_end_vatom(const __global numtyp4 *restrict x_, virial[5] += TWOTHIRD*(delr2[1]*fj[2] + mdelr1[1]*fk[2]); } } // for nbor - - #ifdef THREE_CONCURRENT - store_answers(f,energy,virial,ii,inum,tid,tpa_sq,offset, - eflag,vflag,ans,engv); - #else - store_answers_p(f,energy,virial,ii,inum,tid,tpa_sq,offset, - eflag,vflag,ans,engv); - #endif } // if ii + #ifdef THREE_CONCURRENT + store_answers(f,energy,virial,ii,inum,tid,tpa_sq,offset, + eflag,vflag,ans,engv); + #else + store_answers_p(f,energy,virial,ii,inum,tid,tpa_sq,offset, + eflag,vflag,ans,engv,NUM_BLOCKS_X); + #endif } diff --git a/lib/gpu/lal_tersoff_zbl.h b/lib/gpu/lal_tersoff_zbl.h index eb03e9fb02..b82b391765 100644 --- a/lib/gpu/lal_tersoff_zbl.h +++ b/lib/gpu/lal_tersoff_zbl.h @@ -65,7 +65,7 @@ class TersoffZBL : public BaseThree { bool shared_types; /// Number of atom types - int _lj_types; + int _ntypes; /// ts1.x = lam1, ts1.y = lam2, ts1.z = lam3, ts1.w = powermint UCL_D_Vec ts1; @@ -80,7 +80,7 @@ class TersoffZBL : public BaseThree { /// ts6.x = Z_i, ts6.y = Z_j, ts6.z = ZBLcut, ts6.w = ZBLexpscale UCL_D_Vec ts6; - UCL_D_Vec cutsq; + UCL_D_Vec cutsq_pair; UCL_D_Vec elem2param; UCL_D_Vec map; @@ -91,15 +91,13 @@ class TersoffZBL : public BaseThree { /// zetaij.w = zetaij UCL_D_Vec _zetaij; - UCL_Kernel k_zeta; - UCL_Texture ts1_tex, ts2_tex, ts3_tex, ts4_tex, ts5_tex, ts6_tex; + UCL_Kernel k_zeta, k_zeta_noev, *k_zeta_selt; numtyp _global_e,_global_a_0,_global_epsilon_0; - numtyp _cutshortsq; private: bool _allocated; - void loop(const bool _eflag, const bool _vflag, const int evatom); + int loop(const int eflag, const int vflag, const int evatom, bool &success); }; } diff --git a/lib/gpu/lal_tersoff_zbl_ext.cpp b/lib/gpu/lal_tersoff_zbl_ext.cpp index d1a9e090b6..518b535627 100644 --- a/lib/gpu/lal_tersoff_zbl_ext.cpp +++ b/lib/gpu/lal_tersoff_zbl_ext.cpp @@ -70,7 +70,7 @@ int tersoff_zbl_gpu_init(const int ntypes, const int inum, const int nall, int init_ok=0; if (world_me==0) - init_ok=TSZMF.init(ntypes, inum, nall, 300, cell_size, gpu_split, screen, + init_ok=TSZMF.init(ntypes, inum, nall, max_nbors, cell_size, gpu_split, screen, host_map, nelements, host_elem2param, nparams, ts_lam1, ts_lam2, ts_lam3, ts_powermint, ts_biga, ts_bigb, ts_bigr, ts_bigd, @@ -93,7 +93,7 @@ int tersoff_zbl_gpu_init(const int ntypes, const int inum, const int nall, fflush(screen); } if (gpu_rank==i && world_me!=0) - init_ok=TSZMF.init(ntypes, inum, nall, 300, cell_size, gpu_split, screen, + init_ok=TSZMF.init(ntypes, inum, nall, max_nbors, cell_size, gpu_split, screen, host_map, nelements, host_elem2param, nparams, ts_lam1, ts_lam2, ts_lam3, ts_powermint, ts_biga, ts_bigb, ts_bigr, ts_bigd, @@ -110,7 +110,7 @@ int tersoff_zbl_gpu_init(const int ntypes, const int inum, const int nall, fprintf(screen,"\n"); if (init_ok==0) - TSZMF.estimate_gpu_overhead(); + TSZMF.estimate_gpu_overhead(1); return init_ok; } diff --git a/lib/gpu/lal_ufm.cpp b/lib/gpu/lal_ufm.cpp index a86d07f340..f6a48d4470 100644 --- a/lib/gpu/lal_ufm.cpp +++ b/lib/gpu/lal_ufm.cpp @@ -131,20 +131,9 @@ double UFMT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void UFMT::loop(const bool _eflag, const bool _vflag) { +int UFMT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -152,8 +141,8 @@ void UFMT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &uf1, &uf3, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &uf1, &uf3, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, @@ -166,6 +155,7 @@ void UFMT::loop(const bool _eflag, const bool _vflag) { &ainum, &nbor_pitch, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class UFM; diff --git a/lib/gpu/lal_ufm.cu b/lib/gpu/lal_ufm.cu index 03d1e85bdf..9d6c7b978a 100644 --- a/lib/gpu/lal_ufm.cu +++ b/lib/gpu/lal_ufm.cu @@ -40,16 +40,19 @@ __kernel void k_ufm(const __global numtyp4 *restrict x_, int tid, ii, offset; atom_info(t_per_atom,ii,tid,offset); - acctyp energy=(acctyp)0; + int n_stride; + local_allocate_store_pair(); + acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { energy += - factor_lj * uf3[mtype].x*log(1.0 - expuf) - uf3[mtype].z; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -95,9 +98,9 @@ __kernel void k_ufm(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_ufm_fast(const __global numtyp4 *restrict x_, @@ -116,26 +119,29 @@ __kernel void k_ufm_fast(const __global numtyp4 *restrict x_, __local numtyp4 uf1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 uf3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) + if (EVFLAG && eflag) uf3[tid]=uf3_in[tid]; } - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii0) { + if (EVFLAG && eflag) { energy += - factor_lj * uf3[mtype].x * log(1.0 - expuf) - uf3[mtype].z; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -181,8 +187,8 @@ __kernel void k_ufm_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } diff --git a/lib/gpu/lal_ufm.h b/lib/gpu/lal_ufm.h index 14b96bcc86..390af831ba 100644 --- a/lib/gpu/lal_ufm.h +++ b/lib/gpu/lal_ufm.h @@ -77,7 +77,7 @@ class UFM : public BaseAtomic { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_ufm_ext.cpp b/lib/gpu/lal_ufm_ext.cpp index 12809a28fb..432cbb2e63 100644 --- a/lib/gpu/lal_ufm_ext.cpp +++ b/lib/gpu/lal_ufm_ext.cpp @@ -57,7 +57,7 @@ int ufml_gpu_init(const int ntypes, double **cutsq, double **host_uf1, int init_ok=0; if (world_me==0) init_ok=UFMLMF.init(ntypes, cutsq, host_uf1, host_uf2, host_uf3, - offset, special_lj, inum, nall, 300, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); UFMLMF.device->world_barrier(); @@ -75,7 +75,7 @@ int ufml_gpu_init(const int ntypes, double **cutsq, double **host_uf1, } if (gpu_rank==i && world_me!=0) init_ok=UFMLMF.init(ntypes, cutsq, host_uf1, host_uf2, host_uf3, - offset, special_lj, inum, nall, 300, maxspecial, + offset, special_lj, inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); UFMLMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_vashishta.cpp b/lib/gpu/lal_vashishta.cpp index 4af8a0f71c..c343de3f55 100644 --- a/lib/gpu/lal_vashishta.cpp +++ b/lib/gpu/lal_vashishta.cpp @@ -50,7 +50,7 @@ int VashishtaT::init(const int ntypes, const int nlocal, const int nall, const i const double* gamma, const double* eta, const double* lam1inv, const double* lam4inv, const double* zizj, const double* mbigd, - const double* dvrc, const double* big6w, + const double* dvrc, const double* big6w, const double* heta, const double* bigh, const double* bigw, const double* c0, const double* costheta, const double* bigb, @@ -138,8 +138,6 @@ int VashishtaT::init(const int ntypes, const int nlocal, const int nall, const i dview[i].w=static_cast(r0[i]); } - _cutshortsq = static_cast(r0sqmax); - ucl_copy(param4,dview,false); param4_tex.get_texture(*(this->pair_program),"param4_tex"); param4_tex.bind_float(param4,4); @@ -212,60 +210,33 @@ double VashishtaT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void VashishtaT::loop(const bool _eflag, const bool _vflag, const int evatom) { - // Compute the block size and grid size to keep all cores busy - int BX=this->block_pair(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; +int VashishtaT::loop(const int eflag, const int vflag, const int evatom, + bool &success) { + const int nbor_pitch=this->nbor->nbor_pitch(); // build the short neighbor list int ainum=this->_ainum; - int nbor_pitch=this->nbor->nbor_pitch(); - int GX=static_cast(ceil(static_cast(ainum)/ - (BX/this->_threads_per_atom))); - - this->k_short_nbor.set_size(GX,BX); - this->k_short_nbor.run(&this->atom->x, &this->nbor->dev_nbor, - &this->_nbor_data->begin(), - &this->dev_short_nbor, &_cutshortsq, &ainum, - &nbor_pitch, &this->_threads_per_atom); - - // this->_nbor_data == nbor->dev_packed for gpu_nbor == 0 and tpa > 1 - // this->_nbor_data == nbor->dev_nbor for gpu_nbor == 1 or tpa == 1 - ainum=this->ans->inum(); - nbor_pitch=this->nbor->nbor_pitch(); - GX=static_cast(ceil(static_cast(this->ans->inum())/ - (BX/this->_threads_per_atom))); this->time_pair.start(); - // note that k_pair does not run with the short neighbor list - this->k_pair.set_size(GX,BX); - this->k_pair.run(&this->atom->x, ¶m1, ¶m2, ¶m3, ¶m4, ¶m5, - &map, &elem2param, &_nelements, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->ans->force, &this->ans->engv, - &eflag, &vflag, &ainum, &nbor_pitch, - &this->_threads_per_atom); + int BX=this->block_pair(); + int GX=static_cast(ceil(static_cast(ainum)/BX)); + this->k_short_nbor.set_size(GX,BX); + this->k_short_nbor.run(&this->atom->x, ¶m4, &map, &elem2param, + &_nelements, &_nparams, &this->nbor->dev_nbor, + &this->nbor->dev_packed, &ainum, &nbor_pitch, + &this->_threads_per_atom); + ainum=this->ans->inum(); BX=this->block_size(); GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/(KTHREADS*JTHREADS)))); - - this->k_three_center.set_size(GX,BX); - this->k_three_center.run(&this->atom->x, ¶m1, ¶m2, ¶m3, ¶m4, ¶m5, - &map, &elem2param, &_nelements, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->dev_short_nbor, - &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, + this->k_3center_sel->set_size(GX,BX); + this->k_3center_sel->run(&this->atom->x, ¶m1, ¶m2, ¶m3, ¶m4, + ¶m5, &map, &elem2param, &_nelements, + &this->nbor->dev_nbor, &this->ans->force, + &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->_threads_per_atom, &evatom); + Answer *end_ans; #ifdef THREE_CONCURRENT end_ans=this->ans2; @@ -274,23 +245,34 @@ void VashishtaT::loop(const bool _eflag, const bool _vflag, const int evatom) { #endif if (evatom!=0) { this->k_three_end_vatom.set_size(GX,BX); - this->k_three_end_vatom.run(&this->atom->x, ¶m1, ¶m2, ¶m3, ¶m4, ¶m5, - &map, &elem2param, &_nelements, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->nbor->dev_ilist, &this->dev_short_nbor, - &end_ans->force, &end_ans->engv, &eflag, &vflag, &ainum, - &nbor_pitch, &this->_threads_per_atom, &this->_gpu_nbor); + this->k_three_end_vatom.run(&this->atom->x, ¶m1, ¶m2, ¶m3, + ¶m4, ¶m5, &map, &elem2param, &_nelements, + &this->nbor->dev_nbor, &this->nbor->three_ilist, + &end_ans->force, &end_ans->engv, &eflag, &vflag, + &ainum, &nbor_pitch, &this->_threads_per_atom, + &this->_gpu_nbor); } else { - this->k_three_end.set_size(GX,BX); - this->k_three_end.run(&this->atom->x, ¶m1, ¶m2, ¶m3, ¶m4, ¶m5, - &map, &elem2param, &_nelements, - &this->nbor->dev_nbor, &this->_nbor_data->begin(), - &this->nbor->dev_ilist, &this->dev_short_nbor, - &end_ans->force, &end_ans->engv, &eflag, &vflag, &ainum, - &nbor_pitch, &this->_threads_per_atom, &this->_gpu_nbor); + this->k_3end_sel->set_size(GX,BX); + this->k_3end_sel->run(&this->atom->x, ¶m1, ¶m2, ¶m3, ¶m4, + ¶m5, &map, &elem2param, &_nelements, + &this->nbor->dev_nbor, &this->nbor->three_ilist, + &end_ans->force, &end_ans->engv, &eflag, &vflag, + &ainum, &nbor_pitch, &this->_threads_per_atom, + &this->_gpu_nbor); } + BX=this->block_pair(); + int GXT=static_cast(ceil(static_cast(this->ans->inum())/ + (BX/this->_threads_per_atom))); + // note that k_pair does not run with the short neighbor list + this->k_sel->set_size(GXT,BX); + this->k_sel->run(&this->atom->x, ¶m1, ¶m2, ¶m3, ¶m4, ¶m5, + &map, &elem2param, &_nelements, &this->nbor->dev_packed, + &this->ans->force, &this->ans->engv, &eflag, &vflag, + &ainum, &nbor_pitch, &GX); + this->time_pair.stop(); + return GX; } template class Vashishta; diff --git a/lib/gpu/lal_vashishta.cu b/lib/gpu/lal_vashishta.cu index da15aaf09a..6c9ba14b4a 100644 --- a/lib/gpu/lal_vashishta.cu +++ b/lib/gpu/lal_vashishta.cu @@ -32,6 +32,14 @@ _texture( param4_tex,int4); _texture( param5_tex,int4); #endif +#if (__CUDACC_VER_MAJOR__ >= 11) +#define param1_tex param1 +#define param2_tex param2 +#define param3_tex param3 +#define param4_tex param4 +#define param5_tex param5 +#endif + #else #define pos_tex x_ #define param1_tex param1 @@ -41,92 +49,167 @@ _texture( param5_tex,int4); #define param5_tex param5 #endif + + #define THIRD (numtyp)0.66666666666666666667 //#define THREE_CONCURRENT -#if (ARCH < 300) +#if (SHUFFLE_AVAIL == 0) -#define store_answers_p(f, energy, virial, ii, inum, tid, t_per_atom, offset, \ - eflag, vflag, ans, engv) \ +#define store_answers_p(f, energy, virial, ii, inum, tid, t_per_atom, \ + offset, eflag, vflag, ans, engv, ev_stride) \ if (t_per_atom>1) { \ - __local acctyp red_acc[6][BLOCK_ELLIPSE]; \ - red_acc[0][tid]=f.x; \ - red_acc[1][tid]=f.y; \ - red_acc[2][tid]=f.z; \ - red_acc[3][tid]=energy; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<4; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ + simd_reduce_add3(t_per_atom, red_acc, offset, tid, f.x, f.y, f.z); \ + if (EVFLAG && (vflag==2 || eflag==2)) { \ + if (eflag) { \ + simdsync(); \ + simd_reduce_add1(t_per_atom, red_acc, offset, tid, energy); \ } \ - } \ - f.x=red_acc[0][tid]; \ - f.y=red_acc[1][tid]; \ - f.z=red_acc[2][tid]; \ - energy=red_acc[3][tid]; \ - if (vflag>0) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid]=virial[r]; \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - if (offset < s) { \ - for (int r=0; r<6; r++) \ - red_acc[r][tid] += red_acc[r][tid+s]; \ - } \ + if (vflag) { \ + simdsync(); \ + simd_reduce_arr(6, t_per_atom, red_acc, offset, tid, virial); \ } \ - for (int r=0; r<6; r++) \ - virial[r]=red_acc[r][tid]; \ } \ } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]+=energy*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]+=virial[i]*(acctyp)0.5; \ - ei+=inum; \ - } \ - } \ + if (offset==0 && ii1) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - f.x += shfl_xor(f.x, s, t_per_atom); \ - f.y += shfl_xor(f.y, s, t_per_atom); \ - f.z += shfl_xor(f.z, s, t_per_atom); \ - energy += shfl_xor(energy, s, t_per_atom); \ - } \ - if (vflag>0) { \ - for (unsigned int s=t_per_atom/2; s>0; s>>=1) { \ - for (int r=0; r<6; r++) \ - virial[r] += shfl_xor(virial[r], s, t_per_atom); \ - } \ + simd_reduce_add3(t_per_atom, f.x, f.y, f.z); \ + if (vflag==2 || eflag==2) { \ + if (eflag) \ + simd_reduce_add1(t_per_atom,energy); \ + if (vflag) \ + simd_reduce_arr(6, t_per_atom,virial); \ } \ } \ - if (offset==0) { \ - int ei=ii; \ - if (eflag>0) { \ - engv[ei]+=energy*(acctyp)0.5; \ - ei+=inum; \ - } \ - if (vflag>0) { \ - for (int i=0; i<6; i++) { \ - engv[ei]+=virial[i]*(acctyp)0.5; \ + if (offset==0 && ii 1; active_subgs /= vwidth) { \ + if (active_subgs < BLOCK_SIZE_X/simd_size()) __syncthreads(); \ + if (bnum < active_subgs) { \ + if (eflag) { \ + simd_reduce_add1(vwidth, energy); \ + if (voffset==0) red_acc[6][bnum] = energy; \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (voffset==0) \ + for (int r=0; r<6; r++) red_acc[r][bnum]=virial[r]; \ + } \ + } \ + \ + __syncthreads(); \ + if (tid < active_subgs) { \ + if (eflag) energy = red_acc[6][tid]; \ + if (vflag) \ + for (int r = 0; r < 6; r++) virial[r] = red_acc[r][tid]; \ + } else { \ + if (eflag) energy = (acctyp)0; \ + if (vflag) for (int r = 0; r < 6; r++) virial[r] = (acctyp)0; \ + } \ + } \ + \ + if (bnum == 0) { \ + int ei=BLOCK_ID_X; \ + if (eflag) { \ + simd_reduce_add1(vwidth, energy); \ + if (tid==0) { \ + engv[ei]+=energy*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + if (vflag) { \ + simd_reduce_arr(6, vwidth, virial); \ + if (tid==0) { \ + for (int r=0; r<6; r++) { \ + engv[ei]+=virial[r]*(acctyp)0.5; \ + ei+=ev_stride; \ + } \ + } \ + } \ + } \ + } else if (offset==0 && ii1) \ + simd_reduce_add3(t_per_atom, f.x, f.y, f.z); \ + if (offset==0 && ii0) + if (EVFLAG && eflag) energy += (param3_bigh*reta+vc2-vc3-param3_bigw*r6inv-r*param3_dvrc+param3_c0); - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -293,11 +381,10 @@ __kernel void k_vashishta(const __global numtyp4 *restrict x_, } } } // for nbor - - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii - + const int tid=THREAD_ID_X; + store_answers_p(f,energy,virial,ii,inum,tid,1,0,eflag,vflag,ans,engv, + ev_stride); } #define threebody(delr1x, delr1y, delr1z, eflag, energy) \ @@ -344,9 +431,9 @@ __kernel void k_vashishta(const __global numtyp4 *restrict x_, fky = delr2y*(frad2+csfac2)-delr1y*facang12; \ fkz = delr2z*(frad2+csfac2)-delr1z*facang12; \ \ - if (eflag>0) \ + if (EVFLAG && eflag) \ energy+=facrad; \ - if (vflag>0) { \ + if (EVFLAG && vflag) { \ virial[0] += delr1x*fjx + delr2x*fkx; \ virial[1] += delr1y*fjy + delr2y*fky; \ virial[2] += delr1z*fjz + delr2z*fkz; \ @@ -402,54 +489,45 @@ __kernel void k_vashishta_three_center(const __global numtyp4 *restrict x_, const __global int *restrict elem2param, const int nelements, const __global int * dev_nbor, - const __global int * dev_packed, - const __global int * dev_short_nbor, __global acctyp4 *restrict ans, __global acctyp *restrict engv, const int eflag, const int vflag, const int inum, const int nbor_pitch, const int t_per_atom, const int evatom) { - __local int tpa_sq, n_stride; - tpa_sq=fast_mul(t_per_atom,t_per_atom); + int n_stride; + const int tpa_sq=fast_mul(t_per_atom,t_per_atom); numtyp param_gamma_ij, param_r0sq_ij, param_r0_ij, param_gamma_ik, param_r0sq_ik, param_r0_ik; numtyp param_costheta_ijk, param_bigc_ijk, param_bigb_ijk, param_big2b_ijk; int tid, ii, offset; atom_info(tpa_sq,ii,tid,offset); - acctyp energy=(acctyp)0; + local_allocate_store_three(); + acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } __syncthreads(); if (ii { int init(const int ntypes, const int nlocal, const int nall, const int max_nbors, const double cell_size, const double gpu_split, FILE *screen, int* host_map, const int nelements, int*** host_elem2param, const int nparams, - const double* cutsq, const double* r0, + const double* cutsq, const double* r0, const double* gamma, const double* eta, const double* lam1inv, const double* lam4inv, const double* zizj, const double* mbigd, - const double* dvrc, const double* big6w, + const double* dvrc, const double* big6w, const double* heta, const double* bigh, const double* bigw, const double* c0, const double* costheta, const double* bigb, @@ -82,13 +82,12 @@ class Vashishta : public BaseThree { UCL_D_Vec elem2param; UCL_D_Vec map; int _nparams,_nelements; - numtyp _cutshortsq; UCL_Texture param1_tex, param2_tex, param3_tex, param4_tex, param5_tex; private: bool _allocated; - void loop(const bool _eflag, const bool _vflag, const int evatom); + int loop(const int eflag, const int vflag, const int evatom, bool &success); }; diff --git a/lib/gpu/lal_vashishta_ext.cpp b/lib/gpu/lal_vashishta_ext.cpp index 56dfd8a0ff..ecbdefed19 100644 --- a/lib/gpu/lal_vashishta_ext.cpp +++ b/lib/gpu/lal_vashishta_ext.cpp @@ -32,7 +32,7 @@ int vashishta_gpu_init(const int ntypes, const int inum, const int nall, const i const double* gamma, const double* eta, const double* lam1inv, const double* lam4inv, const double* zizj, const double* mbigd, - const double* dvrc, const double* big6w, + const double* dvrc, const double* big6w, const double* heta, const double* bigh, const double* bigw, const double* c0, const double* costheta, const double* bigb, @@ -63,10 +63,10 @@ int vashishta_gpu_init(const int ntypes, const int inum, const int nall, const i int init_ok=0; if (world_me==0) - init_ok=VashishtaMF.init(ntypes, inum, nall, 500, cell_size, gpu_split, screen, + init_ok=VashishtaMF.init(ntypes, inum, nall, max_nbors, cell_size, gpu_split, screen, host_map, nelements, host_elem2param, nparams, - cutsq, r0, gamma, eta, lam1inv, - lam4inv, zizj, mbigd, dvrc, big6w, heta, bigh, bigw, + cutsq, r0, gamma, eta, lam1inv, + lam4inv, zizj, mbigd, dvrc, big6w, heta, bigh, bigw, c0, costheta, bigb, big2b, bigc); VashishtaMF.device->world_barrier(); @@ -83,10 +83,10 @@ int vashishta_gpu_init(const int ntypes, const int inum, const int nall, const i fflush(screen); } if (gpu_rank==i && world_me!=0) - init_ok=VashishtaMF.init(ntypes, inum, nall, 500, cell_size, gpu_split, screen, + init_ok=VashishtaMF.init(ntypes, inum, nall, max_nbors, cell_size, gpu_split, screen, host_map, nelements, host_elem2param, nparams, - cutsq, r0, gamma, eta, lam1inv, - lam4inv, zizj, mbigd, dvrc, big6w, heta, bigh, bigw, + cutsq, r0, gamma, eta, lam1inv, + lam4inv, zizj, mbigd, dvrc, big6w, heta, bigh, bigw, c0, costheta, bigb, big2b, bigc); VashishtaMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_yukawa.cpp b/lib/gpu/lal_yukawa.cpp index 453139e537..707f60f071 100644 --- a/lib/gpu/lal_yukawa.cpp +++ b/lib/gpu/lal_yukawa.cpp @@ -109,20 +109,9 @@ double YukawaT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void YukawaT::loop(const bool _eflag, const bool _vflag) { +int YukawaT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -130,8 +119,8 @@ void YukawaT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &coeff, &_kappa, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &coeff, &_kappa, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, @@ -144,6 +133,7 @@ void YukawaT::loop(const bool _eflag, const bool _vflag) { &ainum, &nbor_pitch, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class Yukawa; diff --git a/lib/gpu/lal_yukawa.cu b/lib/gpu/lal_yukawa.cu index 62bc013dc6..6ebd2dc06d 100644 --- a/lib/gpu/lal_yukawa.cu +++ b/lib/gpu/lal_yukawa.cu @@ -38,22 +38,25 @@ __kernel void k_yukawa(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e=coeff[mtype].x*screening*rinv; energy+=factor_lj*(e-coeff[mtype].y); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -104,9 +107,9 @@ __kernel void k_yukawa(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_yukawa_fast(const __global numtyp4 *restrict x_, @@ -124,25 +127,28 @@ __kernel void k_yukawa_fast(const __global numtyp4 *restrict x_, __local numtyp4 coeff[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) { + if (EVFLAG && eflag) { numtyp e=coeff[mtype].x*screening*rinv; energy+=factor_lj*(e-coeff[mtype].y); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -193,8 +199,8 @@ __kernel void k_yukawa_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } diff --git a/lib/gpu/lal_yukawa.h b/lib/gpu/lal_yukawa.h index 7d638d760e..51871a9728 100644 --- a/lib/gpu/lal_yukawa.h +++ b/lib/gpu/lal_yukawa.h @@ -72,7 +72,7 @@ class Yukawa : public BaseAtomic { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_yukawa_colloid.cpp b/lib/gpu/lal_yukawa_colloid.cpp index 46d4d64328..a447bb3889 100644 --- a/lib/gpu/lal_yukawa_colloid.cpp +++ b/lib/gpu/lal_yukawa_colloid.cpp @@ -133,10 +133,25 @@ double YukawaColloidT::host_memory_usage() const { template void YukawaColloidT::compute(const int f_ago, const int inum_full, const int nall, double **host_x, int *host_type, int *ilist, - int *numj, int **firstneigh, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - const double cpu_time, bool &success, double *rad) { + int *numj, int **firstneigh, const bool eflag_in, + const bool vflag_in, const bool eatom, const bool vatom, + int &host_start, const double cpu_time, bool &success, + double *rad) { this->acc_timers(); + int eflag, vflag; + if (eatom) eflag=2; + else if (eflag_in) eflag=1; + else eflag=0; + if (vatom) vflag=2; + else if (vflag_in) vflag=1; + else vflag=0; + + #ifdef LAL_NO_BLOCK_REDUCE + if (eflag) eflag=2; + if (vflag) vflag=2; + #endif + + this->set_kernel(eflag,vflag); // ------------------- Resize rad array -------------------------- @@ -177,8 +192,8 @@ void YukawaColloidT::compute(const int f_ago, const int inum_full, this->atom->add_x_data(host_x,host_type); this->add_rad_data(); - this->loop(eflag,vflag); - this->ans->copy_answers(eflag,vflag,eatom,vatom,ilist); + const int red_blocks=this->loop(eflag,vflag); + this->ans->copy_answers(eflag_in,vflag_in,eatom,vatom,ilist,red_blocks); this->device->add_ans_object(this->ans); this->hd_balancer.stop_timer(); } @@ -187,14 +202,28 @@ void YukawaColloidT::compute(const int f_ago, const int inum_full, // Reneighbor on GPU and then compute per-atom densities // --------------------------------------------------------------------------- template -int** YukawaColloidT::compute(const int ago, const int inum_full, const int nall, - double **host_x, int *host_type, double *sublo, +int** YukawaColloidT::compute(const int ago, const int inum_full, + const int nall, double **host_x, int *host_type, double *sublo, double *subhi, tagint *tag, int **nspecial, - tagint **special, const bool eflag, const bool vflag, + tagint **special, const bool eflag_in, const bool vflag_in, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, bool &success, double *rad) { this->acc_timers(); + int eflag, vflag; + if (eatom) eflag=2; + else if (eflag_in) eflag=1; + else eflag=0; + if (vatom) vflag=2; + else if (vflag_in) vflag=1; + else vflag=0; + + #ifdef LAL_NO_BLOCK_REDUCE + if (eflag) eflag=2; + if (vflag) vflag=2; + #endif + + this->set_kernel(eflag,vflag); // ------------------- Resize rad array ---------------------------- @@ -240,8 +269,8 @@ int** YukawaColloidT::compute(const int ago, const int inum_full, const int nall *ilist=this->nbor->host_ilist.begin(); *jnum=this->nbor->host_acc.begin(); - this->loop(eflag,vflag); - this->ans->copy_answers(eflag,vflag,eatom,vatom); + const int red_blocks=this->loop(eflag,vflag); + this->ans->copy_answers(eflag_in,vflag_in,eatom,vatom,red_blocks); this->device->add_ans_object(this->ans); this->hd_balancer.stop_timer(); @@ -252,20 +281,9 @@ int** YukawaColloidT::compute(const int ago, const int inum_full, const int nall // Calculate per-atom energies and forces // --------------------------------------------------------------------------- template -void YukawaColloidT::loop(const bool _eflag, const bool _vflag) { +int YukawaColloidT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -273,8 +291,8 @@ void YukawaColloidT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &c_rad, &coeff, &sp_lj, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &c_rad, &coeff, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->_threads_per_atom, &_kappa); @@ -286,6 +304,7 @@ void YukawaColloidT::loop(const bool _eflag, const bool _vflag) { &ainum, &nbor_pitch, &this->_threads_per_atom, &_kappa); } this->time_pair.stop(); + return GX; } template class YukawaColloid; diff --git a/lib/gpu/lal_yukawa_colloid.cu b/lib/gpu/lal_yukawa_colloid.cu index 30b458fec7..847ffa6d80 100644 --- a/lib/gpu/lal_yukawa_colloid.cu +++ b/lib/gpu/lal_yukawa_colloid.cu @@ -24,6 +24,10 @@ _texture_2d( pos_tex,int4); _texture( rad_tex,int2); #endif +#if (__CUDACC_VER_MAJOR__ >= 11) +#define rad_tex rad_ +#endif + #else #define pos_tex x_ #define rad_tex rad_ @@ -45,22 +49,25 @@ __kernel void k_yukawa_colloid(const __global numtyp4 *restrict x_, atom_info(t_per_atom,ii,tid,offset); __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + sp_lj[0]=sp_lj_in[0]; sp_lj[1]=sp_lj_in[1]; sp_lj[2]=sp_lj_in[2]; sp_lj[3]=sp_lj_in[3]; - acctyp energy=(acctyp)0; acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e=coeff[mtype].x/kappa * screening; energy+=factor_lj*(e-coeff[mtype].y); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -113,9 +120,9 @@ __kernel void k_yukawa_colloid(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_yukawa_colloid_fast(const __global numtyp4 *restrict x_, @@ -134,25 +141,28 @@ __kernel void k_yukawa_colloid_fast(const __global numtyp4 *restrict x_, __local numtyp4 coeff[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp sp_lj[4]; + int n_stride; + local_allocate_store_pair(); + if (tid<4) sp_lj[tid]=sp_lj_in[tid]; if (tid0) { + if (EVFLAG && eflag) { numtyp e=coeff[mtype].x/kappa * screening; energy+=factor_lj*(e-coeff[mtype].y); } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -205,8 +215,7 @@ __kernel void k_yukawa_colloid_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } - diff --git a/lib/gpu/lal_yukawa_colloid.h b/lib/gpu/lal_yukawa_colloid.h index 607bc42321..a08248dd3a 100644 --- a/lib/gpu/lal_yukawa_colloid.h +++ b/lib/gpu/lal_yukawa_colloid.h @@ -114,7 +114,7 @@ class YukawaColloid : public BaseAtomic { private: bool _shared_view; bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_yukawa_colloid_ext.cpp b/lib/gpu/lal_yukawa_colloid_ext.cpp index 988d33bdd6..db86f91689 100644 --- a/lib/gpu/lal_yukawa_colloid_ext.cpp +++ b/lib/gpu/lal_yukawa_colloid_ext.cpp @@ -55,7 +55,7 @@ int ykcolloid_gpu_init(const int ntypes, double **cutsq, double **host_a, int init_ok=0; if (world_me==0) init_ok=YKCOLLMF.init(ntypes, cutsq, host_a, host_offset, special_lj, - inum, nall, 300, maxspecial, cell_size, gpu_split, + inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, kappa); YKCOLLMF.device->world_barrier(); @@ -73,7 +73,7 @@ int ykcolloid_gpu_init(const int ntypes, double **cutsq, double **host_a, } if (gpu_rank==i && world_me!=0) init_ok=YKCOLLMF.init(ntypes, cutsq, host_a, host_offset, special_lj, - inum, nall, 300, maxspecial, cell_size, gpu_split, + inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen, kappa); YKCOLLMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_yukawa_ext.cpp b/lib/gpu/lal_yukawa_ext.cpp index 995694bdfd..cf2bf89e3d 100644 --- a/lib/gpu/lal_yukawa_ext.cpp +++ b/lib/gpu/lal_yukawa_ext.cpp @@ -55,7 +55,7 @@ int yukawa_gpu_init(const int ntypes, double **cutsq, double kappa, int init_ok=0; if (world_me==0) init_ok=YKMF.init(ntypes, cutsq, kappa, host_a, offset, special_lj, - inum, nall, 300, maxspecial, cell_size, + inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); YKMF.device->world_barrier(); @@ -73,7 +73,7 @@ int yukawa_gpu_init(const int ntypes, double **cutsq, double kappa, } if (gpu_rank==i && world_me!=0) init_ok=YKMF.init(ntypes, cutsq, kappa, host_a, offset, special_lj, - inum, nall, 300, maxspecial, cell_size, + inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); YKMF.device->gpu_barrier(); diff --git a/lib/gpu/lal_zbl.cpp b/lib/gpu/lal_zbl.cpp index 2bf3369174..885f6f10bb 100644 --- a/lib/gpu/lal_zbl.cpp +++ b/lib/gpu/lal_zbl.cpp @@ -118,20 +118,9 @@ double ZBLT::host_memory_usage() const { // Calculate energies, forces, and torques // --------------------------------------------------------------------------- template -void ZBLT::loop(const bool _eflag, const bool _vflag) { +int ZBLT::loop(const int eflag, const int vflag) { // Compute the block size and grid size to keep all cores busy const int BX=this->block_size(); - int eflag, vflag; - if (_eflag) - eflag=1; - else - eflag=0; - - if (_vflag) - vflag=1; - else - vflag=0; - int GX=static_cast(ceil(static_cast(this->ans->inum())/ (BX/this->_threads_per_atom))); @@ -139,8 +128,8 @@ void ZBLT::loop(const bool _eflag, const bool _vflag) { int nbor_pitch=this->nbor->nbor_pitch(); this->time_pair.start(); if (shared_types) { - this->k_pair_fast.set_size(GX,BX); - this->k_pair_fast.run(&this->atom->x, &coeff1, &coeff2, &coeff3, + this->k_pair_sel->set_size(GX,BX); + this->k_pair_sel->run(&this->atom->x, &coeff1, &coeff2, &coeff3, &_cut_globalsq, &_cut_innersq, &_cut_inner, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, @@ -154,6 +143,7 @@ void ZBLT::loop(const bool _eflag, const bool _vflag) { &ainum, &nbor_pitch, &this->_threads_per_atom); } this->time_pair.stop(); + return GX; } template class ZBL; diff --git a/lib/gpu/lal_zbl.cu b/lib/gpu/lal_zbl.cu index 2539c0ddd7..09e1b4f6bb 100644 --- a/lib/gpu/lal_zbl.cu +++ b/lib/gpu/lal_zbl.cu @@ -95,17 +95,20 @@ __kernel void k_zbl(const __global numtyp4 *restrict x_, int tid, ii, offset; atom_info(t_per_atom,ii,tid,offset); - acctyp energy=(acctyp)0; + int n_stride; + local_allocate_store_pair(); + acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; - acctyp virial[6]; - for (int i=0; i<6; i++) - virial[i]=(acctyp)0; + acctyp energy, virial[6]; + if (EVFLAG) { + energy=(acctyp)0; + for (int i=0; i<6; i++) virial[i]=(acctyp)0; + } if (ii0) { + if (EVFLAG && eflag) { numtyp e=e_zbl(r, coeff2[mtype].x, coeff2[mtype].y, coeff2[mtype].z, coeff2[mtype].w, coeff1[mtype].z); e += coeff3[mtype].z; @@ -151,7 +154,7 @@ __kernel void k_zbl(const __global numtyp4 *restrict x_, } energy+=e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -162,9 +165,9 @@ __kernel void k_zbl(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } __kernel void k_zbl_fast(const __global numtyp4 *restrict x_, @@ -186,25 +189,28 @@ __kernel void k_zbl_fast(const __global numtyp4 *restrict x_, __local numtyp4 coeff1[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 coeff2[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; __local numtyp4 coeff3[MAX_SHARED_TYPES*MAX_SHARED_TYPES]; + int n_stride; + local_allocate_store_pair(); + if (tid0) { + if (EVFLAG && eflag) { numtyp e=e_zbl(r, coeff2[mtype].x, coeff2[mtype].y, coeff2[mtype].z, coeff2[mtype].w, coeff1[mtype].z); e += coeff3[mtype].z; @@ -251,7 +257,7 @@ __kernel void k_zbl_fast(const __global numtyp4 *restrict x_, } energy+=e; } - if (vflag>0) { + if (EVFLAG && vflag) { virial[0] += delx*delx*force; virial[1] += dely*dely*force; virial[2] += delz*delz*force; @@ -262,8 +268,8 @@ __kernel void k_zbl_fast(const __global numtyp4 *restrict x_, } } // for nbor - store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, - ans,engv); } // if ii + store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag, + ans,engv); } diff --git a/lib/gpu/lal_zbl.h b/lib/gpu/lal_zbl.h index e205d326c6..af4f1b2eac 100644 --- a/lib/gpu/lal_zbl.h +++ b/lib/gpu/lal_zbl.h @@ -76,7 +76,7 @@ class ZBL : public BaseAtomic { private: bool _allocated; - void loop(const bool _eflag, const bool _vflag); + int loop(const int eflag, const int vflag); }; } diff --git a/lib/gpu/lal_zbl_ext.cpp b/lib/gpu/lal_zbl_ext.cpp index f15e814a50..ee7794af2d 100644 --- a/lib/gpu/lal_zbl_ext.cpp +++ b/lib/gpu/lal_zbl_ext.cpp @@ -58,7 +58,7 @@ int zbl_gpu_init(const int ntypes, double **cutsq, double **host_sw1, init_ok=ZBLMF.init(ntypes, cutsq, host_sw1, host_sw2, host_sw3, host_sw4, host_sw5, host_d1a, host_d2a, host_d3a, host_d4a, host_zze, cut_globalsq, cut_innersq, cut_inner, - inum, nall, 300, maxspecial, cell_size, gpu_split, screen); + inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); ZBLMF.device->world_barrier(); if (message) @@ -77,7 +77,7 @@ int zbl_gpu_init(const int ntypes, double **cutsq, double **host_sw1, init_ok=ZBLMF.init(ntypes, cutsq, host_sw1, host_sw2, host_sw3, host_sw4, host_sw5, host_d1a, host_d2a, host_d3a, host_d4a, host_zze, cut_globalsq, cut_innersq, cut_inner, - inum, nall, 300, maxspecial, cell_size, gpu_split, screen); + inum, nall, max_nbors, maxspecial, cell_size, gpu_split, screen); ZBLMF.device->gpu_barrier(); if (message) diff --git a/src/GPU/Install.sh b/src/GPU/Install.sh index 1fefb01d42..1767623314 100755 --- a/src/GPU/Install.sh +++ b/src/GPU/Install.sh @@ -30,6 +30,16 @@ action () { action fix_gpu.cpp action fix_gpu.h +action fix_nve_gpu.h +action fix_nve_gpu.cpp +action fix_nh_gpu.h +action fix_nh_gpu.cpp +action fix_nvt_gpu.h +action fix_nvt_gpu.cpp +action fix_npt_gpu.h +action fix_npt_gpu.cpp +action fix_nve_asphere_gpu.h fix_nve_asphere.h +action fix_nve_asphere_gpu.cpp fix_nve_asphere.cpp action gpu_extra.h action pair_beck_gpu.cpp action pair_beck_gpu.h @@ -83,6 +93,8 @@ action pair_lj96_cut_gpu.cpp action pair_lj96_cut_gpu.h action pair_lj_charmm_coul_long_gpu.cpp pair_lj_charmm_coul_long.cpp action pair_lj_charmm_coul_long_gpu.h pair_lj_charmm_coul_long.cpp +action pair_lj_charmm_coul_charmm_gpu.cpp pair_lj_charmm_coul_charmm.cpp +action pair_lj_charmm_coul_charmm_gpu.h pair_lj_charmm_coul_charmm.cpp action pair_lj_class2_coul_long_gpu.cpp pair_lj_class2_coul_long.cpp action pair_lj_class2_coul_long_gpu.h pair_lj_class2_coul_long.cpp action pair_lj_class2_gpu.cpp pair_lj_class2.cpp @@ -159,6 +171,7 @@ if (test $1 = 1) then sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(gpu_SYSINC) |' ../Makefile.package sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(gpu_SYSLIB) |' ../Makefile.package sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(gpu_SYSPATH) |' ../Makefile.package + sed -i -e 's|^PKG_INC =[ \t]*|&-DLMP_GPU |' ../Makefile.package fi if (test -e ../Makefile.package.settings) then diff --git a/src/GPU/fix_gpu.cpp b/src/GPU/fix_gpu.cpp index 8f88dfd61d..efbaa6e1f8 100644 --- a/src/GPU/fix_gpu.cpp +++ b/src/GPU/fix_gpu.cpp @@ -15,6 +15,7 @@ #include #include "atom.h" +#include "comm.h" #include "force.h" #include "pair.h" #include "pair_hybrid.h" @@ -38,14 +39,19 @@ using namespace FixConst; enum{GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH}; extern int lmp_init_device(MPI_Comm world, MPI_Comm replica, - const int first_gpu, const int last_gpu, + const int ngpu, const int first_gpu_id, const int gpu_mode, const double particle_split, const int nthreads, const int t_per_atom, - const double cell_size, char *opencl_flags, + const double cell_size, char *opencl_args, + const int ocl_platform, char *device_type_flags, const int block_pair); extern void lmp_clear_device(); extern double lmp_gpu_forces(double **f, double **tor, double *eatom, - double **vatom, double *virial, double &ecoul); + double **vatom, double *virial, double &ecoul, + int &err_flag); +extern double lmp_gpu_update_bin_size(const double subx, const double suby, + const double subz, const int nlocal, + const double cut); static const char cite_gpu_package[] = "GPU package (short-range, long-range and three-body potentials):\n\n" @@ -105,10 +111,13 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : if (narg < 4) error->all(FLERR,"Illegal package gpu command"); + // If ngpu is 0, autoset ngpu to the number of devices per node matching + // best device int ngpu = atoi(arg[3]); - if (ngpu <= 0) error->all(FLERR,"Illegal package gpu command"); - int first_gpu = 0; - int last_gpu = ngpu-1; + if (ngpu < 0) error->all(FLERR,"Illegal package gpu command"); + + // Negative value indicate GPU package should find the best device ID + int first_gpu_id = -1; // options @@ -118,9 +127,11 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : int newtonflag = 0; int threads_per_atom = -1; double binsize = 0.0; - char *opencl_flags = nullptr; + char *opencl_args = nullptr; int block_pair = -1; int pair_only_flag = 0; + int ocl_platform = -1; + char *device_type_flags = nullptr; int iarg = 4; while (iarg < narg) { @@ -149,10 +160,9 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal package GPU command"); iarg += 2; } else if (strcmp(arg[iarg],"gpuID") == 0) { - if (iarg+3 > narg) error->all(FLERR,"Illegal package gpu command"); - first_gpu = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - last_gpu = utils::inumeric(FLERR,arg[iarg+2],false,lmp); - iarg += 3; + if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); + first_gpu_id = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + iarg += 2; } else if (strcmp(arg[iarg],"tpa") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); threads_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); @@ -162,9 +172,13 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : nthreads = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nthreads < 1) error->all(FLERR,"Illegal fix GPU command"); iarg += 2; - } else if (strcmp(arg[iarg],"device") == 0) { + } else if (strcmp(arg[iarg],"platform") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); - opencl_flags = arg[iarg+1]; + ocl_platform = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + iarg += 2; + } else if (strcmp(arg[iarg],"device_type") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); + device_type_flags = arg[iarg+1]; iarg += 2; } else if (strcmp(arg[iarg],"blocksize") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); @@ -176,10 +190,14 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[iarg+1],"on") == 0) pair_only_flag = 1; else error->all(FLERR,"Illegal package gpu command"); iarg += 2; + } else if (strcmp(arg[iarg],"ocl_args") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); + opencl_args = arg[iarg+1]; + iarg += 2; } else error->all(FLERR,"Illegal package gpu command"); } - #ifndef _OPENMP + #if (LAL_USE_OMP == 0) if (nthreads > 1) error->all(FLERR,"No OpenMP support compiled in"); #endif @@ -207,10 +225,11 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : // change binsize default (0.0) to -1.0 used by GPU lib if (binsize == 0.0) binsize = -1.0; - int gpu_flag = lmp_init_device(universe->uworld, world, first_gpu, last_gpu, + _binsize = binsize; + int gpu_flag = lmp_init_device(universe->uworld, world, ngpu, first_gpu_id, _gpu_mode, _particle_split, nthreads, - threads_per_atom, binsize, opencl_flags, - block_pair); + threads_per_atom, binsize, opencl_args, + ocl_platform, device_type_flags, block_pair); GPU_EXTRA::check_flag(gpu_flag,error,world); } @@ -296,9 +315,15 @@ void FixGPU::post_force(int /* vflag */) timer->stamp(); double lvirial[6]; for (int i = 0; i < 6; i++) lvirial[i] = 0.0; + int err_flag; double my_eng = lmp_gpu_forces(atom->f, atom->torque, force->pair->eatom, force->pair->vatom, lvirial, - force->pair->eng_coul); + force->pair->eng_coul, err_flag); + if (err_flag) { + if (err_flag==1) + error->one(FLERR, + "Too many neighbors on GPU. Use neigh_modify one to increase limit."); + } force->pair->eng_vdwl += my_eng; force->pair->virial[0] += lvirial[0]; @@ -335,3 +360,12 @@ double FixGPU::memory_usage() return bytes; } +double FixGPU::binsize(const double subx, const double suby, + const double subz, const int nlocal, + const double cut) { + if (_binsize > 0.0) return _binsize; + else if (_gpu_mode == GPU_FORCE || comm->cutghostuser) + return cut * 0.5; + else + return lmp_gpu_update_bin_size(subx, suby, subz, nlocal, cut); +} diff --git a/src/GPU/fix_gpu.h b/src/GPU/fix_gpu.h index ba0b4c83cb..29a0907915 100644 --- a/src/GPU/fix_gpu.h +++ b/src/GPU/fix_gpu.h @@ -37,10 +37,14 @@ class FixGPU : public Fix { void post_force_respa(int, int, int); double memory_usage(); + double binsize(const double subx, const double suby, + const double subz, const int nlocal, const double cut); + private: int _gpu_mode; int _nlevels_respa; double _particle_split; + double _binsize; }; } @@ -78,4 +82,11 @@ E: Cannot use neigh_modify exclude with GPU neighbor builds This is a current limitation of the GPU implementation in LAMMPS. +E: Too many neighbors on GPU. Use neigh_modify one to increase limit. + +The expected maximum number of neighbors is determined in the GPU package +automatically. This error means the actual number of neighbors is exceeding +the expected value. Use neigh_modify one command to increase GPU allocations +(e.g. doubling this value doubles the GPU allocation). + */ diff --git a/src/GPU/fix_nh_gpu.cpp b/src/GPU/fix_nh_gpu.cpp new file mode 100644 index 0000000000..8b57289a50 --- /dev/null +++ b/src/GPU/fix_nh_gpu.cpp @@ -0,0 +1,552 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://lammps.sandia.gov/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: W. Michael Brown (Intel) +------------------------------------------------------------------------- */ + +#include "fix_nh_gpu.h" + +#include "atom.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "gpu_extra.h" +#include "memory.h" +#include "modify.h" +#include "neighbor.h" +#include "update.h" + +#include +#include + +using namespace LAMMPS_NS; +using namespace FixConst; + +#define TILTMAX 1.5 + +enum{NOBIAS,BIAS}; +enum{ISO,ANISO,TRICLINIC}; + +typedef struct { double x,y,z; } dbl3_t; + +/* ---------------------------------------------------------------------- + NVT,NPH,NPT integrators for improved Nose-Hoover equations of motion + ---------------------------------------------------------------------- */ + +FixNHGPU::FixNHGPU(LAMMPS *lmp, int narg, char **arg) : + FixNH(lmp, narg, arg) +{ + _dtfm = 0; + _nlocal3 = 0; + _nlocal_max = 0; +} + +/* ---------------------------------------------------------------------- */ + +FixNHGPU::~FixNHGPU() +{ +} + +/* ---------------------------------------------------------------------- */ + +void FixNHGPU::setup(int vflag) +{ + FixNH::setup(vflag); + if (strstr(update->integrate_style,"respa")) + _respa_on = 1; + else + _respa_on = 0; + reset_dt(); +} + +/* ---------------------------------------------------------------------- + change box size + remap all atoms or dilate group atoms depending on allremap flag + if rigid bodies exist, scale rigid body centers-of-mass +------------------------------------------------------------------------- */ + +void FixNHGPU::remap() +{ + if (_respa_on) { FixNH::remap(); return; } + + double oldlo,oldhi; + double expfac; + + dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; + int *mask = atom->mask; + int nlocal = atom->nlocal; + double *h = domain->h; + + // omega is not used, except for book-keeping + + for (int i = 0; i < 6; i++) omega[i] += dto*omega_dot[i]; + + // convert pertinent atoms and rigid bodies to lamda coords + const double hi0 = domain->h_inv[0]; + const double hi1 = domain->h_inv[1]; + const double hi2 = domain->h_inv[2]; + const double hi3 = domain->h_inv[3]; + const double hi4 = domain->h_inv[4]; + const double hi5 = domain->h_inv[5]; + const double b0 = domain->boxlo[0]; + const double b1 = domain->boxlo[1]; + const double b2 = domain->boxlo[2]; + + if (allremap) { + #if (LAL_USE_OMP == 1) && (LAL_USE_OMP_SIMD == 1) + #pragma omp parallel for simd schedule(static) + #elif (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = 0; i < nlocal; i++) { + const double d0 = x[i].x - b0; + const double d1 = x[i].y - b1; + const double d2 = x[i].z - b2; + x[i].x = hi0*d0 + hi5*d1 + hi4*d2; + x[i].y = hi1*d1 + hi3*d2; + x[i].z = hi2*d2; + } + } else { + #if (LAL_USE_OMP == 1) && (LAL_USE_OMP_SIMD == 1) + #pragma omp parallel for simd schedule(static) + #elif (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = 0; i < nlocal; i++) { + if (mask[i] & dilate_group_bit) { + const double d0 = x[i].x - b0; + const double d1 = x[i].y - b1; + const double d2 = x[i].z - b2; + x[i].x = hi0*d0 + hi5*d1 + hi4*d2; + x[i].y = hi1*d1 + hi3*d2; + x[i].z = hi2*d2; + } + } + } + + if (nrigid) + for (int i = 0; i < nrigid; i++) + modify->fix[rfix[i]]->deform(0); + + // reset global and local box to new size/shape + + // this operation corresponds to applying the + // translate and scale operations + // corresponding to the solution of the following ODE: + // + // h_dot = omega_dot * h + // + // where h_dot, omega_dot and h are all upper-triangular + // 3x3 tensors. In Voigt notation, the elements of the + // RHS product tensor are: + // h_dot = [0*0, 1*1, 2*2, 1*3+3*2, 0*4+5*3+4*2, 0*5+5*1] + // + // Ordering of operations preserves time symmetry. + + double dto2 = dto/2.0; + double dto4 = dto/4.0; + double dto8 = dto/8.0; + + // off-diagonal components, first half + + if (pstyle == TRICLINIC) { + + if (p_flag[4]) { + expfac = exp(dto8*omega_dot[0]); + h[4] *= expfac; + h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]); + h[4] *= expfac; + } + + if (p_flag[3]) { + expfac = exp(dto4*omega_dot[1]); + h[3] *= expfac; + h[3] += dto2*(omega_dot[3]*h[2]); + h[3] *= expfac; + } + + if (p_flag[5]) { + expfac = exp(dto4*omega_dot[0]); + h[5] *= expfac; + h[5] += dto2*(omega_dot[5]*h[1]); + h[5] *= expfac; + } + + if (p_flag[4]) { + expfac = exp(dto8*omega_dot[0]); + h[4] *= expfac; + h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]); + h[4] *= expfac; + } + } + + // scale diagonal components + // scale tilt factors with cell, if set + + if (p_flag[0]) { + oldlo = domain->boxlo[0]; + oldhi = domain->boxhi[0]; + expfac = exp(dto*omega_dot[0]); + domain->boxlo[0] = (oldlo-fixedpoint[0])*expfac + fixedpoint[0]; + domain->boxhi[0] = (oldhi-fixedpoint[0])*expfac + fixedpoint[0]; + } + + if (p_flag[1]) { + oldlo = domain->boxlo[1]; + oldhi = domain->boxhi[1]; + expfac = exp(dto*omega_dot[1]); + domain->boxlo[1] = (oldlo-fixedpoint[1])*expfac + fixedpoint[1]; + domain->boxhi[1] = (oldhi-fixedpoint[1])*expfac + fixedpoint[1]; + if (scalexy) h[5] *= expfac; + } + + if (p_flag[2]) { + oldlo = domain->boxlo[2]; + oldhi = domain->boxhi[2]; + expfac = exp(dto*omega_dot[2]); + domain->boxlo[2] = (oldlo-fixedpoint[2])*expfac + fixedpoint[2]; + domain->boxhi[2] = (oldhi-fixedpoint[2])*expfac + fixedpoint[2]; + if (scalexz) h[4] *= expfac; + if (scaleyz) h[3] *= expfac; + } + + // off-diagonal components, second half + + if (pstyle == TRICLINIC) { + + if (p_flag[4]) { + expfac = exp(dto8*omega_dot[0]); + h[4] *= expfac; + h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]); + h[4] *= expfac; + } + + if (p_flag[3]) { + expfac = exp(dto4*omega_dot[1]); + h[3] *= expfac; + h[3] += dto2*(omega_dot[3]*h[2]); + h[3] *= expfac; + } + + if (p_flag[5]) { + expfac = exp(dto4*omega_dot[0]); + h[5] *= expfac; + h[5] += dto2*(omega_dot[5]*h[1]); + h[5] *= expfac; + } + + if (p_flag[4]) { + expfac = exp(dto8*omega_dot[0]); + h[4] *= expfac; + h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]); + h[4] *= expfac; + } + + } + + domain->yz = h[3]; + domain->xz = h[4]; + domain->xy = h[5]; + + // tilt factor to cell length ratio can not exceed TILTMAX in one step + + if (domain->yz < -TILTMAX*domain->yprd || + domain->yz > TILTMAX*domain->yprd || + domain->xz < -TILTMAX*domain->xprd || + domain->xz > TILTMAX*domain->xprd || + domain->xy < -TILTMAX*domain->xprd || + domain->xy > TILTMAX*domain->xprd) + error->all(FLERR,"Fix npt/nph has tilted box too far in one step - " + "periodic cell is too far from equilibrium state"); + + domain->set_global_box(); + domain->set_local_box(); + + // convert pertinent atoms and rigid bodies back to box coords + const double h0 = domain->h[0]; + const double h1 = domain->h[1]; + const double h2 = domain->h[2]; + const double h3 = domain->h[3]; + const double h4 = domain->h[4]; + const double h5 = domain->h[5]; + const double nb0 = domain->boxlo[0]; + const double nb1 = domain->boxlo[1]; + const double nb2 = domain->boxlo[2]; + + if (allremap) { + #if (LAL_USE_OMP == 1) && (LAL_USE_OMP_SIMD == 1) + #pragma omp parallel for simd schedule(static) + #elif (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = 0; i < nlocal; i++) { + x[i].x = h0*x[i].x + h5*x[i].y + h4*x[i].z + nb0; + x[i].y = h1*x[i].y + h3*x[i].z + nb1; + x[i].z = h2*x[i].z + nb2; + } + } else { + #if (LAL_USE_OMP == 1) && (LAL_USE_OMP_SIMD == 1) + #pragma omp parallel for simd schedule(static) + #elif (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = 0; i < nlocal; i++) { + if (mask[i] & dilate_group_bit) { + x[i].x = h0*x[i].x + h5*x[i].y + h4*x[i].z + nb0; + x[i].y = h1*x[i].y + h3*x[i].z + nb1; + x[i].z = h2*x[i].z + nb2; + } + } + } + + if (nrigid) + for (int i = 0; i < nrigid; i++) + modify->fix[rfix[i]]->deform(1); +} + +/* ---------------------------------------------------------------------- + 2nd half of Verlet update +------------------------------------------------------------------------- */ + +void FixNHGPU::final_integrate() { + if (neighbor->ago == 0 && _respa_on == 0) reset_dt(); + FixNH::final_integrate(); +} + +/* ---------------------------------------------------------------------- */ + +void FixNHGPU::reset_dt() +{ + if (_respa_on) { FixNH::reset_dt(); return; } + dtv = update->dt; + dtf = 0.5 * update->dt * force->ftm2v; + dthalf = 0.5 * update->dt; + dt4 = 0.25 * update->dt; + dt8 = 0.125 * update->dt; + dto = dthalf; + + if (pstat_flag) + pdrag_factor = 1.0 - (update->dt * p_freq_max * drag / nc_pchain); + + if (tstat_flag) + tdrag_factor = 1.0 - (update->dt * t_freq * drag / nc_tchain); + + const int * const mask = atom->mask; + const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : + atom->nlocal; + + if (nlocal > _nlocal_max) { + if (_nlocal_max) memory->destroy(_dtfm); + _nlocal_max = static_cast(1.20 * nlocal); + memory->create(_dtfm, _nlocal_max * 3, "fix_nh_gpu:dtfm"); + } + + _nlocal3 = nlocal * 3; + + if (igroup == 0) { + if (atom->rmass) { + const double * const rmass = atom->rmass; + int n = 0; + for (int i = 0; i < nlocal; i++) { + const double dtfir = dtf / rmass[i]; + _dtfm[n++] = dtfir; + _dtfm[n++] = dtfir; + _dtfm[n++] = dtfir; + } + } else { + const double * const mass = atom->mass; + const int * const type = atom->type; + int n = 0; + for (int i = 0; i < nlocal; i++) { + const double dtfim = dtf / mass[type[i]]; + _dtfm[n++] = dtfim; + _dtfm[n++] = dtfim; + _dtfm[n++] = dtfim; + } + } + } else { + if (atom->rmass) { + const double * const rmass = atom->rmass; + int n = 0; + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + const double dtfir = dtf / rmass[i]; + _dtfm[n++] = dtfir; + _dtfm[n++] = dtfir; + _dtfm[n++] = dtfir; + } else { + _dtfm[n++] = 0.0; + _dtfm[n++] = 0.0; + _dtfm[n++] = 0.0; + } + } else { + const double * const mass = atom->mass; + const int * const type = atom->type; + int n = 0; + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + const double dtfim = dtf / mass[type[i]]; + _dtfm[n++] = dtfim; + _dtfm[n++] = dtfim; + _dtfm[n++] = dtfim; + } else { + _dtfm[n++] = 0.0; + _dtfm[n++] = 0.0; + _dtfm[n++] = 0.0; + } + } + } +} + +/* ---------------------------------------------------------------------- + perform half-step barostat scaling of velocities +-----------------------------------------------------------------------*/ + +void FixNHGPU::nh_v_press() +{ + if (pstyle == TRICLINIC || which == BIAS || _respa_on) { + FixNH::nh_v_press(); + return; + } + + dbl3_t * _noalias const v = (dbl3_t *)atom->v[0]; + int *mask = atom->mask; + int nlocal = atom->nlocal; + if (igroup == atom->firstgroup) nlocal = atom->nfirst; + + double f0 = exp(-dt4*(omega_dot[0]+mtk_term2)); + double f1 = exp(-dt4*(omega_dot[1]+mtk_term2)); + double f2 = exp(-dt4*(omega_dot[2]+mtk_term2)); + f0 *= f0; + f1 *= f1; + f2 *= f2; + + if (igroup == 0) { + #if (LAL_USE_OMP == 1) && (LAL_USE_OMP_SIMD == 1) + #pragma omp parallel for simd schedule(static) + #elif (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = 0; i < nlocal; i++) { + v[i].x *= f0; + v[i].y *= f1; + v[i].z *= f2; + } + } else { + #if (LAL_USE_OMP == 1) && (LAL_USE_OMP_SIMD == 1) + #pragma omp parallel for simd schedule(static) + #elif (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + v[i].x *= f0; + v[i].y *= f1; + v[i].z *= f2; + } + } + } +} + +/* ---------------------------------------------------------------------- + perform half-step update of velocities +-----------------------------------------------------------------------*/ + +void FixNHGPU::nve_v() +{ + if (_respa_on) { FixNH::nve_v(); return; } + + double * _noalias const v = atom->v[0]; + const double * _noalias const f = atom->f[0]; + #if (LAL_USE_OMP == 1) && (LAL_USE_OMP_SIMD == 1) + #pragma omp parallel for simd schedule(static) + #elif (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = 0; i < _nlocal3; i++) + v[i] += _dtfm[i] * f[i]; +} + +/* ---------------------------------------------------------------------- + perform full-step update of positions +-----------------------------------------------------------------------*/ + +void FixNHGPU::nve_x() +{ + if (_respa_on) { FixNH::nve_x(); return; } + + double * _noalias const x = atom->x[0]; + double * _noalias const v = atom->v[0]; + + // x update by full step only for atoms in group + + if (igroup == 0) { + #if (LAL_USE_OMP == 1) && (LAL_USE_OMP_SIMD == 1) + #pragma omp parallel for simd schedule(static) + #elif (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = 0; i < _nlocal3; i++) + x[i] += dtv * v[i]; + } else { + #if (LAL_USE_OMP == 1) && (LAL_USE_OMP_SIMD == 1) + #pragma omp parallel for simd schedule(static) + #elif (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = 0; i < _nlocal3; i++) { + if (_dtfm[i] != 0.0) + x[i] += dtv * v[i]; + } + } +} + +/* ---------------------------------------------------------------------- + perform half-step thermostat scaling of velocities +-----------------------------------------------------------------------*/ + +void FixNHGPU::nh_v_temp() +{ + if (which == BIAS || _respa_on) { + FixNH::nh_v_temp(); + return; + } + + double * _noalias const v = atom->v[0]; + + if (igroup == 0) { + #if (LAL_USE_OMP == 1) && (LAL_USE_OMP_SIMD == 1) + #pragma omp parallel for simd schedule(static) + #elif (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = 0; i < _nlocal3; i++) + v[i] *= factor_eta; + } else { + #if (LAL_USE_OMP == 1) && (LAL_USE_OMP_SIMD == 1) + #pragma omp parallel for simd schedule(static) + #elif (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = 0; i < _nlocal3; i++) { + if (_dtfm[i] != 0.0) + v[i] *= factor_eta; + } + } +} + +double FixNHGPU::memory_usage() +{ + return FixNH::memory_usage() + _nlocal_max * 3 * sizeof(double); +} diff --git a/src/GPU/fix_nh_gpu.h b/src/GPU/fix_nh_gpu.h new file mode 100644 index 0000000000..edd210e813 --- /dev/null +++ b/src/GPU/fix_nh_gpu.h @@ -0,0 +1,164 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: W. Michael Brown (Intel) +------------------------------------------------------------------------- */ + +#ifndef LMP_FIX_NH_GPU_H +#define LMP_FIX_NH_GPU_H + +#include "fix_nh.h" + +namespace LAMMPS_NS { + +class FixNHGPU : public FixNH { + public: + FixNHGPU(class LAMMPS *, int, char **); + virtual ~FixNHGPU(); + virtual void setup(int vflag); + void reset_dt(); + virtual void final_integrate(); + virtual double memory_usage(); + + protected: + double *_dtfm; + int _nlocal3, _nlocal_max, _respa_on; + + virtual void remap(); + virtual void nve_x(); + virtual void nve_v(); + virtual void nh_v_press(); + virtual void nh_v_temp(); +}; + +} + +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Target temperature for fix nvt/npt/nph cannot be 0.0 + +Self-explanatory. + +E: Invalid fix nvt/npt/nph command for a 2d simulation + +Cannot control z dimension in a 2d model. + +E: Fix nvt/npt/nph dilate group ID does not exist + +Self-explanatory. + +E: Invalid fix nvt/npt/nph command pressure settings + +If multiple dimensions are coupled, those dimensions must be +specified. + +E: Cannot use fix nvt/npt/nph on a non-periodic dimension + +When specifying a diagonal pressure component, the dimension must be +periodic. + +E: Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension + +When specifying an off-diagonal pressure component, the 2nd of the two +dimensions must be periodic. E.g. if the xy component is specified, +then the y dimension must be periodic. + +E: Cannot use fix nvt/npt/nph with yz scaling when z is non-periodic dimension + +The 2nd dimension in the barostatted tilt factor must be periodic. + +E: Cannot use fix nvt/npt/nph with xz scaling when z is non-periodic dimension + +The 2nd dimension in the barostatted tilt factor must be periodic. + +E: Cannot use fix nvt/npt/nph with xy scaling when y is non-periodic dimension + +The 2nd dimension in the barostatted tilt factor must be periodic. + +E: Cannot use fix nvt/npt/nph with both yz dynamics and yz scaling + +Self-explanatory. + +E: Cannot use fix nvt/npt/nph with both xz dynamics and xz scaling + +Self-explanatory. + +E: Cannot use fix nvt/npt/nph with both xy dynamics and xy scaling + +Self-explanatory. + +E: Can not specify Pxy/Pxz/Pyz in fix nvt/npt/nph with non-triclinic box + +Only triclinic boxes can be used with off-diagonal pressure components. +See the region prism command for details. + +E: Invalid fix nvt/npt/nph pressure settings + +Settings for coupled dimensions must be the same. + +E: Fix nvt/npt/nph damping parameters must be > 0.0 + +Self-explanatory. + +E: Cannot use fix npt and fix deform on same component of stress tensor + +This would be changing the same box dimension twice. + +E: Temperature ID for fix nvt/npt does not exist + +Self-explanatory. + +E: Pressure ID for fix npt/nph does not exist + +Self-explanatory. + +E: Fix npt/nph has tilted box too far in one step - periodic cell is too far from equilibrium state + +Self-explanatory. The change in the box tilt is too extreme +on a short timescale. + +E: Could not find fix_modify temperature ID + +The compute ID for computing temperature does not exist. + +E: Fix_modify temperature ID does not compute temperature + +The compute ID assigned to the fix must compute temperature. + +W: Temperature for fix modify is not for group all + +The temperature compute is being used with a pressure calculation +which does operate on group all, so this may be inconsistent. + +E: Pressure ID for fix modify does not exist + +Self-explanatory. + +E: Could not find fix_modify pressure ID + +The compute ID for computing pressure does not exist. + +E: Fix_modify pressure ID does not compute pressure + +The compute ID assigned to the fix must compute pressure. + +*/ diff --git a/src/GPU/fix_npt_gpu.cpp b/src/GPU/fix_npt_gpu.cpp new file mode 100644 index 0000000000..2ba0be29e0 --- /dev/null +++ b/src/GPU/fix_npt_gpu.cpp @@ -0,0 +1,68 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://lammps.sandia.gov/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include +#include "fix_npt_gpu.h" +#include "modify.h" +#include "error.h" + +using namespace LAMMPS_NS; +using namespace FixConst; + +/* ---------------------------------------------------------------------- */ + +FixNPTGPU::FixNPTGPU(LAMMPS *lmp, int narg, char **arg) : + FixNHGPU(lmp, narg, arg) +{ + if (!tstat_flag) + error->all(FLERR,"Temperature control must be used with fix npt/omp"); + if (!pstat_flag) + error->all(FLERR,"Pressure control must be used with fix npt/omp"); + + // create a new compute temp style + // id = fix-ID + temp + // compute group = all since pressure is always global (group all) + // and thus its KE/temperature contribution should use group all + + int n = strlen(id) + 6; + id_temp = new char[n]; + strcpy(id_temp,id); + strcat(id_temp,"_temp"); + + char **newarg = new char*[3]; + newarg[0] = id_temp; + newarg[1] = (char *) "all"; + newarg[2] = (char *) "temp"; + + modify->add_compute(3,newarg); + delete [] newarg; + tcomputeflag = 1; + + // create a new compute pressure style + // id = fix-ID + press, compute group = all + // pass id_temp as 4th arg to pressure constructor + + n = strlen(id) + 7; + id_press = new char[n]; + strcpy(id_press,id); + strcat(id_press,"_press"); + + newarg = new char*[4]; + newarg[0] = id_press; + newarg[1] = (char *) "all"; + newarg[2] = (char *) "pressure"; + newarg[3] = id_temp; + modify->add_compute(4,newarg); + delete [] newarg; + pcomputeflag = 1; +} diff --git a/src/GPU/fix_npt_gpu.h b/src/GPU/fix_npt_gpu.h new file mode 100644 index 0000000000..2684935fe5 --- /dev/null +++ b/src/GPU/fix_npt_gpu.h @@ -0,0 +1,52 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: W. Michael Brown (Intel) +------------------------------------------------------------------------- */ + +#ifdef FIX_CLASS + +FixStyle(npt/gpu,FixNPTGPU) + +#else + +#ifndef LMP_FIX_NPT_GPU_H +#define LMP_FIX_NPT_GPU_H + +#include "fix_nh_gpu.h" + +namespace LAMMPS_NS { + +class FixNPTGPU : public FixNHGPU { + public: + FixNPTGPU(class LAMMPS *, int, char **); + ~FixNPTGPU() {} +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Temperature control must be used with fix npt + +Self-explanatory. + +E: Pressure control must be used with fix npt + +Self-explanatory. + +*/ diff --git a/src/GPU/fix_nve_asphere_gpu.cpp b/src/GPU/fix_nve_asphere_gpu.cpp new file mode 100644 index 0000000000..bf6cfda67d --- /dev/null +++ b/src/GPU/fix_nve_asphere_gpu.cpp @@ -0,0 +1,440 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://lammps.sandia.gov/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: W. Michael Brown (Intel) +------------------------------------------------------------------------- */ + +#include "fix_nve_asphere_gpu.h" + +#include "atom.h" +#include "atom_vec_ellipsoid.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "gpu_extra.h" +#include "memory.h" +#include "neighbor.h" +#include "update.h" +#include +#if (LAL_USE_OMP == 1) +#include +#endif + +using namespace LAMMPS_NS; +using namespace FixConst; + +#define INERTIA 0.2 // moment of inertia prefactor for ellipsoid + +#define ME_qnormalize(q) \ +{ \ + double norm = 1.0 / \ + sqrt(q##_w*q##_w + q##_i*q##_i + q##_j*q##_j + q##_k*q##_k); \ + q##_w *= norm; \ + q##_i *= norm; \ + q##_j *= norm; \ + q##_k *= norm; \ +} + +#define ME_mq_to_omega(m, quat, moments_0, moments_1, moments_2, w) \ +{ \ + double wbody_0, wbody_1, wbody_2; \ + double rot_0, rot_1, rot_2, rot_3, rot_4, rot_5, rot_6, rot_7, rot_8; \ + \ + double w2 = quat##_w * quat##_w; \ + double i2 = quat##_i * quat##_i; \ + double j2 = quat##_j * quat##_j; \ + double k2 = quat##_k * quat##_k; \ + double twoij = 2.0 * quat##_i * quat##_j; \ + double twoik = 2.0 * quat##_i * quat##_k; \ + double twojk = 2.0 * quat##_j * quat##_k; \ + double twoiw = 2.0 * quat##_i * quat##_w; \ + double twojw = 2.0 * quat##_j * quat##_w; \ + double twokw = 2.0 * quat##_k * quat##_w; \ + \ + rot##_0 = w2 + i2 - j2 - k2; \ + rot##_1 = twoij - twokw; \ + rot##_2 = twojw + twoik; \ + \ + rot##_3 = twoij + twokw; \ + rot##_4 = w2 - i2 + j2 - k2; \ + rot##_5 = twojk - twoiw; \ + \ + rot##_6 = twoik - twojw; \ + rot##_7 = twojk + twoiw; \ + rot##_8 = w2 - i2 - j2 + k2; \ + \ + wbody_0 = rot##_0*m##_0 + rot##_3*m##_1 + rot##_6*m##_2; \ + wbody_1 = rot##_1*m##_0 + rot##_4*m##_1 + rot##_7*m##_2; \ + wbody_2 = rot##_2*m##_0 + rot##_5*m##_1 + rot##_8*m##_2; \ + \ + wbody_0 *= moments_0; \ + wbody_1 *= moments_1; \ + wbody_2 *= moments_2; \ + \ + w##_0 = rot##_0*wbody_0 + rot##_1*wbody_1 + rot##_2*wbody_2; \ + w##_1 = rot##_3*wbody_0 + rot##_4*wbody_1 + rot##_5*wbody_2; \ + w##_2 = rot##_6*wbody_0 + rot##_7*wbody_1 + rot##_8*wbody_2; \ +} + +#define ME_omega_richardson(dtf,dtq,angmomin,quatin,torque,i0,i1,i2) \ +{ \ + angmomin[0] += dtf * torque[0]; \ + double angmom_0 = angmomin[0]; \ + angmomin[1] += dtf * torque[1]; \ + double angmom_1 = angmomin[1]; \ + angmomin[2] += dtf * torque[2]; \ + double angmom_2 = angmomin[2]; \ + \ + double quat_w = quatin[0]; \ + double quat_i = quatin[1]; \ + double quat_j = quatin[2]; \ + double quat_k = quatin[3]; \ + \ + double omega_0, omega_1, omega_2; \ + ME_mq_to_omega(angmom,quat,i0,i1,i2,omega); \ + \ + double wq_0, wq_1, wq_2, wq_3; \ + wq_0 = -omega_0*quat_i - omega_1*quat_j - omega_2*quat_k; \ + wq_1 = quat_w*omega_0 + omega_1*quat_k - omega_2*quat_j; \ + wq_2 = quat_w*omega_1 + omega_2*quat_i - omega_0*quat_k; \ + wq_3 = quat_w*omega_2 + omega_0*quat_j - omega_1*quat_i; \ + \ + double qfull_w, qfull_i, qfull_j, qfull_k; \ + qfull_w = quat_w + dtq * wq_0; \ + qfull_i = quat_i + dtq * wq_1; \ + qfull_j = quat_j + dtq * wq_2; \ + qfull_k = quat_k + dtq * wq_3; \ + ME_qnormalize(qfull); \ + \ + double qhalf_w, qhalf_i, qhalf_j, qhalf_k; \ + qhalf_w = quat_w + 0.5*dtq * wq_0; \ + qhalf_i = quat_i + 0.5*dtq * wq_1; \ + qhalf_j = quat_j + 0.5*dtq * wq_2; \ + qhalf_k = quat_k + 0.5*dtq * wq_3; \ + ME_qnormalize(qhalf); \ + \ + ME_mq_to_omega(angmom,qhalf,i0,i1,i2,omega); \ + wq_0 = -omega_0*qhalf_i - omega_1*qhalf_j - omega_2*qhalf_k; \ + wq_1 = qhalf_w*omega_0 + omega_1*qhalf_k - omega_2*qhalf_j; \ + wq_2 = qhalf_w*omega_1 + omega_2*qhalf_i - omega_0*qhalf_k; \ + wq_3 = qhalf_w*omega_2 + omega_0*qhalf_j - omega_1*qhalf_i; \ + \ + qhalf_w += 0.5*dtq * wq_0; \ + qhalf_i += 0.5*dtq * wq_1; \ + qhalf_j += 0.5*dtq * wq_2; \ + qhalf_k += 0.5*dtq * wq_3; \ + ME_qnormalize(qhalf); \ + \ + quat_w = 2.0*qhalf_w - qfull_w; \ + quat_i = 2.0*qhalf_i - qfull_i; \ + quat_j = 2.0*qhalf_j - qfull_j; \ + quat_k = 2.0*qhalf_k - qfull_k; \ + ME_qnormalize(quat); \ + \ + quatin[0] = quat_w; \ + quatin[1] = quat_i; \ + quatin[2] = quat_j; \ + quatin[3] = quat_k; \ +} + +/* ---------------------------------------------------------------------- */ + +FixNVEAsphereGPU::FixNVEAsphereGPU(LAMMPS *lmp, int narg, char **arg) : + FixNVE(lmp, narg, arg) +{ + _dtfm = 0; + _nlocal_max = 0; + _inertia0 = 0; + _inertia1 = 0; + _inertia2 = 0; +} + +/* ---------------------------------------------------------------------- */ + +void FixNVEAsphereGPU::init() +{ + avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + if (!avec) + error->all(FLERR,"Compute nve/asphere requires atom style ellipsoid"); + + // check that all particles are finite-size ellipsoids + // no point particles allowed, spherical is OK + + int *ellipsoid = atom->ellipsoid; + int *mask = atom->mask; + int nlocal = atom->nlocal; + + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) + if (ellipsoid[i] < 0) + error->one(FLERR,"Fix nve/asphere requires extended particles"); + + FixNVE::init(); +} + +/* ---------------------------------------------------------------------- */ + +void FixNVEAsphereGPU::setup(int vflag) +{ + FixNVE::setup(vflag); + reset_dt(); +} + +/* ---------------------------------------------------------------------- */ + +void FixNVEAsphereGPU::initial_integrate(int /*vflag*/) +{ + AtomVecEllipsoid::Bonus *bonus = avec->bonus; + int *ellipsoid = atom->ellipsoid; + double * _noalias const x = atom->x[0]; + double * _noalias const v = atom->v[0]; + const double * _noalias const f = atom->f[0]; + int *mask = atom->mask; + + double **angmom = atom->angmom; + double **torque = atom->torque; + int nlocal = atom->nlocal; + if (igroup == atom->firstgroup) nlocal = atom->nfirst; + + // set timestep here since dt may have changed or come via rRESPA + + dtq = 0.5 * dtv; + + #if (LAL_USE_OMP == 1) + #pragma omp parallel + #endif + { + #if (LAL_USE_OMP == 1) + const int nthreads = comm->nthreads; + const int tid = omp_get_thread_num(); + const int idelta = nlocal / nthreads + 1; + const int ifrom = tid * idelta; + const int ito = MIN(ifrom + idelta, nlocal); + const int ifrom3 = ifrom * 3; + const int ito3 = ito * 3; + #else + const int tid = 0; + const int ifrom = 0; + const int ifrom3 = 0; + const int ito = nlocal; + const int ito3 = nlocal * 3; + #endif + + #if (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = ifrom3; i < ito3; i++) { + v[i] += _dtfm[i] * f[i]; + x[i] += dtv * v[i]; + } + + // update angular momentum by 1/2 step + if (igroup == 0) { + #if (LAL_USE_OMP_SIMD == 1) + // Workaround for compiler bug + #ifdef __INTEL_COMPILER + #pragma simd + #else + #pragma omp simd + #endif + #endif + for (int i = ifrom; i < ito; i++) { + double *quat = bonus[ellipsoid[i]].quat; + ME_omega_richardson(dtf, dtq, angmom[i], quat, torque[i], _inertia0[i], + _inertia1[i], _inertia2[i]); + } + } else { + #if (LAL_USE_OMP_SIMD == 1) + // Workaround for compiler bug + #ifdef __INTEL_COMPILER + #pragma simd + #else + #pragma omp simd + #endif + #endif + for (int i = ifrom; i < ito; i++) { + if (mask[i] & groupbit) { + double *quat = bonus[ellipsoid[i]].quat; + ME_omega_richardson(dtf, dtq, angmom[i], quat, torque[i], + _inertia0[i], _inertia1[i], _inertia2[i]); + } + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +void FixNVEAsphereGPU::final_integrate() +{ + double * _noalias const v = atom->v[0]; + const double * _noalias const f = atom->f[0]; + double * _noalias const angmom = atom->angmom[0]; + const double * _noalias const torque = atom->torque[0]; + + const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : + atom->nlocal; + + if (neighbor->ago == 0) { + if (nlocal > _nlocal_max) { + if (_nlocal_max) { + memory->destroy(_dtfm); + memory->destroy(_inertia0); + memory->destroy(_inertia1); + memory->destroy(_inertia2); + } + _nlocal_max = static_cast(1.20 * nlocal); + memory->create(_dtfm, _nlocal_max * 3, "fix_nve_gpu:dtfm"); + memory->create(_inertia0, _nlocal_max * 3, "fix_nve_gpu:inertia0"); + memory->create(_inertia1, _nlocal_max * 3, "fix_nve_gpu:inertia1"); + memory->create(_inertia2, _nlocal_max * 3, "fix_nve_gpu:inertia2"); + } + } + + #if (LAL_USE_OMP == 1) + #pragma omp parallel + #endif + { + #if (LAL_USE_OMP == 1) + const int nthreads = comm->nthreads; + const int tid = omp_get_thread_num(); + const int idelta = nlocal / nthreads + 1; + const int ifrom = tid * idelta; + const int ito = MIN(ifrom + idelta, nlocal); + const int ifrom3 = ifrom * 3; + const int ito3 = ito * 3; + #else + const int tid = 0; + const int ifrom = 0; + const int ifrom3 = 0; + const int ito = nlocal; + const int ito3 = nlocal * 3; + #endif + + double dtfo; + if (neighbor->ago == 0) dtfo = reset_dt_omp(ifrom, ito, tid); + else dtfo = dtf; + + #if (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = ifrom3; i < ito3; i++) { + v[i] += _dtfm[i] * f[i]; + angmom[i] += dtfo * torque[i]; + } + } +} + +void FixNVEAsphereGPU::reset_dt() { + const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : + atom->nlocal; + + if (nlocal > _nlocal_max) { + if (_nlocal_max) { + memory->destroy(_dtfm); + memory->destroy(_inertia0); + memory->destroy(_inertia1); + memory->destroy(_inertia2); + } + _nlocal_max = static_cast(1.20 * nlocal); + memory->create(_dtfm, _nlocal_max * 3, "fix_nve_gpu:dtfm"); + memory->create(_inertia0, _nlocal_max * 3, "fix_nve_gpu:inertia0"); + memory->create(_inertia1, _nlocal_max * 3, "fix_nve_gpu:inertia1"); + memory->create(_inertia2, _nlocal_max * 3, "fix_nve_gpu:inertia2"); + } + + #if (LAL_USE_OMP == 1) + #pragma omp parallel + #endif + { + #if (LAL_USE_OMP == 1) + const int nthreads = comm->nthreads; + const int tid = omp_get_thread_num(); + const int idelta = nlocal / nthreads + 1; + const int ifrom = tid * idelta; + const int ito = MIN(ifrom + idelta, nlocal); + #else + const int tid = 0; + const int ifrom = 0; + const int ito = nlocal; + #endif + reset_dt_omp(ifrom, ito, tid); + } +} + +double FixNVEAsphereGPU::reset_dt_omp(const int ifrom, const int ito, + const int tid) { + AtomVecEllipsoid::Bonus *bonus = avec->bonus; + int *ellipsoid = atom->ellipsoid; + const int * const mask = atom->mask; + + const double dtfo = 0.5 * update->dt * force->ftm2v; + if (tid == 0) { + dtv = update->dt; + dtf = dtfo; + } + + if (igroup == 0) { + const double * const rmass = atom->rmass; + int n = ifrom * 3; + for (int i = ifrom; i < ito; i++) { + const double dtfir = dtfo / rmass[i]; + _dtfm[n++] = dtfir; + _dtfm[n++] = dtfir; + _dtfm[n++] = dtfir; + double *shape = bonus[ellipsoid[i]].shape; + double idot = INERTIA*rmass[i] * (shape[1]*shape[1]+shape[2]*shape[2]); + if (idot != 0.0) idot = 1.0 / idot; + _inertia0[i] = idot; + idot = INERTIA*rmass[i] * (shape[0]*shape[0]+shape[2]*shape[2]); + if (idot != 0.0) idot = 1.0 / idot; + _inertia1[i] = idot; + idot = INERTIA*rmass[i] * (shape[0]*shape[0]+shape[1]*shape[1]); + if (idot != 0.0) idot = 1.0 / idot; + _inertia2[i] = idot; + } + } else { + const double * const rmass = atom->rmass; + int n = ifrom * 3; + for (int i = ifrom; i < ito; i++) { + if (mask[i] & groupbit) { + const double dtfir = dtfo / rmass[i]; + _dtfm[n++] = dtfir; + _dtfm[n++] = dtfir; + _dtfm[n++] = dtfir; + double *shape = bonus[ellipsoid[i]].shape; + double idot = INERTIA*rmass[i] * (shape[1]*shape[1]+shape[2]*shape[2]); + if (idot != 0.0) idot = 1.0 / idot; + _inertia0[i] = idot; + idot = INERTIA*rmass[i] * (shape[0]*shape[0]+shape[2]*shape[2]); + if (idot != 0.0) idot = 1.0 / idot; + _inertia1[i] = idot; + idot = INERTIA*rmass[i] * (shape[0]*shape[0]+shape[1]*shape[1]); + if (idot != 0.0) idot = 1.0 / idot; + _inertia2[i] = idot; + } else { + _dtfm[n++] = 0.0; + _dtfm[n++] = 0.0; + _dtfm[n++] = 0.0; + } + } + } + return dtfo; +} + +double FixNVEAsphereGPU::memory_usage() +{ + return FixNVE::memory_usage() + _nlocal_max * 12 * sizeof(double); +} + diff --git a/src/GPU/fix_nve_asphere_gpu.h b/src/GPU/fix_nve_asphere_gpu.h new file mode 100644 index 0000000000..3c67e0e024 --- /dev/null +++ b/src/GPU/fix_nve_asphere_gpu.h @@ -0,0 +1,63 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: W. Michael Brown (Intel) +------------------------------------------------------------------------- */ + +#ifdef FIX_CLASS + +FixStyle(nve/asphere/gpu,FixNVEAsphereGPU) + +#else + +#ifndef LMP_FIX_NVE_ASPHERE_GPU_H +#define LMP_FIX_NVE_ASPHERE_GPU_H + +#include "fix_nve.h" + +namespace LAMMPS_NS { + +class FixNVEAsphereGPU : public FixNVE { + public: + FixNVEAsphereGPU(class LAMMPS *, int, char **); + void init(); + void setup(int vflag); + void initial_integrate(int); + void final_integrate(); + void reset_dt(); + virtual double memory_usage(); + + private: + double reset_dt_omp(const int, const int, const int); + double *_dtfm, *_inertia0, *_inertia1, *_inertia2; + int _nlocal_max; + double dtq; + class AtomVecEllipsoid *avec; +}; + +} +#endif +#endif + +/* ERROR/WARNING messages: + +E: Compute nve/asphere requires atom style ellipsoid + +Self-explanatory. + +E: Fix nve/asphere requires extended particles + +This fix can only be used for particles with a shape setting. + +*/ diff --git a/src/GPU/fix_nve_gpu.cpp b/src/GPU/fix_nve_gpu.cpp new file mode 100644 index 0000000000..c3dd5b6ae2 --- /dev/null +++ b/src/GPU/fix_nve_gpu.cpp @@ -0,0 +1,291 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://lammps.sandia.gov/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: W. Michael Brown (Intel) +------------------------------------------------------------------------- */ + +#include "fix_nve_gpu.h" +#include +#include "atom.h" +#include "comm.h" +#include "force.h" +#include "gpu_extra.h" +#include "memory.h" +#include "neighbor.h" +#include "update.h" +#if (LAL_USE_OMP == 1) +#include +#endif + +using namespace LAMMPS_NS; +using namespace FixConst; + +/* ---------------------------------------------------------------------- */ + +FixNVEGPU::FixNVEGPU(LAMMPS *lmp, int narg, char **arg) : + FixNVE(lmp, narg, arg) +{ + _dtfm = 0; + _nlocal_max = 0; +} + +/* ---------------------------------------------------------------------- */ + +FixNVEGPU::~FixNVEGPU() +{ + memory->destroy(_dtfm); +} + +/* ---------------------------------------------------------------------- */ + +void FixNVEGPU::setup(int vflag) +{ + FixNVE::setup(vflag); + if (strstr(update->integrate_style,"respa")) + _respa_on = 1; + else + _respa_on = 0; + if (atom->ntypes > 1) reset_dt(); +} + +/* ---------------------------------------------------------------------- + allow for both per-type and per-atom mass +------------------------------------------------------------------------- */ + +void FixNVEGPU::initial_integrate(int vflag) +{ + if (_respa_on) { FixNVE::initial_integrate(vflag); return; } + + // update v and x of atoms in group + + double * _noalias const x = atom->x[0]; + double * _noalias const v = atom->v[0]; + const double * _noalias const f = atom->f[0]; + const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : + atom->nlocal; + const int nlocal3 = nlocal * 3; + + #if (LAL_USE_OMP == 1) + #pragma omp parallel + #endif + { + #if (LAL_USE_OMP == 1) + const int nthreads = comm->nthreads; + const int idelta = nlocal3 / nthreads + 1; + const int ifrom3 = omp_get_thread_num() * idelta; + const int ito3 = MIN(ifrom3 + idelta, nlocal3); + #else + const int ifrom3 = 0; + const int ito3 = nlocal3; + #endif + if (igroup == 0 && atom->ntypes == 1 && !atom->rmass) { + const double dtfm = dtf / atom->mass[1]; + #if (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = ifrom3; i < ito3; i++) { + v[i] += dtfm * f[i]; + x[i] += dtv * v[i]; + } + } else if (igroup == 0) { + #if (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = ifrom3; i < ito3; i++) { + v[i] += _dtfm[i] * f[i]; + x[i] += dtv * v[i]; + } + } else { + #if (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = ifrom3; i < ito3; i++) { + if (_dtfm[i] != 0.0) { + v[i] += _dtfm[i] * f[i]; + x[i] += dtv * v[i]; + } + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +void FixNVEGPU::final_integrate() +{ + if (_respa_on) { FixNVE::final_integrate(); return; } + // update v of atoms in group + double * _noalias const v = atom->v[0]; + const double * _noalias const f = atom->f[0]; + const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : + atom->nlocal; + + if (neighbor->ago == 0) { + if (igroup != 0 || atom->ntypes != 1 || atom->rmass) { + if (nlocal > _nlocal_max) { + if (_nlocal_max) memory->destroy(_dtfm); + _nlocal_max = static_cast(1.20 * nlocal); + memory->create(_dtfm, _nlocal_max * 3, "fix_nve_gpu:dtfm"); + } + } + } + + #if (LAL_USE_OMP == 1) + #pragma omp parallel + #endif + { + #if (LAL_USE_OMP == 1) + const int nthreads = comm->nthreads; + const int tid = omp_get_thread_num(); + const int idelta = nlocal / nthreads + 1; + const int ifrom = tid * idelta; + const int ito = MIN(ifrom + idelta, nlocal); + const int ifrom3 = ifrom * 3; + const int ito3 = ito * 3; + #else + const int tid = 0; + const int ifrom = 0; + const int ifrom3 = 0; + const int ito = nlocal; + const int ito3 = nlocal * 3; + #endif + if (igroup == 0 && atom->ntypes == 1 && !atom->rmass) { + const double dtfm = dtf / atom->mass[1]; + #if (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = ifrom3; i < ito3; i++) + v[i] += dtfm * f[i]; + } else if (igroup == 0) { + if (neighbor->ago == 0) reset_dt_omp(ifrom,ito,tid); + #if (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = ifrom3; i < ito3; i++) + v[i] += _dtfm[i] * f[i]; + } else { + if (neighbor->ago == 0) reset_dt_omp(ifrom,ito,tid); + #if (LAL_USE_OMP_SIMD == 1) + #pragma omp simd + #endif + for (int i = ifrom3; i < ito3; i++) + v[i] += _dtfm[i] * f[i]; + } + } +} + +void FixNVEGPU::reset_dt() { + if (_respa_on) { FixNVE::reset_dt(); return; } + if (igroup == 0 && atom->ntypes == 1 && !atom->rmass) { + dtv = update->dt; + dtf = 0.5 * update->dt * force->ftm2v; + } else { + const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : + atom->nlocal; + if (nlocal > _nlocal_max) { + if (_nlocal_max) memory->destroy(_dtfm); + _nlocal_max = static_cast(1.20 * nlocal); + memory->create(_dtfm, _nlocal_max * 3, "fix_nve_gpu:dtfm"); + } + + #if (LAL_USE_OMP == 1) + #pragma omp parallel + #endif + { + #if (LAL_USE_OMP == 1) + const int nthreads = comm->nthreads; + const int tid = omp_get_thread_num(); + const int idelta = nlocal / nthreads + 1; + const int ifrom = tid * idelta; + const int ito = MIN(ifrom + idelta, nlocal); + #else + const int tid = 0; + const int ifrom = 0; + const int ito = nlocal; + #endif + + reset_dt_omp(ifrom, ito, tid); + } + } +} + +void FixNVEGPU::reset_dt_omp(const int ifrom, const int ito, const int tid) { + const double dtfo = 0.5 * update->dt * force->ftm2v; + if (tid == 0) { + dtv = update->dt; + dtf = dtfo; + } + + const int * const mask = atom->mask; + if (igroup == 0) { + if (atom->rmass) { + const double * const rmass = atom->rmass; + int n = ifrom * 3; + for (int i = ifrom; i < ito; i++) { + const double dtfir = dtfo / rmass[i]; + _dtfm[n++] = dtfir; + _dtfm[n++] = dtfir; + _dtfm[n++] = dtfir; + } + } else { + const double * const mass = atom->mass; + const int * const type = atom->type; + int n = ifrom * 3; + for (int i = ifrom; i < ito; i++) { + const double dtfim = dtfo / mass[type[i]]; + _dtfm[n++] = dtfim; + _dtfm[n++] = dtfim; + _dtfm[n++] = dtfim; + } + } + } else { + if (atom->rmass) { + const double * const rmass = atom->rmass; + int n = ifrom * 3; + for (int i = ifrom; i < ito; i++) + if (mask[i] & groupbit) { + const double dtfir = dtfo / rmass[i]; + _dtfm[n++] = dtfir; + _dtfm[n++] = dtfir; + _dtfm[n++] = dtfir; + } else { + _dtfm[n++] = 0.0; + _dtfm[n++] = 0.0; + _dtfm[n++] = 0.0; + } + } else { + const double * const mass = atom->mass; + const int * const type = atom->type; + int n = ifrom * 3; + for (int i = ifrom; i < ito; i++) + if (mask[i] & groupbit) { + const double dtfim = dtfo / mass[type[i]]; + _dtfm[n++] = dtfim; + _dtfm[n++] = dtfim; + _dtfm[n++] = dtfim; + } else { + _dtfm[n++] = 0.0; + _dtfm[n++] = 0.0; + _dtfm[n++] = 0.0; + } + } + } +} + +double FixNVEGPU::memory_usage() +{ + const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : + atom->nlocal; + return FixNVE::memory_usage() + nlocal * 3 * sizeof(double); +} diff --git a/src/GPU/fix_nve_gpu.h b/src/GPU/fix_nve_gpu.h new file mode 100644 index 0000000000..1042d4eadd --- /dev/null +++ b/src/GPU/fix_nve_gpu.h @@ -0,0 +1,60 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: W. Michael Brown (Intel) +------------------------------------------------------------------------- */ + +#ifdef FIX_CLASS + +FixStyle(nve/gpu,FixNVEGPU) + +#else + +#ifndef LMP_FIX_NVE_GPU_H +#define LMP_FIX_NVE_GPU_H + +#include "fix_nve.h" + +namespace LAMMPS_NS { + +class FixNVEGPU : public FixNVE { + public: + FixNVEGPU(class LAMMPS *, int, char **); + virtual ~FixNVEGPU(); + virtual void setup(int); + virtual void initial_integrate(int); + virtual void final_integrate(); + virtual void reset_dt(); + virtual double memory_usage(); + + protected: + void reset_dt_omp(const int, const int, const int); + double *_dtfm; + int _nlocal_max, _respa_on; +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +*/ diff --git a/src/GPU/fix_nvt_gpu.cpp b/src/GPU/fix_nvt_gpu.cpp new file mode 100644 index 0000000000..7d7826b6bf --- /dev/null +++ b/src/GPU/fix_nvt_gpu.cpp @@ -0,0 +1,50 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://lammps.sandia.gov/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include +#include "fix_nvt_gpu.h" +#include "group.h" +#include "modify.h" +#include "error.h" + +using namespace LAMMPS_NS; +using namespace FixConst; + +/* ---------------------------------------------------------------------- */ + +FixNVTGPU::FixNVTGPU(LAMMPS *lmp, int narg, char **arg) : + FixNHGPU(lmp, narg, arg) +{ + if (!tstat_flag) + error->all(FLERR,"Temperature control must be used with fix nvt"); + if (pstat_flag) + error->all(FLERR,"Pressure control can not be used with fix nvt"); + + // create a new compute temp style + // id = fix-ID + temp + + int n = strlen(id) + 6; + id_temp = new char[n]; + strcpy(id_temp,id); + strcat(id_temp,"_temp"); + + char **newarg = new char*[3]; + newarg[0] = id_temp; + newarg[1] = group->names[igroup]; + newarg[2] = (char *) "temp"; + + modify->add_compute(3,newarg); + delete [] newarg; + tcomputeflag = 1; +} + diff --git a/src/GPU/fix_nvt_gpu.h b/src/GPU/fix_nvt_gpu.h new file mode 100644 index 0000000000..7ccba97040 --- /dev/null +++ b/src/GPU/fix_nvt_gpu.h @@ -0,0 +1,52 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: W. Michael Brown (Intel) +------------------------------------------------------------------------- */ + +#ifdef FIX_CLASS + +FixStyle(nvt/gpu,FixNVTGPU) + +#else + +#ifndef LMP_FIX_NVT_GPU_H +#define LMP_FIX_NVT_GPU_H + +#include "fix_nh_gpu.h" + +namespace LAMMPS_NS { + +class FixNVTGPU : public FixNHGPU { + public: + FixNVTGPU(class LAMMPS *, int, char **); + ~FixNVTGPU() {} +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Temperature control must be used with fix nvt + +Self-explanatory. + +E: Pressure control can not be used with fix nvt + +Self-explanatory. + +*/ diff --git a/src/GPU/gpu_extra.h b/src/GPU/gpu_extra.h index 115e1f0574..1a957c9aef 100644 --- a/src/GPU/gpu_extra.h +++ b/src/GPU/gpu_extra.h @@ -21,6 +21,29 @@ #include "modify.h" #include "error.h" +// ---------------------- OPENMP PREPROCESSOR STUFF ------------------ +#if defined(_OPENMP) + #if !defined(LAL_USE_OMP) + #define LAL_USE_OMP 1 + #endif + + #if !defined(LAL_USE_OMP_SIMD) + #if (_OPENMP >= 201307) + #define LAL_USE_OMP_SIMD 1 + #else + #define LAL_USE_OMP_SIMD 0 + #endif + #endif +#else + #if !defined(LAL_USE_OMP) + #define LAL_USE_OMP 0 + #endif + + #if !defined(LAL_USE_OMP_SIMD) + #define LAL_USE_OMP_SIMD 0 + #endif +#endif + namespace GPU_EXTRA { inline void check_flag(int error_flag, LAMMPS_NS::Error *error, @@ -61,6 +84,12 @@ namespace GPU_EXTRA { else if (all_success == -12) error->all(FLERR, "Invalid OpenCL platform ID."); + else if (all_success == -13) + error->all(FLERR, + "Invalid device configuration."); + else if (all_success == -15) + error->all(FLERR, + "P3M built for FP64 and GPU device is FP32 only."); else error->all(FLERR,"Unknown error in GPU library"); } @@ -127,12 +156,22 @@ greater than 4 for NVIDIA GPUs. E: Invalid custom OpenCL parameter string. There are not enough or too many parameters in the custom string for package -GPU. +GPU or the parameters do not meet required restrictions. E: Unknown error in GPU library Self-explanatory. +E: Invalid device configuration. + +The specified GPU or accelerator does not support the specified device +configuration. Check the output of ocl_get_devices or nvd_get_devices to +verify the correct device IDs for the GPU package. + +E: P3M built for FP64 and GPU device is FP32 only + +Either turn off GPU acceleration for PPPM or build LAMMPS with -DFFT_SINGLE + W: Increasing communication cutoff for GPU style The pair style has increased the communication cutoff to be consistent with diff --git a/src/GPU/pair_beck_gpu.cpp b/src/GPU/pair_beck_gpu.cpp index 38cc593076..ff9537a33e 100644 --- a/src/GPU/pair_beck_gpu.cpp +++ b/src/GPU/pair_beck_gpu.cpp @@ -48,9 +48,9 @@ int beck_gpu_init(const int ntypes, double **cutsq, double **host_aa, const int nall, const int max_nbors, const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen); void beck_gpu_clear(); -int ** beck_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, +int ** beck_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, @@ -160,9 +160,10 @@ void PairBeckGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = beck_gpu_init(atom->ntypes+1, cutsq, aa, alpha, beta, AA, BB, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_born_coul_long_cs_gpu.cpp b/src/GPU/pair_born_coul_long_cs_gpu.cpp index b65b662496..db0faab0ab 100644 --- a/src/GPU/pair_born_coul_long_cs_gpu.cpp +++ b/src/GPU/pair_born_coul_long_cs_gpu.cpp @@ -57,15 +57,15 @@ using namespace MathConst; // External functions from cuda library for atom decomposition int bornclcs_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, - double **host_born1, double **host_born2, - double **host_born3, double **host_a, - double **host_c, double **host_d, - double **sigma, double **offset, double *special_lj, - const int inum, const int nall, const int max_nbors, - const int maxspecial, const double cell_size, - int &gpu_mode, FILE *screen, double **host_cut_ljsq, - double host_cut_coulsq, double *host_special_coul, - const double qqrd2e, const double g_ewald); + double **host_born1, double **host_born2, + double **host_born3, double **host_a, + double **host_c, double **host_d, + double **sigma, double **offset, double *special_lj, + const int inum, const int nall, const int max_nbors, + const int maxspecial, const double cell_size, + int &gpu_mode, FILE *screen, double **host_cut_ljsq, + double host_cut_coulsq, double *host_special_coul, + const double qqrd2e, const double g_ewald); void bornclcs_gpu_clear(); int** bornclcs_gpu_compute_n(const int ago, const int inum_full, const int nall, double **host_x, int *host_type, double *sublo, @@ -196,10 +196,11 @@ void PairBornCoulLongCSGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = bornclcs_gpu_init(atom->ntypes+1, cutsq, rhoinv, born1, born2, born3, a, c, d, sigma, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e, g_ewald); diff --git a/src/GPU/pair_born_coul_long_gpu.cpp b/src/GPU/pair_born_coul_long_gpu.cpp index 0a359f66cc..cad174c0de 100644 --- a/src/GPU/pair_born_coul_long_gpu.cpp +++ b/src/GPU/pair_born_coul_long_gpu.cpp @@ -195,10 +195,11 @@ void PairBornCoulLongGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = borncl_gpu_init(atom->ntypes+1, cutsq, rhoinv, born1, born2, born3, a, c, d, sigma, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e, g_ewald); diff --git a/src/GPU/pair_born_coul_wolf_cs_gpu.cpp b/src/GPU/pair_born_coul_wolf_cs_gpu.cpp index 7aba6e059b..5c8cac0ec2 100644 --- a/src/GPU/pair_born_coul_wolf_cs_gpu.cpp +++ b/src/GPU/pair_born_coul_wolf_cs_gpu.cpp @@ -45,24 +45,26 @@ using namespace MathConst; // External functions from cuda library for atom decomposition int borncwcs_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, - double **host_born1, double **host_born2, - double **host_born3, double **host_a, double **host_c, - double **host_d, double **sigma, double **offset, - double *special_lj, const int inum, - const int nall, const int max_nbors, const int maxspecial, - const double cell_size, int &gpu_mode, FILE *screen, - double **host_cut_ljsq, double host_cut_coulsq, - double *host_special_coul, const double qqrd2e, - const double alf, const double e_shift, const double f_shift); + double **host_born1, double **host_born2, + double **host_born3, double **host_a, double **host_c, + double **host_d, double **sigma, double **offset, + double *special_lj, const int inum, const int nall, + const int max_nbors, const int maxspecial, + const double cell_size, int &gpu_mode, FILE *screen, + double **host_cut_ljsq, double host_cut_coulsq, + double *host_special_coul, const double qqrd2e, + const double alf, const double e_shift, + const double f_shift); void borncwcs_gpu_clear(); -int ** borncwcs_gpu_compute_n(const int ago, const int inum_full, const int nall, - double **host_x, int *host_type, double *sublo, - double *subhi, tagint *tag, int **nspecial, - tagint **special, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - int **ilist, int **jnum, const double cpu_time, - bool &success, double *host_q, double *boxlo, - double *prd); +int ** borncwcs_gpu_compute_n(const int ago, const int inum_full, + const int nall, double **host_x, int *host_type, + double *sublo, double *subhi, tagint *tag, + int **nspecial, tagint **special, + const bool eflag, const bool vflag, + const bool eatom, const bool vatom, + int &host_start, int **ilist, int **jnum, + const double cpu_time, bool &success, + double *host_q, double *boxlo, double *prd); void borncwcs_gpu_compute(const int ago, const int inum_full, const int nall, double **host_x, int *host_type, int *ilist, int *numj, int **firstneigh, const bool eflag, const bool vflag, @@ -179,10 +181,11 @@ void PairBornCoulWolfCSGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = borncwcs_gpu_init(atom->ntypes+1, cutsq, rhoinv, born1, born2, born3, a, c, d, sigma, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e, alf, e_shift, f_shift); diff --git a/src/GPU/pair_born_coul_wolf_gpu.cpp b/src/GPU/pair_born_coul_wolf_gpu.cpp index ee6fcf3cea..73e58b0a1f 100644 --- a/src/GPU/pair_born_coul_wolf_gpu.cpp +++ b/src/GPU/pair_born_coul_wolf_gpu.cpp @@ -51,13 +51,15 @@ int borncw_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, const double cell_size, int &gpu_mode, FILE *screen, double **host_cut_ljsq, double host_cut_coulsq, double *host_special_coul, const double qqrd2e, - const double alf, const double e_shift, const double f_shift); + const double alf, const double e_shift, + const double f_shift); void borncw_gpu_clear(); int ** borncw_gpu_compute_n(const int ago, const int inum_full, const int nall, double **host_x, int *host_type, double *sublo, double *subhi, tagint *tag, int **nspecial, - tagint **special, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, + tagint **special, const bool eflag, + const bool vflag, const bool eatom, + const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, bool &success, double *host_q, double *boxlo, double *prd); @@ -177,10 +179,11 @@ void PairBornCoulWolfGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = borncw_gpu_init(atom->ntypes+1, cutsq, rhoinv, born1, born2, born3, a, c, d, sigma, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e, alf, e_shift, f_shift); diff --git a/src/GPU/pair_born_gpu.cpp b/src/GPU/pair_born_gpu.cpp index 84ed4cfc04..770dad8346 100644 --- a/src/GPU/pair_born_gpu.cpp +++ b/src/GPU/pair_born_gpu.cpp @@ -48,13 +48,13 @@ int born_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen); void born_gpu_reinit(const int ntypes, double **host_rhoinv, - double **host_born1, double **host_born2, double **host_born3, - double **host_a, double **host_c, double **host_d, - double **offset); + double **host_born1, double **host_born2, + double **host_born3, double **host_a, double **host_c, + double **host_d, double **offset); void born_gpu_clear(); -int ** born_gpu_compute_n(const int ago, const int inum_full, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, +int ** born_gpu_compute_n(const int ago, const int inum_full, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, @@ -163,10 +163,11 @@ void PairBornGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = born_gpu_init(atom->ntypes+1, cutsq, rhoinv, born1, born2, born3, a, c, d, sigma, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_buck_coul_cut_gpu.cpp b/src/GPU/pair_buck_coul_cut_gpu.cpp index 036bc0d7a8..2c9e71bc83 100644 --- a/src/GPU/pair_buck_coul_cut_gpu.cpp +++ b/src/GPU/pair_buck_coul_cut_gpu.cpp @@ -167,9 +167,10 @@ void PairBuckCoulCutGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = buckc_gpu_init(atom->ntypes+1, cutsq, rhoinv, buck1, buck2, a, c, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_buck_coul_long_gpu.cpp b/src/GPU/pair_buck_coul_long_gpu.cpp index 3916e5634e..3d48862c6a 100644 --- a/src/GPU/pair_buck_coul_long_gpu.cpp +++ b/src/GPU/pair_buck_coul_long_gpu.cpp @@ -191,9 +191,10 @@ void PairBuckCoulLongGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = buckcl_gpu_init(atom->ntypes+1, cutsq, rhoinv, buck1, buck2, a, c, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e, g_ewald); diff --git a/src/GPU/pair_buck_gpu.cpp b/src/GPU/pair_buck_gpu.cpp index 54c579bf72..d17f9d2072 100644 --- a/src/GPU/pair_buck_gpu.cpp +++ b/src/GPU/pair_buck_gpu.cpp @@ -47,8 +47,8 @@ int buck_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv, const int nall, const int max_nbors, const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen); void buck_gpu_reinit(const int ntypes, double **cutsq, double **host_rhoinv, - double **host_buck1, double **host_buck2, - double **host_a, double **host_c, double **offset); + double **host_buck1, double **host_buck2, + double **host_a, double **host_c, double **offset); void buck_gpu_clear(); int ** buck_gpu_compute_n(const int ago, const int inum_full, const int nall, double **host_x, int *host_type, double *sublo, @@ -161,9 +161,10 @@ void PairBuckGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = buck_gpu_init(atom->ntypes+1, cutsq, rhoinv, buck1, buck2, a, c, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_colloid_gpu.cpp b/src/GPU/pair_colloid_gpu.cpp index 2e35486993..8b7870575a 100644 --- a/src/GPU/pair_colloid_gpu.cpp +++ b/src/GPU/pair_colloid_gpu.cpp @@ -44,18 +44,18 @@ int colloid_gpu_init(const int ntypes, double **cutsq, double **host_lj1, double **host_lj2, double **host_lj3, double **host_lj4, double **offset, double *special_lj, double **host_a12, double **host_a1, double **host_a2, double **host_d1, - double **host_d2, double **host_sigma3, double **host_sigma6, - int **host_form, const int nlocal, + double **host_d2, double **host_sigma3, + double **host_sigma6, int **host_form, const int nlocal, const int nall, const int max_nbors, const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen); void colloid_gpu_clear(); -int ** colloid_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, - tagint **special, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - int **ilist, int **jnum, - const double cpu_time, bool &success); +int ** colloid_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, + tagint **special, const bool eflag, + const bool vflag, const bool eatom, + const bool vatom, int &host_start, int **ilist, + int **jnum, const double cpu_time, bool &success); void colloid_gpu_compute(const int ago, const int inum, const int nall, double **host_x, int *host_type, int *ilist, int *numj, int **firstneigh, const bool eflag, const bool vflag, @@ -171,10 +171,11 @@ void PairColloidGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = colloid_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4, offset, force->special_lj, a12, a1, a2, d1, d2, sigma3, sigma6, _form, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); memory->destroy(_form); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_coul_cut_gpu.cpp b/src/GPU/pair_coul_cut_gpu.cpp index 1e45aebf7b..9098f86737 100644 --- a/src/GPU/pair_coul_cut_gpu.cpp +++ b/src/GPU/pair_coul_cut_gpu.cpp @@ -47,21 +47,21 @@ int coul_gpu_init(const int ntypes, double **host_scale, double **cutsq, const double qqrd2e); void coul_gpu_reinit(const int ntypes, double **host_scale); void coul_gpu_clear(); -int ** coul_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, - tagint **special, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - int **ilist, int **jnum, const double cpu_time, - bool &success, double *host_q, double *boxlo, - double *prd); +int ** coul_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, + tagint **special, const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, + int **ilist, int **jnum, const double cpu_time, + bool &success, double *host_q, double *boxlo, + double *prd); void coul_gpu_compute(const int ago, const int inum, const int nall, double **host_x, int *host_type, - int *ilist, int *numj, int **firstneigh, - const bool eflag, const bool vflag, const bool eatom, - const bool vatom, int &host_start, const double cpu_time, - bool &success, double *host_q, const int nlocal, - double *boxlo, double *prd); + int *ilist, int *numj, int **firstneigh, + const bool eflag, const bool vflag, const bool eatom, + const bool vatom, int &host_start, const double cpu_time, + bool &success, double *host_q, const int nlocal, + double *boxlo, double *prd); double coul_gpu_bytes(); /* ---------------------------------------------------------------------- */ @@ -166,9 +166,10 @@ void PairCoulCutGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = coul_gpu_init(atom->ntypes+1, scale, cutsq, force->special_coul, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, force->qqrd2e); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_coul_debye_gpu.cpp b/src/GPU/pair_coul_debye_gpu.cpp index f23b5acde3..1db2995810 100644 --- a/src/GPU/pair_coul_debye_gpu.cpp +++ b/src/GPU/pair_coul_debye_gpu.cpp @@ -48,20 +48,20 @@ int cdebye_gpu_init(const int ntypes, double **host_scale, double **cutsq, void cdebye_gpu_reinit(const int ntypes, double **host_scale); void cdebye_gpu_clear(); int ** cdebye_gpu_compute_n(const int ago, const int inum, const int nall, - double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, - tagint **special, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - int **ilist, int **jnum, const double cpu_time, - bool &success, double *host_q, double *boxlo, - double *prd); + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, + tagint **special, const bool eflag, + const bool vflag, const bool eatom, + const bool vatom, int &host_start, int **ilist, + int **jnum, const double cpu_time, bool &success, + double *host_q, double *boxlo, double *prd); void cdebye_gpu_compute(const int ago, const int inum, const int nall, - double **host_x, int *host_type, - int *ilist, int *numj, int **firstneigh, - const bool eflag, const bool vflag, const bool eatom, - const bool vatom, int &host_start, const double cpu_time, - bool &success, double *host_q, const int nlocal, - double *boxlo, double *prd); + double **host_x, int *host_type, int *ilist, + int *numj, int **firstneigh, const bool eflag, + const bool vflag, const bool eatom, const bool vatom, + int &host_start, const double cpu_time, bool &success, + double *host_q, const int nlocal, double *boxlo, + double *prd); double cdebye_gpu_bytes(); /* ---------------------------------------------------------------------- */ @@ -167,9 +167,10 @@ void PairCoulDebyeGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = cdebye_gpu_init(atom->ntypes+1, scale, cutsq, force->special_coul, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, force->qqrd2e, kappa); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_coul_dsf_gpu.cpp b/src/GPU/pair_coul_dsf_gpu.cpp index 0bcffb5d2c..830ad057e6 100644 --- a/src/GPU/pair_coul_dsf_gpu.cpp +++ b/src/GPU/pair_coul_dsf_gpu.cpp @@ -57,9 +57,9 @@ int cdsf_gpu_init(const int ntypes, const int nlocal, const int nall, const double e_shift, const double f_shift, const double alpha); void cdsf_gpu_clear(); -int ** cdsf_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, +int ** cdsf_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, @@ -184,8 +184,9 @@ void PairCoulDSFGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = cdsf_gpu_init(atom->ntypes+1, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_coulsq, force->special_coul, force->qqrd2e, e_shift, f_shift, alpha); diff --git a/src/GPU/pair_coul_long_cs_gpu.cpp b/src/GPU/pair_coul_long_cs_gpu.cpp index ef404d7a13..5b1fcd9c8f 100644 --- a/src/GPU/pair_coul_long_cs_gpu.cpp +++ b/src/GPU/pair_coul_long_cs_gpu.cpp @@ -54,27 +54,27 @@ using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition -int clcs_gpu_init(const int ntypes, double **scale, - const int nlocal, const int nall, const int max_nbors, - const int maxspecial, const double cell_size, int &gpu_mode, - FILE *screen, double host_cut_coulsq, double *host_special_coul, - const double qqrd2e, const double g_ewald); +int clcs_gpu_init(const int ntypes, double **scale, const int nlocal, + const int nall, const int max_nbors, const int maxspecial, + const double cell_size, int &gpu_mode, FILE *screen, + double host_cut_coulsq, double *host_special_coul, + const double qqrd2e, const double g_ewald); void clcs_gpu_reinit(const int ntypes, double **scale); void clcs_gpu_clear(); int ** clcs_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, - int **nspecial, tagint **special, const bool eflag, - const bool vflag, const bool eatom, const bool vatom, - int &host_start, int **ilist, int **jnum, - const double cpu_time, bool &success, double *host_q, - double *boxlo, double *prd); + const int nall, double **host_x, int *host_type, + double *sublo, double *subhi, tagint *tag, + int **nspecial, tagint **special, const bool eflag, + const bool vflag, const bool eatom, const bool vatom, + int &host_start, int **ilist, int **jnum, + const double cpu_time, bool &success, double *host_q, + double *boxlo, double *prd); void clcs_gpu_compute(const int ago, const int inum, const int nall, - double **host_x, int *host_type, int *ilist, int *numj, - int **firstneigh, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - const double cpu_time, bool &success, double *host_q, - const int nlocal, double *boxlo, double *prd); + double **host_x, int *host_type, int *ilist, int *numj, + int **firstneigh, const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, + const double cpu_time, bool &success, double *host_q, + const int nlocal, double *boxlo, double *prd); double clcs_gpu_bytes(); /* ---------------------------------------------------------------------- */ @@ -186,8 +186,9 @@ void PairCoulLongCSGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = clcs_gpu_init(atom->ntypes+1, scale, - atom->nlocal, atom->nlocal+atom->nghost, 300, + atom->nlocal, atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_coulsq, force->special_coul, force->qqrd2e, g_ewald); diff --git a/src/GPU/pair_coul_long_gpu.cpp b/src/GPU/pair_coul_long_gpu.cpp index 1118a012d0..af6a66fa34 100644 --- a/src/GPU/pair_coul_long_gpu.cpp +++ b/src/GPU/pair_coul_long_gpu.cpp @@ -181,8 +181,9 @@ void PairCoulLongGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = cl_gpu_init(atom->ntypes+1, scale, - atom->nlocal, atom->nlocal+atom->nghost, 300, + atom->nlocal, atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_coulsq, force->special_coul, force->qqrd2e, g_ewald); diff --git a/src/GPU/pair_dpd_gpu.cpp b/src/GPU/pair_dpd_gpu.cpp index 59c0fa031f..d77d83e953 100644 --- a/src/GPU/pair_dpd_gpu.cpp +++ b/src/GPU/pair_dpd_gpu.cpp @@ -52,8 +52,8 @@ int ** dpd_gpu_compute_n(const int ago, const int inum_full, const int nall, double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, - int **ilist, int **jnum, const double cpu_time, bool &success, - double **host_v, const double dtinvsqrt, + int **ilist, int **jnum, const double cpu_time, + bool &success, double **host_v, const double dtinvsqrt, const int seed, const int timestep, double *boxlo, double *prd); void dpd_gpu_compute(const int ago, const int inum_full, const int nall, @@ -308,9 +308,10 @@ void PairDPDGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = dpd_gpu_init(atom->ntypes+1, cutsq, a0, gamma, sigma, cut, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_dpd_tstat_gpu.cpp b/src/GPU/pair_dpd_tstat_gpu.cpp index 8bf98cc8ed..a5ae3e3001 100644 --- a/src/GPU/pair_dpd_tstat_gpu.cpp +++ b/src/GPU/pair_dpd_tstat_gpu.cpp @@ -47,12 +47,13 @@ int dpd_tstat_gpu_init(const int ntypes, double **cutsq, double **host_a0, const int nall, const int max_nbors, const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen); void dpd_tstat_gpu_clear(); -int ** dpd_tstat_gpu_compute_n(const int ago, const int inum_full, const int nall, - double **host_x, int *host_type, double *sublo, - double *subhi, tagint *tag, int **nspecial, - tagint **special, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - int **ilist, int **jnum, const double cpu_time, bool &success, +int ** dpd_tstat_gpu_compute_n(const int ago, const int inum_full, + const int nall, double **host_x, int *host_type, + double *sublo, double *subhi, tagint *tag, + int **nspecial, tagint **special, const bool eflag, + const bool vflag, const bool eatom, const bool vatom, + int &host_start, int **ilist, int **jnum, + const double cpu_time, bool &success, double **host_v, const double dtinvsqrt, const int seed, const int timestep, double *boxlo, double *prd); @@ -64,8 +65,9 @@ void dpd_tstat_gpu_compute(const int ago, const int inum_full, const int nall, double **host_v, const double dtinvsqrt, const int seed, const int timestep, const int nlocal, double *boxlo, double *prd); -void dpd_tstat_gpu_update_coeff(int ntypes, double **host_a0, double **host_gamma, - double **host_sigma, double **host_cut); +void dpd_tstat_gpu_update_coeff(int ntypes, double **host_a0, + double **host_gamma, double **host_sigma, + double **host_cut); double dpd_tstat_gpu_bytes(); #define EPSILON 1.0e-10 @@ -325,10 +327,11 @@ void PairDPDTstatGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = dpd_tstat_gpu_init(atom->ntypes+1, cutsq, a0, gamma, sigma, - cut, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, - cell_size, gpu_mode, screen); + cut, force->special_lj, atom->nlocal, + atom->nlocal+atom->nghost, mnf, maxspecial, + cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); if (gpu_mode == GPU_FORCE) { diff --git a/src/GPU/pair_eam_alloy_gpu.cpp b/src/GPU/pair_eam_alloy_gpu.cpp index c1370af307..4678a6f669 100644 --- a/src/GPU/pair_eam_alloy_gpu.cpp +++ b/src/GPU/pair_eam_alloy_gpu.cpp @@ -39,21 +39,22 @@ using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition int eam_alloy_gpu_init(const int ntypes, double host_cutforcesq, - int **host_type2rhor, int **host_type2z2r, - int *host_type2frho, double ***host_rhor_spline, - double ***host_z2r_spline, double ***host_frho_spline, - double rdr, double rdrho, double rhomax, - int nrhor, int nrho, int nz2r, int nfrho, int nr, - const int nlocal, const int nall, const int max_nbors, - const int maxspecial, const double cell_size, int &gpu_mode, - FILE *screen, int &fp_size); + int **host_type2rhor, int **host_type2z2r, + int *host_type2frho, double ***host_rhor_spline, + double ***host_z2r_spline, double ***host_frho_spline, + double rdr, double rdrho, double rhomax, + int nrhor, int nrho, int nz2r, int nfrho, int nr, + const int nlocal, const int nall, const int max_nbors, + const int maxspecial, const double cell_size, + int &gpu_mode, FILE *screen, int &fp_size); void eam_alloy_gpu_clear(); -int** eam_alloy_gpu_compute_n(const int ago, const int inum_full, const int nall, - double **host_x, int *host_type, double *sublo, - double *subhi, tagint *tag, int **nspecial, tagint **special, - const bool eflag, const bool vflag, const bool eatom, - const bool vatom, int &host_start, int **ilist, - int **jnum, const double cpu_time, bool &success, +int** eam_alloy_gpu_compute_n(const int ago, const int inum_full, + const int nall, double **host_x, int *host_type, + double *sublo, double *subhi, tagint *tag, + int **nspecial, tagint **special, const bool eflag, + const bool vflag, const bool eatom, const bool vatom, + int &host_start, int **ilist, int **jnum, + const double cpu_time, bool &success, int &inum, void **fp_ptr); void eam_alloy_gpu_compute(const int ago, const int inum_full, const int nlocal, const int nall,double **host_x, int *host_type, @@ -183,10 +184,11 @@ void PairEAMAlloyGPU::init_style() if (atom->molecular) maxspecial=atom->maxspecial; int fp_size; + int mnf = 5e-2 * neighbor->oneatom; int success = eam_alloy_gpu_init(atom->ntypes+1, cutforcesq, type2rhor, type2z2r, type2frho, rhor_spline, z2r_spline, frho_spline, rdr, rdrho, rhomax, nrhor, nrho, nz2r, nfrho, nr, - atom->nlocal, atom->nlocal+atom->nghost, 300, + atom->nlocal, atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, fp_size); GPU_EXTRA::check_flag(success,error,world); @@ -195,7 +197,6 @@ void PairEAMAlloyGPU::init_style() neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; } - if (fp_size == sizeof(double)) fp_single = false; else diff --git a/src/GPU/pair_eam_fs_gpu.cpp b/src/GPU/pair_eam_fs_gpu.cpp index ce3ea8bb0b..390bb93987 100644 --- a/src/GPU/pair_eam_fs_gpu.cpp +++ b/src/GPU/pair_eam_fs_gpu.cpp @@ -50,19 +50,19 @@ int eam_fs_gpu_init(const int ntypes, double host_cutforcesq, void eam_fs_gpu_clear(); int** eam_fs_gpu_compute_n(const int ago, const int inum_full, const int nall, double **host_x, int *host_type, double *sublo, - double *subhi, tagint *tag, int **nspecial, tagint **special, - const bool eflag, const bool vflag, const bool eatom, - const bool vatom, int &host_start, int **ilist, - int **jnum, const double cpu_time, bool &success, - int &inum, void **fp_ptr); + double *subhi, tagint *tag, int **nspecial, + tagint **special, const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, + int **ilist, int **jnum, const double cpu_time, + bool &success, int &inum, void **fp_ptr); void eam_fs_gpu_compute(const int ago, const int inum_full, const int nlocal, - const int nall,double **host_x, int *host_type, - int *ilist, int *numj, int **firstneigh, - const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - const double cpu_time, bool &success, void **fp_ptr); + const int nall,double **host_x, int *host_type, + int *ilist, int *numj, int **firstneigh, + const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, + const double cpu_time, bool &success, void **fp_ptr); void eam_fs_gpu_compute_force(int *ilist, const bool eflag, const bool vflag, - const bool eatom, const bool vatom); + const bool eatom, const bool vatom); double eam_fs_gpu_bytes(); /* ---------------------------------------------------------------------- */ @@ -183,10 +183,11 @@ void PairEAMFSGPU::init_style() if (atom->molecular) maxspecial=atom->maxspecial; int fp_size; + int mnf = 5e-2 * neighbor->oneatom; int success = eam_fs_gpu_init(atom->ntypes+1, cutforcesq, type2rhor, type2z2r, type2frho, rhor_spline, z2r_spline, frho_spline, rdr, rdrho, rhomax, nrhor, nrho, nz2r, nfrho, nr, - atom->nlocal, atom->nlocal+atom->nghost, 300, + atom->nlocal, atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, fp_size); GPU_EXTRA::check_flag(success,error,world); @@ -195,7 +196,6 @@ void PairEAMFSGPU::init_style() neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; } - if (fp_size == sizeof(double)) fp_single = false; else diff --git a/src/GPU/pair_eam_gpu.cpp b/src/GPU/pair_eam_gpu.cpp index abd721a327..e458ea2020 100644 --- a/src/GPU/pair_eam_gpu.cpp +++ b/src/GPU/pair_eam_gpu.cpp @@ -50,11 +50,11 @@ int eam_gpu_init(const int ntypes, double host_cutforcesq, void eam_gpu_clear(); int** eam_gpu_compute_n(const int ago, const int inum_full, const int nall, double **host_x, int *host_type, double *sublo, - double *subhi, tagint *tag, int **nspecial, tagint **special, - const bool eflag, const bool vflag, const bool eatom, - const bool vatom, int &host_start, int **ilist, - int **jnum, const double cpu_time, bool &success, - int &inum, void **fp_ptr); + double *subhi, tagint *tag, int **nspecial, + tagint **special, const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, + int **ilist, int **jnum, const double cpu_time, + bool &success, int &inum, void **fp_ptr); void eam_gpu_compute(const int ago, const int inum_full, const int nlocal, const int nall,double **host_x, int *host_type, int *ilist, int *numj, int **firstneigh, @@ -185,10 +185,11 @@ void PairEAMGPU::init_style() if (atom->molecular) maxspecial=atom->maxspecial; int fp_size; + int mnf = 5e-2 * neighbor->oneatom; int success = eam_gpu_init(atom->ntypes+1, cutforcesq, type2rhor, type2z2r, type2frho, rhor_spline, z2r_spline, frho_spline, rdr, rdrho, rhomax, nrhor, nrho, nz2r, nfrho, nr, - atom->nlocal, atom->nlocal+atom->nghost, 300, + atom->nlocal, atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, fp_size); GPU_EXTRA::check_flag(success,error,world); @@ -197,7 +198,6 @@ void PairEAMGPU::init_style() neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; } - if (fp_size == sizeof(double)) fp_single = false; else diff --git a/src/GPU/pair_gauss_gpu.cpp b/src/GPU/pair_gauss_gpu.cpp index 89b79f11f2..fe9dd9ba96 100644 --- a/src/GPU/pair_gauss_gpu.cpp +++ b/src/GPU/pair_gauss_gpu.cpp @@ -41,15 +41,16 @@ using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition int gauss_gpu_init(const int ntypes, double **cutsq, double **host_a, - double **b, double **offset, double *special_lj, const int nlocal, - const int nall, const int max_nbors, const int maxspecial, - const double cell_size, int &gpu_mode, FILE *screen); + double **b, double **offset, double *special_lj, + const int nlocal, const int nall, const int max_nbors, + const int maxspecial, const double cell_size, + int &gpu_mode, FILE *screen); void gauss_gpu_reinit(const int ntypes, double **cutsq, double **host_a, - double **b, double **offset); + double **b, double **offset); void gauss_gpu_clear(); -int ** gauss_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, +int ** gauss_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, @@ -158,9 +159,10 @@ void PairGaussGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = gauss_gpu_init(atom->ntypes+1, cutsq, a, b, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_gayberne_gpu.cpp b/src/GPU/pair_gayberne_gpu.cpp index 19a4c77032..81966824ba 100644 --- a/src/GPU/pair_gayberne_gpu.cpp +++ b/src/GPU/pair_gayberne_gpu.cpp @@ -49,12 +49,12 @@ int gb_gpu_init(const int ntypes, const double gamma, const double upsilon, double **host_lj3, double **host_lj4, double **offset, double *special_lj, const int nlocal, const int nall, const int max_nbors, const int maxspecial, - const double cell_size, int &gpu_mode, FILE *screen); + const double cell_size, int &gpu_mode, FILE *screen); void gb_gpu_clear(); int ** gb_gpu_compute_n(const int ago, const int inum, const int nall, double **host_x, int *host_type, double *sublo, - double *subhi, tagint *tag, int **nspecial, tagint **special, - const bool eflag, const bool vflag, + double *subhi, tagint *tag, int **nspecial, + tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, bool &success, double **host_quat); @@ -207,10 +207,11 @@ void PairGayBerneGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = gb_gpu_init(atom->ntypes+1, gamma, upsilon, mu, shape2, well, cutsq, sigma, epsilon, lshape, form, lj1, lj2, lj3, lj4, offset, force->special_lj, - atom->nlocal, atom->nlocal+atom->nghost, 300, + atom->nlocal, atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_lj96_cut_gpu.cpp b/src/GPU/pair_lj96_cut_gpu.cpp index e15a78fb91..84d1a1a10d 100644 --- a/src/GPU/pair_lj96_cut_gpu.cpp +++ b/src/GPU/pair_lj96_cut_gpu.cpp @@ -160,9 +160,10 @@ void PairLJ96CutGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = lj96_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_lj_charmm_coul_charmm_gpu.cpp b/src/GPU/pair_lj_charmm_coul_charmm_gpu.cpp new file mode 100644 index 0000000000..4f8679a8a8 --- /dev/null +++ b/src/GPU/pair_lj_charmm_coul_charmm_gpu.cpp @@ -0,0 +1,309 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://lammps.sandia.gov/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + 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 "gpu_extra.h" + +using namespace LAMMPS_NS; + +// External functions from cuda library for atom decomposition + +int crm_gpu_init(const int ntypes, double cut_bothsq, double **host_lj1, + double **host_lj2, double **host_lj3, double **host_lj4, + double *special_lj, const int nlocal, + const int nall, const int max_nbors, const int maxspecial, + const double cell_size, int &gpu_mode, FILE *screen, + double host_cut_ljsq, double host_cut_coulsq, + double *host_special_coul, const double qqrd2e, + const double cut_lj_innersq, const double cut_coul_innersq, + const double denom_lj, const double denom_coul, + double **epsilon, double **sigma, + const bool mix_arithmetic); +void crm_gpu_clear(); +int ** crm_gpu_compute_n(const int ago, const int inum, + const int nall, double **host_x, int *host_type, + double *sublo, double *subhi, tagint *tag, + int **nspecial, tagint **special, const bool eflag, + const bool vflag, const bool eatom, + const bool vatom, int &host_start, int **ilist, + int **jnum, const double cpu_time, bool &success, + double *host_q, double *boxlo, double *prd); +void crm_gpu_compute(const int ago, const int inum, const int nall, + double **host_x, int *host_type, int *ilist, int *numj, + int **firstneigh, const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, + const double cpu_time, bool &success, double *host_q, + const int nlocal, double *boxlo, double *prd); +double crm_gpu_bytes(); + +/* ---------------------------------------------------------------------- */ + +PairLJCharmmCoulCharmmGPU::PairLJCharmmCoulCharmmGPU(LAMMPS *lmp) : + PairLJCharmmCoulCharmm(lmp), gpu_mode(GPU_FORCE) +{ + reinitflag = 0; + cpu_time = 0.0; + GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); +} + +/* ---------------------------------------------------------------------- + free all arrays +------------------------------------------------------------------------- */ + +PairLJCharmmCoulCharmmGPU::~PairLJCharmmCoulCharmmGPU() +{ + crm_gpu_clear(); +} + +/* ---------------------------------------------------------------------- */ + +void PairLJCharmmCoulCharmmGPU::compute(int eflag, int vflag) +{ + if (eflag || vflag) ev_setup(eflag,vflag); + else evflag = vflag_fdotr = 0; + + int nall = atom->nlocal + atom->nghost; + int inum, host_start; + + bool success = true; + int *ilist, *numneigh, **firstneigh; + if (gpu_mode != GPU_FORCE) { + inum = atom->nlocal; + firstneigh = crm_gpu_compute_n(neighbor->ago, inum, nall, atom->x, + atom->type, domain->sublo, domain->subhi, + atom->tag, atom->nspecial, atom->special, + eflag, vflag, eflag_atom, vflag_atom, + host_start, &ilist, &numneigh, cpu_time, + success, atom->q, domain->boxlo, + domain->prd); + } else { + inum = list->inum; + ilist = list->ilist; + numneigh = list->numneigh; + firstneigh = list->firstneigh; + crm_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type, + ilist, numneigh, firstneigh, eflag, vflag, eflag_atom, + vflag_atom, host_start, cpu_time, success, atom->q, + atom->nlocal, domain->boxlo, domain->prd); + } + if (!success) + error->one(FLERR,"Insufficient memory on accelerator"); + + if (host_startq_flag) + error->all(FLERR, + "Pair style lj/charmm/coul/long/gpu requires atom attribute q"); + if (force->newton_pair) + error->all(FLERR, + "Cannot use newton pair with lj/charmm/coul/long/gpu pair style"); + + // Repeat cutsq calculation because done after call to init_style + + double cut; + for (int i = 1; i <= atom->ntypes; i++) { + for (int j = i; j <= atom->ntypes; j++) { + if (setflag[i][j] != 0 || (setflag[i][i] != 0 && setflag[j][j] != 0)) + cut = init_one(i,j); + } + } + + cut_lj_innersq = cut_lj_inner * cut_lj_inner; + cut_coul_innersq = cut_coul_inner * cut_coul_inner; + cut_ljsq = cut_lj * cut_lj; + cut_coulsq = cut_coul * cut_coul; + cut_bothsq = MAX(cut_ljsq,cut_coulsq); + + denom_lj = (cut_ljsq-cut_lj_innersq) * (cut_ljsq-cut_lj_innersq) * + (cut_ljsq-cut_lj_innersq); + denom_lj = 1.0 / denom_lj; + + denom_coul = (cut_coulsq-cut_coul_innersq) * (cut_coulsq-cut_coul_innersq) * + (cut_coulsq-cut_coul_innersq); + denom_coul = 1.0 / denom_coul; + + double cell_size = sqrt(cut_bothsq) + neighbor->skin; + + int maxspecial=0; + if (atom->molecular) + maxspecial=atom->maxspecial; + + bool arithmetic = true; + for (int i = 1; i < atom->ntypes + 1; i++) + for (int j = i + 1; j < atom->ntypes + 1; j++) { + if (epsilon[i][j] != sqrt(epsilon[i][i] * epsilon[j][j])) + arithmetic = false; + if (sigma[i][j] != 0.5 * (sigma[i][i] + sigma[j][j])) + arithmetic = false; + } + + int mnf = 5e-2 * neighbor->oneatom; + int success = crm_gpu_init(atom->ntypes+1, cut_bothsq, lj1, lj2, lj3, lj4, + force->special_lj, atom->nlocal, + atom->nlocal+atom->nghost, mnf, maxspecial, + cell_size, gpu_mode, screen, cut_ljsq, + cut_coulsq, force->special_coul, force->qqrd2e, + cut_lj_innersq,cut_coul_innersq,denom_lj, + denom_coul,epsilon,sigma,arithmetic); + GPU_EXTRA::check_flag(success,error,world); + + if (gpu_mode == GPU_FORCE) { + int irequest = neighbor->request(this,instance_me); + neighbor->requests[irequest]->half = 0; + neighbor->requests[irequest]->full = 1; + } +} + +/* ---------------------------------------------------------------------- */ + +double PairLJCharmmCoulCharmmGPU::memory_usage() +{ + double bytes = Pair::memory_usage(); + return bytes + crm_gpu_bytes(); +} + +/* ---------------------------------------------------------------------- */ + +void PairLJCharmmCoulCharmmGPU::cpu_compute(int start, int inum, int eflag, + 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; + double rsq,r2inv,r6inv,forcecoul,forcelj,factor_coul,factor_lj; + double philj,switch1,switch2; + int *jlist; + + evdwl = ecoul = 0.0; + + double **x = atom->x; + double **f = atom->f; + double *q = atom->q; + int *type = atom->type; + double *special_coul = force->special_coul; + double *special_lj = force->special_lj; + double qqrd2e = force->qqrd2e; + + // loop over neighbors of my atoms + + for (ii = start; ii < inum; ii++) { + i = ilist[ii]; + qtmp = q[i]; + xtmp = x[i][0]; + ytmp = x[i][1]; + ztmp = x[i][2]; + itype = type[i]; + jlist = firstneigh[i]; + jnum = numneigh[i]; + + for (jj = 0; jj < jnum; jj++) { + j = jlist[jj]; + factor_lj = special_lj[sbmask(j)]; + factor_coul = special_coul[sbmask(j)]; + j &= NEIGHMASK; + + delx = xtmp - x[j][0]; + dely = ytmp - x[j][1]; + delz = ztmp - x[j][2]; + rsq = delx*delx + dely*dely + delz*delz; + + if (rsq < cut_bothsq) { + r2inv = 1.0/rsq; + + if (rsq < cut_coulsq) { + forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv); + if (rsq > cut_coul_innersq) { + switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) * + (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) * denom_coul; + forcecoul *= switch1; + } + } else forcecoul = 0.0; + + if (rsq < cut_ljsq) { + r6inv = r2inv*r2inv*r2inv; + jtype = type[j]; + forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]); + if (rsq > cut_lj_innersq) { + switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) * + (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) * denom_lj; + switch2 = 12.0*rsq * (cut_ljsq-rsq) * + (rsq-cut_lj_innersq) * denom_lj; + philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]); + forcelj = forcelj*switch1 + philj*switch2; + } + } else forcelj = 0.0; + + fpair = (factor_coul*forcecoul + factor_lj*forcelj) * r2inv; + + f[i][0] += delx*fpair; + f[i][1] += dely*fpair; + f[i][2] += delz*fpair; + + if (eflag) { + if (rsq < cut_coulsq) { + ecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv); + if (rsq > cut_coul_innersq) { + switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) * + (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) * + denom_coul; + ecoul *= switch1; + } + ecoul *= factor_coul; + } else ecoul = 0.0; + + if (rsq < cut_ljsq) { + evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]); + if (rsq > cut_lj_innersq) { + switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) * + (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) * denom_lj; + evdwl *= switch1; + } + evdwl *= factor_lj; + } else evdwl = 0.0; + } + + if (evflag) ev_tally_full(i,evdwl,ecoul,fpair,delx,dely,delz); + } + } + } +} diff --git a/src/GPU/pair_lj_charmm_coul_charmm_gpu.h b/src/GPU/pair_lj_charmm_coul_charmm_gpu.h new file mode 100644 index 0000000000..d80730ca5c --- /dev/null +++ b/src/GPU/pair_lj_charmm_coul_charmm_gpu.h @@ -0,0 +1,62 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef PAIR_CLASS + +PairStyle(lj/charmm/coul/charmm/gpu,PairLJCharmmCoulCharmmGPU) + +#else + +#ifndef LMP_PAIR_LJ_CHARMM_COUL_CHARMM_GPU_H +#define LMP_PAIR_LJ_CHARMM_COUL_CHARMM_GPU_H + +#include "pair_lj_charmm_coul_charmm.h" + +namespace LAMMPS_NS { + +class PairLJCharmmCoulCharmmGPU : public PairLJCharmmCoulCharmm { + public: + PairLJCharmmCoulCharmmGPU(LAMMPS *lmp); + ~PairLJCharmmCoulCharmmGPU(); + void cpu_compute(int, int, int, int, int *, int *, int **); + void compute(int, int); + void init_style(); + double memory_usage(); + + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + + private: + int gpu_mode; + double cpu_time; +}; + +} +#endif +#endif + +/* ERROR/WARNING messages: + +E: Insufficient memory on accelerator + +There is insufficient memory on one of the devices specified for the gpu +package + +E: Pair style lj/charmm/coul/long/gpu requires atom attribute q + +The atom style defined does not have this attribute. + +E: Cannot use newton pair with lj/charmm/coul/long/gpu pair style + +Self-explanatory. + +*/ diff --git a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp index b89e4d4574..9753404d5e 100644 --- a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp @@ -203,9 +203,10 @@ void PairLJCharmmCoulLongGPU::init_style() arithmetic = false; } + int mnf = 5e-2 * neighbor->oneatom; int success = crml_gpu_init(atom->ntypes+1, cut_bothsq, lj1, lj2, lj3, lj4, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e, g_ewald, cut_lj_innersq,denom_lj,epsilon,sigma, diff --git a/src/GPU/pair_lj_class2_coul_long_gpu.cpp b/src/GPU/pair_lj_class2_coul_long_gpu.cpp index 50183196f8..3fc6195fa8 100644 --- a/src/GPU/pair_lj_class2_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_class2_coul_long_gpu.cpp @@ -188,9 +188,10 @@ void PairLJClass2CoulLongGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = c2cl_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e, g_ewald); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_lj_class2_gpu.cpp b/src/GPU/pair_lj_class2_gpu.cpp index 55fdc2d43d..cf8158ce5f 100644 --- a/src/GPU/pair_lj_class2_gpu.cpp +++ b/src/GPU/pair_lj_class2_gpu.cpp @@ -157,9 +157,10 @@ void PairLJClass2GPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = lj96_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_lj_cubic_gpu.cpp b/src/GPU/pair_lj_cubic_gpu.cpp index 35062a5d71..a0dd9498c6 100644 --- a/src/GPU/pair_lj_cubic_gpu.cpp +++ b/src/GPU/pair_lj_cubic_gpu.cpp @@ -52,18 +52,18 @@ int ljcb_gpu_init(const int ntypes, double **cutsq, double **cut_inner_sq, const double cell_size, int &gpu_mode, FILE *screen); void ljcb_gpu_clear(); -int ** ljcb_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, - tagint **special, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - int **ilist, int **jnum, - const double cpu_time, bool &success); +int ** ljcb_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, + tagint **special, const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, + int **ilist, int **jnum, const double cpu_time, + bool &success); void ljcb_gpu_compute(const int ago, const int inum, const int nall, - double **host_x, int *host_type, int *ilist, int *numj, - int **firstneigh, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - const double cpu_time, bool &success); + double **host_x, int *host_type, int *ilist, int *numj, + int **firstneigh, const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, + const double cpu_time, bool &success); double ljcb_gpu_bytes(); /* ---------------------------------------------------------------------- */ @@ -165,10 +165,11 @@ void PairLJCubicGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = ljcb_gpu_init(atom->ntypes+1, cutsq, cut_inner_sq, cut_inner, sigma, epsilon, lj1, lj2, lj3, lj4, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_lj_cut_coul_cut_gpu.cpp b/src/GPU/pair_lj_cut_coul_cut_gpu.cpp index e4823a3ea4..7932a352b3 100644 --- a/src/GPU/pair_lj_cut_coul_cut_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_cut_gpu.cpp @@ -48,16 +48,16 @@ int ljc_gpu_init(const int ntypes, double **cutsq, double **host_lj1, double **host_cut_ljsq, double **host_cut_coulsq, double *host_special_coul, const double qqrd2e); void ljc_gpu_clear(); -int ** ljc_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, +int ** ljc_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, bool &success, double *host_q, double *boxlo, double *prd); void ljc_gpu_compute(const int ago, const int inum, - const int nall, double **host_x, int *host_type, + const int nall, double **host_x, int *host_type, int *ilist, int *numj, int **firstneigh, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, const double cpu_time, @@ -168,9 +168,10 @@ void PairLJCutCoulCutGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = ljc_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_lj_cut_coul_debye_gpu.cpp b/src/GPU/pair_lj_cut_coul_debye_gpu.cpp index 1f7ae9af01..eb8e2c9c7f 100644 --- a/src/GPU/pair_lj_cut_coul_debye_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_debye_gpu.cpp @@ -41,17 +41,17 @@ using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition int ljcd_gpu_init(const int ntypes, double **cutsq, double **host_lj1, - double **host_lj2, double **host_lj3, double **host_lj4, - double **offset, double *special_lj, const int nlocal, - const int nall, const int max_nbors, const int maxspecial, - const double cell_size, int &gpu_mode, FILE *screen, - double **host_cut_ljsq, double **host_cut_coulsq, - double *host_special_coul, const double qqrd2e, - const double kappa); + double **host_lj2, double **host_lj3, double **host_lj4, + double **offset, double *special_lj, const int nlocal, + const int nall, const int max_nbors, const int maxspecial, + const double cell_size, int &gpu_mode, FILE *screen, + double **host_cut_ljsq, double **host_cut_coulsq, + double *host_special_coul, const double qqrd2e, + const double kappa); void ljcd_gpu_clear(); int ** ljcd_gpu_compute_n(const int ago, const int inum, const int nall, - double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, @@ -170,9 +170,10 @@ void PairLJCutCoulDebyeGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = ljcd_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e, kappa); diff --git a/src/GPU/pair_lj_cut_coul_dsf_gpu.cpp b/src/GPU/pair_lj_cut_coul_dsf_gpu.cpp index 6c25412ae8..e071245a56 100644 --- a/src/GPU/pair_lj_cut_coul_dsf_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_dsf_gpu.cpp @@ -59,9 +59,9 @@ int ljd_gpu_init(const int ntypes, double **cutsq, double **host_lj1, const double e_shift, const double f_shift, const double alpha); void ljd_gpu_clear(); -int ** ljd_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, +int ** ljd_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, @@ -185,9 +185,10 @@ void PairLJCutCoulDSFGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = ljd_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e, e_shift, f_shift, alpha); diff --git a/src/GPU/pair_lj_cut_coul_long_gpu.cpp b/src/GPU/pair_lj_cut_coul_long_gpu.cpp index 50776de795..cff48afd1e 100644 --- a/src/GPU/pair_lj_cut_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_long_gpu.cpp @@ -58,8 +58,8 @@ int ljcl_gpu_init(const int ntypes, double **cutsq, double **host_lj1, double *host_special_coul, const double qqrd2e, const double g_ewald); void ljcl_gpu_reinit(const int ntypes, double **cutsq, double **host_lj1, - double **host_lj2, double **host_lj3, double **host_lj4, - double **offset, double **host_lj_cutsq); + double **host_lj2, double **host_lj3, double **host_lj4, + double **offset, double **host_lj_cutsq); void ljcl_gpu_clear(); int ** ljcl_gpu_compute_n(const int ago, const int inum, const int nall, double **host_x, int *host_type, @@ -193,9 +193,10 @@ void PairLJCutCoulLongGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = ljcl_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e, g_ewald); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_lj_cut_coul_msm_gpu.cpp b/src/GPU/pair_lj_cut_coul_msm_gpu.cpp index 33ba418533..d686ea4d88 100644 --- a/src/GPU/pair_lj_cut_coul_msm_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_msm_gpu.cpp @@ -48,15 +48,17 @@ int ljcm_gpu_init(const int ntypes, double **cutsq, double **host_lj1, const int nall, const int max_nbors, const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen, double **host_cut_ljsq, double host_cut_coulsq, - double *host_special_coul, const int order, const double qqrd2e); + double *host_special_coul, const int order, + const double qqrd2e); void ljcm_gpu_clear(); -int ** ljcm_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, +int ** ljcm_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, - bool &success, double *host_q, double *boxlo, double *prd); + bool &success, double *host_q, double *boxlo, + double *prd); void ljcm_gpu_compute(const int ago, const int inum, const int nall, double **host_x, int *host_type, int *ilist, int *numj, int **firstneigh, const bool eflag, const bool vflag, @@ -177,12 +179,13 @@ void PairLJCutCoulMSMGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = ljcm_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4, force->kspace->get_gcons(), force->kspace->get_dgcons(), offset, force->special_lj, atom->nlocal, atom->nlocal+atom->nghost, - 300, maxspecial, cell_size, gpu_mode, screen, + mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->kspace->order, force->qqrd2e); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_lj_cut_dipole_cut_gpu.cpp b/src/GPU/pair_lj_cut_dipole_cut_gpu.cpp index ae93cd9010..16eef6e8e8 100644 --- a/src/GPU/pair_lj_cut_dipole_cut_gpu.cpp +++ b/src/GPU/pair_lj_cut_dipole_cut_gpu.cpp @@ -173,9 +173,10 @@ void PairLJCutDipoleCutGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = dpl_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_lj_cut_dipole_long_gpu.cpp b/src/GPU/pair_lj_cut_dipole_long_gpu.cpp index 8e7d5baddc..b7c29cedb8 100644 --- a/src/GPU/pair_lj_cut_dipole_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_dipole_long_gpu.cpp @@ -52,29 +52,30 @@ using namespace MathConst; // External functions from cuda library for atom decomposition int dplj_gpu_init(const int ntypes, double **cutsq, double **host_lj1, - double **host_lj2, double **host_lj3, double **host_lj4, - double **offset, double *special_lj, const int nlocal, - const int nall, const int max_nbors, const int maxspecial, - const double cell_size, int &gpu_mode, FILE *screen, - double **host_cut_ljsq, const double host_cut_coulsq, - double *host_special_coul, const double qqrd2e, const double g_ewald); + double **host_lj2, double **host_lj3, double **host_lj4, + double **offset, double *special_lj, const int nlocal, + const int nall, const int max_nbors, const int maxspecial, + const double cell_size, int &gpu_mode, FILE *screen, + double **host_cut_ljsq, const double host_cut_coulsq, + double *host_special_coul, const double qqrd2e, + const double g_ewald); void dplj_gpu_clear(); int ** dplj_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, - int **nspecial, tagint **special, const bool eflag, - const bool vflag, const bool eatom, const bool vatom, - int &host_start, int **ilist, int **jnum, - const double cpu_time, bool &success, - double *host_q, double **host_mu, - double *boxlo, double *prd); + const int nall, double **host_x, int *host_type, + double *sublo, double *subhi, tagint *tag, + int **nspecial, tagint **special, const bool eflag, + const bool vflag, const bool eatom, const bool vatom, + int &host_start, int **ilist, int **jnum, + const double cpu_time, bool &success, + double *host_q, double **host_mu, + double *boxlo, double *prd); void dplj_gpu_compute(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - int *ilist, int *numj, int **firstneigh, - const bool eflag, const bool vflag, const bool eatom, - const bool vatom, int &host_start, const double cpu_time, - bool &success, double *host_q, double **host_mu, - const int nlocal, double *boxlo, double *prd); + const int nall, double **host_x, int *host_type, + int *ilist, int *numj, int **firstneigh, + const bool eflag, const bool vflag, const bool eatom, + const bool vatom, int &host_start, const double cpu_time, + bool &success, double *host_q, double **host_mu, + const int nlocal, double *boxlo, double *prd); double dplj_gpu_bytes(); /* ---------------------------------------------------------------------- */ @@ -196,9 +197,10 @@ void PairLJCutDipoleLongGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = dplj_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e, g_ewald); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_lj_cut_gpu.cpp b/src/GPU/pair_lj_cut_gpu.cpp index 2b2773b920..edd2a7feb0 100644 --- a/src/GPU/pair_lj_cut_gpu.cpp +++ b/src/GPU/pair_lj_cut_gpu.cpp @@ -47,13 +47,13 @@ int ljl_gpu_init(const int ntypes, double **cutsq, double **host_lj1, const double cell_size, int &gpu_mode, FILE *screen); void ljl_gpu_reinit(const int ntypes, double **cutsq, double **host_lj1, - double **host_lj2, double **host_lj3, double **host_lj4, - double **offset); + double **host_lj2, double **host_lj3, double **host_lj4, + double **offset); void ljl_gpu_clear(); -int ** ljl_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, +int ** ljl_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, @@ -164,9 +164,10 @@ void PairLJCutGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = ljl_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp index 3e852513b2..9584c6f68a 100644 --- a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp @@ -229,10 +229,11 @@ void PairLJCutTIP4PLongGPU::init_style() error->warning(FLERR,"Increasing communication cutoff for TIP4P GPU style"); } + int mnf = 5e-2 * neighbor->oneatom; int success = ljtip4p_long_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4, offset, force->special_lj, atom->nlocal, typeH, typeO, alpha, qdist, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, cut_coulsqplus, force->special_coul, force->qqrd2e, diff --git a/src/GPU/pair_lj_expand_coul_long_gpu.cpp b/src/GPU/pair_lj_expand_coul_long_gpu.cpp index 533f9d9070..da0c720c74 100644 --- a/src/GPU/pair_lj_expand_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_expand_coul_long_gpu.cpp @@ -50,31 +50,31 @@ using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition int ljecl_gpu_init(const int ntypes, double **cutsq, double **host_lj1, - double **host_lj2, double **host_lj3, double **host_lj4, - double **offset, double **shift, double *special_lj, const int nlocal, - const int nall, const int max_nbors, const int maxspecial, - const double cell_size, int &gpu_mode, FILE *screen, - double **host_cut_ljsq, double host_cut_coulsq, - double *host_special_coul, const double qqrd2e, - const double g_ewald); + double **host_lj2, double **host_lj3, double **host_lj4, + double **offset, double **shift, double *special_lj, + const int nlocal, const int nall, const int max_nbors, + const int maxspecial, const double cell_size, + int &gpu_mode, FILE *screen, double **host_cut_ljsq, + double host_cut_coulsq, double *host_special_coul, + const double qqrd2e, const double g_ewald); int ljecl_gpu_reinit(const int ntypes, double **cutsq, double **host_lj1, - double **host_lj2, double **host_lj3, double **host_lj4, - double **offset, double **shift, double **host_lj_cutsq); + double **host_lj2, double **host_lj3, double **host_lj4, + double **offset, double **shift, double **host_lj_cutsq); void ljecl_gpu_clear(); int ** ljecl_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, - int **nspecial, tagint **special, const bool eflag, - const bool vflag, const bool eatom, const bool vatom, - int &host_start, int **ilist, int **jnum, - const double cpu_time, bool &success, double *host_q, - double *boxlo, double *prd); + const int nall, double **host_x, int *host_type, + double *sublo, double *subhi, tagint *tag, + int **nspecial, tagint **special, const bool eflag, + const bool vflag, const bool eatom, const bool vatom, + int &host_start, int **ilist, int **jnum, + const double cpu_time, bool &success, double *host_q, + double *boxlo, double *prd); void ljecl_gpu_compute(const int ago, const int inum, const int nall, - double **host_x, int *host_type, int *ilist, int *numj, - int **firstneigh, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - const double cpu_time, bool &success, double *host_q, - const int nlocal, double *boxlo, double *prd); + double **host_x, int *host_type, int *ilist, int *numj, + int **firstneigh, const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, + const double cpu_time, bool &success, double *host_q, + const int nlocal, double *boxlo, double *prd); double ljecl_gpu_bytes(); /* ---------------------------------------------------------------------- */ @@ -193,9 +193,10 @@ void PairLJExpandCoulLongGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = ljecl_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4, offset, shift, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e, g_ewald); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_lj_expand_gpu.cpp b/src/GPU/pair_lj_expand_gpu.cpp index d3745dce56..0e86e41255 100644 --- a/src/GPU/pair_lj_expand_gpu.cpp +++ b/src/GPU/pair_lj_expand_gpu.cpp @@ -47,8 +47,8 @@ int lje_gpu_init(const int ntypes, double **cutsq, double **host_lj1, const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen); void lje_gpu_reinit(const int ntypes, double **cutsq, double **host_lj1, - double **host_lj2, double **host_lj3, double **host_lj4, - double **offset, double **shift); + double **host_lj2, double **host_lj3, double **host_lj4, + double **offset, double **shift); void lje_gpu_clear(); int ** lje_gpu_compute_n(const int ago, const int inum, const int nall, double **host_x, int *host_type, double *sublo, @@ -161,9 +161,10 @@ void PairLJExpandGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = lje_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4, offset, shift, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_lj_gromacs_gpu.cpp b/src/GPU/pair_lj_gromacs_gpu.cpp index 1bffbcd0b9..a605ebd6c4 100644 --- a/src/GPU/pair_lj_gromacs_gpu.cpp +++ b/src/GPU/pair_lj_gromacs_gpu.cpp @@ -43,16 +43,17 @@ using namespace LAMMPS_NS; int ljgrm_gpu_init(const int ntypes, double **cutsq, double **host_lj1, double **host_lj2, double **host_lj3, double **host_lj4, - double *special_lj, const int inum, - const int nall, const int max_nbors, const int maxspecial, + double *special_lj, const int inum, const int nall, + const int max_nbors, const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen, - double **host_ljsw1, double **host_ljsw2, double **host_ljsw3, - double **host_ljsw4, double **host_ljsw5, - double **cut_inner, double **cut_innersq); + double **host_ljsw1, double **host_ljsw2, + double **host_ljsw3, double **host_ljsw4, + double **host_ljsw5, double **cut_inner, + double **cut_innersq); void ljgrm_gpu_clear(); -int ** ljgrm_gpu_compute_n(const int ago, const int inum_full, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, +int ** ljgrm_gpu_compute_n(const int ago, const int inum_full, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, @@ -164,9 +165,10 @@ void PairLJGromacsGPU::init_style() if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = ljgrm_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, ljsw1, ljsw2, ljsw3, ljsw4, ljsw5, cut_inner, cut_inner_sq); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp b/src/GPU/pair_lj_sdk_coul_long_gpu.cpp index a3ba87c82e..df2310e904 100644 --- a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_sdk_coul_long_gpu.cpp @@ -197,9 +197,10 @@ void PairLJSDKCoulLongGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = sdkl_gpu_init(atom->ntypes+1, cutsq, lj_type, lj1, lj2, lj3, lj4, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e, g_ewald); diff --git a/src/GPU/pair_lj_sdk_gpu.cpp b/src/GPU/pair_lj_sdk_gpu.cpp index baf341c25a..5a1960e4c8 100644 --- a/src/GPU/pair_lj_sdk_gpu.cpp +++ b/src/GPU/pair_lj_sdk_gpu.cpp @@ -166,9 +166,10 @@ void PairLJSDKGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = sdk_gpu_init(atom->ntypes+1,cutsq,lj_type,lj1,lj2,lj3,lj4, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_lj_sf_dipole_sf_gpu.cpp b/src/GPU/pair_lj_sf_dipole_sf_gpu.cpp index 6f0ebc58b7..470c2f049e 100644 --- a/src/GPU/pair_lj_sf_dipole_sf_gpu.cpp +++ b/src/GPU/pair_lj_sf_dipole_sf_gpu.cpp @@ -48,21 +48,21 @@ int dplsf_gpu_init(const int ntypes, double **cutsq, double **host_lj1, double **host_cut_ljsq, double **host_cut_coulsq, double *host_special_coul, const double qqrd2e); void dplsf_gpu_clear(); -int ** dplsf_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, +int ** dplsf_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, bool &success, double *host_q, double **host_mu, double *boxlo, double *prd); -void dplsf_gpu_compute(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - int *ilist, int *numj, int **firstneigh, - const bool eflag, const bool vflag, const bool eatom, - const bool vatom, int &host_start, const double cpu_time, - bool &success, double *host_q, double **host_mu, const int nlocal, - double *boxlo, double *prd); +void dplsf_gpu_compute(const int ago, const int inum, const int nall, + double **host_x, int *host_type, int *ilist, int *numj, + int **firstneigh, const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, + const double cpu_time, bool &success, double *host_q, + double **host_mu, const int nlocal, double *boxlo, + double *prd); double dplsf_gpu_bytes(); /* ---------------------------------------------------------------------- */ @@ -172,9 +172,10 @@ void PairLJSFDipoleSFGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = dplsf_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_mie_cut_gpu.cpp b/src/GPU/pair_mie_cut_gpu.cpp index e9e6eedde8..05e92909da 100644 --- a/src/GPU/pair_mie_cut_gpu.cpp +++ b/src/GPU/pair_mie_cut_gpu.cpp @@ -47,9 +47,9 @@ int mie_gpu_init(const int ntypes, double **cutsq, double **host_mie1, const int nall, const int max_nbors, const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen); void mie_gpu_clear(); -int ** mie_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, +int ** mie_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, @@ -161,9 +161,10 @@ void PairMIECutGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = mie_gpu_init(atom->ntypes+1, cutsq, mie1, mie2, mie3, mie4, gamA, gamR, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_morse_gpu.cpp b/src/GPU/pair_morse_gpu.cpp index 75ca5627ba..d929c76930 100644 --- a/src/GPU/pair_morse_gpu.cpp +++ b/src/GPU/pair_morse_gpu.cpp @@ -46,9 +46,9 @@ int mor_gpu_init(const int ntypes, double **cutsq, double **host_morse1, const int nall, const int max_nbors, const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen); void mor_gpu_clear(); -int ** mor_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, +int ** mor_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, @@ -157,9 +157,10 @@ void PairMorseGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = mor_gpu_init(atom->ntypes+1, cutsq, morse1, r0, alpha, d0, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_resquared_gpu.cpp b/src/GPU/pair_resquared_gpu.cpp index b6c212da6f..c816ad9166 100644 --- a/src/GPU/pair_resquared_gpu.cpp +++ b/src/GPU/pair_resquared_gpu.cpp @@ -44,16 +44,16 @@ using namespace LAMMPS_NS; int re_gpu_init(const int ntypes, double **shape, double **well, double **cutsq, double **sigma, double **epsilon, - int **form, double **host_lj1, - double **host_lj2, double **host_lj3, double **host_lj4, - double **offset, double *special_lj, const int nlocal, - const int nall, const int max_nbors, const int maxspecial, - const double cell_size, int &gpu_mode, FILE *screen); + int **form, double **host_lj1, double **host_lj2, + double **host_lj3, double **host_lj4, double **offset, + double *special_lj, const int nlocal, const int nall, + const int max_nbors, const int maxspecial, + const double cell_size, int &gpu_mode, FILE *screen); void re_gpu_clear(); int ** re_gpu_compute_n(const int ago, const int inum, const int nall, double **host_x, int *host_type, double *sublo, - double *subhi, tagint *tag, int **nspecial, tagint **special, - const bool eflag, const bool vflag, + double *subhi, tagint *tag, int **nspecial, + tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, bool &success, double **host_quat); @@ -205,10 +205,11 @@ void PairRESquaredGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = re_gpu_init(atom->ntypes+1, shape1, well, cutsq, sigma, epsilon, form, lj1, lj2, lj3, lj4, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_soft_gpu.cpp b/src/GPU/pair_soft_gpu.cpp index c9eb55157a..5a3ad0c577 100644 --- a/src/GPU/pair_soft_gpu.cpp +++ b/src/GPU/pair_soft_gpu.cpp @@ -48,13 +48,13 @@ int soft_gpu_init(const int ntypes, double **cutsq, double **prefactor, void soft_gpu_reinit(const int ntypes, double **cutsq, double **host_prefactor, double **host_cut); void soft_gpu_clear(); -int ** soft_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, - tagint **special, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - int **ilist, int **jnum, - const double cpu_time, bool &success); +int ** soft_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, + tagint **special, const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, + int **ilist, int **jnum, + const double cpu_time, bool &success); void soft_gpu_compute(const int ago, const int inum, const int nall, double **host_x, int *host_type, int *ilist, int *numj, int **firstneigh, const bool eflag, const bool vflag, @@ -162,9 +162,10 @@ void PairSoftGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = soft_gpu_init(atom->ntypes+1, cutsq, prefactor, cut, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_sw_gpu.cpp b/src/GPU/pair_sw_gpu.cpp index 3d851121e0..7bfbe2810f 100644 --- a/src/GPU/pair_sw_gpu.cpp +++ b/src/GPU/pair_sw_gpu.cpp @@ -38,31 +38,27 @@ using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition -int sw_gpu_init(const int ntypes, const int inum, const int nall, const int max_nbors, - const double cell_size, int &gpu_mode, FILE *screen, - int* host_map, const int nelements, int*** host_elem2param, const int nparams, - const double* sw_epsilon, const double* sw_sigma, - const double* sw_lambda, const double* sw_gamma, - const double* sw_costheta, const double* sw_biga, - const double* sw_bigb, const double* sw_powerp, - const double* sw_powerq, const double* sw_cut, - const double* sw_cutsq); +int sw_gpu_init(const int ntypes, const int inum, const int nall, + const int max_nbors, const double cell_size, int &gpu_mode, + FILE *screen, double **ncutsq, double **ncut, double **sigma, + double **powerp, double **powerq, double **sigma_gamma, + double **c1, double **c2, double **c3,double **c4, + double **c5, double **c6, double ***lambda_epsilon, + double ***costheta, const int *map, int ***e2param); void sw_gpu_clear(); -int ** sw_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, +int ** sw_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, bool &success); -void sw_gpu_compute(const int ago, const int nloc, const int nall, const int ln, - double **host_x, int *host_type, int *ilist, int *numj, - int **firstneigh, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - const double cpu_time, bool &success); +void sw_gpu_compute(const int ago, const int nloc, const int nall, + const int ln, double **host_x, int *host_type, int *ilist, + int *numj, int **firstneigh, const bool eflag, + const bool vflag, const bool eatom, const bool vatom, + int &host_start, const double cpu_time, bool &success); double sw_gpu_bytes(); -extern double lmp_gpu_forces(double **f, double **tor, double *eatom, - double **vatom, double *virial, double &ecoul); #define MAXLINE 1024 #define DELTA 4 @@ -159,55 +155,84 @@ void PairSWGPU::init_style() if (force->newton_pair != 0) error->all(FLERR,"Pair style sw/gpu requires newton pair off"); - double *epsilon, *sigma, *lambda, *gamma; - double *biga, *bigb, *powerp, *powerq; - double *_cut, *_cutsq, *costheta; - epsilon = sigma = lambda = gamma = nullptr; - biga = bigb = powerp = powerq = nullptr; - _cut = _cutsq = costheta = nullptr; + double **c1, **c2, **c3, **c4, **c5, **c6; + double **ncutsq, **ncut, **sigma, **powerp, **powerq, **sigma_gamma; + double ***lambda_epsilon, ***costheta; + c1 = c2 = c3 = c4 = c5 = c6 = nullptr; + ncutsq = ncut = sigma = powerp = powerq = sigma_gamma = nullptr; + lambda_epsilon = costheta = nullptr; - memory->create(epsilon,nparams,"pair:epsilon"); - memory->create(sigma,nparams,"pair:sigma"); - memory->create(lambda,nparams,"pair:lambda"); - memory->create(gamma,nparams,"pair:gamma"); - memory->create(biga,nparams,"pair:biga"); - memory->create(bigb,nparams,"pair:bigb"); - memory->create(powerp,nparams,"pair:powerp"); - memory->create(powerq,nparams,"pair:powerq"); - memory->create(_cut,nparams,"pair:_cut"); - memory->create(_cutsq,nparams,"pair:_cutsq"); - memory->create(costheta,nparams,"pair:costheta"); + const int tp1 = atom->ntypes + 1; - for (int i = 0; i < nparams; i++) { - epsilon[i] = params[i].epsilon; - sigma[i] = params[i].sigma; - lambda[i] = params[i].lambda; - gamma[i] = params[i].gamma; - biga[i] = params[i].biga; - bigb[i] = params[i].bigb; - powerp[i] = params[i].powerp; - powerq[i] = params[i].powerq; - _cut[i] = params[i].cut; - _cutsq[i] = params[i].cutsq; - costheta[i] = params[i].costheta; + memory->create(ncutsq, tp1, tp1, "pair:ncutsq"); + memory->create(ncut, tp1, tp1, "pair:ncut"); + memory->create(sigma, tp1, tp1, "pair:sigma"); + memory->create(powerp, tp1, tp1, "pair:powerp"); + memory->create(powerq, tp1, tp1, "pair:powerq"); + memory->create(sigma_gamma, tp1, tp1, "pair:sigma_gamma"); + memory->create(c1, tp1, tp1, "pair:c1"); + memory->create(c2, tp1, tp1, "pair:c2"); + memory->create(c3, tp1, tp1, "pair:c3"); + memory->create(c4, tp1, tp1, "pair:c4"); + memory->create(c5, tp1, tp1, "pair:c5"); + memory->create(c6, tp1, tp1, "pair:c6"); + memory->create(lambda_epsilon, tp1, tp1, tp1, "pair:lambda_epsilon"); + memory->create(costheta, tp1, tp1, tp1, "pair:costheta"); + + for (int ii = 1; ii < tp1; ii++) { + int i = map[ii]; + for (int jj = 1; jj < tp1; jj++) { + int j = map[jj]; + if (i < 0 || j < 0) + continue; + else { + int ijparam = elem2param[i][j][j]; + ncutsq[ii][jj] = params[ijparam].cutsq; + ncut[ii][jj] = params[ijparam].cut; + sigma[ii][jj] = params[ijparam].sigma; + powerp[ii][jj] = params[ijparam].powerp; + powerq[ii][jj] = params[ijparam].powerq; + sigma_gamma[ii][jj] = params[ijparam].sigma_gamma; + c1[ii][jj] = params[ijparam].c1; + c2[ii][jj] = params[ijparam].c2; + c3[ii][jj] = params[ijparam].c3; + c4[ii][jj] = params[ijparam].c4; + c5[ii][jj] = params[ijparam].c5; + c6[ii][jj] = params[ijparam].c6; + } + + for (int kk = 1; kk < tp1; kk++) { + int k = map[kk]; + if (k < 0) + continue; + else { + int ijkparam = elem2param[i][j][k]; + costheta[ii][jj][kk] = params[ijkparam].costheta; + lambda_epsilon[ii][jj][kk] = params[ijkparam].lambda_epsilon; + } + } + } } - int success = sw_gpu_init(atom->ntypes+1, atom->nlocal, atom->nlocal+atom->nghost, 300, - cell_size, gpu_mode, screen, map, nelements, - elem2param, nparams, epsilon, - sigma, lambda, gamma, costheta, biga, bigb, - powerp, powerq, _cut, _cutsq); + int mnf = 5e-2 * neighbor->oneatom; + int success = sw_gpu_init(tp1, atom->nlocal, atom->nlocal+atom->nghost, mnf, + cell_size, gpu_mode, screen, ncutsq, ncut, sigma, + powerp, powerq, sigma_gamma, c1, c2, c3, c4, c5, + c6, lambda_epsilon, costheta, map, elem2param); - memory->destroy(epsilon); + memory->destroy(ncutsq); + memory->destroy(ncut); memory->destroy(sigma); - memory->destroy(lambda); - memory->destroy(gamma); - memory->destroy(biga); - memory->destroy(bigb); memory->destroy(powerp); memory->destroy(powerq); - memory->destroy(_cut); - memory->destroy(_cutsq); + memory->destroy(sigma_gamma); + memory->destroy(c1); + memory->destroy(c2); + memory->destroy(c3); + memory->destroy(c4); + memory->destroy(c5); + memory->destroy(c6); + memory->destroy(lambda_epsilon); memory->destroy(costheta); GPU_EXTRA::check_flag(success,error,world); @@ -218,7 +243,6 @@ void PairSWGPU::init_style() neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->ghost = 1; } - if (comm->cutghostuser < (2.0*cutmax + neighbor->skin)) { comm->cutghostuser=2.0*cutmax + neighbor->skin; if (comm->me == 0) diff --git a/src/GPU/pair_table_gpu.cpp b/src/GPU/pair_table_gpu.cpp index e3cb740e0e..05b76d9adb 100644 --- a/src/GPU/pair_table_gpu.cpp +++ b/src/GPU/pair_table_gpu.cpp @@ -231,9 +231,10 @@ void PairTableGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = table_gpu_init(atom->ntypes+1, cutsq, table_coeffs, table_data, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, tabstyle, ntables, tablength); GPU_EXTRA::check_flag(success,error,world); @@ -243,7 +244,6 @@ void PairTableGPU::init_style() neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; } - memory->destroy(table_coeffs); memory->destroy(table_data); } diff --git a/src/GPU/pair_tersoff_gpu.cpp b/src/GPU/pair_tersoff_gpu.cpp index 8758150956..e675ba6903 100644 --- a/src/GPU/pair_tersoff_gpu.cpp +++ b/src/GPU/pair_tersoff_gpu.cpp @@ -66,8 +66,6 @@ void tersoff_gpu_compute(const int ago, const int nlocal, const int nall, const bool vflag, const bool eatom, const bool vatom, int &host_start, const double cpu_time, bool &success); double tersoff_gpu_bytes(); -extern double lmp_gpu_forces(double **f, double **tor, double *eatom, - double **vatom, double *virial, double &ecoul); #define MAXLINE 1024 #define DELTA 4 @@ -216,8 +214,9 @@ void PairTersoffGPU::init_style() _cutsq[i] = params[i].cutsq; } + int mnf = 5e-2 * neighbor->oneatom; int success = tersoff_gpu_init(atom->ntypes+1, atom->nlocal, - atom->nlocal+atom->nghost, 300, + atom->nlocal+atom->nghost, mnf, cell_size, gpu_mode, screen, map, nelements, elem2param, nparams, lam1, lam2, lam3, powermint, biga, bigb, bigr, bigd, @@ -252,7 +251,6 @@ void PairTersoffGPU::init_style() neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->ghost = 1; } - if (comm->cutghostuser < (2.0*cutmax + neighbor->skin)) { comm->cutghostuser = 2.0*cutmax + neighbor->skin; if (comm->me == 0) diff --git a/src/GPU/pair_tersoff_mod_gpu.cpp b/src/GPU/pair_tersoff_mod_gpu.cpp index 71734c1c09..98a7248c1f 100644 --- a/src/GPU/pair_tersoff_mod_gpu.cpp +++ b/src/GPU/pair_tersoff_mod_gpu.cpp @@ -43,9 +43,10 @@ int tersoff_mod_gpu_init(const int ntypes, const int inum, const int nall, int* host_map, const int nelements, int*** host_elem2param, const int nparams, const double* ts_lam1, const double* ts_lam2, const double* ts_lam3, const double* ts_powermint, const double* ts_biga, const double* ts_bigb, - const double* ts_bigr, const double* ts_bigd, const double* ts_c1, const double* ts_c2, - const double* ts_c3, const double* ts_c4, const double* ts_c5, const double* ts_h, - const double* ts_beta, const double* ts_powern, const double* ts_powern_del, + const double* ts_bigr, const double* ts_bigd, const double* ts_c1, + const double* ts_c2, const double* ts_c3, const double* ts_c4, + const double* ts_c5, const double* ts_h, const double* ts_beta, + const double* ts_powern, const double* ts_powern_del, const double* ts_ca1, const double* ts_cutsq); void tersoff_mod_gpu_clear(); int ** tersoff_mod_gpu_compute_n(const int ago, const int inum_full, @@ -61,8 +62,6 @@ void tersoff_mod_gpu_compute(const int ago, const int nlocal, const int nall, const bool vflag, const bool eatom, const bool vatom, int &host_start, const double cpu_time, bool &success); double tersoff_mod_gpu_bytes(); -extern double lmp_gpu_forces(double **f, double **tor, double *eatom, - double **vatom, double *virial, double &ecoul); /* ---------------------------------------------------------------------- */ @@ -208,8 +207,9 @@ void PairTersoffMODGPU::init_style() _cutsq[i] = params[i].cutsq; } + int mnf = 5e-2 * neighbor->oneatom; int success = tersoff_mod_gpu_init(atom->ntypes+1, atom->nlocal, - atom->nlocal+atom->nghost, 300, + atom->nlocal+atom->nghost, mnf, cell_size, gpu_mode, screen, map, nelements, elem2param, nparams, lam1, lam2, lam3, powermint, biga, bigb, bigr, bigd, @@ -244,7 +244,6 @@ void PairTersoffMODGPU::init_style() neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->ghost = 1; } - if (comm->cutghostuser < (2.0*cutmax + neighbor->skin)) { comm->cutghostuser = 2.0*cutmax + neighbor->skin; if (comm->me == 0) diff --git a/src/GPU/pair_tersoff_zbl_gpu.cpp b/src/GPU/pair_tersoff_zbl_gpu.cpp index e662159fa8..e17b48fec5 100644 --- a/src/GPU/pair_tersoff_zbl_gpu.cpp +++ b/src/GPU/pair_tersoff_zbl_gpu.cpp @@ -69,8 +69,6 @@ void tersoff_zbl_gpu_compute(const int ago, const int nlocal, const int nall, const bool vflag, const bool eatom, const bool vatom, int &host_start, const double cpu_time, bool &success); double tersoff_zbl_gpu_bytes(); -extern double lmp_gpu_forces(double **f, double **tor, double *eatom, - double **vatom, double *virial, double &ecoul); /* ---------------------------------------------------------------------- */ @@ -225,8 +223,9 @@ void PairTersoffZBLGPU::init_style() _cutsq[i] = params[i].cutsq; } + int mnf = 5e-2 * neighbor->oneatom; int success = tersoff_zbl_gpu_init(atom->ntypes+1, atom->nlocal, - atom->nlocal+atom->nghost, 300, + atom->nlocal+atom->nghost, mnf, cell_size, gpu_mode, screen, map, nelements, elem2param, nparams, lam1, lam2, lam3, powermint, biga, bigb, bigr, bigd, @@ -266,7 +265,6 @@ void PairTersoffZBLGPU::init_style() neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->ghost = 1; } - if (comm->cutghostuser < (2.0*cutmax + neighbor->skin)) { comm->cutghostuser = 2.0*cutmax + neighbor->skin; if (comm->me == 0) diff --git a/src/GPU/pair_ufm_gpu.cpp b/src/GPU/pair_ufm_gpu.cpp index 87354acda9..f950bf11c3 100644 --- a/src/GPU/pair_ufm_gpu.cpp +++ b/src/GPU/pair_ufm_gpu.cpp @@ -43,28 +43,27 @@ using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition int ufml_gpu_init(const int ntypes, double **cutsq, double **host_uf1, - double **host_uf2, double **host_uf3, - double **offset, double *special_lj, const int nlocal, - const int nall, const int max_nbors, const int maxspecial, - const double cell_size, int &gpu_mode, FILE *screen); + double **host_uf2, double **host_uf3, + double **offset, double *special_lj, const int nlocal, + const int nall, const int max_nbors, const int maxspecial, + const double cell_size, int &gpu_mode, FILE *screen); int ufml_gpu_reinit(const int ntypes, double **cutsq, double **host_uf1, - double **host_uf2, double **host_uf3, - double **offset); + double **host_uf2, double **host_uf3, double **offset); void ufml_gpu_clear(); -int ** ufml_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, - tagint **special, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - int **ilist, int **jnum, - const double cpu_time, bool &success); +int ** ufml_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, + tagint **special, const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, + int **ilist, int **jnum, + const double cpu_time, bool &success); void ufml_gpu_compute(const int ago, const int inum, const int nall, - double **host_x, int *host_type, int *ilist, int *numj, - int **firstneigh, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - const double cpu_time, bool &success); + double **host_x, int *host_type, int *ilist, int *numj, + int **firstneigh, const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, + const double cpu_time, bool &success); double ufml_gpu_bytes(); /* ---------------------------------------------------------------------- */ @@ -166,9 +165,10 @@ void PairUFMGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = ufml_gpu_init(atom->ntypes+1, cutsq, uf1, uf2, uf3, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_vashishta_gpu.cpp b/src/GPU/pair_vashishta_gpu.cpp index df17b2091a..c5dd722974 100644 --- a/src/GPU/pair_vashishta_gpu.cpp +++ b/src/GPU/pair_vashishta_gpu.cpp @@ -38,34 +38,34 @@ using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition -int vashishta_gpu_init(const int ntypes, const int inum, const int nall, const int max_nbors, - const double cell_size, int &gpu_mode, FILE *screen, - int* host_map, const int nelements, int*** host_elem2param, const int nparams, - const double* cutsq, const double* r0, - const double* gamma, const double* eta, - const double* lam1inv, const double* lam4inv, - const double* zizj, const double* mbigd, - const double* dvrc, const double* big6w, - const double* heta, const double* bigh, - const double* bigw, const double* c0, - const double* costheta, const double* bigb, - const double* big2b, const double* bigc); +int vashishta_gpu_init(const int ntypes, const int inum, const int nall, + const int max_nbors, const double cell_size, + int &gpu_mode, FILE *screen, int* host_map, + const int nelements, int*** host_elem2param, + const int nparams, const double* cutsq, const double* r0, + const double* gamma, const double* eta, + const double* lam1inv, const double* lam4inv, + const double* zizj, const double* mbigd, + const double* dvrc, const double* big6w, + const double* heta, const double* bigh, + const double* bigw, const double* c0, + const double* costheta, const double* bigb, + const double* big2b, const double* bigc); void vashishta_gpu_clear(); -int ** vashishta_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, +int ** vashishta_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, bool &success); -void vashishta_gpu_compute(const int ago, const int nloc, const int nall, const int ln, - double **host_x, int *host_type, int *ilist, int *numj, - int **firstneigh, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - const double cpu_time, bool &success); +void vashishta_gpu_compute(const int ago, const int nloc, const int nall, + const int ln, double **host_x, int *host_type, + int *ilist, int *numj, int **firstneigh, + const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, + const double cpu_time, bool &success); double vashishta_gpu_bytes(); -extern double lmp_gpu_forces(double **f, double **tor, double *eatom, - double **vatom, double *virial, double &ecoul); /* ---------------------------------------------------------------------- */ @@ -214,7 +214,8 @@ void PairVashishtaGPU::init_style() big2b[i] = params[i].big2b; bigc[i] = params[i].bigc; } - int success = vashishta_gpu_init(atom->ntypes+1, atom->nlocal, atom->nlocal+atom->nghost, 500, + int mnf = 5e-2 * neighbor->oneatom; + int success = vashishta_gpu_init(atom->ntypes+1, atom->nlocal, atom->nlocal+atom->nghost, mnf, cell_size, gpu_mode, screen, map, nelements, elem2param, nparams, cutsq, r0, gamma, eta, lam1inv, lam4inv, zizj, mbigd, dvrc, big6w, heta, bigh, bigw, @@ -246,7 +247,6 @@ void PairVashishtaGPU::init_style() neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->ghost = 1; } - if (comm->cutghostuser < (2.0*cutmax + neighbor->skin)) { comm->cutghostuser=2.0*cutmax + neighbor->skin; if (comm->me == 0) diff --git a/src/GPU/pair_yukawa_colloid_gpu.cpp b/src/GPU/pair_yukawa_colloid_gpu.cpp index 8da3b48dd5..9322f95f44 100644 --- a/src/GPU/pair_yukawa_colloid_gpu.cpp +++ b/src/GPU/pair_yukawa_colloid_gpu.cpp @@ -41,24 +41,27 @@ using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition int ykcolloid_gpu_init(const int ntypes, double **cutsq, double **host_a, - double **host_offset, double *special_lj, const int inum, - const int nall, const int max_nbors, const int maxspecial, - const double cell_size, int &gpu_mode, FILE *screen, - const double kappa); + double **host_offset, double *special_lj, const int inum, + const int nall, const int max_nbors, + const int maxspecial, const double cell_size, + int &gpu_mode, FILE *screen, const double kappa); void ykcolloid_gpu_clear(); int ** ykcolloid_gpu_compute_n(const int ago, const int inum_full, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, - tagint **special, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - int **ilist, int **jnum, const double cpu_time, - bool &success, double *host_rad); + const int nall, double **host_x, int *host_type, + double *sublo, double *subhi, tagint *tag, + int **nspecial, tagint **special, + const bool eflag, const bool vflag, + const bool eatom, const bool vatom, + int &host_start, int **ilist, int **jnum, + const double cpu_time, bool &success, + double *host_rad); void ykcolloid_gpu_compute(const int ago, const int inum_full, - const int nall, double **host_x, int *host_type, - int *ilist, int *numj, int **firstneigh, - const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, - const double cpu_time, bool &success, double *host_rad); + const int nall, double **host_x, int *host_type, + int *ilist, int *numj, int **firstneigh, + const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, + const double cpu_time, bool &success, + double *host_rad); double ykcolloid_gpu_bytes(); /* ---------------------------------------------------------------------- */ @@ -167,9 +170,10 @@ void PairYukawaColloidGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = ykcolloid_gpu_init(atom->ntypes+1, cutsq, a, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, kappa); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_yukawa_gpu.cpp b/src/GPU/pair_yukawa_gpu.cpp index 8c133b068e..81304159a0 100644 --- a/src/GPU/pair_yukawa_gpu.cpp +++ b/src/GPU/pair_yukawa_gpu.cpp @@ -49,10 +49,10 @@ void yukawa_gpu_clear(); int ** yukawa_gpu_compute_n(const int ago, const int inum_full, const int nall, double **host_x, int *host_type, double *sublo, double *subhi, tagint *tag, int **nspecial, - tagint **special, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, - int &host_start, int **ilist, int **jnum, - const double cpu_time, bool &success); + tagint **special, const bool eflag, + const bool vflag, const bool eatom, + const bool vatom, int &host_start, int **ilist, + int **jnum, const double cpu_time, bool &success); void yukawa_gpu_compute(const int ago, const int inum_full, const int nall, double **host_x, int *host_type, int *ilist, int *numj, int **firstneigh, const bool eflag, const bool vflag, @@ -159,9 +159,10 @@ void PairYukawaGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = yukawa_gpu_init(atom->ntypes+1, cutsq, kappa, a, offset, force->special_lj, atom->nlocal, - atom->nlocal+atom->nghost, 300, maxspecial, + atom->nlocal+atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); diff --git a/src/GPU/pair_zbl_gpu.cpp b/src/GPU/pair_zbl_gpu.cpp index eda0c26614..93e0588285 100644 --- a/src/GPU/pair_zbl_gpu.cpp +++ b/src/GPU/pair_zbl_gpu.cpp @@ -50,9 +50,9 @@ int zbl_gpu_init(const int ntypes, double **cutsq, double **host_sw1, const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen); void zbl_gpu_clear(); -int ** zbl_gpu_compute_n(const int ago, const int inum, - const int nall, double **host_x, int *host_type, - double *sublo, double *subhi, tagint *tag, int **nspecial, +int ** zbl_gpu_compute_n(const int ago, const int inum, const int nall, + double **host_x, int *host_type, double *sublo, + double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, @@ -165,11 +165,12 @@ void PairZBLGPU::init_style() int maxspecial=0; if (atom->molecular) maxspecial=atom->maxspecial; + int mnf = 5e-2 * neighbor->oneatom; int success = zbl_gpu_init(atom->ntypes+1, cutsq, sw1, sw2, sw3, sw4, sw5, d1a, d2a, d3a, d4a, zze, cut_globalsq, cut_innersq, cut_inner, atom->nlocal, atom->nlocal+atom->nghost, - 300, maxspecial, cell_size, gpu_mode, screen); + mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success,error,world); if (gpu_mode == GPU_FORCE) { diff --git a/src/GPU/pppm_gpu.cpp b/src/GPU/pppm_gpu.cpp index cc7ef8841e..61d0144b73 100644 --- a/src/GPU/pppm_gpu.cpp +++ b/src/GPU/pppm_gpu.cpp @@ -80,9 +80,9 @@ FFT_SCALAR* PPPM_GPU_API(init)(const int nlocal, const int nall, FILE *screen, const bool respa, int &success); void PPPM_GPU_API(clear)(const double poisson_time); int PPPM_GPU_API(spread)(const int ago, const int nlocal, const int nall, - double **host_x, int *host_type, bool &success, - double *host_q, double *boxlo, const double delxinv, - const double delyinv, const double delzinv); + double **host_x, int *host_type, bool &success, + double *host_q, double *boxlo, const double delxinv, + const double delyinv, const double delzinv); void PPPM_GPU_API(interp)(const FFT_SCALAR qqrd2e_scale); double PPPM_GPU_API(bytes)(); void PPPM_GPU_API(forces)(double **f); @@ -208,9 +208,9 @@ void PPPMGPU::compute(int eflag, int vflag) if (triclinic == 0) { bool success = true; int flag=PPPM_GPU_API(spread)(nago, atom->nlocal, atom->nlocal + - atom->nghost, atom->x, atom->type, success, - atom->q, domain->boxlo, delxinv, delyinv, - delzinv); + atom->nghost, atom->x, atom->type, success, + atom->q, domain->boxlo, delxinv, delyinv, + delzinv); if (!success) error->one(FLERR,"Insufficient memory on accelerator"); if (flag != 0) @@ -402,7 +402,7 @@ void PPPMGPU::poisson_ik() work1[n++] = ZEROF; } - fft1->compute(work1,work1,1); + fft1->compute(work1,work1,FFT3d::FORWARD); // if requested, compute energy and virial contribution @@ -441,7 +441,7 @@ void PPPMGPU::poisson_ik() if (evflag_atom) poisson_peratom(); - // compute gradients of V(r) in each of 3 dims by transformimg -ik*V(k) + // compute gradients of V(r) in each of 3 dims by transformimg ik*V(k) // FFT leaves data in 3d brick decomposition // copy it into inner portion of vdx,vdy,vdz arrays @@ -451,12 +451,12 @@ void PPPMGPU::poisson_ik() for (k = nzlo_fft; k <= nzhi_fft; k++) for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { - work2[n] = fkx[i]*work1[n+1]; - work2[n+1] = -fkx[i]*work1[n]; + work2[n] = -fkx[i]*work1[n+1]; + work2[n+1] = fkx[i]*work1[n]; n += 2; } - fft2->compute(work2,work2,-1); + fft2->compute(work2,work2,FFT3d::BACKWARD); n = 0; int x_hi = nxhi_in * 4 + 3; @@ -473,12 +473,12 @@ void PPPMGPU::poisson_ik() for (k = nzlo_fft; k <= nzhi_fft; k++) for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { - work2[n] = fky[j]*work1[n+1]; - work2[n+1] = -fky[j]*work1[n]; + work2[n] = -fky[j]*work1[n+1]; + work2[n+1] = fky[j]*work1[n]; n += 2; } - fft2->compute(work2,work2,-1); + fft2->compute(work2,work2,FFT3d::BACKWARD); n = 0; for (k = nzlo_in; k <= nzhi_in; k++) @@ -494,12 +494,12 @@ void PPPMGPU::poisson_ik() for (k = nzlo_fft; k <= nzhi_fft; k++) for (j = nylo_fft; j <= nyhi_fft; j++) for (i = nxlo_fft; i <= nxhi_fft; i++) { - work2[n] = fkz[k]*work1[n+1]; - work2[n+1] = -fkz[k]*work1[n]; + work2[n] = -fkz[k]*work1[n+1]; + work2[n+1] = fkz[k]*work1[n]; n += 2; } - fft2->compute(work2,work2,-1); + fft2->compute(work2,work2,FFT3d::BACKWARD); n = 0; for (k = nzlo_in; k <= nzhi_in; k++) From d3123dd5c3025c6b173ccc11e5db8ba02d9351da Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 15 Feb 2021 08:37:38 -0800 Subject: [PATCH 248/384] Feb2021 GPU Package Update - Core LAMMPS Files --- src/MAKE/OPTIONS/Makefile.g++_openmpi | 4 +- src/MAKE/OPTIONS/Makefile.g++_serial | 4 +- src/MAKE/OPTIONS/Makefile.oneapi | 122 ++++++++++++++++++++++++++ src/atom.cpp | 33 +++++++ src/lammps.cpp | 4 +- 5 files changed, 161 insertions(+), 6 deletions(-) create mode 100644 src/MAKE/OPTIONS/Makefile.oneapi diff --git a/src/MAKE/OPTIONS/Makefile.g++_openmpi b/src/MAKE/OPTIONS/Makefile.g++_openmpi index 548994f832..75c12f9b38 100644 --- a/src/MAKE/OPTIONS/Makefile.g++_openmpi +++ b/src/MAKE/OPTIONS/Makefile.g++_openmpi @@ -7,12 +7,12 @@ SHELL = /bin/sh # specify flags and libraries needed for your compiler export OMPI_CXX = g++ -CC = mpicxx +CC = mpicxx -std=c++11 CCFLAGS = -g -O3 SHFLAGS = -fPIC DEPFLAGS = -M -LINK = mpicxx +LINK = mpicxx -std=c++11 LINKFLAGS = -g -O LIB = SIZE = size diff --git a/src/MAKE/OPTIONS/Makefile.g++_serial b/src/MAKE/OPTIONS/Makefile.g++_serial index 65de6a2c2c..4f6f0afe22 100644 --- a/src/MAKE/OPTIONS/Makefile.g++_serial +++ b/src/MAKE/OPTIONS/Makefile.g++_serial @@ -6,12 +6,12 @@ SHELL = /bin/sh # compiler/linker settings # specify flags and libraries needed for your compiler -CC = g++ +CC = g++ -std=c++11 CCFLAGS = -g -O3 SHFLAGS = -fPIC DEPFLAGS = -M -LINK = g++ +LINK = g++ -std=c++11 LINKFLAGS = -g -O LIB = SIZE = size diff --git a/src/MAKE/OPTIONS/Makefile.oneapi b/src/MAKE/OPTIONS/Makefile.oneapi new file mode 100644 index 0000000000..2524773a76 --- /dev/null +++ b/src/MAKE/OPTIONS/Makefile.oneapi @@ -0,0 +1,122 @@ +# oneapi = For Intel oneAPI builds with GPU package + +SHELL = /bin/sh + +# --------------------------------------------------------------------- +# compiler/linker settings +# specify flags and libraries needed for your compiler + +CC = mpiicpc -std=c++11 +OPTFLAGS = -xHost -O2 -fp-model fast=2 -no-prec-div -qoverride-limits +CCFLAGS = -qopenmp -qopenmp-simd -qno-offload -ansi-alias -restrict \ + -DLMP_INTEL_USELRT -DLMP_USE_MKL_RNG $(OPTFLAGS) \ + -I$(MKLROOT)/include +SHFLAGS = -fPIC +DEPFLAGS = -M + +LINK = mpiicpc -std=c++11 +LINKFLAGS = -qopenmp -qopenmp-simd $(OPTFLAGS) -L$(MKLROOT)/lib/intel64/ +LIB = -ltbbmalloc -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core +SIZE = size + +ARCHIVE = ar +ARFLAGS = -rc +SHLIBFLAGS = -shared + +# --------------------------------------------------------------------- +# LAMMPS-specific settings, all OPTIONAL +# specify settings for LAMMPS features you will use +# if you change any -D setting, do full re-compile after "make clean" + +# LAMMPS ifdef settings +# see possible settings in Section 3.5 of the manual + +LMP_INC = -DLAMMPS_GZIP + +# MPI library +# see discussion in Section 3.4 of the manual +# MPI wrapper compiler/linker can provide this info +# can point to dummy MPI library in src/STUBS as in Makefile.serial +# use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts +# INC = path for mpi.h, MPI compiler settings +# PATH = path for MPI library +# LIB = name of MPI library + +MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 +MPI_PATH = +MPI_LIB = + +# FFT library +# see discussion in Section 3.5.2 of manual +# can be left blank to use provided KISS FFT library +# INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings +# PATH = path for FFT library +# LIB = name of FFT library + +FFT_INC = -DFFT_MKL -DFFT_SINGLE +FFT_PATH = +FFT_LIB = + +# JPEG and/or PNG library +# see discussion in Section 3.5.4 of manual +# only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC +# INC = path(s) for jpeglib.h and/or png.h +# PATH = path(s) for JPEG library and/or PNG library +# LIB = name(s) of JPEG library and/or PNG library + +JPG_INC = +JPG_PATH = +JPG_LIB = + +# --------------------------------------------------------------------- +# build rules and dependencies +# do not edit this section + +include Makefile.package.settings +include Makefile.package + +EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) +EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) +EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB) +EXTRA_CPP_DEPENDS = $(PKG_CPP_DEPENDS) +EXTRA_LINK_DEPENDS = $(PKG_LINK_DEPENDS) + +# Path to src files + +vpath %.cpp .. +vpath %.h .. + +# Link target + +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ + +# Library targets + +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + @rm -f ../$(ARLIB) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) + +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) + +# Compilation rules + +%.o:%.cpp + $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< + +# Individual dependencies + +depend : fastdep.exe $(SRC) + @./fastdep.exe $(EXTRA_INC) -- $^ > .depend || exit 1 + +fastdep.exe: ../DEPEND/fastdep.c + cc -O -o $@ $< + +sinclude .depend diff --git a/src/atom.cpp b/src/atom.cpp index 3308d07267..e7b1df8240 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -40,6 +40,10 @@ #include "neigh_request.h" #endif +#ifdef LMP_GPU +#include "fix_gpu.h" +#endif + using namespace LAMMPS_NS; using namespace MathConst; @@ -2196,6 +2200,35 @@ void Atom::setup_sort_bins() } #endif + #ifdef LMP_GPU + if (userbinsize == 0.0) { + int ifix = modify->find_fix("package_gpu"); + if (ifix >= 0) { + const double subx = domain->subhi[0] - domain->sublo[0]; + const double suby = domain->subhi[1] - domain->sublo[1]; + const double subz = domain->subhi[2] - domain->sublo[2]; + + FixGPU *fix = static_cast(modify->fix[ifix]); + binsize = fix->binsize(subx, suby, subz, atom->nlocal, + neighbor->cutneighmax); + bininv = 1.0 / binsize; + + nbinx = static_cast (ceil(subx * bininv)); + nbiny = static_cast (ceil(suby * bininv)); + nbinz = static_cast (ceil(subz * bininv)); + if (domain->dimension == 2) nbinz = 1; + + if (nbinx == 0) nbinx = 1; + if (nbiny == 0) nbiny = 1; + if (nbinz == 0) nbinz = 1; + + bininvx = bininv; + bininvy = bininv; + bininvz = bininv; + } + } + #endif + if (1.0*nbinx*nbiny*nbinz > INT_MAX) error->one(FLERR,"Too many atom sorting bins"); diff --git a/src/lammps.cpp b/src/lammps.cpp index 6734fbd209..277ec4414f 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -842,12 +842,12 @@ void LAMMPS::post_create() if (strcmp(suffix,"omp") == 0 && !modify->check_package("OMP")) error->all(FLERR,"Using suffix omp without USER-OMP package installed"); - if (strcmp(suffix,"gpu") == 0) input->one("package gpu 1"); + if (strcmp(suffix,"gpu") == 0) input->one("package gpu 0"); if (strcmp(suffix,"intel") == 0) input->one("package intel 1"); if (strcmp(suffix,"omp") == 0) input->one("package omp 0"); if (suffix2) { - if (strcmp(suffix2,"gpu") == 0) input->one("package gpu 1"); + if (strcmp(suffix2,"gpu") == 0) input->one("package gpu 0"); if (strcmp(suffix2,"intel") == 0) input->one("package intel 1"); if (strcmp(suffix2,"omp") == 0) input->one("package omp 0"); } From d256614c9f642e2028e8996903e3b36d56ad6164 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Mon, 15 Feb 2021 13:19:25 -0500 Subject: [PATCH 249/384] Fix docs after PR #2592 --- doc/src/Python_atoms.rst | 2 +- doc/src/Python_module.rst | 12 ++++++------ doc/src/Python_neighbor.rst | 4 ++-- doc/src/Python_objects.rst | 12 ++++++------ python/lammps/core.py | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/src/Python_atoms.rst b/doc/src/Python_atoms.rst index 92b9677d16..be0d4ff800 100644 --- a/doc/src/Python_atoms.rst +++ b/doc/src/Python_atoms.rst @@ -50,7 +50,7 @@ against invalid accesses. **Numpy Methods**: - * :py:meth:`numpy.extract_atom() `: extract a per-atom quantity as numpy array + * :py:meth:`numpy.extract_atom() `: extract a per-atom quantity as numpy array .. tab:: PyLammps/IPyLammps API diff --git a/doc/src/Python_module.rst b/doc/src/Python_module.rst index 59be645cbd..d2564986de 100644 --- a/doc/src/Python_module.rst +++ b/doc/src/Python_module.rst @@ -61,7 +61,7 @@ functions. Below is a detailed documentation of the API. .. autoclass:: lammps.lammps :members: -.. autoclass:: lammps.numpy::numpy_wrapper +.. autoclass:: lammps.numpy_wrapper::numpy_wrapper :members: ---------- @@ -134,8 +134,8 @@ Style Constants to request from computes or fixes. See :cpp:enum:`_LMP_STYLE_CONST` for the equivalent constants in the C library interface. Used in :py:func:`lammps.extract_compute`, :py:func:`lammps.extract_fix`, and their NumPy variants - :py:func:`lammps.numpy.extract_compute() ` and - :py:func:`lammps.numpy.extract_fix() `. + :py:func:`lammps.numpy.extract_compute() ` and + :py:func:`lammps.numpy.extract_fix() `. .. _py_type_constants: @@ -149,8 +149,8 @@ Type Constants to request from computes or fixes. See :cpp:enum:`_LMP_TYPE_CONST` for the equivalent constants in the C library interface. Used in :py:func:`lammps.extract_compute`, :py:func:`lammps.extract_fix`, and their NumPy variants - :py:func:`lammps.numpy.extract_compute() ` and - :py:func:`lammps.numpy.extract_fix() `. + :py:func:`lammps.numpy.extract_compute() ` and + :py:func:`lammps.numpy.extract_fix() `. .. _py_vartype_constants: @@ -170,6 +170,6 @@ Classes representing internal objects :members: :no-undoc-members: -.. autoclass:: lammps.numpy::NumPyNeighList +.. autoclass:: lammps.numpy_wrapper::NumPyNeighList :members: :no-undoc-members: diff --git a/doc/src/Python_neighbor.rst b/doc/src/Python_neighbor.rst index 80651b608f..cba117ad20 100644 --- a/doc/src/Python_neighbor.rst +++ b/doc/src/Python_neighbor.rst @@ -14,5 +14,5 @@ Neighbor list access **NumPy Methods:** -* :py:meth:`lammps.numpy.get_neighlist() `: Get neighbor list for given index, which uses NumPy arrays for its element neighbor arrays -* :py:meth:`lammps.numpy.get_neighlist_element_neighbors() `: Get element in neighbor list and its neighbors (as numpy array) +* :py:meth:`lammps.numpy.get_neighlist() `: Get neighbor list for given index, which uses NumPy arrays for its element neighbor arrays +* :py:meth:`lammps.numpy.get_neighlist_element_neighbors() `: Get element in neighbor list and its neighbors (as numpy array) diff --git a/doc/src/Python_objects.rst b/doc/src/Python_objects.rst index ec29863d38..4c8161b8bd 100644 --- a/doc/src/Python_objects.rst +++ b/doc/src/Python_objects.rst @@ -36,9 +36,9 @@ computes, fixes, or variables in LAMMPS using the :py:mod:`lammps` module. Python subscripting. The values will be zero for atoms not in the specified group. - :py:meth:`lammps.numpy.extract_compute() `, - :py:meth:`lammps.numpy.extract_fix() `, and - :py:meth:`lammps.numpy.extract_variable() ` are + :py:meth:`lammps.numpy.extract_compute() `, + :py:meth:`lammps.numpy.extract_fix() `, and + :py:meth:`lammps.numpy.extract_variable() ` are equivalent NumPy implementations that return NumPy arrays instead of ``ctypes`` pointers. The :py:meth:`lammps.set_variable() ` method sets an @@ -54,9 +54,9 @@ computes, fixes, or variables in LAMMPS using the :py:mod:`lammps` module. **NumPy Methods**: - * :py:meth:`lammps.numpy.extract_compute() `: extract value(s) from a compute, return arrays as numpy arrays - * :py:meth:`lammps.numpy.extract_fix() `: extract value(s) from a fix, return arrays as numpy arrays - * :py:meth:`lammps.numpy.extract_variable() `: extract value(s) from a variable, return arrays as numpy arrays + * :py:meth:`lammps.numpy.extract_compute() `: extract value(s) from a compute, return arrays as numpy arrays + * :py:meth:`lammps.numpy.extract_fix() `: extract value(s) from a fix, return arrays as numpy arrays + * :py:meth:`lammps.numpy.extract_variable() `: extract value(s) from a variable, return arrays as numpy arrays .. tab:: PyLammps/IPyLammps API diff --git a/python/lammps/core.py b/python/lammps/core.py index d1bc7bc138..1a4650c285 100644 --- a/python/lammps/core.py +++ b/python/lammps/core.py @@ -1612,7 +1612,7 @@ class lammps(object): def get_neighlist(self, idx): """Returns an instance of :class:`NeighList` which wraps access to the neighbor list with the given index - See :py:meth:`lammps.numpy.get_neighlist() ` if you want to use + See :py:meth:`lammps.numpy.get_neighlist() ` if you want to use NumPy arrays instead of ``c_int`` pointers. :param idx: index of neighbor list From e2c32d12a44b53863d4ff2a6e0e27a0798e0b45c Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 15 Feb 2021 11:07:43 -0800 Subject: [PATCH 250/384] Feb2021 GPU Package Update - Documentation Files --- doc/src/Commands_fix.rst | 8 +- doc/src/Commands_pair.rst | 2 +- doc/src/Speed_gpu.rst | 40 ++++++++-- doc/src/Speed_packages.rst | 8 +- doc/src/fix_nh.rst | 6 +- doc/src/fix_nve.rst | 3 +- doc/src/fix_nve_asphere.rst | 3 +- doc/src/package.rst | 155 ++++++++++++++++++------------------ doc/src/pair_charmm.rst | 3 +- 9 files changed, 132 insertions(+), 96 deletions(-) diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index 26dcc1101c..4793568288 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -114,7 +114,7 @@ OPT. * :doc:`nph/eff ` * :doc:`nph/sphere (o) ` * :doc:`nphug ` - * :doc:`npt (iko) ` + * :doc:`npt (giko) ` * :doc:`npt/asphere (o) ` * :doc:`npt/body ` * :doc:`npt/cauchy ` @@ -122,8 +122,8 @@ OPT. * :doc:`npt/sphere (o) ` * :doc:`npt/uef ` * :doc:`numdiff ` - * :doc:`nve (iko) ` - * :doc:`nve/asphere (i) ` + * :doc:`nve (giko) ` + * :doc:`nve/asphere (gi) ` * :doc:`nve/asphere/noforce ` * :doc:`nve/awpmd ` * :doc:`nve/body ` @@ -138,7 +138,7 @@ OPT. * :doc:`nve/spin ` * :doc:`nve/tri ` * :doc:`nvk ` - * :doc:`nvt (iko) ` + * :doc:`nvt (giko) ` * :doc:`nvt/asphere (o) ` * :doc:`nvt/body ` * :doc:`nvt/eff ` diff --git a/doc/src/Commands_pair.rst b/doc/src/Commands_pair.rst index f5b1ef9b38..e7277e2bbb 100644 --- a/doc/src/Commands_pair.rst +++ b/doc/src/Commands_pair.rst @@ -122,7 +122,7 @@ OPT. * :doc:`lebedeva/z ` * :doc:`lennard/mdf ` * :doc:`line/lj ` - * :doc:`lj/charmm/coul/charmm (iko) ` + * :doc:`lj/charmm/coul/charmm (giko) ` * :doc:`lj/charmm/coul/charmm/implicit (ko) ` * :doc:`lj/charmm/coul/long (gikot) ` * :doc:`lj/charmm/coul/long/soft (o) ` diff --git a/doc/src/Speed_gpu.rst b/doc/src/Speed_gpu.rst index 56eb48cd0e..655f2e1958 100644 --- a/doc/src/Speed_gpu.rst +++ b/doc/src/Speed_gpu.rst @@ -45,12 +45,23 @@ to have the OpenCL headers and the (vendor neutral) OpenCL library installed. In OpenCL mode, the acceleration depends on having an `OpenCL Installable Client Driver (ICD) `_ installed. There can be multiple of them for the same or different hardware (GPUs, CPUs, Accelerators) installed at the same time. OpenCL refers to those -as 'platforms'. The GPU library will select the **first** suitable platform, -but this can be overridden using the device option of the :doc:`package ` +as 'platforms'. The GPU library will try to auto-select the best suitable platform, +but this can be overridden using the platform option of the :doc:`package ` command. run lammps/lib/gpu/ocl_get_devices to get a list of available platforms and devices with a suitable ICD available. -To compute and use this package in HIP mode, you have to have the AMD ROCm +To compile and use this package for Intel GPUs, OpenCL or the Intel oneAPI +HPC Toolkit can be installed using linux package managers. The latter also +provides optimized C++, MPI, and many other libraries and tools. See: + +* https://software.intel.com/content/www/us/en/develop/tools/oneapi/hpc-toolkit/download.html + +If you do not have a discrete GPU card installed, this package can still provide +significant speedups on some CPUs that include integrated GPUs. Additionally, for +many macs, OpenCL is already included with the OS and Makefiles are available +in the lib/gpu directory. + +To compile and use this package in HIP mode, you have to have the AMD ROCm software installed. Versions of ROCm older than 3.5 are currently deprecated by AMD. @@ -75,10 +86,20 @@ automatically if you create more MPI tasks/node than there are GPUs/mode. E.g. with 8 MPI tasks/node and 2 GPUs, each GPU will be shared by 4 MPI tasks. +The GPU package also has limited support for OpenMP for both +multi-threading and vectorization of routines that are run on the CPUs. +This requires that the GPU library and LAMMPS are built with flags to +enable OpenMP support (e.g. -fopenmp -fopenmp-simd). Some styles for +time integration are also available in the GPU package. These run +completely on the CPUs in full double precision, but exploit +multi-threading and vectorization for faster performance. + Use the "-sf gpu" :doc:`command-line switch `, which will automatically append "gpu" to styles that support it. Use the "-pk gpu Ng" :doc:`command-line switch ` to set Ng = # of -GPUs/node to use. +GPUs/node to use. If Ng is 0, the number is selected automatically as +the number of matching GPUs that have the highest number of compute +cores. .. code-block:: bash @@ -87,8 +108,8 @@ GPUs/node to use. mpirun -np 48 -ppn 12 lmp_machine -sf gpu -pk gpu 2 -in in.script # ditto on 4 16-core nodes Note that if the "-sf gpu" switch is used, it also issues a default -:doc:`package gpu 1 ` command, which sets the number of -GPUs/node to 1. +:doc:`package gpu 0 ` command, which will result in +automatic selection of the number of GPUs to use. Using the "-pk" switch explicitly allows for setting of the number of GPUs/node to use and additional options. Its syntax is the same as @@ -138,6 +159,13 @@ Likewise, you should experiment with the precision setting for the GPU library to see if single or mixed precision will give accurate results, since they will typically be faster. +MPI parallelism typically outperforms OpenMP parallelism, but in same cases +using fewer MPI tasks and multiple OpenMP threads with the GPU package +can give better performance. 3-body potentials can often perform better +with multiple OMP threads because the inter-process communication is +higher for these styles with the GPU package in order to allow +deterministic results. + **Guidelines for best performance:** * Using multiple MPI tasks per GPU will often give the best performance, diff --git a/doc/src/Speed_packages.rst b/doc/src/Speed_packages.rst index 600c4ac2b4..6210242413 100644 --- a/doc/src/Speed_packages.rst +++ b/doc/src/Speed_packages.rst @@ -16,7 +16,7 @@ These are the accelerator packages currently in LAMMPS, either as standard or user packages: +-----------------------------------------+-------------------------------------------------------+ -| :doc:`GPU Package ` | for NVIDIA GPUs as well as OpenCL support | +| :doc:`GPU Package ` | for GPUs via CUDA, OpenCL, or ROCm HIP | +-----------------------------------------+-------------------------------------------------------+ | :doc:`USER-INTEL Package ` | for Intel CPUs and Intel Xeon Phi | +-----------------------------------------+-------------------------------------------------------+ @@ -43,7 +43,7 @@ three kinds of hardware, via the listed packages: +-----------------+-----------------------------------------------------------------------------------------------------------------------------+ | Many-core CPUs | :doc:`USER-INTEL `, :doc:`KOKKOS `, :doc:`USER-OMP `, :doc:`OPT ` packages | +-----------------+-----------------------------------------------------------------------------------------------------------------------------+ -| NVIDIA/AMD GPUs | :doc:`GPU `, :doc:`KOKKOS ` packages | +| GPUs | :doc:`GPU `, :doc:`KOKKOS ` packages | +-----------------+-----------------------------------------------------------------------------------------------------------------------------+ | Intel Phi/AVX | :doc:`USER-INTEL `, :doc:`KOKKOS ` packages | +-----------------+-----------------------------------------------------------------------------------------------------------------------------+ @@ -154,8 +154,8 @@ Here is a brief summary of what the various packages provide. Details are in the individual accelerator sections. * Styles with a "gpu" suffix are part of the GPU package and can be run - on NVIDIA or AMD GPUs. The speed-up on a GPU depends on a variety of - factors, discussed in the accelerator sections. + on Intel, NVIDIA, or AMD GPUs. The speed-up on a GPU depends on a + variety of factors, discussed in the accelerator sections. * Styles with an "intel" suffix are part of the USER-INTEL package. These styles support vectorized single and mixed precision calculations, in addition to full double precision. In extreme cases, diff --git a/doc/src/fix_nh.rst b/doc/src/fix_nh.rst index 590211eda7..f40ce0c463 100644 --- a/doc/src/fix_nh.rst +++ b/doc/src/fix_nh.rst @@ -1,8 +1,10 @@ .. index:: fix nvt +.. index:: fix nvt/gpu .. index:: fix nvt/intel .. index:: fix nvt/kk .. index:: fix nvt/omp .. index:: fix npt +.. index:: fix npt/gpu .. index:: fix npt/intel .. index:: fix npt/kk .. index:: fix npt/omp @@ -13,12 +15,12 @@ fix nvt command =============== -Accelerator Variants: *nvt/intel*, *nvt/kk*, *nvt/omp* +Accelerator Variants: *nvt/gpu*, *nvt/intel*, *nvt/kk*, *nvt/omp* fix npt command =============== -Accelerator Variants: *npt/intel*, *npt/kk*, *npt/omp* +Accelerator Variants: *npt/gpu*, *npt/intel*, *npt/kk*, *npt/omp* fix nph command =============== diff --git a/doc/src/fix_nve.rst b/doc/src/fix_nve.rst index 71f8ec300f..ae472b1a38 100644 --- a/doc/src/fix_nve.rst +++ b/doc/src/fix_nve.rst @@ -1,4 +1,5 @@ .. index:: fix nve +.. index:: fix nve/gpu .. index:: fix nve/intel .. index:: fix nve/kk .. index:: fix nve/omp @@ -6,7 +7,7 @@ fix nve command =============== -Accelerator Variants: *nve/intel*, *nve/kk*, *nve/omp* +Accelerator Variants: *nve/gpu*, *nve/intel*, *nve/kk*, *nve/omp* Syntax """""" diff --git a/doc/src/fix_nve_asphere.rst b/doc/src/fix_nve_asphere.rst index af80460b32..c49de34d0b 100644 --- a/doc/src/fix_nve_asphere.rst +++ b/doc/src/fix_nve_asphere.rst @@ -1,10 +1,11 @@ .. index:: fix nve/asphere +.. index:: fix nve/asphere/gpu .. index:: fix nve/asphere/intel fix nve/asphere command ======================= -Accelerator Variants: *nve/asphere/intel* +Accelerator Variants: *nve/asphere/gpu*, *nve/asphere/intel* Syntax """""" diff --git a/doc/src/package.rst b/doc/src/package.rst index 6a5ff44077..a091759214 100644 --- a/doc/src/package.rst +++ b/doc/src/package.rst @@ -18,7 +18,7 @@ Syntax *gpu* args = Ngpu keyword value ... Ngpu = # of GPUs per node zero or more keyword/value pairs may be appended - keywords = *neigh* or *newton* or *pair/only* or *binsize* or *split* or *gpuID* or *tpa* or *device* or *blocksize* + keywords = *neigh* or *newton* or *pair/only* or *binsize* or *split* or *gpuID* or *tpa* or *blocksize* or *platform* or *device_type* or *ocl_args* *neigh* value = *yes* or *no* yes = neighbor list build on GPU (default) no = neighbor list build on CPU @@ -32,17 +32,18 @@ Syntax size = bin size for neighbor list construction (distance units) *split* = fraction fraction = fraction of atoms assigned to GPU (default = 1.0) - *gpuID* values = first last - first = ID of first GPU to be used on each node - last = ID of last GPU to be used on each node *tpa* value = Nthreads - Nthreads = # of GPU threads used per atom - *device* value = device_type or platform_id:device_type or platform_id:custom,val1,val2,val3,..,val13 - platform_id = numerical OpenCL platform id (default: -1) - device_type = *kepler* or *fermi* or *cypress* or *intel* or *phi* or *generic* or *custom* - val1,val2,... = custom OpenCL tune parameters (see below for details) + Nthreads = # of GPU vector lanes used per atom *blocksize* value = size size = thread block size for pair force computation + *platform* value = id + id = For OpenCL, platform ID for the GPU or accelerator + *gpuID* values = id + id = ID of first GPU to be used on each node + *device_type* value = *intelgpu* or *nvidiagpu* or *amdgpu* or *applegpu* or *generic* or *custom,val1,val2,...* + val1,val2,... = custom OpenCL accelerator configuration parameters (see below for details) + *ocl_args* value = args + args = List of additional OpenCL compiler arguments delimited by colons *intel* args = NPhi keyword value ... Nphi = # of co-processors per node zero or more keyword/value pairs may be appended @@ -112,12 +113,10 @@ Examples .. code-block:: LAMMPS - package gpu 1 + package gpu 0 package gpu 1 split 0.75 package gpu 2 split -1.0 - package gpu 1 device kepler - package gpu 1 device 2:generic - package gpu 1 device custom,32,4,8,256,11,128,256,128,32,64,8,128,128 + package gpu 0 device_type intelgpu package kokkos neigh half comm device package omp 0 neigh no package omp 4 @@ -174,10 +173,18 @@ simulations. The *gpu* style invokes settings associated with the use of the GPU package. -The *Ngpu* argument sets the number of GPUs per node. There must be -at least as many MPI tasks per node as GPUs, as set by the mpirun or -mpiexec command. If there are more MPI tasks (per node) -than GPUs, multiple MPI tasks will share each GPU. +The *Ngpu* argument sets the number of GPUs per node. If *Ngpu* is 0 +and no other keywords are specified, GPU or accelerator devices are +autoselected. In this process, all platforms are searched for +accelerator devices and GPUs are chosen if available. The device with +the highest number of compute cores is selected. The number of devices +is increased to be the number of matching accelerators with the same +number of compute cores. If there are more devices than MPI tasks, +the additional devices will be unused. The auto-selection of GPUs/ +accelerator devices and platforms can be restricted by specifying +a non-zero value for *Ngpu* and / or using the *gpuID*, *platform*, +and *device_type* keywords as described below. If there are more MPI +tasks (per node) than GPUs, multiple MPI tasks will share each GPU. Optional keyword/value pairs can also be specified. Each has a default value as listed below. @@ -212,18 +219,8 @@ overlapped with all other computations on the CPU. The *binsize* keyword sets the size of bins used to bin atoms in neighbor list builds performed on the GPU, if *neigh* = *yes* is set. -If *binsize* is set to 0.0 (the default), then bins = the size of the -pairwise cutoff + neighbor skin distance. This is 2x larger than the -LAMMPS default used for neighbor list building on the CPU. This will -be close to optimal for the GPU, so you do not normally need to use -this keyword. Note that if you use a longer-than-usual pairwise -cutoff, e.g. to allow for a smaller fraction of KSpace work with a -:doc:`long-range Coulombic solver ` because the GPU is -faster at performing pairwise interactions, then it may be optimal to -make the *binsize* smaller than the default. For example, with a -cutoff of 20\*sigma in LJ :doc:`units ` and a neighbor skin -distance of sigma, a *binsize* = 5.25\*sigma can be more efficient than -the default. +If *binsize* is set to 0.0 (the default), then the binsize is set +automatically using heuristics in the GPU package. The *split* keyword can be used for load balancing force calculations between CPU and GPU cores in GPU-enabled pair styles. If 0 < *split* < @@ -257,63 +254,69 @@ cores would perform force calculations for some fraction of the particles at the same time the GPUs performed force calculation for the other particles. -The *gpuID* keyword allows selection of which GPUs on each node will -be used for a simulation. The *first* and *last* values specify the -GPU IDs to use (from 0 to Ngpu-1). By default, first = 0 and last = -Ngpu-1, so that all GPUs are used, assuming Ngpu is set to the number -of physical GPUs. If you only wish to use a subset, set Ngpu to a -smaller number and first/last to a sub-range of the available GPUs. +The *gpuID* keyword is used to specify the first ID for the GPU or +other accelerator that LAMMPS will use. For example, if the ID is +1 and *Ngpu* is 3, GPUs 1-3 will be used. Device IDs should be +determined from the output of nvc_get_devices or ocl_get_devices +as provided in the lib/gpu directory. When using OpenCL with +accelerators that have main memory NUMA, the accelerators can be +split into smaller virtual accelerators for more efficient use +with MPI. -The *tpa* keyword sets the number of GPU thread per atom used to +The *tpa* keyword sets the number of GPU vector lanes per atom used to perform force calculations. With a default value of 1, the number of threads will be chosen based on the pair style, however, the value can be set explicitly with this keyword to fine-tune performance. For large cutoffs or with a small number of particles per GPU, increasing the value can improve performance. The number of threads per atom must -be a power of 2 and currently cannot be greater than 32. - -The *device* keyword can be used to tune parameters optimized for a -specific accelerator and platform when using OpenCL. OpenCL supports -the concept of a **platform**\ , which represents one or more devices that -share the same driver (e.g. there would be a different platform for -GPUs from different vendors or for CPU based accelerator support). -In LAMMPS only one platform can be active at a time and by default -the first platform with an accelerator is selected. This is equivalent -to using a platform ID of -1. The platform ID is a number corresponding -to the output of the ocl_get_devices tool. The platform ID is passed -to the GPU library, by prefixing the *device* keyword with that number -separated by a colon. For CUDA, the *device* keyword is ignored. -Currently, the device tuning support is limited to NVIDIA Kepler, NVIDIA -Fermi, AMD Cypress, Intel x86_64 CPU, Intel Xeon Phi, or a generic device. -More devices may be added later. The default device type can be -specified when building LAMMPS with the GPU library, via setting a -variable in the lib/gpu/Makefile that is used. - -In addition, a device type *custom* is available, which is followed by -13 comma separated numbers, which allows to set those tweakable parameters -from the package command. It can be combined with the (colon separated) -platform id. The individual settings are: - -* MEM_THREADS -* THREADS_PER_ATOM -* THREADS_PER_CHARGE -* BLOCK_PAIR -* MAX_SHARED_TYPES -* BLOCK_NBOR_BUILD -* BLOCK_BIO_PAIR -* BLOCK_ELLIPSE -* WARP_SIZE -* PPPM_BLOCK_1D -* BLOCK_CELL_2D -* BLOCK_CELL_ID -* MAX_BIO_SHARED_TYPES +be a power of 2 and currently cannot be greater than the SIMD width +for the GPU / accelerator. In the case it exceeds the SIMD width, it +will automatically be decreased to meet the restriction. The *blocksize* keyword allows you to tweak the number of threads used per thread block. This number should be a multiple of 32 (for GPUs) and its maximum depends on the specific GPU hardware. Typical choices are 64, 128, or 256. A larger block size increases occupancy of individual GPU cores, but reduces the total number of thread blocks, -thus may lead to load imbalance. +thus may lead to load imbalance. On modern hardware, the sensitivity +to the blocksize is typically low. + +The *platform* keyword is only used with OpenCL to specify the ID for +an OpenCL platform. See the output from ocl_get_devices in the lib/gpu +directory. In LAMMPS only one platform can be active at a time and by +default (id=-1) the platform is auto-selected to find the GPU with the +most compute cores. When *Ngpu* or other keywords are specified, the +auto-selection is appropriately restricted. For example, if *Ngpu* is +3, only platforms with at least 3 accelerators are considered. Similar +restrictions can be enforced by the *gpuID* and *device_type* keywords. + +The *device_type* keyword can be used for OpenCL to specify the type of +GPU to use or specify a custom configuration for an accelerator. In most +cases this selection will be automatic and there is no need to use the +keyword. The *applegpu* type is not specific to a particular GPU vendor, +but is separate due to the more restrictive Apple OpenCL implementation. +For expert users, to specify a custom configuration, the *custom* keyword +followed by the next parameters can be specified: + +CONFIG_ID, SIMD_SIZE, MEM_THREADS, SHUFFLE_AVAIL, FAST_MATH, +THREADS_PER_ATOM, THREADS_PER_CHARGE, THREADS_PER_THREE, BLOCK_PAIR, +BLOCK_BIO_PAIR, BLOCK_ELLIPSE, PPPM_BLOCK_1D, BLOCK_NBOR_BUILD, +BLOCK_CELL_2D, BLOCK_CELL_ID, MAX_SHARED_TYPES, MAX_BIO_SHARED_TYPES, +PPPM_MAX_SPLINE. + +CONFIG_ID can be 0. SHUFFLE_AVAIL in {0,1} indicates that inline-PTX +(NVIDIA) or OpenCL extensions (Intel) should be used for horizontal +vector operataions. FAST_MATH in {0,1} indicates that OpenCL fast math +optimizations are used during the build and HW-accelerated +transcendentals are used when available. THREADS_PER_* give the default +*tpa* values for ellipsoidal models, styles using charge, and any other +styles. The BLOCK_* parameters specify the block sizes for various +kernal calls and the MAX_*SHARED*_ parameters are used to determine the +amount of local shared memory to use for storing model parameters. + +For OpenCL, the routines are compiled at runtime for the specified GPU +or accelerator architecture. The *ocl_args* keyword can be used to +specify additional flags for the runtime build. ---------- @@ -658,9 +661,9 @@ Related commands Default """"""" -For the GPU package, the default is Ngpu = 1 and the option defaults +For the GPU package, the default is Ngpu = 0 and the option defaults are neigh = yes, newton = off, binsize = 0.0, split = 1.0, gpuID = 0 -to Ngpu-1, tpa = 1, and device = not used. These settings are made +to Ngpu-1, tpa = 1, and platform=-1. These settings are made automatically if the "-sf gpu" :doc:`command-line switch ` is used. If it is not used, you must invoke the package gpu command in your input script or via the "-pk gpu" :doc:`command-line switch `. diff --git a/doc/src/pair_charmm.rst b/doc/src/pair_charmm.rst index 6d81266a35..b3d2a2b878 100644 --- a/doc/src/pair_charmm.rst +++ b/doc/src/pair_charmm.rst @@ -1,4 +1,5 @@ .. index:: pair_style lj/charmm/coul/charmm +.. index:: pair_style lj/charmm/coul/charmm/gpu .. index:: pair_style lj/charmm/coul/charmm/intel .. index:: pair_style lj/charmm/coul/charmm/kk .. index:: pair_style lj/charmm/coul/charmm/omp @@ -19,7 +20,7 @@ pair_style lj/charmm/coul/charmm command ======================================== -Accelerator Variants: *lj/charmm/coul/charmm/intel*, *lj/charmm/coul/charmm/kk*, *lj/charmm/coul/charmm/omp* +Accelerator Variants: *lj/charmm/coul/charmm/gpu*, *lj/charmm/coul/charmm/intel*, *lj/charmm/coul/charmm/kk*, *lj/charmm/coul/charmm/omp* pair_style lj/charmm/coul/charmm/implicit command ================================================= From 515da322155891ce412e9c37684a221a6ef81783 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Mon, 15 Feb 2021 16:00:47 -0600 Subject: [PATCH 251/384] Fixup errors/issues in cmake/Modules/Packages/KIM.cmake --- cmake/Modules/Packages/KIM.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/Modules/Packages/KIM.cmake b/cmake/Modules/Packages/KIM.cmake index 83a96d02b8..5482d3071c 100644 --- a/cmake/Modules/Packages/KIM.cmake +++ b/cmake/Modules/Packages/KIM.cmake @@ -69,14 +69,14 @@ if(DOWNLOAD_KIM) BUILD_RPATH "${_rpath_prefix}/kim_build-prefix/lib" ) else() - if(KIM-API_FOUND AND KIM_API_VERSION VERSION_GREATER_EQUAL 2.2.0) + if(KIM-API_FOUND AND KIM-API_VERSION VERSION_GREATER_EQUAL 2.2.0) # For kim-api >= 2.2.0 - find_package(KIM-API ${KIM-API_MIN_VERSION} CONFIG REQUIRED) + find_package(KIM-API 2.2.0 CONFIG REQUIRED) target_link_libraries(lammps PRIVATE KIM-API::kim-api) else() # For kim-api 2.1.3 (consistent with previous version of this file) find_package(PkgConfig REQUIRED) - pkg_check_modules(KIM-API REQUIRED IMPORTED_TARGET libkim-api>=KIM-API_MIN_VERSION) + pkg_check_modules(KIM-API REQUIRED IMPORTED_TARGET libkim-api>=${KIM-API_MIN_VERSION}) target_link_libraries(lammps PRIVATE PkgConfig::KIM-API) endif() endif() From 44ab383917ef92e01a7be68662bf4c5aeb3d0c43 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 16 Feb 2021 11:14:22 -0500 Subject: [PATCH 252/384] Remove duplicate line in GPU/Install.sh Otherwise, after running $ make yes-all $ make no-lib the generated Makefile.package would still contain the LMP_GPU define --- src/GPU/Install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/src/GPU/Install.sh b/src/GPU/Install.sh index 1767623314..49b7eeda57 100755 --- a/src/GPU/Install.sh +++ b/src/GPU/Install.sh @@ -171,7 +171,6 @@ if (test $1 = 1) then sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(gpu_SYSINC) |' ../Makefile.package sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(gpu_SYSLIB) |' ../Makefile.package sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(gpu_SYSPATH) |' ../Makefile.package - sed -i -e 's|^PKG_INC =[ \t]*|&-DLMP_GPU |' ../Makefile.package fi if (test -e ../Makefile.package.settings) then From 224da33b228fb680f7059d0204803c4cc3bb3117 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 16 Feb 2021 12:29:50 -0500 Subject: [PATCH 253/384] Add missing fix_nh_gpu files to CMake build --- cmake/Modules/Packages/GPU.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index 4c52eee68b..b11c34b034 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -1,7 +1,9 @@ set(GPU_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/GPU) set(GPU_SOURCES ${GPU_SOURCES_DIR}/gpu_extra.h ${GPU_SOURCES_DIR}/fix_gpu.h - ${GPU_SOURCES_DIR}/fix_gpu.cpp) + ${GPU_SOURCES_DIR}/fix_gpu.cpp + ${GPU_SOURCES_DIR}/fix_nh_gpu.h + ${GPU_SOURCES_DIR}/fix_nh_gpu.cpp) target_compile_definitions(lammps PRIVATE -DLMP_GPU) set(GPU_API "opencl" CACHE STRING "API used by GPU package") From d85a5e3290deee10b48ad3206979080346cb6d25 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 16 Feb 2021 14:57:10 -0500 Subject: [PATCH 254/384] Remove OCL_TUNE option in CMake The GPU package now auto-detects these settings. --- cmake/Modules/Packages/GPU.cmake | 7 +------ doc/src/Build_extras.rst | 2 -- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index b11c34b034..8557cc7178 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -157,11 +157,6 @@ elseif(GPU_API STREQUAL "OPENCL") else() find_package(OpenCL REQUIRED) endif() - set(OCL_TUNE "generic" CACHE STRING "OpenCL Device Tuning") - set(OCL_TUNE_VALUES intel fermi kepler cypress generic) - set_property(CACHE OCL_TUNE PROPERTY STRINGS ${OCL_TUNE_VALUES}) - validate_option(OCL_TUNE OCL_TUNE_VALUES) - string(TOUPPER ${OCL_TUNE} OCL_TUNE) include(OpenCLUtils) set(OCL_COMMON_HEADERS ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_preprocessor.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_aux_fun1.h) @@ -205,7 +200,7 @@ elseif(GPU_API STREQUAL "OPENCL") add_library(gpu STATIC ${GPU_LIB_SOURCES}) target_link_libraries(gpu PRIVATE OpenCL::OpenCL) target_include_directories(gpu PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/gpu) - target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -D${OCL_TUNE}_OCL -DMPI_GERYON -DUCL_NO_EXIT) + target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -DMPI_GERYON -DUCL_NO_EXIT) target_compile_definitions(gpu PRIVATE -DUSE_OPENCL) target_link_libraries(lammps PRIVATE gpu) diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index 8f1154a167..cf15de74bd 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -120,8 +120,6 @@ CMake build -D GPU_API=value # value = opencl (default) or cuda or hip -D GPU_PREC=value # precision setting # value = double or mixed (default) or single - -D OCL_TUNE=value # hardware choice for GPU_API=opencl - # generic (default) or intel (Intel CPU) or fermi, kepler, cypress (NVIDIA) -D GPU_ARCH=value # primary GPU hardware choice for GPU_API=cuda # value = sm_XX, see below # default is sm_50 From 775446b60f85ddac4f2ecd8747064a95cd6eb972 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 16 Feb 2021 15:01:22 -0500 Subject: [PATCH 255/384] Add GERYON_NUMA_FISSION define in CMake --- cmake/Modules/Packages/GPU.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index 8557cc7178..76ad4190cf 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -200,7 +200,7 @@ elseif(GPU_API STREQUAL "OPENCL") add_library(gpu STATIC ${GPU_LIB_SOURCES}) target_link_libraries(gpu PRIVATE OpenCL::OpenCL) target_include_directories(gpu PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/gpu) - target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -DMPI_GERYON -DUCL_NO_EXIT) + target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -DMPI_GERYON -DGERYON_NUMA_FISSION -DUCL_NO_EXIT) target_compile_definitions(gpu PRIVATE -DUSE_OPENCL) target_link_libraries(lammps PRIVATE gpu) From 721c6d96ccb5eade289c25b6e7967ba1b24ca8bf Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 16 Feb 2021 00:36:37 -0800 Subject: [PATCH 256/384] Removing Makefile.opencl from lib/gpu --- lib/gpu/Makefile.opencl | 92 ----------------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 lib/gpu/Makefile.opencl diff --git a/lib/gpu/Makefile.opencl b/lib/gpu/Makefile.opencl deleted file mode 100644 index aa7806b542..0000000000 --- a/lib/gpu/Makefile.opencl +++ /dev/null @@ -1,92 +0,0 @@ -# /* ---------------------------------------------------------------------- -# Generic Linux Makefile for OpenCL -# ------------------------------------------------------------------------- */ - -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.opencl - -# this setting should match LAMMPS Makefile -# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL - -LMP_INC = -DLAMMPS_SMALLBIG - -# precision for GPU calculations -# -D_SINGLE_SINGLE # Single precision for all calculations -# -D_DOUBLE_DOUBLE # Double precision for all calculations -# -D_SINGLE_DOUBLE # Accumulation of forces, etc. in double - -OCL_PREC = -D_SINGLE_DOUBLE - -BIN_DIR = ./ -OBJ_DIR = ./ -LIB_DIR = ./ -AR = ar -BSH = /bin/sh - -# Compiler and linker settings - -# OCL_TUNE = -DFERMI_OCL # -- Uncomment for NVIDIA Fermi -# OCL_TUNE = -DKEPLER_OCL # -- Uncomment for NVIDIA Kepler -# OCL_TUNE = -DCYPRESS_OCL # -- Uncomment for AMD Cypress -OCL_TUNE = -DGENERIC_OCL # -- Uncomment for generic device - -OCL_INC = -I/usr/local/cuda/include # Path to CL directory -OCL_CPP = mpic++ $(DEFAULT_DEVICE) -g -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK $(LMP_INC) $(OCL_INC) -OCL_LINK = -lOpenCL -OCL = $(OCL_CPP) $(OCL_PREC) $(OCL_TUNE) -DUSE_OPENCL - -# Headers for Geryon -UCL_H = $(wildcard ./geryon/ucl*.h) -OCL_H = $(wildcard ./geryon/ocl*.h) $(UCL_H) lal_preprocessor.h -PRE1_H = lal_preprocessor.h lal_aux_fun1.h -ALL_H = $(OCL_H) $(wildcard ./lal_*.h) - -# Source files -SRCS := $(wildcard ./lal_*.cpp) -OBJS := $(subst ./,$(OBJ_DIR)/,$(SRCS:%.cpp=%.o)) -CUS := $(wildcard lal_*.cu) -KERS := $(subst ./,$(OBJ_DIR)/,$(CUS:lal_%.cu=%_cl.h)) -KERS := $(addprefix $(OBJ_DIR)/, $(KERS)) - -# targets - -GPU_LIB = $(LIB_DIR)/libgpu.a - -EXECS = $(BIN_DIR)/ocl_get_devices - -all: $(OBJ_DIR) $(KERS) $(GPU_LIB) $(EXECS) - -$(OBJ_DIR): - mkdir -p $@ - -# device code compilation - -$(OBJ_DIR)/%_cl.h: lal_%.cu $(PRE1_H) - $(BSH) ./geryon/file_to_cstr.sh $* $(PRE1_H) $< $@; - -# host code compilation - -$(OBJ_DIR)/lal_%.o: lal_%.cpp $(KERS) - $(OCL) -o $@ -c $< -I$(OBJ_DIR) - -# build libgpu.a - -$(GPU_LIB): $(OBJS) - $(AR) -crusv $(GPU_LIB) $(OBJS) - @cp $(EXTRAMAKE) Makefile.lammps - -# test app for querying device info - -$(BIN_DIR)/ocl_get_devices: ./geryon/ucl_get_devices.cpp $(OCL_H) - $(OCL) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_OPENCL $(OCL_LINK) - -clean: - -rm -f $(EXECS) $(GPU_LIB) $(OBJS) $(KERS) *.linkinfo - -veryclean: clean - -rm -rf *~ *.linkinfo - -cleanlib: - -rm -f $(EXECS) $(GPU_LIB) $(OBJS) $(KERS) *.linkinfo - From 7b943948eafa4039465599f24c5a626877fb0146 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 16 Feb 2021 06:51:50 -0500 Subject: [PATCH 257/384] Point users to the LAMMPS GitHub Releases page for downloading archives --- doc/src/Install_tarball.rst | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/doc/src/Install_tarball.rst b/doc/src/Install_tarball.rst index 7c9e834104..6f87df8a21 100644 --- a/doc/src/Install_tarball.rst +++ b/doc/src/Install_tarball.rst @@ -33,22 +33,19 @@ in its name, e.g. lammps-23Jun18. ---------- -You can also download a zip file via the "Clone or download" button on -the `LAMMPS GitHub site `_. The file name will be lammps-master.zip -which can be unzipped with the following command, to create -a lammps-master dir: +You can also download a compressed tar or zip archives from the +"Assets" sections of the `LAMMPS GitHub releases site `_. +The file name will be lammps-.zip which can be unzipped +with the following command, to create a lammps- dir: .. code-block:: bash $ unzip lammps*.zip -This version is the most up-to-date LAMMPS development version. It -will have the date of the most recent patch release (see the file -src/version.h). But it will also include any new bug-fixes or -features added since the last patch release. They will be included in -the next patch release tarball. +This version corresponds to the selected LAMMPS patch or stable +release. -.. _git: https://github.com/lammps/lammps +.. _git: https://github.com/lammps/lammps/releases ---------- From e7a37877c0debded037ae8dde9508ccd03f10307 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 16 Feb 2021 11:40:25 -0500 Subject: [PATCH 258/384] apply changes to doc Makefile to limit the impact of SNL network config changes --- doc/Makefile | 8 +++++--- doc/utils/requirements.txt | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 6032aff45f..7deaaf2a2e 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -47,6 +47,8 @@ HAS_PDFLATEX = YES endif endif +# override settings for PIP commands +# PIP_OPTIONS = --cert /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt --proxy http://proxy.mydomain.org #SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())') $(shell test -f $(BUILDDIR)/doxygen/xml/run.stamp && printf -- "-E") @@ -228,13 +230,13 @@ $(VENV): @( \ $(VIRTUALENV) -p $(PYTHON) $(VENV); \ . $(VENV)/bin/activate; \ - pip install --upgrade pip; \ - pip install -r $(BUILDDIR)/utils/requirements.txt; \ + pip $(PIP_OPTIONS) install --upgrade pip; \ + pip $(PIP_OPTIONS) install -r $(BUILDDIR)/utils/requirements.txt; \ deactivate;\ ) $(MATHJAX): - @git clone --depth 1 https://github.com/mathjax/MathJax.git $@ + @git clone --depth 1 git://github.com/mathjax/MathJax.git $@ $(TXT2RST) $(ANCHORCHECK): $(VENV) @( \ diff --git a/doc/utils/requirements.txt b/doc/utils/requirements.txt index e025e23b09..00fa6ecfaf 100644 --- a/doc/utils/requirements.txt +++ b/doc/utils/requirements.txt @@ -1,6 +1,6 @@ Sphinx sphinxcontrib-spelling -git+https://github.com/akohlmey/sphinx-fortran@parallel-read +git+git://github.com/akohlmey/sphinx-fortran@parallel-read sphinx_tabs breathe Pygments From b37ae4aea6560c9a61d2b9b935f356c865aabfd0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 16 Feb 2021 12:26:59 -0500 Subject: [PATCH 259/384] propagate PIP_OPTIONS change to CMake doc build module --- cmake/Modules/Documentation.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/Modules/Documentation.cmake b/cmake/Modules/Documentation.cmake index 189c32e301..5a42244b9e 100644 --- a/cmake/Modules/Documentation.cmake +++ b/cmake/Modules/Documentation.cmake @@ -50,9 +50,9 @@ if(BUILD_DOC) OUTPUT ${DOC_BUILD_DIR}/requirements.txt DEPENDS docenv ${DOCENV_REQUIREMENTS_FILE} COMMAND ${CMAKE_COMMAND} -E copy ${DOCENV_REQUIREMENTS_FILE} ${DOC_BUILD_DIR}/requirements.txt - COMMAND ${DOCENV_BINARY_DIR}/pip install --upgrade pip - COMMAND ${DOCENV_BINARY_DIR}/pip install --upgrade ${LAMMPS_DOC_DIR}/utils/converters - COMMAND ${DOCENV_BINARY_DIR}/pip install --use-feature=2020-resolver -r ${DOC_BUILD_DIR}/requirements.txt --upgrade + COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install --upgrade pip + COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install --upgrade ${LAMMPS_DOC_DIR}/utils/converters + COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install -r ${DOC_BUILD_DIR}/requirements.txt --upgrade ) # download mathjax distribution and unpack to folder "mathjax" From 57b630acbbf509baf9d2c5c6a6c2025728fa8274 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 16 Feb 2021 12:32:37 -0500 Subject: [PATCH 260/384] update documentation for building the manual with PIP_OPTIONS settings --- doc/src/Build_manual.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/src/Build_manual.rst b/doc/src/Build_manual.rst index 59e4e3235b..3bf0337b31 100644 --- a/doc/src/Build_manual.rst +++ b/doc/src/Build_manual.rst @@ -74,7 +74,11 @@ For the documentation build a python virtual environment is set up in the folder ``doc/docenv`` and various python packages are installed into that virtual environment via the ``pip`` tool. For rendering embedded LaTeX code also the `MathJax `_ JavaScript -engine needs to be downloaded. +engine needs to be downloaded. If you need to pass additional options +to the pip commands to work (e.g. to use a web proxy or to point to +additional SSL certificates) you can set them via the ``PIP_OPTIONS`` +environment variable or uncomment and edit the ``PIP_OPTIONS`` setting +at beginning of the makefile. The actual translation is then done via ``make`` commands in the doc folder. The following ``make`` commands are available: @@ -108,7 +112,10 @@ installation of the HTML manual pages into the "install" step when installing LAMMPS after the CMake build via ``cmake --build . --target install``. The documentation build is included in the default build target, but can also be requested independently with -``cmake --build . --target doc``. +``cmake --build . --target doc``. If you need to pass additional options +to the pip commands to work (e.g. to use a web proxy or to point to +additional SSL certificates) you can set them via the ``PIP_OPTIONS`` +environment variable. .. code-block:: bash From f929e57261da982e140526a7a41aa17baa825e8f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 16 Feb 2021 14:38:03 -0500 Subject: [PATCH 261/384] avoid loading mpi4py if the LAMMPS executable has been built without MPI --- python/lammps/core.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/python/lammps/core.py b/python/lammps/core.py index 1a4650c285..8639743a75 100644 --- a/python/lammps/core.py +++ b/python/lammps/core.py @@ -286,15 +286,16 @@ class lammps(object): self.lib.lammps_fix_external_set_energy_global = [c_void_p, c_char_p, c_double] self.lib.lammps_fix_external_set_virial_global = [c_void_p, c_char_p, POINTER(c_double)] - # detect if Python is using version of mpi4py that can pass a communicator - + # detect if Python is using a version of mpi4py that can pass communicators + # only needed if LAMMPS has been compiled with MPI support. self.has_mpi4py = False - try: - from mpi4py import __version__ as mpi4py_version - # tested to work with mpi4py versions 2 and 3 - self.has_mpi4py = mpi4py_version.split('.')[0] in ['2','3'] - except: - pass + if self.has_mpi_support: + try: + from mpi4py import __version__ as mpi4py_version + # tested to work with mpi4py versions 2 and 3 + self.has_mpi4py = mpi4py_version.split('.')[0] in ['2','3'] + except: + pass # if no ptr provided, create an instance of LAMMPS # don't know how to pass an MPI communicator from PyPar @@ -307,18 +308,18 @@ class lammps(object): if not ptr: - # with mpi4py v2, can pass MPI communicator to LAMMPS + # with mpi4py v2+, we can pass MPI communicators to LAMMPS # need to adjust for type of MPI communicator object # allow for int (like MPICH) or void* (like OpenMPI) - if self.has_mpi4py and self.has_mpi_support: + if self.has_mpi_support and self.has_mpi4py: from mpi4py import MPI self.MPI = MPI if comm: - if not self.has_mpi4py: - raise Exception('Python mpi4py version is not 2 or 3') if not self.has_mpi_support: raise Exception('LAMMPS not compiled with real MPI library') + if not self.has_mpi4py: + raise Exception('Python mpi4py version is not 2 or 3') if self.MPI._sizeof(self.MPI.Comm) == sizeof(c_int): MPI_Comm = c_int else: From 742eebec2d533ef113b595f656dcf6ce2073a181 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 16 Feb 2021 20:22:18 -0500 Subject: [PATCH 262/384] support checking the size of MPI communicators and fail if LAMMPS and mpi4py have a mismatch --- python/lammps/core.py | 4 ++++ src/library.cpp | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/python/lammps/core.py b/python/lammps/core.py index 8639743a75..e13bf9585b 100644 --- a/python/lammps/core.py +++ b/python/lammps/core.py @@ -325,6 +325,10 @@ class lammps(object): else: MPI_Comm = c_void_p + # Detect whether LAMMPS and mpi4py definitely use different MPI libs + if sizeof(MPI_Comm) != self.lib.lammps_config_has_mpi_support(): + raise Exception('Inconsistent MPI library in LAMMPS and mpi4py') + narg = 0 cargs = None if cmdargs: diff --git a/src/library.cpp b/src/library.cpp index 71bf205d90..2a7bbf07b3 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -4128,16 +4128,18 @@ void lammps_get_os_info(char *buffer, int buf_size) /* ---------------------------------------------------------------------- */ /** This function is used to query whether LAMMPS was compiled with - * a real MPI library or in serial. + * a real MPI library or in serial. For the real MPI library it + * reports the size of the MPI communicator in bytes (4 or 8), + * which allows to check for compatibility with a hosting code. * - * \return 0 when compiled with MPI STUBS, otherwise 1 */ + * \return 0 when compiled with MPI STUBS, otherwise the MPI_Comm size in bytes */ int lammps_config_has_mpi_support() { #ifdef MPI_STUBS return 0; #else - return 1; + return sizeof(MPI_Comm); #endif } From 61585b1eb6a0e9c1124a2aa718cc970f23607c27 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 17 Feb 2021 15:02:02 -0500 Subject: [PATCH 263/384] make MPI STUBS a C++ library so its symbols won't collide when loading a real MPI library --- cmake/CMakeLists.txt | 3 +-- cmake/Modules/Packages/MESSAGE.cmake | 5 ++--- src/STUBS/Makefile | 6 +++--- src/STUBS/Makefile.mingw32-cross | 6 +++--- src/STUBS/Makefile.mingw64-cross | 6 +++--- src/STUBS/{mpi.c => mpi.cpp} | 0 src/STUBS/mpi.h | 15 ++++++++------- 7 files changed, 20 insertions(+), 21 deletions(-) rename src/STUBS/{mpi.c => mpi.cpp} (100%) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 2d259791f2..aefa9cd597 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -156,8 +156,7 @@ if(BUILD_MPI) endif() endif() else() - enable_language(C) - file(GLOB MPI_SOURCES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.c) + file(GLOB MPI_SOURCES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.cpp) add_library(mpi_stubs STATIC ${MPI_SOURCES}) set_target_properties(mpi_stubs PROPERTIES OUTPUT_NAME lammps_mpi_stubs${LAMMPS_MACHINE}) target_include_directories(mpi_stubs PUBLIC $) diff --git a/cmake/Modules/Packages/MESSAGE.cmake b/cmake/Modules/Packages/MESSAGE.cmake index fb62763828..6ff4e322aa 100644 --- a/cmake/Modules/Packages/MESSAGE.cmake +++ b/cmake/Modules/Packages/MESSAGE.cmake @@ -2,9 +2,8 @@ if(LAMMPS_SIZES STREQUAL BIGBIG) message(FATAL_ERROR "The MESSAGE Package is not compatible with -DLAMMPS_BIGBIG") endif() option(MESSAGE_ZMQ "Use ZeroMQ in MESSAGE package" OFF) -file(GLOB_RECURSE cslib_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.F - ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.c - ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.cpp) +file(GLOB_RECURSE cslib_SOURCES + ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.cpp) add_library(cslib STATIC ${cslib_SOURCES}) target_compile_definitions(cslib PRIVATE -DLAMMPS_${LAMMPS_SIZES}) diff --git a/src/STUBS/Makefile b/src/STUBS/Makefile index 3c3c3b46d9..c9b6fdb65a 100644 --- a/src/STUBS/Makefile +++ b/src/STUBS/Makefile @@ -11,13 +11,13 @@ SHELL = /bin/sh # Files -SRC = mpi.c +SRC = mpi.cpp INC = mpi.h # Definitions EXE = libmpi_stubs.a -OBJ = $(SRC:.c=.o) +OBJ = $(SRC:.cpp=.o) # System-specific settings @@ -36,7 +36,7 @@ clean: # Compilation rules -.c.o: +.cpp.o: $(CC) $(CCFLAGS) -c $< # Individual dependencies diff --git a/src/STUBS/Makefile.mingw32-cross b/src/STUBS/Makefile.mingw32-cross index 4144954ec7..2934bbd468 100644 --- a/src/STUBS/Makefile.mingw32-cross +++ b/src/STUBS/Makefile.mingw32-cross @@ -5,17 +5,17 @@ SHELL = /bin/sh # Files -SRC = mpi.c +SRC = mpi.cpp INC = mpi.h # Definitions EXE = libmpi_mingw32.a -OBJ = $(SRC:%.c=%_mingw32.o) +OBJ = $(SRC:%.cpp=%_mingw32.o) # System-specific settings -CC = i686-w64-mingw32-gcc +CC = i686-w64-mingw32-g++ CCFLAGS = -O2 -Wall -march=i686 -mtune=generic -mfpmath=387 -mpc64 -I. ARCHIVE = i686-w64-mingw32-ar ARCHFLAG = rs diff --git a/src/STUBS/Makefile.mingw64-cross b/src/STUBS/Makefile.mingw64-cross index 70b971f262..e62d5dcbe1 100644 --- a/src/STUBS/Makefile.mingw64-cross +++ b/src/STUBS/Makefile.mingw64-cross @@ -5,17 +5,17 @@ SHELL = /bin/sh # Files -SRC = mpi.c +SRC = mpi.cpp INC = mpi.h # Definitions EXE = libmpi_mingw64.a -OBJ = $(SRC:%.c=%_mingw64.o) +OBJ = $(SRC:%.cpp=%_mingw64.o) # System-specific settings -CC = x86_64-w64-mingw32-gcc +CC = x86_64-w64-mingw32-g++ CCFLAGS = -O2 -Wall -march=core2 -mtune=core2 -msse2 -mpc64 -I. ARCHIVE = x86_64-w64-mingw32-ar ARCHFLAG = rs diff --git a/src/STUBS/mpi.c b/src/STUBS/mpi.cpp similarity index 100% rename from src/STUBS/mpi.c rename to src/STUBS/mpi.cpp diff --git a/src/STUBS/mpi.h b/src/STUBS/mpi.h index 063dc542be..28e897960d 100644 --- a/src/STUBS/mpi.h +++ b/src/STUBS/mpi.h @@ -16,12 +16,17 @@ #include -/* use C bindings for MPI interface */ +/* We compile STUBS with C++ so the symbols embedded + * the serial shared library will not collide with any + * corresponding symbols from a real MPI library (which + * uses C bindings). As a consequence the header *must* + * enforce compiling with C++ only. */ -#ifdef __cplusplus -extern "C" { +#ifndef __cplusplus +#error "MPI STUBS must be compiled with a C++ compiler" #endif + /* Dummy defs for MPI stubs */ #define MPI_COMM_WORLD 0 @@ -176,8 +181,4 @@ int MPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype recvtype, MPI_Comm comm); /* ---------------------------------------------------------------------- */ -#ifdef __cplusplus -} -#endif - #endif From 1552b0d1d66f1a305456a5a920d1a52204898e2f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 17 Feb 2021 15:19:24 -0500 Subject: [PATCH 264/384] update/correct documentation for changes to the STUBS library and its implications --- doc/src/Build_basics.rst | 2 +- doc/src/Build_link.rst | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/doc/src/Build_basics.rst b/doc/src/Build_basics.rst index cb6bd9f6aa..c7baa21e62 100644 --- a/doc/src/Build_basics.rst +++ b/doc/src/Build_basics.rst @@ -95,7 +95,7 @@ standard. A more detailed discussion of that is below. .. note:: - The file ``src/STUBS/mpi.c`` provides a CPU timer function + The file ``src/STUBS/mpi.cpp`` provides a CPU timer function called ``MPI_Wtime()`` that calls ``gettimeofday()``. If your operating system does not support ``gettimeofday()``, you will need to insert code to call another timer. Note that the diff --git a/doc/src/Build_link.rst b/doc/src/Build_link.rst index 3d66371304..5255620231 100644 --- a/doc/src/Build_link.rst +++ b/doc/src/Build_link.rst @@ -20,16 +20,8 @@ the suffix ``.so.0`` (or some other number). .. note:: Care should be taken to use the same MPI library for the calling code - and the LAMMPS library. The ``library.h`` file includes ``mpi.h`` - and uses definitions from it so those need to be available and - consistent. When LAMMPS is compiled with the included STUBS MPI - library, then its ``mpi.h`` file needs to be included. While it is - technically possible to use a full MPI library in the calling code - and link to a serial LAMMPS library compiled with MPI STUBS, it is - recommended to use the *same* MPI library for both, and then use - ``MPI_Comm_split()`` in the calling code to pass a suitable - communicator with a subset of MPI ranks to the function creating the - LAMMPS instance. + and the LAMMPS library unless LAMMPS is to be compiled without (real) + MPI support using the include STUBS MPI library. Link with LAMMPS as a static library ------------------------------------ @@ -110,7 +102,7 @@ executable, that are also required to link the LAMMPS executable. .. code-block:: bash - gcc -c -O -I${HOME}/lammps/src/STUBS -I${HOME}/lammps/src -caller.c + gcc -c -O -I${HOME}/lammps/src -caller.c g++ -o caller caller.o -L${HOME}/lammps/lib/poems \ -L${HOME}/lammps/src/STUBS -L${HOME}/lammps/src \ -llammps_serial -lpoems -lmpi_stubs @@ -174,7 +166,7 @@ the POEMS package installed becomes: .. code-block:: bash - gcc -c -O -I${HOME}/lammps/src/STUBS -I${HOME}/lammps/src -caller.c + gcc -c -O -I${HOME}/lammps/src -caller.c g++ -o caller caller.o -L${HOME}/lammps/src -llammps_serial Locating liblammps.so at runtime From db841dd41278cd3665bc7c8b4fd7baec7db423d2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 17 Feb 2021 15:28:44 -0500 Subject: [PATCH 265/384] correct return value when no packages are installed --- unittest/c-library/test_library_config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittest/c-library/test_library_config.cpp b/unittest/c-library/test_library_config.cpp index f196f800da..8a3d08cb33 100644 --- a/unittest/c-library/test_library_config.cpp +++ b/unittest/c-library/test_library_config.cpp @@ -74,7 +74,7 @@ TEST(LAMMPSConfig, package_name) EXPECT_EQ(lammps_config_package_name(numpkgs + 10, buf, 128), 0); EXPECT_THAT(buf, StrEq("")); } else { - EXPECT_EQ(lammps_config_package_name(0, buf, 128), 1); + EXPECT_EQ(lammps_config_package_name(0, buf, 128), 0); EXPECT_THAT(buf, StrEq("")); } }; From 0c348105181f85e823aee7cbf1e88ea1577ebb4b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 17 Feb 2021 15:29:33 -0500 Subject: [PATCH 266/384] lmp.mpi4py will always be false if LAMMPS has been compiled without MPI support --- unittest/python/python-open.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittest/python/python-open.py b/unittest/python/python-open.py index 67500ea6fa..5140ce9185 100644 --- a/unittest/python/python-open.py +++ b/unittest/python/python-open.py @@ -37,7 +37,7 @@ class PythonOpen(unittest.TestCase): lmp=lammps(name=self.machine) self.assertIsNot(lmp.lmp,None) self.assertEqual(lmp.opened,1) - self.assertEqual(has_mpi4py,lmp.has_mpi4py) + self.assertEqual(has_mpi and has_mpi4py,lmp.has_mpi4py) self.assertEqual(has_mpi,lmp.has_mpi_support) lmp.close() self.assertIsNone(lmp.lmp,None) From 1f109b0db29339b05e3199bae3fce7d42acfeb0c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 17 Feb 2021 15:50:45 -0500 Subject: [PATCH 267/384] update unittest for lammps_config_has_mpi() change --- unittest/c-library/test_library_config.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/unittest/c-library/test_library_config.cpp b/unittest/c-library/test_library_config.cpp index 8a3d08cb33..e5eb044d31 100644 --- a/unittest/c-library/test_library_config.cpp +++ b/unittest/c-library/test_library_config.cpp @@ -200,7 +200,10 @@ TEST(LAMMPSConfig, exceptions) TEST(LAMMPSConfig, mpi_support) { - EXPECT_EQ(lammps_config_has_mpi_support(), LAMMPS_HAS_MPI); + if (LAMMPS_HAS_MPI) + EXPECT_GT(lammps_config_has_mpi_support(), 0); + else + EXPECT_EQ(lammps_config_has_mpi_support(), 0); }; TEST(LAMMPSConfig, png_support) From 1e5a73c468cd274e734adad25e36652b7de57edd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 17 Feb 2021 17:36:35 -0500 Subject: [PATCH 268/384] silence warnings when using default OpenCL headers. Pick OpenCL v2.1 as default. --- lib/gpu/geryon/ocl_device.h | 4 ++++ lib/gpu/geryon/ocl_macros.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/gpu/geryon/ocl_device.h b/lib/gpu/geryon/ocl_device.h index b0a3e3d583..435ee24dd3 100644 --- a/lib/gpu/geryon/ocl_device.h +++ b/lib/gpu/geryon/ocl_device.h @@ -28,6 +28,10 @@ #include #include +#ifndef CL_TARGET_OPENCL_VERSION +#define CL_TARGET_OPENCL_VERSION 210 +#endif + #ifdef __APPLE__ #include #include diff --git a/lib/gpu/geryon/ocl_macros.h b/lib/gpu/geryon/ocl_macros.h index 5fb7665817..0e9ce78389 100644 --- a/lib/gpu/geryon/ocl_macros.h +++ b/lib/gpu/geryon/ocl_macros.h @@ -4,6 +4,10 @@ #include #include +#ifndef CL_TARGET_OPENCL_VERSION +#define CL_TARGET_OPENCL_VERSION 210 +#endif + #ifdef __APPLE__ #include #else From e575c5fa29f79bf5336bacc7cb0b86dd36b2a86d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 17 Feb 2021 18:28:37 -0500 Subject: [PATCH 269/384] -fopenmp implies -fopenmp-simd --- lib/gpu/Makefile.cuda_mps | 2 +- lib/gpu/Makefile.hip | 2 +- lib/gpu/Makefile.linux_opencl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/gpu/Makefile.cuda_mps b/lib/gpu/Makefile.cuda_mps index baffe99b47..21aac89151 100644 --- a/lib/gpu/Makefile.cuda_mps +++ b/lib/gpu/Makefile.cuda_mps @@ -51,7 +51,7 @@ BIN2C = $(CUDA_HOME)/bin/bin2c # host code compiler and settings -CUDR_CPP = mpicxx -fopenmp -fopenmp-simd -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC +CUDR_CPP = mpicxx -fopenmp -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC CUDR_OPTS = -O2 $(LMP_INC) CUDR = $(CUDR_CPP) $(CUDR_OPTS) $(CUDA_PROXY) $(CUDA_PRECISION) $(CUDA_INCLUDE) \ $(CUDPP_OPT) diff --git a/lib/gpu/Makefile.hip b/lib/gpu/Makefile.hip index c34823d471..dbdef433ec 100644 --- a/lib/gpu/Makefile.hip +++ b/lib/gpu/Makefile.hip @@ -17,7 +17,7 @@ LMP_INC = -DLAMMPS_SMALLBIG HIP_PRECISION = -D_SINGLE_DOUBLE HIP_OPTS = -O3 -HIP_HOST_OPTS = -Wno-deprecated-declarations -fopenmp -fopenmp-sim +HIP_HOST_OPTS = -Wno-deprecated-declarations -fopenmp HIP_HOST_INCLUDE = # use device sort diff --git a/lib/gpu/Makefile.linux_opencl b/lib/gpu/Makefile.linux_opencl index c20e26b1f3..43d012dc4a 100644 --- a/lib/gpu/Makefile.linux_opencl +++ b/lib/gpu/Makefile.linux_opencl @@ -15,7 +15,7 @@ OCL_INC = OCL_CPP = mpic++ -std=c++11 -O3 -DMPICH_IGNORE_CXX_SEEK $(LMP_INC) $(OCL_INC) OCL_LINK = -lOpenCL OCL_PREC = -D_SINGLE_DOUBLE -OCL_TUNE = -fopenmp -fopenmp-simd -DMPI_GERYON -DGERYON_NUMA_FISSION -DUCL_NO_EXIT +OCL_TUNE = -fopenmp -DMPI_GERYON -DGERYON_NUMA_FISSION -DUCL_NO_EXIT BIN_DIR = ./ OBJ_DIR = ./ From f367e66abafe2cd4bd7bc4d63e25118259612419 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 17 Feb 2021 18:47:35 -0500 Subject: [PATCH 270/384] documentation corrections, spelling fixes and updates --- doc/src/Speed_gpu.rst | 42 +++++++++++++-------- doc/src/package.rst | 20 +++++----- doc/utils/sphinx-config/false_positives.txt | 2 + lib/gpu/README | 4 +- 4 files changed, 42 insertions(+), 26 deletions(-) diff --git a/doc/src/Speed_gpu.rst b/doc/src/Speed_gpu.rst index 655f2e1958..709a3ad3bb 100644 --- a/doc/src/Speed_gpu.rst +++ b/doc/src/Speed_gpu.rst @@ -1,11 +1,14 @@ GPU package =========== -The GPU package was developed by Mike Brown while at SNL and ORNL -and his collaborators, particularly Trung Nguyen (now at Northwestern). -It provides GPU versions of many pair styles and for parts of the -:doc:`kspace_style pppm ` for long-range Coulombics. -It has the following general features: +The GPU package was developed by Mike Brown while at SNL and ORNL (now +at Intel Corp.) and his collaborators, particularly Trung Nguyen (now at +Northwestern). Support for AMD GPUs via HIP was added by Vsevolod Nikolskiy +and coworkers at HSE University. + +The GPU package provides GPU versions of many pair styles and for +parts of the :doc:`kspace_style pppm ` for long-range +Coulombics. It has the following general features: * It is designed to exploit common GPU hardware configurations where one or more GPUs are coupled to many cores of one or more multi-core CPUs, @@ -24,8 +27,9 @@ It has the following general features: force vectors. * LAMMPS-specific code is in the GPU package. It makes calls to a generic GPU library in the lib/gpu directory. This library provides - NVIDIA support as well as more general OpenCL support, so that the - same functionality is supported on a variety of hardware. + either Nvidia support, AMD support, or more general OpenCL support + (for Nvidia GPUs, AMD GPUs, Intel GPUs, and multi-core CPUs). + so that the same functionality is supported on a variety of hardware. **Required hardware/software:** @@ -89,10 +93,10 @@ shared by 4 MPI tasks. The GPU package also has limited support for OpenMP for both multi-threading and vectorization of routines that are run on the CPUs. This requires that the GPU library and LAMMPS are built with flags to -enable OpenMP support (e.g. -fopenmp -fopenmp-simd). Some styles for -time integration are also available in the GPU package. These run -completely on the CPUs in full double precision, but exploit -multi-threading and vectorization for faster performance. +enable OpenMP support (e.g. -fopenmp). Some styles for time integration +are also available in the GPU package. These run completely on the CPUs +in full double precision, but exploit multi-threading and vectorization +for faster performance. Use the "-sf gpu" :doc:`command-line switch `, which will automatically append "gpu" to styles that support it. Use the "-pk @@ -159,11 +163,11 @@ Likewise, you should experiment with the precision setting for the GPU library to see if single or mixed precision will give accurate results, since they will typically be faster. -MPI parallelism typically outperforms OpenMP parallelism, but in same cases -using fewer MPI tasks and multiple OpenMP threads with the GPU package -can give better performance. 3-body potentials can often perform better -with multiple OMP threads because the inter-process communication is -higher for these styles with the GPU package in order to allow +MPI parallelism typically outperforms OpenMP parallelism, but in some +cases using fewer MPI tasks and multiple OpenMP threads with the GPU +package can give better performance. 3-body potentials can often perform +better with multiple OMP threads because the inter-process communication +is higher for these styles with the GPU package in order to allow deterministic results. **Guidelines for best performance:** @@ -189,6 +193,12 @@ deterministic results. :doc:`angle `, :doc:`dihedral `, :doc:`improper `, and :doc:`long-range ` calculations will not be included in the "Pair" time. +* Since only part of the pppm kspace style is GPU accelerated, it + may be faster to only use GPU acceleration for Pair styles with + long-range electrostatics. See the "pair/only" keyword of the + package command for a shortcut to do that. The work between kspace + on the CPU and non-bonded interactions on the GPU can be balanced + through adjusting the coulomb cutoff without loss of accuracy. * When the *mode* setting for the package gpu command is force/neigh, the time for neighbor list calculations on the GPU will be added into the "Pair" time, not the "Neigh" time. An additional breakdown of the diff --git a/doc/src/package.rst b/doc/src/package.rst index a091759214..aea4ba657f 100644 --- a/doc/src/package.rst +++ b/doc/src/package.rst @@ -175,7 +175,7 @@ package. The *Ngpu* argument sets the number of GPUs per node. If *Ngpu* is 0 and no other keywords are specified, GPU or accelerator devices are -autoselected. In this process, all platforms are searched for +auto-selected. In this process, all platforms are searched for accelerator devices and GPUs are chosen if available. The device with the highest number of compute cores is selected. The number of devices is increased to be the number of matching accelerators with the same @@ -257,7 +257,8 @@ the other particles. The *gpuID* keyword is used to specify the first ID for the GPU or other accelerator that LAMMPS will use. For example, if the ID is 1 and *Ngpu* is 3, GPUs 1-3 will be used. Device IDs should be -determined from the output of nvc_get_devices or ocl_get_devices +determined from the output of nvc_get_devices, ocl_get_devices, +or hip_get_devices as provided in the lib/gpu directory. When using OpenCL with accelerators that have main memory NUMA, the accelerators can be split into smaller virtual accelerators for more efficient use @@ -306,13 +307,14 @@ PPPM_MAX_SPLINE. CONFIG_ID can be 0. SHUFFLE_AVAIL in {0,1} indicates that inline-PTX (NVIDIA) or OpenCL extensions (Intel) should be used for horizontal -vector operataions. FAST_MATH in {0,1} indicates that OpenCL fast math -optimizations are used during the build and HW-accelerated -transcendentals are used when available. THREADS_PER_* give the default -*tpa* values for ellipsoidal models, styles using charge, and any other -styles. The BLOCK_* parameters specify the block sizes for various -kernal calls and the MAX_*SHARED*_ parameters are used to determine the -amount of local shared memory to use for storing model parameters. +vector operations. FAST_MATH in {0,1} indicates that OpenCL fast math +optimizations are used during the build and hardware-accelerated +transcendental functions are used when available. THREADS_PER_* give the +default *tpa* values for ellipsoidal models, styles using charge, and +any other styles. The BLOCK_* parameters specify the block sizes for +various kernel calls and the MAX_*SHARED*_ parameters are used to +determine the amount of local shared memory to use for storing model +parameters. For OpenCL, the routines are compiled at runtime for the specified GPU or accelerator architecture. The *ocl_args* keyword can be used to diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 9937a98850..982e1fde2a 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -2297,6 +2297,7 @@ omegaz Omelyan omp OMP +oneAPI onelevel oneway onn @@ -2528,6 +2529,7 @@ ptm PTM ptol ptr +PTX pu purdue Purohit diff --git a/lib/gpu/README b/lib/gpu/README index 28655836f4..dfffe11b81 100644 --- a/lib/gpu/README +++ b/lib/gpu/README @@ -45,8 +45,10 @@ efficient use with MPI. After building the GPU library, for OpenCL: ./ocl_get_devices -and for CUDA +for CUDA: ./nvc_get_devices +and for ROCm HIP: + ./hip_get_devices ------------------------------------------------------------------------------ QUICK START From 45f6e9ec2ef4a9af5278a2537cf123ac330ba9d7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 17 Feb 2021 18:47:41 -0500 Subject: [PATCH 271/384] whitespace --- src/atom.cpp | 10 +++++----- src/reset_atom_ids.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/atom.cpp b/src/atom.cpp index e7b1df8240..75b1b07fbf 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -2153,7 +2153,7 @@ void Atom::setup_sort_bins() bininvy = nbiny / (bboxhi[1]-bboxlo[1]); bininvz = nbinz / (bboxhi[2]-bboxlo[2]); - #ifdef LMP_USER_INTEL +#ifdef LMP_USER_INTEL int intel_neigh = 0; if (neighbor->nrequest) { if (neighbor->requests[0]->intel) intel_neigh = 1; @@ -2198,9 +2198,9 @@ void Atom::setup_sort_bins() bboxhi[1] = bboxlo[1] + static_cast(nbiny) / bininvy; bboxhi[2] = bboxlo[2] + static_cast(nbinz) / bininvz; } - #endif +#endif - #ifdef LMP_GPU +#ifdef LMP_GPU if (userbinsize == 0.0) { int ifix = modify->find_fix("package_gpu"); if (ifix >= 0) { @@ -2212,7 +2212,7 @@ void Atom::setup_sort_bins() binsize = fix->binsize(subx, suby, subz, atom->nlocal, neighbor->cutneighmax); bininv = 1.0 / binsize; - + nbinx = static_cast (ceil(subx * bininv)); nbiny = static_cast (ceil(suby * bininv)); nbinz = static_cast (ceil(subz * bininv)); @@ -2227,7 +2227,7 @@ void Atom::setup_sort_bins() bininvz = bininv; } } - #endif +#endif if (1.0*nbinx*nbiny*nbinz > INT_MAX) error->one(FLERR,"Too many atom sorting bins"); diff --git a/src/reset_atom_ids.h b/src/reset_atom_ids.h index 7c5c53e2ba..02a7f77e8d 100644 --- a/src/reset_atom_ids.h +++ b/src/reset_atom_ids.h @@ -37,7 +37,7 @@ class ResetIDs : protected Pointers { int ilocal; }; - #if defined(LMP_QSORT) +#if defined(LMP_QSORT) // static variable across all ResetID objects, for qsort callback static AtomRvous *sortrvous; #endif From 45c782308c0937260049db940c121934fa0b2ffc Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 18 Feb 2021 21:08:18 -0800 Subject: [PATCH 272/384] Fixing issue from recent GPU package update with OMP_NUM_THREADS env being overridden in GPU library. Fixing race condition with OpenMP for GPU styles using torque (missed in regression tests due to the first fix) Documenting GPU package option for setting the number of threads (consistent with USER-INTEL and USER-OMP). --- doc/src/package.rst | 85 +++++++++++++++------------------- lib/gpu/lal_answer.cpp | 8 ++-- lib/gpu/lal_base_ellipsoid.cpp | 2 +- lib/gpu/lal_device.cpp | 28 +++++------ lib/gpu/lal_device.h | 12 ++--- src/GPU/fix_gpu.cpp | 27 +++++++---- 6 files changed, 77 insertions(+), 85 deletions(-) diff --git a/doc/src/package.rst b/doc/src/package.rst index aea4ba657f..842fc8bc1c 100644 --- a/doc/src/package.rst +++ b/doc/src/package.rst @@ -32,10 +32,12 @@ Syntax size = bin size for neighbor list construction (distance units) *split* = fraction fraction = fraction of atoms assigned to GPU (default = 1.0) - *tpa* value = Nthreads - Nthreads = # of GPU vector lanes used per atom + *tpa* value = Nlanes + Nlanes = # of GPU vector lanes (CUDA threads) used per atom *blocksize* value = size size = thread block size for pair force computation + *omp* value = Nthreads + Nthreads = number of OpenMP threads to use on CPU (default = 0) *platform* value = id id = For OpenCL, platform ID for the GPU or accelerator *gpuID* values = id @@ -101,7 +103,7 @@ Syntax off = use device acceleration (e.g. GPU) for all available styles in the KOKKOS package (default) on = use device acceleration only for pair styles (and host acceleration for others) *omp* args = Nthreads keyword value ... - Nthread = # of OpenMP threads to associate with each MPI process + Nthreads = # of OpenMP threads to associate with each MPI process zero or more keyword/value pairs may be appended keywords = *neigh* *neigh* value = *yes* or *no* @@ -116,7 +118,7 @@ Examples package gpu 0 package gpu 1 split 0.75 package gpu 2 split -1.0 - package gpu 0 device_type intelgpu + package gpu 0 omp 2 device_type intelgpu package kokkos neigh half comm device package omp 0 neigh no package omp 4 @@ -266,10 +268,10 @@ with MPI. The *tpa* keyword sets the number of GPU vector lanes per atom used to perform force calculations. With a default value of 1, the number of -threads will be chosen based on the pair style, however, the value can +lanes will be chosen based on the pair style, however, the value can be set explicitly with this keyword to fine-tune performance. For large cutoffs or with a small number of particles per GPU, increasing -the value can improve performance. The number of threads per atom must +the value can improve performance. The number of lanes per atom must be a power of 2 and currently cannot be greater than the SIMD width for the GPU / accelerator. In the case it exceeds the SIMD width, it will automatically be decreased to meet the restriction. @@ -282,6 +284,14 @@ individual GPU cores, but reduces the total number of thread blocks, thus may lead to load imbalance. On modern hardware, the sensitivity to the blocksize is typically low. +The *Nthreads* value for the *omp* keyword sets the number of OpenMP +threads allocated for each MPI task. This setting controls OpenMP +parallelism only for routines run on the CPUs. For more details on +setting the number of OpenMP threads, see the discussion of the +*Nthreads* setting on this doc page for the "package omp" command. +The meaning of *Nthreads* is exactly the same for the GPU, USER-INTEL, +and GPU packages. + The *platform* keyword is only used with OpenCL to specify the ID for an OpenCL platform. See the output from ocl_get_devices in the lib/gpu directory. In LAMMPS only one platform can be active at a time and by @@ -336,44 +346,13 @@ built with co-processor support. Optional keyword/value pairs can also be specified. Each has a default value as listed below. -The *omp* keyword determines the number of OpenMP threads allocated -for each MPI task when any portion of the interactions computed by a -USER-INTEL pair style are run on the CPU. This can be the case even -if LAMMPS was built with co-processor support; see the *balance* -keyword discussion below. If you are running with less MPI tasks/node -than there are CPUs, it can be advantageous to use OpenMP threading on -the CPUs. - -.. note:: - - The *omp* keyword has nothing to do with co-processor threads on - the Xeon Phi; see the *tpc* and *tptask* keywords below for a - discussion of co-processor threads. - -The *Nthread* value for the *omp* keyword sets the number of OpenMP -threads allocated for each MPI task. Setting *Nthread* = 0 (the -default) instructs LAMMPS to use whatever value is the default for the -given OpenMP environment. This is usually determined via the -*OMP_NUM_THREADS* environment variable or the compiler runtime, which -is usually a value of 1. - -For more details, including examples of how to set the OMP_NUM_THREADS -environment variable, see the discussion of the *Nthreads* setting on -this doc page for the "package omp" command. Nthreads is a required -argument for the USER-OMP package. Its meaning is exactly the same -for the USER-INTEL package. - -.. note:: - - If you build LAMMPS with both the USER-INTEL and USER-OMP - packages, be aware that both packages allow setting of the *Nthreads* - value via their package commands, but there is only a single global - *Nthreads* value used by OpenMP. Thus if both package commands are - invoked, you should insure the two values are consistent. If they are - not, the last one invoked will take precedence, for both packages. - Also note that if the :doc:`-sf hybrid intel omp command-line switch ` is used, it invokes a "package intel" - command, followed by a "package omp" command, both with a setting of - *Nthreads* = 0. +The *Nthreads* value for the *omp* keyword sets the number of OpenMP +threads allocated for each MPI task. This setting controls OpenMP +parallelism only for routines run on the CPUs. For more details on +setting the number of OpenMP threads, see the discussion of the +*Nthreads* setting on this doc page for the "package omp" command. +The meaning of *Nthreads* is exactly the same for the GPU, USER-INTEL, +and GPU packages. The *mode* keyword determines the precision mode to use for computing pair style forces, either on the CPU or on the co-processor, @@ -579,7 +558,7 @@ result in better performance for certain configurations and system sizes. The *omp* style invokes settings associated with the use of the USER-OMP package. -The *Nthread* argument sets the number of OpenMP threads allocated for +The *Nthreads* argument sets the number of OpenMP threads allocated for each MPI task. For example, if your system has nodes with dual quad-core processors, it has a total of 8 cores per node. You could use two MPI tasks per node (e.g. using the -ppn option of the mpirun @@ -588,7 +567,7 @@ This would use all 8 cores on each node. Note that the product of MPI tasks \* threads/task should not exceed the physical number of cores (on a node), otherwise performance will suffer. -Setting *Nthread* = 0 instructs LAMMPS to use whatever value is the +Setting *Nthreads* = 0 instructs LAMMPS to use whatever value is the default for the given OpenMP environment. This is usually determined via the *OMP_NUM_THREADS* environment variable or the compiler runtime. Note that in most cases the default for OpenMP capable @@ -619,6 +598,18 @@ input. Not all features of LAMMPS support OpenMP threading via the USER-OMP package and the parallel efficiency can be very different, too. +.. note:: + + If you build LAMMPS with the GPU, USER-INTEL, and / or USER-OMP + packages, be aware these packages all allow setting of the *Nthreads* + value via their package commands, but there is only a single global + *Nthreads* value used by OpenMP. Thus if multiple package commands are + invoked, you should insure the values are consistent. If they are + not, the last one invoked will take precedence, for all packages. + Also note that if the :doc:`-sf hybrid intel omp command-line switch ` is used, it invokes a "package intel" command, followed by a + "package omp" command, both with a setting of *Nthreads* = 0. Likewise + for a hybrid suffix for gpu and omp. + Optional keyword/value pairs can also be specified. Each has a default value as listed below. @@ -665,7 +656,7 @@ Default For the GPU package, the default is Ngpu = 0 and the option defaults are neigh = yes, newton = off, binsize = 0.0, split = 1.0, gpuID = 0 -to Ngpu-1, tpa = 1, and platform=-1. These settings are made +to Ngpu-1, tpa = 1, omp = 0, and platform=-1. These settings are made automatically if the "-sf gpu" :doc:`command-line switch ` is used. If it is not used, you must invoke the package gpu command in your input script or via the "-pk gpu" :doc:`command-line switch `. diff --git a/lib/gpu/lal_answer.cpp b/lib/gpu/lal_answer.cpp index e2478a64e5..4a68466d05 100644 --- a/lib/gpu/lal_answer.cpp +++ b/lib/gpu/lal_answer.cpp @@ -331,11 +331,11 @@ void AnswerT::get_answers(double **f, double **tor) { } if (_rot) { vec3d *torp=reinterpret_cast(&(tor[0][0])); - forcep=reinterpret_cast(&(force[_inum*4])); + vec4d_t *torquep=reinterpret_cast(&(force[_inum*4])); for (int i=ifrom; i0) fprintf(screen,"Device Overhead: %.4f s.\n",times[6]/replica_size); fprintf(screen,"Average split: %.4f.\n",avg_split); - fprintf(screen,"Threads / atom: %d.\n",_threads_per_atom); + fprintf(screen,"Lanes / atom: %d.\n",_threads_per_atom); fprintf(screen,"Vector width: %d.\n", device->simd_size()); fprintf(screen,"Max Mem / Proc: %.2f MB.\n",max_mb); if (nbor->gpu_nbor()==2) diff --git a/lib/gpu/lal_device.cpp b/lib/gpu/lal_device.cpp index 5ba9185e6f..a65c3d8810 100644 --- a/lib/gpu/lal_device.cpp +++ b/lib/gpu/lal_device.cpp @@ -53,14 +53,10 @@ DeviceT::~Device() { template int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int ngpu, const int first_gpu_id, const int gpu_mode, - const double p_split, const int nthreads, - const int t_per_atom, const double user_cell_size, - char *ocl_args, const int ocl_platform, - char *device_type_flags, const int block_pair) { - _nthreads=nthreads; - #if (LAL_USE_OMP == 1) - omp_set_num_threads(nthreads); - #endif + const double p_split, const int t_per_atom, + const double user_cell_size, char *ocl_args, + const int ocl_platform, char *device_type_flags, + const int block_pair) { _threads_per_atom=t_per_atom; _threads_per_charge=t_per_atom; _threads_per_three=t_per_atom; @@ -583,7 +579,7 @@ void DeviceT::init_message(FILE *screen, const char *name, fprintf(screen,"- Using acceleration for %s:\n",name); fprintf(screen,"- with %d proc(s) per device.\n",_procs_per_gpu); #if (LAL_USE_OMP == 1) - fprintf(screen,"- with %d thread(s) per proc.\n",_nthreads); + fprintf(screen,"- with %d thread(s) per proc.\n", omp_get_max_threads()); #endif #ifdef USE_OPENCL fprintf(screen,"- with OpenCL Parameters for: %s (%d)\n", @@ -803,7 +799,7 @@ void DeviceT::output_times(UCL_Timer &time_pair, Answer &ans, if (times[5]>0) fprintf(screen,"Device Overhead: %.4f s.\n",times[5]/_replica_size); fprintf(screen,"Average split: %.4f.\n",avg_split); - fprintf(screen,"Threads / atom: %d.\n",threads_per_atom); + fprintf(screen,"Lanes / atom: %d.\n",threads_per_atom); fprintf(screen,"Vector width: %d.\n", simd_size()); fprintf(screen,"Max Mem / Proc: %.2f MB.\n",max_mb); if (nbor.gpu_nbor()==2) @@ -1031,13 +1027,13 @@ Device global_device; using namespace LAMMPS_AL; int lmp_init_device(MPI_Comm world, MPI_Comm replica, const int ngpu, const int first_gpu_id, const int gpu_mode, - const double particle_split, const int nthreads, - const int t_per_atom, const double user_cell_size, - char *opencl_config, const int ocl_platform, - char *device_type_flags, const int block_pair) { + const double particle_split, const int t_per_atom, + const double user_cell_size, char *opencl_config, + const int ocl_platform, char *device_type_flags, + const int block_pair) { return global_device.init_device(world,replica,ngpu,first_gpu_id,gpu_mode, - particle_split,nthreads,t_per_atom, - user_cell_size,opencl_config,ocl_platform, + particle_split,t_per_atom,user_cell_size, + opencl_config,ocl_platform, device_type_flags,block_pair); } diff --git a/lib/gpu/lal_device.h b/lib/gpu/lal_device.h index bd5b81558c..1db6ae3127 100644 --- a/lib/gpu/lal_device.h +++ b/lib/gpu/lal_device.h @@ -49,10 +49,10 @@ class Device { * - -11 if config_string has the wrong number of parameters **/ int init_device(MPI_Comm world, MPI_Comm replica, const int ngpu, const int first_gpu_id, const int gpu_mode, - const double particle_split, const int nthreads, - const int t_per_atom, const double user_cell_size, - char *config_string, const int ocl_platform, - char *device_type_flags, const int block_pair); + const double particle_split, const int t_per_atom, + const double user_cell_size, char *config_string, + const int ocl_platform, char *device_type_flags, + const int block_pair); /// Initialize the device for Atom storage /** \param charge True if charges need to be stored @@ -201,8 +201,6 @@ class Device { /// Return the number of procs sharing a device (size of device communicator) inline int procs_per_gpu() const { return _procs_per_gpu; } - /// Return the number of threads per proc - inline int num_threads() const { return _nthreads; } /// My rank within all processes inline int world_me() const { return _world_me; } /// Total number of processes @@ -331,7 +329,7 @@ class Device { MPI_Comm _comm_world, _comm_replica, _comm_gpu; int _procs_per_gpu, _gpu_rank, _world_me, _world_size, _replica_me, _replica_size; - int _gpu_mode, _first_device, _last_device, _platform_id, _nthreads; + int _gpu_mode, _first_device, _last_device, _platform_id; double _particle_split; double _cpu_full; double _ptx_arch; diff --git a/src/GPU/fix_gpu.cpp b/src/GPU/fix_gpu.cpp index efbaa6e1f8..8297c338a5 100644 --- a/src/GPU/fix_gpu.cpp +++ b/src/GPU/fix_gpu.cpp @@ -32,16 +32,18 @@ #include "citeme.h" #include "error.h" +#if (LAL_USE_OMP == 1) +#include +#endif using namespace LAMMPS_NS; using namespace FixConst; enum{GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH}; -extern int lmp_init_device(MPI_Comm world, MPI_Comm replica, - const int ngpu, const int first_gpu_id, - const int gpu_mode, const double particle_split, - const int nthreads, const int t_per_atom, +extern int lmp_init_device(MPI_Comm world, MPI_Comm replica, const int ngpu, + const int first_gpu_id, const int gpu_mode, + const double particle_split, const int t_per_atom, const double cell_size, char *opencl_args, const int ocl_platform, char *device_type_flags, const int block_pair); @@ -123,7 +125,7 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : _gpu_mode = GPU_NEIGH; _particle_split = 1.0; - int nthreads = 1; + int nthreads = 0; int newtonflag = 0; int threads_per_atom = -1; double binsize = 0.0; @@ -167,10 +169,10 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); threads_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; - } else if (strcmp(arg[iarg],"nthreads") == 0) { + } else if (strcmp(arg[iarg],"omp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); nthreads = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - if (nthreads < 1) error->all(FLERR,"Illegal fix GPU command"); + if (nthreads < 0) error->all(FLERR,"Illegal fix GPU command"); iarg += 2; } else if (strcmp(arg[iarg],"platform") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); @@ -200,6 +202,11 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : #if (LAL_USE_OMP == 0) if (nthreads > 1) error->all(FLERR,"No OpenMP support compiled in"); + #else + if (nthreads > 0) { + omp_set_num_threads(nthreads); + comm->nthreads = nthreads; + } #endif // set newton pair flag @@ -227,9 +234,9 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : if (binsize == 0.0) binsize = -1.0; _binsize = binsize; int gpu_flag = lmp_init_device(universe->uworld, world, ngpu, first_gpu_id, - _gpu_mode, _particle_split, nthreads, - threads_per_atom, binsize, opencl_args, - ocl_platform, device_type_flags, block_pair); + _gpu_mode, _particle_split, threads_per_atom, + binsize, opencl_args, ocl_platform, + device_type_flags, block_pair); GPU_EXTRA::check_flag(gpu_flag,error,world); } From ab9552b63a8d6a35d2c80bbf243b91971511cbbc Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 19 Feb 2021 05:55:37 -0800 Subject: [PATCH 273/384] Adding some notes about KOKKOS thread settings to the package doc. --- doc/src/package.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/src/package.rst b/doc/src/package.rst index 842fc8bc1c..1613ff2fae 100644 --- a/doc/src/package.rst +++ b/doc/src/package.rst @@ -608,7 +608,13 @@ too. not, the last one invoked will take precedence, for all packages. Also note that if the :doc:`-sf hybrid intel omp command-line switch ` is used, it invokes a "package intel" command, followed by a "package omp" command, both with a setting of *Nthreads* = 0. Likewise - for a hybrid suffix for gpu and omp. + for a hybrid suffix for gpu and omp. Note that KOKKOS also supports + setting the number of OpenMP threads from the command line using the + "-k on" :doc:`command-line switch `. The default for + KOKKOS is 1 thread per MPI task, so any other number of threads should + be explicitly set using the "-k on" command-line switch (and this + setting should be consistent with settings from any other packages + used). Optional keyword/value pairs can also be specified. Each has a default value as listed below. From a40db8ddf1a468415c372a04e16fc92d87534a0a Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 19 Feb 2021 05:59:25 -0800 Subject: [PATCH 274/384] Fix for hybrid pair style with certain combinations of USER-INTEL styles. Specifically, fixes issue where memory was not zeroed correctly with a hybrid pair style including an intel variant and a non-intel variant combined with intel variant(s) of non-pair styles. --- src/USER-INTEL/fix_intel.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/USER-INTEL/fix_intel.cpp b/src/USER-INTEL/fix_intel.cpp index 31bd63160f..6c7e108ca6 100644 --- a/src/USER-INTEL/fix_intel.cpp +++ b/src/USER-INTEL/fix_intel.cpp @@ -318,8 +318,7 @@ void FixIntel::init() _zero_master = 0; if (_pair_hybrid_flag && _hybrid_nonpair) - if (_pair_hybrid_flag > 1 || force->newton_pair == 0) - _pair_hybrid_zero = 1; + _pair_hybrid_zero = 1; _hybrid_nonpair = 0; _pair_intel_count = 0; From fd67f83bb7595db7ecff20fc9fc1fef4fe69c364 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 19 Feb 2021 10:27:31 -0500 Subject: [PATCH 275/384] replace atoi() with utils::inumeric() --- src/fix_addforce.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp index a06544e268..07031a40a4 100644 --- a/src/fix_addforce.cpp +++ b/src/fix_addforce.cpp @@ -83,7 +83,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"every") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix addforce command"); - nevery = atoi(arg[iarg+1]); + nevery = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix addforce command"); iarg += 2; } else if (strcmp(arg[iarg],"region") == 0) { From d36df19a2d798837a8a630d72b4dda9727e88eb7 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Fri, 19 Feb 2021 13:22:35 -0500 Subject: [PATCH 276/384] Use mallinfo2 with glibc >= 2.33 --- src/info.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/info.cpp b/src/info.cpp index bf6f14a48a..f1dc96645b 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -1449,8 +1449,13 @@ void Info::get_memory_info(double *meminfo) meminfo[2] = (double)pmc.PeakWorkingSetSize/1048576.0; #else #if defined(__linux__) +#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 33) + struct mallinfo2 mi; + mi = mallinfo2(); +#else struct mallinfo mi; mi = mallinfo(); +#endif meminfo[1] = (double)mi.uordblks/1048576.0+(double)mi.hblkhd/1048576.0; #endif struct rusage ru; From 99ff0bb4d25f17a6a18c038b8489e485272e71d8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 19 Feb 2021 16:57:49 -0500 Subject: [PATCH 277/384] fix cut-n-paste bug --- src/citeme.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/citeme.cpp b/src/citeme.cpp index fdd1ee867d..41ac87f5bb 100644 --- a/src/citeme.cpp +++ b/src/citeme.cpp @@ -118,7 +118,7 @@ void CiteMe::flush() if (!citefile.empty()) logbuffer += fmt::format(cite_file,"file",citefile); if (screen_flag == VERBOSE) - scrbuffer += fmt::format(cite_file,"screen","output"); + logbuffer += fmt::format(cite_file,"screen","output"); logbuffer += cite_separator; if (logfile) fputs(logbuffer.c_str(),logfile); logbuffer.clear(); From 0a355c019451c641d2b22c9aa47cba63aa22d40f Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Fri, 19 Feb 2021 15:20:09 -0700 Subject: [PATCH 278/384] Fix bug in dump image ssao depth shading --- src/image.cpp | 218 +++++++++++++++++++++++++++++--------------------- src/image.h | 4 + 2 files changed, 131 insertions(+), 91 deletions(-) diff --git a/src/image.cpp b/src/image.cpp index 4b181ee8b0..0acef0bceb 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -113,6 +113,11 @@ Image::Image(LAMMPS *lmp, int nmap_caller) : Pointers(lmp) backLightColor[2] = 0.9; random = nullptr; + + // MPI_Gatherv vectors + + recvcounts = nullptr; + displs = nullptr; } /* ---------------------------------------------------------------------- */ @@ -134,6 +139,9 @@ Image::~Image() memory->destroy(rgbcopy); if (random) delete random; + + memory->destroy(recvcounts); + memory->destroy(displs); } /* ---------------------------------------------------------------------- @@ -334,16 +342,37 @@ void Image::merge() // extra SSAO enhancement // bcast full image to all procs // each works on subset of pixels - // gather result back to proc 0 + // MPI_Gather() result back to proc 0 + // use Gatherv() if subset of pixels is not the same size on every proc if (ssao) { MPI_Bcast(imageBuffer,npixels*3,MPI_BYTE,0,world); MPI_Bcast(surfaceBuffer,npixels*2,MPI_DOUBLE,0,world); MPI_Bcast(depthBuffer,npixels,MPI_DOUBLE,0,world); compute_SSAO(); - int pixelPart = height/nprocs * width*3; - MPI_Gather(imageBuffer+me*pixelPart,pixelPart,MPI_BYTE, - rgbcopy,pixelPart,MPI_BYTE,0,world); + + int pixelstart = 3 * static_cast (1.0*me/nprocs * npixels); + int pixelstop = 3 * static_cast (1.0*(me+1)/nprocs * npixels); + int mypixels = pixelstop - pixelstart; + + if (npixels % nprocs == 0) { + MPI_Gather(imageBuffer+pixelstart,mypixels,MPI_BYTE, + rgbcopy,mypixels,MPI_BYTE,0,world); + + } else { + if (recvcounts == nullptr) { + memory->create(recvcounts,nprocs,"image:recvcounts"); + memory->create(displs,nprocs,"image:displs"); + MPI_Allgather(&mypixels,1,MPI_INT,recvcounts,1,MPI_INT,world); + displs[0] = 0; + for (int i = 1; i < nprocs; i++) + displs[i] = displs[i-1] + recvcounts[i-1]; + } + + MPI_Gatherv(imageBuffer+pixelstart,mypixels,MPI_BYTE, + rgbcopy,recvcounts,displs,MPI_BYTE,0,world); + } + writeBuffer = rgbcopy; } else { writeBuffer = imageBuffer; @@ -880,110 +909,117 @@ void Image::compute_SSAO() -tanPerPixel / zoom; int pixelRadius = (int) trunc (SSAORadius / pixelWidth + 0.5); - int x,y,s; - int hPart = height / nprocs; - int index = me * hPart * width; - for (y = me * hPart; y < (me + 1) * hPart; y ++) { - for (x = 0; x < width; x ++, index ++) { - double cdepth = depthBuffer[index]; - if (cdepth < 0) { continue; } + // each proc is assigned a subset of contiguous pixels from the full image + // pixels are contiguous in x (columns within a row), then by row + // index = pixels from 0 to npixel-1 + // x = column # from 0 to width-1 + // y = row # from 0 to height-1 - double sx = surfaceBuffer[index * 2 + 0]; - double sy = surfaceBuffer[index * 2 + 1]; - double sin_t = -sqrt(sx*sx + sy*sy); + int pixelstart = static_cast (1.0*me/nprocs * npixels); + int pixelstop = static_cast (1.0*(me+1)/nprocs * npixels); - double mytheta = random->uniform() * SSAOJitter; - double ao = 0.0; + for (int index = pixelstart; index < pixelstop; index++) { + int x = index % width; + int y = index / width; - for (s = 0; s < SSAOSamples; s ++) { - double hx = cos(mytheta); - double hy = sin(mytheta); - mytheta += delTheta; + double cdepth = depthBuffer[index]; + if (cdepth < 0) { continue; } - // multiply by z cross surface tangent - // so that dot (aka cos) works here + double sx = surfaceBuffer[index * 2 + 0]; + double sy = surfaceBuffer[index * 2 + 1]; + double sin_t = -sqrt(sx*sx + sy*sy); - double scaled_sin_t = sin_t * (hx*sy + hy*sx); + double mytheta = random->uniform() * SSAOJitter; + double ao = 0.0; - // Bresenham's line algorithm to march over depthBuffer + for (int s = 0; s < SSAOSamples; s ++) { + double hx = cos(mytheta); + double hy = sin(mytheta); + mytheta += delTheta; - int dx = static_cast (hx * pixelRadius); - int dy = static_cast (hy * pixelRadius); - int ex = x + dx; - if (ex < 0) { ex = 0; } if (ex >= width) { ex = width - 1; } - int ey = y + dy; - if (ey < 0) { ey = 0; } if (ey >= height) { ey = height - 1; } - double delta; - int small, large; - double lenIncr; - if (fabs(hx) > fabs(hy)) { - small = (hx > 0) ? 1 : -1; - large = (hy > 0) ? width : -width; - delta = fabs(hy / hx); - } else { - small = (hy > 0) ? width : -width; - large = (hx > 0) ? 1 : -1; - delta = fabs(hx / hy); + // multiply by z cross surface tangent + // so that dot (aka cos) works here + + double scaled_sin_t = sin_t * (hx*sy + hy*sx); + + // Bresenham's line algorithm to march over depthBuffer + + int dx = static_cast (hx * pixelRadius); + int dy = static_cast (hy * pixelRadius); + int ex = x + dx; + if (ex < 0) { ex = 0; } if (ex >= width) { ex = width - 1; } + int ey = y + dy; + if (ey < 0) { ey = 0; } if (ey >= height) { ey = height - 1; } + double delta; + int small, large; + double lenIncr; + if (fabs(hx) > fabs(hy)) { + small = (hx > 0) ? 1 : -1; + large = (hy > 0) ? width : -width; + delta = fabs(hy / hx); + } else { + small = (hy > 0) ? width : -width; + large = (hx > 0) ? 1 : -1; + delta = fabs(hx / hy); + } + lenIncr = sqrt (1 + delta * delta) * pixelWidth; + + // initialize with one step + // because the center point doesn't need testing + + int end = ex + ey * width; + int ind = index + small; + double len = lenIncr; + double err = delta; + if (err >= 1.0) { + ind += large; + err -= 1.0; + } + + double minPeak = -1; + double peakLen = 0.0; + int stepsTaken = 1; + while ((small > 0 && ind <= end) || (small < 0 && ind >= end)) { + if (ind < 0 || ind >= (width*height)) { + break; } - lenIncr = sqrt (1 + delta * delta) * pixelWidth; - // initialize with one step - // because the center point doesn't need testing + // cdepth - depthBuffer B/C we want it in the negative z direction - int end = ex + ey * width; - int ind = index + small; - double len = lenIncr; - double err = delta; + if (minPeak < 0 || (depthBuffer[ind] >= 0 && + depthBuffer[ind] < minPeak)) { + minPeak = depthBuffer[ind]; + peakLen = len; + } + ind += small; + len += lenIncr; + err += delta; if (err >= 1.0) { ind += large; err -= 1.0; } - - double minPeak = -1; - double peakLen = 0.0; - int stepsTaken = 1; - while ((small > 0 && ind <= end) || (small < 0 && ind >= end)) { - if (ind < 0 || ind >= (width*height)) { - break; - } - - // cdepth - depthBuffer B/C we want it in the negative z direction - - if (minPeak < 0 || (depthBuffer[ind] >= 0 && - depthBuffer[ind] < minPeak)) { - minPeak = depthBuffer[ind]; - peakLen = len; - } - ind += small; - len += lenIncr; - err += delta; - if (err >= 1.0) { - ind += large; - err -= 1.0; - } - stepsTaken ++; - } - - if (peakLen > 0) { - double h = atan ((cdepth - minPeak) / peakLen); - ao += saturate(sin (h) - scaled_sin_t); - } else { - ao += saturate(-scaled_sin_t); - } + stepsTaken ++; } - ao /= (double)SSAOSamples; - double c[3]; - c[0] = (double) (*(unsigned char *) &imageBuffer[index * 3 + 0]); - c[1] = (double) (*(unsigned char *) &imageBuffer[index * 3 + 1]); - c[2] = (double) (*(unsigned char *) &imageBuffer[index * 3 + 2]); - c[0] *= (1.0 - ao); - c[1] *= (1.0 - ao); - c[2] *= (1.0 - ao); - imageBuffer[index * 3 + 0] = (int) c[0]; - imageBuffer[index * 3 + 1] = (int) c[1]; - imageBuffer[index * 3 + 2] = (int) c[2]; + if (peakLen > 0) { + double h = atan ((cdepth - minPeak) / peakLen); + ao += saturate(sin (h) - scaled_sin_t); + } else { + ao += saturate(-scaled_sin_t); + } } + ao /= (double)SSAOSamples; + + double c[3]; + c[0] = (double) (*(unsigned char *) &imageBuffer[index * 3 + 0]); + c[1] = (double) (*(unsigned char *) &imageBuffer[index * 3 + 1]); + c[2] = (double) (*(unsigned char *) &imageBuffer[index * 3 + 2]); + c[0] *= (1.0 - ao); + c[1] *= (1.0 - ao); + c[2] *= (1.0 - ao); + imageBuffer[index * 3 + 0] = (int) c[0]; + imageBuffer[index * 3 + 1] = (int) c[1]; + imageBuffer[index * 3 + 2] = (int) c[2]; } } diff --git a/src/image.h b/src/image.h index 7df81425d9..1de455d4bd 100644 --- a/src/image.h +++ b/src/image.h @@ -73,6 +73,10 @@ class Image : protected Pointers { double *depthcopy,*surfacecopy; unsigned char *imageBuffer,*rgbcopy,*writeBuffer; + // MPI_Gatherv + + int *recvcounts,*displs; + // constant view params double FOV; From a98177c366ca53b548556e784e2931288e3469bc Mon Sep 17 00:00:00 2001 From: jrgissing Date: Sat, 20 Feb 2021 15:07:50 -0500 Subject: [PATCH 279/384] ring_check refactor --- src/USER-REACTION/fix_bond_react.cpp | 32 +++++++++++----------------- src/USER-REACTION/fix_bond_react.h | 2 +- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 1ec29efacd..40cf2748e2 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -1627,8 +1627,8 @@ void FixBondReact::check_a_neighbor() glove_counter++; if (glove_counter == onemol->natoms) { - status = ACCEPT; - ring_check(); + if (ring_check()) status = ACCEPT; + else status = GUESSFAIL; return; } // status should still == PROCEED @@ -1679,8 +1679,8 @@ void FixBondReact::check_a_neighbor() glove_counter++; if (glove_counter == onemol->natoms) { - status = ACCEPT; - ring_check(); + if (ring_check()) status = ACCEPT; + else status = GUESSFAIL; return; // will never complete here when there are edge atoms // ...actually that could be wrong if people get creative...shouldn't affect anything @@ -1791,8 +1791,8 @@ void FixBondReact::inner_crosscheck_loop() } glove_counter++; if (glove_counter == onemol->natoms) { - status = ACCEPT; - ring_check(); + if (ring_check()) status = ACCEPT; + else status = GUESSFAIL; return; } status = CONTINUE; @@ -1803,21 +1803,17 @@ void FixBondReact::inner_crosscheck_loop() Necessary for certain ringed structures ------------------------------------------------------------------------- */ -void FixBondReact::ring_check() +int FixBondReact::ring_check() { // ring_check can be made more efficient by re-introducing 'frozen' atoms // 'frozen' atoms have been assigned and also are no longer pioneers // double check the number of neighbors match for all non-edge atoms // otherwise, atoms at 'end' of symmetric ring can behave like edge atoms - for (int i = 0; i < onemol->natoms; i++) { - if (edge[i][rxnID] == 0) { - if (onemol_nxspecial[i][0] != nxspecial[atom->map(glove[i][1])][0]) { - status = GUESSFAIL; - return; - } - } - } + for (int i = 0; i < onemol->natoms; i++) + if (edge[i][rxnID] == 0 && + onemol_nxspecial[i][0] != nxspecial[atom->map(glove[i][1])][0]) + return 0; for (int i = 0; i < onemol->natoms; i++) { for (int j = 0; j < onemol_nxspecial[i][0]; j++) { @@ -1829,12 +1825,10 @@ void FixBondReact::ring_check() break; } } - if (ring_fail == 1) { - status = GUESSFAIL; - return; - } + if (ring_fail == 1) return 0; } } + return 1; } /* ---------------------------------------------------------------------- diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h index 87a5945d45..153bdd7a6d 100644 --- a/src/USER-REACTION/fix_bond_react.h +++ b/src/USER-REACTION/fix_bond_react.h @@ -171,7 +171,7 @@ class FixBondReact : public Fix { void check_a_neighbor(); void crosscheck_the_neighbor(); void inner_crosscheck_loop(); - void ring_check(); + int ring_check(); int check_constraints(); void get_IDcoords(int, int, double *); double get_temperature(tagint **, int, int); From 80ae5ba7acbd946df15732456ad6682ad2db4321 Mon Sep 17 00:00:00 2001 From: jrgissing Date: Sat, 20 Feb 2021 15:14:42 -0500 Subject: [PATCH 280/384] refactor constraints check --- src/USER-REACTION/fix_bond_react.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 40cf2748e2..0f98e74a5e 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -1385,9 +1385,9 @@ void FixBondReact::superimpose_algorithm() } } - if (status == ACCEPT && check_constraints()) { // reaction site found successfully! - glove_ghostcheck(); - } + // reaction site found successfully! + if (status == ACCEPT) glove_ghostcheck(); + hang_catch++; // let's go ahead and catch the simplest of hangs //if (hang_catch > onemol->natoms*4) @@ -1627,7 +1627,7 @@ void FixBondReact::check_a_neighbor() glove_counter++; if (glove_counter == onemol->natoms) { - if (ring_check()) status = ACCEPT; + if (ring_check() && check_constraints()) status = ACCEPT; else status = GUESSFAIL; return; } @@ -1679,7 +1679,7 @@ void FixBondReact::check_a_neighbor() glove_counter++; if (glove_counter == onemol->natoms) { - if (ring_check()) status = ACCEPT; + if (ring_check() && check_constraints()) status = ACCEPT; else status = GUESSFAIL; return; // will never complete here when there are edge atoms @@ -1791,7 +1791,7 @@ void FixBondReact::inner_crosscheck_loop() } glove_counter++; if (glove_counter == onemol->natoms) { - if (ring_check()) status = ACCEPT; + if (ring_check() && check_constraints()) status = ACCEPT; else status = GUESSFAIL; return; } From 7d9187cff8364fbf5872946996b1a62c67d6053b Mon Sep 17 00:00:00 2001 From: jrgissing Date: Sat, 20 Feb 2021 16:24:24 -0500 Subject: [PATCH 281/384] eval reaction prob after constraints check --- src/USER-REACTION/fix_bond_react.cpp | 94 +++++++++------------------- src/USER-REACTION/fix_bond_react.h | 2 +- 2 files changed, 32 insertions(+), 64 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 0f98e74a5e..173a92b7fb 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -537,7 +537,6 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : nmax = 0; partner = finalpartner = nullptr; distsq = nullptr; - probability = nullptr; maxattempt = 0; attempt = nullptr; nattempt = nullptr; @@ -585,7 +584,6 @@ FixBondReact::~FixBondReact() memory->destroy(finalpartner); memory->destroy(nattempt); memory->destroy(distsq); - memory->destroy(probability); memory->destroy(attempt); memory->destroy(edge); memory->destroy(equivalences); @@ -877,6 +875,10 @@ void FixBondReact::post_integrate() return; } + // update reaction probability + if (var_flag[PROB][rxnID]) + fraction[rxnID] = input->variable->compute_equal(var_id[PROB][rxnID]); + // acquire updated ghost atom positions // necessary b/c are calling this after integrate, but before Verlet comm @@ -890,16 +892,14 @@ void FixBondReact::post_integrate() memory->destroy(finalpartner); memory->destroy(distsq); memory->destroy(nattempt); - memory->destroy(probability); nmax = atom->nmax; memory->create(partner,nmax,"bond/react:partner"); memory->create(finalpartner,nmax,"bond/react:finalpartner"); memory->create(distsq,nmax,2,"bond/react:distsq"); memory->create(nattempt,nreacts,"bond/react:nattempt"); - memory->create(probability,nmax,"bond/react:probability"); } - // reset create counts + // reset 'attempt' counts for (int i = 0; i < nreacts; i++) { nattempt[i] = 0; } @@ -962,25 +962,14 @@ void FixBondReact::post_integrate() comm->reverse_comm_fix(this); } - // update reaction probability - if (var_flag[PROB][rxnID]) - fraction[rxnID] = input->variable->compute_equal(var_id[PROB][rxnID]); - // each atom now knows its winning partner - // for prob check, generate random value for each atom with a bond partner - // forward comm of partner and random value, so ghosts have it - - if (fraction[rxnID] < 1.0) { - for (int i = 0; i < nlocal; i++) - if (partner[i]) probability[i] = random[rxnID]->uniform(); - } + // forward comm of partner, so ghosts have it commflag = 2; comm->forward_comm_fix(this,2); // consider for reaction: // only if both atoms list each other as winning bond partner - // and probability constraint is satisfied // if other atom is owned by another proc, it should do same thing int temp_nattempt = 0; @@ -994,16 +983,6 @@ void FixBondReact::post_integrate() continue; } - // apply probability constraint using RN for atom with smallest ID - - if (fraction[rxnID] < 1.0) { - if (tag[i] < tag[j]) { - if (probability[i] >= fraction[rxnID]) continue; - } else { - if (probability[j] >= fraction[rxnID]) continue; - } - } - // store final bond partners and count the rxn possibility once finalpartner[i] = tag[j]; @@ -1345,10 +1324,14 @@ void FixBondReact::superimpose_algorithm() (nxspecial[local_atom1][0] == 0 || xspecial[local_atom1][0] == atom->tag[local_atom2]) && check_constraints()) { - status = ACCEPT; - glove_ghostcheck(); - } else - status = REJECT; + if (fraction[rxnID] < 1.0 && + random[rxnID]->uniform() >= fraction[rxnID]) { + status = REJECT; + } else { + status = ACCEPT; + glove_ghostcheck(); + } + } else status = REJECT; } avail_guesses = 0; @@ -1386,7 +1369,10 @@ void FixBondReact::superimpose_algorithm() } // reaction site found successfully! - if (status == ACCEPT) glove_ghostcheck(); + if (status == ACCEPT) + if (fraction[rxnID] < 1.0 && + random[rxnID]->uniform() >= fraction[rxnID]) status = REJECT; + else glove_ghostcheck(); hang_catch++; // let's go ahead and catch the simplest of hangs @@ -3946,20 +3932,10 @@ int FixBondReact::pack_forward_comm(int n, int *list, double *buf, m = 0; - if (commflag == 1) { - for (i = 0; i < n; i++) { - j = list[i]; - printf("hello you shouldn't be here\n"); - //buf[m++] = ubuf(bondcount[j]).d; - } - return m; - } - if (commflag == 2) { for (i = 0; i < n; i++) { j = list[i]; buf[m++] = ubuf(partner[j]).d; - buf[m++] = probability[j]; } return m; } @@ -3985,15 +3961,9 @@ void FixBondReact::unpack_forward_comm(int n, int first, double *buf) m = 0; last = first + n; - if (commflag == 1) { + if (commflag == 2) { for (i = first; i < last; i++) - printf("hello you shouldn't be here\n"); - // bondcount[i] = (int) ubuf(buf[m++]).i; - } else if (commflag == 2) { - for (i = first; i < last; i++) { partner[i] = (tagint) ubuf(buf[m++]).i; - probability[i] = buf[m++]; - } } else { m = 0; last = first + n; @@ -4034,20 +4004,18 @@ void FixBondReact::unpack_reverse_comm(int n, int *list, double *buf) m = 0; - if (commflag != 1) { - for (i = 0; i < n; i++) { - j = list[i]; - if (closeneigh[rxnID] != 0) { - if (buf[m+1] < distsq[j][1]) { - partner[j] = (tagint) ubuf(buf[m++]).i; - distsq[j][1] = buf[m++]; - } else m += 2; - } else { - if (buf[m+1] > distsq[j][0]) { - partner[j] = (tagint) ubuf(buf[m++]).i; - distsq[j][0] = buf[m++]; - } else m += 2; - } + for (i = 0; i < n; i++) { + j = list[i]; + if (closeneigh[rxnID] != 0) { + if (buf[m+1] < distsq[j][1]) { + partner[j] = (tagint) ubuf(buf[m++]).i; + distsq[j][1] = buf[m++]; + } else m += 2; + } else { + if (buf[m+1] > distsq[j][0]) { + partner[j] = (tagint) ubuf(buf[m++]).i; + distsq[j][0] = buf[m++]; + } else m += 2; } } } diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h index 153bdd7a6d..67788df217 100644 --- a/src/USER-REACTION/fix_bond_react.h +++ b/src/USER-REACTION/fix_bond_react.h @@ -86,7 +86,7 @@ class FixBondReact : public Fix { int nmax; // max num local atoms int max_natoms; // max natoms in a molecule template tagint *partner,*finalpartner; - double **distsq,*probability; + double **distsq; int *nattempt; int maxattempt; int allnattempt; From 196b6b92730cd2a9949f158a8981258e52003eb4 Mon Sep 17 00:00:00 2001 From: jrgissing Date: Sat, 20 Feb 2021 20:22:53 -0500 Subject: [PATCH 282/384] variable probability fix --- src/USER-REACTION/fix_bond_react.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 173a92b7fb..93c9fe525b 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -868,6 +868,9 @@ void FixBondReact::post_integrate() ghostly_rxn_count[i] = 0; nlocalskips[i] = 0; nghostlyskips[i] = 0; + // update reaction probability + if (var_flag[PROB][i]) + fraction[i] = input->variable->compute_equal(var_id[PROB][i]); } if (nevery_check) { @@ -875,10 +878,6 @@ void FixBondReact::post_integrate() return; } - // update reaction probability - if (var_flag[PROB][rxnID]) - fraction[rxnID] = input->variable->compute_equal(var_id[PROB][rxnID]); - // acquire updated ghost atom positions // necessary b/c are calling this after integrate, but before Verlet comm From d9941b1648157d32bf812f9cb537cf8b5e093b25 Mon Sep 17 00:00:00 2001 From: jrgissing Date: Sat, 20 Feb 2021 20:29:39 -0500 Subject: [PATCH 283/384] Update in.tiny_nylon.stabilized_variable_probability --- .../tiny_nylon/in.tiny_nylon.stabilized_variable_probability | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/USER/reaction/tiny_nylon/in.tiny_nylon.stabilized_variable_probability b/examples/USER/reaction/tiny_nylon/in.tiny_nylon.stabilized_variable_probability index 2c101ac77c..e81fedc34a 100644 --- a/examples/USER/reaction/tiny_nylon/in.tiny_nylon.stabilized_variable_probability +++ b/examples/USER/reaction/tiny_nylon/in.tiny_nylon.stabilized_variable_probability @@ -22,7 +22,7 @@ improper_style class2 read_data tiny_nylon.data variable runsteps equal 1000 -variable prob1 equal step/v_runsteps*2 +variable prob1 equal step/v_runsteps*2+0.1 variable prob2 equal (step/v_runsteps)>0.5 velocity all create 300.0 4928459 dist gaussian From d5917652d49cd248c3aa9edab463ea2240045ec3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 20 Feb 2021 23:50:55 -0500 Subject: [PATCH 284/384] remove output that is no longer necessary. settings are adapted automatically --- cmake/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index aefa9cd597..f67699c54d 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -777,9 +777,7 @@ if(PKG_GPU) message(STATUS "<<< GPU package settings >>> -- GPU API: ${GPU_API}") if(GPU_API STREQUAL "CUDA") - message(STATUS "GPU architecture: ${GPU_ARCH}") - elseif(GPU_API STREQUAL "OPENCL") - message(STATUS "OpenCL tuning: ${OCL_TUNE}") + message(STATUS "GPU default architecture: ${GPU_ARCH}") elseif(GPU_API STREQUAL "HIP") message(STATUS "HIP platform: ${HIP_PLATFORM}") message(STATUS "HIP architecture: ${HIP_ARCH}") From d025b281cf17b593bee604af787b1e5481f8e96e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 21 Feb 2021 01:28:44 -0500 Subject: [PATCH 285/384] Build and link a static OpenCL loader library for all platforms --- cmake/Modules/OpenCLLoader.cmake | 54 ++++++++++++++++++++++++++++++++ cmake/Modules/Packages/GPU.cmake | 18 +++-------- 2 files changed, 59 insertions(+), 13 deletions(-) create mode 100644 cmake/Modules/OpenCLLoader.cmake diff --git a/cmake/Modules/OpenCLLoader.cmake b/cmake/Modules/OpenCLLoader.cmake new file mode 100644 index 0000000000..0460f686ef --- /dev/null +++ b/cmake/Modules/OpenCLLoader.cmake @@ -0,0 +1,54 @@ +message(STATUS "Downloading and building OpenCL loader library") + +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(OPENCL_LOADER_LIB_POSTFIX d) +else() + set(OPENCL_LOADER_LIB_POSTFIX) +endif() + +include(ExternalProject) +set(OPENCL_LOADER_URL "https://download.lammps.org/thirdparty/opencl-loader-2020.12.18.tar.gz" CACHE STRING "URL for OpenCL loader tarball") +mark_as_advanced(OPENCL_LOADER_URL) +ExternalProject_Add(opencl_loader + URL ${OPENCL_LOADER_URL} + URL_MD5 f1e6a084d4950382588207133965ec89 + SOURCE_DIR "${CMAKE_BINARY_DIR}/opencl_loader-src" + BINARY_DIR "${CMAKE_BINARY_DIR}/opencl_loader-build" + CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${CMAKE_EXTRA_OPENCL_LOADER_OPTS} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + -DCMAKE_INSTALL_PREFIX= + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + BUILD_BYPRODUCTS /lib/${CMAKE_FIND_LIBRARY_PREFIXES}OpenCL${OPENCL_LOADER_LIB_POSTFIX}.a + LOG_DOWNLOAD ON + LOG_CONFIGURE ON + LOG_BUILD ON + INSTALL_COMMAND "" + TEST_COMMAND "") + +ExternalProject_Get_Property(opencl_loader SOURCE_DIR) +set(OPENCL_LOADER_INCLUDE_DIR ${SOURCE_DIR}/inc) + +# workaround for CMake 3.10 on ubuntu 18.04 +file(MAKE_DIRECTORY ${OPENCL_LOADER_INCLUDE_DIR}) + +ExternalProject_Get_Property(opencl_loader BINARY_DIR) + set(OPENCL_LOADER_LIBRARY_PATH "${BINARY_DIR}/libOpenCL${OPENCL_LOADER_LIB_POSTFIX}.a") + +find_package(Threads QUIET) +if(NOT WIN32) + set(OPENCL_LOADER_DEP_LIBS "Threads::Threads;${CMAKE_DL_LIBS}") +else() + set(OPENCL_LOADER_DEP_LIBS "cfgmgr32;runtimeobject") +endif() + +add_library(OpenCL::OpenCL UNKNOWN IMPORTED) +add_dependencies(OpenCL::OpenCL opencl_loader) + +set_target_properties(OpenCL::OpenCL PROPERTIES + IMPORTED_LOCATION ${OPENCL_LOADER_LIBRARY_PATH} + INTERFACE_INCLUDE_DIRECTORIES ${OPENCL_LOADER_INCLUDE_DIR} + INTERFACE_LINK_LIBRARIES "${OPENCL_LOADER_DEP_LIBS}") + + diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index 76ad4190cf..1b543eba8c 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -141,19 +141,10 @@ if(GPU_API STREQUAL "CUDA") target_include_directories(nvc_get_devices PRIVATE ${CUDA_INCLUDE_DIRS}) elseif(GPU_API STREQUAL "OPENCL") - if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - # download and unpack support binaries for compilation of windows binaries. - set(LAMMPS_THIRDPARTY_URL "https://download.lammps.org/thirdparty") - file(DOWNLOAD "${LAMMPS_THIRDPARTY_URL}/opencl-win-devel.tar.gz" "${CMAKE_CURRENT_BINARY_DIR}/opencl-win-devel.tar.gz" - EXPECTED_MD5 2c00364888d5671195598b44c2e0d44d) - execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf opencl-win-devel.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - add_library(OpenCL::OpenCL UNKNOWN IMPORTED) - if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86") - set_target_properties(OpenCL::OpenCL PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/OpenCL/lib_win32/libOpenCL.dll") - elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") - set_target_properties(OpenCL::OpenCL PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/OpenCL/lib_win64/libOpenCL.dll") - endif() - set_target_properties(OpenCL::OpenCL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/OpenCL/include") + option(USE_STATIC_OPENCL_LOADER "Download and include a static OpenCL ICD loader" ON) + mark_as_advanced(USE_STATIC_OPENCL_LOADER) + if (USE_STATIC_OPENCL_LOADER) + include(OpenCLLoader) else() find_package(OpenCL REQUIRED) endif() @@ -208,6 +199,7 @@ elseif(GPU_API STREQUAL "OPENCL") add_executable(ocl_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp) target_compile_definitions(ocl_get_devices PRIVATE -DUCL_OPENCL) target_link_libraries(ocl_get_devices PRIVATE OpenCL::OpenCL) + add_dependencies(ocl_get_devices OpenCL::OpenCL) elseif(GPU_API STREQUAL "HIP") if(NOT DEFINED HIP_PATH) if(NOT DEFINED ENV{HIP_PATH}) From 70327861b29dbc568254d18ce07cbbfcafb5e8ac Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 21 Feb 2021 09:43:56 -0500 Subject: [PATCH 286/384] update for improved OpenCL stub driver with tests --- cmake/Modules/OpenCLLoader.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Modules/OpenCLLoader.cmake b/cmake/Modules/OpenCLLoader.cmake index 0460f686ef..a6aac1c603 100644 --- a/cmake/Modules/OpenCLLoader.cmake +++ b/cmake/Modules/OpenCLLoader.cmake @@ -11,7 +11,7 @@ set(OPENCL_LOADER_URL "https://download.lammps.org/thirdparty/opencl-loader-2020 mark_as_advanced(OPENCL_LOADER_URL) ExternalProject_Add(opencl_loader URL ${OPENCL_LOADER_URL} - URL_MD5 f1e6a084d4950382588207133965ec89 + URL_MD5 d89ab1dc1121b96c9c37526b9db46df1 SOURCE_DIR "${CMAKE_BINARY_DIR}/opencl_loader-src" BINARY_DIR "${CMAKE_BINARY_DIR}/opencl_loader-build" CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${CMAKE_EXTRA_OPENCL_LOADER_OPTS} From 24079e9302c42fc8e559e24d3f4eefe696070253 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 21 Feb 2021 10:45:01 -0500 Subject: [PATCH 287/384] update docs --- doc/src/Build_extras.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index cf15de74bd..5e3356478d 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -133,6 +133,8 @@ CMake build # value = yes (default) or no -D CUDA_MPS_SUPPORT=value # enables some tweaks required to run with active nvidia-cuda-mps daemon # value = yes or no (default) + -D USE_STATIC_OPENCL_LOADER=value # downloads/includes OpenCL ICD loader library, no local OpenCL headers/libs needed + # value = yes (default) or no :code:`GPU_ARCH` settings for different GPU hardware is as follows: @@ -159,6 +161,12 @@ When building with CMake, you **must NOT** build the GPU library in ``lib/gpu`` using the traditional build procedure. CMake will detect files generated by that process and will terminate with an error and a suggestion for how to remove them. +If you are compiling for OpenCL, the default setting is to download, build, and +link with a static OpenCL ICD loader library and standard OpenCL headers. This +way no local OpenCL development headers or library needs to be present and only +OpenCL compatible drivers need to be installed to use OpenCL. If this is not +desired, you can set :code:`USE_STATIC_OPENCL_LOADER` to :code:`no`. + If you are compiling with HIP, note that before running CMake you will have to set appropriate environment variables. Some variables such as :code:`HCC_AMDGPU_TARGET` or :code:`CUDA_PATH` are necessary for :code:`hipcc` From 0c6671ad64354be8197d1f784df8b35b7a67b41c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 21 Feb 2021 11:06:58 -0500 Subject: [PATCH 288/384] do not always add styles that depend on other packages --- cmake/Modules/Packages/GPU.cmake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index 1b543eba8c..70014c8782 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -382,12 +382,8 @@ elseif(GPU_API STREQUAL "HIP") target_link_libraries(lammps PRIVATE gpu) endif() -# GPU package -FindStyleHeaders(${GPU_SOURCES_DIR} FIX_CLASS fix_ FIX) - set_property(GLOBAL PROPERTY "GPU_SOURCES" "${GPU_SOURCES}") - -# detects styles which have GPU version +# detect styles which have a GPU version RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES) get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES) From 826c618aa9e3a69eee32abded0686b0191d5211a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 21 Feb 2021 15:09:50 -0500 Subject: [PATCH 289/384] replace a few more cases of atoi()/atof() with utils::*numeric() functions --- src/atom.cpp | 2 +- src/compute_reduce.cpp | 4 ++-- src/fix_property_atom.cpp | 20 +++++++++++++------- src/kspace.cpp | 12 ++++++------ 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/atom.cpp b/src/atom.cpp index 75b1b07fbf..fe260309e2 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -1752,7 +1752,7 @@ void Atom::set_mass(const char *file, int line, int /*narg*/, char **arg) if (lo < 1 || hi > ntypes) error->all(file,line,"Invalid type for mass set"); for (int itype = lo; itype <= hi; itype++) { - mass[itype] = atof(arg[1]); + mass[itype] = utils::numeric(FLERR,arg[1],false,lmp); mass_setflag[itype] = 1; if (mass[itype] <= 0.0) error->all(file,line,"Invalid mass value"); diff --git a/src/compute_reduce.cpp b/src/compute_reduce.cpp index 82d3dff458..bc9aeefe7b 100644 --- a/src/compute_reduce.cpp +++ b/src/compute_reduce.cpp @@ -148,8 +148,8 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : if (iarg+3 > narg) error->all(FLERR,"Illegal compute reduce command"); if (mode != MINN && mode != MAXX) error->all(FLERR,"Compute reduce replace requires min or max mode"); - int col1 = atoi(arg[iarg+1]) - 1; - int col2 = atoi(arg[iarg+2]) - 1; + int col1 = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; + int col2 = utils::inumeric(FLERR,arg[iarg+2],false,lmp) - 1; if (col1 < 0 || col1 >= nvalues || col2 < 0 || col2 >= nvalues) error->all(FLERR,"Illegal compute reduce command"); if (col1 == col2) error->all(FLERR,"Illegal compute reduce command"); diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index c1c52a3f8c..f18888bbfc 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -254,13 +254,19 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf, if ((m = atom->map(itag)) >= 0) { for (j = 0; j < nvalue; j++) { - if (style[j] == MOLECULE) atom->molecule[m] = ATOTAGINT(values[j+1]); - else if (style[j] == CHARGE) atom->q[m] = atof(values[j+1]); - else if (style[j] == RMASS) atom->rmass[m] = atof(values[j+1]); - else if (style[j] == INTEGER) - atom->ivector[index[j]][m] = atoi(values[j+1]); - else if (style[j] == DOUBLE) - atom->dvector[index[j]][m] = atof(values[j+1]); + if (style[j] == MOLECULE) { + atom->molecule[m] = utils::tnumeric(FLERR,values[j+1],false,lmp); + } else if (style[j] == CHARGE) { + atom->q[m] = utils::numeric(FLERR,values[j+1],false,lmp); + } else if (style[j] == RMASS) { + atom->rmass[m] = utils::numeric(FLERR,values[j+1],false,lmp); + } else if (style[j] == INTEGER) { + atom->ivector[index[j]][m] = utils::inumeric(FLERR,values[j+1], + false,lmp); + } else if (style[j] == DOUBLE) { + atom->dvector[index[j]][m] = utils::numeric(FLERR,values[j+1], + true,lmp); + } } } diff --git a/src/kspace.cpp b/src/kspace.cpp index 5556a5e8d0..f44cc42aaf 100644 --- a/src/kspace.cpp +++ b/src/kspace.cpp @@ -564,9 +564,9 @@ void KSpace::modify_params(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"kmax/ewald") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal kspace_modify command"); - kx_ewald = atoi(arg[iarg+1]); - ky_ewald = atoi(arg[iarg+2]); - kz_ewald = atoi(arg[iarg+3]); + kx_ewald = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + ky_ewald = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + kz_ewald = utils::inumeric(FLERR,arg[iarg+3],false,lmp); if (kx_ewald < 0 || ky_ewald < 0 || kz_ewald < 0) error->all(FLERR,"Bad kspace_modify kmax/ewald parameter"); if (kx_ewald > 0 && ky_ewald > 0 && kz_ewald > 0) @@ -583,15 +583,15 @@ void KSpace::modify_params(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"force/disp/real") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); - accuracy_real_6 = atof(arg[iarg+1]); + accuracy_real_6 = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"force/disp/kspace") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); - accuracy_kspace_6 = atof(arg[iarg+1]); + accuracy_kspace_6 = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"eigtol") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); - splittol = atof(arg[iarg+1]); + splittol = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (splittol >= 1.0) error->all(FLERR,"Kspace_modify eigtol must be smaller than one"); iarg += 2; From 06f6766ed6dab0ac18607ea9ee9d237a09569716 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 21 Feb 2021 16:20:36 -0500 Subject: [PATCH 290/384] CMAKE_FIND_LIBRARY_PREFIXES is a path. must use plain "lib" instead, but there is a variable for the suffix --- cmake/Modules/GTest.cmake | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cmake/Modules/GTest.cmake b/cmake/Modules/GTest.cmake index 060a7e42f9..0c62291d5e 100644 --- a/cmake/Modules/GTest.cmake +++ b/cmake/Modules/GTest.cmake @@ -20,10 +20,10 @@ ExternalProject_Add(googletest -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} - BUILD_BYPRODUCTS /lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${GTEST_LIB_POSTFIX}.a - /lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock${GTEST_LIB_POSTFIX}.a - /lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${GTEST_LIB_POSTFIX}.a - /lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock_main${GTEST_LIB_POSTFIX}.a + BUILD_BYPRODUCTS /lib/libgtest${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} + /lib/libgmock${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} + /lib/libgtest_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} + /lib/libgmock_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} LOG_DOWNLOAD ON LOG_CONFIGURE ON LOG_BUILD ON @@ -39,10 +39,10 @@ file(MAKE_DIRECTORY ${GTEST_INCLUDE_DIR}) file(MAKE_DIRECTORY ${GMOCK_INCLUDE_DIR}) ExternalProject_Get_Property(googletest BINARY_DIR) -set(GTEST_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${GTEST_LIB_POSTFIX}.a) -set(GMOCK_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock${GTEST_LIB_POSTFIX}.a) -set(GTEST_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${GTEST_LIB_POSTFIX}.a) -set(GMOCK_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock_main${GTEST_LIB_POSTFIX}.a) +set(GTEST_LIBRARY_PATH ${BINARY_DIR}/lib/libgtest${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) +set(GMOCK_LIBRARY_PATH ${BINARY_DIR}/lib/libgmock${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) +set(GTEST_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/libgtest_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) +set(GMOCK_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/libgmock_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) # Prevent GoogleTest from overriding our compiler/linker options # when building with Visual Studio From 1a68d761a3060cfd7c8ead56b495df070a847a23 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 21 Feb 2021 16:21:45 -0500 Subject: [PATCH 291/384] correct how to construct the path to the generated OpenCL lib --- cmake/Modules/OpenCLLoader.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/OpenCLLoader.cmake b/cmake/Modules/OpenCLLoader.cmake index a6aac1c603..290f15415a 100644 --- a/cmake/Modules/OpenCLLoader.cmake +++ b/cmake/Modules/OpenCLLoader.cmake @@ -20,7 +20,7 @@ ExternalProject_Add(opencl_loader -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} - BUILD_BYPRODUCTS /lib/${CMAKE_FIND_LIBRARY_PREFIXES}OpenCL${OPENCL_LOADER_LIB_POSTFIX}.a + BUILD_BYPRODUCTS /libOpenCL${OPENCL_LOADER_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} LOG_DOWNLOAD ON LOG_CONFIGURE ON LOG_BUILD ON @@ -34,7 +34,7 @@ set(OPENCL_LOADER_INCLUDE_DIR ${SOURCE_DIR}/inc) file(MAKE_DIRECTORY ${OPENCL_LOADER_INCLUDE_DIR}) ExternalProject_Get_Property(opencl_loader BINARY_DIR) - set(OPENCL_LOADER_LIBRARY_PATH "${BINARY_DIR}/libOpenCL${OPENCL_LOADER_LIB_POSTFIX}.a") +set(OPENCL_LOADER_LIBRARY_PATH "${BINARY_DIR}/libOpenCL${OPENCL_LOADER_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") find_package(Threads QUIET) if(NOT WIN32) From db95552f2b4c28c630c5c9a35b3a83b7892e990e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 21 Feb 2021 16:42:30 -0500 Subject: [PATCH 292/384] update md5sum for updated archive (again) --- cmake/Modules/OpenCLLoader.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Modules/OpenCLLoader.cmake b/cmake/Modules/OpenCLLoader.cmake index 290f15415a..ecd9204d24 100644 --- a/cmake/Modules/OpenCLLoader.cmake +++ b/cmake/Modules/OpenCLLoader.cmake @@ -11,7 +11,7 @@ set(OPENCL_LOADER_URL "https://download.lammps.org/thirdparty/opencl-loader-2020 mark_as_advanced(OPENCL_LOADER_URL) ExternalProject_Add(opencl_loader URL ${OPENCL_LOADER_URL} - URL_MD5 d89ab1dc1121b96c9c37526b9db46df1 + URL_MD5 011cdcbd41030be94f3fced6d763a52a SOURCE_DIR "${CMAKE_BINARY_DIR}/opencl_loader-src" BINARY_DIR "${CMAKE_BINARY_DIR}/opencl_loader-build" CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${CMAKE_EXTRA_OPENCL_LOADER_OPTS} From e0e89c588ba0c907f60824806dcf5ea84e8090d5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 21 Feb 2021 17:11:38 -0500 Subject: [PATCH 293/384] correct library prefix name use also for building libyaml --- cmake/Modules/YAML.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/YAML.cmake b/cmake/Modules/YAML.cmake index a080b566be..f2ba34e1b6 100644 --- a/cmake/Modules/YAML.cmake +++ b/cmake/Modules/YAML.cmake @@ -12,7 +12,7 @@ ExternalProject_Add(libyaml CXX=${CMAKE_CXX_COMPILER} CC=${CMAKE_C_COMPILER} --prefix= --disable-shared - BUILD_BYPRODUCTS /lib/${CMAKE_FIND_LIBRARY_PREFIXES}yaml.a + BUILD_BYPRODUCTS /lib/libyaml${CMAKE_STATIC_LIBRARY_SUFFIX} TEST_COMMAND "") ExternalProject_Get_Property(libyaml INSTALL_DIR) @@ -23,7 +23,7 @@ set(YAML_LIBRARY_DIR ${INSTALL_DIR}/lib) file(MAKE_DIRECTORY ${YAML_INCLUDE_DIR}) file(MAKE_DIRECTORY ${YAML_LIBRARY_DIR}) -set(YAML_LIBRARY_PATH ${INSTALL_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}yaml.a) +set(YAML_LIBRARY_PATH ${INSTALL_DIR}/lib/libyaml${CMAKE_STATIC_LIBRARY_SUFFIX}) add_library(Yaml::Yaml UNKNOWN IMPORTED) set_target_properties(Yaml::Yaml PROPERTIES From 4786391fad023faaa676de5957cd3ea7d3ead24f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 21 Feb 2021 20:40:11 -0500 Subject: [PATCH 294/384] must explicitly register fix gpu --- cmake/Modules/Packages/GPU.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index 70014c8782..e2586881ef 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -385,6 +385,7 @@ endif() set_property(GLOBAL PROPERTY "GPU_SOURCES" "${GPU_SOURCES}") # detect styles which have a GPU version RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES) +RegisterFixStyle(${GPU_SOURCES_DIR}/fix_gpu.h) get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES) From f467832e0f48d6aeb1c14fcbd3a30b27af3d537f Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Mon, 22 Feb 2021 01:29:50 -0500 Subject: [PATCH 295/384] Make PyLammps command history feature optional PyLammps so far has been saving a history for every executed command. This was originally added to allow writing out the commands of interactive PyLammps sessions as regular input scripts. This commit disables this history by default, which avoids the small, but rising memory consumption over time. It can be enabled and disabled with the enable_cmd_history property. There is also now a method to clear the history at any time. --- python/lammps/pylammps.py | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/python/lammps/pylammps.py b/python/lammps/pylammps.py index 47a2a5a6ab..4bba9f5e94 100644 --- a/python/lammps/pylammps.py +++ b/python/lammps/pylammps.py @@ -400,6 +400,7 @@ class PyLammps(object): self.lmp = lammps(name=name,cmdargs=cmdargs,ptr=None,comm=comm) print("LAMMPS output is captured by PyLammps wrapper") self._cmd_history = [] + self._enable_cmd_history = False self.runs = [] def __del__(self): @@ -434,6 +435,24 @@ class PyLammps(object): """ self.lmp.file(file) + @property + def enable_cmd_history(self): + """ + :getter: Return whether command history is saved + :setter: Set if command history should be saved + :type: bool + """ + return self._enable_cmd_history + + @enable_cmd_history.setter + def enable_cmd_history(self, value): + """ + :getter: Return whether command history is saved + :setter: Set if command history should be saved + :type: bool + """ + self._enable_cmd_history = (value == True) + def write_script(self, filepath): """ Write LAMMPS script file containing all commands executed up until now @@ -445,18 +464,28 @@ class PyLammps(object): for cmd in self._cmd_history: print(cmd, file=f) + def clear_cmd_history(self): + """ + Clear LAMMPS command history up to this point + """ + self._cmd_history = [] + def command(self, cmd): """ Execute LAMMPS command - All commands executed will be stored in a command history which can be - written to a file using :py:meth:`PyLammps.write_script()` + If :py:attr:`PyLammps.enable_cmd_history` is set to ``True``, commands executed + will be recorded. The entire command history can be written to a file using + :py:meth:`PyLammps.write_script()`. To clear the command history, use + :py:meth:`PyLammps.clear_cmd_history()`. :param cmd: command string that should be executed :type: cmd: string """ self.lmp.command(cmd) - self._cmd_history.append(cmd) + + if self.enable_cmd_history: + self._cmd_history.append(cmd) def run(self, *args, **kwargs): """ From f3ee948450bbc63eef80c3bad1a2de382dda7b75 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 22 Feb 2021 07:05:20 -0500 Subject: [PATCH 296/384] need to use column 1 in fix ave/time example --- doc/src/compute_temp_chunk.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/compute_temp_chunk.rst b/doc/src/compute_temp_chunk.rst index 77e2568fce..f1c34b42fa 100644 --- a/doc/src/compute_temp_chunk.rst +++ b/doc/src/compute_temp_chunk.rst @@ -153,7 +153,7 @@ temp/chunk calculation to a file is to use the :doc:`fix ave/time compute cc1 all chunk/atom molecule compute myChunk all temp/chunk cc1 temp - fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector + fix 1 all ave/time 100 1 100 c_myChunk[1] file tmp.out mode vector ---------- From ab05e9f5c1db913e32e1e2c866c1548524c0da61 Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Tue, 23 Feb 2021 06:11:54 -0600 Subject: [PATCH 297/384] update the log files for the kim command examples --- .../kim/log.10Feb21.in.kim-ex.melt.clang.1 | 107 +++ .../kim/log.10Feb21.in.kim-ex.melt.clang.4 | 107 +++ .../log.10Feb21.in.kim-pm-property.clang.1 | 223 ++++++ .../log.10Feb21.in.kim-pm-property.clang.4 | 223 ++++++ .../log.10Feb21.in.kim-pm-query.melt.clang.1 | 210 ++++++ .../log.10Feb21.in.kim-pm-query.melt.clang.4 | 210 ++++++ .../kim/log.10Feb21.in.kim-pm.melt.clang.1 | 204 ++++++ .../kim/log.10Feb21.in.kim-pm.melt.clang.4 | 204 ++++++ examples/kim/log.10Feb21.in.kim-query.clang.1 | 655 ++++++++++++++++++ .../kim/log.10Feb21.in.kim-sm.melt.clang.1 | 208 ++++++ .../kim/log.10Feb21.in.kim-sm.melt.clang.4 | 208 ++++++ .../kim/log.10Feb21.in.lammps.melt.clang.1 | 88 +++ .../kim/log.10Feb21.in.lammps.melt.clang.4 | 88 +++ 13 files changed, 2735 insertions(+) create mode 100644 examples/kim/log.10Feb21.in.kim-ex.melt.clang.1 create mode 100644 examples/kim/log.10Feb21.in.kim-ex.melt.clang.4 create mode 100644 examples/kim/log.10Feb21.in.kim-pm-property.clang.1 create mode 100644 examples/kim/log.10Feb21.in.kim-pm-property.clang.4 create mode 100644 examples/kim/log.10Feb21.in.kim-pm-query.melt.clang.1 create mode 100644 examples/kim/log.10Feb21.in.kim-pm-query.melt.clang.4 create mode 100644 examples/kim/log.10Feb21.in.kim-pm.melt.clang.1 create mode 100644 examples/kim/log.10Feb21.in.kim-pm.melt.clang.4 create mode 100644 examples/kim/log.10Feb21.in.kim-query.clang.1 create mode 100644 examples/kim/log.10Feb21.in.kim-sm.melt.clang.1 create mode 100644 examples/kim/log.10Feb21.in.kim-sm.melt.clang.4 create mode 100644 examples/kim/log.10Feb21.in.lammps.melt.clang.1 create mode 100644 examples/kim/log.10Feb21.in.lammps.melt.clang.4 diff --git a/examples/kim/log.10Feb21.in.kim-ex.melt.clang.1 b/examples/kim/log.10Feb21.in.kim-ex.melt.clang.1 new file mode 100644 index 0000000000..dcf8727fc0 --- /dev/null +++ b/examples/kim/log.10Feb21.in.kim-ex.melt.clang.1 @@ -0,0 +1,107 @@ +LAMMPS (10 Feb 2021) +# 3d Lennard-Jones melt +# +# This example requires that the example models provided with +# the kim-api package are installed. see the `./lib/kim/README` or +# `./lib/kim/Install.py` files for details on how to install these +# example models. +# + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable xx equal 20*1 +variable yy equal 20*$y +variable yy equal 20*1 +variable zz equal 20*$z +variable zz equal 20*1 + +kim init LennardJones_Ar real +#=== BEGIN kim init ========================================== +units real +neighbor 2.0 bin # Angstroms +timestep 1.0 # femtoseconds + +This model has No mutable parameters. +#=== END kim init ============================================ + + +lattice fcc 4.4300 +Lattice spacing in x,y,z = 4.4300000 4.4300000 4.4300000 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +region box block 0 20 0 ${yy} 0 ${zz} +region box block 0 20 0 20 0 ${zz} +region box block 0 20 0 20 0 20 +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (88.600000 88.600000 88.600000) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 32000 atoms + create_atoms CPU = 0.003 seconds + +kim interactions Ar +#=== BEGIN kim interactions ================================== +pair_style kim LennardJones_Ar +WARNING: KIM Model does not provide 'partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1139) +WARNING: KIM Model does not provide 'partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1145) +pair_coeff * * Ar +#=== END kim interactions ==================================== + + +mass 1 39.95 +velocity all create 200.0 232345 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 + +run 100 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton off, cut 8.450000000000001 + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 28.12 | 28.12 | 28.12 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 145069.63 0 164146.22 128015.94 + 100 95.179703 154939.42 0 164017.94 131602.75 +Loop time of 2.8463 on 1 procs for 100 steps with 32000 atoms + +Performance: 3.036 ns/day, 7.906 hours/ns, 35.133 timesteps/s +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.5046 | 2.5046 | 2.5046 | 0.0 | 88.00 +Neigh | 0.29437 | 0.29437 | 0.29437 | 0.0 | 10.34 +Comm | 0.01182 | 0.01182 | 0.01182 | 0.0 | 0.42 +Output | 7e-05 | 7e-05 | 7e-05 | 0.0 | 0.00 +Modify | 0.024522 | 0.024522 | 0.024522 | 0.0 | 0.86 +Other | | 0.01091 | | | 0.38 + +Nlocal: 32000.0 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19911.0 ave 19911 max 19911 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 4.25375e+06 ave 4.25375e+06 max 4.25375e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 4253750 +Ave neighs/atom = 132.92969 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:02 diff --git a/examples/kim/log.10Feb21.in.kim-ex.melt.clang.4 b/examples/kim/log.10Feb21.in.kim-ex.melt.clang.4 new file mode 100644 index 0000000000..476b66753b --- /dev/null +++ b/examples/kim/log.10Feb21.in.kim-ex.melt.clang.4 @@ -0,0 +1,107 @@ +LAMMPS (10 Feb 2021) +# 3d Lennard-Jones melt +# +# This example requires that the example models provided with +# the kim-api package are installed. see the `./lib/kim/README` or +# `./lib/kim/Install.py` files for details on how to install these +# example models. +# + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable xx equal 20*1 +variable yy equal 20*$y +variable yy equal 20*1 +variable zz equal 20*$z +variable zz equal 20*1 + +kim init LennardJones_Ar real +#=== BEGIN kim init ========================================== +units real +neighbor 2.0 bin # Angstroms +timestep 1.0 # femtoseconds + +This model has No mutable parameters. +#=== END kim init ============================================ + + +lattice fcc 4.4300 +Lattice spacing in x,y,z = 4.4300000 4.4300000 4.4300000 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +region box block 0 20 0 ${yy} 0 ${zz} +region box block 0 20 0 20 0 ${zz} +region box block 0 20 0 20 0 20 +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (88.600000 88.600000 88.600000) + 1 by 2 by 2 MPI processor grid +create_atoms 1 box +Created 32000 atoms + create_atoms CPU = 0.001 seconds + +kim interactions Ar +#=== BEGIN kim interactions ================================== +pair_style kim LennardJones_Ar +WARNING: KIM Model does not provide 'partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1139) +WARNING: KIM Model does not provide 'partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1145) +pair_coeff * * Ar +#=== END kim interactions ==================================== + + +mass 1 39.95 +velocity all create 200.0 232345 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 + +run 100 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton off, cut 8.450000000000001 + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 9.791 | 9.791 | 9.791 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 145069.63 0 164146.22 128015.94 + 100 95.179703 154939.42 0 164017.94 131602.75 +Loop time of 0.857614 on 4 procs for 100 steps with 32000 atoms + +Performance: 10.074 ns/day, 2.382 hours/ns, 116.603 timesteps/s +99.6% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.73048 | 0.73398 | 0.73855 | 0.3 | 85.58 +Neigh | 0.083739 | 0.083964 | 0.084335 | 0.1 | 9.79 +Comm | 0.017996 | 0.022912 | 0.026515 | 2.1 | 2.67 +Output | 2.7e-05 | 3.5e-05 | 4.5e-05 | 0.0 | 0.00 +Modify | 0.010073 | 0.010158 | 0.010271 | 0.1 | 1.18 +Other | | 0.006571 | | | 0.77 + +Nlocal: 8000.00 ave 8018 max 7967 min +Histogram: 1 0 0 0 0 0 1 0 0 2 +Nghost: 9131.00 ave 9164 max 9113 min +Histogram: 2 0 0 1 0 0 0 0 0 1 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 1.06344e+06 ave 1.06594e+06 max 1.05881e+06 min +Histogram: 1 0 0 0 0 0 1 0 0 2 + +Total # of neighbors = 4253750 +Ave neighs/atom = 132.92969 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/kim/log.10Feb21.in.kim-pm-property.clang.1 b/examples/kim/log.10Feb21.in.kim-pm-property.clang.1 new file mode 100644 index 0000000000..a00085a486 --- /dev/null +++ b/examples/kim/log.10Feb21.in.kim-pm-property.clang.1 @@ -0,0 +1,223 @@ +LAMMPS (10 Feb 2021) +# kim property example +# +# For detailed information of this example please refer to: +# `https://openkim.org/doc/evaluation/tutorial-lammps/` +# +# Description: +# +# This example is designed to calculate the cohesive energy corresponding to +# the equilibrium FCC lattice constant for +# `LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004` model for +# argon. The material properties computed in LAMMPS are represented as a +# standard KIM property instance format. (See +# `https://openkim.org/doc/schema/properties-framework/` and +# `https://lammps.sandia.gov/doc/kim_commands.html` for further details). +# Then the created property instance is written to a file named `results.edn` +# using the `kim property dump` command. +# +# Requirement: +# +# This example requires LAMMPS built with the Python 3.6 or later package +# installed. See the `https://lammps.sandia.gov/doc/python.html` doc page for +# more info on building LAMMPS with the version of Python on your system. +# After successfully building LAMMPS with Python, you need to install the +# kim-property Python package, See the +# `https://lammps.sandia.gov/doc/Build_extras.html#kim` doc page for +# further details. +# +# This example requires that the KIM Portable Model (PM) +# `LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004` +# is installed. This can be done with the command +# kim-api-collections-management install user LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004 +# If this command does not work, you may need to setup your PATH to find the utility. +# If you installed the kim-api using the LAMMPS CMake build, you can do the following +# (where the current working directory is assumed to be the LAMMPS build directory) +# source ./kim_build-prefix/bin/kim-api-activate +# If you installed the kim-api using the LAMMPS Make build, you can do the following +# (where the current working directory is assumed to be the LAMMPS src directory) +# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate +# (where you should relplace X.Y.Z with the appropriate kim-api version number). +# +# Or, see `https://openkim.org/doc/obtaining-models` for alternative options. +# + +# Initialize interatomic potential (KIM model) and units +atom_style atomic + +# Set the OpenKIM model that will be used +kim init LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004 metal +#=== BEGIN kim init ========================================== +units metal +neighbor 2.0 bin # Angstroms +timestep 1.0e-3 # picoseconds + +This model has 3 mutable parameters. + No. | Parameter name | data type | extent +----------------------------------------------------- + 1 | cutoff | "Double" | 1 + 2 | epsilon | "Double" | 1 + 3 | sigma | "Double" | 1 +#=== END kim init ============================================ + + +# the equilibrium lattice constant for the fcc structure +variable lattice_constant equal 5.248509056866169 + +# Periodic boundary conditions along all three dimensions +boundary p p p + +# Create an FCC lattice with the lattice spacing +# using a single conventional (orthogonal) unit cell +lattice fcc ${lattice_constant} +lattice fcc 5.24850905686617 +Lattice spacing in x,y,z = 5.2485091 5.2485091 5.2485091 +region box block 0 1 0 1 0 1 units lattice +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (5.2485091 5.2485091 5.2485091) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 4 atoms + create_atoms CPU = 0.000 seconds +mass 1 39.948 + +# Specify the KIM interactions +kim interactions Ar +#=== BEGIN kim interactions ================================== +pair_style kim LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004 +pair_coeff * * Ar +#=== END kim interactions ==================================== + + +# Compute energy +run 0 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- @Comment +{ +\documentclass{article} +\usepackage{url} +\begin{document} +This Model originally published in \cite{MO_126566794224_004a} is archived in OpenKIM~\cite{MO_126566794224_004, MD_498634107543_004, tadmor:elliott:2011, elliott:tadmor:2011}. +\bibliographystyle{vancouver} +\bibliography{kimcite-MO_126566794224_004.bib} +\end{document} +} + +@Misc{MO_126566794224_004, + author = {Ellad Tadmor}, + title = {{L}ennard-{J}ones model (shifted) for {A}r with parameters from {B}ernardes (1958) (medium precision cutoff) v004}, + doi = {10.25950/9f98b989}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/9f98b989}}, + keywords = {OpenKIM, Model, MO_126566794224_004}, + publisher = {OpenKIM}, + year = 2020, +} + +@Misc{MD_498634107543_004, + author = {Ellad Tadmor}, + title = {{D}river for the {L}ennard-{J}ones model uniformly shifted to have zero energy at the cutoff radius v004}, + doi = {10.25950/bdffd6a6}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/9f98b989}}, + keywords = {OpenKIM, Model Driver, MD_498634107543_004}, + publisher = {OpenKIM}, + year = 2020, +} + +@Article{tadmor:elliott:2011, + author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker}, + title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels}, + journal = {{JOM}}, + year = {2011}, + volume = {63}, + number = {7}, + pages = {17}, + doi = {10.1007/s11837-011-0102-6}, +} + +@Misc{elliott:tadmor:2011, + author = {Ryan S. Elliott and Ellad B. Tadmor}, + title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})}, + howpublished = {\url{https://openkim.org/kim-api}}, + publisher = {OpenKIM}, + year = 2011, + doi = {10.25950/ff8f563a}, +} + +@Article{MO_126566794224_004a, + author = {Newton Bernardes}, + doi = {10.1103/PhysRev.112.1534}, + issue = {5}, + journal = {Physical Review}, + pages = {1534--1539}, + publisher = {American Physical Society}, + title = {Theory of Solid {N}e, {A}, {K}r, and {X}e at 0{K}}, + volume = {112}, + year = {1958}, +} +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 15.5 + ghost atom cutoff = 15.5 + binsize = 7.75, bins = 1 1 1 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton off, cut 15.5 + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.119 | 3.119 | 3.119 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -0.34602203 0 -0.34602203 0.00061471244 +Loop time of 0 on 1 procs for 0 steps with 4 atoms + +0.0% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0 | 0 | 0 | 0.0 | 0.00 +Output | 0 | 0 | 0 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 0 | | | 0.00 + +Nlocal: 4.00000 ave 4 max 4 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 1094.00 ave 1094 max 1094 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 1712.00 ave 1712 max 1712 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1712 +Ave neighs/atom = 428.00000 +Neighbor list builds = 0 +Dangerous builds = 0 + +# Get cohesive energy +variable natoms equal "count(all)" +variable ecohesive equal "-pe/v_natoms" + +# Create a property instance +kim property create 1 cohesive-potential-energy-cubic-crystal +#=== kim property =========================================== + +# Set all the key-value pairs for this property instance +kim property modify 1 key short-name source-value 1 fcc key species source-value 1 Ar key a source-value ${lattice_constant} source-unit angstrom key basis-atom-coordinates source-value 1 1:3 0.0 0.0 0.0 source-value 2 1:3 0.0 0.5 0.5 source-value 3 1:3 0.5 0.0 0.5 source-value 4 1:3 0.5 0.5 0.0 key space-group source-value Fm-3m key cohesive-potential-energy source-value ${ecohesive} source-unit eV +kim property modify 1 key short-name source-value 1 fcc key species source-value 1 Ar key a source-value 5.24850905686617 source-unit angstrom key basis-atom-coordinates source-value 1 1:3 0.0 0.0 0.0 source-value 2 1:3 0.0 0.5 0.5 source-value 3 1:3 0.5 0.0 0.5 source-value 4 1:3 0.5 0.5 0.0 key space-group source-value Fm-3m key cohesive-potential-energy source-value ${ecohesive} source-unit eV +kim property modify 1 key short-name source-value 1 fcc key species source-value 1 Ar key a source-value 5.24850905686617 source-unit angstrom key basis-atom-coordinates source-value 1 1:3 0.0 0.0 0.0 source-value 2 1:3 0.0 0.5 0.5 source-value 3 1:3 0.5 0.0 0.5 source-value 4 1:3 0.5 0.5 0.0 key space-group source-value Fm-3m key cohesive-potential-energy source-value 0.0865055084950546 source-unit eV +#=== kim property =========================================== + +# Dump the results in a file +kim property dump "results.edn" +#=== kim property =========================================== +Total wall time: 0:00:00 diff --git a/examples/kim/log.10Feb21.in.kim-pm-property.clang.4 b/examples/kim/log.10Feb21.in.kim-pm-property.clang.4 new file mode 100644 index 0000000000..c3dd234af2 --- /dev/null +++ b/examples/kim/log.10Feb21.in.kim-pm-property.clang.4 @@ -0,0 +1,223 @@ +LAMMPS (10 Feb 2021) +# kim property example +# +# For detailed information of this example please refer to: +# `https://openkim.org/doc/evaluation/tutorial-lammps/` +# +# Description: +# +# This example is designed to calculate the cohesive energy corresponding to +# the equilibrium FCC lattice constant for +# `LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004` model for +# argon. The material properties computed in LAMMPS are represented as a +# standard KIM property instance format. (See +# `https://openkim.org/doc/schema/properties-framework/` and +# `https://lammps.sandia.gov/doc/kim_commands.html` for further details). +# Then the created property instance is written to a file named `results.edn` +# using the `kim property dump` command. +# +# Requirement: +# +# This example requires LAMMPS built with the Python 3.6 or later package +# installed. See the `https://lammps.sandia.gov/doc/python.html` doc page for +# more info on building LAMMPS with the version of Python on your system. +# After successfully building LAMMPS with Python, you need to install the +# kim-property Python package, See the +# `https://lammps.sandia.gov/doc/Build_extras.html#kim` doc page for +# further details. +# +# This example requires that the KIM Portable Model (PM) +# `LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004` +# is installed. This can be done with the command +# kim-api-collections-management install user LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004 +# If this command does not work, you may need to setup your PATH to find the utility. +# If you installed the kim-api using the LAMMPS CMake build, you can do the following +# (where the current working directory is assumed to be the LAMMPS build directory) +# source ./kim_build-prefix/bin/kim-api-activate +# If you installed the kim-api using the LAMMPS Make build, you can do the following +# (where the current working directory is assumed to be the LAMMPS src directory) +# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate +# (where you should relplace X.Y.Z with the appropriate kim-api version number). +# +# Or, see `https://openkim.org/doc/obtaining-models` for alternative options. +# + +# Initialize interatomic potential (KIM model) and units +atom_style atomic + +# Set the OpenKIM model that will be used +kim init LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004 metal +#=== BEGIN kim init ========================================== +units metal +neighbor 2.0 bin # Angstroms +timestep 1.0e-3 # picoseconds + +This model has 3 mutable parameters. + No. | Parameter name | data type | extent +----------------------------------------------------- + 1 | cutoff | "Double" | 1 + 2 | epsilon | "Double" | 1 + 3 | sigma | "Double" | 1 +#=== END kim init ============================================ + + +# the equilibrium lattice constant for the fcc structure +variable lattice_constant equal 5.248509056866169 + +# Periodic boundary conditions along all three dimensions +boundary p p p + +# Create an FCC lattice with the lattice spacing +# using a single conventional (orthogonal) unit cell +lattice fcc ${lattice_constant} +lattice fcc 5.24850905686617 +Lattice spacing in x,y,z = 5.2485091 5.2485091 5.2485091 +region box block 0 1 0 1 0 1 units lattice +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (5.2485091 5.2485091 5.2485091) + 1 by 2 by 2 MPI processor grid +create_atoms 1 box +Created 4 atoms + create_atoms CPU = 0.000 seconds +mass 1 39.948 + +# Specify the KIM interactions +kim interactions Ar +#=== BEGIN kim interactions ================================== +pair_style kim LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004 +pair_coeff * * Ar +#=== END kim interactions ==================================== + + +# Compute energy +run 0 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- @Comment +{ +\documentclass{article} +\usepackage{url} +\begin{document} +This Model originally published in \cite{MO_126566794224_004a} is archived in OpenKIM~\cite{MO_126566794224_004, MD_498634107543_004, tadmor:elliott:2011, elliott:tadmor:2011}. +\bibliographystyle{vancouver} +\bibliography{kimcite-MO_126566794224_004.bib} +\end{document} +} + +@Misc{MO_126566794224_004, + author = {Ellad Tadmor}, + title = {{L}ennard-{J}ones model (shifted) for {A}r with parameters from {B}ernardes (1958) (medium precision cutoff) v004}, + doi = {10.25950/9f98b989}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/9f98b989}}, + keywords = {OpenKIM, Model, MO_126566794224_004}, + publisher = {OpenKIM}, + year = 2020, +} + +@Misc{MD_498634107543_004, + author = {Ellad Tadmor}, + title = {{D}river for the {L}ennard-{J}ones model uniformly shifted to have zero energy at the cutoff radius v004}, + doi = {10.25950/bdffd6a6}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/9f98b989}}, + keywords = {OpenKIM, Model Driver, MD_498634107543_004}, + publisher = {OpenKIM}, + year = 2020, +} + +@Article{tadmor:elliott:2011, + author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker}, + title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels}, + journal = {{JOM}}, + year = {2011}, + volume = {63}, + number = {7}, + pages = {17}, + doi = {10.1007/s11837-011-0102-6}, +} + +@Misc{elliott:tadmor:2011, + author = {Ryan S. Elliott and Ellad B. Tadmor}, + title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})}, + howpublished = {\url{https://openkim.org/kim-api}}, + publisher = {OpenKIM}, + year = 2011, + doi = {10.25950/ff8f563a}, +} + +@Article{MO_126566794224_004a, + author = {Newton Bernardes}, + doi = {10.1103/PhysRev.112.1534}, + issue = {5}, + journal = {Physical Review}, + pages = {1534--1539}, + publisher = {American Physical Society}, + title = {Theory of Solid {N}e, {A}, {K}r, and {X}e at 0{K}}, + volume = {112}, + year = {1958}, +} +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 15.5 + ghost atom cutoff = 15.5 + binsize = 7.75, bins = 1 1 1 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton off, cut 15.5 + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.165 | 3.165 | 3.165 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -0.34602203 0 -0.34602203 0.00061471244 +Loop time of 1.5e-06 on 4 procs for 0 steps with 4 atoms + +100.0% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0 | 0 | 0 | 0.0 | 0.00 +Output | 0 | 0 | 0 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 1.5e-06 | | |100.00 + +Nlocal: 1.00000 ave 1 max 1 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Nghost: 935.000 ave 935 max 935 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 428.000 ave 428 max 428 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1712 +Ave neighs/atom = 428.00000 +Neighbor list builds = 0 +Dangerous builds = 0 + +# Get cohesive energy +variable natoms equal "count(all)" +variable ecohesive equal "-pe/v_natoms" + +# Create a property instance +kim property create 1 cohesive-potential-energy-cubic-crystal +#=== kim property =========================================== + +# Set all the key-value pairs for this property instance +kim property modify 1 key short-name source-value 1 fcc key species source-value 1 Ar key a source-value ${lattice_constant} source-unit angstrom key basis-atom-coordinates source-value 1 1:3 0.0 0.0 0.0 source-value 2 1:3 0.0 0.5 0.5 source-value 3 1:3 0.5 0.0 0.5 source-value 4 1:3 0.5 0.5 0.0 key space-group source-value Fm-3m key cohesive-potential-energy source-value ${ecohesive} source-unit eV +kim property modify 1 key short-name source-value 1 fcc key species source-value 1 Ar key a source-value 5.24850905686617 source-unit angstrom key basis-atom-coordinates source-value 1 1:3 0.0 0.0 0.0 source-value 2 1:3 0.0 0.5 0.5 source-value 3 1:3 0.5 0.0 0.5 source-value 4 1:3 0.5 0.5 0.0 key space-group source-value Fm-3m key cohesive-potential-energy source-value ${ecohesive} source-unit eV +kim property modify 1 key short-name source-value 1 fcc key species source-value 1 Ar key a source-value 5.24850905686617 source-unit angstrom key basis-atom-coordinates source-value 1 1:3 0.0 0.0 0.0 source-value 2 1:3 0.0 0.5 0.5 source-value 3 1:3 0.5 0.0 0.5 source-value 4 1:3 0.5 0.5 0.0 key space-group source-value Fm-3m key cohesive-potential-energy source-value 0.0865055084950538 source-unit eV +#=== kim property =========================================== + +# Dump the results in a file +kim property dump "results.edn" +#=== kim property =========================================== +Total wall time: 0:00:00 diff --git a/examples/kim/log.10Feb21.in.kim-pm-query.melt.clang.1 b/examples/kim/log.10Feb21.in.kim-pm-query.melt.clang.1 new file mode 100644 index 0000000000..be12cda3da --- /dev/null +++ b/examples/kim/log.10Feb21.in.kim-pm-query.melt.clang.1 @@ -0,0 +1,210 @@ +LAMMPS (10 Feb 2021) +# 3d Lennard-Jones melt +# +# This example requires that the KIM Portable Model (PM) +# `SW_StillingerWeber_1985_Si__MO_405512056662_005` +# is installed. This can be done with the command +# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005 +# If this command does not work, you may need to setup your PATH to find the utility. +# If you installed the kim-api using the LAMMPS CMake build, you can do the following +# (where the current working directory is assumed to be the LAMMPS build directory) +# source ./kim_build-prefix/bin/kim-api-activate +# If you installed the kim-api using the LAMMPS Make build, you can do the following +# (where the current working directory is assumed to be the LAMMPS src directory) +# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate +# (where you should relplace X.Y.Z with the appropriate kim-api version number). +# +# Or, see `https://openkim.org/doc/obtaining-models` for alternative options. +# + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable xx equal 20*1 +variable yy equal 20*$y +variable yy equal 20*1 +variable zz equal 20*$z +variable zz equal 20*1 + +kim init SW_StillingerWeber_1985_Si__MO_405512056662_005 real +#=== BEGIN kim init ========================================== +units real +neighbor 2.0 bin # Angstroms +timestep 1.0 # femtoseconds + +This model has 9 mutable parameters. + No. | Parameter name | data type | extent +----------------------------------------------------- + 1 | A | "Double" | 1 + 2 | B | "Double" | 1 + 3 | p | "Double" | 1 + 4 | q | "Double" | 1 + 5 | sigma | "Double" | 1 + 6 | gamma | "Double" | 1 + 7 | cutoff | "Double" | 1 + 8 | lambda | "Double" | 1 + 9 | costheta0 | "Double" | 1 +#=== END kim init ============================================ + +kim query a0 get_lattice_constant_cubic crystal=["fcc"] species=["Si"] units=["angstrom"] +#=== BEGIN kim-query ========================================= +variable a0 string "4.146581932902336" +#=== END kim-query =========================================== + + +lattice fcc ${a0} +lattice fcc 4.146581932902336 +Lattice spacing in x,y,z = 4.1465819 4.1465819 4.1465819 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +region box block 0 20 0 ${yy} 0 ${zz} +region box block 0 20 0 20 0 ${zz} +region box block 0 20 0 20 0 20 +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (82.931639 82.931639 82.931639) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 32000 atoms + create_atoms CPU = 0.004 seconds + +kim interactions Si +#=== BEGIN kim interactions ================================== +pair_style kim SW_StillingerWeber_1985_Si__MO_405512056662_005 +pair_coeff * * Si +#=== END kim interactions ==================================== + + +mass 1 39.95 +velocity all create 200.0 232345 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 + +run 100 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- @Comment +{ +\documentclass{article} +\usepackage{url} +\begin{document} +This Model originally published in \cite{MO_405512056662_005a, MO_405512056662_005b} is archived in OpenKIM~\cite{MO_405512056662_005, MD_335816936951_004, tadmor:elliott:2011, elliott:tadmor:2011}. +\bibliographystyle{vancouver} +\bibliography{kimcite-MO_405512056662_005.bib} +\end{document} +} + +@Misc{MO_405512056662_005, + author = {Amit K Singh}, + title = {{S}tillinger-{W}eber potential for {S}i due to {S}tillinger and {W}eber (1985) v005}, + doi = {10.25950/c74b293f}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/c74b293f}}, + keywords = {OpenKIM, Model, MO_405512056662_005}, + publisher = {OpenKIM}, + year = 2018, +} + +@Misc{MD_335816936951_004, + author = {Mingjian Wen}, + title = {{S}tillinger-{W}eber ({SW}) {M}odel {D}river v004}, + doi = {10.25950/f3abd2d6}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/c74b293f}}, + keywords = {OpenKIM, Model Driver, MD_335816936951_004}, + publisher = {OpenKIM}, + year = 2018, +} + +@Article{tadmor:elliott:2011, + author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker}, + title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels}, + journal = {{JOM}}, + year = {2011}, + volume = {63}, + number = {7}, + pages = {17}, + doi = {10.1007/s11837-011-0102-6}, +} + +@Misc{elliott:tadmor:2011, + author = {Ryan S. Elliott and Ellad B. Tadmor}, + title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})}, + howpublished = {\url{https://openkim.org/kim-api}}, + publisher = {OpenKIM}, + year = 2011, + doi = {10.25950/ff8f563a}, +} + +@Article{MO_405512056662_005a, + author = {Stillinger, Frank H. and Weber, Thomas A.}, + doi = {10.1103/PhysRevB.31.5262}, + issue = {8}, + journal = {Physical Review B}, + month = {Apr}, + pages = {5262--5271}, + publisher = {American Physical Society}, + title = {Computer simulation of local order in condensed phases of silicon}, + volume = {31}, + year = {1985}, +} + +@Book{MO_405512056662_005b, + author = {Tadmor, Ellad B. and Miller, Ronald E.}, + doi = {10.1017/CBO9781139003582}, + publisher = {Cambridge University Press}, + title = {Modeling Materials: {C}ontinuum, Atomistic and Multiscale Techniques}, + year = {2011}, +} +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 4.07118 + ghost atom cutoff = 4.07118 + binsize = 2.03559, bins = 41 41 41 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton off, cut 4.07118 + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 10.36 | 10.36 | 10.36 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 -126084.25 0 -107007.66 1528.8768 + 100 94.450495 -116016.03 0 -107007.07 2282.2685 +Loop time of 18.2886 on 1 procs for 100 steps with 32000 atoms + +Performance: 0.472 ns/day, 50.802 hours/ns, 5.468 timesteps/s +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 18.155 | 18.155 | 18.155 | 0.0 | 99.27 +Neigh | 0.087194 | 0.087194 | 0.087194 | 0.0 | 0.48 +Comm | 0.009477 | 0.009477 | 0.009477 | 0.0 | 0.05 +Output | 6.7e-05 | 6.7e-05 | 6.7e-05 | 0.0 | 0.00 +Modify | 0.02616 | 0.02616 | 0.02616 | 0.0 | 0.14 +Other | | 0.0111 | | | 0.06 + +Nlocal: 32000.0 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 9667.00 ave 9667 max 9667 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 450192.0 ave 450192 max 450192 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 450192 +Ave neighs/atom = 14.068500 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:21 diff --git a/examples/kim/log.10Feb21.in.kim-pm-query.melt.clang.4 b/examples/kim/log.10Feb21.in.kim-pm-query.melt.clang.4 new file mode 100644 index 0000000000..f982e79425 --- /dev/null +++ b/examples/kim/log.10Feb21.in.kim-pm-query.melt.clang.4 @@ -0,0 +1,210 @@ +LAMMPS (10 Feb 2021) +# 3d Lennard-Jones melt +# +# This example requires that the KIM Portable Model (PM) +# `SW_StillingerWeber_1985_Si__MO_405512056662_005` +# is installed. This can be done with the command +# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005 +# If this command does not work, you may need to setup your PATH to find the utility. +# If you installed the kim-api using the LAMMPS CMake build, you can do the following +# (where the current working directory is assumed to be the LAMMPS build directory) +# source ./kim_build-prefix/bin/kim-api-activate +# If you installed the kim-api using the LAMMPS Make build, you can do the following +# (where the current working directory is assumed to be the LAMMPS src directory) +# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate +# (where you should relplace X.Y.Z with the appropriate kim-api version number). +# +# Or, see `https://openkim.org/doc/obtaining-models` for alternative options. +# + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable xx equal 20*1 +variable yy equal 20*$y +variable yy equal 20*1 +variable zz equal 20*$z +variable zz equal 20*1 + +kim init SW_StillingerWeber_1985_Si__MO_405512056662_005 real +#=== BEGIN kim init ========================================== +units real +neighbor 2.0 bin # Angstroms +timestep 1.0 # femtoseconds + +This model has 9 mutable parameters. + No. | Parameter name | data type | extent +----------------------------------------------------- + 1 | A | "Double" | 1 + 2 | B | "Double" | 1 + 3 | p | "Double" | 1 + 4 | q | "Double" | 1 + 5 | sigma | "Double" | 1 + 6 | gamma | "Double" | 1 + 7 | cutoff | "Double" | 1 + 8 | lambda | "Double" | 1 + 9 | costheta0 | "Double" | 1 +#=== END kim init ============================================ + +kim query a0 get_lattice_constant_cubic crystal=["fcc"] species=["Si"] units=["angstrom"] +#=== BEGIN kim-query ========================================= +variable a0 string "4.146581932902336" +#=== END kim-query =========================================== + + +lattice fcc ${a0} +lattice fcc 4.146581932902336 +Lattice spacing in x,y,z = 4.1465819 4.1465819 4.1465819 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +region box block 0 20 0 ${yy} 0 ${zz} +region box block 0 20 0 20 0 ${zz} +region box block 0 20 0 20 0 20 +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (82.931639 82.931639 82.931639) + 1 by 2 by 2 MPI processor grid +create_atoms 1 box +Created 32000 atoms + create_atoms CPU = 0.001 seconds + +kim interactions Si +#=== BEGIN kim interactions ================================== +pair_style kim SW_StillingerWeber_1985_Si__MO_405512056662_005 +pair_coeff * * Si +#=== END kim interactions ==================================== + + +mass 1 39.95 +velocity all create 200.0 232345 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 + +run 100 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- @Comment +{ +\documentclass{article} +\usepackage{url} +\begin{document} +This Model originally published in \cite{MO_405512056662_005a, MO_405512056662_005b} is archived in OpenKIM~\cite{MO_405512056662_005, MD_335816936951_004, tadmor:elliott:2011, elliott:tadmor:2011}. +\bibliographystyle{vancouver} +\bibliography{kimcite-MO_405512056662_005.bib} +\end{document} +} + +@Misc{MO_405512056662_005, + author = {Amit K Singh}, + title = {{S}tillinger-{W}eber potential for {S}i due to {S}tillinger and {W}eber (1985) v005}, + doi = {10.25950/c74b293f}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/c74b293f}}, + keywords = {OpenKIM, Model, MO_405512056662_005}, + publisher = {OpenKIM}, + year = 2018, +} + +@Misc{MD_335816936951_004, + author = {Mingjian Wen}, + title = {{S}tillinger-{W}eber ({SW}) {M}odel {D}river v004}, + doi = {10.25950/f3abd2d6}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/c74b293f}}, + keywords = {OpenKIM, Model Driver, MD_335816936951_004}, + publisher = {OpenKIM}, + year = 2018, +} + +@Article{tadmor:elliott:2011, + author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker}, + title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels}, + journal = {{JOM}}, + year = {2011}, + volume = {63}, + number = {7}, + pages = {17}, + doi = {10.1007/s11837-011-0102-6}, +} + +@Misc{elliott:tadmor:2011, + author = {Ryan S. Elliott and Ellad B. Tadmor}, + title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})}, + howpublished = {\url{https://openkim.org/kim-api}}, + publisher = {OpenKIM}, + year = 2011, + doi = {10.25950/ff8f563a}, +} + +@Article{MO_405512056662_005a, + author = {Stillinger, Frank H. and Weber, Thomas A.}, + doi = {10.1103/PhysRevB.31.5262}, + issue = {8}, + journal = {Physical Review B}, + month = {Apr}, + pages = {5262--5271}, + publisher = {American Physical Society}, + title = {Computer simulation of local order in condensed phases of silicon}, + volume = {31}, + year = {1985}, +} + +@Book{MO_405512056662_005b, + author = {Tadmor, Ellad B. and Miller, Ronald E.}, + doi = {10.1017/CBO9781139003582}, + publisher = {Cambridge University Press}, + title = {Modeling Materials: {C}ontinuum, Atomistic and Multiscale Techniques}, + year = {2011}, +} +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 4.07118 + ghost atom cutoff = 4.07118 + binsize = 2.03559, bins = 41 41 41 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton off, cut 4.07118 + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.489 | 3.489 | 3.489 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 -126084.25 0 -107007.66 1528.8768 + 100 94.450495 -116016.03 0 -107007.07 2282.2685 +Loop time of 5.00432 on 4 procs for 100 steps with 32000 atoms + +Performance: 1.727 ns/day, 13.901 hours/ns, 19.983 timesteps/s +99.7% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 4.9281 | 4.9366 | 4.9447 | 0.3 | 98.65 +Neigh | 0.02399 | 0.024135 | 0.024318 | 0.1 | 0.48 +Comm | 0.020646 | 0.029014 | 0.037515 | 4.3 | 0.58 +Output | 2.9e-05 | 3.325e-05 | 4.2e-05 | 0.0 | 0.00 +Modify | 0.008808 | 0.0088445 | 0.00888 | 0.0 | 0.18 +Other | | 0.005691 | | | 0.11 + +Nlocal: 8000.00 ave 8029 max 7968 min +Histogram: 1 1 0 0 0 0 0 0 0 2 +Nghost: 4259.00 ave 4303 max 4202 min +Histogram: 1 0 0 0 0 0 2 0 0 1 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 112548.0 ave 113091 max 111995 min +Histogram: 1 0 0 1 0 0 0 1 0 1 + +Total # of neighbors = 450192 +Ave neighs/atom = 14.068500 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:07 diff --git a/examples/kim/log.10Feb21.in.kim-pm.melt.clang.1 b/examples/kim/log.10Feb21.in.kim-pm.melt.clang.1 new file mode 100644 index 0000000000..f27f8e6d83 --- /dev/null +++ b/examples/kim/log.10Feb21.in.kim-pm.melt.clang.1 @@ -0,0 +1,204 @@ +LAMMPS (10 Feb 2021) +# 3d Lennard-Jones melt +# +# This example requires that the KIM Portable Model (PM) +# `SW_StillingerWeber_1985_Si__MO_405512056662_005` +# is installed. This can be done with the command +# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005 +# If this command does not work, you may need to setup your PATH to find the utility. +# If you installed the kim-api using the LAMMPS CMake build, you can do the following +# (where the current working directory is assumed to be the LAMMPS build directory) +# source ./kim_build-prefix/bin/kim-api-activate +# If you installed the kim-api using the LAMMPS Make build, you can do the following +# (where the current working directory is assumed to be the LAMMPS src directory) +# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate +# (where you should relplace X.Y.Z with the appropriate kim-api version number). +# +# Or, see `https://openkim.org/doc/obtaining-models` for alternative options. +# + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable xx equal 20*1 +variable yy equal 20*$y +variable yy equal 20*1 +variable zz equal 20*$z +variable zz equal 20*1 + +kim init SW_StillingerWeber_1985_Si__MO_405512056662_005 real +#=== BEGIN kim init ========================================== +units real +neighbor 2.0 bin # Angstroms +timestep 1.0 # femtoseconds + +This model has 9 mutable parameters. + No. | Parameter name | data type | extent +----------------------------------------------------- + 1 | A | "Double" | 1 + 2 | B | "Double" | 1 + 3 | p | "Double" | 1 + 4 | q | "Double" | 1 + 5 | sigma | "Double" | 1 + 6 | gamma | "Double" | 1 + 7 | cutoff | "Double" | 1 + 8 | lambda | "Double" | 1 + 9 | costheta0 | "Double" | 1 +#=== END kim init ============================================ + + +lattice fcc 4.4300 +Lattice spacing in x,y,z = 4.4300000 4.4300000 4.4300000 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +region box block 0 20 0 ${yy} 0 ${zz} +region box block 0 20 0 20 0 ${zz} +region box block 0 20 0 20 0 20 +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (88.600000 88.600000 88.600000) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 32000 atoms + create_atoms CPU = 0.002 seconds + +kim interactions Si +#=== BEGIN kim interactions ================================== +pair_style kim SW_StillingerWeber_1985_Si__MO_405512056662_005 +pair_coeff * * Si +#=== END kim interactions ==================================== + + +mass 1 39.95 +velocity all create 200.0 232345 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 + +run 100 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- @Comment +{ +\documentclass{article} +\usepackage{url} +\begin{document} +This Model originally published in \cite{MO_405512056662_005a, MO_405512056662_005b} is archived in OpenKIM~\cite{MO_405512056662_005, MD_335816936951_004, tadmor:elliott:2011, elliott:tadmor:2011}. +\bibliographystyle{vancouver} +\bibliography{kimcite-MO_405512056662_005.bib} +\end{document} +} + +@Misc{MO_405512056662_005, + author = {Amit K Singh}, + title = {{S}tillinger-{W}eber potential for {S}i due to {S}tillinger and {W}eber (1985) v005}, + doi = {10.25950/c74b293f}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/c74b293f}}, + keywords = {OpenKIM, Model, MO_405512056662_005}, + publisher = {OpenKIM}, + year = 2018, +} + +@Misc{MD_335816936951_004, + author = {Mingjian Wen}, + title = {{S}tillinger-{W}eber ({SW}) {M}odel {D}river v004}, + doi = {10.25950/f3abd2d6}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/c74b293f}}, + keywords = {OpenKIM, Model Driver, MD_335816936951_004}, + publisher = {OpenKIM}, + year = 2018, +} + +@Article{tadmor:elliott:2011, + author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker}, + title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels}, + journal = {{JOM}}, + year = {2011}, + volume = {63}, + number = {7}, + pages = {17}, + doi = {10.1007/s11837-011-0102-6}, +} + +@Misc{elliott:tadmor:2011, + author = {Ryan S. Elliott and Ellad B. Tadmor}, + title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})}, + howpublished = {\url{https://openkim.org/kim-api}}, + publisher = {OpenKIM}, + year = 2011, + doi = {10.25950/ff8f563a}, +} + +@Article{MO_405512056662_005a, + author = {Stillinger, Frank H. and Weber, Thomas A.}, + doi = {10.1103/PhysRevB.31.5262}, + issue = {8}, + journal = {Physical Review B}, + month = {Apr}, + pages = {5262--5271}, + publisher = {American Physical Society}, + title = {Computer simulation of local order in condensed phases of silicon}, + volume = {31}, + year = {1985}, +} + +@Book{MO_405512056662_005b, + author = {Tadmor, Ellad B. and Miller, Ronald E.}, + doi = {10.1017/CBO9781139003582}, + publisher = {Cambridge University Press}, + title = {Modeling Materials: {C}ontinuum, Atomistic and Multiscale Techniques}, + year = {2011}, +} +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 4.07118 + ghost atom cutoff = 4.07118 + binsize = 2.03559, bins = 44 44 44 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton off, cut 4.07118 + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 10.44 | 10.44 | 10.44 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 -85249.847 0 -66173.259 -33302.387 + 100 253.43357 -90346.68 0 -66173.441 -14888.698 +Loop time of 17.7449 on 1 procs for 100 steps with 32000 atoms + +Performance: 0.487 ns/day, 49.291 hours/ns, 5.635 timesteps/s +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 17.64 | 17.64 | 17.64 | 0.0 | 99.41 +Neigh | 0.060149 | 0.060149 | 0.060149 | 0.0 | 0.34 +Comm | 0.008585 | 0.008585 | 0.008585 | 0.0 | 0.05 +Output | 6.3e-05 | 6.3e-05 | 6.3e-05 | 0.0 | 0.00 +Modify | 0.025324 | 0.025324 | 0.025324 | 0.0 | 0.14 +Other | | 0.01057 | | | 0.06 + +Nlocal: 32000.0 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 7760.00 ave 7760 max 7760 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 402352.0 ave 402352 max 402352 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 402352 +Ave neighs/atom = 12.573500 +Neighbor list builds = 4 +Dangerous builds = 0 +Total wall time: 0:00:17 diff --git a/examples/kim/log.10Feb21.in.kim-pm.melt.clang.4 b/examples/kim/log.10Feb21.in.kim-pm.melt.clang.4 new file mode 100644 index 0000000000..2107e3f876 --- /dev/null +++ b/examples/kim/log.10Feb21.in.kim-pm.melt.clang.4 @@ -0,0 +1,204 @@ +LAMMPS (10 Feb 2021) +# 3d Lennard-Jones melt +# +# This example requires that the KIM Portable Model (PM) +# `SW_StillingerWeber_1985_Si__MO_405512056662_005` +# is installed. This can be done with the command +# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005 +# If this command does not work, you may need to setup your PATH to find the utility. +# If you installed the kim-api using the LAMMPS CMake build, you can do the following +# (where the current working directory is assumed to be the LAMMPS build directory) +# source ./kim_build-prefix/bin/kim-api-activate +# If you installed the kim-api using the LAMMPS Make build, you can do the following +# (where the current working directory is assumed to be the LAMMPS src directory) +# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate +# (where you should relplace X.Y.Z with the appropriate kim-api version number). +# +# Or, see `https://openkim.org/doc/obtaining-models` for alternative options. +# + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable xx equal 20*1 +variable yy equal 20*$y +variable yy equal 20*1 +variable zz equal 20*$z +variable zz equal 20*1 + +kim init SW_StillingerWeber_1985_Si__MO_405512056662_005 real +#=== BEGIN kim init ========================================== +units real +neighbor 2.0 bin # Angstroms +timestep 1.0 # femtoseconds + +This model has 9 mutable parameters. + No. | Parameter name | data type | extent +----------------------------------------------------- + 1 | A | "Double" | 1 + 2 | B | "Double" | 1 + 3 | p | "Double" | 1 + 4 | q | "Double" | 1 + 5 | sigma | "Double" | 1 + 6 | gamma | "Double" | 1 + 7 | cutoff | "Double" | 1 + 8 | lambda | "Double" | 1 + 9 | costheta0 | "Double" | 1 +#=== END kim init ============================================ + + +lattice fcc 4.4300 +Lattice spacing in x,y,z = 4.4300000 4.4300000 4.4300000 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +region box block 0 20 0 ${yy} 0 ${zz} +region box block 0 20 0 20 0 ${zz} +region box block 0 20 0 20 0 20 +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (88.600000 88.600000 88.600000) + 1 by 2 by 2 MPI processor grid +create_atoms 1 box +Created 32000 atoms + create_atoms CPU = 0.001 seconds + +kim interactions Si +#=== BEGIN kim interactions ================================== +pair_style kim SW_StillingerWeber_1985_Si__MO_405512056662_005 +pair_coeff * * Si +#=== END kim interactions ==================================== + + +mass 1 39.95 +velocity all create 200.0 232345 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 + +run 100 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- @Comment +{ +\documentclass{article} +\usepackage{url} +\begin{document} +This Model originally published in \cite{MO_405512056662_005a, MO_405512056662_005b} is archived in OpenKIM~\cite{MO_405512056662_005, MD_335816936951_004, tadmor:elliott:2011, elliott:tadmor:2011}. +\bibliographystyle{vancouver} +\bibliography{kimcite-MO_405512056662_005.bib} +\end{document} +} + +@Misc{MO_405512056662_005, + author = {Amit K Singh}, + title = {{S}tillinger-{W}eber potential for {S}i due to {S}tillinger and {W}eber (1985) v005}, + doi = {10.25950/c74b293f}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/c74b293f}}, + keywords = {OpenKIM, Model, MO_405512056662_005}, + publisher = {OpenKIM}, + year = 2018, +} + +@Misc{MD_335816936951_004, + author = {Mingjian Wen}, + title = {{S}tillinger-{W}eber ({SW}) {M}odel {D}river v004}, + doi = {10.25950/f3abd2d6}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/c74b293f}}, + keywords = {OpenKIM, Model Driver, MD_335816936951_004}, + publisher = {OpenKIM}, + year = 2018, +} + +@Article{tadmor:elliott:2011, + author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker}, + title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels}, + journal = {{JOM}}, + year = {2011}, + volume = {63}, + number = {7}, + pages = {17}, + doi = {10.1007/s11837-011-0102-6}, +} + +@Misc{elliott:tadmor:2011, + author = {Ryan S. Elliott and Ellad B. Tadmor}, + title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})}, + howpublished = {\url{https://openkim.org/kim-api}}, + publisher = {OpenKIM}, + year = 2011, + doi = {10.25950/ff8f563a}, +} + +@Article{MO_405512056662_005a, + author = {Stillinger, Frank H. and Weber, Thomas A.}, + doi = {10.1103/PhysRevB.31.5262}, + issue = {8}, + journal = {Physical Review B}, + month = {Apr}, + pages = {5262--5271}, + publisher = {American Physical Society}, + title = {Computer simulation of local order in condensed phases of silicon}, + volume = {31}, + year = {1985}, +} + +@Book{MO_405512056662_005b, + author = {Tadmor, Ellad B. and Miller, Ronald E.}, + doi = {10.1017/CBO9781139003582}, + publisher = {Cambridge University Press}, + title = {Modeling Materials: {C}ontinuum, Atomistic and Multiscale Techniques}, + year = {2011}, +} +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 4.07118 + ghost atom cutoff = 4.07118 + binsize = 2.03559, bins = 44 44 44 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton off, cut 4.07118 + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.517 | 3.517 | 3.517 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 -85249.847 0 -66173.259 -33302.387 + 100 253.43357 -90346.68 0 -66173.441 -14888.698 +Loop time of 4.87378 on 4 procs for 100 steps with 32000 atoms + +Performance: 1.773 ns/day, 13.538 hours/ns, 20.518 timesteps/s +99.7% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 4.8075 | 4.816 | 4.8244 | 0.3 | 98.81 +Neigh | 0.015902 | 0.015996 | 0.016077 | 0.1 | 0.33 +Comm | 0.018078 | 0.026375 | 0.034752 | 4.2 | 0.54 +Output | 3e-05 | 3.5e-05 | 4.4e-05 | 0.0 | 0.00 +Modify | 0.009331 | 0.0094922 | 0.009588 | 0.1 | 0.19 +Other | | 0.005919 | | | 0.12 + +Nlocal: 8000.00 ave 8014 max 7988 min +Histogram: 1 1 0 0 0 0 1 0 0 1 +Nghost: 3374.75 ave 3389 max 3361 min +Histogram: 1 0 1 0 0 0 0 1 0 1 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 100588.0 ave 100856 max 100392 min +Histogram: 1 0 1 0 1 0 0 0 0 1 + +Total # of neighbors = 402352 +Ave neighs/atom = 12.573500 +Neighbor list builds = 4 +Dangerous builds = 0 +Total wall time: 0:00:04 diff --git a/examples/kim/log.10Feb21.in.kim-query.clang.1 b/examples/kim/log.10Feb21.in.kim-query.clang.1 new file mode 100644 index 0000000000..01fc8cd7dd --- /dev/null +++ b/examples/kim/log.10Feb21.in.kim-query.clang.1 @@ -0,0 +1,655 @@ +LAMMPS (10 Feb 2021) +# kim query example +# +# Requirement: +# +# This example requires LAMMPS is built with KIM package. A requirement for +# the KIM package, is the KIM API library that must be downloaded from the +# OpenKIM website and installed before LAMMPS is compiled. The 'kim query' +# command requires the libcurl library to be installed. See the +# `https://lammps.sandia.gov/doc/Build_extras.html#kim` doc page for further +# details +# +# This example requires that the KIM Models +# `EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005` +# and +# `EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000` +# are installed. +# +# This can be done with the commands +# `kim-api-collections-management install user `EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005` +# `kim-api-collections-management install user `EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000` +# +# If these commands do not work, you may need to setup your PATH to find the utility. +# If you installed the kim-api using the LAMMPS CMake build, you can do the following +# (where the current working directory is assumed to be the LAMMPS build directory) +# source ./kim_build-prefix/bin/kim-api-activate +# If you installed the kim-api using the LAMMPS Make build, you can do the following +# (where the current working directory is assumed to be the LAMMPS src directory) +# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate +# (where you should relplace X.Y.Z with the appropriate kim-api version number). +# +# Or, see https://openkim.org/doc/obtaining-models for alternative options. +# + +# ----------------------------------------------- +# Get an equilibrium fcc crystal lattice constant +# ----------------------------------------------- +kim init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal +#=== BEGIN kim init ========================================== +units metal +neighbor 2.0 bin # Angstroms +timestep 1.0e-3 # picoseconds + +This model has 6 mutable parameters. + No. | Parameter name | data type | extent +----------------------------------------------------- + 1 | cutoff | "Double" | 1 + 2 | deltaRho | "Double" | 1 + 3 | deltaR | "Double" | 1 + 4 | embeddingData | "Double" | 500 + 5 | rPhiData | "Double" | 500 + 6 | densityData | "Double" | 500 +#=== END kim init ============================================ + +kim query latconst_1 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] +#=== BEGIN kim-query ========================================= +variable latconst_1 string "4.032082033157349" +#=== END kim-query =========================================== + +print "FCC lattice constant (EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005) = ${latconst_1}" +FCC lattice constant (EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005) = 4.032082033157349 +# Get the lattice contant from a different model +kim query latconst_2 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005] +#=== BEGIN kim-query ========================================= +variable latconst_2 string "4.024845376610756" +#=== END kim-query =========================================== + +print "FCC lattice constant (EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005) = ${latconst_2}" +FCC lattice constant (EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005) = 4.024845376610756 +clear + + +# ----------------------------------------------- +# Get an equilibrium fcc crystal lattice constant +# ----------------------------------------------- +kim query latconst_1 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005] +#=== BEGIN kim-query ========================================= +variable latconst_1 string "4.032082033157349" +#=== END kim-query =========================================== + +kim query latconst_2 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005] +#=== BEGIN kim-query ========================================= +variable latconst_2 string "4.024845376610756" +#=== END kim-query =========================================== + +print "FCC lattice constant (EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005) = ${latconst_1}" +FCC lattice constant (EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005) = 4.032082033157349 +print "FCC lattice constant (EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005) = ${latconst_2}" +FCC lattice constant (EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005) = 4.024845376610756 +clear + + +# ----------------------------------------------- +# Get an equilibrium hcp crystal lattice constant +# ----------------------------------------------- +kim init EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000 metal +#=== BEGIN kim init ========================================== +units metal +neighbor 2.0 bin # Angstroms +timestep 1.0e-3 # picoseconds + +This model has 6 mutable parameters. + No. | Parameter name | data type | extent +----------------------------------------------------- + 1 | cutoff | "Double" | 1 + 2 | deltaRho | "Double" | 1 + 3 | deltaR | "Double" | 1 + 4 | embeddingData | "Double" | 10000 + 5 | rPhiData | "Double" | 10000 + 6 | densityData | "Double" | 10000 +#=== END kim init ============================================ + +kim query latconst split get_lattice_constant_hexagonal crystal=["hcp"] species=["Zr"] units=["angstrom"] +#=== BEGIN kim-query ========================================= +variable latconst_1 string 3.234055244384789 +variable latconst_2 string 5.167650199630013 +#=== END kim-query =========================================== + +print "HCP lattice constants = ${latconst_1}, ${latconst_2}" +HCP lattice constants = 3.234055244384789, 5.167650199630013 +clear + + +# ----------------------------------------------- +# Query for KIM models from openkim.org +# Get all the EAM models that support Al +# ----------------------------------------------- +kim query model index get_available_models species=[Al] potential_type=[eam] +#=== BEGIN kim-query ========================================= +variable model index "EAM_CubicNaturalSpline_ErcolessiAdams_1994_Al__MO_800509458712_002" "EAM_Dynamo_AngeloMoodyBaskes_1995_NiAlH__MO_418978237058_005" "EAM_Dynamo_CaiYe_1996_AlCu__MO_942551040047_005" "EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005" "EAM_Dynamo_FarkasJones_1996_NbTiAl__MO_042691367780_000" "EAM_Dynamo_JacobsenNorskovPuska_1987_Al__MO_411692133366_000" "EAM_Dynamo_LandaWynblattSiegel_2000_AlPb__MO_699137396381_005" "EAM_Dynamo_LiuAdams_1998_AlMg__MO_019873715786_000" "EAM_Dynamo_LiuErcolessiAdams_2004_Al__MO_051157671505_000" "EAM_Dynamo_LiuLiuBorucki_1999_AlCu__MO_020851069572_000" "EAM_Dynamo_LiuOhotnickyAdams_1997_AlMg__MO_559870613549_000" "EAM_Dynamo_MendelevAstaRahman_2009_AlMg__MO_658278549784_005" "EAM_Dynamo_MendelevFangYe_2015_AlSm__MO_338600200739_000" "EAM_Dynamo_MendelevKramerBecker_2008_Al__MO_106969701023_005" "EAM_Dynamo_MendelevSrolovitzAckland_2005_AlFe__MO_577453891941_005" "EAM_Dynamo_MishinFarkasMehl_1999_Al__MO_651801486679_005" "EAM_Dynamo_MishinMehlPapaconstantopoulos_2002_NiAl__MO_109933561507_005" "EAM_Dynamo_Mishin_2004_NiAl__MO_101214310689_005" "EAM_Dynamo_PunMishin_2009_NiAl__MO_751354403791_005" "EAM_Dynamo_PunYamakovMishin_2013_AlCo__MO_678952612413_000" "EAM_Dynamo_PunYamakovMishin_2013_NiAlCo__MO_826591359508_000" "EAM_Dynamo_SchopfBrommerFrigan_2012_AlMnPd__MO_137572817842_000" "EAM_Dynamo_SturgeonLaird_2000_Al__MO_120808805541_005" "EAM_Dynamo_VailheFarkas_1997_CoAl__MO_284963179498_005" "EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005" "EAM_Dynamo_Zhakhovsky_2009_Al__MO_519613893196_000" "EAM_Dynamo_ZhouJohnsonWadley_2004NISTretabulation_Al__MO_060567868558_000" "EAM_Dynamo_ZhouJohnsonWadley_2004_Al__MO_131650261510_005" "EAM_Dynamo_ZhouWadleyJohnson_2001_Al__MO_049243498555_000" "EAM_Dynamo_ZopeMishin_2003_Al__MO_664470114311_005" "EAM_Dynamo_ZopeMishin_2003_TiAl__MO_117656786760_005" "EAM_ErcolessiAdams_1994_Al__MO_324507536345_003" "EAM_IMD_BrommerGaehler_2006A_AlNiCo__MO_122703700223_003" "EAM_IMD_BrommerGaehler_2006B_AlNiCo__MO_128037485276_003" "EAM_IMD_SchopfBrommerFrigan_2012_AlMnPd__MO_878712978062_003" "EAM_QuinticClampedSpline_ErcolessiAdams_1994_Al__MO_450093727396_002" "EAM_QuinticHermiteSpline_ErcolessiAdams_1994_Al__MO_781138671863_002" "EMT_Asap_Standard_JacobsenStoltzeNorskov_1996_AlAgAuCuNiPdPt__MO_115316750986_001" "EMT_Asap_Standard_JacobsenStoltzeNorskov_1996_Al__MO_623376124862_001" +#=== END kim-query =========================================== + +label model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_CubicNaturalSpline_ErcolessiAdams_1994_Al__MO_800509458712_002] +#=== BEGIN kim-query ========================================= +variable latconst string "4.032082748413087" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_CubicNaturalSpline_ErcolessiAdams_1994_Al__MO_800509458712_002) = 4.032082748413087 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_AngeloMoodyBaskes_1995_NiAlH__MO_418978237058_005] +#=== BEGIN kim-query ========================================= +variable latconst string "4.050000071525574" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_AngeloMoodyBaskes_1995_NiAlH__MO_418978237058_005) = 4.050000071525574 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_CaiYe_1996_AlCu__MO_942551040047_005] +#=== BEGIN kim-query ========================================= +variable latconst string "4.049763545393944" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_CaiYe_1996_AlCu__MO_942551040047_005) = 4.049763545393944 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005] +#=== BEGIN kim-query ========================================= +variable latconst string "4.032082033157349" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005) = 4.032082033157349 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_FarkasJones_1996_NbTiAl__MO_042691367780_000] +#=== BEGIN kim-query ========================================= +variable latconst string "3.869337007403374" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_FarkasJones_1996_NbTiAl__MO_042691367780_000) = 3.869337007403374 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_JacobsenNorskovPuska_1987_Al__MO_411692133366_000] +#=== BEGIN kim-query ========================================= +variable latconst string "3.987558534741402" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_JacobsenNorskovPuska_1987_Al__MO_411692133366_000) = 3.987558534741402 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_LandaWynblattSiegel_2000_AlPb__MO_699137396381_005] +#=== BEGIN kim-query ========================================= +variable latconst string "4.031036108732224" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_LandaWynblattSiegel_2000_AlPb__MO_699137396381_005) = 4.031036108732224 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_LiuAdams_1998_AlMg__MO_019873715786_000] +#=== BEGIN kim-query ========================================= +variable latconst string "4.03203821182251" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_LiuAdams_1998_AlMg__MO_019873715786_000) = 4.03203821182251 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_LiuErcolessiAdams_2004_Al__MO_051157671505_000] +#=== BEGIN kim-query ========================================= +variable latconst string "9.5" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_LiuErcolessiAdams_2004_Al__MO_051157671505_000) = 9.5 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_LiuLiuBorucki_1999_AlCu__MO_020851069572_000] +#=== BEGIN kim-query ========================================= +variable latconst string "4.032073378562927" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_LiuLiuBorucki_1999_AlCu__MO_020851069572_000) = 4.032073378562927 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_LiuOhotnickyAdams_1997_AlMg__MO_559870613549_000] +#=== BEGIN kim-query ========================================= +variable latconst string "8.5" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_LiuOhotnickyAdams_1997_AlMg__MO_559870613549_000) = 8.5 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_MendelevAstaRahman_2009_AlMg__MO_658278549784_005] +#=== BEGIN kim-query ========================================= +variable latconst string "4.045270472764969" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_MendelevAstaRahman_2009_AlMg__MO_658278549784_005) = 4.045270472764969 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_MendelevFangYe_2015_AlSm__MO_338600200739_000] +#=== BEGIN kim-query ========================================= +variable latconst string "4.040926471352577" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_MendelevFangYe_2015_AlSm__MO_338600200739_000) = 4.040926471352577 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_MendelevKramerBecker_2008_Al__MO_106969701023_005] +#=== BEGIN kim-query ========================================= +variable latconst string "4.045259781181811" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_MendelevKramerBecker_2008_Al__MO_106969701023_005) = 4.045259781181811 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_MendelevSrolovitzAckland_2005_AlFe__MO_577453891941_005] +#=== BEGIN kim-query ========================================= +variable latconst string "4.03330184519291" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_MendelevSrolovitzAckland_2005_AlFe__MO_577453891941_005) = 4.03330184519291 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_MishinFarkasMehl_1999_Al__MO_651801486679_005] +#=== BEGIN kim-query ========================================= +variable latconst string "4.050004702806472" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_MishinFarkasMehl_1999_Al__MO_651801486679_005) = 4.050004702806472 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_MishinMehlPapaconstantopoulos_2002_NiAl__MO_109933561507_005] +#=== BEGIN kim-query ========================================= +variable latconst string "4.051526293158533" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_MishinMehlPapaconstantopoulos_2002_NiAl__MO_109933561507_005) = 4.051526293158533 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_Mishin_2004_NiAl__MO_101214310689_005] +#=== BEGIN kim-query ========================================= +variable latconst string "4.049999862909317" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_Mishin_2004_NiAl__MO_101214310689_005) = 4.049999862909317 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_PunMishin_2009_NiAl__MO_751354403791_005] +#=== BEGIN kim-query ========================================= +variable latconst string "4.050000071525574" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_PunMishin_2009_NiAl__MO_751354403791_005) = 4.050000071525574 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_PunYamakovMishin_2013_AlCo__MO_678952612413_000] +#=== BEGIN kim-query ========================================= +variable latconst string "4.05000014603138" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_PunYamakovMishin_2013_AlCo__MO_678952612413_000) = 4.05000014603138 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_PunYamakovMishin_2013_NiAlCo__MO_826591359508_000] +#=== BEGIN kim-query ========================================= +variable latconst string "4.05000014603138" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_PunYamakovMishin_2013_NiAlCo__MO_826591359508_000) = 4.05000014603138 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_SchopfBrommerFrigan_2012_AlMnPd__MO_137572817842_000] +#=== BEGIN kim-query ========================================= +variable latconst string "4.210718545317654" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_SchopfBrommerFrigan_2012_AlMnPd__MO_137572817842_000) = 4.210718545317654 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_SturgeonLaird_2000_Al__MO_120808805541_005] +#=== BEGIN kim-query ========================================= +variable latconst string "4.050010219216347" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_SturgeonLaird_2000_Al__MO_120808805541_005) = 4.050010219216347 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_VailheFarkas_1997_CoAl__MO_284963179498_005] +#=== BEGIN kim-query ========================================= +variable latconst string "4.049696564674378" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_VailheFarkas_1997_CoAl__MO_284963179498_005) = 4.049696564674378 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005] +#=== BEGIN kim-query ========================================= +variable latconst string "4.024845376610756" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005) = 4.024845376610756 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_Zhakhovsky_2009_Al__MO_519613893196_000] +#=== BEGIN kim-query ========================================= +variable latconst string "4.031999975442885" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_Zhakhovsky_2009_Al__MO_519613893196_000) = 4.031999975442885 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_ZhouJohnsonWadley_2004NISTretabulation_Al__MO_060567868558_000] +#=== BEGIN kim-query ========================================= +variable latconst string "4.050199627876282" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_ZhouJohnsonWadley_2004NISTretabulation_Al__MO_060567868558_000) = 4.050199627876282 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_ZhouJohnsonWadley_2004_Al__MO_131650261510_005] +#=== BEGIN kim-query ========================================= +variable latconst string "4.050180745124819" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_ZhouJohnsonWadley_2004_Al__MO_131650261510_005) = 4.050180745124819 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_ZhouWadleyJohnson_2001_Al__MO_049243498555_000] +#=== BEGIN kim-query ========================================= +variable latconst string "4.081654928624631" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_ZhouWadleyJohnson_2001_Al__MO_049243498555_000) = 4.081654928624631 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_ZopeMishin_2003_Al__MO_664470114311_005] +#=== BEGIN kim-query ========================================= +variable latconst string "4.050000011920929" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_ZopeMishin_2003_Al__MO_664470114311_005) = 4.050000011920929 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_ZopeMishin_2003_TiAl__MO_117656786760_005] +#=== BEGIN kim-query ========================================= +variable latconst string "4.049999445676804" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_Dynamo_ZopeMishin_2003_TiAl__MO_117656786760_005) = 4.049999445676804 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_ErcolessiAdams_1994_Al__MO_324507536345_003] +#=== BEGIN kim-query ========================================= +variable latconst string "4.032082714140415" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_ErcolessiAdams_1994_Al__MO_324507536345_003) = 4.032082714140415 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_IMD_BrommerGaehler_2006A_AlNiCo__MO_122703700223_003] +#=== BEGIN kim-query ========================================= +variable latconst string "4.128871455788613" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_IMD_BrommerGaehler_2006A_AlNiCo__MO_122703700223_003) = 4.128871455788613 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_IMD_BrommerGaehler_2006B_AlNiCo__MO_128037485276_003] +#=== BEGIN kim-query ========================================= +variable latconst string "4.073718130588532" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_IMD_BrommerGaehler_2006B_AlNiCo__MO_128037485276_003) = 4.073718130588532 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_IMD_SchopfBrommerFrigan_2012_AlMnPd__MO_878712978062_003] +#=== BEGIN kim-query ========================================= +variable latconst string "4.210700303316115" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_IMD_SchopfBrommerFrigan_2012_AlMnPd__MO_878712978062_003) = 4.210700303316115 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_QuinticClampedSpline_ErcolessiAdams_1994_Al__MO_450093727396_002] +#=== BEGIN kim-query ========================================= +variable latconst string "4.032082897424699" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_QuinticClampedSpline_ErcolessiAdams_1994_Al__MO_450093727396_002) = 4.032082897424699 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_QuinticHermiteSpline_ErcolessiAdams_1994_Al__MO_781138671863_002] +#=== BEGIN kim-query ========================================= +variable latconst string "4.03208246231079" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EAM_QuinticHermiteSpline_ErcolessiAdams_1994_Al__MO_781138671863_002) = 4.03208246231079 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EMT_Asap_Standard_JacobsenStoltzeNorskov_1996_AlAgAuCuNiPdPt__MO_115316750986_001] +#=== BEGIN kim-query ========================================= +variable latconst string "3.994616635143757" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EMT_Asap_Standard_JacobsenStoltzeNorskov_1996_AlAgAuCuNiPdPt__MO_115316750986_001) = 3.994616635143757 +next model +jump SELF model_loop +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] +kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EMT_Asap_Standard_JacobsenStoltzeNorskov_1996_Al__MO_623376124862_001] +#=== BEGIN kim-query ========================================= +variable latconst string "3.994608342647553" +#=== END kim-query =========================================== + +print "FCC lattice constant (${model}) = ${latconst}" +FCC lattice constant (EMT_Asap_Standard_JacobsenStoltzeNorskov_1996_Al__MO_623376124862_001) = 3.994608342647553 +next model +jump SELF model_loop +clear + + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- @Comment +{ +\documentclass{article} +\usepackage{url} +\begin{document} +This Model originally published in \cite{MO_123629422045_005a} is archived in OpenKIM~\cite{MO_123629422045_005, MD_120291908751_005, tadmor:elliott:2011, elliott:tadmor:2011}. +\bibliographystyle{vancouver} +\bibliography{kimcite-MO_123629422045_005.bib} +\end{document} +} + +@Misc{MO_123629422045_005, + author = {Ryan S. Elliott}, + title = {{EAM} potential ({LAMMPS} cubic hermite tabulation) for {A}l developed by {E}rcolessi and {A}dams (1994) v005}, + doi = {10.25950/7cd2a6ab}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/7cd2a6ab}}, + keywords = {OpenKIM, Model, MO_123629422045_005}, + publisher = {OpenKIM}, + year = 2018, +} + +@Misc{MD_120291908751_005, + author = {Ryan S. Elliott}, + title = {{EAM} {M}odel {D}river for tabulated potentials with cubic {H}ermite spline interpolation as used in {LAMMPS} v005}, + doi = {10.25950/68defa36}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/7cd2a6ab}}, + keywords = {OpenKIM, Model Driver, MD_120291908751_005}, + publisher = {OpenKIM}, + year = 2018, +} + +@Article{tadmor:elliott:2011, + author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker}, + title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels}, + journal = {{JOM}}, + year = {2011}, + volume = {63}, + number = {7}, + pages = {17}, + doi = {10.1007/s11837-011-0102-6}, +} + +@Misc{elliott:tadmor:2011, + author = {Ryan S. Elliott and Ellad B. Tadmor}, + title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})}, + howpublished = {\url{https://openkim.org/kim-api}}, + publisher = {OpenKIM}, + year = 2011, + doi = {10.25950/ff8f563a}, +} + +@Article{MO_123629422045_005a, + author = {F. Ercolessi and J. B. Adams}, + doi = {10.1209/0295-5075/26/8/005}, + journal = {Europhysics Letters}, + number = {8}, + pages = {583}, + title = {Interatomic Potentials from First-Principles Calculations: {T}he Force-Matching Method}, + volume = {26}, + year = {1994}, +} +- @Comment +{ +\documentclass{article} +\usepackage{url} +\begin{document} +This Model originally published in \cite{MO_004835508849_000a} is archived in OpenKIM~\cite{MO_004835508849_000, MD_120291908751_005, tadmor:elliott:2011, elliott:tadmor:2011}. +\bibliographystyle{vancouver} +\bibliography{kimcite-MO_004835508849_000.bib} +\end{document} +} + +@Misc{MO_004835508849_000, + author = {Ellad Tadmor}, + title = {{F}innis-{S}inclair potential ({LAMMPS} cubic hermite tabulation) for {Z}r developed by {M}endelev and {A}ckland (2007); version 3 refitted for radiation studies v000}, + doi = {10.25950/7b7b5ab5}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/7b7b5ab5}}, + keywords = {OpenKIM, Model, MO_004835508849_000}, + publisher = {OpenKIM}, + year = 2018, +} + +@Misc{MD_120291908751_005, + author = {Ryan S. Elliott}, + title = {{EAM} {M}odel {D}river for tabulated potentials with cubic {H}ermite spline interpolation as used in {LAMMPS} v005}, + doi = {10.25950/68defa36}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/7b7b5ab5}}, + keywords = {OpenKIM, Model Driver, MD_120291908751_005}, + publisher = {OpenKIM}, + year = 2018, +} + +@Article{tadmor:elliott:2011, + author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker}, + title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels}, + journal = {{JOM}}, + year = {2011}, + volume = {63}, + number = {7}, + pages = {17}, + doi = {10.1007/s11837-011-0102-6}, +} + +@Misc{elliott:tadmor:2011, + author = {Ryan S. Elliott and Ellad B. Tadmor}, + title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})}, + howpublished = {\url{https://openkim.org/kim-api}}, + publisher = {OpenKIM}, + year = 2011, + doi = {10.25950/ff8f563a}, +} + +@Article{MO_004835508849_000a, + author = {Mendelev, M. I. and Ackland, G. J.}, + doi = {10.1080/09500830701191393}, + journal = {Philosophical Magazine Letters}, + number = {5}, + pages = {349-359}, + title = {Development of an interatomic potential for the simulation of phase transformations in zirconium}, + volume = {87}, + year = {2007}, +} +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Total wall time: 0:01:58 diff --git a/examples/kim/log.10Feb21.in.kim-sm.melt.clang.1 b/examples/kim/log.10Feb21.in.kim-sm.melt.clang.1 new file mode 100644 index 0000000000..bb00b7fec4 --- /dev/null +++ b/examples/kim/log.10Feb21.in.kim-sm.melt.clang.1 @@ -0,0 +1,208 @@ +LAMMPS (10 Feb 2021) +# 3d Lennard-Jones melt +# +# This example requires that the KIM Simulator Model (PM) +# `Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000` +# is installed. This can be done with the command +# kim-api-collections-management install user Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 +# If this command does not work, you may need to setup your PATH to find the utility. +# If you installed the kim-api using the LAMMPS CMake build, you can do the following +# (where the current working directory is assumed to be the LAMMPS build directory) +# source ./kim_build-prefix/bin/kim-api-activate +# If you installed the kim-api using the LAMMPS Make build, you can do the following +# (where the current working directory is assumed to be the LAMMPS src directory) +# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate +# (where you should relplace X.Y.Z with the appropriate kim-api version number). +# +# See `https://openkim.org/doc/obtaining-models` for alternative options. +# + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable xx equal 20*1 +variable yy equal 20*$y +variable yy equal 20*1 +variable zz equal 20*$z +variable zz equal 20*1 + +kim init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 real +#=== BEGIN kim init ========================================== +# Using KIM Simulator Model : Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 +# For Simulator : LAMMPS 28 Feb 2019 +# Running on : LAMMPS 10 Feb 2021 +# +units real +neighbor 2.0 bin # Angstroms +timestep 1.0 # femtoseconds +atom_style charge +neigh_modify one 4000 +#=== END kim init ============================================ + + +lattice fcc 4.4300 +Lattice spacing in x,y,z = 4.4300000 4.4300000 4.4300000 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +region box block 0 20 0 ${yy} 0 ${zz} +region box block 0 20 0 20 0 ${zz} +region box block 0 20 0 20 0 20 +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (88.600000 88.600000 88.600000) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 32000 atoms + create_atoms CPU = 0.003 seconds + +kim interactions O +#=== BEGIN kim interactions ================================== +variable kim_periodic equal 1 +pair_style reax/c /var/tmp/kim-shared-library-parameter-file-directory-pgBW45WFK0TI/lmp_control safezone 2.0 mincap 100 +pair_coeff * * /var/tmp/kim-shared-library-parameter-file-directory-pgBW45WFK0TI/ffield.reax.rdx O +Reading potential file /var/tmp/kim-shared-library-parameter-file-directory-pgBW45WFK0TI/ffield.reax.rdx with DATE: 2010-02-19 +fix reaxqeq all qeq/reax 1 0.0 10.0 1.0e-6 /var/tmp/kim-shared-library-parameter-file-directory-pgBW45WFK0TI/param.qeq +#=== END kim interactions ==================================== + + +mass 1 39.95 +velocity all create 200.0 232345 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 + +run 100 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- @Comment +{ +\documentclass{article} +\usepackage{url} +\begin{document} +This Simulator Model originally published in \cite{SM_107643900657_000a} is archived in OpenKIM~\cite{SM_107643900657_000, tadmor:elliott:2011, elliott:tadmor:2011}. +\bibliographystyle{vancouver} +\bibliography{kimcite-SM_107643900657_000.bib} +\end{document} +} + +@Misc{SM_107643900657_000, + author = {Ellad Tadmor}, + title = {{LAMMPS} {R}eax{FF} potential for {RDX} ({C}-{H}-{N}-{O}) systems developed by {S}trachan et al. (2003) v000}, + doi = {10.25950/acd3fc89}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/acd3fc89}}, + keywords = {OpenKIM, Simulator Model, SM_107643900657_000}, + publisher = {OpenKIM}, + year = 2019, +} + +@Article{tadmor:elliott:2011, + author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker}, + title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels}, + journal = {{JOM}}, + year = {2011}, + volume = {63}, + number = {7}, + pages = {17}, + doi = {10.1007/s11837-011-0102-6}, +} + +@Misc{elliott:tadmor:2011, + author = {Ryan S. Elliott and Ellad B. Tadmor}, + title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})}, + howpublished = {\url{https://openkim.org/kim-api}}, + publisher = {OpenKIM}, + year = 2011, + doi = {10.25950/ff8f563a}, +} + +@Article{SM_107643900657_000a, + author = {Strachan, Alejandro and van Duin, Adri C. T. and Chakraborty, Debashis and Dasgupta, Siddharth and Goddard, William A.}, + doi = {10.1103/PhysRevLett.91.098301}, + issue = {9}, + journal = {Physical Review Letters}, + month = {Aug}, + numpages = {4}, + pages = {098301}, + publisher = {American Physical Society}, + title = {Shock Waves in High-Energy Materials: {T}he Initial Chemical Events in Nitramine {RDX}}, + volume = {91}, + year = {2003}, +} +- pair reax/c command: + +@Article{Aktulga12, + author = {H. M. Aktulga, J. C. Fogarty, S. A. Pandit, A. Y. Grama}, + title = {Parallel reactive molecular dynamics: Numerical methods and algorithmic techniques}, + journal = {Parallel Computing}, + year = 2012, + volume = 38, + pages = {245--259} +} + +- fix qeq/reax command: + +@Article{Aktulga12, + author = {H. M. Aktulga, J. C. Fogarty, S. A. Pandit, A. Y. Grama}, + title = {Parallel reactive molecular dynamics: Numerical methods and algorithmic techniques}, + journal = {Parallel Computing}, + year = 2012, + volume = 38, + pages = {245--259} +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 4000, page size: 100000 + master list distance cutoff = 10.3 + ghost atom cutoff = 10.3 + binsize = 5.15, bins = 18 18 18 + 2 neighbor lists, perpetual/occasional/extra = 2 0 0 + (1) pair reax/c, perpetual + attributes: half, newton off, ghost + pair build: half/bin/newtoff/ghost + stencil: half/ghost/bin/3d/newtoff + bin: standard + (2) fix qeq/reax, perpetual, copy from (1) + attributes: half, newton off, ghost + pair build: copy + stencil: none + bin: none +Per MPI rank memory allocation (min/avg/max) = 1803.0 | 1803.0 | 1803.0 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 -39091.147 0 -20014.559 19501.107 + 100 63.198252 -26042.062 0 -20014.027 21497.661 +Loop time of 40.2545 on 1 procs for 100 steps with 32000 atoms + +Performance: 0.215 ns/day, 111.818 hours/ns, 2.484 timesteps/s +99.1% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 24.364 | 24.364 | 24.364 | 0.0 | 60.52 +Neigh | 0.4185 | 0.4185 | 0.4185 | 0.0 | 1.04 +Comm | 0.022045 | 0.022045 | 0.022045 | 0.0 | 0.05 +Output | 6.6e-05 | 6.6e-05 | 6.6e-05 | 0.0 | 0.00 +Modify | 15.438 | 15.438 | 15.438 | 0.0 | 38.35 +Other | | 0.01285 | | | 0.03 + +Nlocal: 32000.0 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 26825.0 ave 26825 max 26825 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 3.73924e+06 ave 3.73924e+06 max 3.73924e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 3739236 +Ave neighs/atom = 116.85112 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:41 diff --git a/examples/kim/log.10Feb21.in.kim-sm.melt.clang.4 b/examples/kim/log.10Feb21.in.kim-sm.melt.clang.4 new file mode 100644 index 0000000000..90c8adc6b0 --- /dev/null +++ b/examples/kim/log.10Feb21.in.kim-sm.melt.clang.4 @@ -0,0 +1,208 @@ +LAMMPS (10 Feb 2021) +# 3d Lennard-Jones melt +# +# This example requires that the KIM Simulator Model (PM) +# `Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000` +# is installed. This can be done with the command +# kim-api-collections-management install user Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 +# If this command does not work, you may need to setup your PATH to find the utility. +# If you installed the kim-api using the LAMMPS CMake build, you can do the following +# (where the current working directory is assumed to be the LAMMPS build directory) +# source ./kim_build-prefix/bin/kim-api-activate +# If you installed the kim-api using the LAMMPS Make build, you can do the following +# (where the current working directory is assumed to be the LAMMPS src directory) +# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate +# (where you should relplace X.Y.Z with the appropriate kim-api version number). +# +# See `https://openkim.org/doc/obtaining-models` for alternative options. +# + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable xx equal 20*1 +variable yy equal 20*$y +variable yy equal 20*1 +variable zz equal 20*$z +variable zz equal 20*1 + +kim init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 real +#=== BEGIN kim init ========================================== +# Using KIM Simulator Model : Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 +# For Simulator : LAMMPS 28 Feb 2019 +# Running on : LAMMPS 10 Feb 2021 +# +units real +neighbor 2.0 bin # Angstroms +timestep 1.0 # femtoseconds +atom_style charge +neigh_modify one 4000 +#=== END kim init ============================================ + + +lattice fcc 4.4300 +Lattice spacing in x,y,z = 4.4300000 4.4300000 4.4300000 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +region box block 0 20 0 ${yy} 0 ${zz} +region box block 0 20 0 20 0 ${zz} +region box block 0 20 0 20 0 20 +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (88.600000 88.600000 88.600000) + 1 by 2 by 2 MPI processor grid +create_atoms 1 box +Created 32000 atoms + create_atoms CPU = 0.001 seconds + +kim interactions O +#=== BEGIN kim interactions ================================== +variable kim_periodic equal 1 +pair_style reax/c /var/tmp/kim-shared-library-parameter-file-directory-zYQfH0ms5WSw/lmp_control safezone 2.0 mincap 100 +pair_coeff * * /var/tmp/kim-shared-library-parameter-file-directory-zYQfH0ms5WSw/ffield.reax.rdx O +Reading potential file /var/tmp/kim-shared-library-parameter-file-directory-zYQfH0ms5WSw/ffield.reax.rdx with DATE: 2010-02-19 +fix reaxqeq all qeq/reax 1 0.0 10.0 1.0e-6 /var/tmp/kim-shared-library-parameter-file-directory-zYQfH0ms5WSw/param.qeq +#=== END kim interactions ==================================== + + +mass 1 39.95 +velocity all create 200.0 232345 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 + +run 100 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- @Comment +{ +\documentclass{article} +\usepackage{url} +\begin{document} +This Simulator Model originally published in \cite{SM_107643900657_000a} is archived in OpenKIM~\cite{SM_107643900657_000, tadmor:elliott:2011, elliott:tadmor:2011}. +\bibliographystyle{vancouver} +\bibliography{kimcite-SM_107643900657_000.bib} +\end{document} +} + +@Misc{SM_107643900657_000, + author = {Ellad Tadmor}, + title = {{LAMMPS} {R}eax{FF} potential for {RDX} ({C}-{H}-{N}-{O}) systems developed by {S}trachan et al. (2003) v000}, + doi = {10.25950/acd3fc89}, + howpublished = {OpenKIM, \url{https://doi.org/10.25950/acd3fc89}}, + keywords = {OpenKIM, Simulator Model, SM_107643900657_000}, + publisher = {OpenKIM}, + year = 2019, +} + +@Article{tadmor:elliott:2011, + author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker}, + title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels}, + journal = {{JOM}}, + year = {2011}, + volume = {63}, + number = {7}, + pages = {17}, + doi = {10.1007/s11837-011-0102-6}, +} + +@Misc{elliott:tadmor:2011, + author = {Ryan S. Elliott and Ellad B. Tadmor}, + title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})}, + howpublished = {\url{https://openkim.org/kim-api}}, + publisher = {OpenKIM}, + year = 2011, + doi = {10.25950/ff8f563a}, +} + +@Article{SM_107643900657_000a, + author = {Strachan, Alejandro and van Duin, Adri C. T. and Chakraborty, Debashis and Dasgupta, Siddharth and Goddard, William A.}, + doi = {10.1103/PhysRevLett.91.098301}, + issue = {9}, + journal = {Physical Review Letters}, + month = {Aug}, + numpages = {4}, + pages = {098301}, + publisher = {American Physical Society}, + title = {Shock Waves in High-Energy Materials: {T}he Initial Chemical Events in Nitramine {RDX}}, + volume = {91}, + year = {2003}, +} +- pair reax/c command: + +@Article{Aktulga12, + author = {H. M. Aktulga, J. C. Fogarty, S. A. Pandit, A. Y. Grama}, + title = {Parallel reactive molecular dynamics: Numerical methods and algorithmic techniques}, + journal = {Parallel Computing}, + year = 2012, + volume = 38, + pages = {245--259} +} + +- fix qeq/reax command: + +@Article{Aktulga12, + author = {H. M. Aktulga, J. C. Fogarty, S. A. Pandit, A. Y. Grama}, + title = {Parallel reactive molecular dynamics: Numerical methods and algorithmic techniques}, + journal = {Parallel Computing}, + year = 2012, + volume = 38, + pages = {245--259} +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 4000, page size: 100000 + master list distance cutoff = 10.3 + ghost atom cutoff = 10.3 + binsize = 5.15, bins = 18 18 18 + 2 neighbor lists, perpetual/occasional/extra = 2 0 0 + (1) pair reax/c, perpetual + attributes: half, newton off, ghost + pair build: half/bin/newtoff/ghost + stencil: half/ghost/bin/3d/newtoff + bin: standard + (2) fix qeq/reax, perpetual, copy from (1) + attributes: half, newton off, ghost + pair build: copy + stencil: none + bin: none +Per MPI rank memory allocation (min/avg/max) = 630.2 | 630.2 | 630.2 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 -39091.147 0 -20014.559 19501.107 + 100 63.198252 -26042.062 0 -20014.027 21497.661 +Loop time of 15.049 on 4 procs for 100 steps with 32000 atoms + +Performance: 0.574 ns/day, 41.803 hours/ns, 6.645 timesteps/s +99.0% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 9.8158 | 9.8159 | 9.8161 | 0.0 | 65.23 +Neigh | 0.17685 | 0.17759 | 0.17832 | 0.1 | 1.18 +Comm | 0.028692 | 0.028847 | 0.028942 | 0.1 | 0.19 +Output | 2.5e-05 | 3.575e-05 | 4.6e-05 | 0.0 | 0.00 +Modify | 5.0171 | 5.0179 | 5.0186 | 0.0 | 33.34 +Other | | 0.008715 | | | 0.06 + +Nlocal: 8000.00 ave 8010 max 7993 min +Histogram: 2 0 0 0 0 1 0 0 0 1 +Nghost: 12605.0 ave 12612 max 12595 min +Histogram: 1 0 0 0 1 0 0 0 0 2 +Neighs: 1.00097e+06 ave 1.00187e+06 max 1.0006e+06 min +Histogram: 2 1 0 0 0 0 0 0 0 1 + +Total # of neighbors = 4003876 +Ave neighs/atom = 125.12113 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:15 diff --git a/examples/kim/log.10Feb21.in.lammps.melt.clang.1 b/examples/kim/log.10Feb21.in.lammps.melt.clang.1 new file mode 100644 index 0000000000..eb2922f413 --- /dev/null +++ b/examples/kim/log.10Feb21.in.lammps.melt.clang.1 @@ -0,0 +1,88 @@ +LAMMPS (10 Feb 2021) +# 3d Lennard-Jones melt + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable xx equal 20*1 +variable yy equal 20*$y +variable yy equal 20*1 +variable zz equal 20*$z +variable zz equal 20*1 + +units real + +lattice fcc 4.4300 +Lattice spacing in x,y,z = 4.4300000 4.4300000 4.4300000 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +region box block 0 20 0 ${yy} 0 ${zz} +region box block 0 20 0 20 0 ${zz} +region box block 0 20 0 20 0 20 +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (88.600000 88.600000 88.600000) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 32000 atoms + create_atoms CPU = 0.002 seconds + +pair_style lj/cut 8.1500 +pair_coeff 1 1 0.0104 3.4000 + +#pair_style kim LennardJones_Ar +#pair_coeff * * Ar + +mass 1 39.95 +velocity all create 200.0 232345 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 + +run 100 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 19.23 | 19.23 | 19.23 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 25367.408 6750.7421 + 100 98.747096 15900.676 0 25319.465 10184.453 +Loop time of 1.92822 on 1 procs for 100 steps with 32000 atoms + +Performance: 4.481 ns/day, 5.356 hours/ns, 51.861 timesteps/s +99.8% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.7377 | 1.7377 | 1.7377 | 0.0 | 90.12 +Neigh | 0.14234 | 0.14234 | 0.14234 | 0.0 | 7.38 +Comm | 0.011694 | 0.011694 | 0.011694 | 0.0 | 0.61 +Output | 6.7e-05 | 6.7e-05 | 6.7e-05 | 0.0 | 0.00 +Modify | 0.02476 | 0.02476 | 0.02476 | 0.0 | 1.28 +Other | | 0.01163 | | | 0.60 + +Nlocal: 32000.0 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19911.0 ave 19911 max 19911 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 1.96027e+06 ave 1.96027e+06 max 1.96027e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1960266 +Ave neighs/atom = 61.258313 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:01 diff --git a/examples/kim/log.10Feb21.in.lammps.melt.clang.4 b/examples/kim/log.10Feb21.in.lammps.melt.clang.4 new file mode 100644 index 0000000000..b8751c4e41 --- /dev/null +++ b/examples/kim/log.10Feb21.in.lammps.melt.clang.4 @@ -0,0 +1,88 @@ +LAMMPS (10 Feb 2021) +# 3d Lennard-Jones melt + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable xx equal 20*1 +variable yy equal 20*$y +variable yy equal 20*1 +variable zz equal 20*$z +variable zz equal 20*1 + +units real + +lattice fcc 4.4300 +Lattice spacing in x,y,z = 4.4300000 4.4300000 4.4300000 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +region box block 0 20 0 ${yy} 0 ${zz} +region box block 0 20 0 20 0 ${zz} +region box block 0 20 0 20 0 20 +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (88.600000 88.600000 88.600000) + 1 by 2 by 2 MPI processor grid +create_atoms 1 box +Created 32000 atoms + create_atoms CPU = 0.001 seconds + +pair_style lj/cut 8.1500 +pair_coeff 1 1 0.0104 3.4000 + +#pair_style kim LennardJones_Ar +#pair_coeff * * Ar + +mass 1 39.95 +velocity all create 200.0 232345 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 + +run 100 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 7.633 | 7.633 | 7.633 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 25367.408 6750.7421 + 100 98.747096 15900.676 0 25319.465 10184.453 +Loop time of 0.561006 on 4 procs for 100 steps with 32000 atoms + +Performance: 15.401 ns/day, 1.558 hours/ns, 178.251 timesteps/s +99.6% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.48486 | 0.48676 | 0.48817 | 0.2 | 86.77 +Neigh | 0.040698 | 0.04091 | 0.041066 | 0.1 | 7.29 +Comm | 0.016616 | 0.01811 | 0.0202 | 1.1 | 3.23 +Output | 3e-05 | 3.575e-05 | 4.7e-05 | 0.0 | 0.01 +Modify | 0.008934 | 0.009025 | 0.009142 | 0.1 | 1.61 +Other | | 0.006161 | | | 1.10 + +Nlocal: 8000.00 ave 8012 max 7989 min +Histogram: 1 0 0 0 2 0 0 0 0 1 +Nghost: 9131.00 ave 9142 max 9119 min +Histogram: 1 0 0 0 0 2 0 0 0 1 +Neighs: 490066.0 ave 491443 max 489273 min +Histogram: 2 0 0 0 1 0 0 0 0 1 + +Total # of neighbors = 1960266 +Ave neighs/atom = 61.258313 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:00 From a73f6f58ad75b9d68b1c13863ace10aef7d5bc71 Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Mon, 15 Feb 2021 13:12:40 -0600 Subject: [PATCH 298/384] Extra check to prevent illegal neighbor request esp, in unit conversion mode --- src/KIM/pair_kim.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 2f1fb9da3e..5fa93b09d0 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -601,6 +601,8 @@ void PairKIM::init_style() // set cutoff neighbor->requests[irequest]->cut = 1; + if (kim_cutoff_values[i] <= neighbor->skin) + error->all(FLERR,"Illegal neighbor request (force cutoff <= skin)"); neighbor->requests[irequest]->cutoff = kim_cutoff_values[i] + neighbor->skin; } From 21a60235eb4c604a1645562b588b956b5ada543f Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Tue, 16 Feb 2021 13:57:55 -0600 Subject: [PATCH 299/384] Fix a wrong indexing for optional explicit argument --- src/KIM/kim_param.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KIM/kim_param.cpp b/src/KIM/kim_param.cpp index 1ebbed62f6..161e8c9fc2 100644 --- a/src/KIM/kim_param.cpp +++ b/src/KIM/kim_param.cpp @@ -367,7 +367,7 @@ void KimParam::command(int narg, char **arg) varsname.resize(1); varsname[0] = varname; // Default explicit (optional) formatarg - } else if (i - 1 + nvars < narg) { + } else if (i - 1 + nvars - 1 < narg) { varsname.resize(nvars); --i; for (int j = 0; j < nvars; ++j, ++i) varsname[j] = arg[i]; From c139adf95be4866be30a571d99b61082ee3ecc5a Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Tue, 16 Feb 2021 15:12:56 -0600 Subject: [PATCH 300/384] Fix the index for get argument and correct the string variable format --- src/KIM/kim_param.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/KIM/kim_param.cpp b/src/KIM/kim_param.cpp index 161e8c9fc2..04e2bdceca 100644 --- a/src/KIM/kim_param.cpp +++ b/src/KIM/kim_param.cpp @@ -346,6 +346,8 @@ void KimParam::command(int narg, char **arg) if (i < narg) { // Get the variable/variable_base name varname = arg[i++]; + if (varname == "split" || varname == "list" || varname == "explicit") + error->all(FLERR, "Illegal variable name in 'kim param get'"); } else { std::string msg("Wrong number of arguments in 'kim param get' "); msg += "command.\nThe LAMMPS variable name is mandatory"; @@ -362,15 +364,22 @@ void KimParam::command(int narg, char **arg) for (int j = 0, k = nlbound; j < nvars; ++j, ++k) { varsname[j] = fmt::format("{}_{}", varname, k); } + ++i; } else if (strcmp(arg[i], "list") == 0) { list_requested = true; varsname.resize(1); varsname[0] = varname; + ++i; // Default explicit (optional) formatarg } else if (i - 1 + nvars - 1 < narg) { varsname.resize(nvars); --i; - for (int j = 0; j < nvars; ++j, ++i) varsname[j] = arg[i]; + for (int j = 0; j < nvars; ++j, ++i) { + varsname[j] = arg[i]; + if (varsname[j] == "split" || varsname[j] == "list" || + varsname[j] == "explicit") + error->all(FLERR, "Illegal variable name in 'kim param get'"); + } if (i < narg) { if (strcmp(arg[i], "explicit") == 0) ++i; } @@ -396,8 +405,7 @@ void KimParam::command(int narg, char **arg) ++i; } else { if ((strcmp(arg[i], "list") == 0) || - (strcmp(arg[i], "explicit") == 0)) - ++i; + (strcmp(arg[i], "explicit") == 0)) ++i; varsname[0] = varname; } @@ -427,7 +435,7 @@ void KimParam::command(int narg, char **arg) str += fmt::format(" {}", V); } - auto setcmd = fmt::format("{} string {}", varsname[0], str); + auto setcmd = fmt::format("{} string \"{}\"", varsname[0], str); input->variable->set(setcmd); input->write_echo(fmt::format("variable {}\n", setcmd)); @@ -465,7 +473,7 @@ void KimParam::command(int narg, char **arg) str += fmt::format(" {}", V); } - auto setcmd = fmt::format("{} string {}", varsname[0], str); + auto setcmd = fmt::format("{} string \"{}\"", varsname[0], str); input->variable->set(setcmd); input->write_echo(fmt::format("variable {}\n", setcmd)); From 29926c4f71ae1c72e066c71809299b262c74fe7b Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Tue, 16 Feb 2021 16:44:12 -0600 Subject: [PATCH 301/384] update kim command unittests with extra test cases for kim param command --- unittest/commands/test_kim_commands.cpp | 65 +++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/unittest/commands/test_kim_commands.cpp b/unittest/commands/test_kim_commands.cpp index 9d02cdb74c..3934e5de6f 100644 --- a/unittest/commands/test_kim_commands.cpp +++ b/unittest/commands/test_kim_commands.cpp @@ -347,6 +347,71 @@ TEST_F(KimCommandsTest, kim_param) if (!verbose) ::testing::internal::GetCapturedStdout(); ASSERT_TRUE(std::string(lmp->input->variable->retrieve("shift")) == "2"); + + TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*", + lmp->input->one("kim param get cutoffs 1:3 list");); + TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*", + lmp->input->one("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2 list");); + TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*", + lmp->input->one("kim param get cutoffs 1:3 split");); + TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*", + lmp->input->one("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2 split");); + TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*", + lmp->input->one("kim param get cutoffs 1:3 explicit");); + TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*", + lmp->input->one("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2 explicit");); + TEST_FAILURE(".*ERROR: Wrong number of arguments in 'kim param get' " + "command.\nThe LAMMPS '3' variable names or 'cutoffs " + "split/list' is mandatory.*", + lmp->input->one("kim param get cutoffs 1:3 cutoffs");); + TEST_FAILURE(".*ERROR: Wrong number of arguments in 'kim param get' " + "command.\nThe LAMMPS '3' variable names or 'cutoffs_1 " + "split' is mandatory.*", + lmp->input->one("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2");); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2 cutoffs_3"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_1")) == "2.20943"); + ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_2")) == "2.10252"); + ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_3")) == "5.666115"); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2 cutoffs_3 explicit"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_1")) == "2.20943"); + ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_2")) == "2.10252"); + ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_3")) == "5.666115"); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("kim param get cutoffs 1:3 cutoffs split"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_1")) == "2.20943"); + ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_2")) == "2.10252"); + ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_3")) == "5.666115"); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("kim param get cutoffs 1:3 cutoffs list"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs")) == "2.20943 2.10252 5.666115"); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("kim param set cutoffs 1 2.21 cutoffs 2 2.11"); + lmp->input->one("kim param get cutoffs 1:2 cutoffs list"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs")) == "2.21 2.11"); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("kim param set cutoffs 1:3 2.3 2.2 5.7"); + lmp->input->one("kim param get cutoffs 1:3 cutoffs list"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs")) == "2.3 2.2 5.7"); } TEST_F(KimCommandsTest, kim_property) From 3b9cbe4361fabd25dccf5fc43b294af80912ac01 Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Tue, 16 Feb 2021 16:44:58 -0600 Subject: [PATCH 302/384] Update the kim command doc Update the document with the latest interface changes. Replace the discontinued models in the examples with the correct models. Test all provided examples and fix the mistakes in them. --- doc/src/kim_commands.rst | 1299 ++++++++++++++++++++------------------ 1 file changed, 694 insertions(+), 605 deletions(-) diff --git a/doc/src/kim_commands.rst b/doc/src/kim_commands.rst index e9afa48fd5..47b8d3e790 100644 --- a/doc/src/kim_commands.rst +++ b/doc/src/kim_commands.rst @@ -1,106 +1,136 @@ -.. index:: kim_init, kim_interactions, kim_query, kim_param, kim_property +.. index:: kim_commands -:ref:`kim_init` command -========================================= - -:ref:`kim_interactions` command -========================================================= - -:ref:`kim_query` command -=========================================== - -:ref:`kim_param` command -=========================================== - -:ref:`kim_property` command -================================================= +kim command +=========== Syntax """""" .. code-block:: LAMMPS - kim_init model user_units unitarg - kim_interactions typeargs - kim_query variable formatarg query_function queryargs - kim_param get param_name index_range variables formatarg - kim_param set param_name index_range values - kim_property create instance_id property_id - kim_property modify instance_id key key_name key_name_key key_name_value - kim_property remove instance_id key key_name - kim_property destroy instance_id - kim_property dump file + kim sub-command -.. _formatarg_options: - -* model = name of the KIM interatomic model (the KIM ID for models archived in OpenKIM) -* user_units = the LAMMPS :doc:`units ` style assumed in the LAMMPS input script -* unitarg = *unit_conversion_mode* (optional) -* typeargs = atom type to species mapping (one entry per atom type) or *fixed_types* for models with a preset fixed mapping -* variable(s) = single name or list of names of (string style) LAMMPS variable(s) where a query result or parameter get result is stored. Variables that do not exist will be created by the command. -* formatarg = *list, split, or explicit* (optional): - - .. parsed-literal:: - - *list* = returns a single string with a list of space separated values - (e.g. "1.0 2.0 3.0"), which is placed in a LAMMPS variable as - defined by the *variable* argument. [default for *kim_query*] - *split* = returns the values separately in new variables with names based - on the prefix specified in *variable* and a number appended to - indicate which element in the list of values is in the variable. - *explicit* = returns the values separately in one more more variable names - provided as arguments that precede *formatarg*\ . [default for *kim_param*] - -* query_function = name of the OpenKIM web API query function to be used -* queryargs = a series of *keyword=value* pairs that represent the web query; supported keywords depend on the query function -* param_name = name of a KIM portable model parameter -* index_range = KIM portable model parameter index range (an integer for a single element, or pair of integers separated by a colon for a range of elements) -* values = new value(s) to replace the current value(s) of a KIM portable model parameter -* instance_id = a positive integer identifying the KIM property instance -* property_id = identifier of a `KIM Property Definition `_, which can be (1) a property short name, (2) the full unique ID of the property (including the contributor and date), (3) a file name corresponding to a local property definition file -* key_name = one of the keys belonging to the specified KIM property definition -* key_name_key = a key belonging to a key-value pair (standardized in the `KIM Properties Framework `__) -* key_name_value = value to be associated with a key_name_key in a key-value pair -* file = name of a file to write the currently defined set of KIM property instances to +* sub-command = :ref:`init ` or :ref:`interactions ` or + :ref:`query ` or :ref:`param ` or :ref:`property ` Examples """""""" .. code-block:: LAMMPS - kim_init SW_StillingerWeber_1985_Si__MO_405512056662_005 metal - kim_interactions Si - kim_init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 real - kim_init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 metal unit_conversion_mode - kim_interactions C H O - kim_init Sim_LAMMPS_IFF_PCFF_HeinzMishraLinEmami_2015Ver1v5_FccmetalsMineralsSolventsPolymers__SM_039297821658_000 real - kim_interactions fixed_types - kim_query a0 get_lattice_constant_cubic crystal=["fcc"] species=["Al"] units=["angstrom"] - kim_param get gamma 1 varGamma - kim_param set gamma 1 3.0 - kim_property create 1 atomic-mass - kim_property modify 1 key mass source-value 26.98154 - kim_property modify 1 key species source-value Al - kim_property remove 1 key species - kim_property destroy 1 - kim_property dump results.edn - + kim init ... + kim interactions ... + kim query ... + kim param ... + kim property ... .. _kim_description: Description """"""""""" -The set of *kim_commands* provide a high-level wrapper around the +*kim command* provides a set of high-level wrapper around the `Open Knowledgebase of Interatomic Models (OpenKIM) `_ repository of interatomic models (IMs) (potentials and force fields), -so that they can be used by LAMMPS scripts. These commands do not implement -any computations directly, but rather generate LAMMPS input commands based -on the information retrieved from the OpenKIM repository to initialize and -activate OpenKIM IMs and query their predictions for use in the LAMMPS script. -All LAMMPS input commands generated and executed by *kim_commands* are +so that they can be used by LAMMPS scripts. This command is followed by a +a set of sub-coammnds. The kim command does not implement any computations +directly, but rather generates LAMMPS input commands based on the information +retrieved from the OpenKIM repository to initialize and activate OpenKIM IMs +and query their predictions for use in the LAMMPS script. +All LAMMPS input commands generated and executed by *kim command* are echoed to the LAMMPS log file. +Full syntax +""""""""""" + +.. code-block:: LAMMPS + + kim init model user_units unitarg + kim interactions typeargs + kim query variable formatarg query_function queryargs + kim param get param_name index_range variables formatarg + kim param set param_name index_range values + kim property create instance_id property_id + kim property modify instance_id key key_name key_name_key key_name_value + kim property remove instance_id key key_name + kim property destroy instance_id + kim property dump file + +.. _formatarg_options: + +* model = name of the KIM interatomic model (the KIM ID for models archived in + OpenKIM) +* user_units = the LAMMPS :doc:`units ` style assumed in the LAMMPS + input script +* unitarg = *unit_conversion_mode* (optional) +* typeargs = atom type to species mapping (one entry per atom type) or + *fixed_types* for models with a preset fixed mapping +* variable(s) = single name or list of names of (string style) LAMMPS + variable(s) where a query result or parameter get result is stored. Variables + that do not exist will be created by the command +* formatarg = *list, split, index, or explicit* (optional): + + .. parsed-literal:: + + *list* = returns a single string with a list of space separated values + (e.g. "1.0 2.0 3.0"), which is placed in a LAMMPS variable as + defined by the *variable* argument. [default for *query* + sub-command] + *split* = returns the values separately in new variables with names based + on the prefix specified in *variable* and a number appended to + indicate which element in the list of values is in the variable + *index* = returns a variable style index that can be incremented via the + next command. This enables the construction of simple loops + *explicit* = returns the values separately in one more more variable names + provided as arguments that precede *formatarg*\ . [default for + *kim_param*] + +* query_function = name of the OpenKIM web API query function to be used +* queryargs = a series of *keyword=value* pairs that represent the web query; + supported keywords depend on the query function +* param_name = name of a KIM portable model parameter +* index_range = KIM portable model parameter index range (an integer for a + single element, or pair of integers separated by a colon for a range of + elements) +* values = new value(s) to replace the current value(s) of a KIM portable model + parameter +* instance_id = a positive integer identifying the KIM property instance +* property_id = identifier of a + `KIM Property Definition `_, which can be (1) + a property short name, (2) the full unique ID of the property (including the + contributor and date), (3) a file name corresponding to a local property + definition file +* key_name = one of the keys belonging to the specified KIM property definition +* key_name_key = a key belonging to a key-value pair (standardized in the + `KIM Properties Framework `__) +* key_name_value = value to be associated with a key_name_key in a key-value + pair +* file = name of a file to write the currently defined set of KIM property + instances to + +Full syntax examples +"""""""""""""""""""" + +.. code-block:: LAMMPS + + kim init SW_StillingerWeber_1985_Si__MO_405512056662_005 metal + kim interactions Si + kim init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_001 real + kim init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_001 metal unit_conversion_mode + kim interactions C H O + kim init Sim_LAMMPS_IFF_PCFF_HeinzMishraLinEmami_2015Ver1v5_FccmetalsMineralsSolventsPolymers__SM_039297821658_000 real + kim interactions fixed_types + kim query a0 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] + kim query model index get_available_models species=[Al] potential_type=[eam] + kim param get gamma 1 varGamma + kim param set gamma 1 3.0 + kim property create 1 atomic-mass + kim property modify 1 key mass source-value 26.98154 + kim property modify 1 key species source-value Al + kim property remove 1 key species + kim property destroy 1 + kim property dump results.edn + Benefits of Using OpenKIM IMs ----------------------------- @@ -109,22 +139,49 @@ Employing OpenKIM IMs provides LAMMPS users with multiple benefits: Reliability ^^^^^^^^^^^ -* All content archived in OpenKIM is reviewed by the `KIM Editor `_ for quality. -* IMs in OpenKIM are archived with full provenance control. Each is associated with a maintainer responsible for the integrity of the content. All changes are tracked and recorded. -* IMs in OpenKIM are exhaustively tested using `KIM Tests `_ that compute a host of material properties, and `KIM Verification Checks `_ that provide the user with information on various aspects of the IM behavior and coding correctness. This information is displayed on the IM's page accessible through the `OpenKIM browse interface `_. +* All content archived in OpenKIM is reviewed by the + `KIM Editor `_ for quality. +* IMs in OpenKIM are archived with full provenance control. Each is associated + with a maintainer responsible for the integrity of the content. All changes + are tracked and recorded. +* IMs in OpenKIM are exhaustively tested using + `KIM Tests `_ that compute a + host of material properties, and + `KIM Verification Checks `_ + that provide the user with information on various aspects of the IM behavior + and coding correctness. This information is displayed on the IM's page + accessible through the + `OpenKIM browse interface `_. Reproducibility ^^^^^^^^^^^^^^^ -* Each IM in OpenKIM is issued a unique identifier (`KIM ID `_), which includes a version number (last three digits). Any changes that can result in different numerical values lead to a version increment in the KIM ID. This makes it possible to reproduce simulations since the specific version of a specific IM used can be retrieved using its KIM ID. -* OpenKIM is a member organization of `DataCite `_ and issues digital object identifiers (DOIs) to all IMs archived in OpenKIM. This makes it possible to cite the IM code used in a simulation in a publications to give credit to the developers and further facilitate reproducibility. +* Each IM in OpenKIM is issued a unique identifier + (`KIM ID `_), which includes a + version number (last three digits). Any changes that can result in different + numerical values lead to a version increment in the KIM ID. This makes it + possible to reproduce simulations since the specific version of a specific IM + used can be retrieved using its KIM ID. +* OpenKIM is a member organization of `DataCite `_ and + issues digital object identifiers (DOIs) to all IMs archived in OpenKIM. This + makes it possible to cite the IM code used in a simulation in a publications + to give credit to the developers and further facilitate reproducibility. Convenience ^^^^^^^^^^^ -* IMs in OpenKIM are distributed in binary form along with LAMMPS and can be used in a LAMMPS input script simply by providing their KIM ID in the *kim_init* command documented on this page. -* The *kim_query* web query tool provides the ability to use the predictions of IMs for supported material properties (computed via `KIM Tests `_) as part of a LAMMPS input script setup and analysis. -* Support is provided for unit conversion between the :doc:`unit style ` used in the LAMMPS input script and the units required by the OpenKIM IM. This makes it possible to use a single input script with IMs using different units without change and minimizes the likelihood of errors due to incompatible units. +* IMs in OpenKIM are distributed in binary form along with LAMMPS and can be + used in a LAMMPS input script simply by providing their KIM ID in the + *kim init* command documented on this page. +* The *kim_query* web query tool provides the ability to use the predictions of + IMs for supported material properties (computed via + `KIM Tests `_) as part of a + LAMMPS input script setup and analysis. +* Support is provided for unit conversion between the :doc:`unit style ` + used in the LAMMPS input script and the units required by the OpenKIM IM. + This makes it possible to use a single input script with IMs using different + units without change and minimizes the likelihood of errors due to + incompatible units. .. _IM_types: @@ -135,12 +192,23 @@ There are two types of IMs archived in OpenKIM: .. _PM_type: -1. The first type is called a *KIM Portable Model* (PM). A KIM PM is an independent computer implementation of an IM written in one of the languages supported by KIM (C, C++, Fortran) that conforms to the KIM Application Programming Interface (`KIM API `_) Portable Model Interface (PMI) standard. A KIM PM will work seamlessly with any simulation code that supports the KIM API/PMI standard (including LAMMPS; see `complete list of supported codes `_). -2. The second type is called a *KIM Simulator Model* (SM). A KIM SM is an IM that is implemented natively within a simulation code (\ *simulator*\ ) that supports the KIM API Simulator Model Interface (SMI); in this case LAMMPS. A separate SM package is archived in OpenKIM for each parameterization of the IM, which includes all of the necessary parameter files, LAMMPS commands, and metadata (supported species, units, etc.) needed to run the IM in LAMMPS. +1. The first type is called a *KIM Portable Model* (PM). A KIM PM is an + independent computer implementation of an IM written in one of the languages + supported by KIM (C, C++, Fortran) that conforms to the KIM Application + Programming Interface (`KIM API `_) Portable + Model Interface (PMI) standard. A KIM PM will work seamlessly with any + simulation code that supports the KIM API/PMI standard (including LAMMPS; see + `complete list of supported codes `_). +2. The second type is called a *KIM Simulator Model* (SM). A KIM SM is an IM + that is implemented natively within a simulation code (\ *simulator*\ ) that + supports the KIM API Simulator Model Interface (SMI); in this case LAMMPS. A + separate SM package is archived in OpenKIM for each parameterization of the + IM, which includes all of the necessary parameter files, LAMMPS commands, and + metadata (supported species, units, etc.) needed to run the IM in LAMMPS. -With these two IM types, OpenKIM can archive and test almost all IMs that -can be used by LAMMPS. (It is easy to contribute new IMs to OpenKIM, see -the `upload instructions `_.) +With these two IM types, OpenKIM can archive and test almost all IMs that can be +used by LAMMPS. (It is easy to contribute new IMs to OpenKIM, see the +`upload instructions `_.) OpenKIM IMs are uniquely identified by a `KIM ID `_. @@ -155,7 +223,7 @@ By convention SM prefixes begin with *Sim_* to readily identify them. .. parsed-literal:: SW_StillingerWeber_1985_Si__MO_405512056662_005 - Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 + Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_001 Each OpenKIM IM has a dedicated "Model Page" on `OpenKIM `_ providing all the information on the IM including a title, description, @@ -169,16 +237,17 @@ The URL for the Model Page is constructed from the https://openkim.org/id/extended_KIM_ID -For example, for the Stillinger--Weber potential -listed above the Model Page is located at: +For example, for the Stillinger--Weber potential listed above the Model Page is +located at: .. parsed-literal:: `https://openkim.org/id/SW_StillingerWeber_1985_Si__MO_405512056662_005 `_ -See the `current list of KIM PMs and SMs archived in OpenKIM `_. -This list is sorted by species and can be filtered to display only -IMs for certain species combinations. +See the +`current list of KIM PMs and SMs archived in OpenKIM `_. +This list is sorted by species and can be filtered to display only IMs for +certain species combinations. See `Obtaining KIM Models `_ to learn how to install a pre-built binary of the OpenKIM Repository of Models. @@ -190,91 +259,87 @@ learn how to install a pre-built binary of the OpenKIM Repository of Models. Using OpenKIM IMs with LAMMPS ----------------------------- -Two commands are employed when using OpenKIM IMs, one to select the -IM and perform necessary initialization (\ *kim_init*\ ), and the second +Two sub-commands are employed when using OpenKIM IMs, one to select the +IM and perform necessary initialization (\ *kim init*\ ), and the second to set up the IM for use by executing any necessary LAMMPS commands -(\ *kim_interactions*\ ). Both are required. +(\ *kim interactions*\ ). Both are required. See the *examples/kim* directory for example input scripts that use KIM PMs and KIM SMs. -.. _kim_init command: +.. _init: -OpenKIM IM Initialization (*kim_init*) +OpenKIM IM Initialization (*kim init*) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The *kim_init* mode command must be issued **before** -the simulation box is created (normally at the top of the file). -This command sets the OpenKIM IM that will be used and may issue -additional commands changing LAMMPS default settings that are required -for using the selected IM (such as :doc:`units ` or -:doc:`atom_style `). If needed, those settings can be overridden, -however, typically a script containing a *kim_init* command -would not include *units* and *atom_style* commands. +The *kim* command followed by *init* sub-command must be issued **before** +the simulation box is created (normally at the top of the file). This command +sets the OpenKIM IM that will be used and may issue additional commands changing +LAMMPS default settings that are required for using the selected IM (such as +:doc:`units ` or :doc:`atom_style `). If needed, those +settings can be overridden, however, typically a script containing a *kim init* +command would not include *units* and *atom_style* commands. -The required arguments of *kim_init* are the *model* name of the -IM to be used in the simulation (for an IM archived in OpenKIM this is -its `extended KIM ID `_, and -the *user_units*, which are the LAMMPS :doc:`units style ` used -in the input script. (Any dimensioned numerical values in the input -script and values read in from files are expected to be in the -*user_units* system.) +The required arguments of *kim init* are the *model* name of the IM to be used +in the simulation (for an IM archived in OpenKIM this is its +`extended KIM ID `_, and the +*user_units*, which are the LAMMPS :doc:`units style ` used in the input +script. (Any dimensioned numerical values in the input script and values read in +from files are expected to be in the *user_units* system.) -The selected IM can be either a :ref:`KIM PM or a KIM SM `. -For a KIM SM, the *kim_init* command verifies that the SM is designed -to work with LAMMPS (and not another simulation code). -In addition, the LAMMPS version used for defining -the SM and the LAMMPS version being currently run are -printed to help diagnose any incompatible changes to input script or -command syntax between the two LAMMPS versions. +The selected IM can be either a :ref:`KIM PM or a KIM SM `. For a KIM +SM, the *kim init* command verifies that the SM is designed to work with LAMMPS +(and not another simulation code). In addition, the LAMMPS version used for +defining the SM and the LAMMPS version being currently run are printed to help +diagnose any incompatible changes to input script or command syntax between the +two LAMMPS versions. -Based on the selected model *kim_init* may modify the -:doc:`atom_style `. -Some SMs have requirements for this setting. If this is the case, then -*atom_style* will be set to the required style. Otherwise, the value is left -unchanged (which in the absence of an *atom_style* command in the input script -is the :doc:`default atom_style value `). +Based on the selected model *kim init* may modify the +:doc:`atom_style `. Some SMs have requirements for this setting. +If this is the case, then *atom_style* will be set to the required style. +Otherwise, the value is left unchanged (which in the absence of an *atom_style* +command in the input script is the +:doc:`default atom_style value `). -Regarding units, the *kim_init* command behaves in different ways depending -on whether or not *unit conversion mode* is activated as indicated by the -optional *unitarg* argument. -If unit conversion mode is **not** active, then *user_units* must -either match the required units of the IM or the IM must be able -to adjust its units to match. (The latter is only possible with some KIM PMs; -SMs can never adjust their units.) If a match is possible, the LAMMPS -:doc:`units ` command is called to set the units to -*user_units*\ . If the match fails, the simulation is terminated with -an error. +Regarding units, the *kim init* behaves in different ways depending on whether +or not *unit conversion mode* is activated as indicated by the optional +*unitarg* argument. +If unit conversion mode is **not** active, then *user_units* must either match +the required units of the IM or the IM must be able to adjust its units to +match. (The latter is only possible with some KIM PMs; SMs can never adjust +their units.) If a match is possible, the LAMMPS :doc:`units ` command is +called to set the units to *user_units*\ . If the match fails, the simulation is +terminated with an error. -Here is an example of a LAMMPS script to compute the cohesive energy -of a face-centered cubic (fcc) lattice for the Ercolessi and Adams (1994) -potential for Al: +Here is an example of a LAMMPS script to compute the cohesive energy of a +face-centered cubic (fcc) lattice for the MEAM potential by Pascuet and +Fernandez (2015) for Al. .. code-block:: LAMMPS - kim_init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal - boundary p p p - lattice fcc 4.032 - region simbox block 0 1 0 1 0 1 units lattice - create_box 1 simbox - create_atoms 1 box - mass 1 26.981539 - kim_interactions Al - run 0 - variable Ec equal (pe/count(all))/${_u_energy} - print "Cohesive Energy = ${EcJ} eV" + kim init Sim_LAMMPS_MEAM_PascuetFernandez_2015_Al__SM_811588957187_000 metal + boundary p p p + lattice fcc 4.049 + region simbox block 0 1 0 1 0 1 units lattice + create_box 1 simbox + create_atoms 1 box + mass 1 26.981539 + kim interactions Al + run 0 + variable Ec equal (pe/count(all)) + print "Cohesive Energy = ${Ec} eV" -The above script will end with an error in the *kim_init* line if the -IM is changed to another potential for Al that does not work with *metal* -units. To address this *kim_init* offers the *unit_conversion_mode* -as shown below. -If unit conversion mode *is* active, then *kim_init* calls the LAMMPS -:doc:`units ` command to set the units to the IM's required or -preferred units. Conversion factors between the IM's units and the *user_units* -are defined for all :doc:`physical quantities ` (mass, distance, etc.). +The above script will end with an error in the *kim init* line if the IM is +changed to another potential for Al that does not work with *metal* units. To +address this, *kim init* offers the *unit_conversion_mode* as shown below. + +If unit conversion mode *is* active, then *kim init* calls the LAMMPS +:doc:`units ` command to set the units to the IM's required or preferred +units. Conversion factors between the IM's units and the *user_units* are +defined for all :doc:`physical quantities ` (mass, distance, etc.). (Note that converting to or from the "lj" unit style is not supported.) -These factors are stored as :doc:`internal style variables ` with -the following standard names: +These factors are stored as :doc:`internal style variables ` with the +following standard names: .. parsed-literal:: @@ -297,127 +362,125 @@ If desired, the input script can be designed to work with these conversion factors so that the script will work without change with any OpenKIM IM. (This approach is used in the `OpenKIM Testing Framework `_.) -For example, the script given above for the cohesive energy of fcc Al -can be rewritten to work with any IM regardless of units. The following -script constructs an fcc lattice with a lattice parameter defined in -meters, computes the total energy, and prints the cohesive energy in -Joules regardless of the units of the IM. + +For example, the script given above for the cohesive energy of fcc Al can be +rewritten to work with any IM regardless of units. The following script +constructs an fcc lattice with a lattice parameter defined in meters, computes +the total energy, and prints the cohesive energy in Joules regardless of the +units of the IM. .. code-block:: LAMMPS - kim_init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 si unit_conversion_mode - boundary p p p - lattice fcc 4.032e-10*${_u_distance} - region simbox block 0 1 0 1 0 1 units lattice - create_box 1 simbox - create_atoms 1 box - mass 1 4.480134e-26*${_u_mass} - kim_interactions Al - run 0 - variable Ec_in_J equal (pe/count(all))/${_u_energy} - print "Cohesive Energy = ${Ec_in_J} J" + kim init Sim_LAMMPS_MEAM_PascuetFernandez_2015_Al__SM_811588957187_000 si unit_conversion_mode + boundary p p p + lattice fcc $(4.049e-10*v__u_distance) + region simbox block 0 1 0 1 0 1 units lattice + create_box 1 simbox + create_atoms 1 box + mass 1 $(4.480134e-26*v__u_mass) + kim interactions Al + neighbor $(0.001e-10*v__u_distance) bin + run 0 + variable Ec_in_J equal (pe/count(all))/v__u_energy + print "Cohesive Energy = ${Ec_in_J} J" -Note the multiplication by ${_u_distance} and ${_u_mass} to convert -from SI units (specified in the *kim_init* command) to whatever units the -IM uses (metal in this case), and the division by ${_u_energy} -to convert from the IM's energy units to SI units (Joule). This script -will work correctly for any IM for Al (KIM PM or SM) selected by the -*kim_init* command. +Note the multiplication by `v__u_distance` and `v__u_mass` to convert from SI +units (specified in the *kim init* command) to whatever units the IM uses (metal +in this case), and the division by `v__u_energy` to convert from the IM's energy +units to SI units (Joule). This script will work correctly for any IM for Al +(KIM PM or SM) selected by the *kim init* command. Care must be taken to apply unit conversion to dimensional variables read in -from a file. For example, if a configuration of atoms is read in from a -dump file using the :doc:`read_dump ` command, the following can -be done to convert the box and all atomic positions to the correct units: +from a file. For example, if a configuration of atoms is read in from a dump +file using the :doc:`read_dump ` command, the following can be done +to convert the box and all atomic positions to the correct units: + .. code-block:: LAMMPS - variable xyfinal equal xy*${_u_distance} - variable xzfinal equal xz*${_u_distance} - variable yzfinal equal yz*${_u_distance} change_box all x scale ${_u_distance} & - y scale ${_u_distance} & - z scale ${_u_distance} & - xy final ${xyfinal} & - xz final ${xzfinal} & - yz final ${yzfinal} & - remap + y scale ${_u_distance} & + z scale ${_u_distance} & + xy final $(xy*v__u_distance) & + xz final $(xz*v__u_distance) & + yz final $(yz*v__u_distance) & + remap .. note:: - Unit conversion will only work if the conversion factors are placed in - all appropriate places in the input script. It is up to the user to do this + Unit conversion will only work if the conversion factors are placed in all + appropriate places in the input script. It is up to the user to do this correctly. -.. _kim_interactions command: +.. _interactions: -OpenKIM IM Execution (*kim_interactions*) +OpenKIM IM Execution (*kim interactions*) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The second and final step in using an OpenKIM IM is to execute the -*kim_interactions* command. This command must be preceded by a *kim_init* +*kim interactions* command. This command must be preceded by a *kim init* command and a command that defines the number of atom types *N* (such as :doc:`create_box `). -The *kim_interactions* command has one argument *typeargs*\ . This argument +The *kim interactions* command has one argument *typeargs*\ . This argument contains either a list of *N* chemical species, which defines a mapping between -atom types in LAMMPS to the available species in the OpenKIM IM, or the -keyword *fixed_types* for models that have a preset fixed mapping (i.e. -the mapping between LAMMPS atom types and chemical species is defined by -the model and cannot be changed). In the latter case, the user must consult -the model documentation to see how many atom types there are and how they -map to the chemical species. +atom types in LAMMPS to the available species in the OpenKIM IM, or the keyword +*fixed_types* for models that have a preset fixed mapping (i.e. the mapping +between LAMMPS atom types and chemical species is defined by the model and +cannot be changed). In the latter case, the user must consult the model +documentation to see how many atom types there are and how they map to the +chemical species. -For example, consider an OpenKIM IM that supports Si and C species. -If the LAMMPS simulation has four atom types, where the first three are Si, -and the fourth is C, the following *kim_interactions* command would be used: +For example, consider an OpenKIM IM that supports Si and C species. If the +LAMMPS simulation has four atom types, where the first three are Si, and the +fourth is C, the following *kim interactions* command would be used: .. code-block:: LAMMPS - kim_interactions Si Si Si C + kim interactions Si Si Si C Alternatively, for a model with a fixed mapping the command would be: .. code-block:: LAMMPS - kim_interactions fixed_types + kim interactions fixed_types -The *kim_interactions* command performs all the necessary steps to set up -the OpenKIM IM selected in the *kim_init* command. The specific actions depend -on whether the IM is a KIM PM or a KIM SM. For a KIM PM, -a :doc:`pair_style kim ` command is executed followed by -the appropriate *pair_coeff* command. For example, for the -Ercolessi and Adams (1994) KIM PM for Al set by the following commands: +The *kim interactions* command performs all the necessary steps to set up the +OpenKIM IM selected in the *kim_init* command. The specific actions depend on +whether the IM is a KIM PM or a KIM SM. For a KIM PM, a +:doc:`pair_style kim ` command is executed followed by the appropriate +*pair_coeff* command. For example, for the Ercolessi and Adams (1994) KIM PM for +Al set by the following commands: .. code-block:: LAMMPS - kim_init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal + kim init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal ... ... box specification lines skipped ... - kim_interactions Al + kim interactions Al -the *kim_interactions* command executes the following LAMMPS input commands: +the *kim interactions* command executes the following LAMMPS input commands: .. code-block:: LAMMPS pair_style kim EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 pair_coeff * * Al -For a KIM SM, the generated input commands may be more complex -and require that LAMMPS is built with the required packages included -for the type of potential being used. The set of commands to be executed -is defined in the SM specification file, which is part of the SM package. -For example, for the Strachan et al. (2003) ReaxFF SM -set by the following commands: +For a KIM SM, the generated input commands may be more complex and require that +LAMMPS is built with the required packages included for the type of potential +being used. The set of commands to be executed is defined in the SM +specification file, which is part of the SM package. For example, for the +Strachan et al. (2003) ReaxFF SM set by the following commands: .. code-block:: LAMMPS - kim_init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 real + kim init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 real ... ... box specification lines skipped ... - kim_interactions C H N O + kim interactions C H N O -the *kim_interactions* command executes the following LAMMPS input commands: +the *kim interactions* command executes the following LAMMPS input commands: .. code-block:: LAMMPS @@ -427,325 +490,354 @@ the *kim_interactions* command executes the following LAMMPS input commands: .. note:: - The files *lmp_control*, *ffield.reax.rdx* and *param.qeq* - are specific to the Strachan et al. (2003) ReaxFF parameterization - and are archived as part of the SM package in OpenKIM. + The files *lmp_control*, *ffield.reax.rdx* and *param.qeq* are specific to + the Strachan et al. (2003) ReaxFF parameterization and are archived as part + of the SM package in OpenKIM. .. note:: - Parameters like cutoff radii and charge tolerances, - which have an effect on IM predictions, are also included in the - SM definition ensuring reproducibility. + Parameters like cutoff radii and charge tolerances, which have an effect on + IM predictions, are also included in the SM definition ensuring + reproducibility. .. note:: - When using *kim_init* and *kim_interactions* to select - and set up an OpenKIM IM, other LAMMPS commands - for the same functions (such as pair_style, pair_coeff, bond_style, - bond_coeff, fixes related to charge equilibration, etc.) should normally - not appear in the input script. + When using *kim init* and *kim interactions* to select and set up an OpenKIM + IM, other LAMMPS commands for the same functions (such as pair_style, + pair_coeff, bond_style, bond_coeff, fixes related to charge equilibration, + etc.) should normally not appear in the input script. -.. _kim_query command: +.. note:: -Using OpenKIM Web Queries in LAMMPS (*kim_query*) + Changing a periodic boundary to a non-periodic one, or in general using the + :doc:`change_box ` command after the interactions are set via + *kim interactions* or *pair_coeff* commands might affect some of the + settings. For example, SM models containing Coulombic terms in the + interactions require different settings if a periodic boundary changes to a + non-periodic one. In these cases, *kim interactions* must be called again + after the *change_box* command to provide the correct settings. + +.. _query: + +Using OpenKIM Web Queries in LAMMPS (*kim query*) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The *kim_query* command performs a web query to retrieve the predictions -of an IM set by *kim_init* for material properties archived in +The *kim query* command performs a web query to retrieve the predictions of an +IM set by *kim init* for material properties archived in `OpenKIM `_. -.. note:: - - The *kim_query* command must be preceded by a *kim_init* command. - -The syntax for the *kim_query* command is as follows: - +The syntax for the *kim query* command is as follows: .. code-block:: LAMMPS - kim_query variable formatarg query_function queryargs + kim query variable formatarg query_function queryargs The result of the query is stored in one or more -:doc:`string style variables ` as determined by the -optional *formatarg* argument :ref:`documented above `. -For the "list" setting of *formatarg* (or if *formatarg* is not -specified), the result is returned as a space-separated list of -values in *variable*\ . -The *formatarg* keyword "split" separates the result values into -individual variables of the form *prefix_I*, where *prefix* is set to the -*kim_query* *variable* argument and *I* ranges from 1 to the number of -returned values. The number and order of the returned values is determined -by the type of query performed. (Note that the "explicit" setting of -*formatarg* is not supported by *kim_query*\ .) +:doc:`string style variables ` as determined by the optional +*formatarg* argument :ref:`documented above `. For the "list" +setting of *formatarg* (or if *formatarg* is not specified), the result is +returned as a space-separated list of values in *variable*\ . The *formatarg* +keyword "split" separates the result values into individual variables of the +form *prefix_I*, where *prefix* is set to the *kim query* *variable* argument +and *I* ranges from 1 to the number of returned values. The number and order of +the returned values is determined by the type of query performed. The +*formatarg* keyword "index" returns a :doc:`variable style index ` +that can be incremented via the :doc:`next ` command. This enables the +construction of simple loops over the returned values by the type of query +performed. (Note that the "explicit" setting of *formatarg* is not supported by +*kim query*\ .) .. note:: - *kim_query* only supports queries that return a single result or - an array of values. More complex queries that return a JSON structure - are not currently supported. An attempt to use *kim_query* in such - cases will generate an error. + *kim query* only supports queries that return a single result or an array of + values. More complex queries that return a JSON structure are not currently + supported. An attempt to use *kim query* in such cases will generate an + error. -The second required argument *query_function* is the name of the -query function to be called (e.g. *get_lattice_constant_cubic*\ ). -All following :doc:`arguments ` are parameters handed over to -the web query in the format *keyword=value*\ , where *value* is always -an array of one or more comma-separated items in brackets. -The list of supported keywords and the type and format of their values -depend on the query function used. The current list of query functions -is available on the OpenKIM webpage at +The second required argument *query_function* is the name of the query function +to be called (e.g. *get_lattice_constant_cubic*\ ). All following +:doc:`arguments ` are parameters handed over to the web query in +the format *keyword=value*\ , where *value* is always an array of one or more +comma-separated items in brackets. The list of supported keywords and the type +and format of their values depend on the query function used. The current list +of query functions is available on the OpenKIM webpage at `https://openkim.org/doc/usage/kim-query `_. .. note:: - All query functions require the *model* keyword, which identifies - the IM whose predictions are being queried. This keyword is automatically - generated by *kim_query* based on the IM set in *kim_init* and must not - be specified as an argument to *kim_query*\ . + All query functions, except *get_available_models* function, require the + *model* keyword, which identifies the IM whose predictions are being queried. + *kim query* automatically generates the *model* keyword based on the IM set + in by *kim init*, and it can be overwritten if specified as an argument to + the *kim query*\ . Where *Kim init* is not specified, the *model* keyword + must be provided as an argument to the *kim query*\ . .. note:: - Each *query_function* is associated with a default method (implemented - as a `KIM Test `_) - used to compute this property. In cases where there are multiple - methods in OpenKIM for computing a property, a *method* keyword can - be provided to select the method of choice. See the - `query documentation `_ - to see which methods are available for a given *query_function*\ . + Each *query_function* is associated with a default method (implemented as a + `KIM Test `_) used to compute + this property. In cases where there are multiple methods in OpenKIM for + computing a property, a *method* keyword can be provided to select the method + of choice. See the + `query documentation `_ to see which + methods are available for a given *query_function*\ . -*kim_query* Usage Examples and Further Clarifications +*kim query* Usage Examples and Further Clarifications ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The data obtained by *kim_query* commands can be used as part of the setup -or analysis phases of LAMMPS simulations. Some examples are given below. +The data obtained by *kim query* commands can be used as part of the setup or +analysis phases of LAMMPS simulations. Some examples are given below. **Define an equilibrium fcc crystal** .. code-block:: LAMMPS - kim_init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal - boundary p p p - kim_query a0 get_lattice_constant_cubic crystal=["fcc"] species=["Al"] units=["angstrom"] - lattice fcc ${a0} + kim init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal + boundary p p p + kim query a0 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] + lattice fcc ${a0} ... -The *kim_query* command retrieves from `OpenKIM `_ -the equilibrium lattice constant predicted by the Ercolessi and Adams (1994) -potential for the fcc structure and places it in -variable *a0*\ . This variable is then used on the next line to set up the -crystal. By using *kim_query*, the user is saved the trouble and possible -error of tracking this value down, or of having to perform an energy -minimization to find the equilibrium lattice constant. +.. code-block:: LAMMPS + + units metal + kim query a0 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005] + lattice fcc ${a0} + ... + +The *kim query* command retrieves from `OpenKIM `_ the +equilibrium lattice constant predicted by the Ercolessi and Adams (1994) +potential for the fcc structure and places it in variable *a0*\ . This variable +is then used on the next line to set up the crystal. By using *kim query*, the +user is saved the trouble and possible error of tracking this value down, or of +having to perform an energy minimization to find the equilibrium lattice +constant. .. note:: - In *unit_conversion_mode* the results obtained from a - *kim_query* would need to be converted to the appropriate units system. - For example, in the above script, the lattice command would need to be - changed to: "lattice fcc ${a0}*${_u_distance}". + In *unit_conversion_mode* the results obtained from a *kim query* would need + to be converted to the appropriate units system. For example, in the above + script, the lattice command would need to be changed to: + "lattice fcc $(v_a0*v__u_distance)". **Define an equilibrium hcp crystal** .. code-block:: LAMMPS - kim_init EAM_Dynamo_Mendelev_2007_Zr__MO_848899341753_000 metal - boundary p p p - kim_query latconst split get_lattice_constant_hexagonal crystal=["hcp"] species=["Zr"] units=["angstrom"] - variable a0 equal latconst_1 - variable c0 equal latconst_2 - variable c_to_a equal ${c0}/${a0} - lattice custom ${a0} a1 0.5 -0.866025 0 a2 0.5 0.866025 0 a3 0 0 ${c_to_a} & - basis 0.333333 0.666666 0.25 basis 0.666666 0.333333 0.75 + kim init EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000 metal + boundary p p p + kim query latconst split get_lattice_constant_hexagonal crystal=[hcp] species=[Zr] units=[angstrom] + lattice custom ${latconst_1} a1 0.5 -0.866025 0 a2 0.5 0.866025 0 a3 0 0 $(latconst_2/latconst_1) & + basis 0.333333 0.666666 0.25 basis 0.666666 0.333333 0.75 ... -In this case the *kim_query* returns two arguments (since the hexagonal -close packed (hcp) structure has two independent lattice constants). -The *formatarg* keyword "split" places the two values into -the variables *latconst_1* and *latconst_2*\ . (These variables are -created if they do not already exist.) For convenience the variables -*a0* and *c0* are created in order to make the remainder of the -input script more readable. +In this case the *kim query* returns two arguments (since the hexagonal close +packed (hcp) structure has two independent lattice constants). The *formatarg* +keyword "split" places the two values into the variables *latconst_1* and +*latconst_2*\ . (These variables are created if they do not already exist.) **Define a crystal at finite temperature accounting for thermal expansion** .. code-block:: LAMMPS - kim_init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal - boundary p p p - kim_query a0 get_lattice_constant_cubic crystal=["fcc"] species=["Al"] units=["angstrom"] - kim_query alpha get_linear_thermal_expansion_coefficient_cubic crystal=["fcc"] species=["Al"] units=["1/K"] temperature=[293.15] temperature_units=["K"] - variable DeltaT equal 300 - lattice fcc ${a0}*${alpha}*${DeltaT} + kim init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal + boundary p p p + kim query a0 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] + kim query alpha get_linear_thermal_expansion_coefficient_cubic crystal=[fcc] species=[Al] units=[1/K] temperature=[293.15] temperature_units=[K] + variable DeltaT equal 300 + lattice fcc $(v_a0*v_alpha*v_DeltaT) ... -As in the previous example, the equilibrium lattice constant is obtained -for the Ercolessi and Adams (1994) potential. However, in this case the -crystal is scaled to the appropriate lattice constant at room temperature -(293.15 K) by using the linear thermal expansion constant predicted by the -potential. +As in the previous example, the equilibrium lattice constant is obtained for the +Ercolessi and Adams (1994) potential. However, in this case the crystal is +scaled to the appropriate lattice constant at room temperature (293.15 K) by +using the linear thermal expansion constant predicted by the potential. .. note:: - When passing numerical values as arguments (as in the case - of the temperature in the above example) it is also possible to pass a - tolerance indicating how close to the value is considered a match. - If no tolerance is passed a default value is used. If multiple results - are returned (indicating that the tolerance is too large), *kim_query* - will return an error. See the - `query documentation `_ - to see which numerical arguments and tolerances are available for a - given *query_function*\ . + When passing numerical values as arguments (as in the case of the temperature + in the above example) it is also possible to pass a tolerance indicating how + close to the value is considered a match. If no tolerance is passed a default + value is used. If multiple results are returned (indicating that the + tolerance is too large), *kim query* will return an error. See the + `query documentation `_ to see which + numerical arguments and tolerances are available for a given + *query_function*\ . **Compute defect formation energy** .. code-block:: LAMMPS - kim_init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal + kim init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal ... ... Build fcc crystal containing some defect and compute the total energy ... which is stored in the variable *Etot* ... - kim_query Ec get_cohesive_energy_cubic crystal=["fcc"] species=["Al"] units=["eV"] - variable Eform equal ${Etot} - count(all)*${Ec} + kim query Ec get_cohesive_energy_cubic crystal=[fcc] species=[Al] units=[eV] + variable Eform equal ${Etot} - count(all)*${Ec} ... -The defect formation energy *Eform* is computed by subtracting from *Etot* the -ideal fcc cohesive energy of the atoms in the system obtained from +The defect formation energy *Eform* is computed by subtracting the ideal fcc +cohesive energy of the atoms in the system from *Etot*\ . The ideal fcc +cohesive energy of the atoms is obtained from `OpenKIM `_ for the Ercolessi and Adams (1994) potential. +**Retrieve equilibrium fcc crystal of all EAM potentials that support a specific species** + +.. code-block:: LAMMPS + + kim query model index get_available_models species=[Al] potential_type=[eam] + label model_loop + kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}] + print "FCC lattice constant (${model} potential) = ${latconst}" + ... + ... do something with current value of latconst + ... + next model + jump SELF model_loop + +In this example, the *index* mode of *formatarg* is used. The first *kim query* +returns the list of all available EAM potentials that support the *Al* species +and archived in `OpenKIM `_. The result of the query +operation is stored in the LAMMPS variable *model* as an index *variable*\ . +This variable is used later to access the values one at a time within a loop as +shown in the example. The second *kim query* command retrieves from +`OpenKIM `_ the equilibrium lattice constant predicted by +each potential for the fcc structure and places it in variable *latconst*\ . + .. note:: - *kim_query* commands return results archived in - `OpenKIM `_. These results are obtained - using programs for computing material properties - (KIM Tests and KIM Test Drivers) that were contributed to OpenKIM. - In order to give credit to Test developers, the number of times results - from these programs are queried is tracked. No other information about - the nature of the query or its source is recorded. + *kim query* commands return results archived in + `OpenKIM `_. These results are obtained using programs + for computing material properties (KIM Tests and KIM Test Drivers) that were + contributed to OpenKIM. In order to give credit to Test developers, the + number of times results from these programs are queried is tracked. No other + information about the nature of the query or its source is recorded. -.. _kim_param command: -Accessing KIM Model Parameters from LAMMPS (*kim_param*) +.. _param: + +Accessing KIM Model Parameters from LAMMPS (*kim param*) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -All IMs are functional forms containing a set of -parameters. The values of these parameters are typically -selected to best reproduce a training set of quantum mechanical -calculations or available experimental data. For example, a -Lennard-Jones potential intended to model argon might have the values of -its two parameters, epsilon and sigma, fit to the -dimer dissociation energy or thermodynamic properties at a critical point -of the phase diagram. +All IMs are functional forms containing a set of parameters. These parameters' +values are typically selected to best reproduce a training set of quantum +mechanical calculations or available experimental data. For example, a +Lennard-Jones potential intended to model argon might have the values of its two +parameters, epsilon, and sigma, fit to the dimer dissociation energy or +thermodynamic properties at a critical point of the phase diagram. -Normally a user employing an IM should not modify its parameters since, -as noted above, these are selected to reproduce material properties. -However, there are cases where accessing and modifying IM parameters -is desired, such as for assessing uncertainty, fitting an IM, -or working with an ensemble of IMs. As explained :ref:`above `, -IMs archived in OpenKIM are either Portable Models (PMs) or -Simulator Models (SMs). KIM PMs are complete independent implementations -of an IM, whereas KIM SMs are wrappers to an IM implemented within LAMMPS. -Two different mechanisms are provided for accessing IM parameters in these -two cases: +Normally a user employing an IM should not modify its parameters since, as noted +above, these are selected to reproduce material properties. However, there are +cases where accessing and modifying IM parameters is desired, such as for +assessing uncertainty, fitting an IM, or working with an ensemble of IMs. As +explained :ref:`above `, IMs archived in OpenKIM are either Portable +Models (PMs) or Simulator Models (SMs). KIM PMs are complete independent +implementations of an IM, whereas KIM SMs are wrappers to an IM implemented +within LAMMPS. Two different mechanisms are provided for accessing IM parameters +in these two cases: -* For a KIM PM, the *kim_param* command can be used to *get* and *set* the values of the PM's parameters as explained below. -* For a KIM SM, the user should consult the documentation page for the specific IM and follow instructions there for how to modify its parameters (if possible). +* For a KIM PM, the *kim param* command can be used to *get* and *set* the + values of the PM's parameters as explained below. +* For a KIM SM, the user should consult the documentation page for the specific + IM and follow instructions there for how to modify its parameters (if + possible). -The *kim_param get* and *kim_param set* commands provide an interface -to access and change the parameters of a KIM PM that "publishes" its -parameters and makes them publicly available (see the +The *kim param get* and *kim param set* commands provide an interface to access +and change the parameters of a KIM PM that "publishes" its parameters and makes +them publicly available (see the `KIM API documentation `_ for details). .. note:: - The *kim_param get/set* commands must be preceded by *kim_init*\ . - The *kim_param set* command must additionally be preceded by a - *kim_interactions* command (or alternatively by a *pair_style kim* - and *pair_coeff* commands). The *kim_param set* command may be used wherever a *pair_coeff* command may occur. + The *kim param get/set* commands must be preceded by *kim init*\ . + The *kim param set* command must additionally be preceded by a + *kim_interactions* command (or alternatively by a *pair_style kim* and + *pair_coeff* commands). The *kim param set* command may be used wherever a + *pair_coeff* command may occur. -The syntax for the *kim_param* command is as follows: +The syntax for the *kim param* command is as follows: .. code-block:: LAMMPS - kim_param get param_name index_range variable formatarg - kim_param set param_name index_range values + kim param get param_name index_range variable formatarg + kim param set param_name index_range values -Here, *param_name* is the name of a KIM PM parameter (which is published -by the PM and available for access). The specific string used to identify -a parameter is defined by the PM. For example, for the +Here, *param_name* is the name of a KIM PM parameter (which is published by the +PM and available for access). The specific string used to identify a parameter +is defined by the PM. For example, for the `Stillinger--Weber (SW) potential in OpenKIM `_, the parameter names are *A, B, p, q, sigma, gamma, cutoff, lambda, costheta0*\ . .. note:: The list of all the parameters that a PM exposes for access/mutation are - automatically written to the lammps log file when *kim_init* is called. + automatically written to the lammps log file when *kim init* is called. -Each published parameter of a KIM PM takes the form of an array of -numerical values. The array can contain one element for a single-valued -parameter, or a set of values. For example, the +Each published parameter of a KIM PM takes the form of an array of numerical +values. The array can contain one element for a single-valued parameter, or a +set of values. For example, the `multispecies SW potential for the Zn-Cd-Hg-S-Se-Te system `_ has the same parameter names as the `single-species SW potential `_, but each parameter array contains 21 entries that correspond to the parameter values used for each pairwise combination of the model's six supported species -(this model does not have parameters specific to individual ternary -combinations of its supported species). +(this model does not have parameters specific to individual ternary combinations +of its supported species). -The *index_range* argument may either be an integer referring to -a specific element within the array associated with the parameter -specified by *param_name*, or a pair of integers separated by a colon -that refer to a slice of this array. In both cases, one-based indexing is -used to refer to the entries of the array. +The *index_range* argument may either be an integer referring to a specific +element within the array associated with the parameter specified by +*param_name*, or a pair of integers separated by a colon that refer to a slice +of this array. In both cases, one-based indexing is used to refer to the +entries of the array. The result of a *get* operation for a specific *index_range* is stored in -one or more :doc:`LAMMPS string style variables ` as determined -by the optional *formatarg* argument :ref:`documented above. ` -If not specified, the default for *formatarg* is "explicit" for the -*kim_param* command. +one or more :doc:`LAMMPS string style variables ` as determined by the +optional *formatarg* argument :ref:`documented above. ` If +not specified, the default for *formatarg* is "explicit" for the *kim param* +command. -For the case where the result is an array with multiple values -(i.e. *index_range* contains a range), the optional "split" or "explicit" -*formatarg* keywords can be used to separate the results into multiple -variables; see the examples below. -Multiple parameters can be retrieved with a single call to *kim_param get* -by repeating the argument list following *get*\ . +For the case where the result is an array with multiple values (i.e. +*index_range* contains a range), the optional "split" or "explicit" *formatarg* +keywords can be used to separate the results into multiple variables; see the +examples below. Multiple parameters can be retrieved with a single call to +*kim param get* by repeating the argument list following *get*\ . -For a *set* operation, the *values* argument contains the new value(s) -for the element(s) of the parameter specified by *index_range*\ . For the case -where multiple values are being set, *values* contains a set of values -separated by spaces. Multiple parameters can be set with a single call to -*kim_param set* by repeating the argument list following *set*\ . +For a *set* operation, the *values* argument contains the new value(s) for the +element(s) of the parameter specified by *index_range*\ . For the case where +multiple values are being set, *values* contains a set of values separated by +spaces. Multiple parameters can be set with a single call to *kim param set* by +repeating the argument list following *set*\ . -*kim_param* Usage Examples and Further Clarifications +*kim param* Usage Examples and Further Clarifications ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Examples of getting and setting KIM PM parameters with further -clarifications are provided below. +Examples of getting and setting KIM PM parameters with further clarifications +are provided below. **Getting a scalar parameter** .. code-block:: LAMMPS - kim_init SW_StillingerWeber_1985_Si__MO_405512056662_005 metal + kim init SW_StillingerWeber_1985_Si__MO_405512056662_005 metal ... - kim_param get A 1 VARA + kim param get A 1 VARA -In this case, the value of the SW *A* parameter is retrieved and placed -in the LAMMPS variable *VARA*\ . The variable *VARA* can be used -in the remainder of the input script in the same manner as any other -LAMMPS variable. +In this case, the value of the SW *A* parameter is retrieved and placed in the +LAMMPS variable *VARA*\ . The variable *VARA* can be used in the remainder of +the input script in the same manner as any other LAMMPS variable. **Getting multiple scalar parameters with a single call** .. code-block:: LAMMPS - kim_init SW_StillingerWeber_1985_Si__MO_405512056662_005 metal + kim init SW_StillingerWeber_1985_Si__MO_405512056662_005 metal ... - kim_param get A 1 VARA B 1 VARB + kim param get A 1 VARA B 1 VARB -This retrieves the *A* and *B* parameters of the SW potential and stores -them in the LAMMPS variables *VARA* and *VARB*\ . +In this example, it is shown how to retrieve the *A* and *B* parameters of the +SW potential and store them in the LAMMPS variables *VARA* and *VARB*\ . **Getting a range of values from a parameter** @@ -754,9 +846,9 @@ determined by the *formatarg* argument. .. code-block:: LAMMPS - kim_init SW_ZhouWardMartin_2013_CdTeZnSeHgS__MO_503261197030_002 metal + kim init SW_ZhouWardMartin_2013_CdTeZnSeHgS__MO_503261197030_002 metal ... - kim_param get lambda 7:9 LAM_TeTe LAM_TeZn LAM_TeSe + kim param get lambda 7:9 LAM_TeTe LAM_TeZn LAM_TeSe In this case, *formatarg* is not specified and therefore the default "explicit" mode is used. (The behavior would be the same if the word @@ -766,166 +858,164 @@ lambda retrieved by the *get* operation are placed in the LAMMPS variables .. note:: - In the above example, elements 7--9 of the lambda parameter correspond - to Te-Te, Te-Zm and Te-Se interactions. This can be determined by visiting - the `model page for the specified potential `_ - and looking at its parameter file linked to at the bottom of the page - (file with .param ending) and consulting the README documentation - provided with the driver for the PM being used. A link to the driver - is provided at the top of the model page. + In the above example, elements 7--9 of the lambda parameter correspond to + Te-Te, Te-Zm and Te-Se interactions. This can be determined by visiting the + `model page for the specified potential `_ + and looking at its parameter file linked to at the bottom of the page (file + with .param ending) and consulting the README documentation provided with the + driver for the PM being used. A link to the driver is provided at the top of + the model page. .. code-block:: LAMMPS - kim_init SW_ZhouWardMartin_2013_CdTeZnSeHgS__MO_503261197030_002 metal + kim init SW_ZhouWardMartin_2013_CdTeZnSeHgS__MO_503261197030_002 metal ... - kim_param get lambda 15:17 LAMS list - variable LAM_VALUE index ${LAMS} - label loop_on_lambda + kim param get lambda 15:17 LAMS list + variable LAM_VALUE index ${LAMS} + label loop_on_lambda ... - ... do something with current value of lambda + ... do something with the current value of lambda ... - next LAM_VALUE - jump SELF loop_on_lambda + next LAM_VALUE + jump SELF loop_on_lambda -In this case, the "list" mode of *formatarg* is used. -The result of the *get* operation is stored in the LAMMPS variable -*LAMS* as a string containing the three retrieved values separated -by spaces, e.g "1.0 2.0 3.0". This can be used in LAMMPS with an -*index* variable to access the values one at a time within a loop -as shown in the example. At each iteration of the loop *LAM_VALUE* -contains the current value of lambda. +In this case, the "list" mode of *formatarg* is used. The result of the *get* +operation is stored in the LAMMPS variable *LAMS* as a string containing the +three retrieved values separated by spaces, e.g "1.0 2.0 3.0". This can be used +in LAMMPS with an *index* variable to access the values one at a time within a +loop as shown in the example. At each iteration of the loop *LAM_VALUE* contains +the current value of lambda. .. code-block:: LAMMPS - kim_init SW_ZhouWardMartin_2013_CdTeZnSeHgS__MO_503261197030_002 metal + kim init SW_ZhouWardMartin_2013_CdTeZnSeHgS__MO_503261197030_002 metal ... - kim_param get lambda 15:17 LAM split + kim param get lambda 15:17 LAM split -In this case, the "split" mode of *formatarg* is used. -The three values retrieved by the *get* operation are stored in -the three LAMMPS variables *LAM_15*, *LAM_16* and *LAM_17*\ . -The provided name "LAM" is used as prefix and the location in -the lambda array is appended to create the variable names. +In this case, the "split" mode of *formatarg* is used. The three values +retrieved by the *get* operation are stored in the three LAMMPS variables +*LAM_15*, *LAM_16* and *LAM_17*\ . The provided name "LAM" is used as prefix and +the location in the lambda array is appended to create the variable names. **Setting a scalar parameter** .. code-block:: LAMMPS - kim_init SW_StillingerWeber_1985_Si__MO_405512056662_005 metal + kim init SW_StillingerWeber_1985_Si__MO_405512056662_005 metal ... - kim_interactions Si - kim_param set gamma 1 2.6 + kim interactions Si + kim param set gamma 1 2.6 Here, the SW potential's gamma parameter is set to 2.6. Note that the *get* -and *set* commands work together, so that a *get* following a *set* -operation will return the new value that was set. For example: +and *set* commands work together, so that a *get* following a *set* operation +will return the new value that was set. For example, .. code-block:: LAMMPS ... - kim_interactions Si - kim_param get gamma 1 ORIG_GAMMA - kim_param set gamma 1 2.6 - kim_param get gamma 1 NEW_GAMMA + kim interactions Si + kim param get gamma 1 ORIG_GAMMA + kim param set gamma 1 2.6 + kim param get gamma 1 NEW_GAMMA ... - print "original gamma = ${ORIG_GAMMA}, new gamma = ${NEW_GAMMA}" + print "original gamma = ${ORIG_GAMMA}, new gamma = ${NEW_GAMMA}" -Here, *ORIG_GAMMA* will contain the original gamma value for the SW -potential, while *NEW_GAMMA* will contain the value 2.6. +Here, *ORIG_GAMMA* will contain the original gamma value for the SW potential, +while *NEW_GAMMA* will contain the value 2.6. **Setting multiple scalar parameters with a single call** .. code-block:: LAMMPS - kim_init SW_ZhouWardMartin_2013_CdTeZnSeHgS__MO_503261197030_002 metal + kim init SW_ZhouWardMartin_2013_CdTeZnSeHgS__MO_503261197030_002 metal ... - kim_interactions Cd Te - variable VARG equal 2.6 - variable VARS equal 2.0951 - kim_param set gamma 1 ${VARG} sigma 3 ${VARS} + kim interactions Cd Te + variable VARG equal 2.6 + variable VARS equal 2.0951 + kim param set gamma 1 ${VARG} sigma 3 ${VARS} -In this case, the first element of the *gamma* parameter and -third element of the *sigma* parameter are set to 2.6 and 2.0951, -respectively. This example also shows how LAMMPS variables can -be used when setting parameters. +In this case, the first element of the *gamma* parameter and third element of +the *sigma* parameter are set to 2.6 and 2.0951, respectively. This example +also shows how LAMMPS variables can be used when setting parameters. **Setting a range of values of a parameter** .. code-block:: LAMMPS - kim_init SW_ZhouWardMartin_2013_CdTeZnSeHgS__MO_503261197030_002 metal + kim init SW_ZhouWardMartin_2013_CdTeZnSeHgS__MO_503261197030_002 metal ... - kim_interactions Cd Te Zn Se Hg S - kim_param set sigma 2:6 2.35214 2.23869 2.04516 2.43269 1.80415 + kim interactions Cd Te Zn Se Hg S + kim param set sigma 2:6 2.35214 2.23869 2.04516 2.43269 1.80415 -In this case, elements 2 through 6 of the parameter *sigma* -are set to the values 2.35214, 2.23869, 2.04516, 2.43269 and 1.80415 in -order. +In this case, elements 2 through 6 of the parameter *sigma* are set to the +values 2.35214, 2.23869, 2.04516, 2.43269 and 1.80415 in order. -.. _kim_property command: +.. _property: -Writing material properties computed in LAMMPS to standard KIM property instance format (*kim_property*) +Writing material properties computed in LAMMPS to standard KIM property instance format (*kim property*) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -As explained :ref:`above`, -The OpenKIM system includes a collection of Tests (material property calculation codes), -Models (interatomic potentials), Predictions, and Reference Data (DFT or experiments). -Specifically, a KIM Test is a computation that when coupled with a KIM Model generates -the prediction of that model for a specific material property rigorously defined -by a KIM Property Definition (see the +As explained :ref:`above`, the OpenKIM system includes a +collection of Tests (material property calculation codes), Models (interatomic +potentials), Predictions, and Reference Data (DFT or experiments). Specifically, +a KIM Test is a computation that when coupled with a KIM Model generates the +prediction of that model for a specific material property rigorously defined by +a KIM Property Definition (see the `KIM Properties Framework `__ -for further details). A prediction of a material property for a given model is a specific -numerical realization of a property definition, referred to as a "Property -Instance." The objective of the *kim_property* command is to make it easy to -output material properties in a standardized, machine readable, format that can be easily -ingested by other programs. -Additionally, it aims to make it as easy as possible to convert a LAMMPS script that computes a -material property into a KIM Test that can then be uploaded to `openkim.org `_ +for further details). A prediction of a material property for a given model is a +specific numerical realization of a property definition, referred to as a +"Property Instance." The objective of the *kim property* command is to make it +easy to output material properties in a standardized, machine readable, format +that can be easily ingested by other programs. Additionally, it aims to make it +as easy as possible to convert a LAMMPS script that computes a material property +into a KIM Test that can then be uploaded to +`openkim.org `_ -A developer interested in creating a KIM Test using a LAMMPS script should -first determine whether a property definition that applies to their calculation +A developer interested in creating a KIM Test using a LAMMPS script should first +determine whether a property definition that applies to their calculation already exists in OpenKIM by searching the `properties page `_. If none exists, it is possible to use a locally defined property definition contained in a file until it can be uploaded to the official repository (see below). Once one or more applicable -property definitions have been identified, the *kim_property create*, -*kim_property modify*, *kim_property remove*, and *kim_property destroy*, +property definitions have been identified, the *kim property create*, +*kim property modify*, *kim property remove*, and *kim property destroy*, commands provide an interface to create, set, modify, remove, and destroy -instances of them within a LAMMPS script. Their general syntax is as follows: +instances of them within a LAMMPS script. Their general syntax is as follows, .. code-block:: LAMMPS - kim_property create instance_id property_id - kim_property modify instance_id key key_name key_name_key key_name_value - kim_property remove instance_id key key_name - kim_property destroy instance_id - kim_property dump file + kim property create instance_id property_id + kim property modify instance_id key key_name key_name_key key_name_value + kim property remove instance_id key key_name + kim property destroy instance_id + kim property dump file Here, *instance_id* is a positive integer used to uniquely identify each property instance; (note that the results file can contain multiple property -instances). A property_id is an identifier of a +instances). A *property_id* is an identifier of a `KIM Property Definition `_, which can be (1) a property short name, (2) the full unique ID of the property (including the contributor and date), (3) a file name corresponding to a local -property definition file. Examples of each of these cases are shown below: +property definition file. Examples of each of these cases are shown below, .. code-block:: LAMMPS - kim_property create 1 atomic-mass - kim_property create 2 cohesive-energy-relation-cubic-crystal + kim property create 1 atomic-mass + kim property create 2 cohesive-energy-relation-cubic-crystal .. code-block:: LAMMPS - kim_property create 1 tag:brunnels@noreply.openkim.org,2016-05-11:property/atomic-mass - kim_property create 2 tag:staff@noreply.openkim.org,2014-04-15:property/cohesive-energy-relation-cubic-crystal + kim property create 1 tag:brunnels@noreply.openkim.org,2016-05-11:property/atomic-mass + kim property create 2 tag:staff@noreply.openkim.org,2014-04-15:property/cohesive-energy-relation-cubic-crystal .. code-block:: LAMMPS - kim_property create 1 new-property.edn - kim_property create 2 /home/mary/marys-kim-properties/dissociation-energy.edn + kim property create 1 new-property.edn + kim property create 2 /home/mary/marys-kim-properties/dissociation-energy.edn -In the last example, "new-property.edn" and "/home/mary/marys-kim-properties/dissociation-energy.edn" are the -names of files that contain user-defined (local) property definitions. +In the last example, "new-property.edn" and +"/home/mary/marys-kim-properties/dissociation-energy.edn" are the names of files +that contain user-defined (local) property definitions. A KIM property instance takes the form of a "map," i.e. a set of key-value pairs akin to Perl's hash, Python's dictionary, or Java's Hashtable. It @@ -944,13 +1034,13 @@ as stipulated in the property definition. Each map assigned to a *key_name* must contain the *key_name_key* "source-value" and an associated *key_name_value* of the appropriate type (as defined in the relevant KIM Property Definition). For keys that are - defined as having physical units, the - "source-unit" *key_name_key* must also be given a string value recognized - by `GNU units `_. + defined as having physical units, the "source-unit" *key_name_key* must also + be given a string value recognized by + `GNU units `_. -Once a *kim_property create* command has been given to instantiate a property +Once a *kim property create* command has been given to instantiate a property instance, maps associated with the property's keys can be edited using the -*kim_property modify* command. In using this command, the special keyword +*kim property modify* command. In using this command, the special keyword "key" should be given, followed by the property key name and the key-value pair in the map associated with the key that is to be set. For example, the `atomic-mass `_ @@ -959,37 +1049,37 @@ An instance of this property could be created like so: .. code-block:: LAMMPS - kim_property create 1 atomic-mass - kim_property modify 1 key species source-value Al - kim_property modify 1 key mass source-value 26.98154 - kim_property modify 1 key mass source-unit amu + kim property create 1 atomic-mass + kim property modify 1 key species source-value Al + kim property modify 1 key mass source-value 26.98154 + kim property modify 1 key mass source-unit amu or, equivalently, .. code-block:: LAMMPS - kim_property create 1 atomic-mass - kim_property modify 1 key species source-value Al & + kim property create 1 atomic-mass + kim property modify 1 key species source-value Al & key mass source-value 26.98154 & source-unit amu -*kim_property* Usage Examples and Further Clarifications +*kim property* Usage Examples and Further Clarifications ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ **Create** .. code-block:: LAMMPS - kim_property create instance_id property_id + kim property create instance_id property_id -The *kim_property create* command takes as input a property instance ID and the +The *kim property create* command takes as input a property instance ID and the property definition name, and creates an initial empty property instance data structure. For example, .. code-block:: LAMMPS - kim_property create 1 atomic-mass - kim_property create 2 cohesive-energy-relation-cubic-crystal + kim property create 1 atomic-mass + kim property create 2 cohesive-energy-relation-cubic-crystal creates an empty property instance of the "atomic-mass" property definition with instance ID 1 and an empty instance of the @@ -1002,32 +1092,32 @@ path of a file containing a valid property definition. For example, .. code-block:: LAMMPS - kim_property create 1 new-property.edn + kim property create 1 new-property.edn where "new-property.edn" refers to a file name containing a new property definition that does not exist in OpenKIM. If the *property_id* given cannot be found in OpenKIM and no file of this name containing a valid property definition can be found, this command will produce -an error with an appropriate message. Calling *kim_property create* with the +an error with an appropriate message. Calling *kim property create* with the same instance ID multiple times will also produce an error. **Modify** .. code-block:: LAMMPS - kim_property modify instance_id key key_name key_name_key key_name_value + kim property modify instance_id key key_name key_name_key key_name_value -The *kim_property modify* command incrementally builds the property instance -by receiving property definition keys along with associated arguments. Each +The *kim property modify* command incrementally builds the property instance +by receiving property definition keys along with associated arguments. Each *key_name* is associated with a map containing one or more key-value pairs (in the form of *key_name_key*-*key_name_value* pairs). For example, .. code-block:: LAMMPS - kim_property modify 1 key species source-value Al - kim_property modify 1 key mass source-value 26.98154 - kim_property modify 1 key mass source-unit amu + kim property modify 1 key species source-value Al + kim property modify 1 key mass source-value 26.98154 + kim property modify 1 key mass source-unit amu where the special keyword "key" is followed by a *key_name* ("species" or "mass" in the above) and one or more key-value pairs. These key-value pairs @@ -1036,7 +1126,7 @@ command line is reached. Thus, the above could equivalently be written as .. code-block:: LAMMPS - kim_property modify 1 key species source-value Al & + kim property modify 1 key species source-value Al & key mass source-value 26.98154 & key mass source-unit amu @@ -1044,19 +1134,18 @@ As an example of modifying multiple key-value pairs belonging to the map of a single property key, the following command modifies the map of the "cohesive-potential-energy" property key to contain the key "source-unit" which is assigned a value of "eV" and the key "digits" which is assigned a value of -5: +5, .. code-block:: LAMMPS - kim_property modify 2 key cohesive-potential-energy source-unit eV digits 5 + kim property modify 2 key cohesive-potential-energy source-unit eV digits 5 .. note:: - The relevant data types of the values in the map are handled - automatically based on the specification of the key in the - KIM Property Definition. In the example above, - this means that the value "eV" will automatically be interpreted as a string - while the value 5 will be interpreted as an integer. + The relevant data types of the values in the map are handled automatically + based on the specification of the key in the KIM Property Definition. In + the example above, this means that the value "eV" will automatically be + interpreted as a string while the value 5 will be interpreted as an integer. The values contained in maps can either be scalars, as in all of the examples above, or arrays depending on which is stipulated in the corresponding Property @@ -1067,7 +1156,7 @@ dimensionality of the array. .. note:: - All array indexing used by *kim_property modify* is one-based, i.e. the + All array indexing used by *kim property modify* is one-based, i.e. the indices are enumerated 1, 2, 3, ... .. note:: @@ -1088,20 +1177,20 @@ of the "species" property key, we can do so by issuing: .. code-block:: LAMMPS - kim_property modify 2 key species source-value 1 Al - kim_property modify 2 key species source-value 2 Al - kim_property modify 2 key species source-value 3 Al - kim_property modify 2 key species source-value 4 Al + kim property modify 2 key species source-value 1 Al + kim property modify 2 key species source-value 2 Al + kim property modify 2 key species source-value 3 Al + kim property modify 2 key species source-value 4 Al .. note:: No declaration of the number of elements in this array was given; - *kim_property modify* will automatically handle memory management to allow + *kim property modify* will automatically handle memory management to allow an arbitrary number of elements to be added to the array. .. note:: - In the event that *kim_property modify* is used to set the value of an + In the event that *kim property modify* is used to set the value of an array index without having set the values of all lesser indices, they will be assigned default values based on the data type associated with the key in the map: @@ -1124,8 +1213,8 @@ of the "species" property key, we can do so by issuing: .. code-block:: LAMMPS - kim_property create 2 cohesive-energy-relation-cubic-crystal - kim_property modify 2 key species source-value 4 Al + kim property create 2 cohesive-energy-relation-cubic-crystal + kim property modify 2 key species source-value 4 Al will result in the "source-value" key in the map for the property key "species" being assigned the array ["", "", "", "Al"]. @@ -1137,12 +1226,12 @@ included). Thus, the snippet above could equivalently be written: .. code-block:: LAMMPS - kim_property modify 2 key species source-value 1:4 Al Al Al Al + kim property modify 2 key species source-value 1:4 Al Al Al Al Calling this command with a non-positive index, e.g. -``kim_property modify 2 key species source-value 0 Al``, or an incorrect +``kim property modify 2 key species source-value 0 Al``, or an incorrect number of input arguments, e.g. -``kim_property modify 2 key species source-value 1:4 Al Al``, will result in an +``kim property modify 2 key species source-value 1:4 Al Al``, will result in an error. As an example of modifying multidimensional arrays, consider the "basis-atoms" @@ -1165,36 +1254,36 @@ each row at a time using colon notation: .. code-block:: LAMMPS - kim_property modify 2 key basis-atom-coordinates source-value 1 1:3 0.0 0.0 0.0 - kim_property modify 2 key basis-atom-coordinates source-value 2 1:3 0.5 0.5 0.0 - kim_property modify 2 key basis-atom-coordinates source-value 3 1:3 0.5 0.0 0.5 - kim_property modify 2 key basis-atom-coordinates source-value 4 1:3 0.0 0.5 0.5 + kim property modify 2 key basis-atom-coordinates source-value 1 1:3 0.0 0.0 0.0 + kim property modify 2 key basis-atom-coordinates source-value 2 1:3 0.5 0.5 0.0 + kim property modify 2 key basis-atom-coordinates source-value 3 1:3 0.5 0.0 0.5 + kim property modify 2 key basis-atom-coordinates source-value 4 1:3 0.0 0.5 0.5 Where the first index given refers to a row and the second index refers to a column. We could, instead, choose to set each column at a time like so: .. code-block:: LAMMPS - kim_property modify 2 key basis-atom-coordinates source-value 1:4 1 0.0 0.5 0.5 0.0 & + kim property modify 2 key basis-atom-coordinates source-value 1:4 1 0.0 0.5 0.5 0.0 & key basis-atom-coordinates source-value 1:4 2 0.0 0.5 0.0 0.5 & key basis-atom-coordinates source-value 1:4 3 0.0 0.0 0.5 0.5 .. note:: - Multiple calls of *kim_property modify* made for the same instance ID + Multiple calls of *kim property modify* made for the same instance ID can be combined into a single invocation, meaning the following are both valid: .. code-block:: LAMMPS - kim_property modify 2 key basis-atom-coordinates source-value 1 1:3 0.0 0.0 0.0 & + kim property modify 2 key basis-atom-coordinates source-value 1 1:3 0.0 0.0 0.0 & key basis-atom-coordinates source-value 2 1:3 0.5 0.5 0.0 & key basis-atom-coordinates source-value 3 1:3 0.5 0.0 0.5 & key basis-atom-coordinates source-value 4 1:3 0.0 0.5 0.5 .. code-block:: LAMMPS - kim_property modify 2 key short-name source-value 1 fcc & + kim property modify 2 key short-name source-value 1 fcc & key species source-value 1:4 Al Al Al Al & key a source-value 1:5 3.9149 4.0000 4.032 4.0817 4.1602 & source-unit angstrom & @@ -1211,46 +1300,46 @@ column. We could, instead, choose to set each column at a time like so: .. code-block:: LAMMPS - kim_property modify 2 key basis-atom-coordinates 1 1:3 0.0 0.0 0.0 + kim property modify 2 key basis-atom-coordinates 1 1:3 0.0 0.0 0.0 is valid but .. code-block:: LAMMPS - kim_property modify 2 key basis-atom-coordinates 1:2 1:3 0.0 0.0 0.0 0.0 0.0 0.0 + kim property modify 2 key basis-atom-coordinates 1:2 1:3 0.0 0.0 0.0 0.0 0.0 0.0 is not. .. note:: - After one sets a value in a map with the *kim_property modify* command, + After one sets a value in a map with the *kim property modify* command, additional calls will overwrite the previous value. **Remove** .. code-block:: LAMMPS - kim_property remove instance_id key key_name + kim property remove instance_id key key_name -The *kim_property remove* command can be used to remove a property key from a +The *kim property remove* command can be used to remove a property key from a property instance. For example, .. code-block:: LAMMPS - kim_property remove 2 key basis-atom-coordinates + kim property remove 2 key basis-atom-coordinates **Destroy** .. code-block:: LAMMPS - kim_property destroy instance_id + kim property destroy instance_id -The *kim_property destroy* command deletes a previously created property +The *kim property destroy* command deletes a previously created property instance ID. For example, .. code-block:: LAMMPS - kim_property destroy 2 + kim property destroy 2 .. note:: @@ -1259,22 +1348,22 @@ instance ID. For example, **Dump** -The *kim_property dump* command can be used to write the content of all +The *kim property dump* command can be used to write the content of all currently defined property instances to a file: .. code-block:: LAMMPS - kim_property dump file + kim property dump file For example, .. code-block:: LAMMPS - kim_property dump results.edn + kim property dump results.edn .. note:: - Issuing the *kim_property dump* command clears all existing property + Issuing the *kim property dump* command clears all existing property instances from memory. Citation of OpenKIM IMs @@ -1283,32 +1372,32 @@ Citation of OpenKIM IMs When publishing results obtained using OpenKIM IMs researchers are requested to cite the OpenKIM project :ref:`(Tadmor) `, KIM API :ref:`(Elliott) `, and the specific IM codes used in the simulations, -in addition to the relevant scientific references for the IM. -The citation format for an IM is displayed on its page on -`OpenKIM `_ along with the corresponding BibTex file, -and is automatically added to the LAMMPS citation reminder. +in addition to the relevant scientific references for the IM. The citation +format for an IM is displayed on its page on +`OpenKIM `_ along with the corresponding BibTex file, and +is automatically added to the LAMMPS citation reminder. -Citing the IM software (KIM infrastructure and specific PM or SM codes) -used in the simulation gives credit to the researchers who developed them -and enables open source efforts like OpenKIM to function. +Citing the IM software (KIM infrastructure and specific PM or SM codes) used in +the simulation gives credit to the researchers who developed them and enables +open source efforts like OpenKIM to function. Restrictions """""""""""" -The set of *kim_commands* is part of the KIM package. It is only enabled if -LAMMPS is built with that package. A requirement for the KIM package, -is the KIM API library that must be downloaded from the -`OpenKIM website `_ and installed before -LAMMPS is compiled. When installing LAMMPS from binary, the kim-api package -is a dependency that is automatically downloaded and installed. The *kim_query* -command requires the *libcurl* library to be installed. The *kim_property* +The *kim* command is part of the KIM package. It is only enabled if LAMMPS is +built with that package. A requirement for the KIM package, is the KIM API +library that must be downloaded from the +`OpenKIM website `_ and installed before LAMMPS is +compiled. When installing LAMMPS from binary, the kim-api package is a +dependency that is automatically downloaded and installed. The *kim query* +command requires the *libcurl* library to be installed. The *kim property* command requires *Python* 3.6 or later and the *kim-property* python package to -be installed. See the KIM section of the :doc:`Packages details ` -for details. +be installed. See the KIM section of the +:doc:`Packages details ` for details. -Furthermore, when using *kim_commands* to run KIM SMs, any packages required -by the native potential being used or other commands or fixes that it invokes -must be installed. +Furthermore, when using *kim* command to run KIM SMs, any packages required by +the native potential being used or other commands or fixes that it invokes must +be installed. Related commands """""""""""""""" From 4cd42093a02fcb55ac61c6b5149a744acdd09d0e Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Tue, 16 Feb 2021 16:47:12 -0600 Subject: [PATCH 303/384] fixed the correct models for extra tests and update the command interface --- doc/src/Build_extras.rst | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index 8f1154a167..60d5ad09af 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -258,18 +258,18 @@ To build with this package, the KIM library with API v2 must be downloaded and built on your system. It must include the KIM models that you want to use with LAMMPS. -If you would like to use the :doc:`kim_query ` +If you would like to use the :doc:`kim query ` command, you also need to have libcurl installed with the matching development headers and the curl-config tool. -If you would like to use the :doc:`kim_property ` +If you would like to use the :doc:`kim property ` command, you need to build LAMMPS with the PYTHON package installed and linked to Python 3.6 or later. See the :ref:`PYTHON package build info ` for more details on this. After successfully building LAMMPS with Python, you -also need to install the kim-property Python package, which can be easily done using -*pip* as ``pip install kim-property``, or from the *conda-forge* channel as -``conda install kim-property`` if LAMMPS is built in Conda. More detailed -information is available at: +also need to install the ``kim-property`` Python package, which can be easily +done using *pip* as ``pip install kim-property``, or from the *conda-forge* +channel as ``conda install kim-property`` if LAMMPS is built in Conda. More +detailed information is available at: `kim-property installation `_. In addition to installing the KIM API, it is also necessary to install the @@ -309,7 +309,7 @@ minutes to hours) to build. Of course you only need to do that once.) You can download and build the KIM library manually if you prefer; follow the instructions in ``lib/kim/README``. You can also do - this in one step from the lammps/src dir, using a command like + this in one step from the lammps/src directory, using a command like these, which simply invoke the ``lib/kim/Install.py`` script with the specified args. @@ -329,7 +329,7 @@ minutes to hours) to build. Of course you only need to do that once.) .. code-block:: make - LMP_INC = -DLMP_NO_SSL_CHECK + LMP_INC = -DLMP_NO_SSL_CHECK Debugging OpenKIM web queries in LAMMPS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -377,10 +377,11 @@ Enabling the extra unit tests have some requirements, Conda. More detailed information is available at: `kim-property installation `_. * It is also necessary to install - ``EAM_Dynamo_Mendelev_2007_Zr__MO_848899341753_000``, and - ``EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005`` KIM models. + ``EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000``, + ``EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005``, and + ``LennardJones612_UniversalShifted__MO_959249795837_003`` KIM models. See `Obtaining KIM Models `_ - to learn how to install a pre-build binary of the OpenKIM Repository of + to learn how to install a pre-built binary of the OpenKIM Repository of Models or see `Installing KIM Models `_ to learn how to install the specific KIM models. From 0e465516325de08ffc6cca430ca4c294e94b36aa Mon Sep 17 00:00:00 2001 From: Yaser Afshar Date: Tue, 16 Feb 2021 16:47:57 -0600 Subject: [PATCH 304/384] Remove the old command interface and update the kim command as the only one --- doc/src/Commands_all.rst | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/doc/src/Commands_all.rst b/doc/src/Commands_all.rst index a38bd5f0db..132425948e 100644 --- a/doc/src/Commands_all.rst +++ b/doc/src/Commands_all.rst @@ -60,11 +60,7 @@ An alphabetic list of all general LAMMPS commands. * :doc:`include ` * :doc:`info ` * :doc:`jump ` - * :doc:`kim_init ` - * :doc:`kim_interactions ` - * :doc:`kim_param ` - * :doc:`kim_property ` - * :doc:`kim_query ` + * :doc:`kim ` * :doc:`kspace_modify ` * :doc:`kspace_style ` * :doc:`label