root/ompi/mpi/c/type_match_size.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Type_match_size

   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) 2009      Sun Microsystems, Inc. All rights reserved.
  13  * Copyright (c) 2015      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/c/bindings.h"
  25 #include "ompi/runtime/params.h"
  26 #include "ompi/communicator/communicator.h"
  27 #include "ompi/errhandler/errhandler.h"
  28 #include "ompi/datatype/ompi_datatype.h"
  29 #include "ompi/datatype/ompi_datatype_internal.h"
  30 
  31 #if OMPI_BUILD_MPI_PROFILING
  32 #if OPAL_HAVE_WEAK_SYMBOLS
  33 #pragma weak MPI_Type_match_size = PMPI_Type_match_size
  34 #endif
  35 #define MPI_Type_match_size PMPI_Type_match_size
  36 #endif
  37 
  38 static const char FUNC_NAME[] = "MPI_Type_match_size";
  39 
  40 
  41 int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *type)
  42 {
  43     if (MPI_PARAM_CHECK) {
  44         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  45     }
  46 
  47     OPAL_CR_ENTER_LIBRARY();
  48 
  49     switch( typeclass ) {
  50     case MPI_TYPECLASS_REAL:
  51         *type = (MPI_Datatype)ompi_datatype_match_size( size, OMPI_DATATYPE_FLAG_DATA_FLOAT, OMPI_DATATYPE_FLAG_DATA_FORTRAN );
  52         break;
  53     case MPI_TYPECLASS_INTEGER:
  54         *type = (MPI_Datatype)ompi_datatype_match_size( size, OMPI_DATATYPE_FLAG_DATA_INT, OMPI_DATATYPE_FLAG_DATA_FORTRAN );
  55         break;
  56     case MPI_TYPECLASS_COMPLEX:
  57         *type = (MPI_Datatype)ompi_datatype_match_size( size, OMPI_DATATYPE_FLAG_DATA_COMPLEX, OMPI_DATATYPE_FLAG_DATA_FORTRAN );
  58         break;
  59     default:
  60         *type = &ompi_mpi_datatype_null.dt;
  61     }
  62 
  63     OPAL_CR_EXIT_LIBRARY();
  64     if( *type != &ompi_mpi_datatype_null.dt ) {
  65         return MPI_SUCCESS;
  66     }
  67 
  68     return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
  69 }

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