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

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

DEFINITIONS

This source file includes following definitions.
  1. ompi_accumulate_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      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 
  27 
  28 #if OMPI_BUILD_MPI_PROFILING
  29 #if OPAL_HAVE_WEAK_SYMBOLS
  30 #pragma weak PMPI_ACCUMULATE = ompi_accumulate_f
  31 #pragma weak pmpi_accumulate = ompi_accumulate_f
  32 #pragma weak pmpi_accumulate_ = ompi_accumulate_f
  33 #pragma weak pmpi_accumulate__ = ompi_accumulate_f
  34 
  35 #pragma weak PMPI_Accumulate_f = ompi_accumulate_f
  36 #pragma weak PMPI_Accumulate_f08 = ompi_accumulate_f
  37 #else
  38 OMPI_GENERATE_F77_BINDINGS (PMPI_ACCUMULATE,
  39                            pmpi_accumulate,
  40                            pmpi_accumulate_,
  41                            pmpi_accumulate__,
  42                            pompi_accumulate_f,
  43                            (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 *ierr),
  44                            (origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, op, win, ierr) )
  45 #endif
  46 #endif
  47 
  48 #if OPAL_HAVE_WEAK_SYMBOLS
  49 #pragma weak MPI_ACCUMULATE = ompi_accumulate_f
  50 #pragma weak mpi_accumulate = ompi_accumulate_f
  51 #pragma weak mpi_accumulate_ = ompi_accumulate_f
  52 #pragma weak mpi_accumulate__ = ompi_accumulate_f
  53 
  54 #pragma weak MPI_Accumulate_f = ompi_accumulate_f
  55 #pragma weak MPI_Accumulate_f08 = ompi_accumulate_f
  56 #else
  57 #if ! OMPI_BUILD_MPI_PROFILING
  58 OMPI_GENERATE_F77_BINDINGS (MPI_ACCUMULATE,
  59                            mpi_accumulate,
  60                            mpi_accumulate_,
  61                            mpi_accumulate__,
  62                            ompi_accumulate_f,
  63                            (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 *ierr),
  64                            (origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, op, win, ierr) )
  65 #else
  66 #define ompi_accumulate_f pompi_accumulate_f
  67 #endif
  68 #endif
  69 
  70 
  71 void ompi_accumulate_f(char *origin_addr, MPI_Fint *origin_count,
  72                       MPI_Fint *origin_datatype, MPI_Fint *target_rank,
  73                       MPI_Aint *target_disp, MPI_Fint *target_count,
  74                       MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win,
  75                       MPI_Fint *ierr)
  76 {
  77     int ierr_c;
  78 
  79     MPI_Datatype c_origin_datatype = PMPI_Type_f2c(*origin_datatype);
  80     MPI_Datatype c_target_datatype = PMPI_Type_f2c(*target_datatype);
  81     MPI_Win c_win = PMPI_Win_f2c(*win);
  82     MPI_Op c_op = PMPI_Op_f2c(*op);
  83 
  84     ierr_c = PMPI_Accumulate(OMPI_F2C_BOTTOM(origin_addr),
  85                              OMPI_FINT_2_INT(*origin_count),
  86                              c_origin_datatype,
  87                              OMPI_FINT_2_INT(*target_rank),
  88                              *target_disp,
  89                              OMPI_FINT_2_INT(*target_count),
  90                              c_target_datatype, c_op, c_win);
  91 
  92     if (NULL != ierr) *ierr = OMPI_INT_2_FINT(ierr_c);
  93 }

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