More config.h macros to 0/1
authorTeemu Murtola <teemu.murtola@gmail.com>
Sat, 9 Jan 2016 05:37:00 +0000 (07:37 +0200)
committerRoland Schulz <roland@rschulz.eu>
Sun, 10 Jan 2016 03:43:29 +0000 (04:43 +0100)
Also, remove a few unused ones.

Change-Id: I1ce3f3345173a5fdfe7aa772008a3206b2118f46

18 files changed:
cmake/gmxDetectSimd.cmake
cmake/gmxSetBuildInformation.cmake
src/config.h.cmakein
src/gromacs/fft/fft5d.cpp
src/gromacs/fileio/gmxfio.cpp
src/gromacs/gmxlib/network.cpp
src/gromacs/gpu_utils/cudautils.cuh
src/gromacs/gpu_utils/gpu_utils.cu
src/gromacs/hardware/cpuinfo.cpp
src/gromacs/mdlib/main.cpp
src/gromacs/mdlib/sighandler.cpp
src/gromacs/mdrunutility/threadaffinity.cpp
src/gromacs/pulling/pullutil.cpp
src/gromacs/timing/cyclecounter.cpp
src/gromacs/timing/walltime_accounting.cpp
src/gromacs/utility/directoryenumerator.cpp
src/gromacs/utility/futil.cpp
src/gromacs/utility/sysinfo.cpp

index eb4c8679eb19707bfa8e4243a4bb128fb2b7a878..aa9c24fdaa4259008e759760c6250acd9bf96069 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015,2016, 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.
@@ -60,9 +60,9 @@ function(gmx_suggest_simd _suggested_simd)
     gmx_test_inline_asm_gcc_x86(GMX_X86_GCC_INLINE_ASM)
 
     if(GMX_X86_GCC_INLINE_ASM)
-        set(GCC_INLINE_ASM_DEFINE "-DGMX_X86_GCC_INLINE_ASM")
+        set(GCC_INLINE_ASM_DEFINE "-DGMX_X86_GCC_INLINE_ASM=1")
     else()
-        set(GCC_INLINE_ASM_DEFINE "")
+        set(GCC_INLINE_ASM_DEFINE "-DGMX_X86_GCC_INLINE_ASM=0")
     endif()
 
     message(STATUS "Detecting best SIMD instructions for this CPU")
index 14f28c44f5622b7e414790769b2c684d04f188a5..bf6551f9e824e7b4a75fc81d74697a913bf9cb56 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015,2016, 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.
@@ -59,9 +59,9 @@ macro(gmx_set_build_information)
     gmx_test_inline_asm_gcc_x86(GMX_X86_GCC_INLINE_ASM)
 
     if(GMX_X86_GCC_INLINE_ASM)
-        set(GCC_INLINE_ASM_DEFINE "-DGMX_X86_GCC_INLINE_ASM")
+        set(GCC_INLINE_ASM_DEFINE "-DGMX_X86_GCC_INLINE_ASM=1")
     else()
-        set(GCC_INLINE_ASM_DEFINE "")
+        set(GCC_INLINE_ASM_DEFINE "-DGMX_X86_GCC_INLINE_ASM=0")
     endif()
 
     message(STATUS "Setting build user/date/host/cpu information")
index 44f74243a2e1e1c1ab267efa3e002ec12ba3c5c9..142af5ef680d135019fc858a30b9fd29ed531754 100644 (file)
 #endif
 
 /* MPI_IN_PLACE exists for collective operations */
-#cmakedefine MPI_IN_PLACE_EXISTS
+#cmakedefine01 MPI_IN_PLACE_EXISTS
 
 /* Use OpenMP multithreading */
 #cmakedefine GMX_OPENMP
 #cmakedefine01 GMX_X11
 
 /* Enable x86 gcc inline assembly */
-#cmakedefine GMX_X86_GCC_INLINE_ASM
+#cmakedefine01 GMX_X86_GCC_INLINE_ASM
 
 /* Define constants useful for handling GPU support */
 #define GMX_GPU_NONE   0
 #cmakedefine GMX_CUDA_NB_SINGLE_COMPILATION_UNIT
 
 /* Use NVML */
