Skip to content

Commit b4d21e0

Browse files
committed
ompio file_read_all: relocate implementation from base to common
Move the default implementation of the read_all function used by some components from fcoll/base to common/ompio, in order to resolve dependency problems with fcoll/base. Re-introduce per-component read_all functions, which are however only stubs calling the common/ompio implementation. Tested with static and dynamic builds. Also ensured that the --disable-io-ompio flag still works correctly. Signed-off-by: Edgar Gabriel <edgar.gabriel1@outlook.com>
1 parent 8e5894a commit b4d21e0

19 files changed

+160
-18
lines changed

ompi/mca/common/ompio/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ sources = \
3535
common_ompio_file_open.c \
3636
common_ompio_file_view.c \
3737
common_ompio_file_read.c \
38+
common_ompio_file_read_all.c \
3839
common_ompio_buffer.c \
3940
common_ompio_file_write.c
4041

ompi/mca/common/ompio/common_ompio.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@ OMPI_DECLSPEC int mca_common_ompio_set_file_defaults (ompio_file_t *fh);
323323
OMPI_DECLSPEC int mca_common_ompio_set_view (ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE disp,
324324
ompi_datatype_t *etype, ompi_datatype_t *filetype, const char *datarep,
325325
opal_info_t *info);
326+
OMPI_DECLSPEC int mca_common_ompio_base_file_read_all (struct ompio_file_t *fh, void *buf, int count,
327+
struct ompi_datatype_t *datatype, ompi_status_public_t *status);
328+
326329

327330

328331
/*

ompi/mca/fcoll/base/fcoll_base_file_read_all.c renamed to ompi/mca/common/ompio/common_ompio_file_read_all.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include <unistd.h>
3434

3535
#define DEBUG_ON 0
36-
#define FCOLL_BASE_SHUFFLE_TAG 123
36+
#define COMMON_OMPIO_SHUFFLE_TAG 123
3737
#define INIT_LEN 10
3838

3939
/*Used for loading file-offsets per aggregator*/
@@ -51,11 +51,11 @@ static int read_heap_sort (mca_io_ompio_local_io_array *io_array,
5151

5252

5353
int
54-
mca_fcoll_base_file_read_all (ompio_file_t *fh,
55-
void *buf,
56-
int count,
57-
struct ompi_datatype_t *datatype,
58-
ompi_status_public_t *status)
54+
mca_common_ompio_base_file_read_all (struct ompio_file_t *fh,
55+
void *buf,
56+
int count,
57+
struct ompi_datatype_t *datatype,
58+
ompi_status_public_t *status)
5959
{
6060
MPI_Aint total_bytes = 0; /* total bytes to be read */
6161
MPI_Aint bytes_to_read_in_cycle = 0; /* left to be read in a cycle*/
@@ -743,7 +743,7 @@ mca_fcoll_base_file_read_all (ompio_file_t *fh,
743743
1,
744744
sendtype[i],
745745
fh->f_procs_in_group[i],
746-
FCOLL_BASE_SHUFFLE_TAG,
746+
COMMON_OMPIO_SHUFFLE_TAG,
747747
MCA_PML_BASE_SEND_STANDARD,
748748
fh->f_comm,
749749
&send_req[i]));
@@ -824,7 +824,7 @@ mca_fcoll_base_file_read_all (ompio_file_t *fh,
824824
1,
825825
newType,
826826
my_aggregator,
827-
FCOLL_BASE_SHUFFLE_TAG,
827+
COMMON_OMPIO_SHUFFLE_TAG,
828828
fh->f_comm,
829829
&recv_req));
830830

ompi/mca/fcoll/base/Makefile.am

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,5 @@ libmca_fcoll_la_SOURCES += \
3030
base/fcoll_base_file_select.c \
3131
base/fcoll_base_file_unselect.c \
3232
base/fcoll_base_sort.c \
33-
base/fcoll_base_file_read_all.c \
3433
base/fcoll_base_coll_array.c
3534
endif

