@@ -350,36 +350,28 @@ int mca_common_ompio_set_view (ompio_file_t *fh,
350
350
351
351
OMPI_MPI_OFFSET_TYPE get_contiguous_chunk_size (ompio_file_t * fh , int flag )
352
352
{
353
- int uniform = 0 ;
354
353
OMPI_MPI_OFFSET_TYPE avg [3 ] = {0 ,0 ,0 };
355
354
OMPI_MPI_OFFSET_TYPE global_avg [3 ] = {0 ,0 ,0 };
356
355
int i = 0 ;
357
356
358
- /* This function does two things: first, it determines the average data chunk
359
- ** size in the file view for each process and across all processes.
360
- ** Second, it establishes whether the view across all processes is uniform.
361
- ** By definition, uniform means:
362
- ** 1. the file view of each process has the same number of contiguous sections
363
- ** 2. each section in the file view has exactly the same size
357
+ /* This function determines the average data chunk
358
+ ** size in the file view for each process and across all processes,
359
+ ** and the avg. file_view size across processes.
364
360
*/
365
361
366
362
if ( flag ) {
367
363
global_avg [0 ] = MCA_IO_DEFAULT_FILE_VIEW_SIZE ;
364
+ fh -> f_avg_view_size = fh -> f_view_size ;
368
365
}
369
366
else {
370
367
for (i = 0 ; i < (int )fh -> f_iov_count ; i ++ ) {
371
368
avg [0 ] += fh -> f_decoded_iov [i ].iov_len ;
372
- if (i && 0 == uniform ) {
373
- if (fh -> f_decoded_iov [i ].iov_len != fh -> f_decoded_iov [i - 1 ].iov_len ) {
374
- uniform = 1 ;
375
- }
376
- }
377
369
}
378
370
if ( 0 != fh -> f_iov_count ) {
379
371
avg [0 ] = avg [0 ]/fh -> f_iov_count ;
380
372
}
381
373
avg [1 ] = (OMPI_MPI_OFFSET_TYPE ) fh -> f_iov_count ;
382
- avg [2 ] = (OMPI_MPI_OFFSET_TYPE ) uniform ;
374
+ avg [2 ] = (OMPI_MPI_OFFSET_TYPE ) fh -> f_view_size ;
383
375
384
376
fh -> f_comm -> c_coll -> coll_allreduce (avg ,
385
377
global_avg ,
@@ -390,37 +382,7 @@ OMPI_MPI_OFFSET_TYPE get_contiguous_chunk_size (ompio_file_t *fh, int flag)
390
382
fh -> f_comm -> c_coll -> coll_allreduce_module );
391
383
global_avg [0 ] = global_avg [0 ]/fh -> f_size ;
392
384
global_avg [1 ] = global_avg [1 ]/fh -> f_size ;
393
-
394
- #if 0
395
- /* Disabling the feature since we are not using it anyway. Saves us one allreduce operation. */
396
- int global_uniform = 0 ;
397
-
398
- if ( global_avg [0 ] == avg [0 ] &&
399
- global_avg [1 ] == avg [1 ] &&
400
- 0 == avg [2 ] &&
401
- 0 == global_avg [2 ] ) {
402
- uniform = 0 ;
403
- }
404
- else {
405
- uniform = 1 ;
406
- }
407
-
408
- /* second confirmation round to see whether all processes agree
409
- ** on having a uniform file view or not
410
- */
411
- fh -> f_comm -> c_coll -> coll_allreduce (& uniform ,
412
- & global_uniform ,
413
- 1 ,
414
- MPI_INT ,
415
- MPI_MAX ,
416
- fh -> f_comm ,
417
- fh -> f_comm -> c_coll -> coll_allreduce_module );
418
-
419
- if ( 0 == global_uniform ){
420
- /* yes, everybody agrees on having a uniform file view */
421
- fh -> f_flags |= OMPIO_UNIFORM_FVIEW ;
422
- }
423
- #endif
385
+ fh -> f_avg_view_size = global_avg [2 ]/fh -> f_size ;
424
386
}
425
387
426
388
return global_avg [0 ];
0 commit comments