Merge pull request #2456 from edgargabriel/pr/dynamic_gen2_uneven_distro_bug
fcoll/dynamic_gen2: fix bug exposed by uneven distribution of data
Этот коммит содержится в:
Коммит
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
|
*** 7b. Determine the number of bytes to be actually written in this cycle
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
if (cycles-1 == index) {
|
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 ;
|
data->bytes_to_write_in_cycle = data->total_bytes - data->bytes_per_cycle*index ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
data->bytes_to_write_in_cycle = data->bytes_per_cycle;
|
data->bytes_to_write_in_cycle = 0;
|
||||||
}
|
}
|
||||||
data->bytes_to_write = data->bytes_to_write_in_cycle;
|
data->bytes_to_write = data->bytes_to_write_in_cycle;
|
||||||
|
|
||||||
#if DEBUG_ON
|
#if DEBUG_ON
|
||||||
if (aggregator == rank) {
|
if (aggregator == rank) {
|
||||||
printf ("****%d: CYCLE %d Bytes %lld**********\n",
|
printf ("****%d: CYCLE %d Bytes %lld**********\n",
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user