-#cmakedefine HAVE_NVML
+#cmakedefine01 HAVE_NVML
 
 /* Define relative path to OpenCL kernels */
 #define OCL_INSTALL_DIR "@OCL_INSTALL_DIR@"
 
 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
-#cmakedefine HAVE_FSEEKO
+#cmakedefine01 HAVE_FSEEKO
 
 /* Define to 1 if _fseeki64 (and presumably _fseeki64) exists and is declared. */
-#cmakedefine HAVE__FSEEKI64
+#cmakedefine01 HAVE__FSEEKI64
 
 /* Have io.h (windows)*/
-#cmakedefine HAVE_IO_H
+#cmakedefine01 HAVE_IO_H
 
 /* Define to 1 if you have the posix_memalign() function. */
 #cmakedefine01 HAVE_POSIX_MEMALIGN
 #cmakedefine01 HAVE__ALIGNED_MALLOC
 
 /* Define to 1 if you have the clock_gettime() function. */
-#cmakedefine HAVE_CLOCK_GETTIME
+#cmakedefine01 HAVE_CLOCK_GETTIME
 
 /* Define to 1 if you have the gettimeofday() function. */
-#cmakedefine HAVE_GETTIMEOFDAY
+#cmakedefine01 HAVE_GETTIMEOFDAY
 
 /* Define to 1 if you have the rdtscp instruction. */
 #cmakedefine HAVE_RDTSCP
 
 /* Define to 1 if you have the fsync() function. */
-#cmakedefine HAVE_FSYNC
+#cmakedefine01 HAVE_FSYNC
 
 /* Define to 1 if you have the Windows _commit() function. */
-#cmakedefine HAVE__COMMIT
+#cmakedefine01 HAVE__COMMIT
 
 /* Define to 1 if you have the fileno() function. */
-#cmakedefine HAVE_FILENO
+#cmakedefine01 HAVE_FILENO
 
 /* Define to 1 if you have the _fileno() function. */
-#cmakedefine HAVE__FILENO
+#cmakedefine01 HAVE__FILENO
 
 /* Define to 1 if you have the sigaction() function. */
-#cmakedefine HAVE_SIGACTION
+#cmakedefine01 HAVE_SIGACTION
 
 /* Define for the GNU __builtin_clz() function. */
 #cmakedefine01 HAVE_BUILTIN_CLZ
 #cmakedefine HAVE_UNISTD_H
 
 /* Define to 1 if yo have the <pwd.h> header file. */
-#cmakedefine HAVE_PWD_H
+#cmakedefine01 HAVE_PWD_H
 
 /* Define to 1 if yo have the <dirent.h> header file. */
-#cmakedefine HAVE_DIRENT_H
+#cmakedefine01 HAVE_DIRENT_H
 
 /* Define to 1 if you have the <sys/time.h> header file. */
 #cmakedefine HAVE_SYS_TIME_H
 
-/* Define to 1 if you have the <x86intrin.h> header file */
-#cmakedefine HAVE_X86INTRIN_H
-
-/* Define to 1 if you have the <intrin.h> header file */
-#cmakedefine HAVE_INTRIN_H
-
 /* Define to 1 if you have the <sched.h> header */
 #cmakedefine HAVE_SCHED_H
 
 #cmakedefine HAVE_SYSCONF
 
 /* Define to 1 if you have the all the affinity functions in sched.h */
-#cmakedefine HAVE_SCHED_AFFINITY
+#cmakedefine01 HAVE_SCHED_AFFINITY
 
 /* Define to 1 if _mm_malloc() is present in either mm_malloc.h,
  * malloc.h or xmmintrin.h, and 0 otherwise. Note that you need to
index da103c0139063242f719e0f5bc8a023b8ddc4064..01bdffea43ba5efbcb79f91d5ab6ef3da1215d71 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2012,2013,2014,2015,2016, 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.
@@ -133,7 +133,7 @@ static int lpfactor(int z)
 }
 
 #ifndef GMX_MPI
-#ifdef HAVE_GETTIMEOFDAY
+#if HAVE_GETTIMEOFDAY
 #include <sys/time.h>
 double MPI_Wtime()
 {
index f8534d57cf43f9ea7bd76854fabf6a38bb8883c1..e632956a8dcdb9adc0cdd7305a7c86368715683a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -44,7 +44,7 @@
 #include <cstdio>
 #include <cstring>
 
-#ifdef HAVE_IO_H
+#if HAVE_IO_H
 #include <io.h>
 #endif
 #ifdef HAVE_UNISTD_H
@@ -735,7 +735,7 @@ t_fileio *gmx_fio_all_output_fsync(void)
        that they're not redirected. */
     fflush(stdout);
     fflush(stderr);
