Skip to content

Commit 007b773

Browse files
authored
Merge pull request #7122 from edgargabriel/pr/simple-aggr-mode-fix
common/ompio: fix calculation in simple-grouping option
2 parents 312c55e + ad5d0df commit 007b773

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ompi/mca/common/ompio/common_ompio_aggregators.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,17 @@ int mca_common_ompio_simple_grouping(ompio_file_t *fh,
126126
}
127127

128128
P_a = 1;
129-
time_prev = cost_calc ( fh->f_size, P_a, fh->f_view_size, (size_t) fh->f_bytes_per_agg, mode );
129+
time_prev = cost_calc ( fh->f_size, P_a, fh->f_cc_size, (size_t) fh->f_bytes_per_agg, mode );
130130
P_a_prev = P_a;
131131
for ( P_a = incr; P_a <= fh->f_size; P_a += incr ) {
132-
time = cost_calc ( fh->f_size, P_a, fh->f_view_size, (size_t) fh->f_bytes_per_agg, mode );
132+
time = cost_calc ( fh->f_size, P_a, fh->f_cc_size, (size_t) fh->f_bytes_per_agg, mode );
133133
dtime_abs = (time_prev - time);
134134
dtime = dtime_abs / time_prev;
135135
dtime_diff = ( P_a == incr ) ? dtime : (dtime_prev - dtime);
136136
#ifdef OMPIO_DEBUG
137137
if ( 0 == fh->f_rank ){
138138
printf(" d_p = %ld P_a = %d time = %lf dtime = %lf dtime_abs =%lf dtime_diff=%lf\n",
139-
fh->f_view_size, P_a, time, dtime, dtime_abs, dtime_diff );
139+
fh->f_cc_size, P_a, time, dtime, dtime_abs, dtime_diff );
140140
}
141141
#endif
142142
if ( dtime_diff < dtime_threshold ) {
@@ -171,7 +171,7 @@ int mca_common_ompio_simple_grouping(ompio_file_t *fh,
171171
num_groups = P_a_prev;
172172
#ifdef OMPIO_DEBUG
173173
printf(" For P=%d d_p=%ld b_c=%d threshold=%f chosen P_a = %d \n",
174-
fh->f_size, fh->f_view_size, fh->f_bytes_per_agg, dtime_threshold, P_a_prev);
174+
fh->f_size, fh->f_cc_size, fh->f_bytes_per_agg, dtime_threshold, P_a_prev);
175175
#endif
176176

177177
/* Cap the maximum number of aggregators.*/
@@ -183,6 +183,7 @@ int mca_common_ompio_simple_grouping(ompio_file_t *fh,
183183
}
184184

185185
*num_groups_out = num_groups;
186+
186187
return mca_common_ompio_forced_grouping ( fh, num_groups, contg_groups);
187188
}
188189

@@ -576,7 +577,7 @@ int mca_common_ompio_create_groups(ompio_file_t *fh,
576577
opal_output (1, "mca_common_ompio_create_groups: error in mca_common_ompio_prepare_to_group\n");
577578
goto exit;
578579
}
579-
580+
580581
switch(ompio_grouping_flag){
581582

582583
case OMPIO_SPLIT:

0 commit comments

Comments
 (0)