Commit 51761cc1 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

bug fix for stochastic collocation

parent 588cd33c
......@@ -83,8 +83,13 @@ struct Mean {
void UpdateParallel(SampleCounter ctr, Weights wgt, int commSplit) {
C = abs(PPM->SumAcrossComm(ctr.Mcomm * Ccomm, commSplit) / ctr.M);
Q = abs(PPM->SumAcrossComm(wgt.Wcomm * Qcomm, commSplit) / wgt.W);
Y = abs(PPM->SumAcrossComm(wgt.Wcomm * Ycomm, commSplit) / wgt.W);
if (wgt.W == ctr.M) { // Monte Carlo Case
Q = abs(PPM->SumAcrossComm(ctr.Mcomm * Qcomm, commSplit) / ctr.M);
Y = abs(PPM->SumAcrossComm(ctr.Mcomm * Ycomm, commSplit) / ctr.M);
} else { // Stochastic Collocation Case
Q = abs(PPM->SumAcrossComm(wgt.Wcomm * Qcomm, commSplit));
Y = abs(PPM->SumAcrossComm(wgt.Wcomm * Ycomm, commSplit));
}
}
friend Logging &operator<<(Logging &s, const Mean &mean) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment