From 3d3dc2fdab1d8ddce91d3c8ab0a9fa5c72af7a96 Mon Sep 17 00:00:00 2001 From: Berk Hess Date: Thu, 12 Sep 2019 09:56:27 +0200 Subject: [PATCH] Remove obsolete mdp option ns-type Also removed unused member ndelta from t_inputrec. Change-Id: Idde132176582001bdffafa6fa64af2eed9d0c242 --- docs/user-guide/mdp-options.rst | 15 ---------- src/gromacs/domdec/domdec.cpp | 5 ---- src/gromacs/fileio/tpxio.cpp | 2 +- src/gromacs/gmxpreprocess/grompp.cpp | 9 +----- src/gromacs/gmxpreprocess/readir.cpp | 28 +++---------------- ...arametersWithValuesIncludingAssignment.xml | 2 -- .../GetIrTest_AcceptsElectricField.xml | 2 -- ...IrTest_AcceptsElectricFieldOscillating.xml | 2 -- .../GetIrTest_AcceptsElectricFieldPulsed.xml | 2 -- .../refdata/GetIrTest_AcceptsEmptyLines.xml | 2 -- .../GetIrTest_AcceptsImplicitSolventNo.xml | 2 -- .../GetIrTest_AcceptsKeyWithoutValue.xml | 2 -- .../tests/refdata/GetIrTest_AcceptsMimic.xml | 2 -- ...IrTest_HandlesDifferentKindsOfMdpLines.xml | 2 -- .../GetIrTest_HandlesOnlyCutoffScheme.xml | 2 -- src/gromacs/mdlib/forcerec.cpp | 1 - src/gromacs/mdtypes/forcerec.h | 1 - src/gromacs/mdtypes/inputrec.cpp | 2 -- src/gromacs/mdtypes/inputrec.h | 4 --- src/gromacs/mdtypes/md_enums.cpp | 5 ---- src/gromacs/mdtypes/md_enums.h | 9 ------ 21 files changed, 6 insertions(+), 95 deletions(-) diff --git a/docs/user-guide/mdp-options.rst b/docs/user-guide/mdp-options.rst index a5af05ee0c..cf5530e518 100644 --- a/docs/user-guide/mdp-options.rst +++ b/docs/user-guide/mdp-options.rst @@ -460,21 +460,6 @@ Neighbor searching Unused. -.. mdp:: ns-type - - .. mdp-value:: grid - - Make a grid in the box and only check atoms in neighboring grid - cells when constructing a new neighbor list every - :mdp:`nstlist` steps. In large systems grid search is much - faster than simple search. - - .. mdp-value:: simple - - Check every atom in the box when constructing a new neighbor - list every :mdp:`nstlist` steps (only with :mdp-value:`cutoff-scheme=group` - cut-off scheme). - .. mdp:: pbc .. mdp-value:: xyz diff --git a/src/gromacs/domdec/domdec.cpp b/src/gromacs/domdec/domdec.cpp index f02b37a39c..bffa2ffb44 100644 --- a/src/gromacs/domdec/domdec.cpp +++ b/src/gromacs/domdec/domdec.cpp @@ -1867,11 +1867,6 @@ static void check_dd_restrictions(const gmx_domdec_t *dd, gmx_fatal(FARGS, "With pbc=%s can only do domain decomposition in the x-direction", epbc_names[ir->ePBC]); } - if (ir->ns_type == ensSIMPLE) - { - gmx_fatal(FARGS, "Domain decomposition does not support simple neighbor searching, use grid searching or run with one MPI rank"); - } - if (ir->nstlist == 0) { gmx_fatal(FARGS, "Domain decomposition does not work with nstlist=0"); diff --git a/src/gromacs/fileio/tpxio.cpp b/src/gromacs/fileio/tpxio.cpp index 300f56ba67..67a1284714 100644 --- a/src/gromacs/fileio/tpxio.cpp +++ b/src/gromacs/fileio/tpxio.cpp @@ -1104,7 +1104,7 @@ static void do_inputrec(gmx::ISerializer *serializer, { ir->cutoff_scheme = ecutsGROUP; } - serializer->doInt(&ir->ns_type); + serializer->doInt(&idum); /* used to be ns_type; not used anymore */ serializer->doInt(&ir->nstlist); serializer->doInt(&idum); /* used to be ndelta; not used anymore */ diff --git a/src/gromacs/gmxpreprocess/grompp.cpp b/src/gromacs/gmxpreprocess/grompp.cpp index bd32aca846..ffdc4da528 100644 --- a/src/gromacs/gmxpreprocess/grompp.cpp +++ b/src/gromacs/gmxpreprocess/grompp.cpp @@ -2248,14 +2248,7 @@ int gmx_grompp(int argc, char *argv[]) /* make exclusions between QM atoms and remove charges if needed */ if (ir->bQMMM) { - if (ir->QMMMscheme == eQMMMschemenormal && ir->ns_type == ensSIMPLE) - { - gmx_fatal(FARGS, "electrostatic embedding only works with grid neighboursearching, use ns-type=grid instead\n"); - } - else - { - generate_qmexcl(&sys, ir, wi, GmxQmmmMode::GMX_QMMM_ORIGINAL); - } + generate_qmexcl(&sys, ir, wi, GmxQmmmMode::GMX_QMMM_ORIGINAL); if (ir->QMMMscheme != eQMMMschemeoniom) { std::vector qmmmAtoms = qmmmAtomIndices(*ir, sys); diff --git a/src/gromacs/gmxpreprocess/readir.cpp b/src/gromacs/gmxpreprocess/readir.cpp index c0623751e8..f64b4cec51 100644 --- a/src/gromacs/gmxpreprocess/readir.cpp +++ b/src/gromacs/gmxpreprocess/readir.cpp @@ -546,8 +546,6 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts, { sprintf(err_buf, "TPI only works with pbc = %s", epbc_names[epbcXYZ]); CHECK(ir->ePBC != epbcXYZ); - sprintf(err_buf, "TPI only works with ns = %s", ens_names[ensGRID]); - CHECK(ir->ns_type != ensGRID); sprintf(err_buf, "with TPI nstlist should be larger than zero"); CHECK(ir->nstlist <= 0); sprintf(err_buf, "TPI does not work with full electrostatics other than PME"); @@ -1757,6 +1755,7 @@ void get_ir(const char *mdparin, const char *mdparout, replace_inp_entry(inp, "gb-dielectric-offset", nullptr); replace_inp_entry(inp, "sa-algorithm", nullptr); replace_inp_entry(inp, "sa-surface-tension", nullptr); + replace_inp_entry(inp, "ns-type", nullptr); /* replace the following commands with the clearer new versions*/ replace_inp_entry(inp, "unconstrained-start", "continuation"); @@ -1838,8 +1837,6 @@ void get_ir(const char *mdparin, const char *mdparout, ir->cutoff_scheme = get_eeenum(&inp, "cutoff-scheme", ecutscheme_names, wi); printStringNoNewline(&inp, "nblist update frequency"); ir->nstlist = get_eint(&inp, "nstlist", 10, wi); - printStringNoNewline(&inp, "ns algorithm (simple or grid)"); - ir->ns_type = get_eeenum(&inp, "ns-type", ens_names, wi); printStringNoNewline(&inp, "Periodic boundary conditions: xyz, no, xy"); ir->ePBC = get_eeenum(&inp, "pbc", epbc_names, wi); ir->bPeriodicMols = get_eeenum(&inp, "periodic-molecules", yesno_names, wi) != 0; @@ -4163,7 +4160,6 @@ void double_check(t_inputrec *ir, matrix box, bool bHasAnyConstraints, warninp_t wi) { - real min_size; char warn_buf[STRLEN]; const char *ptr; @@ -4222,26 +4218,10 @@ void double_check(t_inputrec *ir, matrix box, { warning(wi, "With nstlist=0 atoms are only put into the box at step 0, therefore drifting atoms might cause the simulation to crash."); } - if (ir->ns_type == ensGRID) + if (gmx::square(ir->rlist) >= max_cutoff2(ir->ePBC, box)) { - if (gmx::square(ir->rlist) >= max_cutoff2(ir->ePBC, box)) - { - sprintf(warn_buf, "ERROR: The cut-off length is longer than half the shortest box vector or longer than the smallest box diagonal element. Increase the box size or decrease rlist.\n"); - warning_error(wi, warn_buf); - } - } - else - { - min_size = std::min(box[XX][XX], std::min(box[YY][YY], box[ZZ][ZZ])); - if (2*ir->rlist >= min_size) - { - sprintf(warn_buf, "ERROR: One of the box lengths is smaller than twice the cut-off length. Increase the box size or decrease rlist."); - warning_error(wi, warn_buf); - if (TRICLINIC(box)) - { - fprintf(stderr, "Grid search might allow larger cut-off's than simple search with triclinic boxes."); - } - } + sprintf(warn_buf, "ERROR: The cut-off length is longer than half the shortest box vector or longer than the smallest box diagonal element. Increase the box size or decrease rlist.\n"); + warning_error(wi, warn_buf); } } } diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsDefineParametersWithValuesIncludingAssignment.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsDefineParametersWithValuesIncludingAssignment.xml index 2f245eeb27..e608872e36 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsDefineParametersWithValuesIncludingAssignment.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsDefineParametersWithValuesIncludingAssignment.xml @@ -71,8 +71,6 @@ energygrps = cutoff-scheme = Verlet ; nblist update frequency nstlist = 10 -; ns algorithm (simple or grid) -ns-type = Grid ; Periodic boundary conditions: xyz, no, xy pbc = xyz periodic-molecules = no diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricField.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricField.xml index 5ed81b24e6..37314f84e0 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricField.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricField.xml @@ -71,8 +71,6 @@ energygrps = cutoff-scheme = Verlet ; nblist update frequency nstlist = 10 -; ns algorithm (simple or grid) -ns-type = Grid ; Periodic boundary conditions: xyz, no, xy pbc = xyz periodic-molecules = no diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricFieldOscillating.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricFieldOscillating.xml index 44c58b763c..b5ccd4acb9 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricFieldOscillating.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricFieldOscillating.xml @@ -71,8 +71,6 @@ energygrps = cutoff-scheme = Verlet ; nblist update frequency nstlist = 10 -; ns algorithm (simple or grid) -ns-type = Grid ; Periodic boundary conditions: xyz, no, xy pbc = xyz periodic-molecules = no diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricFieldPulsed.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricFieldPulsed.xml index 87feffeb09..888e418e95 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricFieldPulsed.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricFieldPulsed.xml @@ -71,8 +71,6 @@ energygrps = cutoff-scheme = Verlet ; nblist update frequency nstlist = 10 -; ns algorithm (simple or grid) -ns-type = Grid ; Periodic boundary conditions: xyz, no, xy pbc = xyz periodic-molecules = no diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsEmptyLines.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsEmptyLines.xml index d1f17e2077..df57eff597 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsEmptyLines.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsEmptyLines.xml @@ -71,8 +71,6 @@ energygrps = cutoff-scheme = Verlet ; nblist update frequency nstlist = 10 -; ns algorithm (simple or grid) -ns-type = Grid ; Periodic boundary conditions: xyz, no, xy pbc = xyz periodic-molecules = no diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsImplicitSolventNo.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsImplicitSolventNo.xml index d1f17e2077..df57eff597 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsImplicitSolventNo.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsImplicitSolventNo.xml @@ -71,8 +71,6 @@ energygrps = cutoff-scheme = Verlet ; nblist update frequency nstlist = 10 -; ns algorithm (simple or grid) -ns-type = Grid ; Periodic boundary conditions: xyz, no, xy pbc = xyz periodic-molecules = no diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsKeyWithoutValue.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsKeyWithoutValue.xml index d1f17e2077..df57eff597 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsKeyWithoutValue.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsKeyWithoutValue.xml @@ -71,8 +71,6 @@ energygrps = cutoff-scheme = Verlet ; nblist update frequency nstlist = 10 -; ns algorithm (simple or grid) -ns-type = Grid ; Periodic boundary conditions: xyz, no, xy pbc = xyz periodic-molecules = no diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsMimic.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsMimic.xml index b4534cb0c6..8049ef3a2e 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsMimic.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsMimic.xml @@ -71,8 +71,6 @@ energygrps = cutoff-scheme = Verlet ; nblist update frequency nstlist = 10 -; ns algorithm (simple or grid) -ns-type = Grid ; Periodic boundary conditions: xyz, no, xy pbc = xyz periodic-molecules = no diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesDifferentKindsOfMdpLines.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesDifferentKindsOfMdpLines.xml index ad013492cb..bb7919de70 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesDifferentKindsOfMdpLines.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesDifferentKindsOfMdpLines.xml @@ -71,8 +71,6 @@ energygrps = cutoff-scheme = Verlet ; nblist update frequency nstlist = 10 -; ns algorithm (simple or grid) -ns-type = Grid ; Periodic boundary conditions: xyz, no, xy pbc = xyz periodic-molecules = no diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesOnlyCutoffScheme.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesOnlyCutoffScheme.xml index f232463605..676e87abc7 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesOnlyCutoffScheme.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesOnlyCutoffScheme.xml @@ -71,8 +71,6 @@ energygrps = cutoff-scheme = Group ; nblist update frequency nstlist = 10 -; ns algorithm (simple or grid) -ns-type = Grid ; Periodic boundary conditions: xyz, no, xy pbc = xyz periodic-molecules = no diff --git a/src/gromacs/mdlib/forcerec.cpp b/src/gromacs/mdlib/forcerec.cpp index 0b478cf110..070cfad104 100644 --- a/src/gromacs/mdlib/forcerec.cpp +++ b/src/gromacs/mdlib/forcerec.cpp @@ -1604,7 +1604,6 @@ void init_forcerec(FILE *fp, /* Neighbour searching stuff */ fr->cutoff_scheme = ir->cutoff_scheme; - fr->bGrid = (ir->ns_type == ensGRID); fr->ePBC = ir->ePBC; /* Determine if we will do PBC for distances in bonded interactions */ diff --git a/src/gromacs/mdtypes/forcerec.h b/src/gromacs/mdtypes/forcerec.h index 9849889571..78e826a490 100644 --- a/src/gromacs/mdtypes/forcerec.h +++ b/src/gromacs/mdtypes/forcerec.h @@ -191,7 +191,6 @@ struct t_forcerec { // NOLINT (clang-analyzer-optin.performance.Padding) * It can be set to esolNO to disable all water optimization */ int solvent_opt = 0; int nWatMol = 0; - gmx_bool bGrid = FALSE; gmx_bool bExcl_IntraCGAll_InterCGNone = FALSE; struct cginfo_mb_t *cginfo_mb = nullptr; std::vector cginfo; diff --git a/src/gromacs/mdtypes/inputrec.cpp b/src/gromacs/mdtypes/inputrec.cpp index 6ac3b63070..7445dfc4cc 100644 --- a/src/gromacs/mdtypes/inputrec.cpp +++ b/src/gromacs/mdtypes/inputrec.cpp @@ -879,7 +879,6 @@ void pr_inputrec(FILE *fp, int indent, const char *title, const t_inputrec *ir, /* Neighborsearching parameters */ PS("cutoff-scheme", ECUTSCHEME(ir->cutoff_scheme)); PI("nstlist", ir->nstlist); - PS("ns-type", ENS(ir->ns_type)); PS("pbc", epbc_names[ir->ePBC]); PS("periodic-molecules", EBOOL(ir->bPeriodicMols)); PR("verlet-buffer-tolerance", ir->verletbuf_tol); @@ -1273,7 +1272,6 @@ void cmp_inputrec(FILE *fp, const t_inputrec *ir1, const t_inputrec *ir2, real f cmp_int(fp, "inputrec->ePBC", -1, ir1->ePBC, ir2->ePBC); cmp_bool(fp, "inputrec->bPeriodicMols", -1, ir1->bPeriodicMols, ir2->bPeriodicMols); cmp_int(fp, "inputrec->cutoff_scheme", -1, ir1->cutoff_scheme, ir2->cutoff_scheme); - cmp_int(fp, "inputrec->ns_type", -1, ir1->ns_type, ir2->ns_type); cmp_int(fp, "inputrec->nstlist", -1, ir1->nstlist, ir2->nstlist); cmp_int(fp, "inputrec->nstcomm", -1, ir1->nstcomm, ir2->nstcomm); cmp_int(fp, "inputrec->comm_mode", -1, ir1->comm_mode, ir2->comm_mode); diff --git a/src/gromacs/mdtypes/inputrec.h b/src/gromacs/mdtypes/inputrec.h index dc24fc035b..6cff9d6df6 100644 --- a/src/gromacs/mdtypes/inputrec.h +++ b/src/gromacs/mdtypes/inputrec.h @@ -342,12 +342,8 @@ struct t_inputrec // NOLINT (clang-analyzer-optin.performance.Padding) int nstcalcenergy; //! Group or verlet cutoffs int cutoff_scheme; - //! Which neighbor search method should we use? - int ns_type; //! Number of steps before pairlist is generated int nstlist; - //! Number of cells per rlong - int ndelta; //! Number of steps after which center of mass motion is removed int nstcomm; //! Center of mass motion removal algorithm diff --git a/src/gromacs/mdtypes/md_enums.cpp b/src/gromacs/mdtypes/md_enums.cpp index 71e4b5636a..b3f231d4d0 100644 --- a/src/gromacs/mdtypes/md_enums.cpp +++ b/src/gromacs/mdtypes/md_enums.cpp @@ -56,11 +56,6 @@ const char *yesno_names[BOOL_NR+1] = "no", "yes", nullptr }; -const char *ens_names[ensNR+1] = -{ - "Grid", "Simple", nullptr -}; - const char *ei_names[eiNR+1] = { "md", "steep", "cg", "bd", "sd2 - removed", "nm", "l-bfgs", "tpi", "tpic", "sd", "md-vv", "md-vv-avek", "mimic", nullptr diff --git a/src/gromacs/mdtypes/md_enums.h b/src/gromacs/mdtypes/md_enums.h index ed005b3219..d731900352 100644 --- a/src/gromacs/mdtypes/md_enums.h +++ b/src/gromacs/mdtypes/md_enums.h @@ -211,15 +211,6 @@ extern const char *eljpme_names[eljpmeNR+1]; //! Macro to tell us whether we use LJPME #define EVDW_PME(e) ((e) == evdwPME) -//! Neighborsearching algorithm -enum { - ensGRID, ensSIMPLE, ensNR -}; -//! String corresponding to neighborsearching -extern const char *ens_names[ensNR+1]; -//! Macro for correct NS algorithm -#define ENS(e) enum_name(e, ensNR, ens_names) - /*! \brief Integrator algorithm * * eiSD2 has been removed, but we keep a renamed enum entry, -- 2.22.0