Skip to content

Commit 31b7be6

Browse files
authored
Merge pull request #1851 from edgargabriel/pr/ompio-reorg
Some ompio code cleanup and reoarganization
2 parents 739c580 + 195ec89 commit 31b7be6

13 files changed

+472
-1257
lines changed

ompi/mca/fcoll/base/Makefile.am

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
#
1919

2020
headers += \
21-
base/base.h
21+
base/base.h \
22+
base/fcoll_base_coll_array.h
2223

2324
libmca_fcoll_la_SOURCES += \
2425
base/fcoll_base_frame.c \
2526
base/fcoll_base_file_select.c \
2627
base/fcoll_base_file_unselect.c \
27-
base/fcoll_base_find_available.c
28+
base/fcoll_base_find_available.c \
29+
base/fcoll_base_coll_array.c

ompi/mca/io/ompio/io_ompio_coll_array.c renamed to ompi/mca/fcoll/base/fcoll_base_coll_array.c

Lines changed: 111 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* University of Stuttgart. All rights reserved.
1111
* Copyright (c) 2004-2005 The Regents of the University of California.
1212
* All rights reserved.
13-
* Copyright (c) 2008-2011 University of Houston. All rights reserved.
13+
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
1414
* $COPYRIGHT$
1515
*
1616
* Additional copyrights may follow
@@ -28,20 +28,21 @@
2828
#include "ompi/request/request.h"
2929

3030
#include <math.h>
31-
#include "io_ompio.h"
32-
33-
34-
int ompi_io_ompio_allgatherv_array (void *sbuf,
35-
int scount,
36-
ompi_datatype_t *sdtype,
37-
void *rbuf,
38-
int *rcounts,
39-
int *disps,
40-
ompi_datatype_t *rdtype,
41-
int root_index,
42-
int *procs_in_group,
43-
int procs_per_group,
44-
ompi_communicator_t *comm)
31+
#include "ompi/mca/fcoll/base/fcoll_base_coll_array.h"
32+
#include "ompi/mca/io/ompio/io_ompio.h"
33+
34+
35+
int fcoll_base_coll_allgatherv_array (void *sbuf,
36+
int scount,
37+
ompi_datatype_t *sdtype,
38+
void *rbuf,
39+
int *rcounts,
40+
int *disps,
41+
ompi_datatype_t *rdtype,
42+
int root_index,
43+
int *procs_in_group,
44+
int procs_per_group,
45+
ompi_communicator_t *comm)
4546
{
4647
int err = OMPI_SUCCESS;
4748
OPAL_PTRDIFF_TYPE extent, lb;
@@ -73,17 +74,17 @@ int ompi_io_ompio_allgatherv_array (void *sbuf,
7374
send_type = sdtype;
7475
}
7576

76-
err = ompi_io_ompio_gatherv_array (send_buf,
77-
rcounts[j],
78-
send_type,
79-
rbuf,
80-
rcounts,
81-
disps,
82-
rdtype,
83-
root_index,
84-
procs_in_group,
85-
procs_per_group,
86-
comm);
77+
err = fcoll_base_coll_gatherv_array (send_buf,
78+
rcounts[j],
79+
send_type,
80+
rbuf,
81+
rcounts,
82+
disps,
83+
rdtype,
84+
root_index,
85+
procs_in_group,
86+
procs_per_group,
87+
comm);
8788
if (OMPI_SUCCESS != err) {
8889
return err;
8990
}
@@ -100,31 +101,31 @@ int ompi_io_ompio_allgatherv_array (void *sbuf,
100101
if(MPI_SUCCESS != err) {
101102
return err;
102103
}
103-
104-
ompi_io_ompio_bcast_array (rbuf,
105-
1,
106-
newtype,
107-
root_index,
108-
procs_in_group,
109-
procs_per_group,
110-
comm);
111-
104+
105+
fcoll_base_coll_bcast_array (rbuf,
106+
1,
107+
newtype,
108+
root_index,
109+
procs_in_group,
110+
procs_per_group,
111+
comm);
112+
112113
ompi_datatype_destroy (&newtype);
113114

114115
return OMPI_SUCCESS;
115116
}
116117

117-
int ompi_io_ompio_gatherv_array (void *sbuf,
118-
int scount,
119-
ompi_datatype_t *sdtype,
120-
void *rbuf,
121-
int *rcounts,
122-
int *disps,
123-
ompi_datatype_t *rdtype,
124-
int root_index,
125-
int *procs_in_group,
126-
int procs_per_group,
127-
struct ompi_communicator_t *comm)
118+
int fcoll_base_coll_gatherv_array (void *sbuf,
119+
int scount,
120+
ompi_datatype_t *sdtype,
121+
void *rbuf,
122+
int *rcounts,
123+
int *disps,
124+
ompi_datatype_t *rdtype,
125+
int root_index,
126+
int *procs_in_group,
127+
int procs_per_group,
128+
struct ompi_communicator_t *comm)
128129
{
129130
int i, rank;
130131
int err = OMPI_SUCCESS;
@@ -140,7 +141,7 @@ int ompi_io_ompio_gatherv_array (void *sbuf,
140141
scount,
141142
sdtype,
142143
procs_in_group[root_index],
143-
OMPIO_TAG_GATHERV,
144+
FCOLL_TAG_GATHERV,
144145
MCA_PML_BASE_SEND_STANDARD,
145146
comm));
146147
}
@@ -181,7 +182,7 @@ int ompi_io_ompio_gatherv_array (void *sbuf,
181182
rcounts[i],
182183
rdtype,
183184
procs_in_group[i],
184-
OMPIO_TAG_GATHERV,
185+
FCOLL_TAG_GATHERV,
185186
comm,
186187
&reqs[i]));
187188
}
@@ -203,17 +204,17 @@ int ompi_io_ompio_gatherv_array (void *sbuf,
203204
return err;
204205
}
205206

