Merge branch 'origin/release-2020' into merge-release-2020-into-master
authorPaul Bauer <paul.bauer.q@gmail.com>
Wed, 7 Oct 2020 06:55:19 +0000 (08:55 +0200)
committerPaul Bauer <paul.bauer.q@gmail.com>
Wed, 7 Oct 2020 06:55:19 +0000 (08:55 +0200)
Resolved Conflicts:
admin/gitlab-ci/archive.gitlab-ci.yml
admin/gitlab-ci/global.gitlab-ci.yml
admin/gitlab-ci/gromacs.gitlab-ci.yml
admin/gitlab-ci/lint.gitlab-ci.yml
admin/gitlab-ci/python-gmxapi.gitlab-ci.yml
admin/gitlab-ci/rules.gitlab-ci.yml
admin/gitlab-ci/sample_restraint-regression.gitlab-ci.yml
cmake/gmxVersionInfo.cmake
src/gromacs/fileio/checkpoint.cpp
src/gromacs/hardware/printhardware.cpp
src/gromacs/mdlib/md_support.cpp
src/gromacs/mdlib/trajectory_writing.cpp
src/gromacs/mdrun/runner.cpp
src/gromacs/modularsimulator/domdechelper.cpp
src/gromacs/modularsimulator/domdechelper.h
src/gromacs/modularsimulator/freeenergyperturbationelement.cpp
src/gromacs/modularsimulator/freeenergyperturbationelement.h
src/gromacs/modularsimulator/modularsimulator.cpp
src/gromacs/tools/trjcat.cpp
src/gromacs/topology/topology.h
src/gromacs/utility/fatalerror.cpp
src/gromacs/utility/futil.cpp
src/gromacs/utility/init.cpp
src/programs/mdrun/tests/CMakeLists.txt
tests/CMakeLists.txt

Change-Id: Icd5d9c78ff2cfb0598c3cb55b057487ca098a1f0

23 files changed:
1  2 
CMakeLists.txt
admin/gitlab-ci/global.gitlab-ci.yml
admin/gitlab-ci/rules.gitlab-ci.yml
cmake/gmxTestImageMagick.cmake
docs/CMakeLists.txt
docs/doxygen/suppressions.txt
docs/release-notes/index.rst
src/gromacs/fileio/checkpoint.cpp
src/gromacs/gmxpreprocess/readir.cpp
src/gromacs/hardware/printhardware.cpp
src/gromacs/mdlib/mdoutf.cpp
src/gromacs/mdlib/trajectory_writing.cpp
src/gromacs/mdrun/md.cpp
src/gromacs/mdrun/runner.cpp
src/gromacs/mdtypes/state_propagator_data_gpu.h
src/gromacs/tables/forcetable.cpp
src/gromacs/tools/trjcat.cpp
src/gromacs/topology/topology.h
src/gromacs/utility/fatalerror.cpp
src/gromacs/utility/futil.cpp
src/gromacs/utility/init.cpp
src/programs/mdrun/tests/CMakeLists.txt
tests/CMakeLists.txt

diff --cc CMakeLists.txt
Simple merge
index d6dbf6bf096c0bd6eb9a2b9d48fda75753d9e826,302a58e05efe6987ea812544f6c54b4f6f40d5d7..49056b495926395a77fdc6ffbd485d8b9aeb6923
    variables:
      KUBERNETES_CPU_LIMIT: 8
      KUBERNETES_CPU_REQUEST: 4
-     KUBERNETES_MEMORY_REQUEST: 8Gi
+     KUBERNETES_MEMORY_REQUEST: 4Gi
+     KUBERNETES_MEMORY_LIMIT: 8Gi
      KUBERNETES_EXTENDED_RESOURCE_NAME: ""
      KUBERNETES_EXTENDED_RESOURCE_LIMIT: 0
 -    CACHE_FALLBACK_KEY: "$CI_JOB_NAME-$CI_JOB_STAGE-release-2020"
 +    CACHE_FALLBACK_KEY: "$CI_JOB_NAME-$CI_JOB_STAGE-master"
      BUILD_DIR: build
      INSTALL_DIR: install
      CMAKE_GMXAPI_OPTIONS: ""
