Skip to content

Commit 9c31801

Browse files
committed
io/ompio: Add barrier to file_close and to file_set_size
This fixes a bug reported on the mailing for ompio. https://www.open-mpi.org/community/lists/users/2016/05/29333.php
1 parent c263461 commit 9c31801

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

ompi/mca/common/ompio/common_ompio_file_open.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,14 @@ int mca_common_ompio_file_close (mca_io_ompio_file_t *ompio_fh)
231231
int delete_flag = 0;
232232
char name[256];
233233

234+
ret = ompio_fh->f_comm->c_coll.coll_barrier ( ompio_fh->f_comm, ompio_fh->f_comm->c_coll.coll_barrier_module);
235+
if ( OMPI_SUCCESS != ret ) {
236+
/* Not sure what to do */
237+
opal_output (1,"mca_common_ompio_file_close: error in Barrier \n");
238+
return ret;
239+
}
240+
241+
234242
if(mca_io_ompio_coll_timing_info){
235243
strcpy (name, "WRITE");
236244
if (!mca_common_ompio_empty_print_queue(ompio_fh->f_coll_write_time)){

ompi/mca/io/ompio/io_ompio_file_open.c

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,18 +230,34 @@ int mca_io_ompio_file_set_size (ompi_file_t *fh,
230230

231231
tmp = size;
232232

233-
data->ompio_fh.f_comm->c_coll.coll_bcast (&tmp,
234-
1,
235-
OMPI_OFFSET_DATATYPE,
236-
OMPIO_ROOT,
237-
data->ompio_fh.f_comm,
238-
data->ompio_fh.f_comm->c_coll.coll_bcast_module);
233+
ret = data->ompio_fh.f_comm->c_coll.coll_bcast (&tmp,
234+
1,
235+
OMPI_OFFSET_DATATYPE,
236+
OMPIO_ROOT,
237+
data->ompio_fh.f_comm,
238+
data->ompio_fh.f_comm->c_coll.coll_bcast_module);
239+
if ( OMPI_SUCCESS != ret ) {
240+
opal_output(1, ",mca_io_ompio_file_set_size: error in bcast\n");
241+
return ret;
242+
}
243+
239244

240245
if (tmp != size) {
241246
return OMPI_ERROR;
242247
}
243248

244249
ret = data->ompio_fh.f_fs->fs_file_set_size (&data->ompio_fh, size);
250+
if ( OMPI_SUCCESS != ret ) {
251+
opal_output(1, ",mca_io_ompio_file_set_size: error in fs->set_size\n");
252+
return ret;
253+
}
254+
255+
ret = data->ompio_fh.f_comm->c_coll.coll_barrier (data->ompio_fh.f_comm,
256+
data->ompio_fh.f_comm->c_coll.coll_barrier_module);
257+
if ( OMPI_SUCCESS != ret ) {
258+
opal_output(1, ",mca_io_ompio_file_set_size: error in barrier\n");
259+
return ret;
260+
}
245261

246262
return ret;
247263
}

0 commit comments

Comments
 (0)