#include "xvgr.h"
#include "pbc.h"
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREAD_MPI
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
#include "block_tx.h"
#include "thread_mpi/threads.h"
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREAD_MPI
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
#ifdef GMX_FAHCORE
#include "corewrap.h"
#include "smalloc.h"
#include "gmxfio.h"
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREAD_MPI
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
static gmx_bool bDebug = FALSE;
static char *fatal_tmp_file = NULL;
static FILE *log_file = NULL;
#ifdef GMX_THREAD_MPI
+#include "thread_mpi/threads.h"
static tMPI_Thread_mutex_t debug_mutex = TMPI_THREAD_MUTEX_INITIALIZER;
static tMPI_Thread_mutex_t where_mutex = TMPI_THREAD_MUTEX_INITIALIZER;
static tMPI_Thread_mutex_t fatal_tmp_mutex = TMPI_THREAD_MUTEX_INITIALIZER;
#include <ctype.h>
#include "macros.h"
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-
-#ifdef GMX_THREAD_MPI
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
/* The source code in this file should be thread-safe.
/* This file is completely threadsafe - keep it that way! */
-#ifdef GMX_THREAD_MPI
-#include "thread_mpi/threads.h"
-#endif
-
+#include "gromacs/utility/gmxmpi.h"
#include <stdio.h>
#include <stdlib.h>
if (nelem*elsize >= PRINT_ALLOC_KB*1024)
{
#ifdef GMX_MPI
-#include <mpi.h>
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
#endif
printf("Allocating %.1f MB for %s (called from file %s, line %d on %d)\n",
if (size >= PRINT_ALLOC_KB*1024)
{
#ifdef GMX_MPI
-#include <mpi.h>
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
#endif
printf("Reallocating %.1f MB for %s (called from file %s, line %d on %d)\n",
#ifndef _commrec_h
#define _commrec_h
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#else
-#ifdef GMX_THREAD_MPI
-#include "../thread_mpi/tmpi.h"
-#include "../thread_mpi/mpi_bindings.h"
-#else
-typedef void* MPI_Comm;
-typedef void* MPI_Request;
-typedef void* MPI_Group;
-#define MPI_COMM_NULL NULL
-#endif
-#endif
-
+#include "../../utility/gmxmpi.h"
#include "idef.h"
#ifdef __cplusplus
#include "bondf.h"
#include "gmx_omp_nthreads.h"
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREAD_MPI
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
#define DDRANK(dd, rank) (rank)
#define DDMASTERRANK(dd) (dd->masterrank)
#include <string.h>
#include "domdec_network.h"
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREAD_MPI
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
#define DDMASTERRANK(dd) (dd->masterrank)
#include "gmx_wallcycle.h"
#include "macros.h"
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREADS
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
void GenerateGibbsProbabilities(real *ene, real *p_k, real *pks, int minfep, int maxfep)
{
#endif
#endif
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREAD_MPI
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
#ifdef GMX_OPENMP
/* TODO: Do we still need this? Are we still planning ot use fftw + OpenMP? */
#include "nrnb.h"
#include "bondf.h"
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREAD_MPI
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
#ifdef GMX_X86_SSE2
# ifdef GMX_DOUBLE
#include "mtop_util.h"
#include "genborn.h"
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREAD_MPI
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
/* Only compile this file if SSE2 intrinsics are available */
#if 0 && defined (GMX_X86_SSE2)
#include "mtop_util.h"
#include "genborn.h"
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREAD_MPI
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
/* Only compile this file if SSE intrinsics are available */
#include <string.h>
#include <errno.h>
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREAD_MPI
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
#include "smalloc.h"
#include "gmx_parallel_3dfft.h"
#include "md_logging.h"
#include "string2.h"
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREAD_MPI
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
/* DEBUG_WCYCLE adds consistency checking for the counters.
* It checks if you stop a counter different from the last
#include <config.h>
#endif
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREAD_MPI
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
#include <stdio.h>
#include <string.h>
#include "domdec.h"
#include "sighandler.h"
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREAD_MPI
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
#define PP_PME_CHARGE (1<<0)
#define PP_PME_CHARGEB (1<<1)
#include "nbnxn_kernels/nbnxn_kernel_simd_2xnn.h"
#include "nbnxn_kernels/nbnxn_kernel_gpu_ref.h"
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREAD_MPI
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
#include "adress.h"
#include "qmmm.h"
flags.h
gmx_header_config.h
gmxassert.h
+ gmxmpi.h
programinfo.h
stringutil.h
uniqueptr.h)
--- /dev/null
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2013, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+#ifndef GMX_UTILITY_GMXMPI_H
+#define GMX_UTILITY_GMXMPI_H
+
+#ifdef GMX_LIB_MPI
+/* MPI C++ binding is deprecated and can cause name conflicts (e.g. stdio/mpi seek) */
+#define MPICH_SKIP_MPICXX 1
+#define OMPI_SKIP_MPICXX 1
+#include <mpi.h>
+#else
+#ifdef GMX_THREAD_MPI
+#include "thread_mpi/tmpi.h"
+#include "thread_mpi/mpi_bindings.h"
+#else
+typedef void* MPI_Comm;
+typedef void* MPI_Request;
+typedef void* MPI_Group;
+#define MPI_COMM_NULL NULL
+#endif
+#endif
+
+#endif
#include "types/iteratedconstraints.h"
#include "nbnxn_cuda_data_mgmt.h"
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREAD_MPI
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
#ifdef GMX_FAHCORE
#include "corewrap.h"
#include "gmx_omp.h"
#include "gmx_thread_affinity.h"
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREAD_MPI
-#include "tmpi.h"
-#endif
+#include "gromacs/utility/gmxmpi.h"
#ifdef GMX_FAHCORE
#include "corewrap.h"