Tomographer
v5.4
Tomographer C++ Framework Documentation
|
A task which may be repeated in parallel with different inputs.
A Task should represent an instance of the task to complete (e.g. a Metropolis-Hastings random walk).
A Task interface compliant type should provide the following methods.
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.A Task interface compliant type must always also be compliant with the Resultable Interface, meaning that it must provide the following methods:
Task::getResult()
. See the Resultable Interface.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.