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

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

DEFINITIONS

This source file includes following definitions.
  1. ompi_file_get_view_f

   1 /*
   2  * Copyright (c) 2004-2007 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/mpi/fortran/base/fortran_base_strings.h"
  26 #include "ompi/file/file.h"
  27 
  28 #if OMPI_BUILD_MPI_PROFILING
  29 #if OPAL_HAVE_WEAK_SYMBOLS
  30 #pragma weak PMPI_FILE_GET_VIEW = ompi_file_get_view_f
  31 #pragma weak pmpi_file_get_view = ompi_file_get_view_f
  32 #pragma weak pmpi_file_get_view_ = ompi_file_get_view_f
  33 #pragma weak pmpi_file_get_view__ = ompi_file_get_view_f
  34 
  35 #pragma weak PMPI_File_get_view_f = ompi_file_get_view_f
  36 #pragma weak PMPI_File_get_view_f08 = ompi_file_get_view_f
  37 #else
  38 OMPI_GENERATE_F77_BINDINGS (PMPI_FILE_GET_VIEW,
  39                            pmpi_file_get_view,
  40                            pmpi_file_get_view_,
  41                            pmpi_file_get_view__,
  42                            pompi_file_get_view_f,
  43                            (MPI_Fint *fh, MPI_Offset *disp, MPI_Fint *etype, MPI_Fint *filetype, char *datarep, MPI_Fint *ierr, int datarep_len),
  44                            (fh, disp, etype, filetype, datarep, ierr, datarep_len) )
  45 #endif
  46 #endif
  47 
  48 #if OPAL_HAVE_WEAK_SYMBOLS
  49 #pragma weak MPI_FILE_GET_VIEW = ompi_file_get_view_f
  50 #pragma weak mpi_file_get_view = ompi_file_get_view_f
  51 #pragma weak mpi_file_get_view_ = ompi_file_get_view_f
  52 #pragma weak mpi_file_get_view__ = ompi_file_get_view_f
  53 
  54 #pragma weak MPI_File_get_view_f = ompi_file_get_view_f
  55 #pragma weak MPI_File_get_view_f08 = ompi_file_get_view_f
  56 #else
  57 #if ! OMPI_BUILD_MPI_PROFILING
  58 OMPI_GENERATE_F77_BINDINGS (MPI_FILE_GET_VIEW,
  59                            mpi_file_get_view,
  60                            mpi_file_get_view_,
  61                            mpi_file_get_view__,
  62                            ompi_file_get_view_f,
  63                            (MPI_Fint *fh, MPI_Offset *disp, MPI_Fint *etype, MPI_Fint *filetype, char *datarep, MPI_Fint *ierr, int datarep_len),
  64                            (fh, disp, etype, filetype, datarep, ierr, datarep_len) )
  65 #else
  66 #define ompi_file_get_view_f pompi_file_get_view_f
  67 #endif
  68 #endif
  69 
  70 
  71 void ompi_file_get_view_f(MPI_Fint *fh, MPI_Offset *disp,
  72                          MPI_Fint *etype, MPI_Fint *filetype,
  73                          char *datarep, MPI_Fint *ierr, int datarep_len)
  74 {
  75     int c_ierr;
  76     MPI_File c_fh = PMPI_File_f2c(*fh);
  77     MPI_Datatype c_etype, c_filetype;
  78     MPI_Offset c_disp;
  79     char c_datarep[MPI_MAX_DATAREP_STRING];
  80 
  81     c_ierr = PMPI_File_get_view(c_fh, &c_disp, &c_etype,
  82                                &c_filetype, c_datarep);
  83     if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
  84 
  85     if (MPI_SUCCESS == c_ierr) {
  86         *disp = (MPI_Offset) c_disp;
  87         *etype = PMPI_Type_c2f(c_etype);
  88         *filetype = PMPI_Type_c2f(c_filetype);
  89         ompi_fortran_string_c2f(c_datarep, datarep, datarep_len);
  90     }
  91 }

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