index 201e329599112cfc23728ccc8cbe63922d158a2f,86bf421545e17fde9f3daff974aa13e80e12a16d..7bf1648b47f83a2508677c5ea10e9a723e99854d
  .rules-element:if-post-merge-acceptance-or-mr-then-always: &if-post-merge-acceptance-or-mr-then-always
    if: '$CI_PIPELINE_SOURCE == "merge_request_event" ||
         ($CI_PIPELINE_SOURCE == "push" &&
-         ($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME == "release-*"))'
 -        $CI_COMMIT_REF_NAME == "release-2020")'
++        $CI_COMMIT_REF_NAME == "master")'
    when: always
  
  # Include job only for post submit push
  .rules-element:if-post-merge-acceptance-then-always: &if-post-merge-acceptance-then-always
    if: '$CI_PIPELINE_SOURCE == "push" &&
-         ($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME == "release-*")'
 -       $CI_COMMIT_REF_NAME == "release-2020"'
++       $CI_COMMIT_REF_NAME == "master"'
    when: always
  
  # When composing a rule set, note that the first matching rule is applied.
index 2912b85f3b61dae451d2482fb14b3879bd3874e1,bc06d5af8f8db630991c2d7cf7a340d931a03d95..b008a791706a1fe048a254414282af8921a9db44
@@@ -1,7 -1,7 +1,7 @@@
  #
  # This file is part of the GROMACS molecular simulation package.
  #
--# Copyright (c) 2018,2019, by the GROMACS development team, led by
++# Copyright (c) 2018,2019,2020, 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.
Simple merge
index c5d844eefc2a5aa2f8601755a552ef7014303cfd,533e028090419083d30375477e9919af0d08a2a5..6a976c4971d17e308bdc4b0ed62a0ba137829ec0
@@@ -47,10 -44,9 +47,9 @@@ src/gromacs/tables/cubicsplinetable.h: 
  src/gromacs/tables/quadraticsplinetable.h: warning: includes "simd.h" unnecessarily
  
  # These are specific to Folding@Home, and easiest to suppress here
- *: warning: includes non-local file as "corewrap.h"
  src/gmxpre.h: warning: includes non-local file as "swindirect.h"
  
 -# New external API (see https://redmine.gromacs.org/issues/2586) has some unresolved
 +# New external API (see https://gitlab.com/gromacs/gromacs/-/issues/2586) has some unresolved
  # conflicts with previous definitions of public API, installed API, and other things
  # described or implemented in check-source.py, gmxtree.py, gmxtree.rst, and others
  # TODO: resolve definitions, update testing heuristics, and activate policy checks
Simple merge
index 39d5b2984ae703896505932f40306cd2a2eaa84e,9c6cfe42135b6bf4a7e8c98af3786d7abeed11ea..abd957f09a5fe1a30a48f7f5f2fb9a3d63784942
@@@ -2342,13 -2393,94 +2338,29 @@@ void write_checkpoint_data(t_fileio
          gmx::serializeKeyValueTree(tree, &serializer);
      }
  
 -    do_cpt_footer(gmx_fio_getxdr(fp), headerContents.file_version);
 -
 -    /* we really, REALLY, want to make sure to physically write the checkpoint,
 -       and all the files it depends on, out to disk. Because we've
 -       opened the checkpoint with gmx_fio_open(), it's in our list
 -       of open files.  */
 -    ret = gmx_fio_all_output_fsync();
 -
 -    if (ret)
 +    // Checkpointing modular simulator
      {
 -        char buf[STRLEN];
 -        sprintf(buf, "Cannot fsync '%s'; maybe you are out of disk space?", gmx_fio_getname(ret));
 -
 -        if (getenv(GMX_IGNORE_FSYNC_FAILURE_ENV) == nullptr)
 -        {
 -            gmx_file(buf);
 -        }
 -        else
 -        {
 -            gmx_warning("%s", buf);
 -        }
 -    }
 -
 -    if (gmx_fio_close(fp) != 0)
 -    {
 -        gmx_file("Cannot read/write checkpoint; corrupt file, or maybe you are out of disk space?");
 -    }
 -
 -    /* we don't move the checkpoint if the user specified they didn't want it,
 -       or if the fsyncs failed */
 -#if !GMX_NO_RENAME
 -    if (!bNumberAndKeep && !ret)
 -    {
 -        if (gmx_fexist(fn))
 -        {
 -            /* Rename the previous checkpoint file */
 -            mpiBarrierBeforeRename(applyMpiBarrierBeforeRename, mpiBarrierCommunicator);
 -
 -            std::strcpy(buf, fn);
 -            buf[std::strlen(fn) - std::strlen(ftp2ext(fn2ftp(fn))) - 1] = '\0';
 -            std::strcat(buf, "_prev");
 -            std::strcat(buf, fn + std::strlen(fn) - std::strlen(ftp2ext(fn2ftp(fn))) - 1);
 -            if (!GMX_FAHCORE)
 -            {
 -                /* we copy here so that if something goes wrong between now and
 -                 * the rename below, there's always a state.cpt.
 -                 * If renames are atomic (such as in POSIX systems),
 -                 * this copying should be unneccesary.
 -                 */
 -                gmx_file_copy(fn, buf, FALSE);
 -                /* We don't really care if this fails:
 -                 * there's already a new checkpoint.
 -                 */
 -            }
 -            else
 -            {
 -                gmx_file_rename(fn, buf);
 -            }
 -        }
 -
 -        /* Rename the checkpoint file from the temporary to the final name */
 -        mpiBarrierBeforeRename(applyMpiBarrierBeforeRename, mpiBarrierCommunicator);
 -
 -        if (gmx_file_rename(fntemp, fn) != 0)
 -        {
 -            gmx_file("Cannot rename checkpoint file; maybe you are out of disk space?");
 -        }
 +        gmx::FileIOXdrSerializer serializer(fp);
 +        modularSimulatorCheckpointData->serialize(&serializer);
      }
 -#endif /* GMX_NO_RENAME */
 -
 -    sfree(fntemp);
  
 +    do_cpt_footer(gmx_fio_getxdr(fp), headerContents.file_version);
