|
template<typename ValueFunction > |
| terminator (BinaryOperation op, ValueFunction &&value_fun, bool b_only_local=false) |
|
void | operator() (void) override |
| Starts this terminator if required.
|
|
size_type | iterations (void) const noexcept override |
| Returns the number of times the terminator has iterated. More...
|
|
template<typename Notifier > |
void | set_notifier (Notifier &¬ifier) |
| Sets the function to be called when termination is detected.
|
|
template<typename T, typename BinaryOperation>
class stapl::terminator< T, BinaryOperation >
General termination detection.
- Template Parameters
-
T | Object type of the termination detection. |
BinaryOperation | Binary operation function object type to be applied. |
This terminator does a reduction and compares the resulting value against a known termination value. If they are the same, it calls the notify function.
It implements a phased termination consisting of 3 states:
- State A: Do allreduce. If the return value is the same as the termination value, goto State B, otherwise goto State A.
- State B: Do allreduce. If the return value is the same as the termination value, goto State C, otherwise goto State A.
- State C: Termination detection succeeded.
- See also
- terminator_base