Configuration for MultiProcess infrastructure.
This class offers user-accessible configuration of the MultiProcess infrastructure. Since the rest of the MultiProcess classes are only accessible at compile time, a separate class is needed to set configuration. Currently, the configurable parts are:
- the number of workers to be deployed,
- the number of event-tasks in LikelihoodJobs,
- and the number of component-tasks in LikelihoodJobs.
The default number of workers is set using 'std::thread::hardware_concurrency()'. To change it, use 'Config::setDefaultNWorkers()' to set it to a different value before creation of a new JobManager instance. Note that it cannot be set to zero and also cannot be changed after JobManager has been instantiated.
Use Config::getDefaultNWorkers() to access the current value.
Under Config::LikelihoodJob, we find two members for the number of tasks to use to calculate the range of events and components in parallel, respectively: defaultNEventTasks and defaultNComponentTasks. Newly created LikelihoodJobs will then use these values at construction time. Note that (like with the number of workers) the number cannot be changed for an individual LikelihoodJob after it has been created.
Both event- and component-based tasks by default are set to automatic mode using the automaticNEventTasks and automaticNComponentTasks constants (both under Config::LikelihoodJob as well). These are currently set to zero, but this could change. Automatic mode for events means that the number of tasks is set to the number of workers in the JobManager, with events divided equally over workers. For components, the automatic mode uses just 1 task for all components. These automatic modes may change in the future (for instance, we may switch them around).
Under Config::Queue, we can set the desired queue type: FIFO or Priority. This setting is used when a JobManager is spun up, i.e. usually when the first Job starts. At this point, the Queue is also created according to the setting. The default is FIFO. When using a Priority Queue, the priority of tasks in a Job can be set using either setTaskPriorities or suggestTaskOrder. If no priorities are set, the Priority queue simply assumes equal priority for all tasks. The resulting order then depends on the implementation of std::priority_queue.
Definition at line 24 of file Config.h.