Celeritas 0.7+7c39d13
Loading...
Searching...
No Matches
Functions
Threading.cc File Reference
#include "Threading.hh"
#include <G4Threading.hh>
#include "geocel/GeantUtils.hh"

Functions

StreamId celeritas::geant_main_stream ()
 Get the worker stream ID for the program's main thread (null if MT).
 
StreamId celeritas::geant_stream ()
 Get a stream ID corresponding to the current worker thread.
 
StreamId::size_type celeritas::geant_num_threads ()
 Get the number of threads after initialization.
 

Function Documentation

◆ geant_main_stream()

StreamId celeritas::geant_main_stream ( )

Get the worker stream ID for the program's main thread (null if MT).

This can be compared against geant_stream . In serial execution, the main stream is also a "worker" thread (running events). In MT/tasking, the main stream is a separate manager thread, which does not run events.

◆ geant_stream()

StreamId celeritas::geant_stream ( )

Get a stream ID corresponding to the current worker thread.

The result is null if this is the "master" thread in MT or if the run manager hasn't been started.