Mantid
|
Class to create the box structure of MDWorkspace. More...
#include <MDEventTreeBuilder.h>
Classes | |
struct | Task |
Structure to store the subtask of creating subtree from the range of events. More... | |
struct | TreeWithIndexError |
Public Types | |
using | EventAccessType = DataObjects::EventAccessor |
using | IndexCoordinateSwitcher = typename MDEvent::template AccessFor< EventDistributor > |
enum | WORKER_TYPE { MASTER , SLAVE } |
Public Member Functions | |
TreeWithIndexError | distribute (std::vector< MDEventType< ND > > &mdEvents) |
MDEventTreeBuilder (const int numWorkers, const size_t threshold, const API::BoxController_sptr &bc, const morton_index::MDSpaceBounds< ND > &space) | |
Private Types | |
using | Box = DataObjects::MDBox< MDEvent, ND > |
using | BoxBase = DataObjects::MDBoxBase< MDEvent, ND > |
using | EventDistributor = MDEventTreeBuilder< ND, MDEventType, EventIterator > |
using | GridBox = DataObjects::MDGridBox< MDEvent, ND > |
using | IntT = typename MDEvent::IntT |
using | MDEvent = MDEventType< ND > |
using | MortonT = typename MDEvent::MortonT |
Private Member Functions | |
morton_index::MDCoordinate< ND > | convertToIndex (std::vector< MDEventType< ND > > &mdEvents, const morton_index::MDSpaceBounds< ND > &space) |
void | distributeEvents (Task &tsk, const WORKER_TYPE &wtp) |
Does actual work on creating tasks in MASTER mode and executing tasks in SLAVE mode. More... | |
BoxBase * | doDistributeEvents (std::vector< MDEventType< ND > > &mdEvents) |
std::unique_ptr< Task > | popTask () |
void | pushTask (Task &&tsk) |
void | sortEvents (std::vector< MDEventType< ND > > &mdEvents) |
void | waitAndLaunchSlave () |
Private Attributes | |
const API::BoxController_sptr & | m_bc |
const size_t | m_eventsThreshold |
std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > | m_extents |
std::atomic< bool > | m_masterFinished |
const MortonT | m_mortonMax |
const MortonT | m_mortonMin |
std::mutex | m_mutex |
const int | m_numWorkers |
const morton_index::MDSpaceBounds< ND > & | m_space |
std::queue< Task > | m_tasks |
Class to create the box structure of MDWorkspace.
The algorithm: The MASTER thread starting to build tree structure recursively, if it finds the subtask to distribute N events N < threshold, the it delegates this independent subtask to other tread, syncronisation is implemented with queue and mutex.
ND | :: number of Dimensions |
MDEventType | :: Type of created MDEvent [MDLeanEvent, MDEvent] |
EventIterator | :: Iterator of sorted collection storing the converted events |
Definition at line 29 of file MDEventTreeBuilder.h.
|
private |
Definition at line 34 of file MDEventTreeBuilder.h.
|
private |
Definition at line 33 of file MDEventTreeBuilder.h.
using Mantid::MDAlgorithms::MDEventTreeBuilder< ND, MDEventType, EventIterator >::EventAccessType = DataObjects::EventAccessor |
Definition at line 39 of file MDEventTreeBuilder.h.
|
private |
Definition at line 36 of file MDEventTreeBuilder.h.
|
private |
Definition at line 35 of file MDEventTreeBuilder.h.
using Mantid::MDAlgorithms::MDEventTreeBuilder< ND, MDEventType, EventIterator >::IndexCoordinateSwitcher = typename MDEvent::template AccessFor<EventDistributor> |
Definition at line 40 of file MDEventTreeBuilder.h.
|
private |
Definition at line 31 of file MDEventTreeBuilder.h.
|
private |
Definition at line 30 of file MDEventTreeBuilder.h.
|
private |
Definition at line 32 of file MDEventTreeBuilder.h.
enum Mantid::MDAlgorithms::MDEventTreeBuilder::WORKER_TYPE |
Enumerator | |
---|---|
MASTER | |
SLAVE |
Definition at line 41 of file MDEventTreeBuilder.h.
Mantid::MDAlgorithms::MDEventTreeBuilder< ND, MDEventType, EventIterator >::MDEventTreeBuilder | ( | const int | numWorkers, |
const size_t | threshold, | ||
const API::BoxController_sptr & | bc, | ||
const morton_index::MDSpaceBounds< ND > & | space | ||
) |
Definition at line 96 of file MDEventTreeBuilder.h.
References Mantid::MDAlgorithms::MDEventTreeBuilder< ND, MDEventType, EventIterator >::m_extents.
|
private |
Definition at line 147 of file MDEventTreeBuilder.h.
References Mantid::Geometry::d, and PARALLEL_THREAD_NUMBER.
MDEventTreeBuilder< ND, MDEventType, EventIterator >::TreeWithIndexError Mantid::MDAlgorithms::MDEventTreeBuilder< ND, MDEventType, EventIterator >::distribute | ( | std::vector< MDEventType< ND > > & | mdEvents | ) |
mdEvents | :: events to distribute around the tree |
Definition at line 110 of file MDEventTreeBuilder.h.
|
private |
Does actual work on creating tasks in MASTER mode and executing tasks in SLAVE mode.
Definition at line 217 of file MDEventTreeBuilder.h.
References Mantid::MDAlgorithms::MDEventTreeBuilder< ND, MDEventType, EventIterator >::Task::begin, Mantid::MDAlgorithms::MDEventTreeBuilder< ND, MDEventType, EventIterator >::Task::end, Mantid::MDAlgorithms::MDEventTreeBuilder< ND, MDEventType, EventIterator >::Task::level, Mantid::MDAlgorithms::MDEventTreeBuilder< ND, MDEventType, EventIterator >::Task::lowerBound, Mantid::Geometry::m, Mantid::MDAlgorithms::MDEventTreeBuilder< ND, MDEventType, EventIterator >::Task::maxDepth, and Mantid::MDAlgorithms::MDEventTreeBuilder< ND, MDEventType, EventIterator >::Task::upperBound.
|
private |
|
private |
Definition at line 188 of file MDEventTreeBuilder.h.
|
private |
Definition at line 180 of file MDEventTreeBuilder.h.
|
private |
Definition at line 169 of file MDEventTreeBuilder.h.
|
private |
Definition at line 200 of file MDEventTreeBuilder.h.
Referenced by Mantid::MDAlgorithms::MDEventTreeBuilder< ND, MDEventType, EventIterator >::doDistributeEvents().
|
private |
Definition at line 89 of file MDEventTreeBuilder.h.
|
private |
Definition at line 82 of file MDEventTreeBuilder.h.
|
private |
Definition at line 88 of file MDEventTreeBuilder.h.
Referenced by Mantid::MDAlgorithms::MDEventTreeBuilder< ND, MDEventType, EventIterator >::MDEventTreeBuilder().
|
private |
Definition at line 85 of file MDEventTreeBuilder.h.
|
private |
Definition at line 92 of file MDEventTreeBuilder.h.
|
private |
Definition at line 91 of file MDEventTreeBuilder.h.
|
private |
Definition at line 84 of file MDEventTreeBuilder.h.
|
private |
Definition at line 81 of file MDEventTreeBuilder.h.
|
private |
Definition at line 87 of file MDEventTreeBuilder.h.
|
private |
Definition at line 83 of file MDEventTreeBuilder.h.