Skip to content

Commit 849d045

Browse files
committed
io/ompio: execute barrier before sync
this ensures that all processes are done modifying a file before syncing. Fixes an error in the testmpio testsuite. Signed-off-by: Edgar Gabriel <egabriel@central.uh.edu>
1 parent bf058ca commit 849d045

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ompi/mca/io/ompio/io_ompio_file_open.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +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) 2008-2016 University of Houston. All rights reserved.
12+
* Copyright (c) 2008-2018 University of Houston. All rights reserved.
1313
* Copyright (c) 2015-2018 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
1515
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
@@ -372,6 +372,13 @@ int mca_io_ompio_file_sync (ompi_file_t *fh)
372372
OPAL_THREAD_UNLOCK(&fh->f_lock);
373373
return MPI_ERR_ACCESS;
374374
}
375+
// Make sure all processes reach this point before syncing the file.
376+
ret = data->ompio_fh.f_comm->c_coll->coll_barrier (data->ompio_fh.f_comm,
377+
data->ompio_fh.f_comm->c_coll->coll_barrier_module);
378+
if ( MPI_SUCCESS != ret ) {
379+
OPAL_THREAD_UNLOCK(&fh->f_lock);
380+
return ret;
381+
}
375382
ret = data->ompio_fh.f_fs->fs_file_sync (&data->ompio_fh);
376383
OPAL_THREAD_UNLOCK(&fh->f_lock);
377384

0 commit comments

Comments
 (0)