This source file includes following definitions.
- MPI_Group_excl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #include "ompi_config.h"
25 #include <stdio.h>
26
27 #include "ompi/mpi/c/bindings.h"
28 #include "ompi/runtime/params.h"
29 #include "ompi/group/group.h"
30 #include "ompi/errhandler/errhandler.h"
31 #include "ompi/communicator/communicator.h"
32
33 #if OMPI_BUILD_MPI_PROFILING
34 #if OPAL_HAVE_WEAK_SYMBOLS
35 #pragma weak MPI_Group_excl = PMPI_Group_excl
36 #endif
37 #define MPI_Group_excl PMPI_Group_excl
38 #endif
39
40 static const char FUNC_NAME[] = "MPI_Group_excl";
41
42
43 int MPI_Group_excl(MPI_Group group, int n, const int ranks[],
44 MPI_Group *new_group)
45 {
46 ompi_group_t *group_pointer = (ompi_group_t *)group;
47 int i, err, group_size;
48
49 group_size = ompi_group_size ( group_pointer);
50 if( MPI_PARAM_CHECK ) {
51 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
52
53
54 if ( (MPI_GROUP_NULL == group) || (NULL == group) ||
55 (NULL == new_group) ) {
56 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP,
57 FUNC_NAME);
58 } else if (NULL == ranks && n > 0) {
59 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
60 FUNC_NAME);
61 }
62
63
64 if ( n > group_size) {
65 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP,
66 FUNC_NAME);
67 }
68
69
70 for( i=0 ; i < n ; i++ ) {
71 if( ( 0 > ranks[i] ) || (ranks[i] >= group_size)){
72 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_RANK,
73 FUNC_NAME );
74 }
75 }
76
77 }
78
79 if ( n == group_size ) {
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_excl ( group, n, ranks, new_group );
88 OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, err, FUNC_NAME );
89 }