@@ -105,15 +105,13 @@ get_stride_elem(const void *base, ptrdiff_t sst, size_t nelems, size_t elem_size
105
105
}
106
106
107
107
static inline int
108
- get_dst_pe (struct oshmem_group_t * group , int src_blk_idx , int dst_blk_idx )
108
+ get_dst_pe (struct oshmem_group_t * group , int src_blk_idx , int dst_blk_idx , int * dst_pe_idx )
109
109
{
110
- int dst_grp_pe ;
111
-
112
110
/* index permutation for better distribution of traffic */
113
- dst_grp_pe = (dst_blk_idx + src_blk_idx ) % group -> proc_count ;
111
+ ( * dst_pe_idx ) = (dst_blk_idx + src_blk_idx ) % group -> proc_count ;
114
112
115
113
/* convert to the global pe */
116
- return oshmem_proc_pe (group -> proc_array [dst_grp_pe ]);
114
+ return oshmem_proc_pe (group -> proc_array [* dst_pe_idx ]);
117
115
}
118
116
119
117
static int a2as_alg_simple (struct oshmem_group_t * group ,
@@ -127,6 +125,7 @@ static int a2as_alg_simple(struct oshmem_group_t *group,
127
125
int dst_pe ;
128
126
int src_blk_idx ;
129
127
int dst_blk_idx ;
128
+ int dst_pe_idx ;
130
129
size_t elem_idx ;
131
130
132
131
SCOLL_VERBOSE (14 ,
@@ -137,14 +136,14 @@ static int a2as_alg_simple(struct oshmem_group_t *group,
137
136
138
137
for (src_blk_idx = 0 ; src_blk_idx < group -> proc_count ; src_blk_idx ++ ) {
139
138
140
- dst_pe = get_dst_pe (group , src_blk_idx , dst_blk_idx );
139
+ dst_pe = get_dst_pe (group , src_blk_idx , dst_blk_idx , & dst_pe_idx );
141
140
for (elem_idx = 0 ; elem_idx < nelems ; elem_idx ++ ) {
142
141
rc = MCA_SPML_CALL (put (
143
142
get_stride_elem (target , tst , nelems , element_size ,
144
143
dst_blk_idx , elem_idx ),
145
144
element_size ,
146
145
get_stride_elem (source , sst , nelems , element_size ,
147
- src_blk_idx , elem_idx ),
146
+ dst_pe_idx , elem_idx ),
148
147
dst_pe ));
149
148
if (OSHMEM_SUCCESS != rc ) {
150
149
return rc ;
@@ -164,6 +163,7 @@ static int a2a_alg_simple(struct oshmem_group_t *group,
164
163
int dst_pe ;
165
164
int src_blk_idx ;
166
165
int dst_blk_idx ;
166
+ int dst_pe_idx ;
167
167
void * dst_blk ;
168
168
169
169
SCOLL_VERBOSE (14 ,
@@ -177,11 +177,11 @@ static int a2a_alg_simple(struct oshmem_group_t *group,
177
177
178
178
for (src_blk_idx = 0 ; src_blk_idx < group -> proc_count ; src_blk_idx ++ ) {
179
179
180
- dst_pe = get_dst_pe (group , src_blk_idx , dst_blk_idx );
180
+ dst_pe = get_dst_pe (group , src_blk_idx , dst_blk_idx , & dst_pe_idx );
181
181
rc = MCA_SPML_CALL (put (dst_blk ,
182
182
nelems * element_size ,
183
183
get_stride_elem (source , 1 , nelems ,
184
- element_size , src_blk_idx , 0 ),
184
+ element_size , dst_pe_idx , 0 ),
185
185
dst_pe ));
186
186
if (OSHMEM_SUCCESS != rc ) {
187
187
return rc ;
0 commit comments