Performance tuning. make sure we catch if the user wants to set the default fileview and replace it with our optimized default file view. Otherwise, performance will suffer. file_get_view should still return the correct filetype, not our optimized default file view. This is the correct version compared to ffa67b96933acafb3cfacf39a074d3dc1fe134ae, which unfortunately broke
some test cases in mpi_test_suite. Thanks for @ggouaillardet for reporting this!
Этот коммит содержится в:
родитель
6f6c01ee8d
Коммит
db5af26de7
@ -102,7 +102,6 @@ static int mca_io_ompio_merge_groups(mca_io_ompio_file_t *fh,
|
||||
int num_merge_aggrs);
|
||||
|
||||
|
||||
|
||||
int ompi_io_ompio_set_file_defaults (mca_io_ompio_file_t *fh)
|
||||
{
|
||||
|
||||
@ -133,13 +132,14 @@ int ompi_io_ompio_set_file_defaults (mca_io_ompio_file_t *fh)
|
||||
fh->f_init_num_aggrs = -1;
|
||||
fh->f_init_aggr_list = NULL;
|
||||
|
||||
ompi_datatype_create_contiguous(1048576,
|
||||
ompi_datatype_create_contiguous(MCA_IO_DEFAULT_FILE_VIEW_SIZE,
|
||||
&ompi_mpi_byte.dt,
|
||||
&default_file_view);
|
||||
ompi_datatype_commit (&default_file_view);
|
||||
|
||||
fh->f_etype = &ompi_mpi_byte.dt;
|
||||
fh->f_filetype = default_file_view;
|
||||
ompi_datatype_duplicate ( &ompi_mpi_byte.dt, &fh->f_orig_filetype );
|
||||
|
||||
|
||||
/* Default file View */
|
||||
|
@ -57,7 +57,9 @@ OMPI_DECLSPEC extern int mca_io_ompio_coll_timing_info;
|
||||
#define OMPIO_CONTIGUOUS_FVIEW 0x00000010
|
||||
#define OMPIO_AGGREGATOR_IS_SET 0x00000020
|
||||
#define OMPIO_SHAREDFP_IS_SET 0x00000040
|
||||
|
||||
#define QUEUESIZE 2048
|
||||
#define MCA_IO_DEFAULT_FILE_VIEW_SIZE 4*1024*1024
|
||||
|
||||
#define OMPIO_MIN(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#define OMPIO_MAX(a, b) (((a) < (b)) ? (b) : (a))
|
||||
@ -320,6 +322,7 @@ struct mca_io_ompio_file_t {
|
||||
size_t f_view_size;
|
||||
ompi_datatype_t *f_etype;
|
||||
ompi_datatype_t *f_filetype;
|
||||
ompi_datatype_t *f_orig_filetype; /* the fileview passed by the user to us */
|
||||
size_t f_etype_size;
|
||||
|
||||
/* contains IO requests that needs to be read/written */
|
||||
|
@ -387,6 +387,10 @@ ompio_io_ompio_file_close (mca_io_ompio_file_t *ompio_fh)
|
||||
ompi_datatype_destroy (&ompio_fh->f_filetype);
|
||||
}
|
||||
|
||||
if ( MPI_DATATYPE_NULL != ompio_fh->f_orig_filetype ){
|
||||
ompi_datatype_destroy (&ompio_fh->f_orig_filetype);
|
||||
}
|
||||
|
||||
|
||||
if (MPI_COMM_NULL != ompio_fh->f_comm && (ompio_fh->f_flags & OMPIO_SHAREDFP_IS_SET) ) {
|
||||
ompi_comm_free (&ompio_fh->f_comm);
|
||||
|
@ -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-2014 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2008-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -135,12 +135,15 @@ int mca_io_ompio_file_set_view (ompi_file_t *fp,
|
||||
{
|
||||
mca_io_ompio_data_t *data;
|
||||
mca_io_ompio_file_t *fh;
|
||||
size_t ftype_size;
|
||||
OPAL_PTRDIFF_TYPE ftype_extent, lb;
|
||||
|
||||
data = (mca_io_ompio_data_t *) fp->f_io_selected_data;
|
||||
fh = &data->ompio_fh;
|
||||
|
||||
ompi_datatype_destroy (&fh->f_etype);
|
||||
ompi_datatype_destroy (&fh->f_filetype);
|
||||
ompi_datatype_destroy (&fh->f_orig_filetype);
|
||||
|
||||
if (NULL != fh->f_decoded_iov) {
|
||||
free (fh->f_decoded_iov);
|
||||
@ -157,14 +160,35 @@ int mca_io_ompio_file_set_view (ompi_file_t *fp,
|
||||
|
||||
fh->f_flags |= OMPIO_FILE_VIEW_IS_SET;
|
||||
fh->f_datarep = strdup (datarep);
|
||||
ompi_datatype_duplicate (filetype, &fh->f_orig_filetype );
|
||||
|
||||
opal_datatype_get_extent(&filetype->super, &lb, &ftype_extent);
|
||||
opal_datatype_type_size (&filetype->super, &ftype_size);
|
||||
|
||||
if ( etype == filetype &&
|
||||
ompi_datatype_is_predefined (filetype ) &&
|
||||
ftype_extent == (OPAL_PTRDIFF_TYPE)ftype_size ){
|
||||
ompi_datatype_t *newfiletype;
|
||||
ompi_datatype_create_contiguous(MCA_IO_DEFAULT_FILE_VIEW_SIZE,
|
||||
&ompi_mpi_byte.dt,
|
||||
&newfiletype);
|
||||
ompi_datatype_commit (&newfiletype);
|
||||
mca_io_ompio_set_view_internal (fh,
|
||||
disp,
|
||||
etype,
|
||||
newfiletype,
|
||||
datarep,
|
||||
info);
|
||||
ompi_datatype_destroy ( &newfiletype );
|
||||
}
|
||||
else {
|
||||
mca_io_ompio_set_view_internal (fh,
|
||||
disp,
|
||||
etype,
|
||||
filetype,
|
||||
datarep,
|
||||
info);
|
||||
|
||||
}
|
||||
|
||||
if (OMPI_SUCCESS != mca_fcoll_base_file_select (&data->ompio_fh,
|
||||
NULL)) {
|
||||
@ -189,7 +213,7 @@ int mca_io_ompio_file_get_view (struct ompi_file_t *fp,
|
||||
|
||||
*disp = fh->f_disp;
|
||||
ompi_datatype_duplicate (fh->f_etype, etype);
|
||||
ompi_datatype_duplicate (fh->f_filetype, filetype);
|
||||
ompi_datatype_duplicate (fh->f_orig_filetype, filetype);
|
||||
strcpy (datarep, fh->f_datarep);
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user