+ #if GMX_FAHCORE
+     /* 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 a
+      * possible.
+      */
+     fcCheckpoint();
+ #endif
  }
  
  static void check_int(FILE* fplog, const char* type, int p, int f, gmx_bool* mm)
Simple merge
index 616b7b9e09d474bdd053358c63988e9bbbf4c1c1,43f70234094375cc7ed9b0a909b057ee30f5a93e..0720a12bbe9398a344acffd7eb8f6d24ad491268
  #include "gromacs/utility/stringutil.h"
  #include "gromacs/utility/sysinfo.h"
  
+ #include "architecture.h"
  //! Constant used to help minimize preprocessed code
 -static const bool bGPUBinary = GMX_GPU != GMX_GPU_NONE;
 +static constexpr bool bGPUBinary = (GMX_GPU != 0);
  
  /*! \internal \brief
   * Returns the GPU information text, one GPU per line.
Simple merge
index d9ef7191ede87741b866305ab8c0225f337cfe29,3d99d2353dbc6f8dc236158aa0e63ed0e7024801..f0f9f25fdab8ffac7e4e13e6184a841fede8865b
@@@ -1,8 -1,7 +1,8 @@@
  /*
   * This file is part of the GROMACS molecular simulation package.
   *
-  * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
 - * Copyright (c) 2013,2014,2015,2016,2017,2018,2019,2020, by the GROMACS development team, led by
++ * Copyright (c) 2013,2014,2015,2016,2017, The GROMACS development team.
 + * Copyright (c) 2018,2019,2020, 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.
Simple merge
index dfc399541f395bd24fcd8e2ee5ef06df0812cfb4,3c9def3eaa786fd032bbfecbde701cb33171121e..90275f50a3605c562a59e205c8c6ad41f81eae91
@@@ -205,14 -190,13 +201,14 @@@ static DevelopmentFeatureFlags manageDe
      // getenv results are ignored when clearly they are used.
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wunused-result"
 -    devFlags.enableGpuBufferOps = (getenv("GMX_USE_GPU_BUFFER_OPS") != nullptr)
 -                                  && (GMX_GPU == GMX_GPU_CUDA) && useGpuForNonbonded;
 +
 +    devFlags.enableGpuBufferOps =
 +            GMX_GPU_CUDA && useGpuForNonbonded && (getenv("GMX_USE_GPU_BUFFER_OPS") != nullptr);
 +    devFlags.enableGpuHaloExchange = GMX_GPU_CUDA && GMX_THREAD_MPI && getenv("GMX_GPU_DD_COMMS") != nullptr;
-     devFlags.forceGpuUpdateDefault = (getenv("GMX_FORCE_UPDATE_DEFAULT_GPU") != nullptr);
+     devFlags.forceGpuUpdateDefault = (getenv("GMX_FORCE_UPDATE_DEFAULT_GPU") != nullptr) || GMX_FAHCORE;
 -    devFlags.enableGpuHaloExchange =
 -            (getenv("GMX_GPU_DD_COMMS") != nullptr && GMX_THREAD_MPI && (GMX_GPU == GMX_GPU_CUDA));
      devFlags.enableGpuPmePPComm =
 -            (getenv("GMX_GPU_PME_PP_COMMS") != nullptr && GMX_THREAD_MPI && (GMX_GPU == GMX_GPU_CUDA));
 +            GMX_GPU_CUDA && GMX_THREAD_MPI && getenv("GMX_GPU_PME_PP_COMMS") != nullptr;
 +
  #pragma GCC diagnostic pop
  
      if (devFlags.enableGpuBufferOps)
@@@ -1060,26 -1007,32 +1049,41 @@@ int Mdrunner::mdrunner(
       * So the PME-only nodes (if present) will also initialize
       * the distance restraints.
       */
 -    snew(fcd, 1);
  
      /* This needs to be called before read_checkpoint to extend the state */
 -    init_disres(fplog, &mtop, inputrec, cr, ms, fcd, globalState.get(), replExParams.exchangeInterval > 0);
 +    t_disresdata* disresdata;
 +    snew(disresdata, 1);
 +    init_disres(fplog, &mtop, inputrec.get(), DisResRunMode::MDRun,
 +                MASTER(cr) ? DDRole::Master : DDRole::Agent,
 +                PAR(cr) ? NumRanks::Multiple : NumRanks::Single, cr->mpi_comm_mysim, ms, disresdata,
 +                globalState.get(), replExParams.exchangeInterval > 0);
  
 -    init_orires(fplog, &mtop, inputrec, cr, ms, globalState.get(), &(fcd->orires));
 +    t_oriresdata* oriresdata;
 +    snew(oriresdata, 1);
 +    init_orires(fplog, &mtop, inputrec.get(), cr, ms, globalState.get(), oriresdata);
  
 -    auto deform = prepareBoxDeformation(globalState->box, cr, *inputrec);
 +    auto deform = prepareBoxDeformation(
 +            globalState != nullptr ? globalState->box : box, MASTER(cr) ? DDRole::Master : DDRole::Agent,
 +            PAR(cr) ? NumRanks::Multiple : NumRanks::Single, cr->mpi_comm_mygroup, *inputrec);
  
