1
1

Merge pull request #2456 from edgargabriel/pr/dynamic_gen2_uneven_distro_bug

fcoll/dynamic_gen2: fix bug exposed by uneven distribution of data
Этот коммит содержится в:
Edgar Gabriel 2016-11-24 16:34:19 -06:00 коммит произвёл GitHub
родитель 8fd1c3f0df b10558c3da
Коммит ebcfbbc045

Просмотреть файл

@ -810,13 +810,18 @@ static int shuffle_init ( int index, int cycles, int aggregator, int rank, mca_i
/**************************************************************************
*** 7b. Determine the number of bytes to be actually written in this cycle
**************************************************************************/
if (cycles-1 == index) {
data->bytes_to_write_in_cycle = data->total_bytes - data->bytes_per_cycle*index;
}
else {
int local_cycles= ceil((double)data->total_bytes / data->bytes_per_cycle);
if ( index < (local_cycles -1) ) {
data->bytes_to_write_in_cycle = data->bytes_per_cycle;
}
else if ( index == (local_cycles -1)) {
data->bytes_to_write_in_cycle = data->total_bytes - data->bytes_per_cycle*index ;
}
else {
data->bytes_to_write_in_cycle = 0;
}
data->bytes_to_write = data->bytes_to_write_in_cycle;
#if DEBUG_ON
if (aggregator == rank) {
printf ("****%d: CYCLE %d Bytes %lld**********\n",