This source file includes following definitions.
- MPI_Type_get_name
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #include "ompi_config.h"
23
24 #include <string.h>
25
26 #include "opal/util/string_copy.h"
27
28 #include "ompi/mpi/c/bindings.h"
29 #include "ompi/runtime/params.h"
30 #include "ompi/communicator/communicator.h"
31 #include "ompi/errhandler/errhandler.h"
32 #include "ompi/datatype/ompi_datatype.h"
33 #include "ompi/memchecker.h"
34
35 #if OMPI_BUILD_MPI_PROFILING
36 #if OPAL_HAVE_WEAK_SYMBOLS
37 #pragma weak MPI_Type_get_name = PMPI_Type_get_name
38 #endif
39 #define MPI_Type_get_name PMPI_Type_get_name
40 #endif
41
42 static const char FUNC_NAME[] = "MPI_Type_get_name";
43
44
45 int MPI_Type_get_name(MPI_Datatype type, char *type_name, int *resultlen)
46 {
47
48 MEMCHECKER(
49 memchecker_datatype(type);
50 );
51
52 OPAL_CR_NOOP_PROGRESS();
53
54 if ( MPI_PARAM_CHECK ) {
55 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
56 if (NULL == type || MPI_DATATYPE_NULL == type) {
57 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE,
58 FUNC_NAME );
59 } else if (NULL == type_name || NULL == resultlen) {
60 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
61 FUNC_NAME );
62 }
63 }
64
65
66
67
68
69
70
71
72
73
74
75 *resultlen = (int)strlen(type->name);
76 opal_string_copy(type_name, type->name, MPI_MAX_OBJECT_NAME);
77 return MPI_SUCCESS;
78 }