28 #ifndef TOMOGRAPHER_TOOLS_SIGNAL_STATUS_REPORT 29 #define TOMOGRAPHER_TOOLS_SIGNAL_STATUS_REPORT 53 template<
typename TaskDispatcher,
typename Logger,
62 : tasks(tasks_), logger(logger_), time_start()
64 tasks->setStatusReportHandler(
65 [
this](
const FullStatusReportType& report) {
66 logger.debug(
"SigHandlerStatusReporter/lambda",
"intermediate progress report lambda called");
71 TaskDispatcher * tasks;
74 typename TimerClock::time_point time_start;
76 virtual void handleSignal(
int )
78 tasks->requestStatusReport();
89 "=========================== Intermediate Progress Report ============================\n" 90 " (hit Ctrl+C within %2d sec. to interrupt)\n" 91 " Total Completed Runs: %d/%d: %5.2f%%\n" 92 " %s total elapsed\n",
93 TOMOGRAPHER_SIG_HANDLER_REPEAT_EXIT_DELAY,
103 "Current Run(s) information (workers working/spawned %d/%d):\n",
109 fprintf(stderr,
"=== #%2u: %s\n", k, msg.
c_str());
115 "=====================================================================================\n\n");
120 template<
typename TaskDispatcher,
typename LoggerT>
122 makeSigHandlerTaskDispatcherStatusReporter(TaskDispatcher * tasks, LoggerT & logger)
Base namespace for the Tomographer project.
std::vector< TaskStatusReportType, typename Tools::NeedOwnOperatorNew< TaskStatusReportType >::AllocatorType > workers_reports
List with the raw report submitted from each individual thread.
int num_total_runs
Total number of tasks to perform.
std::vector< bool > workers_running
List specifying for each worker (e.g. a spawned thread) whether it is active or not.
Some common definitions for multiprocessing interfaces.
Basic common code for intercepting a signal and basic interfacing to C++.
int num_completed
Number of completed tasks.
A complete status report, abstract version.