12
12
* All rights reserved.
13
13
* Copyright (c) 2010 University of Houston. All rights reserved.
14
14
* Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
15
- * Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
15
+ * Copyright (c) 2012-2016 Los Alamos National Security, LLC. All rights
16
16
* reserved.
17
17
* Copyright (c) 2015 Research Organization for Information Science
18
18
* and Technology (RIST). All rights reserved.
32
32
#include "ompi/communicator/communicator.h"
33
33
#include "ompi/errhandler/errhandler.h"
34
34
#include "ompi/datatype/ompi_datatype.h"
35
+ #include "ompi/mca/topo/base/base.h"
35
36
#include "ompi/memchecker.h"
36
37
#include "ompi/mca/topo/topo.h"
37
38
#include "ompi/mca/topo/base/base.h"
@@ -50,20 +51,20 @@ int MPI_Neighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sen
50
51
void * recvbuf , const int recvcounts [], const int displs [],
51
52
MPI_Datatype recvtype , MPI_Comm comm )
52
53
{
53
- int i , size , err ;
54
+ int in_size , out_size , err ;
54
55
55
56
MEMCHECKER (
56
57
int rank ;
57
58
ptrdiff_t ext ;
58
59
59
60
rank = ompi_comm_rank (comm );
60
- size = ompi_comm_size (comm );
61
+ mca_topo_base_neighbor_count (comm , & in_size , & out_size );
61
62
ompi_datatype_type_extent (recvtype , & ext );
62
63
63
64
memchecker_datatype (recvtype );
64
65
memchecker_comm (comm );
65
66
/* check whether the receive buffer is addressable. */
66
- for (i = 0 ; i < size ; i ++ ) {
67
+ for (int i = 0 ; i < in_size ; ++ i ) {
67
68
memchecker_call (& opal_memchecker_base_isaddressable ,
68
69
(char * )(recvbuf )+ displs [i ]* ext ,
69
70
recvcounts [i ], recvtype );
@@ -107,8 +108,8 @@ int MPI_Neighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sen
107
108
get the size of the remote group here for both intra- and
108
109
intercommunicators */
109
110
110
- size = ompi_comm_remote_size (comm );
111
- for (i = 0 ; i < size ; ++ i ) {
111
+ mca_topo_base_neighbor_count (comm , & in_size , & out_size );
112
+ for (int i = 0 ; i < in_size ; ++ i ) {
112
113
if (recvcounts [i ] < 0 ) {
113
114
return OMPI_ERRHANDLER_INVOKE (comm , MPI_ERR_COUNT , FUNC_NAME );
114
115
}
@@ -141,27 +142,6 @@ int MPI_Neighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sen
141
142
}
142
143
}
143
144
144
- /* Do we need to do anything? Everyone had to give the same
145
- signature, which means that everyone must have given a
146
- sum(recvounts) > 0 if there's anything to do. */
147
-
148
- if ( OMPI_COMM_IS_INTRA ( comm ) ) {
149
- for (i = 0 ; i < ompi_comm_size (comm ); ++ i ) {
150
- if (0 != recvcounts [i ]) {
151
- break ;
152
- }
153
- }
154
- if (i >= ompi_comm_size (comm )) {
155
- return MPI_SUCCESS ;
156
- }
157
- }
158
- /* There is no rule that can be applied for inter-communicators, since
159
- recvcount(s)=0 only indicates that the processes in the other group
160
- do not send anything, sendcount=0 only indicates that I do not send
161
- anything. However, other processes in my group might very well send
162
- something */
163
-
164
-
165
145
OPAL_CR_ENTER_LIBRARY ();
166
146
167
147
/* Invoke the coll component to perform the back-end operation */
@@ -170,4 +150,3 @@ int MPI_Neighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sen
170
150
recvtype , comm , comm -> c_coll -> coll_neighbor_allgatherv_module );
171
151
OMPI_ERRHANDLER_RETURN (err , comm , err , FUNC_NAME );
172
152
}
173
-
0 commit comments