Skip to content

Commit dc752ce

Browse files
committed
utility consts for better readability
Signed-off-by: Torbjörn Klatt <[email protected]>
1 parent 9e3893e commit dc752ce

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

include/pfasst/interfaces.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ namespace pfasst
8686
*/
8787
class IStatus
8888
{
89+
public:
90+
static const int NOT_CONVERGED = 0;
91+
static const int CONVERGED = 1;
92+
8993
protected:
9094
ICommunicator* comm;
9195

src/pfasst/interfaces_impl.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using namespace std;
77

88
#include "pfasst/globals.hpp"
9+
#include "pfasst/logging.hpp"
910

1011

1112
namespace pfasst
@@ -78,7 +79,11 @@ namespace pfasst
7879
if (this->comm->rank() == 0) {
7980
return !this->get_converged(0);
8081
}
81-
return !this->get_converged(this->comm->rank()) || !this->get_converged(this->comm->rank() - 1);
82+
bool keep_iterating = !this->get_converged(this->comm->rank() - 1) || !this->get_converged(this->comm->rank());
83+
CLOG(DEBUG, "Controller") << "previous converged: " << boolalpha << this->get_converged(this->comm->rank() - 1)
84+
<< "; this converged: " << boolalpha << this->get_converged(this->comm->rank())
85+
<< " --> keep iterating: " << boolalpha << keep_iterating;
86+
return keep_iterating;
8287
}
8388

8489

0 commit comments

Comments
 (0)