This source file includes following definitions.
- MPI_Ialltoall
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 
  21 
  22 
  23 
  24 
  25 
  26 #include "ompi_config.h"
  27 #include <stdio.h>
  28 
  29 #include "ompi/mpi/c/bindings.h"
  30 #include "ompi/runtime/params.h"
  31 #include "ompi/communicator/communicator.h"
  32 #include "ompi/errhandler/errhandler.h"
  33 #include "ompi/datatype/ompi_datatype.h"
  34 #include "ompi/memchecker.h"
  35 #include "ompi/runtime/ompi_spc.h"
  36 
  37 #if OMPI_BUILD_MPI_PROFILING
  38 #if OPAL_HAVE_WEAK_SYMBOLS
  39 #pragma weak MPI_Ialltoall = PMPI_Ialltoall
  40 #endif
  41 #define MPI_Ialltoall PMPI_Ialltoall
  42 #endif
  43 
  44 static const char FUNC_NAME[] = "MPI_Ialltoall";
  45 
  46 
  47 int MPI_Ialltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
  48                   void *recvbuf, int recvcount, MPI_Datatype recvtype,
  49                   MPI_Comm comm,  MPI_Request *request)
  50 {
  51     size_t sendtype_size, recvtype_size;
  52     int err;
  53 
  54     SPC_RECORD(OMPI_SPC_IALLTOALL, 1);
  55 
  56     MEMCHECKER(
  57         memchecker_comm(comm);
  58         if (MPI_IN_PLACE != sendbuf) {
  59             memchecker_datatype(sendtype);
  60             memchecker_call(&opal_memchecker_base_isdefined, (void *)sendbuf, sendcount, sendtype);
  61         }
  62         memchecker_datatype(recvtype);
  63         memchecker_call(&opal_memchecker_base_isaddressable, recvbuf, recvcount, recvtype);
  64     );
  65 
  66     if (MPI_PARAM_CHECK) {
  67 
  68         
  69 
  70 
  71         err = MPI_SUCCESS;
  72         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  73         if (ompi_comm_invalid(comm)) {
  74             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
  75                                           FUNC_NAME);
  76         } else if ((MPI_IN_PLACE == sendbuf && OMPI_COMM_IS_INTER(comm)) ||
  77                    MPI_IN_PLACE == recvbuf) {
  78             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
  79                                           FUNC_NAME);
  80         } else {
  81             if (MPI_IN_PLACE != sendbuf) {
  82                 OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount);
  83                 OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
  84             }
  85             OMPI_CHECK_DATATYPE_FOR_RECV(err, recvtype, recvcount);
  86             OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
  87         }
  88 
  89         if (MPI_IN_PLACE != sendbuf && !OMPI_COMM_IS_INTER(comm)) {
  90             ompi_datatype_type_size(sendtype, &sendtype_size);
  91             ompi_datatype_type_size(recvtype, &recvtype_size);
  92             if ((sendtype_size*sendcount) != (recvtype_size*recvcount)) {
  93                 return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TRUNCATE, FUNC_NAME);
  94             }
  95         }
  96     }
  97 
  98     OPAL_CR_ENTER_LIBRARY();
  99 
 100     
 101     err = comm->c_coll->coll_ialltoall(sendbuf, sendcount, sendtype,
 102                                       recvbuf, recvcount, recvtype, comm,
 103                                       request, comm->c_coll->coll_ialltoall_module);
 104     OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
 105 }