-#if (defined(HAVE_FSYNC))
+#if HAVE_FSYNC
     /* again, fahcore defines HAVE_FSYNC and fsync() */
     fsync(STDOUT_FILENO);
     fsync(STDERR_FILENO);
index 4bd369e0ef535c253a318a34256ec65f091e05c0..485bfe8154dad330868cdda3db2b517423b3e50f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -95,7 +95,7 @@ t_commrec *init_commrec()
     // TODO cr->duty should not be initialized here
     cr->duty = (DUTY_PP | DUTY_PME);
 
-#if defined GMX_MPI && !defined MPI_IN_PLACE_EXISTS
+#if defined GMX_MPI && !MPI_IN_PLACE_EXISTS
     /* initialize the MPI_IN_PLACE replacement buffers */
     snew(cr->mpb, 1);
     cr->mpb->ibuf        = NULL;
@@ -342,7 +342,7 @@ void gmx_sumd(int gmx_unused nr, double gmx_unused r[], const t_commrec gmx_unus
 #ifndef GMX_MPI
     gmx_call("gmx_sumd");
 #else
-#if defined(MPI_IN_PLACE_EXISTS)
+#if MPI_IN_PLACE_EXISTS
     if (cr->nc.bUse)
     {
         if (cr->nc.rank_intra == 0)
@@ -405,7 +405,7 @@ void gmx_sumf(int gmx_unused nr, float gmx_unused r[], const t_commrec gmx_unuse
 #ifndef GMX_MPI
     gmx_call("gmx_sumf");
 #else
-#if defined(MPI_IN_PLACE_EXISTS)
+#if MPI_IN_PLACE_EXISTS
     if (cr->nc.bUse)
     {
         /* Use two step summing.  */
@@ -467,7 +467,7 @@ void gmx_sumi(int gmx_unused nr, int gmx_unused r[], const t_commrec gmx_unused
 #ifndef GMX_MPI
     gmx_call("gmx_sumi");
 #else
-#if defined(MPI_IN_PLACE_EXISTS)
+#if MPI_IN_PLACE_EXISTS
     if (cr->nc.bUse)
     {
         /* Use two step summing */
@@ -525,7 +525,7 @@ void gmx_sumli(int gmx_unused nr, gmx_int64_t gmx_unused r[], const t_commrec gm
 #ifndef GMX_MPI
     gmx_call("gmx_sumli");
 #else
-#if defined(MPI_IN_PLACE_EXISTS)
+#if MPI_IN_PLACE_EXISTS
     if (cr->nc.bUse)
     {
         /* Use two step summing */
@@ -588,7 +588,7 @@ void gmx_sumli(int gmx_unused nr, gmx_int64_t gmx_unused r[], const t_commrec gm
 #ifdef GMX_MPI
 static void gmx_sumd_comm(int nr, double r[], MPI_Comm mpi_comm)
 {
-#if defined(MPI_IN_PLACE_EXISTS)
+#if MPI_IN_PLACE_EXISTS
     MPI_Allreduce(MPI_IN_PLACE, r, nr, MPI_DOUBLE, MPI_SUM, mpi_comm);
 #else
     /* this function is only used in code that is not performance critical,
@@ -611,7 +611,7 @@ static void gmx_sumd_comm(int nr, double r[], MPI_Comm mpi_comm)
 #ifdef GMX_MPI
 static void gmx_sumf_comm(int nr, float r[], MPI_Comm mpi_comm)
 {
-#if defined(MPI_IN_PLACE_EXISTS)
+#if MPI_IN_PLACE_EXISTS
     MPI_Allreduce(MPI_IN_PLACE, r, nr, MPI_FLOAT, MPI_SUM, mpi_comm);
 #else
     /* this function is only used in code that is not performance critical,
@@ -654,7 +654,7 @@ void gmx_sumi_sim(int gmx_unused nr, int gmx_unused r[], const gmx_multisim_t gm
 #ifndef GMX_MPI
     gmx_call("gmx_sumi_sim");
 #else
-#if defined(MPI_IN_PLACE_EXISTS)
+#if MPI_IN_PLACE_EXISTS
     MPI_Allreduce(MPI_IN_PLACE, r, nr, MPI_INT, MPI_SUM, ms->mpi_comm_masters);
 #else
     /* this is thread-unsafe, but it will do for now: */
@@ -679,7 +679,7 @@ void gmx_sumli_sim(int gmx_unused nr, gmx_int64_t gmx_unused r[], const gmx_mult
 #ifndef GMX_MPI
     gmx_call("gmx_sumli_sim");
 #else
-#if defined(MPI_IN_PLACE_EXISTS)
+#if MPI_IN_PLACE_EXISTS
     MPI_Allreduce(MPI_IN_PLACE, r, nr, MPI_INT64_T, MPI_SUM,
                   ms->mpi_comm_masters);
 #else
index ffb39b73a597e663b0a41ac2ddb1e5de5ceea40d..f5ec468c734af37e129d0b6aad68002a25b859eb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016, 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.
@@ -38,7 +38,7 @@
 #include "config.h"
 
 #include <stdio.h>
-#ifdef HAVE_NVML
+#if HAVE_NVML
 #include <nvml.h>
 #endif /* HAVE_NVML */
 
@@ -121,7 +121,7 @@ struct gmx_device_info_t
     int                 stat;                   /* result of the device check */
     gmx_bool            nvml_initialized;       /* If NVML was initialized */
     gmx_bool            nvml_ap_clocks_changed; /* If application clocks have been changed */
-#ifdef HAVE_NVML
+#if HAVE_NVML
     nvmlDevice_t        nvml_device_id;         /* NVML device id */
     nvmlEnableState_t   nvml_is_restricted;     /* Status of application clocks permission */
 #endif                                          /* HAVE_NVML */
index 23066688fb8fbfd4dec52878b30538de1d14d87e..3c271547f7da2d523255d667c46b981bc9aa93a6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, 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.
@@ -55,7 +55,7 @@
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
 
-#ifdef HAVE_NVML
+#if HAVE_NVML
 #include <nvml.h>
 #define HAVE_NVML_APPLICATION_CLOCKS (NVML_API_VERSION >= 6)
 #else  /* HAVE_NVML */
@@ -202,7 +202,7 @@ static int do_sanity_checks(int dev_id, cudaDeviceProp *dev_prop)
     return 0;
 }
 
-#ifdef HAVE_NVML
+#if HAVE_NVML
 /* TODO: We should actually be using md_print_warn in md_logging.c,
  * but we can't include mpi.h in CUDA code.
  */
@@ -324,7 +324,7 @@ static gmx_bool init_gpu_application_clocks(FILE gmx_unused *fplog, int gmx_unus
     {
         return true;
     }
-#ifndef HAVE_NVML
+#if !HAVE_NVML
     int cuda_driver  = 0;
     int cuda_runtime = 0;
     cudaDriverGetVersion(&cuda_driver);
index 7e9c993083c5e60c78727cd8c0d387d27f03d597..6c286f96e9970a33738786765bd1b20dfb8b9cb1 100644 (file)
@@ -155,7 +155,7 @@ executeX86CpuID(unsigned int     gmx_unused level,
 #if defined __i386__ || defined __i386 || defined _X86_ || defined _M_IX86 || \
     defined __x86_64__ || defined __amd64__ || defined _M_X64 || defined _M_AMD64
 
-#    if defined __GNUC__ || defined GMX_X86_GCC_INLINE_ASM
+#    if defined __GNUC__ || GMX_X86_GCC_INLINE_ASM
 
     // any compiler that understands gcc inline assembly
     *eax = level;
@@ -412,7 +412,7 @@ detectX86ApicIDs(bool gmx_unused haveX2Apic)
 
     // We cannot just ask for all APIC IDs, but must force execution on each
     // hardware thread and extract the APIC id there.
-#if defined HAVE_SCHED_AFFINITY && defined HAVE_SYSCONF
+#if HAVE_SCHED_AFFINITY && defined HAVE_SYSCONF
     unsigned int   eax, ebx, ecx, edx;
     unsigned int   nApic = sysconf(_SC_NPROCESSORS_ONLN);
     cpu_set_t      saveCpuSet;
index 10180d1a848df4321b6a5f9ce9d82ae6375d3ef3..6efaab2c7a0ff1c7315eeda7699f0bae1faecd28 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -316,7 +316,7 @@ void init_multisystem(t_commrec *cr, int nsim, char **multidirs,
     MPI_Comm_create(MPI_COMM_WORLD, ms->mpi_group_masters,
                     &ms->mpi_comm_masters);
 
-#if !defined(MPI_IN_PLACE_EXISTS)
+#if !MPI_IN_PLACE_EXISTS
     /* initialize the MPI_IN_PLACE replacement buffers */
     snew(ms->mpb, 1);
     ms->mpb->ibuf        = NULL;
index 1db70fec3fb9d48851aac25296ccbd745da0b63f..ae5a06d66b4b8d48fe5d05db62c6b2e60df325b8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016, 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.
@@ -112,7 +112,7 @@ static void signal_handler(int n)
 
 static void gmx_signal(int signum)
 {
-#ifdef HAVE_SIGACTION
+#if HAVE_SIGACTION
     struct sigaction act;
     act.sa_handler = signal_handler;
     sigemptyset(&act.sa_mask);
index 85fa39c533f590d3ccb3e1bc2bf87993b38ff84f..6d13ab57310e71b8b0e3340aacab7c35c9f5f7e3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016, 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.
@@ -42,7 +42,7 @@
 #include <cstdio>
 #include <cstring>
 
-#ifdef HAVE_SCHED_AFFINITY
+#if HAVE_SCHED_AFFINITY
 #  include <sched.h>
 #  include <sys/syscall.h>
 #endif
@@ -438,7 +438,7 @@ gmx_check_thread_affinity_set(FILE            *fplog,
 #endif
     }
 
-#ifdef HAVE_SCHED_AFFINITY
+#if HAVE_SCHED_AFFINITY
     int       ret;
     cpu_set_t mask_current;
 
index ea25d3568b012876cd948b850ccc39c1190fe186..846eb6212ca45357c65a148aee3c00e58c8b84de 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -74,7 +74,7 @@ static void pull_reduce_real(t_commrec   *cr,
         else
         {
 #ifdef GMX_MPI
-#ifdef MPI_IN_PLACE_EXISTS
+#if MPI_IN_PLACE_EXISTS
             MPI_Allreduce(MPI_IN_PLACE, data, n, GMX_MPI_REAL, MPI_SUM,
                           comm->mpi_comm_com);
 #else
@@ -114,7 +114,7 @@ static void pull_reduce_double(t_commrec   *cr,
         else
         {
 #ifdef GMX_MPI
-#ifdef MPI_IN_PLACE_EXISTS
+#if MPI_IN_PLACE_EXISTS
             MPI_Allreduce(MPI_IN_PLACE, data, n, MPI_DOUBLE, MPI_SUM,
                           comm->mpi_comm_com);
 #else
index 09204ae145efabb5af0e3ac5ba094b9a7b9700d1..bd776b8b2274c449b5a8cd6b19e4308c9c387e7b 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2006 David van der Spoel, Erik Lindahl, Berk Hess, University of Groningen.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -75,7 +75,7 @@ gmx_cycles_calibrate(double sampletime)
     return 1.0/static_cast<double>(i.QuadPart);
     /* end of MS Windows implementation */
 
-#elif (defined HAVE_GETTIMEOFDAY)
+#elif HAVE_GETTIMEOFDAY
 
     /*  generic implementation with gettimeofday() */
     struct timeval t1, t2;
index 41317eb5a1a381b4aff925f0462d3304e97952e8..ee102f7305d420b2d14f3b83b3c300f6b3516bcc 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,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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,7 +193,7 @@ walltime_accounting_set_nsteps_done(gmx_walltime_accounting_t   walltime_account
 double
 gmx_gettime()
 {
-#if defined HAVE_CLOCK_GETTIME && _POSIX_TIMERS >= 0 && !(defined __bgq__ && defined __clang__)
+#if 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. The BlueGene/Q CNK only supports gettimeofday,
@@ -206,7 +206,7 @@ gmx_gettime()
     seconds = static_cast<double>(t.tv_sec) + 1e-9*t.tv_nsec;
 
     return seconds;
-#elif defined HAVE_GETTIMEOFDAY
+#elif 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.
@@ -229,7 +229,7 @@ gmx_gettime()
 static double
 gmx_gettime_per_thread()
 {
-#if defined HAVE_CLOCK_GETTIME && _POSIX_THREAD_CPUTIME >= 0
+#if HAVE_CLOCK_GETTIME && _POSIX_THREAD_CPUTIME >= 0
     struct timespec t;
     double          seconds;
 
index 5749e228a8060751722e225c23b61080f1c836b9..6ac192b712d903cfe3c799a3067491686875b04b 100644 (file)
@@ -53,7 +53,7 @@
 #include <string>
 #include <vector>
 
-#ifdef HAVE_DIRENT_H
+#if HAVE_DIRENT_H
 #include <dirent.h>
 #endif
 #if GMX_NATIVE_WINDOWS
@@ -155,7 +155,7 @@ class DirectoryEnumerator::Impl
         _finddata_t  finddata;
         bool         bFirst_;
 };
-#elif defined HAVE_DIRENT_H
+#elif HAVE_DIRENT_H
 class DirectoryEnumerator::Impl
 {
     public:
index 5e94df61dd113a53beb8487f2003e783b9f9fe43..0b5fe92cfed5f0069e297426d027504229075e0d 100644 (file)
@@ -262,10 +262,10 @@ void frewind(FILE *fp)
 
 int gmx_fseek(FILE *stream, gmx_off_t offset, int whence)
 {
-#ifdef HAVE_FSEEKO
+#if HAVE_FSEEKO
     return fseeko(stream, offset, whence);
 #else
-#ifdef HAVE__FSEEKI64
+#if HAVE__FSEEKI64
     return _fseeki64(stream, offset, whence);
 #else
     return fseek(stream, offset, whence);
@@ -275,10 +275,10 @@ int gmx_fseek(FILE *stream, gmx_off_t offset, int whence)
 
 gmx_off_t gmx_ftell(FILE *stream)
 {
-#ifdef HAVE_FSEEKO
+#if HAVE_FSEEKO
     return ftello(stream);
 #else
-#ifdef HAVE__FSEEKI64
+#if HAVE__FSEEKI64
 #ifndef __MINGW32__
     return _ftelli64(stream);
 #else
@@ -757,9 +757,9 @@ int gmx_fsync(FILE *fp)
         int fn;
 
         /* get the file number */
-#if defined(HAVE_FILENO)
+#if HAVE_FILENO
         fn = fileno(fp);
-#elif defined(HAVE__FILENO)
+#elif HAVE__FILENO
         fn = _fileno(fp);
 #else
         fn = -1;
@@ -768,9 +768,9 @@ int gmx_fsync(FILE *fp)
         /* do the actual fsync */
         if (fn >= 0)
         {
-#if (defined(HAVE_FSYNC))
+#if HAVE_FSYNC
             rc = fsync(fn);
-#elif (defined(HAVE__COMMIT))
+#elif HAVE__COMMIT
             rc = _commit(fn);
 #endif
         }
index b2ecbeed9c123e1b8c12e6496cf1a07ea6084810..374b3c04a47495afd43357179808cbbb8a216c2b 100644 (file)
@@ -56,7 +56,7 @@
 #include <Windows.h>
 #include <process.h>
 #endif
-#ifdef HAVE_PWD_H
+#if HAVE_PWD_H
 #include <pwd.h>
 #endif
 #ifdef HAVE_UNISTD_H