Celeritas  0.5.0-56+6b053cd
Public Member Functions | List of all members
celeritas::Stepper< M > Class Template Referencefinal

Manage a state vector and execute a single step on all of them. More...

#include <Stepper.hh>

Inheritance diagram for celeritas::Stepper< M >:
Inheritance graph
[legend]

Public Types

Type aliases
using StateRef = CoreStateData< Ownership::reference, M >
 
- Public Types inherited from celeritas::StepperInterface
using Input = StepperInput
 
using ActionSequenceT = ActionSequence
 
using SpanConstPrimary = Span< Primary const >
 
using result_type = StepperResult
 
using SPState = std::shared_ptr< CoreStateInterface >
 

Public Member Functions

 Stepper (Input input)
 Construct with problem parameters and setup options.
 
 ~Stepper ()
 Default destructor.
 
void warm_up () final
 Run all step actions with no active particles. More...
 
StepperResult operator() () final
 Transport already-initialized states. More...
 
StepperResult operator() (SpanConstPrimary primaries) final
 Initialize new primaries and transport them for a single step.
 
void kill_active () final
 Kill all tracks in flight to debug "stuck" tracks. More...
 
void reseed (UniqueEventId event_id) final
 Reseed RNGs and counters at the start of an event for reproducibility. More...
 
ActionSequenceT const & actions () const final
 Get action sequence for timing diagnostics.
 
StateRef const & state_ref () const
 Access core data, primarily for debugging.
 
CoreStateInterface const & state () const final
 Get the core state interface for diagnostic output.
 
void reset_state ()
 Reset the core state counters and data so it can be reused.
 
SPState sp_state () final
 Get a shared pointer to the state (TEMPORARY, DO NOT USE)
 

Additional Inherited Members

- Protected Member Functions inherited from celeritas::StepperInterface
 CELER_DEFAULT_COPY_MOVE (StepperInterface)
 

Detailed Description

template<MemSpace M>
class celeritas::Stepper< M >

Manage a state vector and execute a single step on all of them.

Note
This is likely to be removed and refactored since we're changing how primaries are created and how multithread state ownership is managed.
Stepper<MemSpace::host> step(input);
// Transport primaries for the initial step
StepperResult alive_tracks = step(my_primaries);
while (alive_tracks)
{
// Transport secondaries
alive_tracks = step();
}

Member Function Documentation

◆ kill_active()

template<MemSpace M>
void celeritas::Stepper< M >::kill_active
finalvirtual

Kill all tracks in flight to debug "stuck" tracks.

The next "step" will apply the tracking cut and (if CPU) print diagnostic output about the failed tracks.

Implements celeritas::StepperInterface.

◆ operator()()

template<MemSpace M>
auto celeritas::Stepper< M >::operator()
finalvirtual

Transport already-initialized states.

A single transport step is simply a loop over a toplogically sorted DAG of kernels.

Implements celeritas::StepperInterface.

◆ reseed()

template<MemSpace M>
void celeritas::Stepper< M >::reseed ( UniqueEventId  event_id)
finalvirtual

Reseed RNGs and counters at the start of an event for reproducibility.

This reinitializes the RNG states using a single seed and unique subsequence for each thread. It ensures that given an event identification, the random number sequence for the event (and thus the event's behavior) can be reproduced.

Implements celeritas::StepperInterface.

◆ warm_up()

template<MemSpace M>
void celeritas::Stepper< M >::warm_up
finalvirtual

Run all step actions with no active particles.

The warmup stage is useful for profiling and debugging since the first step iteration can do the following:

  • Initialize asynchronous memory pools
  • Interrogate kernel functions for properties to be output later
  • Allocate "lazy" auxiliary data (e.g. action diagnostics)

Implements celeritas::StepperInterface.


The documentation for this class was generated from the following files: