Fix walltime measurement with bgclang
authorMark Abraham <mark.j.abraham@gmail.com>
Thu, 12 Nov 2015 07:10:37 +0000 (07:10 +0000)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sat, 14 Nov 2015 16:47:26 +0000 (17:47 +0100)
BlueGeneQ + xlc was fine

BlueGeneQ + bgclang clock_gettime doesn't work properly, leading to
checkpoints every nstlist steps.

Change-Id: I8c58da39be7dd19a8aea2715b418586c42feba46

src/gromacs/timing/walltime_accounting.c

index ec0cba0b1e35fc988e9029e78013005e2449eea0..d5a88ffcdd76af14f7805967458cb7b6e607086d 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 2013, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, 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.
@@ -193,10 +193,12 @@ walltime_accounting_set_nsteps_done(gmx_walltime_accounting_t   walltime_account
 double
 gmx_gettime()
 {
-#if defined HAVE_CLOCK_GETTIME && _POSIX_TIMERS >= 0
+#if defined HAVE_CLOCK_GETTIME && _POSIX_TIMERS >= 0 && !(defined __bgq__ && defined __clang__)
     /* Mac and Windows do not support this. For added fun, Windows
      * defines _POSIX_TIMERS without actually providing the
-     * implementation. */
+     * implementation. The BlueGene/Q CNK only supports gettimeofday,
+     * and bgclang doesn't provide a fully functional implementation
+     * for clock_gettime (unlike xlc). */
     struct timespec t;
     double          seconds;
 
@@ -207,6 +209,7 @@ gmx_gettime()
 #elif defined HAVE_GETTIMEOFDAY
     // Note that gettimeofday() is deprecated by POSIX, but since Mac
     // and Windows do not yet support POSIX, we are still stuck.
+    // Also, this is the only supported API call on Bluegene/Q.
     struct timeval t;
     double         seconds;