1 #ifndef UTILITIES_SRC_MOLPRO_MPI_H_
2 #define UTILITIES_SRC_MOLPRO_MPI_H_
7 #if defined(OMPI_MPI_H) || defined(MPI_INCLUDED)
10 #if defined __has_include
11 #if __has_include(<mpi.h>)
21 #define MPI_Comm_c2f(x) x
22 using MPI_Comm = int64_t;
23 #define MPI_COMM_NULL 0
24 #define MPI_WIN_NULL 0
25 #define MPI_INFO_NULL 0
26 using MPI_Win = int64_t;
27 inline void _MPI_nullfunction(
const void* x) {}
28 #define MPI_Barrier(x) _MPI_nullfunction(&x)
29 #define MPI_Win_free(x) _MPI_nullfunction(x)
30 #define MPI_Win_allocate(x1,x2,x3,x4,x5,x6) _MPI_nullfunction(x5)
31 #define MPI_Win_lock(x1,x2,x3,x4) _MPI_nullfunction(&x4)
32 #define MPI_Win_unlock(x1,x2) _MPI_nullfunction(&x2)
55 MPI_Initialized(&flag);
65 extern "C" int molpro_mppx();
86 MPI_Initialized(&flag);
89 return MPI_COMM_WORLD;
97 return MPI_Comm_f2c(PPIDD_Worker_comm());
101 if (GA_MPI_Comm() != 0 && GA_MPI_Comm() != MPI_COMM_NULL) {
102 return GA_MPI_Comm();
107 return MPI_COMM_WORLD;
141 return MPI_Init(0,
nullptr);
152 return MPI_Finalize();
int64_t mpicomm_global()
C binding of mpi::comm_global(), suitable for calling from Fortran.
Definition: mpi.h:165
int mpi_init()
C binding of mpi::init(), suitable for calling from Fortran.
Definition: mpi.h:185
int64_t mpicomm_self()
C binding of mpi::comm_self(), suitable for calling from Fortran.
Definition: mpi.h:170
int64_t mpisize_global()
C binding of mpi::size_global(), suitable for calling from Fortran.
Definition: mpi.h:175
int64_t mpirank_global()
C binding of mpi::rank_global(), suitable for calling from Fortran.
Definition: mpi.h:180
int mpi_finalize()
C binding of mpi::finalize(), suitable for calling from Fortran.
Definition: mpi.h:190
int finalize()
In MPI environment finalize; otherwise do nothing.
Definition: mpi.h:150
MPI_Comm comm_self()
Return MPI_COMM_SELF in an MPI program, or an appropriate dummy if not.
Definition: mpi.h:52
int rank_global()
Query the rank in the global MPI communicator.
Definition: mpi.h:128
MPI_Comm comm_global()
Return the MPI communicator containing all processes available for participation in computation....
Definition: mpi.h:80
int init()
In MPI environment initialize; otherwise do nothing. Intended to support MPI-agnostic programs.
Definition: mpi.h:139
int size_global()
Query the size of the global MPI communicator.
Definition: mpi.h:116
Class that manages input options.
Definition: iostream.h:14