Celeritas 0.6.0-dev.115+3b60a5fd
|
Print diagnostic output about what's in what slots. More...
#include <SlotDiagnostic.hh>
Classes | |
struct | State |
Public Member Functions | |
SlotDiagnostic (ActionId action_id, AuxId aux_id, std::string filename_base, size_type num_stream, std::shared_ptr< ParticleParams const > particle) | |
Construct with IDs and filename base. | |
Metadata interface | |
std::string_view | label () const final |
Label for the auxiliary data and action. | |
std::string_view | description () const final |
Label for the auxiliary data and action. | |
Step action interface | |
ActionId | action_id () const final |
Index of this class instance in its registry. | |
StepActionOrder | order () const final |
Index of this class instance in its registry. | |
void | step (CoreParams const ¶ms, CoreStateHost &state) const final |
Execute with with the last action's ID and the state. | |
void | step (CoreParams const ¶ms, CoreStateDevice &state) const final |
Index of this class instance in its registry. | |
Aux params interface | |
AuxId | aux_id () const final |
Index of this class instance in its registry. | |
UPState | create_state (MemSpace m, StreamId id, size_type size) const final |
Build state data for a stream. | |
![]() | |
virtual void | step (P const &, S< MemSpace::host > &) const =0 |
Execute the action with host data. | |
virtual void | step (P const &, S< MemSpace::device > &) const =0 |
Execute the action with device data. | |
![]() | |
virtual | ~ActionInterface () noexcept=0 |
Default destructor. | |
![]() | |
virtual | ~AuxParamsInterface () |
Default destructor. | |
Static Public Member Functions | |
static std::shared_ptr< SlotDiagnostic > | make_and_insert (CoreParams const &core, std::string filename_base) |
Construct and add to core params. | |
Additional Inherited Members | |
![]() | |
using | CoreParams = P |
using | CoreStateHost = S< MemSpace::host > |
using | CoreStateDevice = S< MemSpace::device > |
using | SpanCoreStateHost = Span< S< MemSpace::host > *const > |
using | SpanCoreStateDevice = Span< S< MemSpace::device > *const > |
![]() | |
using | UPState = std::unique_ptr< AuxStateInterface > |
Default destructor. | |
![]() | |
CELER_DEFAULT_COPY_MOVE (ActionInterface) | |
![]() | |
AuxParamsInterface ()=default | |
CELER_DEFAULT_COPY_MOVE (AuxParamsInterface) | |
Default destructor. | |
Print diagnostic output about what's in what slots.
Currently this only prints the particle ID as a function of track slot, which can later be combined with postprocessing data to print the charge of each particle. We could in the future extend the class to use thread ID and/or write action ID or any other ID/status instead. Special IDs are:
-1
: track slot is inactive-2
: track has been flagged as an errorA "JSON lines" file (one line per step) is opened for each stream, and a separate file is opened once during construction to write appropriate metadata.
The filename base is appended with the stream ID or metadata
. If the filename is a directory, that directory must already exist. For example, you could pass a filename base of slot-diag-
to get filenames slot-diag-metadata.json
, slot-diag-0.jsonl
, etc.
scripts/user/plot-slot-diagnostic.py
celeritas::SlotDiagnostic::SlotDiagnostic | ( | ActionId | action_id, |
AuxId | aux_id, | ||
std::string | filename_base, | ||
size_type | num_streams, | ||
std::shared_ptr< ParticleParams const > | particle | ||
) |
Construct with IDs and filename base.
This also writes to the "metadata" JSON suffix.
|
inlinefinalvirtual |
Index of this class instance in its registry.
Implements celeritas::ActionInterface.
|
inlinefinalvirtual |
Index of this class instance in its registry.
Implements celeritas::AuxParamsInterface.
|
finalvirtual |
Build state data for a stream.
Implements celeritas::AuxParamsInterface.
|
inlinefinalvirtual |
Label for the auxiliary data and action.
Implements celeritas::ActionInterface.
|
inlinefinalvirtual |
Label for the auxiliary data and action.
Implements celeritas::ActionInterface.
|
inlinefinalvirtual |
Index of this class instance in its registry.
Implements celeritas::StepActionInterface< P, S >.
|
final |
Execute with with the last action's ID and the state.
This must be called after both create_state
and begin_run
.