From 8fdb3d53247b3f6319a33b86f8a383b4da0f9c8d Mon Sep 17 00:00:00 2001 From: Evan Ramos Date: Fri, 2 Nov 2018 13:38:28 -0500 Subject: [PATCH] Wrap all RTS functions exposed to AMPI programs in special macros Split these macro-wrapped function declarations into separate headers for repeated inclusion using different definitions of the macros. No functional changes. Change-Id: I492edf98699330e82d1b7bdfceefaa2828bb6cb2 --- src/arch/common/special.sh | 5 +- src/arch/cuda/hybridAPI/hapi.h | 103 +-- src/arch/cuda/hybridAPI/hapi_functions.h | 55 ++ src/libs/ck-libs/ampi/Makefile | 6 +- src/libs/ck-libs/ampi/ampi.C | 2 +- src/libs/ck-libs/ampi/ampi.h | 748 ++------------------ src/libs/ck-libs/ampi/ampi_functions.h | 764 +++++++++++++++++++++ src/libs/ck-libs/ampi/ampi_noimpl.C | 166 +---- src/libs/ck-libs/ampi/ampiimpl.h | 37 +- src/libs/ck-libs/ampi/mpio_functions.h | 1 + src/libs/ck-libs/ampi/romio/README.AMPI | 5 + src/libs/ck-libs/ampi/romio/include/mpio.h.in | 570 +++------------ .../ck-libs/ampi/romio/include/mpio_functions.h | 368 ++++++++++ src/scripts/Makefile | 2 + src/util/pup_c.h | 81 +-- src/util/pup_c_functions.h | 77 +++ 16 files changed, 1540 insertions(+), 1450 deletions(-) create mode 100644 src/arch/cuda/hybridAPI/hapi_functions.h create mode 100644 src/libs/ck-libs/ampi/ampi_functions.h rewrite src/libs/ck-libs/ampi/ampi_noimpl.C (96%) create mode 100644 src/libs/ck-libs/ampi/mpio_functions.h rewrite src/libs/ck-libs/ampi/romio/include/mpio.h.in (84%) create mode 100644 src/libs/ck-libs/ampi/romio/include/mpio_functions.h create mode 100644 src/util/pup_c_functions.h diff --git a/src/arch/common/special.sh b/src/arch/common/special.sh index bce585caf4..db063f031c 100755 --- a/src/arch/common/special.sh +++ b/src/arch/common/special.sh @@ -13,7 +13,10 @@ then ./gathertree $SRCBASE/arch/cuda . # make links - test ! -f "../include/hapi_impl.h" && ./system_ln "../tmp/hybridAPI/hapi_impl.h" ../include && test ! -f "../include/hapi.h" && ./system_ln "../tmp/hybridAPI/hapi.h" ../include && test ! -f "../include/hapi_nvtx.h" && ./system_ln "../tmp/hybridAPI/hapi_nvtx.h" ../include + test ! -f "../include/hapi_impl.h" && ./system_ln "../tmp/hybridAPI/hapi_impl.h" ../include + test ! -f "../include/hapi_functions.h" && ./system_ln "../tmp/hybridAPI/hapi_functions.h" ../include + test ! -f "../include/hapi.h" && ./system_ln "../tmp/hybridAPI/hapi.h" ../include + test ! -f "../include/hapi_nvtx.h" && ./system_ln "../tmp/hybridAPI/hapi_nvtx.h" ../include #make library export CHARMINC=../include diff --git a/src/arch/cuda/hybridAPI/hapi.h b/src/arch/cuda/hybridAPI/hapi.h index 19d244cb6a..8e8896a814 100644 --- a/src/arch/cuda/hybridAPI/hapi.h +++ b/src/arch/cuda/hybridAPI/hapi.h @@ -1,9 +1,9 @@ #ifndef __HAPI_H_ #define __HAPI_H_ #include -#include -#include -#include + +/* See hapi_functions.h for the majority of function declarations provided + * by the Hybrid API. */ /******************** DEPRECATED ********************/ // HAPI wrappers whose behavior is controlled by user defined variables, @@ -21,6 +21,12 @@ # define hapiHostFree free #endif // HAPI_USE_CUDAMALLOCHOST +#ifdef __cplusplus + +#include +#include +#include + /******************** DEPRECATED ********************/ // Contains information about a device buffer, which is used by // the runtime to perform appropriate operations. Each hapiBufferInfo should @@ -194,51 +200,13 @@ typedef struct hapiWorkRequest { } hapiWorkRequest; -/******************** DEPRECATED ********************/ -// Create a hapiWorkRequest object for the user. The runtime manages the associated -// memory, so the user only needs to set it up properly. -hapiWorkRequest* hapiCreateWorkRequest(); - -/******************** DEPRECATED ********************/ -// Add a work request into the "queue". Currently all specified data transfers -// and kernel execution are directly put into a CUDA stream. -void hapiEnqueue(hapiWorkRequest* wr); - -// The runtime queries the compute capability of the device, and creates as -// many streams as the maximum number of concurrent kernels. -int hapiCreateStreams(); - -// Get a CUDA stream that was created by the runtime. Current scheme is to -// hand out streams in a round-robin fashion. -cudaStream_t hapiGetStream(); - -// Add a Charm++ callback function to be invoked after the previous operation -// in the stream completes. This call should be placed after data transfers or -// a kernel invocation. -void hapiAddCallback(cudaStream_t, void*, void* = NULL); - -// Thin wrappers for memory related CUDA API calls. -cudaError_t hapiMalloc(void**, size_t); -cudaError_t hapiFree(void*); -cudaError_t hapiMallocHost(void**, size_t); -cudaError_t hapiFreeHost(void*); -cudaError_t hapiMallocHostPool(void**, size_t); -cudaError_t hapiFreeHostPool(void*); -#ifdef __cplusplus -// Overloaded versions for C++ code -static inline cudaError_t hapiMallocHost(void** ptr, size_t size, bool pool) { - return pool ? hapiMallocHostPool(ptr, size) : hapiMallocHost(ptr, size); -} +#else /* defined __cplusplus */ -static inline cudaError_t hapiFreeHost(void* ptr, bool pool) { - return pool ? hapiFreeHostPool(ptr) : hapiFreeHost(ptr); -} -#endif -cudaError_t hapiMemcpyAsync(void*, const void*, size_t, cudaMemcpyKind, cudaStream_t); +/* In C mode, only declare the existence of C++ structs. */ +typedef struct hapiBufferInfo hapiBufferInfo; +typedef struct hapiWorkRequest hapiWorkRequest; -// Explicit memory allocations using pinned memory pool. -void* hapiPoolMalloc(size_t); -void hapiPoolFree(void*); +#endif /* defined __cplusplus */ // Provides support for detecting errors with CUDA API calls. #ifndef HAPI_CHECK_OFF @@ -246,21 +214,54 @@ void hapiPoolFree(void*); #else #define hapiCheck(code) code #endif -void hapiErrorDie(cudaError_t, const char*, const char*, int); #ifdef HAPI_INSTRUMENT_WRS -struct hapiRequestTimeInfo { +typedef struct hapiRequestTimeInfo { double transfer_time; double kernel_time; double cleanup_time; int n; +#ifdef __cplusplus hapiRequestTimeInfo() : transfer_time(0.0), kernel_time(0.0), cleanup_time(0.0), n(0) {} -}; +#endif /* defined __cplusplus */ +} hapiRequestTimeInfo; +#endif /* defined HAPI_INSTRUMENT_WRS */ -void hapiInitInstrument(int n_chares, char n_types); -hapiRequestTimeInfo* hapiQueryInstrument(int chare, char type, char phase); + +#ifndef AMPI_INTERNAL_SKIP_FUNCTIONS + +#define AMPI_CUSTOM_FUNC(return_type, function_name, ...) \ +extern return_type function_name(__VA_ARGS__); + +#ifdef __cplusplus +extern "C" { #endif +#include "hapi_functions.h" +#ifdef __cplusplus +} +#endif + +#undef AMPI_CUSTOM_FUNC + +#ifdef __cplusplus + +// Provide a C++-only stub for this function's default parameter. +static inline void hapiAddCallback(cudaStream_t a, void* b) { + hapiAddCallback(a, b, NULL); +} + +// Overloaded C++ wrappers for selecting whether to pool or not using a bool. +static inline cudaError_t hapiMallocHost(void** ptr, size_t size, bool pool) { + return pool ? hapiMallocHostPool(ptr, size) : hapiMallocHost(ptr, size); +} +static inline cudaError_t hapiFreeHost(void* ptr, bool pool) { + return pool ? hapiFreeHostPool(ptr) : hapiFreeHost(ptr); +} + +#endif /* defined __cplusplus */ + +#endif /* !defined AMPI_INTERNAL_SKIP_FUNCTIONS */ #endif // __HAPI_H_ diff --git a/src/arch/cuda/hybridAPI/hapi_functions.h b/src/arch/cuda/hybridAPI/hapi_functions.h new file mode 100644 index 0000000000..5be92d7248 --- /dev/null +++ b/src/arch/cuda/hybridAPI/hapi_functions.h @@ -0,0 +1,55 @@ +/* + * This file is separate from hapi.h because the Hybrid API is included as part + * of AMPI's extensions to the MPI standard, and certain global variable + * privatization methods require the AMPI API to be exposed as function pointers + * through a shim and loader mechanism that needs to list the entire set of + * provided functions at multiple points in its implementation. + * + * See src/libs/ck-libs/ampi/ampi_functions.h for mandatory procedures. + * + * For ease of reading: AMPI_CUSTOM_FUNC(ReturnType, FunctionName, Parameters...) + */ + +/******************** DEPRECATED ********************/ +// Create a hapiWorkRequest object for the user. The runtime manages the associated +// memory, so the user only needs to set it up properly. +AMPI_CUSTOM_FUNC(hapiWorkRequest*, hapiCreateWorkRequest, void) + +/******************** DEPRECATED ********************/ +// Add a work request into the "queue". Currently all specified data transfers +// and kernel execution are directly put into a CUDA stream. +AMPI_CUSTOM_FUNC(void, hapiEnqueue, hapiWorkRequest* wr) + +// The runtime queries the compute capability of the device, and creates as +// many streams as the maximum number of concurrent kernels. +AMPI_CUSTOM_FUNC(int, hapiCreateStreams, void) + +// Get a CUDA stream that was created by the runtime. Current scheme is to +// hand out streams in a round-robin fashion. +AMPI_CUSTOM_FUNC(cudaStream_t, hapiGetStream, void) + +// Add a Charm++ callback function to be invoked after the previous operation +// in the stream completes. This call should be placed after data transfers or +// a kernel invocation. +AMPI_CUSTOM_FUNC(void, hapiAddCallback, cudaStream_t, void*, void*) + +// Thin wrappers for memory related CUDA API calls. +AMPI_CUSTOM_FUNC(cudaError_t, hapiMalloc, void**, size_t) +AMPI_CUSTOM_FUNC(cudaError_t, hapiFree, void*) +AMPI_CUSTOM_FUNC(cudaError_t, hapiMallocHost, void**, size_t) +AMPI_CUSTOM_FUNC(cudaError_t, hapiFreeHost, void*) +AMPI_CUSTOM_FUNC(cudaError_t, hapiMallocHostPool, void**, size_t) +AMPI_CUSTOM_FUNC(cudaError_t, hapiFreeHostPool, void*) +AMPI_CUSTOM_FUNC(cudaError_t, hapiMemcpyAsync, void*, const void*, size_t, enum cudaMemcpyKind, cudaStream_t) + +// Explicit memory allocations using pinned memory pool. +AMPI_CUSTOM_FUNC(void*, hapiPoolMalloc, size_t) +AMPI_CUSTOM_FUNC(void, hapiPoolFree, void*) + +// Provides support for detecting errors with CUDA API calls. +AMPI_CUSTOM_FUNC(void, hapiErrorDie, cudaError_t, const char*, const char*, int) + +#ifdef HAPI_INSTRUMENT_WRS +AMPI_CUSTOM_FUNC(void, hapiInitInstrument, int n_chares, char n_types) +AMPI_CUSTOM_FUNC(hapiRequestTimeInfo*, hapiQueryInstrument, int chare, char type, char phase) +#endif diff --git a/src/libs/ck-libs/ampi/Makefile b/src/libs/ck-libs/ampi/Makefile index 1e185271ee..9e84037355 100644 --- a/src/libs/ck-libs/ampi/Makefile +++ b/src/libs/ck-libs/ampi/Makefile @@ -2,7 +2,9 @@ CDIR := $(shell cd ../../../.. && pwd) -include $(CDIR)/include/conv-mach-opt.mak CHARMC=$(CDIR)/bin/charmc $(OPTS) -HEADERS=ampi.h ampif.h mpio.h mpiof.h ampiimpl.h ampi-interoperate.h ampi.decl.h +HEADERS=ampi.h ampif.h mpio.h mpiof.h ampiimpl.h \ + ampi-interoperate.h ampi.decl.h \ + ampi_functions.h mpio_functions.h HEADDEP=$(HEADERS) ampiimpl.h ddt.h \ ../tcharm/tcharm.h ../tcharm/tcharm_impl.h COMPAT=compat_ampius.o compat_ampifus.o compat_ampi.o \ @@ -49,7 +51,7 @@ $(ROMIO): | AMPI AMPIF --enable-f77=`test -f $(DESTF) && echo yes || echo no` \ --srcdir=`pwd` - cp romio/include/mpio.h romio/include/mpiof.h $(CDIR)/include + cp romio/include/mpio.h romio/include/mpiof.h romio/include/mpio_functions.h $(CDIR)/include $(MAKE) -C romio cp romio/lib/libmpio.a $@ if [ -n "$(ROMIOLIBSHARED)" ]; then \ diff --git a/src/libs/ck-libs/ampi/ampi.C b/src/libs/ck-libs/ampi/ampi.C index fa6a6861f0..8932e319f1 100644 --- a/src/libs/ck-libs/ampi/ampi.C +++ b/src/libs/ck-libs/ampi/ampi.C @@ -11497,7 +11497,7 @@ int AMPI_GPU_Iinvoke(cudaStream_t stream, MPI_Request *request) // A callback that completes the corresponding request CkCallback *cb = new CkCallback(&I_GPU_complete, newreq); - hapiAddCallback(stream, cb); + hapiAddCallback(stream, cb, NULL); } CLINKAGE diff --git a/src/libs/ck-libs/ampi/ampi.h b/src/libs/ck-libs/ampi/ampi.h index a5ac5c7d5a..ee7a16cc88 100644 --- a/src/libs/ck-libs/ampi/ampi.h +++ b/src/libs/ck-libs/ampi/ampi.h @@ -3,30 +3,35 @@ #include /* for redefinition of exit() below */ #include /* for intptr_t */ -#include "conv-config.h" -#include "charm-api.h" /* for CLINKAGE */ +#include "charm-api.h" + +#define AMPI_INTERNAL_SKIP_FUNCTIONS -#ifdef __cplusplus #if CMK_CUDA #include "hapi.h" #endif -#endif /* NON-standard define: this lets people #ifdef on AMPI, e.g. to portably use AMPI extensions to the MPI standard. */ #define AMPI -/* Macro to define the AMPI'fied name of an MPI function, plus the AMPI'fied - * PMPI name. When building Charm++/AMPI on top of MPI, we rename the user's - * MPI_ calls to use AMPI_. */ -#if CMK_CONVERSE_MPI - #define AMPI_API_DEF(return_type, function_name, ...) \ - return_type A##function_name(__VA_ARGS__); \ - return_type AP##function_name(__VA_ARGS__); +/* Declare the conditions under which AMPI supports PMPI. */ +#if defined(__linux__) +# define AMPI_HAVE_PMPI 1 #else +# define AMPI_HAVE_PMPI 0 +#endif + +/* Macros to define the AMPI'fied name of an MPI function, plus the AMPI'fied + * PMPI name. */ +#define AMPI_CUSTOM_API_DEF(return_type, function_name, ...) \ + extern return_type function_name(__VA_ARGS__); +#if AMPI_HAVE_PMPI #define AMPI_API_DEF(return_type, function_name, ...) \ - return_type function_name(__VA_ARGS__); \ - return_type P##function_name(__VA_ARGS__); + extern return_type function_name(__VA_ARGS__); \ + extern return_type P##function_name(__VA_ARGS__); +#else + #define AMPI_API_DEF AMPI_CUSTOM_API_DEF #endif #ifdef __cplusplus @@ -37,7 +42,6 @@ # define AMPI_API_REINTERPRET_CAST(type, obj) ((type)(obj)) #endif -CLINKAGE void AMPI_Exit(int exitCode); /* Allow applications to terminate cleanly with exit(): * In C++ applications, this can conflict with user-defined * exit routines inside namespaces, such as Foo::exit(), so @@ -52,7 +56,6 @@ CLINKAGE void AMPI_Exit(int exitCode); /* Notify AMPI when atexit() is used in order to prevent running MPI_Finalize() in a function registered with atexit. Only applies when including mpi.h. */ -CLINKAGE void ampiMarkAtexit(void); #ifndef AMPI_RENAME_ATEXIT #define AMPI_RENAME_ATEXIT 1 #endif @@ -85,7 +88,6 @@ typedef intptr_t MPI_Aint; typedef int MPI_Fint; typedef MPI_Aint MPI_Count; typedef long long int MPI_Offset; -#define HAVE_MPI_OFFSET 1 /* ROMIO requires us to set this */ /********************** MPI-1.1 prototypes and defines ***************************/ /* MPI-1 Errors */ @@ -370,31 +372,11 @@ typedef int (MPI_Copy_function)(MPI_Comm oldcomm, int keyval, typedef int (MPI_Delete_function)(MPI_Comm comm, int keyval, void *attribute_val, void *extra_state); -#define MPI_COMM_NULL_COPY_FN MPI_comm_null_copy_fn -#define MPI_COMM_NULL_DELETE_FN MPI_comm_null_delete_fn -#define MPI_COMM_DUP_FN MPI_comm_dup_fn - -#define MPI_NULL_COPY_FN MPI_comm_null_copy_fn -#define MPI_NULL_DELETE_FN MPI_comm_null_delete_fn -#define MPI_DUP_FN MPI_comm_dup_fn - -int MPI_COMM_NULL_COPY_FN ( MPI_Comm, int, void *, void *, void *, int * ); -int MPI_COMM_NULL_DELETE_FN ( MPI_Comm, int, void *, void * ); -int MPI_COMM_DUP_FN ( MPI_Comm, int, void *, void *, void *, int * ); - typedef int MPI_Type_copy_attr_function(MPI_Datatype oldtype, int type_keyval, void *extra_state, void *attribute_val_in, void *attribute_val_out, int *flag); typedef int MPI_Type_delete_attr_function(MPI_Datatype datatype, int type_keyval, void *attribute_val, void *extra_state); -#define MPI_TYPE_NULL_DELETE_FN MPI_type_null_delete_fn -#define MPI_TYPE_NULL_COPY_FN MPI_type_null_copy_fn -#define MPI_TYPE_DUP_FN MPI_type_dup_fn - -int MPI_TYPE_NULL_COPY_FN ( MPI_Datatype, int, void *, void *, void *, int * ); -int MPI_TYPE_NULL_DELETE_FN ( MPI_Datatype, int, void *, void * ); -int MPI_TYPE_DUP_FN ( MPI_Datatype, int, void *, void *, void *, int * ); - typedef int MPI_Grequest_query_function(void *extra_state, MPI_Status *status); typedef int MPI_Grequest_free_function(void *extra_state); typedef int MPI_Grequest_cancel_function(void *extra_state, int complete); @@ -1170,387 +1152,11 @@ typedef void (*MPI_MigrateFn)(void); #endif //CMK_CONVERSE_MPI -/***pt2pt***/ -AMPI_API_DEF(int, MPI_Send, const void *msg, int count, MPI_Datatype type, int dest, - int tag, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Ssend, const void *msg, int count, MPI_Datatype type, int dest, - int tag, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Recv, void *msg, int count, MPI_Datatype type, int src, int tag, - MPI_Comm comm, MPI_Status *status) -AMPI_API_DEF(int, MPI_Mrecv, void* buf, int count, MPI_Datatype datatype, MPI_Message *message, - MPI_Status *status) -AMPI_API_DEF(int, MPI_Get_count, const MPI_Status *sts, MPI_Datatype dtype, int *count) -AMPI_API_DEF(int, MPI_Bsend, const void *buf, int count, MPI_Datatype datatype, - int dest, int tag,MPI_Comm comm) -AMPI_API_DEF(int, MPI_Rsend, const void *buf, int count, MPI_Datatype datatype, - int dest, int tag,MPI_Comm comm) -AMPI_API_DEF(int, MPI_Buffer_attach, void *buffer, int size) -AMPI_API_DEF(int, MPI_Buffer_detach, void *buffer, int *size) -AMPI_API_DEF(int, MPI_Isend, const void *buf, int count, MPI_Datatype datatype, int dest, - int tag, MPI_Comm comm, MPI_Request *request) -AMPI_API_DEF(int, MPI_Ibsend, const void *buf, int count, MPI_Datatype datatype, int dest, - int tag, MPI_Comm comm, MPI_Request *request) -AMPI_API_DEF(int, MPI_Issend, const void *buf, int count, MPI_Datatype datatype, int dest, - int tag, MPI_Comm comm, MPI_Request *request) -AMPI_API_DEF(int, MPI_Irsend, const void *buf, int count, MPI_Datatype datatype, int dest, - int tag, MPI_Comm comm, MPI_Request *request) -AMPI_API_DEF(int, MPI_Irecv, void *buf, int count, MPI_Datatype datatype, int src, - int tag, MPI_Comm comm, MPI_Request *request) -AMPI_API_DEF(int, MPI_Imrecv, void* buf, int count, MPI_Datatype datatype, MPI_Message *message, - MPI_Request *request) -AMPI_API_DEF(int, MPI_Wait, MPI_Request *request, MPI_Status *sts) -AMPI_API_DEF(int, MPI_Test, MPI_Request *request, int *flag, MPI_Status *sts) -AMPI_API_DEF(int, MPI_Waitany, int count, MPI_Request *request, int *index, MPI_Status *sts) -AMPI_API_DEF(int, MPI_Testany, int count, MPI_Request *request, int *index, int *flag, MPI_Status *status) -AMPI_API_DEF(int, MPI_Waitall, int count, MPI_Request *request, MPI_Status *sts) -AMPI_API_DEF(int, MPI_Testall, int count, MPI_Request *request, int *flag, MPI_Status *sts) -AMPI_API_DEF(int, MPI_Waitsome, int incount, MPI_Request *array_of_requests, int *outcount, - int *array_of_indices, MPI_Status *array_of_statuses) -AMPI_API_DEF(int, MPI_Testsome, int incount, MPI_Request *array_of_requests, int *outcount, - int *array_of_indices, MPI_Status *array_of_statuses) -AMPI_API_DEF(int, MPI_Request_get_status, MPI_Request request, int *flag, MPI_Status *sts) -AMPI_API_DEF(int, MPI_Request_free, MPI_Request *request) -AMPI_API_DEF(int, MPI_Grequest_start, MPI_Grequest_query_function *query_fn, MPI_Grequest_free_function *free_fn,\ - MPI_Grequest_cancel_function *cancel_fn, void *extra_state, MPI_Request *request) -AMPI_API_DEF(int, MPI_Grequest_complete, MPI_Request request) -AMPI_API_DEF(int, MPI_Cancel, MPI_Request *request) -AMPI_API_DEF(int, MPI_Test_cancelled, const MPI_Status *status, int *flag) /* FIXME: always returns success */ -AMPI_API_DEF(int, MPI_Status_set_cancelled, MPI_Status *status, int flag) -AMPI_API_DEF(int, MPI_Iprobe, int src, int tag, MPI_Comm comm, int *flag, MPI_Status *sts) -AMPI_API_DEF(int, MPI_Probe, int source, int tag, MPI_Comm comm, MPI_Status *sts) -AMPI_API_DEF(int, MPI_Improbe, int source, int tag, MPI_Comm comm, int *flag, - MPI_Message *message, MPI_Status *status) -AMPI_API_DEF(int, MPI_Mprobe, int source, int tag, MPI_Comm comm, MPI_Message *message, - MPI_Status *status) -AMPI_API_DEF(int, MPI_Send_init, const void *buf, int count, MPI_Datatype type, int dest, int tag, - MPI_Comm comm, MPI_Request *req) -AMPI_API_DEF(int, MPI_Ssend_init, const void *buf, int count, MPI_Datatype type, int dest, int tag, - MPI_Comm comm, MPI_Request *req) -AMPI_API_DEF(int, MPI_Rsend_init, const void *buf, int count, MPI_Datatype type, int dest, int tag, - MPI_Comm comm, MPI_Request *req) -AMPI_API_DEF(int, MPI_Bsend_init, const void *buf, int count, MPI_Datatype type, int dest, int tag, - MPI_Comm comm, MPI_Request *req) -AMPI_API_DEF(int, MPI_Recv_init, void *buf, int count, MPI_Datatype type, int src, int tag, - MPI_Comm comm, MPI_Request *req) -AMPI_API_DEF(int, MPI_Start, MPI_Request *reqnum) -AMPI_API_DEF(int, MPI_Startall, int count, MPI_Request *array_of_requests) -AMPI_API_DEF(int, MPI_Sendrecv, const void *sbuf, int scount, MPI_Datatype stype, int dest, - int stag, void *rbuf, int rcount, MPI_Datatype rtype, - int src, int rtag, MPI_Comm comm, MPI_Status *sts) -AMPI_API_DEF(int, MPI_Sendrecv_replace, void* buf, int count, MPI_Datatype datatype, - int dest, int sendtag, int source, int recvtag, - MPI_Comm comm, MPI_Status *status) /***datatypes***/ -AMPI_API_DEF(int, MPI_Type_contiguous, int count, MPI_Datatype oldtype, - MPI_Datatype *newtype) -AMPI_API_DEF(int, MPI_Type_vector, int count, int blocklength, int stride, - MPI_Datatype oldtype, MPI_Datatype *newtype) -AMPI_API_DEF(int, MPI_Type_create_hvector, int count, int blocklength, MPI_Aint stride, - MPI_Datatype oldtype, MPI_Datatype *newtype) -AMPI_API_DEF(int, MPI_Type_hvector, int count, int blocklength, MPI_Aint stride, - MPI_Datatype oldtype, MPI_Datatype *newtype) -AMPI_API_DEF(int, MPI_Type_indexed, int count, const int* arrBlength, const int* arrDisp, - MPI_Datatype oldtype, MPI_Datatype *newtype) -AMPI_API_DEF(int, MPI_Type_create_hindexed, int count, const int* arrBlength, const MPI_Aint* arrDisp, - MPI_Datatype oldtype, MPI_Datatype *newtype) -AMPI_API_DEF(int, MPI_Type_create_indexed_block, int count, int Blength, const int *arrDisp, - MPI_Datatype oldtype, MPI_Datatype *newtype) -AMPI_API_DEF(int, MPI_Type_create_hindexed_block, int count, int Blength, const MPI_Aint *arrDisp, - MPI_Datatype oldtype, MPI_Datatype *newtype) -AMPI_API_DEF(int, MPI_Type_hindexed, int count, int* arrBlength, MPI_Aint* arrDisp, - MPI_Datatype oldtype, MPI_Datatype *newtype) -AMPI_API_DEF(int, MPI_Type_create_struct, int count, const int* arrBLength, const MPI_Aint* arrDisp, - const MPI_Datatype *oldType, MPI_Datatype *newType) -AMPI_API_DEF(int, MPI_Type_struct, int count, int* arrBLength, MPI_Aint* arrDisp, - MPI_Datatype *oldType, MPI_Datatype *newType) -AMPI_API_DEF(int, MPI_Type_get_envelope, MPI_Datatype datatype, int *num_integers, int *num_addresses, - int *num_datatypes, int *combiner) -AMPI_API_DEF(int, MPI_Type_get_contents, MPI_Datatype datatype, int max_integers, int max_addresses, - int max_datatypes, int array_of_integers[], MPI_Aint array_of_addresses[], - MPI_Datatype array_of_datatypes[]) -AMPI_API_DEF(int, MPI_Type_commit, MPI_Datatype *datatype) -AMPI_API_DEF(int, MPI_Type_free, MPI_Datatype *datatype) -AMPI_API_DEF(int, MPI_Type_get_extent, MPI_Datatype datatype, MPI_Aint *lb, MPI_Aint *extent) -AMPI_API_DEF(int, MPI_Type_get_extent_x, MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent) -AMPI_API_DEF(int, MPI_Type_extent, MPI_Datatype datatype, MPI_Aint *extent) -AMPI_API_DEF(int, MPI_Type_get_true_extent, MPI_Datatype datatype, MPI_Aint *true_lb, MPI_Aint *true_extent) -AMPI_API_DEF(int, MPI_Type_get_true_extent_x, MPI_Datatype datatype, MPI_Count *true_lb, MPI_Count *true_extent) -AMPI_API_DEF(int, MPI_Type_size, MPI_Datatype datatype, int *size) -AMPI_API_DEF(int, MPI_Type_size_x, MPI_Datatype datatype, MPI_Count *size) -AMPI_API_DEF(int, MPI_Type_lb, MPI_Datatype datatype, MPI_Aint* displacement) -AMPI_API_DEF(int, MPI_Type_ub, MPI_Datatype datatype, MPI_Aint* displacement) -AMPI_API_DEF(int, MPI_Type_set_name, MPI_Datatype datatype, const char *name) -AMPI_API_DEF(int, MPI_Type_get_name, MPI_Datatype datatype, char *name, int *resultlen) -AMPI_API_DEF(int, MPI_Type_dup, MPI_Datatype oldtype, MPI_Datatype *newtype) -AMPI_API_DEF(int, MPI_Type_create_resized, MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint extent, MPI_Datatype *newtype) -AMPI_API_DEF(int, MPI_Type_set_attr, MPI_Datatype datatype, int type_keyval, void *attribute_val) -AMPI_API_DEF(int, MPI_Type_get_attr, MPI_Datatype datatype, int type_keyval, void *attribute_val, int *flag) -AMPI_API_DEF(int, MPI_Type_delete_attr, MPI_Datatype datatype, int type_keyval) -AMPI_API_DEF(int, MPI_Type_create_keyval, MPI_Type_copy_attr_function *type_copy_attr_fn, - MPI_Type_delete_attr_function *type_delete_attr_fn, - int *type_keyval, void *extra_state) -AMPI_API_DEF(int, MPI_Type_free_keyval, int *type_keyval) -AMPI_API_DEF(int, MPI_Type_create_darray, int size, int rank, int ndims, - const int array_of_gsizes[], const int array_of_distribs[], - const int array_of_dargs[], const int array_of_psizes[], - int order, MPI_Datatype oldtype, MPI_Datatype *newtype) -AMPI_API_DEF(int, MPI_Type_create_subarray, int ndims, const int array_of_sizes[], - const int array_of_subsizes[], const int array_of_starts[], int order, - MPI_Datatype oldtype, MPI_Datatype *newtype) -AMPI_API_DEF(int, MPI_Get_address, const void* location, MPI_Aint *address) -AMPI_API_DEF(int, MPI_Address, void* location, MPI_Aint *address) -AMPI_API_DEF(int, MPI_Status_set_elements, MPI_Status *status, MPI_Datatype datatype, int count) -AMPI_API_DEF(int, MPI_Status_set_elements_x, MPI_Status *status, MPI_Datatype datatype, MPI_Count count) -AMPI_API_DEF(int, MPI_Get_elements, const MPI_Status *status, MPI_Datatype datatype, int *count) -AMPI_API_DEF(int, MPI_Get_elements_x, const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count) -AMPI_API_DEF(int, MPI_Pack, const void *inbuf, int incount, MPI_Datatype dtype, void *outbuf, - int outsize, int *position, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Unpack, const void *inbuf, int insize, int *position, void *outbuf, - int outcount, MPI_Datatype dtype, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Pack_size, int incount,MPI_Datatype datatype,MPI_Comm comm,int *sz) #define MPI_Aint_add(addr, disp) ((MPI_Aint)((char*)(addr) + (disp))) #define MPI_Aint_diff(addr1, addr2) ((MPI_Aint)((char*)(addr1) - (char*)(addr2))) -/***collectives***/ -AMPI_API_DEF(int, MPI_Barrier, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Ibarrier, MPI_Comm comm, MPI_Request *request) -AMPI_API_DEF(int, MPI_Bcast, void *buf, int count, MPI_Datatype type, int root, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Ibcast, void *buf, int count, MPI_Datatype type, int root, MPI_Comm comm, - MPI_Request *request) -AMPI_API_DEF(int, MPI_Gather, const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - int root, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Igather, const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - int root, MPI_Comm comm, MPI_Request *request) -AMPI_API_DEF(int, MPI_Gatherv, const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, const int *recvcounts, const int *displs, - MPI_Datatype recvtype, int root, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Igatherv, const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, const int *recvcounts, const int *displs, - MPI_Datatype recvtype, int root, MPI_Comm comm, - MPI_Request *request) -AMPI_API_DEF(int, MPI_Scatter, const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - int root, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Iscatter, const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - int root, MPI_Comm comm, MPI_Request *request) -AMPI_API_DEF(int, MPI_Scatterv, const void *sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - int root, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Iscatterv, const void *sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - int root, MPI_Comm comm, MPI_Request *request) -AMPI_API_DEF(int, MPI_Allgather, const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm) -AMPI_API_DEF(int, MPI_Iallgather, const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm, MPI_Request* request) -AMPI_API_DEF(int, MPI_Allgatherv, const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, const int *recvcounts, const int *displs, - MPI_Datatype recvtype, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Iallgatherv, const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, const int *recvcounts, const int *displs, - MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request) -AMPI_API_DEF(int, MPI_Alltoall, const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm) -AMPI_API_DEF(int, MPI_Ialltoall, const void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm, MPI_Request *request) -AMPI_API_DEF(int, MPI_Alltoallv, const void *sendbuf, const int *sendcounts, const int *sdispls, - MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, - const int *rdispls, MPI_Datatype recvtype, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Ialltoallv, void *sendbuf, int *sendcounts, int *sdispls, - MPI_Datatype sendtype, void *recvbuf, int *recvcounts, - int *rdispls, MPI_Datatype recvtype, MPI_Comm comm, - MPI_Request *request) -AMPI_API_DEF(int, MPI_Alltoallw, const void *sendbuf, const int *sendcounts, const int *sdispls, - const MPI_Datatype *sendtypes, void *recvbuf, const int *recvcounts, - const int *rdispls, const MPI_Datatype *recvtypes, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Ialltoallw, const void *sendbuf, const int *sendcounts, const int *sdispls, - const MPI_Datatype *sendtypes, void *recvbuf, const int *recvcounts, - const int *rdispls, const MPI_Datatype *recvtypes, MPI_Comm comm, - MPI_Request *request) -AMPI_API_DEF(int, MPI_Reduce, const void *inbuf, void *outbuf, int count, MPI_Datatype type, - MPI_Op op, int root, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Ireduce, const void *sendbuf, void *recvbuf, int count, MPI_Datatype type, - MPI_Op op, int root, MPI_Comm comm, MPI_Request *request) -AMPI_API_DEF(int, MPI_Allreduce, const void *inbuf, void *outbuf, int count, MPI_Datatype type, - MPI_Op op, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Iallreduce, const void *inbuf, void *outbuf, int count, MPI_Datatype type, - MPI_Op op, MPI_Comm comm, MPI_Request *request) -AMPI_API_DEF(int, MPI_Reduce_local, const void *inbuf, void *outbuf, int count, - MPI_Datatype datatype, MPI_Op op) -AMPI_API_DEF(int, MPI_Reduce_scatter_block, const void* sendbuf, void* recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Ireduce_scatter_block, const void* sendbuf, void* recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request) -AMPI_API_DEF(int, MPI_Reduce_scatter, const void* sendbuf, void* recvbuf, const int *recvcounts, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Ireduce_scatter, const void* sendbuf, void* recvbuf, const int *recvcounts, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request) -AMPI_API_DEF(int, MPI_Scan, const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, - MPI_Op op, MPI_Comm comm ) -AMPI_API_DEF(int, MPI_Iscan, const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, - MPI_Op op, MPI_Comm comm, MPI_Request *request) -AMPI_API_DEF(int, MPI_Exscan, const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, - MPI_Op op, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Iexscan, const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, - MPI_Op op, MPI_Comm comm, MPI_Request *request) - -/***neighborhood collectives***/ -AMPI_API_DEF(int, MPI_Neighbor_alltoall, const void* sendbuf, int sendcount, MPI_Datatype sendtype, - void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Ineighbor_alltoall, const void* sendbuf, int sendcount, MPI_Datatype sendtype, - void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, - MPI_Request* request) -AMPI_API_DEF(int, MPI_Neighbor_alltoallv, const void* sendbuf, const int* sendcounts, const int* sdispls, - MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, const int* rdispls, - MPI_Datatype recvtype, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Ineighbor_alltoallv, const void* sendbuf, const int* sendcounts, const int* sdispls, - MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, const int* rdispls, - MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request) -AMPI_API_DEF(int, MPI_Neighbor_alltoallw, const void* sendbuf, const int* sendcounts, const MPI_Aint* sdipls, - const MPI_Datatype* sendtypes, void* recvbuf, const int* recvcounts, const MPI_Aint* rdispls, - const MPI_Datatype* recvtypes, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Ineighbor_alltoallw, const void* sendbuf, const int* sendcounts, const MPI_Aint* sdispls, - const MPI_Datatype* sendtypes, void* recvbuf, const int* recvcounts, const MPI_Aint* rdispls, - const MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request* request) -AMPI_API_DEF(int, MPI_Neighbor_allgather, const void* sendbuf, int sendcount, MPI_Datatype sendtype, - void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) -AMPI_API_DEF(int, MPI_Ineighbor_allgather, const void* sendbuf, int sendcount, MPI_Datatype sendtype, - void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, - MPI_Request *request) -AMPI_API_DEF(int, MPI_Neighbor_allgatherv, const void* sendbuf, int sendcount, MPI_Datatype sendtype, - void* recvbuf, const int* recvcounts, const int* displs, MPI_Datatype recvtype, - MPI_Comm comm) -AMPI_API_DEF(int, MPI_Ineighbor_allgatherv, const void* sendbuf, int sendcount, MPI_Datatype sendtype, - void* recvbuf, const int* recvcounts, const int* displs, MPI_Datatype recvtype, - MPI_Comm comm, MPI_Request *request) - -/***ops***/ -AMPI_API_DEF(int, MPI_Op_create, MPI_User_function *function, int commute, MPI_Op *op) -AMPI_API_DEF(int, MPI_Op_free, MPI_Op *op) -AMPI_API_DEF(int, MPI_Op_commutative, MPI_Op op, int* commute) - -/***groups***/ -AMPI_API_DEF(int, MPI_Group_size, MPI_Group group, int *size) -AMPI_API_DEF(int, MPI_Group_rank, MPI_Group group, int *rank) -AMPI_API_DEF(int, MPI_Group_translate_ranks, MPI_Group group1, int n, const int *ranks1, MPI_Group group2, int *ranks2) -AMPI_API_DEF(int, MPI_Group_compare, MPI_Group group1,MPI_Group group2, int *result) -AMPI_API_DEF(int, MPI_Comm_group, MPI_Comm comm, MPI_Group *group) -AMPI_API_DEF(int, MPI_Group_union, MPI_Group group1, MPI_Group group2, MPI_Group *newgroup) -AMPI_API_DEF(int, MPI_Group_intersection, MPI_Group group1, MPI_Group group2, MPI_Group *newgroup) -AMPI_API_DEF(int, MPI_Group_difference, MPI_Group group1, MPI_Group group2, MPI_Group *newgroup) -AMPI_API_DEF(int, MPI_Group_incl, MPI_Group group, int n, const int *ranks, MPI_Group *newgroup) -AMPI_API_DEF(int, MPI_Group_excl, MPI_Group group, int n, const int *ranks, MPI_Group *newgroup) -AMPI_API_DEF(int, MPI_Group_range_incl, MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup) -AMPI_API_DEF(int, MPI_Group_range_excl, MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup) -AMPI_API_DEF(int, MPI_Group_free, MPI_Group *group) - -/***communicators***/ -AMPI_API_DEF(int, MPI_Intercomm_create, MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm, - int remote_leader, int tag, MPI_Comm *newintercomm) -AMPI_API_DEF(int, MPI_Intercomm_merge, MPI_Comm intercomm, int high, MPI_Comm *newintracomm) -AMPI_API_DEF(int, MPI_Comm_create, MPI_Comm comm, MPI_Group group, MPI_Comm* newcomm) -AMPI_API_DEF(int, MPI_Comm_create_group, MPI_Comm comm, MPI_Group group, int tag, MPI_Comm *newcomm) -AMPI_API_DEF(int, MPI_Comm_size, MPI_Comm comm, int *size) -AMPI_API_DEF(int, MPI_Comm_rank, MPI_Comm comm, int *rank) -AMPI_API_DEF(int, MPI_Comm_compare, MPI_Comm comm1,MPI_Comm comm2, int *result) -AMPI_API_DEF(int, MPI_Comm_split, MPI_Comm src, int color, int key, MPI_Comm *dest) -AMPI_API_DEF(int, MPI_Comm_split_type, MPI_Comm src, int split_type, int key, MPI_Info info, MPI_Comm *dest) -AMPI_API_DEF(int, MPI_Comm_dup, MPI_Comm src, MPI_Comm *dest) -AMPI_API_DEF(int, MPI_Comm_idup, MPI_Comm comm, MPI_Comm *newcomm, MPI_Request *request) -AMPI_API_DEF(int, MPI_Comm_dup_with_info, MPI_Comm src, MPI_Info info, MPI_Comm *dest) -AMPI_API_DEF(int, MPI_Comm_idup_with_info, MPI_Comm src, MPI_Info info, MPI_Comm *dest, MPI_Request *request) -AMPI_API_DEF(int, MPI_Comm_free, MPI_Comm *comm) -AMPI_API_DEF(int, MPI_Comm_test_inter, MPI_Comm comm, int *flag) -AMPI_API_DEF(int, MPI_Comm_remote_size, MPI_Comm comm, int *size) -AMPI_API_DEF(int, MPI_Comm_remote_group, MPI_Comm comm, MPI_Group *group) -AMPI_API_DEF(int, MPI_Comm_set_name, MPI_Comm comm, const char *name) -AMPI_API_DEF(int, MPI_Comm_get_name, MPI_Comm comm, char *comm_name, int *resultlen) -AMPI_API_DEF(int, MPI_Comm_set_info, MPI_Comm comm, MPI_Info info) -AMPI_API_DEF(int, MPI_Comm_get_info, MPI_Comm comm, MPI_Info *info) -AMPI_API_DEF(int, MPI_Comm_call_errhandler, MPI_Comm comm, int errorcode) -AMPI_API_DEF(int, MPI_Comm_create_errhandler, MPI_Comm_errhandler_fn *function, MPI_Errhandler *errhandler) -AMPI_API_DEF(int, MPI_Comm_set_errhandler, MPI_Comm comm, MPI_Errhandler errhandler) -AMPI_API_DEF(int, MPI_Comm_get_errhandler, MPI_Comm comm, MPI_Errhandler *errhandler) -AMPI_API_DEF(int, MPI_Comm_free_errhandler, MPI_Errhandler *errhandler) -AMPI_API_DEF(int, MPI_Comm_create_keyval, MPI_Comm_copy_attr_function *copy_fn, MPI_Comm_delete_attr_function *delete_fn, - int *keyval, void* extra_state) -AMPI_API_DEF(int, MPI_Comm_free_keyval, int *keyval) -AMPI_API_DEF(int, MPI_Comm_set_attr, MPI_Comm comm, int keyval, void* attribute_val) -AMPI_API_DEF(int, MPI_Comm_get_attr, MPI_Comm comm, int keyval, void *attribute_val, int *flag) -AMPI_API_DEF(int, MPI_Comm_delete_attr, MPI_Comm comm, int keyval) - -/***keyvals/attributes***/ -AMPI_API_DEF(int, MPI_Keyval_create, MPI_Copy_function *copy_fn, MPI_Delete_function *delete_fn, - int *keyval, void* extra_state) -AMPI_API_DEF(int, MPI_Keyval_free, int *keyval) -AMPI_API_DEF(int, MPI_Attr_put, MPI_Comm comm, int keyval, void* attribute_val) -AMPI_API_DEF(int, MPI_Attr_get, MPI_Comm comm, int keyval, void *attribute_val, int *flag) -AMPI_API_DEF(int, MPI_Attr_delete, MPI_Comm comm, int keyval) - -/***topologies***/ -AMPI_API_DEF(int, MPI_Cart_create, MPI_Comm comm_old, int ndims, const int *dims, - const int *periods, int reorder, MPI_Comm *comm_cart) -AMPI_API_DEF(int, MPI_Graph_create, MPI_Comm comm_old, int nnodes, const int *index, - const int *edges, int reorder, MPI_Comm *comm_graph) -AMPI_API_DEF(int, MPI_Dist_graph_create_adjacent, MPI_Comm comm_old, int indegree, const int sources[], - const int sourceweights[], int outdegree, - const int destinations[], const int destweights[], - MPI_Info info, int reorder, MPI_Comm *comm_dist_graph) -AMPI_API_DEF(int, MPI_Dist_graph_create, MPI_Comm comm_old, int n, const int sources[], const int degrees[], - const int destintations[], const int weights[], MPI_Info info, - int reorder, MPI_Comm *comm_dist_graph) -AMPI_API_DEF(int, MPI_Topo_test, MPI_Comm comm, int *status) -AMPI_API_DEF(int, MPI_Cart_map, MPI_Comm comm, int ndims, const int *dims, const int *periods, - int *newrank) -AMPI_API_DEF(int, MPI_Graph_map, MPI_Comm comm, int nnodes, const int *index, const int *edges, - int *newrank) -AMPI_API_DEF(int, MPI_Cartdim_get, MPI_Comm comm, int *ndims) -AMPI_API_DEF(int, MPI_Cart_get, MPI_Comm comm, int maxdims, int *dims, int *periods, int *coords) -AMPI_API_DEF(int, MPI_Cart_rank, MPI_Comm comm, const int *coords, int *rank) -AMPI_API_DEF(int, MPI_Cart_coords, MPI_Comm comm, int rank, int maxdims, int *coords) -AMPI_API_DEF(int, MPI_Cart_shift, MPI_Comm comm, int direction, int disp, int *rank_source, int *rank_dest) -AMPI_API_DEF(int, MPI_Graphdims_get, MPI_Comm comm, int *nnodes, int *nedges) -AMPI_API_DEF(int, MPI_Graph_get, MPI_Comm comm, int maxindex, int maxedges, int *index, int *edges) -AMPI_API_DEF(int, MPI_Graph_neighbors_count, MPI_Comm comm, int rank, int *nneighbors) -AMPI_API_DEF(int, MPI_Graph_neighbors, MPI_Comm comm, int rank, int maxneighbors, int *neighbors) -AMPI_API_DEF(int, MPI_Dims_create, int nnodes, int ndims, int *dims) -AMPI_API_DEF(int, MPI_Cart_sub, MPI_Comm comm, const int *remain_dims, MPI_Comm *newcomm) -AMPI_API_DEF(int, MPI_Dist_graph_neighbors, MPI_Comm comm, int maxindegree, int sources[], int sourceweights[], - int maxoutdegree, int destinations[], int destweights[]) -AMPI_API_DEF(int, MPI_Dist_graph_neighbors_count, MPI_Comm comm, int *indegree, int *outdegree, int *weighted) - -/***environment management***/ -AMPI_API_DEF(int, MPI_Errhandler_create, MPI_Handler_function *function, MPI_Errhandler *errhandler) -AMPI_API_DEF(int, MPI_Errhandler_set, MPI_Comm comm, MPI_Errhandler errhandler) -AMPI_API_DEF(int, MPI_Errhandler_get, MPI_Comm comm, MPI_Errhandler *errhandler) -AMPI_API_DEF(int, MPI_Errhandler_free, MPI_Errhandler *errhandler) -AMPI_API_DEF(int, MPI_Add_error_code, int errorclass, int *errorcode) -AMPI_API_DEF(int, MPI_Add_error_class, int *errorclass) -AMPI_API_DEF(int, MPI_Add_error_string, int errorcode, const char *errorstring) -AMPI_API_DEF(int, MPI_Error_class, int errorcode, int *errorclass) -AMPI_API_DEF(int, MPI_Error_string, int errorcode, char *string, int *resultlen) -AMPI_API_DEF(int, MPI_Get_version, int *version, int *subversion) -AMPI_API_DEF(int, MPI_Get_library_version, char *version, int *resultlen) -AMPI_API_DEF(int, MPI_Get_processor_name, char *name, int *resultlen) -AMPI_API_DEF(double, MPI_Wtime, void) -AMPI_API_DEF(double, MPI_Wtick, void) -AMPI_API_DEF(int, MPI_Is_thread_main, int *flag) -AMPI_API_DEF(int, MPI_Query_thread, int *provided) -AMPI_API_DEF(int, MPI_Init_thread, int *argc, char*** argv, int required, int *provided) -AMPI_API_DEF(int, MPI_Init, int *argc, char*** argv) -AMPI_API_DEF(int, MPI_Initialized, int *isInit) -AMPI_API_DEF(int, MPI_Finalize, void) -AMPI_API_DEF(int, MPI_Finalized, int *finalized) -AMPI_API_DEF(int, MPI_Abort, MPI_Comm comm, int errorcode) -AMPI_API_DEF(int, MPI_Pcontrol, const int level, ...) /*********************One sided communication routines *****************/ /* MPI_Win : an index into a list in ampiParent (just like MPI_Group) */ @@ -1587,87 +1193,6 @@ typedef int (MPI_Win_copy_attr_function)(MPI_Win oldwin, int keyval, typedef int (MPI_Win_delete_attr_function)(MPI_Win win, int keyval, void *attribute_val, void *extra_state); -#define MPI_WIN_NULL_DELETE_FN MPI_win_null_delete_fn -#define MPI_WIN_NULL_COPY_FN MPI_win_null_copy_fn -#define MPI_WIN_DUP_FN MPI_win_dup_fn - -int MPI_WIN_NULL_COPY_FN ( MPI_Win, int, void *, void *, void *, int * ); -int MPI_WIN_NULL_DELETE_FN ( MPI_Win, int, void *, void * ); -int MPI_WIN_DUP_FN ( MPI_Win, int, void *, void *, void *, int * ); - -/***windows/rma***/ -AMPI_API_DEF(int, MPI_Win_create, void *base, MPI_Aint size, int disp_unit, - MPI_Info info, MPI_Comm comm, MPI_Win *newwin) -AMPI_API_DEF(int, MPI_Win_free, MPI_Win *win) -AMPI_API_DEF(int, MPI_Win_create_errhandler, MPI_Win_errhandler_function *win_errhandler_fn, - MPI_Errhandler *errhandler) -AMPI_API_DEF(int, MPI_Win_call_errhandler, MPI_Win win, int errorcode) -AMPI_API_DEF(int, MPI_Win_get_errhandler, MPI_Win win, MPI_Errhandler *errhandler) -AMPI_API_DEF(int, MPI_Win_set_errhandler, MPI_Win win, MPI_Errhandler errhandler) -AMPI_API_DEF(int, MPI_Win_create_keyval, MPI_Win_copy_attr_function *copy_fn, - MPI_Win_delete_attr_function *delete_fn, - int *keyval, void *extra_state) -AMPI_API_DEF(int, MPI_Win_free_keyval, int *keyval) -AMPI_API_DEF(int, MPI_Win_delete_attr, MPI_Win win, int key) -AMPI_API_DEF(int, MPI_Win_get_attr, MPI_Win win, int win_keyval, void *attribute_val, int *flag) -AMPI_API_DEF(int, MPI_Win_set_attr, MPI_Win win, int win_keyval, void *attribute_val) -AMPI_API_DEF(int, MPI_Win_get_group, MPI_Win win, MPI_Group *group) -AMPI_API_DEF(int, MPI_Win_set_name, MPI_Win win, const char *name) -AMPI_API_DEF(int, MPI_Win_get_name, MPI_Win win, char *name, int *length) -AMPI_API_DEF(int, MPI_Win_set_info, MPI_Win win, MPI_Info info) -AMPI_API_DEF(int, MPI_Win_get_info, MPI_Win win, MPI_Info *info) -AMPI_API_DEF(int, MPI_Win_fence, int assertion, MPI_Win win) -AMPI_API_DEF(int, MPI_Win_lock, int lock_type, int rank, int assert, MPI_Win win) -AMPI_API_DEF(int, MPI_Win_unlock, int rank, MPI_Win win) -AMPI_API_DEF(int, MPI_Win_post, MPI_Group group, int assertion, MPI_Win win) -AMPI_API_DEF(int, MPI_Win_wait, MPI_Win win) -AMPI_API_DEF(int, MPI_Win_start, MPI_Group group, int assertion, MPI_Win win) -AMPI_API_DEF(int, MPI_Win_complete, MPI_Win win) -AMPI_API_DEF(int, MPI_Win_test, MPI_Win win, int *flag) -AMPI_API_DEF(int, MPI_Alloc_mem, MPI_Aint size, MPI_Info info, void *baseptr) -AMPI_API_DEF(int, MPI_Free_mem, void *base) -AMPI_API_DEF(int, MPI_Put, const void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank, - MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, MPI_Win win) -AMPI_API_DEF(int, MPI_Get, void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank, - MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, MPI_Win win) -AMPI_API_DEF(int, MPI_Accumulate, const void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank, - MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, - MPI_Op op, MPI_Win win) -AMPI_API_DEF(int, MPI_Get_accumulate, const void *orgaddr, int orgcnt, MPI_Datatype orgtype, - void *resaddr, int rescnt, MPI_Datatype restype, - int rank, MPI_Aint targdisp, int targcnt, - MPI_Datatype targtype, MPI_Op op, MPI_Win win) -AMPI_API_DEF(int, MPI_Rput, const void *orgaddr, int orgcnt, MPI_Datatype orgtype, int targrank, - MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, MPI_Win win, - MPI_Request *request) -AMPI_API_DEF(int, MPI_Rget, void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank, - MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, MPI_Win win, - MPI_Request *request) -AMPI_API_DEF(int, MPI_Raccumulate, const void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank, - MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, - MPI_Op op, MPI_Win win, MPI_Request *request) -AMPI_API_DEF(int, MPI_Rget_accumulate, const void *orgaddr, int orgcnt, MPI_Datatype orgtype, - void *resaddr, int rescnt, MPI_Datatype restype, - int rank, MPI_Aint targdisp, int targcnt, - MPI_Datatype targtype, MPI_Op op, MPI_Win win, - MPI_Request *request) -AMPI_API_DEF(int, MPI_Fetch_and_op, const void *orgaddr, void *resaddr, MPI_Datatype type, - int rank, MPI_Aint targdisp, MPI_Op op, MPI_Win win) -AMPI_API_DEF(int, MPI_Compare_and_swap, const void *orgaddr, const void *compaddr, void *resaddr, - MPI_Datatype type, int rank, MPI_Aint targdisp, - MPI_Win win) - -/***infos***/ -AMPI_API_DEF(int, MPI_Info_create, MPI_Info *info) -AMPI_API_DEF(int, MPI_Info_set, MPI_Info info, const char *key, const char *value) -AMPI_API_DEF(int, MPI_Info_delete, MPI_Info info, const char *key) -AMPI_API_DEF(int, MPI_Info_get, MPI_Info info, const char *key, int valuelen, char *value, int *flag) -AMPI_API_DEF(int, MPI_Info_get_valuelen, MPI_Info info, const char *key, int *valuelen, int *flag) -AMPI_API_DEF(int, MPI_Info_get_nkeys, MPI_Info info, int *nkeys) -AMPI_API_DEF(int, MPI_Info_get_nthkey, MPI_Info info, int n, char *key) -AMPI_API_DEF(int, MPI_Info_dup, MPI_Info info, MPI_Info *newinfo) -AMPI_API_DEF(int, MPI_Info_free, MPI_Info *info) - /***MPIX***/ typedef int MPIX_Grequest_class; @@ -1675,16 +1200,6 @@ typedef int MPIX_Grequest_poll_function(void *extra_state, MPI_Status *status); typedef int MPIX_Grequest_wait_function(int count, void **array_of_states, double timeout, MPI_Status *status); -AMPI_API_DEF(int, MPIX_Grequest_start, MPI_Grequest_query_function *query_fn, - MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, - MPIX_Grequest_poll_function *poll_fn, void *extra_state, MPI_Request *request) -AMPI_API_DEF(int, MPIX_Grequest_class_create, MPI_Grequest_query_function *query_fn, - MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, - MPIX_Grequest_poll_function *poll_fn, MPIX_Grequest_wait_function *wait_fn, - MPIX_Grequest_class *greq_class) -AMPI_API_DEF(int, MPIX_Grequest_class_allocate, MPIX_Grequest_class greq_class, - void *extra_state, MPI_Request *request) - /***Fortran-C bindings***/ #define MPI_Comm_c2f(comm) (MPI_Fint)(comm) @@ -1704,80 +1219,22 @@ AMPI_API_DEF(int, MPIX_Grequest_class_allocate, MPIX_Grequest_class greq_class, #define MPI_Win_c2f(win) (MPI_Fint)(win) #define MPI_Win_f2c(win) (MPI_Win)(win) -#include "mpio.h" -/*** AMPI Extensions ***/ -int AMPI_Migrate(MPI_Info hints); -int AMPI_Load_start_measure(void); -int AMPI_Load_stop_measure(void); -int AMPI_Load_reset_measure(void); -int AMPI_Load_set_value(double value); -int AMPI_Migrate_to_pe(int dest); -int AMPI_Set_migratable(int mig); -int AMPI_Register_pup(MPI_PupFn fn, void *data, int *idx); -int AMPI_Get_pup_data(int idx, void *data); -int AMPI_Register_main(MPI_MainFn mainFn, const char *name); -int AMPI_Register_about_to_migrate(MPI_MigrateFn fn); -int AMPI_Register_just_migrated(MPI_MigrateFn fn); -int AMPI_Iget(MPI_Aint orgdisp, int orgcnt, MPI_Datatype orgtype, int rank, - MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, - MPI_Win win, MPI_Request *request); -int AMPI_Iget_wait(MPI_Request *request, MPI_Status *status, MPI_Win win); -int AMPI_Iget_free(MPI_Request *request, MPI_Status *status, MPI_Win win); -int AMPI_Iget_data(void *data, MPI_Status status); -int AMPI_Type_is_contiguous(MPI_Datatype datatype, int *flag); -#if CMK_FAULT_EVAC -int AMPI_Evacuate(void); -#endif -int AMPI_Yield(void); -int AMPI_Suspend(void); -int AMPI_Resume(int dest, MPI_Comm comm); -int AMPI_Print(const char *str); -int AMPI_Trace_begin(void); -int AMPI_Trace_end(void); -int AMPI_Alltoall_medium(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm); -int AMPI_Alltoall_long(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm); - -#if CMK_BIGSIM_CHARM -int AMPI_Set_start_event(MPI_Comm comm); -int AMPI_Set_end_event(void); -void beginTraceBigSim(char* msg); -void endTraceBigSim(char* msg, char* param); +/* From ROMIO's mpio.h */ +/* If we needed to define MPI_Offset, then we also need to make + this definition. */ +#ifndef HAVE_MPI_DATAREP_FUNCTIONS +#define HAVE_MPI_DATAREP_FUNCTIONS +typedef int (MPI_Datarep_conversion_function)(void *, MPI_Datatype, int, + void *, MPI_Offset, void *); +typedef int (MPI_Datarep_extent_function)(MPI_Datatype datatype, MPI_Aint *, + void *); #endif -#ifdef __cplusplus -#if CMK_CUDA -int AMPI_GPU_Iinvoke_wr(hapiWorkRequest *to_call, MPI_Request *request); -int AMPI_GPU_Iinvoke(cudaStream_t stream, MPI_Request *request); -int AMPI_GPU_Invoke_wr(hapiWorkRequest *to_call); -int AMPI_GPU_Invoke(cudaStream_t stream); -#endif -#endif - -/* Execute this shell command (just like "system()") */ -int AMPI_System(const char *cmd); - -/* Determine approximate depth of stack at the point of this call */ -extern long ampiCurrentStackUsage(void); - -// Functions and constants unsupported in AMPI +#include "mpio.h" -#if defined __cplusplus && __cplusplus >= 201402L -# define AMPI_UNIMPLEMENTED [[deprecated("currently unimplemented in AMPI")]] -#elif defined __GNUC__ || defined __clang__ -# define AMPI_UNIMPLEMENTED __attribute__((deprecated("currently unimplemented in AMPI"))) -#elif defined _MSC_VER -# define AMPI_UNIMPLEMENTED __declspec(deprecated("currently unimplemented in AMPI")) -#else -# define AMPI_UNIMPLEMENTED -#endif -#define AMPI_API_DEF_NOIMPL(return_type, function_name, ...) \ - AMPI_UNIMPLEMENTED AMPI_API_DEF(return_type, function_name, __VA_ARGS__) +// Typedefs and constants unsupported in AMPI // MPI-2 Constants #define MPI_ARGV_NULL (char **)0 @@ -1900,141 +1357,44 @@ typedef int MPI_T_pvar_session; #define MPIX_Comm_failure_get_acked (void*) #define MPIX_Comm_revoke (void*) - -/* MPI 3.1 standards compliance overview. - * This list contains all MPI functions not supported in AMPI currently. -*/ - -/* A.2.1 Point-to-Point Communication C Bindings */ - -/* A.2.2 Datatypes C Bindings */ - -AMPI_API_DEF_NOIMPL(int, MPI_Pack_external, const char datarep[], const void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outsize, MPI_Aint *position) -AMPI_API_DEF_NOIMPL(int, MPI_Pack_external_size, const char datarep[], int incount, MPI_Datatype datatype, MPI_Aint *size) -AMPI_API_DEF_NOIMPL(int, MPI_Unpack_external, const char datarep[], const void *inbuf, MPI_Aint insize, MPI_Aint *position, void *outbuf, int outcount, MPI_Datatype datatype) - -/* A.2.3 Collective Communication C Bindings */ - -/* A.2.4 Groups, Contexts, Communicators, and Caching C Bindings */ - -/* A.2.6 MPI Environmental Management C Bindings */ - typedef void (MPI_File_errhandler_function)(MPI_File *file, int *err, ...); -AMPI_API_DEF_NOIMPL(int, MPI_File_call_errhandler, MPI_File fh, int errorcode) -AMPI_API_DEF_NOIMPL(int, MPI_File_create_errhandler, MPI_File_errhandler_function *file_errhandler_fn, MPI_Errhandler *errhandler) -AMPI_API_DEF_NOIMPL(int, MPI_File_get_errhandler, MPI_File file, MPI_Errhandler *errhandler) -AMPI_API_DEF_NOIMPL(int, MPI_File_set_errhandler, MPI_File file, MPI_Errhandler errhandler) - - -/* A.2.7 The Info Object C Bindings */ - -/* A.2.8 Process Creation and Management C Bindings */ - -AMPI_API_DEF_NOIMPL(int, MPI_Close_port, const char *port_name) -AMPI_API_DEF_NOIMPL(int, MPI_Comm_accept, const char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm) -AMPI_API_DEF_NOIMPL(int, MPI_Comm_connect, const char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm) -AMPI_API_DEF_NOIMPL(int, MPI_Comm_disconnect, MPI_Comm *comm) -AMPI_API_DEF_NOIMPL(int, MPI_Comm_get_parent, MPI_Comm *parent) -AMPI_API_DEF_NOIMPL(int, MPI_Comm_join, int fd, MPI_Comm *intercomm) -AMPI_API_DEF_NOIMPL(int, MPI_Comm_spawn, const char *command, char *argv[], int maxprocs, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *intercomm, int array_of_errcodes[]) -AMPI_API_DEF_NOIMPL(int, MPI_Comm_spawn_multiple, int count, char *array_of_commands[], char **array_of_argv[], const int array_of_maxprocs[], const MPI_Info array_of_info[], int root, MPI_Comm comm, MPI_Comm *intercomm, int array_of_errcodes[]) -AMPI_API_DEF_NOIMPL(int, MPI_Lookup_name, const char *service_name, MPI_Info info, char *port_name) -AMPI_API_DEF_NOIMPL(int, MPI_Open_port, MPI_Info info, char *port_name) -AMPI_API_DEF_NOIMPL(int, MPI_Publish_name, const char *service_name, MPI_Info info, const char *port_name) -AMPI_API_DEF_NOIMPL(int, MPI_Unpublish_name, const char *service_name, MPI_Info info, const char *port_name) - - -/* A.2.9 One-Sided Communications C Bindings */ - -AMPI_API_DEF_NOIMPL(int, MPI_Win_allocate, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *baseptr, MPI_Win *win) -AMPI_API_DEF_NOIMPL(int, MPI_Win_allocate_shared, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *baseptr, MPI_Win *win) -AMPI_API_DEF_NOIMPL(int, MPI_Win_attach, MPI_Win win, void *base, MPI_Aint size) -AMPI_API_DEF_NOIMPL(int, MPI_Win_create_dynamic, MPI_Info info, MPI_Comm comm, MPI_Win *win) -AMPI_API_DEF_NOIMPL(int, MPI_Win_detach, MPI_Win win, const void *base) -AMPI_API_DEF_NOIMPL(int, MPI_Win_flush, int rank, MPI_Win win) -AMPI_API_DEF_NOIMPL(int, MPI_Win_flush_all, MPI_Win win) -AMPI_API_DEF_NOIMPL(int, MPI_Win_flush_local, int rank, MPI_Win win) -AMPI_API_DEF_NOIMPL(int, MPI_Win_flush_local_all, MPI_Win win) -AMPI_API_DEF_NOIMPL(int, MPI_Win_lock_all, int assert, MPI_Win win) -AMPI_API_DEF_NOIMPL(int, MPI_Win_shared_query, MPI_Win win, int rank, MPI_Aint *size, int *disp_unit, void *baseptr) -AMPI_API_DEF_NOIMPL(int, MPI_Win_sync, MPI_Win win) -AMPI_API_DEF_NOIMPL(int, MPI_Win_unlock_all, MPI_Win win) +typedef struct { + MPI_Fint count_lo, count_hi_and_cancelled, MPI_SOURCE, MPI_TAG, MPI_ERROR; +} MPI_F08_status; -/* A.2.10 External Interfaces C Bindings */ +/* Declare functions */ -/* A.2.11 I/O C Bindings */ +#if defined __cplusplus && __cplusplus >= 201402L +# define AMPI_UNIMPLEMENTED [[deprecated("currently unimplemented in AMPI")]] +#elif defined __GNUC__ || defined __clang__ +# define AMPI_UNIMPLEMENTED __attribute__((deprecated("currently unimplemented in AMPI"))) +#elif defined _MSC_VER +# define AMPI_UNIMPLEMENTED __declspec(deprecated("currently unimplemented in AMPI")) +#else +# define AMPI_UNIMPLEMENTED +#endif -AMPI_API_DEF_NOIMPL(int, MPI_CONVERSION_FN_NULL, void *userbuf, MPI_Datatype datatype, int count, void *filebuf, MPI_Offset position, void *extra_state) -AMPI_API_DEF_NOIMPL(int, MPI_File_iread_all, MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request) -AMPI_API_DEF_NOIMPL(int, MPI_File_iread_at_all, MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request) -AMPI_API_DEF_NOIMPL(int, MPI_File_iwrite_all, MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request) -AMPI_API_DEF_NOIMPL(int, MPI_File_iwrite_at_all, MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request) -// AMPI_API_DEF_NOIMPL(int, MPI_Register_datarep, const char *datarep, MPI_Datarep_conversion_function *read_conversion_fn, MPI_Datarep_conversion_function *write_conversion_fn, MPI_Datarep_extent_function *dtype_file_extent_fn, void *extra_state) //Provided by ROMIO +#undef AMPI_INTERNAL_SKIP_FUNCTIONS +#define AMPI_FUNC AMPI_API_DEF +#define AMPI_FUNC_NOIMPL AMPI_UNIMPLEMENTED AMPI_FUNC +#define AMPI_CUSTOM_FUNC AMPI_CUSTOM_API_DEF -/* A.2.12 Language Bindings C Bindings */ +#include "ampi_functions.h" -typedef struct { - MPI_Fint count_lo, count_hi_and_cancelled, MPI_SOURCE, MPI_TAG, MPI_ERROR; -} MPI_F08_status; +#undef AMPI_FUNC +#undef AMPI_FUNC_NOIMPL +#undef AMPI_CUSTOM_FUNC -AMPI_API_DEF_NOIMPL(int, MPI_Status_f082f, MPI_F08_status *f08_status, MPI_Fint *f_status) -AMPI_API_DEF_NOIMPL(int, MPI_Status_f2f08, MPI_Fint *f_status, MPI_F08_status *f08_status) -AMPI_API_DEF_NOIMPL(int, MPI_Type_create_f90_complex, int p, int r, MPI_Datatype *newtype) -AMPI_API_DEF_NOIMPL(int, MPI_Type_create_f90_integer, int r, MPI_Datatype *newtype) -AMPI_API_DEF_NOIMPL(int, MPI_Type_create_f90_real, int p, int r, MPI_Datatype *newtype) -AMPI_API_DEF_NOIMPL(int, MPI_Type_match_size, int typeclass, int size, MPI_Datatype *datatype) -AMPI_API_DEF_NOIMPL(MPI_Fint, MPI_Message_c2f, MPI_Message message) -AMPI_API_DEF_NOIMPL(MPI_Message, MPI_Message_f2c, MPI_Fint message) -AMPI_API_DEF_NOIMPL(int, MPI_Status_c2f, const MPI_Status *c_status, MPI_Fint *f_status) -AMPI_API_DEF_NOIMPL(int, MPI_Status_c2f08, const MPI_Status *c_status, MPI_F08_status *f08_status) -AMPI_API_DEF_NOIMPL(int, MPI_Status_f082c, const MPI_F08_status *f08_status, MPI_Status *c_status) -AMPI_API_DEF_NOIMPL(int, MPI_Status_f2c, const MPI_Fint *f_status, MPI_Status *c_status) - - -/* A.2.13 Tools / Profiling Interface C Bindings */ - -/* A.2.14 Tools / MPI Tool Information Interface C Bindings */ - -AMPI_API_DEF_NOIMPL(int, MPI_T_category_changed, int *stamp) -AMPI_API_DEF_NOIMPL(int, MPI_T_category_get_categories, int cat_index, int len, int indices[]) -AMPI_API_DEF_NOIMPL(int, MPI_T_category_get_cvars, int cat_index, int len, int indices[]) -AMPI_API_DEF_NOIMPL(int, MPI_T_category_get_index, const char *name, int *cat_index) -AMPI_API_DEF_NOIMPL(int, MPI_T_category_get_info, int cat_index, char *name, int *name_len, char *desc, int *desc_len, int *num_cvars, int *num_pvars, int *num_categories) -AMPI_API_DEF_NOIMPL(int, MPI_T_category_get_num, int *num_cat) -AMPI_API_DEF_NOIMPL(int, MPI_T_category_get_pvars, int cat_index, int len, int indices[]) -AMPI_API_DEF_NOIMPL(int, MPI_T_cvar_get_index, const char *name, int *cvar_index) -AMPI_API_DEF_NOIMPL(int, MPI_T_cvar_get_info, int cvar_index, char *name, int *name_len, int *verbosity, MPI_Datatype *datatype, MPI_T_enum *enumtype, char *desc, int *desc_len, int *bind, int *scope) -AMPI_API_DEF_NOIMPL(int, MPI_T_cvar_get_num, int *num_cvar) -AMPI_API_DEF_NOIMPL(int, MPI_T_cvar_handle_alloc, int cvar_index, void *obj_handle, MPI_T_cvar_handle *handle, int *count) -AMPI_API_DEF_NOIMPL(int, MPI_T_cvar_handle_free, MPI_T_cvar_handle *handle) -AMPI_API_DEF_NOIMPL(int, MPI_T_cvar_read, MPI_T_cvar_handle handle, void* buf) -AMPI_API_DEF_NOIMPL(int, MPI_T_cvar_write, MPI_T_cvar_handle handle, const void* buf) -AMPI_API_DEF_NOIMPL(int, MPI_T_enum_get_info, MPI_T_enum enumtype, int *num, char *name, int *name_len) -AMPI_API_DEF_NOIMPL(int, MPI_T_enum_get_item, MPI_T_enum enumtype, int index, int *value, char *name, int *name_len) -AMPI_API_DEF_NOIMPL(int, MPI_T_finalize, void) -AMPI_API_DEF_NOIMPL(int, MPI_T_init_thread, int required, int *provided) -AMPI_API_DEF_NOIMPL(int, MPI_T_pvar_get_index, const char *name, int var_class, int *pvar_index) -AMPI_API_DEF_NOIMPL(int, MPI_T_pvar_get_info, int pvar_index, char *name, int *name_len, int *verbosity, int *var_class, MPI_Datatype *datatype, MPI_T_enum *enumtype, char *desc, int *desc_len, int *bind, int *readonly, int *continuous, int *atomic) -AMPI_API_DEF_NOIMPL(int, MPI_T_pvar_get_num, int *num_pvar) -AMPI_API_DEF_NOIMPL(int, MPI_T_pvar_handle_alloc, MPI_T_pvar_session session, int pvar_index, void *obj_handle, MPI_T_pvar_handle *handle, int *count) -AMPI_API_DEF_NOIMPL(int, MPI_T_pvar_handle_free, MPI_T_pvar_session session,MPI_T_pvar_handle *handle) -AMPI_API_DEF_NOIMPL(int, MPI_T_pvar_read, MPI_T_pvar_session session, MPI_T_pvar_handle handle,void* buf) -AMPI_API_DEF_NOIMPL(int, MPI_T_pvar_readreset, MPI_T_pvar_session session,MPI_T_pvar_handle handle, void* buf) -AMPI_API_DEF_NOIMPL(int, MPI_T_pvar_reset, MPI_T_pvar_session session, MPI_T_pvar_handle handle) -AMPI_API_DEF_NOIMPL(int, MPI_T_pvar_session_create, MPI_T_pvar_session *session) -AMPI_API_DEF_NOIMPL(int, MPI_T_pvar_session_free, MPI_T_pvar_session *session) -AMPI_API_DEF_NOIMPL(int, MPI_T_pvar_start, MPI_T_pvar_session session, MPI_T_pvar_handle handle) -AMPI_API_DEF_NOIMPL(int, MPI_T_pvar_stop, MPI_T_pvar_session session, MPI_T_pvar_handle handle) -AMPI_API_DEF_NOIMPL(int, MPI_T_pvar_write, MPI_T_pvar_session session, MPI_T_pvar_handle handle, const void* buf) - - -/* A.2.15 Deprecated C Bindings */ #ifdef __cplusplus } #endif + +#undef AMPI_API_DEF +#undef AMPI_CUSTOM_API_DEF + #endif diff --git a/src/libs/ck-libs/ampi/ampi_functions.h b/src/libs/ck-libs/ampi/ampi_functions.h new file mode 100644 index 0000000000..16c19d9729 --- /dev/null +++ b/src/libs/ck-libs/ampi/ampi_functions.h @@ -0,0 +1,764 @@ +/* + Keep this header free of: + * include guards + * extern "C" + * typedef + * #define without #ifndef guard or #undef after use + * global variables + * basically anything other than function declarations of the form + AMPI_FUNC/AMPI_CUSTOM_FUNC, with no trailing semicolon + * #include of files violating any of the above + */ + +#ifndef AMPI_NOIMPL_ONLY + +#ifndef AMPI_FUNC +# error You must define AMPI_FUNC before including this file! +#endif +#ifndef AMPI_CUSTOM_FUNC +# error You must define AMPI_CUSTOM_FUNC before including this file! +#endif + +#if CMK_CUDA +#include "hapi_functions.h" +#endif + +AMPI_CUSTOM_FUNC(void, AMPI_Exit, int exitCode) + +AMPI_CUSTOM_FUNC(void, ampiMarkAtexit, void) + +#ifndef MPI_COMM_NULL_COPY_FN +#define MPI_COMM_NULL_COPY_FN MPI_comm_null_copy_fn +#endif +#ifndef MPI_COMM_NULL_DELETE_FN +#define MPI_COMM_NULL_DELETE_FN MPI_comm_null_delete_fn +#endif +#ifndef MPI_COMM_DUP_FN +#define MPI_COMM_DUP_FN MPI_comm_dup_fn +#endif + +#ifndef MPI_NULL_COPY_FN +#define MPI_NULL_COPY_FN MPI_comm_null_copy_fn +#endif +#ifndef MPI_NULL_DELETE_FN +#define MPI_NULL_DELETE_FN MPI_comm_null_delete_fn +#endif +#ifndef MPI_DUP_FN +#define MPI_DUP_FN MPI_comm_dup_fn +#endif + +AMPI_CUSTOM_FUNC(int, MPI_COMM_NULL_COPY_FN , MPI_Comm, int, void *, void *, void *, int * ) +AMPI_CUSTOM_FUNC(int, MPI_COMM_NULL_DELETE_FN , MPI_Comm, int, void *, void * ) +AMPI_CUSTOM_FUNC(int, MPI_COMM_DUP_FN , MPI_Comm, int, void *, void *, void *, int * ) + +#ifndef MPI_TYPE_NULL_DELETE_FN +#define MPI_TYPE_NULL_DELETE_FN MPI_type_null_delete_fn +#endif +#ifndef MPI_TYPE_NULL_COPY_FN +#define MPI_TYPE_NULL_COPY_FN MPI_type_null_copy_fn +#endif +#ifndef MPI_TYPE_DUP_FN +#define MPI_TYPE_DUP_FN MPI_type_dup_fn +#endif + +AMPI_CUSTOM_FUNC(int, MPI_TYPE_NULL_COPY_FN , MPI_Datatype, int, void *, void *, void *, int * ) +AMPI_CUSTOM_FUNC(int, MPI_TYPE_NULL_DELETE_FN , MPI_Datatype, int, void *, void * ) +AMPI_CUSTOM_FUNC(int, MPI_TYPE_DUP_FN , MPI_Datatype, int, void *, void *, void *, int * ) + +#include "pup_c_functions.h" + +/***pt2pt***/ +AMPI_FUNC(int, MPI_Send, const void *msg, int count, MPI_Datatype type, int dest, + int tag, MPI_Comm comm) +AMPI_FUNC(int, MPI_Ssend, const void *msg, int count, MPI_Datatype type, int dest, + int tag, MPI_Comm comm) +AMPI_FUNC(int, MPI_Recv, void *msg, int count, MPI_Datatype type, int src, int tag, + MPI_Comm comm, MPI_Status *status) +AMPI_FUNC(int, MPI_Mrecv, void* buf, int count, MPI_Datatype datatype, MPI_Message *message, + MPI_Status *status) +AMPI_FUNC(int, MPI_Get_count, const MPI_Status *sts, MPI_Datatype dtype, int *count) +AMPI_FUNC(int, MPI_Bsend, const void *buf, int count, MPI_Datatype datatype, + int dest, int tag,MPI_Comm comm) +AMPI_FUNC(int, MPI_Rsend, const void *buf, int count, MPI_Datatype datatype, + int dest, int tag,MPI_Comm comm) +AMPI_FUNC(int, MPI_Buffer_attach, void *buffer, int size) +AMPI_FUNC(int, MPI_Buffer_detach, void *buffer, int *size) +AMPI_FUNC(int, MPI_Isend, const void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request) +AMPI_FUNC(int, MPI_Ibsend, const void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request) +AMPI_FUNC(int, MPI_Issend, const void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request) +AMPI_FUNC(int, MPI_Irsend, const void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request) +AMPI_FUNC(int, MPI_Irecv, void *buf, int count, MPI_Datatype datatype, int src, + int tag, MPI_Comm comm, MPI_Request *request) +AMPI_FUNC(int, MPI_Imrecv, void* buf, int count, MPI_Datatype datatype, MPI_Message *message, + MPI_Request *request) +AMPI_FUNC(int, MPI_Wait, MPI_Request *request, MPI_Status *sts) +AMPI_FUNC(int, MPI_Test, MPI_Request *request, int *flag, MPI_Status *sts) +AMPI_FUNC(int, MPI_Waitany, int count, MPI_Request *request, int *index, MPI_Status *sts) +AMPI_FUNC(int, MPI_Testany, int count, MPI_Request *request, int *index, int *flag, MPI_Status *status) +AMPI_FUNC(int, MPI_Waitall, int count, MPI_Request *request, MPI_Status *sts) +AMPI_FUNC(int, MPI_Testall, int count, MPI_Request *request, int *flag, MPI_Status *sts) +AMPI_FUNC(int, MPI_Waitsome, int incount, MPI_Request *array_of_requests, int *outcount, + int *array_of_indices, MPI_Status *array_of_statuses) +AMPI_FUNC(int, MPI_Testsome, int incount, MPI_Request *array_of_requests, int *outcount, + int *array_of_indices, MPI_Status *array_of_statuses) +AMPI_FUNC(int, MPI_Request_get_status, MPI_Request request, int *flag, MPI_Status *sts) +AMPI_FUNC(int, MPI_Request_free, MPI_Request *request) +AMPI_FUNC(int, MPI_Grequest_start, MPI_Grequest_query_function *query_fn, MPI_Grequest_free_function *free_fn,\ + MPI_Grequest_cancel_function *cancel_fn, void *extra_state, MPI_Request *request) +AMPI_FUNC(int, MPI_Grequest_complete, MPI_Request request) +AMPI_FUNC(int, MPI_Cancel, MPI_Request *request) +AMPI_FUNC(int, MPI_Test_cancelled, const MPI_Status *status, int *flag) /* FIXME: always returns success */ +AMPI_FUNC(int, MPI_Status_set_cancelled, MPI_Status *status, int flag) +AMPI_FUNC(int, MPI_Iprobe, int src, int tag, MPI_Comm comm, int *flag, MPI_Status *sts) +AMPI_FUNC(int, MPI_Probe, int source, int tag, MPI_Comm comm, MPI_Status *sts) +AMPI_FUNC(int, MPI_Improbe, int source, int tag, MPI_Comm comm, int *flag, + MPI_Message *message, MPI_Status *status) +AMPI_FUNC(int, MPI_Mprobe, int source, int tag, MPI_Comm comm, MPI_Message *message, + MPI_Status *status) +AMPI_FUNC(int, MPI_Send_init, const void *buf, int count, MPI_Datatype type, int dest, int tag, + MPI_Comm comm, MPI_Request *req) +AMPI_FUNC(int, MPI_Ssend_init, const void *buf, int count, MPI_Datatype type, int dest, int tag, + MPI_Comm comm, MPI_Request *req) +AMPI_FUNC(int, MPI_Rsend_init, const void *buf, int count, MPI_Datatype type, int dest, int tag, + MPI_Comm comm, MPI_Request *req) +AMPI_FUNC(int, MPI_Bsend_init, const void *buf, int count, MPI_Datatype type, int dest, int tag, + MPI_Comm comm, MPI_Request *req) +AMPI_FUNC(int, MPI_Recv_init, void *buf, int count, MPI_Datatype type, int src, int tag, + MPI_Comm comm, MPI_Request *req) +AMPI_FUNC(int, MPI_Start, MPI_Request *reqnum) +AMPI_FUNC(int, MPI_Startall, int count, MPI_Request *array_of_requests) +AMPI_FUNC(int, MPI_Sendrecv, const void *sbuf, int scount, MPI_Datatype stype, int dest, + int stag, void *rbuf, int rcount, MPI_Datatype rtype, + int src, int rtag, MPI_Comm comm, MPI_Status *sts) +AMPI_FUNC(int, MPI_Sendrecv_replace, void* buf, int count, MPI_Datatype datatype, + int dest, int sendtag, int source, int recvtag, + MPI_Comm comm, MPI_Status *status) + +/***datatypes***/ +AMPI_FUNC(int, MPI_Type_contiguous, int count, MPI_Datatype oldtype, + MPI_Datatype *newtype) +AMPI_FUNC(int, MPI_Type_vector, int count, int blocklength, int stride, + MPI_Datatype oldtype, MPI_Datatype *newtype) +AMPI_FUNC(int, MPI_Type_create_hvector, int count, int blocklength, MPI_Aint stride, + MPI_Datatype oldtype, MPI_Datatype *newtype) +AMPI_FUNC(int, MPI_Type_hvector, int count, int blocklength, MPI_Aint stride, + MPI_Datatype oldtype, MPI_Datatype *newtype) +AMPI_FUNC(int, MPI_Type_indexed, int count, const int* arrBlength, const int* arrDisp, + MPI_Datatype oldtype, MPI_Datatype *newtype) +AMPI_FUNC(int, MPI_Type_create_hindexed, int count, const int* arrBlength, const MPI_Aint* arrDisp, + MPI_Datatype oldtype, MPI_Datatype *newtype) +AMPI_FUNC(int, MPI_Type_create_indexed_block, int count, int Blength, const int *arrDisp, + MPI_Datatype oldtype, MPI_Datatype *newtype) +AMPI_FUNC(int, MPI_Type_create_hindexed_block, int count, int Blength, const MPI_Aint *arrDisp, + MPI_Datatype oldtype, MPI_Datatype *newtype) +AMPI_FUNC(int, MPI_Type_hindexed, int count, int* arrBlength, MPI_Aint* arrDisp, + MPI_Datatype oldtype, MPI_Datatype *newtype) +AMPI_FUNC(int, MPI_Type_create_struct, int count, const int* arrBLength, const MPI_Aint* arrDisp, + const MPI_Datatype *oldType, MPI_Datatype *newType) +AMPI_FUNC(int, MPI_Type_struct, int count, int* arrBLength, MPI_Aint* arrDisp, + MPI_Datatype *oldType, MPI_Datatype *newType) +AMPI_FUNC(int, MPI_Type_get_envelope, MPI_Datatype datatype, int *num_integers, int *num_addresses, + int *num_datatypes, int *combiner) +AMPI_FUNC(int, MPI_Type_get_contents, MPI_Datatype datatype, int max_integers, int max_addresses, + int max_datatypes, int array_of_integers[], MPI_Aint array_of_addresses[], + MPI_Datatype array_of_datatypes[]) +AMPI_FUNC(int, MPI_Type_commit, MPI_Datatype *datatype) +AMPI_FUNC(int, MPI_Type_free, MPI_Datatype *datatype) +AMPI_FUNC(int, MPI_Type_get_extent, MPI_Datatype datatype, MPI_Aint *lb, MPI_Aint *extent) +AMPI_FUNC(int, MPI_Type_get_extent_x, MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent) +AMPI_FUNC(int, MPI_Type_extent, MPI_Datatype datatype, MPI_Aint *extent) +AMPI_FUNC(int, MPI_Type_get_true_extent, MPI_Datatype datatype, MPI_Aint *true_lb, MPI_Aint *true_extent) +AMPI_FUNC(int, MPI_Type_get_true_extent_x, MPI_Datatype datatype, MPI_Count *true_lb, MPI_Count *true_extent) +AMPI_FUNC(int, MPI_Type_size, MPI_Datatype datatype, int *size) +AMPI_FUNC(int, MPI_Type_size_x, MPI_Datatype datatype, MPI_Count *size) +AMPI_FUNC(int, MPI_Type_lb, MPI_Datatype datatype, MPI_Aint* displacement) +AMPI_FUNC(int, MPI_Type_ub, MPI_Datatype datatype, MPI_Aint* displacement) +AMPI_FUNC(int, MPI_Type_set_name, MPI_Datatype datatype, const char *name) +AMPI_FUNC(int, MPI_Type_get_name, MPI_Datatype datatype, char *name, int *resultlen) +AMPI_FUNC(int, MPI_Type_dup, MPI_Datatype oldtype, MPI_Datatype *newtype) +AMPI_FUNC(int, MPI_Type_create_resized, MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint extent, MPI_Datatype *newtype) +AMPI_FUNC(int, MPI_Type_set_attr, MPI_Datatype datatype, int type_keyval, void *attribute_val) +AMPI_FUNC(int, MPI_Type_get_attr, MPI_Datatype datatype, int type_keyval, void *attribute_val, int *flag) +AMPI_FUNC(int, MPI_Type_delete_attr, MPI_Datatype datatype, int type_keyval) +AMPI_FUNC(int, MPI_Type_create_keyval, MPI_Type_copy_attr_function *type_copy_attr_fn, + MPI_Type_delete_attr_function *type_delete_attr_fn, + int *type_keyval, void *extra_state) +AMPI_FUNC(int, MPI_Type_free_keyval, int *type_keyval) +AMPI_FUNC(int, MPI_Type_create_darray, int size, int rank, int ndims, + const int array_of_gsizes[], const int array_of_distribs[], + const int array_of_dargs[], const int array_of_psizes[], + int order, MPI_Datatype oldtype, MPI_Datatype *newtype) +AMPI_FUNC(int, MPI_Type_create_subarray, int ndims, const int array_of_sizes[], + const int array_of_subsizes[], const int array_of_starts[], int order, + MPI_Datatype oldtype, MPI_Datatype *newtype) +AMPI_FUNC(int, MPI_Get_address, const void* location, MPI_Aint *address) +AMPI_FUNC(int, MPI_Address, void* location, MPI_Aint *address) +AMPI_FUNC(int, MPI_Status_set_elements, MPI_Status *status, MPI_Datatype datatype, int count) +AMPI_FUNC(int, MPI_Status_set_elements_x, MPI_Status *status, MPI_Datatype datatype, MPI_Count count) +AMPI_FUNC(int, MPI_Get_elements, const MPI_Status *status, MPI_Datatype datatype, int *count) +AMPI_FUNC(int, MPI_Get_elements_x, const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count) +AMPI_FUNC(int, MPI_Pack, const void *inbuf, int incount, MPI_Datatype dtype, void *outbuf, + int outsize, int *position, MPI_Comm comm) +AMPI_FUNC(int, MPI_Unpack, const void *inbuf, int insize, int *position, void *outbuf, + int outcount, MPI_Datatype dtype, MPI_Comm comm) +AMPI_FUNC(int, MPI_Pack_size, int incount,MPI_Datatype datatype,MPI_Comm comm,int *sz) + +/***collectives***/ +AMPI_FUNC(int, MPI_Barrier, MPI_Comm comm) +AMPI_FUNC(int, MPI_Ibarrier, MPI_Comm comm, MPI_Request *request) +AMPI_FUNC(int, MPI_Bcast, void *buf, int count, MPI_Datatype type, int root, MPI_Comm comm) +AMPI_FUNC(int, MPI_Ibcast, void *buf, int count, MPI_Datatype type, int root, MPI_Comm comm, + MPI_Request *request) +AMPI_FUNC(int, MPI_Gather, const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm) +AMPI_FUNC(int, MPI_Igather, const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Request *request) +AMPI_FUNC(int, MPI_Gatherv, const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, const int *recvcounts, const int *displs, + MPI_Datatype recvtype, int root, MPI_Comm comm) +AMPI_FUNC(int, MPI_Igatherv, const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, const int *recvcounts, const int *displs, + MPI_Datatype recvtype, int root, MPI_Comm comm, + MPI_Request *request) +AMPI_FUNC(int, MPI_Scatter, const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm) +AMPI_FUNC(int, MPI_Iscatter, const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Request *request) +AMPI_FUNC(int, MPI_Scatterv, const void *sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm) +AMPI_FUNC(int, MPI_Iscatterv, const void *sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm, MPI_Request *request) +AMPI_FUNC(int, MPI_Allgather, const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + MPI_Comm comm) +AMPI_FUNC(int, MPI_Iallgather, const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Request* request) +AMPI_FUNC(int, MPI_Allgatherv, const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, const int *recvcounts, const int *displs, + MPI_Datatype recvtype, MPI_Comm comm) +AMPI_FUNC(int, MPI_Iallgatherv, const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, const int *recvcounts, const int *displs, + MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request) +AMPI_FUNC(int, MPI_Alltoall, const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + MPI_Comm comm) +AMPI_FUNC(int, MPI_Ialltoall, const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Request *request) +AMPI_FUNC(int, MPI_Alltoallv, const void *sendbuf, const int *sendcounts, const int *sdispls, + MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, + const int *rdispls, MPI_Datatype recvtype, MPI_Comm comm) +AMPI_FUNC(int, MPI_Ialltoallv, void *sendbuf, int *sendcounts, int *sdispls, + MPI_Datatype sendtype, void *recvbuf, int *recvcounts, + int *rdispls, MPI_Datatype recvtype, MPI_Comm comm, + MPI_Request *request) +AMPI_FUNC(int, MPI_Alltoallw, const void *sendbuf, const int *sendcounts, const int *sdispls, + const MPI_Datatype *sendtypes, void *recvbuf, const int *recvcounts, + const int *rdispls, const MPI_Datatype *recvtypes, MPI_Comm comm) +AMPI_FUNC(int, MPI_Ialltoallw, const void *sendbuf, const int *sendcounts, const int *sdispls, + const MPI_Datatype *sendtypes, void *recvbuf, const int *recvcounts, + const int *rdispls, const MPI_Datatype *recvtypes, MPI_Comm comm, + MPI_Request *request) +AMPI_FUNC(int, MPI_Reduce, const void *inbuf, void *outbuf, int count, MPI_Datatype type, + MPI_Op op, int root, MPI_Comm comm) +AMPI_FUNC(int, MPI_Ireduce, const void *sendbuf, void *recvbuf, int count, MPI_Datatype type, + MPI_Op op, int root, MPI_Comm comm, MPI_Request *request) +AMPI_FUNC(int, MPI_Allreduce, const void *inbuf, void *outbuf, int count, MPI_Datatype type, + MPI_Op op, MPI_Comm comm) +AMPI_FUNC(int, MPI_Iallreduce, const void *inbuf, void *outbuf, int count, MPI_Datatype type, + MPI_Op op, MPI_Comm comm, MPI_Request *request) +AMPI_FUNC(int, MPI_Reduce_local, const void *inbuf, void *outbuf, int count, + MPI_Datatype datatype, MPI_Op op) +AMPI_FUNC(int, MPI_Reduce_scatter_block, const void* sendbuf, void* recvbuf, int count, + MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +AMPI_FUNC(int, MPI_Ireduce_scatter_block, const void* sendbuf, void* recvbuf, int count, + MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request) +AMPI_FUNC(int, MPI_Reduce_scatter, const void* sendbuf, void* recvbuf, const int *recvcounts, + MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +AMPI_FUNC(int, MPI_Ireduce_scatter, const void* sendbuf, void* recvbuf, const int *recvcounts, + MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request) +AMPI_FUNC(int, MPI_Scan, const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm ) +AMPI_FUNC(int, MPI_Iscan, const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Request *request) +AMPI_FUNC(int, MPI_Exscan, const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm) +AMPI_FUNC(int, MPI_Iexscan, const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm, MPI_Request *request) + +/***neighborhood collectives***/ +AMPI_FUNC(int, MPI_Neighbor_alltoall, const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) +AMPI_FUNC(int, MPI_Ineighbor_alltoall, const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, + MPI_Request* request) +AMPI_FUNC(int, MPI_Neighbor_alltoallv, const void* sendbuf, const int* sendcounts, const int* sdispls, + MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, const int* rdispls, + MPI_Datatype recvtype, MPI_Comm comm) +AMPI_FUNC(int, MPI_Ineighbor_alltoallv, const void* sendbuf, const int* sendcounts, const int* sdispls, + MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, const int* rdispls, + MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request) +AMPI_FUNC(int, MPI_Neighbor_alltoallw, const void* sendbuf, const int* sendcounts, const MPI_Aint* sdipls, + const MPI_Datatype* sendtypes, void* recvbuf, const int* recvcounts, const MPI_Aint* rdispls, + const MPI_Datatype* recvtypes, MPI_Comm comm) +AMPI_FUNC(int, MPI_Ineighbor_alltoallw, const void* sendbuf, const int* sendcounts, const MPI_Aint* sdispls, + const MPI_Datatype* sendtypes, void* recvbuf, const int* recvcounts, const MPI_Aint* rdispls, + const MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request* request) +AMPI_FUNC(int, MPI_Neighbor_allgather, const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) +AMPI_FUNC(int, MPI_Ineighbor_allgather, const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, + MPI_Request *request) +AMPI_FUNC(int, MPI_Neighbor_allgatherv, const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, const int* recvcounts, const int* displs, MPI_Datatype recvtype, + MPI_Comm comm) +AMPI_FUNC(int, MPI_Ineighbor_allgatherv, const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, const int* recvcounts, const int* displs, MPI_Datatype recvtype, + MPI_Comm comm, MPI_Request *request) + +/***ops***/ +AMPI_FUNC(int, MPI_Op_create, MPI_User_function *function, int commute, MPI_Op *op) +AMPI_FUNC(int, MPI_Op_free, MPI_Op *op) +AMPI_FUNC(int, MPI_Op_commutative, MPI_Op op, int* commute) + +/***groups***/ +AMPI_FUNC(int, MPI_Group_size, MPI_Group group, int *size) +AMPI_FUNC(int, MPI_Group_rank, MPI_Group group, int *rank) +AMPI_FUNC(int, MPI_Group_translate_ranks, MPI_Group group1, int n, const int *ranks1, MPI_Group group2, int *ranks2) +AMPI_FUNC(int, MPI_Group_compare, MPI_Group group1,MPI_Group group2, int *result) +AMPI_FUNC(int, MPI_Comm_group, MPI_Comm comm, MPI_Group *group) +AMPI_FUNC(int, MPI_Group_union, MPI_Group group1, MPI_Group group2, MPI_Group *newgroup) +AMPI_FUNC(int, MPI_Group_intersection, MPI_Group group1, MPI_Group group2, MPI_Group *newgroup) +AMPI_FUNC(int, MPI_Group_difference, MPI_Group group1, MPI_Group group2, MPI_Group *newgroup) +AMPI_FUNC(int, MPI_Group_incl, MPI_Group group, int n, const int *ranks, MPI_Group *newgroup) +AMPI_FUNC(int, MPI_Group_excl, MPI_Group group, int n, const int *ranks, MPI_Group *newgroup) +AMPI_FUNC(int, MPI_Group_range_incl, MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup) +AMPI_FUNC(int, MPI_Group_range_excl, MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup) +AMPI_FUNC(int, MPI_Group_free, MPI_Group *group) + +/***communicators***/ +AMPI_FUNC(int, MPI_Intercomm_create, MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm, + int remote_leader, int tag, MPI_Comm *newintercomm) +AMPI_FUNC(int, MPI_Intercomm_merge, MPI_Comm intercomm, int high, MPI_Comm *newintracomm) +AMPI_FUNC(int, MPI_Comm_create, MPI_Comm comm, MPI_Group group, MPI_Comm* newcomm) +AMPI_FUNC(int, MPI_Comm_create_group, MPI_Comm comm, MPI_Group group, int tag, MPI_Comm *newcomm) +AMPI_FUNC(int, MPI_Comm_size, MPI_Comm comm, int *size) +AMPI_FUNC(int, MPI_Comm_rank, MPI_Comm comm, int *rank) +AMPI_FUNC(int, MPI_Comm_compare, MPI_Comm comm1,MPI_Comm comm2, int *result) +AMPI_FUNC(int, MPI_Comm_split, MPI_Comm src, int color, int key, MPI_Comm *dest) +AMPI_FUNC(int, MPI_Comm_split_type, MPI_Comm src, int split_type, int key, MPI_Info info, MPI_Comm *dest) +AMPI_FUNC(int, MPI_Comm_dup, MPI_Comm src, MPI_Comm *dest) +AMPI_FUNC(int, MPI_Comm_idup, MPI_Comm comm, MPI_Comm *newcomm, MPI_Request *request) +AMPI_FUNC(int, MPI_Comm_dup_with_info, MPI_Comm src, MPI_Info info, MPI_Comm *dest) +AMPI_FUNC(int, MPI_Comm_idup_with_info, MPI_Comm src, MPI_Info info, MPI_Comm *dest, MPI_Request *request) +AMPI_FUNC(int, MPI_Comm_free, MPI_Comm *comm) +AMPI_FUNC(int, MPI_Comm_test_inter, MPI_Comm comm, int *flag) +AMPI_FUNC(int, MPI_Comm_remote_size, MPI_Comm comm, int *size) +AMPI_FUNC(int, MPI_Comm_remote_group, MPI_Comm comm, MPI_Group *group) +AMPI_FUNC(int, MPI_Comm_set_name, MPI_Comm comm, const char *name) +AMPI_FUNC(int, MPI_Comm_get_name, MPI_Comm comm, char *comm_name, int *resultlen) +AMPI_FUNC(int, MPI_Comm_set_info, MPI_Comm comm, MPI_Info info) +AMPI_FUNC(int, MPI_Comm_get_info, MPI_Comm comm, MPI_Info *info) +AMPI_FUNC(int, MPI_Comm_call_errhandler, MPI_Comm comm, int errorcode) +AMPI_FUNC(int, MPI_Comm_create_errhandler, MPI_Comm_errhandler_fn *function, MPI_Errhandler *errhandler) +AMPI_FUNC(int, MPI_Comm_set_errhandler, MPI_Comm comm, MPI_Errhandler errhandler) +AMPI_FUNC(int, MPI_Comm_get_errhandler, MPI_Comm comm, MPI_Errhandler *errhandler) +AMPI_FUNC(int, MPI_Comm_free_errhandler, MPI_Errhandler *errhandler) +AMPI_FUNC(int, MPI_Comm_create_keyval, MPI_Comm_copy_attr_function *copy_fn, MPI_Comm_delete_attr_function *delete_fn, + int *keyval, void* extra_state) +AMPI_FUNC(int, MPI_Comm_free_keyval, int *keyval) +AMPI_FUNC(int, MPI_Comm_set_attr, MPI_Comm comm, int keyval, void* attribute_val) +AMPI_FUNC(int, MPI_Comm_get_attr, MPI_Comm comm, int keyval, void *attribute_val, int *flag) +AMPI_FUNC(int, MPI_Comm_delete_attr, MPI_Comm comm, int keyval) + +/***keyvals/attributes***/ +AMPI_FUNC(int, MPI_Keyval_create, MPI_Copy_function *copy_fn, MPI_Delete_function *delete_fn, + int *keyval, void* extra_state) +AMPI_FUNC(int, MPI_Keyval_free, int *keyval) +AMPI_FUNC(int, MPI_Attr_put, MPI_Comm comm, int keyval, void* attribute_val) +AMPI_FUNC(int, MPI_Attr_get, MPI_Comm comm, int keyval, void *attribute_val, int *flag) +AMPI_FUNC(int, MPI_Attr_delete, MPI_Comm comm, int keyval) + +/***topologies***/ +AMPI_FUNC(int, MPI_Cart_create, MPI_Comm comm_old, int ndims, const int *dims, + const int *periods, int reorder, MPI_Comm *comm_cart) +AMPI_FUNC(int, MPI_Graph_create, MPI_Comm comm_old, int nnodes, const int *index, + const int *edges, int reorder, MPI_Comm *comm_graph) +AMPI_FUNC(int, MPI_Dist_graph_create_adjacent, MPI_Comm comm_old, int indegree, const int sources[], + const int sourceweights[], int outdegree, + const int destinations[], const int destweights[], + MPI_Info info, int reorder, MPI_Comm *comm_dist_graph) +AMPI_FUNC(int, MPI_Dist_graph_create, MPI_Comm comm_old, int n, const int sources[], const int degrees[], + const int destintations[], const int weights[], MPI_Info info, + int reorder, MPI_Comm *comm_dist_graph) +AMPI_FUNC(int, MPI_Topo_test, MPI_Comm comm, int *status) +AMPI_FUNC(int, MPI_Cart_map, MPI_Comm comm, int ndims, const int *dims, const int *periods, + int *newrank) +AMPI_FUNC(int, MPI_Graph_map, MPI_Comm comm, int nnodes, const int *index, const int *edges, + int *newrank) +AMPI_FUNC(int, MPI_Cartdim_get, MPI_Comm comm, int *ndims) +AMPI_FUNC(int, MPI_Cart_get, MPI_Comm comm, int maxdims, int *dims, int *periods, int *coords) +AMPI_FUNC(int, MPI_Cart_rank, MPI_Comm comm, const int *coords, int *rank) +AMPI_FUNC(int, MPI_Cart_coords, MPI_Comm comm, int rank, int maxdims, int *coords) +AMPI_FUNC(int, MPI_Cart_shift, MPI_Comm comm, int direction, int disp, int *rank_source, int *rank_dest) +AMPI_FUNC(int, MPI_Graphdims_get, MPI_Comm comm, int *nnodes, int *nedges) +AMPI_FUNC(int, MPI_Graph_get, MPI_Comm comm, int maxindex, int maxedges, int *index, int *edges) +AMPI_FUNC(int, MPI_Graph_neighbors_count, MPI_Comm comm, int rank, int *nneighbors) +AMPI_FUNC(int, MPI_Graph_neighbors, MPI_Comm comm, int rank, int maxneighbors, int *neighbors) +AMPI_FUNC(int, MPI_Dims_create, int nnodes, int ndims, int *dims) +AMPI_FUNC(int, MPI_Cart_sub, MPI_Comm comm, const int *remain_dims, MPI_Comm *newcomm) +AMPI_FUNC(int, MPI_Dist_graph_neighbors, MPI_Comm comm, int maxindegree, int sources[], int sourceweights[], + int maxoutdegree, int destinations[], int destweights[]) +AMPI_FUNC(int, MPI_Dist_graph_neighbors_count, MPI_Comm comm, int *indegree, int *outdegree, int *weighted) + +/***environment management***/ +AMPI_FUNC(int, MPI_Errhandler_create, MPI_Handler_function *function, MPI_Errhandler *errhandler) +AMPI_FUNC(int, MPI_Errhandler_set, MPI_Comm comm, MPI_Errhandler errhandler) +AMPI_FUNC(int, MPI_Errhandler_get, MPI_Comm comm, MPI_Errhandler *errhandler) +AMPI_FUNC(int, MPI_Errhandler_free, MPI_Errhandler *errhandler) +AMPI_FUNC(int, MPI_Add_error_code, int errorclass, int *errorcode) +AMPI_FUNC(int, MPI_Add_error_class, int *errorclass) +AMPI_FUNC(int, MPI_Add_error_string, int errorcode, const char *errorstring) +AMPI_FUNC(int, MPI_Error_class, int errorcode, int *errorclass) +AMPI_FUNC(int, MPI_Error_string, int errorcode, char *string, int *resultlen) +AMPI_FUNC(int, MPI_Get_version, int *version, int *subversion) +AMPI_FUNC(int, MPI_Get_library_version, char *version, int *resultlen) +AMPI_FUNC(int, MPI_Get_processor_name, char *name, int *resultlen) +AMPI_FUNC(double, MPI_Wtime, void) +AMPI_FUNC(double, MPI_Wtick, void) +AMPI_FUNC(int, MPI_Is_thread_main, int *flag) +AMPI_FUNC(int, MPI_Query_thread, int *provided) +AMPI_FUNC(int, MPI_Init_thread, int *argc, char*** argv, int required, int *provided) +AMPI_FUNC(int, MPI_Init, int *argc, char*** argv) +AMPI_FUNC(int, MPI_Initialized, int *isInit) +AMPI_FUNC(int, MPI_Finalize, void) +AMPI_FUNC(int, MPI_Finalized, int *finalized) +AMPI_FUNC(int, MPI_Abort, MPI_Comm comm, int errorcode) +AMPI_FUNC(int, MPI_Pcontrol, const int level, ...) + +/*********************One sided communication routines *****************/ +#ifndef MPI_WIN_NULL_DELETE_FN +#define MPI_WIN_NULL_DELETE_FN MPI_win_null_delete_fn +#endif +#ifndef MPI_WIN_NULL_COPY_FN +#define MPI_WIN_NULL_COPY_FN MPI_win_null_copy_fn +#endif +#ifndef MPI_WIN_DUP_FN +#define MPI_WIN_DUP_FN MPI_win_dup_fn +#endif + +AMPI_CUSTOM_FUNC(int, MPI_WIN_NULL_COPY_FN , MPI_Win, int, void *, void *, void *, int * ) +AMPI_CUSTOM_FUNC(int, MPI_WIN_NULL_DELETE_FN , MPI_Win, int, void *, void * ) +AMPI_CUSTOM_FUNC(int, MPI_WIN_DUP_FN , MPI_Win, int, void *, void *, void *, int * ) + +/***windows/rma***/ +AMPI_FUNC(int, MPI_Win_create, void *base, MPI_Aint size, int disp_unit, + MPI_Info info, MPI_Comm comm, MPI_Win *newwin) +AMPI_FUNC(int, MPI_Win_free, MPI_Win *win) +AMPI_FUNC(int, MPI_Win_create_errhandler, MPI_Win_errhandler_function *win_errhandler_fn, + MPI_Errhandler *errhandler) +AMPI_FUNC(int, MPI_Win_call_errhandler, MPI_Win win, int errorcode) +AMPI_FUNC(int, MPI_Win_get_errhandler, MPI_Win win, MPI_Errhandler *errhandler) +AMPI_FUNC(int, MPI_Win_set_errhandler, MPI_Win win, MPI_Errhandler errhandler) +AMPI_FUNC(int, MPI_Win_create_keyval, MPI_Win_copy_attr_function *copy_fn, + MPI_Win_delete_attr_function *delete_fn, + int *keyval, void *extra_state) +AMPI_FUNC(int, MPI_Win_free_keyval, int *keyval) +AMPI_FUNC(int, MPI_Win_delete_attr, MPI_Win win, int key) +AMPI_FUNC(int, MPI_Win_get_attr, MPI_Win win, int win_keyval, void *attribute_val, int *flag) +AMPI_FUNC(int, MPI_Win_set_attr, MPI_Win win, int win_keyval, void *attribute_val) +AMPI_FUNC(int, MPI_Win_get_group, MPI_Win win, MPI_Group *group) +AMPI_FUNC(int, MPI_Win_set_name, MPI_Win win, const char *name) +AMPI_FUNC(int, MPI_Win_get_name, MPI_Win win, char *name, int *length) +AMPI_FUNC(int, MPI_Win_set_info, MPI_Win win, MPI_Info info) +AMPI_FUNC(int, MPI_Win_get_info, MPI_Win win, MPI_Info *info) +AMPI_FUNC(int, MPI_Win_fence, int assertion, MPI_Win win) +AMPI_FUNC(int, MPI_Win_lock, int lock_type, int rank, int assert, MPI_Win win) +AMPI_FUNC(int, MPI_Win_unlock, int rank, MPI_Win win) +AMPI_FUNC(int, MPI_Win_post, MPI_Group group, int assertion, MPI_Win win) +AMPI_FUNC(int, MPI_Win_wait, MPI_Win win) +AMPI_FUNC(int, MPI_Win_start, MPI_Group group, int assertion, MPI_Win win) +AMPI_FUNC(int, MPI_Win_complete, MPI_Win win) +AMPI_FUNC(int, MPI_Win_test, MPI_Win win, int *flag) +AMPI_FUNC(int, MPI_Alloc_mem, MPI_Aint size, MPI_Info info, void *baseptr) +AMPI_FUNC(int, MPI_Free_mem, void *base) +AMPI_FUNC(int, MPI_Put, const void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank, + MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, MPI_Win win) +AMPI_FUNC(int, MPI_Get, void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank, + MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, MPI_Win win) +AMPI_FUNC(int, MPI_Accumulate, const void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank, + MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, + MPI_Op op, MPI_Win win) +AMPI_FUNC(int, MPI_Get_accumulate, const void *orgaddr, int orgcnt, MPI_Datatype orgtype, + void *resaddr, int rescnt, MPI_Datatype restype, + int rank, MPI_Aint targdisp, int targcnt, + MPI_Datatype targtype, MPI_Op op, MPI_Win win) +AMPI_FUNC(int, MPI_Rput, const void *orgaddr, int orgcnt, MPI_Datatype orgtype, int targrank, + MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, MPI_Win win, + MPI_Request *request) +AMPI_FUNC(int, MPI_Rget, void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank, + MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, MPI_Win win, + MPI_Request *request) +AMPI_FUNC(int, MPI_Raccumulate, const void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank, + MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, + MPI_Op op, MPI_Win win, MPI_Request *request) +AMPI_FUNC(int, MPI_Rget_accumulate, const void *orgaddr, int orgcnt, MPI_Datatype orgtype, + void *resaddr, int rescnt, MPI_Datatype restype, + int rank, MPI_Aint targdisp, int targcnt, + MPI_Datatype targtype, MPI_Op op, MPI_Win win, + MPI_Request *request) +AMPI_FUNC(int, MPI_Fetch_and_op, const void *orgaddr, void *resaddr, MPI_Datatype type, + int rank, MPI_Aint targdisp, MPI_Op op, MPI_Win win) +AMPI_FUNC(int, MPI_Compare_and_swap, const void *orgaddr, const void *compaddr, void *resaddr, + MPI_Datatype type, int rank, MPI_Aint targdisp, + MPI_Win win) + +/***infos***/ +AMPI_FUNC(int, MPI_Info_create, MPI_Info *info) +AMPI_FUNC(int, MPI_Info_set, MPI_Info info, const char *key, const char *value) +AMPI_FUNC(int, MPI_Info_delete, MPI_Info info, const char *key) +AMPI_FUNC(int, MPI_Info_get, MPI_Info info, const char *key, int valuelen, char *value, int *flag) +AMPI_FUNC(int, MPI_Info_get_valuelen, MPI_Info info, const char *key, int *valuelen, int *flag) +AMPI_FUNC(int, MPI_Info_get_nkeys, MPI_Info info, int *nkeys) +AMPI_FUNC(int, MPI_Info_get_nthkey, MPI_Info info, int n, char *key) +AMPI_FUNC(int, MPI_Info_dup, MPI_Info info, MPI_Info *newinfo) +AMPI_FUNC(int, MPI_Info_free, MPI_Info *info) + + +/***MPIX***/ +AMPI_FUNC(int, MPIX_Grequest_start, MPI_Grequest_query_function *query_fn, + MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, + MPIX_Grequest_poll_function *poll_fn, void *extra_state, MPI_Request *request) +AMPI_FUNC(int, MPIX_Grequest_class_create, MPI_Grequest_query_function *query_fn, + MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, + MPIX_Grequest_poll_function *poll_fn, MPIX_Grequest_wait_function *wait_fn, + MPIX_Grequest_class *greq_class) +AMPI_FUNC(int, MPIX_Grequest_class_allocate, MPIX_Grequest_class greq_class, + void *extra_state, MPI_Request *request) + + +#include "mpio_functions.h" + + +/*** AMPI Extensions ***/ +AMPI_CUSTOM_FUNC(int, AMPI_Migrate, MPI_Info hints) +AMPI_CUSTOM_FUNC(int, AMPI_Load_start_measure, void) +AMPI_CUSTOM_FUNC(int, AMPI_Load_stop_measure, void) +AMPI_CUSTOM_FUNC(int, AMPI_Load_reset_measure, void) +AMPI_CUSTOM_FUNC(int, AMPI_Load_set_value, double value) +AMPI_CUSTOM_FUNC(int, AMPI_Migrate_to_pe, int dest) +AMPI_CUSTOM_FUNC(int, AMPI_Set_migratable, int mig) +AMPI_CUSTOM_FUNC(int, AMPI_Register_pup, MPI_PupFn fn, void *data, int *idx) +AMPI_CUSTOM_FUNC(int, AMPI_Get_pup_data, int idx, void *data) +AMPI_CUSTOM_FUNC(int, AMPI_Register_main, MPI_MainFn mainFn, const char *name) +AMPI_CUSTOM_FUNC(int, AMPI_Register_about_to_migrate, MPI_MigrateFn fn) +AMPI_CUSTOM_FUNC(int, AMPI_Register_just_migrated, MPI_MigrateFn fn) +AMPI_CUSTOM_FUNC(int, AMPI_Iget, MPI_Aint orgdisp, int orgcnt, MPI_Datatype orgtype, int rank, + MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, + MPI_Win win, MPI_Request *request) +AMPI_CUSTOM_FUNC(int, AMPI_Iget_wait, MPI_Request *request, MPI_Status *status, MPI_Win win) +AMPI_CUSTOM_FUNC(int, AMPI_Iget_free, MPI_Request *request, MPI_Status *status, MPI_Win win) +AMPI_CUSTOM_FUNC(int, AMPI_Iget_data, void *data, MPI_Status status) +AMPI_CUSTOM_FUNC(int, AMPI_Type_is_contiguous, MPI_Datatype datatype, int *flag) +#if CMK_FAULT_EVAC +AMPI_CUSTOM_FUNC(int, AMPI_Evacuate, void) +#endif +AMPI_CUSTOM_FUNC(int, AMPI_Yield, void) +AMPI_CUSTOM_FUNC(int, AMPI_Suspend, void) +AMPI_CUSTOM_FUNC(int, AMPI_Resume, int dest, MPI_Comm comm) +AMPI_CUSTOM_FUNC(int, AMPI_Print, const char *str) +AMPI_CUSTOM_FUNC(int, AMPI_Trace_begin, void) +AMPI_CUSTOM_FUNC(int, AMPI_Trace_end, void) +AMPI_CUSTOM_FUNC(int, AMPI_Alltoall_medium, void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + MPI_Comm comm) +AMPI_CUSTOM_FUNC(int, AMPI_Alltoall_long, void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + MPI_Comm comm) + +#if CMK_BIGSIM_CHARM +AMPI_CUSTOM_FUNC(int, AMPI_Set_start_event, MPI_Comm comm) +AMPI_CUSTOM_FUNC(int, AMPI_Set_end_event, void) +AMPI_CUSTOM_FUNC(void, beginTraceBigSim, char* msg) +AMPI_CUSTOM_FUNC(void, endTraceBigSim, char* msg, char* param) +#endif + +#ifdef __cplusplus +#if CMK_CUDA +AMPI_CUSTOM_FUNC(int, AMPI_GPU_Iinvoke_wr, hapiWorkRequest *to_call, MPI_Request *request) +AMPI_CUSTOM_FUNC(int, AMPI_GPU_Iinvoke, cudaStream_t stream, MPI_Request *request) +AMPI_CUSTOM_FUNC(int, AMPI_GPU_Invoke_wr, hapiWorkRequest *to_call) +AMPI_CUSTOM_FUNC(int, AMPI_GPU_Invoke, cudaStream_t stream) +#endif +#endif + +/* Execute this shell command , just like "system, )") */ +AMPI_CUSTOM_FUNC(int, AMPI_System, const char *cmd) + +/* Determine approximate depth of stack at the point of this call */ +AMPI_CUSTOM_FUNC(long, ampiCurrentStackUsage, void) + +#endif /* !defined AMPI_NOIMPL_ONLY */ + + +/* Functions unsupported in AMPI */ + +/* Disable deprecation warnings added in ampi.h */ +#if defined __GNUC__ || defined __clang__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#elif defined _MSC_VER +# pragma warning(push) +# pragma warning(disable : 4996) +#elif defined __INTEL_COMPILER +# pragma warning push +# pragma warning disable 1478 +#endif + +#ifndef AMPI_FUNC_NOIMPL +# error You must define AMPI_FUNC_NOIMPL before including this file! +#endif + +/* MPI 3.1 standards compliance overview. + * This list contains all MPI functions not supported in AMPI currently. +*/ + +/* A.2.1 Point-to-Point Communication C Bindings */ + +/* A.2.2 Datatypes C Bindings */ + +AMPI_FUNC_NOIMPL(int, MPI_Pack_external, const char datarep[], const void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outsize, MPI_Aint *position) +AMPI_FUNC_NOIMPL(int, MPI_Pack_external_size, const char datarep[], int incount, MPI_Datatype datatype, MPI_Aint *size) +AMPI_FUNC_NOIMPL(int, MPI_Unpack_external, const char datarep[], const void *inbuf, MPI_Aint insize, MPI_Aint *position, void *outbuf, int outcount, MPI_Datatype datatype) + +/* A.2.3 Collective Communication C Bindings */ + +/* A.2.4 Groups, Contexts, Communicators, and Caching C Bindings */ + +/* A.2.6 MPI Environmental Management C Bindings */ + +AMPI_FUNC_NOIMPL(int, MPI_File_call_errhandler, MPI_File fh, int errorcode) +AMPI_FUNC_NOIMPL(int, MPI_File_create_errhandler, MPI_File_errhandler_function *file_errhandler_fn, MPI_Errhandler *errhandler) +AMPI_FUNC_NOIMPL(int, MPI_File_get_errhandler, MPI_File file, MPI_Errhandler *errhandler) +AMPI_FUNC_NOIMPL(int, MPI_File_set_errhandler, MPI_File file, MPI_Errhandler errhandler) + + +/* A.2.7 The Info Object C Bindings */ + +/* A.2.8 Process Creation and Management C Bindings */ + +AMPI_FUNC_NOIMPL(int, MPI_Close_port, const char *port_name) +AMPI_FUNC_NOIMPL(int, MPI_Comm_accept, const char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm) +AMPI_FUNC_NOIMPL(int, MPI_Comm_connect, const char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm) +AMPI_FUNC_NOIMPL(int, MPI_Comm_disconnect, MPI_Comm *comm) +AMPI_FUNC_NOIMPL(int, MPI_Comm_get_parent, MPI_Comm *parent) +AMPI_FUNC_NOIMPL(int, MPI_Comm_join, int fd, MPI_Comm *intercomm) +AMPI_FUNC_NOIMPL(int, MPI_Comm_spawn, const char *command, char *argv[], int maxprocs, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *intercomm, int array_of_errcodes[]) +AMPI_FUNC_NOIMPL(int, MPI_Comm_spawn_multiple, int count, char *array_of_commands[], char **array_of_argv[], const int array_of_maxprocs[], const MPI_Info array_of_info[], int root, MPI_Comm comm, MPI_Comm *intercomm, int array_of_errcodes[]) +AMPI_FUNC_NOIMPL(int, MPI_Lookup_name, const char *service_name, MPI_Info info, char *port_name) +AMPI_FUNC_NOIMPL(int, MPI_Open_port, MPI_Info info, char *port_name) +AMPI_FUNC_NOIMPL(int, MPI_Publish_name, const char *service_name, MPI_Info info, const char *port_name) +AMPI_FUNC_NOIMPL(int, MPI_Unpublish_name, const char *service_name, MPI_Info info, const char *port_name) + + +/* A.2.9 One-Sided Communications C Bindings */ + +AMPI_FUNC_NOIMPL(int, MPI_Win_allocate, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *baseptr, MPI_Win *win) +AMPI_FUNC_NOIMPL(int, MPI_Win_allocate_shared, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *baseptr, MPI_Win *win) +AMPI_FUNC_NOIMPL(int, MPI_Win_attach, MPI_Win win, void *base, MPI_Aint size) +AMPI_FUNC_NOIMPL(int, MPI_Win_create_dynamic, MPI_Info info, MPI_Comm comm, MPI_Win *win) +AMPI_FUNC_NOIMPL(int, MPI_Win_detach, MPI_Win win, const void *base) +AMPI_FUNC_NOIMPL(int, MPI_Win_flush, int rank, MPI_Win win) +AMPI_FUNC_NOIMPL(int, MPI_Win_flush_all, MPI_Win win) +AMPI_FUNC_NOIMPL(int, MPI_Win_flush_local, int rank, MPI_Win win) +AMPI_FUNC_NOIMPL(int, MPI_Win_flush_local_all, MPI_Win win) +AMPI_FUNC_NOIMPL(int, MPI_Win_lock_all, int assert, MPI_Win win) +AMPI_FUNC_NOIMPL(int, MPI_Win_shared_query, MPI_Win win, int rank, MPI_Aint *size, int *disp_unit, void *baseptr) +AMPI_FUNC_NOIMPL(int, MPI_Win_sync, MPI_Win win) +AMPI_FUNC_NOIMPL(int, MPI_Win_unlock_all, MPI_Win win) + + +/* A.2.10 External Interfaces C Bindings */ + +/* A.2.11 I/O C Bindings */ + +AMPI_FUNC_NOIMPL(int, MPI_CONVERSION_FN_NULL, void *userbuf, MPI_Datatype datatype, int count, void *filebuf, MPI_Offset position, void *extra_state) +AMPI_FUNC_NOIMPL(int, MPI_File_iread_all, MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request) +AMPI_FUNC_NOIMPL(int, MPI_File_iread_at_all, MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request) +AMPI_FUNC_NOIMPL(int, MPI_File_iwrite_all, MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request) +AMPI_FUNC_NOIMPL(int, MPI_File_iwrite_at_all, MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request) +// AMPI_FUNC_NOIMPL(int, MPI_Register_datarep, const char *datarep, MPI_Datarep_conversion_function *read_conversion_fn, MPI_Datarep_conversion_function *write_conversion_fn, MPI_Datarep_extent_function *dtype_file_extent_fn, void *extra_state) //Provided by ROMIO + + +/* A.2.12 Language Bindings C Bindings */ + +AMPI_FUNC_NOIMPL(int, MPI_Status_f082f, MPI_F08_status *f08_status, MPI_Fint *f_status) +AMPI_FUNC_NOIMPL(int, MPI_Status_f2f08, MPI_Fint *f_status, MPI_F08_status *f08_status) +AMPI_FUNC_NOIMPL(int, MPI_Type_create_f90_complex, int p, int r, MPI_Datatype *newtype) +AMPI_FUNC_NOIMPL(int, MPI_Type_create_f90_integer, int r, MPI_Datatype *newtype) +AMPI_FUNC_NOIMPL(int, MPI_Type_create_f90_real, int p, int r, MPI_Datatype *newtype) +AMPI_FUNC_NOIMPL(int, MPI_Type_match_size, int typeclass, int size, MPI_Datatype *datatype) +AMPI_FUNC_NOIMPL(MPI_Fint, MPI_Message_c2f, MPI_Message message) +AMPI_FUNC_NOIMPL(MPI_Message, MPI_Message_f2c, MPI_Fint message) +AMPI_FUNC_NOIMPL(int, MPI_Status_c2f, const MPI_Status *c_status, MPI_Fint *f_status) +AMPI_FUNC_NOIMPL(int, MPI_Status_c2f08, const MPI_Status *c_status, MPI_F08_status *f08_status) +AMPI_FUNC_NOIMPL(int, MPI_Status_f082c, const MPI_F08_status *f08_status, MPI_Status *c_status) +AMPI_FUNC_NOIMPL(int, MPI_Status_f2c, const MPI_Fint *f_status, MPI_Status *c_status) + + +/* A.2.14 Tools / MPI Tool Information Interface C Bindings */ + +AMPI_FUNC_NOIMPL(int, MPI_T_category_changed, int *stamp) +AMPI_FUNC_NOIMPL(int, MPI_T_category_get_categories, int cat_index, int len, int indices[]) +AMPI_FUNC_NOIMPL(int, MPI_T_category_get_cvars, int cat_index, int len, int indices[]) +AMPI_FUNC_NOIMPL(int, MPI_T_category_get_index, const char *name, int *cat_index) +AMPI_FUNC_NOIMPL(int, MPI_T_category_get_info, int cat_index, char *name, int *name_len, char *desc, int *desc_len, int *num_cvars, int *num_pvars, int *num_categories) +AMPI_FUNC_NOIMPL(int, MPI_T_category_get_num, int *num_cat) +AMPI_FUNC_NOIMPL(int, MPI_T_category_get_pvars, int cat_index, int len, int indices[]) +AMPI_FUNC_NOIMPL(int, MPI_T_cvar_get_index, const char *name, int *cvar_index) +AMPI_FUNC_NOIMPL(int, MPI_T_cvar_get_info, int cvar_index, char *name, int *name_len, int *verbosity, MPI_Datatype *datatype, MPI_T_enum *enumtype, char *desc, int *desc_len, int *bind, int *scope) +AMPI_FUNC_NOIMPL(int, MPI_T_cvar_get_num, int *num_cvar) +AMPI_FUNC_NOIMPL(int, MPI_T_cvar_handle_alloc, int cvar_index, void *obj_handle, MPI_T_cvar_handle *handle, int *count) +AMPI_FUNC_NOIMPL(int, MPI_T_cvar_handle_free, MPI_T_cvar_handle *handle) +AMPI_FUNC_NOIMPL(int, MPI_T_cvar_read, MPI_T_cvar_handle handle, void* buf) +AMPI_FUNC_NOIMPL(int, MPI_T_cvar_write, MPI_T_cvar_handle handle, const void* buf) +AMPI_FUNC_NOIMPL(int, MPI_T_enum_get_info, MPI_T_enum enumtype, int *num, char *name, int *name_len) +AMPI_FUNC_NOIMPL(int, MPI_T_enum_get_item, MPI_T_enum enumtype, int index, int *value, char *name, int *name_len) +AMPI_FUNC_NOIMPL(int, MPI_T_finalize, void) +AMPI_FUNC_NOIMPL(int, MPI_T_init_thread, int required, int *provided) +AMPI_FUNC_NOIMPL(int, MPI_T_pvar_get_index, const char *name, int var_class, int *pvar_index) +AMPI_FUNC_NOIMPL(int, MPI_T_pvar_get_info, int pvar_index, char *name, int *name_len, int *verbosity, int *var_class, MPI_Datatype *datatype, MPI_T_enum *enumtype, char *desc, int *desc_len, int *bind, int *readonly, int *continuous, int *atomic) +AMPI_FUNC_NOIMPL(int, MPI_T_pvar_get_num, int *num_pvar) +AMPI_FUNC_NOIMPL(int, MPI_T_pvar_handle_alloc, MPI_T_pvar_session session, int pvar_index, void *obj_handle, MPI_T_pvar_handle *handle, int *count) +AMPI_FUNC_NOIMPL(int, MPI_T_pvar_handle_free, MPI_T_pvar_session session,MPI_T_pvar_handle *handle) +AMPI_FUNC_NOIMPL(int, MPI_T_pvar_read, MPI_T_pvar_session session, MPI_T_pvar_handle handle,void* buf) +AMPI_FUNC_NOIMPL(int, MPI_T_pvar_readreset, MPI_T_pvar_session session,MPI_T_pvar_handle handle, void* buf) +AMPI_FUNC_NOIMPL(int, MPI_T_pvar_reset, MPI_T_pvar_session session, MPI_T_pvar_handle handle) +AMPI_FUNC_NOIMPL(int, MPI_T_pvar_session_create, MPI_T_pvar_session *session) +AMPI_FUNC_NOIMPL(int, MPI_T_pvar_session_free, MPI_T_pvar_session *session) +AMPI_FUNC_NOIMPL(int, MPI_T_pvar_start, MPI_T_pvar_session session, MPI_T_pvar_handle handle) +AMPI_FUNC_NOIMPL(int, MPI_T_pvar_stop, MPI_T_pvar_session session, MPI_T_pvar_handle handle) +AMPI_FUNC_NOIMPL(int, MPI_T_pvar_write, MPI_T_pvar_session session, MPI_T_pvar_handle handle, const void* buf) + + +/* A.2.15 Deprecated C Bindings */ + + +#if defined __GNUC__ || defined __clang__ +# pragma GCC diagnostic pop +#elif defined _MSC_VER +# pragma warning(pop) +#elif defined __INTEL_COMPILER +# pragma warning pop +#endif diff --git a/src/libs/ck-libs/ampi/ampi_noimpl.C b/src/libs/ck-libs/ampi/ampi_noimpl.C dissimilarity index 96% index ba8077370d..401ad06d95 100644 --- a/src/libs/ck-libs/ampi/ampi_noimpl.C +++ b/src/libs/ck-libs/ampi/ampi_noimpl.C @@ -1,147 +1,19 @@ -#include "ampiimpl.h" - -/* -This file contains function definitions of all MPI functions that are currently -unsupported in AMPI. Calling these functions aborts the application. -*/ - -#define AMPI_API_NOIMPL(return_type, function_name, ...) \ - AMPI_API_IMPL(return_type, function_name, __VA_ARGS__) \ - { \ - AMPI_API(STRINGIFY(function_name)); \ - CkAbort(STRINGIFY(function_name) " is not implemented in AMPI."); \ - } - - -/* Disable deprecation warnings added in ampi.h */ - -#if defined __GNUC__ || defined __clang__ -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#elif defined _MSC_VER -# pragma warning(push) -# pragma warning(disable : 4996) -#elif defined __INTEL_COMPILER -# pragma warning push -# pragma warning disable 1478 -#endif - - -/* A.2.2 Datatypes C Bindings */ - -AMPI_API_NOIMPL(int, MPI_Pack_external, const char datarep[], const void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outsize, MPI_Aint *position) -AMPI_API_NOIMPL(int, MPI_Pack_external_size, const char datarep[], int incount, MPI_Datatype datatype, MPI_Aint *size) -// AMPI_API_NOIMPL(int, MPI_Type_create_darray, int size, int rank, int ndims, const int array_of_gsizes[], const int array_of_distribs[], const int array_of_dargs[], const int array_of_psizes[], int order, MPI_Datatype oldtype, MPI_Datatype *newtype) //provided by ROMIO -// AMPI_API_NOIMPL(int, MPI_Type_create_subarray, int ndims, const int array_of_sizes[], const int array_of_subsizes[], const int array_of_starts[], int order, MPI_Datatype oldtype, MPI_Datatype *newtype) //provided by ROMIO -AMPI_API_NOIMPL(int, MPI_Unpack_external, const char datarep[], const void *inbuf, MPI_Aint insize, MPI_Aint *position, void *outbuf, int outcount, MPI_Datatype datatype) - - -/* A.2.6 MPI Environmental Management C Bindings */ - -AMPI_API_NOIMPL(int, MPI_File_call_errhandler, MPI_File fh, int errorcode) -AMPI_API_NOIMPL(int, MPI_File_create_errhandler, MPI_File_errhandler_function *file_errhandler_fn, MPI_Errhandler *errhandler) -AMPI_API_NOIMPL(int, MPI_File_get_errhandler, MPI_File file, MPI_Errhandler *errhandler) -AMPI_API_NOIMPL(int, MPI_File_set_errhandler, MPI_File file, MPI_Errhandler errhandler) - - -/* A.2.8 Process Creation and Management C Bindings */ - -AMPI_API_NOIMPL(int, MPI_Close_port, const char *port_name) -AMPI_API_NOIMPL(int, MPI_Comm_accept, const char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm) -AMPI_API_NOIMPL(int, MPI_Comm_connect, const char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm) -AMPI_API_NOIMPL(int, MPI_Comm_disconnect, MPI_Comm *comm) -AMPI_API_NOIMPL(int, MPI_Comm_get_parent, MPI_Comm *parent) -AMPI_API_NOIMPL(int, MPI_Comm_join, int fd, MPI_Comm *intercomm) -AMPI_API_NOIMPL(int, MPI_Comm_spawn, const char *command, char *argv[], int maxprocs, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *intercomm, int array_of_errcodes[]) -AMPI_API_NOIMPL(int, MPI_Comm_spawn_multiple, int count, char *array_of_commands[], char **array_of_argv[], const int array_of_maxprocs[], const MPI_Info array_of_info[], int root, MPI_Comm comm, MPI_Comm *intercomm, int array_of_errcodes[]) -AMPI_API_NOIMPL(int, MPI_Lookup_name, const char *service_name, MPI_Info info, char *port_name) -AMPI_API_NOIMPL(int, MPI_Open_port, MPI_Info info, char *port_name) -AMPI_API_NOIMPL(int, MPI_Publish_name, const char *service_name, MPI_Info info, const char *port_name) -AMPI_API_NOIMPL(int, MPI_Unpublish_name, const char *service_name, MPI_Info info, const char *port_name) - - -/* A.2.9 One-Sided Communications C Bindings */ - -AMPI_API_NOIMPL(int, MPI_Win_allocate, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *baseptr, MPI_Win *win) -AMPI_API_NOIMPL(int, MPI_Win_allocate_shared, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *baseptr, MPI_Win *win) -AMPI_API_NOIMPL(int, MPI_Win_attach, MPI_Win win, void *base, MPI_Aint size) -AMPI_API_NOIMPL(int, MPI_Win_create_dynamic, MPI_Info info, MPI_Comm comm, MPI_Win *win) -AMPI_API_NOIMPL(int, MPI_Win_detach, MPI_Win win, const void *base) -AMPI_API_NOIMPL(int, MPI_Win_flush, int rank, MPI_Win win) -AMPI_API_NOIMPL(int, MPI_Win_flush_all, MPI_Win win) -AMPI_API_NOIMPL(int, MPI_Win_flush_local, int rank, MPI_Win win) -AMPI_API_NOIMPL(int, MPI_Win_flush_local_all, MPI_Win win) -AMPI_API_NOIMPL(int, MPI_Win_lock_all, int assert, MPI_Win win) -AMPI_API_NOIMPL(int, MPI_Win_shared_query, MPI_Win win, int rank, MPI_Aint *size, int *disp_unit, void *baseptr) -AMPI_API_NOIMPL(int, MPI_Win_sync, MPI_Win win) -AMPI_API_NOIMPL(int, MPI_Win_unlock_all, MPI_Win win) - - -/* A.2.11 I/O C Bindings */ - -AMPI_API_NOIMPL(int, MPI_CONVERSION_FN_NULL, void *userbuf, MPI_Datatype datatype, int count, void *filebuf, MPI_Offset position, void *extra_state) -AMPI_API_NOIMPL(int, MPI_File_iread_all, MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request) -AMPI_API_NOIMPL(int, MPI_File_iread_at_all, MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request) -AMPI_API_NOIMPL(int, MPI_File_iwrite_all, MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request) -AMPI_API_NOIMPL(int, MPI_File_iwrite_at_all, MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request) -// AMPI_API_NOIMPL(int, MPI_Register_datarep, const char *datarep, MPI_Datarep_conversion_function *read_conversion_fn, MPI_Datarep_conversion_function *write_conversion_fn, MPI_Datarep_extent_function *dtype_file_extent_fn, void *extra_state) //Provided by ROMIO - - -/* A.2.12 Language Bindings C Bindings */ - -AMPI_API_NOIMPL(int, MPI_Status_f082f, MPI_F08_status *f08_status, MPI_Fint *f_status) -AMPI_API_NOIMPL(int, MPI_Status_f2f08, MPI_Fint *f_status, MPI_F08_status *f08_status) -AMPI_API_NOIMPL(int, MPI_Type_create_f90_complex, int p, int r, MPI_Datatype *newtype) -AMPI_API_NOIMPL(int, MPI_Type_create_f90_integer, int r, MPI_Datatype *newtype) -AMPI_API_NOIMPL(int, MPI_Type_create_f90_real, int p, int r, MPI_Datatype *newtype) -AMPI_API_NOIMPL(int, MPI_Type_match_size, int typeclass, int size, MPI_Datatype *datatype) -AMPI_API_NOIMPL(MPI_Fint, MPI_Message_c2f, MPI_Message message) -AMPI_API_NOIMPL(MPI_Message, MPI_Message_f2c, MPI_Fint message) -AMPI_API_NOIMPL(int, MPI_Status_c2f, const MPI_Status *c_status, MPI_Fint *f_status) -AMPI_API_NOIMPL(int, MPI_Status_c2f08, const MPI_Status *c_status, MPI_F08_status *f08_status) -AMPI_API_NOIMPL(int, MPI_Status_f082c, const MPI_F08_status *f08_status, MPI_Status *c_status) -AMPI_API_NOIMPL(int, MPI_Status_f2c, const MPI_Fint *f_status, MPI_Status *c_status) - - -/* A.2.14 Tools / MPI Tool Information Interface C Bindings */ - -AMPI_API_NOIMPL(int, MPI_T_category_changed, int *stamp) -AMPI_API_NOIMPL(int, MPI_T_category_get_categories, int cat_index, int len, int indices[]) -AMPI_API_NOIMPL(int, MPI_T_category_get_cvars, int cat_index, int len, int indices[]) -AMPI_API_NOIMPL(int, MPI_T_category_get_index, const char *name, int *cat_index) -AMPI_API_NOIMPL(int, MPI_T_category_get_info, int cat_index, char *name, int *name_len, char *desc, int *desc_len, int *num_cvars, int *num_pvars, int *num_categories) -AMPI_API_NOIMPL(int, MPI_T_category_get_num, int *num_cat) -AMPI_API_NOIMPL(int, MPI_T_category_get_pvars, int cat_index, int len, int indices[]) -AMPI_API_NOIMPL(int, MPI_T_cvar_get_index, const char *name, int *cvar_index) -AMPI_API_NOIMPL(int, MPI_T_cvar_get_info, int cvar_index, char *name, int *name_len, int *verbosity, MPI_Datatype *datatype, MPI_T_enum *enumtype, char *desc, int *desc_len, int *bind, int *scope) -AMPI_API_NOIMPL(int, MPI_T_cvar_get_num, int *num_cvar) -AMPI_API_NOIMPL(int, MPI_T_cvar_handle_alloc, int cvar_index, void *obj_handle, MPI_T_cvar_handle *handle, int *count) -AMPI_API_NOIMPL(int, MPI_T_cvar_handle_free, MPI_T_cvar_handle *handle) -AMPI_API_NOIMPL(int, MPI_T_cvar_read, MPI_T_cvar_handle handle, void* buf) -AMPI_API_NOIMPL(int, MPI_T_cvar_write, MPI_T_cvar_handle handle, const void* buf) -AMPI_API_NOIMPL(int, MPI_T_enum_get_info, MPI_T_enum enumtype, int *num, char *name, int *name_len) -AMPI_API_NOIMPL(int, MPI_T_enum_get_item, MPI_T_enum enumtype, int index, int *value, char *name, int *name_len) -AMPI_API_NOIMPL(int, MPI_T_finalize, void) -AMPI_API_NOIMPL(int, MPI_T_init_thread, int required, int *provided) -AMPI_API_NOIMPL(int, MPI_T_pvar_get_index, const char *name, int var_class, int *pvar_index) -AMPI_API_NOIMPL(int, MPI_T_pvar_get_info, int pvar_index, char *name, int *name_len, int *verbosity, int *var_class, MPI_Datatype *datatype, MPI_T_enum *enumtype, char *desc, int *desc_len, int *bind, int *readonly, int *continuous, int *atomic) -AMPI_API_NOIMPL(int, MPI_T_pvar_get_num, int *num_pvar) -AMPI_API_NOIMPL(int, MPI_T_pvar_handle_alloc, MPI_T_pvar_session session, int pvar_index, void *obj_handle, MPI_T_pvar_handle *handle, int *count) -AMPI_API_NOIMPL(int, MPI_T_pvar_handle_free, MPI_T_pvar_session session,MPI_T_pvar_handle *handle) -AMPI_API_NOIMPL(int, MPI_T_pvar_read, MPI_T_pvar_session session, MPI_T_pvar_handle handle,void* buf) -AMPI_API_NOIMPL(int, MPI_T_pvar_readreset, MPI_T_pvar_session session,MPI_T_pvar_handle handle, void* buf) -AMPI_API_NOIMPL(int, MPI_T_pvar_reset, MPI_T_pvar_session session, MPI_T_pvar_handle handle) -AMPI_API_NOIMPL(int, MPI_T_pvar_session_create, MPI_T_pvar_session *session) -AMPI_API_NOIMPL(int, MPI_T_pvar_session_free, MPI_T_pvar_session *session) -AMPI_API_NOIMPL(int, MPI_T_pvar_start, MPI_T_pvar_session session, MPI_T_pvar_handle handle) -AMPI_API_NOIMPL(int, MPI_T_pvar_stop, MPI_T_pvar_session session, MPI_T_pvar_handle handle) -AMPI_API_NOIMPL(int, MPI_T_pvar_write, MPI_T_pvar_session session, MPI_T_pvar_handle handle, const void* buf) - - -#if defined __GNUC__ || defined __clang__ -# pragma GCC diagnostic pop -#elif defined _MSC_VER -# pragma warning(pop) -#elif defined __INTEL_COMPILER -# pragma warning pop -#endif +#include "ampiimpl.h" + +/* +This file contains function definitions of all MPI functions that are currently +unsupported in AMPI. Calling these functions aborts the application. +*/ + +#define AMPI_NOIMPL_ONLY +#define AMPI_FUNC_NOIMPL(return_type, function_name, ...) \ + AMPI_API_IMPL(return_type, function_name, __VA_ARGS__) \ + { \ + AMPI_API(STRINGIFY(function_name)); \ + CkAbort(STRINGIFY(function_name) " is not implemented in AMPI."); \ + } + +#include "ampi_functions.h" + +#undef AMPI_NOIMPL_ONLY +#undef AMPI_FUNC_NOIMPL diff --git a/src/libs/ck-libs/ampi/ampiimpl.h b/src/libs/ck-libs/ampi/ampiimpl.h index 3c8ee9a491..1cedf8b582 100644 --- a/src/libs/ck-libs/ampi/ampiimpl.h +++ b/src/libs/ck-libs/ampi/ampiimpl.h @@ -25,32 +25,19 @@ using std::vector; * * 2. When AMPI is built on top of MPI, we rename the user's MPI_* calls as AMPI_*. */ -#define STRINGIFY(a) #a - -#if defined(__linux__) - #if CMK_CONVERSE_MPI - #define AMPI_API_IMPL(ret, name, ...) \ - _Pragma(STRINGIFY(weak A##name)) \ - _Pragma(STRINGIFY(weak AP##name = A##name)) \ - CLINKAGE \ - ret A##name(__VA_ARGS__) - #else - #define AMPI_API_IMPL(ret, name, ...) \ - _Pragma(STRINGIFY(weak name)) \ - _Pragma(STRINGIFY(weak P##name = name)) \ - CLINKAGE \ - ret name(__VA_ARGS__) - #endif +#define STRINGIFY_INTERNAL(a) #a +#define STRINGIFY(a) STRINGIFY_INTERNAL(a) + +#if AMPI_HAVE_PMPI + #define AMPI_API_IMPL(ret, name, ...) \ + _Pragma(STRINGIFY(weak name)) \ + _Pragma(STRINGIFY(weak P##name = name)) \ + CLINKAGE \ + ret name(__VA_ARGS__) #else // not Linux (no PMPI support): - #if CMK_CONVERSE_MPI - #define AMPI_API_IMPL(ret, name, ...) \ - CLINKAGE \ - ret A##name(__VA_ARGS__) - #else - #define AMPI_API_IMPL(ret, name, ...) \ - CLINKAGE \ - ret name(__VA_ARGS__) - #endif + #define AMPI_API_IMPL(ret, name, ...) \ + CLINKAGE \ + ret name(__VA_ARGS__) #endif #if AMPIMSGLOG diff --git a/src/libs/ck-libs/ampi/mpio_functions.h b/src/libs/ck-libs/ampi/mpio_functions.h new file mode 100644 index 0000000000..a0bc34afc5 --- /dev/null +++ b/src/libs/ck-libs/ampi/mpio_functions.h @@ -0,0 +1 @@ +/* dummy mpio_functions.h for inclusion in ampi.h when ROMIO is not built */ diff --git a/src/libs/ck-libs/ampi/romio/README.AMPI b/src/libs/ck-libs/ampi/romio/README.AMPI index 3ca8888c89..17f3216c99 100644 --- a/src/libs/ck-libs/ampi/romio/README.AMPI +++ b/src/libs/ck-libs/ampi/romio/README.AMPI @@ -14,6 +14,11 @@ ROMIO integrated into AMPI: $CHARMDIR/lib/libampiromio.a and the user is supposed to link with ampiromio at link time. * Global variables were privatized, as shown in the section below. +* Function declarations have been moved from mpio.h.in to a new file, + mpio_functions.h, in line with ampi_functions.h. As part of this, + the mpi.h include has been moved to the bottom of mpio.h.in, and one + item that depends on mpi.h typedefs has been moved to ampi.h. +* HAVE_MPI_OFFSET is unconditionally defined to 1. Variable privatization diff --git a/src/libs/ck-libs/ampi/romio/include/mpio.h.in b/src/libs/ck-libs/ampi/romio/include/mpio.h.in dissimilarity index 84% index e88adaa64c..afc337f252 100644 --- a/src/libs/ck-libs/ampi/romio/include/mpio.h.in +++ b/src/libs/ck-libs/ampi/romio/include/mpio.h.in @@ -1,463 +1,107 @@ -/* -*- Mode: C; c-basic-offset:4 ; -*- */ -/* - * - * Copyright (C) 1997 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -/* user include file for MPI-IO programs */ - -#ifndef MPIO_INCLUDE -#define MPIO_INCLUDE - -#include "mpi.h" - -#undef HAVE_MPI_OFFSET //Needed for HAVE_MPI_DATAREP_FUNCTIONS below - -#if defined(__cplusplus) -extern "C" { -#endif - -#define ROMIO_VERSION 126 /* version 1.2.6 */ - -/* define MPI-IO datatypes and constants */ - -#ifndef MPI_FILE_DEFINED -typedef struct ADIOI_FileD *MPI_File; -#endif - -@DEFINE_HAVE_MPI_GREQUEST@ -#ifndef HAVE_MPI_GREQUEST -typedef struct ADIOI_RequestD *MPIO_Request; -#else -#define MPIO_Request MPI_Request -#define MPIO_USES_MPI_REQUEST -/* Also rename the MPIO routines to get the MPI versions */ -#define MPIO_Wait MPI_Wait -#define MPIO_Test MPI_Test -#define PMPIO_Wait PMPI_Wait -#define PMPIO_Test PMPI_Test -#endif -#define MPIO_REQUEST_DEFINED - -#ifndef HAVE_MPI_OFFSET -//@DEFINE_MPI_OFFSET@ -/* If we needed to define MPI_Offset, then we also need to make - this definition. */ -#ifndef HAVE_MPI_DATAREP_FUNCTIONS -#define HAVE_MPI_DATAREP_FUNCTIONS -typedef int (MPI_Datarep_conversion_function)(void *, MPI_Datatype, int, - void *, MPI_Offset, void *); -typedef int (MPI_Datarep_extent_function)(MPI_Datatype datatype, MPI_Aint *, - void *); -#endif -#endif - -#ifndef NEEDS_MPI_FINT -@NEEDS_MPI_FINT@ -#endif -#ifdef NEEDS_MPI_FINT -typedef int MPI_Fint; -#endif - -#ifndef HAVE_MPI_INFO -@HAVE_MPI_INFO@ -#endif -#ifndef HAVE_MPI_INFO - typedef struct MPIR_Info *MPI_Info; -# define MPI_INFO_NULL ((MPI_Info) 0) -# define MPI_MAX_INFO_KEY 255 -# define MPI_MAX_INFO_VAL 1024 -#endif - -#define MPI_MODE_RDONLY 2 /* ADIO_RDONLY */ -#define MPI_MODE_RDWR 8 /* ADIO_RDWR */ -#define MPI_MODE_WRONLY 4 /* ADIO_WRONLY */ -#define MPI_MODE_CREATE 1 /* ADIO_CREATE */ -#define MPI_MODE_EXCL 64 /* ADIO_EXCL */ -#define MPI_MODE_DELETE_ON_CLOSE 16 /* ADIO_DELETE_ON_CLOSE */ -#define MPI_MODE_UNIQUE_OPEN 32 /* ADIO_UNIQUE_OPEN */ -#define MPI_MODE_APPEND 128 /* ADIO_APPEND */ -#define MPI_MODE_SEQUENTIAL 256 /* ADIO_SEQUENTIAL */ - -#define MPI_DISPLACEMENT_CURRENT -54278278 - -#ifndef MPICH2 -/* FIXME: Make sure that we get a consistent definition of MPI_FILE_NULL - in MPICH2 */ -/* MPICH2 defines null object handles differently */ -#define MPI_FILE_NULL ((MPI_File) 0) -#endif -#define MPIO_REQUEST_NULL ((MPIO_Request) 0) - -#define MPI_SEEK_SET 600 -#define MPI_SEEK_CUR 602 -#define MPI_SEEK_END 604 - -#define MPI_MAX_DATAREP_STRING 128 - -#ifndef HAVE_MPI_DARRAY_SUBARRAY -@HAVE_MPI_DARRAY_SUBARRAY@ -#endif -#ifndef HAVE_MPI_DARRAY_SUBARRAY -# define MPI_ORDER_C 56 -# define MPI_ORDER_FORTRAN 57 -# define MPI_DISTRIBUTE_BLOCK 121 -# define MPI_DISTRIBUTE_CYCLIC 122 -# define MPI_DISTRIBUTE_NONE 123 -# define MPI_DISTRIBUTE_DFLT_DARG -49767 -#endif - - -/* MPI-IO function prototypes */ - -/* The compiler must support ANSI C style prototypes, otherwise - long long constants (e.g. 0) may get passed as ints. */ - -#ifndef HAVE_PRAGMA_HP_SEC_DEF - -/* Section 9.2 */ -/* Begin Prototypes */ -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 *); - -/* Section 9.3 */ -int MPI_File_set_view(MPI_File, MPI_Offset, MPI_Datatype, - MPI_Datatype, char *, MPI_Info); -int MPI_File_get_view(MPI_File, MPI_Offset *, - MPI_Datatype *, MPI_Datatype *, char *); - -/* Section 9.4.2 */ -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 *); - -/* nonblocking calls currently use MPIO_Request, because generalized - requests not yet implemented. For the same reason, MPIO_Test and - MPIO_Wait are used to test and wait on nonblocking I/O requests */ - -int MPI_File_iread_at(MPI_File, MPI_Offset, void *, - int, MPI_Datatype, MPIO_Request *); -int MPI_File_iwrite_at(MPI_File, MPI_Offset, void *, - int, MPI_Datatype, MPIO_Request *); - -/* Section 9.4.3 */ -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 *); - -/* nonblocking calls currently use MPIO_Request, because generalized - requests not yet implemented. For the same reason, MPIO_Test and - MPIO_Wait are used to test and wait on nonblocking I/O requests */ - -int MPI_File_iread(MPI_File, void *, int, MPI_Datatype, MPIO_Request *); -int MPI_File_iwrite(MPI_File, void *, int, MPI_Datatype, MPIO_Request *); - -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 *); - -/* Section 9.4.4 */ -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, MPIO_Request *); -int MPI_File_iwrite_shared(MPI_File, void *, int, - MPI_Datatype, MPIO_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 *); - -/* Section 9.4.5 */ -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 *); - -/* Section 9.5.1 */ -int MPI_File_get_type_extent(MPI_File, MPI_Datatype, MPI_Aint *); - -/* Section 9.5.3 */ -int MPI_Register_datarep(char *, - MPI_Datarep_conversion_function *, - MPI_Datarep_conversion_function *, - MPI_Datarep_extent_function *, - void *); - -/* Section 9.6.1 */ -int MPI_File_set_atomicity(MPI_File, int); -int MPI_File_get_atomicity(MPI_File, int *); -int MPI_File_sync(MPI_File); - -/* Section 4.13.3 */ -#ifndef MPICH2 -/* MPICH2 provides these definitions */ -int MPI_File_set_errhandler( MPI_File, MPI_Errhandler ); -int MPI_File_get_errhandler( MPI_File, MPI_Errhandler * ); -#endif -/* End Prototypes */ - -#ifndef HAVE_MPI_DARRAY_SUBARRAY -/* Section 4.14.4 */ -int MPI_Type_create_subarray(int, int *, int *, int *, int, - MPI_Datatype, MPI_Datatype *); - -/* Section 4.14.5 */ -int MPI_Type_create_darray(int, int, int, - int *, int *, int *, int *, - int, MPI_Datatype, MPI_Datatype *); -#endif - -/* The globus2 device has to rename MPI_ symbols in order to use the vendor - MPI as one of its transport mechanisms. Therefore, the following undefines - should only happen if MPICH_RENAMING_MPI_FUNCS is not defined. */ -/* Section 4.12.4 */ -#if !defined(MPICH_RENAMING_MPI_FUNCS) -#ifdef MPI_File_f2c -#undef MPI_File_f2c -#endif -#ifdef MPI_File_c2f -#undef MPI_File_c2f -#endif -#endif -/* above needed for some versions of mpi.h in MPICH!! */ -MPI_File MPI_File_f2c(MPI_Fint); -MPI_Fint MPI_File_c2f(MPI_File); - - -#ifndef HAVE_MPI_GREQUEST -/* The following functions are required if generalized requests are not - available, because in that case, an MPIO_Request object - is currently used for nonblocking I/O. */ -int MPIO_Test(MPIO_Request *, int *, MPI_Status *); -int MPIO_Wait(MPIO_Request *, MPI_Status *); -int MPIO_Testall(int, MPIO_Request *, int *, MPI_Status *); -int MPIO_Waitall(int, MPIO_Request *, MPI_Status *); -int MPIO_Testany(int, MPIO_Request *, int *, int *, MPI_Status *); -int MPIO_Waitany(int, MPIO_Request *, int *, MPI_Status *); -int MPIO_Waitsome(int, MPIO_Request *, int *, int *, MPI_Status *); -int MPIO_Testsome(int, MPIO_Request *, int *, int *, MPI_Status *); - -MPI_Fint MPIO_Request_c2f(MPIO_Request); -MPIO_Request MPIO_Request_f2c(MPI_Fint); -#endif /* HAVE_MPI_GREQUEST */ - -/* info functions if not defined in the MPI implementation */ -#ifndef HAVE_MPI_INFO - -int MPI_Info_create(MPI_Info *); -int MPI_Info_set(MPI_Info, char *, char *); -int MPI_Info_delete(MPI_Info, char *); -int MPI_Info_get(MPI_Info, char *, int, char *, int *); -int MPI_Info_get_valuelen(MPI_Info, char *, int *, int *); -int MPI_Info_get_nkeys(MPI_Info, int *); -int MPI_Info_get_nthkey(MPI_Info, int, char *); -int MPI_Info_dup(MPI_Info, MPI_Info *); -int MPI_Info_free(MPI_Info *); - -/* The globus2 device has to rename MPI_ symbols in order to use the vendor - MPI as one of its transport mechanisms. Therefore, the following undefines - should only happen if MPICH_RENAMING_MPI_FUNCS is not defined. */ -#if !defined(MPICH_RENAMING_MPI_FUNCS) -#ifdef MPI_Info_f2c -#undef MPI_Info_f2c -#endif -#ifdef MPI_Info_c2f -#undef MPI_Info_c2f -#endif -#endif -/* above needed for some versions of mpi.h in MPICH!! */ -MPI_Fint MPI_Info_c2f(MPI_Info); -MPI_Info MPI_Info_f2c(MPI_Fint); -#endif - -#endif /* HAVE_PRAGMA_HP_SEC_DEF */ - - -/**************** BINDINGS FOR THE PROFILING INTERFACE ***************/ - - -/* Section 9.2 */ -#if 0 -int PMPI_File_open(MPI_Comm, char *, int, MPI_Info, MPI_File *); -int PMPI_File_close(MPI_File *); -int PMPI_File_delete(char *, MPI_Info); -int PMPI_File_set_size(MPI_File, MPI_Offset); -int PMPI_File_preallocate(MPI_File, MPI_Offset); -int PMPI_File_get_size(MPI_File, MPI_Offset *); -int PMPI_File_get_group(MPI_File, MPI_Group *); -int PMPI_File_get_amode(MPI_File, int *); -int PMPI_File_set_info(MPI_File, MPI_Info); -int PMPI_File_get_info(MPI_File, MPI_Info *); - -/* Section 9.3 */ -int PMPI_File_set_view(MPI_File, MPI_Offset, - MPI_Datatype, MPI_Datatype, char *, MPI_Info); -int PMPI_File_get_view(MPI_File, MPI_Offset *, - MPI_Datatype *, MPI_Datatype *, char *); - -/* Section 9.4.2 */ -int PMPI_File_read_at(MPI_File, MPI_Offset, void *, - int, MPI_Datatype, MPI_Status *); -int PMPI_File_read_at_all(MPI_File, MPI_Offset, void *, - int, MPI_Datatype, MPI_Status *); -int PMPI_File_write_at(MPI_File, MPI_Offset, void *, - int, MPI_Datatype, MPI_Status *); -int PMPI_File_write_at_all(MPI_File, MPI_Offset, void *, - int, MPI_Datatype, MPI_Status *); - -/* nonblocking calls currently use MPIO_Request, because generalized - requests not yet implemented. For the same reason, MPIO_Test and - MPIO_Wait are used to test and wait on nonblocking I/O requests */ - -int PMPI_File_iread_at(MPI_File, MPI_Offset, void *, - int, MPI_Datatype, MPIO_Request *); -int PMPI_File_iwrite_at(MPI_File, MPI_Offset, void *, - int, MPI_Datatype, MPIO_Request *); - -/* Section 9.4.3 */ -int PMPI_File_read(MPI_File, void *, int, MPI_Datatype, MPI_Status *); -int PMPI_File_read_all(MPI_File, void *, int, MPI_Datatype, MPI_Status *); -int PMPI_File_write(MPI_File, void *, int, MPI_Datatype, MPI_Status *); -int PMPI_File_write_all(MPI_File, void *, int, MPI_Datatype, MPI_Status *); - -/* nonblocking calls currently use MPIO_Request, because generalized - requests not yet implemented. For the same reason, MPIO_Test and - MPIO_Wait are used to test and wait on nonblocking I/O requests */ - -int PMPI_File_iread(MPI_File, void *, int, MPI_Datatype, MPIO_Request *); -int PMPI_File_iwrite(MPI_File, void *, int, MPI_Datatype, MPIO_Request *); - -int PMPI_File_seek(MPI_File, MPI_Offset, int); -int PMPI_File_get_position(MPI_File, MPI_Offset *); -int PMPI_File_get_byte_offset(MPI_File, MPI_Offset, MPI_Offset *); - -/* Section 9.4.4 */ -int PMPI_File_read_shared(MPI_File, void *, int, MPI_Datatype, MPI_Status *); -int PMPI_File_write_shared(MPI_File, void *, int, MPI_Datatype, MPI_Status *); -int PMPI_File_iread_shared(MPI_File, void *, int, - MPI_Datatype, MPIO_Request *); -int PMPI_File_iwrite_shared(MPI_File, void *, int, - MPI_Datatype, MPIO_Request *); -int PMPI_File_read_ordered(MPI_File, void *, int, MPI_Datatype, MPI_Status *); -int PMPI_File_write_ordered(MPI_File, void *, int, MPI_Datatype, MPI_Status *); -int PMPI_File_seek_shared(MPI_File, MPI_Offset, int); -int PMPI_File_get_position_shared(MPI_File, MPI_Offset *); - -/* Section 9.4.5 */ -int PMPI_File_read_at_all_begin(MPI_File, MPI_Offset, void *, - int, MPI_Datatype); -int PMPI_File_read_at_all_end(MPI_File, void *, MPI_Status *); -int PMPI_File_write_at_all_begin(MPI_File, MPI_Offset, void *, - int, MPI_Datatype); -int PMPI_File_write_at_all_end(MPI_File, void *, MPI_Status *); -int PMPI_File_read_all_begin(MPI_File, void *, int, MPI_Datatype); -int PMPI_File_read_all_end(MPI_File, void *, MPI_Status *); -int PMPI_File_write_all_begin(MPI_File, void *, int, MPI_Datatype); -int PMPI_File_write_all_end(MPI_File, void *, MPI_Status *); -int PMPI_File_read_ordered_begin(MPI_File, void *, int, MPI_Datatype); -int PMPI_File_read_ordered_end(MPI_File, void *, MPI_Status *); -int PMPI_File_write_ordered_begin(MPI_File, void *, int, MPI_Datatype); -int PMPI_File_write_ordered_end(MPI_File, void *, MPI_Status *); - -/* Section 9.5.1 */ -int PMPI_File_get_type_extent(MPI_File, MPI_Datatype, MPI_Aint *); - -/* Section 9.5.3 */ -int PMPI_Register_datarep(char *, - MPI_Datarep_conversion_function *, - MPI_Datarep_conversion_function *, - MPI_Datarep_extent_function *, - void *); - -/* Section 9.6.1 */ -int PMPI_File_set_atomicity(MPI_File, int); -int PMPI_File_get_atomicity(MPI_File, int *); -int PMPI_File_sync(MPI_File); - -/* Section 4.13.3 */ -#ifndef MPICH2 -/* MPICH2 provides these definitions */ -int PMPI_File_set_errhandler( MPI_File, MPI_Errhandler ); -int PMPI_File_get_errhandler( MPI_File, MPI_Errhandler * ); -#endif - -#ifndef HAVE_MPI_DARRAY_SUBARRAY -/* Section 4.14.4 */ -int PMPI_Type_create_subarray(int, int *, int *, int *, int, - MPI_Datatype, MPI_Datatype *); - -/* Section 4.14.5 */ -int PMPI_Type_create_darray(int, int, int, int *, int *, - int *, int *, int, MPI_Datatype, MPI_Datatype *); -#endif - -/* Section 4.12.4 */ -MPI_File PMPI_File_f2c(MPI_Fint); -MPI_Fint PMPI_File_c2f(MPI_File); - -#ifndef HAVE_MPI_GREQUEST -/* The following functions are required if generalized requests are not - available, because in that case, an MPIO_Request object - is currently used for nonblocking I/O. */ -int PMPIO_Test(MPIO_Request *, int *, MPI_Status *); -int PMPIO_Wait(MPIO_Request *, MPI_Status *); -int PMPIO_Testall(int, MPIO_Request *, int *, MPI_Status *); -int PMPIO_Waitall(int, MPIO_Request *, MPI_Status *); -int PMPIO_Testany(int, MPIO_Request *, int *, int *, MPI_Status *); -int PMPIO_Waitany(int, MPIO_Request *, int *, MPI_Status *); -int PMPIO_Waitsome(int, MPIO_Request *, int *, int *, MPI_Status *); -int PMPIO_Testsome(int, MPIO_Request *, int *, int *, MPI_Status *); -MPI_Fint PMPIO_Request_c2f(MPIO_Request); -MPIO_Request PMPIO_Request_f2c(MPI_Fint); -#endif /* HAVE_MPI_GREQUEST */ - -/* info functions if not defined in the MPI implementation */ -#ifndef HAVE_MPI_INFO - -int PMPI_Info_create(MPI_Info *); -int PMPI_Info_set(MPI_Info, char *, char *); -int PMPI_Info_delete(MPI_Info, char *); -int PMPI_Info_get(MPI_Info, char *, int, char *, int *); -int PMPI_Info_get_valuelen(MPI_Info, char *, int *, int *); -int PMPI_Info_get_nkeys(MPI_Info, int *); -int PMPI_Info_get_nthkey(MPI_Info, int, char *); -int PMPI_Info_dup(MPI_Info, MPI_Info *); -int PMPI_Info_free(MPI_Info *); - -MPI_Fint PMPI_Info_c2f(MPI_Info); -MPI_Info PMPI_Info_f2c(MPI_Fint); -#endif -#endif - -#if defined(__cplusplus) -} -#endif - -#endif +/* -*- Mode: C; c-basic-offset:4 ; -*- */ +/* + * + * Copyright (C) 1997 University of Chicago. + * See COPYRIGHT notice in top-level directory. + */ + +/* user include file for MPI-IO programs */ + +#ifndef MPIO_INCLUDE +#define MPIO_INCLUDE + +#if defined(__cplusplus) +extern "C" { +#endif + +#define ROMIO_VERSION 126 /* version 1.2.6 */ + +/* define MPI-IO datatypes and constants */ + +#ifndef MPI_FILE_DEFINED +typedef struct ADIOI_FileD *MPI_File; +#endif + +@DEFINE_HAVE_MPI_GREQUEST@ +#ifndef HAVE_MPI_GREQUEST +typedef struct ADIOI_RequestD *MPIO_Request; +#else +#define MPIO_Request MPI_Request +#define MPIO_USES_MPI_REQUEST +/* Also rename the MPIO routines to get the MPI versions */ +#define MPIO_Wait MPI_Wait +#define MPIO_Test MPI_Test +#define PMPIO_Wait PMPI_Wait +#define PMPIO_Test PMPI_Test +#endif +#define MPIO_REQUEST_DEFINED + +#ifndef HAVE_MPI_OFFSET +//@DEFINE_MPI_OFFSET@ +#define HAVE_MPI_OFFSET 1 /* ROMIO requires AMPI to set this */ +/* AMPI: HAVE_MPI_DATAREP_FUNCTIONS moved to ampi.h */ +#endif + +#ifndef NEEDS_MPI_FINT +@NEEDS_MPI_FINT@ +#endif +#ifdef NEEDS_MPI_FINT +typedef int MPI_Fint; +#endif + +#ifndef HAVE_MPI_INFO +@HAVE_MPI_INFO@ +#endif +#ifndef HAVE_MPI_INFO + typedef struct MPIR_Info *MPI_Info; +# define MPI_INFO_NULL ((MPI_Info) 0) +# define MPI_MAX_INFO_KEY 255 +# define MPI_MAX_INFO_VAL 1024 +#endif + +#define MPI_MODE_RDONLY 2 /* ADIO_RDONLY */ +#define MPI_MODE_RDWR 8 /* ADIO_RDWR */ +#define MPI_MODE_WRONLY 4 /* ADIO_WRONLY */ +#define MPI_MODE_CREATE 1 /* ADIO_CREATE */ +#define MPI_MODE_EXCL 64 /* ADIO_EXCL */ +#define MPI_MODE_DELETE_ON_CLOSE 16 /* ADIO_DELETE_ON_CLOSE */ +#define MPI_MODE_UNIQUE_OPEN 32 /* ADIO_UNIQUE_OPEN */ +#define MPI_MODE_APPEND 128 /* ADIO_APPEND */ +#define MPI_MODE_SEQUENTIAL 256 /* ADIO_SEQUENTIAL */ + +#define MPI_DISPLACEMENT_CURRENT -54278278 + +#ifndef MPICH2 +/* FIXME: Make sure that we get a consistent definition of MPI_FILE_NULL + in MPICH2 */ +/* MPICH2 defines null object handles differently */ +#define MPI_FILE_NULL ((MPI_File) 0) +#endif +#define MPIO_REQUEST_NULL ((MPIO_Request) 0) + +#define MPI_SEEK_SET 600 +#define MPI_SEEK_CUR 602 +#define MPI_SEEK_END 604 + +#define MPI_MAX_DATAREP_STRING 128 + +#ifndef HAVE_MPI_DARRAY_SUBARRAY +@HAVE_MPI_DARRAY_SUBARRAY@ +#endif +#ifndef HAVE_MPI_DARRAY_SUBARRAY +# define MPI_ORDER_C 56 +# define MPI_ORDER_FORTRAN 57 +# define MPI_DISTRIBUTE_BLOCK 121 +# define MPI_DISTRIBUTE_CYCLIC 122 +# define MPI_DISTRIBUTE_NONE 123 +# define MPI_DISTRIBUTE_DFLT_DARG -49767 +#endif + +#if defined(__cplusplus) +} +#endif + +/* mpi.h will include mpio_functions.h */ +#include "mpi.h" + +#endif diff --git a/src/libs/ck-libs/ampi/romio/include/mpio_functions.h b/src/libs/ck-libs/ampi/romio/include/mpio_functions.h new file mode 100644 index 0000000000..ab45c8d5da --- /dev/null +++ b/src/libs/ck-libs/ampi/romio/include/mpio_functions.h @@ -0,0 +1,368 @@ +/* -*- Mode: C; c-basic-offset:4 ; -*- */ +/* + * $Id$ + * + * Copyright (C) 1997 University of Chicago. + * See COPYRIGHT notice in top-level directory. + */ + + +/* + * This file is separate from mpio.h because ROMIO is included as part + * of AMPI's implementation of the MPI standard, and certain global variable + * privatization methods require the AMPI API to be exposed as function pointers + * through a shim and loader mechanism that needs to list the entire set of + * provided functions at multiple points in its implementation. + * + * See src/libs/ck-libs/ampi/ampi_functions.h for mandatory procedures. + * + * For ease of reading: AMPI_CUSTOM_FUNC(ReturnType, FunctionName, Parameters...) + */ + + +/* MPI-IO function prototypes */ + +/* The compiler must support ANSI C style prototypes, otherwise + long long constants (e.g. 0) may get passed as ints. */ + +#ifndef HAVE_PRAGMA_HP_SEC_DEF + +/* Section 9.2 */ +/* Begin Prototypes */ +AMPI_CUSTOM_FUNC(int, MPI_File_open, MPI_Comm, char *, int, MPI_Info, MPI_File *) +AMPI_CUSTOM_FUNC(int, MPI_File_close, MPI_File *) +AMPI_CUSTOM_FUNC(int, MPI_File_delete, char *, MPI_Info) +AMPI_CUSTOM_FUNC(int, MPI_File_set_size, MPI_File, MPI_Offset) +AMPI_CUSTOM_FUNC(int, MPI_File_preallocate, MPI_File, MPI_Offset) +AMPI_CUSTOM_FUNC(int, MPI_File_get_size, MPI_File, MPI_Offset *) +AMPI_CUSTOM_FUNC(int, MPI_File_get_group, MPI_File, MPI_Group *) +AMPI_CUSTOM_FUNC(int, MPI_File_get_amode, MPI_File, int *) +AMPI_CUSTOM_FUNC(int, MPI_File_set_info, MPI_File, MPI_Info) +AMPI_CUSTOM_FUNC(int, MPI_File_get_info, MPI_File, MPI_Info *) + +/* Section 9.3 */ +AMPI_CUSTOM_FUNC(int, MPI_File_set_view, MPI_File, MPI_Offset, MPI_Datatype, + MPI_Datatype, char *, MPI_Info) +AMPI_CUSTOM_FUNC(int, MPI_File_get_view, MPI_File, MPI_Offset *, + MPI_Datatype *, MPI_Datatype *, char *) + +/* Section 9.4.2 */ +AMPI_CUSTOM_FUNC(int, MPI_File_read_at, MPI_File, MPI_Offset, void *, + int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPI_File_read_at_all, MPI_File, MPI_Offset, void *, + int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPI_File_write_at, MPI_File, MPI_Offset, void *, + int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPI_File_write_at_all, MPI_File, MPI_Offset, void *, + int, MPI_Datatype, MPI_Status *) + +/* nonblocking calls currently use MPIO_Request, because generalized + requests not yet implemented. For the same reason, MPIO_Test and + MPIO_Wait are used to test and wait on nonblocking I/O requests */ + +AMPI_CUSTOM_FUNC(int, MPI_File_iread_at, MPI_File, MPI_Offset, void *, + int, MPI_Datatype, MPIO_Request *) +AMPI_CUSTOM_FUNC(int, MPI_File_iwrite_at, MPI_File, MPI_Offset, void *, + int, MPI_Datatype, MPIO_Request *) + +/* Section 9.4.3 */ +AMPI_CUSTOM_FUNC(int, MPI_File_read, MPI_File, void *, int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPI_File_read_all, MPI_File, void *, int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPI_File_write, MPI_File, void *, int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPI_File_write_all, MPI_File, void *, int, MPI_Datatype, MPI_Status *) + +/* nonblocking calls currently use MPIO_Request, because generalized + requests not yet implemented. For the same reason, MPIO_Test and + MPIO_Wait are used to test and wait on nonblocking I/O requests */ + +AMPI_CUSTOM_FUNC(int, MPI_File_iread, MPI_File, void *, int, MPI_Datatype, MPIO_Request *) +AMPI_CUSTOM_FUNC(int, MPI_File_iwrite, MPI_File, void *, int, MPI_Datatype, MPIO_Request *) + +AMPI_CUSTOM_FUNC(int, MPI_File_seek, MPI_File, MPI_Offset, int) +AMPI_CUSTOM_FUNC(int, MPI_File_get_position, MPI_File, MPI_Offset *) +AMPI_CUSTOM_FUNC(int, MPI_File_get_byte_offset, MPI_File, MPI_Offset, MPI_Offset *) + +/* Section 9.4.4 */ +AMPI_CUSTOM_FUNC(int, MPI_File_read_shared, MPI_File, void *, int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPI_File_write_shared, MPI_File, void *, int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPI_File_iread_shared, MPI_File, void *, int, MPI_Datatype, MPIO_Request *) +AMPI_CUSTOM_FUNC(int, MPI_File_iwrite_shared, MPI_File, void *, int, + MPI_Datatype, MPIO_Request *) +AMPI_CUSTOM_FUNC(int, MPI_File_read_ordered, MPI_File, void *, int, + MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPI_File_write_ordered, MPI_File, void *, int, + MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPI_File_seek_shared, MPI_File, MPI_Offset, int) +AMPI_CUSTOM_FUNC(int, MPI_File_get_position_shared, MPI_File, MPI_Offset *) + +/* Section 9.4.5 */ +AMPI_CUSTOM_FUNC(int, MPI_File_read_at_all_begin, MPI_File, MPI_Offset, void *, + int, MPI_Datatype) +AMPI_CUSTOM_FUNC(int, MPI_File_read_at_all_end, MPI_File, void *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPI_File_write_at_all_begin, MPI_File, MPI_Offset, void *, + int, MPI_Datatype) +AMPI_CUSTOM_FUNC(int, MPI_File_write_at_all_end, MPI_File, void *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPI_File_read_all_begin, MPI_File, void *, int, MPI_Datatype) +AMPI_CUSTOM_FUNC(int, MPI_File_read_all_end, MPI_File, void *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPI_File_write_all_begin, MPI_File, void *, int, MPI_Datatype) +AMPI_CUSTOM_FUNC(int, MPI_File_write_all_end, MPI_File, void *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPI_File_read_ordered_begin, MPI_File, void *, int, MPI_Datatype) +AMPI_CUSTOM_FUNC(int, MPI_File_read_ordered_end, MPI_File, void *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPI_File_write_ordered_begin, MPI_File, void *, int, MPI_Datatype) +AMPI_CUSTOM_FUNC(int, MPI_File_write_ordered_end, MPI_File, void *, MPI_Status *) + +/* Section 9.5.1 */ +AMPI_CUSTOM_FUNC(int, MPI_File_get_type_extent, MPI_File, MPI_Datatype, MPI_Aint *) + +/* Section 9.5.3 */ +AMPI_CUSTOM_FUNC(int, MPI_Register_datarep, char *, + MPI_Datarep_conversion_function *, + MPI_Datarep_conversion_function *, + MPI_Datarep_extent_function *, + void *) + +/* Section 9.6.1 */ +AMPI_CUSTOM_FUNC(int, MPI_File_set_atomicity, MPI_File, int) +AMPI_CUSTOM_FUNC(int, MPI_File_get_atomicity, MPI_File, int *) +AMPI_CUSTOM_FUNC(int, MPI_File_sync, MPI_File) + +/* Section 4.13.3 */ +#ifndef MPICH2 +/* MPICH2 provides these definitions */ +AMPI_CUSTOM_FUNC(int, MPI_File_set_errhandler, MPI_File, MPI_Errhandler ) +AMPI_CUSTOM_FUNC(int, MPI_File_get_errhandler, MPI_File, MPI_Errhandler * ) +#endif +/* End Prototypes */ + +#ifndef HAVE_MPI_DARRAY_SUBARRAY +/* Section 4.14.4 */ +AMPI_CUSTOM_FUNC(int, MPI_Type_create_subarray, int, int *, int *, int *, int, + MPI_Datatype, MPI_Datatype *) + +/* Section 4.14.5 */ +AMPI_CUSTOM_FUNC(int, MPI_Type_create_darray, int, int, int, + int *, int *, int *, int *, + int, MPI_Datatype, MPI_Datatype *) +#endif + +/* The globus2 device has to rename MPI_ symbols in order to use the vendor + MPI as one of its transport mechanisms. Therefore, the following undefines + should only happen if MPICH_RENAMING_MPI_FUNCS is not defined. */ +/* Section 4.12.4 */ +#if !defined(MPICH_RENAMING_MPI_FUNCS) +#ifdef MPI_File_f2c +#undef MPI_File_f2c +#endif +#ifdef MPI_File_c2f +#undef MPI_File_c2f +#endif +#endif +/* above needed for some versions of mpi.h in MPICH!! */ +AMPI_CUSTOM_FUNC(MPI_File, MPI_File_f2c, MPI_Fint) +AMPI_CUSTOM_FUNC(MPI_Fint, MPI_File_c2f, MPI_File) + + +#ifndef HAVE_MPI_GREQUEST +/* The following functions are required if generalized requests are not + available, because in that case, an MPIO_Request object + is currently used for nonblocking I/O. */ +AMPI_CUSTOM_FUNC(int, MPIO_Test, MPIO_Request *, int *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPIO_Wait, MPIO_Request *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPIO_Testall, int, MPIO_Request *, int *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPIO_Waitall, int, MPIO_Request *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPIO_Testany, int, MPIO_Request *, int *, int *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPIO_Waitany, int, MPIO_Request *, int *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPIO_Waitsome, int, MPIO_Request *, int *, int *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, MPIO_Testsome, int, MPIO_Request *, int *, int *, MPI_Status *) + +AMPI_CUSTOM_FUNC(MPI_Fint, MPIO_Request_c2f, MPIO_Request) +AMPI_CUSTOM_FUNC(MPIO_Request, MPIO_Request_f2c, MPI_Fint) +#endif /* HAVE_MPI_GREQUEST */ + +/* info functions if not defined in the MPI implementation */ +#ifndef HAVE_MPI_INFO + +AMPI_CUSTOM_FUNC(int, MPI_Info_create, MPI_Info *) +AMPI_CUSTOM_FUNC(int, MPI_Info_set, MPI_Info, char *, char *) +AMPI_CUSTOM_FUNC(int, MPI_Info_delete, MPI_Info, char *) +AMPI_CUSTOM_FUNC(int, MPI_Info_get, MPI_Info, char *, int, char *, int *) +AMPI_CUSTOM_FUNC(int, MPI_Info_get_valuelen, MPI_Info, char *, int *, int *) +AMPI_CUSTOM_FUNC(int, MPI_Info_get_nkeys, MPI_Info, int *) +AMPI_CUSTOM_FUNC(int, MPI_Info_get_nthkey, MPI_Info, int, char *) +AMPI_CUSTOM_FUNC(int, MPI_Info_dup, MPI_Info, MPI_Info *) +AMPI_CUSTOM_FUNC(int, MPI_Info_free, MPI_Info *) + +/* The globus2 device has to rename MPI_ symbols in order to use the vendor + MPI as one of its transport mechanisms. Therefore, the following undefines + should only happen if MPICH_RENAMING_MPI_FUNCS is not defined. */ +#if !defined(MPICH_RENAMING_MPI_FUNCS) +#ifdef MPI_Info_f2c +#undef MPI_Info_f2c +#endif +#ifdef MPI_Info_c2f +#undef MPI_Info_c2f +#endif +#endif +/* above needed for some versions of mpi.h in MPICH!! */ +AMPI_CUSTOM_FUNC(MPI_Fint, MPI_Info_c2f, MPI_Info) +AMPI_CUSTOM_FUNC(MPI_Info, MPI_Info_f2c, MPI_Fint) +#endif + +#endif /* HAVE_PRAGMA_HP_SEC_DEF */ + + +/**************** BINDINGS FOR THE PROFILING INTERFACE ***************/ + + +/* Section 9.2 */ +#if 0 +AMPI_CUSTOM_FUNC(int, PMPI_File_open, MPI_Comm, char *, int, MPI_Info, MPI_File *) +AMPI_CUSTOM_FUNC(int, PMPI_File_close, MPI_File *) +AMPI_CUSTOM_FUNC(int, PMPI_File_delete, char *, MPI_Info) +AMPI_CUSTOM_FUNC(int, PMPI_File_set_size, MPI_File, MPI_Offset) +AMPI_CUSTOM_FUNC(int, PMPI_File_preallocate, MPI_File, MPI_Offset) +AMPI_CUSTOM_FUNC(int, PMPI_File_get_size, MPI_File, MPI_Offset *) +AMPI_CUSTOM_FUNC(int, PMPI_File_get_group, MPI_File, MPI_Group *) +AMPI_CUSTOM_FUNC(int, PMPI_File_get_amode, MPI_File, int *) +AMPI_CUSTOM_FUNC(int, PMPI_File_set_info, MPI_File, MPI_Info) +AMPI_CUSTOM_FUNC(int, PMPI_File_get_info, MPI_File, MPI_Info *) + +/* Section 9.3 */ +AMPI_CUSTOM_FUNC(int, PMPI_File_set_view, MPI_File, MPI_Offset, + MPI_Datatype, MPI_Datatype, char *, MPI_Info) +AMPI_CUSTOM_FUNC(int, PMPI_File_get_view, MPI_File, MPI_Offset *, + MPI_Datatype *, MPI_Datatype *, char *) + +/* Section 9.4.2 */ +AMPI_CUSTOM_FUNC(int, PMPI_File_read_at, MPI_File, MPI_Offset, void *, + int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPI_File_read_at_all, MPI_File, MPI_Offset, void *, + int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPI_File_write_at, MPI_File, MPI_Offset, void *, + int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPI_File_write_at_all, MPI_File, MPI_Offset, void *, + int, MPI_Datatype, MPI_Status *) + +/* nonblocking calls currently use MPIO_Request, because generalized + requests not yet implemented. For the same reason, MPIO_Test and + MPIO_Wait are used to test and wait on nonblocking I/O requests */ + +AMPI_CUSTOM_FUNC(int, PMPI_File_iread_at, MPI_File, MPI_Offset, void *, + int, MPI_Datatype, MPIO_Request *) +AMPI_CUSTOM_FUNC(int, PMPI_File_iwrite_at, MPI_File, MPI_Offset, void *, + int, MPI_Datatype, MPIO_Request *) + +/* Section 9.4.3 */ +AMPI_CUSTOM_FUNC(int, PMPI_File_read, MPI_File, void *, int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPI_File_read_all, MPI_File, void *, int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPI_File_write, MPI_File, void *, int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPI_File_write_all, MPI_File, void *, int, MPI_Datatype, MPI_Status *) + +/* nonblocking calls currently use MPIO_Request, because generalized + requests not yet implemented. For the same reason, MPIO_Test and + MPIO_Wait are used to test and wait on nonblocking I/O requests */ + +AMPI_CUSTOM_FUNC(int, PMPI_File_iread, MPI_File, void *, int, MPI_Datatype, MPIO_Request *) +AMPI_CUSTOM_FUNC(int, PMPI_File_iwrite, MPI_File, void *, int, MPI_Datatype, MPIO_Request *) + +AMPI_CUSTOM_FUNC(int, PMPI_File_seek, MPI_File, MPI_Offset, int) +AMPI_CUSTOM_FUNC(int, PMPI_File_get_position, MPI_File, MPI_Offset *) +AMPI_CUSTOM_FUNC(int, PMPI_File_get_byte_offset, MPI_File, MPI_Offset, MPI_Offset *) + +/* Section 9.4.4 */ +AMPI_CUSTOM_FUNC(int, PMPI_File_read_shared, MPI_File, void *, int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPI_File_write_shared, MPI_File, void *, int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPI_File_iread_shared, MPI_File, void *, int, + MPI_Datatype, MPIO_Request *) +AMPI_CUSTOM_FUNC(int, PMPI_File_iwrite_shared, MPI_File, void *, int, + MPI_Datatype, MPIO_Request *) +AMPI_CUSTOM_FUNC(int, PMPI_File_read_ordered, MPI_File, void *, int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPI_File_write_ordered, MPI_File, void *, int, MPI_Datatype, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPI_File_seek_shared, MPI_File, MPI_Offset, int) +AMPI_CUSTOM_FUNC(int, PMPI_File_get_position_shared, MPI_File, MPI_Offset *) + +/* Section 9.4.5 */ +AMPI_CUSTOM_FUNC(int, PMPI_File_read_at_all_begin, MPI_File, MPI_Offset, void *, + int, MPI_Datatype) +AMPI_CUSTOM_FUNC(int, PMPI_File_read_at_all_end, MPI_File, void *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPI_File_write_at_all_begin, MPI_File, MPI_Offset, void *, + int, MPI_Datatype) +AMPI_CUSTOM_FUNC(int, PMPI_File_write_at_all_end, MPI_File, void *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPI_File_read_all_begin, MPI_File, void *, int, MPI_Datatype) +AMPI_CUSTOM_FUNC(int, PMPI_File_read_all_end, MPI_File, void *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPI_File_write_all_begin, MPI_File, void *, int, MPI_Datatype) +AMPI_CUSTOM_FUNC(int, PMPI_File_write_all_end, MPI_File, void *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPI_File_read_ordered_begin, MPI_File, void *, int, MPI_Datatype) +AMPI_CUSTOM_FUNC(int, PMPI_File_read_ordered_end, MPI_File, void *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPI_File_write_ordered_begin, MPI_File, void *, int, MPI_Datatype) +AMPI_CUSTOM_FUNC(int, PMPI_File_write_ordered_end, MPI_File, void *, MPI_Status *) + +/* Section 9.5.1 */ +AMPI_CUSTOM_FUNC(int, PMPI_File_get_type_extent, MPI_File, MPI_Datatype, MPI_Aint *) + +/* Section 9.5.3 */ +AMPI_CUSTOM_FUNC(int, PMPI_Register_datarep, char *, + MPI_Datarep_conversion_function *, + MPI_Datarep_conversion_function *, + MPI_Datarep_extent_function *, + void *) + +/* Section 9.6.1 */ +AMPI_CUSTOM_FUNC(int, PMPI_File_set_atomicity, MPI_File, int) +AMPI_CUSTOM_FUNC(int, PMPI_File_get_atomicity, MPI_File, int *) +AMPI_CUSTOM_FUNC(int, PMPI_File_sync, MPI_File) + +/* Section 4.13.3 */ +#ifndef MPICH2 +/* MPICH2 provides these definitions */ +AMPI_CUSTOM_FUNC(int, PMPI_File_set_errhandler, MPI_File, MPI_Errhandler ) +AMPI_CUSTOM_FUNC(int, PMPI_File_get_errhandler, MPI_File, MPI_Errhandler * ) +#endif + +#ifndef HAVE_MPI_DARRAY_SUBARRAY +/* Section 4.14.4 */ +AMPI_CUSTOM_FUNC(int, PMPI_Type_create_subarray, int, int *, int *, int *, int, + MPI_Datatype, MPI_Datatype *) + +/* Section 4.14.5 */ +AMPI_CUSTOM_FUNC(int, PMPI_Type_create_darray, int, int, int, int *, int *, + int *, int *, int, MPI_Datatype, MPI_Datatype *) +#endif + +/* Section 4.12.4 */ +AMPI_CUSTOM_FUNC(MPI_File, PMPI_File_f2c, MPI_Fint) +AMPI_CUSTOM_FUNC(MPI_Fint, PMPI_File_c2f, MPI_File) + +#ifndef HAVE_MPI_GREQUEST +/* The following functions are required if generalized requests are not + available, because in that case, an MPIO_Request object + is currently used for nonblocking I/O. */ +AMPI_CUSTOM_FUNC(int, PMPIO_Test, MPIO_Request *, int *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPIO_Wait, MPIO_Request *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPIO_Testall, int, MPIO_Request *, int *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPIO_Waitall, int, MPIO_Request *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPIO_Testany, int, MPIO_Request *, int *, int *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPIO_Waitany, int, MPIO_Request *, int *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPIO_Waitsome, int, MPIO_Request *, int *, int *, MPI_Status *) +AMPI_CUSTOM_FUNC(int, PMPIO_Testsome, int, MPIO_Request *, int *, int *, MPI_Status *) +AMPI_CUSTOM_FUNC(MPI_Fint, PMPIO_Request_c2f, MPIO_Request) +AMPI_CUSTOM_FUNC(MPIO_Request, PMPIO_Request_f2c, MPI_Fint) +#endif /* HAVE_MPI_GREQUEST */ + +/* info functions if not defined in the MPI implementation */ +#ifndef HAVE_MPI_INFO + +AMPI_CUSTOM_FUNC(int, PMPI_Info_create, MPI_Info *) +AMPI_CUSTOM_FUNC(int, PMPI_Info_set, MPI_Info, char *, char *) +AMPI_CUSTOM_FUNC(int, PMPI_Info_delete, MPI_Info, char *) +AMPI_CUSTOM_FUNC(int, PMPI_Info_get, MPI_Info, char *, int, char *, int *) +AMPI_CUSTOM_FUNC(int, PMPI_Info_get_valuelen, MPI_Info, char *, int *, int *) +AMPI_CUSTOM_FUNC(int, PMPI_Info_get_nkeys, MPI_Info, int *) +AMPI_CUSTOM_FUNC(int, PMPI_Info_get_nthkey, MPI_Info, int, char *) +AMPI_CUSTOM_FUNC(int, PMPI_Info_dup, MPI_Info, MPI_Info *) +AMPI_CUSTOM_FUNC(int, PMPI_Info_free, MPI_Info *) + +AMPI_CUSTOM_FUNC(MPI_Fint, PMPI_Info_c2f, MPI_Info) +AMPI_CUSTOM_FUNC(MPI_Info, PMPI_Info_f2c, MPI_Fint) +#endif +#endif diff --git a/src/scripts/Makefile b/src/scripts/Makefile index 5f36a962c7..a4f3e0f3f6 100644 --- a/src/scripts/Makefile +++ b/src/scripts/Makefile @@ -261,6 +261,7 @@ CVHEADERS=cpthreads.h converse.h conv-trace.h conv-random.h conv-qd.h \ # The .c files are there to be #included by clients whole # This is a bit unusual, but makes client linking simpler. UTILHEADERS=pup.h pupf.h pup_c.h pup_stl.h pup_mpi.h pup_toNetwork.h pup_toNetwork4.h pup_paged.h pup_cmialloc.h\ + pup_c_functions.h \ ckimage.h ckdll.h ckhashtable.h ckbitvector.h cklists.h ckliststring.h \ cksequence.h ckstatistics.h ckvector3d.h conv-lists.h ckcomplex.h \ sockRoutines.h sockRoutines.C cmimemcpy.h simd.h SSE-Double.h SSE-Float.h \ @@ -801,6 +802,7 @@ $(L)/libtrace-simple.a: $(LIBTRACE_SIMPLE) libtrace-Tau.o: trace-Tau.C charm++.h charm.h converse.h conv-config.h \ conv-autoconfig.h conv-common.h conv-mach.h conv-mach-opt.h \ conv-mach-ifort.h pup_c.h conv-cpm.h conv-cpath.h conv-qd.h \ + pup_c_functions.h \ conv-random.h conv-lists.h conv-trace.h persistent.h debug-conv.h pup.h \ middle.h middle-conv.h cklists.h ckbitvector.h ckstream.h init.h \ ckhashtable.h debug-charm.h CkMarshall.decl.h cksection.h ckcallback.h \ diff --git a/src/util/pup_c.h b/src/util/pup_c.h index 65d904841e..367feecde5 100644 --- a/src/util/pup_c.h +++ b/src/util/pup_c.h @@ -57,81 +57,30 @@ void pup_bar(pup_er p,bar *b) */ +#include "conv-config.h" +#include + #ifdef __cplusplus extern "C" { #endif -#include "conv-config.h" -#include "stddef.h" - /*This is actually a PUP::er *, cast to void *. From C++, you can pass "&p" as a pup_er. */ typedef void *pup_er; -/*Allocate PUP::er of different kind */ -pup_er pup_new_sizer(void); -pup_er pup_new_toMem(void *Nbuf); -pup_er pup_new_fromMem(const void *Nbuf); -pup_er pup_new_network_sizer(void); -pup_er pup_new_network_pack(void *Nbuf); -pup_er pup_new_network_unpack(const void *Nbuf); -#if CMK_CCS_AVAILABLE -pup_er pup_new_fmt(pup_er p); -void pup_fmt_sync_begin_object(pup_er p); -void pup_fmt_sync_end_object(pup_er p); -void pup_fmt_sync_begin_array(pup_er p); -void pup_fmt_sync_end_array(pup_er p); -void pup_fmt_sync_item(pup_er p); -#endif -void pup_destroy(pup_er p); - -/*Determine what kind of pup_er we have-- -return 1 for true, 0 for false.*/ -int pup_isPacking(const pup_er p); -int pup_isUnpacking(const pup_er p); -int pup_isSizing(const pup_er p); -int pup_isDeleting(const pup_er p); -int pup_isUserlevel(const pup_er p); -int pup_isRestarting(const pup_er p); -char *pup_typeString(const pup_er p); - -/*Insert a synchronization into the data stream */ -void pup_syncComment(const pup_er p, unsigned int sync, const char *message); -void pup_comment(const pup_er p, const char *message); - -/*Read the size of a pupper */ -size_t pup_size(const pup_er p); - -/* Utilities to approximately encode large sizes, within 0.5% */ -CMK_TYPEDEF_UINT2 pup_encodeSize(size_t s); -size_t pup_decodeSize(CMK_TYPEDEF_UINT2 a); - -/*Pack/unpack data items, declared with macros for brevity. -The macros expand like: -void pup_int(pup_er p,int *i); <- single integer pack/unpack -void pup_ints(pup_er p,int *iarr,int nItems); <- array pack/unpack -*/ -#define PUP_BASIC_DATATYPE(typeName,type) \ - void pup_##typeName(pup_er p,type *v); \ - void pup_##typeName##s(pup_er p,type *arr,size_t nItems); - -PUP_BASIC_DATATYPE(char,char) -PUP_BASIC_DATATYPE(short,short) -PUP_BASIC_DATATYPE(int,int) -PUP_BASIC_DATATYPE(long,long) -PUP_BASIC_DATATYPE(uchar,unsigned char) -PUP_BASIC_DATATYPE(ushort,unsigned short) -PUP_BASIC_DATATYPE(uint,unsigned int) -PUP_BASIC_DATATYPE(ulong,unsigned long) -PUP_BASIC_DATATYPE(float,float) -PUP_BASIC_DATATYPE(double,double) -PUP_BASIC_DATATYPE(pointer,void*) -PUP_BASIC_DATATYPE(int8, CMK_TYPEDEF_INT8) -PUP_BASIC_DATATYPE(size_t, size_t) - -/*Pack/unpack untyped byte array:*/ -void pup_bytes(pup_er p,void *ptr,size_t nBytes); + +#ifndef AMPI_INTERNAL_SKIP_FUNCTIONS + +#define AMPI_CUSTOM_FUNC(return_type, function_name, ...) \ +extern return_type function_name(__VA_ARGS__); + +#include "pup_c_functions.h" + +#undef AMPI_CUSTOM_FUNC + +#endif /* !defined AMPI_INTERNAL_SKIP_FUNCTIONS */ + /* These MUST match the sync declarations in pup.h */ enum { diff --git a/src/util/pup_c_functions.h b/src/util/pup_c_functions.h new file mode 100644 index 0000000000..f57d4ee7e0 --- /dev/null +++ b/src/util/pup_c_functions.h @@ -0,0 +1,77 @@ +/* + * This file is separate from pup_c.h because PUP is included as part + * of AMPI's extensions to the MPI standard, and certain global variable + * privatization methods require the AMPI API to be exposed as function pointers + * through a shim and loader mechanism that needs to list the entire set of + * provided functions at multiple points in its implementation. + * + * See src/libs/ck-libs/ampi/ampi_functions.h for mandatory procedures. + * + * For ease of reading: AMPI_CUSTOM_FUNC(ReturnType, FunctionName, Parameters...) + */ + +/*Allocate PUP::er of different kind */ +AMPI_CUSTOM_FUNC(pup_er, pup_new_sizer, void) +AMPI_CUSTOM_FUNC(pup_er, pup_new_toMem, void *Nbuf) +AMPI_CUSTOM_FUNC(pup_er, pup_new_fromMem, const void *Nbuf) +AMPI_CUSTOM_FUNC(pup_er, pup_new_network_sizer, void) +AMPI_CUSTOM_FUNC(pup_er, pup_new_network_pack, void *Nbuf) +AMPI_CUSTOM_FUNC(pup_er, pup_new_network_unpack, const void *Nbuf) +#if CMK_CCS_AVAILABLE +AMPI_CUSTOM_FUNC(pup_er, pup_new_fmt, pup_er p) +AMPI_CUSTOM_FUNC(void, pup_fmt_sync_begin_object, pup_er p) +AMPI_CUSTOM_FUNC(void, pup_fmt_sync_end_object, pup_er p) +AMPI_CUSTOM_FUNC(void, pup_fmt_sync_begin_array, pup_er p) +AMPI_CUSTOM_FUNC(void, pup_fmt_sync_end_array, pup_er p) +AMPI_CUSTOM_FUNC(void, pup_fmt_sync_item, pup_er p) +#endif +AMPI_CUSTOM_FUNC(void, pup_destroy, pup_er p) + +/*Determine what kind of pup_er we have-- +return 1 for true, 0 for false.*/ +AMPI_CUSTOM_FUNC(int, pup_isPacking, const pup_er p) +AMPI_CUSTOM_FUNC(int, pup_isUnpacking, const pup_er p) +AMPI_CUSTOM_FUNC(int, pup_isSizing, const pup_er p) +AMPI_CUSTOM_FUNC(int, pup_isDeleting, const pup_er p) +AMPI_CUSTOM_FUNC(int, pup_isUserlevel, const pup_er p) +AMPI_CUSTOM_FUNC(int, pup_isRestarting, const pup_er p) +AMPI_CUSTOM_FUNC(char *, pup_typeString, const pup_er p) + +/*Insert a synchronization into the data stream */ +AMPI_CUSTOM_FUNC(void, pup_syncComment, const pup_er p, unsigned int sync, const char *message) +AMPI_CUSTOM_FUNC(void, pup_comment, const pup_er p, const char *message) + +/*Read the size of a pupper */ +AMPI_CUSTOM_FUNC(size_t, pup_size, const pup_er p) + +/* Utilities to approximately encode large sizes, within 0.5% */ +AMPI_CUSTOM_FUNC(CMK_TYPEDEF_UINT2, pup_encodeSize, size_t s) +AMPI_CUSTOM_FUNC(size_t, pup_decodeSize, CMK_TYPEDEF_UINT2 a) + +/*Pack/unpack data items, declared with macros for brevity. +The macros expand like: +AMPI_CUSTOM_FUNC(void, pup_int, pup_er p,int *i) // <- single integer pack/unpack +AMPI_CUSTOM_FUNC(void, pup_ints, pup_er p,int *iarr,int nItems) // <- array pack/unpack +*/ +#define PUP_BASIC_DATATYPE(typeName,type) \ + AMPI_CUSTOM_FUNC(void, pup_##typeName, pup_er p,type *v) \ + AMPI_CUSTOM_FUNC(void, pup_##typeName##s, pup_er p,type *arr,size_t nItems) + +PUP_BASIC_DATATYPE(char,char) +PUP_BASIC_DATATYPE(short,short) +PUP_BASIC_DATATYPE(int,int) +PUP_BASIC_DATATYPE(long,long) +PUP_BASIC_DATATYPE(uchar,unsigned char) +PUP_BASIC_DATATYPE(ushort,unsigned short) +PUP_BASIC_DATATYPE(uint,unsigned int) +PUP_BASIC_DATATYPE(ulong,unsigned long) +PUP_BASIC_DATATYPE(float,float) +PUP_BASIC_DATATYPE(double,double) +PUP_BASIC_DATATYPE(pointer,void*) +PUP_BASIC_DATATYPE(int8, CMK_TYPEDEF_INT8) +PUP_BASIC_DATATYPE(size_t, size_t) + +#undef PUP_BASIC_DATATYPE + +/*Pack/unpack untyped byte array:*/ +AMPI_CUSTOM_FUNC(void, pup_bytes, pup_er p,void *ptr,size_t nBytes) -- 2.11.4.GIT