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

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

DEFINITIONS

This source file includes following definitions.
  1. ompi_neighbor_allgather_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      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 
  30 #if OMPI_BUILD_MPI_PROFILING
  31 #if OPAL_HAVE_WEAK_SYMBOLS
  32 #pragma weak PMPI_NEIGHBOR_ALLGATHER = ompi_neighbor_allgather_f
  33 #pragma weak pmpi_neighbor_allgather = ompi_neighbor_allgather_f
  34 #pragma weak pmpi_neighbor_allgather_ = ompi_neighbor_allgather_f
  35 #pragma weak pmpi_neighbor_allgather__ = ompi_neighbor_allgather_f
  36 
  37 #pragma weak PMPI_Neighbor_allgather_f = ompi_neighbor_allgather_f
  38 #pragma weak PMPI_Neighbor_allgather_f08 = ompi_neighbor_allgather_f
  39 #else
  40 OMPI_GENERATE_F77_BINDINGS (PMPI_NEIGHBOR_ALLGATHER,
  41                            pmpi_neighbor_allgather,
  42                            pmpi_neighbor_allgather_,
  43                            pmpi_neighbor_allgather__,
  44                            pompi_neighbor_allgather_f,
  45                            (char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr),
  46                            (sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, ierr) )
  47 #endif
  48 #endif
  49 
  50 #if OPAL_HAVE_WEAK_SYMBOLS
  51 #pragma weak MPI_NEIGHBOR_ALLGATHER = ompi_neighbor_allgather_f
  52 #pragma weak mpi_neighbor_allgather = ompi_neighbor_allgather_f
  53 #pragma weak mpi_neighbor_allgather_ = ompi_neighbor_allgather_f
  54 #pragma weak mpi_neighbor_allgather__ = ompi_neighbor_allgather_f
  55 
  56 #pragma weak MPI_Neighbor_allgather_f = ompi_neighbor_allgather_f
  57 #pragma weak MPI_Neighbor_allgather_f08 = ompi_neighbor_allgather_f
  58 #else
  59 #if ! OMPI_BUILD_MPI_PROFILING
  60 OMPI_GENERATE_F77_BINDINGS (MPI_NEIGHBOR_ALLGATHER,
  61                            mpi_neighbor_allgather,
  62                            mpi_neighbor_allgather_,
  63                            mpi_neighbor_allgather__,
  64                            ompi_neighbor_allgather_f,
  65                            (char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr),
  66                            (sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, ierr) )
  67 #else
  68 #define ompi_neighbor_allgather_f pompi_neighbor_allgather_f
  69 #endif
  70 #endif
  71 
  72 
  73 void ompi_neighbor_allgather_f(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype,
  74                                char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype,
  75                                MPI_Fint *comm, MPI_Fint *ierr)
  76 {
  77     int ierr_c;
  78     MPI_Comm c_comm;
  79     MPI_Datatype c_sendtype, c_recvtype;
  80 
  81     c_comm = PMPI_Comm_f2c(*comm);
  82     c_sendtype = PMPI_Type_f2c(*sendtype);
  83     c_recvtype = PMPI_Type_f2c(*recvtype);
  84 
  85     sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf);
  86     sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf);
  87     recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf);
  88 
  89     ierr_c = PMPI_Neighbor_allgather(sendbuf,
  90                                      OMPI_FINT_2_INT(*sendcount),
  91                                      c_sendtype,
  92                                      recvbuf,
  93                                      OMPI_FINT_2_INT(*recvcount),
  94                                      c_recvtype, c_comm);
  95 
  96     if (NULL != ierr) *ierr = OMPI_INT_2_FINT(ierr_c);
  97 }

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