206-
int ompi_io_ompio_scatterv_array (void *sbuf,
207-
int *scounts,
208-
int *disps,
209-
ompi_datatype_t *sdtype,
210-
void *rbuf,
211-
int rcount,
212-
ompi_datatype_t *rdtype,
213-
int root_index,
214-
int *procs_in_group,
215-
int procs_per_group,
216-
struct ompi_communicator_t *comm)
207+
int fcoll_base_coll_scatterv_array (void *sbuf,
208+
int *scounts,
209+
int *disps,
210+
ompi_datatype_t *sdtype,
211+
void *rbuf,
212+
int rcount,
213+
ompi_datatype_t *rdtype,
214+
int root_index,
215+
int *procs_in_group,
216+
int procs_per_group,
217+
struct ompi_communicator_t *comm)
217218
{
218219
int i, rank;
219220
int err = OMPI_SUCCESS;
@@ -229,7 +230,7 @@ int ompi_io_ompio_scatterv_array (void *sbuf,
229230
rcount,
230231
rdtype,
231232
procs_in_group[root_index],
232-
OMPIO_TAG_SCATTERV,
233+
FCOLL_TAG_SCATTERV,
233234
comm,
234235
MPI_STATUS_IGNORE));
235236
}
@@ -271,7 +272,7 @@ int ompi_io_ompio_scatterv_array (void *sbuf,
271272
scounts[i],
272273
sdtype,
273274
procs_in_group[i],
274-
OMPIO_TAG_SCATTERV,
275+
FCOLL_TAG_SCATTERV,
275276
MCA_PML_BASE_SEND_STANDARD,
276277
comm,
277278
&reqs[i]));
@@ -293,16 +294,16 @@ int ompi_io_ompio_scatterv_array (void *sbuf,
293294
return err;
294295
}
295296

