Skip to content

Commit 1ae4f8c

Browse files
committed
Revert "Performance tuning. make sure we catch if the user wants to set the default fileview and replace it with"
This reverts commit ffa67b9.
1 parent 67fdfdd commit 1ae4f8c

File tree

2 files changed

+9
-34
lines changed

2 files changed

+9
-34
lines changed

ompi/mca/io/ompio/io_ompio.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,14 @@ static int mca_io_ompio_merge_initial_groups(mca_io_ompio_file_t *fh,
100100
static int mca_io_ompio_merge_groups(mca_io_ompio_file_t *fh,
101101
int *merge_aggrs,
102102
int num_merge_aggrs);
103-
104-
#define MCA_IO_OMPIO_DEFAULT_FVIEW_SIZE 4*1024*1024
105-
ompi_datatype_t *mca_io_ompio_default_file_view=NULL;
103+
104+
106105

107106
int ompi_io_ompio_set_file_defaults (mca_io_ompio_file_t *fh)
108107
{
109108

110109
if (NULL != fh) {
111-
ompi_datatype_t *types[2];
110+
ompi_datatype_t *types[2], *default_file_view;
112111
int blocklen[2] = {1, 1};
113112
OPAL_PTRDIFF_TYPE d[2], base;
114113
int i;
@@ -134,13 +133,13 @@ int ompi_io_ompio_set_file_defaults (mca_io_ompio_file_t *fh)
134133
fh->f_init_num_aggrs = -1;
135134
fh->f_init_aggr_list = NULL;
136135

137-
ompi_datatype_create_contiguous(MCA_IO_OMPIO_DEFAULT_FVIEW_SIZE,
136+
ompi_datatype_create_contiguous(1048576,
138137
&ompi_mpi_byte.dt,
139-
&mca_io_ompio_default_file_view);
140-
ompi_datatype_commit (&mca_io_ompio_default_file_view);
138+
&default_file_view);
139+
ompi_datatype_commit (&default_file_view);
141140

142141
fh->f_etype = &ompi_mpi_byte.dt;
143-
fh->f_filetype = mca_io_ompio_default_file_view;
142+
fh->f_filetype = default_file_view;
144143

145144

146145
/* Default file View */
@@ -152,10 +151,9 @@ int ompi_io_ompio_set_file_defaults (mca_io_ompio_file_t *fh)
152151
mca_io_ompio_set_view_internal(fh,
153152
0,
154153
&ompi_mpi_byte.dt,
155-
mca_io_ompio_default_file_view,
154+
default_file_view,
156155
"native",
157156
fh->f_info);
158-
fh->f_flags |= OMPIO_FILE_VIEW_IS_SET;
159157

160158

161159
/*Create a derived datatype for the created iovec */

ompi/mca/io/ompio/io_ompio_file_set_view.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#include "io_ompio.h"
3939

4040
static OMPI_MPI_OFFSET_TYPE get_contiguous_chunk_size (mca_io_ompio_file_t *);
41-
extern ompi_datatype_t *mca_io_ompio_default_file_view;
4241

4342

4443
int mca_io_ompio_set_view_internal(mca_io_ompio_file_t *fh,
@@ -140,23 +139,6 @@ int mca_io_ompio_file_set_view (ompi_file_t *fp,
140139
data = (mca_io_ompio_data_t *) fp->f_io_selected_data;
141140
fh = &data->ompio_fh;
142141

143-
if ( fh->f_flags & OMPIO_FILE_VIEW_IS_SET ) {
144-
if ( MPI_BYTE == etype && MPI_BYTE == filetype ) {
145-
/* this is the default file view that the user provides. If we also have the default file view set
146-
** dont replace our optimized version of the default file view with
147-
** MPI_BYTE/MPI_BYTE, since the performance suffers terribly
148-
** if you do that. Otherwise, pass the optimized version along, not the trivial version.
149-
*/
150-
if ( mca_io_ompio_default_file_view == fh->f_filetype ) {
151-
/* don't do anything */
152-
return OMPI_SUCCESS;
153-
}
154-
else {
155-
filetype = mca_io_ompio_default_file_view;
156-
}
157-
}
158-
}
159-
160142
if (NULL != fh->f_decoded_iov) {
161143
free (fh->f_decoded_iov);
162144
fh->f_decoded_iov = NULL;
@@ -204,12 +186,7 @@ int mca_io_ompio_file_get_view (struct ompi_file_t *fp,
204186

205187
*disp = fh->f_disp;
206188
ompi_datatype_duplicate (fh->f_etype, etype);
207-
if ( mca_io_ompio_default_file_view == fh->f_filetype ) {
208-
ompi_datatype_duplicate ( &ompi_mpi_byte.dt, filetype);
209-
}
210-
else {
211-
ompi_datatype_duplicate (fh->f_filetype, filetype);
212-
}
189+
ompi_datatype_duplicate (fh->f_filetype, filetype);
213190
strcpy (datarep, fh->f_datarep);
214191

215192
return OMPI_SUCCESS;

0 commit comments

Comments
 (0)