Tomographer
v4.0
Tomographer C++ Framework Documentation
|
A task which may be repeated in parallel with different inputs.
Task
should represent an instance of the task to complete (e.g. a Metropolis-Hastings random walk). It should provide the following methods.
Task::getResult()
.TaskCData::getTaskInput()
returned. logger
(see Tomographer::Logger::LoggerBase). Note that the logger need NOT be the logger that may have been specified, e.g., to the task dispatcher: it could be, for example, an internal thread-safe wrapper to your original logger. To be sure, you should make this a template method with a parameter LoggerType.logger
(see Tomographer::Logger::LoggerBase). Note that the logger need NOT be the logger that may have been specified, e.g., to the task dispatcher: it could be, for example, an internal thread-safe wrapper to your original logger. To be sure, you should make this a template method with parameters LoggerType and TaskManagerIface.run()
should poll tmgriface->statusReportRequested()
and provide a status report if requested to do so via tmgriface->statusReport(const TaskStatusReportType &)
. tmgriface is an object which complies to the TaskManagerIface Interface.Tasks must regularly check whether a status report has been requested as they run. This is done by regularly calling the function tmgriface->statusReportRequested()
on the tmgriface
object provided to TaskType::run()
. This function call is meant to be very efficient (for example, it does not require a critical
section in the OpenMP implementation), so this check can be done often. The function tmgriface->statusReportRequested()
returns a bool
indicating whether such a report was requested or not. If such a report was requested, then the thread should prepare its status report object (of type TaskStatusReportType
), and call tmgriface->submitStatusReport(const TaskStatusReportType & obj)
.
StatusReportType
, which can be for example a simple typedef to Tomographer::MultiProc::TaskStatusReport, which specifies the type of its status reports.