Skip to content

Commit c4879ec

Browse files
committed
io/ompio: don't reset amode if MODE_SEQUENTIAL is set
the ompio module resets the amode from WRONLY to RDWR in order to accoomodate data sieving in the two-phase fcoll componet. This leads however to an error if MPI_MODE_SEQUENTIAL has been requested by the user, since MODE_SEQUENTIAL is incompatible with MODE_RDWR. SInce the change to the amode was done after opening the file for individual file pointers but before opening the file for shared filepointers, this lead to an error message in the sharedfp component. Note, that data sieving is never necessary if MODE_SEQUENTIAL is set, so this should not be a problem for any scenario. Fixes #4991 Signed-off-by: Edgar Gabriel <[email protected]>
1 parent 44a1c78 commit c4879ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ompi/mca/common/ompio/common_ompio_file_open.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ int mca_common_ompio_file_open (ompi_communicator_t *comm,
111111

112112
/* This fix is needed for data seiving to work with
113113
two-phase collective I/O */
114-
if ( mca_io_ompio_overwrite_amode ) {
114+
if ( mca_io_ompio_overwrite_amode && !(amode & MPI_MODE_SEQUENTIAL) ) {
115115
if ((amode & MPI_MODE_WRONLY)){
116116
amode -= MPI_MODE_WRONLY;
117117
amode += MPI_MODE_RDWR;

0 commit comments

Comments
 (0)