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

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

DEFINITIONS

This source file includes following definitions.
  1. ompix_neighbor_allgatherv_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_ALLGATHERV_INIT = ompix_neighbor_allgatherv_init_f
  34 #pragma weak pmpix_neighbor_allgatherv_init = ompix_neighbor_allgatherv_init_f
  35 #pragma weak pmpix_neighbor_allgatherv_init_ = ompix_neighbor_allgatherv_init_f
  36 #pragma weak pmpix_neighbor_allgatherv_init__ = ompix_neighbor_allgatherv_init_f
  37 
  38 #pragma weak PMPIX_Neighbor_allgatherv_init_f = ompix_neighbor_allgatherv_init_f
  39 #pragma weak PMPIX_Neighbor_allgatherv_init_f08 = ompix_neighbor_allgatherv_init_f
  40 #else
  41 OMPI_GENERATE_F77_BINDINGS (PMPIX_NEIGHBOR_ALLGATHERV_INIT,
  42                             pmpix_neighbor_allgatherv_init,
  43                             pmpix_neighbor_allgatherv_init_,
  44                             pmpix_neighbor_allgatherv_init__,
  45                             pompix_neighbor_allgatherv_init_f,
  46                             (char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *displs, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr),
  47                             (sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, info, request, ierr) )
  48 #endif
  49 #endif
  50 
  51 #if OPAL_HAVE_WEAK_SYMBOLS
  52 #pragma weak MPIX_NEIGHBOR_ALLGATHERV_INIT = ompix_neighbor_allgatherv_init_f
  53 #pragma weak mpix_neighbor_allgatherv_init = ompix_neighbor_allgatherv_init_f
  54 #pragma weak mpix_neighbor_allgatherv_init_ = ompix_neighbor_allgatherv_init_f
  55 #pragma weak mpix_neighbor_allgatherv_init__ = ompix_neighbor_allgatherv_init_f
  56 
  57 #pragma weak MPIX_Neighbor_allgatherv_init_f = ompix_neighbor_allgatherv_init_f
  58 #pragma weak MPIX_Neighbor_allgatherv_init_f08 = ompix_neighbor_allgatherv_init_f
  59 #else
  60 #if ! OMPI_BUILD_MPI_PROFILING
  61 OMPI_GENERATE_F77_BINDINGS (MPIX_NEIGHBOR_ALLGATHERV_INIT,
  62                             mpix_neighbor_allgatherv_init,
  63                             mpix_neighbor_allgatherv_init_,
  64                             mpix_neighbor_allgatherv_init__,
  65                             ompix_neighbor_allgatherv_init_f,
  66                             (char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *displs, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr),
  67                             (sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, info, request, ierr) )
  68 #else
  69 #define ompix_neighbor_allgatherv_init_f pompix_neighbor_allgatherv_init_f
  70 #endif
  71 #endif
  72 
  73 
  74 void ompix_neighbor_allgatherv_init_f(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype,
  75                                       char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *displs,
  76                                       MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request,
  77                                       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, ierr_c;
  84     OMPI_ARRAY_NAME_DECL(recvcounts);
  85     OMPI_ARRAY_NAME_DECL(displs);
  86 
  87     c_comm = PMPI_Comm_f2c(*comm);
  88     c_sendtype = PMPI_Type_f2c(*sendtype);
  89     c_recvtype = PMPI_Type_f2c(*recvtype);
  90     c_info = PMPI_Info_f2c(*info);
  91 
  92     PMPI_Comm_size(c_comm, &size);
  93     OMPI_ARRAY_FINT_2_INT(recvcounts, size);
  94     OMPI_ARRAY_FINT_2_INT(displs, size);
  95 
  96     sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf);
  97     sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf);
  98     recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf);
  99 
 100     ierr_c = PMPIX_Neighbor_allgatherv_init(sendbuf,
 101                                             OMPI_FINT_2_INT(*sendcount),
 102                                             c_sendtype,
 103                                             recvbuf,
 104                                             OMPI_ARRAY_NAME_CONVERT(recvcounts),
 105                                             OMPI_ARRAY_NAME_CONVERT(displs),
 106                                             c_recvtype, c_comm, c_info, &c_request);
 107 
 108     if (NULL != ierr) *ierr = OMPI_INT_2_FINT(ierr_c);
 109     if (MPI_SUCCESS == ierr_c) *request = PMPI_Request_c2f(c_request);
 110 
 111     OMPI_ARRAY_FINT_2_INT_CLEANUP(recvcounts);
 112     OMPI_ARRAY_FINT_2_INT_CLEANUP(displs);
 113 }

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