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

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

DEFINITIONS

This source file includes following definitions.
  1. ompi_fetch_and_op_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      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_FETCH_AND_OP = ompi_fetch_and_op_f
  34 #pragma weak pmpi_fetch_and_op = ompi_fetch_and_op_f
  35 #pragma weak pmpi_fetch_and_op_ = ompi_fetch_and_op_f
  36 #pragma weak pmpi_fetch_and_op__ = ompi_fetch_and_op_f
  37 
  38 #pragma weak PMPI_Fetch_and_op_f = ompi_fetch_and_op_f
  39 #pragma weak PMPI_Fetch_and_op_f08 = ompi_fetch_and_op_f
  40 #else
  41 OMPI_GENERATE_F77_BINDINGS (PMPI_FETCH_AND_OP,
  42                             pmpi_fetch_and_op,
  43                             pmpi_fetch_and_op_,
  44                             pmpi_fetch_and_op__,
  45                             pompi_fetch_and_op_f,
  46                             (char *origin_addr, char *result_addr, MPI_Fint *datatype, MPI_Fint *target_rank, MPI_Aint *target_disp, MPI_Fint *op, MPI_Fint *win, MPI_Fint *ierr),
  47                             (origin_addr, result_addr, datatype, target_rank, target_disp, op, win, ierr) )
  48 #endif
  49 #endif
  50 
  51 #if OPAL_HAVE_WEAK_SYMBOLS
  52 #pragma weak MPI_FETCH_AND_OP = ompi_fetch_and_op_f
  53 #pragma weak mpi_fetch_and_op = ompi_fetch_and_op_f
  54 #pragma weak mpi_fetch_and_op_ = ompi_fetch_and_op_f
  55 #pragma weak mpi_fetch_and_op__ = ompi_fetch_and_op_f
  56 
  57 #pragma weak MPI_Fetch_and_op_f = ompi_fetch_and_op_f
  58 #pragma weak MPI_Fetch_and_op_f08 = ompi_fetch_and_op_f
  59 #else
  60 #if ! OMPI_BUILD_MPI_PROFILING
  61 OMPI_GENERATE_F77_BINDINGS (MPI_FETCH_AND_OP,
  62                             mpi_fetch_and_op,
  63                             mpi_fetch_and_op_,
  64                             mpi_fetch_and_op__,
  65                             ompi_fetch_and_op_f,
  66                             (char *origin_addr, char *result_addr, MPI_Fint *datatype, MPI_Fint *target_rank, MPI_Aint *target_disp, MPI_Fint *op, MPI_Fint *win, MPI_Fint *ierr),
  67                             (origin_addr, result_addr, datatype, target_rank, target_disp, op, win, ierr) )
  68 #else
  69 #define ompi_fetch_and_op_f pompi_fetch_and_op_f
  70 #endif
  71 #endif
  72 
  73 
  74 void ompi_fetch_and_op_f(char *origin_addr, char *result_addr, MPI_Fint *datatype,
  75                          MPI_Fint *target_rank, MPI_Aint *target_disp,
  76                          MPI_Fint *op, MPI_Fint *win, MPI_Fint *ierr)
  77 {
  78     int c_ierr;
  79     MPI_Datatype c_datatype = PMPI_Type_f2c(*datatype);
  80     MPI_Win c_win = PMPI_Win_f2c(*win);
  81     MPI_Op c_op = PMPI_Op_f2c(*op);
  82 
  83     c_ierr = PMPI_Fetch_and_op(OMPI_F2C_BOTTOM(origin_addr),
  84                               OMPI_F2C_BOTTOM(result_addr),
  85                               c_datatype,
  86                               OMPI_FINT_2_INT(*target_rank),
  87                               *target_disp, c_op, c_win);
  88     if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
  89 }

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