Fix order of ED/swap blocks during checkpoint reading.
authorCarsten Kutzner <ckutzne@gwdg.de>
Tue, 14 Oct 2014 08:56:14 +0000 (10:56 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Mon, 20 Oct 2014 01:09:29 +0000 (03:09 +0200)
For some reason the order of reading the swap state and the essential
dynamics (ED) state were mixed up in read_checkpoint(), which lead to
unreadable state files if both ED and swap functionality were used.
This fix changes the order of those blocks to be consistent with
write_checkpoint().

Change-Id: Ie234486b990861decef9e00fc5125f867001f814

src/gromacs/gmxlib/checkpoint.c

index 18c0a312a61cd3940d1c7d84573ff7f501935137..5f93ff28e57262ae3452529eb9b5c91a82af36c6 100644 (file)
@@ -2102,13 +2102,13 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
         cp_error();
     }
 
-    ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, &state->swapstate, NULL);
+    ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, &state->edsamstate, NULL);
     if (ret)
     {
         cp_error();
     }
 
-    ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, &state->edsamstate, NULL);
+    ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, &state->swapstate, NULL);
     if (ret)
     {
         cp_error();