mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
4cc87c28f6
commit
02120d14d1
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user