From da07b2ef651d7c2cdefa8a2e22606cee61672c04 Mon Sep 17 00:00:00 2001 From: Carsten Kutzner Date: Fri, 6 Dec 2013 11:45:48 +0100 Subject: [PATCH] Read essential dynamics data from checkpoint at correct place, fixes #1392 In read_checkpoint(), the order in which the data blocks are read from .cpt differs from the order in write_checkpoint(), read_checkpoint_data() and list_checkpoint(). This change puts the do_cpt_EDstate() routine after the do_cpt_enerhist() routine, as is already the case for the other checkpoint-reading functions. Change-Id: Ib017dfbd05918b4ee8e27f1ec93523497c559936 --- src/gromacs/gmxlib/checkpoint.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gromacs/gmxlib/checkpoint.c b/src/gromacs/gmxlib/checkpoint.c index 5a3fb148b0..65984af702 100644 --- a/src/gromacs/gmxlib/checkpoint.c +++ b/src/gromacs/gmxlib/checkpoint.c @@ -1981,12 +1981,6 @@ static void read_checkpoint(const char *fn, FILE **pfplog, cp_error(); } - ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, &state->edsamstate, NULL); - if (ret) - { - cp_error(); - } - if (file_version < 6) { const char *warn = "Reading checkpoint file in old format, assuming that the run that generated this file started at step 0, if this is not the case the averages stored in the energy file will be incorrect."; @@ -2006,6 +2000,12 @@ static void read_checkpoint(const char *fn, FILE **pfplog, cp_error(); } + ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, &state->edsamstate, NULL); + if (ret) + { + cp_error(); + } + ret = do_cpt_files(gmx_fio_getxdr(fp), TRUE, &outputfiles, &nfiles, NULL, file_version); if (ret) { -- 2.22.0