Also, remove a few unused ones.
Change-Id: I1ce3f3345173a5fdfe7aa772008a3206b2118f46
#
# 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.
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")
#
# 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.
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")
#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
/*
* 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.
}
#ifndef GMX_MPI
-#ifdef HAVE_GETTIMEOFDAY
+#if HAVE_GETTIMEOFDAY
#include <sys/time.h>
double MPI_Wtime()
{
*
* 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.
#include <cstdio>
#include <cstring>
-#ifdef HAVE_IO_H
+#if HAVE_IO_H
#include <io.h>
#endif
#ifdef HAVE_UNISTD_H
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);
*
* 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.
// 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;
#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)
#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. */
#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 */
#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 */
#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,
#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,
#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: */
#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
/*
* 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.
#include "config.h"
#include <stdio.h>
-#ifdef HAVE_NVML
+#if HAVE_NVML
#include <nvml.h>
#endif /* HAVE_NVML */
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 */
/*
* 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.
#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 */
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.
*/
{
return true;
}
-#ifndef HAVE_NVML
+#if !HAVE_NVML
int cuda_driver = 0;
int cuda_runtime = 0;
cudaDriverGetVersion(&cuda_driver);
#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;
// 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;
*
* 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.
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;
*
* 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.
static void gmx_signal(int signum)
{
-#ifdef HAVE_SIGACTION
+#if HAVE_SIGACTION
struct sigaction act;
act.sa_handler = signal_handler;
sigemptyset(&act.sa_mask);
/*
* 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.
#include <cstdio>
#include <cstring>
-#ifdef HAVE_SCHED_AFFINITY
+#if HAVE_SCHED_AFFINITY
# include <sched.h>
# include <sys/syscall.h>
#endif
#endif
}
-#ifdef HAVE_SCHED_AFFINITY
+#if HAVE_SCHED_AFFINITY
int ret;
cpu_set_t mask_current;
*
* 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.
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
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
* 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.
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;
* 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.
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,
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.
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;
#include <string>
#include <vector>
-#ifdef HAVE_DIRENT_H
+#if HAVE_DIRENT_H
#include <dirent.h>
#endif
#if GMX_NATIVE_WINDOWS
_finddata_t finddata;
bool bFirst_;
};
-#elif defined HAVE_DIRENT_H
+#elif HAVE_DIRENT_H
class DirectoryEnumerator::Impl
{
public:
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);
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
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;
/* 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
}
#include <Windows.h>
#include <process.h>
#endif
-#ifdef HAVE_PWD_H
+#if HAVE_PWD_H
#include <pwd.h>
#endif
#ifdef HAVE_UNISTD_H