root/ompi/mpi/fortran/mpif-h/iscatterv_f.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. ompi_iscatterv_f

   1 /*
   2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2005 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2011-2012 Cisco Systems, Inc.  All rights reserved.
  13  * Copyright (c) 2015      Research Organization for Information Science
  14  *                         and Technology (RIST). All rights reserved.
  15  * Copyright (c) 2018      FUJITSU LIMITED.  All rights reserved.
  16  * $COPYRIGHT$
  17  *
  18  * Additional copyrights may follow
  19  *
  20  * $HEADER$
  21  */
  22 
  23 #include "ompi_config.h"
  24 
  25 #include "ompi/mpi/fortran/mpif-h/bindings.h"
  26 #include "ompi/mpi/fortran/base/constants.h"
  27 
  28 #if OMPI_BUILD_MPI_PROFILING
  29 #if OPAL_HAVE_WEAK_SYMBOLS
  30 #pragma weak PMPI_ISCATTERV = ompi_iscatterv_f
  31 #pragma weak pmpi_iscatterv = ompi_iscatterv_f
  32 #pragma weak pmpi_iscatterv_ = ompi_iscatterv_f
  33 #pragma weak pmpi_iscatterv__ = ompi_iscatterv_f
  34 
  35 #pragma weak PMPI_Iscatterv_f = ompi_iscatterv_f
  36 #pragma weak PMPI_Iscatterv_f08 = ompi_iscatterv_f
  37 #else
  38 OMPI_GENERATE_F77_BINDINGS (PMPI_ISCATTERV,
  39                             pmpi_iscatterv,
  40                             pmpi_iscatterv_,
  41                             pmpi_iscatterv__,
  42                             pompi_iscatterv_f,
  43                             (char *sendbuf, MPI_Fint *sendcounts, MPI_Fint *displs, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *root, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr),
  44                             (sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request, ierr) )
  45 #endif
  46 #endif
  47 
  48 #if OPAL_HAVE_WEAK_SYMBOLS
  49 #pragma weak MPI_ISCATTERV = ompi_iscatterv_f
  50 #pragma weak mpi_iscatterv = ompi_iscatterv_f
  51 #pragma weak mpi_iscatterv_ = ompi_iscatterv_f
  52 #pragma weak mpi_iscatterv__ = ompi_iscatterv_f
  53 
  54 #pragma weak MPI_Iscatterv_f = ompi_iscatterv_f
  55 #pragma weak MPI_Iscatterv_f08 = ompi_iscatterv_f
  56 #else
  57 #if ! OMPI_BUILD_MPI_PROFILING
  58 OMPI_GENERATE_F77_BINDINGS (MPI_ISCATTERV,
  59                             mpi_iscatterv,
  60                             mpi_iscatterv_,
  61                             mpi_iscatterv__,
  62                             ompi_iscatterv_f,
  63                             (char *sendbuf, MPI_Fint *sendcounts, MPI_Fint *displs, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *root, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr),
  64                             (sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request, ierr) )
  65 #else
  66 #define ompi_iscatterv_f pompi_iscatterv_f
  67 #endif
  68 #endif
  69 
  70 
  71 void ompi_iscatterv_f(char *sendbuf, MPI_Fint *sendcounts,
  72                       MPI_Fint *displs, MPI_Fint *sendtype,
  73                       char *recvbuf, MPI_Fint *recvcount,
  74                       MPI_Fint *recvtype, MPI_Fint *root,
  75                       MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr)
  76 {
  77     MPI_Comm c_comm;
  78     MPI_Datatype c_sendtype, c_recvtype;
  79     MPI_Request c_request;
  80     int size, c_ierr;
  81     OMPI_ARRAY_NAME_DECL(sendcounts);
  82     OMPI_ARRAY_NAME_DECL(displs);
  83 
  84     c_comm = PMPI_Comm_f2c(*comm);
  85     c_sendtype = PMPI_Type_f2c(*sendtype);
  86     c_recvtype = PMPI_Type_f2c(*recvtype);
  87 
  88     PMPI_Comm_size(c_comm, &size);
  89     OMPI_ARRAY_FINT_2_INT(sendcounts, size);
  90     OMPI_ARRAY_FINT_2_INT(displs, size);
  91 
  92     sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf);
  93     recvbuf = (char *) OMPI_F2C_IN_PLACE(recvbuf);
  94     recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf);
  95 
  96     c_ierr = PMPI_Iscatterv(sendbuf,
  97                            OMPI_ARRAY_NAME_CONVERT(sendcounts),
  98                            OMPI_ARRAY_NAME_CONVERT(displs),
  99                            c_sendtype, recvbuf,
 100                            OMPI_FINT_2_INT(*recvcount),
 101                            c_recvtype,
 102                            OMPI_FINT_2_INT(*root), c_comm, &c_request);
 103     if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
 104     if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request);
 105 
 106     OMPI_ARRAY_FINT_2_INT_CLEANUP(sendcounts);
 107     OMPI_ARRAY_FINT_2_INT_CLEANUP(displs);
 108 }

/* [<][>][^][v][top][bottom][index][help] */