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

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

DEFINITIONS

This source file includes following definitions.
  1. ompix_reduce_scatter_init_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-2018 Research Organization for Information Science
  14  *                         and Technology (RIST). All rights reserved.
  15  * $COPYRIGHT$
  16  *
  17  * Additional copyrights may follow
  18  *
  19  * $HEADER$
  20  */
  21 
  22 #include "ompi_config.h"
  23 
  24 #include "ompi/mpi/fortran/mpif-h/bindings.h"
  25 #include "ompi/mpi/fortran/base/constants.h"
  26 #include "ompi/mpiext/pcollreq/mpif-h/mpiext_pcollreq_prototypes.h"
  27 
  28 #if OMPI_BUILD_MPI_PROFILING
  29 #if OPAL_HAVE_WEAK_SYMBOLS
  30 #pragma weak PMPIX_REDUCE_SCATTER_INIT = ompix_reduce_scatter_init_f
  31 #pragma weak pmpix_reduce_scatter_init = ompix_reduce_scatter_init_f
  32 #pragma weak pmpix_reduce_scatter_init_ = ompix_reduce_scatter_init_f
  33 #pragma weak pmpix_reduce_scatter_init__ = ompix_reduce_scatter_init_f
  34 
  35 #pragma weak PMPIX_Reduce_scatter_init_f = ompix_reduce_scatter_init_f
  36 #pragma weak PMPIX_Reduce_scatter_init_f08 = ompix_reduce_scatter_init_f
  37 #else
  38 OMPI_GENERATE_F77_BINDINGS (PMPIX_REDUCE_SCATTER_INIT,
  39                             pmpix_reduce_scatter_init,
  40                             pmpix_reduce_scatter_init_,
  41                             pmpix_reduce_scatter_init__,
  42                             pompix_reduce_scatter_init_f,
  43                             (char *sendbuf, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr),
  44                             (sendbuf, recvbuf, recvcounts, datatype, op, comm, info, request, ierr) )
  45 #endif
  46 #endif
  47 
  48 #if OPAL_HAVE_WEAK_SYMBOLS
  49 #pragma weak MPIX_REDUCE_SCATTER_INIT = ompix_reduce_scatter_init_f
  50 #pragma weak mpix_reduce_scatter_init = ompix_reduce_scatter_init_f
  51 #pragma weak mpix_reduce_scatter_init_ = ompix_reduce_scatter_init_f
  52 #pragma weak mpix_reduce_scatter_init__ = ompix_reduce_scatter_init_f
  53 
  54 #pragma weak MPIX_Reduce_scatter_init_f = ompix_reduce_scatter_init_f
  55 #pragma weak MPIX_Reduce_scatter_init_f08 = ompix_reduce_scatter_init_f
  56 #else
  57 #if ! OMPI_BUILD_MPI_PROFILING
  58 OMPI_GENERATE_F77_BINDINGS (MPIX_REDUCE_SCATTER_INIT,
  59                             mpix_reduce_scatter_init,
  60                             mpix_reduce_scatter_init_,
  61                             mpix_reduce_scatter_init__,
  62                             ompix_reduce_scatter_init_f,
  63                             (char *sendbuf, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr),
  64                             (sendbuf, recvbuf, recvcounts, datatype, op, comm, info, request, ierr) )
  65 #else
  66 #define ompix_reduce_scatter_init_f pompix_reduce_scatter_init_f
  67 #endif
  68 #endif
  69 
  70 
  71 void ompix_reduce_scatter_init_f(char *sendbuf, char *recvbuf,
  72                                  MPI_Fint *recvcounts, MPI_Fint *datatype,
  73                                  MPI_Fint *op, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request,
  74                                  MPI_Fint *ierr)
  75 {
  76     int c_ierr;
  77     MPI_Comm c_comm;
  78     MPI_Datatype c_type;
  79     MPI_Info c_info;
  80     MPI_Request c_request;
  81     MPI_Op c_op;
  82     int size;
  83     OMPI_ARRAY_NAME_DECL(recvcounts);
  84 
  85     c_comm = PMPI_Comm_f2c(*comm);
  86     c_type = PMPI_Type_f2c(*datatype);
  87     c_op = PMPI_Op_f2c(*op);
  88     c_info = PMPI_Info_f2c(*info);
  89 
  90     PMPI_Comm_size(c_comm, &size);
  91     OMPI_ARRAY_FINT_2_INT(recvcounts, size);
  92 
  93     sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf);
  94     sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf);
  95     recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf);
  96 
  97     c_ierr = PMPIX_Reduce_scatter_init(sendbuf, recvbuf,
  98                                        OMPI_ARRAY_NAME_CONVERT(recvcounts),
  99                                        c_type, c_op, c_comm, c_info, &c_request);
 100     if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
 101     if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request);
 102 }

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