This source file includes following definitions.
- MPI_Type_set_name
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 <string.h>
28
29 #include "opal/util/string_copy.h"
30
31 #include "ompi/mpi/c/bindings.h"
32 #include "ompi/runtime/params.h"
33 #include "ompi/communicator/communicator.h"
34 #include "ompi/errhandler/errhandler.h"
35 #include "ompi/datatype/ompi_datatype.h"
36 #include "ompi/memchecker.h"
37
38 #if OMPI_BUILD_MPI_PROFILING
39 #if OPAL_HAVE_WEAK_SYMBOLS
40 #pragma weak MPI_Type_set_name = PMPI_Type_set_name
41 #endif
42 #define MPI_Type_set_name PMPI_Type_set_name
43 #endif
44
45 static const char FUNC_NAME[] = "MPI_Type_set_name";
46
47
48 int MPI_Type_set_name (MPI_Datatype type, const char *type_name)
49 {
50 MEMCHECKER(
51 memchecker_datatype(type);
52 );
53
54 OPAL_CR_NOOP_PROGRESS();
55
56 if (MPI_PARAM_CHECK) {
57 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
58 if (NULL == type || MPI_DATATYPE_NULL == type) {
59 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME);
60 } else if (NULL == type_name) {
61 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
62 }
63 }
64
65 memset(type->name, 0, MPI_MAX_OBJECT_NAME);
66 opal_string_copy( type->name, type_name, MPI_MAX_OBJECT_NAME);
67 return MPI_SUCCESS;
68 }