-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
For the following discussion I use Instrument Collection to refer to InstrumentTree
, DetectorInfo
and SpectrumInfo
InstrumentTree
,DetectorInfo
andSpectrumInfo
should not know how to create each other. That would severely limit the ability to test each one in isolation. Mixing creational logic with domain logic is also not wise.- Taking
SpectrumInfo
as an example, the heldDetectorInfo
must exist and be in a valid state by the time theSpectrumInfo
constructor completes. We do not want to leak the encapsulated knowledge we see currently done in the Mantid framework, where clients are forced to very that an objectisValid
orisInitialized
before calling it. - Seemingly at odds with the above, from the MPI perspective, ranks are specified per
SpectrumIndex
, and that is a key part of theInstrumentTree
redistribution. The procedure for making the instrument collection, involves extracting those spectrum indexes that should reside on a givenrank
and creating an instrument collection from scratch around it. This supposes that creation happens in the reverse order that we expect, we know the spectrum indexes, so we create theSpectrumInfo
first, and then we create the other held bits.
This is a necessary part of mpi support
SimonHeybrock