This source file includes following definitions.
- MPI_Get_processor_name
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #include "ompi_config.h"
22 #include <stdio.h>
23 #ifdef HAVE_UNISTD_H
24 #include <unistd.h>
25 #endif
26 #include <string.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
33 #if OMPI_BUILD_MPI_PROFILING
34 #if OPAL_HAVE_WEAK_SYMBOLS
35 #pragma weak MPI_Get_processor_name = PMPI_Get_processor_name
36 #endif
37 #define MPI_Get_processor_name PMPI_Get_processor_name
38 #endif
39
40 static const char FUNC_NAME[] = "MPI_Get_processor_name";
41
42
43 int MPI_Get_processor_name(char *name, int *resultlen)
44 {
45 OPAL_CR_NOOP_PROGRESS();
46
47 if ( MPI_PARAM_CHECK) {
48 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
49 if ( NULL == name ) {
50 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
51 FUNC_NAME);
52 }
53 if ( NULL == resultlen ) {
54 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
55 FUNC_NAME);
56 }
57 }
58
59
60
61
62
63
64
65
66
67
68
69 gethostname(name, (MPI_MAX_PROCESSOR_NAME - 1));
70 name[MPI_MAX_PROCESSOR_NAME - 1] = '\0';
71 *resultlen = (int) strlen(name);
72
73 return MPI_SUCCESS;
74 }