Skip to content

Commit fb9fa4f

Browse files
authored
Merge pull request #1938 from edgargabriel/pr/barrier-on-close
io/ompio: Add barrier to file_close and to file_set_size
2 parents 4709f42 + 9c31801 commit fb9fa4f

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
@@ -228,6 +228,14 @@ int mca_common_ompio_file_close (mca_io_ompio_file_t *ompio_fh)
228228
int delete_flag = 0;
229229
char name[256];
230230

231+
ret = ompio_fh->f_comm->c_coll.coll_barrier ( ompio_fh->f_comm, ompio_fh->f_comm->c_coll.coll_barrier_module);
232+
if ( OMPI_SUCCESS != ret ) {
233+
/* Not sure what to do */
234+
opal_output (1,"mca_common_ompio_file_close: error in Barrier \n");
235+
return ret;
236+
}
237+
238+
231239
if(mca_io_ompio_coll_timing_info){
232240
strcpy (name, "WRITE");
233241
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)