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

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

DEFINITIONS

This source file includes following definitions.
  1. ompi_raccumulate_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) 2014-2016 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 
  31 #if OMPI_BUILD_MPI_PROFILING
  32 #if OPAL_HAVE_WEAK_SYMBOLS
  33 #pragma weak PMPI_RACCUMULATE = ompi_raccumulate_f
  34 #pragma weak pmpi_raccumulate = ompi_raccumulate_f
  35 #pragma weak pmpi_raccumulate_ = ompi_raccumulate_f
  36 #pragma weak pmpi_raccumulate__ = ompi_raccumulate_f
  37 
  38 #pragma weak PMPI_Raccumulate_f = ompi_raccumulate_f
  39 #pragma weak PMPI_Raccumulate_f08 = ompi_raccumulate_f
  40 #else
  41 OMPI_GENERATE_F77_BINDINGS (PMPI_RACCUMULATE,
  42                             pmpi_raccumulate,
  43                             pmpi_raccumulate_,
  44                             pmpi_raccumulate__,
  45                             pompi_raccumulate_f,
  46                             (char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Aint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win, MPI_Fint *request, MPI_Fint *ierr),
  47                             (origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, op, win, request, ierr) )
  48 #endif
  49 #endif
  50 
  51 #if OPAL_HAVE_WEAK_SYMBOLS
  52 #pragma weak MPI_RACCUMULATE = ompi_raccumulate_f
  53 #pragma weak mpi_raccumulate = ompi_raccumulate_f
  54 #pragma weak mpi_raccumulate_ = ompi_raccumulate_f
  55 #pragma weak mpi_raccumulate__ = ompi_raccumulate_f
  56 
  57 #pragma weak MPI_Raccumulate_f = ompi_raccumulate_f
  58 #pragma weak MPI_Raccumulate_f08 = ompi_raccumulate_f
  59 #else
  60 #if ! OMPI_BUILD_MPI_PROFILING
  61 OMPI_GENERATE_F77_BINDINGS (MPI_RACCUMULATE,
  62                             mpi_raccumulate,
  63                             mpi_raccumulate_,
  64                             mpi_raccumulate__,
  65                             ompi_raccumulate_f,
  66                             (char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Aint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win, MPI_Fint *request, MPI_Fint *ierr),
  67                             (origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, op, win, request, ierr) )
  68 #else
  69 #define ompi_raccumulate_f pompi_raccumulate_f
  70 #endif
  71 #endif
  72 
  73 
  74 void ompi_raccumulate_f(char *origin_addr, MPI_Fint *origin_count,
  75                         MPI_Fint *origin_datatype, MPI_Fint *target_rank,
  76                         MPI_Aint *target_disp, MPI_Fint *target_count,
  77                         MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win,
  78                         MPI_Fint *request, MPI_Fint *ierr)
  79 {
  80     int ierr_c;
  81 
  82     MPI_Datatype c_origin_datatype = PMPI_Type_f2c(*origin_datatype);
  83     MPI_Datatype c_target_datatype = PMPI_Type_f2c(*target_datatype);
  84     MPI_Win c_win = PMPI_Win_f2c(*win);
  85     MPI_Op c_op = PMPI_Op_f2c(*op);
  86     MPI_Request c_req;
  87 
  88     ierr_c = PMPI_Raccumulate(OMPI_F2C_BOTTOM(origin_addr),
  89                               OMPI_FINT_2_INT(*origin_count),
  90                               c_origin_datatype,
  91                               OMPI_FINT_2_INT(*target_rank),
  92                               *target_disp,
  93                               OMPI_FINT_2_INT(*target_count),
  94                               c_target_datatype, c_op, c_win,
  95                               &c_req);
  96 
  97     if (NULL != ierr) *ierr = OMPI_INT_2_FINT(ierr_c);
  98 
  99     if (MPI_SUCCESS == ierr_c) {
 100         *request = PMPI_Request_c2f(c_req);
 101     }
 102 }

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