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

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

DEFINITIONS

This source file includes following definitions.
  1. ompi_status_set_elements_x_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-2013 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-2013 Cisco Systems, Inc.  All rights reserved.
  13  * Copyright (c) 2013      Los Alamos National Security, LLC. All rights
  14  *                         reserved.
  15  * Copyright (c) 2015      Research Organization for Information Science
  16  *                         and Technology (RIST). All rights reserved.
  17  * $COPYRIGHT$
  18  *
  19  * Additional copyrights may follow
  20  *
  21  * $HEADER$
  22  */
  23 
  24 #include "ompi_config.h"
  25 
  26 #include "ompi/mpi/fortran/mpif-h/bindings.h"
  27 #include "ompi/mpi/fortran/base/constants.h"
  28 
  29 #if OMPI_BUILD_MPI_PROFILING
  30 #if OPAL_HAVE_WEAK_SYMBOLS
  31 #pragma weak PMPI_STATUS_SET_ELEMENTS_X = ompi_status_set_elements_x_f
  32 #pragma weak pmpi_status_set_elements_x = ompi_status_set_elements_x_f
  33 #pragma weak pmpi_status_set_elements_x_ = ompi_status_set_elements_x_f
  34 #pragma weak pmpi_status_set_elements_x__ = ompi_status_set_elements_x_f
  35 
  36 #pragma weak PMPI_Status_set_elements_x_f = ompi_status_set_elements_x_f
  37 #pragma weak PMPI_Status_set_elements_x_f08 = ompi_status_set_elements_x_f
  38 #else
  39 OMPI_GENERATE_F77_BINDINGS (PMPI_STATUS_SET_ELEMENTS_X,
  40                            pmpi_status_set_elements_x,
  41                            pmpi_status_set_elements_x_,
  42                            pmpi_status_set_elements_x__,
  43                            pompi_status_set_elements_x_f,
  44                            (MPI_Fint *status, MPI_Fint *datatype, MPI_Count *count, MPI_Fint *ierr),
  45                            (status, datatype, count, ierr) )
  46 #endif
  47 #endif
  48 
  49 #if OPAL_HAVE_WEAK_SYMBOLS
  50 #pragma weak MPI_STATUS_SET_ELEMENTS_X = ompi_status_set_elements_x_f
  51 #pragma weak mpi_status_set_elements_x = ompi_status_set_elements_x_f
  52 #pragma weak mpi_status_set_elements_x_ = ompi_status_set_elements_x_f
  53 #pragma weak mpi_status_set_elements_x__ = ompi_status_set_elements_x_f
  54 
  55 #pragma weak MPI_Status_set_elements_x_f = ompi_status_set_elements_x_f
  56 #pragma weak MPI_Status_set_elements_x_f08 = ompi_status_set_elements_x_f
  57 #else
  58 #if ! OMPI_BUILD_MPI_PROFILING
  59 OMPI_GENERATE_F77_BINDINGS (MPI_STATUS_SET_ELEMENTS_X,
  60                            mpi_status_set_elements_x,
  61                            mpi_status_set_elements_x_,
  62                            mpi_status_set_elements_x__,
  63                            ompi_status_set_elements_x_f,
  64                            (MPI_Fint *status, MPI_Fint *datatype, MPI_Count *count, MPI_Fint *ierr),
  65                            (status, datatype, count, ierr) )
  66 #else
  67 #define ompi_status_set_elements_x_f pompi_status_set_elements_x_f
  68 #endif
  69 #endif
  70 
  71 
  72 void ompi_status_set_elements_x_f(MPI_Fint *status, MPI_Fint *datatype,
  73                                MPI_Count *count, MPI_Fint *ierr)
  74 {
  75     int c_ierr;
  76     MPI_Datatype c_type = PMPI_Type_f2c(*datatype);
  77     MPI_Status c_status;
  78 
  79     /* This seems silly, but someone will do it */
  80 
  81     if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) {
  82         c_ierr = MPI_SUCCESS;
  83     } else {
  84         PMPI_Status_f2c( status, &c_status );
  85 
  86         c_ierr = PMPI_Status_set_elements_x(&c_status, c_type, *count);
  87 
  88         /* If datatype is really being set, then that needs to be
  89            converted.... */
  90         if (MPI_SUCCESS == c_ierr) {
  91             PMPI_Status_c2f(&c_status, status);
  92         }
  93     }
  94     if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
  95 }

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