From: Mark Abraham Date: Fri, 26 Jan 2018 16:22:04 +0000 (+0100) Subject: Disallowed change of ensemble for checkpoint restart X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=96a334f3ab8cf2da695c732432da4b4e20ed67de;p=alexxy%2Fgromacs.git Disallowed change of ensemble for checkpoint restart Change-Id: I63a8330043fddffc9cfc98203f60d71497e6c2f7 --- diff --git a/docs/user-guide/environment-variables.rst b/docs/user-guide/environment-variables.rst index 61eeb169e7..545e4bdb0f 100644 --- a/docs/user-guide/environment-variables.rst +++ b/docs/user-guide/environment-variables.rst @@ -138,11 +138,6 @@ Performance and Run Control file. Normally, :mdp:`epsilon-r` must be greater than zero to prevent a fatal error. See webpage_ for example input files for a planetary simulation. -``GMX_ALLOW_CPT_MISMATCH`` - when set, runs will not exit if the - ensemble set in the :ref:`tpr` file does not match that of the - :ref:`cpt` file. - ``GMX_BONDED_NTHREAD_UNIFORM`` Value of the number of threads per rank from which to switch from uniform to localized bonded interaction distribution; optimal value dependent on diff --git a/src/gromacs/fileio/checkpoint.cpp b/src/gromacs/fileio/checkpoint.cpp index c609e12774..2034fb5966 100644 --- a/src/gromacs/fileio/checkpoint.cpp +++ b/src/gromacs/fileio/checkpoint.cpp @@ -2023,25 +2023,6 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep, #endif /* end GMX_FAHCORE block */ } -static void print_flag_mismatch(FILE *fplog, int sflags, int fflags) -{ - int i; - - fprintf(fplog, "\nState entry mismatch between the simulation and the checkpoint file\n"); - fprintf(fplog, "Entries which are not present in the checkpoint file will not be updated\n"); - fprintf(fplog, " %24s %11s %11s\n", "", "simulation", "checkpoint"); - for (i = 0; i < estNR; i++) - { - if ((sflags & (1<eIntegrator != eIntegrator) { - if (MASTER(cr)) - { - fprintf(stderr, int_warn, EI(headerContents->eIntegrator), EI(eIntegrator)); - } - if (bAppendOutputFiles) - { - gmx_fatal(FARGS, - "Output file appending requested, but input/checkpoint integrators do not match.\n" - "Stopping the run to prevent you from ruining all your data...\n" - "If you _really_ know what you are doing, try with the -noappend option.\n"); - } - if (fplog) - { - fprintf(fplog, int_warn, EI(headerContents->eIntegrator), EI(eIntegrator)); - } + gmx_fatal(FARGS, "Cannot change integrator during a checkpoint restart. Perhaps you should make a new .tpr with grompp -f new.mdp -t %s", fn); } if (headerContents->flags_state != state->flags) { - - if (MASTER(cr)) - { - if (bAppendOutputFiles) - { - gmx_fatal(FARGS, - "Output file appending requested, but input and checkpoint states are not identical.\n" - "Stopping the run to prevent you from ruining all your data...\n" - "You can try with the -noappend option, and get more info in the log file.\n"); - } - - if (getenv("GMX_ALLOW_CPT_MISMATCH") == nullptr) - { - gmx_fatal(FARGS, "You seem to have switched ensemble, integrator, T and/or P-coupling algorithm between the cpt and tpr file, or switched GROMACS version. The recommended way of doing this is passing the cpt file to grompp (with option -t) instead of to mdrun. If you know what you are doing, you can override this error by setting the env.var. GMX_ALLOW_CPT_MISMATCH"); - } - else - { - fprintf(stderr, - "WARNING: The checkpoint state entries do not match the simulation,\n" - " see the log file for details\n\n"); - } - } - - if (fplog) - { - print_flag_mismatch(fplog, state->flags, headerContents->flags_state); - } + gmx_fatal(FARGS, "Cannot change a simulation algorithm during a checkpoint restart. Perhaps you should make a new .tpr with grompp -f new.mdp -t %s", fn); } - else + + if (MASTER(cr)) { - if (MASTER(cr)) - { - check_match(fplog, cr, dd_nc, *headerContents, - reproducibilityRequested); - } + check_match(fplog, cr, dd_nc, *headerContents, + reproducibilityRequested); } + ret = do_cpt_state(gmx_fio_getxdr(fp), headerContents->flags_state, state, nullptr); *init_fep_state = state->fep_state; /* there should be a better way to do this than setting it here. Investigate for 5.0. */