From 5582dbc3d360fa66102c2569eaa9f013a90f0207 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 8 Oct 2022 10:33:08 -0400 Subject: [PATCH] handle the case of using -pk pair/only on --- src/input.cpp | 2 +- src/lammps.cpp | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index 09e5d6decb..399405942e 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -831,7 +831,7 @@ int Input::execute_command() // try suffixed version first std::string mycmd = command; - if (lmp->suffix_enable) { + if (lmp->suffix_enable && lmp->suffix) { mycmd = command + std::string("/") + lmp->suffix; if (command_map->find(mycmd) == command_map->end()) { if (lmp->suffix2) { diff --git a/src/lammps.cpp b/src/lammps.cpp index 57d121d938..83f00ecefd 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -860,7 +860,7 @@ void LAMMPS::post_create() if (skiprunflag) input->one("timer timeout 0 every 1"); // Don't unnecessarily reissue a package command via suffix - int package_issued = 0; + int package_issued = Suffix::NONE; // default package command triggered by "-k on" @@ -886,27 +886,30 @@ void LAMMPS::post_create() } } - // suffix will always be set if suffix_enable = 1 + // either suffix or suffixp will be set if suffix_enable = 1 // check that KOKKOS package classes were instantiated // check that GPU, INTEL, OPENMP fixes were compiled with LAMMPS + // do not re-issue package command if already issued if (suffix_enable) { + const char *mysuffix = suffix; + if (suffixp) mysuffix = suffixp; - if (strcmp(suffix,"gpu") == 0 && !modify->check_package("GPU")) + if (strcmp(mysuffix,"gpu") == 0 && !modify->check_package("GPU")) error->all(FLERR,"Using suffix gpu without GPU package installed"); - if (strcmp(suffix,"intel") == 0 && !modify->check_package("INTEL")) + if (strcmp(mysuffix,"intel") == 0 && !modify->check_package("INTEL")) error->all(FLERR,"Using suffix intel without INTEL package installed"); - if (strcmp(suffix,"kk") == 0 && + if (strcmp(mysuffix,"kk") == 0 && (kokkos == nullptr || kokkos->kokkos_exists == 0)) error->all(FLERR,"Using suffix kk without KOKKOS package enabled"); - if (strcmp(suffix,"omp") == 0 && !modify->check_package("OMP")) + if (strcmp(mysuffix,"omp") == 0 && !modify->check_package("OMP")) error->all(FLERR,"Using suffix omp without OPENMP package installed"); - if (strcmp(suffix,"gpu") == 0 && !(package_issued & Suffix::GPU)) + if (strcmp(mysuffix,"gpu") == 0 && !(package_issued & Suffix::GPU)) input->one("package gpu 0"); - if (strcmp(suffix,"intel") == 0 && !(package_issued & Suffix::INTEL)) + if (strcmp(mysuffix,"intel") == 0 && !(package_issued & Suffix::INTEL)) input->one("package intel 1"); - if (strcmp(suffix,"omp") == 0 && !(package_issued & Suffix::OMP)) + if (strcmp(mysuffix,"omp") == 0 && !(package_issued & Suffix::OMP)) input->one("package omp 0"); if (suffix2) { @@ -1217,7 +1220,6 @@ void _noopt LAMMPS::help() "-var varname value : set index style variable (-v)\n\n", exename); - print_config(fp); fprintf(fp,"List of individual style options included in this LAMMPS executable\n\n");