Import Geant4 11.4.0 source tree
This commit is contained in:
@@ -1,173 +0,0 @@
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
Example ThreadsafeScorers
|
||||
----------------------------
|
||||
|
||||
This example demonstrates a very simple application where an energy
|
||||
deposit and # of steps is accounted in thread-local (i.e. one instance per
|
||||
thread) hits maps with underlying types of plain-old data (POD) and global
|
||||
(i.e. one instance) hits maps with underlying types of atomics.
|
||||
The example uses a coarse mesh, extensive physics, and step limiters
|
||||
to ensure that there is a higher degree of conflict between threads
|
||||
when updating the scorers to test the robustness of the atomics
|
||||
classes and maximize the compounding of thread-local round-off error.
|
||||
At the end of the simulation, the scorers are printed to
|
||||
"mfd_<DATA_TYPE>_<SCORER_TYPE>.out", where DATA_TYPE is either
|
||||
"tl" (thread-local) or "tg" (thread-global) and SCORER_TYPE is "EnergyDeposit"
|
||||
or "NumberOfSteps". These values are then compared to a thread-global
|
||||
sum of these scorers that were updated via mutex locking. If round-off
|
||||
errors in thread-local EnergyDeposit are present, they can be viewed
|
||||
in "mfd_diff.out" at the end of the simulation
|
||||
|
||||
1- ATOMICS and the ATOMIC SCORERS
|
||||
|
||||
atomics can ONLY handle plain-old data (POD) types, e.g. int, double, etc.
|
||||
The implementation of atomics in compiler-dependent. At the very worst,
|
||||
the performance of an atomic is the same mutex locking.
|
||||
Atomics, in general, are not copy-constructable. This has to do with
|
||||
thread safety (e.g. making a copy while another thread tries to update)
|
||||
This is why atomics cannot be used in STL containers. The implementation
|
||||
in atomic.hh has limited copy-construction and still cannot be used in
|
||||
STL containers. Use these copy-constructors with extreme caution. See
|
||||
opening comments of G4atomic.hh for more details.
|
||||
|
||||
The newly provided classes in this example (G4atomic, G4TAtomicHitsMap, and
|
||||
G4TAtomicHitsCollection) are intended for applications where memory is a
|
||||
greater concern than performance. While atomics generally perform better than
|
||||
mutex locking, the synchronization is not without a cost. However, since
|
||||
the memory consumed by thread-local hits maps scales roughly linearly
|
||||
with the number of threads, simulations with a large number of scoring
|
||||
volumes can decrease simulation time by increasing the number of threads
|
||||
beyond what was previously allowed due to the increase in memory consumption.
|
||||
|
||||
The G4TAtomicHitsMap and G4TAtomicHitsCollection work exactly the same way
|
||||
as the standard G4THitsMap and G4THitsCollection, respectively, with the
|
||||
exception(s) that you should only implement one instance and provide a
|
||||
pointer/reference of that instance to the threads instead of having the
|
||||
threads create them. Additionally, there is no need to include them
|
||||
in the G4Run::Merge().
|
||||
|
||||
2- GEOMETRY DEFINITION
|
||||
|
||||
The geometry is constructed in the TSDetectorConstruction class.
|
||||
The setup consists of a box filling the world. The volume is divided into
|
||||
subregions, where the outermost boxes are a different material. The materials
|
||||
by default are water and boron as these have large scattering cross-sections
|
||||
for neutrons (the default particle).
|
||||
|
||||
3- PHYSICS LIST
|
||||
|
||||
The particle's type and the physic processes which will be available
|
||||
in this example are set are built from a variety of physics constructors.
|
||||
The chosen physics lists are extensive, primarily
|
||||
The constructors are:
|
||||
|
||||
G4EmStandardPhysics_option4
|
||||
G4DecayPhysics
|
||||
G4RadioactiveDecayPhysics
|
||||
G4HadronPhysicsQGSP_BERT_HP
|
||||
G4HadronElasticPhysicsHP
|
||||
G4StepLimiterPhysics
|
||||
G4IonElasticPhysics
|
||||
G4IonBinaryCascadePhysics
|
||||
|
||||
4- ACTION INITALIZATION
|
||||
|
||||
TSActionInitialization, instantiates and registers to Geant4 kernel
|
||||
all user action classes.
|
||||
|
||||
While in sequential mode the action classes are instatiated just once,
|
||||
via invoking the method:
|
||||
TSActionInitialization::Build()
|
||||
in multi-threading mode the same method is invoked for each thread worker
|
||||
and so all user action classes are defined thread-local.
|
||||
|
||||
A run action class is instantiated both thread-local
|
||||
and global that's why its instance is created also in the method
|
||||
TSActionInitialization::BuildForMaster()
|
||||
which is invoked only in multi-threading mode.
|
||||
|
||||
5- PRIMARY GENERATOR
|
||||
|
||||
The primary generator is defined in the TSPrimaryGeneratorAction class.
|
||||
The default kinematics is a 1 MeV neutron, randomly distributed in front
|
||||
of the target across 100% of the transverse (X,Y) target size.
|
||||
This default setting can be changed via the Geant4 built-in commands
|
||||
of the G4ParticleGun class.
|
||||
|
||||
6- DETECTOR RESPONSE
|
||||
|
||||
This example demonstrates a scoring implemented
|
||||
in the user action classes and TSRun object.
|
||||
|
||||
The energy deposited is collected per event in the PrimitiveScorer
|
||||
G4PSEnergyDeposit (as part of a MultiFunctionalDetector)
|
||||
and the thread-local version are merged at the end of the run.
|
||||
|
||||
The number of steps is collected per event in the PrimativeScorer
|
||||
G4PSNoOfSteps and the thread-local version are merged at the end of the run.
|
||||
|
||||
When the MFD is recording an event i.e. TSRun::RecordEvent(const G4Event*),
|
||||
the global atomic hits map adds the same hits collections
|
||||
|
||||
In multi-threading mode the energy accumulated in TSRun MFD object per
|
||||
workers is merged to the master in TSRun::Merge().
|
||||
|
||||
TSRun contains five hits collections types:
|
||||
1) a thread-local hits map,
|
||||
2) a global atomic hits map
|
||||
3) a global "mutex" hits map
|
||||
4) a global G4StatAnalysis hits deque
|
||||
5) a global G4ConvergenceTester hits deque
|
||||
|
||||
The thread-local hits map is the same as you will find in many other
|
||||
examples.
|
||||
|
||||
The atomics hits map is the purpose of this example. Code-wise, the
|
||||
implementation looks extremely similar to the thread-local version with
|
||||
3 primary exceptions:
|
||||
(1) construction - there should only be one instance so it should be a
|
||||
static member variable or a pointer/reference to a single instance
|
||||
(2) It does not need to, nor should be, summed in G4Run::Merge()
|
||||
(3) destruction -- it should only be cleared by the master thread since
|
||||
there is only one instance.
|
||||
|
||||
The "mutex" hits map is also included as reference for checking the results
|
||||
accumulated by the thread-local hits maps and atomic hits maps. The
|
||||
differences w.r.t. this hits maps are computed in
|
||||
TSRunAction::EndOfRunAction
|
||||
|
||||
The "G4StatAnalysis" and "G4ConvergenceTester" hits deques are
|
||||
memory-efficient version of the standard G4THitsMap. While maps are
|
||||
ideal for scoring at the G4Event-level, where sparsity w.r.t. indices
|
||||
is common; at the G4Run-level, these data structures require much
|
||||
less memory overhead. Due to a lack of
|
||||
G4ConvergenceTester::operator+=(G4ConvergenceTester), the static version
|
||||
of G4ConvergenceTester is the only valid way to use G4ConvergenceTester
|
||||
in a scoring container. This is not the case for G4StatAnalysis, which
|
||||
can be used in lieu of G4double.
|
||||
|
||||
7- HOW TO RUN
|
||||
|
||||
- Execute ts_scorers in the 'interactive mode' with visualization:
|
||||
% ./ts_scorers
|
||||
and type in the commands from run.mac line by line:
|
||||
Idle> /control/verbose 2
|
||||
Idle> /tracking/verbose 1
|
||||
Idle> /run/beamOn 10
|
||||
Idle> ...
|
||||
Idle> exit
|
||||
or
|
||||
Idle> /control/execute run.mac
|
||||
....
|
||||
Idle> exit
|
||||
|
||||
- Execute ts_scorers in the 'batch' mode from macro files
|
||||
(without visualization)
|
||||
% ./ts_scorers run.mac
|
||||
% ./ts_scorers run.mac > run.out
|
||||
+11
-20
@@ -1,8 +1,4 @@
|
||||
|
||||
///\file "parallel/ThreadsafeScorers/.README.txt"
|
||||
///\brief Threadsafe Scorers README page
|
||||
|
||||
/*! \page ExampleThreadsafeScorers Example ThreadsafeScorers
|
||||
\page ExampleThreadsafeScorers Example ThreadsafeScorers
|
||||
|
||||
This example demonstrates a very simple application where an energy
|
||||
deposit and # of steps is accounted in thread-local (i.e. one instance per
|
||||
@@ -13,15 +9,15 @@
|
||||
when updating the scorers to test the robustness of the atomics
|
||||
classes and maximize the compounding of thread-local round-off error.
|
||||
|
||||
At the end of the simulation, the scorers are printed to
|
||||
"mfd_<DATA_TYPE>_<SCORER_TYPE>.out", where DATA_TYPE is either
|
||||
At the end of the simulation, the scorers are printed to
|
||||
"mfd_DATA_TYPE_SCORER_TYPE.out", where DATA_TYPE is either
|
||||
"tl" (thread-local) or "tg" (thread-global) and SCORER_TYPE is "EnergyDeposit"
|
||||
or "NumberOfSteps". These values are then compared to a thread-global
|
||||
sum of these scorers that were updated via mutex locking. If round-off
|
||||
errors in thread-local EnergyDeposit are present, they can be viewed
|
||||
in "mfd_diff.out" at the end of the simulation
|
||||
|
||||
\section ThreadsafeScorers_s1 ATOMICS and the ATOMIC SCORERS
|
||||
## ATOMICS and the ATOMIC SCORERS
|
||||
|
||||
atomics can ONLY handle plain-old data (POD) types, e.g. int, double, etc.
|
||||
The implementation of atomics in compiler-dependent. At the very worst,
|
||||
@@ -41,10 +37,7 @@
|
||||
with the number of threads, simulations with a large number of scoring
|
||||
volumes can decrease simulation time by increasing the number of threads
|
||||
beyond what was previously allowed due to the increase in memory consumption.
|
||||
***************************************************************************
|
||||
*** These classes are intended to be included in the Geant4 source code ***
|
||||
*** release next year ***
|
||||
***************************************************************************
|
||||
These classes are intended to be included in the Geant4 source code.
|
||||
|
||||
The G4TAtomicHitsMap and G4TAtomicHitsCollection work exactly the same way
|
||||
as the standard G4THitsMap and G4THitsCollection, respectively, with the
|
||||
@@ -53,7 +46,7 @@
|
||||
threads create them. Additionally, there is no need to include them
|
||||
in the G4Run::Merge().
|
||||
|
||||
\section ThreadsafeScorers_s2 GEOMETRY DEFINITION
|
||||
## GEOMETRY DEFINITION
|
||||
|
||||
The geometry is constructed in the TSDetectorConstruction class.
|
||||
The setup consists of a box filling the world. The volume is divided into
|
||||
@@ -61,7 +54,7 @@
|
||||
by default are water and boron as these have large scattering cross-sections
|
||||
for neutrons (the default particle).
|
||||
|
||||
\section ThreadsafeScorers_s3 PHYSICS LIST
|
||||
## PHYSICS LIST
|
||||
|
||||
The particle's type and the physic processes which will be available
|
||||
in this example are set are built from a variety of physics constructors.
|
||||
@@ -77,7 +70,7 @@
|
||||
- G4IonElasticPhysics
|
||||
- G4IonBinaryCascadePhysics
|
||||
|
||||
\section ThreadsafeScorers_s4 ACTION INITALIZATION
|
||||
## ACTION INITALIZATION
|
||||
|
||||
TSActionInitialization, instantiates and registers to Geant4 kernel
|
||||
all user action classes.
|
||||
@@ -93,7 +86,7 @@
|
||||
TSActionInitialization::BuildForMaster()
|
||||
which is invoked only in multi-threading mode.
|
||||
|
||||
\section ThreadsafeScorers_s5 PRIMARY GENERATOR
|
||||
## PRIMARY GENERATOR
|
||||
|
||||
The primary generator is defined in the TSPrimaryGeneratorAction class.
|
||||
The default kinematics is a 1 MeV neutron, randomly distributed in front
|
||||
@@ -101,7 +94,7 @@
|
||||
This default setting can be changed via the Geant4 built-in commands
|
||||
of the G4ParticleGun class.
|
||||
|
||||
\section ThreadsafeScorers_s6 DETECTOR RESPONSE
|
||||
## DETECTOR RESPONSE
|
||||
|
||||
This example demonstrates a scoring implemented
|
||||
in the user action classes and TSRun object.
|
||||
@@ -156,7 +149,7 @@
|
||||
in a scoring container. This is not the case for G4StatAnalysis, which
|
||||
can be used in lieu of G4double.
|
||||
|
||||
\section ThreadsafeScorers_s7 HOW TO RUN
|
||||
## HOW TO RUN
|
||||
|
||||
- Execute ts_scorers in the 'interactive mode' with visualization:
|
||||
|
||||
@@ -182,5 +175,3 @@
|
||||
% ./ts_scorers run.mac
|
||||
% ./ts_scorers run.mac > run.out
|
||||
|
||||
*/
|
||||
|
||||
@@ -23,12 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file parallel/ThreadsafeScorers/include/G4TAtomicHitsCollection.hh
|
||||
/// \file G4TAtomicHitsCollection.hh
|
||||
/// \brief Definition of the G4TAtomicHitsCollection class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
///
|
||||
/// This is an implementation of G4THitsCollection<T> where the underlying
|
||||
/// type is G4atomic<T>, not just T. A static assert is provided to
|
||||
/// ensure that T is fundamental. This class should be used in lieu
|
||||
@@ -55,15 +52,15 @@
|
||||
#include <deque>
|
||||
#include <type_traits>
|
||||
|
||||
// class description:
|
||||
//
|
||||
// This is a template class of hits collection and parametrized by
|
||||
// The concrete class of G4VHit. This is a uniform collection for
|
||||
// a particular concrete hit class objects.
|
||||
// An intermediate layer class G4HitsCollection appeared in this
|
||||
// header file is used just for G4Allocator, because G4Allocator
|
||||
// cannot be instansiated with a template class. Thus G4HitsCollection
|
||||
// class MUST NOT be directly used by the user.
|
||||
/// class description:
|
||||
///
|
||||
/// This is a template class of hits collection and parametrized by
|
||||
/// The concrete class of G4VHit. This is a uniform collection for
|
||||
/// a particular concrete hit class objects.
|
||||
/// An intermediate layer class G4HitsCollection appeared in this
|
||||
/// header file is used just for G4Allocator, because G4Allocator
|
||||
/// cannot be instansiated with a template class. Thus G4HitsCollection
|
||||
/// class MUST NOT be directly used by the user.
|
||||
|
||||
/*class G4HitsCollection : public G4VHitsCollection
|
||||
{
|
||||
|
||||
@@ -23,12 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file parallel/ThreadsafeScorers/include/G4TAtomicHitsMap.hh
|
||||
/// \file G4TAtomicHitsMap.hh
|
||||
/// \brief Definition of the G4TAtomicHitsMap class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
///
|
||||
/// This is an implementation of G4THitsMap<T> where the underlying
|
||||
/// type is G4atomic<T>, not just T. A static assert is provided to
|
||||
/// ensure that T is fundamental. This class should be used in lieu
|
||||
@@ -55,15 +52,15 @@
|
||||
#include <map>
|
||||
#include <type_traits>
|
||||
|
||||
// class description:
|
||||
//
|
||||
// This is a template class of hits map and parametrized by
|
||||
// The concrete class of G4VHit. This is a uniform collection for
|
||||
// a particular concrete hit class objects.
|
||||
// An intermediate layer class G4HitsMap appeared in this
|
||||
// header file is used just for G4Allocator, because G4Allocator
|
||||
// cannot be instansiated with a template class. Thus G4HitsMap
|
||||
// class MUST NOT be directly used by the user.
|
||||
/// class description:
|
||||
///
|
||||
/// This is a template class of hits map and parametrized by
|
||||
/// The concrete class of G4VHit. This is a uniform collection for
|
||||
/// a particular concrete hit class objects.
|
||||
/// An intermediate layer class G4HitsMap appeared in this
|
||||
/// header file is used just for G4Allocator, because G4Allocator
|
||||
/// cannot be instansiated with a template class. Thus G4HitsMap
|
||||
/// class MUST NOT be directly used by the user.
|
||||
|
||||
template<typename T>
|
||||
class G4TAtomicHitsMap : public G4VHitsCollection
|
||||
|
||||
@@ -23,12 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file parallel/ThreadsafeScorers/include/G4atomic.hh
|
||||
/// \file G4atomic.hh
|
||||
/// \brief Definition of the G4atomic class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
///
|
||||
/// This is an friendly implementation of the STL atomic class.
|
||||
/// This class has the same interface as the STL atomic but can be used
|
||||
/// in an extremely similar fashion to plain old data (POD) types.
|
||||
@@ -41,6 +38,7 @@
|
||||
/// only used as a RHS term outside of the multithreaded operations on it.
|
||||
///
|
||||
/// FOR EXAMPLE:
|
||||
/// ```
|
||||
/// Proper use:
|
||||
/// Goal: sum energy deposited in run
|
||||
/// Impl: Is a member variable of derived
|
||||
@@ -59,6 +57,7 @@
|
||||
/// sum, sum_sq, and counts are updated by another thread
|
||||
/// while error is being calculated, i.e. they are used as
|
||||
/// RHS terms
|
||||
/// ```
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,12 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file parallel/ThreadsafeScorers/include/G4atomic_defines.hh
|
||||
/// \brief Definition of the G4atomic_defines class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
/// \file G4atomic_defines.hh
|
||||
/// \brief Definition of the atomics utilities
|
||||
///
|
||||
/// This is a functional class for G4atomic. The functions in this
|
||||
/// file are not intended to be used outside of their implementation
|
||||
/// in G4atomic.
|
||||
|
||||
@@ -23,12 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file parallel/ThreadsafeScorers/include/TSActionInitialization.hh
|
||||
/// \file TSActionInitialization.hh
|
||||
/// \brief Definition of the TSActionInitialization class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
///
|
||||
/// Standard ActionInitialization class creating a RunAction instance for the
|
||||
/// master thread and RunAction and PrimaryGeneratorAction instances for
|
||||
/// the worker threads
|
||||
|
||||
@@ -23,12 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file parallel/ThreadsafeScorers/include/TSDetectorConstruction.hh
|
||||
/// \file TSDetectorConstruction.hh
|
||||
/// \brief Definition of the TSDetectorConstruction class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
///
|
||||
/// Construction of a target material (default = boron) surrounded by a
|
||||
/// casing material (default = water) and a vacuum world (default =
|
||||
/// target and casing fill world). The target + casing is brick
|
||||
@@ -36,12 +33,14 @@
|
||||
/// in each dimension. The end sections in each dimension
|
||||
/// is set to the casing. So a fTargetSections = G4ThreeVector(3, 3, 3)
|
||||
/// would be one section of boron and 8 sections of water.
|
||||
///
|
||||
/// The idea behind this geometry is just to create a simple geometry that
|
||||
/// scatters and produces a lot neutrons with a minimal number of sections
|
||||
/// (i.e. coarse meshing) such that the contention in operating on
|
||||
/// the atomic hits maps is higher and round-off errors in the
|
||||
/// thread-local hits maps are detectable (printed out in TSRunAction)
|
||||
/// from the sheer number of floating point sum operations.
|
||||
///
|
||||
/// Two scorers are implemented: EnergyDeposit and Number of steps
|
||||
/// The energy deposit is to (possibly) show the round-off error seen
|
||||
/// with thread-local hits maps. The # of steps scorer is to verify
|
||||
|
||||
@@ -23,12 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file parallel/ThreadsafeScorers/include/TSPhysicsList.hh
|
||||
/// \file TSPhysicsList.hh
|
||||
/// \brief Definition of the TSPhysicsList class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
///
|
||||
/// This is a very, very extensive physics list and step-limiters are applied
|
||||
/// to many particles. The reasoning behind this is because we wan't to put
|
||||
/// as much pressure on the atomics as possible and produce as much
|
||||
|
||||
@@ -23,12 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file parallel/ThreadsafeScorers/include/TSPrimaryGeneratorAction.hh
|
||||
/// \file TSPrimaryGeneratorAction.hh
|
||||
/// \brief Definition of the TSPrimaryGeneratorAction class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
///
|
||||
/// Simple PrimaryGeneratorAction that produces a -Z surface flux of 1 MeV
|
||||
/// neutrons into the world
|
||||
//
|
||||
|
||||
@@ -23,12 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file parallel/ThreadsafeScorers/include/TSRun.hh
|
||||
/// \file TSRun.hh
|
||||
/// \brief Definition of the TSRun class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
///
|
||||
/// TSRun contains three collections of hits maps: a thread-local hits map,
|
||||
/// a global atomic hits map (implemented as a static since TSRun is
|
||||
/// implemented as a thread-local instance), and a global "mutex" hits map
|
||||
@@ -42,6 +39,7 @@
|
||||
/// for instance); (2) It does not need to, nor should be, summed in
|
||||
/// G4Run::Merge(); and (3) destruction -- it should only be cleared by
|
||||
/// the master thread since there is only one instance.
|
||||
///
|
||||
/// A "mutex" hits map is also included as reference for checking the results
|
||||
/// accumulated by the thread-local hits maps and atomic hits maps. The
|
||||
/// differences w.r.t. this hits maps are computed in
|
||||
|
||||
@@ -23,16 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file parallel/ThreadsafeScorers/include/TSRunAction.hh
|
||||
/// \file TSRunAction.hh
|
||||
/// \brief Definition of the TSRunAction class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef tsrunaction_hh
|
||||
#define tsrunaction_hh 1
|
||||
|
||||
@@ -23,12 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file parallel/ThreadsafeScorers/src/TSActionInitialization.cc
|
||||
/// \file TSActionInitialization.cc
|
||||
/// \brief Implementation of the TSActionInitialization class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
///
|
||||
/// Standard ActionInitialization class creating a RunAction instance for the
|
||||
/// master thread and RunAction and PrimaryGeneratorAction instances for
|
||||
/// the worker threads
|
||||
|
||||
@@ -23,12 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file parallel/ThreadsafeScorers/src/TSDetectorConstruction.cc
|
||||
/// \file TSDetectorConstruction.cc
|
||||
/// \brief Implementation of the TSDetectorConstruction class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
///
|
||||
/// Construction of a target material (default = boron) surrounded by a
|
||||
/// casing material (default = water) and a vacuum world (default =
|
||||
/// target and casing fill world). The target + casing is brick
|
||||
@@ -36,12 +33,14 @@
|
||||
/// in each dimension. The end sections in each dimension
|
||||
/// is set to the casing. So a fTargetSections = G4ThreeVector(3, 3, 3)
|
||||
/// would be one section of boron and 8 sections of water.
|
||||
///
|
||||
/// The idea behind this geometry is just to create a simple geometry that
|
||||
/// scatters and produces a lot neutrons with a minimal number of sections
|
||||
/// (i.e. coarse meshing) such that the contention in operating on
|
||||
/// the atomic hits maps is higher and round-off errors in the
|
||||
/// thread-local hits maps are detectable (printed out in TSRunAction)
|
||||
/// from the sheer number of floating point sum operations.
|
||||
///
|
||||
/// Two scorers are implemented: EnergyDeposit and Number of steps
|
||||
/// The energy deposit is to (possibly) show the round-off error seen
|
||||
/// with thread-local hits maps. The # of steps scorer is to verify
|
||||
|
||||
@@ -23,12 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file parallel/ThreadsafeScorers/src/TSPhysicsList.cc
|
||||
/// \file TSPhysicsList.cc
|
||||
/// \brief Implementation of the TSPhysicsList class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
///
|
||||
/// This is a very, very extensive physics list and step-limiters are applied
|
||||
/// to many particles. The reasoning behind this is because we wan't to put
|
||||
/// as much pressure on the atomics as possible and produce as much
|
||||
|
||||
@@ -23,12 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file parallel/ThreadsafeScorers/src/TSPrimaryGeneratorAction.cc
|
||||
/// \file TSPrimaryGeneratorAction.cc
|
||||
/// \brief Implementation of the TSPrimaryGeneratorAction class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
///
|
||||
/// Simple PrimaryGeneratorAction that produces a -Z surface flux of 1 MeV
|
||||
/// neutrons into the world
|
||||
//
|
||||
|
||||
@@ -23,18 +23,15 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file parallel/ThreadsafeScorers/src/TSRun.cc
|
||||
/// \file TSRun.cc
|
||||
/// \brief Implementation of the TSRun class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
///
|
||||
/// TSRun contains five hits collections types:
|
||||
/// 1) a thread-local hits map,
|
||||
/// 2) a global atomic hits map
|
||||
/// 3) a global "mutex" hits map
|
||||
/// 4) a global G4StatAnalysis hits deque
|
||||
/// 5) a global G4ConvergenceTester hits deque
|
||||
/// - 1) a thread-local hits map,
|
||||
/// - 2) a global atomic hits map
|
||||
/// - 3) a global "mutex" hits map
|
||||
/// - 4) a global G4StatAnalysis hits deque
|
||||
/// - 5) a global G4ConvergenceTester hits deque
|
||||
///
|
||||
/// The thread-local hits map is the same as you will find in many other
|
||||
/// examples.
|
||||
@@ -42,11 +39,11 @@
|
||||
/// The atomics hits map is the purpose of this example. Code-wise, the
|
||||
/// implementation looks extremely similar to the thread-local version with
|
||||
/// 3 primary exceptions:
|
||||
/// (1) construction - there should only be one instance so it should be a
|
||||
/// static member variable or a pointer/reference to a single instance
|
||||
/// (2) It does not need to, nor should be, summed in G4Run::Merge()
|
||||
/// (3) destruction -- it should only be cleared by the master thread since
|
||||
/// there is only one instance.
|
||||
/// - (1) construction - there should only be one instance so it should be a
|
||||
/// static member variable or a pointer/reference to a single instance
|
||||
/// - (2) It does not need to, nor should be, summed in G4Run::Merge()
|
||||
/// - (3) destruction -- it should only be cleared by the master thread since
|
||||
/// there is only one instance.
|
||||
///
|
||||
/// The "mutex" hits map is also included as reference for checking the results
|
||||
/// accumulated by the thread-local hits maps and atomic hits maps. The
|
||||
|
||||
@@ -23,16 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file parallel/ThreadsafeScorers/src/TSRunAction.cc
|
||||
/// \file TSRunAction.cc
|
||||
/// \brief Implementation of the TSRunAction class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "TSRunAction.hh"
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,12 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file parallel/ThreadsafeScorers/ts_scorers.cc
|
||||
/// \brief Main of the ThreadsafeScorers example
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
/// \file ts_scorers.cc
|
||||
/// \brief Main program of the parallel/ThreadsafeScorers example
|
||||
///
|
||||
/// ts_scorers example shows how to use global scorers. The benefit of using
|
||||
/// global scorers in memory-savings for problems with very large amounts
|
||||
/// of scoring volumes. Additionally, the global scorers are more precise
|
||||
|
||||
Reference in New Issue
Block a user