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

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

DEFINITIONS

This source file includes following definitions.
  1. ompi_win_set_attr_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-2017 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/attribute/attribute.h"
  26 #include "ompi/win/win.h"
  27 
  28 
  29 #if OMPI_BUILD_MPI_PROFILING
  30 #if OPAL_HAVE_WEAK_SYMBOLS
  31 #pragma weak PMPI_WIN_SET_ATTR = ompi_win_set_attr_f
  32 #pragma weak pmpi_win_set_attr = ompi_win_set_attr_f
  33 #pragma weak pmpi_win_set_attr_ = ompi_win_set_attr_f
  34 #pragma weak pmpi_win_set_attr__ = ompi_win_set_attr_f
  35 
  36 #pragma weak PMPI_Win_set_attr_f = ompi_win_set_attr_f
  37 #pragma weak PMPI_Win_set_attr_f08 = ompi_win_set_attr_f
  38 #else
  39 OMPI_GENERATE_F77_BINDINGS (PMPI_WIN_SET_ATTR,
  40                            pmpi_win_set_attr,
  41                            pmpi_win_set_attr_,
  42                            pmpi_win_set_attr__,
  43                            pompi_win_set_attr_f,
  44                            (MPI_Fint *win, MPI_Fint *win_keyval, MPI_Aint *attribute_val, MPI_Fint *ierr),
  45                            (win, win_keyval, attribute_val, ierr) )
  46 #endif
  47 #endif
  48 
  49 #if OPAL_HAVE_WEAK_SYMBOLS
  50 #pragma weak MPI_WIN_SET_ATTR = ompi_win_set_attr_f
  51 #pragma weak mpi_win_set_attr = ompi_win_set_attr_f
  52 #pragma weak mpi_win_set_attr_ = ompi_win_set_attr_f
  53 #pragma weak mpi_win_set_attr__ = ompi_win_set_attr_f
  54 
  55 #pragma weak MPI_Win_set_attr_f = ompi_win_set_attr_f
  56 #pragma weak MPI_Win_set_attr_f08 = ompi_win_set_attr_f
  57 #else
  58 #if ! OMPI_BUILD_MPI_PROFILING
  59 OMPI_GENERATE_F77_BINDINGS (MPI_WIN_SET_ATTR,
  60                            mpi_win_set_attr,
  61                            mpi_win_set_attr_,
  62                            mpi_win_set_attr__,
  63                            ompi_win_set_attr_f,
  64                            (MPI_Fint *win, MPI_Fint *win_keyval, MPI_Aint *attribute_val, MPI_Fint *ierr),
  65                            (win, win_keyval, attribute_val, ierr) )
  66 #else
  67 #define ompi_win_set_attr_f pompi_win_set_attr_f
  68 #endif
  69 #endif
  70 
  71 void ompi_win_set_attr_f(MPI_Fint *win, MPI_Fint *win_keyval,
  72                         MPI_Aint *attribute_val, MPI_Fint *ierr)
  73 {
  74     int c_ierr;
  75     MPI_Win c_win = PMPI_Win_f2c(*win);
  76 
  77     /* This stuff is very confusing.  Be sure to see the comment at
  78        the top of src/attributes/attributes.c. */
  79 
  80     c_ierr = ompi_attr_set_aint(WIN_ATTR,
  81                                 c_win,
  82                                 &c_win->w_keyhash,
  83                                 OMPI_FINT_2_INT(*win_keyval),
  84                                 *attribute_val,
  85                                 false);
  86     if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
  87 }

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