mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-10 07:55:35 +00:00
WilsonMG: Fix random behavior in GMRES
From time to time I saw random since the basis vectors were not initialized properly.
This commit is contained in:
parent
4f41cd114d
commit
2ab9d4bc56
@ -145,7 +145,8 @@ class CommunicationAvoidingGeneralisedMinimalResidual : public OperatorFunction<
|
||||
Field w(src._grid);
|
||||
Field r(src._grid);
|
||||
|
||||
std::vector<Field> v(RestartLength + 1, src._grid);
|
||||
// this should probably be made a class member so that it is only allocated once, not in every restart
|
||||
std::vector<Field> v(RestartLength + 1, src._grid); for (auto &elem : v) elem = zero;
|
||||
|
||||
MatrixTimer.Start();
|
||||
LinOp.Op(psi, w);
|
||||
|
@ -152,8 +152,9 @@ class FlexibleCommunicationAvoidingGeneralisedMinimalResidual : public OperatorF
|
||||
Field w(src._grid);
|
||||
Field r(src._grid);
|
||||
|
||||
std::vector<Field> v(RestartLength + 1, src._grid);
|
||||
std::vector<Field> z(RestartLength + 1, src._grid);
|
||||
// these should probably be made class members so that they are only allocated once, not in every restart
|
||||
std::vector<Field> v(RestartLength + 1, src._grid); for (auto &elem : v) elem = zero;
|
||||
std::vector<Field> z(RestartLength + 1, src._grid); for (auto &elem : z) elem = zero;
|
||||
|
||||
MatrixTimer.Start();
|
||||
LinOp.Op(psi, w);
|
||||
|
@ -150,8 +150,9 @@ class FlexibleGeneralisedMinimalResidual : public OperatorFunction<Field> {
|
||||
Field w(src._grid);
|
||||
Field r(src._grid);
|
||||
|
||||
std::vector<Field> v(RestartLength + 1, src._grid);
|
||||
std::vector<Field> z(RestartLength + 1, src._grid);
|
||||
// these should probably be made class members so that they are only allocated once, not in every restart
|
||||
std::vector<Field> v(RestartLength + 1, src._grid); for (auto &elem : v) elem = zero;
|
||||
std::vector<Field> z(RestartLength + 1, src._grid); for (auto &elem : z) elem = zero;
|
||||
|
||||
MatrixTimer.Start();
|
||||
LinOp.Op(psi, w);
|
||||
|
@ -143,7 +143,8 @@ class GeneralisedMinimalResidual : public OperatorFunction<Field> {
|
||||
Field w(src._grid);
|
||||
Field r(src._grid);
|
||||
|
||||
std::vector<Field> v(RestartLength + 1, src._grid);
|
||||
// this should probably be made a class member so that it is only allocated once, not in every restart
|
||||
std::vector<Field> v(RestartLength + 1, src._grid); for (auto &elem : v) elem = zero;
|
||||
|
||||
MatrixTimer.Start();
|
||||
LinOp.Op(psi, w);
|
||||
|
@ -157,8 +157,9 @@ class MixedPrecisionFlexibleGeneralisedMinimalResidual : public OperatorFunction
|
||||
FieldD w(src._grid);
|
||||
FieldD r(src._grid);
|
||||
|
||||
std::vector<FieldD> v(RestartLength + 1, src._grid); // these should probably be made class members
|
||||
std::vector<FieldD> z(RestartLength + 1, src._grid); // so that they are only allocated once, not in every restart
|
||||
// these should probably be made class members so that they are only allocated once, not in every restart
|
||||
std::vector<FieldD> v(RestartLength + 1, src._grid); for (auto &elem : v) elem = zero;
|
||||
std::vector<FieldD> z(RestartLength + 1, src._grid); for (auto &elem : z) elem = zero;
|
||||
|
||||
MatrixTimer.Start();
|
||||
LinOp.Op(psi, w);
|
||||
|
Loading…
Reference in New Issue
Block a user