root/ompi/mpiext/pcollreq/mpif-h/neighbor_alltoallv_init_f.c

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

DEFINITIONS

This source file includes following definitions.
  1. ompix_neighbor_alltoallv_init_f

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2004-2005 The University of Tennessee and The University
   7  *                         of Tennessee Research Foundation.  All rights
   8  *                         reserved.
   9  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
  10  *                         University of Stuttgart.  All rights reserved.
  11  * Copyright (c) 2004-2005 The Regents of the University of California.
  12  *                         All rights reserved.
  13  * Copyright (c) 2011-2012 Cisco Systems, Inc.  All rights reserved.
  14  * Copyright (c) 2013      Los Alamos National Security, LLC. All rights
  15  *                         reserved.
  16  * Copyright (c) 2015-2018 Research Organization for Information Science
  17  *                         and Technology (RIST). All rights reserved.
  18  * $COPYRIGHT$
  19  *
  20  * Additional copyrights may follow
  21  *
  22  * $HEADER$
  23  */
  24 
  25 #include "ompi_config.h"
  26 
  27 #include "ompi/mpi/fortran/mpif-h/bindings.h"
  28 #include "ompi/mpi/fortran/base/constants.h"
  29 #include "ompi/mpiext/pcollreq/mpif-h/mpiext_pcollreq_prototypes.h"
  30 
  31 #if OMPI_BUILD_MPI_PROFILING
  32 #if OPAL_HAVE_WEAK_SYMBOLS
  33 #pragma weak PMPIX_NEIGHBOR_ALLTOALLV_INIT = ompix_neighbor_alltoallv_init_f
  34 #pragma weak pmpix_neighbor_alltoallv_init = ompix_neighbor_alltoallv_init_f
  35 #pragma weak pmpix_neighbor_alltoallv_init_ = ompix_neighbor_alltoallv_init_f
  36 #pragma weak pmpix_neighbor_alltoallv_init__ = ompix_neighbor_alltoallv_init_f
  37 
  38 #pragma weak PMPIX_Neighbor_alltoallv_init_f = ompix_neighbor_alltoallv_init_f
  39 #pragma weak PMPIX_Neighbor_alltoallv_init_f08 = ompix_neighbor_alltoallv_init_f
  40 #else
  41 OMPI_GENERATE_F77_BINDINGS (PMPIX_NEIGHBOR_ALLTOALLV_INIT,
  42                             pmpix_neighbor_alltoallv_init,
  43                             pmpix_neighbor_alltoallv_init_,
  44                             pmpix_neighbor_alltoallv_init__,
  45                             pompix_neighbor_alltoallv_init_f,
  46                             (char *sendbuf, MPI_Fint *sendcounts, MPI_Fint *sdispls, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *rdispls, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr),
  47                             (sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm, info, request, ierr) )
  48 #endif
  49 #endif
  50 
  51 #if OPAL_HAVE_WEAK_SYMBOLS
  52 #pragma weak MPIX_NEIGHBOR_ALLTOALLV_INIT = ompix_neighbor_alltoallv_init_f
  53 #pragma weak mpix_neighbor_alltoallv_init = ompix_neighbor_alltoallv_init_f
  54 #pragma weak mpix_neighbor_alltoallv_init_ = ompix_neighbor_alltoallv_init_f
  55 #pragma weak mpix_neighbor_alltoallv_init__ = ompix_neighbor_alltoallv_init_f
  56 
  57 #pragma weak MPIX_Neighbor_alltoallv_init_f = ompix_neighbor_alltoallv_init_f
  58 #pragma weak MPIX_Neighbor_alltoallv_init_f08 = ompix_neighbor_alltoallv_init_f
  59 #else
  60 #if ! OMPI_BUILD_MPI_PROFILING
  61 OMPI_GENERATE_F77_BINDINGS (MPIX_NEIGHBOR_ALLTOALLV_INIT,
  62                             mpix_neighbor_alltoallv_init,
  63                             mpix_neighbor_alltoallv_init_,
  64                             mpix_neighbor_alltoallv_init__,
  65                             ompix_neighbor_alltoallv_init_f,
  66                             (char *sendbuf, MPI_Fint *sendcounts, MPI_Fint *sdispls, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *rdispls, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr),
  67                             (sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm, info, request, ierr) )
  68 #else
  69 #define ompix_neighbor_alltoallv_init_f pompix_neighbor_alltoallv_init_f
  70 #endif
  71 #endif
  72 
  73 
  74 void ompix_neighbor_alltoallv_init_f(char *sendbuf, MPI_Fint *sendcounts, MPI_Fint *sdispls,
  75                                      MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts,
  76                                      MPI_Fint *rdispls, MPI_Fint *recvtype,
  77                                      MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr)
  78 {
  79     MPI_Comm c_comm;
  80     MPI_Datatype c_sendtype, c_recvtype;
  81     MPI_Info c_info;
  82     MPI_Request c_request;
  83     int size, c_ierr;
  84     OMPI_ARRAY_NAME_DECL(sendcounts);
  85     OMPI_ARRAY_NAME_DECL(sdispls);
  86     OMPI_ARRAY_NAME_DECL(recvcounts);
  87     OMPI_ARRAY_NAME_DECL(rdispls);
  88 
  89     c_comm = PMPI_Comm_f2c(*comm);
  90     c_sendtype = PMPI_Type_f2c(*sendtype);
  91     c_recvtype = PMPI_Type_f2c(*recvtype);
  92     c_info = PMPI_Info_f2c(*info);
  93 
  94     PMPI_Comm_size(c_comm, &size);
  95     OMPI_ARRAY_FINT_2_INT(sendcounts, size);
  96     OMPI_ARRAY_FINT_2_INT(sdispls, size);
  97     OMPI_ARRAY_FINT_2_INT(recvcounts, size);
  98     OMPI_ARRAY_FINT_2_INT(rdispls, size);
  99 
 100     sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf);
 101     sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf);
 102     recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf);
 103 
 104     c_ierr = PMPIX_Neighbor_alltoallv_init(sendbuf,
 105                                            OMPI_ARRAY_NAME_CONVERT(sendcounts),
 106                                            OMPI_ARRAY_NAME_CONVERT(sdispls),
 107                                            c_sendtype,
 108                                            recvbuf,
 109                                            OMPI_ARRAY_NAME_CONVERT(recvcounts),
 110                                            OMPI_ARRAY_NAME_CONVERT(rdispls),
 111                                            c_recvtype, c_comm, c_info, &c_request);
 112     if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
 113     if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request);
 114 
 115     OMPI_ARRAY_FINT_2_INT_CLEANUP(sendcounts);
 116     OMPI_ARRAY_FINT_2_INT_CLEANUP(sdispls);
 117     OMPI_ARRAY_FINT_2_INT_CLEANUP(recvcounts);
 118     OMPI_ARRAY_FINT_2_INT_CLEANUP(rdispls);
 119 }

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