From 03010aede0c380b63da50ad7492b0f2a2b8525e2 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Mon, 19 Nov 2012 14:36:52 -0300 Subject: [PATCH 01/56] MPI-3: Fix prototype of MPI_Compare_and_swap() --- src/include/mpi4py/mpi.pxi | 2 +- src/missing.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/mpi4py/mpi.pxi b/src/include/mpi4py/mpi.pxi index 78428d1..5ae2371 100644 --- a/src/include/mpi4py/mpi.pxi +++ b/src/include/mpi4py/mpi.pxi @@ -558,7 +558,7 @@ cdef extern from "mpi.h" nogil: int MPI_Accumulate(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Op, MPI_Win) int MPI_Get_accumulate(void*, int, MPI_Datatype, void*, int,MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Op, MPI_Win) int MPI_Fetch_and_op(void*, void*, MPI_Datatype, int, MPI_Aint, MPI_Op, MPI_Win) - int MPI_Compare_and_swap(void*, void*, void*, MPI_Datatype, int, MPI_Aint, MPI_Op, MPI_Win) + int MPI_Compare_and_swap(void*, void*, void*, MPI_Datatype, int, MPI_Aint, MPI_Win) int MPI_Rget(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win, MPI_Request*) int MPI_Rput(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win, MPI_Request*) diff --git a/src/missing.h b/src/missing.h index ae06457..cf8401f 100644 --- a/src/missing.h +++ b/src/missing.h @@ -2201,7 +2201,7 @@ typedef int (PyMPI_MPI_Delete_function)(MPI_Comm,int,void*,void*); #ifdef PyMPI_MISSING_MPI_Compare_and_swap #undef MPI_Compare_and_swap -#define MPI_Compare_and_swap(a1,a2,a3,a4,a5,a6,a7,a8) PyMPI_UNAVAILABLE("MPI_Compare_and_swap",a1,a2,a3,a4,a5,a6,a7,a8) +#define MPI_Compare_and_swap(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Compare_and_swap",a1,a2,a3,a4,a5,a6,a7) #endif #ifdef PyMPI_MISSING_MPI_Rget From e645e6f8cdd5192891a6f17b487d1ce0bb29c535 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Tue, 20 Nov 2012 13:04:39 -0300 Subject: [PATCH 02/56] MPI-3: Handle MPI_WEIGHTS_EMPTY --- src/MPI/Comm.pyx | 12 +++++------- src/MPI/MPI.pyx | 6 +++++- src/MPI/commimpl.pxi | 25 +++++++++++++++++++++++++ src/config/mpi-30.h | 2 ++ src/include/mpi4py/mpi.pxi | 1 + src/missing.h | 5 +++++ 6 files changed, 43 insertions(+), 8 deletions(-) diff --git a/src/MPI/Comm.pyx b/src/MPI/Comm.pyx index 10e2134..975b27b 100644 --- a/src/MPI/Comm.pyx +++ b/src/MPI/Comm.pyx @@ -1304,13 +1304,12 @@ cdef class Intracomm(Comm): cdef int *idestweight = MPI_UNWEIGHTED if sources is not None: sources = getarray_int(sources, &indegree, &isource) - if sourceweights is not None: - sourceweights = chkarray_int( - sourceweights, indegree, &isourceweight) + sourceweights = asarray_weights( + sourceweights, indegree, &isourceweight) if destinations is not None: destinations = getarray_int(destinations, &outdegree, &idest) - if destweights is not None: - destweights = chkarray_int(destweights, outdegree, &idestweight) + destweights = asarray_weights( + destweights, outdegree, &idestweight) cdef MPI_Info cinfo = arg_Info(info) # cdef Distgraphcomm comm = \ @@ -1334,8 +1333,7 @@ cdef class Intracomm(Comm): degrees = chkarray_int(degrees, nv, &idegree) for i from 0 <= i < nv: ne += idegree[i] destinations = chkarray_int(destinations, ne, &idest) - if weights is not None: - weights = chkarray_int(weights, ne, &iweight) + weights = asarray_weights(weights, ne, &iweight) cdef MPI_Info cinfo = arg_Info(info) # cdef Distgraphcomm comm = \ diff --git a/src/MPI/MPI.pyx b/src/MPI/MPI.pyx index 6603637..33491e5 100644 --- a/src/MPI/MPI.pyx +++ b/src/MPI/MPI.pyx @@ -57,6 +57,11 @@ BOTTOM = __BOTTOM__ IN_PLACE = __IN_PLACE__ #"""*In-place* option for collective communications""" +UNWEIGHTED = __UNWEIGHTED__ +#"""Unweighted graph""" + +WEIGHTS_EMPTY = __WEIGHTS_EMPTY__ +#"""Empty graph weights""" # Predefined Attribute Keyvals @@ -100,7 +105,6 @@ def Free_mem(memory): asmemory(memory, &base, NULL) CHKERR( MPI_Free_mem(base) ) - # Initialization and Exit # ----------------------- diff --git a/src/MPI/commimpl.pxi b/src/MPI/commimpl.pxi index 9dc0053..0d6efbc 100644 --- a/src/MPI/commimpl.pxi +++ b/src/MPI/commimpl.pxi @@ -133,3 +133,28 @@ cdef inline object detach_buffer(void *p, int n): return ob # ----------------------------------------------------------------------------- + +cdef object __UNWEIGHTED__ = MPI_UNWEIGHTED + +cdef object __WEIGHTS_EMPTY__ = MPI_WEIGHTS_EMPTY + +cdef object asarray_weights(object weights, int nweight, int **iweight): + # + if weights is None: + iweight[0] = MPI_UNWEIGHTED + return None + # + if weights is __WEIGHTS_EMPTY__: + if MPI_WEIGHTS_EMPTY != MPI_UNWEIGHTED: + iweight[0] = MPI_WEIGHTS_EMPTY + return None + else: + return newarray_int(nweight, iweight) + # + if weights is __UNWEIGHTED__: + iweight[0] = MPI_UNWEIGHTED + return None + # + return chkarray_int(weights, nweight, iweight) + +# ----------------------------------------------------------------------------- diff --git a/src/config/mpi-30.h b/src/config/mpi-30.h index e5e1e36..6c76973 100644 --- a/src/config/mpi-30.h +++ b/src/config/mpi-30.h @@ -41,6 +41,8 @@ #define PyMPI_MISSING_MPI_Iscan 1 #define PyMPI_MISSING_MPI_Iexscan 1 +#define PyMPI_MISSING_MPI_WEIGHTS_EMPTY 1 + #define PyMPI_MISSING_MPI_Comm_dup_with_info 1 #define PyMPI_MISSING_MPI_Comm_idup 1 #define PyMPI_MISSING_MPI_Comm_create_group 1 diff --git a/src/include/mpi4py/mpi.pxi b/src/include/mpi4py/mpi.pxi index 5ae2371..53d23fe 100644 --- a/src/include/mpi4py/mpi.pxi +++ b/src/include/mpi4py/mpi.pxi @@ -461,6 +461,7 @@ cdef extern from "mpi.h" nogil: enum: MPI_DIST_GRAPH #:= MPI_UNDEFINED int* MPI_UNWEIGHTED #:= 0 + int* MPI_WEIGHTS_EMPTY #:= MPI_UNWEIGHTED int MPI_Dist_graph_create_adjacent(MPI_Comm, int, int[], int[], int, int[], int[], MPI_Info, int, MPI_Comm*) int MPI_Dist_graph_create(MPI_Comm, int, int[], int[], int[], int[], MPI_Info, int, MPI_Comm*) int MPI_Dist_graph_neighbors_count(MPI_Comm, int*, int*, int*) diff --git a/src/missing.h b/src/missing.h index cf8401f..db12430 100644 --- a/src/missing.h +++ b/src/missing.h @@ -1796,6 +1796,11 @@ typedef void (PyMPI_MPI_User_function)(void*, void*, int*, MPI_Datatype*); #define MPI_UNWEIGHTED ((int*)0) #endif +#ifdef PyMPI_MISSING_MPI_WEIGHTS_EMPTY +#undef MPI_WEIGHTS_EMPTY +#define MPI_WEIGHTS_EMPTY ((int*)MPI_UNWEIGHTED) +#endif + #ifdef PyMPI_MISSING_MPI_Dist_graph_create_adjacent #undef MPI_Dist_graph_create_adjacent #define MPI_Dist_graph_create_adjacent(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) PyMPI_UNAVAILABLE("MPI_Dist_graph_create_adjacent",a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) From 1eea796fa6f167f03ded991bd4e2ca0cb4c1abbe Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Tue, 20 Nov 2012 13:16:19 -0300 Subject: [PATCH 03/56] PyPy: Update classmethod hack for Prequest and Grequest --- src/MPI/MPI.pyx | 2 ++ src/atimport.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MPI/MPI.pyx b/src/MPI/MPI.pyx index 33491e5..b9eaf56 100644 --- a/src/MPI/MPI.pyx +++ b/src/MPI/MPI.pyx @@ -287,6 +287,8 @@ def _pypy_setup(): Status, Datatype, Request, + Prequest, + Grequest, Message, Op, Group, diff --git a/src/atimport.h b/src/atimport.h index d6baaa4..61ffdff 100644 --- a/src/atimport.h +++ b/src/atimport.h @@ -323,7 +323,7 @@ PyMemoryView_FromBuffer(Py_buffer *view) #ifdef PYPY_VERSION -static int +static int PyMPI_UNUSED _PyLong_AsByteArray(PyLongObject* v, unsigned char* bytes, size_t n, int little_endian, int is_signed) From a33cebfde32f8d9a047dd39082d4e4a04ffbb113 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Wed, 21 Nov 2012 19:17:51 -0300 Subject: [PATCH 04/56] MPI-3: Update after testing with mpich-3.0rc1 --- conf/mpiconfig.py | 1 + misc/env-mpich3.bat | 3 ++ misc/env-mpich3.sh | 4 ++ mpi.cfg | 20 ++++++++++ setup.py | 6 ++- src/atimport.h | 9 ++++- src/compat/mpich3.h | 4 ++ src/config/mpich3-io.h | 86 ++++++++++++++++++++++++++++++++++++++++++ src/config/mpich3.h | 18 +++++++++ src/vendor.h | 18 +++++++++ test/test_comm.py | 5 ++- test/test_environ.py | 3 +- test/test_info.py | 20 ++++------ test/test_pack.py | 2 +- test/test_spawn.py | 17 ++++----- 15 files changed, 188 insertions(+), 28 deletions(-) create mode 100644 misc/env-mpich3.bat create mode 100644 misc/env-mpich3.sh create mode 100644 src/compat/mpich3.h create mode 100644 src/config/mpich3-io.h create mode 100644 src/config/mpich3.h diff --git a/conf/mpiconfig.py b/conf/mpiconfig.py index 53db45a..09a52f9 100644 --- a/conf/mpiconfig.py +++ b/conf/mpiconfig.py @@ -145,6 +145,7 @@ def _setup_windows(self): from glob import glob ProgramFiles = os.environ.get('ProgramFiles', '') for (name, install_suffix) in ( + ('mpich3', 'MPICH'), ('mpich2', 'MPICH2'), ('openmpi', 'OpenMPI'), ('openmpi', 'OpenMPI*'), diff --git a/misc/env-mpich3.bat b/misc/env-mpich3.bat new file mode 100644 index 0000000..dcd043c --- /dev/null +++ b/misc/env-mpich3.bat @@ -0,0 +1,3 @@ +@echo off +set MPIDIR=%ProgramFiles%\MPICH +set PATH=%MPIDIR%\bin;%PATH% \ No newline at end of file diff --git a/misc/env-mpich3.sh b/misc/env-mpich3.sh new file mode 100644 index 0000000..d972fe8 --- /dev/null +++ b/misc/env-mpich3.sh @@ -0,0 +1,4 @@ +# -*- shell-script -*- +export MPI_DIR=/home/devel/mpi/mpich-3.0rc1 +export PATH=$MPI_DIR/bin:$PATH +export LD_LIBRARY_PATH=$MPI_DIR/lib:$LD_LIBRARY_PATH diff --git a/mpi.cfg b/mpi.cfg index 595d685..9c5b6e2 100644 --- a/mpi.cfg +++ b/mpi.cfg @@ -39,6 +39,18 @@ +# MPICH3 example +# -------------- +[mpich3] +mpi_dir = /home/devel/mpi/mpich-3.0rc1 +mpicc = %(mpi_dir)s/bin/mpicc +mpicxx = %(mpi_dir)s/bin/mpicxx +#include_dirs = %(mpi_dir)s/include +#libraries = mpich opa mpl rt +#library_dirs = %(mpi_dir)s/lib +#runtime_library_dirs = %(library_dirs)s + + # MPICH2 example # -------------- [mpich2] @@ -108,6 +120,14 @@ mpicc = mpcc_r mpicxx = mpCC_r +# MPICH3 example (Windows) +# ------------------------ +[mpich3-windows] +mpi_dir = $ProgramFiles\MPICH +include_dirs = %(mpi_dir)s\include +libraries = mpi +library_dirs = %(mpi_dir)s\lib + # MPICH2 example (Windows) # ------------------------ [mpich2-windows] diff --git a/setup.py b/setup.py index 3f991ca..2914ffc 100644 --- a/setup.py +++ b/setup.py @@ -202,12 +202,14 @@ def configure_mpi(ext, config_cmd): if not ok: raise DistutilsPlatformError(errmsg % "link") # log.info("checking for missing MPI functions/symbols ...") - macros = ("MPICH2", "OPEN_MPI", "DEINO_MPI", "MSMPI_VER",) + tests = ["defined(%s)" % macro for macro in + ("OPEN_MPI", "MPICH2", "DEINO_MPI", "MSMPI_VER",)] + tests += ["(defined(MPICH_NAME)&&(MPICH_NAME==3))"] ConfigTest = dedent('''\ #if !(%s) #error "Unknown MPI" #endif - ''') % "||".join(["defined(%s)" % m for m in macros]) + ''') % "||".join(tests) ok = config_cmd.try_compile(ConfigTest, headers=headers) if not ok: from conf.mpidistutils import ConfigureMPI diff --git a/src/atimport.h b/src/atimport.h index 61ffdff..2f03e56 100644 --- a/src/atimport.h +++ b/src/atimport.h @@ -14,6 +14,9 @@ #define MPICH2 1 #endif #endif +#if defined(MPICH_NAME) && (MPICH_NAME==3) + #define MPICH3 1 +#endif #if defined(MPICH_NAME) && (MPICH_NAME==1) #define MPICH1 1 #endif @@ -32,6 +35,8 @@ /* XXX describe */ #if defined(HAVE_CONFIG_H) #include "config.h" +#elif defined(MPICH3) +#include "config/mpich3.h" #elif defined(MPICH2) #include "config/mpich2.h" #elif defined(OPEN_MPI) @@ -45,7 +50,9 @@ #include "fallback.h" /* XXX describe */ -#if defined(MPICH2) +#if defined(MPICH3) +#include "compat/mpich3.h" +#elif defined(MPICH2) #include "compat/mpich2.h" #elif defined(OPEN_MPI) #include "compat/openmpi.h" diff --git a/src/compat/mpich3.h b/src/compat/mpich3.h new file mode 100644 index 0000000..747a7cd --- /dev/null +++ b/src/compat/mpich3.h @@ -0,0 +1,4 @@ +#ifndef PyMPI_COMPAT_MPICH3_H +#define PyMPI_COMPAT_MPICH3_H + +#endif /* !PyMPI_COMPAT_MPICH3_H */ diff --git a/src/config/mpich3-io.h b/src/config/mpich3-io.h new file mode 100644 index 0000000..a7f3567 --- /dev/null +++ b/src/config/mpich3-io.h @@ -0,0 +1,86 @@ +#ifndef PyMPI_CONFIG_MPICH3_IO_H +#define PyMPI_CONFIG_MPICH3_IO_H + +#define PyMPI_MISSING_MPI_File 1 +#define PyMPI_MISSING_MPI_FILE_NULL 1 +#define PyMPI_MISSING_MPI_MODE_RDONLY 1 +#define PyMPI_MISSING_MPI_MODE_RDWR 1 +#define PyMPI_MISSING_MPI_MODE_WRONLY 1 +#define PyMPI_MISSING_MPI_MODE_CREATE 1 +#define PyMPI_MISSING_MPI_MODE_EXCL 1 +#define PyMPI_MISSING_MPI_MODE_DELETE_ON_CLOSE 1 +#define PyMPI_MISSING_MPI_MODE_UNIQUE_OPEN 1 +#define PyMPI_MISSING_MPI_MODE_APPEND 1 +#define PyMPI_MISSING_MPI_MODE_SEQUENTIAL 1 +#define PyMPI_MISSING_MPI_File_open 1 +#define PyMPI_MISSING_MPI_File_close 1 +#define PyMPI_MISSING_MPI_File_delete 1 +#define PyMPI_MISSING_MPI_File_set_size 1 +#define PyMPI_MISSING_MPI_File_preallocate 1 +#define PyMPI_MISSING_MPI_File_get_size 1 +#define PyMPI_MISSING_MPI_File_get_group 1 +#define PyMPI_MISSING_MPI_File_get_amode 1 +#define PyMPI_MISSING_MPI_File_set_info 1 +#define PyMPI_MISSING_MPI_File_get_info 1 +#define PyMPI_MISSING_MPI_File_get_view 1 +#define PyMPI_MISSING_MPI_File_set_view 1 +#define PyMPI_MISSING_MPI_File_read_at 1 +#define PyMPI_MISSING_MPI_File_read_at_all 1 +#define PyMPI_MISSING_MPI_File_write_at 1 +#define PyMPI_MISSING_MPI_File_write_at_all 1 +#define PyMPI_MISSING_MPI_File_iread_at 1 +#define PyMPI_MISSING_MPI_File_iwrite_at 1 +#define PyMPI_MISSING_MPI_SEEK_SET 1 +#define PyMPI_MISSING_MPI_SEEK_CUR 1 +#define PyMPI_MISSING_MPI_SEEK_END 1 +#define PyMPI_MISSING_MPI_DISPLACEMENT_CURRENT 1 +#define PyMPI_MISSING_MPI_File_seek 1 +#define PyMPI_MISSING_MPI_File_get_position 1 +#define PyMPI_MISSING_MPI_File_get_byte_offset 1 +#define PyMPI_MISSING_MPI_File_read 1 +#define PyMPI_MISSING_MPI_File_read_all 1 +#define PyMPI_MISSING_MPI_File_write 1 +#define PyMPI_MISSING_MPI_File_write_all 1 +#define PyMPI_MISSING_MPI_File_iread 1 +#define PyMPI_MISSING_MPI_File_iwrite 1 +#define PyMPI_MISSING_MPI_File_read_shared 1 +#define PyMPI_MISSING_MPI_File_write_shared 1 +#define PyMPI_MISSING_MPI_File_iread_shared 1 +#define PyMPI_MISSING_MPI_File_iwrite_shared 1 +#define PyMPI_MISSING_MPI_File_read_ordered 1 +#define PyMPI_MISSING_MPI_File_write_ordered 1 +#define PyMPI_MISSING_MPI_File_seek_shared 1 +#define PyMPI_MISSING_MPI_File_get_position_shared 1 +#define PyMPI_MISSING_MPI_File_read_at_all_begin 1 +#define PyMPI_MISSING_MPI_File_read_at_all_end 1 +#define PyMPI_MISSING_MPI_File_write_at_all_begin 1 +#define PyMPI_MISSING_MPI_File_write_at_all_end 1 +#define PyMPI_MISSING_MPI_File_read_all_begin 1 +#define PyMPI_MISSING_MPI_File_read_all_end 1 +#define PyMPI_MISSING_MPI_File_write_all_begin 1 +#define PyMPI_MISSING_MPI_File_write_all_end 1 +#define PyMPI_MISSING_MPI_File_read_ordered_begin 1 +#define PyMPI_MISSING_MPI_File_read_ordered_end 1 +#define PyMPI_MISSING_MPI_File_write_ordered_begin 1 +#define PyMPI_MISSING_MPI_File_write_ordered_end 1 +#define PyMPI_MISSING_MPI_File_get_type_extent 1 +#define PyMPI_MISSING_MPI_File_set_atomicity 1 +#define PyMPI_MISSING_MPI_File_get_atomicity 1 +#define PyMPI_MISSING_MPI_File_sync 1 +#define PyMPI_MISSING_MPI_File_get_errhandler 1 +#define PyMPI_MISSING_MPI_File_set_errhandler 1 +#define PyMPI_MISSING_MPI_File_errhandler_fn 1 +#define PyMPI_MISSING_MPI_File_errhandler_function 1 +#define PyMPI_MISSING_MPI_File_create_errhandler 1 +#define PyMPI_MISSING_MPI_File_call_errhandler 1 + +#define PyMPI_MISSING_MPI_Datarep_conversion_function 1 +#define PyMPI_MISSING_MPI_Datarep_extent_function 1 +#define PyMPI_MISSING_MPI_CONVERSION_FN_NULL 1 +#define PyMPI_MISSING_MPI_MAX_DATAREP_STRING 1 +#define PyMPI_MISSING_MPI_Register_datarep 1 + +#define PyMPI_MISSING_MPI_File_c2f 1 +#define PyMPI_MISSING_MPI_File_f2c 1 + +#endif /* !PyMPI_CONFIG_MPICH3_IO_H */ diff --git a/src/config/mpich3.h b/src/config/mpich3.h new file mode 100644 index 0000000..2708e5a --- /dev/null +++ b/src/config/mpich3.h @@ -0,0 +1,18 @@ +#ifndef PyMPI_CONFIG_MPICH2_H +#define PyMPI_CONFIG_MPICH2_H + +/* These types are Open MPI extensions */ +#define PyMPI_MISSING_MPI_LOGICAL1 1 +#define PyMPI_MISSING_MPI_LOGICAL2 1 +#define PyMPI_MISSING_MPI_LOGICAL4 1 +#define PyMPI_MISSING_MPI_LOGICAL8 1 + +/* These types are difficult to implement portably */ +#define PyMPI_MISSING_MPI_REAL2 1 +#define PyMPI_MISSING_MPI_COMPLEX4 1 + +#ifndef ROMIO_VERSION +#include "mpich3-io.h" +#endif + +#endif /* !PyMPI_CONFIG_MPICH2_H */ diff --git a/src/vendor.h b/src/vendor.h index 6a4cec9..bb5de0c 100644 --- a/src/vendor.h +++ b/src/vendor.h @@ -24,6 +24,24 @@ static int MPI_Get_vendor(const char **vendor_name, const char* name="unknown"; int major=0, minor=0, micro=0; + /* MPICH3 */ +#if defined(MPICH3) + #if defined(MPICH_NUMVERSION) + {int version = MPICH_NUMVERSION/1000; + major = version/10000; version -= major*10000; + minor = version/100; version -= minor*100; + micro = version/1; version -= micro*1;} + #elif defined(MPICH_VERSION) + myVersionParser(MPICH_VERSION,major,minor,micro); + #endif + name = "MPICH"; + #if defined(DEINO_MPI) + name = "DeinoMPI"; + #elif defined(MS_MPI) + name = "Microsoft MPI"; + #endif +#endif + /* MPICH2 */ #if defined(MPICH2) #if defined(MPICH2_NUMVERSION) diff --git a/test/test_comm.py b/test/test_comm.py index 9926152..d50ad04 100644 --- a/test/test_comm.py +++ b/test/test_comm.py @@ -57,7 +57,10 @@ def testIsInter(self): self.assertTrue(type(is_inter) is bool) def testGetSetName(self): - name = self.COMM.Get_name() + try: + name = self.COMM.Get_name() + except NotImplementedError: + return self.COMM.Set_name('comm') self.assertEqual(self.COMM.Get_name(), 'comm') self.COMM.Set_name(name) diff --git a/test/test_environ.py b/test/test_environ.py index 3801f0f..6d5d3d8 100644 --- a/test/test_environ.py +++ b/test/test_environ.py @@ -90,8 +90,7 @@ def testLastUsedCode(self): self.assertTrue(lastuc >= 0) _name, _version = MPI.get_vendor() -if (_name == 'MPICH2' and - _version > (1, 2)): +if (_name in ('MPICH', 'MPICH2') and _version > (1, 2)): # Up to mpich2-1.3.1 when running under Hydra process manager, # getting the universe size fails for the singleton init case if MPI.COMM_WORLD.Get_attr(MPI.APPNUM) is None: diff --git a/test/test_info.py b/test/test_info.py index 2a6abc7..19e413c 100644 --- a/test/test_info.py +++ b/test/test_info.py @@ -26,18 +26,14 @@ def testTruth(self): self.assertTrue(bool(MPI.INFO_ENV)) def testPyMethods(self): - ienv = MPI.INFO_NULL - def getitem(): return inull['k'] - def setitem(): inull['k'] = 'v' - def delitem(): del inull['k'] - self.assertEqual(len(inull), 0) - self.assertFalse('key' in inull) - self.assertRaises(KeyError, getitem) - self.assertRaises(KeyError, setitem) - self.assertRaises(KeyError, delitem) - self.assertEqual(inull.keys(), []) - self.assertEqual(inull.values(), []) - self.assertEqual(inull.items(), []) + env = MPI.INFO_ENV + if env == MPI.INFO_NULL: return + for key in ("command", "argv", + "maxprocs", "soft", + "host", "arch", + "wdir", "file", + "thread_level"): + v = env.Get(key) class TestInfo(unittest.TestCase): diff --git a/test/test_pack.py b/test/test_pack.py index b6d7fb7..62e55f2 100644 --- a/test/test_pack.py +++ b/test/test_pack.py @@ -106,7 +106,7 @@ class TestPackExternal(BaseTestPackExternal, unittest.TestCase): if _version < (1, 5, 0): del BaseTestPackExternal del TestPackExternal -elif _name in ('MPICH2', 'DeinoMPI'): +elif _name in ('MPICH', 'MPICH2', 'DeinoMPI'): BaseTestPackExternal.skipdtype += ['l'] BaseTestPackExternal.skipdtype += ['d'] else: diff --git a/test/test_spawn.py b/test/test_spawn.py index 0b014b6..f914fab 100644 --- a/test/test_spawn.py +++ b/test/test_spawn.py @@ -146,15 +146,14 @@ class TestSpawnWorldMany(BaseTestSpawn, unittest.TestCase): del TestSpawnWorld del TestSpawnSelfMany del TestSpawnWorldMany -elif _name == 'MPICH2': - if _version > (1, 2): - # Up to mpich2-1.3.1 when running under Hydra process manager, - # spawn fails for the singleton init case - if MPI.COMM_WORLD.Get_attr(MPI.APPNUM) is None: - del TestSpawnSelf - del TestSpawnWorld - del TestSpawnSelfMany - del TestSpawnWorldMany +elif (_name in ('MPICH', 'MPICH2') and _version > (1, 2)): + # Up to mpich2-1.3.1 when running under Hydra process manager, + # spawn fails for the singleton init case + if MPI.COMM_WORLD.Get_attr(MPI.APPNUM) is None: + del TestSpawnSelf + del TestSpawnWorld + del TestSpawnSelfMany + del TestSpawnWorldMany if __name__ == '__main__': unittest.main() From 04c3f469a872d61b06eb4ead6a8ba79afbd7d078 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Thu, 22 Nov 2012 14:58:00 -0300 Subject: [PATCH 05/56] Issue #34: Backward compatibility for MPI_Message in mpi4py/mpi4py.h --- src/include/mpi4py/mpi4py.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/include/mpi4py/mpi4py.h b/src/include/mpi4py/mpi4py.h index 5041db5..b0a83a0 100644 --- a/src/include/mpi4py/mpi4py.h +++ b/src/include/mpi4py/mpi4py.h @@ -6,6 +6,11 @@ #include "mpi.h" +#if (MPI_VERSION < 3) && !defined(_MPI4PY_HAVE_MPI_MESSAGE) +typedef void *PyMPI_MPI_Message; +#define MPI_Message PyMPI_MPI_Message +#endif + #include "mpi4py.MPI_api.h" static int import_mpi4py(void) { From 8b56e0a41a4a05365b6c3b5233396a3d1bff6d90 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Thu, 22 Nov 2012 15:12:02 -0300 Subject: [PATCH 06/56] MPI-3: Make MPI_Count alias MPI_Aint for MPI<=2 --- src/include/mpi4py/mpi.pxi | 2 +- src/missing.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/mpi4py/mpi.pxi b/src/include/mpi4py/mpi.pxi index 53d23fe..7d6bc83 100644 --- a/src/include/mpi4py/mpi.pxi +++ b/src/include/mpi4py/mpi.pxi @@ -7,7 +7,7 @@ cdef extern from "mpi.h" nogil: ctypedef long MPI_Aint ctypedef long long MPI_Offset #:= long - ctypedef long long MPI_Count #:= long + ctypedef long long MPI_Count #:= MPI_Aint ctypedef struct MPI_Status: int MPI_SOURCE diff --git a/src/missing.h b/src/missing.h index db12430..b5a0039 100644 --- a/src/missing.h +++ b/src/missing.h @@ -31,7 +31,7 @@ typedef long PyMPI_MPI_Offset; #ifdef PyMPI_MISSING_MPI_Count #undef MPI_Count -typedef long PyMPI_MPI_Count; +typedef MPI_Aint PyMPI_MPI_Count; #define MPI_Count PyMPI_MPI_Count #endif From d2a202178aeaf0158522baa6247898c6ff9d8a5b Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Thu, 27 Dec 2012 13:16:41 -0300 Subject: [PATCH 07/56] MPI-3: Fix bad MPI_ERR_RMA_WRONG_FLAVOR to MPI_ERR_RMA_FLAVOR --- src/MPI/Exception.pyx | 22 +++++++++++----------- src/config/mpi-30.h | 4 ++-- src/config/mpich2.h | 10 +++++----- src/include/mpi4py/mpi.pxi | 2 +- src/missing.h | 6 +++--- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/MPI/Exception.pyx b/src/MPI/Exception.pyx index c81f1cf..67e4634 100644 --- a/src/MPI/Exception.pyx +++ b/src/MPI/Exception.pyx @@ -70,17 +70,17 @@ ERR_QUOTA = MPI_ERR_QUOTA ERR_SERVICE = MPI_ERR_SERVICE ERR_SPAWN = MPI_ERR_SPAWN # Windows -ERR_BASE = MPI_ERR_BASE -ERR_SIZE = MPI_ERR_SIZE -ERR_DISP = MPI_ERR_DISP -ERR_ASSERT = MPI_ERR_ASSERT -ERR_LOCKTYPE = MPI_ERR_LOCKTYPE -ERR_RMA_CONFLICT = MPI_ERR_RMA_CONFLICT -ERR_RMA_SYNC = MPI_ERR_RMA_SYNC -ERR_RMA_RANGE = MPI_ERR_RMA_RANGE -ERR_RMA_ATTACH = MPI_ERR_RMA_ATTACH -ERR_RMA_SHARED = MPI_ERR_RMA_SHARED -ERR_RMA_WRONG_FLAVOR = MPI_ERR_RMA_WRONG_FLAVOR +ERR_BASE = MPI_ERR_BASE +ERR_SIZE = MPI_ERR_SIZE +ERR_DISP = MPI_ERR_DISP +ERR_ASSERT = MPI_ERR_ASSERT +ERR_LOCKTYPE = MPI_ERR_LOCKTYPE +ERR_RMA_CONFLICT = MPI_ERR_RMA_CONFLICT +ERR_RMA_SYNC = MPI_ERR_RMA_SYNC +ERR_RMA_RANGE = MPI_ERR_RMA_RANGE +ERR_RMA_ATTACH = MPI_ERR_RMA_ATTACH +ERR_RMA_SHARED = MPI_ERR_RMA_SHARED +ERR_RMA_FLAVOR = MPI_ERR_RMA_FLAVOR diff --git a/src/config/mpi-30.h b/src/config/mpi-30.h index 6c76973..287e8c8 100644 --- a/src/config/mpi-30.h +++ b/src/config/mpi-30.h @@ -89,10 +89,10 @@ #define PyMPI_MISSING_MPI_Win_flush_local_all 1 #define PyMPI_MISSING_MPI_Win_sync 1 -#define PyMPI_MISSING_MPI_ERR_RMA_RANGE 1 +#define PyMPI_MISSING_MPI_ERR_RMA_RANGE 1 #define PyMPI_MISSING_MPI_ERR_RMA_ATTACH 1 #define PyMPI_MISSING_MPI_ERR_RMA_SHARED 1 -#define PyMPI_MISSING_MPI_ERR_RMA_WRONG_FLAVOR 1 +#define PyMPI_MISSING_MPI_ERR_RMA_FLAVOR 1 #define PyMPI_MISSING_MPI_MAX_LIBRARY_VERSION_STRING 1 #define PyMPI_MISSING_MPI_Get_library_version 1 diff --git a/src/config/mpich2.h b/src/config/mpich2.h index 38acfa5..feb8158 100644 --- a/src/config/mpich2.h +++ b/src/config/mpich2.h @@ -186,11 +186,11 @@ #undef PyMPI_MISSING_MPI_ERR_RMA_RANGE #undef PyMPI_MISSING_MPI_ERR_RMA_ATTACH #undef PyMPI_MISSING_MPI_ERR_RMA_SHARED -#undef PyMPI_MISSING_MPI_ERR_RMA_WRONG_FLAVOR -#define MPI_ERR_RMA_RANGE MPIX_ERR_RMA_RANGE -#define MPI_ERR_RMA_ATTACH MPIX_ERR_RMA_ATTACH -#define MPI_ERR_RMA_SHARED MPIX_ERR_RMA_SHARED -#define MPI_ERR_RMA_WRONG_FLAVOR MPIX_ERR_RMA_WRONG_FLAVOR +#undef PyMPI_MISSING_MPI_ERR_RMA_FLAVOR +#define MPI_ERR_RMA_RANGE MPIX_ERR_RMA_RANGE +#define MPI_ERR_RMA_ATTACH MPIX_ERR_RMA_ATTACH +#define MPI_ERR_RMA_SHARED MPIX_ERR_RMA_SHARED +#define MPI_ERR_RMA_FLAVOR MPIX_ERR_RMA_WRONG_FLAVOR /**/ #if 0 /*XXX*/ #undef PyMPI_MISSING_MPI_Comm_dup_with_info diff --git a/src/include/mpi4py/mpi.pxi b/src/include/mpi4py/mpi.pxi index 7d6bc83..a46cdca 100644 --- a/src/include/mpi4py/mpi.pxi +++ b/src/include/mpi4py/mpi.pxi @@ -814,7 +814,7 @@ cdef extern from "mpi.h" nogil: enum: MPI_ERR_RMA_RANGE #:= MPI_ERR_UNKNOWN enum: MPI_ERR_RMA_ATTACH #:= MPI_ERR_UNKNOWN enum: MPI_ERR_RMA_SHARED #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_RMA_WRONG_FLAVOR #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_RMA_FLAVOR #:= MPI_ERR_UNKNOWN #----------------------------------------------------------------- diff --git a/src/missing.h b/src/missing.h index b5a0039..e4c30ef 100644 --- a/src/missing.h +++ b/src/missing.h @@ -3210,9 +3210,9 @@ typedef int (PyMPI_MPI_Datarep_extent_function)(MPI_Datatype,MPI_Aint*,void*); #define MPI_ERR_RMA_SHARED (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_RMA_WRONG_FLAVOR -#undef MPI_ERR_RMA_WRONG_FLAVOR -#define MPI_ERR_RMA_WRONG_FLAVOR (MPI_ERR_UNKNOWN) +#ifdef PyMPI_MISSING_MPI_ERR_RMA_FLAVOR +#undef MPI_ERR_RMA_FLAVOR +#define MPI_ERR_RMA_FLAVOR (MPI_ERR_UNKNOWN) #endif #ifdef PyMPI_MISSING_MPI_Alloc_mem From e834184b1eef4f8f91cbc2d110b190a6c1221bd7 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Thu, 27 Dec 2012 13:51:20 -0300 Subject: [PATCH 08/56] Update Cython wrap demo for missing MPI_Message in MPI_VERSION<3 --- demo/wrap-cython/helloworld.pyx | 2 ++ demo/wrap-cython/mpi-compat.h | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 demo/wrap-cython/mpi-compat.h diff --git a/demo/wrap-cython/helloworld.pyx b/demo/wrap-cython/helloworld.pyx index 4fe08fb..407d7e7 100644 --- a/demo/wrap-cython/helloworld.pyx +++ b/demo/wrap-cython/helloworld.pyx @@ -1,3 +1,5 @@ +cdef extern from "mpi-compat.h": pass + cimport mpi4py.MPI as MPI from mpi4py.mpi_c cimport * diff --git a/demo/wrap-cython/mpi-compat.h b/demo/wrap-cython/mpi-compat.h new file mode 100644 index 0000000..2ce4753 --- /dev/null +++ b/demo/wrap-cython/mpi-compat.h @@ -0,0 +1,14 @@ +/* Author: Lisandro Dalcin */ +/* Contact: dalcinl@gmail.com */ + +#ifndef MPI_COMPAT_H +#define MPI_COMPAT_H + +#include + +#if (MPI_VERSION < 3) && !defined(_MPI4PY_HAVE_MPI_MESSAGE) +typedef void *PyMPI_MPI_Message; +#define MPI_Message PyMPI_MPI_Message +#endif + +#endif/*MPI_COMPAT_H*/ From c30f24f19b2cef6624497bf319c68af0950d34f9 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Thu, 27 Dec 2012 14:13:42 -0300 Subject: [PATCH 09/56] Fixes after testing with mpich-3.0.1 --- mpi.cfg | 5 +++-- src/compat/mpich3.h | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/mpi.cfg b/mpi.cfg index 9c5b6e2..b707a71 100644 --- a/mpi.cfg +++ b/mpi.cfg @@ -42,11 +42,11 @@ # MPICH3 example # -------------- [mpich3] -mpi_dir = /home/devel/mpi/mpich-3.0rc1 +mpi_dir = /home/devel/mpi/mpich-3.0.1 mpicc = %(mpi_dir)s/bin/mpicc mpicxx = %(mpi_dir)s/bin/mpicxx #include_dirs = %(mpi_dir)s/include -#libraries = mpich opa mpl rt +#libraries = mpich opa mpl rt pthread #library_dirs = %(mpi_dir)s/lib #runtime_library_dirs = %(library_dirs)s @@ -128,6 +128,7 @@ include_dirs = %(mpi_dir)s\include libraries = mpi library_dirs = %(mpi_dir)s\lib + # MPICH2 example (Windows) # ------------------------ [mpich2-windows] diff --git a/src/compat/mpich3.h b/src/compat/mpich3.h index 747a7cd..e299bb0 100644 --- a/src/compat/mpich3.h +++ b/src/compat/mpich3.h @@ -1,4 +1,29 @@ #ifndef PyMPI_COMPAT_MPICH3_H #define PyMPI_COMPAT_MPICH3_H +#if defined(MPICH_NUMVERSION) && (MPICH_NUMVERSION < 30100000) + +static int PyMPI_MPICH3_MPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size) +{ + int ierr = MPI_Type_commit(&datatype); if (ierr) return ierr; + return MPI_Type_size_x(datatype,size); +} +#define MPI_Type_size_x PyMPI_MPICH3_MPI_Type_size_x + +static int PyMPI_MPICH3_MPI_Type_get_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent) +{ + int ierr = MPI_Type_commit(&datatype); if (ierr) return ierr; + return MPI_Type_get_extent_x(datatype,lb,extent); +} +#define MPI_Type_get_extent_x PyMPI_MPICH3_MPI_Type_get_extent_x + +static int PyMPI_MPICH3_MPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent) +{ + int ierr = MPI_Type_commit(&datatype); if (ierr) return ierr; + return MPI_Type_get_true_extent_x(datatype,lb,extent); +} +#define MPI_Type_get_true_extent_x PyMPI_MPICH3_MPI_Type_get_true_extent_x + +#endif + #endif /* !PyMPI_COMPAT_MPICH3_H */ From 7f1899bb3c407c1f5f33abc4d92c94f62460afca Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Thu, 27 Dec 2012 14:46:02 -0300 Subject: [PATCH 10/56] docs: update references MPICH2 -> MPICH --- docs/source/usrman/appendix.rst | 12 ++++++------ docs/source/usrman/install.rst | 2 +- docs/source/usrman/intro.rst | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/source/usrman/appendix.rst b/docs/source/usrman/appendix.rst index 56f7b20..22fd4bf 100644 --- a/docs/source/usrman/appendix.rst +++ b/docs/source/usrman/appendix.rst @@ -139,11 +139,11 @@ In the list below you have some executive instructions for building some of the open-source MPI implementations out there with support for shared/dynamic libraries on POSIX environments. -+ *MPICH 2* :: ++ *MPICH* :: - $ tar -zxf mpich2-X.X.X.tar.gz - $ cd mpich2-X.X.X - $ ./configure --enable-shared --prefix=/usr/local/mpich2 + $ tar -zxf mpich-X.X.X.tar.gz + $ cd mpich-X.X.X + $ ./configure --enable-shared --prefix=/usr/local/mpich $ make $ make install @@ -178,9 +178,9 @@ MPI libraries . In case of getting runtime linking errors when running MPI programs, the following lines can be added to the user login shell script (:file:`.profile`, :file:`.bashrc`, etc.). -- *MPICH 2* :: +- *MPICH* :: - MPI_DIR=/usr/local/mpich2 + MPI_DIR=/usr/local/mpich export LD_LIBRARY_PATH=$MPI_DIR/lib:$LD_LIBRARY_PATH - *Open MPI* :: diff --git a/docs/source/usrman/install.rst b/docs/source/usrman/install.rst index e5d4e36..db0540f 100644 --- a/docs/source/usrman/install.rst +++ b/docs/source/usrman/install.rst @@ -105,7 +105,7 @@ After unpacking the release tarball:: the distribution is ready for building. - If you use a MPI implementation providing a :program:`mpicc` - compiler wrapper (e.g., MPICH 1/2, Open MPI, LAM), it will be used + compiler wrapper (e.g., MPICH, Open MPI, LAM), it will be used for compilation and linking. This is the preferred and easiest way of building *MPI for Python*. diff --git a/docs/source/usrman/intro.rst b/docs/source/usrman/intro.rst index 6e30c29..bedf7f8 100644 --- a/docs/source/usrman/intro.rst +++ b/docs/source/usrman/intro.rst @@ -172,7 +172,7 @@ scientific computing and software development with Python. .. _MPI: http://www.mpi-forum.org/ -.. _MPICH: http://www.mcs.anl.gov/research/projects/mpich2/ +.. _MPICH: http://www.mpich.org/ .. _Open MPI: http://www.open-mpi.org/ From a15ad0e9e54b80829a8547be34748619e1b3511a Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Fri, 28 Dec 2012 13:29:36 -0300 Subject: [PATCH 11/56] Backward compatibility for Cython 0.15 --- src/MPI/MPI.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MPI/MPI.pyx b/src/MPI/MPI.pyx index b9eaf56..beb66f0 100644 --- a/src/MPI/MPI.pyx +++ b/src/MPI/MPI.pyx @@ -305,6 +305,6 @@ def _pypy_setup(): hasattr(klass, name) _pypy_setup() del _pypy_setup -""" +""" in globals() # -------------------------------------------------------------------- From 8058d8cd22dd264f000471640786526bda4c8be8 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Tue, 15 Jan 2013 11:37:52 -0300 Subject: [PATCH 12/56] PyPy: Fix failing test with PyPy 2.0-beta1 --- test/test_cco_buf.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/test_cco_buf.py b/test/test_cco_buf.py index 7baa07e..b1ae2c4 100644 --- a/test/test_cco_buf.py +++ b/test/test_cco_buf.py @@ -346,8 +346,10 @@ def testGather(self): if rank == root: sbuf = MPI.IN_PLACE buf = array(-1, typecode, (size, count)) - buf.flat[(rank*count):((rank+1)*count)] = \ - array(root, typecode, count) + #buf.flat[(rank*count):((rank+1)*count)] = \ + # array(root, typecode, count) + s, e = rank*count, (rank+1)*count + for i in range(s, e): buf.flat[i] = root rbuf = buf.as_mpi() else: buf = array(root, typecode, count) @@ -389,8 +391,10 @@ def testAllgather(self): for typecode in arrayimpl.TypeMap: for count in range(1, 10): buf = array(-1, typecode, (size, count)) - buf.flat[(rank*count):((rank+1)*count)] = \ - array(count, typecode, count) + #buf.flat[(rank*count):((rank+1)*count)] = \ + # array(count, typecode, count) + s, e = rank*count, (rank+1)*count + for i in range(s, e): buf.flat[i] = count try: self.COMM.Allgather(MPI.IN_PLACE, buf.as_mpi()) except NotImplementedError: From ab9d40045813f7098362b9a46eab6813f9d8bf1d Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Tue, 15 Jan 2013 12:20:27 -0300 Subject: [PATCH 13/56] Issue #35: Fix manual Init() requires explicit Finalize() --- src/MPI/atimport.pxi | 10 ++++++---- src/rc.py | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/MPI/atimport.pxi b/src/MPI/atimport.pxi index 3194938..141805d 100644 --- a/src/MPI/atimport.pxi +++ b/src/MPI/atimport.pxi @@ -41,7 +41,7 @@ cdef int getRCParams(RCParams* rc) except -1: cdef object initialize = True cdef object threaded = True cdef object thread_level = 'multiple' - cdef object finalize = True + cdef object finalize = None try: initialize = rcmod.initialize except: pass try: threaded = rcmod.threaded @@ -76,7 +76,9 @@ cdef int getRCParams(RCParams* rc) except -1: else: warnRC("thread_level", thread_level) # - if finalize in (True, 'yes'): + if finalize is None: + rc.finalize = rc.initialize + elif finalize in (True, 'yes'): rc.finalize = 1 elif finalize in (False, 'no'): rc.finalize = 0 @@ -135,8 +137,8 @@ cdef int initialize() except -1: if ierr != MPI_SUCCESS: raise RuntimeError( "MPI_Init() failed [error code: %d]" % ierr) inited_atimport = 1 # We initialized MPI - if rc.finalize: # We have to finalize MPI - finalize_atexit = 1 + if rc.finalize: # We have to finalize MPI + finalize_atexit = 1 # Cleanup at (the very end of) Python exit if Py_AtExit(atexit) < 0: PySys_WriteStderr(b"warning: could not register " diff --git a/src/rc.py b/src/rc.py index dd59957..6ac76df 100644 --- a/src/rc.py +++ b/src/rc.py @@ -33,7 +33,7 @@ """ -finalize = True +finalize = None """ Automatic MPI finalization at exit time From 935beb6432d1780a0b2b0f98a22c0b8518112585 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Wed, 16 Jan 2013 18:45:34 -0300 Subject: [PATCH 14/56] PyPy: PyCode_GetNumFree() got fixed in PyPy 2.0-beta1 --- src/atimport.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/atimport.h b/src/atimport.h index 2f03e56..d80a6ec 100644 --- a/src/atimport.h +++ b/src/atimport.h @@ -376,7 +376,9 @@ PyMemoryView_FromBuffer_PyPy(Py_buffer *view) } #define PyMemoryView_FromBuffer PyMemoryView_FromBuffer_PyPy +#if PY_VERSION_HEX < 0x02070300 /* PyPy < 2.0 */ #define PyCode_GetNumFree(o) PyCode_GetNumFree((PyObject *)(o)) +#endif #endif/*PYPY_VERSION*/ From 4c19ef66f1dc28349553d530c02c3b7d99f63a92 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Thu, 17 Jan 2013 19:15:20 -0300 Subject: [PATCH 15/56] Add copy constructor for Status --- src/MPI/Status.pyx | 4 +++- src/MPI/helpers.pxi | 6 ++++++ test/test_status.py | 29 +++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/MPI/Status.pyx b/src/MPI/Status.pyx index 742b2a0..1217b07 100644 --- a/src/MPI/Status.pyx +++ b/src/MPI/Status.pyx @@ -4,10 +4,12 @@ cdef class Status: Status """ - def __cinit__(self): + def __cinit__(self, Status status=None): self.ob_mpi.MPI_SOURCE = MPI_ANY_SOURCE self.ob_mpi.MPI_TAG = MPI_ANY_TAG self.ob_mpi.MPI_ERROR = MPI_SUCCESS + if status is not None: + copy_Status(&status.ob_mpi, &self.ob_mpi) def __richcmp__(self, other, int op): if not isinstance(self, Status): return NotImplemented diff --git a/src/MPI/helpers.pxi b/src/MPI/helpers.pxi index a21d75e..c4455f2 100644 --- a/src/MPI/helpers.pxi +++ b/src/MPI/helpers.pxi @@ -29,6 +29,12 @@ cdef inline int equal_Status(MPI_Status* s1, MPI_Status* s2) nogil: return 0 return 1 +cdef inline void copy_Status(MPI_Status* si, MPI_Status* so) nogil: + cdef size_t i=0, n=sizeof(MPI_Status) + cdef unsigned char* a = si + cdef unsigned char* b = so + for i from 0 <= i < n: b[i] = a[i] + #------------------------------------------------------------------------------ # Datatype diff --git a/test/test_status.py b/test/test_status.py index 5aa4c87..31006a7 100644 --- a/test/test_status.py +++ b/test/test_status.py @@ -56,6 +56,35 @@ def testPyProps(self): self.assertEqual(self.STATUS.tag, 2) self.assertEqual(self.STATUS.error, MPI.ERR_ARG) + def testCopyConstructor(self): + self.STATUS.source = 1 + self.STATUS.tag = 2 + self.STATUS.error = MPI.ERR_ARG + try: + self.STATUS.Set_elements(MPI.BYTE, 7) + except NotImplementedError: + pass + try: + self.STATUS.Set_cancelled(True) + except NotImplementedError: + pass + status = MPI.Status(self.STATUS) + self.assertEqual(status.source, 1) + self.assertEqual(status.tag, 2) + self.assertEqual(status.error, MPI.ERR_ARG) + try: + count = status.Get_count(MPI.BYTE) + elems = status.Get_elements(MPI.BYTE) + self.assertEqual(count, 7) + self.assertEqual(elems, 7) + except NotImplementedError: + pass + try: + flag = status.Is_cancelled() + self.assertTrue(flag) + except NotImplementedError: + pass + if __name__ == '__main__': unittest.main() From 052fc3576f6f7bce3438bb828d5541bae2842bfd Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Thu, 17 Jan 2013 19:15:38 -0300 Subject: [PATCH 16/56] Add copy constructor for Group --- src/MPI/Group.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MPI/Group.pyx b/src/MPI/Group.pyx index 341c164..3aa318b 100644 --- a/src/MPI/Group.pyx +++ b/src/MPI/Group.pyx @@ -4,8 +4,10 @@ cdef class Group: Group """ - def __cinit__(self): + def __cinit__(self, Group group=None): self.ob_mpi = MPI_GROUP_NULL + if group is not None: + self.ob_mpi = group.ob_mpi def __dealloc__(self): if not (self.flags & PyMPI_OWNED): return From cb56e6bb285350b10e4e7da8db99ceb14223909a Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Thu, 17 Jan 2013 19:17:34 -0300 Subject: [PATCH 17/56] Add copy constructor for Datatype --- src/MPI/Datatype.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MPI/Datatype.pyx b/src/MPI/Datatype.pyx index 3e78c4d..5ac7872 100644 --- a/src/MPI/Datatype.pyx +++ b/src/MPI/Datatype.pyx @@ -51,8 +51,10 @@ cdef class Datatype: Datatype """ - def __cinit__(self): + def __cinit__(self, Datatype datatype=None): self.ob_mpi = MPI_DATATYPE_NULL + if datatype is not None: + self.ob_mpi = datatype.ob_mpi def __dealloc__(self): if not (self.flags & PyMPI_OWNED): return From d2816d1d7decdf2c84f6c76940aef3dc500bd982 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Thu, 17 Jan 2013 19:29:34 -0300 Subject: [PATCH 18/56] Add copy constructor for Errhandler --- src/MPI/Errhandler.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MPI/Errhandler.pyx b/src/MPI/Errhandler.pyx index cc9b120..2cc94c0 100644 --- a/src/MPI/Errhandler.pyx +++ b/src/MPI/Errhandler.pyx @@ -4,8 +4,10 @@ cdef class Errhandler: Error Handler """ - def __cinit__(self): + def __cinit__(self, Errhandler errhandler=None): self.ob_mpi = MPI_ERRHANDLER_NULL + if errhandler is not None: + self.ob_mpi = errhandler.ob_mpi def __dealloc__(self): if not (self.flags & PyMPI_OWNED): return From ecddb68a7f093905fccbc6ce2b84bbcd6b1f334c Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Thu, 17 Jan 2013 19:30:32 -0300 Subject: [PATCH 19/56] Add copy constructor for Info --- src/MPI/Info.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MPI/Info.pyx b/src/MPI/Info.pyx index dc0ec49..61156d5 100644 --- a/src/MPI/Info.pyx +++ b/src/MPI/Info.pyx @@ -4,8 +4,10 @@ cdef class Info: Info """ - def __cinit__(self): + def __cinit__(self, Info info=None): self.ob_mpi = MPI_INFO_NULL + if info is not None: + self.ob_mpi = info.ob_mpi def __dealloc__(self): if not (self.flags & PyMPI_OWNED): return From 41463057cf34712e859a711249d7d61f1abbe017 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Thu, 17 Jan 2013 19:41:34 -0300 Subject: [PATCH 20/56] Add copy constructor for Op --- src/MPI/Op.pyx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/MPI/Op.pyx b/src/MPI/Op.pyx index da5e7d3..9a9b6e8 100644 --- a/src/MPI/Op.pyx +++ b/src/MPI/Op.pyx @@ -4,8 +4,12 @@ cdef class Op: Op """ - def __cinit__(self): + def __cinit__(self, Op op=None): self.ob_mpi = MPI_OP_NULL + if op is not None: + self.ob_mpi = op.ob_mpi + self.ob_func = op.ob_func + self.ob_usrid = 0 # XXX def __dealloc__(self): if not (self.flags & PyMPI_OWNED): return From 6103c5fd39dbc1d0a8a4ddd7b46d45a0bbdddaab Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Thu, 17 Jan 2013 20:11:00 -0300 Subject: [PATCH 21/56] Prepare to use @cython.internal in the near future --- src/MPI/asbuffer.pxi | 1 + src/MPI/asmemory.pxi | 2 +- src/MPI/msgbuffer.pxi | 5 +++++ src/MPI/msgpickle.pxi | 1 + src/MPI/reqimpl.pxi | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/MPI/asbuffer.pxi b/src/MPI/asbuffer.pxi index 4ba84bc..c4963a3 100644 --- a/src/MPI/asbuffer.pxi +++ b/src/MPI/asbuffer.pxi @@ -103,6 +103,7 @@ except -1: #--------------------------------------------------------------------- +#@cython.internal cdef class _p_buffer: cdef Py_buffer view diff --git a/src/MPI/asmemory.pxi b/src/MPI/asmemory.pxi index a1f2d45..81c21e4 100644 --- a/src/MPI/asmemory.pxi +++ b/src/MPI/asmemory.pxi @@ -27,7 +27,7 @@ cdef inline object tomemory(void *base, MPI_Aint size): #@cython.internal cdef class _p_mem: - cdef void *buf + cdef void *buf def __cinit__(self): self.buf = NULL def __dealloc__(self): diff --git a/src/MPI/msgbuffer.pxi b/src/MPI/msgbuffer.pxi index dafdb22..3a48f10 100644 --- a/src/MPI/msgbuffer.pxi +++ b/src/MPI/msgbuffer.pxi @@ -17,6 +17,7 @@ cdef object __IN_PLACE__ = MPI_IN_PLACE #------------------------------------------------------------------------------ +#@cython.internal cdef class _p_message: cdef _p_buffer buf cdef object count @@ -287,6 +288,7 @@ cdef _p_message message_vector(object msg, #------------------------------------------------------------------------------ +#@cython.internal cdef class _p_msg_p2p: # raw C-side arguments @@ -329,6 +331,7 @@ cdef inline _p_msg_p2p message_p2p_recv(object recvbuf, int source): #------------------------------------------------------------------------------ +#@cython.internal cdef class _p_msg_cco: # raw C-side arguments @@ -722,6 +725,7 @@ cdef inline _p_msg_cco message_cco(): #------------------------------------------------------------------------------ +#@cython.internal cdef class _p_msg_rma: # raw origin arguments @@ -812,6 +816,7 @@ cdef inline _p_msg_rma message_rma(): #------------------------------------------------------------------------------ +#@cython.internal cdef class _p_msg_io: # raw C-side data diff --git a/src/MPI/msgpickle.pxi b/src/MPI/msgpickle.pxi index a353481..bb50a17 100644 --- a/src/MPI/msgpickle.pxi +++ b/src/MPI/msgpickle.pxi @@ -35,6 +35,7 @@ if PY_MAJOR_VERSION == 2: except ImportError: pass +#@cython.internal cdef class _p_Pickle: cdef object ob_dumps diff --git a/src/MPI/reqimpl.pxi b/src/MPI/reqimpl.pxi index a4521aa..d838210 100644 --- a/src/MPI/reqimpl.pxi +++ b/src/MPI/reqimpl.pxi @@ -51,6 +51,7 @@ cdef int release_rs(object requests, # ----------------------------------------------------------------------------- +#@cython.internal cdef class _p_greq: cdef object query_fn From c56ad2c20e4372af5caf146f7ff13dbe1e072ef0 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sun, 24 Mar 2013 18:17:40 +0300 Subject: [PATCH 22/56] Change install/uninstall makefile targets to user-type installs --- makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile index b06c6d9..e62ca7a 100644 --- a/makefile +++ b/makefile @@ -35,10 +35,10 @@ fullclean: distclean srcclean docsclean .PHONY: install uninstall install: build - ${PYTHON} setup.py install ${INSTALLOPT} --home=${HOME} + ${PYTHON} setup.py install --user ${INSTALLOPT} uninstall: - -${RM} -r ${HOME}/lib{,64}/python/mpi4py - -${RM} -r ${HOME}/lib{,64}/python/mpi4py-*-py*.egg-info + -${RM} -r $(shell ${PYTHON} -m site --user-site)/mpi4py + -${RM} -r $(shell ${PYTHON} -m site --user-site)/mpi4py-*-py*.egg-info # ---- From 4a0c13951356bdc075b7d8be55f5658f245b22bf Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Mon, 25 Mar 2013 09:58:36 +0300 Subject: [PATCH 23/56] MPI-3: Intel MPI advertises itself as MPICH2 with version > 1.5.x --- src/config/mpich2.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/config/mpich2.h b/src/config/mpich2.h index feb8158..b69fb56 100644 --- a/src/config/mpich2.h +++ b/src/config/mpich2.h @@ -30,7 +30,9 @@ #endif #if MPI_VERSION < 3 -#if defined(MPICH2_NUMVERSION) && MPICH2_NUMVERSION >= 10500000 +#if defined(MPICH2_NUMVERSION) && \ + MPICH2_NUMVERSION >= 10500000 && \ + MPICH2_NUMVERSION < 20000000 /**/ #if 0 /*XXX*/ #undef PyMPI_MISSING_MPI_Count From 25461896fbe989f68b02eb5d87cd08d86d0fd504 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Thu, 18 Apr 2013 17:48:35 +0300 Subject: [PATCH 24/56] docs: Fix typos in user manual (thanks to Yury Zaytsev) --HG-- extra : rebase_source : 106028d2f7bbea464efd1d4f21256068a310983f --- docs/source/usrman/install.rst | 2 +- docs/source/usrman/mpi4py.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/usrman/install.rst b/docs/source/usrman/install.rst index db0540f..6e45f97 100644 --- a/docs/source/usrman/install.rst +++ b/docs/source/usrman/install.rst @@ -67,7 +67,7 @@ or alternatively *setuptools* :program:`easy_install` (deprecated):: Using **distutils** ------------------- -*MPI for Python* uses a standard distutils-based buildsystem. However, +*MPI for Python* uses a standard distutils-based build system. However, some distutils commands (like *build*) have additional options: * :option:`--mpicc=` : let you specify a special location or name for diff --git a/docs/source/usrman/mpi4py.rst b/docs/source/usrman/mpi4py.rst index cda82d0..32fa525 100644 --- a/docs/source/usrman/mpi4py.rst +++ b/docs/source/usrman/mpi4py.rst @@ -199,7 +199,7 @@ following. *MPI for Python* provides support for almost all collective calls. Unfortunately, the :meth:`Alltoallw` and :meth:`Reduce_scatter` -methods are curently unimplemented. +methods are currently unimplemented. In *MPI for Python*, the :meth:`Bcast`, :meth:`Scatter`, :meth:`Gather`, :meth:`Allgather` and :meth:`Alltoall` methods of @@ -345,7 +345,7 @@ offsets, individual file pointers, and shared file pointers), coordination (non-collective and collective), and synchronism (blocking, nonblocking, and split collective with begin/end phases). -In *MPI forPython*, all MPI input/output operations are performed +In *MPI for Python*, all MPI input/output operations are performed through instances of the :class:`File` class. File handles are obtained by calling the :meth:`Open` method at all processes within a communicator and providing a file name and the intended access mode. From 160c3cfa2e7f808ffe4edabe6c1b8a8f43a87cf3 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Fri, 19 Apr 2013 22:29:47 +0300 Subject: [PATCH 25/56] Windows: Update search locations for MS-MPI --- conf/mpiconfig.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/conf/mpiconfig.py b/conf/mpiconfig.py index 09a52f9..fc2d093 100644 --- a/conf/mpiconfig.py +++ b/conf/mpiconfig.py @@ -144,21 +144,26 @@ def _setup_posix(self): def _setup_windows(self): from glob import glob ProgramFiles = os.environ.get('ProgramFiles', '') - for (name, install_suffix) in ( - ('mpich3', 'MPICH'), - ('mpich2', 'MPICH2'), - ('openmpi', 'OpenMPI'), - ('openmpi', 'OpenMPI*'), - ('deinompi', 'DeinoMPI'), - ('msmpi', 'Microsoft HPC Pack 2008 R2'), - ('msmpi', 'Microsoft HPC Pack 2008 SDK'), + CCP_HOME = os.environ.get('CCP_HOME', '') + for (name, prefix, suffix) in ( + ('mpich3', ProgramFiles, 'MPICH'), + ('mpich2', ProgramFiles, 'MPICH2'), + ('openmpi', ProgramFiles, 'OpenMPI'), + ('openmpi', ProgramFiles, 'OpenMPI*'), + ('deinompi', ProgramFiles, 'DeinoMPI'), + ('msmpi', CPP_HOME, ''), + ('msmpi', ProgramFiles, 'Microsoft HPC Pack 2012'), + ('msmpi', ProgramFiles, 'Microsoft HPC Pack 2012 SDK'), + ('msmpi', ProgramFiles, 'Microsoft HPC Pack 2008 R2'), + ('msmpi', ProgramFiles, 'Microsoft HPC Pack 2008'), + ('msmpi', ProgramFiles, 'Microsoft HPC Pack 2008 SDK'), ): - mpi_dir = os.path.join(ProgramFiles, install_suffix) + mpi_dir = os.path.join(prefix, suffix) if '*' in mpi_dir: dirs = glob(mpi_dir) if dirs: mpi_dir = max(dirs) - if not os.path.isdir(mpi_dir): + if not (mpi_dir and os.path.isdir(mpi_dir)): continue define_macros = [] include_dirs = [os.path.join(mpi_dir, 'include')] From 1d6835d51923230f646bf1591162817f6840e2f6 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Fri, 19 Apr 2013 23:19:11 +0300 Subject: [PATCH 26/56] Fix check for NULL pointer --- src/fallback.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fallback.h b/src/fallback.h index 9459640..5b95831 100644 --- a/src/fallback.h +++ b/src/fallback.h @@ -731,7 +731,7 @@ static int PyMPI_Get_elements_x(MPI_Status *status, int elements_ = MPI_UNDEFINED; ierr = MPI_Get_elements(status, datatype, &elements_); if (ierr != MPI_SUCCESS) return ierr; - if (elements == 0) return MPI_ERR_ARG; /* XXX */ + if (!elements) return MPI_ERR_ARG; /* XXX */ *elements = (MPI_Count) elements_; return MPI_SUCCESS; } From 1fc205f4109ef89c60a87791e12b34a74650e3b0 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Wed, 24 Apr 2013 22:05:28 +0300 Subject: [PATCH 27/56] Update wrapping demos --- demo/python-config | 80 +++++++++++++++++++++++++++++++++ demo/wrap-boost/makefile | 18 +++++--- demo/wrap-c/makefile | 17 ++++--- demo/wrap-cython/helloworld.pyx | 4 +- demo/wrap-cython/makefile | 18 +++++--- demo/wrap-f2py/makefile | 18 +++++--- demo/wrap-swig/makefile | 18 ++++---- 7 files changed, 135 insertions(+), 38 deletions(-) create mode 100755 demo/python-config diff --git a/demo/python-config b/demo/python-config new file mode 100755 index 0000000..498b414 --- /dev/null +++ b/demo/python-config @@ -0,0 +1,80 @@ +#!/usr/bin/env python +# -*- python -*- + +import sys, os +import getopt +try: + import sysconfig +except ImportError: + from distutils import sysconfig + +valid_opts = ['help', 'prefix', 'exec-prefix', 'includes', 'libs', 'cflags', + 'ldflags', 'extension-suffix', 'abiflags', 'configdir'] + +def exit_with_usage(code=1): + sys.stderr.write("Usage: %s [%s]\n" % ( + sys.argv[0], '|'.join('--'+opt for opt in valid_opts))) + sys.exit(code) + +try: + opts, args = getopt.getopt(sys.argv[1:], '', valid_opts) +except getopt.error: + exit_with_usage() + +if not opts: + exit_with_usage() + +getvar = sysconfig.get_config_var +pyver = getvar('VERSION') +try: + abiflags = sys.abiflags +except AttributeError: + abiflags = '' + +opt_flags = [flag for (flag, val) in opts] + +if '--help' in opt_flags: + exit_with_usage(code=0) + +for opt in opt_flags: + if opt == '--prefix': + print(getvar('prefix')) + + elif opt == '--exec-prefix': + print(getvar('exec_prefix')) + + elif opt in ('--includes', '--cflags'): + try: + include = sysconfig.get_path('include') + platinclude = sysconfig.get_path('platinclude') + except AttributeError: + include = sysconfig.get_python_inc() + platinclude = sysconfig.get_python_inc(plat_specific=True) + flags = ['-I' + include] + if include != platinclude: + flags.append('-I' + platinclude) + if opt == '--cflags': + flags.extend(getvar('CFLAGS').split()) + print(' '.join(flags)) + + elif opt in ('--libs', '--ldflags'): + libs = getvar('LIBS').split() + getvar('SYSLIBS').split() + libs.append('-lpython' + pyver + abiflags) + if opt == '--ldflags': + if not getvar('Py_ENABLE_SHARED'): + libs.insert(0, '-L' + getvar('LIBPL')) + if not getvar('PYTHONFRAMEWORK'): + libs.extend(getvar('LINKFORSHARED').split()) + print(' '.join(libs)) + + elif opt == '--extension-suffix': + ext_suffix = getvar('EXT_SUFFIX') + if ext_suffix is None: + ext_suffix = getvar('SO') + print(ext_suffix) + + elif opt == '--abiflags': + print(abiflags) + + elif opt == '--configdir': + print(getvar('LIBPL')) diff --git a/demo/wrap-boost/makefile b/demo/wrap-boost/makefile index bbc46bb..05db2fc 100644 --- a/demo/wrap-boost/makefile +++ b/demo/wrap-boost/makefile @@ -2,24 +2,28 @@ default: build test clean PYTHON = python -PYTHON_INCLUDE = ${shell ${PYTHON} -c 'from distutils import sysconfig; print( sysconfig.get_python_inc() )'} +PYTHON_CONFIG = ${PYTHON} ../python-config MPI4PY_INCLUDE = ${shell ${PYTHON} -c 'import mpi4py; print( mpi4py.get_include() )'} -BOOST_FLAGS = -lboost_python -lboost_python-mt +BOOST_INCS = +BOOST_LIBS = -lboost_python -lboost_python-mt + MPICXX = mpicxx -CXXFLAGS = -shared -fPIC -SO = ${shell ${PYTHON} -c 'import imp; print (imp.get_suffixes()[0][0])'} +CXXFLAGS = -fPIC ${shell ${PYTHON_CONFIG} --includes} ${BOOST_INCS} +LDFLAGS = -shared ${shell ${PYTHON_CONFIG} --libs} ${BOOST_LIBS} +SO = ${shell ${PYTHON_CONFIG} --extension-suffix} .PHONY: build build: helloworld${SO} helloworld${SO}: helloworld.cxx - ${MPICXX} ${CXXFLAGS} -I${PYTHON_INCLUDE} -I${MPI4PY_INCLUDE} -I${BOOST_FLAGS} -o $@ $< + ${MPICXX} ${CXXFLAGS} -I${MPI4PY_INCLUDE} -o $@ $< ${LDFLAGS} MPIEXEC = mpiexec -NP = -n 5 +NP_FLAG = -n +NP = 5 .PHONY: test test: build - ${MPIEXEC} ${NP} ${PYTHON} test.py + ${MPIEXEC} ${NP_FLAG} ${NP} ${PYTHON} test.py .PHONY: clean diff --git a/demo/wrap-c/makefile b/demo/wrap-c/makefile index 55dbda9..da43a54 100644 --- a/demo/wrap-c/makefile +++ b/demo/wrap-c/makefile @@ -2,23 +2,26 @@ default: build test clean PYTHON = python -PYTHON_INCLUDE = ${shell ${PYTHON} -c 'from distutils import sysconfig; print( sysconfig.get_python_inc() )'} +PYTHON_CONFIG = ${PYTHON} ../python-config MPI4PY_INCLUDE = ${shell ${PYTHON} -c 'import mpi4py; print( mpi4py.get_include() )'} -MPICC = mpicc -CFLAGS = -shared -fPIC -SO = ${shell ${PYTHON} -c 'import imp; print (imp.get_suffixes()[0][0])'} + +MPICC = mpicc +CFLAGS = -fPIC ${shell ${PYTHON_CONFIG} --includes} +LDFLAGS = -shared ${shell ${PYTHON_CONFIG} --libs} +SO = ${shell ${PYTHON_CONFIG} --extension-suffix} .PHONY: build build: helloworld${SO} helloworld${SO}: helloworld.c - ${MPICC} ${CFLAGS} -I${PYTHON_INCLUDE} -I${MPI4PY_INCLUDE} -o $@ $< + ${MPICC} ${CFLAGS} -I${MPI4PY_INCLUDE} -o $@ $< ${LDFLAGS} MPIEXEC = mpiexec -NP = -n 5 +NP_FLAG = -n +NP = 5 .PHONY: test test: build - ${MPIEXEC} ${NP} ${PYTHON} test.py + ${MPIEXEC} ${NP_FLAG} ${NP} ${PYTHON} test.py .PHONY: clean diff --git a/demo/wrap-cython/helloworld.pyx b/demo/wrap-cython/helloworld.pyx index 407d7e7..2e164bb 100644 --- a/demo/wrap-cython/helloworld.pyx +++ b/demo/wrap-cython/helloworld.pyx @@ -10,12 +10,12 @@ cdef void c_sayhello(MPI_Comm comm): cdef int size, rank, plen cdef char pname[MPI_MAX_PROCESSOR_NAME] if comm == MPI_COMM_NULL: - printf("You passed MPI_COMM_NULL !!!\n") + printf(b"You passed MPI_COMM_NULL !!!\n",0) return MPI_Comm_size(comm, &size) MPI_Comm_rank(comm, &rank) MPI_Get_processor_name(pname, &plen) - printf("Hello, World! I am process %d of %d on %s.\n", + printf(b"Hello, World! I am process %d of %d on %s.\n", rank, size, pname) def sayhello(MPI.Comm comm not None ): diff --git a/demo/wrap-cython/makefile b/demo/wrap-cython/makefile index 45a91b3..122a7be 100644 --- a/demo/wrap-cython/makefile +++ b/demo/wrap-cython/makefile @@ -2,29 +2,33 @@ default: build test clean PYTHON = python -PYTHON_INCLUDE = ${shell ${PYTHON} -c 'from distutils import sysconfig; print( sysconfig.get_python_inc() )'} +PYTHON_CONFIG = ${PYTHON} ../python-config MPI4PY_INCLUDE = ${shell ${PYTHON} -c 'import mpi4py; print( mpi4py.get_include() )'} + CYTHON = cython +.PHONY: src src: helloworld.c helloworld.c: helloworld.pyx ${CYTHON} -I${MPI4PY_INCLUDE} $< -MPICC = mpicc -shared -fPIC -CFLAGS = -shared -fPIC -SO = ${shell ${PYTHON} -c 'import imp; print (imp.get_suffixes()[0][0])'} +MPICC = mpicc +CFLAGS = -fPIC ${shell ${PYTHON_CONFIG} --includes} +LDFLAGS = -shared ${shell ${PYTHON_CONFIG} --libs} +SO = ${shell ${PYTHON_CONFIG} --extension-suffix} .PHONY: build build: helloworld${SO} helloworld${SO}: helloworld.c - ${MPICC} ${CFLAGS} -I${PYTHON_INCLUDE} -I${MPI4PY_INCLUDE} -o $@ $< + ${MPICC} ${CFLAGS} -I${MPI4PY_INCLUDE} -o $@ $< ${LDFLAGS} MPIEXEC = mpiexec -NP = -n 5 +NP_FLAG = -n +NP = 5 .PHONY: test test: build - ${MPIEXEC} ${NP} ${PYTHON} test.py + ${MPIEXEC} ${NP_FLAG} ${NP} ${PYTHON} test.py .PHONY: clean diff --git a/demo/wrap-f2py/makefile b/demo/wrap-f2py/makefile index 68e621e..ba11cbe 100644 --- a/demo/wrap-f2py/makefile +++ b/demo/wrap-f2py/makefile @@ -1,23 +1,27 @@ -.PHONY: default build test clean - +.PHONY: default default: build test clean PYTHON = python +PYTHON_CONFIG = ${PYTHON} ../python-config + -F2PY = f2py -F2PY_FC = --fcompiler=gnu95 MPIF90 = mpif90 -SO = ${shell ${PYTHON} -c 'import imp; print (imp.get_suffixes()[0][0])'} +F2PY = f2py --fcompiler=gnu95 +SO = ${shell ${PYTHON_CONFIG} --extension-suffix} +.PHONY: build build: helloworld${SO} helloworld${SO}: helloworld.f90 - ${F2PY} ${F2PY_FC} --f90exec=${MPIF90} -m helloworld -c $< + ${F2PY} --f90exec=${MPIF90} -m helloworld -c $< MPIEXEC = mpiexec +NP_FLAG = -n NP = -n 5 +.PHONY: test test: build - ${MPIEXEC} ${NP} ${PYTHON} test.py + ${MPIEXEC} ${NP_FLAG} ${NP} ${PYTHON} test.py +.PHONY: clean clean: ${RM} helloworld${SO} diff --git a/demo/wrap-swig/makefile b/demo/wrap-swig/makefile index d0c94f3..b1c95d9 100644 --- a/demo/wrap-swig/makefile +++ b/demo/wrap-swig/makefile @@ -2,9 +2,10 @@ default: build test clean PYTHON = python -PYTHON_INCLUDE = ${shell ${PYTHON} -c 'from distutils import sysconfig; print( sysconfig.get_python_inc() )'} +PYTHON_CONFIG = ${PYTHON} ../python-config MPI4PY_INCLUDE = ${shell ${PYTHON} -c 'import mpi4py; print( mpi4py.get_include() )'} + SWIG = swig SWIG_PY = ${SWIG} -python .PHONY: src @@ -12,21 +13,22 @@ src: helloworld_wrap.c helloworld_wrap.c: helloworld.i ${SWIG_PY} -I${MPI4PY_INCLUDE} -o $@ $< - -MPICC = mpicc -CFLAGS = -shared -fPIC -SO = ${shell ${PYTHON} -c 'import imp; print (imp.get_suffixes()[0][0])'} +MPICC = mpicc +CFLAGS = -fPIC ${shell ${PYTHON_CONFIG} --includes} +LDFLAGS = -shared ${shell ${PYTHON_CONFIG} --libs} +SO = ${shell ${PYTHON_CONFIG} --extension-suffix} .PHONY: build build: _helloworld${SO} _helloworld${SO}: helloworld_wrap.c - ${MPICC} ${CFLAGS} -I${PYTHON_INCLUDE} -I${MPI4PY_INCLUDE} -o $@ $< + ${MPICC} ${CFLAGS} -I${MPI4PY_INCLUDE} -o $@ $< ${LDFLAGS} MPIEXEC = mpiexec -NP = -n 5 +NP_FLAG = -n +NP = 5 .PHONY: test test: build - ${MPIEXEC} ${NP} ${PYTHON} test.py + ${MPIEXEC} ${NP_FLAG} ${NP} ${PYTHON} test.py .PHONY: clean From 7a11e9d8678ea909cbc41e5fc1316d3cfde058a1 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Wed, 24 Apr 2013 22:48:39 +0300 Subject: [PATCH 28/56] Update demos --- demo/cython/makefile | 23 ++++++++++++++--------- demo/embedding/helloworld.c | 4 ++-- demo/embedding/makefile | 14 ++++++-------- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/demo/cython/makefile b/demo/cython/makefile index ac1cf43..7ac61a0 100644 --- a/demo/cython/makefile +++ b/demo/cython/makefile @@ -1,29 +1,34 @@ -.PHONY: default src build test clean - +.PHONY: default default: build test clean PYTHON = python -PYTHON_INCLUDE = ${shell ${PYTHON} -c 'from distutils import sysconfig; print( sysconfig.get_python_inc() )'} -MPI4PY_INCLUDE = ${shell ${PYTHON} -c 'import mpi4py; print( mpi4py.get_include() )'} +PYTHON = python +PYTHON_CONFIG = ${PYTHON} ../python-config +MPI4PY_INCLUDE = -I${shell ${PYTHON} -c 'import mpi4py; print( mpi4py.get_include() )'} CYTHON = cython +.PHONY: src src: helloworld.c helloworld.c: helloworld.pyx - ${CYTHON} -I${MPI4PY_INCLUDE} $< + ${CYTHON} ${MPI4PY_INCLUDE} $< -MPICC = mpicc -shared -fPIC -CFLAGS = -shared -fPIC -SO = ${shell ${PYTHON} -c 'import imp; print (imp.get_suffixes()[0][0])'} +MPICC = mpicc +CFLAGS = -fPIC ${shell ${PYTHON_CONFIG} --includes} +LDFLAGS = -shared ${shell ${PYTHON_CONFIG} --libs} +SO = ${shell ${PYTHON_CONFIG} --extension-suffix} +.PHONY: build build: helloworld${SO} helloworld${SO}: helloworld.c - ${MPICC} ${CFLAGS} -I${PYTHON_INCLUDE} -I${MPI4PY_INCLUDE} -o $@ $< + ${MPICC} ${CFLAGS} -I${MPI4PY_INCLUDE} -o $@ $< ${LDFLAGS} +.PHONY: test test: build ${PYTHON} -c 'import helloworld' +.PHONY: clean clean: ${RM} helloworld.c helloworld${SO} diff --git a/demo/embedding/helloworld.c b/demo/embedding/helloworld.c index e5f2676..5842bec 100644 --- a/demo/embedding/helloworld.c +++ b/demo/embedding/helloworld.c @@ -31,8 +31,8 @@ int main(int argc, char *argv[]) Py_Initialize(); PyRun_SimpleString(helloworld); - MPI_Finalize(); - Py_Finalize(); + MPI_Finalize(); /* MPI should be finalized */ + Py_Finalize(); /* after finalizing Python */ Py_Initialize(); PyRun_SimpleString("from mpi4py import MPI\n"); diff --git a/demo/embedding/makefile b/demo/embedding/makefile index 188338b..9884f1d 100644 --- a/demo/embedding/makefile +++ b/demo/embedding/makefile @@ -3,24 +3,22 @@ default: build test clean PYTHON = python -PYTHON_PERFIX = ${shell ${PYTHON} -c 'import sys; print(sys.exec_prefix)'} -PYTHON_VERSION = ${shell ${PYTHON} -c 'import sys; print(sys.version[:3])'} -PYTHON_CONFIG = ${PYTHON_PERFIX}/bin/python$(PYTHON_VERSION)-config +PYTHON_CONFIG = ${PYTHON} ../python-config MPICC = mpicc CFLAGS = ${shell ${PYTHON_CONFIG} --cflags} LDFLAGS = ${shell ${PYTHON_CONFIG} --ldflags} -LDLAST = -Xlinker -export-dynamic build: helloworld.exe helloworld.exe: helloworld.c - ${MPICC} ${CFLAGS} ${LDFLAGS} ${LDLAST} -o $@ $< + ${MPICC} ${CFLAGS} -o $@ $< ${LDFLAGS} MPIEXEC = mpiexec -NP = -n 5 +NP_FLAG = -n +NP = 5 test: build - ${MPIEXEC} ${NP} ./helloworld.exe + ${MPIEXEC} ${NP_FLAG} ${NP} ./helloworld.exe clean: - ${RM} helloworld.exe + ${RM} -r helloworld.exe helloworld.exe.dSYM From 1946f1ebf18b8416c7608e2436e9b60212288ed9 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sun, 28 Apr 2013 11:44:52 +0300 Subject: [PATCH 29/56] Update demos --- demo/cython/helloworld.pyx | 2 ++ demo/cython/mpi-compat.h | 14 ++++++++++++++ demo/wrap-f2py/makefile | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 demo/cython/mpi-compat.h diff --git a/demo/cython/helloworld.pyx b/demo/cython/helloworld.pyx index 5a02ccb..2486804 100644 --- a/demo/cython/helloworld.pyx +++ b/demo/cython/helloworld.pyx @@ -1,3 +1,5 @@ +cdef extern from "mpi-compat.h": pass + # --------- diff --git a/demo/cython/mpi-compat.h b/demo/cython/mpi-compat.h new file mode 100644 index 0000000..2ce4753 --- /dev/null +++ b/demo/cython/mpi-compat.h @@ -0,0 +1,14 @@ +/* Author: Lisandro Dalcin */ +/* Contact: dalcinl@gmail.com */ + +#ifndef MPI_COMPAT_H +#define MPI_COMPAT_H + +#include + +#if (MPI_VERSION < 3) && !defined(_MPI4PY_HAVE_MPI_MESSAGE) +typedef void *PyMPI_MPI_Message; +#define MPI_Message PyMPI_MPI_Message +#endif + +#endif/*MPI_COMPAT_H*/ diff --git a/demo/wrap-f2py/makefile b/demo/wrap-f2py/makefile index ba11cbe..3a82852 100644 --- a/demo/wrap-f2py/makefile +++ b/demo/wrap-f2py/makefile @@ -16,7 +16,7 @@ helloworld${SO}: helloworld.f90 MPIEXEC = mpiexec NP_FLAG = -n -NP = -n 5 +NP = 5 .PHONY: test test: build ${MPIEXEC} ${NP_FLAG} ${NP} ${PYTHON} test.py From 03359ed31b6f558a503447319446cd618774a052 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sun, 28 Apr 2013 13:02:18 +0300 Subject: [PATCH 30/56] Minor improvements to code in __main__.py --- src/__init__.py | 4 ++-- src/__main__.py | 27 +++++++++++++++------------ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/__init__.py b/src/__init__.py index b895083..c03e2fa 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -169,7 +169,7 @@ def lookup_dylib(name, path): # -------------------------------------------------------------------- if __name__ == '__main__': - from mpi4py.__main__ import _main - _main() + from mpi4py.__main__ import main + main() # -------------------------------------------------------------------- diff --git a/src/__main__.py b/src/__main__.py index 36acb79..6382923 100644 --- a/src/__main__.py +++ b/src/__main__.py @@ -35,12 +35,15 @@ def ringtest(comm, args=None, verbose=True): parser = OptionParser(prog="mpi4py ringtest") parser.add_option("-q","--quiet", action="store_false", dest="verbose", default=verbose) - parser.add_option("-n", "--size", type="int", default=1, dest="size") - parser.add_option("-l", "--loop", type="int", default=1, dest="loop") - parser.add_option("-s", "--skip", type="int", default=0, dest="skip") + parser.add_option("-n", "--size", type="int", default=1, dest="size", + help="message size") + parser.add_option("-s", "--skip", type="int", default=0, dest="skip", + help="number of warm-up iterations") + parser.add_option("-l", "--loop", type="int", default=1, dest="loop", + help="number of iterations") (options, args) = parser.parse_args(args) - def ring(comm, n=1, loops=1, skip=0): - iterations = list(range((loops+skip))) + def ring(comm, n=1, loop=1, skip=0): + iterations = list(range((loop+skip))) size = comm.Get_size() rank = comm.Get_rank() source = (rank - 1) % size @@ -80,14 +83,14 @@ def ring(comm, n=1, loops=1, skip=0): traceback.print_exc() comm.Abort(2) return toc - tic - size = getattr(options, 'size', 1) - loops = getattr(options, 'loops', 1) - skip = getattr(options, 'skip', 0) + size = getattr(options, 'size', 1) + loop = getattr(options, 'loop', 1) + skip = getattr(options, 'skip', 0) comm.Barrier() - elapsed = ring(comm, size, loops, skip) + elapsed = ring(comm, size, loop, skip) if options.verbose and comm.rank == 0: _println("time for %d loops = %g seconds (%d processes, %d bytes)" - % (loops, elapsed, comm.size, size), + % (loop, elapsed, comm.size, size), stream=_stdout) return elapsed @@ -117,7 +120,7 @@ def _seq_end(comm): 'ringtest' : ringtest, } -def _main(args=None): +def main(args=None): from optparse import OptionParser from mpi4py import __name__ as prog from mpi4py import __version__ as version @@ -163,4 +166,4 @@ def _main(args=None): parser.exit() if __name__ == '__main__': - _main() + main() From b7cc5501df5bee418709070d352efe80adc25e3e Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Tue, 30 Apr 2013 12:11:41 +0300 Subject: [PATCH 31/56] MPI-3: Neighborhood collectives --- src/MPI/Comm.pyx | 150 +++++++++++++++++++++++++++++++++++++ src/MPI/commimpl.pxi | 28 +++++++ src/MPI/msgbuffer.pxi | 61 +++++++++++---- src/MPI/msgpickle.pxi | 64 ++++++++++++++++ src/config/mpi-30.h | 12 +++ src/config/mpich2.h | 21 ++++++ src/include/mpi4py/mpi.pxi | 12 +++ src/missing.h | 50 +++++++++++++ test/test_cco_ngh_buf.py | 144 +++++++++++++++++++++++++++++++++++ test/test_cco_ngh_obj.py | 115 ++++++++++++++++++++++++++++ 10 files changed, 643 insertions(+), 14 deletions(-) create mode 100644 test/test_cco_ngh_buf.py create mode 100644 test/test_cco_ngh_obj.py diff --git a/src/MPI/Comm.pyx b/src/MPI/Comm.pyx index 975b27b..be12a00 100644 --- a/src/MPI/Comm.pyx +++ b/src/MPI/Comm.pyx @@ -835,6 +835,7 @@ cdef class Comm: """ Nonblocking Generalized All-to-All """ + sendbuf = recvbuf = None raise NotImplementedError # XXX implement! cdef void *sbuf = NULL, *rbuf = NULL cdef int *scounts = NULL, *rcounts = NULL @@ -1426,6 +1427,155 @@ cdef class Intracomm(Comm): cdef MPI_Comm comm = self.ob_mpi return PyMPI_exscan(sendobj, recvobj, op, comm) + # Neighborhood Collectives + # ------------------------ + + def Neighbor_allgather(self, sendbuf, recvbuf): + """ + Neighbor Gather to All + """ + cdef _p_msg_cco m = message_cco() + m.for_neighbor_allgather(0, sendbuf, recvbuf, self.ob_mpi) + with nogil: CHKERR( MPI_Neighbor_allgather( + m.sbuf, m.scount, m.stype, + m.rbuf, m.rcount, m.rtype, + self.ob_mpi) ) + + def Neighbor_allgatherv(self, sendbuf, recvbuf): + """ + Neighbor Gather to All Vector + """ + cdef _p_msg_cco m = message_cco() + m.for_neighbor_allgather(1, sendbuf, recvbuf, self.ob_mpi) + with nogil: CHKERR( MPI_Neighbor_allgatherv( + m.sbuf, m.scount, m.stype, + m.rbuf, m.rcounts, m.rdispls, m.rtype, + self.ob_mpi) ) + + def Neighbor_alltoall(self, sendbuf, recvbuf): + """ + Neighbor All-to-All + """ + cdef _p_msg_cco m = message_cco() + m.for_neighbor_alltoall(0, sendbuf, recvbuf, self.ob_mpi) + with nogil: CHKERR( MPI_Neighbor_alltoall( + m.sbuf, m.scount, m.stype, + m.rbuf, m.rcount, m.rtype, + self.ob_mpi) ) + + def Neighbor_alltoallv(self, sendbuf, recvbuf): + """ + Neighbor All-to-All Vector + """ + cdef _p_msg_cco m = message_cco() + m.for_neighbor_alltoall(1, sendbuf, recvbuf, self.ob_mpi) + with nogil: CHKERR( MPI_Neighbor_alltoallv( + m.sbuf, m.scounts, m.sdispls, m.stype, + m.rbuf, m.rcounts, m.rdispls, m.rtype, + self.ob_mpi) ) + + def Neighbor_alltoallw(self, sendbuf, recvbuf): + """ + Neighbor All-to-All Generalized + """ + sendbuf = recvbuf = None + raise NotImplementedError # XXX implement! + cdef void *sbuf = NULL, *rbuf = NULL + cdef int *scounts = NULL, *rcounts = NULL + cdef int *sdispls = NULL, *rdispls = NULL + cdef MPI_Datatype *stypes = NULL, *rtypes = NULL + with nogil: CHKERR( MPI_Neighbor_alltoallw( + sbuf, scounts, sdispls, stypes, + rbuf, rcounts, rdispls, rtypes, + self.ob_mpi) ) + + # Nonblocking Neighborhood Collectives + + def Ineighbor_allgather(self, sendbuf, recvbuf): + """ + Nonblocking Neighbor Gather to All + """ + cdef _p_msg_cco m = message_cco() + m.for_neighbor_allgather(0, sendbuf, recvbuf, self.ob_mpi) + cdef Request request = Request.__new__(Request) + with nogil: CHKERR( MPI_Ineighbor_allgather( + m.sbuf, m.scount, m.stype, + m.rbuf, m.rcount, m.rtype, + self.ob_mpi, &request.ob_mpi) ) + request.ob_buf = m + return request + + def Ineighbor_allgatherv(self, sendbuf, recvbuf): + """ + Nonblocking Neighbor Gather to All Vector + """ + cdef _p_msg_cco m = message_cco() + m.for_neighbor_allgather(1, sendbuf, recvbuf, self.ob_mpi) + cdef Request request = Request.__new__(Request) + with nogil: CHKERR( MPI_Ineighbor_allgatherv( + m.sbuf, m.scount, m.stype, + m.rbuf, m.rcounts, m.rdispls, m.rtype, + self.ob_mpi, &request.ob_mpi) ) + request.ob_buf = m + return request + + def Ineighbor_alltoall(self, sendbuf, recvbuf): + """ + Nonblocking Neighbor All-to-All + """ + cdef _p_msg_cco m = message_cco() + m.for_neighbor_alltoall(0, sendbuf, recvbuf, self.ob_mpi) + cdef Request request = Request.__new__(Request) + with nogil: CHKERR( MPI_Ineighbor_alltoall( + m.sbuf, m.scount, m.stype, + m.rbuf, m.rcount, m.rtype, + self.ob_mpi, &request.ob_mpi) ) + request.ob_buf = m + return request + + def Ineighbor_alltoallv(self, sendbuf, recvbuf): + """ + Nonblocking Neighbor All-to-All Vector + """ + cdef _p_msg_cco m = message_cco() + m.for_neighbor_alltoall(1, sendbuf, recvbuf, self.ob_mpi) + cdef Request request = Request.__new__(Request) + with nogil: CHKERR( MPI_Ineighbor_alltoallv( + m.sbuf, m.scounts, m.sdispls, m.stype, + m.rbuf, m.rcounts, m.rdispls, m.rtype, + self.ob_mpi, &request.ob_mpi) ) + request.ob_buf = m + return request + + def Ineighbor_alltoallw(self, sendbuf, recvbuf): + """ + Nonblocking Neighbor All-to-All Generalized + """ + sendbuf = recvbuf = None + raise NotImplementedError # XXX implement! + cdef void *sbuf = NULL, *rbuf = NULL + cdef int *scounts = NULL, *rcounts = NULL + cdef int *sdispls = NULL, *rdispls = NULL + cdef MPI_Datatype *stypes = NULL, *rtypes = NULL + cdef Request request = Request.__new__(Request) + with nogil: CHKERR( MPI_Ineighbor_alltoallw( + sbuf, scounts, sdispls, stypes, + rbuf, rcounts, rdispls, rtypes, + self.ob_mpi, &request.ob_mpi) ) + request.ob_buf = None + return request + + # Python Communication + # + def neighbor_allgather(self, sendobj=None, recvobj=None): + """Neighbor Gather to All""" + cdef MPI_Comm comm = self.ob_mpi + return PyMPI_neighbor_allgather(sendobj, recvobj, comm) + # + def neighbor_alltoall(self, sendobj=None, recvobj=None): + """Neighbor All to All Scatter/Gather""" + cdef MPI_Comm comm = self.ob_mpi + return PyMPI_neighbor_alltoall(sendobj, recvobj, comm) # Establishing Communication # -------------------------- diff --git a/src/MPI/commimpl.pxi b/src/MPI/commimpl.pxi index 0d6efbc..231da8a 100644 --- a/src/MPI/commimpl.pxi +++ b/src/MPI/commimpl.pxi @@ -158,3 +158,31 @@ cdef object asarray_weights(object weights, int nweight, int **iweight): return chkarray_int(weights, nweight, iweight) # ----------------------------------------------------------------------------- + +cdef inline int comm_neighbors_count(MPI_Comm comm, + int *incoming, + int *outgoing, + ) except -1: + cdef int topo = MPI_UNDEFINED + cdef int size=0, ndims=0, rank=0, nneighbors=0 + cdef int indegree=0, outdegree=0, weighted=0 + CHKERR( MPI_Topo_test(comm, &topo) ) + if topo == MPI_UNDEFINED: # XXX + CHKERR( MPI_Comm_size(comm, &size) ) + indegree = outdegree = size + elif topo == MPI_CART: + CHKERR( MPI_Cartdim_get(comm, &ndims) ) + indegree = outdegree = 2*ndims + elif topo == MPI_GRAPH: + CHKERR( MPI_Comm_rank(comm, &rank) ) + CHKERR( MPI_Graph_neighbors_count( + comm, rank, &nneighbors) ) + indegree = outdegree = nneighbors + elif topo == MPI_DIST_GRAPH: + CHKERR( MPI_Dist_graph_neighbors_count( + comm, &indegree, &outdegree, &weighted) ) + if incoming != NULL: incoming[0] = indegree + if outgoing != NULL: outgoing[0] = outdegree + return 0 + +# ----------------------------------------------------------------------------- diff --git a/src/MPI/msgbuffer.pxi b/src/MPI/msgbuffer.pxi index 3a48f10..a22080e 100644 --- a/src/MPI/msgbuffer.pxi +++ b/src/MPI/msgbuffer.pxi @@ -17,6 +17,7 @@ cdef object __IN_PLACE__ = MPI_IN_PLACE #------------------------------------------------------------------------------ +#@cython.final #@cython.internal cdef class _p_message: cdef _p_buffer buf @@ -156,7 +157,7 @@ cdef _p_message message_simple(object msg, if blocks < 1: blocks = 1 if ((bsize // extent) % blocks) != 0: raise ValueError( ("message: cannot guess count, " - "number of datatype items %d is not a multiple of" + "number of datatype items %d is not a multiple of " "the required number of blocks %d" ) % (bsize//extent, blocks)) count = ((bsize // extent) // blocks) # XXX overflow? @@ -288,6 +289,7 @@ cdef _p_message message_vector(object msg, #------------------------------------------------------------------------------ +#@cython.final #@cython.internal cdef class _p_msg_p2p: @@ -331,12 +333,13 @@ cdef inline _p_msg_p2p message_p2p_recv(object recvbuf, int source): #------------------------------------------------------------------------------ +#@cython.final #@cython.internal cdef class _p_msg_cco: # raw C-side arguments cdef void *sbuf, *rbuf - cdef int scount, rcount + cdef int scount, rcount cdef int *scounts, *rcounts cdef int *sdispls, *rdispls cdef MPI_Datatype stype, rtype @@ -355,31 +358,35 @@ cdef class _p_msg_cco: # ----------------------------------- # sendbuf arguments - cdef int for_cco_send(self, int vector, + cdef int for_cco_send(self, bint VECTOR, object amsg, - int root, int size) except -1: - if not vector: # block variant + int rank, int blocks) except -1: + cdef bint readonly = 1 + if not VECTOR: # block variant self._smsg = message_simple( - amsg, 1, root, size, + amsg, readonly, rank, blocks, &self.sbuf, &self.scount, &self.stype) else: # vector variant self._smsg = message_vector( - amsg, 1, root, size, - &self.sbuf, &self.scounts, &self.sdispls, &self.stype) + amsg, readonly, rank, blocks, + &self.sbuf, &self.scounts, + &self.sdispls, &self.stype) return 0 # recvbuf arguments - cdef int for_cco_recv(self, int vector, + cdef int for_cco_recv(self, bint VECTOR, object amsg, - int root, int size) except -1: - if not vector: # block variant + int rank, int blocks) except -1: + cdef bint readonly = 0 + if not VECTOR: # block variant self._rmsg = message_simple( - amsg, 0, root, size, + amsg, readonly, rank, blocks, &self.rbuf, &self.rcount, &self.rtype) else: # vector variant self._rmsg = message_vector( - amsg, 0, root, size, - &self.rbuf, &self.rcounts, &self.rdispls, &self.rtype) + amsg, readonly, rank, blocks, + &self.rbuf, &self.rcounts, + &self.rdispls, &self.rtype) return 0 # bcast @@ -521,6 +528,30 @@ cdef class _p_msg_cco: self.for_cco_send(v, smsg, 0, size) return 0 + # Neighbor Collectives + # -------------------- + + # neighbor allgather/allgatherv + cdef int for_neighbor_allgather(self, int v, + object smsg, object rmsg, + MPI_Comm comm) except -1: + if comm == MPI_COMM_NULL: return 0 + cdef int recvsize=0 + comm_neighbors_count(comm, &recvsize, NULL) + self.for_cco_send(0, smsg, 0, 0) + self.for_cco_recv(v, rmsg, 0, recvsize) + return 0 + + # neighbor alltoall/alltoallv + cdef int for_neighbor_alltoall(self, int v, + object smsg, object rmsg, + MPI_Comm comm) except -1: + if comm == MPI_COMM_NULL: return 0 + cdef int sendsize=0, recvsize=0 + comm_neighbors_count(comm, &recvsize, &sendsize) + self.for_cco_send(v, smsg, 0, sendsize) + self.for_cco_recv(v, rmsg, 0, recvsize) + return 0 # Collective Reductions Operations # -------------------------------- @@ -725,6 +756,7 @@ cdef inline _p_msg_cco message_cco(): #------------------------------------------------------------------------------ +#@cython.final #@cython.internal cdef class _p_msg_rma: @@ -816,6 +848,7 @@ cdef inline _p_msg_rma message_rma(): #------------------------------------------------------------------------------ +#@cython.final #@cython.internal cdef class _p_msg_io: diff --git a/src/MPI/msgpickle.pxi b/src/MPI/msgpickle.pxi index bb50a17..9a3be36 100644 --- a/src/MPI/msgpickle.pxi +++ b/src/MPI/msgpickle.pxi @@ -35,6 +35,7 @@ if PY_MAJOR_VERSION == 2: except ImportError: pass +#@cython.final #@cython.internal cdef class _p_Pickle: @@ -824,6 +825,69 @@ cdef object PyMPI_alltoall(object sendobj, object recvobj, rmsg = pickle.loadv(rmsg, size, rcounts, rdispls) return rmsg + +cdef object PyMPI_neighbor_allgather(object sendobj, object recvobj, + MPI_Comm comm): + cdef _p_Pickle pickle = PyMPI_pickle() + # + cdef void *sbuf = NULL + cdef int scount = 0 + cdef MPI_Datatype stype = MPI_BYTE + cdef void *rbuf = NULL + cdef int *rcounts = NULL + cdef int *rdispls = NULL + cdef MPI_Datatype rtype = MPI_BYTE + # + cdef int rsize=0 + comm_neighbors_count(comm, &rsize, NULL) + # + cdef object tmp1 = allocate_int(rsize, &rcounts) + cdef object tmp2 = allocate_int(rsize, &rdispls) + # + cdef object smsg = pickle.dump(sendobj, &sbuf, &scount) + with nogil: CHKERR( MPI_Neighbor_allgather(&scount, 1, MPI_INT, + rcounts, 1, MPI_INT, + comm) ) + cdef object rmsg = pickle.allocv(&rbuf, rsize, rcounts, rdispls) + with nogil: CHKERR( MPI_Neighbor_allgatherv(sbuf, scount, stype, + rbuf, rcounts, rdispls, rtype, + comm) ) + rmsg = pickle.loadv(rmsg, rsize, rcounts, rdispls) + return rmsg + + +cdef object PyMPI_neighbor_alltoall(object sendobj, object recvobj, + MPI_Comm comm): + cdef _p_Pickle pickle = PyMPI_pickle() + # + cdef void *sbuf = NULL + cdef int *scounts = NULL + cdef int *sdispls = NULL + cdef MPI_Datatype stype = MPI_BYTE + cdef void *rbuf = NULL + cdef int *rcounts = NULL + cdef int *rdispls = NULL + cdef MPI_Datatype rtype = MPI_BYTE + # + cdef int ssize=0, rsize=0 + comm_neighbors_count(comm, &rsize, &ssize) + # + cdef object stmp1 = allocate_int(ssize, &scounts) + cdef object stmp2 = allocate_int(ssize, &sdispls) + cdef object rtmp1 = allocate_int(rsize, &rcounts) + cdef object rtmp2 = allocate_int(rsize, &rdispls) + # + cdef object smsg = pickle.dumpv(sendobj, &sbuf, ssize, scounts, sdispls) + with nogil: CHKERR( MPI_Neighbor_alltoall(scounts, 1, MPI_INT, + rcounts, 1, MPI_INT, + comm) ) + cdef object rmsg = pickle.allocv(&rbuf, rsize, rcounts, rdispls) + with nogil: CHKERR( MPI_Neighbor_alltoallv(sbuf, scounts, sdispls, stype, + rbuf, rcounts, rdispls, rtype, + comm) ) + rmsg = pickle.loadv(rmsg, rsize, rcounts, rdispls) + return rmsg + # ----------------------------------------------------------------------------- cdef inline object _py_reduce(object seq, object op): diff --git a/src/config/mpi-30.h b/src/config/mpi-30.h index 287e8c8..6f6c919 100644 --- a/src/config/mpi-30.h +++ b/src/config/mpi-30.h @@ -23,6 +23,12 @@ #define PyMPI_MISSING_MPI_Mrecv 1 #define PyMPI_MISSING_MPI_Imrecv 1 +#define PyMPI_MISSING_MPI_Neighbor_allgather 1 +#define PyMPI_MISSING_MPI_Neighbor_allgatherv 1 +#define PyMPI_MISSING_MPI_Neighbor_alltoall 1 +#define PyMPI_MISSING_MPI_Neighbor_alltoallv 1 +#define PyMPI_MISSING_MPI_Neighbor_alltoallw 1 + #define PyMPI_MISSING_MPI_Ibarrier 1 #define PyMPI_MISSING_MPI_Ibcast 1 #define PyMPI_MISSING_MPI_Igather 1 @@ -41,6 +47,12 @@ #define PyMPI_MISSING_MPI_Iscan 1 #define PyMPI_MISSING_MPI_Iexscan 1 +#define PyMPI_MISSING_MPI_Ineighbor_allgather 1 +#define PyMPI_MISSING_MPI_Ineighbor_allgatherv 1 +#define PyMPI_MISSING_MPI_Ineighbor_alltoall 1 +#define PyMPI_MISSING_MPI_Ineighbor_alltoallv 1 +#define PyMPI_MISSING_MPI_Ineighbor_alltoallw 1 + #define PyMPI_MISSING_MPI_WEIGHTS_EMPTY 1 #define PyMPI_MISSING_MPI_Comm_dup_with_info 1 diff --git a/src/config/mpich2.h b/src/config/mpich2.h index b69fb56..ea0ccda 100644 --- a/src/config/mpich2.h +++ b/src/config/mpich2.h @@ -113,6 +113,27 @@ #define MPI_Iscan MPIX_Iscan #define MPI_Iexscan MPIX_Iexscan /**/ +#undef PyMPI_MISSING_MPI_Neighbor_allgather +#undef PyMPI_MISSING_MPI_Neighbor_allgatherv +#undef PyMPI_MISSING_MPI_Neighbor_alltoall +#undef PyMPI_MISSING_MPI_Neighbor_alltoallv +#undef PyMPI_MISSING_MPI_Neighbor_alltoallw +#define MPI_Neighbor_allgather MPIX_Neighbor_allgather +#define MPI_Neighbor_allgatherv MPIX_Neighbor_allgatherv +#define MPI_Neighbor_alltoall MPIX_Neighbor_alltoall +#define MPI_Neighbor_alltoallv MPIX_Neighbor_alltoallv +#define MPI_Neighbor_alltoallw MPIX_Neighbor_alltoallw +#undef PyMPI_MISSING_MPI_Ineighbor_allgather +#undef PyMPI_MISSING_MPI_Ineighbor_allgatherv +#undef PyMPI_MISSING_MPI_Ineighbor_alltoall +#undef PyMPI_MISSING_MPI_Ineighbor_alltoallv +#undef PyMPI_MISSING_MPI_Ineighbor_alltoallw +#define MPI_Ineighbor_allgather MPIX_Ineighbor_allgather +#define MPI_Ineighbor_allgatherv MPIX_Ineighbor_allgatherv +#define MPI_Ineighbor_alltoall MPIX_Ineighbor_alltoall +#define MPI_Ineighbor_alltoallv MPIX_Ineighbor_alltoallv +#define MPI_Ineighbor_alltoallw MPIX_Ineighbor_alltoallw +/**/ #undef PyMPI_MISSING_MPI_Comm_idup #undef PyMPI_MISSING_MPI_Comm_create_group #undef PyMPI_MISSING_MPI_COMM_TYPE_SHARED diff --git a/src/include/mpi4py/mpi.pxi b/src/include/mpi4py/mpi.pxi index a46cdca..dc83945 100644 --- a/src/include/mpi4py/mpi.pxi +++ b/src/include/mpi4py/mpi.pxi @@ -410,6 +410,12 @@ cdef extern from "mpi.h" nogil: int MPI_Scan(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm) int MPI_Exscan(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm) + int MPI_Neighbor_allgather(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm) + int MPI_Neighbor_allgatherv(void*, int, MPI_Datatype, void*, int[], int[], MPI_Datatype, MPI_Comm) + int MPI_Neighbor_alltoall(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm) + int MPI_Neighbor_alltoallv(void*, int[], int[],MPI_Datatype, void*, int[],int[], MPI_Datatype, MPI_Comm) + int MPI_Neighbor_alltoallw(void *, int[], MPI_Aint[],MPI_Datatype[], void*, int[],MPI_Aint[], MPI_Datatype[], MPI_Comm) + int MPI_Ibarrier(MPI_Comm, MPI_Request*) int MPI_Ibcast(void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*) int MPI_Igather(void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*) @@ -429,6 +435,12 @@ cdef extern from "mpi.h" nogil: int MPI_Iscan(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*) int MPI_Iexscan(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*) + int MPI_Ineighbor_allgather(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm, MPI_Request*) + int MPI_Ineighbor_allgatherv(void*, int, MPI_Datatype, void*, int[], int[], MPI_Datatype, MPI_Comm, MPI_Request*) + int MPI_Ineighbor_alltoall(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm, MPI_Request*) + int MPI_Ineighbor_alltoallv(void*, int[], int[],MPI_Datatype, void*, int[],int[], MPI_Datatype, MPI_Comm, MPI_Request*) + int MPI_Ineighbor_alltoallw(void *, int[], MPI_Aint[],MPI_Datatype[], void*, int[],MPI_Aint[], MPI_Datatype[], MPI_Comm, MPI_Request*) + int MPI_Comm_dup(MPI_Comm, MPI_Comm*) int MPI_Comm_dup_with_info(MPI_Comm, MPI_Info, MPI_Comm*) int MPI_Comm_idup(MPI_Comm, MPI_Comm*, MPI_Request*) diff --git a/src/missing.h b/src/missing.h index e4c30ef..ef0097d 100644 --- a/src/missing.h +++ b/src/missing.h @@ -1566,6 +1566,31 @@ typedef void (PyMPI_MPI_User_function)(void*, void*, int*, MPI_Datatype*); #define MPI_Exscan(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Exscan",a1,a2,a3,a4,a5,a6) #endif +#ifdef PyMPI_MISSING_MPI_Neighbor_allgather +#undef MPI_Neighbor_allgather +#define MPI_Neighbor_allgather(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Neighbor_allgather",a1,a2,a3,a4,a5,a6,a7) +#endif + +#ifdef PyMPI_MISSING_MPI_Neighbor_allgatherv +#undef MPI_Neighbor_allgatherv +#define MPI_Neighbor_allgatherv(a1,a2,a3,a4,a5,a6,a7,a8) PyMPI_UNAVAILABLE("MPI_Neighbor_allgatherv",a1,a2,a3,a4,a5,a6,a7,a8) +#endif + +#ifdef PyMPI_MISSING_MPI_Neighbor_alltoall +#undef MPI_Neighbor_alltoall +#define MPI_Neighbor_alltoall(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Neighbor_alltoall",a1,a2,a3,a4,a5,a6,a7) +#endif + +#ifdef PyMPI_MISSING_MPI_Neighbor_alltoallv +#undef MPI_Neighbor_alltoallv +#define MPI_Neighbor_alltoallv(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Neighbor_alltoallv",a1,a2,a3,a4,a5,a6,a7,a8,a9) +#endif + +#ifdef PyMPI_MISSING_MPI_Neighbor_alltoallw +#undef MPI_Neighbor_alltoallw +#define MPI_Neighbor_alltoallw(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Neighbor_alltoallw",a1,a2,a3,a4,a5,a6,a7,a8,a9) +#endif + #ifdef PyMPI_MISSING_MPI_Ibarrier #undef MPI_Ibarrier #define MPI_Ibarrier(a1,a2) PyMPI_UNAVAILABLE("MPI_Ibarrier",a1,a2) @@ -1651,6 +1676,31 @@ typedef void (PyMPI_MPI_User_function)(void*, void*, int*, MPI_Datatype*); #define MPI_Iexscan(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Iexscan",a1,a2,a3,a4,a5,a6,a7) #endif +#ifdef PyMPI_MISSING_MPI_Ineighbor_allgather +#undef MPI_Ineighbor_allgather +#define MPI_Ineighbor_allgather(a1,a2,a3,a4,a5,a6,a7,a8) PyMPI_UNAVAILABLE("MPI_Ineighbor_allgather",a1,a2,a3,a4,a5,a6,a7,a8) +#endif + +#ifdef PyMPI_MISSING_MPI_Ineighbor_allgatherv +#undef MPI_Ineighbor_allgatherv +#define MPI_Ineighbor_allgatherv(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Ineighbor_allgatherv",a1,a2,a3,a4,a5,a6,a7,a8,a9) +#endif + +#ifdef PyMPI_MISSING_MPI_Ineighbor_alltoall +#undef MPI_Ineighbor_alltoall +#define MPI_Ineighbor_alltoall(a1,a2,a3,a4,a5,a6,a7,a8) PyMPI_UNAVAILABLE("MPI_Ineighbor_alltoall",a1,a2,a3,a4,a5,a6,a7,a8) +#endif + +#ifdef PyMPI_MISSING_MPI_Ineighbor_alltoallv +#undef MPI_Ineighbor_alltoallv +#define MPI_Ineighbor_alltoallv(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) PyMPI_UNAVAILABLE("MPI_Ineighbor_alltoallv",a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) +#endif + +#ifdef PyMPI_MISSING_MPI_Ineighbor_alltoallw +#undef MPI_Ineighbor_alltoallw +#define MPI_Ineighbor_alltoallw(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) PyMPI_UNAVAILABLE("MPI_Ineighbor_alltoallw",a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) +#endif + #ifdef PyMPI_MISSING_MPI_Comm_dup #undef MPI_Comm_dup #define MPI_Comm_dup(a1,a2) PyMPI_UNAVAILABLE("MPI_Comm_dup",a1,a2) diff --git a/test/test_cco_ngh_buf.py b/test/test_cco_ngh_buf.py new file mode 100644 index 0000000..0a079af --- /dev/null +++ b/test/test_cco_ngh_buf.py @@ -0,0 +1,144 @@ +from mpi4py import MPI +import mpiunittest as unittest +import arrayimpl + +def create_topo_comms(comm): + size = comm.Get_size() + rank = comm.Get_rank() + # Cartesian + n = int(size**1/2.0) + m = int(size**1/3.0) + if m*m*m == size: + dims = [m, m, m] + elif n*n == size: + dims = [n, n] + else: + dims = [size] + periods = [True] * len(dims) + yield comm.Create_cart(dims, periods=periods) + # Graph + index, edges = [0], [] + for i in range(size): + pos = index[-1] + index.append(pos+2) + edges.append((i-1)%size) + edges.append((i+1)%size) + yield comm.Create_graph(index, edges) + # Dist Graph + sources = [(rank-2)%size, (rank-1)%size] + destinations = [(rank+1)%size, (rank+2)%size] + yield comm.Create_dist_graph_adjacent(sources, destinations) + +def get_neighbors_count(comm): + topo = comm.Get_topology() + if topo == MPI.CART: + ndim = comm.Get_dim() + return 2*ndim, 2*ndim + if topo == MPI.GRAPH: + rank = comm.Get_rank() + nneighbors = comm.Get_neighbors_count(rank) + return nneighbors, nneighbors + if topo == MPI.DIST_GRAPH: + indeg, outdeg, w = comm.Get_dist_neighbors_count() + return indeg, outdeg + return 0, 0 + + +class BaseTestCCONghBuf(object): + + COMM = MPI.COMM_NULL + + def testNeighborAllgather(self): + for comm in create_topo_comms(self.COMM): + rsize, ssize = get_neighbors_count(comm) + for array in arrayimpl.ArrayTypes: + for typecode in arrayimpl.TypeMap: + for v in range(3): + sbuf = array( v, typecode, 3) + rbuf = array(-1, typecode, (rsize, 3)) + comm.Neighbor_allgather(sbuf.as_mpi(), rbuf.as_mpi()) + for value in rbuf.flat: + self.assertEqual(value, v) + sbuf = array( v, typecode, 3) + rbuf = array(-1, typecode, (rsize, 3)) + comm.Neighbor_allgatherv(sbuf.as_mpi_c(3), rbuf.as_mpi_c(3)) + for value in rbuf.flat: + self.assertEqual(value, v) + sbuf = array( v, typecode, 3) + rbuf = array(-1, typecode, (rsize, 3)) + comm.Ineighbor_allgather(sbuf.as_mpi(), rbuf.as_mpi()).Wait() + for value in rbuf.flat: + self.assertEqual(value, v) + sbuf = array( v, typecode, 3) + rbuf = array(-1, typecode, (rsize, 3)) + comm.Ineighbor_allgatherv(sbuf.as_mpi_c(3), rbuf.as_mpi_c(3)).Wait() + for value in rbuf.flat: + self.assertEqual(value, v) + comm.Free() + + def testNeighborAlltoall(self): + for comm in create_topo_comms(self.COMM): + rsize, ssize = get_neighbors_count(comm) + for array in arrayimpl.ArrayTypes: + for typecode in arrayimpl.TypeMap: + for v in range(3): + sbuf = array( v, typecode, (ssize, 3)) + rbuf = array(-1, typecode, (rsize, 3)) + comm.Neighbor_alltoall(sbuf.as_mpi(), rbuf.as_mpi_c(3)) + for value in rbuf.flat: + self.assertEqual(value, v) + sbuf = array( v, typecode, (ssize, 3)) + rbuf = array(-1, typecode, (rsize, 3)) + comm.Neighbor_alltoall(sbuf.as_mpi(), rbuf.as_mpi()) + for value in rbuf.flat: + self.assertEqual(value, v) + sbuf = array( v, typecode, (ssize, 3)) + rbuf = array(-1, typecode, (rsize, 3)) + comm.Neighbor_alltoallv(sbuf.as_mpi_c(3), rbuf.as_mpi_c(3)) + for value in rbuf.flat: + self.assertEqual(value, v) + sbuf = array( v, typecode, (ssize, 3)) + rbuf = array(-1, typecode, (rsize, 3)) + comm.Ineighbor_alltoall(sbuf.as_mpi(), rbuf.as_mpi()).Wait() + for value in rbuf.flat: + self.assertEqual(value, v) + sbuf = array( v, typecode, (ssize, 3)) + rbuf = array(-1, typecode, (rsize, 3)) + comm.Ineighbor_alltoallv(sbuf.as_mpi_c(3), rbuf.as_mpi_c(3)).Wait() + for value in rbuf.flat: + self.assertEqual(value, v) + comm.Free() + + +class TestCCONghBufSelf(BaseTestCCONghBuf, unittest.TestCase): + COMM = MPI.COMM_SELF + +class TestCCONghBufWorld(BaseTestCCONghBuf, unittest.TestCase): + COMM = MPI.COMM_WORLD + +class TestCCONghBufSelfDup(BaseTestCCONghBuf, unittest.TestCase): + def setUp(self): + self.COMM = MPI.COMM_SELF.Dup() + def tearDown(self): + self.COMM.Free() + +class TestCCONghBufWorldDup(BaseTestCCONghBuf, unittest.TestCase): + def setUp(self): + self.COMM = MPI.COMM_WORLD.Dup() + def tearDown(self): + self.COMM.Free() + +cartcomm = MPI.COMM_SELF.Create_cart([1], periods=[1]) +try: + cartcomm.neighbor_allgather(None) +except NotImplementedError: + del BaseTestCCONghBuf + del TestCCONghBufSelf + del TestCCONghBufWorld + del TestCCONghBufSelfDup + del TestCCONghBufWorldDup +finally: + cartcomm.Free() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_cco_ngh_obj.py b/test/test_cco_ngh_obj.py new file mode 100644 index 0000000..a63143a --- /dev/null +++ b/test/test_cco_ngh_obj.py @@ -0,0 +1,115 @@ +from mpi4py import MPI +import mpiunittest as unittest + +_basic = [None, + True, False, + -7, 0, 7, 2**31, + -2**63, 2**63-1, + -2.17, 0.0, 3.14, + 1+2j, 2-3j, + 'mpi4py', + ] +messages = _basic +messages += [ list(_basic), + tuple(_basic), + dict([('k%d' % key, val) + for key, val in enumerate(_basic)]) + ] +messages = messages + [messages] + +def create_topo_comms(comm): + size = comm.Get_size() + rank = comm.Get_rank() + # Cartesian + n = int(size**1/2.0) + m = int(size**1/3.0) + if m*m*m == size: + dims = [m, m, m] + elif n*n == size: + dims = [n, n] + else: + dims = [size] + periods = [True] * len(dims) + yield comm.Create_cart(dims, periods=periods) + # Graph + index, edges = [0], [] + for i in range(size): + pos = index[-1] + index.append(pos+2) + edges.append((i-1)%size) + edges.append((i+1)%size) + yield comm.Create_graph(index, edges) + # Dist Graph + sources = [(rank-2)%size, (rank-1)%size] + destinations = [(rank+1)%size, (rank+2)%size] + yield comm.Create_dist_graph_adjacent(sources, destinations) + +def get_neighbors_count(comm): + topo = comm.Get_topology() + if topo == MPI.CART: + ndim = comm.Get_dim() + return 2*ndim, 2*ndim + if topo == MPI.GRAPH: + rank = comm.Get_rank() + nneighbors = comm.Get_neighbors_count(rank) + return nneighbors, nneighbors + if topo == MPI.DIST_GRAPH: + indeg, outdeg, w = comm.Get_dist_neighbors_count() + return indeg, outdeg + return 0, 0 + + +class BaseTestCCONghObj(object): + + COMM = MPI.COMM_NULL + + def testNeighborAllgather(self): + for comm in create_topo_comms(self.COMM): + rsize, ssize = get_neighbors_count(comm) + for smess in messages: + rmess = comm.neighbor_allgather(smess) + self.assertEqual(rmess, [smess] * rsize) + comm.Free() + + def testNeighborAlltoall(self): + for comm in create_topo_comms(self.COMM): + rsize, ssize = get_neighbors_count(comm) + for smess in messages: + rmess = comm.neighbor_alltoall([smess] * ssize) + self.assertEqual(rmess, [smess] * rsize) + comm.Free() + + +class TestCCONghObjSelf(BaseTestCCONghObj, unittest.TestCase): + COMM = MPI.COMM_SELF + +class TestCCONghObjWorld(BaseTestCCONghObj, unittest.TestCase): + COMM = MPI.COMM_WORLD + +class TestCCONghObjSelfDup(BaseTestCCONghObj, unittest.TestCase): + def setUp(self): + self.COMM = MPI.COMM_SELF.Dup() + def tearDown(self): + self.COMM.Free() + +class TestCCONghObjWorldDup(BaseTestCCONghObj, unittest.TestCase): + def setUp(self): + self.COMM = MPI.COMM_WORLD.Dup() + def tearDown(self): + self.COMM.Free() + + +cartcomm = MPI.COMM_SELF.Create_cart([1], periods=[1]) +try: + cartcomm.neighbor_allgather(None) +except NotImplementedError: + del BaseTestCCONghObj + del TestCCONghObjSelf + del TestCCONghObjWorld + del TestCCONghObjSelfDup + del TestCCONghObjWorldDup +finally: + cartcomm.Free() + +if __name__ == '__main__': + unittest.main() From c6a02b19234332df098442dec450ce5c379ca153 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Tue, 30 Apr 2013 18:44:49 +0300 Subject: [PATCH 32/56] Update for Open MPI 1.7 --- src/atimport.h | 3 --- src/config/openmpi.h | 34 +++++++++++++++++++++++++--------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/atimport.h b/src/atimport.h index d80a6ec..8a4a85c 100644 --- a/src/atimport.h +++ b/src/atimport.h @@ -155,9 +155,6 @@ static int PyMPI_CleanUp(void) return MPI_SUCCESS; } -#ifndef PyMPI_UNUSED -#define PyMPI_UNUSED -#endif static int PyMPIAPI PyMPI_AtExitMPI(PyMPI_UNUSED MPI_Comm comm, PyMPI_UNUSED int k, diff --git a/src/config/openmpi.h b/src/config/openmpi.h index 14aa1f6..3a7df4a 100644 --- a/src/config/openmpi.h +++ b/src/config/openmpi.h @@ -73,13 +73,13 @@ #endif #endif -#if MPI_VERSION < 3 -#if (defined(OMPI_MAJOR_VERSION) && \ - defined(OMPI_MINOR_VERSION) && \ - defined(OMPI_RELEASE_VERSION)) && \ - ((OMPI_MAJOR_VERSION * 10000) + \ - (OMPI_MINOR_VERSION * 100) + \ - (OMPI_RELEASE_VERSION * 1)) >= 10900 +#if MPI_VERSION < 3 && (defined(OMPI_MAJOR_VERSION) && \ + defined(OMPI_MINOR_VERSION) && \ + defined(OMPI_RELEASE_VERSION)) + +#if ((OMPI_MAJOR_VERSION * 10000) + \ + (OMPI_MINOR_VERSION * 100) + \ + (OMPI_RELEASE_VERSION * 1)) >= 10700 /**/ #undef PyMPI_MISSING_MPI_Message #undef PyMPI_MISSING_MPI_MESSAGE_NULL @@ -112,7 +112,23 @@ #undef PyMPI_MISSING_MPI_MAX_LIBRARY_VERSION_STRING #undef PyMPI_MISSING_MPI_Get_library_version /**/ -#endif /* OMPI < 1.9*/ -#endif /* MPI < 3.0*/ +#endif /* OMPI < 1.7*/ + +#if 0 +/**/ +#undef PyMPI_MISSING_MPI_Neighbor_allgather +#undef PyMPI_MISSING_MPI_Neighbor_allgatherv +#undef PyMPI_MISSING_MPI_Neighbor_alltoall +#undef PyMPI_MISSING_MPI_Neighbor_alltoallv +#undef PyMPI_MISSING_MPI_Neighbor_alltoallw +#undef PyMPI_MISSING_MPI_Ineighbor_allgather +#undef PyMPI_MISSING_MPI_Ineighbor_allgatherv +#undef PyMPI_MISSING_MPI_Ineighbor_alltoall +#undef PyMPI_MISSING_MPI_Ineighbor_alltoallv +#undef PyMPI_MISSING_MPI_Ineighbor_alltoallw +/**/ +#endif /* */ + +#endif /* MPI < 3.0*/ #endif /* !PyMPI_CONFIG_OPENMPI_H */ From f92b4461def6efa7a02656718b42d4ff66b48c9e Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Tue, 30 Apr 2013 20:00:34 +0300 Subject: [PATCH 33/56] Open MPI: Workaround bug in 1.7 calling MPI_Mrecv(...,MPI_STATUS_IGNORE) --- src/compat/openmpi.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/compat/openmpi.h b/src/compat/openmpi.h index 6463631..36024f8 100644 --- a/src/compat/openmpi.h +++ b/src/compat/openmpi.h @@ -246,6 +246,23 @@ static int PyMPI_OPENMPI_MPI_Win_set_errhandler(MPI_Win win, /* ------------------------------------------------------------------------- */ +/* + * Open MPI 1.7 tries to set status even in the case of MPI_STATUS_IGNORE. + */ + +#if PyMPI_OPENMPI_VERSION >= 10700 +static int PyMPI_OPENMPI_MPI_Mrecv(void *buf, int count, MPI_Datatype type, + MPI_Message *message, MPI_Status *status) +{ + MPI_Status sts; if (status == MPI_STATUS_IGNORE) status = &sts; + return MPI_Mrecv(buf, count, type, message, status); +} +#undef MPI_Mrecv +#define MPI_Mrecv PyMPI_OPENMPI_MPI_Mrecv +#endif /* !(PyMPI_OPENMPI_VERSION > 10700) */ + +/* ------------------------------------------------------------------------- */ + #endif /* !PyMPI_COMPAT_OPENMPI_H */ /* From cbe6c1f46b01a16a4fc40ae4058b18d45ab22ad4 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Tue, 30 Apr 2013 20:58:58 +0300 Subject: [PATCH 34/56] Update makefile in VampirTrace demo --- demo/vampirtrace/makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/demo/vampirtrace/makefile b/demo/vampirtrace/makefile index 228dd3f..fcafdb5 100644 --- a/demo/vampirtrace/makefile +++ b/demo/vampirtrace/makefile @@ -34,3 +34,4 @@ test: run .PHONY: clean clean: ${RM} *.otf *.uctl *.*.def.z *.*.events.z *.*.marker.z + ${RM} *.thumb *.*.def *.*.events From 730c6fef2f8baca049d67ca9815994391d92e0e0 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Wed, 1 May 2013 19:55:04 +0300 Subject: [PATCH 35/56] Quick fix for newer versions of VampirTrace --- setup.py | 25 +++++++++++++++---------- src/pmpi-vt.c | 7 ++++--- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/setup.py b/setup.py index 2914ffc..aba4278 100644 --- a/setup.py +++ b/setup.py @@ -202,7 +202,7 @@ def configure_mpi(ext, config_cmd): if not ok: raise DistutilsPlatformError(errmsg % "link") # log.info("checking for missing MPI functions/symbols ...") - tests = ["defined(%s)" % macro for macro in + tests = ["defined(%s)" % macro for macro in ("OPEN_MPI", "MPICH2", "DEINO_MPI", "MSMPI_VER",)] tests += ["(defined(MPICH_NAME)&&(MPICH_NAME==3))"] ConfigTest = dedent('''\ @@ -250,7 +250,7 @@ def configure_mpe(ext, config_cmd): ) if ok: ext.define_macros += [('HAVE_MPE', 1)] - if ((linux or darwin or solaris) and + if ((linux or darwin or solaris) and libraries[0] == 'lmpe'): ext.extra_link_args += whole_archive('lmpe') for libname in libraries[1:]: @@ -277,7 +277,7 @@ def configure_libmpe(lib, config_cmd): libname, other_libraries=libraries): libraries.insert(0, libname) if 'mpe' in libraries: - if ((linux or darwin or solaris) and + if ((linux or darwin or solaris) and libraries[0] == 'lmpe'): lib.extra_link_args += whole_archive('lmpe') for libname in libraries[1:]: @@ -291,12 +291,17 @@ def configure_libvt(lib, config_cmd): for vt_lib in ('vt-mpi', 'vt.mpi'): ok = config_cmd.check_library(vt_lib) if ok: break - if ok: - if linux or darwin or solaris: - lib.extra_link_args += whole_archive(vt_lib) - lib.extra_link_args += ['-lotf', '-lz', '-ldl'] - else: - lib.libraries += [vt_lib, 'otf', 'z', 'dl'] + if not ok: return + libraries = [] + for libname in ('otf', 'z', 'dl'): + ok = config_cmd.check_library(libname) + if ok: libraries.append(libname) + if linux or darwin or solaris: + lib.extra_link_args += whole_archive(vt_lib) + lib.extra_link_args += ['-l%s' % libname + for libname in libraries] + else: + lib.libraries += [vt_lib] + libraries elif lib.name in ('vt-mpi', 'vt-hyb'): vt_lib = lib.name ok = config_cmd.check_library(vt_lib) @@ -581,7 +586,7 @@ def run_testsuite(cmd): from runtests import main finally: del sys.path[0] - if cmd.dry_run: + if cmd.dry_run: return args = cmd.args[:] or [] if cmd.verbose < 1: diff --git a/src/pmpi-vt.c b/src/pmpi-vt.c index f303c42..07dab6d 100644 --- a/src/pmpi-vt.c +++ b/src/pmpi-vt.c @@ -1,13 +1,14 @@ #include "stdlib.h" #include "mpi.h" +static const char name[] = "vt"; #if (defined(OMPI_MAJOR_VERSION) && \ defined(OMPI_MINOR_VERSION) && \ defined(OMPI_RELEASE_VERSION)) #define OPENMPI_VERSION_NUMBER \ - ((OMPI_MAJOR_VERSION * 10000) + \ - (OMPI_MINOR_VERSION * 100) + \ - (OMPI_RELEASE_VERSION * 1)) + ((OMPI_MAJOR_VERSION * 10000) + \ + (OMPI_MINOR_VERSION * 100) + \ + (OMPI_RELEASE_VERSION * 1)) #endif #ifdef __cplusplus From 37e77760d36a06396d8063aacb7670b7cbabd7a9 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Wed, 1 May 2013 22:22:57 +0300 Subject: [PATCH 36/56] Unimportant fix for code consistency --- src/MPI/Win.pyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MPI/Win.pyx b/src/MPI/Win.pyx index cc3708f..22a6ca6 100644 --- a/src/MPI/Win.pyx +++ b/src/MPI/Win.pyx @@ -216,8 +216,8 @@ cdef class Win: cdef void *attrval = NULL cdef int flag = 0 CHKERR( MPI_Win_get_attr(self.ob_mpi, keyval, &attrval, &flag) ) - if not flag: return None - if not attrval: return 0 + if flag == 0: return None + if attrval == NULL: return 0 # handle predefined keyvals if (keyval == MPI_WIN_BASE): return attrval @@ -500,9 +500,9 @@ cdef class Win: """ Test whether an RMA exposure epoch has completed """ - cdef bint flag = 0 + cdef int flag = 0 with nogil: CHKERR( MPI_Win_test(self.ob_mpi, &flag) ) - return flag + return flag # [6.4.3] Lock # ------------ From 09a45e5d691d25b9772528733cff31a01026bc98 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Wed, 1 May 2013 23:03:18 +0300 Subject: [PATCH 37/56] PyPy: Fix build in OS X --- conf/mpidistutils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf/mpidistutils.py b/conf/mpidistutils.py index 81c4d4b..6ae129f 100644 --- a/conf/mpidistutils.py +++ b/conf/mpidistutils.py @@ -29,6 +29,7 @@ def fix_config_vars(names, values): if 'ARCHFLAGS' in os.environ: ARCHFLAGS = os.environ['ARCHFLAGS'] for i, flag in enumerate(list(values)): + if flag is None: continue flag, count = re.subn('-arch\s+\w+', ' ', flag) if count and ARCHFLAGS: flag = flag + ' ' + ARCHFLAGS @@ -36,6 +37,7 @@ def fix_config_vars(names, values): if 'SDKROOT' in os.environ: SDKROOT = os.environ['SDKROOT'] for i, flag in enumerate(list(values)): + if flag is None: continue flag, count = re.subn('-isysroot [^ \t]*', ' ', flag) if count and SDKROOT: flag = flag + ' ' + '-isysroot ' + SDKROOT From e16a832b7626cec244a05a137fa579f6baa981a7 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Fri, 3 May 2013 00:40:07 +0300 Subject: [PATCH 38/56] Add libmpi.pxd to expose the MPI API to Cython --HG-- extra : rebase_source : 23c3ce03a0e5ed5de89c13b19721ef77dacac9c4 --- conf/CMakeLists.txt | 1 + conf/mpidistutils.py | 2 +- conf/mpiscanner.py | 2 +- demo/cython/helloworld.pyx | 2 +- demo/wrap-cython/helloworld.pyx | 2 +- setup.py | 3 +- src/MPI/MPI.pyx | 2 +- src/include/mpi4py/MPI.pxd | 56 +- src/include/mpi4py/libmpi.pxd | 904 ++++++++++++++++++++++++++++++++ src/include/mpi4py/mpi.pxi | 902 +------------------------------ src/include/mpi4py/mpi_c.pxd | 2 +- src/libmpi.pxd | 4 + src/mpi_c.pxd | 2 +- 13 files changed, 934 insertions(+), 950 deletions(-) create mode 100644 src/include/mpi4py/libmpi.pxd create mode 100644 src/libmpi.pxd diff --git a/conf/CMakeLists.txt b/conf/CMakeLists.txt index 0982134..f02492a 100644 --- a/conf/CMakeLists.txt +++ b/conf/CMakeLists.txt @@ -20,6 +20,7 @@ FILE(GLOB mpi4py_HEADER_FILES ${mpi4py_SOURCE_DIR}/include/mpi4py/*.px[di] ${mpi4py_SOURCE_DIR}/include/mpi4py/*.pyx ${mpi4py_SOURCE_DIR}/include/mpi4py/*.[hi] + ${mpi4py_SOURCE_DIR}/*.pxd ) FOREACH(file diff --git a/conf/mpidistutils.py b/conf/mpidistutils.py index 6ae129f..c188a59 100644 --- a/conf/mpidistutils.py +++ b/conf/mpidistutils.py @@ -290,7 +290,7 @@ def parse_file(self, *args): class ConfigureMPI(object): SRCDIR = 'src' - SOURCES = [os.path.join('include', 'mpi4py', 'mpi.pxi')] + SOURCES = [os.path.join('include', 'mpi4py', 'libmpi.pxd')] DESTDIR = 'src' CONFIG_H = 'config.h' MISSING_H = 'missing.h' diff --git a/conf/mpiscanner.py b/conf/mpiscanner.py index ab09a42..2c18842 100644 --- a/conf/mpiscanner.py +++ b/conf/mpiscanner.py @@ -331,7 +331,7 @@ def dump_missing_h(self, fileobj, suite): if __name__ == '__main__': import sys, os - sources = [os.path.join('src', 'include', 'mpi4py', 'mpi.pxi')] + sources = [os.path.join('src', 'include', 'mpi4py', 'libmpi.pxd')] log = lambda msg: sys.stderr.write(msg + '\n') scanner = Scanner() for filename in sources: diff --git a/demo/cython/helloworld.pyx b/demo/cython/helloworld.pyx index 2486804..45edfbc 100644 --- a/demo/cython/helloworld.pyx +++ b/demo/cython/helloworld.pyx @@ -43,7 +43,7 @@ cdef IntracommType SELF = MPI.COMM_SELF # with namespace-protection (stuff accessed as mpi.XXX) # (file: mpi4py/include/mpi4py/mpi_c.pxd) -from mpi4py cimport mpi_c as mpi +from mpi4py cimport libmpi as mpi cdef mpi.MPI_Comm world1 = WORLD.ob_mpi diff --git a/demo/wrap-cython/helloworld.pyx b/demo/wrap-cython/helloworld.pyx index 2e164bb..b1db111 100644 --- a/demo/wrap-cython/helloworld.pyx +++ b/demo/wrap-cython/helloworld.pyx @@ -1,7 +1,7 @@ cdef extern from "mpi-compat.h": pass cimport mpi4py.MPI as MPI -from mpi4py.mpi_c cimport * +from mpi4py.libmpi cimport * cdef extern from "stdio.h": int printf(char*, ...) diff --git a/setup.py b/setup.py index aba4278..e7ce6b0 100644 --- a/setup.py +++ b/setup.py @@ -460,7 +460,8 @@ def run_setup(): 'include/mpi4py/*.pyx', 'include/mpi4py/*.pxi', 'include/mpi4py/*.i', - 'MPI.pxd', 'mpi_c.pxd',]}, + 'MPI.pxd', 'libmpi.pxd', + 'mpi_c.pxd',]}, ext_modules = [Ext(**ext) for ext in ext_modules()], libraries = [Lib(**lib) for lib in libraries() ], executables = [Exe(**exe) for exe in executables()], diff --git a/src/MPI/MPI.pyx b/src/MPI/MPI.pyx index beb66f0..5ede82c 100644 --- a/src/MPI/MPI.pyx +++ b/src/MPI/MPI.pyx @@ -2,7 +2,7 @@ __doc__ = """ Message Passing Interface """ -include "mpi4py/mpi.pxi" +from mpi4py.libmpi cimport * include "stdlib.pxi" include "atimport.pxi" diff --git a/src/include/mpi4py/MPI.pxd b/src/include/mpi4py/MPI.pxd index 0358431..7e9508c 100644 --- a/src/include/mpi4py/MPI.pxd +++ b/src/include/mpi4py/MPI.pxd @@ -3,50 +3,24 @@ # -- -cdef extern from "mpi.h": - - ctypedef long MPI_Aint - ctypedef long long MPI_Offset - ctypedef long long MPI_Count - - ctypedef struct MPI_Status: - int MPI_SOURCE - int MPI_TAG - int MPI_ERROR - - ctypedef struct _mpi_datatype_t - ctypedef _mpi_datatype_t* MPI_Datatype - - ctypedef struct _mpi_request_t - ctypedef _mpi_request_t* MPI_Request - - ctypedef struct _mpi_message_t - ctypedef _mpi_message_t* MPI_Message - - ctypedef struct _mpi_op_t - ctypedef _mpi_op_t* MPI_Op - - ctypedef struct _mpi_group_t - ctypedef _mpi_group_t* MPI_Group - - ctypedef struct _mpi_info_t - ctypedef _mpi_info_t* MPI_Info - - ctypedef struct _mpi_errhandler_t - ctypedef _mpi_errhandler_t* MPI_Errhandler - - ctypedef struct _mpi_comm_t - ctypedef _mpi_comm_t* MPI_Comm - - ctypedef struct _mpi_win_t - ctypedef _mpi_win_t* MPI_Win - - ctypedef struct _mpi_file_t - ctypedef _mpi_file_t* MPI_File +from mpi4py.libmpi cimport MPI_Aint +from mpi4py.libmpi cimport MPI_Offset +from mpi4py.libmpi cimport MPI_Count +from mpi4py.libmpi cimport MPI_Status +from mpi4py.libmpi cimport MPI_Datatype +from mpi4py.libmpi cimport MPI_Request +from mpi4py.libmpi cimport MPI_Message +from mpi4py.libmpi cimport MPI_Op +from mpi4py.libmpi cimport MPI_Group +from mpi4py.libmpi cimport MPI_Info +from mpi4py.libmpi cimport MPI_Errhandler +from mpi4py.libmpi cimport MPI_Comm +from mpi4py.libmpi cimport MPI_Win +from mpi4py.libmpi cimport MPI_File # -- -cdef extern from *: +cdef import from *: ctypedef MPI_Aint Aint "MPI_Aint" ctypedef MPI_Offset Offset "MPI_Offset" ctypedef MPI_Count Count "MPI_Count" diff --git a/src/include/mpi4py/libmpi.pxd b/src/include/mpi4py/libmpi.pxd new file mode 100644 index 0000000..6cff71f --- /dev/null +++ b/src/include/mpi4py/libmpi.pxd @@ -0,0 +1,904 @@ +# Author: Lisandro Dalcin +# Contact: dalcinl@gmail.com + +cdef import from "mpi.h" nogil: + + #----------------------------------------------------------------- + + ctypedef long MPI_Aint + ctypedef long long MPI_Offset #:= long + ctypedef long long MPI_Count #:= MPI_Aint + + ctypedef struct MPI_Status: + int MPI_SOURCE + int MPI_TAG + int MPI_ERROR + + ctypedef struct _mpi_datatype_t + ctypedef _mpi_datatype_t* MPI_Datatype + + ctypedef struct _mpi_request_t + ctypedef _mpi_request_t* MPI_Request + + ctypedef struct _mpi_message_t + ctypedef _mpi_message_t* MPI_Message + + ctypedef struct _mpi_op_t + ctypedef _mpi_op_t* MPI_Op + + ctypedef struct _mpi_group_t + ctypedef _mpi_group_t* MPI_Group + + ctypedef struct _mpi_info_t + ctypedef _mpi_info_t* MPI_Info + + ctypedef struct _mpi_comm_t + ctypedef _mpi_comm_t* MPI_Comm + + ctypedef struct _mpi_win_t + ctypedef _mpi_win_t* MPI_Win + + ctypedef struct _mpi_file_t + ctypedef _mpi_file_t* MPI_File + + ctypedef struct _mpi_errhandler_t + ctypedef _mpi_errhandler_t* MPI_Errhandler + + #----------------------------------------------------------------- + + enum: MPI_UNDEFINED #:= -32766 + enum: MPI_ANY_SOURCE #:= MPI_UNDEFINED + enum: MPI_ANY_TAG #:= MPI_UNDEFINED + enum: MPI_PROC_NULL #:= MPI_UNDEFINED + enum: MPI_ROOT #:= MPI_PROC_NULL + + enum: MPI_IDENT #:= 1 + enum: MPI_CONGRUENT #:= 2 + enum: MPI_SIMILAR #:= 3 + enum: MPI_UNEQUAL #:= 4 + + void* MPI_BOTTOM #:= 0 + void* MPI_IN_PLACE #:= 0 + + enum: MPI_KEYVAL_INVALID #:= 0 + enum: MPI_MAX_OBJECT_NAME #:= 1 + + #----------------------------------------------------------------- + + # Null datatype + MPI_Datatype MPI_DATATYPE_NULL #:= 0 + # MPI datatypes + MPI_Datatype MPI_PACKED #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_BYTE #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_AINT #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_OFFSET #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_COUNT #:= MPI_DATATYPE_NULL + # Elementary C datatypes + MPI_Datatype MPI_CHAR #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_WCHAR #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_SIGNED_CHAR #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_SHORT #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_INT #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_LONG #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_LONG_LONG #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_LONG_LONG_INT #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_UNSIGNED_CHAR #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_UNSIGNED_SHORT #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_UNSIGNED #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_UNSIGNED_LONG #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_UNSIGNED_LONG_LONG #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_FLOAT #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_DOUBLE #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_LONG_DOUBLE #:= MPI_DATATYPE_NULL + # C99 datatypes + MPI_Datatype MPI_C_BOOL #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_INT8_T #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_INT16_T #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_INT32_T #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_INT64_T #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_UINT8_T #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_UINT16_T #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_UINT32_T #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_UINT64_T #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_C_COMPLEX #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_C_FLOAT_COMPLEX #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_C_DOUBLE_COMPLEX #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_C_LONG_DOUBLE_COMPLEX #:= MPI_DATATYPE_NULL + # C datatypes for reduction operations + MPI_Datatype MPI_SHORT_INT #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_2INT #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_LONG_INT #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_FLOAT_INT #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_DOUBLE_INT #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_LONG_DOUBLE_INT #:= MPI_DATATYPE_NULL + # Elementary Fortran datatypes + MPI_Datatype MPI_CHARACTER #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_LOGICAL #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_INTEGER #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_REAL #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_DOUBLE_PRECISION #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_COMPLEX #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_DOUBLE_COMPLEX #:= MPI_DATATYPE_NULL + # Size-specific Fortran datatypes + MPI_Datatype MPI_LOGICAL1 #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_LOGICAL2 #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_LOGICAL4 #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_LOGICAL8 #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_INTEGER1 #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_INTEGER2 #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_INTEGER4 #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_INTEGER8 #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_INTEGER16 #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_REAL2 #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_REAL4 #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_REAL8 #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_REAL16 #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_COMPLEX4 #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_COMPLEX8 #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_COMPLEX16 #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_COMPLEX32 #:= MPI_DATATYPE_NULL + + # Deprecated since MPI-2, removed in MPI-3 + MPI_Datatype MPI_UB #:= MPI_DATATYPE_NULL + MPI_Datatype MPI_LB #:= MPI_DATATYPE_NULL + int MPI_Type_lb(MPI_Datatype, MPI_Aint*) + int MPI_Type_ub(MPI_Datatype, MPI_Aint*) + int MPI_Type_extent(MPI_Datatype, MPI_Aint*) + int MPI_Address(void*, MPI_Aint*) + int MPI_Type_hvector(int, int, MPI_Aint, MPI_Datatype, MPI_Datatype*) + int MPI_Type_hindexed(int, int[], MPI_Aint[], MPI_Datatype, MPI_Datatype*) + int MPI_Type_struct(int, int[], MPI_Aint[], MPI_Datatype[], MPI_Datatype*) + + int MPI_Type_dup(MPI_Datatype, MPI_Datatype*) + int MPI_Type_contiguous(int, MPI_Datatype, MPI_Datatype*) + int MPI_Type_vector(int, int, int, MPI_Datatype, MPI_Datatype*) + int MPI_Type_indexed(int, int[], int[], MPI_Datatype, MPI_Datatype*) + int MPI_Type_create_indexed_block(int, int, int[], MPI_Datatype, MPI_Datatype*) + enum: MPI_ORDER_C #:= 0 + enum: MPI_ORDER_FORTRAN #:= 1 + int MPI_Type_create_subarray(int, int[], int[], int[], int, MPI_Datatype, MPI_Datatype*) + enum: MPI_DISTRIBUTE_NONE #:= 0 + enum: MPI_DISTRIBUTE_BLOCK #:= 1 + enum: MPI_DISTRIBUTE_CYCLIC #:= 2 + enum: MPI_DISTRIBUTE_DFLT_DARG #:= 4 + int MPI_Type_create_darray(int, int, int, int[], int[], int[], int[], int, MPI_Datatype, MPI_Datatype*) + + int MPI_Get_address(void*, MPI_Aint*) #:= MPI_Address + int MPI_Type_create_hvector(int, int, MPI_Aint, MPI_Datatype, MPI_Datatype*) #:= MPI_Type_hvector + int MPI_Type_create_hindexed(int, int[], MPI_Aint[], MPI_Datatype, MPI_Datatype*) #:= MPI_Type_hindexed + int MPI_Type_create_hindexed_block(int, int, MPI_Aint[], MPI_Datatype, MPI_Datatype*) + int MPI_Type_create_struct(int, int[], MPI_Aint[], MPI_Datatype[], MPI_Datatype*) #:= MPI_Type_struct + int MPI_Type_create_resized(MPI_Datatype, MPI_Aint, MPI_Aint, MPI_Datatype*) + + int MPI_Type_size(MPI_Datatype, int*) + int MPI_Type_size_x(MPI_Datatype, MPI_Count*) + int MPI_Type_get_extent(MPI_Datatype, MPI_Aint*, MPI_Aint*) + int MPI_Type_get_extent_x(MPI_Datatype, MPI_Count*, MPI_Count*) + int MPI_Type_get_true_extent(MPI_Datatype, MPI_Aint*, MPI_Aint*) + int MPI_Type_get_true_extent_x(MPI_Datatype, MPI_Count*, MPI_Count*) + + int MPI_Type_create_f90_integer(int, MPI_Datatype*) + int MPI_Type_create_f90_real(int, int, MPI_Datatype*) + int MPI_Type_create_f90_complex(int, int, MPI_Datatype*) + enum: MPI_TYPECLASS_INTEGER #:= MPI_UNDEFINED + enum: MPI_TYPECLASS_REAL #:= MPI_UNDEFINED + enum: MPI_TYPECLASS_COMPLEX #:= MPI_UNDEFINED + int MPI_Type_match_size(int, int, MPI_Datatype*) + + int MPI_Type_commit(MPI_Datatype*) + int MPI_Type_free(MPI_Datatype*) + + int MPI_Pack(void*, int, MPI_Datatype, void*, int, int*, MPI_Comm) + int MPI_Unpack(void*, int, int*, void*, int, MPI_Datatype, MPI_Comm) + int MPI_Pack_size(int, MPI_Datatype, MPI_Comm, int*) + + int MPI_Pack_external(char[], void*, int, MPI_Datatype, void*, MPI_Aint, MPI_Aint*) + int MPI_Unpack_external(char[], void*, MPI_Aint, MPI_Aint*, void*, int, MPI_Datatype) + int MPI_Pack_external_size(char[], int, MPI_Datatype, MPI_Aint*) + + enum: MPI_COMBINER_NAMED #:= MPI_UNDEFINED + enum: MPI_COMBINER_DUP #:= MPI_UNDEFINED + enum: MPI_COMBINER_CONTIGUOUS #:= MPI_UNDEFINED + enum: MPI_COMBINER_VECTOR #:= MPI_UNDEFINED + enum: MPI_COMBINER_HVECTOR #:= MPI_UNDEFINED + enum: MPI_COMBINER_HVECTOR_INTEGER #:= MPI_UNDEFINED + enum: MPI_COMBINER_INDEXED #:= MPI_UNDEFINED + enum: MPI_COMBINER_HINDEXED #:= MPI_UNDEFINED + enum: MPI_COMBINER_HINDEXED_INTEGER #:= MPI_UNDEFINED + enum: MPI_COMBINER_INDEXED_BLOCK #:= MPI_UNDEFINED + enum: MPI_COMBINER_HINDEXED_BLOCK #:= MPI_UNDEFINED + enum: MPI_COMBINER_STRUCT #:= MPI_UNDEFINED + enum: MPI_COMBINER_STRUCT_INTEGER #:= MPI_UNDEFINED + enum: MPI_COMBINER_SUBARRAY #:= MPI_UNDEFINED + enum: MPI_COMBINER_DARRAY #:= MPI_UNDEFINED + enum: MPI_COMBINER_F90_REAL #:= MPI_UNDEFINED + enum: MPI_COMBINER_F90_COMPLEX #:= MPI_UNDEFINED + enum: MPI_COMBINER_F90_INTEGER #:= MPI_UNDEFINED + enum: MPI_COMBINER_RESIZED #:= MPI_UNDEFINED + int MPI_Type_get_envelope(MPI_Datatype, int*, int*, int*, int*) + int MPI_Type_get_contents(MPI_Datatype, int, int, int, int[], MPI_Aint[], MPI_Datatype[]) + + int MPI_Type_get_name(MPI_Datatype, char[], int*) + int MPI_Type_set_name(MPI_Datatype, char[]) + + int MPI_Type_get_attr(MPI_Datatype, int, void*, int*) + int MPI_Type_set_attr(MPI_Datatype, int, void*) + int MPI_Type_delete_attr(MPI_Datatype, int) + + ctypedef int MPI_Type_copy_attr_function(MPI_Datatype,int,void*,void*,void*,int*) + ctypedef int MPI_Type_delete_attr_function(MPI_Datatype,int,void*,void*) + MPI_Type_copy_attr_function* MPI_TYPE_NULL_COPY_FN #:= 0 + MPI_Type_copy_attr_function* MPI_TYPE_DUP_FN #:= 0 + MPI_Type_delete_attr_function* MPI_TYPE_NULL_DELETE_FN #:= 0 + int MPI_Type_create_keyval(MPI_Type_copy_attr_function*, MPI_Type_delete_attr_function*, int*, void*) + int MPI_Type_free_keyval(int*) + + #----------------------------------------------------------------- + + MPI_Status* MPI_STATUS_IGNORE #:= 0 + MPI_Status* MPI_STATUSES_IGNORE #:= 0 + + int MPI_Get_count(MPI_Status*, MPI_Datatype, int*) + int MPI_Get_elements(MPI_Status*, MPI_Datatype, int*) + int MPI_Get_elements_x(MPI_Status*, MPI_Datatype, MPI_Count*) + int MPI_Status_set_elements(MPI_Status*, MPI_Datatype, int) + int MPI_Status_set_elements_x(MPI_Status*, MPI_Datatype, MPI_Count) + + int MPI_Test_cancelled(MPI_Status*, int*) + int MPI_Status_set_cancelled(MPI_Status*, int) + + #----------------------------------------------------------------- + + MPI_Request MPI_REQUEST_NULL #:= 0 + + int MPI_Request_free(MPI_Request*) + int MPI_Wait(MPI_Request*, MPI_Status*) + int MPI_Test(MPI_Request*, int*, MPI_Status*) + int MPI_Request_get_status(MPI_Request, int*, MPI_Status*) + int MPI_Cancel(MPI_Request*) + + int MPI_Waitany(int, MPI_Request[], int*, MPI_Status*) + int MPI_Testany(int, MPI_Request[], int*, int*, MPI_Status*) + int MPI_Waitall(int, MPI_Request[], MPI_Status[]) + int MPI_Testall(int, MPI_Request[], int*, MPI_Status[]) + int MPI_Waitsome(int, MPI_Request[], int*, int[], MPI_Status[]) + int MPI_Testsome(int, MPI_Request[], int*, int[], MPI_Status[]) + + int MPI_Start(MPI_Request*) + int MPI_Startall(int, MPI_Request*) + + ctypedef int MPI_Grequest_cancel_function(void*,int) + ctypedef int MPI_Grequest_free_function(void*) + ctypedef int MPI_Grequest_query_function(void*,MPI_Status*) + int MPI_Grequest_start(MPI_Grequest_query_function*, MPI_Grequest_free_function*, MPI_Grequest_cancel_function*, void*, MPI_Request*) + int MPI_Grequest_complete(MPI_Request) + + #----------------------------------------------------------------- + + MPI_Op MPI_OP_NULL #:= 0 + MPI_Op MPI_MAX #:= MPI_OP_NULL + MPI_Op MPI_MIN #:= MPI_OP_NULL + MPI_Op MPI_SUM #:= MPI_OP_NULL + MPI_Op MPI_PROD #:= MPI_OP_NULL + MPI_Op MPI_LAND #:= MPI_OP_NULL + MPI_Op MPI_BAND #:= MPI_OP_NULL + MPI_Op MPI_LOR #:= MPI_OP_NULL + MPI_Op MPI_BOR #:= MPI_OP_NULL + MPI_Op MPI_LXOR #:= MPI_OP_NULL + MPI_Op MPI_BXOR #:= MPI_OP_NULL + MPI_Op MPI_MAXLOC #:= MPI_OP_NULL + MPI_Op MPI_MINLOC #:= MPI_OP_NULL + MPI_Op MPI_REPLACE #:= MPI_OP_NULL + MPI_Op MPI_NO_OP #:= MPI_OP_NULL + + int MPI_Op_free(MPI_Op*) + + ctypedef void MPI_User_function(void*, void*, int*, MPI_Datatype*) + int MPI_Op_create(MPI_User_function*, int, MPI_Op*) + int MPI_Op_commutative(MPI_Op, int*) + + #----------------------------------------------------------------- + + MPI_Info MPI_INFO_NULL #:= 0 + MPI_Info MPI_INFO_ENV #:= MPI_INFO_NULL + + int MPI_Info_free(MPI_Info*) + int MPI_Info_create(MPI_Info*) + int MPI_Info_dup(MPI_Info, MPI_Info*) + + enum: MPI_MAX_INFO_KEY #:= 1 + enum: MPI_MAX_INFO_VAL #:= 1 + int MPI_Info_get(MPI_Info, char[], int, char[],int*) + int MPI_Info_set(MPI_Info, char[], char[]) + int MPI_Info_delete(MPI_Info, char[]) + + int MPI_Info_get_nkeys(MPI_Info, int*) + int MPI_Info_get_nthkey(MPI_Info, int, char[]) + int MPI_Info_get_valuelen(MPI_Info, char[], int*, int*) + + #----------------------------------------------------------------- + + MPI_Group MPI_GROUP_NULL #:= 0 + MPI_Group MPI_GROUP_EMPTY #:= 1 + + int MPI_Group_free(MPI_Group*) + + int MPI_Group_size(MPI_Group, int*) + int MPI_Group_rank(MPI_Group, int*) + int MPI_Group_translate_ranks(MPI_Group, int, int[], MPI_Group, int[]) + + int MPI_Group_compare(MPI_Group, MPI_Group, int*) + + int MPI_Group_union(MPI_Group, MPI_Group, MPI_Group*) + int MPI_Group_intersection(MPI_Group, MPI_Group, MPI_Group*) + int MPI_Group_difference(MPI_Group, MPI_Group, MPI_Group*) + int MPI_Group_incl(MPI_Group, int, int[], MPI_Group*) + int MPI_Group_excl(MPI_Group, int, int[], MPI_Group*) + int MPI_Group_range_incl(MPI_Group, int, int[][3], MPI_Group*) + int MPI_Group_range_excl(MPI_Group, int, int[][3], MPI_Group*) + + #----------------------------------------------------------------- + + MPI_Comm MPI_COMM_NULL #:= 0 + MPI_Comm MPI_COMM_SELF #:= MPI_COMM_NULL + MPI_Comm MPI_COMM_WORLD #:= MPI_COMM_NULL + + int MPI_Comm_free(MPI_Comm*) + + int MPI_Comm_group(MPI_Comm, MPI_Group*) + + int MPI_Comm_size(MPI_Comm, int*) + int MPI_Comm_rank(MPI_Comm, int*) + + int MPI_Comm_compare(MPI_Comm, MPI_Comm, int*) + int MPI_Topo_test(MPI_Comm, int*) + int MPI_Comm_test_inter(MPI_Comm, int*) + + int MPI_Abort(MPI_Comm, int) + + int MPI_Send(void*, int, MPI_Datatype, int, int, MPI_Comm) + int MPI_Recv(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Status*) + int MPI_Sendrecv(void*, int, MPI_Datatype,int, int, void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Status*) + int MPI_Sendrecv_replace(void*, int, MPI_Datatype, int, int, int, int, MPI_Comm, MPI_Status*) + + enum: MPI_BSEND_OVERHEAD #:= 0 + int MPI_Buffer_attach(void*, int) + int MPI_Buffer_detach(void*, int*) + int MPI_Bsend(void*, int, MPI_Datatype, int, int, MPI_Comm) + int MPI_Ssend(void*, int, MPI_Datatype, int, int, MPI_Comm) + int MPI_Rsend(void*, int, MPI_Datatype, int, int, MPI_Comm) + + int MPI_Isend(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*) + int MPI_Ibsend(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*) + int MPI_Issend(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*) + int MPI_Irsend(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*) + int MPI_Irecv(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*) + + int MPI_Send_init(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*) + int MPI_Bsend_init(void*, int, MPI_Datatype, int,int, MPI_Comm, MPI_Request*) + int MPI_Ssend_init(void*, int, MPI_Datatype, int,int, MPI_Comm, MPI_Request*) + int MPI_Rsend_init(void*, int, MPI_Datatype, int,int, MPI_Comm, MPI_Request*) + int MPI_Recv_init(void*, int, MPI_Datatype, int,int, MPI_Comm, MPI_Request*) + + int MPI_Probe(int, int, MPI_Comm, MPI_Status*) + int MPI_Iprobe(int, int, MPI_Comm, int*, MPI_Status*) + + MPI_Message MPI_MESSAGE_NULL #:= 0 + MPI_Message MPI_MESSAGE_NO_PROC #:= MPI_MESSAGE_NULL + int MPI_Mprobe(int, int, MPI_Comm, MPI_Message*, MPI_Status*) + int MPI_Improbe(int, int, MPI_Comm, int*, MPI_Message*, MPI_Status*) + int MPI_Mrecv(void*, int, MPI_Datatype, MPI_Message*, MPI_Status*) + int MPI_Imrecv(void*, int, MPI_Datatype, MPI_Message*, MPI_Request*) + + int MPI_Barrier(MPI_Comm) + int MPI_Bcast(void*, int, MPI_Datatype, int, MPI_Comm) + int MPI_Gather(void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm) + int MPI_Gatherv(void*, int, MPI_Datatype, void*, int*, int*, MPI_Datatype, int, MPI_Comm) + int MPI_Scatter(void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm) + int MPI_Scatterv(void*, int*, int*, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm) + int MPI_Allgather(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm) + int MPI_Allgatherv(void*, int, MPI_Datatype, void*, int*, int*, MPI_Datatype, MPI_Comm) + int MPI_Alltoall(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm) + int MPI_Alltoallv(void*, int*, int*, MPI_Datatype, void*, int*, int*, MPI_Datatype, MPI_Comm) + int MPI_Alltoallw(void*, int*, int*, MPI_Datatype*, void*, int*, int*, MPI_Datatype*, MPI_Comm) + + int MPI_Reduce(void*, void*, int, MPI_Datatype, MPI_Op, int, MPI_Comm) + int MPI_Allreduce(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm) + int MPI_Reduce_local(void*, void*, int, MPI_Datatype, MPI_Op) + int MPI_Reduce_scatter_block(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm) + int MPI_Reduce_scatter(void*, void*, int*, MPI_Datatype, MPI_Op, MPI_Comm) + int MPI_Scan(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm) + int MPI_Exscan(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm) + + int MPI_Neighbor_allgather(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm) + int MPI_Neighbor_allgatherv(void*, int, MPI_Datatype, void*, int[], int[], MPI_Datatype, MPI_Comm) + int MPI_Neighbor_alltoall(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm) + int MPI_Neighbor_alltoallv(void*, int[], int[],MPI_Datatype, void*, int[],int[], MPI_Datatype, MPI_Comm) + int MPI_Neighbor_alltoallw(void *, int[], MPI_Aint[],MPI_Datatype[], void*, int[],MPI_Aint[], MPI_Datatype[], MPI_Comm) + + int MPI_Ibarrier(MPI_Comm, MPI_Request*) + int MPI_Ibcast(void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*) + int MPI_Igather(void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*) + int MPI_Igatherv(void*, int, MPI_Datatype, void*, int*, int*, MPI_Datatype, int, MPI_Comm, MPI_Request*) + int MPI_Iscatter(void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*) + int MPI_Iscatterv(void*, int*, int*, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*) + int MPI_Iallgather(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm, MPI_Request*) + int MPI_Iallgatherv(void*, int, MPI_Datatype, void*, int*, int*, MPI_Datatype, MPI_Comm, MPI_Request*) + int MPI_Ialltoall(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm, MPI_Request*) + int MPI_Ialltoallv(void*, int*, int*, MPI_Datatype, void*, int*, int*, MPI_Datatype, MPI_Comm, MPI_Request*) + int MPI_Ialltoallw(void*, int*, int*, MPI_Datatype*, void*, int*, int*, MPI_Datatype*, MPI_Comm, MPI_Request*) + + int MPI_Ireduce(void*, void*, int, MPI_Datatype, MPI_Op, int, MPI_Comm, MPI_Request*) + int MPI_Iallreduce(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*) + int MPI_Ireduce_scatter_block(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*) + int MPI_Ireduce_scatter(void*, void*, int*, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*) + int MPI_Iscan(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*) + int MPI_Iexscan(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*) + + int MPI_Ineighbor_allgather(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm, MPI_Request*) + int MPI_Ineighbor_allgatherv(void*, int, MPI_Datatype, void*, int[], int[], MPI_Datatype, MPI_Comm, MPI_Request*) + int MPI_Ineighbor_alltoall(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm, MPI_Request*) + int MPI_Ineighbor_alltoallv(void*, int[], int[],MPI_Datatype, void*, int[],int[], MPI_Datatype, MPI_Comm, MPI_Request*) + int MPI_Ineighbor_alltoallw(void *, int[], MPI_Aint[],MPI_Datatype[], void*, int[],MPI_Aint[], MPI_Datatype[], MPI_Comm, MPI_Request*) + + int MPI_Comm_dup(MPI_Comm, MPI_Comm*) + int MPI_Comm_dup_with_info(MPI_Comm, MPI_Info, MPI_Comm*) + int MPI_Comm_idup(MPI_Comm, MPI_Comm*, MPI_Request*) + int MPI_Comm_create(MPI_Comm, MPI_Group, MPI_Comm*) + int MPI_Comm_create_group(MPI_Comm, MPI_Group, int, MPI_Comm*) + int MPI_Comm_split(MPI_Comm, int, int, MPI_Comm*) + enum: MPI_COMM_TYPE_SHARED #:= MPI_UNDEFINED + int MPI_Comm_split_type(MPI_Comm, int, int, MPI_Info, MPI_Comm*) + int MPI_Comm_set_info(MPI_Comm, MPI_Info) + int MPI_Comm_get_info(MPI_Comm, MPI_Info*) + + enum: MPI_CART #:= MPI_UNDEFINED + int MPI_Cart_create(MPI_Comm, int, int[], int[], int, MPI_Comm*) + int MPI_Cartdim_get(MPI_Comm, int*) + int MPI_Cart_get(MPI_Comm, int, int[], int[], int[]) + int MPI_Cart_rank(MPI_Comm, int[], int*) + int MPI_Cart_coords(MPI_Comm, int, int, int[]) + int MPI_Cart_shift(MPI_Comm, int, int, int[], int[]) + int MPI_Cart_sub(MPI_Comm, int[], MPI_Comm*) + int MPI_Cart_map(MPI_Comm, int, int[], int[], int*) + int MPI_Dims_create(int, int, int[]) + + enum: MPI_GRAPH #:= MPI_UNDEFINED + int MPI_Graph_create(MPI_Comm, int, int[], int[], int, MPI_Comm*) + int MPI_Graphdims_get(MPI_Comm, int*, int*) + int MPI_Graph_get(MPI_Comm, int, int, int[], int[]) + int MPI_Graph_map(MPI_Comm, int, int[], int[], int*) + int MPI_Graph_neighbors_count(MPI_Comm, int, int*) + int MPI_Graph_neighbors(MPI_Comm, int, int, int[]) + + enum: MPI_DIST_GRAPH #:= MPI_UNDEFINED + int* MPI_UNWEIGHTED #:= 0 + int* MPI_WEIGHTS_EMPTY #:= MPI_UNWEIGHTED + int MPI_Dist_graph_create_adjacent(MPI_Comm, int, int[], int[], int, int[], int[], MPI_Info, int, MPI_Comm*) + int MPI_Dist_graph_create(MPI_Comm, int, int[], int[], int[], int[], MPI_Info, int, MPI_Comm*) + int MPI_Dist_graph_neighbors_count(MPI_Comm, int*, int*, int*) + int MPI_Dist_graph_neighbors(MPI_Comm, int, int[], int[], int, int[], int[]) + + int MPI_Intercomm_create(MPI_Comm, int, MPI_Comm, int, int, MPI_Comm*) + int MPI_Comm_remote_group(MPI_Comm, MPI_Group*) + int MPI_Comm_remote_size(MPI_Comm, int*) + int MPI_Intercomm_merge(MPI_Comm, int, MPI_Comm*) + + enum: MPI_MAX_PORT_NAME #:= 1 + int MPI_Open_port(MPI_Info, char[]) + int MPI_Close_port(char[]) + + int MPI_Publish_name(char[], MPI_Info, char[]) + int MPI_Unpublish_name(char[], MPI_Info, char[]) + int MPI_Lookup_name(char[], MPI_Info, char[]) + + int MPI_Comm_accept(char[], MPI_Info, int, MPI_Comm, MPI_Comm*) + int MPI_Comm_connect(char[], MPI_Info, int, MPI_Comm, MPI_Comm*) + int MPI_Comm_join(int, MPI_Comm*) + int MPI_Comm_disconnect(MPI_Comm*) + + char** MPI_ARGV_NULL #:= 0 + char*** MPI_ARGVS_NULL #:= 0 + int* MPI_ERRCODES_IGNORE #:= 0 + int MPI_Comm_spawn(char[], char*[], int, MPI_Info, int, MPI_Comm, MPI_Comm*, int[]) + int MPI_Comm_spawn_multiple(int, char*[], char**[], int[], MPI_Info[], int, MPI_Comm, MPI_Comm*, int[]) + int MPI_Comm_get_parent(MPI_Comm*) + + int MPI_Errhandler_get(MPI_Comm, MPI_Errhandler*) + int MPI_Errhandler_set(MPI_Comm, MPI_Errhandler) + ctypedef void MPI_Handler_function(MPI_Comm*,int*,...) + int MPI_Errhandler_create(MPI_Handler_function*, MPI_Errhandler*) + + enum: MPI_TAG_UB #:= MPI_KEYVAL_INVALID + enum: MPI_HOST #:= MPI_KEYVAL_INVALID + enum: MPI_IO #:= MPI_KEYVAL_INVALID + enum: MPI_WTIME_IS_GLOBAL #:= MPI_KEYVAL_INVALID + int MPI_Attr_get(MPI_Comm, int, void*, int*) + int MPI_Attr_put(MPI_Comm, int, void*) + int MPI_Attr_delete(MPI_Comm, int) + + ctypedef int MPI_Copy_function(MPI_Comm,int,void*,void*,void*,int*) + ctypedef int MPI_Delete_function(MPI_Comm,int,void*,void*) + MPI_Copy_function* MPI_DUP_FN #:= 0 + MPI_Copy_function* MPI_NULL_COPY_FN #:= 0 + MPI_Delete_function* MPI_NULL_DELETE_FN #:= 0 + int MPI_Keyval_create(MPI_Copy_function*, MPI_Delete_function*, int*, void*) + int MPI_Keyval_free(int*) + + int MPI_Comm_get_errhandler(MPI_Comm, MPI_Errhandler*) #:= MPI_Errhandler_get + int MPI_Comm_set_errhandler(MPI_Comm, MPI_Errhandler) #:= MPI_Errhandler_set + ctypedef void MPI_Comm_errhandler_fn(MPI_Comm*,int*,...) #:= MPI_Handler_function + ctypedef void MPI_Comm_errhandler_function(MPI_Comm*,int*,...) #:= MPI_Comm_errhandler_fn + int MPI_Comm_create_errhandler(MPI_Comm_errhandler_function*, MPI_Errhandler*) #:= MPI_Errhandler_create + int MPI_Comm_call_errhandler(MPI_Comm, int) + + int MPI_Comm_get_name(MPI_Comm, char[], int*) + int MPI_Comm_set_name(MPI_Comm, char[]) + + enum: MPI_UNIVERSE_SIZE #:= MPI_KEYVAL_INVALID + enum: MPI_APPNUM #:= MPI_KEYVAL_INVALID + enum: MPI_LASTUSEDCODE #:= MPI_KEYVAL_INVALID + int MPI_Comm_get_attr(MPI_Comm, int, void*, int*) #:= MPI_Attr_get + int MPI_Comm_set_attr(MPI_Comm, int, void*) #:= MPI_Attr_put + int MPI_Comm_delete_attr(MPI_Comm, int) #:= MPI_Attr_delete + + ctypedef int MPI_Comm_copy_attr_function(MPI_Comm,int,void*,void*,void*,int*) #:= MPI_Copy_function + ctypedef int MPI_Comm_delete_attr_function(MPI_Comm,int,void*,void*) #:= MPI_Delete_function + MPI_Comm_copy_attr_function* MPI_COMM_DUP_FN #:= MPI_DUP_FN + MPI_Comm_copy_attr_function* MPI_COMM_NULL_COPY_FN #:= MPI_NULL_COPY_FN + MPI_Comm_delete_attr_function* MPI_COMM_NULL_DELETE_FN #:= MPI_NULL_DELETE_FN + int MPI_Comm_create_keyval(MPI_Comm_copy_attr_function*, MPI_Comm_delete_attr_function*, int*, void*) #:= MPI_Keyval_create + int MPI_Comm_free_keyval(int*) #:= MPI_Keyval_free + + #----------------------------------------------------------------- + + MPI_Win MPI_WIN_NULL #:= 0 + + int MPI_Win_free(MPI_Win*) + int MPI_Win_create(void*, MPI_Aint, int, MPI_Info, MPI_Comm, MPI_Win*) + int MPI_Win_allocate(MPI_Aint, int, MPI_Info, MPI_Comm, void*, MPI_Win*) + int MPI_Win_allocate_shared(MPI_Aint, int, MPI_Info, MPI_Comm, void*, MPI_Win*) + int MPI_Win_shared_query(MPI_Win, int, MPI_Aint*,int*, void*) + int MPI_Win_create_dynamic(MPI_Info, MPI_Comm, MPI_Win*) + int MPI_Win_attach(MPI_Win, void*, MPI_Aint) + int MPI_Win_detach(MPI_Win, void*) + int MPI_Win_set_info(MPI_Win,MPI_Info) + int MPI_Win_get_info(MPI_Win,MPI_Info*) + int MPI_Win_get_group(MPI_Win, MPI_Group*) + + int MPI_Get(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win) + int MPI_Put(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win) + int MPI_Accumulate(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Op, MPI_Win) + int MPI_Get_accumulate(void*, int, MPI_Datatype, void*, int,MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Op, MPI_Win) + int MPI_Fetch_and_op(void*, void*, MPI_Datatype, int, MPI_Aint, MPI_Op, MPI_Win) + int MPI_Compare_and_swap(void*, void*, void*, MPI_Datatype, int, MPI_Aint, MPI_Win) + + int MPI_Rget(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win, MPI_Request*) + int MPI_Rput(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win, MPI_Request*) + int MPI_Raccumulate(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Op, MPI_Win, MPI_Request*) + int MPI_Rget_accumulate(void*, int, MPI_Datatype, void*, int,MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Op, MPI_Win, MPI_Request*) + + enum: MPI_MODE_NOCHECK #:= MPI_UNDEFINED + enum: MPI_MODE_NOSTORE #:= MPI_UNDEFINED + enum: MPI_MODE_NOPUT #:= MPI_UNDEFINED + enum: MPI_MODE_NOPRECEDE #:= MPI_UNDEFINED + enum: MPI_MODE_NOSUCCEED #:= MPI_UNDEFINED + int MPI_Win_fence(int, MPI_Win) + int MPI_Win_post(MPI_Group, int, MPI_Win) + int MPI_Win_start(MPI_Group, int, MPI_Win) + int MPI_Win_complete(MPI_Win) + int MPI_Win_wait(MPI_Win) + int MPI_Win_test(MPI_Win, int*) + + enum: MPI_LOCK_EXCLUSIVE #:= MPI_UNDEFINED + enum: MPI_LOCK_SHARED #:= MPI_UNDEFINED + int MPI_Win_lock(int, int, int, MPI_Win) + int MPI_Win_unlock(int, MPI_Win) + int MPI_Win_lock_all(int, MPI_Win) + int MPI_Win_unlock_all(MPI_Win) + int MPI_Win_flush(int, MPI_Win) + int MPI_Win_flush_all(MPI_Win) + int MPI_Win_flush_local(int, MPI_Win) + int MPI_Win_flush_local_all(MPI_Win) + int MPI_Win_sync(MPI_Win) + + int MPI_Win_get_errhandler(MPI_Win, MPI_Errhandler*) + int MPI_Win_set_errhandler(MPI_Win, MPI_Errhandler) + ctypedef void MPI_Win_errhandler_fn(MPI_Win*,int*,...) + ctypedef void MPI_Win_errhandler_function(MPI_Comm*,int*,...) #:= MPI_Win_errhandler_fn + int MPI_Win_create_errhandler(MPI_Win_errhandler_function*, MPI_Errhandler*) + int MPI_Win_call_errhandler(MPI_Win, int) + + int MPI_Win_get_name(MPI_Win, char[], int*) + int MPI_Win_set_name(MPI_Win, char[]) + + enum: MPI_WIN_BASE #:= MPI_KEYVAL_INVALID + enum: MPI_WIN_SIZE #:= MPI_KEYVAL_INVALID + enum: MPI_WIN_DISP_UNIT #:= MPI_KEYVAL_INVALID + enum: MPI_WIN_CREATE_FLAVOR #:= MPI_KEYVAL_INVALID + enum: MPI_WIN_MODEL #:= MPI_KEYVAL_INVALID + + enum: MPI_WIN_FLAVOR_CREATE #:= MPI_UNDEFINED + enum: MPI_WIN_FLAVOR_ALLOCATE #:= MPI_UNDEFINED + enum: MPI_WIN_FLAVOR_DYNAMIC #:= MPI_UNDEFINED + enum: MPI_WIN_FLAVOR_SHARED #:= MPI_UNDEFINED + + enum: MPI_WIN_SEPARATE #:= MPI_UNDEFINED + enum: MPI_WIN_UNIFIED #:= MPI_UNDEFINED + + int MPI_Win_get_attr(MPI_Win, int, void*, int*) + int MPI_Win_set_attr(MPI_Win, int, void*) + int MPI_Win_delete_attr(MPI_Win, int) + + ctypedef int MPI_Win_copy_attr_function(MPI_Win,int,void*,void*,void*,int*) + ctypedef int MPI_Win_delete_attr_function(MPI_Win,int,void*,void*) + MPI_Win_copy_attr_function* MPI_WIN_DUP_FN #:= 0 + MPI_Win_copy_attr_function* MPI_WIN_NULL_COPY_FN #:= 0 + MPI_Win_delete_attr_function* MPI_WIN_NULL_DELETE_FN #:= 0 + int MPI_Win_create_keyval(MPI_Win_copy_attr_function*, MPI_Win_delete_attr_function*, int*, void*) + int MPI_Win_free_keyval(int*) + + #----------------------------------------------------------------- + + MPI_File MPI_FILE_NULL #:= 0 + + enum: MPI_MODE_RDONLY #:= 1 + enum: MPI_MODE_RDWR #:= 2 + enum: MPI_MODE_WRONLY #:= 4 + enum: MPI_MODE_CREATE #:= 8 + enum: MPI_MODE_EXCL #:= 16 + enum: MPI_MODE_DELETE_ON_CLOSE #:= 32 + enum: MPI_MODE_UNIQUE_OPEN #:= 64 + enum: MPI_MODE_APPEND #:= 128 + enum: MPI_MODE_SEQUENTIAL #:= 256 + + int MPI_File_open(MPI_Comm, char[], int, MPI_Info, MPI_File*) + int MPI_File_close(MPI_File*) + int MPI_File_delete(char[], MPI_Info) + + int MPI_File_set_size(MPI_File, MPI_Offset) + int MPI_File_preallocate(MPI_File, MPI_Offset) + int MPI_File_get_size(MPI_File, MPI_Offset*) + int MPI_File_get_group(MPI_File, MPI_Group*) + int MPI_File_get_amode(MPI_File, int*) + int MPI_File_set_info(MPI_File, MPI_Info) + int MPI_File_get_info(MPI_File, MPI_Info*) + + int MPI_File_get_view(MPI_File, MPI_Offset*, MPI_Datatype*, MPI_Datatype*, char[]) + int MPI_File_set_view(MPI_File, MPI_Offset, MPI_Datatype, MPI_Datatype, char[], MPI_Info) + + int MPI_File_read_at (MPI_File, MPI_Offset, void*, int, MPI_Datatype, MPI_Status*) + int MPI_File_read_at_all (MPI_File, MPI_Offset, void*, int, MPI_Datatype, MPI_Status*) + int MPI_File_write_at (MPI_File, MPI_Offset, void*, int, MPI_Datatype, MPI_Status*) + int MPI_File_write_at_all (MPI_File, MPI_Offset, void*, int, MPI_Datatype, MPI_Status*) + + int MPI_File_iread_at (MPI_File, MPI_Offset, void*, int, MPI_Datatype, MPI_Request*) + int MPI_File_iwrite_at (MPI_File, MPI_Offset, void*, int, MPI_Datatype, MPI_Request*) + + enum: MPI_SEEK_SET #:= 0 + enum: MPI_SEEK_CUR #:= 1 + enum: MPI_SEEK_END #:= 2 + enum: MPI_DISPLACEMENT_CURRENT #:= 3 + int MPI_File_seek(MPI_File, MPI_Offset, int) + int MPI_File_get_position(MPI_File, MPI_Offset*) + int MPI_File_get_byte_offset(MPI_File, MPI_Offset, MPI_Offset*) + + int MPI_File_read (MPI_File, void*, int, MPI_Datatype, MPI_Status*) + int MPI_File_read_all (MPI_File, void*, int, MPI_Datatype, MPI_Status*) + int MPI_File_write (MPI_File, void*, int, MPI_Datatype, MPI_Status*) + int MPI_File_write_all (MPI_File, void*, int, MPI_Datatype, MPI_Status*) + int MPI_File_iread (MPI_File, void*, int, MPI_Datatype, MPI_Request*) + int MPI_File_iwrite (MPI_File, void*, int, MPI_Datatype, MPI_Request*) + + int MPI_File_read_shared (MPI_File, void*, int, MPI_Datatype, MPI_Status*) + int MPI_File_write_shared (MPI_File, void*, int, MPI_Datatype, MPI_Status*) + int MPI_File_iread_shared (MPI_File, void*, int, MPI_Datatype, MPI_Request*) + int MPI_File_iwrite_shared (MPI_File, void*, int, MPI_Datatype, MPI_Request*) + int MPI_File_read_ordered (MPI_File, void*, int, MPI_Datatype, MPI_Status*) + int MPI_File_write_ordered (MPI_File, void*, int, MPI_Datatype, MPI_Status*) + + int MPI_File_seek_shared(MPI_File, MPI_Offset, int) + int MPI_File_get_position_shared(MPI_File, MPI_Offset*) + + int MPI_File_read_at_all_begin (MPI_File, MPI_Offset, void*, int, MPI_Datatype) + int MPI_File_read_at_all_end (MPI_File, void*, MPI_Status*) + int MPI_File_write_at_all_begin (MPI_File, MPI_Offset, void*, int, MPI_Datatype) + int MPI_File_write_at_all_end (MPI_File, void*, MPI_Status*) + int MPI_File_read_all_begin (MPI_File, void*, int, MPI_Datatype) + int MPI_File_read_all_end (MPI_File, void*, MPI_Status*) + int MPI_File_write_all_begin (MPI_File, void*, int, MPI_Datatype) + int MPI_File_write_all_end (MPI_File, void*, MPI_Status*) + int MPI_File_read_ordered_begin (MPI_File, void*, int, MPI_Datatype) + int MPI_File_read_ordered_end (MPI_File, void*, MPI_Status*) + int MPI_File_write_ordered_begin (MPI_File, void*, int, MPI_Datatype) + int MPI_File_write_ordered_end (MPI_File, void*, MPI_Status*) + + int MPI_File_get_type_extent(MPI_File, MPI_Datatype, MPI_Aint*) + + int MPI_File_set_atomicity(MPI_File, int) + int MPI_File_get_atomicity(MPI_File, int*) + int MPI_File_sync(MPI_File) + + int MPI_File_get_errhandler(MPI_File, MPI_Errhandler*) + int MPI_File_set_errhandler(MPI_File, MPI_Errhandler) + ctypedef void MPI_File_errhandler_fn(MPI_File*,int*,...) + ctypedef void MPI_File_errhandler_function(MPI_File*,int*,...) #:= MPI_File_errhandler_fn + int MPI_File_create_errhandler(MPI_File_errhandler_function*, MPI_Errhandler*) + int MPI_File_call_errhandler(MPI_File, int) + + ctypedef int MPI_Datarep_conversion_function(void*,MPI_Datatype,int,void*,MPI_Offset,void*) + ctypedef int MPI_Datarep_extent_function(MPI_Datatype,MPI_Aint*,void*) + MPI_Datarep_conversion_function* MPI_CONVERSION_FN_NULL #:= 0 + enum: MPI_MAX_DATAREP_STRING #:= 1 + int MPI_Register_datarep(char[], MPI_Datarep_conversion_function*, MPI_Datarep_conversion_function*, MPI_Datarep_extent_function*, void*) + + #----------------------------------------------------------------- + + MPI_Errhandler MPI_ERRHANDLER_NULL #:= 0 + MPI_Errhandler MPI_ERRORS_RETURN #:= MPI_ERRHANDLER_NULL + MPI_Errhandler MPI_ERRORS_ARE_FATAL #:= MPI_ERRHANDLER_NULL + + int MPI_Errhandler_free(MPI_Errhandler*) + + #----------------------------------------------------------------- + + enum: MPI_MAX_ERROR_STRING #:= 1 + int MPI_Error_class(int, int*) + int MPI_Error_string(int, char[], int*) + + int MPI_Add_error_class(int*) + int MPI_Add_error_code(int,int*) + int MPI_Add_error_string(int,char[]) + + # MPI-1 Error classes + # ------------------- + # Actually no errors + enum: MPI_SUCCESS #:= 0 + enum: MPI_ERR_LASTCODE #:= 1 + # MPI-1 Objects + enum: MPI_ERR_COMM #:= MPI_ERR_LASTCODE + enum: MPI_ERR_GROUP #:= MPI_ERR_LASTCODE + enum: MPI_ERR_TYPE #:= MPI_ERR_LASTCODE + enum: MPI_ERR_REQUEST #:= MPI_ERR_LASTCODE + enum: MPI_ERR_OP #:= MPI_ERR_LASTCODE + # Communication argument parameters + enum: MPI_ERR_BUFFER #:= MPI_ERR_LASTCODE + enum: MPI_ERR_COUNT #:= MPI_ERR_LASTCODE + enum: MPI_ERR_TAG #:= MPI_ERR_LASTCODE + enum: MPI_ERR_RANK #:= MPI_ERR_LASTCODE + enum: MPI_ERR_ROOT #:= MPI_ERR_LASTCODE + enum: MPI_ERR_TRUNCATE #:= MPI_ERR_LASTCODE + # Multiple completion + enum: MPI_ERR_IN_STATUS #:= MPI_ERR_LASTCODE + enum: MPI_ERR_PENDING #:= MPI_ERR_LASTCODE + # Topology argument parameters + enum: MPI_ERR_TOPOLOGY #:= MPI_ERR_LASTCODE + enum: MPI_ERR_DIMS #:= MPI_ERR_LASTCODE + # All other arguments, this is a class with many kinds + enum: MPI_ERR_ARG #:= MPI_ERR_LASTCODE + # Other errors that are not simply an invalid argument + enum: MPI_ERR_OTHER #:= MPI_ERR_LASTCODE + enum: MPI_ERR_UNKNOWN #:= MPI_ERR_LASTCODE + enum: MPI_ERR_INTERN #:= MPI_ERR_LASTCODE + + # MPI-2 Error classes + # ------------------- + # Attributes + enum: MPI_ERR_KEYVAL #:= MPI_ERR_ARG + # Memory Allocation + enum: MPI_ERR_NO_MEM #:= MPI_ERR_UNKNOWN + # Info Object + enum: MPI_ERR_INFO #:= MPI_ERR_ARG + enum: MPI_ERR_INFO_KEY #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_INFO_VALUE #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_INFO_NOKEY #:= MPI_ERR_UNKNOWN + # Dynamic Process Management + enum: MPI_ERR_SPAWN #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_PORT #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_SERVICE #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_NAME #:= MPI_ERR_UNKNOWN + # Input/Ouput + enum: MPI_ERR_FILE #:= MPI_ERR_ARG + enum: MPI_ERR_NOT_SAME #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_BAD_FILE #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_NO_SUCH_FILE #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_FILE_EXISTS #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_FILE_IN_USE #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_AMODE #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_ACCESS #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_READ_ONLY #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_NO_SPACE #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_QUOTA #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_UNSUPPORTED_DATAREP #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_UNSUPPORTED_OPERATION #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_CONVERSION #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_DUP_DATAREP #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_IO #:= MPI_ERR_UNKNOWN + # One-Sided Communications + enum: MPI_ERR_WIN #:= MPI_ERR_ARG + enum: MPI_ERR_BASE #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_SIZE #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_DISP #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_ASSERT #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_LOCKTYPE #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_RMA_CONFLICT #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_RMA_SYNC #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_RMA_RANGE #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_RMA_ATTACH #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_RMA_SHARED #:= MPI_ERR_UNKNOWN + enum: MPI_ERR_RMA_FLAVOR #:= MPI_ERR_UNKNOWN + + #----------------------------------------------------------------- + + int MPI_Alloc_mem(MPI_Aint, MPI_Info, void*) + int MPI_Free_mem(void*) + + #----------------------------------------------------------------- + + int MPI_Init(int*, char**[]) + int MPI_Finalize() + int MPI_Initialized(int*) + int MPI_Finalized(int*) + + enum: MPI_THREAD_SINGLE #:= 0 + enum: MPI_THREAD_FUNNELED #:= 1 + enum: MPI_THREAD_SERIALIZED #:= 2 + enum: MPI_THREAD_MULTIPLE #:= 3 + int MPI_Init_thread(int*, char**[], int, int*) + int MPI_Query_thread(int*) + int MPI_Is_thread_main(int*) + + #----------------------------------------------------------------- + + enum: MPI_VERSION #:= 1 + enum: MPI_SUBVERSION #:= 0 + int MPI_Get_version(int*, int*) + + enum: MPI_MAX_LIBRARY_VERSION_STRING #:= 1 + int MPI_Get_library_version(char[], int*) + + enum: MPI_MAX_PROCESSOR_NAME #:= 1 + int MPI_Get_processor_name(char[], int*) + + #----------------------------------------------------------------- + + double MPI_Wtime() + double MPI_Wtick() + + int MPI_Pcontrol(int, ...) + + #----------------------------------------------------------------- + + # Fortran INTEGER + ctypedef int MPI_Fint + + MPI_Fint* MPI_F_STATUS_IGNORE #:= 0 + MPI_Fint* MPI_F_STATUSES_IGNORE #:= 0 + int MPI_Status_c2f (MPI_Status*, MPI_Fint*) + int MPI_Status_f2c (MPI_Fint*, MPI_Status*) + + # C -> Fortran + MPI_Fint MPI_Type_c2f (MPI_Datatype) + MPI_Fint MPI_Request_c2f (MPI_Request) + MPI_Fint MPI_Message_c2f (MPI_Message) + MPI_Fint MPI_Op_c2f (MPI_Op) + MPI_Fint MPI_Info_c2f (MPI_Info) + MPI_Fint MPI_Group_c2f (MPI_Group) + MPI_Fint MPI_Comm_c2f (MPI_Comm) + MPI_Fint MPI_Win_c2f (MPI_Win) + MPI_Fint MPI_File_c2f (MPI_File) + MPI_Fint MPI_Errhandler_c2f (MPI_Errhandler) + + # Fortran -> C + MPI_Datatype MPI_Type_f2c (MPI_Fint) + MPI_Request MPI_Request_f2c (MPI_Fint) + MPI_Message MPI_Message_f2c (MPI_Fint) + MPI_Op MPI_Op_f2c (MPI_Fint) + MPI_Info MPI_Info_f2c (MPI_Fint) + MPI_Group MPI_Group_f2c (MPI_Fint) + MPI_Comm MPI_Comm_f2c (MPI_Fint) + MPI_Win MPI_Win_f2c (MPI_Fint) + MPI_File MPI_File_f2c (MPI_Fint) + MPI_Errhandler MPI_Errhandler_f2c (MPI_Fint) + + #----------------------------------------------------------------- diff --git a/src/include/mpi4py/mpi.pxi b/src/include/mpi4py/mpi.pxi index dc83945..1e44a46 100644 --- a/src/include/mpi4py/mpi.pxi +++ b/src/include/mpi4py/mpi.pxi @@ -1,904 +1,4 @@ # Author: Lisandro Dalcin # Contact: dalcinl@gmail.com -cdef extern from "mpi.h" nogil: - - #----------------------------------------------------------------- - - ctypedef long MPI_Aint - ctypedef long long MPI_Offset #:= long - ctypedef long long MPI_Count #:= MPI_Aint - - ctypedef struct MPI_Status: - int MPI_SOURCE - int MPI_TAG - int MPI_ERROR - - ctypedef struct _mpi_datatype_t - ctypedef _mpi_datatype_t* MPI_Datatype - - ctypedef struct _mpi_request_t - ctypedef _mpi_request_t* MPI_Request - - ctypedef struct _mpi_message_t - ctypedef _mpi_message_t* MPI_Message - - ctypedef struct _mpi_op_t - ctypedef _mpi_op_t* MPI_Op - - ctypedef struct _mpi_group_t - ctypedef _mpi_group_t* MPI_Group - - ctypedef struct _mpi_info_t - ctypedef _mpi_info_t* MPI_Info - - ctypedef struct _mpi_comm_t - ctypedef _mpi_comm_t* MPI_Comm - - ctypedef struct _mpi_win_t - ctypedef _mpi_win_t* MPI_Win - - ctypedef struct _mpi_file_t - ctypedef _mpi_file_t* MPI_File - - ctypedef struct _mpi_errhandler_t - ctypedef _mpi_errhandler_t* MPI_Errhandler - - #----------------------------------------------------------------- - - enum: MPI_UNDEFINED #:= -32766 - enum: MPI_ANY_SOURCE #:= MPI_UNDEFINED - enum: MPI_ANY_TAG #:= MPI_UNDEFINED - enum: MPI_PROC_NULL #:= MPI_UNDEFINED - enum: MPI_ROOT #:= MPI_PROC_NULL - - enum: MPI_IDENT #:= 1 - enum: MPI_CONGRUENT #:= 2 - enum: MPI_SIMILAR #:= 3 - enum: MPI_UNEQUAL #:= 4 - - void* MPI_BOTTOM #:= 0 - void* MPI_IN_PLACE #:= 0 - - enum: MPI_KEYVAL_INVALID #:= 0 - enum: MPI_MAX_OBJECT_NAME #:= 1 - - #----------------------------------------------------------------- - - # Null datatype - MPI_Datatype MPI_DATATYPE_NULL #:= 0 - # MPI datatypes - MPI_Datatype MPI_PACKED #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_BYTE #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_AINT #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_OFFSET #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_COUNT #:= MPI_DATATYPE_NULL - # Elementary C datatypes - MPI_Datatype MPI_CHAR #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_WCHAR #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_SIGNED_CHAR #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_SHORT #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_INT #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_LONG #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_LONG_LONG #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_LONG_LONG_INT #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_UNSIGNED_CHAR #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_UNSIGNED_SHORT #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_UNSIGNED #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_UNSIGNED_LONG #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_UNSIGNED_LONG_LONG #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_FLOAT #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_DOUBLE #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_LONG_DOUBLE #:= MPI_DATATYPE_NULL - # C99 datatypes - MPI_Datatype MPI_C_BOOL #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_INT8_T #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_INT16_T #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_INT32_T #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_INT64_T #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_UINT8_T #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_UINT16_T #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_UINT32_T #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_UINT64_T #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_C_COMPLEX #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_C_FLOAT_COMPLEX #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_C_DOUBLE_COMPLEX #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_C_LONG_DOUBLE_COMPLEX #:= MPI_DATATYPE_NULL - # C datatypes for reduction operations - MPI_Datatype MPI_SHORT_INT #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_2INT #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_LONG_INT #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_FLOAT_INT #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_DOUBLE_INT #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_LONG_DOUBLE_INT #:= MPI_DATATYPE_NULL - # Elementary Fortran datatypes - MPI_Datatype MPI_CHARACTER #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_LOGICAL #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_INTEGER #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_REAL #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_DOUBLE_PRECISION #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_COMPLEX #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_DOUBLE_COMPLEX #:= MPI_DATATYPE_NULL - # Size-specific Fortran datatypes - MPI_Datatype MPI_LOGICAL1 #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_LOGICAL2 #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_LOGICAL4 #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_LOGICAL8 #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_INTEGER1 #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_INTEGER2 #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_INTEGER4 #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_INTEGER8 #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_INTEGER16 #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_REAL2 #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_REAL4 #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_REAL8 #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_REAL16 #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_COMPLEX4 #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_COMPLEX8 #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_COMPLEX16 #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_COMPLEX32 #:= MPI_DATATYPE_NULL - - # Deprecated since MPI-2, removed in MPI-3 - MPI_Datatype MPI_UB #:= MPI_DATATYPE_NULL - MPI_Datatype MPI_LB #:= MPI_DATATYPE_NULL - int MPI_Type_lb(MPI_Datatype, MPI_Aint*) - int MPI_Type_ub(MPI_Datatype, MPI_Aint*) - int MPI_Type_extent(MPI_Datatype, MPI_Aint*) - int MPI_Address(void*, MPI_Aint*) - int MPI_Type_hvector(int, int, MPI_Aint, MPI_Datatype, MPI_Datatype*) - int MPI_Type_hindexed(int, int[], MPI_Aint[], MPI_Datatype, MPI_Datatype*) - int MPI_Type_struct(int, int[], MPI_Aint[], MPI_Datatype[], MPI_Datatype*) - - int MPI_Type_dup(MPI_Datatype, MPI_Datatype*) - int MPI_Type_contiguous(int, MPI_Datatype, MPI_Datatype*) - int MPI_Type_vector(int, int, int, MPI_Datatype, MPI_Datatype*) - int MPI_Type_indexed(int, int[], int[], MPI_Datatype, MPI_Datatype*) - int MPI_Type_create_indexed_block(int, int, int[], MPI_Datatype, MPI_Datatype*) - enum: MPI_ORDER_C #:= 0 - enum: MPI_ORDER_FORTRAN #:= 1 - int MPI_Type_create_subarray(int, int[], int[], int[], int, MPI_Datatype, MPI_Datatype*) - enum: MPI_DISTRIBUTE_NONE #:= 0 - enum: MPI_DISTRIBUTE_BLOCK #:= 1 - enum: MPI_DISTRIBUTE_CYCLIC #:= 2 - enum: MPI_DISTRIBUTE_DFLT_DARG #:= 4 - int MPI_Type_create_darray(int, int, int, int[], int[], int[], int[], int, MPI_Datatype, MPI_Datatype*) - - int MPI_Get_address(void*, MPI_Aint*) #:= MPI_Address - int MPI_Type_create_hvector(int, int, MPI_Aint, MPI_Datatype, MPI_Datatype*) #:= MPI_Type_hvector - int MPI_Type_create_hindexed(int, int[], MPI_Aint[], MPI_Datatype, MPI_Datatype*) #:= MPI_Type_hindexed - int MPI_Type_create_hindexed_block(int, int, MPI_Aint[], MPI_Datatype, MPI_Datatype*) - int MPI_Type_create_struct(int, int[], MPI_Aint[], MPI_Datatype[], MPI_Datatype*) #:= MPI_Type_struct - int MPI_Type_create_resized(MPI_Datatype, MPI_Aint, MPI_Aint, MPI_Datatype*) - - int MPI_Type_size(MPI_Datatype, int*) - int MPI_Type_size_x(MPI_Datatype, MPI_Count*) - int MPI_Type_get_extent(MPI_Datatype, MPI_Aint*, MPI_Aint*) - int MPI_Type_get_extent_x(MPI_Datatype, MPI_Count*, MPI_Count*) - int MPI_Type_get_true_extent(MPI_Datatype, MPI_Aint*, MPI_Aint*) - int MPI_Type_get_true_extent_x(MPI_Datatype, MPI_Count*, MPI_Count*) - - int MPI_Type_create_f90_integer(int, MPI_Datatype*) - int MPI_Type_create_f90_real(int, int, MPI_Datatype*) - int MPI_Type_create_f90_complex(int, int, MPI_Datatype*) - enum: MPI_TYPECLASS_INTEGER #:= MPI_UNDEFINED - enum: MPI_TYPECLASS_REAL #:= MPI_UNDEFINED - enum: MPI_TYPECLASS_COMPLEX #:= MPI_UNDEFINED - int MPI_Type_match_size(int, int, MPI_Datatype*) - - int MPI_Type_commit(MPI_Datatype*) - int MPI_Type_free(MPI_Datatype*) - - int MPI_Pack(void*, int, MPI_Datatype, void*, int, int*, MPI_Comm) - int MPI_Unpack(void*, int, int*, void*, int, MPI_Datatype, MPI_Comm) - int MPI_Pack_size(int, MPI_Datatype, MPI_Comm, int*) - - int MPI_Pack_external(char[], void*, int, MPI_Datatype, void*, MPI_Aint, MPI_Aint*) - int MPI_Unpack_external(char[], void*, MPI_Aint, MPI_Aint*, void*, int, MPI_Datatype) - int MPI_Pack_external_size(char[], int, MPI_Datatype, MPI_Aint*) - - enum: MPI_COMBINER_NAMED #:= MPI_UNDEFINED - enum: MPI_COMBINER_DUP #:= MPI_UNDEFINED - enum: MPI_COMBINER_CONTIGUOUS #:= MPI_UNDEFINED - enum: MPI_COMBINER_VECTOR #:= MPI_UNDEFINED - enum: MPI_COMBINER_HVECTOR #:= MPI_UNDEFINED - enum: MPI_COMBINER_HVECTOR_INTEGER #:= MPI_UNDEFINED - enum: MPI_COMBINER_INDEXED #:= MPI_UNDEFINED - enum: MPI_COMBINER_HINDEXED #:= MPI_UNDEFINED - enum: MPI_COMBINER_HINDEXED_INTEGER #:= MPI_UNDEFINED - enum: MPI_COMBINER_INDEXED_BLOCK #:= MPI_UNDEFINED - enum: MPI_COMBINER_HINDEXED_BLOCK #:= MPI_UNDEFINED - enum: MPI_COMBINER_STRUCT #:= MPI_UNDEFINED - enum: MPI_COMBINER_STRUCT_INTEGER #:= MPI_UNDEFINED - enum: MPI_COMBINER_SUBARRAY #:= MPI_UNDEFINED - enum: MPI_COMBINER_DARRAY #:= MPI_UNDEFINED - enum: MPI_COMBINER_F90_REAL #:= MPI_UNDEFINED - enum: MPI_COMBINER_F90_COMPLEX #:= MPI_UNDEFINED - enum: MPI_COMBINER_F90_INTEGER #:= MPI_UNDEFINED - enum: MPI_COMBINER_RESIZED #:= MPI_UNDEFINED - int MPI_Type_get_envelope(MPI_Datatype, int*, int*, int*, int*) - int MPI_Type_get_contents(MPI_Datatype, int, int, int, int[], MPI_Aint[], MPI_Datatype[]) - - int MPI_Type_get_name(MPI_Datatype, char[], int*) - int MPI_Type_set_name(MPI_Datatype, char[]) - - int MPI_Type_get_attr(MPI_Datatype, int, void*, int*) - int MPI_Type_set_attr(MPI_Datatype, int, void*) - int MPI_Type_delete_attr(MPI_Datatype, int) - - ctypedef int MPI_Type_copy_attr_function(MPI_Datatype,int,void*,void*,void*,int*) - ctypedef int MPI_Type_delete_attr_function(MPI_Datatype,int,void*,void*) - MPI_Type_copy_attr_function* MPI_TYPE_NULL_COPY_FN #:= 0 - MPI_Type_copy_attr_function* MPI_TYPE_DUP_FN #:= 0 - MPI_Type_delete_attr_function* MPI_TYPE_NULL_DELETE_FN #:= 0 - int MPI_Type_create_keyval(MPI_Type_copy_attr_function*, MPI_Type_delete_attr_function*, int*, void*) - int MPI_Type_free_keyval(int*) - - #----------------------------------------------------------------- - - MPI_Status* MPI_STATUS_IGNORE #:= 0 - MPI_Status* MPI_STATUSES_IGNORE #:= 0 - - int MPI_Get_count(MPI_Status*, MPI_Datatype, int*) - int MPI_Get_elements(MPI_Status*, MPI_Datatype, int*) - int MPI_Get_elements_x(MPI_Status*, MPI_Datatype, MPI_Count*) - int MPI_Status_set_elements(MPI_Status*, MPI_Datatype, int) - int MPI_Status_set_elements_x(MPI_Status*, MPI_Datatype, MPI_Count) - - int MPI_Test_cancelled(MPI_Status*, int*) - int MPI_Status_set_cancelled(MPI_Status*, int) - - #----------------------------------------------------------------- - - MPI_Request MPI_REQUEST_NULL #:= 0 - - int MPI_Request_free(MPI_Request*) - int MPI_Wait(MPI_Request*, MPI_Status*) - int MPI_Test(MPI_Request*, int*, MPI_Status*) - int MPI_Request_get_status(MPI_Request, int*, MPI_Status*) - int MPI_Cancel(MPI_Request*) - - int MPI_Waitany(int, MPI_Request[], int*, MPI_Status*) - int MPI_Testany(int, MPI_Request[], int*, int*, MPI_Status*) - int MPI_Waitall(int, MPI_Request[], MPI_Status[]) - int MPI_Testall(int, MPI_Request[], int*, MPI_Status[]) - int MPI_Waitsome(int, MPI_Request[], int*, int[], MPI_Status[]) - int MPI_Testsome(int, MPI_Request[], int*, int[], MPI_Status[]) - - int MPI_Start(MPI_Request*) - int MPI_Startall(int, MPI_Request*) - - ctypedef int MPI_Grequest_cancel_function(void*,int) - ctypedef int MPI_Grequest_free_function(void*) - ctypedef int MPI_Grequest_query_function(void*,MPI_Status*) - int MPI_Grequest_start(MPI_Grequest_query_function*, MPI_Grequest_free_function*, MPI_Grequest_cancel_function*, void*, MPI_Request*) - int MPI_Grequest_complete(MPI_Request) - - #----------------------------------------------------------------- - - MPI_Op MPI_OP_NULL #:= 0 - MPI_Op MPI_MAX #:= MPI_OP_NULL - MPI_Op MPI_MIN #:= MPI_OP_NULL - MPI_Op MPI_SUM #:= MPI_OP_NULL - MPI_Op MPI_PROD #:= MPI_OP_NULL - MPI_Op MPI_LAND #:= MPI_OP_NULL - MPI_Op MPI_BAND #:= MPI_OP_NULL - MPI_Op MPI_LOR #:= MPI_OP_NULL - MPI_Op MPI_BOR #:= MPI_OP_NULL - MPI_Op MPI_LXOR #:= MPI_OP_NULL - MPI_Op MPI_BXOR #:= MPI_OP_NULL - MPI_Op MPI_MAXLOC #:= MPI_OP_NULL - MPI_Op MPI_MINLOC #:= MPI_OP_NULL - MPI_Op MPI_REPLACE #:= MPI_OP_NULL - MPI_Op MPI_NO_OP #:= MPI_OP_NULL - - int MPI_Op_free(MPI_Op*) - - ctypedef void MPI_User_function(void*, void*, int*, MPI_Datatype*) - int MPI_Op_create(MPI_User_function*, int, MPI_Op*) - int MPI_Op_commutative(MPI_Op, int*) - - #----------------------------------------------------------------- - - MPI_Info MPI_INFO_NULL #:= 0 - MPI_Info MPI_INFO_ENV #:= MPI_INFO_NULL - - int MPI_Info_free(MPI_Info*) - int MPI_Info_create(MPI_Info*) - int MPI_Info_dup(MPI_Info, MPI_Info*) - - enum: MPI_MAX_INFO_KEY #:= 1 - enum: MPI_MAX_INFO_VAL #:= 1 - int MPI_Info_get(MPI_Info, char[], int, char[],int*) - int MPI_Info_set(MPI_Info, char[], char[]) - int MPI_Info_delete(MPI_Info, char[]) - - int MPI_Info_get_nkeys(MPI_Info, int*) - int MPI_Info_get_nthkey(MPI_Info, int, char[]) - int MPI_Info_get_valuelen(MPI_Info, char[], int*, int*) - - #----------------------------------------------------------------- - - MPI_Group MPI_GROUP_NULL #:= 0 - MPI_Group MPI_GROUP_EMPTY #:= 1 - - int MPI_Group_free(MPI_Group*) - - int MPI_Group_size(MPI_Group, int*) - int MPI_Group_rank(MPI_Group, int*) - int MPI_Group_translate_ranks(MPI_Group, int, int[], MPI_Group, int[]) - - int MPI_Group_compare(MPI_Group, MPI_Group, int*) - - int MPI_Group_union(MPI_Group, MPI_Group, MPI_Group*) - int MPI_Group_intersection(MPI_Group, MPI_Group, MPI_Group*) - int MPI_Group_difference(MPI_Group, MPI_Group, MPI_Group*) - int MPI_Group_incl(MPI_Group, int, int[], MPI_Group*) - int MPI_Group_excl(MPI_Group, int, int[], MPI_Group*) - int MPI_Group_range_incl(MPI_Group, int, int[][3], MPI_Group*) - int MPI_Group_range_excl(MPI_Group, int, int[][3], MPI_Group*) - - #----------------------------------------------------------------- - - MPI_Comm MPI_COMM_NULL #:= 0 - MPI_Comm MPI_COMM_SELF #:= MPI_COMM_NULL - MPI_Comm MPI_COMM_WORLD #:= MPI_COMM_NULL - - int MPI_Comm_free(MPI_Comm*) - - int MPI_Comm_group(MPI_Comm, MPI_Group*) - - int MPI_Comm_size(MPI_Comm, int*) - int MPI_Comm_rank(MPI_Comm, int*) - - int MPI_Comm_compare(MPI_Comm, MPI_Comm, int*) - int MPI_Topo_test(MPI_Comm, int*) - int MPI_Comm_test_inter(MPI_Comm, int*) - - int MPI_Abort(MPI_Comm, int) - - int MPI_Send(void*, int, MPI_Datatype, int, int, MPI_Comm) - int MPI_Recv(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Status*) - int MPI_Sendrecv(void*, int, MPI_Datatype,int, int, void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Status*) - int MPI_Sendrecv_replace(void*, int, MPI_Datatype, int, int, int, int, MPI_Comm, MPI_Status*) - - enum: MPI_BSEND_OVERHEAD #:= 0 - int MPI_Buffer_attach(void*, int) - int MPI_Buffer_detach(void*, int*) - int MPI_Bsend(void*, int, MPI_Datatype, int, int, MPI_Comm) - int MPI_Ssend(void*, int, MPI_Datatype, int, int, MPI_Comm) - int MPI_Rsend(void*, int, MPI_Datatype, int, int, MPI_Comm) - - int MPI_Isend(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*) - int MPI_Ibsend(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*) - int MPI_Issend(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*) - int MPI_Irsend(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*) - int MPI_Irecv(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*) - - int MPI_Send_init(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*) - int MPI_Bsend_init(void*, int, MPI_Datatype, int,int, MPI_Comm, MPI_Request*) - int MPI_Ssend_init(void*, int, MPI_Datatype, int,int, MPI_Comm, MPI_Request*) - int MPI_Rsend_init(void*, int, MPI_Datatype, int,int, MPI_Comm, MPI_Request*) - int MPI_Recv_init(void*, int, MPI_Datatype, int,int, MPI_Comm, MPI_Request*) - - int MPI_Probe(int, int, MPI_Comm, MPI_Status*) - int MPI_Iprobe(int, int, MPI_Comm, int*, MPI_Status*) - - MPI_Message MPI_MESSAGE_NULL #:= 0 - MPI_Message MPI_MESSAGE_NO_PROC #:= MPI_MESSAGE_NULL - int MPI_Mprobe(int, int, MPI_Comm, MPI_Message*, MPI_Status*) - int MPI_Improbe(int, int, MPI_Comm, int*, MPI_Message*, MPI_Status*) - int MPI_Mrecv(void*, int, MPI_Datatype, MPI_Message*, MPI_Status*) - int MPI_Imrecv(void*, int, MPI_Datatype, MPI_Message*, MPI_Request*) - - int MPI_Barrier(MPI_Comm) - int MPI_Bcast(void*, int, MPI_Datatype, int, MPI_Comm) - int MPI_Gather(void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm) - int MPI_Gatherv(void*, int, MPI_Datatype, void*, int*, int*, MPI_Datatype, int, MPI_Comm) - int MPI_Scatter(void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm) - int MPI_Scatterv(void*, int*, int*, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm) - int MPI_Allgather(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm) - int MPI_Allgatherv(void*, int, MPI_Datatype, void*, int*, int*, MPI_Datatype, MPI_Comm) - int MPI_Alltoall(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm) - int MPI_Alltoallv(void*, int*, int*, MPI_Datatype, void*, int*, int*, MPI_Datatype, MPI_Comm) - int MPI_Alltoallw(void*, int*, int*, MPI_Datatype*, void*, int*, int*, MPI_Datatype*, MPI_Comm) - - int MPI_Reduce(void*, void*, int, MPI_Datatype, MPI_Op, int, MPI_Comm) - int MPI_Allreduce(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm) - int MPI_Reduce_local(void*, void*, int, MPI_Datatype, MPI_Op) - int MPI_Reduce_scatter_block(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm) - int MPI_Reduce_scatter(void*, void*, int*, MPI_Datatype, MPI_Op, MPI_Comm) - int MPI_Scan(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm) - int MPI_Exscan(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm) - - int MPI_Neighbor_allgather(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm) - int MPI_Neighbor_allgatherv(void*, int, MPI_Datatype, void*, int[], int[], MPI_Datatype, MPI_Comm) - int MPI_Neighbor_alltoall(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm) - int MPI_Neighbor_alltoallv(void*, int[], int[],MPI_Datatype, void*, int[],int[], MPI_Datatype, MPI_Comm) - int MPI_Neighbor_alltoallw(void *, int[], MPI_Aint[],MPI_Datatype[], void*, int[],MPI_Aint[], MPI_Datatype[], MPI_Comm) - - int MPI_Ibarrier(MPI_Comm, MPI_Request*) - int MPI_Ibcast(void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*) - int MPI_Igather(void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*) - int MPI_Igatherv(void*, int, MPI_Datatype, void*, int*, int*, MPI_Datatype, int, MPI_Comm, MPI_Request*) - int MPI_Iscatter(void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*) - int MPI_Iscatterv(void*, int*, int*, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*) - int MPI_Iallgather(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm, MPI_Request*) - int MPI_Iallgatherv(void*, int, MPI_Datatype, void*, int*, int*, MPI_Datatype, MPI_Comm, MPI_Request*) - int MPI_Ialltoall(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm, MPI_Request*) - int MPI_Ialltoallv(void*, int*, int*, MPI_Datatype, void*, int*, int*, MPI_Datatype, MPI_Comm, MPI_Request*) - int MPI_Ialltoallw(void*, int*, int*, MPI_Datatype*, void*, int*, int*, MPI_Datatype*, MPI_Comm, MPI_Request*) - - int MPI_Ireduce(void*, void*, int, MPI_Datatype, MPI_Op, int, MPI_Comm, MPI_Request*) - int MPI_Iallreduce(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*) - int MPI_Ireduce_scatter_block(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*) - int MPI_Ireduce_scatter(void*, void*, int*, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*) - int MPI_Iscan(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*) - int MPI_Iexscan(void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*) - - int MPI_Ineighbor_allgather(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm, MPI_Request*) - int MPI_Ineighbor_allgatherv(void*, int, MPI_Datatype, void*, int[], int[], MPI_Datatype, MPI_Comm, MPI_Request*) - int MPI_Ineighbor_alltoall(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm, MPI_Request*) - int MPI_Ineighbor_alltoallv(void*, int[], int[],MPI_Datatype, void*, int[],int[], MPI_Datatype, MPI_Comm, MPI_Request*) - int MPI_Ineighbor_alltoallw(void *, int[], MPI_Aint[],MPI_Datatype[], void*, int[],MPI_Aint[], MPI_Datatype[], MPI_Comm, MPI_Request*) - - int MPI_Comm_dup(MPI_Comm, MPI_Comm*) - int MPI_Comm_dup_with_info(MPI_Comm, MPI_Info, MPI_Comm*) - int MPI_Comm_idup(MPI_Comm, MPI_Comm*, MPI_Request*) - int MPI_Comm_create(MPI_Comm, MPI_Group, MPI_Comm*) - int MPI_Comm_create_group(MPI_Comm, MPI_Group, int, MPI_Comm*) - int MPI_Comm_split(MPI_Comm, int, int, MPI_Comm*) - enum: MPI_COMM_TYPE_SHARED #:= MPI_UNDEFINED - int MPI_Comm_split_type(MPI_Comm, int, int, MPI_Info, MPI_Comm*) - int MPI_Comm_set_info(MPI_Comm, MPI_Info) - int MPI_Comm_get_info(MPI_Comm, MPI_Info*) - - enum: MPI_CART #:= MPI_UNDEFINED - int MPI_Cart_create(MPI_Comm, int, int[], int[], int, MPI_Comm*) - int MPI_Cartdim_get(MPI_Comm, int*) - int MPI_Cart_get(MPI_Comm, int, int[], int[], int[]) - int MPI_Cart_rank(MPI_Comm, int[], int*) - int MPI_Cart_coords(MPI_Comm, int, int, int[]) - int MPI_Cart_shift(MPI_Comm, int, int, int[], int[]) - int MPI_Cart_sub(MPI_Comm, int[], MPI_Comm*) - int MPI_Cart_map(MPI_Comm, int, int[], int[], int*) - int MPI_Dims_create(int, int, int[]) - - enum: MPI_GRAPH #:= MPI_UNDEFINED - int MPI_Graph_create(MPI_Comm, int, int[], int[], int, MPI_Comm*) - int MPI_Graphdims_get(MPI_Comm, int*, int*) - int MPI_Graph_get(MPI_Comm, int, int, int[], int[]) - int MPI_Graph_map(MPI_Comm, int, int[], int[], int*) - int MPI_Graph_neighbors_count(MPI_Comm, int, int*) - int MPI_Graph_neighbors(MPI_Comm, int, int, int[]) - - enum: MPI_DIST_GRAPH #:= MPI_UNDEFINED - int* MPI_UNWEIGHTED #:= 0 - int* MPI_WEIGHTS_EMPTY #:= MPI_UNWEIGHTED - int MPI_Dist_graph_create_adjacent(MPI_Comm, int, int[], int[], int, int[], int[], MPI_Info, int, MPI_Comm*) - int MPI_Dist_graph_create(MPI_Comm, int, int[], int[], int[], int[], MPI_Info, int, MPI_Comm*) - int MPI_Dist_graph_neighbors_count(MPI_Comm, int*, int*, int*) - int MPI_Dist_graph_neighbors(MPI_Comm, int, int[], int[], int, int[], int[]) - - int MPI_Intercomm_create(MPI_Comm, int, MPI_Comm, int, int, MPI_Comm*) - int MPI_Comm_remote_group(MPI_Comm, MPI_Group*) - int MPI_Comm_remote_size(MPI_Comm, int*) - int MPI_Intercomm_merge(MPI_Comm, int, MPI_Comm*) - - enum: MPI_MAX_PORT_NAME #:= 1 - int MPI_Open_port(MPI_Info, char[]) - int MPI_Close_port(char[]) - - int MPI_Publish_name(char[], MPI_Info, char[]) - int MPI_Unpublish_name(char[], MPI_Info, char[]) - int MPI_Lookup_name(char[], MPI_Info, char[]) - - int MPI_Comm_accept(char[], MPI_Info, int, MPI_Comm, MPI_Comm*) - int MPI_Comm_connect(char[], MPI_Info, int, MPI_Comm, MPI_Comm*) - int MPI_Comm_join(int, MPI_Comm*) - int MPI_Comm_disconnect(MPI_Comm*) - - char** MPI_ARGV_NULL #:= 0 - char*** MPI_ARGVS_NULL #:= 0 - int* MPI_ERRCODES_IGNORE #:= 0 - int MPI_Comm_spawn(char[], char*[], int, MPI_Info, int, MPI_Comm, MPI_Comm*, int[]) - int MPI_Comm_spawn_multiple(int, char*[], char**[], int[], MPI_Info[], int, MPI_Comm, MPI_Comm*, int[]) - int MPI_Comm_get_parent(MPI_Comm*) - - int MPI_Errhandler_get(MPI_Comm, MPI_Errhandler*) - int MPI_Errhandler_set(MPI_Comm, MPI_Errhandler) - ctypedef void MPI_Handler_function(MPI_Comm*,int*,...) - int MPI_Errhandler_create(MPI_Handler_function*, MPI_Errhandler*) - - enum: MPI_TAG_UB #:= MPI_KEYVAL_INVALID - enum: MPI_HOST #:= MPI_KEYVAL_INVALID - enum: MPI_IO #:= MPI_KEYVAL_INVALID - enum: MPI_WTIME_IS_GLOBAL #:= MPI_KEYVAL_INVALID - int MPI_Attr_get(MPI_Comm, int, void*, int*) - int MPI_Attr_put(MPI_Comm, int, void*) - int MPI_Attr_delete(MPI_Comm, int) - - ctypedef int MPI_Copy_function(MPI_Comm,int,void*,void*,void*,int*) - ctypedef int MPI_Delete_function(MPI_Comm,int,void*,void*) - MPI_Copy_function* MPI_DUP_FN #:= 0 - MPI_Copy_function* MPI_NULL_COPY_FN #:= 0 - MPI_Delete_function* MPI_NULL_DELETE_FN #:= 0 - int MPI_Keyval_create(MPI_Copy_function*, MPI_Delete_function*, int*, void*) - int MPI_Keyval_free(int*) - - int MPI_Comm_get_errhandler(MPI_Comm, MPI_Errhandler*) #:= MPI_Errhandler_get - int MPI_Comm_set_errhandler(MPI_Comm, MPI_Errhandler) #:= MPI_Errhandler_set - ctypedef void MPI_Comm_errhandler_fn(MPI_Comm*,int*,...) #:= MPI_Handler_function - ctypedef void MPI_Comm_errhandler_function(MPI_Comm*,int*,...) #:= MPI_Comm_errhandler_fn - int MPI_Comm_create_errhandler(MPI_Comm_errhandler_function*, MPI_Errhandler*) #:= MPI_Errhandler_create - int MPI_Comm_call_errhandler(MPI_Comm, int) - - int MPI_Comm_get_name(MPI_Comm, char[], int*) - int MPI_Comm_set_name(MPI_Comm, char[]) - - enum: MPI_UNIVERSE_SIZE #:= MPI_KEYVAL_INVALID - enum: MPI_APPNUM #:= MPI_KEYVAL_INVALID - enum: MPI_LASTUSEDCODE #:= MPI_KEYVAL_INVALID - int MPI_Comm_get_attr(MPI_Comm, int, void*, int*) #:= MPI_Attr_get - int MPI_Comm_set_attr(MPI_Comm, int, void*) #:= MPI_Attr_put - int MPI_Comm_delete_attr(MPI_Comm, int) #:= MPI_Attr_delete - - ctypedef int MPI_Comm_copy_attr_function(MPI_Comm,int,void*,void*,void*,int*) #:= MPI_Copy_function - ctypedef int MPI_Comm_delete_attr_function(MPI_Comm,int,void*,void*) #:= MPI_Delete_function - MPI_Comm_copy_attr_function* MPI_COMM_DUP_FN #:= MPI_DUP_FN - MPI_Comm_copy_attr_function* MPI_COMM_NULL_COPY_FN #:= MPI_NULL_COPY_FN - MPI_Comm_delete_attr_function* MPI_COMM_NULL_DELETE_FN #:= MPI_NULL_DELETE_FN - int MPI_Comm_create_keyval(MPI_Comm_copy_attr_function*, MPI_Comm_delete_attr_function*, int*, void*) #:= MPI_Keyval_create - int MPI_Comm_free_keyval(int*) #:= MPI_Keyval_free - - #----------------------------------------------------------------- - - MPI_Win MPI_WIN_NULL #:= 0 - - int MPI_Win_free(MPI_Win*) - int MPI_Win_create(void*, MPI_Aint, int, MPI_Info, MPI_Comm, MPI_Win*) - int MPI_Win_allocate(MPI_Aint, int, MPI_Info, MPI_Comm, void*, MPI_Win*) - int MPI_Win_allocate_shared(MPI_Aint, int, MPI_Info, MPI_Comm, void*, MPI_Win*) - int MPI_Win_shared_query(MPI_Win, int, MPI_Aint*,int*, void*) - int MPI_Win_create_dynamic(MPI_Info, MPI_Comm, MPI_Win*) - int MPI_Win_attach(MPI_Win, void*, MPI_Aint) - int MPI_Win_detach(MPI_Win, void*) - int MPI_Win_set_info(MPI_Win,MPI_Info) - int MPI_Win_get_info(MPI_Win,MPI_Info*) - int MPI_Win_get_group(MPI_Win, MPI_Group*) - - int MPI_Get(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win) - int MPI_Put(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win) - int MPI_Accumulate(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Op, MPI_Win) - int MPI_Get_accumulate(void*, int, MPI_Datatype, void*, int,MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Op, MPI_Win) - int MPI_Fetch_and_op(void*, void*, MPI_Datatype, int, MPI_Aint, MPI_Op, MPI_Win) - int MPI_Compare_and_swap(void*, void*, void*, MPI_Datatype, int, MPI_Aint, MPI_Win) - - int MPI_Rget(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win, MPI_Request*) - int MPI_Rput(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win, MPI_Request*) - int MPI_Raccumulate(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Op, MPI_Win, MPI_Request*) - int MPI_Rget_accumulate(void*, int, MPI_Datatype, void*, int,MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Op, MPI_Win, MPI_Request*) - - enum: MPI_MODE_NOCHECK #:= MPI_UNDEFINED - enum: MPI_MODE_NOSTORE #:= MPI_UNDEFINED - enum: MPI_MODE_NOPUT #:= MPI_UNDEFINED - enum: MPI_MODE_NOPRECEDE #:= MPI_UNDEFINED - enum: MPI_MODE_NOSUCCEED #:= MPI_UNDEFINED - int MPI_Win_fence(int, MPI_Win) - int MPI_Win_post(MPI_Group, int, MPI_Win) - int MPI_Win_start(MPI_Group, int, MPI_Win) - int MPI_Win_complete(MPI_Win) - int MPI_Win_wait(MPI_Win) - int MPI_Win_test(MPI_Win, int*) - - enum: MPI_LOCK_EXCLUSIVE #:= MPI_UNDEFINED - enum: MPI_LOCK_SHARED #:= MPI_UNDEFINED - int MPI_Win_lock(int, int, int, MPI_Win) - int MPI_Win_unlock(int, MPI_Win) - int MPI_Win_lock_all(int, MPI_Win) - int MPI_Win_unlock_all(MPI_Win) - int MPI_Win_flush(int, MPI_Win) - int MPI_Win_flush_all(MPI_Win) - int MPI_Win_flush_local(int, MPI_Win) - int MPI_Win_flush_local_all(MPI_Win) - int MPI_Win_sync(MPI_Win) - - int MPI_Win_get_errhandler(MPI_Win, MPI_Errhandler*) - int MPI_Win_set_errhandler(MPI_Win, MPI_Errhandler) - ctypedef void MPI_Win_errhandler_fn(MPI_Win*,int*,...) - ctypedef void MPI_Win_errhandler_function(MPI_Comm*,int*,...) #:= MPI_Win_errhandler_fn - int MPI_Win_create_errhandler(MPI_Win_errhandler_function*, MPI_Errhandler*) - int MPI_Win_call_errhandler(MPI_Win, int) - - int MPI_Win_get_name(MPI_Win, char[], int*) - int MPI_Win_set_name(MPI_Win, char[]) - - enum: MPI_WIN_BASE #:= MPI_KEYVAL_INVALID - enum: MPI_WIN_SIZE #:= MPI_KEYVAL_INVALID - enum: MPI_WIN_DISP_UNIT #:= MPI_KEYVAL_INVALID - enum: MPI_WIN_CREATE_FLAVOR #:= MPI_KEYVAL_INVALID - enum: MPI_WIN_MODEL #:= MPI_KEYVAL_INVALID - - enum: MPI_WIN_FLAVOR_CREATE #:= MPI_UNDEFINED - enum: MPI_WIN_FLAVOR_ALLOCATE #:= MPI_UNDEFINED - enum: MPI_WIN_FLAVOR_DYNAMIC #:= MPI_UNDEFINED - enum: MPI_WIN_FLAVOR_SHARED #:= MPI_UNDEFINED - - enum: MPI_WIN_SEPARATE #:= MPI_UNDEFINED - enum: MPI_WIN_UNIFIED #:= MPI_UNDEFINED - - int MPI_Win_get_attr(MPI_Win, int, void*, int*) - int MPI_Win_set_attr(MPI_Win, int, void*) - int MPI_Win_delete_attr(MPI_Win, int) - - ctypedef int MPI_Win_copy_attr_function(MPI_Win,int,void*,void*,void*,int*) - ctypedef int MPI_Win_delete_attr_function(MPI_Win,int,void*,void*) - MPI_Win_copy_attr_function* MPI_WIN_DUP_FN #:= 0 - MPI_Win_copy_attr_function* MPI_WIN_NULL_COPY_FN #:= 0 - MPI_Win_delete_attr_function* MPI_WIN_NULL_DELETE_FN #:= 0 - int MPI_Win_create_keyval(MPI_Win_copy_attr_function*, MPI_Win_delete_attr_function*, int*, void*) - int MPI_Win_free_keyval(int*) - - #----------------------------------------------------------------- - - MPI_File MPI_FILE_NULL #:= 0 - - enum: MPI_MODE_RDONLY #:= 1 - enum: MPI_MODE_RDWR #:= 2 - enum: MPI_MODE_WRONLY #:= 4 - enum: MPI_MODE_CREATE #:= 8 - enum: MPI_MODE_EXCL #:= 16 - enum: MPI_MODE_DELETE_ON_CLOSE #:= 32 - enum: MPI_MODE_UNIQUE_OPEN #:= 64 - enum: MPI_MODE_APPEND #:= 128 - enum: MPI_MODE_SEQUENTIAL #:= 256 - - int MPI_File_open(MPI_Comm, char[], int, MPI_Info, MPI_File*) - int MPI_File_close(MPI_File*) - int MPI_File_delete(char[], MPI_Info) - - int MPI_File_set_size(MPI_File, MPI_Offset) - int MPI_File_preallocate(MPI_File, MPI_Offset) - int MPI_File_get_size(MPI_File, MPI_Offset*) - int MPI_File_get_group(MPI_File, MPI_Group*) - int MPI_File_get_amode(MPI_File, int*) - int MPI_File_set_info(MPI_File, MPI_Info) - int MPI_File_get_info(MPI_File, MPI_Info*) - - int MPI_File_get_view(MPI_File, MPI_Offset*, MPI_Datatype*, MPI_Datatype*, char[]) - int MPI_File_set_view(MPI_File, MPI_Offset, MPI_Datatype, MPI_Datatype, char[], MPI_Info) - - int MPI_File_read_at (MPI_File, MPI_Offset, void*, int, MPI_Datatype, MPI_Status*) - int MPI_File_read_at_all (MPI_File, MPI_Offset, void*, int, MPI_Datatype, MPI_Status*) - int MPI_File_write_at (MPI_File, MPI_Offset, void*, int, MPI_Datatype, MPI_Status*) - int MPI_File_write_at_all (MPI_File, MPI_Offset, void*, int, MPI_Datatype, MPI_Status*) - - int MPI_File_iread_at (MPI_File, MPI_Offset, void*, int, MPI_Datatype, MPI_Request*) - int MPI_File_iwrite_at (MPI_File, MPI_Offset, void*, int, MPI_Datatype, MPI_Request*) - - enum: MPI_SEEK_SET #:= 0 - enum: MPI_SEEK_CUR #:= 1 - enum: MPI_SEEK_END #:= 2 - enum: MPI_DISPLACEMENT_CURRENT #:= 3 - int MPI_File_seek(MPI_File, MPI_Offset, int) - int MPI_File_get_position(MPI_File, MPI_Offset*) - int MPI_File_get_byte_offset(MPI_File, MPI_Offset, MPI_Offset*) - - int MPI_File_read (MPI_File, void*, int, MPI_Datatype, MPI_Status*) - int MPI_File_read_all (MPI_File, void*, int, MPI_Datatype, MPI_Status*) - int MPI_File_write (MPI_File, void*, int, MPI_Datatype, MPI_Status*) - int MPI_File_write_all (MPI_File, void*, int, MPI_Datatype, MPI_Status*) - int MPI_File_iread (MPI_File, void*, int, MPI_Datatype, MPI_Request*) - int MPI_File_iwrite (MPI_File, void*, int, MPI_Datatype, MPI_Request*) - - int MPI_File_read_shared (MPI_File, void*, int, MPI_Datatype, MPI_Status*) - int MPI_File_write_shared (MPI_File, void*, int, MPI_Datatype, MPI_Status*) - int MPI_File_iread_shared (MPI_File, void*, int, MPI_Datatype, MPI_Request*) - int MPI_File_iwrite_shared (MPI_File, void*, int, MPI_Datatype, MPI_Request*) - int MPI_File_read_ordered (MPI_File, void*, int, MPI_Datatype, MPI_Status*) - int MPI_File_write_ordered (MPI_File, void*, int, MPI_Datatype, MPI_Status*) - - int MPI_File_seek_shared(MPI_File, MPI_Offset, int) - int MPI_File_get_position_shared(MPI_File, MPI_Offset*) - - int MPI_File_read_at_all_begin (MPI_File, MPI_Offset, void*, int, MPI_Datatype) - int MPI_File_read_at_all_end (MPI_File, void*, MPI_Status*) - int MPI_File_write_at_all_begin (MPI_File, MPI_Offset, void*, int, MPI_Datatype) - int MPI_File_write_at_all_end (MPI_File, void*, MPI_Status*) - int MPI_File_read_all_begin (MPI_File, void*, int, MPI_Datatype) - int MPI_File_read_all_end (MPI_File, void*, MPI_Status*) - int MPI_File_write_all_begin (MPI_File, void*, int, MPI_Datatype) - int MPI_File_write_all_end (MPI_File, void*, MPI_Status*) - int MPI_File_read_ordered_begin (MPI_File, void*, int, MPI_Datatype) - int MPI_File_read_ordered_end (MPI_File, void*, MPI_Status*) - int MPI_File_write_ordered_begin (MPI_File, void*, int, MPI_Datatype) - int MPI_File_write_ordered_end (MPI_File, void*, MPI_Status*) - - int MPI_File_get_type_extent(MPI_File, MPI_Datatype, MPI_Aint*) - - int MPI_File_set_atomicity(MPI_File, int) - int MPI_File_get_atomicity(MPI_File, int*) - int MPI_File_sync(MPI_File) - - int MPI_File_get_errhandler(MPI_File, MPI_Errhandler*) - int MPI_File_set_errhandler(MPI_File, MPI_Errhandler) - ctypedef void MPI_File_errhandler_fn(MPI_File*,int*,...) - ctypedef void MPI_File_errhandler_function(MPI_File*,int*,...) #:= MPI_File_errhandler_fn - int MPI_File_create_errhandler(MPI_File_errhandler_function*, MPI_Errhandler*) - int MPI_File_call_errhandler(MPI_File, int) - - ctypedef int MPI_Datarep_conversion_function(void*,MPI_Datatype,int,void*,MPI_Offset,void*) - ctypedef int MPI_Datarep_extent_function(MPI_Datatype,MPI_Aint*,void*) - MPI_Datarep_conversion_function* MPI_CONVERSION_FN_NULL #:= 0 - enum: MPI_MAX_DATAREP_STRING #:= 1 - int MPI_Register_datarep(char[], MPI_Datarep_conversion_function*, MPI_Datarep_conversion_function*, MPI_Datarep_extent_function*, void*) - - #----------------------------------------------------------------- - - MPI_Errhandler MPI_ERRHANDLER_NULL #:= 0 - MPI_Errhandler MPI_ERRORS_RETURN #:= MPI_ERRHANDLER_NULL - MPI_Errhandler MPI_ERRORS_ARE_FATAL #:= MPI_ERRHANDLER_NULL - - int MPI_Errhandler_free(MPI_Errhandler*) - - #----------------------------------------------------------------- - - enum: MPI_MAX_ERROR_STRING #:= 1 - int MPI_Error_class(int, int*) - int MPI_Error_string(int, char[], int*) - - int MPI_Add_error_class(int*) - int MPI_Add_error_code(int,int*) - int MPI_Add_error_string(int,char[]) - - # MPI-1 Error classes - # ------------------- - # Actually no errors - enum: MPI_SUCCESS #:= 0 - enum: MPI_ERR_LASTCODE #:= 1 - # MPI-1 Objects - enum: MPI_ERR_COMM #:= MPI_ERR_LASTCODE - enum: MPI_ERR_GROUP #:= MPI_ERR_LASTCODE - enum: MPI_ERR_TYPE #:= MPI_ERR_LASTCODE - enum: MPI_ERR_REQUEST #:= MPI_ERR_LASTCODE - enum: MPI_ERR_OP #:= MPI_ERR_LASTCODE - # Communication argument parameters - enum: MPI_ERR_BUFFER #:= MPI_ERR_LASTCODE - enum: MPI_ERR_COUNT #:= MPI_ERR_LASTCODE - enum: MPI_ERR_TAG #:= MPI_ERR_LASTCODE - enum: MPI_ERR_RANK #:= MPI_ERR_LASTCODE - enum: MPI_ERR_ROOT #:= MPI_ERR_LASTCODE - enum: MPI_ERR_TRUNCATE #:= MPI_ERR_LASTCODE - # Multiple completion - enum: MPI_ERR_IN_STATUS #:= MPI_ERR_LASTCODE - enum: MPI_ERR_PENDING #:= MPI_ERR_LASTCODE - # Topology argument parameters - enum: MPI_ERR_TOPOLOGY #:= MPI_ERR_LASTCODE - enum: MPI_ERR_DIMS #:= MPI_ERR_LASTCODE - # All other arguments, this is a class with many kinds - enum: MPI_ERR_ARG #:= MPI_ERR_LASTCODE - # Other errors that are not simply an invalid argument - enum: MPI_ERR_OTHER #:= MPI_ERR_LASTCODE - enum: MPI_ERR_UNKNOWN #:= MPI_ERR_LASTCODE - enum: MPI_ERR_INTERN #:= MPI_ERR_LASTCODE - - # MPI-2 Error classes - # ------------------- - # Attributes - enum: MPI_ERR_KEYVAL #:= MPI_ERR_ARG - # Memory Allocation - enum: MPI_ERR_NO_MEM #:= MPI_ERR_UNKNOWN - # Info Object - enum: MPI_ERR_INFO #:= MPI_ERR_ARG - enum: MPI_ERR_INFO_KEY #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_INFO_VALUE #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_INFO_NOKEY #:= MPI_ERR_UNKNOWN - # Dynamic Process Management - enum: MPI_ERR_SPAWN #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_PORT #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_SERVICE #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_NAME #:= MPI_ERR_UNKNOWN - # Input/Ouput - enum: MPI_ERR_FILE #:= MPI_ERR_ARG - enum: MPI_ERR_NOT_SAME #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_BAD_FILE #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_NO_SUCH_FILE #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_FILE_EXISTS #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_FILE_IN_USE #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_AMODE #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_ACCESS #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_READ_ONLY #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_NO_SPACE #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_QUOTA #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_UNSUPPORTED_DATAREP #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_UNSUPPORTED_OPERATION #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_CONVERSION #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_DUP_DATAREP #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_IO #:= MPI_ERR_UNKNOWN - # One-Sided Communications - enum: MPI_ERR_WIN #:= MPI_ERR_ARG - enum: MPI_ERR_BASE #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_SIZE #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_DISP #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_ASSERT #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_LOCKTYPE #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_RMA_CONFLICT #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_RMA_SYNC #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_RMA_RANGE #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_RMA_ATTACH #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_RMA_SHARED #:= MPI_ERR_UNKNOWN - enum: MPI_ERR_RMA_FLAVOR #:= MPI_ERR_UNKNOWN - - #----------------------------------------------------------------- - - int MPI_Alloc_mem(MPI_Aint, MPI_Info, void*) - int MPI_Free_mem(void*) - - #----------------------------------------------------------------- - - int MPI_Init(int*, char**[]) - int MPI_Finalize() - int MPI_Initialized(int*) - int MPI_Finalized(int*) - - enum: MPI_THREAD_SINGLE #:= 0 - enum: MPI_THREAD_FUNNELED #:= 1 - enum: MPI_THREAD_SERIALIZED #:= 2 - enum: MPI_THREAD_MULTIPLE #:= 3 - int MPI_Init_thread(int*, char**[], int, int*) - int MPI_Query_thread(int*) - int MPI_Is_thread_main(int*) - - #----------------------------------------------------------------- - - enum: MPI_VERSION #:= 1 - enum: MPI_SUBVERSION #:= 0 - int MPI_Get_version(int*, int*) - - enum: MPI_MAX_LIBRARY_VERSION_STRING #:= 1 - int MPI_Get_library_version(char[], int*) - - enum: MPI_MAX_PROCESSOR_NAME #:= 1 - int MPI_Get_processor_name(char[], int*) - - #----------------------------------------------------------------- - - double MPI_Wtime() - double MPI_Wtick() - - int MPI_Pcontrol(int, ...) - - #----------------------------------------------------------------- - - # Fortran INTEGER - ctypedef int MPI_Fint - - MPI_Fint* MPI_F_STATUS_IGNORE #:= 0 - MPI_Fint* MPI_F_STATUSES_IGNORE #:= 0 - int MPI_Status_c2f (MPI_Status*, MPI_Fint*) - int MPI_Status_f2c (MPI_Fint*, MPI_Status*) - - # C -> Fortran - MPI_Fint MPI_Type_c2f (MPI_Datatype) - MPI_Fint MPI_Request_c2f (MPI_Request) - MPI_Fint MPI_Message_c2f (MPI_Message) - MPI_Fint MPI_Op_c2f (MPI_Op) - MPI_Fint MPI_Info_c2f (MPI_Info) - MPI_Fint MPI_Group_c2f (MPI_Group) - MPI_Fint MPI_Comm_c2f (MPI_Comm) - MPI_Fint MPI_Win_c2f (MPI_Win) - MPI_Fint MPI_File_c2f (MPI_File) - MPI_Fint MPI_Errhandler_c2f (MPI_Errhandler) - - # Fortran -> C - MPI_Datatype MPI_Type_f2c (MPI_Fint) - MPI_Request MPI_Request_f2c (MPI_Fint) - MPI_Message MPI_Message_f2c (MPI_Fint) - MPI_Op MPI_Op_f2c (MPI_Fint) - MPI_Info MPI_Info_f2c (MPI_Fint) - MPI_Group MPI_Group_f2c (MPI_Fint) - MPI_Comm MPI_Comm_f2c (MPI_Fint) - MPI_Win MPI_Win_f2c (MPI_Fint) - MPI_File MPI_File_f2c (MPI_Fint) - MPI_Errhandler MPI_Errhandler_f2c (MPI_Fint) - - #----------------------------------------------------------------- +include "mpi4py/libmpi.pxd" diff --git a/src/include/mpi4py/mpi_c.pxd b/src/include/mpi4py/mpi_c.pxd index ce4905c..39a60d5 100644 --- a/src/include/mpi4py/mpi_c.pxd +++ b/src/include/mpi4py/mpi_c.pxd @@ -1,4 +1,4 @@ # Author: Lisandro Dalcin # Contact: dalcinl@gmail.com -include "mpi4py/mpi.pxi" +from mpi4py.libmpi cimport * diff --git a/src/libmpi.pxd b/src/libmpi.pxd new file mode 100644 index 0000000..aba5d48 --- /dev/null +++ b/src/libmpi.pxd @@ -0,0 +1,4 @@ +# Author: Lisandro Dalcin +# Contact: dalcinl@gmail.com + +include "include/mpi4py/libmpi.pxd" diff --git a/src/mpi_c.pxd b/src/mpi_c.pxd index 6498a65..7c9163f 100644 --- a/src/mpi_c.pxd +++ b/src/mpi_c.pxd @@ -1,4 +1,4 @@ # Author: Lisandro Dalcin # Contact: dalcinl@gmail.com -include "include/mpi4py/mpi.pxi" +include "include/mpi4py/mpi_c.pxd" From 44492143d7b7b442e2a8f5fcb7178d54728bdc22 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sat, 4 May 2013 11:34:07 +0300 Subject: [PATCH 39/56] Remove MPE from the __all__ list --- src/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/__init__.py b/src/__init__.py index c03e2fa..116f2ab 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -30,7 +30,7 @@ # -------------------------------------------------------------------- -__all__ = ['MPI', 'MPE'] +__all__ = ['MPI'] # -------------------------------------------------------------------- From 7b5c7966d36dc8c5be0260a4863f5a8abd3639cc Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sat, 4 May 2013 17:28:32 +0300 Subject: [PATCH 40/56] Rename macros PyMPI_MISSING_XXX -> PyMPI_HAVE_XXX --- conf/__init__.py | 2 + conf/mpiscanner.py | 14 +- demo/cython/mpi-compat.h | 2 +- demo/wrap-cython/mpi-compat.h | 2 +- misc/fakempi/mpi.h | 2 - setup.py | 1 + src/atimport.h | 18 +- src/compat/mpich1.h | 2 +- src/compat/mpich3.h | 4 +- src/compat/openmpi.h | 6 +- src/config/mpi-11.h | 260 +++++++ src/config/mpi-12.h | 8 +- src/config/mpi-20.h | 648 ++++++++-------- src/config/mpi-22.h | 74 +- src/config/mpi-30.h | 228 +++--- src/config/mpich2-io.h | 190 ++--- src/config/mpich2.h | 229 +++--- src/config/mpich3-io.h | 160 ++-- src/config/mpich3.h | 14 +- src/config/openmpi-io.h | 190 ++--- src/config/openmpi.h | 142 ++-- src/config/unknown.h | 290 +------ src/fallback.h | 68 +- src/include/mpi4py/mpi4py.h | 2 +- src/missing.h | 1382 ++++++++++++++++----------------- 25 files changed, 1974 insertions(+), 1964 deletions(-) create mode 100644 src/config/mpi-11.h diff --git a/conf/__init__.py b/conf/__init__.py index e69de29..cabf349 100644 --- a/conf/__init__.py +++ b/conf/__init__.py @@ -0,0 +1,2 @@ +# Author: Lisandro Dalcin +# Contact: dalcinl@gmail.com diff --git a/conf/mpiscanner.py b/conf/mpiscanner.py index 2c18842..3fb1a9a 100644 --- a/conf/mpiscanner.py +++ b/conf/mpiscanner.py @@ -24,7 +24,7 @@ def match(self, line): HEADER = None HEADER_HEAD = """\ - #ifdef PyMPI_MISSING_%(name)s + #ifndef PyMPI_HAVE_%(name)s #undef %(cname)s """ HEADER_TAIL = """ @@ -253,7 +253,7 @@ def itertests(self): #define PyMPI_CONFIG_H """ - CONFIG_MACRO = '#define PyMPI_MISSING_%s 1\n' + CONFIG_MACRO = 'PyMPI_HAVE_%s' CONFIG_TAIL = """\ #endif /* !PyMPI_CONFIG_H */ @@ -270,12 +270,16 @@ def dump_config_h(self, fileobj, suite): fileobj.write(head) if suite is None: for node in self: - fileobj.write(macro % node.name) + line = "#undef %s\n" % ((macro % node.name)) + fileobj.write(line) else: for name, result in suite: assert name in self.nodemap - if not result: - fileobj.write(macro % name) + if result: + line = "#define %s 1\n" % ((macro % name)) + else: + line = "#undef %s\n" % ((macro % name)) + fileobj.write(line) fileobj.write(tail) MISSING_HEAD = """\ diff --git a/demo/cython/mpi-compat.h b/demo/cython/mpi-compat.h index 2ce4753..367c58a 100644 --- a/demo/cython/mpi-compat.h +++ b/demo/cython/mpi-compat.h @@ -6,7 +6,7 @@ #include -#if (MPI_VERSION < 3) && !defined(_MPI4PY_HAVE_MPI_MESSAGE) +#if (MPI_VERSION < 3) && !defined(PyMPI_HAVE_MPI_Message) typedef void *PyMPI_MPI_Message; #define MPI_Message PyMPI_MPI_Message #endif diff --git a/demo/wrap-cython/mpi-compat.h b/demo/wrap-cython/mpi-compat.h index 2ce4753..367c58a 100644 --- a/demo/wrap-cython/mpi-compat.h +++ b/demo/wrap-cython/mpi-compat.h @@ -6,7 +6,7 @@ #include -#if (MPI_VERSION < 3) && !defined(_MPI4PY_HAVE_MPI_MESSAGE) +#if (MPI_VERSION < 3) && !defined(PyMPI_HAVE_MPI_Message) typedef void *PyMPI_MPI_Message; #define MPI_Message PyMPI_MPI_Message #endif diff --git a/misc/fakempi/mpi.h b/misc/fakempi/mpi.h index db17fc6..069b333 100644 --- a/misc/fakempi/mpi.h +++ b/misc/fakempi/mpi.h @@ -5,8 +5,6 @@ #warning Using a fake "mpi.h" include file, just for testing!!! #endif -#define PyMPI_MISSING_MPI 1 - #define MPI_Init(a,b) 0 #define MPI_Finalize() 0 #define MPI_Initialized(a) ((*(a)=1),0) diff --git a/setup.py b/setup.py index e7ce6b0..bf24e7c 100644 --- a/setup.py +++ b/setup.py @@ -185,6 +185,7 @@ def configure_mpi(ext, config_cmd): "Check your configuration!!!") ok = config_cmd.check_header("mpi.h", headers=["stdlib.h"]) if not ok: raise DistutilsPlatformError(errmsg) + # headers = ["stdlib.h", "mpi.h"] ConfigTest = dedent("""\ int main(int argc, char **argv) diff --git a/src/atimport.h b/src/atimport.h index 8a4a85c..f1b0a3c 100644 --- a/src/atimport.h +++ b/src/atimport.h @@ -45,6 +45,16 @@ #include "config/unknown.h" #endif +#ifdef PyMPI_MISSING_MPI_Type_create_f90_integer +#undef PyMPI_HAVE_MPI_Type_create_f90_integer +#endif +#ifdef PyMPI_MISSING_MPI_Type_create_f90_real +#undef PyMPI_HAVE_MPI_Type_create_f90_real +#endif +#ifdef PyMPI_MISSING_MPI_Type_create_f90_complex +#undef PyMPI_HAVE_MPI_Type_create_f90_complex +#endif + /* XXX describe */ #include "missing.h" #include "fallback.h" @@ -167,11 +177,11 @@ PyMPI_AtExitMPI(PyMPI_UNUSED MPI_Comm comm, /* ------------------------------------------------------------------------- */ #if !defined(PyMPI_USE_MATCHED_RECV) - #if defined(PyMPI_MISSING_MPI_Mprobe) || \ - defined(PyMPI_MISSING_MPI_Mrecv) - #define PyMPI_USE_MATCHED_RECV 0 - #else + #if defined(PyMPI_HAVE_MPI_Mprobe) && \ + defined(PyMPI_HAVE_MPI_Mrecv) #define PyMPI_USE_MATCHED_RECV 1 + #else + #define PyMPI_USE_MATCHED_RECV 0 #endif #endif #if !defined(PyMPI_USE_MATCHED_RECV) diff --git a/src/compat/mpich1.h b/src/compat/mpich1.h index 7b199ff..be46fce 100644 --- a/src/compat/mpich1.h +++ b/src/compat/mpich1.h @@ -99,7 +99,7 @@ struct MPIR_Errhandler { MPI_Handler_function *routine; int ref_count; }; -void *MPIR_ToPointer(int); +extern void *MPIR_ToPointer(int); #if defined(__cplusplus) } diff --git a/src/compat/mpich3.h b/src/compat/mpich3.h index e299bb0..e5f658a 100644 --- a/src/compat/mpich3.h +++ b/src/compat/mpich3.h @@ -1,7 +1,8 @@ #ifndef PyMPI_COMPAT_MPICH3_H #define PyMPI_COMPAT_MPICH3_H -#if defined(MPICH_NUMVERSION) && (MPICH_NUMVERSION < 30100000) +#if defined(MPICH_NUMVERSION) +#if (MPICH_NUMVERSION < 30100000) static int PyMPI_MPICH3_MPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size) { @@ -24,6 +25,7 @@ static int PyMPI_MPICH3_MPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Co } #define MPI_Type_get_true_extent_x PyMPI_MPICH3_MPI_Type_get_true_extent_x +#endif #endif #endif /* !PyMPI_COMPAT_MPICH3_H */ diff --git a/src/compat/openmpi.h b/src/compat/openmpi.h index 36024f8..e06f24e 100644 --- a/src/compat/openmpi.h +++ b/src/compat/openmpi.h @@ -49,7 +49,7 @@ static void * my_dlopen(const char *name, int mode) { #define dlopen my_dlopen */ -static void OPENMPI_dlopen_libmpi(void) +static void PyMPI_OPENMPI_dlopen_libmpi(void) { void *handle = 0; int mode = RTLD_NOW | RTLD_GLOBAL; @@ -78,7 +78,7 @@ static void OPENMPI_dlopen_libmpi(void) static int PyMPI_OPENMPI_MPI_Init(int *argc, char ***argv) { - OPENMPI_dlopen_libmpi(); + PyMPI_OPENMPI_dlopen_libmpi(); return MPI_Init(argc, argv); } #undef MPI_Init @@ -87,7 +87,7 @@ static int PyMPI_OPENMPI_MPI_Init(int *argc, char ***argv) static int PyMPI_OPENMPI_MPI_Init_thread(int *argc, char ***argv, int required, int *provided) { - OPENMPI_dlopen_libmpi(); + PyMPI_OPENMPI_dlopen_libmpi(); return MPI_Init_thread(argc, argv, required, provided); } #undef MPI_Init_thread diff --git a/src/config/mpi-11.h b/src/config/mpi-11.h new file mode 100644 index 0000000..246d4eb --- /dev/null +++ b/src/config/mpi-11.h @@ -0,0 +1,260 @@ +#define PyMPI_HAVE_MPI_UNDEFINED 1 +#define PyMPI_HAVE_MPI_ANY_SOURCE 1 +#define PyMPI_HAVE_MPI_ANY_TAG 1 +#define PyMPI_HAVE_MPI_PROC_NULL 1 + +#define PyMPI_HAVE_MPI_Aint 1 +#define PyMPI_HAVE_MPI_Datatype 1 +#define PyMPI_HAVE_MPI_DATATYPE_NULL 1 +#define PyMPI_HAVE_MPI_UB 1 +#define PyMPI_HAVE_MPI_LB 1 +#define PyMPI_HAVE_MPI_PACKED 1 +#define PyMPI_HAVE_MPI_BYTE 1 +#define PyMPI_HAVE_MPI_CHAR 1 +#define PyMPI_HAVE_MPI_SHORT 1 +#define PyMPI_HAVE_MPI_INT 1 +#define PyMPI_HAVE_MPI_LONG 1 +#define PyMPI_HAVE_MPI_LONG_LONG_INT 1 +#define PyMPI_HAVE_MPI_UNSIGNED_CHAR 1 +#define PyMPI_HAVE_MPI_UNSIGNED_SHORT 1 +#define PyMPI_HAVE_MPI_UNSIGNED 1 +#define PyMPI_HAVE_MPI_UNSIGNED_LONG 1 +#define PyMPI_HAVE_MPI_FLOAT 1 +#define PyMPI_HAVE_MPI_DOUBLE 1 +#define PyMPI_HAVE_MPI_LONG_DOUBLE 1 +#define PyMPI_HAVE_MPI_SHORT_INT 1 +#define PyMPI_HAVE_MPI_2INT 1 +#define PyMPI_HAVE_MPI_LONG_INT 1 +#define PyMPI_HAVE_MPI_FLOAT_INT 1 +#define PyMPI_HAVE_MPI_DOUBLE_INT 1 +#define PyMPI_HAVE_MPI_LONG_DOUBLE_INT 1 + +#define PyMPI_HAVE_MPI_CHARACTER 1 +#define PyMPI_HAVE_MPI_LOGICAL 1 +#define PyMPI_HAVE_MPI_INTEGER 1 +#define PyMPI_HAVE_MPI_REAL 1 +#define PyMPI_HAVE_MPI_DOUBLE_PRECISION 1 +#define PyMPI_HAVE_MPI_COMPLEX 1 +#define PyMPI_HAVE_MPI_DOUBLE_COMPLEX 1 +#define PyMPI_HAVE_MPI_INTEGER1 1 +#define PyMPI_HAVE_MPI_INTEGER2 1 +#define PyMPI_HAVE_MPI_INTEGER4 1 +#define PyMPI_HAVE_MPI_REAL2 1 +#define PyMPI_HAVE_MPI_REAL4 1 +#define PyMPI_HAVE_MPI_REAL8 1 + +#define PyMPI_HAVE_MPI_BOTTOM 1 +#define PyMPI_HAVE_MPI_Address 1 +#define PyMPI_HAVE_MPI_Type_size 1 +#define PyMPI_HAVE_MPI_Type_extent 1 +#define PyMPI_HAVE_MPI_Type_lb 1 +#define PyMPI_HAVE_MPI_Type_ub 1 +#define PyMPI_HAVE_MPI_Type_dup 1 +#define PyMPI_HAVE_MPI_Type_contiguous 1 +#define PyMPI_HAVE_MPI_Type_vector 1 +#define PyMPI_HAVE_MPI_Type_indexed 1 +#define PyMPI_HAVE_MPI_Type_hvector 1 +#define PyMPI_HAVE_MPI_Type_hindexed 1 +#define PyMPI_HAVE_MPI_Type_struct 1 +#define PyMPI_HAVE_MPI_Type_commit 1 +#define PyMPI_HAVE_MPI_Type_free 1 +#define PyMPI_HAVE_MPI_Pack 1 +#define PyMPI_HAVE_MPI_Unpack 1 +#define PyMPI_HAVE_MPI_Pack_size 1 + +#define PyMPI_HAVE_MPI_Status 1 +#define PyMPI_HAVE_MPI_Get_count 1 +#define PyMPI_HAVE_MPI_Get_elements 1 +#define PyMPI_HAVE_MPI_Test_cancelled 1 + +#define PyMPI_HAVE_MPI_Request 1 +#define PyMPI_HAVE_MPI_REQUEST_NULL 1 +#define PyMPI_HAVE_MPI_Request_free 1 +#define PyMPI_HAVE_MPI_Wait 1 +#define PyMPI_HAVE_MPI_Test 1 +#define PyMPI_HAVE_MPI_Request_get_status 1 +#define PyMPI_HAVE_MPI_Cancel 1 +#define PyMPI_HAVE_MPI_Waitany 1 +#define PyMPI_HAVE_MPI_Testany 1 +#define PyMPI_HAVE_MPI_Waitall 1 +#define PyMPI_HAVE_MPI_Testall 1 +#define PyMPI_HAVE_MPI_Waitsome 1 +#define PyMPI_HAVE_MPI_Testsome 1 +#define PyMPI_HAVE_MPI_Start 1 +#define PyMPI_HAVE_MPI_Startall 1 + +#define PyMPI_HAVE_MPI_Op 1 +#define PyMPI_HAVE_MPI_OP_NULL 1 +#define PyMPI_HAVE_MPI_MAX 1 +#define PyMPI_HAVE_MPI_MIN 1 +#define PyMPI_HAVE_MPI_SUM 1 +#define PyMPI_HAVE_MPI_PROD 1 +#define PyMPI_HAVE_MPI_LAND 1 +#define PyMPI_HAVE_MPI_BAND 1 +#define PyMPI_HAVE_MPI_LOR 1 +#define PyMPI_HAVE_MPI_BOR 1 +#define PyMPI_HAVE_MPI_LXOR 1 +#define PyMPI_HAVE_MPI_BXOR 1 +#define PyMPI_HAVE_MPI_MAXLOC 1 +#define PyMPI_HAVE_MPI_MINLOC 1 +#define PyMPI_HAVE_MPI_REPLACE 1 +#define PyMPI_HAVE_MPI_Op_free 1 +#define PyMPI_HAVE_MPI_User_function 1 +#define PyMPI_HAVE_MPI_Op_create 1 + +#define PyMPI_HAVE_MPI_Group 1 +#define PyMPI_HAVE_MPI_GROUP_NULL 1 +#define PyMPI_HAVE_MPI_GROUP_EMPTY 1 +#define PyMPI_HAVE_MPI_Group_free 1 +#define PyMPI_HAVE_MPI_Group_size 1 +#define PyMPI_HAVE_MPI_Group_rank 1 +#define PyMPI_HAVE_MPI_Group_translate_ranks 1 +#define PyMPI_HAVE_MPI_IDENT 1 +#define PyMPI_HAVE_MPI_CONGRUENT 1 +#define PyMPI_HAVE_MPI_SIMILAR 1 +#define PyMPI_HAVE_MPI_UNEQUAL 1 + +#define PyMPI_HAVE_MPI_Group_compare 1 +#define PyMPI_HAVE_MPI_Group_union 1 +#define PyMPI_HAVE_MPI_Group_intersection 1 +#define PyMPI_HAVE_MPI_Group_difference 1 +#define PyMPI_HAVE_MPI_Group_incl 1 +#define PyMPI_HAVE_MPI_Group_excl 1 +#define PyMPI_HAVE_MPI_Group_range_incl 1 +#define PyMPI_HAVE_MPI_Group_range_excl 1 + +#define PyMPI_HAVE_MPI_Comm 1 +#define PyMPI_HAVE_MPI_COMM_NULL 1 +#define PyMPI_HAVE_MPI_COMM_SELF 1 +#define PyMPI_HAVE_MPI_COMM_WORLD 1 +#define PyMPI_HAVE_MPI_Comm_free 1 +#define PyMPI_HAVE_MPI_Comm_group 1 +#define PyMPI_HAVE_MPI_Comm_size 1 +#define PyMPI_HAVE_MPI_Comm_rank 1 +#define PyMPI_HAVE_MPI_Comm_compare 1 +#define PyMPI_HAVE_MPI_Topo_test 1 +#define PyMPI_HAVE_MPI_Comm_test_inter 1 +#define PyMPI_HAVE_MPI_Abort 1 +#define PyMPI_HAVE_MPI_Send 1 +#define PyMPI_HAVE_MPI_Recv 1 +#define PyMPI_HAVE_MPI_Sendrecv 1 +#define PyMPI_HAVE_MPI_Sendrecv_replace 1 +#define PyMPI_HAVE_MPI_BSEND_OVERHEAD 1 +#define PyMPI_HAVE_MPI_Buffer_attach 1 +#define PyMPI_HAVE_MPI_Buffer_detach 1 +#define PyMPI_HAVE_MPI_Bsend 1 +#define PyMPI_HAVE_MPI_Ssend 1 +#define PyMPI_HAVE_MPI_Rsend 1 +#define PyMPI_HAVE_MPI_Isend 1 +#define PyMPI_HAVE_MPI_Ibsend 1 +#define PyMPI_HAVE_MPI_Issend 1 +#define PyMPI_HAVE_MPI_Irsend 1 +#define PyMPI_HAVE_MPI_Irecv 1 +#define PyMPI_HAVE_MPI_Send_init 1 +#define PyMPI_HAVE_MPI_Bsend_init 1 +#define PyMPI_HAVE_MPI_Ssend_init 1 +#define PyMPI_HAVE_MPI_Rsend_init 1 +#define PyMPI_HAVE_MPI_Recv_init 1 +#define PyMPI_HAVE_MPI_Probe 1 +#define PyMPI_HAVE_MPI_Iprobe 1 +#define PyMPI_HAVE_MPI_Barrier 1 +#define PyMPI_HAVE_MPI_Bcast 1 +#define PyMPI_HAVE_MPI_Gather 1 +#define PyMPI_HAVE_MPI_Gatherv 1 +#define PyMPI_HAVE_MPI_Scatter 1 +#define PyMPI_HAVE_MPI_Scatterv 1 +#define PyMPI_HAVE_MPI_Allgather 1 +#define PyMPI_HAVE_MPI_Allgatherv 1 +#define PyMPI_HAVE_MPI_Alltoall 1 +#define PyMPI_HAVE_MPI_Alltoallv 1 +#define PyMPI_HAVE_MPI_Reduce 1 +#define PyMPI_HAVE_MPI_Allreduce 1 +#define PyMPI_HAVE_MPI_Reduce_scatter 1 +#define PyMPI_HAVE_MPI_Scan 1 +#define PyMPI_HAVE_MPI_Comm_dup 1 +#define PyMPI_HAVE_MPI_Comm_create 1 +#define PyMPI_HAVE_MPI_Comm_split 1 +#define PyMPI_HAVE_MPI_CART 1 +#define PyMPI_HAVE_MPI_Cart_create 1 +#define PyMPI_HAVE_MPI_Cartdim_get 1 +#define PyMPI_HAVE_MPI_Cart_get 1 +#define PyMPI_HAVE_MPI_Cart_rank 1 +#define PyMPI_HAVE_MPI_Cart_coords 1 +#define PyMPI_HAVE_MPI_Cart_shift 1 +#define PyMPI_HAVE_MPI_Cart_sub 1 +#define PyMPI_HAVE_MPI_Cart_map 1 +#define PyMPI_HAVE_MPI_Dims_create 1 +#define PyMPI_HAVE_MPI_GRAPH 1 +#define PyMPI_HAVE_MPI_Graph_create 1 +#define PyMPI_HAVE_MPI_Graphdims_get 1 +#define PyMPI_HAVE_MPI_Graph_get 1 +#define PyMPI_HAVE_MPI_Graph_map 1 +#define PyMPI_HAVE_MPI_Graph_neighbors_count 1 +#define PyMPI_HAVE_MPI_Graph_neighbors 1 +#define PyMPI_HAVE_MPI_Intercomm_create 1 +#define PyMPI_HAVE_MPI_Comm_remote_group 1 +#define PyMPI_HAVE_MPI_Comm_remote_size 1 +#define PyMPI_HAVE_MPI_Intercomm_merge 1 +#define PyMPI_HAVE_MPI_Errhandler_get 1 +#define PyMPI_HAVE_MPI_Errhandler_set 1 +#define PyMPI_HAVE_MPI_Handler_function 1 +#define PyMPI_HAVE_MPI_Errhandler_create 1 + +#define PyMPI_HAVE_MPI_Init 1 +#define PyMPI_HAVE_MPI_Finalize 1 +#define PyMPI_HAVE_MPI_Initialized 1 +#define PyMPI_HAVE_MPI_Finalized 1 + +#define PyMPI_HAVE_MPI_MAX_PROCESSOR_NAME 1 +#define PyMPI_HAVE_MPI_Get_processor_name 1 +#define PyMPI_HAVE_MPI_Wtime 1 +#define PyMPI_HAVE_MPI_Wtick 1 +#define PyMPI_HAVE_MPI_Pcontrol 1 + +#define PyMPI_HAVE_MPI_Errhandler 1 +#define PyMPI_HAVE_MPI_ERRHANDLER_NULL 1 +#define PyMPI_HAVE_MPI_ERRORS_RETURN 1 +#define PyMPI_HAVE_MPI_ERRORS_ARE_FATAL 1 +#define PyMPI_HAVE_MPI_Errhandler_free 1 + +#define PyMPI_HAVE_MPI_KEYVAL_INVALID 1 +#define PyMPI_HAVE_MPI_TAG_UB 1 +#define PyMPI_HAVE_MPI_HOST 1 +#define PyMPI_HAVE_MPI_IO 1 +#define PyMPI_HAVE_MPI_WTIME_IS_GLOBAL 1 +#define PyMPI_HAVE_MPI_Attr_get 1 +#define PyMPI_HAVE_MPI_Attr_put 1 +#define PyMPI_HAVE_MPI_Attr_delete 1 +#define PyMPI_HAVE_MPI_Copy_function 1 +#define PyMPI_HAVE_MPI_Delete_function 1 +#define PyMPI_HAVE_MPI_DUP_FN 1 +#define PyMPI_HAVE_MPI_NULL_COPY_FN 1 +#define PyMPI_HAVE_MPI_NULL_DELETE_FN 1 +#define PyMPI_HAVE_MPI_Keyval_create 1 +#define PyMPI_HAVE_MPI_Keyval_free 1 + +#define PyMPI_HAVE_MPI_SUCCESS 1 +#define PyMPI_HAVE_MPI_ERR_LASTCODE 1 +#define PyMPI_HAVE_MPI_ERR_COMM 1 +#define PyMPI_HAVE_MPI_ERR_GROUP 1 +#define PyMPI_HAVE_MPI_ERR_TYPE 1 +#define PyMPI_HAVE_MPI_ERR_REQUEST 1 +#define PyMPI_HAVE_MPI_ERR_OP 1 +#define PyMPI_HAVE_MPI_ERR_BUFFER 1 +#define PyMPI_HAVE_MPI_ERR_COUNT 1 +#define PyMPI_HAVE_MPI_ERR_TAG 1 +#define PyMPI_HAVE_MPI_ERR_RANK 1 +#define PyMPI_HAVE_MPI_ERR_ROOT 1 +#define PyMPI_HAVE_MPI_ERR_TRUNCATE 1 +#define PyMPI_HAVE_MPI_ERR_IN_STATUS 1 +#define PyMPI_HAVE_MPI_ERR_PENDING 1 +#define PyMPI_HAVE_MPI_ERR_TOPOLOGY 1 +#define PyMPI_HAVE_MPI_ERR_DIMS 1 +#define PyMPI_HAVE_MPI_ERR_ARG 1 +#define PyMPI_HAVE_MPI_ERR_OTHER 1 +#define PyMPI_HAVE_MPI_ERR_UNKNOWN 1 +#define PyMPI_HAVE_MPI_ERR_INTERN 1 + +#define PyMPI_HAVE_MPI_MAX_ERROR_STRING 1 +#define PyMPI_HAVE_MPI_Error_class 1 +#define PyMPI_HAVE_MPI_Error_string 1 diff --git a/src/config/mpi-12.h b/src/config/mpi-12.h index d361178..297f947 100644 --- a/src/config/mpi-12.h +++ b/src/config/mpi-12.h @@ -1,5 +1,5 @@ -#if !defined(MPI_VERSION) -#define PyMPI_MISSING_MPI_VERSION 1 -#define PyMPI_MISSING_MPI_SUBVERSION 1 -#define PyMPI_MISSING_MPI_Get_version 1 +#if defined(MPI_VERSION) +#define PyMPI_HAVE_MPI_VERSION 1 +#define PyMPI_HAVE_MPI_SUBVERSION 1 +#define PyMPI_HAVE_MPI_Get_version 1 #endif diff --git a/src/config/mpi-20.h b/src/config/mpi-20.h index 278a98a..ea1106f 100644 --- a/src/config/mpi-20.h +++ b/src/config/mpi-20.h @@ -1,340 +1,342 @@ -#if !defined(MPI_VERSION) || (MPI_VERSION < 2) +#if defined(MPI_VERSION) +#if (MPI_VERSION >= 2) -#define PyMPI_MISSING_MPI_ERR_KEYVAL 1 -#define PyMPI_MISSING_MPI_MAX_OBJECT_NAME 1 +#define PyMPI_HAVE_MPI_ERR_KEYVAL 1 +#define PyMPI_HAVE_MPI_MAX_OBJECT_NAME 1 -#define PyMPI_MISSING_MPI_WCHAR 1 -#define PyMPI_MISSING_MPI_SIGNED_CHAR 1 -#define PyMPI_MISSING_MPI_LONG_LONG 1 -#define PyMPI_MISSING_MPI_UNSIGNED_LONG_LONG 1 +#define PyMPI_HAVE_MPI_WCHAR 1 +#define PyMPI_HAVE_MPI_SIGNED_CHAR 1 +#define PyMPI_HAVE_MPI_LONG_LONG 1 +#define PyMPI_HAVE_MPI_UNSIGNED_LONG_LONG 1 -#define PyMPI_MISSING_MPI_Type_dup 1 -#define PyMPI_MISSING_MPI_Type_create_indexed_block 1 -#define PyMPI_MISSING_MPI_ORDER_C 1 -#define PyMPI_MISSING_MPI_ORDER_FORTRAN 1 -#define PyMPI_MISSING_MPI_Type_create_subarray 1 -#define PyMPI_MISSING_MPI_DISTRIBUTE_NONE 1 -#define PyMPI_MISSING_MPI_DISTRIBUTE_BLOCK 1 -#define PyMPI_MISSING_MPI_DISTRIBUTE_CYCLIC 1 -#define PyMPI_MISSING_MPI_DISTRIBUTE_DFLT_DARG 1 -#define PyMPI_MISSING_MPI_Type_create_darray 1 -#define PyMPI_MISSING_MPI_Get_address 1 -#define PyMPI_MISSING_MPI_Type_create_hvector 1 -#define PyMPI_MISSING_MPI_Type_create_hindexed 1 -#define PyMPI_MISSING_MPI_Type_create_struct 1 -#define PyMPI_MISSING_MPI_Type_get_extent 1 -#define PyMPI_MISSING_MPI_Type_create_resized 1 -#define PyMPI_MISSING_MPI_Type_get_true_extent 1 -#define PyMPI_MISSING_MPI_Type_create_f90_integer 1 -#define PyMPI_MISSING_MPI_Type_create_f90_real 1 -#define PyMPI_MISSING_MPI_Type_create_f90_complex 1 -#define PyMPI_MISSING_MPI_TYPECLASS_INTEGER 1 -#define PyMPI_MISSING_MPI_TYPECLASS_REAL 1 -#define PyMPI_MISSING_MPI_TYPECLASS_COMPLEX 1 -#define PyMPI_MISSING_MPI_Type_match_size 1 -#define PyMPI_MISSING_MPI_Pack_external 1 -#define PyMPI_MISSING_MPI_Unpack_external 1 -#define PyMPI_MISSING_MPI_Pack_external_size 1 -#define PyMPI_MISSING_MPI_COMBINER_NAMED 1 -#define PyMPI_MISSING_MPI_COMBINER_DUP 1 -#define PyMPI_MISSING_MPI_COMBINER_CONTIGUOUS 1 -#define PyMPI_MISSING_MPI_COMBINER_VECTOR 1 -#define PyMPI_MISSING_MPI_COMBINER_HVECTOR_INTEGER 1 -#define PyMPI_MISSING_MPI_COMBINER_HVECTOR 1 -#define PyMPI_MISSING_MPI_COMBINER_INDEXED 1 -#define PyMPI_MISSING_MPI_COMBINER_HINDEXED_INTEGER 1 -#define PyMPI_MISSING_MPI_COMBINER_HINDEXED 1 -#define PyMPI_MISSING_MPI_COMBINER_INDEXED_BLOCK 1 -#define PyMPI_MISSING_MPI_COMBINER_STRUCT_INTEGER 1 -#define PyMPI_MISSING_MPI_COMBINER_STRUCT 1 -#define PyMPI_MISSING_MPI_COMBINER_SUBARRAY 1 -#define PyMPI_MISSING_MPI_COMBINER_DARRAY 1 -#define PyMPI_MISSING_MPI_COMBINER_F90_REAL 1 -#define PyMPI_MISSING_MPI_COMBINER_F90_COMPLEX 1 -#define PyMPI_MISSING_MPI_COMBINER_F90_INTEGER 1 -#define PyMPI_MISSING_MPI_COMBINER_RESIZED 1 -#define PyMPI_MISSING_MPI_Type_get_envelope 1 -#define PyMPI_MISSING_MPI_Type_get_contents 1 -#define PyMPI_MISSING_MPI_Type_get_name 1 -#define PyMPI_MISSING_MPI_Type_set_name 1 -#define PyMPI_MISSING_MPI_Type_get_attr 1 -#define PyMPI_MISSING_MPI_Type_set_attr 1 -#define PyMPI_MISSING_MPI_Type_delete_attr 1 -#define PyMPI_MISSING_MPI_Type_copy_attr_function 1 -#define PyMPI_MISSING_MPI_Type_delete_attr_function 1 -#define PyMPI_MISSING_MPI_TYPE_NULL_COPY_FN 1 -#define PyMPI_MISSING_MPI_TYPE_DUP_FN 1 -#define PyMPI_MISSING_MPI_TYPE_NULL_DELETE_FN 1 -#define PyMPI_MISSING_MPI_Type_create_keyval 1 -#define PyMPI_MISSING_MPI_Type_free_keyval 1 +#define PyMPI_HAVE_MPI_Type_dup 1 +#define PyMPI_HAVE_MPI_Type_create_indexed_block 1 +#define PyMPI_HAVE_MPI_ORDER_C 1 +#define PyMPI_HAVE_MPI_ORDER_FORTRAN 1 +#define PyMPI_HAVE_MPI_Type_create_subarray 1 +#define PyMPI_HAVE_MPI_DISTRIBUTE_NONE 1 +#define PyMPI_HAVE_MPI_DISTRIBUTE_BLOCK 1 +#define PyMPI_HAVE_MPI_DISTRIBUTE_CYCLIC 1 +#define PyMPI_HAVE_MPI_DISTRIBUTE_DFLT_DARG 1 +#define PyMPI_HAVE_MPI_Type_create_darray 1 +#define PyMPI_HAVE_MPI_Get_address 1 +#define PyMPI_HAVE_MPI_Type_create_hvector 1 +#define PyMPI_HAVE_MPI_Type_create_hindexed 1 +#define PyMPI_HAVE_MPI_Type_create_struct 1 +#define PyMPI_HAVE_MPI_Type_get_extent 1 +#define PyMPI_HAVE_MPI_Type_create_resized 1 +#define PyMPI_HAVE_MPI_Type_get_true_extent 1 +#define PyMPI_HAVE_MPI_Type_create_f90_integer 1 +#define PyMPI_HAVE_MPI_Type_create_f90_real 1 +#define PyMPI_HAVE_MPI_Type_create_f90_complex 1 +#define PyMPI_HAVE_MPI_TYPECLASS_INTEGER 1 +#define PyMPI_HAVE_MPI_TYPECLASS_REAL 1 +#define PyMPI_HAVE_MPI_TYPECLASS_COMPLEX 1 +#define PyMPI_HAVE_MPI_Type_match_size 1 +#define PyMPI_HAVE_MPI_Pack_external 1 +#define PyMPI_HAVE_MPI_Unpack_external 1 +#define PyMPI_HAVE_MPI_Pack_external_size 1 +#define PyMPI_HAVE_MPI_COMBINER_NAMED 1 +#define PyMPI_HAVE_MPI_COMBINER_DUP 1 +#define PyMPI_HAVE_MPI_COMBINER_CONTIGUOUS 1 +#define PyMPI_HAVE_MPI_COMBINER_VECTOR 1 +#define PyMPI_HAVE_MPI_COMBINER_HVECTOR_INTEGER 1 +#define PyMPI_HAVE_MPI_COMBINER_HVECTOR 1 +#define PyMPI_HAVE_MPI_COMBINER_INDEXED 1 +#define PyMPI_HAVE_MPI_COMBINER_HINDEXED_INTEGER 1 +#define PyMPI_HAVE_MPI_COMBINER_HINDEXED 1 +#define PyMPI_HAVE_MPI_COMBINER_INDEXED_BLOCK 1 +#define PyMPI_HAVE_MPI_COMBINER_STRUCT_INTEGER 1 +#define PyMPI_HAVE_MPI_COMBINER_STRUCT 1 +#define PyMPI_HAVE_MPI_COMBINER_SUBARRAY 1 +#define PyMPI_HAVE_MPI_COMBINER_DARRAY 1 +#define PyMPI_HAVE_MPI_COMBINER_F90_REAL 1 +#define PyMPI_HAVE_MPI_COMBINER_F90_COMPLEX 1 +#define PyMPI_HAVE_MPI_COMBINER_F90_INTEGER 1 +#define PyMPI_HAVE_MPI_COMBINER_RESIZED 1 +#define PyMPI_HAVE_MPI_Type_get_envelope 1 +#define PyMPI_HAVE_MPI_Type_get_contents 1 +#define PyMPI_HAVE_MPI_Type_get_name 1 +#define PyMPI_HAVE_MPI_Type_set_name 1 +#define PyMPI_HAVE_MPI_Type_get_attr 1 +#define PyMPI_HAVE_MPI_Type_set_attr 1 +#define PyMPI_HAVE_MPI_Type_delete_attr 1 +#define PyMPI_HAVE_MPI_Type_copy_attr_function 1 +#define PyMPI_HAVE_MPI_Type_delete_attr_function 1 +#define PyMPI_HAVE_MPI_TYPE_NULL_COPY_FN 1 +#define PyMPI_HAVE_MPI_TYPE_DUP_FN 1 +#define PyMPI_HAVE_MPI_TYPE_NULL_DELETE_FN 1 +#define PyMPI_HAVE_MPI_Type_create_keyval 1 +#define PyMPI_HAVE_MPI_Type_free_keyval 1 -#define PyMPI_MISSING_MPI_STATUS_IGNORE 1 -#define PyMPI_MISSING_MPI_STATUSES_IGNORE 1 -#define PyMPI_MISSING_MPI_Status_set_elements 1 -#define PyMPI_MISSING_MPI_Status_set_cancelled 1 +#define PyMPI_HAVE_MPI_STATUS_IGNORE 1 +#define PyMPI_HAVE_MPI_STATUSES_IGNORE 1 +#define PyMPI_HAVE_MPI_Status_set_elements 1 +#define PyMPI_HAVE_MPI_Status_set_cancelled 1 -#define PyMPI_MISSING_MPI_Request_get_status 1 -#define PyMPI_MISSING_MPI_Grequest_cancel_function 1 -#define PyMPI_MISSING_MPI_Grequest_free_function 1 -#define PyMPI_MISSING_MPI_Grequest_query_function 1 -#define PyMPI_MISSING_MPI_Grequest_start 1 -#define PyMPI_MISSING_MPI_Grequest_complete 1 +#define PyMPI_HAVE_MPI_Request_get_status 1 +#define PyMPI_HAVE_MPI_Grequest_cancel_function 1 +#define PyMPI_HAVE_MPI_Grequest_free_function 1 +#define PyMPI_HAVE_MPI_Grequest_query_function 1 +#define PyMPI_HAVE_MPI_Grequest_start 1 +#define PyMPI_HAVE_MPI_Grequest_complete 1 -#define PyMPI_MISSING_MPI_ROOT 1 -#define PyMPI_MISSING_MPI_IN_PLACE 1 -#define PyMPI_MISSING_MPI_Alltoallw 1 -#define PyMPI_MISSING_MPI_Exscan 1 +#define PyMPI_HAVE_MPI_ROOT 1 +#define PyMPI_HAVE_MPI_IN_PLACE 1 +#define PyMPI_HAVE_MPI_Alltoallw 1 +#define PyMPI_HAVE_MPI_Exscan 1 -#define PyMPI_MISSING_MPI_Comm_get_errhandler 1 -#define PyMPI_MISSING_MPI_Comm_set_errhandler 1 -#define PyMPI_MISSING_MPI_Comm_errhandler_fn 1 -#define PyMPI_MISSING_MPI_Comm_errhandler_function 1 -#define PyMPI_MISSING_MPI_Comm_create_errhandler 1 -#define PyMPI_MISSING_MPI_Comm_call_errhandler 1 -#define PyMPI_MISSING_MPI_Comm_get_name 1 -#define PyMPI_MISSING_MPI_Comm_set_name 1 +#define PyMPI_HAVE_MPI_Comm_get_errhandler 1 +#define PyMPI_HAVE_MPI_Comm_set_errhandler 1 +#define PyMPI_HAVE_MPI_Comm_errhandler_fn 1 +#define PyMPI_HAVE_MPI_Comm_errhandler_function 1 +#define PyMPI_HAVE_MPI_Comm_create_errhandler 1 +#define PyMPI_HAVE_MPI_Comm_call_errhandler 1 +#define PyMPI_HAVE_MPI_Comm_get_name 1 +#define PyMPI_HAVE_MPI_Comm_set_name 1 -#define PyMPI_MISSING_MPI_Comm_get_attr 1 -#define PyMPI_MISSING_MPI_Comm_set_attr 1 -#define PyMPI_MISSING_MPI_Comm_delete_attr 1 -#define PyMPI_MISSING_MPI_Comm_copy_attr_function 1 -#define PyMPI_MISSING_MPI_Comm_delete_attr_function 1 -#define PyMPI_MISSING_MPI_COMM_DUP_FN 1 -#define PyMPI_MISSING_MPI_COMM_NULL_COPY_FN 1 -#define PyMPI_MISSING_MPI_COMM_NULL_DELETE_FN 1 -#define PyMPI_MISSING_MPI_Comm_create_keyval 1 -#define PyMPI_MISSING_MPI_Comm_free_keyval 1 +#define PyMPI_HAVE_MPI_Comm_get_attr 1 +#define PyMPI_HAVE_MPI_Comm_set_attr 1 +#define PyMPI_HAVE_MPI_Comm_delete_attr 1 +#define PyMPI_HAVE_MPI_Comm_copy_attr_function 1 +#define PyMPI_HAVE_MPI_Comm_delete_attr_function 1 +#define PyMPI_HAVE_MPI_COMM_DUP_FN 1 +#define PyMPI_HAVE_MPI_COMM_NULL_COPY_FN 1 +#define PyMPI_HAVE_MPI_COMM_NULL_DELETE_FN 1 +#define PyMPI_HAVE_MPI_Comm_create_keyval 1 +#define PyMPI_HAVE_MPI_Comm_free_keyval 1 -#define PyMPI_MISSING_MPI_MAX_PORT_NAME 1 -#define PyMPI_MISSING_MPI_Open_port 1 -#define PyMPI_MISSING_MPI_Close_port 1 -#define PyMPI_MISSING_MPI_Publish_name 1 -#define PyMPI_MISSING_MPI_Unpublish_name 1 -#define PyMPI_MISSING_MPI_Lookup_name 1 -#define PyMPI_MISSING_MPI_Comm_accept 1 -#define PyMPI_MISSING_MPI_Comm_connect 1 -#define PyMPI_MISSING_MPI_Comm_join 1 -#define PyMPI_MISSING_MPI_Comm_disconnect 1 -#define PyMPI_MISSING_MPI_ARGV_NULL 1 -#define PyMPI_MISSING_MPI_ARGVS_NULL 1 -#define PyMPI_MISSING_MPI_ERRCODES_IGNORE 1 -#define PyMPI_MISSING_MPI_Comm_spawn 1 -#define PyMPI_MISSING_MPI_Comm_spawn_multiple 1 -#define PyMPI_MISSING_MPI_Comm_get_parent 1 -#define PyMPI_MISSING_MPI_UNIVERSE_SIZE 1 -#define PyMPI_MISSING_MPI_APPNUM 1 -#define PyMPI_MISSING_MPI_ERR_SPAWN 1 -#define PyMPI_MISSING_MPI_ERR_PORT 1 -#define PyMPI_MISSING_MPI_ERR_SERVICE 1 -#define PyMPI_MISSING_MPI_ERR_NAME 1 +#define PyMPI_HAVE_MPI_MAX_PORT_NAME 1 +#define PyMPI_HAVE_MPI_Open_port 1 +#define PyMPI_HAVE_MPI_Close_port 1 +#define PyMPI_HAVE_MPI_Publish_name 1 +#define PyMPI_HAVE_MPI_Unpublish_name 1 +#define PyMPI_HAVE_MPI_Lookup_name 1 +#define PyMPI_HAVE_MPI_Comm_accept 1 +#define PyMPI_HAVE_MPI_Comm_connect 1 +#define PyMPI_HAVE_MPI_Comm_join 1 +#define PyMPI_HAVE_MPI_Comm_disconnect 1 +#define PyMPI_HAVE_MPI_ARGV_NULL 1 +#define PyMPI_HAVE_MPI_ARGVS_NULL 1 +#define PyMPI_HAVE_MPI_ERRCODES_IGNORE 1 +#define PyMPI_HAVE_MPI_Comm_spawn 1 +#define PyMPI_HAVE_MPI_Comm_spawn_multiple 1 +#define PyMPI_HAVE_MPI_Comm_get_parent 1 +#define PyMPI_HAVE_MPI_UNIVERSE_SIZE 1 +#define PyMPI_HAVE_MPI_APPNUM 1 +#define PyMPI_HAVE_MPI_ERR_SPAWN 1 +#define PyMPI_HAVE_MPI_ERR_PORT 1 +#define PyMPI_HAVE_MPI_ERR_SERVICE 1 +#define PyMPI_HAVE_MPI_ERR_NAME 1 -#define PyMPI_MISSING_MPI_Alloc_mem 1 -#define PyMPI_MISSING_MPI_Free_mem 1 -#define PyMPI_MISSING_MPI_ERR_NO_MEM 1 +#define PyMPI_HAVE_MPI_Alloc_mem 1 +#define PyMPI_HAVE_MPI_Free_mem 1 +#define PyMPI_HAVE_MPI_ERR_NO_MEM 1 -#define PyMPI_MISSING_MPI_Info 1 -#define PyMPI_MISSING_MPI_INFO_NULL 1 -#define PyMPI_MISSING_MPI_Info_free 1 -#define PyMPI_MISSING_MPI_Info_create 1 -#define PyMPI_MISSING_MPI_Info_dup 1 -#define PyMPI_MISSING_MPI_MAX_INFO_KEY 1 -#define PyMPI_MISSING_MPI_MAX_INFO_VAL 1 -#define PyMPI_MISSING_MPI_Info_get 1 -#define PyMPI_MISSING_MPI_Info_set 1 -#define PyMPI_MISSING_MPI_Info_delete 1 -#define PyMPI_MISSING_MPI_Info_get_nkeys 1 -#define PyMPI_MISSING_MPI_Info_get_nthkey 1 -#define PyMPI_MISSING_MPI_Info_get_valuelen 1 -#define PyMPI_MISSING_MPI_ERR_INFO 1 -#define PyMPI_MISSING_MPI_ERR_INFO_KEY 1 -#define PyMPI_MISSING_MPI_ERR_INFO_VALUE 1 -#define PyMPI_MISSING_MPI_ERR_INFO_NOKEY 1 +#define PyMPI_HAVE_MPI_Info 1 +#define PyMPI_HAVE_MPI_INFO_NULL 1 +#define PyMPI_HAVE_MPI_Info_free 1 +#define PyMPI_HAVE_MPI_Info_create 1 +#define PyMPI_HAVE_MPI_Info_dup 1 +#define PyMPI_HAVE_MPI_MAX_INFO_KEY 1 +#define PyMPI_HAVE_MPI_MAX_INFO_VAL 1 +#define PyMPI_HAVE_MPI_Info_get 1 +#define PyMPI_HAVE_MPI_Info_set 1 +#define PyMPI_HAVE_MPI_Info_delete 1 +#define PyMPI_HAVE_MPI_Info_get_nkeys 1 +#define PyMPI_HAVE_MPI_Info_get_nthkey 1 +#define PyMPI_HAVE_MPI_Info_get_valuelen 1 +#define PyMPI_HAVE_MPI_ERR_INFO 1 +#define PyMPI_HAVE_MPI_ERR_INFO_KEY 1 +#define PyMPI_HAVE_MPI_ERR_INFO_VALUE 1 +#define PyMPI_HAVE_MPI_ERR_INFO_NOKEY 1 -#define PyMPI_MISSING_MPI_Win 1 -#define PyMPI_MISSING_MPI_WIN_NULL 1 -#define PyMPI_MISSING_MPI_Win_free 1 -#define PyMPI_MISSING_MPI_Win_create 1 -#define PyMPI_MISSING_MPI_Win_get_group 1 -#define PyMPI_MISSING_MPI_Get 1 -#define PyMPI_MISSING_MPI_Put 1 -#define PyMPI_MISSING_MPI_REPLACE 1 -#define PyMPI_MISSING_MPI_Accumulate 1 -#define PyMPI_MISSING_MPI_MODE_NOCHECK 1 -#define PyMPI_MISSING_MPI_MODE_NOSTORE 1 -#define PyMPI_MISSING_MPI_MODE_NOPUT 1 -#define PyMPI_MISSING_MPI_MODE_NOPRECEDE 1 -#define PyMPI_MISSING_MPI_MODE_NOSUCCEED 1 -#define PyMPI_MISSING_MPI_Win_fence 1 -#define PyMPI_MISSING_MPI_Win_post 1 -#define PyMPI_MISSING_MPI_Win_start 1 -#define PyMPI_MISSING_MPI_Win_complete 1 -#define PyMPI_MISSING_MPI_Win_wait 1 -#define PyMPI_MISSING_MPI_Win_test 1 -#define PyMPI_MISSING_MPI_LOCK_EXCLUSIVE 1 -#define PyMPI_MISSING_MPI_LOCK_SHARED 1 -#define PyMPI_MISSING_MPI_Win_lock 1 -#define PyMPI_MISSING_MPI_Win_unlock 1 -#define PyMPI_MISSING_MPI_Win_get_errhandler 1 -#define PyMPI_MISSING_MPI_Win_set_errhandler 1 -#define PyMPI_MISSING_MPI_Win_errhandler_fn 1 -#define PyMPI_MISSING_MPI_Win_errhandler_function 1 -#define PyMPI_MISSING_MPI_Win_create_errhandler 1 -#define PyMPI_MISSING_MPI_Win_call_errhandler 1 -#define PyMPI_MISSING_MPI_Win_get_name 1 -#define PyMPI_MISSING_MPI_Win_set_name 1 -#define PyMPI_MISSING_MPI_WIN_BASE 1 -#define PyMPI_MISSING_MPI_WIN_SIZE 1 -#define PyMPI_MISSING_MPI_WIN_DISP_UNIT 1 -#define PyMPI_MISSING_MPI_Win_get_attr 1 -#define PyMPI_MISSING_MPI_Win_set_attr 1 -#define PyMPI_MISSING_MPI_Win_delete_attr 1 -#define PyMPI_MISSING_MPI_Win_copy_attr_function 1 -#define PyMPI_MISSING_MPI_Win_delete_attr_function 1 -#define PyMPI_MISSING_MPI_WIN_DUP_FN 1 -#define PyMPI_MISSING_MPI_WIN_NULL_COPY_FN 1 -#define PyMPI_MISSING_MPI_WIN_NULL_DELETE_FN 1 -#define PyMPI_MISSING_MPI_Win_create_keyval 1 -#define PyMPI_MISSING_MPI_Win_free_keyval 1 -#define PyMPI_MISSING_MPI_ERR_WIN 1 -#define PyMPI_MISSING_MPI_ERR_BASE 1 -#define PyMPI_MISSING_MPI_ERR_SIZE 1 -#define PyMPI_MISSING_MPI_ERR_DISP 1 -#define PyMPI_MISSING_MPI_ERR_ASSERT 1 -#define PyMPI_MISSING_MPI_ERR_LOCKTYPE 1 -#define PyMPI_MISSING_MPI_ERR_RMA_CONFLICT 1 -#define PyMPI_MISSING_MPI_ERR_RMA_SYNC 1 +#define PyMPI_HAVE_MPI_Win 1 +#define PyMPI_HAVE_MPI_WIN_NULL 1 +#define PyMPI_HAVE_MPI_Win_free 1 +#define PyMPI_HAVE_MPI_Win_create 1 +#define PyMPI_HAVE_MPI_Win_get_group 1 +#define PyMPI_HAVE_MPI_Get 1 +#define PyMPI_HAVE_MPI_Put 1 +#define PyMPI_HAVE_MPI_REPLACE 1 +#define PyMPI_HAVE_MPI_Accumulate 1 +#define PyMPI_HAVE_MPI_MODE_NOCHECK 1 +#define PyMPI_HAVE_MPI_MODE_NOSTORE 1 +#define PyMPI_HAVE_MPI_MODE_NOPUT 1 +#define PyMPI_HAVE_MPI_MODE_NOPRECEDE 1 +#define PyMPI_HAVE_MPI_MODE_NOSUCCEED 1 +#define PyMPI_HAVE_MPI_Win_fence 1 +#define PyMPI_HAVE_MPI_Win_post 1 +#define PyMPI_HAVE_MPI_Win_start 1 +#define PyMPI_HAVE_MPI_Win_complete 1 +#define PyMPI_HAVE_MPI_Win_wait 1 +#define PyMPI_HAVE_MPI_Win_test 1 +#define PyMPI_HAVE_MPI_LOCK_EXCLUSIVE 1 +#define PyMPI_HAVE_MPI_LOCK_SHARED 1 +#define PyMPI_HAVE_MPI_Win_lock 1 +#define PyMPI_HAVE_MPI_Win_unlock 1 +#define PyMPI_HAVE_MPI_Win_get_errhandler 1 +#define PyMPI_HAVE_MPI_Win_set_errhandler 1 +#define PyMPI_HAVE_MPI_Win_errhandler_fn 1 +#define PyMPI_HAVE_MPI_Win_errhandler_function 1 +#define PyMPI_HAVE_MPI_Win_create_errhandler 1 +#define PyMPI_HAVE_MPI_Win_call_errhandler 1 +#define PyMPI_HAVE_MPI_Win_get_name 1 +#define PyMPI_HAVE_MPI_Win_set_name 1 +#define PyMPI_HAVE_MPI_WIN_BASE 1 +#define PyMPI_HAVE_MPI_WIN_SIZE 1 +#define PyMPI_HAVE_MPI_WIN_DISP_UNIT 1 +#define PyMPI_HAVE_MPI_Win_get_attr 1 +#define PyMPI_HAVE_MPI_Win_set_attr 1 +#define PyMPI_HAVE_MPI_Win_delete_attr 1 +#define PyMPI_HAVE_MPI_Win_copy_attr_function 1 +#define PyMPI_HAVE_MPI_Win_delete_attr_function 1 +#define PyMPI_HAVE_MPI_WIN_DUP_FN 1 +#define PyMPI_HAVE_MPI_WIN_NULL_COPY_FN 1 +#define PyMPI_HAVE_MPI_WIN_NULL_DELETE_FN 1 +#define PyMPI_HAVE_MPI_Win_create_keyval 1 +#define PyMPI_HAVE_MPI_Win_free_keyval 1 +#define PyMPI_HAVE_MPI_ERR_WIN 1 +#define PyMPI_HAVE_MPI_ERR_BASE 1 +#define PyMPI_HAVE_MPI_ERR_SIZE 1 +#define PyMPI_HAVE_MPI_ERR_DISP 1 +#define PyMPI_HAVE_MPI_ERR_ASSERT 1 +#define PyMPI_HAVE_MPI_ERR_LOCKTYPE 1 +#define PyMPI_HAVE_MPI_ERR_RMA_CONFLICT 1 +#define PyMPI_HAVE_MPI_ERR_RMA_SYNC 1 -#define PyMPI_MISSING_MPI_Offset 1 -#define PyMPI_MISSING_MPI_File 1 -#define PyMPI_MISSING_MPI_FILE_NULL 1 -#define PyMPI_MISSING_MPI_MODE_RDONLY 1 -#define PyMPI_MISSING_MPI_MODE_RDWR 1 -#define PyMPI_MISSING_MPI_MODE_WRONLY 1 -#define PyMPI_MISSING_MPI_MODE_CREATE 1 -#define PyMPI_MISSING_MPI_MODE_EXCL 1 -#define PyMPI_MISSING_MPI_MODE_DELETE_ON_CLOSE 1 -#define PyMPI_MISSING_MPI_MODE_UNIQUE_OPEN 1 -#define PyMPI_MISSING_MPI_MODE_APPEND 1 -#define PyMPI_MISSING_MPI_MODE_SEQUENTIAL 1 -#define PyMPI_MISSING_MPI_File_open 1 -#define PyMPI_MISSING_MPI_File_close 1 -#define PyMPI_MISSING_MPI_File_delete 1 -#define PyMPI_MISSING_MPI_File_set_size 1 -#define PyMPI_MISSING_MPI_File_preallocate 1 -#define PyMPI_MISSING_MPI_File_get_size 1 -#define PyMPI_MISSING_MPI_File_get_group 1 -#define PyMPI_MISSING_MPI_File_get_amode 1 -#define PyMPI_MISSING_MPI_File_set_info 1 -#define PyMPI_MISSING_MPI_File_get_info 1 -#define PyMPI_MISSING_MPI_MAX_DATAREP_STRING 1 -#define PyMPI_MISSING_MPI_File_get_view 1 -#define PyMPI_MISSING_MPI_File_set_view 1 -#define PyMPI_MISSING_MPI_File_read_at 1 -#define PyMPI_MISSING_MPI_File_read_at_all 1 -#define PyMPI_MISSING_MPI_File_write_at 1 -#define PyMPI_MISSING_MPI_File_write_at_all 1 -#define PyMPI_MISSING_MPI_File_iread_at 1 -#define PyMPI_MISSING_MPI_File_iwrite_at 1 -#define PyMPI_MISSING_MPI_SEEK_SET 1 -#define PyMPI_MISSING_MPI_SEEK_CUR 1 -#define PyMPI_MISSING_MPI_SEEK_END 1 -#define PyMPI_MISSING_MPI_DISPLACEMENT_CURRENT 1 -#define PyMPI_MISSING_MPI_File_seek 1 -#define PyMPI_MISSING_MPI_File_get_position 1 -#define PyMPI_MISSING_MPI_File_get_byte_offset 1 -#define PyMPI_MISSING_MPI_File_read 1 -#define PyMPI_MISSING_MPI_File_read_all 1 -#define PyMPI_MISSING_MPI_File_write 1 -#define PyMPI_MISSING_MPI_File_write_all 1 -#define PyMPI_MISSING_MPI_File_iread 1 -#define PyMPI_MISSING_MPI_File_iwrite 1 -#define PyMPI_MISSING_MPI_File_read_shared 1 -#define PyMPI_MISSING_MPI_File_write_shared 1 -#define PyMPI_MISSING_MPI_File_iread_shared 1 -#define PyMPI_MISSING_MPI_File_iwrite_shared 1 -#define PyMPI_MISSING_MPI_File_read_ordered 1 -#define PyMPI_MISSING_MPI_File_write_ordered 1 -#define PyMPI_MISSING_MPI_File_seek_shared 1 -#define PyMPI_MISSING_MPI_File_get_position_shared 1 -#define PyMPI_MISSING_MPI_File_read_at_all_begin 1 -#define PyMPI_MISSING_MPI_File_read_at_all_end 1 -#define PyMPI_MISSING_MPI_File_write_at_all_begin 1 -#define PyMPI_MISSING_MPI_File_write_at_all_end 1 -#define PyMPI_MISSING_MPI_File_read_all_begin 1 -#define PyMPI_MISSING_MPI_File_read_all_end 1 -#define PyMPI_MISSING_MPI_File_write_all_begin 1 -#define PyMPI_MISSING_MPI_File_write_all_end 1 -#define PyMPI_MISSING_MPI_File_read_ordered_begin 1 -#define PyMPI_MISSING_MPI_File_read_ordered_end 1 -#define PyMPI_MISSING_MPI_File_write_ordered_begin 1 -#define PyMPI_MISSING_MPI_File_write_ordered_end 1 -#define PyMPI_MISSING_MPI_File_get_type_extent 1 -#define PyMPI_MISSING_MPI_File_set_atomicity 1 -#define PyMPI_MISSING_MPI_File_get_atomicity 1 -#define PyMPI_MISSING_MPI_File_sync 1 -#define PyMPI_MISSING_MPI_File_get_errhandler 1 -#define PyMPI_MISSING_MPI_File_set_errhandler 1 -#define PyMPI_MISSING_MPI_File_errhandler_fn 1 -#define PyMPI_MISSING_MPI_File_errhandler_function 1 -#define PyMPI_MISSING_MPI_File_create_errhandler 1 -#define PyMPI_MISSING_MPI_File_call_errhandler 1 -#define PyMPI_MISSING_MPI_Datarep_conversion_function 1 -#define PyMPI_MISSING_MPI_Datarep_extent_function 1 -#define PyMPI_MISSING_MPI_CONVERSION_FN_NULL 1 -#define PyMPI_MISSING_MPI_MAX_DATAREP_STRING 1 -#define PyMPI_MISSING_MPI_Register_datarep 1 -#define PyMPI_MISSING_MPI_ERR_FILE 1 -#define PyMPI_MISSING_MPI_ERR_NOT_SAME 1 -#define PyMPI_MISSING_MPI_ERR_BAD_FILE 1 -#define PyMPI_MISSING_MPI_ERR_NO_SUCH_FILE 1 -#define PyMPI_MISSING_MPI_ERR_FILE_EXISTS 1 -#define PyMPI_MISSING_MPI_ERR_FILE_IN_USE 1 -#define PyMPI_MISSING_MPI_ERR_AMODE 1 -#define PyMPI_MISSING_MPI_ERR_ACCESS 1 -#define PyMPI_MISSING_MPI_ERR_READ_ONLY 1 -#define PyMPI_MISSING_MPI_ERR_NO_SPACE 1 -#define PyMPI_MISSING_MPI_ERR_QUOTA 1 -#define PyMPI_MISSING_MPI_ERR_UNSUPPORTED_DATAREP 1 -#define PyMPI_MISSING_MPI_ERR_UNSUPPORTED_OPERATION 1 -#define PyMPI_MISSING_MPI_ERR_CONVERSION 1 -#define PyMPI_MISSING_MPI_ERR_DUP_DATAREP 1 -#define PyMPI_MISSING_MPI_ERR_IO 1 +#define PyMPI_HAVE_MPI_Offset 1 +#define PyMPI_HAVE_MPI_File 1 +#define PyMPI_HAVE_MPI_FILE_NULL 1 +#define PyMPI_HAVE_MPI_MODE_RDONLY 1 +#define PyMPI_HAVE_MPI_MODE_RDWR 1 +#define PyMPI_HAVE_MPI_MODE_WRONLY 1 +#define PyMPI_HAVE_MPI_MODE_CREATE 1 +#define PyMPI_HAVE_MPI_MODE_EXCL 1 +#define PyMPI_HAVE_MPI_MODE_DELETE_ON_CLOSE 1 +#define PyMPI_HAVE_MPI_MODE_UNIQUE_OPEN 1 +#define PyMPI_HAVE_MPI_MODE_APPEND 1 +#define PyMPI_HAVE_MPI_MODE_SEQUENTIAL 1 +#define PyMPI_HAVE_MPI_File_open 1 +#define PyMPI_HAVE_MPI_File_close 1 +#define PyMPI_HAVE_MPI_File_delete 1 +#define PyMPI_HAVE_MPI_File_set_size 1 +#define PyMPI_HAVE_MPI_File_preallocate 1 +#define PyMPI_HAVE_MPI_File_get_size 1 +#define PyMPI_HAVE_MPI_File_get_group 1 +#define PyMPI_HAVE_MPI_File_get_amode 1 +#define PyMPI_HAVE_MPI_File_set_info 1 +#define PyMPI_HAVE_MPI_File_get_info 1 +#define PyMPI_HAVE_MPI_MAX_DATAREP_STRING 1 +#define PyMPI_HAVE_MPI_File_get_view 1 +#define PyMPI_HAVE_MPI_File_set_view 1 +#define PyMPI_HAVE_MPI_File_read_at 1 +#define PyMPI_HAVE_MPI_File_read_at_all 1 +#define PyMPI_HAVE_MPI_File_write_at 1 +#define PyMPI_HAVE_MPI_File_write_at_all 1 +#define PyMPI_HAVE_MPI_File_iread_at 1 +#define PyMPI_HAVE_MPI_File_iwrite_at 1 +#define PyMPI_HAVE_MPI_SEEK_SET 1 +#define PyMPI_HAVE_MPI_SEEK_CUR 1 +#define PyMPI_HAVE_MPI_SEEK_END 1 +#define PyMPI_HAVE_MPI_DISPLACEMENT_CURRENT 1 +#define PyMPI_HAVE_MPI_File_seek 1 +#define PyMPI_HAVE_MPI_File_get_position 1 +#define PyMPI_HAVE_MPI_File_get_byte_offset 1 +#define PyMPI_HAVE_MPI_File_read 1 +#define PyMPI_HAVE_MPI_File_read_all 1 +#define PyMPI_HAVE_MPI_File_write 1 +#define PyMPI_HAVE_MPI_File_write_all 1 +#define PyMPI_HAVE_MPI_File_iread 1 +#define PyMPI_HAVE_MPI_File_iwrite 1 +#define PyMPI_HAVE_MPI_File_read_shared 1 +#define PyMPI_HAVE_MPI_File_write_shared 1 +#define PyMPI_HAVE_MPI_File_iread_shared 1 +#define PyMPI_HAVE_MPI_File_iwrite_shared 1 +#define PyMPI_HAVE_MPI_File_read_ordered 1 +#define PyMPI_HAVE_MPI_File_write_ordered 1 +#define PyMPI_HAVE_MPI_File_seek_shared 1 +#define PyMPI_HAVE_MPI_File_get_position_shared 1 +#define PyMPI_HAVE_MPI_File_read_at_all_begin 1 +#define PyMPI_HAVE_MPI_File_read_at_all_end 1 +#define PyMPI_HAVE_MPI_File_write_at_all_begin 1 +#define PyMPI_HAVE_MPI_File_write_at_all_end 1 +#define PyMPI_HAVE_MPI_File_read_all_begin 1 +#define PyMPI_HAVE_MPI_File_read_all_end 1 +#define PyMPI_HAVE_MPI_File_write_all_begin 1 +#define PyMPI_HAVE_MPI_File_write_all_end 1 +#define PyMPI_HAVE_MPI_File_read_ordered_begin 1 +#define PyMPI_HAVE_MPI_File_read_ordered_end 1 +#define PyMPI_HAVE_MPI_File_write_ordered_begin 1 +#define PyMPI_HAVE_MPI_File_write_ordered_end 1 +#define PyMPI_HAVE_MPI_File_get_type_extent 1 +#define PyMPI_HAVE_MPI_File_set_atomicity 1 +#define PyMPI_HAVE_MPI_File_get_atomicity 1 +#define PyMPI_HAVE_MPI_File_sync 1 +#define PyMPI_HAVE_MPI_File_get_errhandler 1 +#define PyMPI_HAVE_MPI_File_set_errhandler 1 +#define PyMPI_HAVE_MPI_File_errhandler_fn 1 +#define PyMPI_HAVE_MPI_File_errhandler_function 1 +#define PyMPI_HAVE_MPI_File_create_errhandler 1 +#define PyMPI_HAVE_MPI_File_call_errhandler 1 +#define PyMPI_HAVE_MPI_Datarep_conversion_function 1 +#define PyMPI_HAVE_MPI_Datarep_extent_function 1 +#define PyMPI_HAVE_MPI_CONVERSION_FN_NULL 1 +#define PyMPI_HAVE_MPI_MAX_DATAREP_STRING 1 +#define PyMPI_HAVE_MPI_Register_datarep 1 +#define PyMPI_HAVE_MPI_ERR_FILE 1 +#define PyMPI_HAVE_MPI_ERR_NOT_SAME 1 +#define PyMPI_HAVE_MPI_ERR_BAD_FILE 1 +#define PyMPI_HAVE_MPI_ERR_NO_SUCH_FILE 1 +#define PyMPI_HAVE_MPI_ERR_FILE_EXISTS 1 +#define PyMPI_HAVE_MPI_ERR_FILE_IN_USE 1 +#define PyMPI_HAVE_MPI_ERR_AMODE 1 +#define PyMPI_HAVE_MPI_ERR_ACCESS 1 +#define PyMPI_HAVE_MPI_ERR_READ_ONLY 1 +#define PyMPI_HAVE_MPI_ERR_NO_SPACE 1 +#define PyMPI_HAVE_MPI_ERR_QUOTA 1 +#define PyMPI_HAVE_MPI_ERR_UNSUPPORTED_DATAREP 1 +#define PyMPI_HAVE_MPI_ERR_UNSUPPORTED_OPERATION 1 +#define PyMPI_HAVE_MPI_ERR_CONVERSION 1 +#define PyMPI_HAVE_MPI_ERR_DUP_DATAREP 1 +#define PyMPI_HAVE_MPI_ERR_IO 1 -#define PyMPI_MISSING_MPI_LASTUSEDCODE 1 -#define PyMPI_MISSING_MPI_Add_error_class 1 -#define PyMPI_MISSING_MPI_Add_error_code 1 -#define PyMPI_MISSING_MPI_Add_error_string 1 +#define PyMPI_HAVE_MPI_LASTUSEDCODE 1 +#define PyMPI_HAVE_MPI_Add_error_class 1 +#define PyMPI_HAVE_MPI_Add_error_code 1 +#define PyMPI_HAVE_MPI_Add_error_string 1 -#define PyMPI_MISSING_MPI_THREAD_SINGLE 1 -#define PyMPI_MISSING_MPI_THREAD_FUNNELED 1 -#define PyMPI_MISSING_MPI_THREAD_SERIALIZED 1 -#define PyMPI_MISSING_MPI_THREAD_MULTIPLE 1 -#define PyMPI_MISSING_MPI_Init_thread 1 -#define PyMPI_MISSING_MPI_Query_thread 1 -#define PyMPI_MISSING_MPI_Is_thread_main 1 +#define PyMPI_HAVE_MPI_THREAD_SINGLE 1 +#define PyMPI_HAVE_MPI_THREAD_FUNNELED 1 +#define PyMPI_HAVE_MPI_THREAD_SERIALIZED 1 +#define PyMPI_HAVE_MPI_THREAD_MULTIPLE 1 +#define PyMPI_HAVE_MPI_Init_thread 1 +#define PyMPI_HAVE_MPI_Query_thread 1 +#define PyMPI_HAVE_MPI_Is_thread_main 1 -#define PyMPI_MISSING_MPI_Fint 1 -#define PyMPI_MISSING_MPI_F_STATUS_IGNORE 1 -#define PyMPI_MISSING_MPI_F_STATUSES_IGNORE 1 -#define PyMPI_MISSING_MPI_Status_c2f 1 -#define PyMPI_MISSING_MPI_Status_f2c 1 -#define PyMPI_MISSING_MPI_Type_c2f 1 -#define PyMPI_MISSING_MPI_Request_c2f 1 -#define PyMPI_MISSING_MPI_Op_c2f 1 -#define PyMPI_MISSING_MPI_Info_c2f 1 -#define PyMPI_MISSING_MPI_Group_c2f 1 -#define PyMPI_MISSING_MPI_Comm_c2f 1 -#define PyMPI_MISSING_MPI_Win_c2f 1 -#define PyMPI_MISSING_MPI_File_c2f 1 -#define PyMPI_MISSING_MPI_Errhandler_c2f 1 -#define PyMPI_MISSING_MPI_Type_f2c 1 -#define PyMPI_MISSING_MPI_Request_f2c 1 -#define PyMPI_MISSING_MPI_Op_f2c 1 -#define PyMPI_MISSING_MPI_Info_f2c 1 -#define PyMPI_MISSING_MPI_Group_f2c 1 -#define PyMPI_MISSING_MPI_Comm_f2c 1 -#define PyMPI_MISSING_MPI_Win_f2c 1 -#define PyMPI_MISSING_MPI_File_f2c 1 -#define PyMPI_MISSING_MPI_Errhandler_f2c 1 +#define PyMPI_HAVE_MPI_Fint 1 +#define PyMPI_HAVE_MPI_F_STATUS_IGNORE 1 +#define PyMPI_HAVE_MPI_F_STATUSES_IGNORE 1 +#define PyMPI_HAVE_MPI_Status_c2f 1 +#define PyMPI_HAVE_MPI_Status_f2c 1 +#define PyMPI_HAVE_MPI_Type_c2f 1 +#define PyMPI_HAVE_MPI_Request_c2f 1 +#define PyMPI_HAVE_MPI_Op_c2f 1 +#define PyMPI_HAVE_MPI_Info_c2f 1 +#define PyMPI_HAVE_MPI_Group_c2f 1 +#define PyMPI_HAVE_MPI_Comm_c2f 1 +#define PyMPI_HAVE_MPI_Win_c2f 1 +#define PyMPI_HAVE_MPI_File_c2f 1 +#define PyMPI_HAVE_MPI_Errhandler_c2f 1 +#define PyMPI_HAVE_MPI_Type_f2c 1 +#define PyMPI_HAVE_MPI_Request_f2c 1 +#define PyMPI_HAVE_MPI_Op_f2c 1 +#define PyMPI_HAVE_MPI_Info_f2c 1 +#define PyMPI_HAVE_MPI_Group_f2c 1 +#define PyMPI_HAVE_MPI_Comm_f2c 1 +#define PyMPI_HAVE_MPI_Win_f2c 1 +#define PyMPI_HAVE_MPI_File_f2c 1 +#define PyMPI_HAVE_MPI_Errhandler_f2c 1 -#endif /* MPI < 2.0 */ +#endif +#endif diff --git a/src/config/mpi-22.h b/src/config/mpi-22.h index 2b44077..13aabf3 100644 --- a/src/config/mpi-22.h +++ b/src/config/mpi-22.h @@ -1,43 +1,45 @@ -#if !defined(MPI_VERSION) || (MPI_VERSION < 2) || (MPI_VERSION == 2 && MPI_SUBVERSION < 2) +#if defined(MPI_VERSION) +#if (MPI_VERSION > 2) || (MPI_VERSION == 2 && MPI_SUBVERSION >= 2) -#define PyMPI_MISSING_MPI_AINT 1 -#define PyMPI_MISSING_MPI_OFFSET 1 +#define PyMPI_HAVE_MPI_AINT 1 +#define PyMPI_HAVE_MPI_OFFSET 1 -#define PyMPI_MISSING_MPI_C_BOOL 1 -#define PyMPI_MISSING_MPI_INT8_T 1 -#define PyMPI_MISSING_MPI_INT16_T 1 -#define PyMPI_MISSING_MPI_INT32_T 1 -#define PyMPI_MISSING_MPI_INT64_T 1 -#define PyMPI_MISSING_MPI_UINT8_T 1 -#define PyMPI_MISSING_MPI_UINT16_T 1 -#define PyMPI_MISSING_MPI_UINT32_T 1 -#define PyMPI_MISSING_MPI_UINT64_T 1 -#define PyMPI_MISSING_MPI_C_COMPLEX 1 -#define PyMPI_MISSING_MPI_C_FLOAT_COMPLEX 1 -#define PyMPI_MISSING_MPI_C_DOUBLE_COMPLEX 1 -#define PyMPI_MISSING_MPI_C_LONG_DOUBLE_COMPLEX 1 +#define PyMPI_HAVE_MPI_C_BOOL 1 +#define PyMPI_HAVE_MPI_INT8_T 1 +#define PyMPI_HAVE_MPI_INT16_T 1 +#define PyMPI_HAVE_MPI_INT32_T 1 +#define PyMPI_HAVE_MPI_INT64_T 1 +#define PyMPI_HAVE_MPI_UINT8_T 1 +#define PyMPI_HAVE_MPI_UINT16_T 1 +#define PyMPI_HAVE_MPI_UINT32_T 1 +#define PyMPI_HAVE_MPI_UINT64_T 1 +#define PyMPI_HAVE_MPI_C_COMPLEX 1 +#define PyMPI_HAVE_MPI_C_FLOAT_COMPLEX 1 +#define PyMPI_HAVE_MPI_C_DOUBLE_COMPLEX 1 +#define PyMPI_HAVE_MPI_C_LONG_DOUBLE_COMPLEX 1 -#define PyMPI_MISSING_MPI_INTEGER8 1 -#define PyMPI_MISSING_MPI_INTEGER16 1 -#define PyMPI_MISSING_MPI_REAL16 1 -#define PyMPI_MISSING_MPI_COMPLEX4 1 -#define PyMPI_MISSING_MPI_COMPLEX8 1 -#define PyMPI_MISSING_MPI_COMPLEX16 1 -#define PyMPI_MISSING_MPI_COMPLEX32 1 +#define PyMPI_HAVE_MPI_INTEGER8 1 +#define PyMPI_HAVE_MPI_INTEGER16 1 +#define PyMPI_HAVE_MPI_REAL16 1 +#define PyMPI_HAVE_MPI_COMPLEX4 1 +#define PyMPI_HAVE_MPI_COMPLEX8 1 +#define PyMPI_HAVE_MPI_COMPLEX16 1 +#define PyMPI_HAVE_MPI_COMPLEX32 1 -#define PyMPI_MISSING_MPI_Op_commutative 1 -#define PyMPI_MISSING_MPI_Reduce_local 1 -#define PyMPI_MISSING_MPI_Reduce_scatter_block 1 +#define PyMPI_HAVE_MPI_Op_commutative 1 +#define PyMPI_HAVE_MPI_Reduce_local 1 +#define PyMPI_HAVE_MPI_Reduce_scatter_block 1 -#define PyMPI_MISSING_MPI_DIST_GRAPH 1 -#define PyMPI_MISSING_MPI_UNWEIGHTED 1 -#define PyMPI_MISSING_MPI_Dist_graph_create_adjacent 1 -#define PyMPI_MISSING_MPI_Dist_graph_create 1 -#define PyMPI_MISSING_MPI_Dist_graph_neighbors_count 1 -#define PyMPI_MISSING_MPI_Dist_graph_neighbors 1 +#define PyMPI_HAVE_MPI_DIST_GRAPH 1 +#define PyMPI_HAVE_MPI_UNWEIGHTED 1 +#define PyMPI_HAVE_MPI_Dist_graph_create_adjacent 1 +#define PyMPI_HAVE_MPI_Dist_graph_create 1 +#define PyMPI_HAVE_MPI_Dist_graph_neighbors_count 1 +#define PyMPI_HAVE_MPI_Dist_graph_neighbors 1 -#define PyMPI_MISSING_MPI_Comm_errhandler_function 1 -#define PyMPI_MISSING_MPI_Win_errhandler_function 1 -#define PyMPI_MISSING_MPI_File_errhandler_function 1 +#define PyMPI_HAVE_MPI_Comm_errhandler_function 1 +#define PyMPI_HAVE_MPI_Win_errhandler_function 1 +#define PyMPI_HAVE_MPI_File_errhandler_function 1 -#endif /* MPI < 2.2 */ +#endif +#endif diff --git a/src/config/mpi-30.h b/src/config/mpi-30.h index 6f6c919..40e6e08 100644 --- a/src/config/mpi-30.h +++ b/src/config/mpi-30.h @@ -1,113 +1,115 @@ -#if defined(MPI_VERSION) && (MPI_VERSION < 3) - -#define PyMPI_MISSING_MPI_Count 1 -#define PyMPI_MISSING_MPI_COUNT 1 -#define PyMPI_MISSING_MPI_Type_size_x 1 -#define PyMPI_MISSING_MPI_Type_get_extent_x 1 -#define PyMPI_MISSING_MPI_Type_get_true_extent_x 1 -#define PyMPI_MISSING_MPI_Get_elements_x 1 -#define PyMPI_MISSING_MPI_Status_set_elements_x 1 - -#define PyMPI_MISSING_MPI_COMBINER_HINDEXED_BLOCK -#define PyMPI_MISSING_MPI_Type_create_hindexed_block 1 - -#define PyMPI_MISSING_MPI_NO_OP 1 - -#define PyMPI_MISSING_MPI_Message 1 -#define PyMPI_MISSING_MPI_MESSAGE_NULL 1 -#define PyMPI_MISSING_MPI_MESSAGE_NO_PROC 1 -#define PyMPI_MISSING_MPI_Message_c2f 1 -#define PyMPI_MISSING_MPI_Message_f2c 1 -#define PyMPI_MISSING_MPI_Mprobe 1 -#define PyMPI_MISSING_MPI_Improbe 1 -#define PyMPI_MISSING_MPI_Mrecv 1 -#define PyMPI_MISSING_MPI_Imrecv 1 - -#define PyMPI_MISSING_MPI_Neighbor_allgather 1 -#define PyMPI_MISSING_MPI_Neighbor_allgatherv 1 -#define PyMPI_MISSING_MPI_Neighbor_alltoall 1 -#define PyMPI_MISSING_MPI_Neighbor_alltoallv 1 -#define PyMPI_MISSING_MPI_Neighbor_alltoallw 1 - -#define PyMPI_MISSING_MPI_Ibarrier 1 -#define PyMPI_MISSING_MPI_Ibcast 1 -#define PyMPI_MISSING_MPI_Igather 1 -#define PyMPI_MISSING_MPI_Igatherv 1 -#define PyMPI_MISSING_MPI_Iscatter 1 -#define PyMPI_MISSING_MPI_Iscatterv 1 -#define PyMPI_MISSING_MPI_Iallgather 1 -#define PyMPI_MISSING_MPI_Iallgatherv 1 -#define PyMPI_MISSING_MPI_Ialltoall 1 -#define PyMPI_MISSING_MPI_Ialltoallv 1 -#define PyMPI_MISSING_MPI_Ialltoallw 1 -#define PyMPI_MISSING_MPI_Ireduce 1 -#define PyMPI_MISSING_MPI_Iallreduce 1 -#define PyMPI_MISSING_MPI_Ireduce_scatter_block 1 -#define PyMPI_MISSING_MPI_Ireduce_scatter 1 -#define PyMPI_MISSING_MPI_Iscan 1 -#define PyMPI_MISSING_MPI_Iexscan 1 - -#define PyMPI_MISSING_MPI_Ineighbor_allgather 1 -#define PyMPI_MISSING_MPI_Ineighbor_allgatherv 1 -#define PyMPI_MISSING_MPI_Ineighbor_alltoall 1 -#define PyMPI_MISSING_MPI_Ineighbor_alltoallv 1 -#define PyMPI_MISSING_MPI_Ineighbor_alltoallw 1 - -#define PyMPI_MISSING_MPI_WEIGHTS_EMPTY 1 - -#define PyMPI_MISSING_MPI_Comm_dup_with_info 1 -#define PyMPI_MISSING_MPI_Comm_idup 1 -#define PyMPI_MISSING_MPI_Comm_create_group 1 -#define PyMPI_MISSING_MPI_COMM_TYPE_SHARED 1 -#define PyMPI_MISSING_MPI_Comm_split_type 1 -#define PyMPI_MISSING_MPI_Comm_set_info 1 -#define PyMPI_MISSING_MPI_Comm_get_info 1 - -#define PyMPI_MISSING_MPI_WIN_CREATE_FLAVOR 1 -#define PyMPI_MISSING_MPI_WIN_FLAVOR_CREATE 1 -#define PyMPI_MISSING_MPI_WIN_FLAVOR_ALLOCATE 1 -#define PyMPI_MISSING_MPI_WIN_FLAVOR_DYNAMIC 1 -#define PyMPI_MISSING_MPI_WIN_FLAVOR_SHARED 1 - -#define PyMPI_MISSING_MPI_WIN_MODEL 1 -#define PyMPI_MISSING_MPI_WIN_SEPARATE 1 -#define PyMPI_MISSING_MPI_WIN_UNIFIED 1 - -#define PyMPI_MISSING_MPI_Win_allocate 1 -#define PyMPI_MISSING_MPI_Win_allocate_shared 1 -#define PyMPI_MISSING_MPI_Win_shared_query 1 - -#define PyMPI_MISSING_MPI_Win_create_dynamic 1 -#define PyMPI_MISSING_MPI_Win_attach 1 -#define PyMPI_MISSING_MPI_Win_detach 1 - -#define PyMPI_MISSING_MPI_Win_set_info 1 -#define PyMPI_MISSING_MPI_Win_get_info 1 - -#define PyMPI_MISSING_MPI_Get_accumulate 1 -#define PyMPI_MISSING_MPI_Fetch_and_op 1 -#define PyMPI_MISSING_MPI_Compare_and_swap 1 - -#define PyMPI_MISSING_MPI_Rget 1 -#define PyMPI_MISSING_MPI_Rput 1 -#define PyMPI_MISSING_MPI_Raccumulate 1 -#define PyMPI_MISSING_MPI_Rget_accumulate 1 - -#define PyMPI_MISSING_MPI_Win_lock_all 1 -#define PyMPI_MISSING_MPI_Win_unlock_all 1 -#define PyMPI_MISSING_MPI_Win_flush 1 -#define PyMPI_MISSING_MPI_Win_flush_all 1 -#define PyMPI_MISSING_MPI_Win_flush_local 1 -#define PyMPI_MISSING_MPI_Win_flush_local_all 1 -#define PyMPI_MISSING_MPI_Win_sync 1 - -#define PyMPI_MISSING_MPI_ERR_RMA_RANGE 1 -#define PyMPI_MISSING_MPI_ERR_RMA_ATTACH 1 -#define PyMPI_MISSING_MPI_ERR_RMA_SHARED 1 -#define PyMPI_MISSING_MPI_ERR_RMA_FLAVOR 1 - -#define PyMPI_MISSING_MPI_MAX_LIBRARY_VERSION_STRING 1 -#define PyMPI_MISSING_MPI_Get_library_version 1 -#define PyMPI_MISSING_MPI_INFO_ENV 1 - -#endif /* MPI < 3.0 */ +#if defined(MPI_VERSION) +#if (MPI_VERSION >= 3) + +#define PyMPI_HAVE_MPI_Count 1 +#define PyMPI_HAVE_MPI_COUNT 1 +#define PyMPI_HAVE_MPI_Type_size_x 1 +#define PyMPI_HAVE_MPI_Type_get_extent_x 1 +#define PyMPI_HAVE_MPI_Type_get_true_extent_x 1 +#define PyMPI_HAVE_MPI_Get_elements_x 1 +#define PyMPI_HAVE_MPI_Status_set_elements_x 1 + +#define PyMPI_HAVE_MPI_COMBINER_HINDEXED_BLOCK +#define PyMPI_HAVE_MPI_Type_create_hindexed_block 1 + +#define PyMPI_HAVE_MPI_NO_OP 1 + +#define PyMPI_HAVE_MPI_Message 1 +#define PyMPI_HAVE_MPI_MESSAGE_NULL 1 +#define PyMPI_HAVE_MPI_MESSAGE_NO_PROC 1 +#define PyMPI_HAVE_MPI_Message_c2f 1 +#define PyMPI_HAVE_MPI_Message_f2c 1 +#define PyMPI_HAVE_MPI_Mprobe 1 +#define PyMPI_HAVE_MPI_Improbe 1 +#define PyMPI_HAVE_MPI_Mrecv 1 +#define PyMPI_HAVE_MPI_Imrecv 1 + +#define PyMPI_HAVE_MPI_Neighbor_allgather 1 +#define PyMPI_HAVE_MPI_Neighbor_allgatherv 1 +#define PyMPI_HAVE_MPI_Neighbor_alltoall 1 +#define PyMPI_HAVE_MPI_Neighbor_alltoallv 1 +#define PyMPI_HAVE_MPI_Neighbor_alltoallw 1 + +#define PyMPI_HAVE_MPI_Ibarrier 1 +#define PyMPI_HAVE_MPI_Ibcast 1 +#define PyMPI_HAVE_MPI_Igather 1 +#define PyMPI_HAVE_MPI_Igatherv 1 +#define PyMPI_HAVE_MPI_Iscatter 1 +#define PyMPI_HAVE_MPI_Iscatterv 1 +#define PyMPI_HAVE_MPI_Iallgather 1 +#define PyMPI_HAVE_MPI_Iallgatherv 1 +#define PyMPI_HAVE_MPI_Ialltoall 1 +#define PyMPI_HAVE_MPI_Ialltoallv 1 +#define PyMPI_HAVE_MPI_Ialltoallw 1 +#define PyMPI_HAVE_MPI_Ireduce 1 +#define PyMPI_HAVE_MPI_Iallreduce 1 +#define PyMPI_HAVE_MPI_Ireduce_scatter_block 1 +#define PyMPI_HAVE_MPI_Ireduce_scatter 1 +#define PyMPI_HAVE_MPI_Iscan 1 +#define PyMPI_HAVE_MPI_Iexscan 1 + +#define PyMPI_HAVE_MPI_Ineighbor_allgather 1 +#define PyMPI_HAVE_MPI_Ineighbor_allgatherv 1 +#define PyMPI_HAVE_MPI_Ineighbor_alltoall 1 +#define PyMPI_HAVE_MPI_Ineighbor_alltoallv 1 +#define PyMPI_HAVE_MPI_Ineighbor_alltoallw 1 + +#define PyMPI_HAVE_MPI_WEIGHTS_EMPTY 1 + +#define PyMPI_HAVE_MPI_Comm_dup_with_info 1 +#define PyMPI_HAVE_MPI_Comm_idup 1 +#define PyMPI_HAVE_MPI_Comm_create_group 1 +#define PyMPI_HAVE_MPI_COMM_TYPE_SHARED 1 +#define PyMPI_HAVE_MPI_Comm_split_type 1 +#define PyMPI_HAVE_MPI_Comm_set_info 1 +#define PyMPI_HAVE_MPI_Comm_get_info 1 + +#define PyMPI_HAVE_MPI_WIN_CREATE_FLAVOR 1 +#define PyMPI_HAVE_MPI_WIN_FLAVOR_CREATE 1 +#define PyMPI_HAVE_MPI_WIN_FLAVOR_ALLOCATE 1 +#define PyMPI_HAVE_MPI_WIN_FLAVOR_DYNAMIC 1 +#define PyMPI_HAVE_MPI_WIN_FLAVOR_SHARED 1 + +#define PyMPI_HAVE_MPI_WIN_MODEL 1 +#define PyMPI_HAVE_MPI_WIN_SEPARATE 1 +#define PyMPI_HAVE_MPI_WIN_UNIFIED 1 + +#define PyMPI_HAVE_MPI_Win_allocate 1 +#define PyMPI_HAVE_MPI_Win_allocate_shared 1 +#define PyMPI_HAVE_MPI_Win_shared_query 1 + +#define PyMPI_HAVE_MPI_Win_create_dynamic 1 +#define PyMPI_HAVE_MPI_Win_attach 1 +#define PyMPI_HAVE_MPI_Win_detach 1 + +#define PyMPI_HAVE_MPI_Win_set_info 1 +#define PyMPI_HAVE_MPI_Win_get_info 1 + +#define PyMPI_HAVE_MPI_Get_accumulate 1 +#define PyMPI_HAVE_MPI_Fetch_and_op 1 +#define PyMPI_HAVE_MPI_Compare_and_swap 1 + +#define PyMPI_HAVE_MPI_Rget 1 +#define PyMPI_HAVE_MPI_Rput 1 +#define PyMPI_HAVE_MPI_Raccumulate 1 +#define PyMPI_HAVE_MPI_Rget_accumulate 1 + +#define PyMPI_HAVE_MPI_Win_lock_all 1 +#define PyMPI_HAVE_MPI_Win_unlock_all 1 +#define PyMPI_HAVE_MPI_Win_flush 1 +#define PyMPI_HAVE_MPI_Win_flush_all 1 +#define PyMPI_HAVE_MPI_Win_flush_local 1 +#define PyMPI_HAVE_MPI_Win_flush_local_all 1 +#define PyMPI_HAVE_MPI_Win_sync 1 + +#define PyMPI_HAVE_MPI_ERR_RMA_RANGE 1 +#define PyMPI_HAVE_MPI_ERR_RMA_ATTACH 1 +#define PyMPI_HAVE_MPI_ERR_RMA_SHARED 1 +#define PyMPI_HAVE_MPI_ERR_RMA_FLAVOR 1 + +#define PyMPI_HAVE_MPI_MAX_LIBRARY_VERSION_STRING 1 +#define PyMPI_HAVE_MPI_Get_library_version 1 +#define PyMPI_HAVE_MPI_INFO_ENV 1 + +#endif +#endif diff --git a/src/config/mpich2-io.h b/src/config/mpich2-io.h index c1de27d..7946511 100644 --- a/src/config/mpich2-io.h +++ b/src/config/mpich2-io.h @@ -1,105 +1,105 @@ #ifndef PyMPI_CONFIG_MPICH2_IO_H #define PyMPI_CONFIG_MPICH2_IO_H -#define PyMPI_MISSING_MPI_File 1 -#define PyMPI_MISSING_MPI_FILE_NULL 1 -#define PyMPI_MISSING_MPI_MODE_RDONLY 1 -#define PyMPI_MISSING_MPI_MODE_RDWR 1 -#define PyMPI_MISSING_MPI_MODE_WRONLY 1 -#define PyMPI_MISSING_MPI_MODE_CREATE 1 -#define PyMPI_MISSING_MPI_MODE_EXCL 1 -#define PyMPI_MISSING_MPI_MODE_DELETE_ON_CLOSE 1 -#define PyMPI_MISSING_MPI_MODE_UNIQUE_OPEN 1 -#define PyMPI_MISSING_MPI_MODE_APPEND 1 -#define PyMPI_MISSING_MPI_MODE_SEQUENTIAL 1 -#define PyMPI_MISSING_MPI_File_open 1 -#define PyMPI_MISSING_MPI_File_close 1 -#define PyMPI_MISSING_MPI_File_delete 1 -#define PyMPI_MISSING_MPI_File_set_size 1 -#define PyMPI_MISSING_MPI_File_preallocate 1 -#define PyMPI_MISSING_MPI_File_get_size 1 -#define PyMPI_MISSING_MPI_File_get_group 1 -#define PyMPI_MISSING_MPI_File_get_amode 1 -#define PyMPI_MISSING_MPI_File_set_info 1 -#define PyMPI_MISSING_MPI_File_get_info 1 -#define PyMPI_MISSING_MPI_File_get_view 1 -#define PyMPI_MISSING_MPI_File_set_view 1 -#define PyMPI_MISSING_MPI_File_read_at 1 -#define PyMPI_MISSING_MPI_File_read_at_all 1 -#define PyMPI_MISSING_MPI_File_write_at 1 -#define PyMPI_MISSING_MPI_File_write_at_all 1 -#define PyMPI_MISSING_MPI_File_iread_at 1 -#define PyMPI_MISSING_MPI_File_iwrite_at 1 -#define PyMPI_MISSING_MPI_SEEK_SET 1 -#define PyMPI_MISSING_MPI_SEEK_CUR 1 -#define PyMPI_MISSING_MPI_SEEK_END 1 -#define PyMPI_MISSING_MPI_DISPLACEMENT_CURRENT 1 -#define PyMPI_MISSING_MPI_File_seek 1 -#define PyMPI_MISSING_MPI_File_get_position 1 -#define PyMPI_MISSING_MPI_File_get_byte_offset 1 -#define PyMPI_MISSING_MPI_File_read 1 -#define PyMPI_MISSING_MPI_File_read_all 1 -#define PyMPI_MISSING_MPI_File_write 1 -#define PyMPI_MISSING_MPI_File_write_all 1 -#define PyMPI_MISSING_MPI_File_iread 1 -#define PyMPI_MISSING_MPI_File_iwrite 1 -#define PyMPI_MISSING_MPI_File_read_shared 1 -#define PyMPI_MISSING_MPI_File_write_shared 1 -#define PyMPI_MISSING_MPI_File_iread_shared 1 -#define PyMPI_MISSING_MPI_File_iwrite_shared 1 -#define PyMPI_MISSING_MPI_File_read_ordered 1 -#define PyMPI_MISSING_MPI_File_write_ordered 1 -#define PyMPI_MISSING_MPI_File_seek_shared 1 -#define PyMPI_MISSING_MPI_File_get_position_shared 1 -#define PyMPI_MISSING_MPI_File_read_at_all_begin 1 -#define PyMPI_MISSING_MPI_File_read_at_all_end 1 -#define PyMPI_MISSING_MPI_File_write_at_all_begin 1 -#define PyMPI_MISSING_MPI_File_write_at_all_end 1 -#define PyMPI_MISSING_MPI_File_read_all_begin 1 -#define PyMPI_MISSING_MPI_File_read_all_end 1 -#define PyMPI_MISSING_MPI_File_write_all_begin 1 -#define PyMPI_MISSING_MPI_File_write_all_end 1 -#define PyMPI_MISSING_MPI_File_read_ordered_begin 1 -#define PyMPI_MISSING_MPI_File_read_ordered_end 1 -#define PyMPI_MISSING_MPI_File_write_ordered_begin 1 -#define PyMPI_MISSING_MPI_File_write_ordered_end 1 -#define PyMPI_MISSING_MPI_File_get_type_extent 1 -#define PyMPI_MISSING_MPI_File_set_atomicity 1 -#define PyMPI_MISSING_MPI_File_get_atomicity 1 -#define PyMPI_MISSING_MPI_File_sync 1 -#define PyMPI_MISSING_MPI_File_get_errhandler 1 -#define PyMPI_MISSING_MPI_File_set_errhandler 1 -#define PyMPI_MISSING_MPI_File_errhandler_fn 1 -#define PyMPI_MISSING_MPI_File_errhandler_function 1 -#define PyMPI_MISSING_MPI_File_create_errhandler 1 -#define PyMPI_MISSING_MPI_File_call_errhandler 1 +#undef PyMPI_HAVE_MPI_File +#undef PyMPI_HAVE_MPI_FILE_NULL +#undef PyMPI_HAVE_MPI_MODE_RDONLY +#undef PyMPI_HAVE_MPI_MODE_RDWR +#undef PyMPI_HAVE_MPI_MODE_WRONLY +#undef PyMPI_HAVE_MPI_MODE_CREATE +#undef PyMPI_HAVE_MPI_MODE_EXCL +#undef PyMPI_HAVE_MPI_MODE_DELETE_ON_CLOSE +#undef PyMPI_HAVE_MPI_MODE_UNIQUE_OPEN +#undef PyMPI_HAVE_MPI_MODE_APPEND +#undef PyMPI_HAVE_MPI_MODE_SEQUENTIAL +#undef PyMPI_HAVE_MPI_File_open +#undef PyMPI_HAVE_MPI_File_close +#undef PyMPI_HAVE_MPI_File_delete +#undef PyMPI_HAVE_MPI_File_set_size +#undef PyMPI_HAVE_MPI_File_preallocate +#undef PyMPI_HAVE_MPI_File_get_size +#undef PyMPI_HAVE_MPI_File_get_group +#undef PyMPI_HAVE_MPI_File_get_amode +#undef PyMPI_HAVE_MPI_File_set_info +#undef PyMPI_HAVE_MPI_File_get_info +#undef PyMPI_HAVE_MPI_File_get_view +#undef PyMPI_HAVE_MPI_File_set_view +#undef PyMPI_HAVE_MPI_File_read_at +#undef PyMPI_HAVE_MPI_File_read_at_all +#undef PyMPI_HAVE_MPI_File_write_at +#undef PyMPI_HAVE_MPI_File_write_at_all +#undef PyMPI_HAVE_MPI_File_iread_at +#undef PyMPI_HAVE_MPI_File_iwrite_at +#undef PyMPI_HAVE_MPI_SEEK_SET +#undef PyMPI_HAVE_MPI_SEEK_CUR +#undef PyMPI_HAVE_MPI_SEEK_END +#undef PyMPI_HAVE_MPI_DISPLACEMENT_CURRENT +#undef PyMPI_HAVE_MPI_File_seek +#undef PyMPI_HAVE_MPI_File_get_position +#undef PyMPI_HAVE_MPI_File_get_byte_offset +#undef PyMPI_HAVE_MPI_File_read +#undef PyMPI_HAVE_MPI_File_read_all +#undef PyMPI_HAVE_MPI_File_write +#undef PyMPI_HAVE_MPI_File_write_all +#undef PyMPI_HAVE_MPI_File_iread +#undef PyMPI_HAVE_MPI_File_iwrite +#undef PyMPI_HAVE_MPI_File_read_shared +#undef PyMPI_HAVE_MPI_File_write_shared +#undef PyMPI_HAVE_MPI_File_iread_shared +#undef PyMPI_HAVE_MPI_File_iwrite_shared +#undef PyMPI_HAVE_MPI_File_read_ordered +#undef PyMPI_HAVE_MPI_File_write_ordered +#undef PyMPI_HAVE_MPI_File_seek_shared +#undef PyMPI_HAVE_MPI_File_get_position_shared +#undef PyMPI_HAVE_MPI_File_read_at_all_begin +#undef PyMPI_HAVE_MPI_File_read_at_all_end +#undef PyMPI_HAVE_MPI_File_write_at_all_begin +#undef PyMPI_HAVE_MPI_File_write_at_all_end +#undef PyMPI_HAVE_MPI_File_read_all_begin +#undef PyMPI_HAVE_MPI_File_read_all_end +#undef PyMPI_HAVE_MPI_File_write_all_begin +#undef PyMPI_HAVE_MPI_File_write_all_end +#undef PyMPI_HAVE_MPI_File_read_ordered_begin +#undef PyMPI_HAVE_MPI_File_read_ordered_end +#undef PyMPI_HAVE_MPI_File_write_ordered_begin +#undef PyMPI_HAVE_MPI_File_write_ordered_end +#undef PyMPI_HAVE_MPI_File_get_type_extent +#undef PyMPI_HAVE_MPI_File_set_atomicity +#undef PyMPI_HAVE_MPI_File_get_atomicity +#undef PyMPI_HAVE_MPI_File_sync +#undef PyMPI_HAVE_MPI_File_get_errhandler +#undef PyMPI_HAVE_MPI_File_set_errhandler +#undef PyMPI_HAVE_MPI_File_errhandler_fn +#undef PyMPI_HAVE_MPI_File_errhandler_function +#undef PyMPI_HAVE_MPI_File_create_errhandler +#undef PyMPI_HAVE_MPI_File_call_errhandler -#define PyMPI_MISSING_MPI_Datarep_conversion_function 1 -#define PyMPI_MISSING_MPI_Datarep_extent_function 1 -#define PyMPI_MISSING_MPI_CONVERSION_FN_NULL 1 -#define PyMPI_MISSING_MPI_MAX_DATAREP_STRING 1 -#define PyMPI_MISSING_MPI_Register_datarep 1 +#undef PyMPI_HAVE_MPI_Datarep_conversion_function +#undef PyMPI_HAVE_MPI_Datarep_extent_function +#undef PyMPI_HAVE_MPI_CONVERSION_FN_NULL +#undef PyMPI_HAVE_MPI_MAX_DATAREP_STRING +#undef PyMPI_HAVE_MPI_Register_datarep -#define PyMPI_MISSING_MPI_File_c2f 1 -#define PyMPI_MISSING_MPI_File_f2c 1 +#undef PyMPI_HAVE_MPI_File_c2f +#undef PyMPI_HAVE_MPI_File_f2c #if !defined(MPI_ERR_FILE) -#define PyMPI_MISSING_MPI_ERR_FILE 1 -#define PyMPI_MISSING_MPI_ERR_NOT_SAME 1 -#define PyMPI_MISSING_MPI_ERR_BAD_FILE 1 -#define PyMPI_MISSING_MPI_ERR_NO_SUCH_FILE 1 -#define PyMPI_MISSING_MPI_ERR_FILE_EXISTS 1 -#define PyMPI_MISSING_MPI_ERR_FILE_IN_USE 1 -#define PyMPI_MISSING_MPI_ERR_AMODE 1 -#define PyMPI_MISSING_MPI_ERR_ACCESS 1 -#define PyMPI_MISSING_MPI_ERR_READ_ONLY 1 -#define PyMPI_MISSING_MPI_ERR_NO_SPACE 1 -#define PyMPI_MISSING_MPI_ERR_QUOTA 1 -#define PyMPI_MISSING_MPI_ERR_UNSUPPORTED_DATAREP 1 -#define PyMPI_MISSING_MPI_ERR_UNSUPPORTED_OPERATION 1 -#define PyMPI_MISSING_MPI_ERR_CONVERSION 1 -#define PyMPI_MISSING_MPI_ERR_DUP_DATAREP 1 -#define PyMPI_MISSING_MPI_ERR_IO 1 +#undef PyMPI_HAVE_MPI_ERR_FILE +#undef PyMPI_HAVE_MPI_ERR_NOT_SAME +#undef PyMPI_HAVE_MPI_ERR_BAD_FILE +#undef PyMPI_HAVE_MPI_ERR_NO_SUCH_FILE +#undef PyMPI_HAVE_MPI_ERR_FILE_EXISTS +#undef PyMPI_HAVE_MPI_ERR_FILE_IN_USE +#undef PyMPI_HAVE_MPI_ERR_AMODE +#undef PyMPI_HAVE_MPI_ERR_ACCESS +#undef PyMPI_HAVE_MPI_ERR_READ_ONLY +#undef PyMPI_HAVE_MPI_ERR_NO_SPACE +#undef PyMPI_HAVE_MPI_ERR_QUOTA +#undef PyMPI_HAVE_MPI_ERR_UNSUPPORTED_DATAREP +#undef PyMPI_HAVE_MPI_ERR_UNSUPPORTED_OPERATION +#undef PyMPI_HAVE_MPI_ERR_CONVERSION +#undef PyMPI_HAVE_MPI_ERR_DUP_DATAREP +#undef PyMPI_HAVE_MPI_ERR_IO #endif #endif /* !PyMPI_CONFIG_MPICH2_IO_H */ diff --git a/src/config/mpich2.h b/src/config/mpich2.h index ea0ccda..e60bfce 100644 --- a/src/config/mpich2.h +++ b/src/config/mpich2.h @@ -1,18 +1,15 @@ #ifndef PyMPI_CONFIG_MPICH2_H #define PyMPI_CONFIG_MPICH2_H +#include "mpi-11.h" +#include "mpi-12.h" +#include "mpi-20.h" #include "mpi-22.h" #include "mpi-30.h" -/* These types are Open MPI extensions */ -#define PyMPI_MISSING_MPI_LOGICAL1 1 -#define PyMPI_MISSING_MPI_LOGICAL2 1 -#define PyMPI_MISSING_MPI_LOGICAL4 1 -#define PyMPI_MISSING_MPI_LOGICAL8 1 - /* These types are difficult to implement portably */ -#define PyMPI_MISSING_MPI_REAL2 1 -#define PyMPI_MISSING_MPI_COMPLEX4 1 +#undef PyMPI_HAVE_MPI_REAL2 +#undef PyMPI_HAVE_MPI_COMPLEX4 #if defined(MPI_UNWEIGHTED) && (MPICH2_NUMVERSION < 10300000) #undef MPI_UNWEIGHTED @@ -20,28 +17,27 @@ #endif /* MPICH2 < 1.3.0 */ #if !defined(MPICH2_NUMVERSION) || (MPICH2_NUMVERSION < 10100000) -#define PyMPI_MISSING_MPI_Type_create_f90_integer 1 -#define PyMPI_MISSING_MPI_Type_create_f90_real 1 -#define PyMPI_MISSING_MPI_Type_create_f90_complex 1 +#undef PyMPI_HAVE_MPI_Type_create_f90_integer +#undef PyMPI_HAVE_MPI_Type_create_f90_real +#undef PyMPI_HAVE_MPI_Type_create_f90_complex #endif /* MPICH2 < 1.1.0 */ #ifndef ROMIO_VERSION #include "mpich2-io.h" #endif -#if MPI_VERSION < 3 -#if defined(MPICH2_NUMVERSION) && \ - MPICH2_NUMVERSION >= 10500000 && \ - MPICH2_NUMVERSION < 20000000 -/**/ +#if MPI_VERSION < 3 && defined(MPICH2_NUMVERSION) +#if MPICH2_NUMVERSION >= 10500000 && \ + MPICH2_NUMVERSION < 20000000 + #if 0 /*XXX*/ -#undef PyMPI_MISSING_MPI_Count -#undef PyMPI_MISSING_MPI_COUNT -#undef PyMPI_MISSING_MPI_Type_size_x -#undef PyMPI_MISSING_MPI_Type_get_extent_x -#undef PyMPI_MISSING_MPI_Type_get_true_extent_x -#undef PyMPI_MISSING_MPI_Get_elements_x -#undef PyMPI_MISSING_MPI_Status_set_elements_x +#define PyMPI_HAVE_MPI_Count 1 +#define PyMPI_HAVE_MPI_COUNT 1 +#define PyMPI_HAVE_MPI_Type_size_x 1 +#define PyMPI_HAVE_MPI_Type_get_extent_x 1 +#define PyMPI_HAVE_MPI_Type_get_true_extent_x 1 +#define PyMPI_HAVE_MPI_Get_elements_x 1 +#define PyMPI_HAVE_MPI_Status_set_elements_x 1 #define MPI_Count MPIX_Count #define MPI_COUNT MPIX_COUNT #define MPI_Type_size_x MPIX_Type_size_x @@ -50,24 +46,24 @@ #define MPI_Get_elements_x MPIX_Get_elements_x #define MPI_Status_set_elements_x MPIX_Status_set_elements_x #endif -/**/ -#undef PyMPI_MISSING_MPI_COMBINER_HINDEXED_BLOCK -#undef PyMPI_MISSING_MPI_Type_create_hindexed_block + +#define PyMPI_HAVE_MPI_COMBINER_HINDEXED_BLOCK 1 +#define PyMPI_HAVE_MPI_Type_create_hindexed_block 1 #define MPI_COMBINER_HINDEXED_BLOCK MPIX_COMBINER_HINDEXED_BLOCK #define MPI_Type_create_hindexed_block MPIX_Type_create_hindexed_block -/**/ -#undef PyMPI_MISSING_MPI_NO_OP + +#define PyMPI_HAVE_MPI_NO_OP 1 #define MPI_NO_OP MPIX_NO_OP -/**/ -#undef PyMPI_MISSING_MPI_Message -#undef PyMPI_MISSING_MPI_MESSAGE_NULL -#undef PyMPI_MISSING_MPI_MESSAGE_NO_PROC -#undef PyMPI_MISSING_MPI_Message_c2f -#undef PyMPI_MISSING_MPI_Message_f2c -#undef PyMPI_MISSING_MPI_Mprobe -#undef PyMPI_MISSING_MPI_Improbe -#undef PyMPI_MISSING_MPI_Mrecv -#undef PyMPI_MISSING_MPI_Imrecv + +#define PyMPI_HAVE_MPI_Message 1 +#define PyMPI_HAVE_MPI_MESSAGE_NULL 1 +#define PyMPI_HAVE_MPI_MESSAGE_NO_PROC 1 +#define PyMPI_HAVE_MPI_Message_c2f 1 +#define PyMPI_HAVE_MPI_Message_f2c 1 +#define PyMPI_HAVE_MPI_Mprobe 1 +#define PyMPI_HAVE_MPI_Improbe 1 +#define PyMPI_HAVE_MPI_Mrecv 1 +#define PyMPI_HAVE_MPI_Imrecv 1 #define MPI_Message MPIX_Message #define MPI_MESSAGE_NULL MPIX_MESSAGE_NULL #define MPI_MESSAGE_NO_PROC MPIX_MESSAGE_NO_PROC @@ -77,24 +73,24 @@ #define MPI_Improbe MPIX_Improbe #define MPI_Mrecv MPIX_Mrecv #define MPI_Imrecv MPIX_Imrecv -/**/ -#undef PyMPI_MISSING_MPI_Ibarrier -#undef PyMPI_MISSING_MPI_Ibcast -#undef PyMPI_MISSING_MPI_Igather -#undef PyMPI_MISSING_MPI_Igatherv -#undef PyMPI_MISSING_MPI_Iscatter -#undef PyMPI_MISSING_MPI_Iscatterv -#undef PyMPI_MISSING_MPI_Iallgather -#undef PyMPI_MISSING_MPI_Iallgatherv -#undef PyMPI_MISSING_MPI_Ialltoall -#undef PyMPI_MISSING_MPI_Ialltoallv -#undef PyMPI_MISSING_MPI_Ialltoallw -#undef PyMPI_MISSING_MPI_Ireduce -#undef PyMPI_MISSING_MPI_Iallreduce -#undef PyMPI_MISSING_MPI_Ireduce_scatter_block -#undef PyMPI_MISSING_MPI_Ireduce_scatter -#undef PyMPI_MISSING_MPI_Iscan -#undef PyMPI_MISSING_MPI_Iexscan + +#define PyMPI_HAVE_MPI_Ibarrier 1 +#define PyMPI_HAVE_MPI_Ibcast 1 +#define PyMPI_HAVE_MPI_Igather 1 +#define PyMPI_HAVE_MPI_Igatherv 1 +#define PyMPI_HAVE_MPI_Iscatter 1 +#define PyMPI_HAVE_MPI_Iscatterv 1 +#define PyMPI_HAVE_MPI_Iallgather 1 +#define PyMPI_HAVE_MPI_Iallgatherv 1 +#define PyMPI_HAVE_MPI_Ialltoall 1 +#define PyMPI_HAVE_MPI_Ialltoallv 1 +#define PyMPI_HAVE_MPI_Ialltoallw 1 +#define PyMPI_HAVE_MPI_Ireduce 1 +#define PyMPI_HAVE_MPI_Iallreduce 1 +#define PyMPI_HAVE_MPI_Ireduce_scatter_block 1 +#define PyMPI_HAVE_MPI_Ireduce_scatter 1 +#define PyMPI_HAVE_MPI_Iscan 1 +#define PyMPI_HAVE_MPI_Iexscan 1 #define MPI_Ibarrier MPIX_Ibarrier #define MPI_Ibcast MPIX_Ibcast #define MPI_Igather MPIX_Igather @@ -112,93 +108,94 @@ #define MPI_Ireduce_scatter MPIX_Ireduce_scatter #define MPI_Iscan MPIX_Iscan #define MPI_Iexscan MPIX_Iexscan -/**/ -#undef PyMPI_MISSING_MPI_Neighbor_allgather -#undef PyMPI_MISSING_MPI_Neighbor_allgatherv -#undef PyMPI_MISSING_MPI_Neighbor_alltoall -#undef PyMPI_MISSING_MPI_Neighbor_alltoallv -#undef PyMPI_MISSING_MPI_Neighbor_alltoallw + +#define PyMPI_HAVE_MPI_Neighbor_allgather 1 +#define PyMPI_HAVE_MPI_Neighbor_allgatherv 1 +#define PyMPI_HAVE_MPI_Neighbor_alltoall 1 +#define PyMPI_HAVE_MPI_Neighbor_alltoallv 1 +#define PyMPI_HAVE_MPI_Neighbor_alltoallw 1 #define MPI_Neighbor_allgather MPIX_Neighbor_allgather #define MPI_Neighbor_allgatherv MPIX_Neighbor_allgatherv #define MPI_Neighbor_alltoall MPIX_Neighbor_alltoall #define MPI_Neighbor_alltoallv MPIX_Neighbor_alltoallv #define MPI_Neighbor_alltoallw MPIX_Neighbor_alltoallw -#undef PyMPI_MISSING_MPI_Ineighbor_allgather -#undef PyMPI_MISSING_MPI_Ineighbor_allgatherv -#undef PyMPI_MISSING_MPI_Ineighbor_alltoall -#undef PyMPI_MISSING_MPI_Ineighbor_alltoallv -#undef PyMPI_MISSING_MPI_Ineighbor_alltoallw +#define PyMPI_HAVE_MPI_Ineighbor_allgather 1 +#define PyMPI_HAVE_MPI_Ineighbor_allgatherv 1 +#define PyMPI_HAVE_MPI_Ineighbor_alltoall 1 +#define PyMPI_HAVE_MPI_Ineighbor_alltoallv 1 +#define PyMPI_HAVE_MPI_Ineighbor_alltoallw 1 #define MPI_Ineighbor_allgather MPIX_Ineighbor_allgather #define MPI_Ineighbor_allgatherv MPIX_Ineighbor_allgatherv #define MPI_Ineighbor_alltoall MPIX_Ineighbor_alltoall #define MPI_Ineighbor_alltoallv MPIX_Ineighbor_alltoallv #define MPI_Ineighbor_alltoallw MPIX_Ineighbor_alltoallw -/**/ -#undef PyMPI_MISSING_MPI_Comm_idup -#undef PyMPI_MISSING_MPI_Comm_create_group -#undef PyMPI_MISSING_MPI_COMM_TYPE_SHARED -#undef PyMPI_MISSING_MPI_Comm_split_type + +#define PyMPI_HAVE_MPI_Comm_idup 1 +#define PyMPI_HAVE_MPI_Comm_create_group 1 +#define PyMPI_HAVE_MPI_COMM_TYPE_SHARED 1 +#define PyMPI_HAVE_MPI_Comm_split_type 1 #define MPI_Comm_idup MPIX_Comm_idup #define MPI_Comm_create_group MPIX_Comm_create_group #define MPI_COMM_TYPE_SHARED MPIX_COMM_TYPE_SHARED #define MPI_Comm_split_type MPIX_Comm_split_type -/**/ -#undef PyMPI_MISSING_MPI_WIN_CREATE_FLAVOR -#undef PyMPI_MISSING_MPI_WIN_FLAVOR_CREATE -#undef PyMPI_MISSING_MPI_WIN_FLAVOR_ALLOCATE -#undef PyMPI_MISSING_MPI_WIN_FLAVOR_DYNAMIC -#undef PyMPI_MISSING_MPI_WIN_FLAVOR_SHARED + +#define PyMPI_HAVE_MPI_WIN_CREATE_FLAVOR 1 +#define PyMPI_HAVE_MPI_WIN_FLAVOR_CREATE 1 +#define PyMPI_HAVE_MPI_WIN_FLAVOR_ALLOCATE 1 +#define PyMPI_HAVE_MPI_WIN_FLAVOR_DYNAMIC 1 +#define PyMPI_HAVE_MPI_WIN_FLAVOR_SHARED 1 #define MPI_WIN_CREATE_FLAVOR MPIX_WIN_CREATE_FLAVOR #define MPI_WIN_FLAVOR_CREATE MPIX_WIN_FLAVOR_CREATE #define MPI_WIN_FLAVOR_ALLOCATE MPIX_WIN_FLAVOR_ALLOCATE #define MPI_WIN_FLAVOR_DYNAMIC MPIX_WIN_FLAVOR_DYNAMIC #define MPI_WIN_FLAVOR_SHARED MPIX_WIN_FLAVOR_SHARED -#undef PyMPI_MISSING_MPI_WIN_MODEL -#undef PyMPI_MISSING_MPI_WIN_SEPARATE -#undef PyMPI_MISSING_MPI_WIN_UNIFIED +#define PyMPI_HAVE_MPI_WIN_MODEL 1 +#define PyMPI_HAVE_MPI_WIN_SEPARATE 1 +#define PyMPI_HAVE_MPI_WIN_UNIFIED 1 #define MPI_WIN_MODEL MPIX_WIN_MODEL #define MPI_WIN_SEPARATE MPIX_WIN_SEPARATE #define MPI_WIN_UNIFIED MPIX_WIN_UNIFIED -#undef PyMPI_MISSING_MPI_Win_allocate +#define PyMPI_HAVE_MPI_Win_allocate 1 #define MPI_Win_allocate MPIX_Win_allocate -#undef PyMPI_MISSING_MPI_Win_allocate_shared -#undef PyMPI_MISSING_MPI_Win_shared_query +#define PyMPI_HAVE_MPI_Win_allocate_shared 1 +#define PyMPI_HAVE_MPI_Win_shared_query 1 #define MPI_Win_allocate_shared MPIX_Win_allocate_shared #define MPI_Win_shared_query MPIX_Win_shared_query -#undef PyMPI_MISSING_MPI_Win_create_dynamic -#undef PyMPI_MISSING_MPI_Win_attach -#undef PyMPI_MISSING_MPI_Win_detach +#define PyMPI_HAVE_MPI_Win_create_dynamic 1 +#define PyMPI_HAVE_MPI_Win_attach 1 +#define PyMPI_HAVE_MPI_Win_detach 1 #define MPI_Win_create_dynamic MPIX_Win_create_dynamic #define MPI_Win_attach MPIX_Win_attach #define MPI_Win_detach MPIX_Win_detach #if 0 /*XXX*/ -#undef PyMPI_MISSING_MPI_Win_set_info -#undef PyMPI_MISSING_MPI_Win_get_info +#define PyMPI_HAVE_MPI_Win_set_info 1 +#define PyMPI_HAVE_MPI_Win_get_info 1 #define MPI_Win_set_info MPIX_Win_set_info #define MPI_Win_get_info MPIX_Win_get_info #endif/*XXX*/ -#undef PyMPI_MISSING_MPI_Get_accumulate -#undef PyMPI_MISSING_MPI_Fetch_and_op -#undef PyMPI_MISSING_MPI_Compare_and_swap + +#define PyMPI_HAVE_MPI_Get_accumulate 1 +#define PyMPI_HAVE_MPI_Fetch_and_op 1 +#define PyMPI_HAVE_MPI_Compare_and_swap 1 #define MPI_Get_accumulate MPIX_Get_accumulate #define MPI_Fetch_and_op MPIX_Fetch_and_op #define MPI_Compare_and_swap MPIX_Compare_and_swap -#undef PyMPI_MISSING_MPI_Rget -#undef PyMPI_MISSING_MPI_Rput -#undef PyMPI_MISSING_MPI_Raccumulate -#undef PyMPI_MISSING_MPI_Rget_accumulate +#define PyMPI_HAVE_MPI_Rget 1 +#define PyMPI_HAVE_MPI_Rput 1 +#define PyMPI_HAVE_MPI_Raccumulate 1 +#define PyMPI_HAVE_MPI_Rget_accumulate 1 #define MPI_Rget MPIX_Rget #define MPI_Rput MPIX_Rput #define MPI_Raccumulate MPIX_Raccumulate #define MPI_Rget_accumulate MPIX_Rget_accumulate -#undef PyMPI_MISSING_MPI_Win_lock_all -#undef PyMPI_MISSING_MPI_Win_unlock_all -#undef PyMPI_MISSING_MPI_Win_flush -#undef PyMPI_MISSING_MPI_Win_flush_all -#undef PyMPI_MISSING_MPI_Win_flush_local -#undef PyMPI_MISSING_MPI_Win_flush_local_all -#undef PyMPI_MISSING_MPI_Win_sync +#define PyMPI_HAVE_MPI_Win_lock_all 1 +#define PyMPI_HAVE_MPI_Win_unlock_all 1 +#define PyMPI_HAVE_MPI_Win_flush 1 +#define PyMPI_HAVE_MPI_Win_flush_all 1 +#define PyMPI_HAVE_MPI_Win_flush_local 1 +#define PyMPI_HAVE_MPI_Win_flush_local_all 1 +#define PyMPI_HAVE_MPI_Win_sync #define MPI_Win_lock_all MPIX_Win_lock_all #define MPI_Win_unlock_all MPIX_Win_unlock_all #define MPI_Win_flush MPIX_Win_flush @@ -206,33 +203,33 @@ #define MPI_Win_flush_local MPIX_Win_flush_local #define MPI_Win_flush_local_all MPIX_Win_flush_local_all #define MPI_Win_sync MPIX_Win_sync -#undef PyMPI_MISSING_MPI_ERR_RMA_RANGE -#undef PyMPI_MISSING_MPI_ERR_RMA_ATTACH -#undef PyMPI_MISSING_MPI_ERR_RMA_SHARED -#undef PyMPI_MISSING_MPI_ERR_RMA_FLAVOR +#define PyMPI_HAVE_MPI_ERR_RMA_RANGE 1 +#define PyMPI_HAVE_MPI_ERR_RMA_ATTACH 1 +#define PyMPI_HAVE_MPI_ERR_RMA_SHARED 1 +#define PyMPI_HAVE_MPI_ERR_RMA_FLAVOR 1 #define MPI_ERR_RMA_RANGE MPIX_ERR_RMA_RANGE #define MPI_ERR_RMA_ATTACH MPIX_ERR_RMA_ATTACH #define MPI_ERR_RMA_SHARED MPIX_ERR_RMA_SHARED #define MPI_ERR_RMA_FLAVOR MPIX_ERR_RMA_WRONG_FLAVOR -/**/ + #if 0 /*XXX*/ -#undef PyMPI_MISSING_MPI_Comm_dup_with_info -#undef PyMPI_MISSING_MPI_Comm_set_info -#undef PyMPI_MISSING_MPI_Comm_get_info +#define PyMPI_HAVE_MPI_Comm_dup_with_info 1 +#define PyMPI_HAVE_MPI_Comm_set_info 1 +#define PyMPI_HAVE_MPI_Comm_get_info 1 #define MPI_Comm_dup_with_info MPIX_Comm_dup_with_info #define MPI_Comm_set_info MPIX_Comm_set_info #define MPI_Comm_get_info MPIX_Comm_get_info #endif/*XXX*/ -/**/ + #if 0 /*XXX*/ -#undef PyMPI_MISSING_MPI_MAX_LIBRARY_VERSION_STRING -#undef PyMPI_MISSING_MPI_Get_library_version -#undef PyMPI_MISSING_MPI_INFO_ENV +#define PyMPI_HAVE_MPI_MAX_LIBRARY_VERSION_STRING 1 +#define PyMPI_HAVE_MPI_Get_library_version 1 +#define PyMPI_HAVE_MPI_INFO_ENV 1 #define MPI_MAX_LIBRARY_VERSION_STRING MPIX_MAX_LIBRARY_VERSION_STRING #define MPI_Get_library_version MPIX_Get_library_version #define MPI_INFO_ENV MPIX_INFO_ENV #endif/*XXX*/ -/**/ + #endif /* MPICH2 < 1.5*/ #endif /* MPI < 3.0*/ diff --git a/src/config/mpich3-io.h b/src/config/mpich3-io.h index a7f3567..122499b 100644 --- a/src/config/mpich3-io.h +++ b/src/config/mpich3-io.h @@ -1,86 +1,86 @@ #ifndef PyMPI_CONFIG_MPICH3_IO_H -#define PyMPI_CONFIG_MPICH3_IO_H +#undef PyMPI_CONFIG_MPICH3_IO_H -#define PyMPI_MISSING_MPI_File 1 -#define PyMPI_MISSING_MPI_FILE_NULL 1 -#define PyMPI_MISSING_MPI_MODE_RDONLY 1 -#define PyMPI_MISSING_MPI_MODE_RDWR 1 -#define PyMPI_MISSING_MPI_MODE_WRONLY 1 -#define PyMPI_MISSING_MPI_MODE_CREATE 1 -#define PyMPI_MISSING_MPI_MODE_EXCL 1 -#define PyMPI_MISSING_MPI_MODE_DELETE_ON_CLOSE 1 -#define PyMPI_MISSING_MPI_MODE_UNIQUE_OPEN 1 -#define PyMPI_MISSING_MPI_MODE_APPEND 1 -#define PyMPI_MISSING_MPI_MODE_SEQUENTIAL 1 -#define PyMPI_MISSING_MPI_File_open 1 -#define PyMPI_MISSING_MPI_File_close 1 -#define PyMPI_MISSING_MPI_File_delete 1 -#define PyMPI_MISSING_MPI_File_set_size 1 -#define PyMPI_MISSING_MPI_File_preallocate 1 -#define PyMPI_MISSING_MPI_File_get_size 1 -#define PyMPI_MISSING_MPI_File_get_group 1 -#define PyMPI_MISSING_MPI_File_get_amode 1 -#define PyMPI_MISSING_MPI_File_set_info 1 -#define PyMPI_MISSING_MPI_File_get_info 1 -#define PyMPI_MISSING_MPI_File_get_view 1 -#define PyMPI_MISSING_MPI_File_set_view 1 -#define PyMPI_MISSING_MPI_File_read_at 1 -#define PyMPI_MISSING_MPI_File_read_at_all 1 -#define PyMPI_MISSING_MPI_File_write_at 1 -#define PyMPI_MISSING_MPI_File_write_at_all 1 -#define PyMPI_MISSING_MPI_File_iread_at 1 -#define PyMPI_MISSING_MPI_File_iwrite_at 1 -#define PyMPI_MISSING_MPI_SEEK_SET 1 -#define PyMPI_MISSING_MPI_SEEK_CUR 1 -#define PyMPI_MISSING_MPI_SEEK_END 1 -#define PyMPI_MISSING_MPI_DISPLACEMENT_CURRENT 1 -#define PyMPI_MISSING_MPI_File_seek 1 -#define PyMPI_MISSING_MPI_File_get_position 1 -#define PyMPI_MISSING_MPI_File_get_byte_offset 1 -#define PyMPI_MISSING_MPI_File_read 1 -#define PyMPI_MISSING_MPI_File_read_all 1 -#define PyMPI_MISSING_MPI_File_write 1 -#define PyMPI_MISSING_MPI_File_write_all 1 -#define PyMPI_MISSING_MPI_File_iread 1 -#define PyMPI_MISSING_MPI_File_iwrite 1 -#define PyMPI_MISSING_MPI_File_read_shared 1 -#define PyMPI_MISSING_MPI_File_write_shared 1 -#define PyMPI_MISSING_MPI_File_iread_shared 1 -#define PyMPI_MISSING_MPI_File_iwrite_shared 1 -#define PyMPI_MISSING_MPI_File_read_ordered 1 -#define PyMPI_MISSING_MPI_File_write_ordered 1 -#define PyMPI_MISSING_MPI_File_seek_shared 1 -#define PyMPI_MISSING_MPI_File_get_position_shared 1 -#define PyMPI_MISSING_MPI_File_read_at_all_begin 1 -#define PyMPI_MISSING_MPI_File_read_at_all_end 1 -#define PyMPI_MISSING_MPI_File_write_at_all_begin 1 -#define PyMPI_MISSING_MPI_File_write_at_all_end 1 -#define PyMPI_MISSING_MPI_File_read_all_begin 1 -#define PyMPI_MISSING_MPI_File_read_all_end 1 -#define PyMPI_MISSING_MPI_File_write_all_begin 1 -#define PyMPI_MISSING_MPI_File_write_all_end 1 -#define PyMPI_MISSING_MPI_File_read_ordered_begin 1 -#define PyMPI_MISSING_MPI_File_read_ordered_end 1 -#define PyMPI_MISSING_MPI_File_write_ordered_begin 1 -#define PyMPI_MISSING_MPI_File_write_ordered_end 1 -#define PyMPI_MISSING_MPI_File_get_type_extent 1 -#define PyMPI_MISSING_MPI_File_set_atomicity 1 -#define PyMPI_MISSING_MPI_File_get_atomicity 1 -#define PyMPI_MISSING_MPI_File_sync 1 -#define PyMPI_MISSING_MPI_File_get_errhandler 1 -#define PyMPI_MISSING_MPI_File_set_errhandler 1 -#define PyMPI_MISSING_MPI_File_errhandler_fn 1 -#define PyMPI_MISSING_MPI_File_errhandler_function 1 -#define PyMPI_MISSING_MPI_File_create_errhandler 1 -#define PyMPI_MISSING_MPI_File_call_errhandler 1 +#undef PyMPI_HAVE_MPI_File +#undef PyMPI_HAVE_MPI_FILE_NULL +#undef PyMPI_HAVE_MPI_MODE_RDONLY +#undef PyMPI_HAVE_MPI_MODE_RDWR +#undef PyMPI_HAVE_MPI_MODE_WRONLY +#undef PyMPI_HAVE_MPI_MODE_CREATE +#undef PyMPI_HAVE_MPI_MODE_EXCL +#undef PyMPI_HAVE_MPI_MODE_DELETE_ON_CLOSE +#undef PyMPI_HAVE_MPI_MODE_UNIQUE_OPEN +#undef PyMPI_HAVE_MPI_MODE_APPEND +#undef PyMPI_HAVE_MPI_MODE_SEQUENTIAL +#undef PyMPI_HAVE_MPI_File_open +#undef PyMPI_HAVE_MPI_File_close +#undef PyMPI_HAVE_MPI_File_delete +#undef PyMPI_HAVE_MPI_File_set_size +#undef PyMPI_HAVE_MPI_File_preallocate +#undef PyMPI_HAVE_MPI_File_get_size +#undef PyMPI_HAVE_MPI_File_get_group +#undef PyMPI_HAVE_MPI_File_get_amode +#undef PyMPI_HAVE_MPI_File_set_info +#undef PyMPI_HAVE_MPI_File_get_info +#undef PyMPI_HAVE_MPI_File_get_view +#undef PyMPI_HAVE_MPI_File_set_view +#undef PyMPI_HAVE_MPI_File_read_at +#undef PyMPI_HAVE_MPI_File_read_at_all +#undef PyMPI_HAVE_MPI_File_write_at +#undef PyMPI_HAVE_MPI_File_write_at_all +#undef PyMPI_HAVE_MPI_File_iread_at +#undef PyMPI_HAVE_MPI_File_iwrite_at +#undef PyMPI_HAVE_MPI_SEEK_SET +#undef PyMPI_HAVE_MPI_SEEK_CUR +#undef PyMPI_HAVE_MPI_SEEK_END +#undef PyMPI_HAVE_MPI_DISPLACEMENT_CURRENT +#undef PyMPI_HAVE_MPI_File_seek +#undef PyMPI_HAVE_MPI_File_get_position +#undef PyMPI_HAVE_MPI_File_get_byte_offset +#undef PyMPI_HAVE_MPI_File_read +#undef PyMPI_HAVE_MPI_File_read_all +#undef PyMPI_HAVE_MPI_File_write +#undef PyMPI_HAVE_MPI_File_write_all +#undef PyMPI_HAVE_MPI_File_iread +#undef PyMPI_HAVE_MPI_File_iwrite +#undef PyMPI_HAVE_MPI_File_read_shared +#undef PyMPI_HAVE_MPI_File_write_shared +#undef PyMPI_HAVE_MPI_File_iread_shared +#undef PyMPI_HAVE_MPI_File_iwrite_shared +#undef PyMPI_HAVE_MPI_File_read_ordered +#undef PyMPI_HAVE_MPI_File_write_ordered +#undef PyMPI_HAVE_MPI_File_seek_shared +#undef PyMPI_HAVE_MPI_File_get_position_shared +#undef PyMPI_HAVE_MPI_File_read_at_all_begin +#undef PyMPI_HAVE_MPI_File_read_at_all_end +#undef PyMPI_HAVE_MPI_File_write_at_all_begin +#undef PyMPI_HAVE_MPI_File_write_at_all_end +#undef PyMPI_HAVE_MPI_File_read_all_begin +#undef PyMPI_HAVE_MPI_File_read_all_end +#undef PyMPI_HAVE_MPI_File_write_all_begin +#undef PyMPI_HAVE_MPI_File_write_all_end +#undef PyMPI_HAVE_MPI_File_read_ordered_begin +#undef PyMPI_HAVE_MPI_File_read_ordered_end +#undef PyMPI_HAVE_MPI_File_write_ordered_begin +#undef PyMPI_HAVE_MPI_File_write_ordered_end +#undef PyMPI_HAVE_MPI_File_get_type_extent +#undef PyMPI_HAVE_MPI_File_set_atomicity +#undef PyMPI_HAVE_MPI_File_get_atomicity +#undef PyMPI_HAVE_MPI_File_sync +#undef PyMPI_HAVE_MPI_File_get_errhandler +#undef PyMPI_HAVE_MPI_File_set_errhandler +#undef PyMPI_HAVE_MPI_File_errhandler_fn +#undef PyMPI_HAVE_MPI_File_errhandler_function +#undef PyMPI_HAVE_MPI_File_create_errhandler +#undef PyMPI_HAVE_MPI_File_call_errhandler -#define PyMPI_MISSING_MPI_Datarep_conversion_function 1 -#define PyMPI_MISSING_MPI_Datarep_extent_function 1 -#define PyMPI_MISSING_MPI_CONVERSION_FN_NULL 1 -#define PyMPI_MISSING_MPI_MAX_DATAREP_STRING 1 -#define PyMPI_MISSING_MPI_Register_datarep 1 +#undef PyMPI_HAVE_MPI_Datarep_conversion_function +#undef PyMPI_HAVE_MPI_Datarep_extent_function +#undef PyMPI_HAVE_MPI_CONVERSION_FN_NULL +#undef PyMPI_HAVE_MPI_MAX_DATAREP_STRING +#undef PyMPI_HAVE_MPI_Register_datarep -#define PyMPI_MISSING_MPI_File_c2f 1 -#define PyMPI_MISSING_MPI_File_f2c 1 +#undef PyMPI_HAVE_MPI_File_c2f +#undef PyMPI_HAVE_MPI_File_f2c #endif /* !PyMPI_CONFIG_MPICH3_IO_H */ diff --git a/src/config/mpich3.h b/src/config/mpich3.h index 2708e5a..78cd9f9 100644 --- a/src/config/mpich3.h +++ b/src/config/mpich3.h @@ -1,15 +1,15 @@ #ifndef PyMPI_CONFIG_MPICH2_H #define PyMPI_CONFIG_MPICH2_H -/* These types are Open MPI extensions */ -#define PyMPI_MISSING_MPI_LOGICAL1 1 -#define PyMPI_MISSING_MPI_LOGICAL2 1 -#define PyMPI_MISSING_MPI_LOGICAL4 1 -#define PyMPI_MISSING_MPI_LOGICAL8 1 +#include "mpi-11.h" +#include "mpi-12.h" +#include "mpi-20.h" +#include "mpi-22.h" +#include "mpi-30.h" /* These types are difficult to implement portably */ -#define PyMPI_MISSING_MPI_REAL2 1 -#define PyMPI_MISSING_MPI_COMPLEX4 1 +#undef PyMPI_HAVE_MPI_REAL2 +#undef PyMPI_HAVE_MPI_COMPLEX4 #ifndef ROMIO_VERSION #include "mpich3-io.h" diff --git a/src/config/openmpi-io.h b/src/config/openmpi-io.h index 3bc7acc..e5d2092 100644 --- a/src/config/openmpi-io.h +++ b/src/config/openmpi-io.h @@ -1,105 +1,105 @@ #ifndef PyMPI_CONFIG_OPENMPI_IO_H #define PyMPI_CONFIG_OPENMPI_IO_H -#define PyMPI_MISSING_MPI_File 1 -#define PyMPI_MISSING_MPI_FILE_NULL 1 -#define PyMPI_MISSING_MPI_MODE_RDONLY 1 -#define PyMPI_MISSING_MPI_MODE_RDWR 1 -#define PyMPI_MISSING_MPI_MODE_WRONLY 1 -#define PyMPI_MISSING_MPI_MODE_CREATE 1 -#define PyMPI_MISSING_MPI_MODE_EXCL 1 -#define PyMPI_MISSING_MPI_MODE_DELETE_ON_CLOSE 1 -#define PyMPI_MISSING_MPI_MODE_UNIQUE_OPEN 1 -#define PyMPI_MISSING_MPI_MODE_APPEND 1 -#define PyMPI_MISSING_MPI_MODE_SEQUENTIAL 1 -#define PyMPI_MISSING_MPI_File_open 1 -#define PyMPI_MISSING_MPI_File_close 1 -#define PyMPI_MISSING_MPI_File_delete 1 -#define PyMPI_MISSING_MPI_File_set_size 1 -#define PyMPI_MISSING_MPI_File_preallocate 1 -#define PyMPI_MISSING_MPI_File_get_size 1 -#define PyMPI_MISSING_MPI_File_get_group 1 -#define PyMPI_MISSING_MPI_File_get_amode 1 -#define PyMPI_MISSING_MPI_File_set_info 1 -#define PyMPI_MISSING_MPI_File_get_info 1 -#define PyMPI_MISSING_MPI_File_get_view 1 -#define PyMPI_MISSING_MPI_File_set_view 1 -#define PyMPI_MISSING_MPI_File_read_at 1 -#define PyMPI_MISSING_MPI_File_read_at_all 1 -#define PyMPI_MISSING_MPI_File_write_at 1 -#define PyMPI_MISSING_MPI_File_write_at_all 1 -#define PyMPI_MISSING_MPI_File_iread_at 1 -#define PyMPI_MISSING_MPI_File_iwrite_at 1 -#define PyMPI_MISSING_MPI_SEEK_SET 1 -#define PyMPI_MISSING_MPI_SEEK_CUR 1 -#define PyMPI_MISSING_MPI_SEEK_END 1 -#define PyMPI_MISSING_MPI_DISPLACEMENT_CURRENT 1 -#define PyMPI_MISSING_MPI_File_seek 1 -#define PyMPI_MISSING_MPI_File_get_position 1 -#define PyMPI_MISSING_MPI_File_get_byte_offset 1 -#define PyMPI_MISSING_MPI_File_read 1 -#define PyMPI_MISSING_MPI_File_read_all 1 -#define PyMPI_MISSING_MPI_File_write 1 -#define PyMPI_MISSING_MPI_File_write_all 1 -#define PyMPI_MISSING_MPI_File_iread 1 -#define PyMPI_MISSING_MPI_File_iwrite 1 -#define PyMPI_MISSING_MPI_File_read_shared 1 -#define PyMPI_MISSING_MPI_File_write_shared 1 -#define PyMPI_MISSING_MPI_File_iread_shared 1 -#define PyMPI_MISSING_MPI_File_iwrite_shared 1 -#define PyMPI_MISSING_MPI_File_read_ordered 1 -#define PyMPI_MISSING_MPI_File_write_ordered 1 -#define PyMPI_MISSING_MPI_File_seek_shared 1 -#define PyMPI_MISSING_MPI_File_get_position_shared 1 -#define PyMPI_MISSING_MPI_File_read_at_all_begin 1 -#define PyMPI_MISSING_MPI_File_read_at_all_end 1 -#define PyMPI_MISSING_MPI_File_write_at_all_begin 1 -#define PyMPI_MISSING_MPI_File_write_at_all_end 1 -#define PyMPI_MISSING_MPI_File_read_all_begin 1 -#define PyMPI_MISSING_MPI_File_read_all_end 1 -#define PyMPI_MISSING_MPI_File_write_all_begin 1 -#define PyMPI_MISSING_MPI_File_write_all_end 1 -#define PyMPI_MISSING_MPI_File_read_ordered_begin 1 -#define PyMPI_MISSING_MPI_File_read_ordered_end 1 -#define PyMPI_MISSING_MPI_File_write_ordered_begin 1 -#define PyMPI_MISSING_MPI_File_write_ordered_end 1 -#define PyMPI_MISSING_MPI_File_get_type_extent 1 -#define PyMPI_MISSING_MPI_File_set_atomicity 1 -#define PyMPI_MISSING_MPI_File_get_atomicity 1 -#define PyMPI_MISSING_MPI_File_sync 1 -#define PyMPI_MISSING_MPI_File_get_errhandler 1 -#define PyMPI_MISSING_MPI_File_set_errhandler 1 -#define PyMPI_MISSING_MPI_File_errhandler_fn 1 -#define PyMPI_MISSING_MPI_File_errhandler_function 1 -#define PyMPI_MISSING_MPI_File_create_errhandler 1 -#define PyMPI_MISSING_MPI_File_call_errhandler 1 +#undef PyMPI_HAVE_MPI_File +#undef PyMPI_HAVE_MPI_FILE_NULL +#undef PyMPI_HAVE_MPI_MODE_RDONLY +#undef PyMPI_HAVE_MPI_MODE_RDWR +#undef PyMPI_HAVE_MPI_MODE_WRONLY +#undef PyMPI_HAVE_MPI_MODE_CREATE +#undef PyMPI_HAVE_MPI_MODE_EXCL +#undef PyMPI_HAVE_MPI_MODE_DELETE_ON_CLOSE +#undef PyMPI_HAVE_MPI_MODE_UNIQUE_OPEN +#undef PyMPI_HAVE_MPI_MODE_APPEND +#undef PyMPI_HAVE_MPI_MODE_SEQUENTIAL +#undef PyMPI_HAVE_MPI_File_open +#undef PyMPI_HAVE_MPI_File_close +#undef PyMPI_HAVE_MPI_File_delete +#undef PyMPI_HAVE_MPI_File_set_size +#undef PyMPI_HAVE_MPI_File_preallocate +#undef PyMPI_HAVE_MPI_File_get_size +#undef PyMPI_HAVE_MPI_File_get_group +#undef PyMPI_HAVE_MPI_File_get_amode +#undef PyMPI_HAVE_MPI_File_set_info +#undef PyMPI_HAVE_MPI_File_get_info +#undef PyMPI_HAVE_MPI_File_get_view +#undef PyMPI_HAVE_MPI_File_set_view +#undef PyMPI_HAVE_MPI_File_read_at +#undef PyMPI_HAVE_MPI_File_read_at_all +#undef PyMPI_HAVE_MPI_File_write_at +#undef PyMPI_HAVE_MPI_File_write_at_all +#undef PyMPI_HAVE_MPI_File_iread_at +#undef PyMPI_HAVE_MPI_File_iwrite_at +#undef PyMPI_HAVE_MPI_SEEK_SET +#undef PyMPI_HAVE_MPI_SEEK_CUR +#undef PyMPI_HAVE_MPI_SEEK_END +#undef PyMPI_HAVE_MPI_DISPLACEMENT_CURRENT +#undef PyMPI_HAVE_MPI_File_seek +#undef PyMPI_HAVE_MPI_File_get_position +#undef PyMPI_HAVE_MPI_File_get_byte_offset +#undef PyMPI_HAVE_MPI_File_read +#undef PyMPI_HAVE_MPI_File_read_all +#undef PyMPI_HAVE_MPI_File_write +#undef PyMPI_HAVE_MPI_File_write_all +#undef PyMPI_HAVE_MPI_File_iread +#undef PyMPI_HAVE_MPI_File_iwrite +#undef PyMPI_HAVE_MPI_File_read_shared +#undef PyMPI_HAVE_MPI_File_write_shared +#undef PyMPI_HAVE_MPI_File_iread_shared +#undef PyMPI_HAVE_MPI_File_iwrite_shared +#undef PyMPI_HAVE_MPI_File_read_ordered +#undef PyMPI_HAVE_MPI_File_write_ordered +#undef PyMPI_HAVE_MPI_File_seek_shared +#undef PyMPI_HAVE_MPI_File_get_position_shared +#undef PyMPI_HAVE_MPI_File_read_at_all_begin +#undef PyMPI_HAVE_MPI_File_read_at_all_end +#undef PyMPI_HAVE_MPI_File_write_at_all_begin +#undef PyMPI_HAVE_MPI_File_write_at_all_end +#undef PyMPI_HAVE_MPI_File_read_all_begin +#undef PyMPI_HAVE_MPI_File_read_all_end +#undef PyMPI_HAVE_MPI_File_write_all_begin +#undef PyMPI_HAVE_MPI_File_write_all_end +#undef PyMPI_HAVE_MPI_File_read_ordered_begin +#undef PyMPI_HAVE_MPI_File_read_ordered_end +#undef PyMPI_HAVE_MPI_File_write_ordered_begin +#undef PyMPI_HAVE_MPI_File_write_ordered_end +#undef PyMPI_HAVE_MPI_File_get_type_extent +#undef PyMPI_HAVE_MPI_File_set_atomicity +#undef PyMPI_HAVE_MPI_File_get_atomicity +#undef PyMPI_HAVE_MPI_File_sync +#undef PyMPI_HAVE_MPI_File_get_errhandler +#undef PyMPI_HAVE_MPI_File_set_errhandler +#undef PyMPI_HAVE_MPI_File_errhandler_fn +#undef PyMPI_HAVE_MPI_File_errhandler_function +#undef PyMPI_HAVE_MPI_File_create_errhandler +#undef PyMPI_HAVE_MPI_File_call_errhandler -#define PyMPI_MISSING_MPI_Datarep_conversion_function 1 -#define PyMPI_MISSING_MPI_Datarep_extent_function 1 -#define PyMPI_MISSING_MPI_CONVERSION_FN_NULL 1 -#define PyMPI_MISSING_MPI_MAX_DATAREP_STRING 1 -#define PyMPI_MISSING_MPI_Register_datarep 1 +#undef PyMPI_HAVE_MPI_Datarep_conversion_function +#undef PyMPI_HAVE_MPI_Datarep_extent_function +#undef PyMPI_HAVE_MPI_CONVERSION_FN_NULL +#undef PyMPI_HAVE_MPI_MAX_DATAREP_STRING +#undef PyMPI_HAVE_MPI_Register_datarep -#define PyMPI_MISSING_MPI_File_c2f 1 -#define PyMPI_MISSING_MPI_File_f2c 1 +#undef PyMPI_HAVE_MPI_File_c2f +#undef PyMPI_HAVE_MPI_File_f2c #if !defined(MPI_ERR_FILE) -#define PyMPI_MISSING_MPI_ERR_FILE 1 -#define PyMPI_MISSING_MPI_ERR_NOT_SAME 1 -#define PyMPI_MISSING_MPI_ERR_BAD_FILE 1 -#define PyMPI_MISSING_MPI_ERR_NO_SUCH_FILE 1 -#define PyMPI_MISSING_MPI_ERR_FILE_EXISTS 1 -#define PyMPI_MISSING_MPI_ERR_FILE_IN_USE 1 -#define PyMPI_MISSING_MPI_ERR_AMODE 1 -#define PyMPI_MISSING_MPI_ERR_ACCESS 1 -#define PyMPI_MISSING_MPI_ERR_READ_ONLY 1 -#define PyMPI_MISSING_MPI_ERR_NO_SPACE 1 -#define PyMPI_MISSING_MPI_ERR_QUOTA 1 -#define PyMPI_MISSING_MPI_ERR_UNSUPPORTED_DATAREP 1 -#define PyMPI_MISSING_MPI_ERR_UNSUPPORTED_OPERATION 1 -#define PyMPI_MISSING_MPI_ERR_CONVERSION 1 -#define PyMPI_MISSING_MPI_ERR_DUP_DATAREP 1 -#define PyMPI_MISSING_MPI_ERR_IO 1 +#undef PyMPI_HAVE_MPI_ERR_FILE +#undef PyMPI_HAVE_MPI_ERR_NOT_SAME +#undef PyMPI_HAVE_MPI_ERR_BAD_FILE +#undef PyMPI_HAVE_MPI_ERR_NO_SUCH_FILE +#undef PyMPI_HAVE_MPI_ERR_FILE_EXISTS +#undef PyMPI_HAVE_MPI_ERR_FILE_IN_USE +#undef PyMPI_HAVE_MPI_ERR_AMODE +#undef PyMPI_HAVE_MPI_ERR_ACCESS +#undef PyMPI_HAVE_MPI_ERR_READ_ONLY +#undef PyMPI_HAVE_MPI_ERR_NO_SPACE +#undef PyMPI_HAVE_MPI_ERR_QUOTA +#undef PyMPI_HAVE_MPI_ERR_UNSUPPORTED_DATAREP +#undef PyMPI_HAVE_MPI_ERR_UNSUPPORTED_OPERATION +#undef PyMPI_HAVE_MPI_ERR_CONVERSION +#undef PyMPI_HAVE_MPI_ERR_DUP_DATAREP +#undef PyMPI_HAVE_MPI_ERR_IO #endif #endif /* !PyMPI_CONFIG_OPENMPI_IO_H */ diff --git a/src/config/openmpi.h b/src/config/openmpi.h index 3a7df4a..5ddde4f 100644 --- a/src/config/openmpi.h +++ b/src/config/openmpi.h @@ -1,6 +1,9 @@ #ifndef PyMPI_CONFIG_OPENMPI_H #define PyMPI_CONFIG_OPENMPI_H +#include "mpi-11.h" +#include "mpi-12.h" +#include "mpi-20.h" #include "mpi-22.h" #include "mpi-30.h" @@ -17,54 +20,55 @@ #define OMPI_HAVE_FORTRAN_LOGICAL8 0 #endif -#if !OMPI_HAVE_FORTRAN_LOGICAL1 -#define PyMPI_MISSING_MPI_LOGICAL1 1 +#if OMPI_HAVE_FORTRAN_LOGICAL1 +#define PyMPI_HAVE_MPI_LOGICAL1 1 #endif -#if !OMPI_HAVE_FORTRAN_LOGICAL2 -#define PyMPI_MISSING_MPI_LOGICAL2 1 +#if OMPI_HAVE_FORTRAN_LOGICAL2 +#define PyMPI_HAVE_MPI_LOGICAL2 1 #endif -#if !OMPI_HAVE_FORTRAN_LOGICAL4 -#define PyMPI_MISSING_MPI_LOGICAL4 1 +#if OMPI_HAVE_FORTRAN_LOGICAL4 +#define PyMPI_HAVE_MPI_LOGICAL4 1 #endif -#if !OMPI_HAVE_FORTRAN_LOGICAL8 -#define PyMPI_MISSING_MPI_LOGICAL8 1 +#if OMPI_HAVE_FORTRAN_LOGICAL8 +#define PyMPI_HAVE_MPI_LOGICAL8 1 #endif + #if !OMPI_HAVE_FORTRAN_INTEGER1 -#define PyMPI_MISSING_MPI_INTEGER1 1 +#undef PyMPI_HAVE_MPI_INTEGER1 #endif #if !OMPI_HAVE_FORTRAN_INTEGER2 -#define PyMPI_MISSING_MPI_INTEGER2 1 +#undef PyMPI_HAVE_MPI_INTEGER2 #endif #if !OMPI_HAVE_FORTRAN_INTEGER4 -#define PyMPI_MISSING_MPI_INTEGER4 1 +#undef PyMPI_HAVE_MPI_INTEGER4 #endif #if !OMPI_HAVE_FORTRAN_INTEGER8 -#define PyMPI_MISSING_MPI_INTEGER8 1 +#undef PyMPI_HAVE_MPI_INTEGER8 #endif #if !OMPI_HAVE_FORTRAN_INTEGER16 -#define PyMPI_MISSING_MPI_INTEGER16 1 +#undef PyMPI_HAVE_MPI_INTEGER16 #endif #if !OMPI_HAVE_FORTRAN_REAL2 -#define PyMPI_MISSING_MPI_REAL2 1 -#define PyMPI_MISSING_MPI_COMPLEX4 1 +#undef PyMPI_HAVE_MPI_REAL2 +#undef PyMPI_HAVE_MPI_COMPLEX4 #endif #if !OMPI_HAVE_FORTRAN_REAL4 -#define PyMPI_MISSING_MPI_REAL4 1 -#define PyMPI_MISSING_MPI_COMPLEX8 1 +#undef PyMPI_HAVE_MPI_REAL4 +#undef PyMPI_HAVE_MPI_COMPLEX8 #endif #if !OMPI_HAVE_FORTRAN_REAL8 -#define PyMPI_MISSING_MPI_REAL8 1 -#define PyMPI_MISSING_MPI_COMPLEX16 1 +#undef PyMPI_HAVE_MPI_REAL8 +#undef PyMPI_HAVE_MPI_COMPLEX16 #endif #if !OMPI_HAVE_FORTRAN_REAL16 -#define PyMPI_MISSING_MPI_REAL16 1 -#define PyMPI_MISSING_MPI_COMPLEX32 1 +#undef PyMPI_HAVE_MPI_REAL16 +#undef PyMPI_HAVE_MPI_COMPLEX32 #endif #if MPI_VERSION==2 && MPI_SUBVERSION<2 -#define PyMPI_MISSING_MPI_Comm_errhandler_function 1 -#define PyMPI_MISSING_MPI_Win_errhandler_function 1 -#define PyMPI_MISSING_MPI_File_errhandler_function 1 +#undef PyMPI_HAVE_MPI_Comm_errhandler_function +#undef PyMPI_HAVE_MPI_Win_errhandler_function +#undef PyMPI_HAVE_MPI_File_errhandler_function #endif #ifdef OMPI_PROVIDE_MPI_FILE_INTERFACE @@ -80,54 +84,52 @@ #if ((OMPI_MAJOR_VERSION * 10000) + \ (OMPI_MINOR_VERSION * 100) + \ (OMPI_RELEASE_VERSION * 1)) >= 10700 -/**/ -#undef PyMPI_MISSING_MPI_Message -#undef PyMPI_MISSING_MPI_MESSAGE_NULL -#undef PyMPI_MISSING_MPI_MESSAGE_NO_PROC -#undef PyMPI_MISSING_MPI_Message_c2f -#undef PyMPI_MISSING_MPI_Message_f2c -#undef PyMPI_MISSING_MPI_Mprobe -#undef PyMPI_MISSING_MPI_Improbe -#undef PyMPI_MISSING_MPI_Mrecv -#undef PyMPI_MISSING_MPI_Imrecv -/**/ -#undef PyMPI_MISSING_MPI_Ibarrier -#undef PyMPI_MISSING_MPI_Ibcast -#undef PyMPI_MISSING_MPI_Igather -#undef PyMPI_MISSING_MPI_Igatherv -#undef PyMPI_MISSING_MPI_Iscatter -#undef PyMPI_MISSING_MPI_Iscatterv -#undef PyMPI_MISSING_MPI_Iallgather -#undef PyMPI_MISSING_MPI_Iallgatherv -#undef PyMPI_MISSING_MPI_Ialltoall -#undef PyMPI_MISSING_MPI_Ialltoallv -#undef PyMPI_MISSING_MPI_Ialltoallw -#undef PyMPI_MISSING_MPI_Ireduce -#undef PyMPI_MISSING_MPI_Iallreduce -#undef PyMPI_MISSING_MPI_Ireduce_scatter_block -#undef PyMPI_MISSING_MPI_Ireduce_scatter -#undef PyMPI_MISSING_MPI_Iscan -#undef PyMPI_MISSING_MPI_Iexscan -/**/ -#undef PyMPI_MISSING_MPI_MAX_LIBRARY_VERSION_STRING -#undef PyMPI_MISSING_MPI_Get_library_version -/**/ + +#define PyMPI_HAVE_MPI_Message 1 +#define PyMPI_HAVE_MPI_MESSAGE_NULL 1 +#define PyMPI_HAVE_MPI_MESSAGE_NO_PROC 1 +#define PyMPI_HAVE_MPI_Message_c2f 1 +#define PyMPI_HAVE_MPI_Message_f2c 1 +#define PyMPI_HAVE_MPI_Mprobe 1 +#define PyMPI_HAVE_MPI_Improbe 1 +#define PyMPI_HAVE_MPI_Mrecv 1 +#define PyMPI_HAVE_MPI_Imrecv 1 + +#define PyMPI_HAVE_MPI_Ibarrier 1 +#define PyMPI_HAVE_MPI_Ibcast 1 +#define PyMPI_HAVE_MPI_Igather 1 +#define PyMPI_HAVE_MPI_Igatherv 1 +#define PyMPI_HAVE_MPI_Iscatter 1 +#define PyMPI_HAVE_MPI_Iscatterv 1 +#define PyMPI_HAVE_MPI_Iallgather 1 +#define PyMPI_HAVE_MPI_Iallgatherv 1 +#define PyMPI_HAVE_MPI_Ialltoall 1 +#define PyMPI_HAVE_MPI_Ialltoallv 1 +#define PyMPI_HAVE_MPI_Ialltoallw 1 +#define PyMPI_HAVE_MPI_Ireduce 1 +#define PyMPI_HAVE_MPI_Iallreduce 1 +#define PyMPI_HAVE_MPI_Ireduce_scatter_block 1 +#define PyMPI_HAVE_MPI_Ireduce_scatter 1 +#define PyMPI_HAVE_MPI_Iscan 1 +#define PyMPI_HAVE_MPI_Iexscan 1 + +#define PyMPI_HAVE_MPI_MAX_LIBRARY_VERSION_STRING 1 +#define PyMPI_HAVE_MPI_Get_library_version 1 + #endif /* OMPI < 1.7*/ -#if 0 -/**/ -#undef PyMPI_MISSING_MPI_Neighbor_allgather -#undef PyMPI_MISSING_MPI_Neighbor_allgatherv -#undef PyMPI_MISSING_MPI_Neighbor_alltoall -#undef PyMPI_MISSING_MPI_Neighbor_alltoallv -#undef PyMPI_MISSING_MPI_Neighbor_alltoallw -#undef PyMPI_MISSING_MPI_Ineighbor_allgather -#undef PyMPI_MISSING_MPI_Ineighbor_allgatherv -#undef PyMPI_MISSING_MPI_Ineighbor_alltoall -#undef PyMPI_MISSING_MPI_Ineighbor_alltoallv -#undef PyMPI_MISSING_MPI_Ineighbor_alltoallw -/**/ -#endif /* */ +#if 0 /*XXX*/ +#define PyMPI_HAVE_MPI_Neighbor_allgather 1 +#define PyMPI_HAVE_MPI_Neighbor_allgatherv 1 +#define PyMPI_HAVE_MPI_Neighbor_alltoall 1 +#define PyMPI_HAVE_MPI_Neighbor_alltoallv 1 +#define PyMPI_HAVE_MPI_Neighbor_alltoallw 1 +#define PyMPI_HAVE_MPI_Ineighbor_allgather 1 +#define PyMPI_HAVE_MPI_Ineighbor_allgatherv 1 +#define PyMPI_HAVE_MPI_Ineighbor_alltoall 1 +#define PyMPI_HAVE_MPI_Ineighbor_alltoallv 1 +#define PyMPI_HAVE_MPI_Ineighbor_alltoallw 1 +#endif/*XXX*/ #endif /* MPI < 3.0*/ diff --git a/src/config/unknown.h b/src/config/unknown.h index 22f5eab..957a9ca 100644 --- a/src/config/unknown.h +++ b/src/config/unknown.h @@ -3,273 +3,7 @@ /* ------------------------------------------------------------------------- */ -#if defined(PyMPI_MISSING_MPI) && (PyMPI_MISSING_MPI == 1) -/* - */ -#define PyMPI_MISSING_MPI_UNDEFINED 1 -#define PyMPI_MISSING_MPI_ANY_SOURCE 1 -#define PyMPI_MISSING_MPI_ANY_TAG 1 -#define PyMPI_MISSING_MPI_PROC_NULL 1 -/* - */ -#define PyMPI_MISSING_MPI_Aint 1 -#define PyMPI_MISSING_MPI_Datatype 1 -#define PyMPI_MISSING_MPI_DATATYPE_NULL 1 -#define PyMPI_MISSING_MPI_UB 1 -#define PyMPI_MISSING_MPI_LB 1 -#define PyMPI_MISSING_MPI_PACKED 1 -#define PyMPI_MISSING_MPI_BYTE 1 -#define PyMPI_MISSING_MPI_CHAR 1 -#define PyMPI_MISSING_MPI_SHORT 1 -#define PyMPI_MISSING_MPI_INT 1 -#define PyMPI_MISSING_MPI_LONG 1 -#define PyMPI_MISSING_MPI_LONG_LONG_INT 1 -#define PyMPI_MISSING_MPI_UNSIGNED_CHAR 1 -#define PyMPI_MISSING_MPI_UNSIGNED_SHORT 1 -#define PyMPI_MISSING_MPI_UNSIGNED 1 -#define PyMPI_MISSING_MPI_UNSIGNED_LONG 1 -#define PyMPI_MISSING_MPI_FLOAT 1 -#define PyMPI_MISSING_MPI_DOUBLE 1 -#define PyMPI_MISSING_MPI_LONG_DOUBLE 1 -#define PyMPI_MISSING_MPI_SHORT_INT 1 -#define PyMPI_MISSING_MPI_2INT 1 -#define PyMPI_MISSING_MPI_LONG_INT 1 -#define PyMPI_MISSING_MPI_FLOAT_INT 1 -#define PyMPI_MISSING_MPI_DOUBLE_INT 1 -#define PyMPI_MISSING_MPI_LONG_DOUBLE_INT 1 -/* - */ -#define PyMPI_MISSING_MPI_CHARACTER 1 -#define PyMPI_MISSING_MPI_LOGICAL 1 -#define PyMPI_MISSING_MPI_INTEGER 1 -#define PyMPI_MISSING_MPI_REAL 1 -#define PyMPI_MISSING_MPI_DOUBLE_PRECISION 1 -#define PyMPI_MISSING_MPI_COMPLEX 1 -#define PyMPI_MISSING_MPI_DOUBLE_COMPLEX 1 -#define PyMPI_MISSING_MPI_INTEGER1 1 -#define PyMPI_MISSING_MPI_INTEGER2 1 -#define PyMPI_MISSING_MPI_INTEGER4 1 -#define PyMPI_MISSING_MPI_REAL2 1 -#define PyMPI_MISSING_MPI_REAL4 1 -#define PyMPI_MISSING_MPI_REAL8 1 -/* - */ -#define PyMPI_MISSING_MPI_BOTTOM 1 -#define PyMPI_MISSING_MPI_Address 1 -#define PyMPI_MISSING_MPI_Type_size 1 -#define PyMPI_MISSING_MPI_Type_extent 1 -#define PyMPI_MISSING_MPI_Type_lb 1 -#define PyMPI_MISSING_MPI_Type_ub 1 -#define PyMPI_MISSING_MPI_Type_dup 1 -#define PyMPI_MISSING_MPI_Type_contiguous 1 -#define PyMPI_MISSING_MPI_Type_vector 1 -#define PyMPI_MISSING_MPI_Type_indexed 1 -#define PyMPI_MISSING_MPI_Type_hvector 1 -#define PyMPI_MISSING_MPI_Type_hindexed 1 -#define PyMPI_MISSING_MPI_Type_struct 1 -#define PyMPI_MISSING_MPI_Type_commit 1 -#define PyMPI_MISSING_MPI_Type_free 1 -#define PyMPI_MISSING_MPI_Pack 1 -#define PyMPI_MISSING_MPI_Unpack 1 -#define PyMPI_MISSING_MPI_Pack_size 1 -/* - */ -#define PyMPI_MISSING_MPI_Status 1 -#define PyMPI_MISSING_MPI_Get_count 1 -#define PyMPI_MISSING_MPI_Get_elements 1 -#define PyMPI_MISSING_MPI_Test_cancelled 1 -/* - */ -#define PyMPI_MISSING_MPI_Request 1 -#define PyMPI_MISSING_MPI_REQUEST_NULL 1 -#define PyMPI_MISSING_MPI_Request_free 1 -#define PyMPI_MISSING_MPI_Wait 1 -#define PyMPI_MISSING_MPI_Test 1 -#define PyMPI_MISSING_MPI_Request_get_status 1 -#define PyMPI_MISSING_MPI_Cancel 1 -#define PyMPI_MISSING_MPI_Waitany 1 -#define PyMPI_MISSING_MPI_Testany 1 -#define PyMPI_MISSING_MPI_Waitall 1 -#define PyMPI_MISSING_MPI_Testall 1 -#define PyMPI_MISSING_MPI_Waitsome 1 -#define PyMPI_MISSING_MPI_Testsome 1 -#define PyMPI_MISSING_MPI_Start 1 -#define PyMPI_MISSING_MPI_Startall 1 -/* - */ -#define PyMPI_MISSING_MPI_Op 1 -#define PyMPI_MISSING_MPI_OP_NULL 1 -#define PyMPI_MISSING_MPI_MAX 1 -#define PyMPI_MISSING_MPI_MIN 1 -#define PyMPI_MISSING_MPI_SUM 1 -#define PyMPI_MISSING_MPI_PROD 1 -#define PyMPI_MISSING_MPI_LAND 1 -#define PyMPI_MISSING_MPI_BAND 1 -#define PyMPI_MISSING_MPI_LOR 1 -#define PyMPI_MISSING_MPI_BOR 1 -#define PyMPI_MISSING_MPI_LXOR 1 -#define PyMPI_MISSING_MPI_BXOR 1 -#define PyMPI_MISSING_MPI_MAXLOC 1 -#define PyMPI_MISSING_MPI_MINLOC 1 -#define PyMPI_MISSING_MPI_REPLACE 1 -#define PyMPI_MISSING_MPI_Op_free 1 -#define PyMPI_MISSING_MPI_User_function 1 -#define PyMPI_MISSING_MPI_Op_create 1 -/* - */ -#define PyMPI_MISSING_MPI_Group 1 -#define PyMPI_MISSING_MPI_GROUP_NULL 1 -#define PyMPI_MISSING_MPI_GROUP_EMPTY 1 -#define PyMPI_MISSING_MPI_Group_free 1 -#define PyMPI_MISSING_MPI_Group_size 1 -#define PyMPI_MISSING_MPI_Group_rank 1 -#define PyMPI_MISSING_MPI_Group_translate_ranks 1 -#define PyMPI_MISSING_MPI_IDENT 1 -#define PyMPI_MISSING_MPI_CONGRUENT 1 -#define PyMPI_MISSING_MPI_SIMILAR 1 -#define PyMPI_MISSING_MPI_UNEQUAL 1 -/* - */ -#define PyMPI_MISSING_MPI_Group_compare 1 -#define PyMPI_MISSING_MPI_Group_union 1 -#define PyMPI_MISSING_MPI_Group_intersection 1 -#define PyMPI_MISSING_MPI_Group_difference 1 -#define PyMPI_MISSING_MPI_Group_incl 1 -#define PyMPI_MISSING_MPI_Group_excl 1 -#define PyMPI_MISSING_MPI_Group_range_incl 1 -#define PyMPI_MISSING_MPI_Group_range_excl 1 -/* - */ -#define PyMPI_MISSING_MPI_Comm 1 -#define PyMPI_MISSING_MPI_COMM_NULL 1 -#define PyMPI_MISSING_MPI_COMM_SELF 1 -#define PyMPI_MISSING_MPI_COMM_WORLD 1 -#define PyMPI_MISSING_MPI_Comm_free 1 -#define PyMPI_MISSING_MPI_Comm_group 1 -#define PyMPI_MISSING_MPI_Comm_size 1 -#define PyMPI_MISSING_MPI_Comm_rank 1 -#define PyMPI_MISSING_MPI_Comm_compare 1 -#define PyMPI_MISSING_MPI_Topo_test 1 -#define PyMPI_MISSING_MPI_Comm_test_inter 1 -#define PyMPI_MISSING_MPI_Abort 1 -#define PyMPI_MISSING_MPI_Send 1 -#define PyMPI_MISSING_MPI_Recv 1 -#define PyMPI_MISSING_MPI_Sendrecv 1 -#define PyMPI_MISSING_MPI_Sendrecv_replace 1 -#define PyMPI_MISSING_MPI_BSEND_OVERHEAD 1 -#define PyMPI_MISSING_MPI_Buffer_attach 1 -#define PyMPI_MISSING_MPI_Buffer_detach 1 -#define PyMPI_MISSING_MPI_Bsend 1 -#define PyMPI_MISSING_MPI_Ssend 1 -#define PyMPI_MISSING_MPI_Rsend 1 -#define PyMPI_MISSING_MPI_Isend 1 -#define PyMPI_MISSING_MPI_Ibsend 1 -#define PyMPI_MISSING_MPI_Issend 1 -#define PyMPI_MISSING_MPI_Irsend 1 -#define PyMPI_MISSING_MPI_Irecv 1 -#define PyMPI_MISSING_MPI_Send_init 1 -#define PyMPI_MISSING_MPI_Bsend_init 1 -#define PyMPI_MISSING_MPI_Ssend_init 1 -#define PyMPI_MISSING_MPI_Rsend_init 1 -#define PyMPI_MISSING_MPI_Recv_init 1 -#define PyMPI_MISSING_MPI_Probe 1 -#define PyMPI_MISSING_MPI_Iprobe 1 -#define PyMPI_MISSING_MPI_Barrier 1 -#define PyMPI_MISSING_MPI_Bcast 1 -#define PyMPI_MISSING_MPI_Gather 1 -#define PyMPI_MISSING_MPI_Gatherv 1 -#define PyMPI_MISSING_MPI_Scatter 1 -#define PyMPI_MISSING_MPI_Scatterv 1 -#define PyMPI_MISSING_MPI_Allgather 1 -#define PyMPI_MISSING_MPI_Allgatherv 1 -#define PyMPI_MISSING_MPI_Alltoall 1 -#define PyMPI_MISSING_MPI_Alltoallv 1 -#define PyMPI_MISSING_MPI_Reduce 1 -#define PyMPI_MISSING_MPI_Allreduce 1 -#define PyMPI_MISSING_MPI_Reduce_scatter 1 -#define PyMPI_MISSING_MPI_Scan 1 -#define PyMPI_MISSING_MPI_Comm_dup 1 -#define PyMPI_MISSING_MPI_Comm_create 1 -#define PyMPI_MISSING_MPI_Comm_split 1 -#define PyMPI_MISSING_MPI_CART 1 -#define PyMPI_MISSING_MPI_Cart_create 1 -#define PyMPI_MISSING_MPI_Cartdim_get 1 -#define PyMPI_MISSING_MPI_Cart_get 1 -#define PyMPI_MISSING_MPI_Cart_rank 1 -#define PyMPI_MISSING_MPI_Cart_coords 1 -#define PyMPI_MISSING_MPI_Cart_shift 1 -#define PyMPI_MISSING_MPI_Cart_sub 1 -#define PyMPI_MISSING_MPI_Cart_map 1 -#define PyMPI_MISSING_MPI_Dims_create 1 -#define PyMPI_MISSING_MPI_GRAPH 1 -#define PyMPI_MISSING_MPI_Graph_create 1 -#define PyMPI_MISSING_MPI_Graphdims_get 1 -#define PyMPI_MISSING_MPI_Graph_get 1 -#define PyMPI_MISSING_MPI_Graph_map 1 -#define PyMPI_MISSING_MPI_Graph_neighbors_count 1 -#define PyMPI_MISSING_MPI_Graph_neighbors 1 -#define PyMPI_MISSING_MPI_Intercomm_create 1 -#define PyMPI_MISSING_MPI_Comm_remote_group 1 -#define PyMPI_MISSING_MPI_Comm_remote_size 1 -#define PyMPI_MISSING_MPI_Intercomm_merge 1 -#define PyMPI_MISSING_MPI_Errhandler_get 1 -#define PyMPI_MISSING_MPI_Errhandler_set 1 -#define PyMPI_MISSING_MPI_Handler_function 1 -#define PyMPI_MISSING_MPI_Errhandler_create 1 -/* - */ -#define PyMPI_MISSING_MPI_Init 1 -#define PyMPI_MISSING_MPI_Finalize 1 -#define PyMPI_MISSING_MPI_Initialized 1 -#define PyMPI_MISSING_MPI_Finalized 1 -/* - */ -#define PyMPI_MISSING_MPI_MAX_PROCESSOR_NAME 1 -#define PyMPI_MISSING_MPI_Get_processor_name 1 -#define PyMPI_MISSING_MPI_Wtime 1 -#define PyMPI_MISSING_MPI_Wtick 1 -#define PyMPI_MISSING_MPI_Pcontrol 1 -/* - */ -#define PyMPI_MISSING_MPI_Errhandler 1 -#define PyMPI_MISSING_MPI_ERRHANDLER_NULL 1 -#define PyMPI_MISSING_MPI_ERRORS_RETURN 1 -#define PyMPI_MISSING_MPI_ERRORS_ARE_FATAL 1 -#define PyMPI_MISSING_MPI_Errhandler_free 1 -/* - */ -#define PyMPI_MISSING_MPI_KEYVAL_INVALID 1 -#define PyMPI_MISSING_MPI_TAG_UB 1 -#define PyMPI_MISSING_MPI_HOST 1 -#define PyMPI_MISSING_MPI_IO 1 -#define PyMPI_MISSING_MPI_WTIME_IS_GLOBAL 1 -#define PyMPI_MISSING_MPI_Attr_get 1 -#define PyMPI_MISSING_MPI_Attr_put 1 -#define PyMPI_MISSING_MPI_Attr_delete 1 -#define PyMPI_MISSING_MPI_Copy_function 1 -#define PyMPI_MISSING_MPI_Delete_function 1 -#define PyMPI_MISSING_MPI_DUP_FN 1 -#define PyMPI_MISSING_MPI_NULL_COPY_FN 1 -#define PyMPI_MISSING_MPI_NULL_DELETE_FN 1 -#define PyMPI_MISSING_MPI_Keyval_create 1 -#define PyMPI_MISSING_MPI_Keyval_free 1 -/* - */ -#define PyMPI_MISSING_MPI_SUCCESS 1 -#define PyMPI_MISSING_MPI_ERR_LASTCODE 1 -#define PyMPI_MISSING_MPI_ERR_COMM 1 -#define PyMPI_MISSING_MPI_ERR_GROUP 1 -#define PyMPI_MISSING_MPI_ERR_TYPE 1 -#define PyMPI_MISSING_MPI_ERR_REQUEST 1 -#define PyMPI_MISSING_MPI_ERR_OP 1 -#define PyMPI_MISSING_MPI_ERR_BUFFER 1 -#define PyMPI_MISSING_MPI_ERR_COUNT 1 -#define PyMPI_MISSING_MPI_ERR_TAG 1 -#define PyMPI_MISSING_MPI_ERR_RANK 1 -#define PyMPI_MISSING_MPI_ERR_ROOT 1 -#define PyMPI_MISSING_MPI_ERR_TRUNCATE 1 -#define PyMPI_MISSING_MPI_ERR_IN_STATUS 1 -#define PyMPI_MISSING_MPI_ERR_PENDING 1 -#define PyMPI_MISSING_MPI_ERR_TOPOLOGY 1 -#define PyMPI_MISSING_MPI_ERR_DIMS 1 -#define PyMPI_MISSING_MPI_ERR_ARG 1 -#define PyMPI_MISSING_MPI_ERR_OTHER 1 -#define PyMPI_MISSING_MPI_ERR_UNKNOWN 1 -#define PyMPI_MISSING_MPI_ERR_INTERN 1 -/* - */ -#define PyMPI_MISSING_MPI_MAX_ERROR_STRING 1 -#define PyMPI_MISSING_MPI_Error_class 1 -#define PyMPI_MISSING_MPI_Error_string 1 -/* - */ -#endif /* PyMPI_MISSING_MPI */ - -/* ------------------------------------------------------------------------- */ - +#include "mpi-11.h" #include "mpi-12.h" #include "mpi-20.h" #include "mpi-22.h" @@ -277,24 +11,18 @@ /* ------------------------------------------------------------------------- */ -/* These types are Open MPI extensions */ -#define PyMPI_MISSING_MPI_LOGICAL1 1 -#define PyMPI_MISSING_MPI_LOGICAL2 1 -#define PyMPI_MISSING_MPI_LOGICAL4 1 -#define PyMPI_MISSING_MPI_LOGICAL8 1 - /* These types are difficult to implement portably */ -#define PyMPI_MISSING_MPI_INTEGER16 1 -#define PyMPI_MISSING_MPI_REAL2 1 -#define PyMPI_MISSING_MPI_COMPLEX4 1 +#undef PyMPI_HAVE_MPI_INTEGER16 +#undef PyMPI_HAVE_MPI_REAL2 +#undef PyMPI_HAVE_MPI_COMPLEX4 /* These types are not available in MPICH(1) */ #if defined(MPICH_NAME) && (MPICH_NAME==1) -#define PyMPI_MISSING_MPI_INTEGER1 -#define PyMPI_MISSING_MPI_INTEGER2 -#define PyMPI_MISSING_MPI_INTEGER4 -#define PyMPI_MISSING_MPI_REAL4 -#define PyMPI_MISSING_MPI_REAL8 +#undef PyMPI_HAVE_MPI_INTEGER1 +#undef PyMPI_HAVE_MPI_INTEGER2 +#undef PyMPI_HAVE_MPI_INTEGER4 +#undef PyMPI_HAVE_MPI_REAL4 +#undef PyMPI_HAVE_MPI_REAL8 #endif /* ------------------------------------------------------------------------- */ diff --git a/src/fallback.h b/src/fallback.h index 5b95831..885bc55 100644 --- a/src/fallback.h +++ b/src/fallback.h @@ -38,19 +38,19 @@ /* Version Number */ -#ifdef PyMPI_MISSING_MPI_VERSION +#ifndef PyMPI_HAVE_MPI_VERSION #if !defined(MPI_VERSION) #define MPI_VERSION 1 #endif #endif -#ifdef PyMPI_MISSING_MPI_SUBVERSION +#ifndef PyMPI_HAVE_MPI_SUBVERSION #if !defined(MPI_SUBVERSION) #define MPI_SUBVERSION 0 #endif #endif -#ifdef PyMPI_MISSING_MPI_Get_version +#ifndef PyMPI_HAVE_MPI_Get_version static int PyMPI_Get_version(int *version, int* subversion) { if (!version) return MPI_ERR_ARG; @@ -63,7 +63,7 @@ static int PyMPI_Get_version(int *version, int* subversion) #define MPI_Get_version PyMPI_Get_version #endif -#ifdef PyMPI_MISSING_MPI_Get_library_version +#ifndef PyMPI_HAVE_MPI_Get_library_version #define PyMPI_MAX_LIBRARY_VERSION_STRING 8 static int PyMPI_Get_library_version(char version[], int *rlen) { @@ -88,7 +88,7 @@ static int PyMPI_Get_library_version(char version[], int *rlen) /* Threading Support */ -#ifdef PyMPI_MISSING_MPI_Init_thread +#ifndef PyMPI_HAVE_MPI_Init_thread static int PyMPI_Init_thread(int *argc, char ***argv, int required, int *provided) { @@ -103,7 +103,7 @@ static int PyMPI_Init_thread(int *argc, char ***argv, #define MPI_Init_thread PyMPI_Init_thread #endif -#ifdef PyMPI_MISSING_MPI_Query_thread +#ifndef PyMPI_HAVE_MPI_Query_thread static int PyMPI_Query_thread(int *provided) { if (!provided) return MPI_ERR_ARG; @@ -114,7 +114,7 @@ static int PyMPI_Query_thread(int *provided) #define MPI_Query_thread PyMPI_Query_thread #endif -#ifdef PyMPI_MISSING_MPI_Is_thread_main +#ifndef PyMPI_HAVE_MPI_Is_thread_main static int PyMPI_Is_thread_main(int *flag) { if (!flag) return MPI_ERR_ARG; @@ -129,13 +129,13 @@ static int PyMPI_Is_thread_main(int *flag) /* Status */ -#ifdef PyMPI_MISSING_MPI_STATUS_IGNORE +#ifndef PyMPI_HAVE_MPI_STATUS_IGNORE static MPI_Status PyMPI_STATUS_IGNORE; #undef MPI_STATUS_IGNORE #define MPI_STATUS_IGNORE ((MPI_Status*)(&PyMPI_STATUS_IGNORE)) #endif -#ifdef PyMPI_MISSING_MPI_STATUSES_IGNORE +#ifndef PyMPI_HAVE_MPI_STATUSES_IGNORE #ifndef PyMPI_MPI_STATUSES_IGNORE_SIZE #if defined(__GNUC__) || defined(__ICC) || defined(__INTEL_COMPILER) #warning MPI_STATUSES_IGNORE will use static storage of size 4096 @@ -152,12 +152,12 @@ static MPI_Status PyMPI_STATUSES_IGNORE[PyMPI_MPI_STATUSES_IGNORE_SIZE]; /* Datatypes */ -#ifdef PyMPI_MISSING_MPI_LONG_LONG +#ifndef PyMPI_HAVE_MPI_LONG_LONG #undef MPI_LONG_LONG #define MPI_LONG_LONG MPI_LONG_LONG_INT #endif -#ifdef PyMPI_MISSING_MPI_Type_get_extent +#ifndef PyMPI_HAVE_MPI_Type_get_extent static int PyMPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint *lb, MPI_Aint *extent) { @@ -172,7 +172,7 @@ static int PyMPI_Type_get_extent(MPI_Datatype datatype, #define MPI_Type_get_extent PyMPI_Type_get_extent #endif -#ifdef PyMPI_MISSING_MPI_Type_dup +#ifndef PyMPI_HAVE_MPI_Type_dup static int PyMPI_Type_dup(MPI_Datatype datatype, MPI_Datatype *newtype) { int ierr = MPI_SUCCESS; @@ -186,7 +186,7 @@ static int PyMPI_Type_dup(MPI_Datatype datatype, MPI_Datatype *newtype) #define MPI_Type_dup PyMPI_Type_dup #endif -#ifdef PyMPI_MISSING_MPI_Type_create_indexed_block +#ifndef PyMPI_HAVE_MPI_Type_create_indexed_block static int PyMPI_Type_create_indexed_block(int count, int blocklength, int displacements[], @@ -209,7 +209,7 @@ static int PyMPI_Type_create_indexed_block(int count, #define MPI_COMBINER_INDEXED_BLOCK MPI_COMBINER_INDEXED #endif -#ifdef PyMPI_MISSING_MPI_Type_create_hindexed_block +#ifndef PyMPI_HAVE_MPI_Type_create_hindexed_block static int PyMPI_Type_create_hindexed_block(int count, int blocklength, MPI_Aint displacements[], @@ -237,7 +237,7 @@ static int PyMPI_Type_create_hindexed_block(int count, * mpich2-1.0.7/src/mpi/datatype/type_create_subarray.c * */ -#ifdef PyMPI_MISSING_MPI_Type_create_subarray +#ifndef PyMPI_HAVE_MPI_Type_create_subarray #undef PyMPI_CHKARG #define PyMPI_CHKARG(EXPR) if (!(EXPR)) return MPI_ERR_ARG @@ -352,7 +352,7 @@ static int PyMPI_Type_create_subarray(int ndims, * mpich2-1.0.7/src/mpi/datatype/type_create_darray.c * */ -#ifdef PyMPI_MISSING_MPI_Type_create_darray +#ifndef PyMPI_HAVE_MPI_Type_create_darray #undef PyMPI_MIN #define PyMPI_MIN(__a, __b) (((__a) < (__b)) ? (__a) : (__b)) @@ -668,7 +668,7 @@ static int PyMPI_Type_create_darray(int size, #define MPI_Type_create_darray PyMPI_Type_create_darray #endif -#ifdef PyMPI_MISSING_MPI_Type_size_x +#ifndef PyMPI_HAVE_MPI_Type_size_x static int PyMPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size) { @@ -684,7 +684,7 @@ static int PyMPI_Type_size_x(MPI_Datatype datatype, #define MPI_Type_size_x PyMPI_Type_size_x #endif -#ifdef PyMPI_MISSING_MPI_Type_get_extent_x +#ifndef PyMPI_HAVE_MPI_Type_get_extent_x static int PyMPI_Type_get_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent) @@ -703,7 +703,7 @@ static int PyMPI_Type_get_extent_x(MPI_Datatype datatype, #define MPI_Type_get_extent_x PyMPI_Type_get_extent_x #endif -#ifdef PyMPI_MISSING_MPI_Type_get_true_extent_x +#ifndef PyMPI_HAVE_MPI_Type_get_true_extent_x static int PyMPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent) @@ -722,7 +722,7 @@ static int PyMPI_Type_get_true_extent_x(MPI_Datatype datatype, #define MPI_Type_get_true_extent_x PyMPI_Type_get_true_extent_x #endif -#ifdef PyMPI_MISSING_MPI_Get_elements_x +#ifndef PyMPI_HAVE_MPI_Get_elements_x static int PyMPI_Get_elements_x(MPI_Status *status, MPI_Datatype datatype, MPI_Count *elements) @@ -739,7 +739,7 @@ static int PyMPI_Get_elements_x(MPI_Status *status, #define MPI_Get_elements_x PyMPI_Get_elements_x #endif -#ifdef PyMPI_MISSING_MPI_Status_set_elements_x +#ifndef PyMPI_HAVE_MPI_Status_set_elements_x static int PyMPI_Status_set_elements_x(MPI_Status *status, MPI_Datatype datatype, MPI_Count elements) @@ -754,7 +754,7 @@ static int PyMPI_Status_set_elements_x(MPI_Status *status, /* ---------------------------------------------------------------- */ -#ifndef PyMPI_MISSING_MPI_Request_get_status +#ifdef PyMPI_HAVE_MPI_Request_get_status #if ((10 * MPI_VERSION + MPI_SUBVERSION) < 22) static int PyMPI_Request_get_status(MPI_Request request, int *flag, MPI_Status *status) @@ -765,8 +765,8 @@ static int PyMPI_Request_get_status(MPI_Request request, if (status && status != MPI_STATUS_IGNORE && status != MPI_STATUSES_IGNORE) { - #if defined(PyMPI_MISSING_MPI_Status_set_cancelled) || \ - defined(PyMPI_MISSING_MPI_Status_set_elements) + #if !defined(PyMPI_HAVE_MPI_Status_set_cancelled) || \ + !defined(PyMPI_HAVE_MPI_Status_set_elements) int n = (int) sizeof(MPI_Status); unsigned char *p = (unsigned char *)status; while (n-- > 0) p[n] = 0; @@ -774,10 +774,10 @@ static int PyMPI_Request_get_status(MPI_Request request, status->MPI_SOURCE = MPI_ANY_SOURCE; status->MPI_TAG = MPI_ANY_TAG; status->MPI_ERROR = MPI_SUCCESS; - #ifndef PyMPI_MISSING_MPI_Status_set_elements + #ifdef PyMPI_HAVE_MPI_Status_set_elements MPI_Status_set_elements(status, MPI_BYTE, 0); #endif - #ifndef PyMPI_MISSING_MPI_Status_set_cancelled + #ifdef PyMPI_HAVE_MPI_Status_set_cancelled MPI_Status_set_cancelled(status, 0); #endif } @@ -790,7 +790,7 @@ static int PyMPI_Request_get_status(MPI_Request request, /* ---------------------------------------------------------------- */ -#ifdef PyMPI_MISSING_MPI_Reduce_scatter_block +#ifndef PyMPI_HAVE_MPI_Reduce_scatter_block static int PyMPI_Reduce_scatter_block(void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) @@ -816,7 +816,7 @@ static int PyMPI_Reduce_scatter_block(void *sendbuf, void *recvbuf, /* Communicator Info */ -#ifdef PyMPI_MISSING_MPI_Comm_dup_with_info +#ifndef PyMPI_HAVE_MPI_Comm_dup_with_info static int PyMPI_Comm_dup_with_info(MPI_Comm comm, MPI_Info info, MPI_Comm *newcomm) { @@ -831,7 +831,7 @@ static int PyMPI_Comm_dup_with_info(MPI_Comm comm, MPI_Info info, #define MPI_Comm_dup_with_info PyMPI_Comm_dup_with_info #endif -#ifdef PyMPI_MISSING_MPI_Comm_set_info +#ifndef PyMPI_HAVE_MPI_Comm_set_info static int PyMPI_Comm_set_info(MPI_Comm comm, MPI_Info info) { int dummy, ierr; @@ -847,7 +847,7 @@ static int PyMPI_Comm_set_info(MPI_Comm comm, MPI_Info info) #define MPI_Comm_set_info PyMPI_Comm_set_info #endif -#ifdef PyMPI_MISSING_MPI_Comm_get_info +#ifndef PyMPI_HAVE_MPI_Comm_get_info static int PyMPI_Comm_get_info(MPI_Comm comm, MPI_Info *info) { int dummy, ierr; @@ -863,8 +863,8 @@ static int PyMPI_Comm_get_info(MPI_Comm comm, MPI_Info *info) /* Memory Allocation */ -#if (defined(PyMPI_MISSING_MPI_Alloc_mem) || \ - defined(PyMPI_MISSING_MPI_Free_mem)) +#if !defined(PyMPI_HAVE_MPI_Alloc_mem) || \ + !defined(PyMPI_HAVE_MPI_Free_mem) static int PyMPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr) { @@ -894,8 +894,8 @@ static int PyMPI_Free_mem(void *baseptr) /* ---------------------------------------------------------------- */ -#ifdef PyMPI_MISSING_MPI_Win_allocate -#ifndef PyMPI_MISSING_MPI_Win_create +#ifndef PyMPI_HAVE_MPI_Win_allocate +#ifdef PyMPI_HAVE_MPI_Win_create static int PyMPI_KEYVAL_WIN_MPIMEM = MPI_KEYVAL_INVALID; diff --git a/src/include/mpi4py/mpi4py.h b/src/include/mpi4py/mpi4py.h index b0a83a0..e44ff94 100644 --- a/src/include/mpi4py/mpi4py.h +++ b/src/include/mpi4py/mpi4py.h @@ -6,7 +6,7 @@ #include "mpi.h" -#if (MPI_VERSION < 3) && !defined(_MPI4PY_HAVE_MPI_MESSAGE) +#if (MPI_VERSION < 3) && !defined(PyMPI_HAVE_MPI_Message) typedef void *PyMPI_MPI_Message; #define MPI_Message PyMPI_MPI_Message #endif diff --git a/src/missing.h b/src/missing.h index ef0097d..5333b55 100644 --- a/src/missing.h +++ b/src/missing.h @@ -17,25 +17,25 @@ static PyMPI_UNUSED int PyMPI_UNAVAILABLE(const char *name,...) { return -1; } -#ifdef PyMPI_MISSING_MPI_Aint +#ifndef PyMPI_HAVE_MPI_Aint #undef MPI_Aint typedef long PyMPI_MPI_Aint; #define MPI_Aint PyMPI_MPI_Aint #endif -#ifdef PyMPI_MISSING_MPI_Offset +#ifndef PyMPI_HAVE_MPI_Offset #undef MPI_Offset typedef long PyMPI_MPI_Offset; #define MPI_Offset PyMPI_MPI_Offset #endif -#ifdef PyMPI_MISSING_MPI_Count +#ifndef PyMPI_HAVE_MPI_Count #undef MPI_Count typedef MPI_Aint PyMPI_MPI_Count; #define MPI_Count PyMPI_MPI_Count #endif -#ifdef PyMPI_MISSING_MPI_Status +#ifndef PyMPI_HAVE_MPI_Status #undef MPI_Status typedef struct PyMPI_MPI_Status { int MPI_SOURCE; @@ -45,3463 +45,3463 @@ typedef struct PyMPI_MPI_Status { #define MPI_Status PyMPI_MPI_Status #endif -#ifdef PyMPI_MISSING_MPI_Datatype +#ifndef PyMPI_HAVE_MPI_Datatype #undef MPI_Datatype typedef void *PyMPI_MPI_Datatype; #define MPI_Datatype PyMPI_MPI_Datatype #endif -#ifdef PyMPI_MISSING_MPI_Request +#ifndef PyMPI_HAVE_MPI_Request #undef MPI_Request typedef void *PyMPI_MPI_Request; #define MPI_Request PyMPI_MPI_Request #endif -#ifdef PyMPI_MISSING_MPI_Message +#ifndef PyMPI_HAVE_MPI_Message #undef MPI_Message typedef void *PyMPI_MPI_Message; #define MPI_Message PyMPI_MPI_Message #endif -#ifdef PyMPI_MISSING_MPI_Op +#ifndef PyMPI_HAVE_MPI_Op #undef MPI_Op typedef void *PyMPI_MPI_Op; #define MPI_Op PyMPI_MPI_Op #endif -#ifdef PyMPI_MISSING_MPI_Group +#ifndef PyMPI_HAVE_MPI_Group #undef MPI_Group typedef void *PyMPI_MPI_Group; #define MPI_Group PyMPI_MPI_Group #endif -#ifdef PyMPI_MISSING_MPI_Info +#ifndef PyMPI_HAVE_MPI_Info #undef MPI_Info typedef void *PyMPI_MPI_Info; #define MPI_Info PyMPI_MPI_Info #endif -#ifdef PyMPI_MISSING_MPI_Comm +#ifndef PyMPI_HAVE_MPI_Comm #undef MPI_Comm typedef void *PyMPI_MPI_Comm; #define MPI_Comm PyMPI_MPI_Comm #endif -#ifdef PyMPI_MISSING_MPI_Win +#ifndef PyMPI_HAVE_MPI_Win #undef MPI_Win typedef void *PyMPI_MPI_Win; #define MPI_Win PyMPI_MPI_Win #endif -#ifdef PyMPI_MISSING_MPI_File +#ifndef PyMPI_HAVE_MPI_File #undef MPI_File typedef void *PyMPI_MPI_File; #define MPI_File PyMPI_MPI_File #endif -#ifdef PyMPI_MISSING_MPI_Errhandler +#ifndef PyMPI_HAVE_MPI_Errhandler #undef MPI_Errhandler typedef void *PyMPI_MPI_Errhandler; #define MPI_Errhandler PyMPI_MPI_Errhandler #endif -#ifdef PyMPI_MISSING_MPI_UNDEFINED +#ifndef PyMPI_HAVE_MPI_UNDEFINED #undef MPI_UNDEFINED #define MPI_UNDEFINED (-32766) #endif -#ifdef PyMPI_MISSING_MPI_ANY_SOURCE +#ifndef PyMPI_HAVE_MPI_ANY_SOURCE #undef MPI_ANY_SOURCE #define MPI_ANY_SOURCE (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_ANY_TAG +#ifndef PyMPI_HAVE_MPI_ANY_TAG #undef MPI_ANY_TAG #define MPI_ANY_TAG (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_PROC_NULL +#ifndef PyMPI_HAVE_MPI_PROC_NULL #undef MPI_PROC_NULL #define MPI_PROC_NULL (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_ROOT +#ifndef PyMPI_HAVE_MPI_ROOT #undef MPI_ROOT #define MPI_ROOT (MPI_PROC_NULL) #endif -#ifdef PyMPI_MISSING_MPI_IDENT +#ifndef PyMPI_HAVE_MPI_IDENT #undef MPI_IDENT #define MPI_IDENT (1) #endif -#ifdef PyMPI_MISSING_MPI_CONGRUENT +#ifndef PyMPI_HAVE_MPI_CONGRUENT #undef MPI_CONGRUENT #define MPI_CONGRUENT (2) #endif -#ifdef PyMPI_MISSING_MPI_SIMILAR +#ifndef PyMPI_HAVE_MPI_SIMILAR #undef MPI_SIMILAR #define MPI_SIMILAR (3) #endif -#ifdef PyMPI_MISSING_MPI_UNEQUAL +#ifndef PyMPI_HAVE_MPI_UNEQUAL #undef MPI_UNEQUAL #define MPI_UNEQUAL (4) #endif -#ifdef PyMPI_MISSING_MPI_BOTTOM +#ifndef PyMPI_HAVE_MPI_BOTTOM #undef MPI_BOTTOM #define MPI_BOTTOM ((void*)0) #endif -#ifdef PyMPI_MISSING_MPI_IN_PLACE +#ifndef PyMPI_HAVE_MPI_IN_PLACE #undef MPI_IN_PLACE #define MPI_IN_PLACE ((void*)0) #endif -#ifdef PyMPI_MISSING_MPI_KEYVAL_INVALID +#ifndef PyMPI_HAVE_MPI_KEYVAL_INVALID #undef MPI_KEYVAL_INVALID #define MPI_KEYVAL_INVALID (0) #endif -#ifdef PyMPI_MISSING_MPI_MAX_OBJECT_NAME +#ifndef PyMPI_HAVE_MPI_MAX_OBJECT_NAME #undef MPI_MAX_OBJECT_NAME #define MPI_MAX_OBJECT_NAME (1) #endif -#ifdef PyMPI_MISSING_MPI_DATATYPE_NULL +#ifndef PyMPI_HAVE_MPI_DATATYPE_NULL #undef MPI_DATATYPE_NULL #define MPI_DATATYPE_NULL ((MPI_Datatype)0) #endif -#ifdef PyMPI_MISSING_MPI_PACKED +#ifndef PyMPI_HAVE_MPI_PACKED #undef MPI_PACKED #define MPI_PACKED ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_BYTE +#ifndef PyMPI_HAVE_MPI_BYTE #undef MPI_BYTE #define MPI_BYTE ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_AINT +#ifndef PyMPI_HAVE_MPI_AINT #undef MPI_AINT #define MPI_AINT ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_OFFSET +#ifndef PyMPI_HAVE_MPI_OFFSET #undef MPI_OFFSET #define MPI_OFFSET ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_COUNT +#ifndef PyMPI_HAVE_MPI_COUNT #undef MPI_COUNT #define MPI_COUNT ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_CHAR +#ifndef PyMPI_HAVE_MPI_CHAR #undef MPI_CHAR #define MPI_CHAR ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_WCHAR +#ifndef PyMPI_HAVE_MPI_WCHAR #undef MPI_WCHAR #define MPI_WCHAR ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_SIGNED_CHAR +#ifndef PyMPI_HAVE_MPI_SIGNED_CHAR #undef MPI_SIGNED_CHAR #define MPI_SIGNED_CHAR ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_SHORT +#ifndef PyMPI_HAVE_MPI_SHORT #undef MPI_SHORT #define MPI_SHORT ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_INT +#ifndef PyMPI_HAVE_MPI_INT #undef MPI_INT #define MPI_INT ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_LONG +#ifndef PyMPI_HAVE_MPI_LONG #undef MPI_LONG #define MPI_LONG ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_LONG_LONG +#ifndef PyMPI_HAVE_MPI_LONG_LONG #undef MPI_LONG_LONG #define MPI_LONG_LONG ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_LONG_LONG_INT +#ifndef PyMPI_HAVE_MPI_LONG_LONG_INT #undef MPI_LONG_LONG_INT #define MPI_LONG_LONG_INT ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_UNSIGNED_CHAR +#ifndef PyMPI_HAVE_MPI_UNSIGNED_CHAR #undef MPI_UNSIGNED_CHAR #define MPI_UNSIGNED_CHAR ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_UNSIGNED_SHORT +#ifndef PyMPI_HAVE_MPI_UNSIGNED_SHORT #undef MPI_UNSIGNED_SHORT #define MPI_UNSIGNED_SHORT ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_UNSIGNED +#ifndef PyMPI_HAVE_MPI_UNSIGNED #undef MPI_UNSIGNED #define MPI_UNSIGNED ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_UNSIGNED_LONG +#ifndef PyMPI_HAVE_MPI_UNSIGNED_LONG #undef MPI_UNSIGNED_LONG #define MPI_UNSIGNED_LONG ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_UNSIGNED_LONG_LONG +#ifndef PyMPI_HAVE_MPI_UNSIGNED_LONG_LONG #undef MPI_UNSIGNED_LONG_LONG #define MPI_UNSIGNED_LONG_LONG ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_FLOAT +#ifndef PyMPI_HAVE_MPI_FLOAT #undef MPI_FLOAT #define MPI_FLOAT ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_DOUBLE +#ifndef PyMPI_HAVE_MPI_DOUBLE #undef MPI_DOUBLE #define MPI_DOUBLE ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_LONG_DOUBLE +#ifndef PyMPI_HAVE_MPI_LONG_DOUBLE #undef MPI_LONG_DOUBLE #define MPI_LONG_DOUBLE ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_C_BOOL +#ifndef PyMPI_HAVE_MPI_C_BOOL #undef MPI_C_BOOL #define MPI_C_BOOL ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_INT8_T +#ifndef PyMPI_HAVE_MPI_INT8_T #undef MPI_INT8_T #define MPI_INT8_T ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_INT16_T +#ifndef PyMPI_HAVE_MPI_INT16_T #undef MPI_INT16_T #define MPI_INT16_T ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_INT32_T +#ifndef PyMPI_HAVE_MPI_INT32_T #undef MPI_INT32_T #define MPI_INT32_T ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_INT64_T +#ifndef PyMPI_HAVE_MPI_INT64_T #undef MPI_INT64_T #define MPI_INT64_T ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_UINT8_T +#ifndef PyMPI_HAVE_MPI_UINT8_T #undef MPI_UINT8_T #define MPI_UINT8_T ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_UINT16_T +#ifndef PyMPI_HAVE_MPI_UINT16_T #undef MPI_UINT16_T #define MPI_UINT16_T ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_UINT32_T +#ifndef PyMPI_HAVE_MPI_UINT32_T #undef MPI_UINT32_T #define MPI_UINT32_T ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_UINT64_T +#ifndef PyMPI_HAVE_MPI_UINT64_T #undef MPI_UINT64_T #define MPI_UINT64_T ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_C_COMPLEX +#ifndef PyMPI_HAVE_MPI_C_COMPLEX #undef MPI_C_COMPLEX #define MPI_C_COMPLEX ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_C_FLOAT_COMPLEX +#ifndef PyMPI_HAVE_MPI_C_FLOAT_COMPLEX #undef MPI_C_FLOAT_COMPLEX #define MPI_C_FLOAT_COMPLEX ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_C_DOUBLE_COMPLEX +#ifndef PyMPI_HAVE_MPI_C_DOUBLE_COMPLEX #undef MPI_C_DOUBLE_COMPLEX #define MPI_C_DOUBLE_COMPLEX ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_C_LONG_DOUBLE_COMPLEX +#ifndef PyMPI_HAVE_MPI_C_LONG_DOUBLE_COMPLEX #undef MPI_C_LONG_DOUBLE_COMPLEX #define MPI_C_LONG_DOUBLE_COMPLEX ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_SHORT_INT +#ifndef PyMPI_HAVE_MPI_SHORT_INT #undef MPI_SHORT_INT #define MPI_SHORT_INT ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_2INT +#ifndef PyMPI_HAVE_MPI_2INT #undef MPI_2INT #define MPI_2INT ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_LONG_INT +#ifndef PyMPI_HAVE_MPI_LONG_INT #undef MPI_LONG_INT #define MPI_LONG_INT ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_FLOAT_INT +#ifndef PyMPI_HAVE_MPI_FLOAT_INT #undef MPI_FLOAT_INT #define MPI_FLOAT_INT ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_DOUBLE_INT +#ifndef PyMPI_HAVE_MPI_DOUBLE_INT #undef MPI_DOUBLE_INT #define MPI_DOUBLE_INT ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_LONG_DOUBLE_INT +#ifndef PyMPI_HAVE_MPI_LONG_DOUBLE_INT #undef MPI_LONG_DOUBLE_INT #define MPI_LONG_DOUBLE_INT ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_CHARACTER +#ifndef PyMPI_HAVE_MPI_CHARACTER #undef MPI_CHARACTER #define MPI_CHARACTER ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_LOGICAL +#ifndef PyMPI_HAVE_MPI_LOGICAL #undef MPI_LOGICAL #define MPI_LOGICAL ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_INTEGER +#ifndef PyMPI_HAVE_MPI_INTEGER #undef MPI_INTEGER #define MPI_INTEGER ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_REAL +#ifndef PyMPI_HAVE_MPI_REAL #undef MPI_REAL #define MPI_REAL ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_DOUBLE_PRECISION +#ifndef PyMPI_HAVE_MPI_DOUBLE_PRECISION #undef MPI_DOUBLE_PRECISION #define MPI_DOUBLE_PRECISION ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_COMPLEX +#ifndef PyMPI_HAVE_MPI_COMPLEX #undef MPI_COMPLEX #define MPI_COMPLEX ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_DOUBLE_COMPLEX +#ifndef PyMPI_HAVE_MPI_DOUBLE_COMPLEX #undef MPI_DOUBLE_COMPLEX #define MPI_DOUBLE_COMPLEX ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_LOGICAL1 +#ifndef PyMPI_HAVE_MPI_LOGICAL1 #undef MPI_LOGICAL1 #define MPI_LOGICAL1 ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_LOGICAL2 +#ifndef PyMPI_HAVE_MPI_LOGICAL2 #undef MPI_LOGICAL2 #define MPI_LOGICAL2 ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_LOGICAL4 +#ifndef PyMPI_HAVE_MPI_LOGICAL4 #undef MPI_LOGICAL4 #define MPI_LOGICAL4 ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_LOGICAL8 +#ifndef PyMPI_HAVE_MPI_LOGICAL8 #undef MPI_LOGICAL8 #define MPI_LOGICAL8 ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_INTEGER1 +#ifndef PyMPI_HAVE_MPI_INTEGER1 #undef MPI_INTEGER1 #define MPI_INTEGER1 ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_INTEGER2 +#ifndef PyMPI_HAVE_MPI_INTEGER2 #undef MPI_INTEGER2 #define MPI_INTEGER2 ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_INTEGER4 +#ifndef PyMPI_HAVE_MPI_INTEGER4 #undef MPI_INTEGER4 #define MPI_INTEGER4 ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_INTEGER8 +#ifndef PyMPI_HAVE_MPI_INTEGER8 #undef MPI_INTEGER8 #define MPI_INTEGER8 ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_INTEGER16 +#ifndef PyMPI_HAVE_MPI_INTEGER16 #undef MPI_INTEGER16 #define MPI_INTEGER16 ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_REAL2 +#ifndef PyMPI_HAVE_MPI_REAL2 #undef MPI_REAL2 #define MPI_REAL2 ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_REAL4 +#ifndef PyMPI_HAVE_MPI_REAL4 #undef MPI_REAL4 #define MPI_REAL4 ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_REAL8 +#ifndef PyMPI_HAVE_MPI_REAL8 #undef MPI_REAL8 #define MPI_REAL8 ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_REAL16 +#ifndef PyMPI_HAVE_MPI_REAL16 #undef MPI_REAL16 #define MPI_REAL16 ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_COMPLEX4 +#ifndef PyMPI_HAVE_MPI_COMPLEX4 #undef MPI_COMPLEX4 #define MPI_COMPLEX4 ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_COMPLEX8 +#ifndef PyMPI_HAVE_MPI_COMPLEX8 #undef MPI_COMPLEX8 #define MPI_COMPLEX8 ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_COMPLEX16 +#ifndef PyMPI_HAVE_MPI_COMPLEX16 #undef MPI_COMPLEX16 #define MPI_COMPLEX16 ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_COMPLEX32 +#ifndef PyMPI_HAVE_MPI_COMPLEX32 #undef MPI_COMPLEX32 #define MPI_COMPLEX32 ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_UB +#ifndef PyMPI_HAVE_MPI_UB #undef MPI_UB #define MPI_UB ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_LB +#ifndef PyMPI_HAVE_MPI_LB #undef MPI_LB #define MPI_LB ((MPI_Datatype)MPI_DATATYPE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_Type_lb +#ifndef PyMPI_HAVE_MPI_Type_lb #undef MPI_Type_lb #define MPI_Type_lb(a1,a2) PyMPI_UNAVAILABLE("MPI_Type_lb",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Type_ub +#ifndef PyMPI_HAVE_MPI_Type_ub #undef MPI_Type_ub #define MPI_Type_ub(a1,a2) PyMPI_UNAVAILABLE("MPI_Type_ub",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Type_extent +#ifndef PyMPI_HAVE_MPI_Type_extent #undef MPI_Type_extent #define MPI_Type_extent(a1,a2) PyMPI_UNAVAILABLE("MPI_Type_extent",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Address +#ifndef PyMPI_HAVE_MPI_Address #undef MPI_Address #define MPI_Address(a1,a2) PyMPI_UNAVAILABLE("MPI_Address",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Type_hvector +#ifndef PyMPI_HAVE_MPI_Type_hvector #undef MPI_Type_hvector #define MPI_Type_hvector(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Type_hvector",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Type_hindexed +#ifndef PyMPI_HAVE_MPI_Type_hindexed #undef MPI_Type_hindexed #define MPI_Type_hindexed(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Type_hindexed",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Type_struct +#ifndef PyMPI_HAVE_MPI_Type_struct #undef MPI_Type_struct #define MPI_Type_struct(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Type_struct",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Type_dup +#ifndef PyMPI_HAVE_MPI_Type_dup #undef MPI_Type_dup #define MPI_Type_dup(a1,a2) PyMPI_UNAVAILABLE("MPI_Type_dup",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Type_contiguous +#ifndef PyMPI_HAVE_MPI_Type_contiguous #undef MPI_Type_contiguous #define MPI_Type_contiguous(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Type_contiguous",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Type_vector +#ifndef PyMPI_HAVE_MPI_Type_vector #undef MPI_Type_vector #define MPI_Type_vector(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Type_vector",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Type_indexed +#ifndef PyMPI_HAVE_MPI_Type_indexed #undef MPI_Type_indexed #define MPI_Type_indexed(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Type_indexed",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Type_create_indexed_block +#ifndef PyMPI_HAVE_MPI_Type_create_indexed_block #undef MPI_Type_create_indexed_block #define MPI_Type_create_indexed_block(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Type_create_indexed_block",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_ORDER_C +#ifndef PyMPI_HAVE_MPI_ORDER_C #undef MPI_ORDER_C #define MPI_ORDER_C (0) #endif -#ifdef PyMPI_MISSING_MPI_ORDER_FORTRAN +#ifndef PyMPI_HAVE_MPI_ORDER_FORTRAN #undef MPI_ORDER_FORTRAN #define MPI_ORDER_FORTRAN (1) #endif -#ifdef PyMPI_MISSING_MPI_Type_create_subarray +#ifndef PyMPI_HAVE_MPI_Type_create_subarray #undef MPI_Type_create_subarray #define MPI_Type_create_subarray(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Type_create_subarray",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_DISTRIBUTE_NONE +#ifndef PyMPI_HAVE_MPI_DISTRIBUTE_NONE #undef MPI_DISTRIBUTE_NONE #define MPI_DISTRIBUTE_NONE (0) #endif -#ifdef PyMPI_MISSING_MPI_DISTRIBUTE_BLOCK +#ifndef PyMPI_HAVE_MPI_DISTRIBUTE_BLOCK #undef MPI_DISTRIBUTE_BLOCK #define MPI_DISTRIBUTE_BLOCK (1) #endif -#ifdef PyMPI_MISSING_MPI_DISTRIBUTE_CYCLIC +#ifndef PyMPI_HAVE_MPI_DISTRIBUTE_CYCLIC #undef MPI_DISTRIBUTE_CYCLIC #define MPI_DISTRIBUTE_CYCLIC (2) #endif -#ifdef PyMPI_MISSING_MPI_DISTRIBUTE_DFLT_DARG +#ifndef PyMPI_HAVE_MPI_DISTRIBUTE_DFLT_DARG #undef MPI_DISTRIBUTE_DFLT_DARG #define MPI_DISTRIBUTE_DFLT_DARG (4) #endif -#ifdef PyMPI_MISSING_MPI_Type_create_darray +#ifndef PyMPI_HAVE_MPI_Type_create_darray #undef MPI_Type_create_darray #define MPI_Type_create_darray(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) PyMPI_UNAVAILABLE("MPI_Type_create_darray",a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) #endif -#ifdef PyMPI_MISSING_MPI_Get_address +#ifndef PyMPI_HAVE_MPI_Get_address #undef MPI_Get_address #define MPI_Get_address MPI_Address #endif -#ifdef PyMPI_MISSING_MPI_Type_create_hvector +#ifndef PyMPI_HAVE_MPI_Type_create_hvector #undef MPI_Type_create_hvector #define MPI_Type_create_hvector MPI_Type_hvector #endif -#ifdef PyMPI_MISSING_MPI_Type_create_hindexed +#ifndef PyMPI_HAVE_MPI_Type_create_hindexed #undef MPI_Type_create_hindexed #define MPI_Type_create_hindexed MPI_Type_hindexed #endif -#ifdef PyMPI_MISSING_MPI_Type_create_hindexed_block +#ifndef PyMPI_HAVE_MPI_Type_create_hindexed_block #undef MPI_Type_create_hindexed_block #define MPI_Type_create_hindexed_block(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Type_create_hindexed_block",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Type_create_struct +#ifndef PyMPI_HAVE_MPI_Type_create_struct #undef MPI_Type_create_struct #define MPI_Type_create_struct MPI_Type_struct #endif -#ifdef PyMPI_MISSING_MPI_Type_create_resized +#ifndef PyMPI_HAVE_MPI_Type_create_resized #undef MPI_Type_create_resized #define MPI_Type_create_resized(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Type_create_resized",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Type_size +#ifndef PyMPI_HAVE_MPI_Type_size #undef MPI_Type_size #define MPI_Type_size(a1,a2) PyMPI_UNAVAILABLE("MPI_Type_size",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Type_size_x +#ifndef PyMPI_HAVE_MPI_Type_size_x #undef MPI_Type_size_x #define MPI_Type_size_x(a1,a2) PyMPI_UNAVAILABLE("MPI_Type_size_x",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Type_get_extent +#ifndef PyMPI_HAVE_MPI_Type_get_extent #undef MPI_Type_get_extent #define MPI_Type_get_extent(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Type_get_extent",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Type_get_extent_x +#ifndef PyMPI_HAVE_MPI_Type_get_extent_x #undef MPI_Type_get_extent_x #define MPI_Type_get_extent_x(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Type_get_extent_x",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Type_get_true_extent +#ifndef PyMPI_HAVE_MPI_Type_get_true_extent #undef MPI_Type_get_true_extent #define MPI_Type_get_true_extent(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Type_get_true_extent",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Type_get_true_extent_x +#ifndef PyMPI_HAVE_MPI_Type_get_true_extent_x #undef MPI_Type_get_true_extent_x #define MPI_Type_get_true_extent_x(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Type_get_true_extent_x",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Type_create_f90_integer +#ifndef PyMPI_HAVE_MPI_Type_create_f90_integer #undef MPI_Type_create_f90_integer #define MPI_Type_create_f90_integer(a1,a2) PyMPI_UNAVAILABLE("MPI_Type_create_f90_integer",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Type_create_f90_real +#ifndef PyMPI_HAVE_MPI_Type_create_f90_real #undef MPI_Type_create_f90_real #define MPI_Type_create_f90_real(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Type_create_f90_real",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Type_create_f90_complex +#ifndef PyMPI_HAVE_MPI_Type_create_f90_complex #undef MPI_Type_create_f90_complex #define MPI_Type_create_f90_complex(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Type_create_f90_complex",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_TYPECLASS_INTEGER +#ifndef PyMPI_HAVE_MPI_TYPECLASS_INTEGER #undef MPI_TYPECLASS_INTEGER #define MPI_TYPECLASS_INTEGER (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_TYPECLASS_REAL +#ifndef PyMPI_HAVE_MPI_TYPECLASS_REAL #undef MPI_TYPECLASS_REAL #define MPI_TYPECLASS_REAL (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_TYPECLASS_COMPLEX +#ifndef PyMPI_HAVE_MPI_TYPECLASS_COMPLEX #undef MPI_TYPECLASS_COMPLEX #define MPI_TYPECLASS_COMPLEX (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_Type_match_size +#ifndef PyMPI_HAVE_MPI_Type_match_size #undef MPI_Type_match_size #define MPI_Type_match_size(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Type_match_size",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Type_commit +#ifndef PyMPI_HAVE_MPI_Type_commit #undef MPI_Type_commit #define MPI_Type_commit(a1) PyMPI_UNAVAILABLE("MPI_Type_commit",a1) #endif -#ifdef PyMPI_MISSING_MPI_Type_free +#ifndef PyMPI_HAVE_MPI_Type_free #undef MPI_Type_free #define MPI_Type_free(a1) PyMPI_UNAVAILABLE("MPI_Type_free",a1) #endif -#ifdef PyMPI_MISSING_MPI_Pack +#ifndef PyMPI_HAVE_MPI_Pack #undef MPI_Pack #define MPI_Pack(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Pack",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Unpack +#ifndef PyMPI_HAVE_MPI_Unpack #undef MPI_Unpack #define MPI_Unpack(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Unpack",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Pack_size +#ifndef PyMPI_HAVE_MPI_Pack_size #undef MPI_Pack_size #define MPI_Pack_size(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Pack_size",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Pack_external +#ifndef PyMPI_HAVE_MPI_Pack_external #undef MPI_Pack_external #define MPI_Pack_external(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Pack_external",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Unpack_external +#ifndef PyMPI_HAVE_MPI_Unpack_external #undef MPI_Unpack_external #define MPI_Unpack_external(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Unpack_external",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Pack_external_size +#ifndef PyMPI_HAVE_MPI_Pack_external_size #undef MPI_Pack_external_size #define MPI_Pack_external_size(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Pack_external_size",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_NAMED +#ifndef PyMPI_HAVE_MPI_COMBINER_NAMED #undef MPI_COMBINER_NAMED #define MPI_COMBINER_NAMED (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_DUP +#ifndef PyMPI_HAVE_MPI_COMBINER_DUP #undef MPI_COMBINER_DUP #define MPI_COMBINER_DUP (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_CONTIGUOUS +#ifndef PyMPI_HAVE_MPI_COMBINER_CONTIGUOUS #undef MPI_COMBINER_CONTIGUOUS #define MPI_COMBINER_CONTIGUOUS (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_VECTOR +#ifndef PyMPI_HAVE_MPI_COMBINER_VECTOR #undef MPI_COMBINER_VECTOR #define MPI_COMBINER_VECTOR (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_HVECTOR +#ifndef PyMPI_HAVE_MPI_COMBINER_HVECTOR #undef MPI_COMBINER_HVECTOR #define MPI_COMBINER_HVECTOR (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_HVECTOR_INTEGER +#ifndef PyMPI_HAVE_MPI_COMBINER_HVECTOR_INTEGER #undef MPI_COMBINER_HVECTOR_INTEGER #define MPI_COMBINER_HVECTOR_INTEGER (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_INDEXED +#ifndef PyMPI_HAVE_MPI_COMBINER_INDEXED #undef MPI_COMBINER_INDEXED #define MPI_COMBINER_INDEXED (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_HINDEXED +#ifndef PyMPI_HAVE_MPI_COMBINER_HINDEXED #undef MPI_COMBINER_HINDEXED #define MPI_COMBINER_HINDEXED (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_HINDEXED_INTEGER +#ifndef PyMPI_HAVE_MPI_COMBINER_HINDEXED_INTEGER #undef MPI_COMBINER_HINDEXED_INTEGER #define MPI_COMBINER_HINDEXED_INTEGER (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_INDEXED_BLOCK +#ifndef PyMPI_HAVE_MPI_COMBINER_INDEXED_BLOCK #undef MPI_COMBINER_INDEXED_BLOCK #define MPI_COMBINER_INDEXED_BLOCK (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_HINDEXED_BLOCK +#ifndef PyMPI_HAVE_MPI_COMBINER_HINDEXED_BLOCK #undef MPI_COMBINER_HINDEXED_BLOCK #define MPI_COMBINER_HINDEXED_BLOCK (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_STRUCT +#ifndef PyMPI_HAVE_MPI_COMBINER_STRUCT #undef MPI_COMBINER_STRUCT #define MPI_COMBINER_STRUCT (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_STRUCT_INTEGER +#ifndef PyMPI_HAVE_MPI_COMBINER_STRUCT_INTEGER #undef MPI_COMBINER_STRUCT_INTEGER #define MPI_COMBINER_STRUCT_INTEGER (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_SUBARRAY +#ifndef PyMPI_HAVE_MPI_COMBINER_SUBARRAY #undef MPI_COMBINER_SUBARRAY #define MPI_COMBINER_SUBARRAY (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_DARRAY +#ifndef PyMPI_HAVE_MPI_COMBINER_DARRAY #undef MPI_COMBINER_DARRAY #define MPI_COMBINER_DARRAY (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_F90_REAL +#ifndef PyMPI_HAVE_MPI_COMBINER_F90_REAL #undef MPI_COMBINER_F90_REAL #define MPI_COMBINER_F90_REAL (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_F90_COMPLEX +#ifndef PyMPI_HAVE_MPI_COMBINER_F90_COMPLEX #undef MPI_COMBINER_F90_COMPLEX #define MPI_COMBINER_F90_COMPLEX (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_F90_INTEGER +#ifndef PyMPI_HAVE_MPI_COMBINER_F90_INTEGER #undef MPI_COMBINER_F90_INTEGER #define MPI_COMBINER_F90_INTEGER (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_COMBINER_RESIZED +#ifndef PyMPI_HAVE_MPI_COMBINER_RESIZED #undef MPI_COMBINER_RESIZED #define MPI_COMBINER_RESIZED (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_Type_get_envelope +#ifndef PyMPI_HAVE_MPI_Type_get_envelope #undef MPI_Type_get_envelope #define MPI_Type_get_envelope(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Type_get_envelope",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Type_get_contents +#ifndef PyMPI_HAVE_MPI_Type_get_contents #undef MPI_Type_get_contents #define MPI_Type_get_contents(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Type_get_contents",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Type_get_name +#ifndef PyMPI_HAVE_MPI_Type_get_name #undef MPI_Type_get_name #define MPI_Type_get_name(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Type_get_name",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Type_set_name +#ifndef PyMPI_HAVE_MPI_Type_set_name #undef MPI_Type_set_name #define MPI_Type_set_name(a1,a2) PyMPI_UNAVAILABLE("MPI_Type_set_name",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Type_get_attr +#ifndef PyMPI_HAVE_MPI_Type_get_attr #undef MPI_Type_get_attr #define MPI_Type_get_attr(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Type_get_attr",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Type_set_attr +#ifndef PyMPI_HAVE_MPI_Type_set_attr #undef MPI_Type_set_attr #define MPI_Type_set_attr(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Type_set_attr",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Type_delete_attr +#ifndef PyMPI_HAVE_MPI_Type_delete_attr #undef MPI_Type_delete_attr #define MPI_Type_delete_attr(a1,a2) PyMPI_UNAVAILABLE("MPI_Type_delete_attr",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Type_copy_attr_function +#ifndef PyMPI_HAVE_MPI_Type_copy_attr_function #undef MPI_Type_copy_attr_function typedef int (PyMPI_MPI_Type_copy_attr_function)(MPI_Datatype,int,void*,void*,void*,int*); #define MPI_Type_copy_attr_function PyMPI_MPI_Type_copy_attr_function #endif -#ifdef PyMPI_MISSING_MPI_Type_delete_attr_function +#ifndef PyMPI_HAVE_MPI_Type_delete_attr_function #undef MPI_Type_delete_attr_function typedef int (PyMPI_MPI_Type_delete_attr_function)(MPI_Datatype,int,void*,void*); #define MPI_Type_delete_attr_function PyMPI_MPI_Type_delete_attr_function #endif -#ifdef PyMPI_MISSING_MPI_TYPE_NULL_COPY_FN +#ifndef PyMPI_HAVE_MPI_TYPE_NULL_COPY_FN #undef MPI_TYPE_NULL_COPY_FN #define MPI_TYPE_NULL_COPY_FN (0) #endif -#ifdef PyMPI_MISSING_MPI_TYPE_DUP_FN +#ifndef PyMPI_HAVE_MPI_TYPE_DUP_FN #undef MPI_TYPE_DUP_FN #define MPI_TYPE_DUP_FN (0) #endif -#ifdef PyMPI_MISSING_MPI_TYPE_NULL_DELETE_FN +#ifndef PyMPI_HAVE_MPI_TYPE_NULL_DELETE_FN #undef MPI_TYPE_NULL_DELETE_FN #define MPI_TYPE_NULL_DELETE_FN (0) #endif -#ifdef PyMPI_MISSING_MPI_Type_create_keyval +#ifndef PyMPI_HAVE_MPI_Type_create_keyval #undef MPI_Type_create_keyval #define MPI_Type_create_keyval(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Type_create_keyval",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Type_free_keyval +#ifndef PyMPI_HAVE_MPI_Type_free_keyval #undef MPI_Type_free_keyval #define MPI_Type_free_keyval(a1) PyMPI_UNAVAILABLE("MPI_Type_free_keyval",a1) #endif -#ifdef PyMPI_MISSING_MPI_STATUS_IGNORE +#ifndef PyMPI_HAVE_MPI_STATUS_IGNORE #undef MPI_STATUS_IGNORE #define MPI_STATUS_IGNORE (0) #endif -#ifdef PyMPI_MISSING_MPI_STATUSES_IGNORE +#ifndef PyMPI_HAVE_MPI_STATUSES_IGNORE #undef MPI_STATUSES_IGNORE #define MPI_STATUSES_IGNORE (0) #endif -#ifdef PyMPI_MISSING_MPI_Get_count +#ifndef PyMPI_HAVE_MPI_Get_count #undef MPI_Get_count #define MPI_Get_count(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Get_count",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Get_elements +#ifndef PyMPI_HAVE_MPI_Get_elements #undef MPI_Get_elements #define MPI_Get_elements(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Get_elements",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Get_elements_x +#ifndef PyMPI_HAVE_MPI_Get_elements_x #undef MPI_Get_elements_x #define MPI_Get_elements_x(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Get_elements_x",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Status_set_elements +#ifndef PyMPI_HAVE_MPI_Status_set_elements #undef MPI_Status_set_elements #define MPI_Status_set_elements(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Status_set_elements",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Status_set_elements_x +#ifndef PyMPI_HAVE_MPI_Status_set_elements_x #undef MPI_Status_set_elements_x #define MPI_Status_set_elements_x(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Status_set_elements_x",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Test_cancelled +#ifndef PyMPI_HAVE_MPI_Test_cancelled #undef MPI_Test_cancelled #define MPI_Test_cancelled(a1,a2) PyMPI_UNAVAILABLE("MPI_Test_cancelled",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Status_set_cancelled +#ifndef PyMPI_HAVE_MPI_Status_set_cancelled #undef MPI_Status_set_cancelled #define MPI_Status_set_cancelled(a1,a2) PyMPI_UNAVAILABLE("MPI_Status_set_cancelled",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_REQUEST_NULL +#ifndef PyMPI_HAVE_MPI_REQUEST_NULL #undef MPI_REQUEST_NULL #define MPI_REQUEST_NULL ((MPI_Request)0) #endif -#ifdef PyMPI_MISSING_MPI_Request_free +#ifndef PyMPI_HAVE_MPI_Request_free #undef MPI_Request_free #define MPI_Request_free(a1) PyMPI_UNAVAILABLE("MPI_Request_free",a1) #endif -#ifdef PyMPI_MISSING_MPI_Wait +#ifndef PyMPI_HAVE_MPI_Wait #undef MPI_Wait #define MPI_Wait(a1,a2) PyMPI_UNAVAILABLE("MPI_Wait",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Test +#ifndef PyMPI_HAVE_MPI_Test #undef MPI_Test #define MPI_Test(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Test",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Request_get_status +#ifndef PyMPI_HAVE_MPI_Request_get_status #undef MPI_Request_get_status #define MPI_Request_get_status(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Request_get_status",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Cancel +#ifndef PyMPI_HAVE_MPI_Cancel #undef MPI_Cancel #define MPI_Cancel(a1) PyMPI_UNAVAILABLE("MPI_Cancel",a1) #endif -#ifdef PyMPI_MISSING_MPI_Waitany +#ifndef PyMPI_HAVE_MPI_Waitany #undef MPI_Waitany #define MPI_Waitany(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Waitany",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Testany +#ifndef PyMPI_HAVE_MPI_Testany #undef MPI_Testany #define MPI_Testany(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Testany",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Waitall +#ifndef PyMPI_HAVE_MPI_Waitall #undef MPI_Waitall #define MPI_Waitall(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Waitall",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Testall +#ifndef PyMPI_HAVE_MPI_Testall #undef MPI_Testall #define MPI_Testall(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Testall",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Waitsome +#ifndef PyMPI_HAVE_MPI_Waitsome #undef MPI_Waitsome #define MPI_Waitsome(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Waitsome",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Testsome +#ifndef PyMPI_HAVE_MPI_Testsome #undef MPI_Testsome #define MPI_Testsome(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Testsome",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Start +#ifndef PyMPI_HAVE_MPI_Start #undef MPI_Start #define MPI_Start(a1) PyMPI_UNAVAILABLE("MPI_Start",a1) #endif -#ifdef PyMPI_MISSING_MPI_Startall +#ifndef PyMPI_HAVE_MPI_Startall #undef MPI_Startall #define MPI_Startall(a1,a2) PyMPI_UNAVAILABLE("MPI_Startall",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Grequest_cancel_function +#ifndef PyMPI_HAVE_MPI_Grequest_cancel_function #undef MPI_Grequest_cancel_function typedef int (PyMPI_MPI_Grequest_cancel_function)(void*,int); #define MPI_Grequest_cancel_function PyMPI_MPI_Grequest_cancel_function #endif -#ifdef PyMPI_MISSING_MPI_Grequest_free_function +#ifndef PyMPI_HAVE_MPI_Grequest_free_function #undef MPI_Grequest_free_function typedef int (PyMPI_MPI_Grequest_free_function)(void*); #define MPI_Grequest_free_function PyMPI_MPI_Grequest_free_function #endif -#ifdef PyMPI_MISSING_MPI_Grequest_query_function +#ifndef PyMPI_HAVE_MPI_Grequest_query_function #undef MPI_Grequest_query_function typedef int (PyMPI_MPI_Grequest_query_function)(void*,MPI_Status*); #define MPI_Grequest_query_function PyMPI_MPI_Grequest_query_function #endif -#ifdef PyMPI_MISSING_MPI_Grequest_start +#ifndef PyMPI_HAVE_MPI_Grequest_start #undef MPI_Grequest_start #define MPI_Grequest_start(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Grequest_start",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Grequest_complete +#ifndef PyMPI_HAVE_MPI_Grequest_complete #undef MPI_Grequest_complete #define MPI_Grequest_complete(a1) PyMPI_UNAVAILABLE("MPI_Grequest_complete",a1) #endif -#ifdef PyMPI_MISSING_MPI_OP_NULL +#ifndef PyMPI_HAVE_MPI_OP_NULL #undef MPI_OP_NULL #define MPI_OP_NULL ((MPI_Op)0) #endif -#ifdef PyMPI_MISSING_MPI_MAX +#ifndef PyMPI_HAVE_MPI_MAX #undef MPI_MAX #define MPI_MAX ((MPI_Op)MPI_OP_NULL) #endif -#ifdef PyMPI_MISSING_MPI_MIN +#ifndef PyMPI_HAVE_MPI_MIN #undef MPI_MIN #define MPI_MIN ((MPI_Op)MPI_OP_NULL) #endif -#ifdef PyMPI_MISSING_MPI_SUM +#ifndef PyMPI_HAVE_MPI_SUM #undef MPI_SUM #define MPI_SUM ((MPI_Op)MPI_OP_NULL) #endif -#ifdef PyMPI_MISSING_MPI_PROD +#ifndef PyMPI_HAVE_MPI_PROD #undef MPI_PROD #define MPI_PROD ((MPI_Op)MPI_OP_NULL) #endif -#ifdef PyMPI_MISSING_MPI_LAND +#ifndef PyMPI_HAVE_MPI_LAND #undef MPI_LAND #define MPI_LAND ((MPI_Op)MPI_OP_NULL) #endif -#ifdef PyMPI_MISSING_MPI_BAND +#ifndef PyMPI_HAVE_MPI_BAND #undef MPI_BAND #define MPI_BAND ((MPI_Op)MPI_OP_NULL) #endif -#ifdef PyMPI_MISSING_MPI_LOR +#ifndef PyMPI_HAVE_MPI_LOR #undef MPI_LOR #define MPI_LOR ((MPI_Op)MPI_OP_NULL) #endif -#ifdef PyMPI_MISSING_MPI_BOR +#ifndef PyMPI_HAVE_MPI_BOR #undef MPI_BOR #define MPI_BOR ((MPI_Op)MPI_OP_NULL) #endif -#ifdef PyMPI_MISSING_MPI_LXOR +#ifndef PyMPI_HAVE_MPI_LXOR #undef MPI_LXOR #define MPI_LXOR ((MPI_Op)MPI_OP_NULL) #endif -#ifdef PyMPI_MISSING_MPI_BXOR +#ifndef PyMPI_HAVE_MPI_BXOR #undef MPI_BXOR #define MPI_BXOR ((MPI_Op)MPI_OP_NULL) #endif -#ifdef PyMPI_MISSING_MPI_MAXLOC +#ifndef PyMPI_HAVE_MPI_MAXLOC #undef MPI_MAXLOC #define MPI_MAXLOC ((MPI_Op)MPI_OP_NULL) #endif -#ifdef PyMPI_MISSING_MPI_MINLOC +#ifndef PyMPI_HAVE_MPI_MINLOC #undef MPI_MINLOC #define MPI_MINLOC ((MPI_Op)MPI_OP_NULL) #endif -#ifdef PyMPI_MISSING_MPI_REPLACE +#ifndef PyMPI_HAVE_MPI_REPLACE #undef MPI_REPLACE #define MPI_REPLACE ((MPI_Op)MPI_OP_NULL) #endif -#ifdef PyMPI_MISSING_MPI_NO_OP +#ifndef PyMPI_HAVE_MPI_NO_OP #undef MPI_NO_OP #define MPI_NO_OP ((MPI_Op)MPI_OP_NULL) #endif -#ifdef PyMPI_MISSING_MPI_Op_free +#ifndef PyMPI_HAVE_MPI_Op_free #undef MPI_Op_free #define MPI_Op_free(a1) PyMPI_UNAVAILABLE("MPI_Op_free",a1) #endif -#ifdef PyMPI_MISSING_MPI_User_function +#ifndef PyMPI_HAVE_MPI_User_function #undef MPI_User_function typedef void (PyMPI_MPI_User_function)(void*, void*, int*, MPI_Datatype*); #define MPI_User_function PyMPI_MPI_User_function #endif -#ifdef PyMPI_MISSING_MPI_Op_create +#ifndef PyMPI_HAVE_MPI_Op_create #undef MPI_Op_create #define MPI_Op_create(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Op_create",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Op_commutative +#ifndef PyMPI_HAVE_MPI_Op_commutative #undef MPI_Op_commutative #define MPI_Op_commutative(a1,a2) PyMPI_UNAVAILABLE("MPI_Op_commutative",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_INFO_NULL +#ifndef PyMPI_HAVE_MPI_INFO_NULL #undef MPI_INFO_NULL #define MPI_INFO_NULL ((MPI_Info)0) #endif -#ifdef PyMPI_MISSING_MPI_INFO_ENV +#ifndef PyMPI_HAVE_MPI_INFO_ENV #undef MPI_INFO_ENV #define MPI_INFO_ENV ((MPI_Info)MPI_INFO_NULL) #endif -#ifdef PyMPI_MISSING_MPI_Info_free +#ifndef PyMPI_HAVE_MPI_Info_free #undef MPI_Info_free #define MPI_Info_free(a1) PyMPI_UNAVAILABLE("MPI_Info_free",a1) #endif -#ifdef PyMPI_MISSING_MPI_Info_create +#ifndef PyMPI_HAVE_MPI_Info_create #undef MPI_Info_create #define MPI_Info_create(a1) PyMPI_UNAVAILABLE("MPI_Info_create",a1) #endif -#ifdef PyMPI_MISSING_MPI_Info_dup +#ifndef PyMPI_HAVE_MPI_Info_dup #undef MPI_Info_dup #define MPI_Info_dup(a1,a2) PyMPI_UNAVAILABLE("MPI_Info_dup",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_MAX_INFO_KEY +#ifndef PyMPI_HAVE_MPI_MAX_INFO_KEY #undef MPI_MAX_INFO_KEY #define MPI_MAX_INFO_KEY (1) #endif -#ifdef PyMPI_MISSING_MPI_MAX_INFO_VAL +#ifndef PyMPI_HAVE_MPI_MAX_INFO_VAL #undef MPI_MAX_INFO_VAL #define MPI_MAX_INFO_VAL (1) #endif -#ifdef PyMPI_MISSING_MPI_Info_get +#ifndef PyMPI_HAVE_MPI_Info_get #undef MPI_Info_get #define MPI_Info_get(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Info_get",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Info_set +#ifndef PyMPI_HAVE_MPI_Info_set #undef MPI_Info_set #define MPI_Info_set(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Info_set",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Info_delete +#ifndef PyMPI_HAVE_MPI_Info_delete #undef MPI_Info_delete #define MPI_Info_delete(a1,a2) PyMPI_UNAVAILABLE("MPI_Info_delete",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Info_get_nkeys +#ifndef PyMPI_HAVE_MPI_Info_get_nkeys #undef MPI_Info_get_nkeys #define MPI_Info_get_nkeys(a1,a2) PyMPI_UNAVAILABLE("MPI_Info_get_nkeys",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Info_get_nthkey +#ifndef PyMPI_HAVE_MPI_Info_get_nthkey #undef MPI_Info_get_nthkey #define MPI_Info_get_nthkey(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Info_get_nthkey",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Info_get_valuelen +#ifndef PyMPI_HAVE_MPI_Info_get_valuelen #undef MPI_Info_get_valuelen #define MPI_Info_get_valuelen(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Info_get_valuelen",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_GROUP_NULL +#ifndef PyMPI_HAVE_MPI_GROUP_NULL #undef MPI_GROUP_NULL #define MPI_GROUP_NULL ((MPI_Group)0) #endif -#ifdef PyMPI_MISSING_MPI_GROUP_EMPTY +#ifndef PyMPI_HAVE_MPI_GROUP_EMPTY #undef MPI_GROUP_EMPTY #define MPI_GROUP_EMPTY ((MPI_Group)1) #endif -#ifdef PyMPI_MISSING_MPI_Group_free +#ifndef PyMPI_HAVE_MPI_Group_free #undef MPI_Group_free #define MPI_Group_free(a1) PyMPI_UNAVAILABLE("MPI_Group_free",a1) #endif -#ifdef PyMPI_MISSING_MPI_Group_size +#ifndef PyMPI_HAVE_MPI_Group_size #undef MPI_Group_size #define MPI_Group_size(a1,a2) PyMPI_UNAVAILABLE("MPI_Group_size",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Group_rank +#ifndef PyMPI_HAVE_MPI_Group_rank #undef MPI_Group_rank #define MPI_Group_rank(a1,a2) PyMPI_UNAVAILABLE("MPI_Group_rank",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Group_translate_ranks +#ifndef PyMPI_HAVE_MPI_Group_translate_ranks #undef MPI_Group_translate_ranks #define MPI_Group_translate_ranks(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Group_translate_ranks",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Group_compare +#ifndef PyMPI_HAVE_MPI_Group_compare #undef MPI_Group_compare #define MPI_Group_compare(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Group_compare",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Group_union +#ifndef PyMPI_HAVE_MPI_Group_union #undef MPI_Group_union #define MPI_Group_union(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Group_union",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Group_intersection +#ifndef PyMPI_HAVE_MPI_Group_intersection #undef MPI_Group_intersection #define MPI_Group_intersection(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Group_intersection",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Group_difference +#ifndef PyMPI_HAVE_MPI_Group_difference #undef MPI_Group_difference #define MPI_Group_difference(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Group_difference",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Group_incl +#ifndef PyMPI_HAVE_MPI_Group_incl #undef MPI_Group_incl #define MPI_Group_incl(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Group_incl",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Group_excl +#ifndef PyMPI_HAVE_MPI_Group_excl #undef MPI_Group_excl #define MPI_Group_excl(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Group_excl",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Group_range_incl +#ifndef PyMPI_HAVE_MPI_Group_range_incl #undef MPI_Group_range_incl #define MPI_Group_range_incl(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Group_range_incl",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Group_range_excl +#ifndef PyMPI_HAVE_MPI_Group_range_excl #undef MPI_Group_range_excl #define MPI_Group_range_excl(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Group_range_excl",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_COMM_NULL +#ifndef PyMPI_HAVE_MPI_COMM_NULL #undef MPI_COMM_NULL #define MPI_COMM_NULL ((MPI_Comm)0) #endif -#ifdef PyMPI_MISSING_MPI_COMM_SELF +#ifndef PyMPI_HAVE_MPI_COMM_SELF #undef MPI_COMM_SELF #define MPI_COMM_SELF ((MPI_Comm)MPI_COMM_NULL) #endif -#ifdef PyMPI_MISSING_MPI_COMM_WORLD +#ifndef PyMPI_HAVE_MPI_COMM_WORLD #undef MPI_COMM_WORLD #define MPI_COMM_WORLD ((MPI_Comm)MPI_COMM_NULL) #endif -#ifdef PyMPI_MISSING_MPI_Comm_free +#ifndef PyMPI_HAVE_MPI_Comm_free #undef MPI_Comm_free #define MPI_Comm_free(a1) PyMPI_UNAVAILABLE("MPI_Comm_free",a1) #endif -#ifdef PyMPI_MISSING_MPI_Comm_group +#ifndef PyMPI_HAVE_MPI_Comm_group #undef MPI_Comm_group #define MPI_Comm_group(a1,a2) PyMPI_UNAVAILABLE("MPI_Comm_group",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Comm_size +#ifndef PyMPI_HAVE_MPI_Comm_size #undef MPI_Comm_size #define MPI_Comm_size(a1,a2) PyMPI_UNAVAILABLE("MPI_Comm_size",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Comm_rank +#ifndef PyMPI_HAVE_MPI_Comm_rank #undef MPI_Comm_rank #define MPI_Comm_rank(a1,a2) PyMPI_UNAVAILABLE("MPI_Comm_rank",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Comm_compare +#ifndef PyMPI_HAVE_MPI_Comm_compare #undef MPI_Comm_compare #define MPI_Comm_compare(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Comm_compare",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Topo_test +#ifndef PyMPI_HAVE_MPI_Topo_test #undef MPI_Topo_test #define MPI_Topo_test(a1,a2) PyMPI_UNAVAILABLE("MPI_Topo_test",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Comm_test_inter +#ifndef PyMPI_HAVE_MPI_Comm_test_inter #undef MPI_Comm_test_inter #define MPI_Comm_test_inter(a1,a2) PyMPI_UNAVAILABLE("MPI_Comm_test_inter",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Abort +#ifndef PyMPI_HAVE_MPI_Abort #undef MPI_Abort #define MPI_Abort(a1,a2) PyMPI_UNAVAILABLE("MPI_Abort",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Send +#ifndef PyMPI_HAVE_MPI_Send #undef MPI_Send #define MPI_Send(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Send",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_Recv +#ifndef PyMPI_HAVE_MPI_Recv #undef MPI_Recv #define MPI_Recv(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Recv",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Sendrecv +#ifndef PyMPI_HAVE_MPI_Sendrecv #undef MPI_Sendrecv #define MPI_Sendrecv(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) PyMPI_UNAVAILABLE("MPI_Sendrecv",a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) #endif -#ifdef PyMPI_MISSING_MPI_Sendrecv_replace +#ifndef PyMPI_HAVE_MPI_Sendrecv_replace #undef MPI_Sendrecv_replace #define MPI_Sendrecv_replace(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Sendrecv_replace",a1,a2,a3,a4,a5,a6,a7,a8,a9) #endif -#ifdef PyMPI_MISSING_MPI_BSEND_OVERHEAD +#ifndef PyMPI_HAVE_MPI_BSEND_OVERHEAD #undef MPI_BSEND_OVERHEAD #define MPI_BSEND_OVERHEAD (0) #endif -#ifdef PyMPI_MISSING_MPI_Buffer_attach +#ifndef PyMPI_HAVE_MPI_Buffer_attach #undef MPI_Buffer_attach #define MPI_Buffer_attach(a1,a2) PyMPI_UNAVAILABLE("MPI_Buffer_attach",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Buffer_detach +#ifndef PyMPI_HAVE_MPI_Buffer_detach #undef MPI_Buffer_detach #define MPI_Buffer_detach(a1,a2) PyMPI_UNAVAILABLE("MPI_Buffer_detach",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Bsend +#ifndef PyMPI_HAVE_MPI_Bsend #undef MPI_Bsend #define MPI_Bsend(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Bsend",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_Ssend +#ifndef PyMPI_HAVE_MPI_Ssend #undef MPI_Ssend #define MPI_Ssend(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Ssend",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_Rsend +#ifndef PyMPI_HAVE_MPI_Rsend #undef MPI_Rsend #define MPI_Rsend(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Rsend",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_Isend +#ifndef PyMPI_HAVE_MPI_Isend #undef MPI_Isend #define MPI_Isend(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Isend",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Ibsend +#ifndef PyMPI_HAVE_MPI_Ibsend #undef MPI_Ibsend #define MPI_Ibsend(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Ibsend",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Issend +#ifndef PyMPI_HAVE_MPI_Issend #undef MPI_Issend #define MPI_Issend(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Issend",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Irsend +#ifndef PyMPI_HAVE_MPI_Irsend #undef MPI_Irsend #define MPI_Irsend(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Irsend",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Irecv +#ifndef PyMPI_HAVE_MPI_Irecv #undef MPI_Irecv #define MPI_Irecv(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Irecv",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Send_init +#ifndef PyMPI_HAVE_MPI_Send_init #undef MPI_Send_init #define MPI_Send_init(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Send_init",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Bsend_init +#ifndef PyMPI_HAVE_MPI_Bsend_init #undef MPI_Bsend_init #define MPI_Bsend_init(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Bsend_init",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Ssend_init +#ifndef PyMPI_HAVE_MPI_Ssend_init #undef MPI_Ssend_init #define MPI_Ssend_init(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Ssend_init",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Rsend_init +#ifndef PyMPI_HAVE_MPI_Rsend_init #undef MPI_Rsend_init #define MPI_Rsend_init(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Rsend_init",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Recv_init +#ifndef PyMPI_HAVE_MPI_Recv_init #undef MPI_Recv_init #define MPI_Recv_init(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Recv_init",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Probe +#ifndef PyMPI_HAVE_MPI_Probe #undef MPI_Probe #define MPI_Probe(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Probe",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Iprobe +#ifndef PyMPI_HAVE_MPI_Iprobe #undef MPI_Iprobe #define MPI_Iprobe(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Iprobe",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_MESSAGE_NULL +#ifndef PyMPI_HAVE_MPI_MESSAGE_NULL #undef MPI_MESSAGE_NULL #define MPI_MESSAGE_NULL ((MPI_Message)0) #endif -#ifdef PyMPI_MISSING_MPI_MESSAGE_NO_PROC +#ifndef PyMPI_HAVE_MPI_MESSAGE_NO_PROC #undef MPI_MESSAGE_NO_PROC #define MPI_MESSAGE_NO_PROC ((MPI_Message)MPI_MESSAGE_NULL) #endif -#ifdef PyMPI_MISSING_MPI_Mprobe +#ifndef PyMPI_HAVE_MPI_Mprobe #undef MPI_Mprobe #define MPI_Mprobe(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Mprobe",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Improbe +#ifndef PyMPI_HAVE_MPI_Improbe #undef MPI_Improbe #define MPI_Improbe(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Improbe",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_Mrecv +#ifndef PyMPI_HAVE_MPI_Mrecv #undef MPI_Mrecv #define MPI_Mrecv(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Mrecv",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Imrecv +#ifndef PyMPI_HAVE_MPI_Imrecv #undef MPI_Imrecv #define MPI_Imrecv(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Imrecv",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Barrier +#ifndef PyMPI_HAVE_MPI_Barrier #undef MPI_Barrier #define MPI_Barrier(a1) PyMPI_UNAVAILABLE("MPI_Barrier",a1) #endif -#ifdef PyMPI_MISSING_MPI_Bcast +#ifndef PyMPI_HAVE_MPI_Bcast #undef MPI_Bcast #define MPI_Bcast(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Bcast",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Gather +#ifndef PyMPI_HAVE_MPI_Gather #undef MPI_Gather #define MPI_Gather(a1,a2,a3,a4,a5,a6,a7,a8) PyMPI_UNAVAILABLE("MPI_Gather",a1,a2,a3,a4,a5,a6,a7,a8) #endif -#ifdef PyMPI_MISSING_MPI_Gatherv +#ifndef PyMPI_HAVE_MPI_Gatherv #undef MPI_Gatherv #define MPI_Gatherv(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Gatherv",a1,a2,a3,a4,a5,a6,a7,a8,a9) #endif -#ifdef PyMPI_MISSING_MPI_Scatter +#ifndef PyMPI_HAVE_MPI_Scatter #undef MPI_Scatter #define MPI_Scatter(a1,a2,a3,a4,a5,a6,a7,a8) PyMPI_UNAVAILABLE("MPI_Scatter",a1,a2,a3,a4,a5,a6,a7,a8) #endif -#ifdef PyMPI_MISSING_MPI_Scatterv +#ifndef PyMPI_HAVE_MPI_Scatterv #undef MPI_Scatterv #define MPI_Scatterv(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Scatterv",a1,a2,a3,a4,a5,a6,a7,a8,a9) #endif -#ifdef PyMPI_MISSING_MPI_Allgather +#ifndef PyMPI_HAVE_MPI_Allgather #undef MPI_Allgather #define MPI_Allgather(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Allgather",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Allgatherv +#ifndef PyMPI_HAVE_MPI_Allgatherv #undef MPI_Allgatherv #define MPI_Allgatherv(a1,a2,a3,a4,a5,a6,a7,a8) PyMPI_UNAVAILABLE("MPI_Allgatherv",a1,a2,a3,a4,a5,a6,a7,a8) #endif -#ifdef PyMPI_MISSING_MPI_Alltoall +#ifndef PyMPI_HAVE_MPI_Alltoall #undef MPI_Alltoall #define MPI_Alltoall(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Alltoall",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Alltoallv +#ifndef PyMPI_HAVE_MPI_Alltoallv #undef MPI_Alltoallv #define MPI_Alltoallv(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Alltoallv",a1,a2,a3,a4,a5,a6,a7,a8,a9) #endif -#ifdef PyMPI_MISSING_MPI_Alltoallw +#ifndef PyMPI_HAVE_MPI_Alltoallw #undef MPI_Alltoallw #define MPI_Alltoallw(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Alltoallw",a1,a2,a3,a4,a5,a6,a7,a8,a9) #endif -#ifdef PyMPI_MISSING_MPI_Reduce +#ifndef PyMPI_HAVE_MPI_Reduce #undef MPI_Reduce #define MPI_Reduce(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Reduce",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Allreduce +#ifndef PyMPI_HAVE_MPI_Allreduce #undef MPI_Allreduce #define MPI_Allreduce(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Allreduce",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_Reduce_local +#ifndef PyMPI_HAVE_MPI_Reduce_local #undef MPI_Reduce_local #define MPI_Reduce_local(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Reduce_local",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Reduce_scatter_block +#ifndef PyMPI_HAVE_MPI_Reduce_scatter_block #undef MPI_Reduce_scatter_block #define MPI_Reduce_scatter_block(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Reduce_scatter_block",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_Reduce_scatter +#ifndef PyMPI_HAVE_MPI_Reduce_scatter #undef MPI_Reduce_scatter #define MPI_Reduce_scatter(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Reduce_scatter",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_Scan +#ifndef PyMPI_HAVE_MPI_Scan #undef MPI_Scan #define MPI_Scan(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Scan",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_Exscan +#ifndef PyMPI_HAVE_MPI_Exscan #undef MPI_Exscan #define MPI_Exscan(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Exscan",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_Neighbor_allgather +#ifndef PyMPI_HAVE_MPI_Neighbor_allgather #undef MPI_Neighbor_allgather #define MPI_Neighbor_allgather(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Neighbor_allgather",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Neighbor_allgatherv +#ifndef PyMPI_HAVE_MPI_Neighbor_allgatherv #undef MPI_Neighbor_allgatherv #define MPI_Neighbor_allgatherv(a1,a2,a3,a4,a5,a6,a7,a8) PyMPI_UNAVAILABLE("MPI_Neighbor_allgatherv",a1,a2,a3,a4,a5,a6,a7,a8) #endif -#ifdef PyMPI_MISSING_MPI_Neighbor_alltoall +#ifndef PyMPI_HAVE_MPI_Neighbor_alltoall #undef MPI_Neighbor_alltoall #define MPI_Neighbor_alltoall(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Neighbor_alltoall",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Neighbor_alltoallv +#ifndef PyMPI_HAVE_MPI_Neighbor_alltoallv #undef MPI_Neighbor_alltoallv #define MPI_Neighbor_alltoallv(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Neighbor_alltoallv",a1,a2,a3,a4,a5,a6,a7,a8,a9) #endif -#ifdef PyMPI_MISSING_MPI_Neighbor_alltoallw +#ifndef PyMPI_HAVE_MPI_Neighbor_alltoallw #undef MPI_Neighbor_alltoallw #define MPI_Neighbor_alltoallw(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Neighbor_alltoallw",a1,a2,a3,a4,a5,a6,a7,a8,a9) #endif -#ifdef PyMPI_MISSING_MPI_Ibarrier +#ifndef PyMPI_HAVE_MPI_Ibarrier #undef MPI_Ibarrier #define MPI_Ibarrier(a1,a2) PyMPI_UNAVAILABLE("MPI_Ibarrier",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Ibcast +#ifndef PyMPI_HAVE_MPI_Ibcast #undef MPI_Ibcast #define MPI_Ibcast(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Ibcast",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_Igather +#ifndef PyMPI_HAVE_MPI_Igather #undef MPI_Igather #define MPI_Igather(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Igather",a1,a2,a3,a4,a5,a6,a7,a8,a9) #endif -#ifdef PyMPI_MISSING_MPI_Igatherv +#ifndef PyMPI_HAVE_MPI_Igatherv #undef MPI_Igatherv #define MPI_Igatherv(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) PyMPI_UNAVAILABLE("MPI_Igatherv",a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) #endif -#ifdef PyMPI_MISSING_MPI_Iscatter +#ifndef PyMPI_HAVE_MPI_Iscatter #undef MPI_Iscatter #define MPI_Iscatter(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Iscatter",a1,a2,a3,a4,a5,a6,a7,a8,a9) #endif -#ifdef PyMPI_MISSING_MPI_Iscatterv +#ifndef PyMPI_HAVE_MPI_Iscatterv #undef MPI_Iscatterv #define MPI_Iscatterv(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) PyMPI_UNAVAILABLE("MPI_Iscatterv",a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) #endif -#ifdef PyMPI_MISSING_MPI_Iallgather +#ifndef PyMPI_HAVE_MPI_Iallgather #undef MPI_Iallgather #define MPI_Iallgather(a1,a2,a3,a4,a5,a6,a7,a8) PyMPI_UNAVAILABLE("MPI_Iallgather",a1,a2,a3,a4,a5,a6,a7,a8) #endif -#ifdef PyMPI_MISSING_MPI_Iallgatherv +#ifndef PyMPI_HAVE_MPI_Iallgatherv #undef MPI_Iallgatherv #define MPI_Iallgatherv(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Iallgatherv",a1,a2,a3,a4,a5,a6,a7,a8,a9) #endif -#ifdef PyMPI_MISSING_MPI_Ialltoall +#ifndef PyMPI_HAVE_MPI_Ialltoall #undef MPI_Ialltoall #define MPI_Ialltoall(a1,a2,a3,a4,a5,a6,a7,a8) PyMPI_UNAVAILABLE("MPI_Ialltoall",a1,a2,a3,a4,a5,a6,a7,a8) #endif -#ifdef PyMPI_MISSING_MPI_Ialltoallv +#ifndef PyMPI_HAVE_MPI_Ialltoallv #undef MPI_Ialltoallv #define MPI_Ialltoallv(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) PyMPI_UNAVAILABLE("MPI_Ialltoallv",a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) #endif -#ifdef PyMPI_MISSING_MPI_Ialltoallw +#ifndef PyMPI_HAVE_MPI_Ialltoallw #undef MPI_Ialltoallw #define MPI_Ialltoallw(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) PyMPI_UNAVAILABLE("MPI_Ialltoallw",a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) #endif -#ifdef PyMPI_MISSING_MPI_Ireduce +#ifndef PyMPI_HAVE_MPI_Ireduce #undef MPI_Ireduce #define MPI_Ireduce(a1,a2,a3,a4,a5,a6,a7,a8) PyMPI_UNAVAILABLE("MPI_Ireduce",a1,a2,a3,a4,a5,a6,a7,a8) #endif -#ifdef PyMPI_MISSING_MPI_Iallreduce +#ifndef PyMPI_HAVE_MPI_Iallreduce #undef MPI_Iallreduce #define MPI_Iallreduce(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Iallreduce",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Ireduce_scatter_block +#ifndef PyMPI_HAVE_MPI_Ireduce_scatter_block #undef MPI_Ireduce_scatter_block #define MPI_Ireduce_scatter_block(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Ireduce_scatter_block",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Ireduce_scatter +#ifndef PyMPI_HAVE_MPI_Ireduce_scatter #undef MPI_Ireduce_scatter #define MPI_Ireduce_scatter(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Ireduce_scatter",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Iscan +#ifndef PyMPI_HAVE_MPI_Iscan #undef MPI_Iscan #define MPI_Iscan(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Iscan",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Iexscan +#ifndef PyMPI_HAVE_MPI_Iexscan #undef MPI_Iexscan #define MPI_Iexscan(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Iexscan",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Ineighbor_allgather +#ifndef PyMPI_HAVE_MPI_Ineighbor_allgather #undef MPI_Ineighbor_allgather #define MPI_Ineighbor_allgather(a1,a2,a3,a4,a5,a6,a7,a8) PyMPI_UNAVAILABLE("MPI_Ineighbor_allgather",a1,a2,a3,a4,a5,a6,a7,a8) #endif -#ifdef PyMPI_MISSING_MPI_Ineighbor_allgatherv +#ifndef PyMPI_HAVE_MPI_Ineighbor_allgatherv #undef MPI_Ineighbor_allgatherv #define MPI_Ineighbor_allgatherv(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Ineighbor_allgatherv",a1,a2,a3,a4,a5,a6,a7,a8,a9) #endif -#ifdef PyMPI_MISSING_MPI_Ineighbor_alltoall +#ifndef PyMPI_HAVE_MPI_Ineighbor_alltoall #undef MPI_Ineighbor_alltoall #define MPI_Ineighbor_alltoall(a1,a2,a3,a4,a5,a6,a7,a8) PyMPI_UNAVAILABLE("MPI_Ineighbor_alltoall",a1,a2,a3,a4,a5,a6,a7,a8) #endif -#ifdef PyMPI_MISSING_MPI_Ineighbor_alltoallv +#ifndef PyMPI_HAVE_MPI_Ineighbor_alltoallv #undef MPI_Ineighbor_alltoallv #define MPI_Ineighbor_alltoallv(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) PyMPI_UNAVAILABLE("MPI_Ineighbor_alltoallv",a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) #endif -#ifdef PyMPI_MISSING_MPI_Ineighbor_alltoallw +#ifndef PyMPI_HAVE_MPI_Ineighbor_alltoallw #undef MPI_Ineighbor_alltoallw #define MPI_Ineighbor_alltoallw(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) PyMPI_UNAVAILABLE("MPI_Ineighbor_alltoallw",a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) #endif -#ifdef PyMPI_MISSING_MPI_Comm_dup +#ifndef PyMPI_HAVE_MPI_Comm_dup #undef MPI_Comm_dup #define MPI_Comm_dup(a1,a2) PyMPI_UNAVAILABLE("MPI_Comm_dup",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Comm_dup_with_info +#ifndef PyMPI_HAVE_MPI_Comm_dup_with_info #undef MPI_Comm_dup_with_info #define MPI_Comm_dup_with_info(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Comm_dup_with_info",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Comm_idup +#ifndef PyMPI_HAVE_MPI_Comm_idup #undef MPI_Comm_idup #define MPI_Comm_idup(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Comm_idup",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Comm_create +#ifndef PyMPI_HAVE_MPI_Comm_create #undef MPI_Comm_create #define MPI_Comm_create(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Comm_create",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Comm_create_group +#ifndef PyMPI_HAVE_MPI_Comm_create_group #undef MPI_Comm_create_group #define MPI_Comm_create_group(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Comm_create_group",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Comm_split +#ifndef PyMPI_HAVE_MPI_Comm_split #undef MPI_Comm_split #define MPI_Comm_split(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Comm_split",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_COMM_TYPE_SHARED +#ifndef PyMPI_HAVE_MPI_COMM_TYPE_SHARED #undef MPI_COMM_TYPE_SHARED #define MPI_COMM_TYPE_SHARED (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_Comm_split_type +#ifndef PyMPI_HAVE_MPI_Comm_split_type #undef MPI_Comm_split_type #define MPI_Comm_split_type(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Comm_split_type",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Comm_set_info +#ifndef PyMPI_HAVE_MPI_Comm_set_info #undef MPI_Comm_set_info #define MPI_Comm_set_info(a1,a2) PyMPI_UNAVAILABLE("MPI_Comm_set_info",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Comm_get_info +#ifndef PyMPI_HAVE_MPI_Comm_get_info #undef MPI_Comm_get_info #define MPI_Comm_get_info(a1,a2) PyMPI_UNAVAILABLE("MPI_Comm_get_info",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_CART +#ifndef PyMPI_HAVE_MPI_CART #undef MPI_CART #define MPI_CART (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_Cart_create +#ifndef PyMPI_HAVE_MPI_Cart_create #undef MPI_Cart_create #define MPI_Cart_create(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Cart_create",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_Cartdim_get +#ifndef PyMPI_HAVE_MPI_Cartdim_get #undef MPI_Cartdim_get #define MPI_Cartdim_get(a1,a2) PyMPI_UNAVAILABLE("MPI_Cartdim_get",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Cart_get +#ifndef PyMPI_HAVE_MPI_Cart_get #undef MPI_Cart_get #define MPI_Cart_get(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Cart_get",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Cart_rank +#ifndef PyMPI_HAVE_MPI_Cart_rank #undef MPI_Cart_rank #define MPI_Cart_rank(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Cart_rank",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Cart_coords +#ifndef PyMPI_HAVE_MPI_Cart_coords #undef MPI_Cart_coords #define MPI_Cart_coords(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Cart_coords",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Cart_shift +#ifndef PyMPI_HAVE_MPI_Cart_shift #undef MPI_Cart_shift #define MPI_Cart_shift(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Cart_shift",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Cart_sub +#ifndef PyMPI_HAVE_MPI_Cart_sub #undef MPI_Cart_sub #define MPI_Cart_sub(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Cart_sub",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Cart_map +#ifndef PyMPI_HAVE_MPI_Cart_map #undef MPI_Cart_map #define MPI_Cart_map(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Cart_map",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Dims_create +#ifndef PyMPI_HAVE_MPI_Dims_create #undef MPI_Dims_create #define MPI_Dims_create(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Dims_create",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_GRAPH +#ifndef PyMPI_HAVE_MPI_GRAPH #undef MPI_GRAPH #define MPI_GRAPH (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_Graph_create +#ifndef PyMPI_HAVE_MPI_Graph_create #undef MPI_Graph_create #define MPI_Graph_create(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Graph_create",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_Graphdims_get +#ifndef PyMPI_HAVE_MPI_Graphdims_get #undef MPI_Graphdims_get #define MPI_Graphdims_get(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Graphdims_get",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Graph_get +#ifndef PyMPI_HAVE_MPI_Graph_get #undef MPI_Graph_get #define MPI_Graph_get(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Graph_get",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Graph_map +#ifndef PyMPI_HAVE_MPI_Graph_map #undef MPI_Graph_map #define MPI_Graph_map(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Graph_map",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Graph_neighbors_count +#ifndef PyMPI_HAVE_MPI_Graph_neighbors_count #undef MPI_Graph_neighbors_count #define MPI_Graph_neighbors_count(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Graph_neighbors_count",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Graph_neighbors +#ifndef PyMPI_HAVE_MPI_Graph_neighbors #undef MPI_Graph_neighbors #define MPI_Graph_neighbors(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Graph_neighbors",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_DIST_GRAPH +#ifndef PyMPI_HAVE_MPI_DIST_GRAPH #undef MPI_DIST_GRAPH #define MPI_DIST_GRAPH (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_UNWEIGHTED +#ifndef PyMPI_HAVE_MPI_UNWEIGHTED #undef MPI_UNWEIGHTED #define MPI_UNWEIGHTED ((int*)0) #endif -#ifdef PyMPI_MISSING_MPI_WEIGHTS_EMPTY +#ifndef PyMPI_HAVE_MPI_WEIGHTS_EMPTY #undef MPI_WEIGHTS_EMPTY #define MPI_WEIGHTS_EMPTY ((int*)MPI_UNWEIGHTED) #endif -#ifdef PyMPI_MISSING_MPI_Dist_graph_create_adjacent +#ifndef PyMPI_HAVE_MPI_Dist_graph_create_adjacent #undef MPI_Dist_graph_create_adjacent #define MPI_Dist_graph_create_adjacent(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) PyMPI_UNAVAILABLE("MPI_Dist_graph_create_adjacent",a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) #endif -#ifdef PyMPI_MISSING_MPI_Dist_graph_create +#ifndef PyMPI_HAVE_MPI_Dist_graph_create #undef MPI_Dist_graph_create #define MPI_Dist_graph_create(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Dist_graph_create",a1,a2,a3,a4,a5,a6,a7,a8,a9) #endif -#ifdef PyMPI_MISSING_MPI_Dist_graph_neighbors_count +#ifndef PyMPI_HAVE_MPI_Dist_graph_neighbors_count #undef MPI_Dist_graph_neighbors_count #define MPI_Dist_graph_neighbors_count(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Dist_graph_neighbors_count",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Dist_graph_neighbors +#ifndef PyMPI_HAVE_MPI_Dist_graph_neighbors #undef MPI_Dist_graph_neighbors #define MPI_Dist_graph_neighbors(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Dist_graph_neighbors",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Intercomm_create +#ifndef PyMPI_HAVE_MPI_Intercomm_create #undef MPI_Intercomm_create #define MPI_Intercomm_create(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Intercomm_create",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_Comm_remote_group +#ifndef PyMPI_HAVE_MPI_Comm_remote_group #undef MPI_Comm_remote_group #define MPI_Comm_remote_group(a1,a2) PyMPI_UNAVAILABLE("MPI_Comm_remote_group",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Comm_remote_size +#ifndef PyMPI_HAVE_MPI_Comm_remote_size #undef MPI_Comm_remote_size #define MPI_Comm_remote_size(a1,a2) PyMPI_UNAVAILABLE("MPI_Comm_remote_size",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Intercomm_merge +#ifndef PyMPI_HAVE_MPI_Intercomm_merge #undef MPI_Intercomm_merge #define MPI_Intercomm_merge(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Intercomm_merge",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_MAX_PORT_NAME +#ifndef PyMPI_HAVE_MPI_MAX_PORT_NAME #undef MPI_MAX_PORT_NAME #define MPI_MAX_PORT_NAME (1) #endif -#ifdef PyMPI_MISSING_MPI_Open_port +#ifndef PyMPI_HAVE_MPI_Open_port #undef MPI_Open_port #define MPI_Open_port(a1,a2) PyMPI_UNAVAILABLE("MPI_Open_port",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Close_port +#ifndef PyMPI_HAVE_MPI_Close_port #undef MPI_Close_port #define MPI_Close_port(a1) PyMPI_UNAVAILABLE("MPI_Close_port",a1) #endif -#ifdef PyMPI_MISSING_MPI_Publish_name +#ifndef PyMPI_HAVE_MPI_Publish_name #undef MPI_Publish_name #define MPI_Publish_name(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Publish_name",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Unpublish_name +#ifndef PyMPI_HAVE_MPI_Unpublish_name #undef MPI_Unpublish_name #define MPI_Unpublish_name(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Unpublish_name",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Lookup_name +#ifndef PyMPI_HAVE_MPI_Lookup_name #undef MPI_Lookup_name #define MPI_Lookup_name(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Lookup_name",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Comm_accept +#ifndef PyMPI_HAVE_MPI_Comm_accept #undef MPI_Comm_accept #define MPI_Comm_accept(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Comm_accept",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Comm_connect +#ifndef PyMPI_HAVE_MPI_Comm_connect #undef MPI_Comm_connect #define MPI_Comm_connect(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Comm_connect",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Comm_join +#ifndef PyMPI_HAVE_MPI_Comm_join #undef MPI_Comm_join #define MPI_Comm_join(a1,a2) PyMPI_UNAVAILABLE("MPI_Comm_join",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Comm_disconnect +#ifndef PyMPI_HAVE_MPI_Comm_disconnect #undef MPI_Comm_disconnect #define MPI_Comm_disconnect(a1) PyMPI_UNAVAILABLE("MPI_Comm_disconnect",a1) #endif -#ifdef PyMPI_MISSING_MPI_ARGV_NULL +#ifndef PyMPI_HAVE_MPI_ARGV_NULL #undef MPI_ARGV_NULL #define MPI_ARGV_NULL ((char**)0) #endif -#ifdef PyMPI_MISSING_MPI_ARGVS_NULL +#ifndef PyMPI_HAVE_MPI_ARGVS_NULL #undef MPI_ARGVS_NULL #define MPI_ARGVS_NULL ((char***)0) #endif -#ifdef PyMPI_MISSING_MPI_ERRCODES_IGNORE +#ifndef PyMPI_HAVE_MPI_ERRCODES_IGNORE #undef MPI_ERRCODES_IGNORE #define MPI_ERRCODES_IGNORE ((int*)0) #endif -#ifdef PyMPI_MISSING_MPI_Comm_spawn +#ifndef PyMPI_HAVE_MPI_Comm_spawn #undef MPI_Comm_spawn #define MPI_Comm_spawn(a1,a2,a3,a4,a5,a6,a7,a8) PyMPI_UNAVAILABLE("MPI_Comm_spawn",a1,a2,a3,a4,a5,a6,a7,a8) #endif -#ifdef PyMPI_MISSING_MPI_Comm_spawn_multiple +#ifndef PyMPI_HAVE_MPI_Comm_spawn_multiple #undef MPI_Comm_spawn_multiple #define MPI_Comm_spawn_multiple(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Comm_spawn_multiple",a1,a2,a3,a4,a5,a6,a7,a8,a9) #endif -#ifdef PyMPI_MISSING_MPI_Comm_get_parent +#ifndef PyMPI_HAVE_MPI_Comm_get_parent #undef MPI_Comm_get_parent #define MPI_Comm_get_parent(a1) PyMPI_UNAVAILABLE("MPI_Comm_get_parent",a1) #endif -#ifdef PyMPI_MISSING_MPI_Errhandler_get +#ifndef PyMPI_HAVE_MPI_Errhandler_get #undef MPI_Errhandler_get #define MPI_Errhandler_get(a1,a2) PyMPI_UNAVAILABLE("MPI_Errhandler_get",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Errhandler_set +#ifndef PyMPI_HAVE_MPI_Errhandler_set #undef MPI_Errhandler_set #define MPI_Errhandler_set(a1,a2) PyMPI_UNAVAILABLE("MPI_Errhandler_set",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Handler_function +#ifndef PyMPI_HAVE_MPI_Handler_function #undef MPI_Handler_function typedef void (PyMPI_MPI_Handler_function)(MPI_Comm*,int*,...); #define MPI_Handler_function PyMPI_MPI_Handler_function #endif -#ifdef PyMPI_MISSING_MPI_Errhandler_create +#ifndef PyMPI_HAVE_MPI_Errhandler_create #undef MPI_Errhandler_create #define MPI_Errhandler_create(a1,a2) PyMPI_UNAVAILABLE("MPI_Errhandler_create",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_TAG_UB +#ifndef PyMPI_HAVE_MPI_TAG_UB #undef MPI_TAG_UB #define MPI_TAG_UB (MPI_KEYVAL_INVALID) #endif -#ifdef PyMPI_MISSING_MPI_HOST +#ifndef PyMPI_HAVE_MPI_HOST #undef MPI_HOST #define MPI_HOST (MPI_KEYVAL_INVALID) #endif -#ifdef PyMPI_MISSING_MPI_IO +#ifndef PyMPI_HAVE_MPI_IO #undef MPI_IO #define MPI_IO (MPI_KEYVAL_INVALID) #endif -#ifdef PyMPI_MISSING_MPI_WTIME_IS_GLOBAL +#ifndef PyMPI_HAVE_MPI_WTIME_IS_GLOBAL #undef MPI_WTIME_IS_GLOBAL #define MPI_WTIME_IS_GLOBAL (MPI_KEYVAL_INVALID) #endif -#ifdef PyMPI_MISSING_MPI_Attr_get +#ifndef PyMPI_HAVE_MPI_Attr_get #undef MPI_Attr_get #define MPI_Attr_get(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Attr_get",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Attr_put +#ifndef PyMPI_HAVE_MPI_Attr_put #undef MPI_Attr_put #define MPI_Attr_put(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Attr_put",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Attr_delete +#ifndef PyMPI_HAVE_MPI_Attr_delete #undef MPI_Attr_delete #define MPI_Attr_delete(a1,a2) PyMPI_UNAVAILABLE("MPI_Attr_delete",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Copy_function +#ifndef PyMPI_HAVE_MPI_Copy_function #undef MPI_Copy_function typedef int (PyMPI_MPI_Copy_function)(MPI_Comm,int,void*,void*,void*,int*); #define MPI_Copy_function PyMPI_MPI_Copy_function #endif -#ifdef PyMPI_MISSING_MPI_Delete_function +#ifndef PyMPI_HAVE_MPI_Delete_function #undef MPI_Delete_function typedef int (PyMPI_MPI_Delete_function)(MPI_Comm,int,void*,void*); #define MPI_Delete_function PyMPI_MPI_Delete_function #endif -#ifdef PyMPI_MISSING_MPI_DUP_FN +#ifndef PyMPI_HAVE_MPI_DUP_FN #undef MPI_DUP_FN #define MPI_DUP_FN (0) #endif -#ifdef PyMPI_MISSING_MPI_NULL_COPY_FN +#ifndef PyMPI_HAVE_MPI_NULL_COPY_FN #undef MPI_NULL_COPY_FN #define MPI_NULL_COPY_FN (0) #endif -#ifdef PyMPI_MISSING_MPI_NULL_DELETE_FN +#ifndef PyMPI_HAVE_MPI_NULL_DELETE_FN #undef MPI_NULL_DELETE_FN #define MPI_NULL_DELETE_FN (0) #endif -#ifdef PyMPI_MISSING_MPI_Keyval_create +#ifndef PyMPI_HAVE_MPI_Keyval_create #undef MPI_Keyval_create #define MPI_Keyval_create(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Keyval_create",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Keyval_free +#ifndef PyMPI_HAVE_MPI_Keyval_free #undef MPI_Keyval_free #define MPI_Keyval_free(a1) PyMPI_UNAVAILABLE("MPI_Keyval_free",a1) #endif -#ifdef PyMPI_MISSING_MPI_Comm_get_errhandler +#ifndef PyMPI_HAVE_MPI_Comm_get_errhandler #undef MPI_Comm_get_errhandler #define MPI_Comm_get_errhandler MPI_Errhandler_get #endif -#ifdef PyMPI_MISSING_MPI_Comm_set_errhandler +#ifndef PyMPI_HAVE_MPI_Comm_set_errhandler #undef MPI_Comm_set_errhandler #define MPI_Comm_set_errhandler MPI_Errhandler_set #endif -#ifdef PyMPI_MISSING_MPI_Comm_errhandler_fn +#ifndef PyMPI_HAVE_MPI_Comm_errhandler_fn #undef MPI_Comm_errhandler_fn #define MPI_Comm_errhandler_fn MPI_Handler_function #endif -#ifdef PyMPI_MISSING_MPI_Comm_errhandler_function +#ifndef PyMPI_HAVE_MPI_Comm_errhandler_function #undef MPI_Comm_errhandler_function #define MPI_Comm_errhandler_function MPI_Comm_errhandler_fn #endif -#ifdef PyMPI_MISSING_MPI_Comm_create_errhandler +#ifndef PyMPI_HAVE_MPI_Comm_create_errhandler #undef MPI_Comm_create_errhandler #define MPI_Comm_create_errhandler MPI_Errhandler_create #endif -#ifdef PyMPI_MISSING_MPI_Comm_call_errhandler +#ifndef PyMPI_HAVE_MPI_Comm_call_errhandler #undef MPI_Comm_call_errhandler #define MPI_Comm_call_errhandler(a1,a2) PyMPI_UNAVAILABLE("MPI_Comm_call_errhandler",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Comm_get_name +#ifndef PyMPI_HAVE_MPI_Comm_get_name #undef MPI_Comm_get_name #define MPI_Comm_get_name(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Comm_get_name",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Comm_set_name +#ifndef PyMPI_HAVE_MPI_Comm_set_name #undef MPI_Comm_set_name #define MPI_Comm_set_name(a1,a2) PyMPI_UNAVAILABLE("MPI_Comm_set_name",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_UNIVERSE_SIZE +#ifndef PyMPI_HAVE_MPI_UNIVERSE_SIZE #undef MPI_UNIVERSE_SIZE #define MPI_UNIVERSE_SIZE (MPI_KEYVAL_INVALID) #endif -#ifdef PyMPI_MISSING_MPI_APPNUM +#ifndef PyMPI_HAVE_MPI_APPNUM #undef MPI_APPNUM #define MPI_APPNUM (MPI_KEYVAL_INVALID) #endif -#ifdef PyMPI_MISSING_MPI_LASTUSEDCODE +#ifndef PyMPI_HAVE_MPI_LASTUSEDCODE #undef MPI_LASTUSEDCODE #define MPI_LASTUSEDCODE (MPI_KEYVAL_INVALID) #endif -#ifdef PyMPI_MISSING_MPI_Comm_get_attr +#ifndef PyMPI_HAVE_MPI_Comm_get_attr #undef MPI_Comm_get_attr #define MPI_Comm_get_attr MPI_Attr_get #endif -#ifdef PyMPI_MISSING_MPI_Comm_set_attr +#ifndef PyMPI_HAVE_MPI_Comm_set_attr #undef MPI_Comm_set_attr #define MPI_Comm_set_attr MPI_Attr_put #endif -#ifdef PyMPI_MISSING_MPI_Comm_delete_attr +#ifndef PyMPI_HAVE_MPI_Comm_delete_attr #undef MPI_Comm_delete_attr #define MPI_Comm_delete_attr MPI_Attr_delete #endif -#ifdef PyMPI_MISSING_MPI_Comm_copy_attr_function +#ifndef PyMPI_HAVE_MPI_Comm_copy_attr_function #undef MPI_Comm_copy_attr_function #define MPI_Comm_copy_attr_function MPI_Copy_function #endif -#ifdef PyMPI_MISSING_MPI_Comm_delete_attr_function +#ifndef PyMPI_HAVE_MPI_Comm_delete_attr_function #undef MPI_Comm_delete_attr_function #define MPI_Comm_delete_attr_function MPI_Delete_function #endif -#ifdef PyMPI_MISSING_MPI_COMM_DUP_FN +#ifndef PyMPI_HAVE_MPI_COMM_DUP_FN #undef MPI_COMM_DUP_FN #define MPI_COMM_DUP_FN (MPI_DUP_FN) #endif -#ifdef PyMPI_MISSING_MPI_COMM_NULL_COPY_FN +#ifndef PyMPI_HAVE_MPI_COMM_NULL_COPY_FN #undef MPI_COMM_NULL_COPY_FN #define MPI_COMM_NULL_COPY_FN (MPI_NULL_COPY_FN) #endif -#ifdef PyMPI_MISSING_MPI_COMM_NULL_DELETE_FN +#ifndef PyMPI_HAVE_MPI_COMM_NULL_DELETE_FN #undef MPI_COMM_NULL_DELETE_FN #define MPI_COMM_NULL_DELETE_FN (MPI_NULL_DELETE_FN) #endif -#ifdef PyMPI_MISSING_MPI_Comm_create_keyval +#ifndef PyMPI_HAVE_MPI_Comm_create_keyval #undef MPI_Comm_create_keyval #define MPI_Comm_create_keyval MPI_Keyval_create #endif -#ifdef PyMPI_MISSING_MPI_Comm_free_keyval +#ifndef PyMPI_HAVE_MPI_Comm_free_keyval #undef MPI_Comm_free_keyval #define MPI_Comm_free_keyval MPI_Keyval_free #endif -#ifdef PyMPI_MISSING_MPI_WIN_NULL +#ifndef PyMPI_HAVE_MPI_WIN_NULL #undef MPI_WIN_NULL #define MPI_WIN_NULL ((MPI_Win)0) #endif -#ifdef PyMPI_MISSING_MPI_Win_free +#ifndef PyMPI_HAVE_MPI_Win_free #undef MPI_Win_free #define MPI_Win_free(a1) PyMPI_UNAVAILABLE("MPI_Win_free",a1) #endif -#ifdef PyMPI_MISSING_MPI_Win_create +#ifndef PyMPI_HAVE_MPI_Win_create #undef MPI_Win_create #define MPI_Win_create(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Win_create",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_Win_allocate +#ifndef PyMPI_HAVE_MPI_Win_allocate #undef MPI_Win_allocate #define MPI_Win_allocate(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Win_allocate",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_Win_allocate_shared +#ifndef PyMPI_HAVE_MPI_Win_allocate_shared #undef MPI_Win_allocate_shared #define MPI_Win_allocate_shared(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_Win_allocate_shared",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_Win_shared_query +#ifndef PyMPI_HAVE_MPI_Win_shared_query #undef MPI_Win_shared_query #define MPI_Win_shared_query(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Win_shared_query",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_Win_create_dynamic +#ifndef PyMPI_HAVE_MPI_Win_create_dynamic #undef MPI_Win_create_dynamic #define MPI_Win_create_dynamic(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Win_create_dynamic",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Win_attach +#ifndef PyMPI_HAVE_MPI_Win_attach #undef MPI_Win_attach #define MPI_Win_attach(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Win_attach",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Win_detach +#ifndef PyMPI_HAVE_MPI_Win_detach #undef MPI_Win_detach #define MPI_Win_detach(a1,a2) PyMPI_UNAVAILABLE("MPI_Win_detach",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Win_set_info +#ifndef PyMPI_HAVE_MPI_Win_set_info #undef MPI_Win_set_info #define MPI_Win_set_info(a1,a2) PyMPI_UNAVAILABLE("MPI_Win_set_info",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Win_get_info +#ifndef PyMPI_HAVE_MPI_Win_get_info #undef MPI_Win_get_info #define MPI_Win_get_info(a1,a2) PyMPI_UNAVAILABLE("MPI_Win_get_info",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Win_get_group +#ifndef PyMPI_HAVE_MPI_Win_get_group #undef MPI_Win_get_group #define MPI_Win_get_group(a1,a2) PyMPI_UNAVAILABLE("MPI_Win_get_group",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Get +#ifndef PyMPI_HAVE_MPI_Get #undef MPI_Get #define MPI_Get(a1,a2,a3,a4,a5,a6,a7,a8) PyMPI_UNAVAILABLE("MPI_Get",a1,a2,a3,a4,a5,a6,a7,a8) #endif -#ifdef PyMPI_MISSING_MPI_Put +#ifndef PyMPI_HAVE_MPI_Put #undef MPI_Put #define MPI_Put(a1,a2,a3,a4,a5,a6,a7,a8) PyMPI_UNAVAILABLE("MPI_Put",a1,a2,a3,a4,a5,a6,a7,a8) #endif -#ifdef PyMPI_MISSING_MPI_Accumulate +#ifndef PyMPI_HAVE_MPI_Accumulate #undef MPI_Accumulate #define MPI_Accumulate(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Accumulate",a1,a2,a3,a4,a5,a6,a7,a8,a9) #endif -#ifdef PyMPI_MISSING_MPI_Get_accumulate +#ifndef PyMPI_HAVE_MPI_Get_accumulate #undef MPI_Get_accumulate #define MPI_Get_accumulate(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) PyMPI_UNAVAILABLE("MPI_Get_accumulate",a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) #endif -#ifdef PyMPI_MISSING_MPI_Fetch_and_op +#ifndef PyMPI_HAVE_MPI_Fetch_and_op #undef MPI_Fetch_and_op #define MPI_Fetch_and_op(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Fetch_and_op",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Compare_and_swap +#ifndef PyMPI_HAVE_MPI_Compare_and_swap #undef MPI_Compare_and_swap #define MPI_Compare_and_swap(a1,a2,a3,a4,a5,a6,a7) PyMPI_UNAVAILABLE("MPI_Compare_and_swap",a1,a2,a3,a4,a5,a6,a7) #endif -#ifdef PyMPI_MISSING_MPI_Rget +#ifndef PyMPI_HAVE_MPI_Rget #undef MPI_Rget #define MPI_Rget(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Rget",a1,a2,a3,a4,a5,a6,a7,a8,a9) #endif -#ifdef PyMPI_MISSING_MPI_Rput +#ifndef PyMPI_HAVE_MPI_Rput #undef MPI_Rput #define MPI_Rput(a1,a2,a3,a4,a5,a6,a7,a8,a9) PyMPI_UNAVAILABLE("MPI_Rput",a1,a2,a3,a4,a5,a6,a7,a8,a9) #endif -#ifdef PyMPI_MISSING_MPI_Raccumulate +#ifndef PyMPI_HAVE_MPI_Raccumulate #undef MPI_Raccumulate #define MPI_Raccumulate(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) PyMPI_UNAVAILABLE("MPI_Raccumulate",a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) #endif -#ifdef PyMPI_MISSING_MPI_Rget_accumulate +#ifndef PyMPI_HAVE_MPI_Rget_accumulate #undef MPI_Rget_accumulate #define MPI_Rget_accumulate(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) PyMPI_UNAVAILABLE("MPI_Rget_accumulate",a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) #endif -#ifdef PyMPI_MISSING_MPI_MODE_NOCHECK +#ifndef PyMPI_HAVE_MPI_MODE_NOCHECK #undef MPI_MODE_NOCHECK #define MPI_MODE_NOCHECK (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_MODE_NOSTORE +#ifndef PyMPI_HAVE_MPI_MODE_NOSTORE #undef MPI_MODE_NOSTORE #define MPI_MODE_NOSTORE (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_MODE_NOPUT +#ifndef PyMPI_HAVE_MPI_MODE_NOPUT #undef MPI_MODE_NOPUT #define MPI_MODE_NOPUT (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_MODE_NOPRECEDE +#ifndef PyMPI_HAVE_MPI_MODE_NOPRECEDE #undef MPI_MODE_NOPRECEDE #define MPI_MODE_NOPRECEDE (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_MODE_NOSUCCEED +#ifndef PyMPI_HAVE_MPI_MODE_NOSUCCEED #undef MPI_MODE_NOSUCCEED #define MPI_MODE_NOSUCCEED (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_Win_fence +#ifndef PyMPI_HAVE_MPI_Win_fence #undef MPI_Win_fence #define MPI_Win_fence(a1,a2) PyMPI_UNAVAILABLE("MPI_Win_fence",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Win_post +#ifndef PyMPI_HAVE_MPI_Win_post #undef MPI_Win_post #define MPI_Win_post(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Win_post",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Win_start +#ifndef PyMPI_HAVE_MPI_Win_start #undef MPI_Win_start #define MPI_Win_start(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Win_start",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Win_complete +#ifndef PyMPI_HAVE_MPI_Win_complete #undef MPI_Win_complete #define MPI_Win_complete(a1) PyMPI_UNAVAILABLE("MPI_Win_complete",a1) #endif -#ifdef PyMPI_MISSING_MPI_Win_wait +#ifndef PyMPI_HAVE_MPI_Win_wait #undef MPI_Win_wait #define MPI_Win_wait(a1) PyMPI_UNAVAILABLE("MPI_Win_wait",a1) #endif -#ifdef PyMPI_MISSING_MPI_Win_test +#ifndef PyMPI_HAVE_MPI_Win_test #undef MPI_Win_test #define MPI_Win_test(a1,a2) PyMPI_UNAVAILABLE("MPI_Win_test",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_LOCK_EXCLUSIVE +#ifndef PyMPI_HAVE_MPI_LOCK_EXCLUSIVE #undef MPI_LOCK_EXCLUSIVE #define MPI_LOCK_EXCLUSIVE (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_LOCK_SHARED +#ifndef PyMPI_HAVE_MPI_LOCK_SHARED #undef MPI_LOCK_SHARED #define MPI_LOCK_SHARED (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_Win_lock +#ifndef PyMPI_HAVE_MPI_Win_lock #undef MPI_Win_lock #define MPI_Win_lock(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Win_lock",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Win_unlock +#ifndef PyMPI_HAVE_MPI_Win_unlock #undef MPI_Win_unlock #define MPI_Win_unlock(a1,a2) PyMPI_UNAVAILABLE("MPI_Win_unlock",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Win_lock_all +#ifndef PyMPI_HAVE_MPI_Win_lock_all #undef MPI_Win_lock_all #define MPI_Win_lock_all(a1,a2) PyMPI_UNAVAILABLE("MPI_Win_lock_all",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Win_unlock_all +#ifndef PyMPI_HAVE_MPI_Win_unlock_all #undef MPI_Win_unlock_all #define MPI_Win_unlock_all(a1) PyMPI_UNAVAILABLE("MPI_Win_unlock_all",a1) #endif -#ifdef PyMPI_MISSING_MPI_Win_flush +#ifndef PyMPI_HAVE_MPI_Win_flush #undef MPI_Win_flush #define MPI_Win_flush(a1,a2) PyMPI_UNAVAILABLE("MPI_Win_flush",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Win_flush_all +#ifndef PyMPI_HAVE_MPI_Win_flush_all #undef MPI_Win_flush_all #define MPI_Win_flush_all(a1) PyMPI_UNAVAILABLE("MPI_Win_flush_all",a1) #endif -#ifdef PyMPI_MISSING_MPI_Win_flush_local +#ifndef PyMPI_HAVE_MPI_Win_flush_local #undef MPI_Win_flush_local #define MPI_Win_flush_local(a1,a2) PyMPI_UNAVAILABLE("MPI_Win_flush_local",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Win_flush_local_all +#ifndef PyMPI_HAVE_MPI_Win_flush_local_all #undef MPI_Win_flush_local_all #define MPI_Win_flush_local_all(a1) PyMPI_UNAVAILABLE("MPI_Win_flush_local_all",a1) #endif -#ifdef PyMPI_MISSING_MPI_Win_sync +#ifndef PyMPI_HAVE_MPI_Win_sync #undef MPI_Win_sync #define MPI_Win_sync(a1) PyMPI_UNAVAILABLE("MPI_Win_sync",a1) #endif -#ifdef PyMPI_MISSING_MPI_Win_get_errhandler +#ifndef PyMPI_HAVE_MPI_Win_get_errhandler #undef MPI_Win_get_errhandler #define MPI_Win_get_errhandler(a1,a2) PyMPI_UNAVAILABLE("MPI_Win_get_errhandler",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Win_set_errhandler +#ifndef PyMPI_HAVE_MPI_Win_set_errhandler #undef MPI_Win_set_errhandler #define MPI_Win_set_errhandler(a1,a2) PyMPI_UNAVAILABLE("MPI_Win_set_errhandler",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Win_errhandler_fn +#ifndef PyMPI_HAVE_MPI_Win_errhandler_fn #undef MPI_Win_errhandler_fn typedef void (PyMPI_MPI_Win_errhandler_fn)(MPI_Win*,int*,...); #define MPI_Win_errhandler_fn PyMPI_MPI_Win_errhandler_fn #endif -#ifdef PyMPI_MISSING_MPI_Win_errhandler_function +#ifndef PyMPI_HAVE_MPI_Win_errhandler_function #undef MPI_Win_errhandler_function #define MPI_Win_errhandler_function MPI_Win_errhandler_fn #endif -#ifdef PyMPI_MISSING_MPI_Win_create_errhandler +#ifndef PyMPI_HAVE_MPI_Win_create_errhandler #undef MPI_Win_create_errhandler #define MPI_Win_create_errhandler(a1,a2) PyMPI_UNAVAILABLE("MPI_Win_create_errhandler",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Win_call_errhandler +#ifndef PyMPI_HAVE_MPI_Win_call_errhandler #undef MPI_Win_call_errhandler #define MPI_Win_call_errhandler(a1,a2) PyMPI_UNAVAILABLE("MPI_Win_call_errhandler",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Win_get_name +#ifndef PyMPI_HAVE_MPI_Win_get_name #undef MPI_Win_get_name #define MPI_Win_get_name(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Win_get_name",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Win_set_name +#ifndef PyMPI_HAVE_MPI_Win_set_name #undef MPI_Win_set_name #define MPI_Win_set_name(a1,a2) PyMPI_UNAVAILABLE("MPI_Win_set_name",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_WIN_BASE +#ifndef PyMPI_HAVE_MPI_WIN_BASE #undef MPI_WIN_BASE #define MPI_WIN_BASE (MPI_KEYVAL_INVALID) #endif -#ifdef PyMPI_MISSING_MPI_WIN_SIZE +#ifndef PyMPI_HAVE_MPI_WIN_SIZE #undef MPI_WIN_SIZE #define MPI_WIN_SIZE (MPI_KEYVAL_INVALID) #endif -#ifdef PyMPI_MISSING_MPI_WIN_DISP_UNIT +#ifndef PyMPI_HAVE_MPI_WIN_DISP_UNIT #undef MPI_WIN_DISP_UNIT #define MPI_WIN_DISP_UNIT (MPI_KEYVAL_INVALID) #endif -#ifdef PyMPI_MISSING_MPI_WIN_CREATE_FLAVOR +#ifndef PyMPI_HAVE_MPI_WIN_CREATE_FLAVOR #undef MPI_WIN_CREATE_FLAVOR #define MPI_WIN_CREATE_FLAVOR (MPI_KEYVAL_INVALID) #endif -#ifdef PyMPI_MISSING_MPI_WIN_MODEL +#ifndef PyMPI_HAVE_MPI_WIN_MODEL #undef MPI_WIN_MODEL #define MPI_WIN_MODEL (MPI_KEYVAL_INVALID) #endif -#ifdef PyMPI_MISSING_MPI_WIN_FLAVOR_CREATE +#ifndef PyMPI_HAVE_MPI_WIN_FLAVOR_CREATE #undef MPI_WIN_FLAVOR_CREATE #define MPI_WIN_FLAVOR_CREATE (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_WIN_FLAVOR_ALLOCATE +#ifndef PyMPI_HAVE_MPI_WIN_FLAVOR_ALLOCATE #undef MPI_WIN_FLAVOR_ALLOCATE #define MPI_WIN_FLAVOR_ALLOCATE (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_WIN_FLAVOR_DYNAMIC +#ifndef PyMPI_HAVE_MPI_WIN_FLAVOR_DYNAMIC #undef MPI_WIN_FLAVOR_DYNAMIC #define MPI_WIN_FLAVOR_DYNAMIC (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_WIN_FLAVOR_SHARED +#ifndef PyMPI_HAVE_MPI_WIN_FLAVOR_SHARED #undef MPI_WIN_FLAVOR_SHARED #define MPI_WIN_FLAVOR_SHARED (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_WIN_SEPARATE +#ifndef PyMPI_HAVE_MPI_WIN_SEPARATE #undef MPI_WIN_SEPARATE #define MPI_WIN_SEPARATE (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_WIN_UNIFIED +#ifndef PyMPI_HAVE_MPI_WIN_UNIFIED #undef MPI_WIN_UNIFIED #define MPI_WIN_UNIFIED (MPI_UNDEFINED) #endif -#ifdef PyMPI_MISSING_MPI_Win_get_attr +#ifndef PyMPI_HAVE_MPI_Win_get_attr #undef MPI_Win_get_attr #define MPI_Win_get_attr(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Win_get_attr",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Win_set_attr +#ifndef PyMPI_HAVE_MPI_Win_set_attr #undef MPI_Win_set_attr #define MPI_Win_set_attr(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Win_set_attr",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Win_delete_attr +#ifndef PyMPI_HAVE_MPI_Win_delete_attr #undef MPI_Win_delete_attr #define MPI_Win_delete_attr(a1,a2) PyMPI_UNAVAILABLE("MPI_Win_delete_attr",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Win_copy_attr_function +#ifndef PyMPI_HAVE_MPI_Win_copy_attr_function #undef MPI_Win_copy_attr_function typedef int (PyMPI_MPI_Win_copy_attr_function)(MPI_Win,int,void*,void*,void*,int*); #define MPI_Win_copy_attr_function PyMPI_MPI_Win_copy_attr_function #endif -#ifdef PyMPI_MISSING_MPI_Win_delete_attr_function +#ifndef PyMPI_HAVE_MPI_Win_delete_attr_function #undef MPI_Win_delete_attr_function typedef int (PyMPI_MPI_Win_delete_attr_function)(MPI_Win,int,void*,void*); #define MPI_Win_delete_attr_function PyMPI_MPI_Win_delete_attr_function #endif -#ifdef PyMPI_MISSING_MPI_WIN_DUP_FN +#ifndef PyMPI_HAVE_MPI_WIN_DUP_FN #undef MPI_WIN_DUP_FN #define MPI_WIN_DUP_FN (0) #endif -#ifdef PyMPI_MISSING_MPI_WIN_NULL_COPY_FN +#ifndef PyMPI_HAVE_MPI_WIN_NULL_COPY_FN #undef MPI_WIN_NULL_COPY_FN #define MPI_WIN_NULL_COPY_FN (0) #endif -#ifdef PyMPI_MISSING_MPI_WIN_NULL_DELETE_FN +#ifndef PyMPI_HAVE_MPI_WIN_NULL_DELETE_FN #undef MPI_WIN_NULL_DELETE_FN #define MPI_WIN_NULL_DELETE_FN (0) #endif -#ifdef PyMPI_MISSING_MPI_Win_create_keyval +#ifndef PyMPI_HAVE_MPI_Win_create_keyval #undef MPI_Win_create_keyval #define MPI_Win_create_keyval(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Win_create_keyval",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Win_free_keyval +#ifndef PyMPI_HAVE_MPI_Win_free_keyval #undef MPI_Win_free_keyval #define MPI_Win_free_keyval(a1) PyMPI_UNAVAILABLE("MPI_Win_free_keyval",a1) #endif -#ifdef PyMPI_MISSING_MPI_FILE_NULL +#ifndef PyMPI_HAVE_MPI_FILE_NULL #undef MPI_FILE_NULL #define MPI_FILE_NULL ((MPI_File)0) #endif -#ifdef PyMPI_MISSING_MPI_MODE_RDONLY +#ifndef PyMPI_HAVE_MPI_MODE_RDONLY #undef MPI_MODE_RDONLY #define MPI_MODE_RDONLY (1) #endif -#ifdef PyMPI_MISSING_MPI_MODE_RDWR +#ifndef PyMPI_HAVE_MPI_MODE_RDWR #undef MPI_MODE_RDWR #define MPI_MODE_RDWR (2) #endif -#ifdef PyMPI_MISSING_MPI_MODE_WRONLY +#ifndef PyMPI_HAVE_MPI_MODE_WRONLY #undef MPI_MODE_WRONLY #define MPI_MODE_WRONLY (4) #endif -#ifdef PyMPI_MISSING_MPI_MODE_CREATE +#ifndef PyMPI_HAVE_MPI_MODE_CREATE #undef MPI_MODE_CREATE #define MPI_MODE_CREATE (8) #endif -#ifdef PyMPI_MISSING_MPI_MODE_EXCL +#ifndef PyMPI_HAVE_MPI_MODE_EXCL #undef MPI_MODE_EXCL #define MPI_MODE_EXCL (16) #endif -#ifdef PyMPI_MISSING_MPI_MODE_DELETE_ON_CLOSE +#ifndef PyMPI_HAVE_MPI_MODE_DELETE_ON_CLOSE #undef MPI_MODE_DELETE_ON_CLOSE #define MPI_MODE_DELETE_ON_CLOSE (32) #endif -#ifdef PyMPI_MISSING_MPI_MODE_UNIQUE_OPEN +#ifndef PyMPI_HAVE_MPI_MODE_UNIQUE_OPEN #undef MPI_MODE_UNIQUE_OPEN #define MPI_MODE_UNIQUE_OPEN (64) #endif -#ifdef PyMPI_MISSING_MPI_MODE_APPEND +#ifndef PyMPI_HAVE_MPI_MODE_APPEND #undef MPI_MODE_APPEND #define MPI_MODE_APPEND (128) #endif -#ifdef PyMPI_MISSING_MPI_MODE_SEQUENTIAL +#ifndef PyMPI_HAVE_MPI_MODE_SEQUENTIAL #undef MPI_MODE_SEQUENTIAL #define MPI_MODE_SEQUENTIAL (256) #endif -#ifdef PyMPI_MISSING_MPI_File_open +#ifndef PyMPI_HAVE_MPI_File_open #undef MPI_File_open #define MPI_File_open(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_File_open",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_File_close +#ifndef PyMPI_HAVE_MPI_File_close #undef MPI_File_close #define MPI_File_close(a1) PyMPI_UNAVAILABLE("MPI_File_close",a1) #endif -#ifdef PyMPI_MISSING_MPI_File_delete +#ifndef PyMPI_HAVE_MPI_File_delete #undef MPI_File_delete #define MPI_File_delete(a1,a2) PyMPI_UNAVAILABLE("MPI_File_delete",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_File_set_size +#ifndef PyMPI_HAVE_MPI_File_set_size #undef MPI_File_set_size #define MPI_File_set_size(a1,a2) PyMPI_UNAVAILABLE("MPI_File_set_size",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_File_preallocate +#ifndef PyMPI_HAVE_MPI_File_preallocate #undef MPI_File_preallocate #define MPI_File_preallocate(a1,a2) PyMPI_UNAVAILABLE("MPI_File_preallocate",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_File_get_size +#ifndef PyMPI_HAVE_MPI_File_get_size #undef MPI_File_get_size #define MPI_File_get_size(a1,a2) PyMPI_UNAVAILABLE("MPI_File_get_size",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_File_get_group +#ifndef PyMPI_HAVE_MPI_File_get_group #undef MPI_File_get_group #define MPI_File_get_group(a1,a2) PyMPI_UNAVAILABLE("MPI_File_get_group",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_File_get_amode +#ifndef PyMPI_HAVE_MPI_File_get_amode #undef MPI_File_get_amode #define MPI_File_get_amode(a1,a2) PyMPI_UNAVAILABLE("MPI_File_get_amode",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_File_set_info +#ifndef PyMPI_HAVE_MPI_File_set_info #undef MPI_File_set_info #define MPI_File_set_info(a1,a2) PyMPI_UNAVAILABLE("MPI_File_set_info",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_File_get_info +#ifndef PyMPI_HAVE_MPI_File_get_info #undef MPI_File_get_info #define MPI_File_get_info(a1,a2) PyMPI_UNAVAILABLE("MPI_File_get_info",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_File_get_view +#ifndef PyMPI_HAVE_MPI_File_get_view #undef MPI_File_get_view #define MPI_File_get_view(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_File_get_view",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_File_set_view +#ifndef PyMPI_HAVE_MPI_File_set_view #undef MPI_File_set_view #define MPI_File_set_view(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_File_set_view",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_File_read_at +#ifndef PyMPI_HAVE_MPI_File_read_at #undef MPI_File_read_at #define MPI_File_read_at(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_File_read_at",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_File_read_at_all +#ifndef PyMPI_HAVE_MPI_File_read_at_all #undef MPI_File_read_at_all #define MPI_File_read_at_all(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_File_read_at_all",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_File_write_at +#ifndef PyMPI_HAVE_MPI_File_write_at #undef MPI_File_write_at #define MPI_File_write_at(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_File_write_at",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_File_write_at_all +#ifndef PyMPI_HAVE_MPI_File_write_at_all #undef MPI_File_write_at_all #define MPI_File_write_at_all(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_File_write_at_all",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_File_iread_at +#ifndef PyMPI_HAVE_MPI_File_iread_at #undef MPI_File_iread_at #define MPI_File_iread_at(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_File_iread_at",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_File_iwrite_at +#ifndef PyMPI_HAVE_MPI_File_iwrite_at #undef MPI_File_iwrite_at #define MPI_File_iwrite_at(a1,a2,a3,a4,a5,a6) PyMPI_UNAVAILABLE("MPI_File_iwrite_at",a1,a2,a3,a4,a5,a6) #endif -#ifdef PyMPI_MISSING_MPI_SEEK_SET +#ifndef PyMPI_HAVE_MPI_SEEK_SET #undef MPI_SEEK_SET #define MPI_SEEK_SET (0) #endif -#ifdef PyMPI_MISSING_MPI_SEEK_CUR +#ifndef PyMPI_HAVE_MPI_SEEK_CUR #undef MPI_SEEK_CUR #define MPI_SEEK_CUR (1) #endif -#ifdef PyMPI_MISSING_MPI_SEEK_END +#ifndef PyMPI_HAVE_MPI_SEEK_END #undef MPI_SEEK_END #define MPI_SEEK_END (2) #endif -#ifdef PyMPI_MISSING_MPI_DISPLACEMENT_CURRENT +#ifndef PyMPI_HAVE_MPI_DISPLACEMENT_CURRENT #undef MPI_DISPLACEMENT_CURRENT #define MPI_DISPLACEMENT_CURRENT (3) #endif -#ifdef PyMPI_MISSING_MPI_File_seek +#ifndef PyMPI_HAVE_MPI_File_seek #undef MPI_File_seek #define MPI_File_seek(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_File_seek",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_File_get_position +#ifndef PyMPI_HAVE_MPI_File_get_position #undef MPI_File_get_position #define MPI_File_get_position(a1,a2) PyMPI_UNAVAILABLE("MPI_File_get_position",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_File_get_byte_offset +#ifndef PyMPI_HAVE_MPI_File_get_byte_offset #undef MPI_File_get_byte_offset #define MPI_File_get_byte_offset(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_File_get_byte_offset",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_File_read +#ifndef PyMPI_HAVE_MPI_File_read #undef MPI_File_read #define MPI_File_read(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_File_read",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_File_read_all +#ifndef PyMPI_HAVE_MPI_File_read_all #undef MPI_File_read_all #define MPI_File_read_all(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_File_read_all",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_File_write +#ifndef PyMPI_HAVE_MPI_File_write #undef MPI_File_write #define MPI_File_write(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_File_write",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_File_write_all +#ifndef PyMPI_HAVE_MPI_File_write_all #undef MPI_File_write_all #define MPI_File_write_all(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_File_write_all",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_File_iread +#ifndef PyMPI_HAVE_MPI_File_iread #undef MPI_File_iread #define MPI_File_iread(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_File_iread",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_File_iwrite +#ifndef PyMPI_HAVE_MPI_File_iwrite #undef MPI_File_iwrite #define MPI_File_iwrite(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_File_iwrite",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_File_read_shared +#ifndef PyMPI_HAVE_MPI_File_read_shared #undef MPI_File_read_shared #define MPI_File_read_shared(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_File_read_shared",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_File_write_shared +#ifndef PyMPI_HAVE_MPI_File_write_shared #undef MPI_File_write_shared #define MPI_File_write_shared(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_File_write_shared",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_File_iread_shared +#ifndef PyMPI_HAVE_MPI_File_iread_shared #undef MPI_File_iread_shared #define MPI_File_iread_shared(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_File_iread_shared",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_File_iwrite_shared +#ifndef PyMPI_HAVE_MPI_File_iwrite_shared #undef MPI_File_iwrite_shared #define MPI_File_iwrite_shared(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_File_iwrite_shared",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_File_read_ordered +#ifndef PyMPI_HAVE_MPI_File_read_ordered #undef MPI_File_read_ordered #define MPI_File_read_ordered(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_File_read_ordered",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_File_write_ordered +#ifndef PyMPI_HAVE_MPI_File_write_ordered #undef MPI_File_write_ordered #define MPI_File_write_ordered(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_File_write_ordered",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_File_seek_shared +#ifndef PyMPI_HAVE_MPI_File_seek_shared #undef MPI_File_seek_shared #define MPI_File_seek_shared(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_File_seek_shared",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_File_get_position_shared +#ifndef PyMPI_HAVE_MPI_File_get_position_shared #undef MPI_File_get_position_shared #define MPI_File_get_position_shared(a1,a2) PyMPI_UNAVAILABLE("MPI_File_get_position_shared",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_File_read_at_all_begin +#ifndef PyMPI_HAVE_MPI_File_read_at_all_begin #undef MPI_File_read_at_all_begin #define MPI_File_read_at_all_begin(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_File_read_at_all_begin",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_File_read_at_all_end +#ifndef PyMPI_HAVE_MPI_File_read_at_all_end #undef MPI_File_read_at_all_end #define MPI_File_read_at_all_end(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_File_read_at_all_end",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_File_write_at_all_begin +#ifndef PyMPI_HAVE_MPI_File_write_at_all_begin #undef MPI_File_write_at_all_begin #define MPI_File_write_at_all_begin(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_File_write_at_all_begin",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_File_write_at_all_end +#ifndef PyMPI_HAVE_MPI_File_write_at_all_end #undef MPI_File_write_at_all_end #define MPI_File_write_at_all_end(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_File_write_at_all_end",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_File_read_all_begin +#ifndef PyMPI_HAVE_MPI_File_read_all_begin #undef MPI_File_read_all_begin #define MPI_File_read_all_begin(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_File_read_all_begin",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_File_read_all_end +#ifndef PyMPI_HAVE_MPI_File_read_all_end #undef MPI_File_read_all_end #define MPI_File_read_all_end(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_File_read_all_end",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_File_write_all_begin +#ifndef PyMPI_HAVE_MPI_File_write_all_begin #undef MPI_File_write_all_begin #define MPI_File_write_all_begin(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_File_write_all_begin",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_File_write_all_end +#ifndef PyMPI_HAVE_MPI_File_write_all_end #undef MPI_File_write_all_end #define MPI_File_write_all_end(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_File_write_all_end",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_File_read_ordered_begin +#ifndef PyMPI_HAVE_MPI_File_read_ordered_begin #undef MPI_File_read_ordered_begin #define MPI_File_read_ordered_begin(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_File_read_ordered_begin",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_File_read_ordered_end +#ifndef PyMPI_HAVE_MPI_File_read_ordered_end #undef MPI_File_read_ordered_end #define MPI_File_read_ordered_end(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_File_read_ordered_end",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_File_write_ordered_begin +#ifndef PyMPI_HAVE_MPI_File_write_ordered_begin #undef MPI_File_write_ordered_begin #define MPI_File_write_ordered_begin(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_File_write_ordered_begin",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_File_write_ordered_end +#ifndef PyMPI_HAVE_MPI_File_write_ordered_end #undef MPI_File_write_ordered_end #define MPI_File_write_ordered_end(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_File_write_ordered_end",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_File_get_type_extent +#ifndef PyMPI_HAVE_MPI_File_get_type_extent #undef MPI_File_get_type_extent #define MPI_File_get_type_extent(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_File_get_type_extent",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_File_set_atomicity +#ifndef PyMPI_HAVE_MPI_File_set_atomicity #undef MPI_File_set_atomicity #define MPI_File_set_atomicity(a1,a2) PyMPI_UNAVAILABLE("MPI_File_set_atomicity",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_File_get_atomicity +#ifndef PyMPI_HAVE_MPI_File_get_atomicity #undef MPI_File_get_atomicity #define MPI_File_get_atomicity(a1,a2) PyMPI_UNAVAILABLE("MPI_File_get_atomicity",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_File_sync +#ifndef PyMPI_HAVE_MPI_File_sync #undef MPI_File_sync #define MPI_File_sync(a1) PyMPI_UNAVAILABLE("MPI_File_sync",a1) #endif -#ifdef PyMPI_MISSING_MPI_File_get_errhandler +#ifndef PyMPI_HAVE_MPI_File_get_errhandler #undef MPI_File_get_errhandler #define MPI_File_get_errhandler(a1,a2) PyMPI_UNAVAILABLE("MPI_File_get_errhandler",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_File_set_errhandler +#ifndef PyMPI_HAVE_MPI_File_set_errhandler #undef MPI_File_set_errhandler #define MPI_File_set_errhandler(a1,a2) PyMPI_UNAVAILABLE("MPI_File_set_errhandler",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_File_errhandler_fn +#ifndef PyMPI_HAVE_MPI_File_errhandler_fn #undef MPI_File_errhandler_fn typedef void (PyMPI_MPI_File_errhandler_fn)(MPI_File*,int*,...); #define MPI_File_errhandler_fn PyMPI_MPI_File_errhandler_fn #endif -#ifdef PyMPI_MISSING_MPI_File_errhandler_function +#ifndef PyMPI_HAVE_MPI_File_errhandler_function #undef MPI_File_errhandler_function #define MPI_File_errhandler_function MPI_File_errhandler_fn #endif -#ifdef PyMPI_MISSING_MPI_File_create_errhandler +#ifndef PyMPI_HAVE_MPI_File_create_errhandler #undef MPI_File_create_errhandler #define MPI_File_create_errhandler(a1,a2) PyMPI_UNAVAILABLE("MPI_File_create_errhandler",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_File_call_errhandler +#ifndef PyMPI_HAVE_MPI_File_call_errhandler #undef MPI_File_call_errhandler #define MPI_File_call_errhandler(a1,a2) PyMPI_UNAVAILABLE("MPI_File_call_errhandler",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Datarep_conversion_function +#ifndef PyMPI_HAVE_MPI_Datarep_conversion_function #undef MPI_Datarep_conversion_function typedef int (PyMPI_MPI_Datarep_conversion_function)(void*,MPI_Datatype,int,void*,MPI_Offset,void*); #define MPI_Datarep_conversion_function PyMPI_MPI_Datarep_conversion_function #endif -#ifdef PyMPI_MISSING_MPI_Datarep_extent_function +#ifndef PyMPI_HAVE_MPI_Datarep_extent_function #undef MPI_Datarep_extent_function typedef int (PyMPI_MPI_Datarep_extent_function)(MPI_Datatype,MPI_Aint*,void*); #define MPI_Datarep_extent_function PyMPI_MPI_Datarep_extent_function #endif -#ifdef PyMPI_MISSING_MPI_CONVERSION_FN_NULL +#ifndef PyMPI_HAVE_MPI_CONVERSION_FN_NULL #undef MPI_CONVERSION_FN_NULL #define MPI_CONVERSION_FN_NULL (0) #endif -#ifdef PyMPI_MISSING_MPI_MAX_DATAREP_STRING +#ifndef PyMPI_HAVE_MPI_MAX_DATAREP_STRING #undef MPI_MAX_DATAREP_STRING #define MPI_MAX_DATAREP_STRING (1) #endif -#ifdef PyMPI_MISSING_MPI_Register_datarep +#ifndef PyMPI_HAVE_MPI_Register_datarep #undef MPI_Register_datarep #define MPI_Register_datarep(a1,a2,a3,a4,a5) PyMPI_UNAVAILABLE("MPI_Register_datarep",a1,a2,a3,a4,a5) #endif -#ifdef PyMPI_MISSING_MPI_ERRHANDLER_NULL +#ifndef PyMPI_HAVE_MPI_ERRHANDLER_NULL #undef MPI_ERRHANDLER_NULL #define MPI_ERRHANDLER_NULL ((MPI_Errhandler)0) #endif -#ifdef PyMPI_MISSING_MPI_ERRORS_RETURN +#ifndef PyMPI_HAVE_MPI_ERRORS_RETURN #undef MPI_ERRORS_RETURN #define MPI_ERRORS_RETURN ((MPI_Errhandler)MPI_ERRHANDLER_NULL) #endif -#ifdef PyMPI_MISSING_MPI_ERRORS_ARE_FATAL +#ifndef PyMPI_HAVE_MPI_ERRORS_ARE_FATAL #undef MPI_ERRORS_ARE_FATAL #define MPI_ERRORS_ARE_FATAL ((MPI_Errhandler)MPI_ERRHANDLER_NULL) #endif -#ifdef PyMPI_MISSING_MPI_Errhandler_free +#ifndef PyMPI_HAVE_MPI_Errhandler_free #undef MPI_Errhandler_free #define MPI_Errhandler_free(a1) PyMPI_UNAVAILABLE("MPI_Errhandler_free",a1) #endif -#ifdef PyMPI_MISSING_MPI_MAX_ERROR_STRING +#ifndef PyMPI_HAVE_MPI_MAX_ERROR_STRING #undef MPI_MAX_ERROR_STRING #define MPI_MAX_ERROR_STRING (1) #endif -#ifdef PyMPI_MISSING_MPI_Error_class +#ifndef PyMPI_HAVE_MPI_Error_class #undef MPI_Error_class #define MPI_Error_class(a1,a2) PyMPI_UNAVAILABLE("MPI_Error_class",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Error_string +#ifndef PyMPI_HAVE_MPI_Error_string #undef MPI_Error_string #define MPI_Error_string(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Error_string",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Add_error_class +#ifndef PyMPI_HAVE_MPI_Add_error_class #undef MPI_Add_error_class #define MPI_Add_error_class(a1) PyMPI_UNAVAILABLE("MPI_Add_error_class",a1) #endif -#ifdef PyMPI_MISSING_MPI_Add_error_code +#ifndef PyMPI_HAVE_MPI_Add_error_code #undef MPI_Add_error_code #define MPI_Add_error_code(a1,a2) PyMPI_UNAVAILABLE("MPI_Add_error_code",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Add_error_string +#ifndef PyMPI_HAVE_MPI_Add_error_string #undef MPI_Add_error_string #define MPI_Add_error_string(a1,a2) PyMPI_UNAVAILABLE("MPI_Add_error_string",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_SUCCESS +#ifndef PyMPI_HAVE_MPI_SUCCESS #undef MPI_SUCCESS #define MPI_SUCCESS (0) #endif -#ifdef PyMPI_MISSING_MPI_ERR_LASTCODE +#ifndef PyMPI_HAVE_MPI_ERR_LASTCODE #undef MPI_ERR_LASTCODE #define MPI_ERR_LASTCODE (1) #endif -#ifdef PyMPI_MISSING_MPI_ERR_COMM +#ifndef PyMPI_HAVE_MPI_ERR_COMM #undef MPI_ERR_COMM #define MPI_ERR_COMM (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_GROUP +#ifndef PyMPI_HAVE_MPI_ERR_GROUP #undef MPI_ERR_GROUP #define MPI_ERR_GROUP (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_TYPE +#ifndef PyMPI_HAVE_MPI_ERR_TYPE #undef MPI_ERR_TYPE #define MPI_ERR_TYPE (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_REQUEST +#ifndef PyMPI_HAVE_MPI_ERR_REQUEST #undef MPI_ERR_REQUEST #define MPI_ERR_REQUEST (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_OP +#ifndef PyMPI_HAVE_MPI_ERR_OP #undef MPI_ERR_OP #define MPI_ERR_OP (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_BUFFER +#ifndef PyMPI_HAVE_MPI_ERR_BUFFER #undef MPI_ERR_BUFFER #define MPI_ERR_BUFFER (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_COUNT +#ifndef PyMPI_HAVE_MPI_ERR_COUNT #undef MPI_ERR_COUNT #define MPI_ERR_COUNT (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_TAG +#ifndef PyMPI_HAVE_MPI_ERR_TAG #undef MPI_ERR_TAG #define MPI_ERR_TAG (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_RANK +#ifndef PyMPI_HAVE_MPI_ERR_RANK #undef MPI_ERR_RANK #define MPI_ERR_RANK (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_ROOT +#ifndef PyMPI_HAVE_MPI_ERR_ROOT #undef MPI_ERR_ROOT #define MPI_ERR_ROOT (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_TRUNCATE +#ifndef PyMPI_HAVE_MPI_ERR_TRUNCATE #undef MPI_ERR_TRUNCATE #define MPI_ERR_TRUNCATE (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_IN_STATUS +#ifndef PyMPI_HAVE_MPI_ERR_IN_STATUS #undef MPI_ERR_IN_STATUS #define MPI_ERR_IN_STATUS (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_PENDING +#ifndef PyMPI_HAVE_MPI_ERR_PENDING #undef MPI_ERR_PENDING #define MPI_ERR_PENDING (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_TOPOLOGY +#ifndef PyMPI_HAVE_MPI_ERR_TOPOLOGY #undef MPI_ERR_TOPOLOGY #define MPI_ERR_TOPOLOGY (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_DIMS +#ifndef PyMPI_HAVE_MPI_ERR_DIMS #undef MPI_ERR_DIMS #define MPI_ERR_DIMS (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_ARG +#ifndef PyMPI_HAVE_MPI_ERR_ARG #undef MPI_ERR_ARG #define MPI_ERR_ARG (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_OTHER +#ifndef PyMPI_HAVE_MPI_ERR_OTHER #undef MPI_ERR_OTHER #define MPI_ERR_OTHER (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_UNKNOWN +#ifndef PyMPI_HAVE_MPI_ERR_UNKNOWN #undef MPI_ERR_UNKNOWN #define MPI_ERR_UNKNOWN (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_INTERN +#ifndef PyMPI_HAVE_MPI_ERR_INTERN #undef MPI_ERR_INTERN #define MPI_ERR_INTERN (MPI_ERR_LASTCODE) #endif -#ifdef PyMPI_MISSING_MPI_ERR_KEYVAL +#ifndef PyMPI_HAVE_MPI_ERR_KEYVAL #undef MPI_ERR_KEYVAL #define MPI_ERR_KEYVAL (MPI_ERR_ARG) #endif -#ifdef PyMPI_MISSING_MPI_ERR_NO_MEM +#ifndef PyMPI_HAVE_MPI_ERR_NO_MEM #undef MPI_ERR_NO_MEM #define MPI_ERR_NO_MEM (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_INFO +#ifndef PyMPI_HAVE_MPI_ERR_INFO #undef MPI_ERR_INFO #define MPI_ERR_INFO (MPI_ERR_ARG) #endif -#ifdef PyMPI_MISSING_MPI_ERR_INFO_KEY +#ifndef PyMPI_HAVE_MPI_ERR_INFO_KEY #undef MPI_ERR_INFO_KEY #define MPI_ERR_INFO_KEY (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_INFO_VALUE +#ifndef PyMPI_HAVE_MPI_ERR_INFO_VALUE #undef MPI_ERR_INFO_VALUE #define MPI_ERR_INFO_VALUE (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_INFO_NOKEY +#ifndef PyMPI_HAVE_MPI_ERR_INFO_NOKEY #undef MPI_ERR_INFO_NOKEY #define MPI_ERR_INFO_NOKEY (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_SPAWN +#ifndef PyMPI_HAVE_MPI_ERR_SPAWN #undef MPI_ERR_SPAWN #define MPI_ERR_SPAWN (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_PORT +#ifndef PyMPI_HAVE_MPI_ERR_PORT #undef MPI_ERR_PORT #define MPI_ERR_PORT (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_SERVICE +#ifndef PyMPI_HAVE_MPI_ERR_SERVICE #undef MPI_ERR_SERVICE #define MPI_ERR_SERVICE (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_NAME +#ifndef PyMPI_HAVE_MPI_ERR_NAME #undef MPI_ERR_NAME #define MPI_ERR_NAME (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_FILE +#ifndef PyMPI_HAVE_MPI_ERR_FILE #undef MPI_ERR_FILE #define MPI_ERR_FILE (MPI_ERR_ARG) #endif -#ifdef PyMPI_MISSING_MPI_ERR_NOT_SAME +#ifndef PyMPI_HAVE_MPI_ERR_NOT_SAME #undef MPI_ERR_NOT_SAME #define MPI_ERR_NOT_SAME (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_BAD_FILE +#ifndef PyMPI_HAVE_MPI_ERR_BAD_FILE #undef MPI_ERR_BAD_FILE #define MPI_ERR_BAD_FILE (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_NO_SUCH_FILE +#ifndef PyMPI_HAVE_MPI_ERR_NO_SUCH_FILE #undef MPI_ERR_NO_SUCH_FILE #define MPI_ERR_NO_SUCH_FILE (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_FILE_EXISTS +#ifndef PyMPI_HAVE_MPI_ERR_FILE_EXISTS #undef MPI_ERR_FILE_EXISTS #define MPI_ERR_FILE_EXISTS (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_FILE_IN_USE +#ifndef PyMPI_HAVE_MPI_ERR_FILE_IN_USE #undef MPI_ERR_FILE_IN_USE #define MPI_ERR_FILE_IN_USE (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_AMODE +#ifndef PyMPI_HAVE_MPI_ERR_AMODE #undef MPI_ERR_AMODE #define MPI_ERR_AMODE (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_ACCESS +#ifndef PyMPI_HAVE_MPI_ERR_ACCESS #undef MPI_ERR_ACCESS #define MPI_ERR_ACCESS (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_READ_ONLY +#ifndef PyMPI_HAVE_MPI_ERR_READ_ONLY #undef MPI_ERR_READ_ONLY #define MPI_ERR_READ_ONLY (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_NO_SPACE +#ifndef PyMPI_HAVE_MPI_ERR_NO_SPACE #undef MPI_ERR_NO_SPACE #define MPI_ERR_NO_SPACE (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_QUOTA +#ifndef PyMPI_HAVE_MPI_ERR_QUOTA #undef MPI_ERR_QUOTA #define MPI_ERR_QUOTA (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_UNSUPPORTED_DATAREP +#ifndef PyMPI_HAVE_MPI_ERR_UNSUPPORTED_DATAREP #undef MPI_ERR_UNSUPPORTED_DATAREP #define MPI_ERR_UNSUPPORTED_DATAREP (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_UNSUPPORTED_OPERATION +#ifndef PyMPI_HAVE_MPI_ERR_UNSUPPORTED_OPERATION #undef MPI_ERR_UNSUPPORTED_OPERATION #define MPI_ERR_UNSUPPORTED_OPERATION (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_CONVERSION +#ifndef PyMPI_HAVE_MPI_ERR_CONVERSION #undef MPI_ERR_CONVERSION #define MPI_ERR_CONVERSION (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_DUP_DATAREP +#ifndef PyMPI_HAVE_MPI_ERR_DUP_DATAREP #undef MPI_ERR_DUP_DATAREP #define MPI_ERR_DUP_DATAREP (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_IO +#ifndef PyMPI_HAVE_MPI_ERR_IO #undef MPI_ERR_IO #define MPI_ERR_IO (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_WIN +#ifndef PyMPI_HAVE_MPI_ERR_WIN #undef MPI_ERR_WIN #define MPI_ERR_WIN (MPI_ERR_ARG) #endif -#ifdef PyMPI_MISSING_MPI_ERR_BASE +#ifndef PyMPI_HAVE_MPI_ERR_BASE #undef MPI_ERR_BASE #define MPI_ERR_BASE (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_SIZE +#ifndef PyMPI_HAVE_MPI_ERR_SIZE #undef MPI_ERR_SIZE #define MPI_ERR_SIZE (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_DISP +#ifndef PyMPI_HAVE_MPI_ERR_DISP #undef MPI_ERR_DISP #define MPI_ERR_DISP (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_ASSERT +#ifndef PyMPI_HAVE_MPI_ERR_ASSERT #undef MPI_ERR_ASSERT #define MPI_ERR_ASSERT (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_LOCKTYPE +#ifndef PyMPI_HAVE_MPI_ERR_LOCKTYPE #undef MPI_ERR_LOCKTYPE #define MPI_ERR_LOCKTYPE (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_RMA_CONFLICT +#ifndef PyMPI_HAVE_MPI_ERR_RMA_CONFLICT #undef MPI_ERR_RMA_CONFLICT #define MPI_ERR_RMA_CONFLICT (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_RMA_SYNC +#ifndef PyMPI_HAVE_MPI_ERR_RMA_SYNC #undef MPI_ERR_RMA_SYNC #define MPI_ERR_RMA_SYNC (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_RMA_RANGE +#ifndef PyMPI_HAVE_MPI_ERR_RMA_RANGE #undef MPI_ERR_RMA_RANGE #define MPI_ERR_RMA_RANGE (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_RMA_ATTACH +#ifndef PyMPI_HAVE_MPI_ERR_RMA_ATTACH #undef MPI_ERR_RMA_ATTACH #define MPI_ERR_RMA_ATTACH (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_RMA_SHARED +#ifndef PyMPI_HAVE_MPI_ERR_RMA_SHARED #undef MPI_ERR_RMA_SHARED #define MPI_ERR_RMA_SHARED (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_ERR_RMA_FLAVOR +#ifndef PyMPI_HAVE_MPI_ERR_RMA_FLAVOR #undef MPI_ERR_RMA_FLAVOR #define MPI_ERR_RMA_FLAVOR (MPI_ERR_UNKNOWN) #endif -#ifdef PyMPI_MISSING_MPI_Alloc_mem +#ifndef PyMPI_HAVE_MPI_Alloc_mem #undef MPI_Alloc_mem #define MPI_Alloc_mem(a1,a2,a3) PyMPI_UNAVAILABLE("MPI_Alloc_mem",a1,a2,a3) #endif -#ifdef PyMPI_MISSING_MPI_Free_mem +#ifndef PyMPI_HAVE_MPI_Free_mem #undef MPI_Free_mem #define MPI_Free_mem(a1) PyMPI_UNAVAILABLE("MPI_Free_mem",a1) #endif -#ifdef PyMPI_MISSING_MPI_Init +#ifndef PyMPI_HAVE_MPI_Init #undef MPI_Init #define MPI_Init(a1,a2) PyMPI_UNAVAILABLE("MPI_Init",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Finalize +#ifndef PyMPI_HAVE_MPI_Finalize #undef MPI_Finalize #define MPI_Finalize() PyMPI_UNAVAILABLE("MPI_Finalize") #endif -#ifdef PyMPI_MISSING_MPI_Initialized +#ifndef PyMPI_HAVE_MPI_Initialized #undef MPI_Initialized #define MPI_Initialized(a1) PyMPI_UNAVAILABLE("MPI_Initialized",a1) #endif -#ifdef PyMPI_MISSING_MPI_Finalized +#ifndef PyMPI_HAVE_MPI_Finalized #undef MPI_Finalized #define MPI_Finalized(a1) PyMPI_UNAVAILABLE("MPI_Finalized",a1) #endif -#ifdef PyMPI_MISSING_MPI_THREAD_SINGLE +#ifndef PyMPI_HAVE_MPI_THREAD_SINGLE #undef MPI_THREAD_SINGLE #define MPI_THREAD_SINGLE (0) #endif -#ifdef PyMPI_MISSING_MPI_THREAD_FUNNELED +#ifndef PyMPI_HAVE_MPI_THREAD_FUNNELED #undef MPI_THREAD_FUNNELED #define MPI_THREAD_FUNNELED (1) #endif -#ifdef PyMPI_MISSING_MPI_THREAD_SERIALIZED +#ifndef PyMPI_HAVE_MPI_THREAD_SERIALIZED #undef MPI_THREAD_SERIALIZED #define MPI_THREAD_SERIALIZED (2) #endif -#ifdef PyMPI_MISSING_MPI_THREAD_MULTIPLE +#ifndef PyMPI_HAVE_MPI_THREAD_MULTIPLE #undef MPI_THREAD_MULTIPLE #define MPI_THREAD_MULTIPLE (3) #endif -#ifdef PyMPI_MISSING_MPI_Init_thread +#ifndef PyMPI_HAVE_MPI_Init_thread #undef MPI_Init_thread #define MPI_Init_thread(a1,a2,a3,a4) PyMPI_UNAVAILABLE("MPI_Init_thread",a1,a2,a3,a4) #endif -#ifdef PyMPI_MISSING_MPI_Query_thread +#ifndef PyMPI_HAVE_MPI_Query_thread #undef MPI_Query_thread #define MPI_Query_thread(a1) PyMPI_UNAVAILABLE("MPI_Query_thread",a1) #endif -#ifdef PyMPI_MISSING_MPI_Is_thread_main +#ifndef PyMPI_HAVE_MPI_Is_thread_main #undef MPI_Is_thread_main #define MPI_Is_thread_main(a1) PyMPI_UNAVAILABLE("MPI_Is_thread_main",a1) #endif -#ifdef PyMPI_MISSING_MPI_VERSION +#ifndef PyMPI_HAVE_MPI_VERSION #undef MPI_VERSION #define MPI_VERSION (1) #endif -#ifdef PyMPI_MISSING_MPI_SUBVERSION +#ifndef PyMPI_HAVE_MPI_SUBVERSION #undef MPI_SUBVERSION #define MPI_SUBVERSION (0) #endif -#ifdef PyMPI_MISSING_MPI_Get_version +#ifndef PyMPI_HAVE_MPI_Get_version #undef MPI_Get_version #define MPI_Get_version(a1,a2) PyMPI_UNAVAILABLE("MPI_Get_version",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_MAX_LIBRARY_VERSION_STRING +#ifndef PyMPI_HAVE_MPI_MAX_LIBRARY_VERSION_STRING #undef MPI_MAX_LIBRARY_VERSION_STRING #define MPI_MAX_LIBRARY_VERSION_STRING (1) #endif -#ifdef PyMPI_MISSING_MPI_Get_library_version +#ifndef PyMPI_HAVE_MPI_Get_library_version #undef MPI_Get_library_version #define MPI_Get_library_version(a1,a2) PyMPI_UNAVAILABLE("MPI_Get_library_version",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_MAX_PROCESSOR_NAME +#ifndef PyMPI_HAVE_MPI_MAX_PROCESSOR_NAME #undef MPI_MAX_PROCESSOR_NAME #define MPI_MAX_PROCESSOR_NAME (1) #endif -#ifdef PyMPI_MISSING_MPI_Get_processor_name +#ifndef PyMPI_HAVE_MPI_Get_processor_name #undef MPI_Get_processor_name #define MPI_Get_processor_name(a1,a2) PyMPI_UNAVAILABLE("MPI_Get_processor_name",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Wtime +#ifndef PyMPI_HAVE_MPI_Wtime #undef MPI_Wtime #define MPI_Wtime() PyMPI_UNAVAILABLE("MPI_Wtime") #endif -#ifdef PyMPI_MISSING_MPI_Wtick +#ifndef PyMPI_HAVE_MPI_Wtick #undef MPI_Wtick #define MPI_Wtick() PyMPI_UNAVAILABLE("MPI_Wtick") #endif -#ifdef PyMPI_MISSING_MPI_Pcontrol +#ifndef PyMPI_HAVE_MPI_Pcontrol #undef MPI_Pcontrol #define MPI_Pcontrol(a1) PyMPI_UNAVAILABLE("MPI_Pcontrol",a1) #endif -#ifdef PyMPI_MISSING_MPI_Fint +#ifndef PyMPI_HAVE_MPI_Fint #undef MPI_Fint typedef int PyMPI_MPI_Fint; #define MPI_Fint PyMPI_MPI_Fint #endif -#ifdef PyMPI_MISSING_MPI_F_STATUS_IGNORE +#ifndef PyMPI_HAVE_MPI_F_STATUS_IGNORE #undef MPI_F_STATUS_IGNORE #define MPI_F_STATUS_IGNORE ((MPI_Fint*)0) #endif -#ifdef PyMPI_MISSING_MPI_F_STATUSES_IGNORE +#ifndef PyMPI_HAVE_MPI_F_STATUSES_IGNORE #undef MPI_F_STATUSES_IGNORE #define MPI_F_STATUSES_IGNORE ((MPI_Fint*)0) #endif -#ifdef PyMPI_MISSING_MPI_Status_c2f +#ifndef PyMPI_HAVE_MPI_Status_c2f #undef MPI_Status_c2f #define MPI_Status_c2f(a1,a2) PyMPI_UNAVAILABLE("MPI_Status_c2f",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Status_f2c +#ifndef PyMPI_HAVE_MPI_Status_f2c #undef MPI_Status_f2c #define MPI_Status_f2c(a1,a2) PyMPI_UNAVAILABLE("MPI_Status_f2c",a1,a2) #endif -#ifdef PyMPI_MISSING_MPI_Type_c2f +#ifndef PyMPI_HAVE_MPI_Type_c2f #undef MPI_Type_c2f #define MPI_Type_c2f(a1) ((MPI_Fint)0) #endif -#ifdef PyMPI_MISSING_MPI_Request_c2f +#ifndef PyMPI_HAVE_MPI_Request_c2f #undef MPI_Request_c2f #define MPI_Request_c2f(a1) ((MPI_Fint)0) #endif -#ifdef PyMPI_MISSING_MPI_Message_c2f +#ifndef PyMPI_HAVE_MPI_Message_c2f #undef MPI_Message_c2f #define MPI_Message_c2f(a1) ((MPI_Fint)0) #endif -#ifdef PyMPI_MISSING_MPI_Op_c2f +#ifndef PyMPI_HAVE_MPI_Op_c2f #undef MPI_Op_c2f #define MPI_Op_c2f(a1) ((MPI_Fint)0) #endif -#ifdef PyMPI_MISSING_MPI_Info_c2f +#ifndef PyMPI_HAVE_MPI_Info_c2f #undef MPI_Info_c2f #define MPI_Info_c2f(a1) ((MPI_Fint)0) #endif -#ifdef PyMPI_MISSING_MPI_Group_c2f +#ifndef PyMPI_HAVE_MPI_Group_c2f #undef MPI_Group_c2f #define MPI_Group_c2f(a1) ((MPI_Fint)0) #endif -#ifdef PyMPI_MISSING_MPI_Comm_c2f +#ifndef PyMPI_HAVE_MPI_Comm_c2f #undef MPI_Comm_c2f #define MPI_Comm_c2f(a1) ((MPI_Fint)0) #endif -#ifdef PyMPI_MISSING_MPI_Win_c2f +#ifndef PyMPI_HAVE_MPI_Win_c2f #undef MPI_Win_c2f #define MPI_Win_c2f(a1) ((MPI_Fint)0) #endif -#ifdef PyMPI_MISSING_MPI_File_c2f +#ifndef PyMPI_HAVE_MPI_File_c2f #undef MPI_File_c2f #define MPI_File_c2f(a1) ((MPI_Fint)0) #endif -#ifdef PyMPI_MISSING_MPI_Errhandler_c2f +#ifndef PyMPI_HAVE_MPI_Errhandler_c2f #undef MPI_Errhandler_c2f #define MPI_Errhandler_c2f(a1) ((MPI_Fint)0) #endif -#ifdef PyMPI_MISSING_MPI_Type_f2c +#ifndef PyMPI_HAVE_MPI_Type_f2c #undef MPI_Type_f2c #define MPI_Type_f2c(a1) MPI_DATATYPE_NULL #endif -#ifdef PyMPI_MISSING_MPI_Request_f2c +#ifndef PyMPI_HAVE_MPI_Request_f2c #undef MPI_Request_f2c #define MPI_Request_f2c(a1) MPI_REQUEST_NULL #endif -#ifdef PyMPI_MISSING_MPI_Message_f2c +#ifndef PyMPI_HAVE_MPI_Message_f2c #undef MPI_Message_f2c #define MPI_Message_f2c(a1) MPI_MESSAGE_NULL #endif -#ifdef PyMPI_MISSING_MPI_Op_f2c +#ifndef PyMPI_HAVE_MPI_Op_f2c #undef MPI_Op_f2c #define MPI_Op_f2c(a1) MPI_OP_NULL #endif -#ifdef PyMPI_MISSING_MPI_Info_f2c +#ifndef PyMPI_HAVE_MPI_Info_f2c #undef MPI_Info_f2c #define MPI_Info_f2c(a1) MPI_INFO_NULL #endif -#ifdef PyMPI_MISSING_MPI_Group_f2c +#ifndef PyMPI_HAVE_MPI_Group_f2c #undef MPI_Group_f2c #define MPI_Group_f2c(a1) MPI_GROUP_NULL #endif -#ifdef PyMPI_MISSING_MPI_Comm_f2c +#ifndef PyMPI_HAVE_MPI_Comm_f2c #undef MPI_Comm_f2c #define MPI_Comm_f2c(a1) MPI_COMM_NULL #endif -#ifdef PyMPI_MISSING_MPI_Win_f2c +#ifndef PyMPI_HAVE_MPI_Win_f2c #undef MPI_Win_f2c #define MPI_Win_f2c(a1) MPI_WIN_NULL #endif -#ifdef PyMPI_MISSING_MPI_File_f2c +#ifndef PyMPI_HAVE_MPI_File_f2c #undef MPI_File_f2c #define MPI_File_f2c(a1) MPI_FILE_NULL #endif -#ifdef PyMPI_MISSING_MPI_Errhandler_f2c +#ifndef PyMPI_HAVE_MPI_Errhandler_f2c #undef MPI_Errhandler_f2c #define MPI_Errhandler_f2c(a1) MPI_ERRHANDLER_NULL #endif From 00a7dd4ca1a7d81bd885a4802d3a81422bd4ed3e Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sat, 4 May 2013 17:44:34 +0300 Subject: [PATCH 41/56] Fix target names in CMakeLists.txt --- conf/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/CMakeLists.txt b/conf/CMakeLists.txt index f02492a..f2920bb 100644 --- a/conf/CMakeLists.txt +++ b/conf/CMakeLists.txt @@ -184,7 +184,7 @@ TARGET_LINK_LIBRARIES(pmpi-vt ${MPI_LIBRARIES}) # --- mpi4py/lib-pmpi/libvt-mpi.so --- ADD_LIBRARY(pmpi-vt-mpi MODULE "${mpi4py_SOURCE_DIR}/pmpi-vt-mpi.c") SET_TARGET_PROPERTIES( - pmpi-vt PROPERTIES + pmpi-vt-mpi PROPERTIES OUTPUT_NAME "vt-mpi" LIBRARY_OUTPUT_DIRECTORY "${mpi4py_BINARY_DIR}/lib-pmpi" RUNTIME_OUTPUT_DIRECTORY "${mpi4py_BINARY_DIR}/lib-pmpi" @@ -196,7 +196,7 @@ TARGET_LINK_LIBRARIES(pmpi-vt-mpi ${MPI_LIBRARIES}) # --- mpi4py/lib-pmpi/libvt-hyb.so --- ADD_LIBRARY(pmpi-vt-hyb MODULE "${mpi4py_SOURCE_DIR}/pmpi-vt-hyb.c") SET_TARGET_PROPERTIES( - pmpi-vt PROPERTIES + pmpi-vt-hyb PROPERTIES OUTPUT_NAME "vt-hyb" LIBRARY_OUTPUT_DIRECTORY "${mpi4py_BINARY_DIR}/lib-pmpi" RUNTIME_OUTPUT_DIRECTORY "${mpi4py_BINARY_DIR}/lib-pmpi" From 68c84caf885c5a4186a91bde04e879d9c2a9ef54 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sat, 4 May 2013 17:59:43 +0300 Subject: [PATCH 42/56] Rename macro PyMPIAPI -> MPIAPI --- src/MPI/commimpl.pxi | 4 ++-- src/MPI/opimpl.pxi | 32 ++++++++++++++++---------------- src/MPI/reqimpl.pxi | 6 +++--- src/MPI/typeimpl.pxi | 4 ++-- src/MPI/winimpl.pxi | 6 +++--- src/atimport.h | 18 ++++++++---------- src/fallback.h | 4 ++-- 7 files changed, 36 insertions(+), 38 deletions(-) diff --git a/src/MPI/commimpl.pxi b/src/MPI/commimpl.pxi index 231da8a..8dae654 100644 --- a/src/MPI/commimpl.pxi +++ b/src/MPI/commimpl.pxi @@ -82,7 +82,7 @@ cdef int comm_attr_delete_cb( return MPI_ERR_OTHER return MPI_SUCCESS -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef int comm_attr_copy_fn(MPI_Comm comm, int keyval, void *extra_state, @@ -95,7 +95,7 @@ cdef int comm_attr_copy_fn(MPI_Comm comm, return comm_attr_copy_cb(comm, keyval, extra_state, attrval_in, attrval_out, flag) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef int comm_attr_delete_fn(MPI_Comm comm, int keyval, void *attrval, diff --git a/src/MPI/opimpl.pxi b/src/MPI/opimpl.pxi index cbdc0c4..98b19f9 100644 --- a/src/MPI/opimpl.pxi +++ b/src/MPI/opimpl.pxi @@ -110,52 +110,52 @@ cdef inline void op_user_call( # make the actual GIL-safe Python call op_user_mpi(index, a, b, n, t) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef void op_user_01(void *a, void *b, int *n, MPI_Datatype *t) nogil: op_user_call( 1, a, b, n, t) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef void op_user_02(void *a, void *b, int *n, MPI_Datatype *t) nogil: op_user_call( 2, a, b, n, t) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef void op_user_03(void *a, void *b, int *n, MPI_Datatype *t) nogil: op_user_call( 3, a, b, n, t) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef void op_user_04(void *a, void *b, int *n, MPI_Datatype *t) nogil: op_user_call( 4, a, b, n, t) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef void op_user_05(void *a, void *b, int *n, MPI_Datatype *t) nogil: op_user_call( 5, a, b, n, t) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef void op_user_06(void *a, void *b, int *n, MPI_Datatype *t) nogil: op_user_call( 6, a, b, n, t) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef void op_user_07(void *a, void *b, int *n, MPI_Datatype *t) nogil: op_user_call( 7, a, b, n, t) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef void op_user_08(void *a, void *b, int *n, MPI_Datatype *t) nogil: op_user_call( 8, a, b, n, t) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef void op_user_09(void *a, void *b, int *n, MPI_Datatype *t) nogil: op_user_call( 9, a, b, n, t) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef void op_user_10(void *a, void *b, int *n, MPI_Datatype *t) nogil: op_user_call(10, a, b, n, t) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef void op_user_11(void *a, void *b, int *n, MPI_Datatype *t) nogil: op_user_call(11, a, b, n, t) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef void op_user_12(void *a, void *b, int *n, MPI_Datatype *t) nogil: op_user_call(12, a, b, n, t) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef void op_user_13(void *a, void *b, int *n, MPI_Datatype *t) nogil: op_user_call(13, a, b, n, t) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef void op_user_14(void *a, void *b, int *n, MPI_Datatype *t) nogil: op_user_call(14, a, b, n, t) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef void op_user_15(void *a, void *b, int *n, MPI_Datatype *t) nogil: op_user_call(15, a, b, n, t) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef void op_user_16(void *a, void *b, int *n, MPI_Datatype *t) nogil: op_user_call(15, a, b, n, t) diff --git a/src/MPI/reqimpl.pxi b/src/MPI/reqimpl.pxi index d838210..e64523a 100644 --- a/src/MPI/reqimpl.pxi +++ b/src/MPI/reqimpl.pxi @@ -138,7 +138,7 @@ cdef int greq_cancel(void *extra_state, int completed) with gil: # --- -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef int greq_query_fn(void *extra_state, MPI_Status *status) nogil: if extra_state == NULL: return MPI_ERR_INTERN @@ -148,7 +148,7 @@ cdef int greq_query_fn(void *extra_state, MPI_Status *status) nogil: return MPI_ERR_INTERN return greq_query(extra_state, status) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef int greq_free_fn(void *extra_state) nogil: if extra_state == NULL: return MPI_ERR_INTERN @@ -156,7 +156,7 @@ cdef int greq_free_fn(void *extra_state) nogil: return MPI_ERR_INTERN return greq_free(extra_state) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef int greq_cancel_fn(void *extra_state, int completed) nogil: if extra_state == NULL: return MPI_ERR_INTERN diff --git a/src/MPI/typeimpl.pxi b/src/MPI/typeimpl.pxi index e661f80..857c84b 100644 --- a/src/MPI/typeimpl.pxi +++ b/src/MPI/typeimpl.pxi @@ -82,7 +82,7 @@ cdef int type_attr_delete_cb( return MPI_ERR_OTHER return MPI_SUCCESS -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef int type_attr_copy_fn(MPI_Datatype datatype, int keyval, void *extra_state, @@ -95,7 +95,7 @@ cdef int type_attr_copy_fn(MPI_Datatype datatype, return type_attr_copy_cb(datatype, keyval, extra_state, attrval_in, attrval_out, flag) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef int type_attr_delete_fn(MPI_Datatype datatype, int keyval, void *attrval, diff --git a/src/MPI/winimpl.pxi b/src/MPI/winimpl.pxi index d378f12..6276005 100644 --- a/src/MPI/winimpl.pxi +++ b/src/MPI/winimpl.pxi @@ -6,7 +6,7 @@ cdef extern from *: cdef void win_memory_decref(void *ob) with gil: Py_DECREF(ob) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef int win_memory_del(MPI_Win w, int k, void *v, void *xs) nogil: if v != NULL: if Py_IsInitialized(): @@ -112,7 +112,7 @@ cdef int win_attr_delete_cb( return MPI_ERR_OTHER return MPI_SUCCESS -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef int win_attr_copy_fn(MPI_Win win, int keyval, void *extra_state, @@ -125,7 +125,7 @@ cdef int win_attr_copy_fn(MPI_Win win, return win_attr_copy_cb(win, keyval, extra_state, attrval_in, attrval_out, flag) -@cython.callspec("PyMPIAPI") +@cython.callspec("MPIAPI") cdef int win_attr_delete_fn(MPI_Win win, int keyval, void *attrval, diff --git a/src/atimport.h b/src/atimport.h index f1b0a3c..c3ac6a6 100644 --- a/src/atimport.h +++ b/src/atimport.h @@ -21,15 +21,13 @@ #define MPICH1 1 #endif -#if defined(MS_WINDOWS) && !defined(PyMPIAPI) - #if defined(MPI_CALL) /* DeinoMPI */ - #define PyMPIAPI MPI_CALL - #elif defined(MPIAPI) /* Microsoft MPI */ - #define PyMPIAPI MPIAPI - #endif +#if defined(MS_WINDOWS) && !defined(MPIAPI) +#if defined(MPI_CALL) /* DeinoMPI */ + #define MPIAPI MPI_CALL +#endif #endif -#if !defined(PyMPIAPI) - #define PyMPIAPI +#if !defined(MPIAPI) + #define MPIAPI #endif /* XXX describe */ @@ -105,7 +103,7 @@ static int PyMPI_KEYVAL_WIN_MEMORY = MPI_KEYVAL_INVALID; static int PyMPI_StartUp(void); static int PyMPI_CleanUp(void); -static int PyMPIAPI PyMPI_AtExitMPI(MPI_Comm,int,void*,void*); +static int MPIAPI PyMPI_AtExitMPI(MPI_Comm,int,void*,void*); static int PyMPI_STARTUP_DONE = 0; static int PyMPI_StartUp(void) @@ -165,7 +163,7 @@ static int PyMPI_CleanUp(void) return MPI_SUCCESS; } -static int PyMPIAPI +static int MPIAPI PyMPI_AtExitMPI(PyMPI_UNUSED MPI_Comm comm, PyMPI_UNUSED int k, PyMPI_UNUSED void *v, diff --git a/src/fallback.h b/src/fallback.h index 885bc55..144a24e 100644 --- a/src/fallback.h +++ b/src/fallback.h @@ -899,7 +899,7 @@ static int PyMPI_Free_mem(void *baseptr) static int PyMPI_KEYVAL_WIN_MPIMEM = MPI_KEYVAL_INVALID; -static int PyMPIAPI +static int MPIAPI PyMPI_Win_free_mem(PyMPI_UNUSED MPI_Win w, PyMPI_UNUSED int k, void *v, PyMPI_UNUSED void *xs) @@ -907,7 +907,7 @@ PyMPI_Win_free_mem(PyMPI_UNUSED MPI_Win w, return MPI_Free_mem(v); } -static int PyMPIAPI +static int MPIAPI PyMPI_win_free_keyval(PyMPI_UNUSED MPI_Comm comm, PyMPI_UNUSED int k, void *v, PyMPI_UNUSED void *xs) From e6264c715a42803c7d675adb5b6e7a886233438d Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sat, 4 May 2013 20:48:16 +0300 Subject: [PATCH 43/56] Rework fallback implementation of MPI_Win_allocate --- src/fallback.h | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/fallback.h b/src/fallback.h index 144a24e..71e8c88 100644 --- a/src/fallback.h +++ b/src/fallback.h @@ -900,21 +900,23 @@ static int PyMPI_Free_mem(void *baseptr) static int PyMPI_KEYVAL_WIN_MPIMEM = MPI_KEYVAL_INVALID; static int MPIAPI -PyMPI_Win_free_mem(PyMPI_UNUSED MPI_Win w, - PyMPI_UNUSED int k, void *v, - PyMPI_UNUSED void *xs) +PyMPI_win_free_mpimem(PyMPI_UNUSED MPI_Win win, + PyMPI_UNUSED int k, void *v, + PyMPI_UNUSED void *xs) { return MPI_Free_mem(v); } static int MPIAPI -PyMPI_win_free_keyval(PyMPI_UNUSED MPI_Comm comm, +PyMPI_free_keyval_win(PyMPI_UNUSED MPI_Comm comm, PyMPI_UNUSED int k, void *v, PyMPI_UNUSED void *xs) { - int *keyval = (int*) v; - if (*keyval != MPI_KEYVAL_INVALID) - return MPI_Win_free_keyval(keyval); + int ierr = MPI_SUCCESS; + ierr = MPI_Win_free_keyval((int *)v); + if (ierr != MPI_SUCCESS) return ierr; + ierr = MPI_Comm_free_keyval(&k); + if (ierr != MPI_SUCCESS) return ierr; return MPI_SUCCESS; } @@ -929,22 +931,24 @@ static int PyMPI_Win_allocate(MPI_Aint size, int disp_unit, if (ierr != MPI_SUCCESS) goto error; ierr = MPI_Win_create(baseptr, size, disp_unit, info, comm, &win); if (ierr != MPI_SUCCESS) goto error; +#if defined(PyMPI_HAVE_MPI_Win_create_keyval) && \ + defined(PyMPI_HAVE_MPI_Win_set_attr) if (PyMPI_KEYVAL_WIN_MPIMEM == MPI_KEYVAL_INVALID) { int comm_keyval = MPI_KEYVAL_INVALID; ierr = MPI_Win_create_keyval(MPI_WIN_NULL_COPY_FN, - PyMPI_Win_free_mem, + PyMPI_win_free_mpimem, &PyMPI_KEYVAL_WIN_MPIMEM, NULL); if (ierr != MPI_SUCCESS) goto error; - if (MPI_Comm_create_keyval(MPI_COMM_NULL_COPY_FN, - PyMPI_win_free_keyval, - &comm_keyval, 0) == MPI_SUCCESS) { + ierr = MPI_Comm_create_keyval(MPI_COMM_NULL_COPY_FN, + PyMPI_free_keyval_win, + &comm_keyval, NULL); + if (ierr == MPI_SUCCESS) (void)MPI_Comm_set_attr(MPI_COMM_SELF, comm_keyval, &PyMPI_KEYVAL_WIN_MPIMEM); - (void)MPI_Comm_free_keyval(&comm_keyval); - } } ierr = MPI_Win_set_attr(win, PyMPI_KEYVAL_WIN_MPIMEM, baseptr); if (ierr != MPI_SUCCESS) goto error; +#endif *((void**)baseptr_) = baseptr; *win_ = win; return MPI_SUCCESS; From 47b10dcbb21c3ecf92724561ebc40677df595504 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Thu, 9 May 2013 18:57:04 +0300 Subject: [PATCH 44/56] Prepare to use @cython.final in the near future --- src/MPI/asbuffer.pxi | 3 ++- src/MPI/asmemory.pxi | 1 + src/MPI/reqimpl.pxi | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/MPI/asbuffer.pxi b/src/MPI/asbuffer.pxi index c4963a3..9a5e832 100644 --- a/src/MPI/asbuffer.pxi +++ b/src/MPI/asbuffer.pxi @@ -103,6 +103,7 @@ except -1: #--------------------------------------------------------------------- +#@cython.final #@cython.internal cdef class _p_buffer: cdef Py_buffer view @@ -176,7 +177,7 @@ cdef inline object getformat(_p_buffer buf): format = ob.dtype.char except (AttributeError, TypeError): try: # array.array - format = ob.typecode + format = ob.typecode except (AttributeError, TypeError): if view.format != NULL: format = mpistr(view.format) diff --git a/src/MPI/asmemory.pxi b/src/MPI/asmemory.pxi index 81c21e4..c71a2a3 100644 --- a/src/MPI/asmemory.pxi +++ b/src/MPI/asmemory.pxi @@ -25,6 +25,7 @@ cdef inline object tomemory(void *base, MPI_Aint size): #------------------------------------------------------------------------------ +#@cython.final #@cython.internal cdef class _p_mem: cdef void *buf diff --git a/src/MPI/reqimpl.pxi b/src/MPI/reqimpl.pxi index e64523a..fee3f5b 100644 --- a/src/MPI/reqimpl.pxi +++ b/src/MPI/reqimpl.pxi @@ -51,6 +51,7 @@ cdef int release_rs(object requests, # ----------------------------------------------------------------------------- +#@cython.final #@cython.internal cdef class _p_greq: From bab5522ceb66f40bfef01725e92d87569058d559 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Fri, 10 May 2013 20:41:22 +0300 Subject: [PATCH 45/56] PyPy: Rework buffer interface emulation --HG-- extra : rebase_source : 1f57932f9d62e3e623ad0c4496699f3b56c46efb --- src/MPI/asbuffer.pxi | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/MPI/asbuffer.pxi b/src/MPI/asbuffer.pxi index 9a5e832..abfe735 100644 --- a/src/MPI/asbuffer.pxi +++ b/src/MPI/asbuffer.pxi @@ -49,33 +49,35 @@ if PYPY: from numpypy import ndarray as numpy_array cdef int \ PyPy_GetBuffer(object obj, Py_buffer *view, int flags) \ except -1: - cdef Py_ssize_t addr = 0 + cdef object addr + cdef void *buf = NULL cdef Py_ssize_t size = 0 cdef bint readonly = 0 if isinstance(obj, bytes): - addr = PyBytes_AsString(obj) + buf = PyBytes_AsString(obj) size = PyBytes_Size(obj) readonly = 1 #elif isinstance(obj, bytearray): - # addr = PyByteArray_AsString(obj) + # buf = PyByteArray_AsString(obj) # size = PyByteArray_Size(obj) # readonly = 0 elif isinstance(obj, array_array): addr, size = obj.buffer_info() + buf = PyLong_AsVoidPtr(addr) size *= obj.itemsize readonly = 0 elif isinstance(obj, numpy_array): addr, readonly = obj.__array_interface__['data'] - size = obj.size - size *= obj.itemsize + buf = PyLong_AsVoidPtr(addr) + size = obj.nbytes else: if (flags & PyBUF_WRITABLE) == PyBUF_WRITABLE: readonly = 0 - PyObject_AsWriteBuffer(obj, &addr, &size) + PyObject_AsWriteBuffer(obj, &buf, &size) else: readonly = 1 - PyObject_AsReadBuffer(obj, &addr, &size) - PyBuffer_FillInfo(view, obj, addr, size, readonly, flags) + PyObject_AsReadBuffer(obj, &buf, &size) + PyBuffer_FillInfo(view, obj, buf, size, readonly, flags) if (flags & PyBUF_FORMAT) == PyBUF_FORMAT: view.format = b"B" return 0 From ff9da1e0944768f1d63f5fe05371e78e9eab392f Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Fri, 10 May 2013 21:58:34 +0300 Subject: [PATCH 46/56] PyPy: Fix build in OS X --- conf/mpidistutils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf/mpidistutils.py b/conf/mpidistutils.py index c188a59..05e57c9 100644 --- a/conf/mpidistutils.py +++ b/conf/mpidistutils.py @@ -137,6 +137,8 @@ def customize_compiler(compiler, lang=None, basecflags = '-Wall -Wimplicit' if not ccshared: ccshared = '-fPIC' if not ldshared: ldshared = '-shared' + if sys.platform == 'darwin': + ldshared += ' -Wl,-undefined,dynamic_lookup' # Compiler command overriding if not mpild and (mpicc or mpicxx): if lang == 'c': From b775e3b5bfecc69244509808aaf84e49bd9eb52c Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sat, 11 May 2013 00:09:30 +0300 Subject: [PATCH 47/56] PyPy: Workaround issues in Message.mrecv() --- src/MPI/asbuffer.pxi | 2 +- src/MPI/msgpickle.pxi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MPI/asbuffer.pxi b/src/MPI/asbuffer.pxi index abfe735..0d876cf 100644 --- a/src/MPI/asbuffer.pxi +++ b/src/MPI/asbuffer.pxi @@ -54,7 +54,7 @@ except -1: cdef Py_ssize_t size = 0 cdef bint readonly = 0 if isinstance(obj, bytes): - buf = PyBytes_AsString(obj) + buf = PyBytes_AsString(obj) size = PyBytes_Size(obj) readonly = 1 #elif isinstance(obj, bytearray): diff --git a/src/MPI/msgpickle.pxi b/src/MPI/msgpickle.pxi index 9a3be36..56ed2d1 100644 --- a/src/MPI/msgpickle.pxi +++ b/src/MPI/msgpickle.pxi @@ -586,7 +586,7 @@ cdef object PyMPI_mrecv(object rmsg, elif rmsg is None: pass elif PyBytes_CheckExact(rmsg): - getbuffer_r(rmsg, &rbuf, &rlen) + rmsg = getbuffer_r(rmsg, &rbuf, &rlen) else: rmsg = getbuffer_w(rmsg, &rbuf, &rlen) cdef int rcount = rlen # XXX overflow? From 23dcae1d70a65b4789f72094e696905089efdeac Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sat, 11 May 2013 11:23:56 +0300 Subject: [PATCH 48/56] PyPy: version 2.0 fixed PyBuffer_FillInfo() --- src/atimport.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/atimport.h b/src/atimport.h index c3ac6a6..d91eac1 100644 --- a/src/atimport.h +++ b/src/atimport.h @@ -345,16 +345,15 @@ _PyLong_AsByteArray(PyLongObject* v, return -1; } +#if PY_VERSION_HEX < 0x02070300 /* PyPy < 2.0 */ static int PyBuffer_FillInfo_PyPy(Py_buffer *view, PyObject *obj, void *buf, Py_ssize_t len, int readonly, int flags) { if (view == NULL) return 0; - if (((flags & PyBUF_WRITABLE) == PyBUF_WRITABLE) && - (readonly == 1)) { - PyErr_SetString(PyExc_BufferError, - "Object is not writable."); + if ((flags & PyBUF_WRITABLE) && readonly) { + PyErr_SetString(PyExc_BufferError, "Object is not writable."); return -1; } if (PyBuffer_FillInfo(view, obj, buf, len, readonly, flags) < 0) @@ -363,6 +362,7 @@ PyBuffer_FillInfo_PyPy(Py_buffer *view, PyObject *obj, return 0; } #define PyBuffer_FillInfo PyBuffer_FillInfo_PyPy +#endif static PyObject * PyMemoryView_FromBuffer_PyPy(Py_buffer *view) From 54e12896b494ec38ef136ac9777f039ca51ff94d Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sat, 11 May 2013 11:46:14 +0300 Subject: [PATCH 49/56] Update year 2012 -> 2013 --- LICENSE.txt | 2 +- docs/source/usrman/Makefile | 8 ++++---- docs/source/usrman/conf.py | 4 ++-- docs/source/usrman/make.bat | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 3c59e6a..7c64ed4 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -9,7 +9,7 @@ LICENSE: MPI for Python :Address: CCT CONICET, 3000 Santa Fe, Argentina -Copyright (c) 2012, Lisandro Dalcin. +Copyright (c) 2013, Lisandro Dalcin. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/docs/source/usrman/Makefile b/docs/source/usrman/Makefile index f488bef..7ed4227 100644 --- a/docs/source/usrman/Makefile +++ b/docs/source/usrman/Makefile @@ -77,17 +77,17 @@ qthelp: @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PETScforPython.qhcp" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/MPIforPython.qhcp" @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PETScforPython.qhc" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/MPIforPython.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/PETScforPython" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PETScforPython" + @echo "# mkdir -p $$HOME/.local/share/devhelp/MPIforPython" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/MPIforPython" @echo "# devhelp" epub: diff --git a/docs/source/usrman/conf.py b/docs/source/usrman/conf.py index f4063e2..538361f 100644 --- a/docs/source/usrman/conf.py +++ b/docs/source/usrman/conf.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # MPI for Python documentation build configuration file, created by -# sphinx-quickstart on Mon Jul 23 13:42:07 2012. +# sphinx-quickstart on Sat May 11 08:44:19 2013. # # This file is execfile()d with the current directory set to its containing dir. # @@ -45,7 +45,7 @@ # General information about the project. project = u'MPI for Python' -copyright = u'2012, Lisandro Dalcin' +copyright = u'2013, Lisandro Dalcin' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/docs/source/usrman/make.bat b/docs/source/usrman/make.bat index 167298f..470a50f 100644 --- a/docs/source/usrman/make.bat +++ b/docs/source/usrman/make.bat @@ -99,9 +99,9 @@ if "%1" == "qthelp" ( echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\PETScforPython.qhcp + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\MPIforPython.qhcp echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\PETScforPython.ghc + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\MPIforPython.ghc goto end ) From 59f0e7d2d4e05f4c917d8242f71684e0c5c7e65b Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Mon, 13 May 2013 20:24:43 +0300 Subject: [PATCH 50/56] Remove py30 from envlist in tox.ini --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index 7461895..b00b51c 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,6 @@ envlist = py25, py26, py27, - py30, py31, py32, py33, From 174c8da32bc9d79726f424cc0a0f3a77747da099 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Tue, 14 May 2013 11:07:49 +0300 Subject: [PATCH 51/56] Use unsigned integers for object flags --- src/include/mpi4py/MPI.pxd | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/include/mpi4py/MPI.pxd b/src/include/mpi4py/MPI.pxd index 7e9508c..4649870 100644 --- a/src/include/mpi4py/MPI.pxd +++ b/src/include/mpi4py/MPI.pxd @@ -30,21 +30,21 @@ ctypedef public api class Status [ object PyMPIStatusObject, ]: cdef MPI_Status ob_mpi - cdef int flags + cdef unsigned flags ctypedef public api class Datatype [ type PyMPIDatatype_Type, object PyMPIDatatypeObject, ]: cdef MPI_Datatype ob_mpi - cdef int flags + cdef unsigned flags ctypedef public api class Request [ type PyMPIRequest_Type, object PyMPIRequestObject, ]: cdef MPI_Request ob_mpi - cdef int flags + cdef unsigned flags cdef object ob_buf ctypedef public api class Prequest(Request) [ @@ -64,7 +64,7 @@ ctypedef public api class Message [ object PyMPIMessageObject, ]: cdef MPI_Message ob_mpi - cdef int flags + cdef unsigned flags cdef object ob_buf ctypedef public api class Op [ @@ -81,28 +81,28 @@ ctypedef public api class Group [ object PyMPIGroupObject, ]: cdef MPI_Group ob_mpi - cdef int flags + cdef unsigned flags ctypedef public api class Info [ type PyMPIInfo_Type, object PyMPIInfoObject, ]: cdef MPI_Info ob_mpi - cdef int flags + cdef unsigned flags ctypedef public api class Errhandler [ type PyMPIErrhandler_Type, object PyMPIErrhandlerObject, ]: cdef MPI_Errhandler ob_mpi - cdef int flags + cdef unsigned flags ctypedef public api class Comm [ type PyMPIComm_Type, object PyMPICommObject, ]: cdef MPI_Comm ob_mpi - cdef int flags + cdef unsigned flags ctypedef public api class Intracomm(Comm) [ type PyMPIIntracomm_Type, @@ -138,14 +138,14 @@ ctypedef public api class Win [ type PyMPIWin_Type, object PyMPIWinObject, ]: - cdef MPI_Win ob_mpi - cdef int flags + cdef MPI_Win ob_mpi + cdef unsigned flags ctypedef public api class File [ type PyMPIFile_Type, object PyMPIFileObject, ]: cdef MPI_File ob_mpi - cdef int flags + cdef unsigned flags # -- From 6e0114e69fbc97b27e7f1b45ac558925ffd60938 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Tue, 14 May 2013 11:41:34 +0300 Subject: [PATCH 52/56] Fix exception handling in user-defined reduction operations --- src/MPI/opimpl.pxi | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/MPI/opimpl.pxi b/src/MPI/opimpl.pxi index 98b19f9..1cbac33 100644 --- a/src/MPI/opimpl.pxi +++ b/src/MPI/opimpl.pxi @@ -87,15 +87,18 @@ cdef inline object op_user_py(int index, object x, object y, object dt): cdef inline void op_user_mpi( int index, void *a, void *b, MPI_Aint n, MPI_Datatype *t) with gil: + cdef Datatype datatype # errors in user-defined reduction operations are unrecoverable try: - op_user_py(index, tomemory(a, n), tomemory(b, n), new_Datatype(t[0])) + datatype = Datatype.__new__(Datatype) + datatype.ob_mpi = t[0] + op_user_py(index, tomemory(a, n), tomemory(b, n), datatype) except: # print the full exception traceback and abort. PySys_WriteStderr(b"Fatal Python error: exception in " b"user-defined reduction operation\n", 0) - print_traceback() - MPI_Abort(MPI_COMM_WORLD, 1) + try: print_traceback() + finally: MPI_Abort(MPI_COMM_WORLD, 1) cdef inline void op_user_call( int index, void *a, void *b, int *plen, MPI_Datatype *t) nogil: From 323683b117474f2702b1ba6fa782e3854dcd289c Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sun, 19 May 2013 22:24:47 +0300 Subject: [PATCH 53/56] Rework memory management for integer arrays --- src/MPI/Comm.pyx | 66 +++++++++++++++++++++++-------------------- src/MPI/Datatype.pyx | 8 +++--- src/MPI/Group.pyx | 7 +++-- src/MPI/Request.pyx | 26 +++++++++-------- src/MPI/asarray.pxi | 30 +++++++------------- src/MPI/asmemory.pxi | 6 ++-- src/MPI/commimpl.pxi | 4 +-- src/MPI/msgbuffer.pxi | 16 +++++------ test/arrayimpl.py | 12 +++++--- test/runtests.py | 11 ++++++++ test/test_datatype.py | 21 ++++++++++---- test/test_message.py | 44 ++++++++++++++++------------- test/test_op.py | 18 ++++++++---- 13 files changed, 154 insertions(+), 115 deletions(-) diff --git a/src/MPI/Comm.pyx b/src/MPI/Comm.pyx index be12a00..78446ff 100644 --- a/src/MPI/Comm.pyx +++ b/src/MPI/Comm.pyx @@ -1265,11 +1265,13 @@ cdef class Intracomm(Comm): """ Create cartesian communicator """ - cdef int ndims = 0, *idims = NULL - dims = getarray_int(dims, &ndims, &idims) - if periods is None: periods = [False] * ndims + cdef int ndims = 0 + ndims = len(dims) + cdef int *idims = NULL + dims = asarray_int(dims, ndims, &idims) cdef int *iperiods = NULL - periods = chkarray_int(periods, ndims, &iperiods) + if periods is None: periods = [False] * ndims + periods = asarray_int(periods, ndims, &iperiods) # cdef Cartcomm comm = Cartcomm.__new__(Cartcomm) with nogil: CHKERR( MPI_Cart_create( @@ -1330,10 +1332,11 @@ cdef class Intracomm(Comm): cdef int nv = 0, ne = 0, i = 0 cdef int *isource = NULL, *idegree = NULL, cdef int *idest = NULL, *iweight = MPI_UNWEIGHTED - sources = getarray_int(sources, &nv, &isource) - degrees = chkarray_int(degrees, nv, &idegree) + nv = len(sources) + sources = asarray_int(sources, nv, &isource) + degrees = asarray_int(degrees, nv, &idegree) for i from 0 <= i < nv: ne += idegree[i] - destinations = chkarray_int(destinations, ne, &idest) + destinations = asarray_int(destinations, ne, &idest) weights = asarray_weights(weights, ne, &iweight) cdef MPI_Info cinfo = arg_Info(info) # @@ -1600,7 +1603,7 @@ cdef class Intracomm(Comm): if args is not None: tmp1 = asarray_argv(args, &argv) if errcodes is not None: - tmp2 = newarray_int(maxprocs, &ierrcodes) + tmp2 = mkarray_int(maxprocs, &ierrcodes) # cdef Intercomm comm = Intercomm.__new__(Intercomm) with nogil: CHKERR( MPI_Comm_spawn( @@ -1627,7 +1630,7 @@ cdef class Intracomm(Comm): # cdef int rank = MPI_UNDEFINED CHKERR( MPI_Comm_rank(self.ob_mpi, &rank) ) - cdef object tmp1, tmp2, tmp3, tmp4, tmp5 + cdef tmp1, tmp2, tmp3, tmp4, tmp5 cdef Py_ssize_t i=0, n=0 if root == rank: count = len(command) @@ -1641,7 +1644,7 @@ cdef class Intracomm(Comm): tmp3 = asarray_nprocs(maxprocs, count, &imaxprocs) for i from 0 <= i < count: n += imaxprocs[i] - tmp5 = newarray_int(n, &ierrcodes) + tmp5 = mkarray_int(n, &ierrcodes) # cdef Intercomm comm = Intercomm.__new__(Intercomm) with nogil: CHKERR( MPI_Comm_spawn_multiple( @@ -1740,11 +1743,11 @@ cdef class Cartcomm(Intracomm): cdef int ndim = 0 CHKERR( MPI_Cartdim_get(self.ob_mpi, &ndim) ) cdef int *idims = NULL - cdef tmp1 = newarray_int(ndim, &idims) + cdef tmp1 = mkarray_int(ndim, &idims) cdef int *iperiods = NULL - cdef tmp2 = newarray_int(ndim, &iperiods) + cdef tmp2 = mkarray_int(ndim, &iperiods) cdef int *icoords = NULL - cdef tmp3 = newarray_int(ndim, &icoords) + cdef tmp3 = mkarray_int(ndim, &icoords) CHKERR( MPI_Cart_get(self.ob_mpi, ndim, idims, iperiods, icoords) ) cdef int i = 0 cdef object dims = [idims[i] for i from 0 <= i < ndim] @@ -1782,7 +1785,7 @@ cdef class Cartcomm(Intracomm): """ cdef int ndim = 0, *icoords = NULL CHKERR( MPI_Cartdim_get( self.ob_mpi, &ndim) ) - coords = chkarray_int(coords, ndim, &icoords) + coords = asarray_int(coords, ndim, &icoords) cdef int rank = MPI_PROC_NULL CHKERR( MPI_Cart_rank(self.ob_mpi, icoords, &rank) ) return rank @@ -1791,10 +1794,11 @@ cdef class Cartcomm(Intracomm): """ Translate ranks to logical coordinates """ - cdef int ndim = 0, *icoords = NULL + cdef int i = 0, ndim = 0, *icoords = NULL CHKERR( MPI_Cartdim_get(self.ob_mpi, &ndim) ) - cdef object coords = newarray_int(ndim, &icoords) + cdef tmp = mkarray_int(ndim, &icoords) CHKERR( MPI_Cart_coords(self.ob_mpi, rank, ndim, icoords) ) + cdef object coords = [icoords[i] for i from 0 <= i < ndim] return coords # Cartesian Shift Function @@ -1819,7 +1823,7 @@ cdef class Cartcomm(Intracomm): """ cdef int ndim = 0, *iremdims = NULL CHKERR( MPI_Cartdim_get(self.ob_mpi, &ndim) ) - remain_dims = chkarray_int(remain_dims, ndim, &iremdims) + remain_dims = asarray_int(remain_dims, ndim, &iremdims) cdef Cartcomm comm = Cartcomm.__new__(Cartcomm) with nogil: CHKERR( MPI_Cart_sub(self.ob_mpi, iremdims, &comm.ob_mpi) ) return comm @@ -1834,9 +1838,10 @@ cdef class Cartcomm(Intracomm): calling process on the physical machine """ cdef int ndims = 0, *idims = NULL, *iperiods = NULL - dims = getarray_int(dims, &ndims, &idims) + ndims = len(dims) + dims = asarray_int(dims, ndims, &idims) if periods is None: periods = [False] * ndims - periods = chkarray_int(periods, ndims, &iperiods) + periods = asarray_int(periods, ndims, &iperiods) cdef int rank = MPI_PROC_NULL CHKERR( MPI_Cart_map(self.ob_mpi, ndims, idims, iperiods, &rank) ) return rank @@ -1849,14 +1854,15 @@ def Compute_dims(int nnodes, dims): Return a balanced distribution of processes per coordinate direction """ - cdef int ndims=0, *idims = NULL + cdef int i = 0, ndims = 0, *idims = NULL try: ndims = len(dims) except: ndims = dims dims = [0] * ndims - dims = chkarray_int(dims, ndims, &idims) + cdef tmp = asarray_int(dims, ndims, &idims) CHKERR( MPI_Dims_create(nnodes, ndims, idims) ) + dims = [idims[i] for i from 0 <= i < ndims] return dims @@ -1906,9 +1912,9 @@ cdef class Graphcomm(Intracomm): cdef int nindex = 0, nedges = 0 CHKERR( MPI_Graphdims_get( self.ob_mpi, &nindex, &nedges) ) cdef int *iindex = NULL - cdef tmp1 = newarray_int(nindex, &iindex) + cdef tmp1 = mkarray_int(nindex, &iindex) cdef int *iedges = NULL - cdef tmp2 = newarray_int(nedges, &iedges) + cdef tmp2 = mkarray_int(nedges, &iedges) CHKERR( MPI_Graph_get(self.ob_mpi, nindex, nedges, iindex, iedges) ) cdef int i = 0 cdef object index = [iindex[i] for i from 0 <= i < nindex] @@ -1951,14 +1957,12 @@ cdef class Graphcomm(Intracomm): """ Return list of neighbors of a process """ - cdef int nneighbors = 0 + cdef int i = 0, nneighbors = 0, *ineighbors = NULL CHKERR( MPI_Graph_neighbors_count( self.ob_mpi, rank, &nneighbors) ) - cdef int *ineighbors = NULL - cdef tmp = newarray_int(nneighbors, &ineighbors) + cdef tmp = mkarray_int(nneighbors, &ineighbors) CHKERR( MPI_Graph_neighbors( self.ob_mpi, rank, nneighbors, ineighbors) ) - cdef int i = 0 cdef object neighbors = [ineighbors[i] for i from 0 <= i < nneighbors] return neighbors @@ -2027,13 +2031,13 @@ cdef class Distgraphcomm(Intracomm): cdef int *sourceweights = MPI_UNWEIGHTED cdef int *destweights = MPI_UNWEIGHTED cdef tmp1, tmp2, tmp3, tmp4 - tmp1 = newarray_int(maxindegree, &sources) - tmp2 = newarray_int(maxoutdegree, &destinations) + tmp1 = mkarray_int(maxindegree, &sources) + tmp2 = mkarray_int(maxoutdegree, &destinations) cdef int i = 0 if weighted: - tmp3 = newarray_int(maxindegree, &sourceweights) + tmp3 = mkarray_int(maxindegree, &sourceweights) for i from 0 <= i < maxindegree: sourceweights[i] = 1 - tmp4 = newarray_int(maxoutdegree, &destweights) + tmp4 = mkarray_int(maxoutdegree, &destweights) for i from 0 <= i < maxoutdegree: destweights[i] = 1 # CHKERR( MPI_Dist_graph_neighbors( diff --git a/src/MPI/Datatype.pyx b/src/MPI/Datatype.pyx index 5ac7872..69df40f 100644 --- a/src/MPI/Datatype.pyx +++ b/src/MPI/Datatype.pyx @@ -249,9 +249,9 @@ cdef class Datatype: """ cdef int ndims = 0, *isizes = NULL cdef int *isubsizes = NULL, *istarts = NULL - sizes = getarray_int(sizes, &ndims, &isizes ) - subsizes = chkarray_int(subsizes, ndims, &isubsizes) - starts = chkarray_int(starts, ndims, &istarts ) + sizes = getarray_int(sizes, &ndims, &isizes ) + subsizes = chkarray_int(subsizes, ndims, &isubsizes) + starts = chkarray_int(starts, ndims, &istarts ) cdef int iorder = MPI_ORDER_C if order is not None: iorder = order # @@ -428,7 +428,7 @@ cdef class Datatype: # get the datatype envelope cdef int ni = 0, na = 0, nd = 0, combiner = MPI_UNDEFINED CHKERR( MPI_Type_get_envelope(self.ob_mpi, &ni, &na, &nd, &combiner) ) - # return self immediatly for named datatypes + # return self immediately for named datatypes if combiner == MPI_COMBINER_NAMED: return self # get the datatype contents cdef int *i = NULL diff --git a/src/MPI/Group.pyx b/src/MPI/Group.pyx index 3aa318b..722a4c8 100644 --- a/src/MPI/Group.pyx +++ b/src/MPI/Group.pyx @@ -63,9 +63,9 @@ cdef class Group: """ cdef MPI_Group grp1 = MPI_GROUP_NULL cdef MPI_Group grp2 = MPI_GROUP_NULL - cdef int n = 0, *iranks1 = NULL, *iranks2 = NULL - cdef object ranks_ = getarray_int(ranks1, &n, &iranks1) - cdef object ranks2 = newarray_int(n, &iranks2) + cdef int i = 0, n = 0, *iranks1 = NULL, *iranks2 = NULL + cdef tmp1 = getarray_int(ranks1, &n, &iranks1) + cdef tmp2 = newarray_int(n, &iranks2) # grp1 = group1.ob_mpi if group2 is not None: @@ -79,6 +79,7 @@ cdef class Group: if group2 is None: CHKERR( MPI_Group_free(&grp2) ) # + cdef object ranks2 = [iranks2[i] for i from 0 <= i < n] return ranks2 @classmethod diff --git a/src/MPI/Request.pyx b/src/MPI/Request.pyx index a951092..9adc106 100644 --- a/src/MPI/Request.pyx +++ b/src/MPI/Request.pyx @@ -154,19 +154,21 @@ cdef class Request: cdef int outcount = MPI_UNDEFINED, *iindices = NULL cdef MPI_Status *istatuses = MPI_STATUSES_IGNORE # - cdef tmp = acquire_rs(requests, statuses, - &incount, &irequests, &istatuses) - cdef object indices = newarray_int(incount, &iindices) + cdef tmp1 = acquire_rs(requests, statuses, + &incount, &irequests, &istatuses) + cdef tmp2 = mkarray_int(incount, &iindices) try: with nogil: CHKERR( MPI_Waitsome( incount, irequests, &outcount, iindices, istatuses) ) finally: release_rs(requests, statuses, incount, irequests, istatuses) # + cdef int i = 0 + cdef object indices if outcount == MPI_UNDEFINED: - del indices[:] + indices = [] else: - del indices[outcount:] + indices = [iindices[i] for i from 0 <= i < outcount] return (outcount, indices) @classmethod @@ -174,24 +176,26 @@ cdef class Request: """ Test for completion of some previously initiated requests """ - cdef int incount = len(requests) + cdef int incount = 0 cdef MPI_Request *irequests = NULL cdef int outcount = MPI_UNDEFINED, *iindices = NULL cdef MPI_Status *istatuses = MPI_STATUSES_IGNORE # - cdef tmp = acquire_rs(requests, statuses, - &incount, &irequests, &istatuses) - cdef object indices = newarray_int(incount, &iindices) + cdef tmp1 = acquire_rs(requests, statuses, + &incount, &irequests, &istatuses) + cdef tmp2 = mkarray_int(incount, &iindices) try: with nogil: CHKERR( MPI_Testsome( incount, irequests, &outcount, iindices, istatuses) ) finally: release_rs(requests, statuses, incount, irequests, istatuses) # + cdef int i = 0 + cdef object indices if outcount == MPI_UNDEFINED: - del indices[:] + indices = [] else: - del indices[outcount:] + indices = [iindices[i] for i from 0 <= i < outcount] return (outcount, indices) # Cancel diff --git a/src/MPI/asarray.pxi b/src/MPI/asarray.pxi index ebdac34..66800f6 100644 --- a/src/MPI/asarray.pxi +++ b/src/MPI/asarray.pxi @@ -1,39 +1,29 @@ # ----------------------------------------------------------------------------- -cdef type arraytype -from array import array as arraytype - cdef inline object newarray_int(Py_ssize_t n, int **p): - cdef object ary = arraytype('i', [0]) - if n < 1: del ary[0] - if n > 1: ary *= n - cdef int *base = NULL - cdef Py_ssize_t size = 0 - if PYPY: - getbuffer_w(ary, &base, NULL) - else: - PyObject_AsWriteBuffer(ary, &base, &size) - if p != NULL: p[0] = base - return ary + return allocate(n, sizeof(int), p) cdef inline object getarray_int(object ob, int *n, int **p): cdef int *base = NULL cdef Py_ssize_t i = 0, size = len(ob) - cdef object ary = newarray_int(size, &base) + cdef object mem = newarray_int(size, &base) for i from 0 <= i < size: base[i] = ob[i] - if n != NULL: n[0] = size # XXX overflow? - if p != NULL: p[0] = base - return ary + n[0] = size # XXX overflow? + p[0] = base + return mem cdef inline object chkarray_int(object ob, Py_ssize_t size, int **p): cdef int n = 0 - cdef object ary = getarray_int(ob, &n, p) + cdef object mem = getarray_int(ob, &n, p) if size != n: raise ValueError( "expecting %d items, got %d" % (size, n)) - return ary + return mem # ----------------------------------------------------------------------------- +cdef inline object mkarray_int(Py_ssize_t size, int **p): + return allocate(size, sizeof(int), p) + cdef inline object asarray_int(object sequence, Py_ssize_t size, int **p): cdef int *array = NULL diff --git a/src/MPI/asmemory.pxi b/src/MPI/asmemory.pxi index c71a2a3..130607e 100644 --- a/src/MPI/asmemory.pxi +++ b/src/MPI/asmemory.pxi @@ -3,11 +3,11 @@ cdef extern from "Python.h": enum: PY_SSIZE_T_MAX void *PyMem_Malloc(size_t) - void *PyMem_Realloc(void *, size_t) - void PyMem_Free(void *) + void *PyMem_Realloc(void*, size_t) + void PyMem_Free(void*) cdef extern from "Python.h": - object PyLong_FromVoidPtr(void *) + object PyLong_FromVoidPtr(void*) void* PyLong_AsVoidPtr(object) #------------------------------------------------------------------------------ diff --git a/src/MPI/commimpl.pxi b/src/MPI/commimpl.pxi index 8dae654..90cb297 100644 --- a/src/MPI/commimpl.pxi +++ b/src/MPI/commimpl.pxi @@ -149,13 +149,13 @@ cdef object asarray_weights(object weights, int nweight, int **iweight): iweight[0] = MPI_WEIGHTS_EMPTY return None else: - return newarray_int(nweight, iweight) + return mkarray_int(nweight, iweight) # if weights is __UNWEIGHTED__: iweight[0] = MPI_UNWEIGHTED return None # - return chkarray_int(weights, nweight, iweight) + return asarray_int(weights, nweight, iweight) # ----------------------------------------------------------------------------- diff --git a/src/MPI/msgbuffer.pxi b/src/MPI/msgbuffer.pxi index a22080e..c874c47 100644 --- a/src/MPI/msgbuffer.pxi +++ b/src/MPI/msgbuffer.pxi @@ -254,30 +254,30 @@ cdef _p_message message_vector(object msg, "datatype extent %d (lb:%d, ub:%d)" ) % (bsize, extent, lb, lb+extent)) asize = bsize // extent - o_counts = newarray_int(blocks, &counts) + o_counts = mkarray_int(blocks, &counts) for i from 0 <= i < blocks: aval = (asize // blocks) + (asize % blocks > i) counts[i] = aval # XXX overflow? elif is_int(o_counts): val = o_counts - o_counts = newarray_int(blocks, &counts) + o_counts = mkarray_int(blocks, &counts) for i from 0 <= i < blocks: counts[i] = val else: - o_counts = chkarray_int(o_counts, blocks, &counts) + o_counts = asarray_int(o_counts, blocks, &counts) if o_displs is None: # contiguous val = 0 - o_displs = newarray_int(blocks, &displs) + o_displs = mkarray_int(blocks, &displs) for i from 0 <= i < blocks: displs[i] = val val += counts[i] elif is_int(o_displs): # strided val = o_displs - o_displs = newarray_int(blocks, &displs) + o_displs = mkarray_int(blocks, &displs) for i from 0 <= i < blocks: displs[i] = val * i else: # general - o_displs = chkarray_int(o_displs, blocks, &displs) + o_displs = asarray_int(o_displs, blocks, &displs) m.count = o_counts m.displ = o_displs # return collected message data @@ -674,11 +674,11 @@ cdef class _p_msg_cco: self.for_cro_send(smsg, 0) # get receive counts if rcnt is None and not inter and self.sbuf != MPI_IN_PLACE: - self._rcnt = newarray_int(size, &self.rcounts) + self._rcnt = mkarray_int(size, &self.rcounts) CHKERR( MPI_Allgather(&self.rcount, 1, MPI_INT, self.rcounts, 1, MPI_INT, comm) ) else: - self._rcnt = chkarray_int(rcnt, size, &self.rcounts) + self._rcnt = asarray_int(rcnt, size, &self.rcounts) # total sum or receive counts cdef int i=0, sumrcounts=0 for i from 0 <= i < size: diff --git a/test/arrayimpl.py b/test/arrayimpl.py index 4c77eed..c7c4530 100644 --- a/test/arrayimpl.py +++ b/test/arrayimpl.py @@ -6,10 +6,14 @@ h=MPI.SHORT, i=MPI.INT, l=MPI.LONG, - #q=MPI.LONG_LONG, + q=MPI.LONG_LONG, f=MPI.FLOAT, d=MPI.DOUBLE) +import sys +if sys.version_info[:2] < (3,3): + del TypeMap['q'] + if MPI.SIGNED_CHAR == MPI.DATATYPE_NULL: del TypeMap['b'] @@ -31,7 +35,7 @@ def mkshape(seq): class Array(array.array): - TypeMap = TypeMap + TypeMap = dict(TypeMap) def __new__(cls, arg, typecode, shape=None): if isinstance(arg, (int, float)): @@ -84,7 +88,7 @@ def as_mpi_v(self, cnt, dsp): class NumPy(object): - TypeMap = TypeMap + TypeMap = dict(TypeMap) def __init__(self, arg, typecode, shape=None): if isinstance(arg, (int, float, complex)): @@ -97,7 +101,7 @@ def __init__(self, arg, typecode, shape=None): else: ary[:] = arg try: - self.mpidtype = Array.TypeMap[typecode] + self.mpidtype = NumPy.TypeMap[typecode] except KeyError: self.mpidtype = MPI.DATATYPE_NULL diff --git a/test/runtests.py b/test/runtests.py index ad5f5c1..86d6122 100644 --- a/test/runtests.py +++ b/test/runtests.py @@ -40,6 +40,9 @@ def getoptionparser(): parser.add_option("--no-numpy", action="store_false", dest="numpy", default=True, help="disable testing with NumPy arrays") + parser.add_option("--no-array", + action="store_false", dest="array", default=True, + help="disable testing with builtin array.array") return parser def getbuilddir(): @@ -81,6 +84,12 @@ def writeln(self, message=''): _WritelnDecorator.writeln = writeln def import_package(options, pkgname): + # + if not options.numpy: + sys.modules['numpy'] = None + if not options.array: + sys.modules['array'] = None + # package = __import__(pkgname) # import mpi4py.rc @@ -148,6 +157,8 @@ def load_tests(options, args): exclude = re.compile('|'.join(options.exclude)).search if not options.numpy: sys.modules['numpy'] = None + if not options.array: + sys.modules['array'] = None for testfile in testfiles: filename = os.path.basename(testfile) testname = os.path.splitext(filename)[0] diff --git a/test/test_datatype.py b/test/test_datatype.py index 38123b5..6a9f16c 100644 --- a/test/test_datatype.py +++ b/test/test_datatype.py @@ -256,11 +256,22 @@ def testCommit(self): class TestGetAddress(unittest.TestCase): def testGetAddress(self): - from array import array - location = array('i', range(10)) - addr = MPI.Get_address(location) - bufptr, buflen = location.buffer_info() - self.assertEqual(addr, bufptr) + try: + from array import array + location = array('i', range(10)) + bufptr, _ = location.buffer_info() + addr = MPI.Get_address(location) + self.assertEqual(addr, bufptr) + except ImportError: + pass + try: + from numpy import asarray + location = asarray(range(10), dtype='i') + bufptr, _ = location.__array_interface__['data'] + addr = MPI.Get_address(location) + self.assertEqual(addr, bufptr) + except ImportError: + pass import sys _name, _version = MPI.get_vendor() diff --git a/test/test_message.py b/test/test_message.py index b0ffe49..1b419c3 100644 --- a/test/test_message.py +++ b/test/test_message.py @@ -2,6 +2,11 @@ import mpiunittest as unittest from arrayimpl import allclose +try: + import array + HAVE_ARRAY = True +except ImportError: + HAVE_ARRAY = False try: import numpy HAVE_NUMPY = True @@ -73,25 +78,26 @@ def _test4(self, equal, z, s, r, typecode): self.assertTrue(equal(z[:p], r[:p])) self.assertTrue(equal(z[q:], r[q:])) - def _testArray(self, test): - from array import array - from operator import eq as equal - for t in tuple(self.TYPECODES): - for n in range(1, 10): - z = array(t, [0]*n) - s = array(t, list(range(n))) - r = array(t, [0]*n) - test(equal, z, s, r, t) - def testArray1(self): - self._testArray(self._test1) - def testArray2(self): - self._testArray(self._test2) - def testArray31(self): - self._testArray(self._test31) - def testArray32(self): - self._testArray(self._test32) - def testArray4(self): - self._testArray(self._test4) + if HAVE_ARRAY: + def _testArray(self, test): + from array import array + from operator import eq as equal + for t in tuple(self.TYPECODES): + for n in range(1, 10): + z = array(t, [0]*n) + s = array(t, list(range(n))) + r = array(t, [0]*n) + test(equal, z, s, r, t) + def testArray1(self): + self._testArray(self._test1) + def testArray2(self): + self._testArray(self._test2) + def testArray31(self): + self._testArray(self._test31) + def testArray32(self): + self._testArray(self._test32) + def testArray4(self): + self._testArray(self._test4) if HAVE_NUMPY: def _testNumPy(self, test): diff --git a/test/test_op.py b/test/test_op.py index 5846723..effea2b 100644 --- a/test/test_op.py +++ b/test/test_op.py @@ -1,18 +1,23 @@ from mpi4py import MPI import mpiunittest as unittest -import array MPI_ERR_OP = MPI.ERR_OP +try: + import array +except ImportError: + array = None + try: bytes except NameError: bytes = str -try: - tobytes = array.array.tobytes -except AttributeError: - tobytes = array.array.tostring +if array: + try: + tobytes = array.array.tobytes + except AttributeError: + tobytes = array.array.tostring def frombytes(typecode, data): a = array.array(typecode,[]) @@ -114,5 +119,8 @@ def xor(x,y): return bool(x) ^ bool(y) self._test_call(MPI.NO_OP, (2,3), 2) self._test_call(MPI.NO_OP, (3,2), 3) +if not array: + del TestOp.testCreate + if __name__ == '__main__': unittest.main() From d08a04f9a634043b7a913632c19897a560fa45a5 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sun, 19 May 2013 22:37:19 +0300 Subject: [PATCH 54/56] Add option to testrunner --- test/runtests.py | 5 ++++- tox.ini | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/runtests.py b/test/runtests.py index 86d6122..b65a38e 100644 --- a/test/runtests.py +++ b/test/runtests.py @@ -17,6 +17,9 @@ def getoptionparser(): parser.add_option("-e", "--exclude", type="string", action="append", dest="exclude", default=[], help="exclude tests matching PATTERN", metavar="PATTERN") + parser.add_option("--no-builddir", + action="store_false", dest="builddir", default=True, + help="disable testing from build directory") parser.add_option("--path", type="string", action="append", dest="path", default=[], help="prepend PATH to sys.path", metavar="PATH") @@ -56,7 +59,7 @@ def getbuilddir(): def setup_python(options): rootdir = os.path.dirname(os.path.dirname(__file__)) builddir = os.path.join(rootdir, getbuilddir()) - if os.path.exists(builddir): + if options.builddir and os.path.exists(builddir): sys.path.insert(0, builddir) if options.path: path = options.path[:] diff --git a/tox.ini b/tox.ini index b00b51c..eff59ce 100644 --- a/tox.ini +++ b/tox.ini @@ -16,5 +16,4 @@ envlist = [testenv] deps = commands = - {envpython} setup.py -q clean --all - {envpython} {toxinidir}/test/runtests.py -q + {envpython} {toxinidir}/test/runtests.py --quiet --no-builddir [] From 6fa607521505ac21c4f615c44563743f23762425 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sun, 19 May 2013 23:28:42 +0300 Subject: [PATCH 55/56] Quick fix for previous commit --- src/MPI/commimpl.pxi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/MPI/commimpl.pxi b/src/MPI/commimpl.pxi index 90cb297..6b5d4af 100644 --- a/src/MPI/commimpl.pxi +++ b/src/MPI/commimpl.pxi @@ -144,12 +144,15 @@ cdef object asarray_weights(object weights, int nweight, int **iweight): iweight[0] = MPI_UNWEIGHTED return None # + cdef int i = 0 if weights is __WEIGHTS_EMPTY__: if MPI_WEIGHTS_EMPTY != MPI_UNWEIGHTED: iweight[0] = MPI_WEIGHTS_EMPTY return None else: - return mkarray_int(nweight, iweight) + weights = mkarray_int(nweight, iweight) + for i from 0 <= i < nweight: iweight[0][i] = 0 + return weights # if weights is __UNWEIGHTED__: iweight[0] = MPI_UNWEIGHTED From 0339f4294948bfb330374970cb99cbdf6d863b4f Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Tue, 21 May 2013 19:20:43 +0300 Subject: [PATCH 56/56] Add generalized all-to-all collectives --- src/MPI/Comm.pyx | 52 ++++++----------- src/MPI/msgbuffer.pxi | 125 ++++++++++++++++++++++++++++++++++++++++ test/test_cco_buf.py | 20 +++++++ test/test_cco_nb_vec.py | 20 +++++++ 4 files changed, 183 insertions(+), 34 deletions(-) diff --git a/src/MPI/Comm.pyx b/src/MPI/Comm.pyx index 78446ff..b04830d 100644 --- a/src/MPI/Comm.pyx +++ b/src/MPI/Comm.pyx @@ -638,15 +638,11 @@ cdef class Comm: Generalized All-to-All communication allowing different counts, displacements and datatypes for each partner """ - sendbuf = recvbuf = None - raise NotImplementedError # XXX implement! - cdef void *sbuf = NULL, *rbuf = NULL - cdef int *scounts = NULL, *rcounts = NULL - cdef int *sdispls = NULL, *rdispls = NULL - cdef MPI_Datatype *stypes = NULL, *rtypes = NULL + cdef _p_msg_ccow m = message_ccow() + m.for_alltoallw(sendbuf, recvbuf, self.ob_mpi) with nogil: CHKERR( MPI_Alltoallw( - sbuf, scounts, sdispls, stypes, - rbuf, rcounts, rdispls, rtypes, + m.sbuf, m.scounts, m.sdispls, m.stypes, + m.rbuf, m.rcounts, m.rdispls, m.rtypes, self.ob_mpi) ) @@ -835,18 +831,14 @@ cdef class Comm: """ Nonblocking Generalized All-to-All """ - sendbuf = recvbuf = None - raise NotImplementedError # XXX implement! - cdef void *sbuf = NULL, *rbuf = NULL - cdef int *scounts = NULL, *rcounts = NULL - cdef int *sdispls = NULL, *rdispls = NULL - cdef MPI_Datatype *stypes = NULL, *rtypes = NULL + cdef _p_msg_ccow m = message_ccow() + m.for_alltoallw(sendbuf, recvbuf, self.ob_mpi) cdef Request request = Request.__new__(Request) with nogil: CHKERR( MPI_Ialltoallw( - sbuf, scounts, sdispls, stypes, - rbuf, rcounts, rdispls, rtypes, + m.sbuf, m.scounts, m.sdispls, m.stypes, + m.rbuf, m.rcounts, m.rdispls, m.rtypes, self.ob_mpi, &request.ob_mpi) ) - request.ob_buf = None + request.ob_buf = m return request def Ireduce(self, sendbuf, recvbuf, Op op not None=SUM, int root=0): @@ -1481,15 +1473,11 @@ cdef class Intracomm(Comm): """ Neighbor All-to-All Generalized """ - sendbuf = recvbuf = None - raise NotImplementedError # XXX implement! - cdef void *sbuf = NULL, *rbuf = NULL - cdef int *scounts = NULL, *rcounts = NULL - cdef int *sdispls = NULL, *rdispls = NULL - cdef MPI_Datatype *stypes = NULL, *rtypes = NULL + cdef _p_msg_ccow m = message_ccow() + m.for_neighbor_alltoallw(sendbuf, recvbuf, self.ob_mpi) with nogil: CHKERR( MPI_Neighbor_alltoallw( - sbuf, scounts, sdispls, stypes, - rbuf, rcounts, rdispls, rtypes, + m.sbuf, m.scounts, m.sdisplsA, m.stypes, + m.rbuf, m.rcounts, m.rdisplsA, m.rtypes, self.ob_mpi) ) # Nonblocking Neighborhood Collectives @@ -1554,18 +1542,14 @@ cdef class Intracomm(Comm): """ Nonblocking Neighbor All-to-All Generalized """ - sendbuf = recvbuf = None - raise NotImplementedError # XXX implement! - cdef void *sbuf = NULL, *rbuf = NULL - cdef int *scounts = NULL, *rcounts = NULL - cdef int *sdispls = NULL, *rdispls = NULL - cdef MPI_Datatype *stypes = NULL, *rtypes = NULL + cdef _p_msg_ccow m = message_ccow() + m.for_neighbor_alltoallw(sendbuf, recvbuf, self.ob_mpi) cdef Request request = Request.__new__(Request) with nogil: CHKERR( MPI_Ineighbor_alltoallw( - sbuf, scounts, sdispls, stypes, - rbuf, rcounts, rdispls, rtypes, + m.sbuf, m.scounts, m.sdisplsA, m.stypes, + m.rbuf, m.rcounts, m.rdisplsA, m.rtypes, self.ob_mpi, &request.ob_mpi) ) - request.ob_buf = None + request.ob_buf = m return request # Python Communication diff --git a/src/MPI/msgbuffer.pxi b/src/MPI/msgbuffer.pxi index c874c47..f9b8833 100644 --- a/src/MPI/msgbuffer.pxi +++ b/src/MPI/msgbuffer.pxi @@ -287,6 +287,56 @@ cdef _p_message message_vector(object msg, _type[0] = btype return m +cdef tuple message_vecw_I(object msg, + int readonly, + int blocks, + # + void **_addr, + int **_counts, + int **_displs, + MPI_Datatype **_types, + ): + cdef Py_ssize_t nargs = len(msg) + if nargs == 3: + o_buffer, (o_counts, o_displs), o_types = msg + elif nargs == 4: + o_buffer, o_counts, o_displs, o_types = msg + else: + raise ValueError("message: expecting 3 to 4 items") + if readonly: + o_buffer = getbuffer_r(o_buffer, _addr, NULL) + else: + o_buffer = getbuffer_w(o_buffer, _addr, NULL) + o_counts = asarray_int(o_counts, blocks, _counts) + o_displs = asarray_int(o_displs, blocks, _displs) + o_types = asarray_Datatype(o_types, blocks, _types) + return (o_buffer, o_counts, o_displs, o_types) + +cdef tuple message_vecw_A(object msg, + int readonly, + int blocks, + # + void **_addr, + int **_counts, + MPI_Aint **_displs, + MPI_Datatype **_types, + ): + cdef Py_ssize_t nargs = len(msg) + if nargs == 3: + o_buffer, (o_counts, o_displs), o_types = msg + elif nargs == 4: + o_buffer, o_counts, o_displs, o_types = msg + else: + raise ValueError("message: expecting 3 to 4 items") + if readonly: + o_buffer = getbuffer_r(o_buffer, _addr, NULL) + else: + o_buffer = getbuffer_w(o_buffer, _addr, NULL) + o_counts = asarray_int(o_counts, blocks, _counts) + o_displs = asarray_Aint(o_displs, blocks, _displs) + o_types = asarray_Datatype(o_types, blocks, _types) + return (o_buffer, o_counts, o_displs, o_types) + #------------------------------------------------------------------------------ #@cython.final @@ -403,6 +453,7 @@ cdef class _p_msg_cco: sending = 1 else: self.for_cco_recv(0, msg, root, 0) + sending = 0 else: # inter-communication if ((root == MPI_ROOT) or (root == MPI_PROC_NULL)): @@ -410,6 +461,7 @@ cdef class _p_msg_cco: sending = 1 else: self.for_cco_recv(0, msg, root, 0) + sending = 0 if sending: self.rbuf = self.sbuf self.rcount = self.scount @@ -756,6 +808,79 @@ cdef inline _p_msg_cco message_cco(): #------------------------------------------------------------------------------ +#@cython.final +#@cython.internal +cdef class _p_msg_ccow: + + # raw C-side arguments + cdef void *sbuf, *rbuf + cdef int *scounts, *rcounts + cdef int *sdispls, *rdispls + cdef MPI_Aint *sdisplsA, *rdisplsA + cdef MPI_Datatype *stypes, *rtypes + # python-side arguments + cdef object _smsg, _rmsg + + def __cinit__(self): + self.sbuf = self.rbuf = NULL + self.scounts = self.rcounts = NULL + self.sdispls = self.rdispls = NULL + self.sdisplsA = self.rdisplsA = NULL + self.stypes = self.rtypes = NULL + + # alltoallw + cdef int for_alltoallw(self, + object smsg, object rmsg, + MPI_Comm comm) except -1: + if comm == MPI_COMM_NULL: return 0 + cdef int inter=0, size=0 + CHKERR( MPI_Comm_test_inter(comm, &inter) ) + if not inter: # intra-communication + CHKERR( MPI_Comm_size(comm, &size) ) + else: # inter-communication + CHKERR( MPI_Comm_remote_size(comm, &size) ) + # + self._rmsg = message_vecw_I( + rmsg, 0, size, + &self.rbuf, &self.rcounts, + &self.rdispls, &self.rtypes) + if not inter and smsg is __IN_PLACE__: + self.sbuf = MPI_IN_PLACE + self.scount = self.rcount + self.scounts = self.rcounts + self.sdispls = self.rdispls + self.stypes = self.rtypes + return 0 + self._smsg = message_vecw_I( + smsg, 1, size, + &self.sbuf, &self.scounts, + &self.sdispls, &self.stypes) + return 0 + + # neighbor alltoallw + cdef int for_neighbor_alltoallw(self, + object smsg, object rmsg, + MPI_Comm comm) except -1: + if comm == MPI_COMM_NULL: return 0 + cdef int sendsize=0, recvsize=0 + comm_neighbors_count(comm, &recvsize, &sendsize) + self._rmsg = message_vecw_A( + rmsg, 0, recvsize, + &self.rbuf, &self.rcounts, + &self.rdisplsA, &self.rtypes) + self._smsg = message_vecw_A( + smsg, 1, sendsize, + &self.sbuf, &self.scounts, + &self.sdisplsA, &self.stypes) + return 0 + + +cdef inline _p_msg_ccow message_ccow(): + cdef _p_msg_ccow msg = <_p_msg_ccow>_p_msg_ccow.__new__(_p_msg_ccow) + return msg + +#------------------------------------------------------------------------------ + #@cython.final #@cython.internal cdef class _p_msg_rma: diff --git a/test/test_cco_buf.py b/test/test_cco_buf.py index b1ae2c4..c154306 100644 --- a/test/test_cco_buf.py +++ b/test/test_cco_buf.py @@ -99,6 +99,26 @@ def testAlltoall(self): for value in rbuf.flat: self.assertEqual(value, root) + def testAlltoallw(self): + size = self.COMM.Get_size() + rank = self.COMM.Get_rank() + for array in arrayimpl.ArrayTypes: + for typecode in arrayimpl.TypeMap: + for n in range(1,size+1): + sbuf = array( n, typecode, (size, n)) + rbuf = array(-1, typecode, (size, n)) + sdt, rdt = sbuf.mpidtype, rbuf.mpidtype + sdsp = list(range(0, size*n*sdt.extent, n*sdt.extent)) + rdsp = list(range(0, size*n*rdt.extent, n*rdt.extent)) + smsg = (sbuf.as_raw(), ([n]*size, sdsp), [sdt]*size) + rmsg = (rbuf.as_raw(), ([n]*size, rdsp), [rdt]*size) + try: + self.COMM.Alltoallw(smsg, rmsg) + except NotImplementedError: + return + for value in rbuf.flat: + self.assertEqual(value, n) + def assertAlmostEqual(self, first, second): num = float(float(second-first)) den = float(second+first)/2 or 1.0 diff --git a/test/test_cco_nb_vec.py b/test/test_cco_nb_vec.py index e43a4b8..ddca2b0 100644 --- a/test/test_cco_nb_vec.py +++ b/test/test_cco_nb_vec.py @@ -285,6 +285,26 @@ def testAlltoallv3(self): for v in rbuf: self.assertEqual(v, root) + def testAlltoallw(self): + size = self.COMM.Get_size() + rank = self.COMM.Get_rank() + for array in arrayimpl.ArrayTypes: + for typecode in arrayimpl.TypeMap: + for n in range(1, size+1): + sbuf = array( n, typecode, (size, n)) + rbuf = array(-1, typecode, (size, n)) + sdt, rdt = sbuf.mpidtype, rbuf.mpidtype + sdsp = list(range(0, size*n*sdt.extent, n*sdt.extent)) + rdsp = list(range(0, size*n*rdt.extent, n*rdt.extent)) + smsg = (sbuf.as_raw(), ([n]*size, sdsp), [sdt]*size) + rmsg = (rbuf.as_raw(), ([n]*size, rdsp), [rdt]*size) + try: + self.COMM.Ialltoallw(smsg, rmsg).Wait() + except NotImplementedError: + return + for v in rbuf.flat: + self.assertEqual(v, n) + class TestCCOVecSelf(BaseTestCCOVec, unittest.TestCase): COMM = MPI.COMM_SELF