11 extern std::atomic<bool>
CTRL_C;
42 steps(st), runtime(t), nthreads(thr), restart(re), break_CTRLC(true) {
48 Control(
const Control& c) : steps(c.steps), runtime(c.runtime), nthreads(c.nthreads), restart(c.restart), break_CTRLC(true) {
71 if(break_CTRLC and
CTRL_C) {
73 std::cerr <<
"Control break on CTRL_C" << std::endl;
78 if(steps > 0 and done_steps >= steps+1) {
80 std::cerr <<
"Control break on steps" << std::endl;
85 if(runtime > 0 and time_since(start_time) >= runtime) {
87 std::cerr <<
"Control break on runtime\t"<< runtime << std::endl;
106 return {st,t,thr,re};
unsigned long inner_runtime
Definition: FleetArgs.h:26
unsigned long steps
Definition: Control.h:24
Control(const Control &c)
Definition: Control.h:48
bool break_CTRLC
Definition: Control.h:34
time_ms runtime
Definition: Control.h:25
void start()
Definition: Control.h:54
unsigned long inner_restart
Definition: FleetArgs.h:27
size_t nthreads
Definition: Control.h:26
Control(unsigned long st=FleetArgs::steps, unsigned long t=FleetArgs::runtime, size_t thr=FleetArgs::nthreads, unsigned long re=FleetArgs::restart)
Definition: Control.h:38
Control InnerControl(unsigned long st=FleetArgs::inner_steps, unsigned long t=FleetArgs::inner_runtime, size_t thr=1, unsigned long re=FleetArgs::inner_restart)
Make a Control object (NOTE it's a Control object not an InnerControl one) that has default parameter...
Definition: Control.h:102
std::atomic< unsigned long > done_steps
Definition: Control.h:32
bool running()
Definition: Control.h:63
timept start_time
Definition: Control.h:29
unsigned long inner_steps
Definition: FleetArgs.h:13
size_t nthreads
Definition: FleetArgs.h:20
unsigned long runtime
Definition: FleetArgs.h:25
unsigned long restart
Definition: Control.h:27
unsigned long steps
Definition: FleetArgs.h:12
unsigned long restart
Definition: FleetArgs.h:32
std::atomic< bool > CTRL_C