diff --git a/ompi/mca/common/ompio/common_ompio_aggregators.c b/ompi/mca/common/ompio/common_ompio_aggregators.c index 90082253c5..aa751cd4a1 100644 --- a/ompi/mca/common/ompio/common_ompio_aggregators.c +++ b/ompi/mca/common/ompio/common_ompio_aggregators.c @@ -650,14 +650,17 @@ int mca_common_ompio_create_groups(ompio_file_t *fh, opal_output(1,"mca_common_ompio_create_groups: could not allocate memory\n"); goto exit; } - + + int found; for ( i=0, j=0; if_num_aggrs; i++ ) { - for ( ; jf_size; j++ ) { + found = 0; + do { if ( 1 == tmp_final_aggrs[j] ) { - break; + fh->f_aggr_list[i] = j; + found=1; } - fh->f_aggr_list[i] = tmp_final_aggrs[j]; - } + j++; + } while ( !found && j < fh->f_size); } exit: