Fix build for Folding@home
authorDmitry Moskalchuk <dm@crystax.net>
Mon, 15 Mar 2021 16:13:17 +0000 (16:13 +0000)
committerMark Abraham <mark.j.abraham@gmail.com>
Mon, 15 Mar 2021 16:13:17 +0000 (16:13 +0000)
Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
src/gromacs/mdlib/mdoutf.cpp
src/gromacs/mdlib/trajectory_writing.cpp

index 6ba96c89503b6d69924eb544949906a3898e968d..7e06e4fc9ee5fae2fe646c1b404e309fd8436128 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 2013,2014,2015,2016,2017 The GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -468,13 +468,20 @@ static void write_checkpoint(const char*                     fn,
     sfree(fntemp);
 
 #if GMX_FAHCORE
-    /*code for alternate checkpointing scheme.  moved from top of loop over
-       steps */
-    fcRequestCheckPoint();
-    if (fcCheckPointParallel(cr->nodeid, NULL, 0) == 0)
-    {
-        gmx_fatal(3, __FILE__, __LINE__, "Checkpoint error on step %d\n", step);
-    }
+    /* Always FAH checkpoint immediately after a GROMACS checkpoint.
+     *
+     * Note that it is critical that we save a FAH checkpoint directly
+     * after writing a GROMACS checkpoint. If the program dies, either
+     * by the machine powering off suddenly or the process being,
+     * killed, FAH can recover files that have only appended data by
+     * truncating them to the last recorded length. The GROMACS
+     * checkpoint does not just append data, it is fully rewritten each
+     * time so a crash between moving the new Gromacs checkpoint file in
+     * to place and writing a FAH checkpoint is not recoverable. Thus
+     * the time between these operations must be kept as short as
+     * possible.
+     */
+    fcCheckpoint();
 #endif /* end GMX_FAHCORE block */
 }
 
index f0f9f25fdab8ffac7e4e13e6184a841fede8865b..09f1b6512da27fb796354a730669625a2a4a60ac 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 2013,2014,2015,2016,2017, The GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -191,7 +191,7 @@ void do_md_trajectory_writing(FILE*                          fplog,
 #if GMX_FAHCORE
     if (MASTER(cr))
     {
-        fcWriteVisFrame(ir->ePBC, state_global->box, top_global, state_global->x.rvec_array());
+        fcWriteVisFrame(ir->pbcType, state_global->box, top_global, state_global->x.rvec_array());
     }
 #endif
 }