Directly initialize variable with global value.

Previously we initialized a variable for a global
(i.e. sum over all processes) value with the local
value first and the overwrote it with the computed
global. This meant the name did not reflect the value
during the first initialization.

With this commit we fix this by using an additional
variable for the local value that is used to compute
the global one.
This commit is contained in:
Markus Blatt 2015-09-07 09:38:49 +02:00
parent 4cc87c28f6
commit 02120d14d1

View File

@ -188,8 +188,8 @@ namespace detail {
// Only rank 0 does print to std::cout if terminal_output is enabled
terminal_output_ = (info.communicator().rank()==0);
}
int global_number_of_wells = wells_->number_of_wells;
global_number_of_wells = info.communicator().sum(global_number_of_wells);
int local_number_of_wells = wells_->number_of_wells;
int global_number_of_wells = info.communicator().sum(local_number_of_wells);
wells_active_ = ( global_number_of_wells > 0 );
}else
{