Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 64dd52e

Browse files
authored
Merge pull request #1302 from edgargabriel/pr/barrier-on-close
io/ompio: Add barrier to file_close and file_set_size
2 parents 24b425b + 03c3269 commit 64dd52e

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

ompi/mca/io/ompio/io_ompio_file_open.c

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,13 @@ ompio_io_ompio_file_close (mca_io_ompio_file_t *ompio_fh)
294294
int delete_flag = 0;
295295
char name[256];
296296

297+
ret = ompio_fh->f_comm->c_coll.coll_barrier ( ompio_fh->f_comm, ompio_fh->f_comm->c_coll.coll_barrier_module);
298+
if ( OMPI_SUCCESS != ret ) {
299+
/* Not sure what to do */
300+
opal_output (1,"mca_common_ompio_file_close: error in Barrier \n");
301+
return ret;
302+
}
303+
297304
if(mca_io_ompio_coll_timing_info){
298305
strcpy (name, "WRITE");
299306
if (!ompi_io_ompio_empty_print_queue(WRITE_PRINT_QUEUE)){
@@ -542,18 +549,33 @@ mca_io_ompio_file_set_size (ompi_file_t *fh,
542549

543550
tmp = size;
544551

545-
data->ompio_fh.f_comm->c_coll.coll_bcast (&tmp,
546-
1,
547-
OMPI_OFFSET_DATATYPE,
548-
OMPIO_ROOT,
549-
data->ompio_fh.f_comm,
550-
data->ompio_fh.f_comm->c_coll.coll_bcast_module);
552+
ret = data->ompio_fh.f_comm->c_coll.coll_bcast (&tmp,
553+
1,
554+
OMPI_OFFSET_DATATYPE,
555+
OMPIO_ROOT,
556+
data->ompio_fh.f_comm,
557+
data->ompio_fh.f_comm->c_coll.coll_bcast_module);
558+
if ( OMPI_SUCCESS != ret ) {
559+
opal_output(1, ",mca_io_ompio_file_set_size: error in bcast\n");
560+
return ret;
561+
}
551562

552563
if (tmp != size) {
553564
return OMPI_ERROR;
554565
}
555566

556567
ret = data->ompio_fh.f_fs->fs_file_set_size (&data->ompio_fh, size);
568+
if ( OMPI_SUCCESS != ret ) {
569+
opal_output(1, ",mca_io_ompio_file_set_size: error in fs->set_size\n");
570+
return ret;
571+
}
572+
573+
ret = data->ompio_fh.f_comm->c_coll.coll_barrier (data->ompio_fh.f_comm,
574+
data->ompio_fh.f_comm->c_coll.coll_barrier_module);
575+
if ( OMPI_SUCCESS != ret ) {
576+
opal_output(1, ",mca_io_ompio_file_set_size: error in barrier\n");
577+
return ret;
578+
}
557579

558580
return ret;
559581
}

0 commit comments

Comments
 (0)