296-
int ompi_io_ompio_allgather_array (void *sbuf,
297-
int scount,
298-
ompi_datatype_t *sdtype,
299-
void *rbuf,
300-
int rcount,
301-
ompi_datatype_t *rdtype,
302-
int root_index,
303-
int *procs_in_group,
304-
int procs_per_group,
305-
ompi_communicator_t *comm)
297+
int fcoll_base_coll_allgather_array (void *sbuf,
298+
int scount,
299+
ompi_datatype_t *sdtype,
300+
void *rbuf,
301+
int rcount,
302+
ompi_datatype_t *rdtype,
303+
int root_index,
304+
int *procs_in_group,
305+
int procs_per_group,
306+
ompi_communicator_t *comm)
306307
{
307308
int err = OMPI_SUCCESS;
308309
int rank;
@@ -321,41 +322,41 @@ int ompi_io_ompio_allgather_array (void *sbuf,
321322
}
322323

323324
/* Gather and broadcast. */
324-
err = ompi_io_ompio_gather_array (sbuf,
325-
scount,
326-
sdtype,
327-
rbuf,
328-
rcount,
329-
rdtype,
330-
root_index,
331-
procs_in_group,
332-
procs_per_group,
333-
comm);
334-
325+
err = fcoll_base_coll_gather_array (sbuf,
326+
scount,
327+
sdtype,
328+
rbuf,
329+
rcount,
330+
rdtype,
331+
root_index,
332+
procs_in_group,
333+
procs_per_group,
334+
comm);
335+
335336
if (OMPI_SUCCESS == err) {
336-
err = ompi_io_ompio_bcast_array (rbuf,
337-
rcount * procs_per_group,
338-
rdtype,
339-
root_index,
340-
procs_in_group,
341-
procs_per_group,
342-
comm);
337+
err = fcoll_base_coll_bcast_array (rbuf,
338+
rcount * procs_per_group,
339+
rdtype,
340+
root_index,
341+
procs_in_group,
342+
procs_per_group,
343+
comm);
343344
}
344345
/* All done */
345346

346347
return err;
347348
}
348349

349-
int ompi_io_ompio_gather_array (void *sbuf,
350-
int scount,
351-
ompi_datatype_t *sdtype,
352-
void *rbuf,
353-
int rcount,
354-
ompi_datatype_t *rdtype,
355-
int root_index,
356-
int *procs_in_group,
357-
int procs_per_group,
358-
struct ompi_communicator_t *comm)
350+
int fcoll_base_coll_gather_array (void *sbuf,
351+
int scount,
352+
ompi_datatype_t *sdtype,
353+
void *rbuf,
354+
int rcount,
355+
ompi_datatype_t *rdtype,
356+
int root_index,
357+
int *procs_in_group,
358+
int procs_per_group,
359+
struct ompi_communicator_t *comm)
359360
{
360361
int i;
361362
int rank;
@@ -373,7 +374,7 @@ int ompi_io_ompio_gather_array (void *sbuf,
373374
scount,
374375
sdtype,
375376
procs_in_group[root_index],
376-
OMPIO_TAG_GATHER,
377+
FCOLL_TAG_GATHER,
377378
MCA_PML_BASE_SEND_STANDARD,
378379
comm));
379380
return err;
@@ -410,7 +411,7 @@ int ompi_io_ompio_gather_array (void *sbuf,
410411
rcount,
411412
rdtype,
412413
procs_in_group[i],
413-
OMPIO_TAG_GATHER,
414+
FCOLL_TAG_GATHER,
414415
comm,
415416
&reqs[i]));
416417
/*
@@ -436,13 +437,13 @@ int ompi_io_ompio_gather_array (void *sbuf,
436437
return err;
437438
}
438439

439-
int ompi_io_ompio_bcast_array (void *buff,
440-
int count,
441-
ompi_datatype_t *datatype,
442-
int root_index,
443-
int *procs_in_group,
444-
int procs_per_group,
445-
ompi_communicator_t *comm)
440+
int fcoll_base_coll_bcast_array (void *buff,
441+
int count,
442+
ompi_datatype_t *datatype,
443+
int root_index,
444+
int *procs_in_group,
445+
int procs_per_group,
446+
ompi_communicator_t *comm)
446447
{
447448
int i, rank;
448449
int err = OMPI_SUCCESS;
@@ -456,7 +457,7 @@ int ompi_io_ompio_bcast_array (void *buff,
456457
count,
457458
datatype,
458459
procs_in_group[root_index],
459-
OMPIO_TAG_BCAST,
460+
FCOLL_TAG_BCAST,
460461
comm,
461462
MPI_STATUS_IGNORE));
462463
return err;
@@ -478,7 +479,7 @@ int ompi_io_ompio_bcast_array (void *buff,
478479
count,
479480
datatype,
480481
procs_in_group[i],
481-
OMPIO_TAG_BCAST,
482+
FCOLL_TAG_BCAST,
482483
MCA_PML_BASE_SEND_STANDARD,
483484
comm,
484485
&reqs[i]));

0 commit comments

Comments
 (0)