ompi/mca/fcoll/dynamic/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ sources = \
2525
fcoll_dynamic.h \
2626
fcoll_dynamic_module.c \
2727
fcoll_dynamic_component.c \
28+
fcoll_dynamic_file_read_all.c \
2829
fcoll_dynamic_file_write_all.c
2930

3031
# Make the output library in this directory, and name it either

ompi/mca/fcoll/dynamic/fcoll_dynamic.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,17 @@ int mca_fcoll_dynamic_component_file_unquery (ompio_file_t *file);
5050
int mca_fcoll_dynamic_module_init (ompio_file_t *file);
5151
int mca_fcoll_dynamic_module_finalize (ompio_file_t *file);
5252

53-
int mca_fcoll_dynamic_file_write_all (ompio_file_t *fh,
53+
int mca_fcoll_dynamic_file_write_all (struct ompio_file_t *fh,
5454
const void *buf,
5555
int count,
5656
struct ompi_datatype_t *datatype,
5757
ompi_status_public_t * status);
58+
int mca_fcoll_dynamic_file_read_all (struct ompio_file_t *fh,
59+
void *buf,
60+
int count,
61+
struct ompi_datatype_t *datatype,
62+
ompi_status_public_t * status);
63+
5864

5965

6066
END_C_DECLS
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
* University Research and Technology
4+
* Corporation. All rights reserved.
5+
* Copyright (c) 2004-2005 The University of Tennessee and The University
6+
* of Tennessee Research Foundation. All rights
7+
* reserved.
8+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
* University of Stuttgart. All rights reserved.
10+
* Copyright (c) 2004-2005 The Regents of the University of California.
11+
* All rights reserved.
12+
* Copyright (c) 2008-2015 University of Houston. All rights reserved.
13+
* Copyright (c) 2015-2018 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2017 IBM Corporation. All rights reserved.
16+
* $COPYRIGHT$
17+
*
18+
* Additional copyrights may follow
19+
*
20+
* $HEADER$
21+
*/
22+
23+
#include "ompi_config.h"
24+
#include "fcoll_dynamic.h"
25+
26+
#include "mpi.h"
27+
#include "ompi/mca/common/ompio/common_ompio.h"
28+
29+
30+
31+
int
32+
mca_fcoll_dynamic_file_read_all (struct ompio_file_t *fh,
33+
void *buf,
34+
int count,
35+
struct ompi_datatype_t *datatype,
36+
ompi_status_public_t *status)
37+
{
38+
return mca_common_ompio_base_file_read_all (fh, buf, count, datatype, status);
39+
}
40+
41+

ompi/mca/fcoll/dynamic/fcoll_dynamic_file_write_all.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static int local_heap_sort (mca_io_ompio_local_io_array *io_array,
5151

5252

5353
int
54-
mca_fcoll_dynamic_file_write_all (ompio_file_t *fh,
54+
mca_fcoll_dynamic_file_write_all (struct ompio_file_t *fh,
5555
const void *buf,
5656
int count,
5757
struct ompi_datatype_t *datatype,

ompi/mca/fcoll/dynamic/fcoll_dynamic_module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
static mca_fcoll_base_module_1_0_0_t dynamic = {
3838
mca_fcoll_dynamic_module_init,
3939
mca_fcoll_dynamic_module_finalize,
40-
mca_fcoll_base_file_read_all,
40+
mca_fcoll_dynamic_file_read_all,
4141
NULL, /* iread_all */
4242
mca_fcoll_dynamic_file_write_all,
4343
NULL, /*iwrite_all */

ompi/mca/fcoll/dynamic_gen2/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ sources = \
2525
fcoll_dynamic_gen2.h \
2626
fcoll_dynamic_gen2_module.c \
2727
fcoll_dynamic_gen2_component.c \
28+
fcoll_dynamic_gen2_file_read_all.c \
2829
fcoll_dynamic_gen2_file_write_all.c
2930

3031
# Make the output library in this directory, and name it either

0 commit comments

Comments
 (0)