From c4de46e2840f4f6ce85d1a041def61a4e5b17393 Mon Sep 17 00:00:00 2001 From: Mangala Jyothi Bhaskar Date: Thu, 16 Apr 2015 10:38:07 -0500 Subject: [PATCH] Fix number of aggregators used in two phase fcoll --- ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c | 3 +-- ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c | 3 +-- ompi/mca/io/ompio/io_ompio.c | 3 +++ ompi/mca/io/ompio/io_ompio.h | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c index b94c1df378..62c263964e 100644 --- a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c +++ b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c @@ -190,8 +190,7 @@ mca_fcoll_two_phase_file_read_all (mca_io_ompio_file_t *fh, return ret; } - two_phase_num_io_procs = - ceil((float)fh->f_size/fh->f_procs_per_group); + two_phase_num_io_procs = fh->f_final_num_aggrs; } diff --git a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c index 162c866eab..c460bb3d14 100644 --- a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c +++ b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c @@ -222,8 +222,7 @@ mca_fcoll_two_phase_file_write_all (mca_io_ompio_file_t *fh, return ret; } - two_phase_num_io_procs = - ceil((float)fh->f_size/fh->f_procs_per_group); + two_phase_num_io_procs = fh->f_final_num_aggrs; } diff --git a/ompi/mca/io/ompio/io_ompio.c b/ompi/mca/io/ompio/io_ompio.c index 341e86c548..5d2f3e1c35 100644 --- a/ompi/mca/io/ompio/io_ompio.c +++ b/ompi/mca/io/ompio/io_ompio.c @@ -2150,6 +2150,9 @@ int mca_io_ompio_create_groups(mca_io_ompio_file_t *fh, fh->f_comm, fh->f_comm->c_coll.coll_allreduce_module); + //Set final number of aggregators in file handle + fh->f_final_num_aggrs = final_num_aggrs; + //Print final number of aggregators if required /*if(fh->f_rank == 0){ diff --git a/ompi/mca/io/ompio/io_ompio.h b/ompi/mca/io/ompio/io_ompio.h index 394c97ab7b..6da5cfef77 100644 --- a/ompi/mca/io/ompio/io_ompio.h +++ b/ompi/mca/io/ompio/io_ompio.h @@ -349,6 +349,7 @@ struct mca_io_ompio_file_t { int f_init_procs_per_group; int *f_init_procs_in_group; + int f_final_num_aggrs; mca_io_ompio_decode_datatype_fn_t f_decode_datatype; mca_io_ompio_generate_current_file_view_fn_t f_generate_current_file_view;