1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-08-01 04:07:07 +01:00

More cleanup

This commit is contained in:
Guido Cossu
2016-12-08 06:14:20 +00:00
parent 538e64e5b4
commit 14a1406f54
3 changed files with 219 additions and 2 deletions

View File

@@ -214,7 +214,12 @@ class ConjugateGradient : public OperatorFunction<Field> {
ReprTest.do_check = true;
ReprTest.reset_counter();
this->operator()(Linop, src, psi_start);// run the repro test
std::cout << GridLogMessage << "Test passed" << std::endl;
if (ReprTest.success)
std::cout << GridLogMessage << "Reproducibility test passed" << std::endl;
else{
std::cout << GridLogMessage << "Reproducibility test failed" << std::endl;
exit(1);
}
}
// Clear state

View File

@@ -40,6 +40,7 @@ class ReproducibilityState {
unsigned int n_call;
bool do_check;
bool enable_reprocheck;
bool success;
sum_type th_states;
void reset_counter() { n_call = 0; }
@@ -47,6 +48,7 @@ class ReproducibilityState {
th_states.clear();
do_check = false;
enable_reprocheck = false;
success = true;
n_call = 0;
};
@@ -131,7 +133,8 @@ class ReproducibilityState {
std::cout << GridLogMessage << "Current state" << std::endl;
show_binaryrep(sumarray[thread]);
std::cout << GridLogMessage << "Xor result" << std::endl;
show_binaryrep(xors, words);
show_binaryrep(xors, words);
repr.success = false;
}
}
repr.n_call++;