Skip to content

Commit 29e9564

Browse files
committed
io/romio314: Add work around support for missing MPI_File ops
* Add work around support for the following missing ops in ROMIO 3.1.4 - `MPI_File_iread_at_all` - `MPI_File_iwrite_at_all` - `MPI_File_iread_all` - `MPI_File_iwrite_all` Signed-off-by: Joshua Hursey <[email protected]>
1 parent 2960963 commit 29e9564

File tree

4 files changed

+133
-5
lines changed

4 files changed

+133
-5
lines changed

ompi/mca/io/romio314/src/io_romio314.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,24 @@ int mca_io_romio314_file_iread_at (struct ompi_file_t *fh,
129129
int count,
130130
struct ompi_datatype_t *datatype,
131131
ompi_request_t **request);
132+
int mca_io_romio314_file_iread_at_all (struct ompi_file_t *fh,
133+
MPI_Offset offset,
134+
void *buf,
135+
int count,
136+
struct ompi_datatype_t *datatype,
137+
ompi_request_t **request);
132138
int mca_io_romio314_file_iwrite_at (struct ompi_file_t *fh,
133139
MPI_Offset offset,
134140
const void *buf,
135141
int count,
136142
struct ompi_datatype_t *datatype,
137143
ompi_request_t **request);
144+
int mca_io_romio314_file_iwrite_at_all (struct ompi_file_t *fh,
145+
MPI_Offset offset,
146+
const void *buf,
147+
int count,
148+
struct ompi_datatype_t *datatype,
149+
ompi_request_t **request);
138150

139151
/* Section 9.4.3 */
140152
int mca_io_romio314_file_read (struct ompi_file_t *fh,
@@ -162,11 +174,21 @@ int mca_io_romio314_file_iread (struct ompi_file_t *fh,
162174
int count,
163175
struct ompi_datatype_t *datatype,
164176
ompi_request_t **request);
177+
int mca_io_romio314_file_iread_all (struct ompi_file_t *fh,
178+
void *buf,
179+
int count,
180+
struct ompi_datatype_t *datatype,
181+
ompi_request_t **request);
165182
int mca_io_romio314_file_iwrite (struct ompi_file_t *fh,
166183
const void *buf,
167184
int count,
168185
struct ompi_datatype_t *datatype,
169186
ompi_request_t **request);
187+
int mca_io_romio314_file_iwrite_all (struct ompi_file_t *fh,
188+
const void *buf,
189+
int count,
190+
struct ompi_datatype_t *datatype,
191+
ompi_request_t **request);
170192
int mca_io_romio314_file_seek (struct ompi_file_t *fh,
171193
MPI_Offset offset,
172194
int whence);

ompi/mca/io/romio314/src/io_romio314_file_read.c

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* University of Stuttgart. All rights reserved.
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
12+
* Copyright (c) 2017 IBM Corporation. All rights reserved.
1213
* $COPYRIGHT$
1314
*
1415
* Additional copyrights may follow
@@ -87,6 +88,36 @@ mca_io_romio314_file_iread_at (ompi_file_t *fh,
8788
return ret;
8889
}
8990

91+
int
92+
mca_io_romio314_file_iread_at_all (ompi_file_t *fh,
93+
MPI_Offset offset,
94+
void *buf,
95+
int count,
96+
struct ompi_datatype_t *datatype,
97+
ompi_request_t **request)
98+
{
99+
int ret;
100+
mca_io_romio314_data_t *data;
101+
MPI_Offset prev_offset;
102+
103+
mca_io_romio314_file_get_position(fh, &prev_offset);
104+
mca_io_romio314_file_seek(fh, offset, MPI_SEEK_SET);
105+
106+
data = (mca_io_romio314_data_t *) fh->f_io_selected_data;
107+
OPAL_THREAD_LOCK (&mca_io_romio314_mutex);
108+
// No support for non-blocking collective I/O operations.
109+
// Fake it with individual non-blocking I/O operations.
110+
// Same as OMPIO
111+
ret =
112+
ROMIO_PREFIX(MPI_File_iread) (data->romio_fh, buf, count, datatype,
113+
request);
114+
OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex);
115+
116+
mca_io_romio314_file_seek(fh, prev_offset, MPI_SEEK_SET);
117+
118+
return ret;
119+
}
120+
90121

91122
int
92123
mca_io_romio314_file_read (ompi_file_t *fh,
@@ -150,6 +181,28 @@ mca_io_romio314_file_iread (ompi_file_t *fh,
150181
return ret;
151182
}
152183

184+
int
185+
mca_io_romio314_file_iread_all (ompi_file_t *fh,
186+
void *buf,
187+
int count,
188+
struct ompi_datatype_t *datatype,
189+
ompi_request_t **request)
190+
{
191+
int ret;
192+
mca_io_romio314_data_t *data;
193+
194+
data = (mca_io_romio314_data_t *) fh->f_io_selected_data;
195+
OPAL_THREAD_LOCK (&mca_io_romio314_mutex);
196+
// No support for non-blocking collective I/O operations.
197+
// Fake it with individual non-blocking I/O operations.
198+
// Same as OMPIO
199+
ret =
200+
ROMIO_PREFIX(MPI_File_iread) (data->romio_fh, buf, count, datatype,
201+
request);
202+
OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex);
203+
204+
return ret;
205+
}
153206

