16 , start(clock_type::now_time())
21 : limit(timelimit), start(clock_type::now_time()), comm(cm)
26 time_point_type now(clock_type::now_time());
30 if (comm->rank() == 0) {
31 to_stop = !signals.
empty() || (limit > 0 && clock_type::time_diff(now, start) >= limit);
37 return !signals.
empty() || (limit > 0 && clock_type::time_diff(now, start) >= limit);
43 , start(clock_type::now_time())
47 time_point_type now(clock_type::now_time());
48 return (limit > 0 && clock_type::time_diff(now, start) >= limit);
bool operator()() const
Returns true if it's time to stop (time is up or signal is received)
void broadcast(C const &c, P &p, int r=0)
Encapsulation of an MPI communicator and some communicator-related operations.
bool operator()() const
Returns true if time is up.
simple_time_callback(std::size_t timelimit)
Initializes the functor with the desired time duration.
stop_callback(std::size_t timelimit)
Initializes the functor with the desired time duration.