X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fdab189916cad1bf47afa4f3c272c8ba26c36ed1..d389c534faa9e89b5a9752fc122b20516b7659b0:/src/smpi/include/private.hpp?ds=sidebyside diff --git a/src/smpi/include/private.hpp b/src/smpi/include/private.hpp index 6adc8704cb..2f135703ae 100644 --- a/src/smpi/include/private.hpp +++ b/src/smpi/include/private.hpp @@ -47,12 +47,19 @@ constexpr int SMPI_RMA_TAG = -6666; #define MPI_REQUEST_IGNORED ((MPI_Request*)-100) +/* Bindings for MPI special values */ +extern XBT_PUBLIC int mpi_in_place_; +extern XBT_PUBLIC int mpi_bottom_; +extern XBT_PUBLIC int mpi_status_ignore_; +extern XBT_PUBLIC int mpi_statuses_ignore_; /* Convert between Fortran and C */ - -#define FORT_BOTTOM(addr) ((*(int*)addr) == -200 ? MPI_BOTTOM : (void*)addr) -#define FORT_IN_PLACE(addr) ((*(int*)addr) == -100 ? MPI_IN_PLACE : (void*)addr) -#define FORT_STATUS_IGNORE(addr) (static_cast((*(int*)addr) == -300 ? MPI_STATUS_IGNORE : (void*)addr)) -#define FORT_STATUSES_IGNORE(addr) (static_cast((*(int*)addr) == -400 ? MPI_STATUSES_IGNORE : (void*)addr)) +#define FORT_ADDR(addr, val, val2) \ + (((void *)(addr) == (void*) &(val2)) \ + ? (val) : (void *)(addr)) +#define FORT_BOTTOM(addr) FORT_ADDR(addr, MPI_BOTTOM, mpi_bottom_) +#define FORT_IN_PLACE(addr) FORT_ADDR(addr, MPI_IN_PLACE, mpi_in_place_) +#define FORT_STATUS_IGNORE(addr) static_cast(FORT_ADDR(addr, MPI_STATUS_IGNORE, mpi_status_ignore_)) +#define FORT_STATUSES_IGNORE(addr) static_cast(FORT_ADDR(addr, MPI_STATUSES_IGNORE, mpi_statuses_ignore_)) extern XBT_PRIVATE MPI_Comm MPI_COMM_UNINITIALIZED;