Merge pull request #5907 from edgargabriel/topic/testmpio-fixes
Topic/testmpio fixes
Этот коммит содержится в:
Коммит
069084e6ad
@ -77,6 +77,12 @@ int mca_common_ompio_file_read (ompio_file_t *fh,
|
||||
int i = 0; /* index into the decoded iovec of the buffer */
|
||||
int j = 0; /* index into the file vie iovec */
|
||||
|
||||
if (fh->f_amode & MPI_MODE_WRONLY){
|
||||
// opal_output(10, "Improper use of FILE Mode, Using WRONLY for Read!\n");
|
||||
ret = MPI_ERR_ACCESS;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if ( 0 == count ) {
|
||||
if ( MPI_STATUS_IGNORE != status ) {
|
||||
status->_ucount = 0;
|
||||
@ -84,11 +90,6 @@ int mca_common_ompio_file_read (ompio_file_t *fh,
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (fh->f_amode & MPI_MODE_WRONLY){
|
||||
printf("Improper use of FILE Mode, Using WRONLY for Read!\n");
|
||||
ret = OMPI_ERROR;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if OPAL_CUDA_SUPPORT
|
||||
int is_gpu, is_managed;
|
||||
@ -226,6 +227,12 @@ int mca_common_ompio_file_iread (ompio_file_t *fh,
|
||||
mca_ompio_request_t *ompio_req=NULL;
|
||||
size_t spc=0;
|
||||
|
||||
if (fh->f_amode & MPI_MODE_WRONLY){
|
||||
// opal_output(10, "Improper use of FILE Mode, Using WRONLY for Read!\n");
|
||||
ret = MPI_ERR_ACCESS;
|
||||
return ret;
|
||||
}
|
||||
|
||||
mca_common_ompio_request_alloc ( &ompio_req, MCA_OMPIO_REQUEST_READ);
|
||||
|
||||
if ( 0 == count ) {
|
||||
|
@ -141,6 +141,10 @@ int mca_common_ompio_set_view (ompio_file_t *fh,
|
||||
// in orig_file type, No need to set args on this one.
|
||||
ompi_datatype_duplicate (newfiletype, &fh->f_filetype);
|
||||
|
||||
if ( (fh->f_view_size % fh->f_etype_size) ) {
|
||||
// File view is not a multiple of the etype.
|
||||
return MPI_ERR_ARG;
|
||||
}
|
||||
|
||||
if( SIMPLE_PLUS == OMPIO_MCA_GET(fh, grouping_option) ) {
|
||||
fh->f_cc_size = get_contiguous_chunk_size (fh, 1);
|
||||
|
@ -58,6 +58,13 @@ int mca_common_ompio_file_write (ompio_file_t *fh,
|
||||
int i = 0; /* index into the decoded iovec of the buffer */
|
||||
int j = 0; /* index into the file view iovec */
|
||||
|
||||
if (fh->f_amode & MPI_MODE_RDONLY){
|
||||
// opal_output(10, "Improper use of FILE Mode, Using RDONLY for write!\n");
|
||||
ret = MPI_ERR_READ_ONLY;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
if ( 0 == count ) {
|
||||
if ( MPI_STATUS_IGNORE != status ) {
|
||||
status->_ucount = 0;
|
||||
@ -194,6 +201,12 @@ int mca_common_ompio_file_iwrite (ompio_file_t *fh,
|
||||
mca_ompio_request_t *ompio_req=NULL;
|
||||
size_t spc=0;
|
||||
|
||||
if (fh->f_amode & MPI_MODE_RDONLY){
|
||||
// opal_output(10, "Improper use of FILE Mode, Using RDONLY for write!\n");
|
||||
ret = MPI_ERR_READ_ONLY;
|
||||
return ret;
|
||||
}
|
||||
|
||||
mca_common_ompio_request_alloc ( &ompio_req, MCA_OMPIO_REQUEST_WRITE);
|
||||
|
||||
if ( 0 == count ) {
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2008-2018 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015-2018 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
|
||||
@ -372,6 +372,13 @@ int mca_io_ompio_file_sync (ompi_file_t *fh)
|
||||
OPAL_THREAD_UNLOCK(&fh->f_lock);
|
||||
return MPI_ERR_ACCESS;
|
||||
}
|
||||
// Make sure all processes reach this point before syncing the file.
|
||||
ret = data->ompio_fh.f_comm->c_coll->coll_barrier (data->ompio_fh.f_comm,
|
||||
data->ompio_fh.f_comm->c_coll->coll_barrier_module);
|
||||
if ( MPI_SUCCESS != ret ) {
|
||||
OPAL_THREAD_UNLOCK(&fh->f_lock);
|
||||
return ret;
|
||||
}
|
||||
ret = data->ompio_fh.f_fs->fs_file_sync (&data->ompio_fh);
|
||||
OPAL_THREAD_UNLOCK(&fh->f_lock);
|
||||
|
||||
@ -400,8 +407,9 @@ int mca_io_ompio_file_seek (ompi_file_t *fh,
|
||||
}
|
||||
break;
|
||||
case MPI_SEEK_CUR:
|
||||
offset += data->ompio_fh.f_position_in_file_view;
|
||||
offset += data->ompio_fh.f_disp;
|
||||
ret = mca_common_ompio_file_get_position (&data->ompio_fh,
|
||||
&temp_offset);
|
||||
offset += temp_offset;
|
||||
if (offset < 0) {
|
||||
OPAL_THREAD_UNLOCK(&fh->f_lock);
|
||||
return OMPI_ERROR;
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2008-2018 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015-2018 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
|
||||
@ -66,6 +66,10 @@ int mca_io_ompio_file_set_view (ompi_file_t *fp,
|
||||
mca_common_ompio_data_t *data;
|
||||
ompio_file_t *fh;
|
||||
|
||||
if ( (strcmp(datarep, "native") && strcmp(datarep, "NATIVE"))) {
|
||||
return MPI_ERR_UNSUPPORTED_DATAREP;
|
||||
}
|
||||
|
||||
data = (mca_common_ompio_data_t *) fp->f_io_selected_data;
|
||||
|
||||
/* we need to call the internal file set view twice: once for the individual
|
||||
|
@ -64,6 +64,10 @@ int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype,
|
||||
OMPI_CHECK_DATATYPE_FOR_VIEW(rc, filetype, 0);
|
||||
}
|
||||
}
|
||||
if ( NULL == datarep) {
|
||||
rc = MPI_ERR_UNSUPPORTED_DATAREP;
|
||||
fh = MPI_FILE_NULL;
|
||||
}
|
||||
OMPI_ERRHANDLER_CHECK(rc, fh, rc, FUNC_NAME);
|
||||
}
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user