1
1

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
Этот коммит содержится в:
Edgar Gabriel 2015-07-30 19:15:00 -05:00
родитель 93a303ba89
Коммит ffa67b9693
2 изменённых файлов: 34 добавлений и 9 удалений

Просмотреть файл

@ -100,14 +100,15 @@ static int mca_io_ompio_merge_initial_groups(mca_io_ompio_file_t *fh,
static int mca_io_ompio_merge_groups(mca_io_ompio_file_t *fh,
int *merge_aggrs,
int num_merge_aggrs);
#define MCA_IO_OMPIO_DEFAULT_FVIEW_SIZE 4*1024*1024
ompi_datatype_t *mca_io_ompio_default_file_view=NULL;
int ompi_io_ompio_set_file_defaults (mca_io_ompio_file_t *fh)
{
if (NULL != fh) {
ompi_datatype_t *types[2], *default_file_view;
ompi_datatype_t *types[2];
int blocklen[2] = {1, 1};
OPAL_PTRDIFF_TYPE d[2], base;
int i;
@ -133,13 +134,13 @@ 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_OMPIO_DEFAULT_FVIEW_SIZE,
&ompi_mpi_byte.dt,
&default_file_view);
ompi_datatype_commit (&default_file_view);
&mca_io_ompio_default_file_view);
ompi_datatype_commit (&mca_io_ompio_default_file_view);
fh->f_etype = &ompi_mpi_byte.dt;
fh->f_filetype = default_file_view;
fh->f_filetype = mca_io_ompio_default_file_view;
/* Default file View */
@ -151,9 +152,10 @@ int ompi_io_ompio_set_file_defaults (mca_io_ompio_file_t *fh)
mca_io_ompio_set_view_internal(fh,
0,
&ompi_mpi_byte.dt,
default_file_view,
mca_io_ompio_default_file_view,
"native",
fh->f_info);
fh->f_flags |= OMPIO_FILE_VIEW_IS_SET;
/*Create a derived datatype for the created iovec */

Просмотреть файл

@ -38,6 +38,7 @@
#include "io_ompio.h"
static OMPI_MPI_OFFSET_TYPE get_contiguous_chunk_size (mca_io_ompio_file_t *);
extern ompi_datatype_t *mca_io_ompio_default_file_view;
int mca_io_ompio_set_view_internal(mca_io_ompio_file_t *fh,
@ -139,6 +140,23 @@ int mca_io_ompio_file_set_view (ompi_file_t *fp,
data = (mca_io_ompio_data_t *) fp->f_io_selected_data;
fh = &data->ompio_fh;
if ( fh->f_flags & OMPIO_FILE_VIEW_IS_SET ) {
if ( MPI_BYTE == etype && MPI_BYTE == filetype ) {
/* this is the default file view that the user provides. If we also have the default file view set
** dont replace our optimized version of the default file view with
** MPI_BYTE/MPI_BYTE, since the performance suffers terribly
** if you do that. Otherwise, pass the optimized version along, not the trivial version.
*/
if ( mca_io_ompio_default_file_view == fh->f_filetype ) {
/* don't do anything */
return OMPI_SUCCESS;
}
else {
filetype = mca_io_ompio_default_file_view;
}
}
}
if (NULL != fh->f_decoded_iov) {
free (fh->f_decoded_iov);
fh->f_decoded_iov = NULL;
@ -186,7 +204,12 @@ 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);
if ( mca_io_ompio_default_file_view == fh->f_filetype ) {
ompi_datatype_duplicate ( &ompi_mpi_byte.dt, filetype);
}
else {
ompi_datatype_duplicate (fh->f_filetype, filetype);
}
strcpy (datarep, fh->f_datarep);
return OMPI_SUCCESS;