154207
int
155208
mca_io_romio314_file_read_shared (ompi_file_t *fh,

ompi/mca/io/romio314/src/io_romio314_file_write.c

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* All rights reserved.
1212
* Copyright (c) 2015 Research Organization for Information Science
1313
* and Technology (RIST). All rights reserved.
14+
* Copyright (c) 2017 IBM Corporation. All rights reserved.
1415
* $COPYRIGHT$
1516
*
1617
* Additional copyrights may follow
@@ -92,6 +93,35 @@ mca_io_romio314_file_iwrite_at (ompi_file_t *fh,
9293
}
9394

9495

96+
int
97+
mca_io_romio314_file_iwrite_at_all (ompi_file_t *fh,
98+
MPI_Offset offset,
99+
const void *buf,
100+
int count,
101+
struct ompi_datatype_t *datatype,
102+
ompi_request_t **request)
103+
{
104+
int ret;
105+
mca_io_romio314_data_t *data;
106+
MPI_Offset prev_offset;
107+
108+
mca_io_romio314_file_get_position(fh, &prev_offset);
109+
mca_io_romio314_file_seek(fh, offset, MPI_SEEK_SET);
110+
111+
data = (mca_io_romio314_data_t *) fh->f_io_selected_data;
112+
OPAL_THREAD_LOCK (&mca_io_romio314_mutex);
113+
// No support for non-blocking collective I/O operations.
114+
// Fake it with individual non-blocking I/O operations.
115+
// Same as OMPIO
116+
ret =
117+
ROMIO_PREFIX(MPI_File_iwrite) (data->romio_fh, buf, count, datatype,
118+
request);
119+
OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex);
120+
121+
mca_io_romio314_file_seek(fh, prev_offset, MPI_SEEK_SET);
122+
123+
return ret;
124+
}
95125

96126

97127

@@ -155,6 +185,29 @@ mca_io_romio314_file_iwrite (ompi_file_t *fh,
155185
return ret;
156186
}
157187

188+
int
189+
mca_io_romio314_file_iwrite_all (ompi_file_t *fh,
190+
const void *buf,
191+
int count,
192+
struct ompi_datatype_t *datatype,
193+
ompi_request_t **request)
194+
{
195+
int ret;
196+
mca_io_romio314_data_t *data;
197+
198+
data = (mca_io_romio314_data_t *) fh->f_io_selected_data;
199+
OPAL_THREAD_LOCK (&mca_io_romio314_mutex);
200+
// No support for non-blocking collective I/O operations.
201+
// Fake it with individual non-blocking I/O operations.
202+
// Same as OMPIO
203+
ret =
204+
ROMIO_PREFIX(MPI_File_iwrite) (data->romio_fh, buf, count, datatype,
205+
request);
206+
OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex);
207+
208+
return ret;
209+
}
210+
158211

159212
int
160213
mca_io_romio314_file_write_shared (ompi_file_t *fh,

ompi/mca/io/romio314/src/io_romio314_module.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* All rights reserved.
1212
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
1313
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
14-
* Copyright (c) 2017 IBM Corp. All rights reserved.
14+
* Copyright (c) 2017 IBM Corporation. All rights reserved.
1515
* $COPYRIGHT$
1616
*
1717
* Additional copyrights may follow
@@ -58,8 +58,8 @@ mca_io_base_module_2_0_0_t mca_io_romio314_module = {
5858
mca_io_romio314_file_write_at_all,
5959
mca_io_romio314_file_iread_at,
6060
mca_io_romio314_file_iwrite_at,
61-
NULL, /* iread_at_all */
62-
NULL, /* iwrite_at_all */
61+
mca_io_romio314_file_iread_at_all,
62+
mca_io_romio314_file_iwrite_at_all,
6363

6464
/* non-indexed IO operations */
6565
mca_io_romio314_file_read,
@@ -68,8 +68,8 @@ mca_io_base_module_2_0_0_t mca_io_romio314_module = {
6868
mca_io_romio314_file_write_all,
6969
mca_io_romio314_file_iread,
7070
mca_io_romio314_file_iwrite,
71-
NULL, /* iread_all */
72-
NULL, /* iwrite_all */
71+
mca_io_romio314_file_iread_all,
72+
mca_io_romio314_file_iwrite_all,
7373

7474
mca_io_romio314_file_seek,
7575
mca_io_romio314_file_get_position,

0 commit comments

Comments
 (0)