This source file includes following definitions.
- MPI_Group_incl
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 #include <stdio.h>
27
28 #include "ompi/mpi/c/bindings.h"
29 #include "ompi/runtime/params.h"
30 #include "ompi/group/group.h"
31 #include "ompi/errhandler/errhandler.h"
32 #include "ompi/communicator/communicator.h"
33
34 #if OMPI_BUILD_MPI_PROFILING
35 #if OPAL_HAVE_WEAK_SYMBOLS
36 #pragma weak MPI_Group_incl = PMPI_Group_incl
37 #endif
38 #define MPI_Group_incl PMPI_Group_incl
39 #endif
40
41 static const char FUNC_NAME[] = "MPI_Group_incl";
42
43
44 int MPI_Group_incl(MPI_Group group, int n, const int ranks[], MPI_Group *new_group)
45 {
46 int i, group_size, err;
47 ompi_group_t *group_pointer;
48
49 group_pointer = (ompi_group_t *)group;
50 group_size = ompi_group_size ( group_pointer );
51
52 if( MPI_PARAM_CHECK ) {
53 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
54
55
56 if ( (MPI_GROUP_NULL == group) || ( NULL == group) ||
57 (NULL == new_group) ) {
58 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP,
59 FUNC_NAME);
60 } else if (NULL == ranks && n > 0) {
61 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
62 FUNC_NAME);
63 }
64
65
66 if ( n > group_size ) {
67 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_RANK,
68 FUNC_NAME);
69 }
70
71 for (i = 0; i < n; i++) {
72 if ((ranks[i] < 0) || (ranks[i] >= group_size)){
73 return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_RANK,
74 FUNC_NAME);
75 }
76 }
77 }
78
79 if ( 0 == n ) {
80 *new_group = MPI_GROUP_EMPTY;
81 OBJ_RETAIN(MPI_GROUP_EMPTY);
82 return MPI_SUCCESS;
83 }
84
85 OPAL_CR_ENTER_LIBRARY();
86
87 err = ompi_group_incl(group,n,ranks,new_group);
88 OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD,err,FUNC_NAME);
89 }