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
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.
14
* Additional copyrights may follow
19
#include "ompi_config.h"
21
#include "ompi/mpi/f77/bindings.h"
22
#include "ompi/mpi/f77/constants.h"
23
#include "ompi/datatype/datatype.h"
24
#include "ompi/errhandler/errhandler.h"
25
#include "ompi/communicator/communicator.h"
26
#include "ompi/runtime/params.h"
28
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER
29
#pragma weak PMPI_TYPE_MATCH_SIZE = mpi_type_match_size_f
30
#pragma weak pmpi_type_match_size = mpi_type_match_size_f
31
#pragma weak pmpi_type_match_size_ = mpi_type_match_size_f
32
#pragma weak pmpi_type_match_size__ = mpi_type_match_size_f
33
#elif OMPI_PROFILE_LAYER
34
OMPI_GENERATE_F77_BINDINGS (PMPI_TYPE_MATCH_SIZE,
36
pmpi_type_match_size_,
37
pmpi_type_match_size__,
38
pmpi_type_match_size_f,
39
(MPI_Fint *typeclass, MPI_Fint *size, MPI_Fint *type, MPI_Fint *ierr),
40
(typeclass, size, type, ierr) )
43
#if OMPI_HAVE_WEAK_SYMBOLS
44
#pragma weak MPI_TYPE_MATCH_SIZE = mpi_type_match_size_f
45
#pragma weak mpi_type_match_size = mpi_type_match_size_f
46
#pragma weak mpi_type_match_size_ = mpi_type_match_size_f
47
#pragma weak mpi_type_match_size__ = mpi_type_match_size_f
50
#if ! OMPI_HAVE_WEAK_SYMBOLS && ! OMPI_PROFILE_LAYER
51
OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_MATCH_SIZE,
54
mpi_type_match_size__,
55
mpi_type_match_size_f,
56
(MPI_Fint *typeclass, MPI_Fint *size, MPI_Fint *type, MPI_Fint *ierr),
57
(typeclass, size, type, ierr) )
61
#if OMPI_PROFILE_LAYER && ! OMPI_HAVE_WEAK_SYMBOLS
62
#include "ompi/mpi/f77/profile/defines.h"
65
static const char FUNC_NAME[] = "MPI_Type_match_size_f";
67
/* We cannot use the C function as from Fortran we should check for Fortran types. The only
68
* difference is the type of predefined datatypes we are looking for.
70
void mpi_type_match_size_f(MPI_Fint *typeclass, MPI_Fint *size, MPI_Fint *type, MPI_Fint *ierr)
73
int c_size = OMPI_FINT_2_INT( *size );
75
if (MPI_PARAM_CHECK) {
76
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
79
switch( OMPI_FINT_2_INT(*typeclass) ) {
80
case MPI_TYPECLASS_REAL:
81
c_type = (MPI_Datatype)ompi_ddt_match_size( c_size, DT_FLAG_DATA_FLOAT, DT_FLAG_DATA_FORTRAN );
83
case MPI_TYPECLASS_INTEGER:
84
c_type = (MPI_Datatype)ompi_ddt_match_size( c_size, DT_FLAG_DATA_INT, DT_FLAG_DATA_FORTRAN );
86
case MPI_TYPECLASS_COMPLEX:
87
c_type = (MPI_Datatype)ompi_ddt_match_size( c_size, DT_FLAG_DATA_COMPLEX, DT_FLAG_DATA_FORTRAN );
90
c_type = &ompi_mpi_datatype_null;
92
*type = MPI_Type_c2f( c_type );
93
if( c_type != &ompi_mpi_datatype_null )
94
*ierr = OMPI_INT_2_FINT( MPI_SUCCESS );
96
*ierr = OMPI_INT_2_FINT( MPI_ERR_ARG );
97
(void)OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);