This source file includes following definitions.
- MPI_Type_size
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 #include "ompi_config.h"
26
27 #include "ompi/mpi/c/bindings.h"
28 #include "ompi/runtime/params.h"
29 #include "ompi/communicator/communicator.h"
30 #include "ompi/errhandler/errhandler.h"
31 #include "ompi/datatype/ompi_datatype.h"
32 #include "ompi/memchecker.h"
33
34 #if OMPI_BUILD_MPI_PROFILING
35 #if OPAL_HAVE_WEAK_SYMBOLS
36 #pragma weak MPI_Type_size = PMPI_Type_size
37 #endif
38 #define MPI_Type_size PMPI_Type_size
39 #endif
40
41 static const char FUNC_NAME[] = "MPI_Type_size";
42
43 int MPI_Type_size(MPI_Datatype type, int *size)
44 {
45 size_t type_size;
46 MEMCHECKER(
47 memchecker_datatype(type);
48 );
49
50 OPAL_CR_NOOP_PROGRESS();
51
52 if (MPI_PARAM_CHECK) {
53 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
54 if (NULL == type || MPI_DATATYPE_NULL == type) {
55 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME);
56 } else if (NULL == size) {
57 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
58 }
59 }
60
61 opal_datatype_type_size ( &type->super, &type_size);
62
63 *size = (type_size > (size_t) INT_MAX) ? MPI_UNDEFINED : (int) type_size;
64
65 return MPI_SUCCESS;
66 }