+ #if GMX_FAHCORE
+     /* We have to remember the generation's first step before reading checkpoint.
+        This way, we can report to the F@H core both the generation's first step
+        and the restored first step, thus making it able to distinguish between
+        an interruption/resume and start of the n-th generation simulation.
+        Having this information, the F@H core can correctly calculate and report
+        the progress.
+      */
+     int gen_first_step = 0;
+     if (MASTER(cr))
+     {
+         gen_first_step = inputrec->init_step;
+     }
+ #endif
      ObservablesHistory observablesHistory = {};
  
 +    auto modularSimulatorCheckpointData = std::make_unique<ReadCheckpointDataHolder>();
      if (startingBehavior != StartingBehavior::NewSimulation)
      {
          /* Check if checkpoint file exists before doing continuation.
Simple merge
index 5b0b20b6835991a47eb321117305ecc5f5ad2c4e,0d5e1f45cbf806f19ff188a66d4e27caaa313583..b2377eafd6cf650372b3eac5a858ccb1879a069d
@@@ -3,8 -3,7 +3,8 @@@
   *
   * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
   * Copyright (c) 2001-2004, The GROMACS development team.
-  * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
 - * Copyright (c) 2013,2014,2015,2016,2017,2018,2019,2020, by the GROMACS development team, led by
++ * Copyright (c) 2013,2014,2015,2016,2017, The GROMACS development team.
 + * Copyright (c) 2018,2019,2020, 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.
index 6ac65d0b39d104f9c8bbf9d38872eb81cc4d58b1,1d8f9abc219be1267815038b4a84d2f44322db76..cda4ec7e942e5bba57d907e69566725d709c82f1
@@@ -3,8 -3,7 +3,8 @@@
   *
   * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
   * Copyright (c) 2001-2004, The GROMACS development team.
-  * Copyright (c) 2011,2014,2015,2016,2018 by the GROMACS development team.
 - * Copyright (c) 2011,2014,2015,2016,2018,2019,2020, by the GROMACS development team, led by
++ * Copyright (c) 2011,2014,2015,2016,2018, The GROMACS development team.
 + * Copyright (c) 2019,2020, 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.
index 04127783fd14ecc1f5e2f9346ceee5e5a5aecee4,e27f64b69276bb1d2d959d48b64f0c23b80e6462..f29b400a807e489e70b8633a3d55e85279eff8d0
@@@ -3,8 -3,7 +3,8 @@@
   *
   * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
   * Copyright (c) 2001-2004, The GROMACS development team.
-  * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
 - * Copyright (c) 2013,2014,2015,2016,2017,2018,2019,2020, by the GROMACS development team, led by
++ * Copyright (c) 2013,2014,2015,2016,2017, The GROMACS development team.
 + * Copyright (c) 2018,2019,2020, 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.
index b09c5403b8dc7849397d365d5cc44e0a1c311c28,c16605e90acc72bbb5c0ce2914e4dae08dbb216b..6f631efc8b3f608b01e18e76e90fb30c41d66b18
@@@ -3,8 -3,7 +3,8 @@@
   *
   * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
   * Copyright (c) 2001-2004, The GROMACS development team.
-  * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
 - * Copyright (c) 2013,2014,2015,2016,2017,2018,2019,2020, by the GROMACS development team, led by
++ * Copyright (c) 2013,2014,2015,2016,2017, The GROMACS development team.
 + * Copyright (c) 2018,2019,2020, 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.
@@@ -164,13 -163,9 +164,9 @@@ static void push_ps(FILE* fp
  #    ifdef gmx_ffclose
  #        undef gmx_ffclose
  #    endif
- #    if (!HAVE_PIPES && !defined(__native_client__))
+ #endif
+ #if (!HAVE_PIPES && !defined(__native_client__))
 -static FILE* popen(const char* nm, const char* mode)
 +static FILE* popen(const char* /* nm */, const char* /* mode */)
  {
      gmx_impl("Sorry no pipes...");
  
@@@ -692,14 -678,13 +679,14 @@@ int gmx_fsync(FILE* fp
          int fn;
  
          /* get the file number */
- #    if HAVE_FILENO
+ #if HAVE_FILENO
          fn = fileno(fp);
- #    elif HAVE__FILENO
+ #elif HAVE__FILENO
          fn = _fileno(fp);
- #    else
+ #else
 +        GMX_UNUSED_VALUE(fp);
          fn = -1;
- #    endif
+ #endif
  
          /* do the actual fsync */
          if (fn >= 0)
index f23f8cae503318caafb86e60d3a93d2bf2ac197c,b9ee23851725d1f39b7fb8483162d520efb6e5c3..1f6e07414bdb765f98457fffd926bc1ee1a06b0c
@@@ -1,8 -1,7 +1,8 @@@
  /*
   * This file is part of the GROMACS molecular simulation package.
   *
-  * Copyright (c) 2013,2014,2015,2016,2018 by the GROMACS development team.
 - * Copyright (c) 2013,2014,2015,2016,2018,2019,2020, by the GROMACS development team, led by
++ * Copyright (c) 2013,2014,2015,2016,2018, The GROMACS development team.
 + * Copyright (c) 2019,2020, 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.
index dee12e276b95b8fd2fc4ac10447b86c9b42a093e,9ba03c04fc8d9d1dbc1c54c9df9ac052c2acbd0e..b051068c0670184835bd4dda10d283a2b7e00d10
@@@ -95,6 -92,6 +95,9 @@@ gmx_add_gtest_executable(${exename
  target_link_libraries(${exename} PRIVATE mdrun_test_infrastructure)
  gmx_register_gtest_test(${testname} ${exename} OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS)
  
++# To avoid running into test timeouts, some end-to-end tests of mdrun
++# functionality are split off. This can be rearranged in future as we
++# see fit.
  set(testname "MdrunTests")
  set(exename "mdrun-test")
  
Simple merge