Import Geant4 10.5.0.beta source tree
This commit is contained in:
+31
-6
@@ -1,4 +1,4 @@
|
||||
$Id: History 110119 2018-05-15 12:22:31Z gcosmo $
|
||||
$Id: History 110726 2018-06-11 06:05:16Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,25 +17,50 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
April 3, 2018, M. Asai (run-V10-03-19)
|
||||
June 8th, 2018, J. Madsen (run-V10-04-09)
|
||||
- Fixed compilation warnings related to TIMEMORY_AUTO_TIMER macros on Windows
|
||||
|
||||
June 6th, 2018, J. Madsen (run-V10-04-08)
|
||||
- Added TiMemory auto-timer macros to some key functions in
|
||||
G4RunManager, G4RunManagerKernel, G4MTRunManager, and G4MTRunManagerKernel
|
||||
- Added TiMemory libraries and includes to sources.cmake
|
||||
|
||||
May 17th, 2018, J. Madsen (run-V10-04-07)
|
||||
- updated "thread-local-static-var" model to
|
||||
"function-returning-thread-local-static-reference" model
|
||||
which fixes Windows DLL + MT
|
||||
|
||||
April 3, 2018, M. Asai (run-V10-04-06)
|
||||
- G4ExceptionHandler: Add track/step/volume information when
|
||||
exception happens while event is in process.
|
||||
|
||||
February 27, 2018, G. Cosmo (run-V10-03-18)
|
||||
February 27, 2018, G. Cosmo (run-V10-04-05)
|
||||
- G4RunManagerKernel: updated also MT banner.
|
||||
|
||||
February 26, 2018, M. Asai
|
||||
February 26, 2018, M. Asai (run-V10-04-04)
|
||||
- G4RunManagerKernel: two general papers are added to the banner.
|
||||
|
||||
February 9, 2018, M. Asai (run-V10-03-17)
|
||||
February 21 2018 Jonathan Madsen (run-V10-04-03)
|
||||
- Replace pthread-style <void*(void*)> function signatures with
|
||||
<void(G4WorkerThread*)> as it is now unnecessary
|
||||
|
||||
February 12 2018 Jonathan Madsen (run-V10-04-02)
|
||||
- Removed WIN32 conditional for G4THREADCREATE in
|
||||
G4UnserWorkerThreadInitialization (no longer needed)
|
||||
- Changed G4Thread to G4NativeThread when setting pin affinity in
|
||||
G4WorkerThread
|
||||
|
||||
February 9, 2018, M. Asai (run-V10-04-01)
|
||||
- G4RunManagerKernel.cc :
|
||||
Application state is set to G4State_Init while application is in
|
||||
RunInitialization().
|
||||
- Co-working with global-V10-04-01.
|
||||
|
||||
December 26, 2017, M. Asai
|
||||
December 26, 2017, M. Asai (run-V10-04-00)
|
||||
- G4UserPhysicsListMessenger :
|
||||
UI command returns an error message if a command is refused due
|
||||
to incorrect parameter(s).
|
||||
- This tag requires intercoms-V10-04-01 tag.
|
||||
|
||||
November 21, 2017, G. Cosmo (run-V10-03-16)
|
||||
- Fixed compilation warning on clang compiler.
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ExceptionHandler.hh 110119 2018-05-15 12:22:31Z gcosmo $
|
||||
// $Id: G4ExceptionHandler.hh 109231 2018-04-05 06:57:57Z gcosmo $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -73,7 +73,7 @@ public: // with descroption
|
||||
// This static method is used to start a worker thread.
|
||||
// Virtual methods to be invoked from this methos are
|
||||
// defined in G4UserWorkerInitialization class.
|
||||
static void* StartThread(void* context);
|
||||
static void StartThread(G4WorkerThread* context);
|
||||
|
||||
//private:
|
||||
// static void ReinitializeGeometry();
|
||||
|
||||
@@ -11,12 +11,13 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: sources.cmake 103803 2017-04-27 14:03:05Z gcosmo $
|
||||
# $Id: sources.cmake 110673 2018-06-07 10:28:33Z gcosmo $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# List external includes needed.
|
||||
include_directories(${CLHEP_INCLUDE_DIRS})
|
||||
include_directories(${TiMemory_INCLUDE_DIRS})
|
||||
|
||||
# List internal includes needed.
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/digits_hits/detector/include)
|
||||
@@ -178,6 +179,7 @@ GEANT4_DEFINE_MODULE(NAME G4run
|
||||
G4track
|
||||
G4tracking
|
||||
LINK_LIBRARIES
|
||||
${TiMemory_LIBRARIES}
|
||||
)
|
||||
|
||||
# List any source specific properties here
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ExceptionHandler.cc 110119 2018-05-15 12:22:31Z gcosmo $
|
||||
// $Id: G4ExceptionHandler.cc 109231 2018-04-05 06:57:57Z gcosmo $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "G4ProductionCutsTable.hh"
|
||||
#include "G4Timer.hh"
|
||||
#include "G4TiMemory.hh"
|
||||
|
||||
G4ScoringManager* G4MTRunManager::masterScM = 0;
|
||||
G4MTRunManager::masterWorlds_t G4MTRunManager::masterWorlds = G4MTRunManager::masterWorlds_t();
|
||||
@@ -255,6 +256,7 @@ void G4MTRunManager::CreateAndStartWorkers()
|
||||
|
||||
void G4MTRunManager::InitializeEventLoop(G4int n_event, const char* macroFile, G4int n_select)
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
MTkernel->SetUpDecayChannels();
|
||||
numberOfEventToBeProcessed = n_event;
|
||||
numberOfEventProcessed = 0;
|
||||
|
||||
@@ -102,7 +102,7 @@ G4ThreadLocal G4WorkerThread* G4MTRunManagerKernel::wThreadContext = 0;
|
||||
G4WorkerThread* G4MTRunManagerKernel::GetWorkerThread()
|
||||
{ return wThreadContext; }
|
||||
|
||||
void* G4MTRunManagerKernel::StartThread(void* context)
|
||||
void G4MTRunManagerKernel::StartThread(G4WorkerThread* context)
|
||||
{
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//!!!!!! IMPORTANT !!!!!!!!!
|
||||
@@ -118,7 +118,7 @@ void* G4MTRunManagerKernel::StartThread(void* context)
|
||||
// turnontpmalloc();
|
||||
//#endif
|
||||
G4Threading::WorkerThreadJoinsPool();
|
||||
wThreadContext = static_cast<G4WorkerThread*>(context);
|
||||
wThreadContext = context;
|
||||
G4MTRunManager* masterRM = G4MTRunManager::GetMasterRunManager();
|
||||
|
||||
|
||||
@@ -216,7 +216,6 @@ void* G4MTRunManagerKernel::StartThread(void* context)
|
||||
wThreadContext = 0;
|
||||
|
||||
G4Threading::WorkerThreadLeavesPool();
|
||||
return static_cast<void*>(0);
|
||||
}
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunManager.cc 103291 2017-03-24 14:00:49Z gcosmo $
|
||||
// $Id: G4RunManager.cc 110726 2018-06-11 06:05:16Z gcosmo $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
#include "G4ProductionCutsTable.hh"
|
||||
#include "G4ParallelWorldProcessStore.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4TiMemory.hh"
|
||||
#include <sstream>
|
||||
|
||||
|
||||
@@ -116,6 +117,7 @@ G4RunManager::G4RunManager()
|
||||
randomNumberStatusForThisRun = oss.str();
|
||||
randomNumberStatusForThisEvent = oss.str();
|
||||
runManagerType = sequentialRM;
|
||||
InitializeTiMemory();
|
||||
}
|
||||
|
||||
G4RunManager::G4RunManager( RMType rmType )
|
||||
@@ -178,6 +180,7 @@ G4RunManager::G4RunManager( RMType rmType )
|
||||
G4Random::saveFullState(oss);
|
||||
randomNumberStatusForThisRun = oss.str();
|
||||
randomNumberStatusForThisEvent = oss.str();
|
||||
InitializeTiMemory();
|
||||
}
|
||||
|
||||
G4RunManager::~G4RunManager()
|
||||
@@ -261,6 +264,7 @@ void G4RunManager::DeleteUserInitializations()
|
||||
|
||||
void G4RunManager::BeamOn(G4int n_event,const char* macroFile,G4int n_select)
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
if(n_event<=0) { fakeRun = true; }
|
||||
else { fakeRun = false; }
|
||||
G4bool cond = ConfirmBeamOnCondition();
|
||||
@@ -312,6 +316,7 @@ void G4RunManager::RunInitialization()
|
||||
{
|
||||
if(!(kernel->RunInitialization(fakeRun))) return;
|
||||
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
runAborted = false;
|
||||
numberOfEventProcessed = 0;
|
||||
|
||||
@@ -359,6 +364,7 @@ void G4RunManager::RunInitialization()
|
||||
|
||||
void G4RunManager::DoEventLoop(G4int n_event,const char* macroFile,G4int n_select)
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
InitializeEventLoop(n_event,macroFile,n_select);
|
||||
|
||||
// Event loop
|
||||
@@ -395,6 +401,7 @@ void G4RunManager::InitializeEventLoop(G4int n_event,const char* macroFile,G4int
|
||||
|
||||
void G4RunManager::ProcessOneEvent(G4int i_event)
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
currentEvent = GenerateEvent(i_event);
|
||||
eventManager->ProcessOneEvent(currentEvent);
|
||||
AnalyzeEvent(currentEvent);
|
||||
@@ -404,6 +411,7 @@ void G4RunManager::ProcessOneEvent(G4int i_event)
|
||||
|
||||
void G4RunManager::TerminateOneEvent()
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
StackPreviousEvent(currentEvent);
|
||||
currentEvent = 0;
|
||||
numberOfEventProcessed++;
|
||||
@@ -428,6 +436,7 @@ void G4RunManager::TerminateEventLoop()
|
||||
|
||||
G4Event* G4RunManager::GenerateEvent(G4int i_event)
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
if(!userPrimaryGeneratorAction)
|
||||
{
|
||||
G4Exception("G4RunManager::GenerateEvent()", "Run0032", FatalException,
|
||||
@@ -463,6 +472,7 @@ G4Event* G4RunManager::GenerateEvent(G4int i_event)
|
||||
|
||||
void G4RunManager::StoreRNGStatus(const G4String& fnpref)
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
G4String fileN = randomNumberStatusDir + fnpref+".rndm";
|
||||
G4Random::saveEngineStatus(fileN);
|
||||
}
|
||||
@@ -744,6 +754,7 @@ void G4RunManager::ConstructScoringWorlds()
|
||||
G4int nPar = ScM->GetNumberOfMesh();
|
||||
if(nPar<1) return;
|
||||
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
G4ParticleTable::G4PTblDicIterator* theParticleIterator
|
||||
= G4ParticleTable::GetParticleTable()->GetIterator();
|
||||
for(G4int iw=0;iw<nPar;iw++)
|
||||
@@ -799,6 +810,7 @@ void G4RunManager::UpdateScoring()
|
||||
G4int nPar = ScM->GetNumberOfMesh();
|
||||
if(nPar<1) return;
|
||||
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
G4HCofThisEvent* HCE = currentEvent->GetHCofThisEvent();
|
||||
if(!HCE) return;
|
||||
G4int nColl = HCE->GetCapacity();
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunManagerKernel.cc 108682 2018-02-27 07:54:34Z gcosmo $
|
||||
// $Id: G4RunManagerKernel.cc 110726 2018-06-11 06:05:16Z gcosmo $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4Version.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4TiMemory.hh"
|
||||
|
||||
#include "G4MTRunManager.hh"
|
||||
#include "G4AllocatorList.hh"
|
||||
@@ -656,6 +657,7 @@ void G4RunManagerKernel::InitializePhysics()
|
||||
|
||||
G4bool G4RunManagerKernel::RunInitialization(G4bool fakeRun)
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
G4StateManager* stateManager = G4StateManager::GetStateManager();
|
||||
G4ApplicationState currentState = stateManager->GetCurrentState();
|
||||
|
||||
@@ -786,6 +788,7 @@ void G4RunManagerKernel::BuildPhysicsTables(G4bool fakeRun)
|
||||
if( G4ProductionCutsTable::GetProductionCutsTable()->IsModified()
|
||||
|| physicsNeedsToBeReBuilt)
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
#ifdef G4MULTITHREADED
|
||||
if(runManagerKernelType==masterRMK)
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UserPhysicsListMessenger.cc 108540 2018-02-16 09:30:43Z gcosmo $
|
||||
// $Id: G4UserPhysicsListMessenger.cc 108133 2018-01-09 13:25:44Z gcosmo $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -45,11 +45,7 @@ G4Thread* G4UserWorkerThreadInitialization::CreateAndStartWorker(G4WorkerThread*
|
||||
//Note: this method is called by G4MTRunManager, here we are still sequential
|
||||
//Create a new thread/worker structure
|
||||
G4Thread* worker = new G4Thread;
|
||||
#ifdef WIN32
|
||||
G4THREADCREATE(worker, (LPTHREAD_START_ROUTINE)&G4MTRunManagerKernel::StartThread , wTC );
|
||||
#else
|
||||
G4THREADCREATE(worker, &G4MTRunManagerKernel::StartThread , wTC );
|
||||
#endif
|
||||
G4THREADCREATE(worker, &G4MTRunManagerKernel::StartThread, wTC );
|
||||
return worker;
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserPhysicsList.cc 103803 2017-04-27 14:03:05Z gcosmo $
|
||||
// $Id: G4VUserPhysicsList.cc 110264 2018-05-17 14:29:16Z gcosmo $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -244,8 +244,8 @@ void G4VUserPhysicsList::InitializeProcessManager()
|
||||
//Request lock for particle table accesses. Some changes are inside
|
||||
//this critical region.
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXLOCK(&G4ParticleTable::particleTableMutex);
|
||||
G4ParticleTable::lockCount++;
|
||||
G4MUTEXLOCK(&G4ParticleTable::particleTableMutex());
|
||||
G4ParticleTable::lockCount()++;
|
||||
#endif
|
||||
G4ParticleDefinition* gion = G4ParticleTable::GetParticleTable()->GetGenericIon();
|
||||
|
||||
@@ -291,7 +291,7 @@ void G4VUserPhysicsList::InitializeProcessManager()
|
||||
|
||||
//release lock for particle table accesses.
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXUNLOCK(&G4ParticleTable::particleTableMutex);
|
||||
G4MUTEXUNLOCK(&G4ParticleTable::particleTableMutex());
|
||||
#endif
|
||||
// G4cout << "Particle table is released by G4VUserPhysicsList::InitializeProcessManager" << G4endl;
|
||||
|
||||
@@ -303,8 +303,8 @@ void G4VUserPhysicsList::RemoveProcessManager()
|
||||
//Request lock for particle table accesses. Some changes are inside
|
||||
//this critical region.
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXLOCK(&G4ParticleTable::particleTableMutex);
|
||||
G4ParticleTable::lockCount++;
|
||||
G4MUTEXLOCK(&G4ParticleTable::particleTableMutex());
|
||||
G4ParticleTable::lockCount()++;
|
||||
#endif
|
||||
// G4cout << "Particle table is held by G4VUserPhysicsList::InitializeProcessManager" << G4endl;
|
||||
|
||||
@@ -312,7 +312,7 @@ void G4VUserPhysicsList::RemoveProcessManager()
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
if (particle->GetInstanceID() < G4ParticleDefinitionSubInstanceManager::slavetotalspace)
|
||||
if (particle->GetInstanceID() < G4ParticleDefinitionSubInstanceManager::slavetotalspace())
|
||||
{
|
||||
if(particle->GetParticleSubType()!="generic" || particle->GetParticleName()=="GenericIon")
|
||||
{
|
||||
@@ -332,7 +332,7 @@ void G4VUserPhysicsList::RemoveProcessManager()
|
||||
|
||||
//release lock for particle table accesses.
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXUNLOCK(&G4ParticleTable::particleTableMutex);
|
||||
G4MUTEXUNLOCK(&G4ParticleTable::particleTableMutex());
|
||||
#endif
|
||||
// G4cout << "Particle table is released by G4VUserPhysicsList::InitializeProcessManager" << G4endl;
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4VScoringMesh.hh"
|
||||
#include "G4Timer.hh"
|
||||
#include "G4TiMemory.hh"
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
|
||||
@@ -133,6 +134,7 @@ void G4WorkerRunManager::InitializeGeometry() {
|
||||
|
||||
void G4WorkerRunManager::RunInitialization()
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
#ifdef G4MULTITHREADED
|
||||
if(!visIsSetUp)
|
||||
{
|
||||
@@ -204,6 +206,7 @@ void G4WorkerRunManager::RunInitialization()
|
||||
|
||||
void G4WorkerRunManager::DoEventLoop(G4int n_event, const char* macroFile , G4int n_select)
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
if(!userPrimaryGeneratorAction)
|
||||
{
|
||||
G4Exception("G4RunManager::GenerateEvent()", "Run0032", FatalException,
|
||||
@@ -248,6 +251,7 @@ void G4WorkerRunManager::DoEventLoop(G4int n_event, const char* macroFile , G4in
|
||||
|
||||
void G4WorkerRunManager::ProcessOneEvent(G4int i_event)
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
currentEvent = GenerateEvent(i_event);
|
||||
if(eventLoopOnGoing)
|
||||
{
|
||||
@@ -260,6 +264,7 @@ void G4WorkerRunManager::ProcessOneEvent(G4int i_event)
|
||||
|
||||
G4Event* G4WorkerRunManager::GenerateEvent(G4int i_event)
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
G4Event* anEvent = new G4Event(i_event);
|
||||
long s1 = 0;
|
||||
long s2 = 0;
|
||||
@@ -588,6 +593,7 @@ void G4WorkerRunManager::StoreRNGStatus(const G4String& fn )
|
||||
|
||||
void G4WorkerRunManager::DoWork()
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
G4MTRunManager* mrm = G4MTRunManager::GetMasterRunManager();
|
||||
G4MTRunManager::WorkerActionRequest nextAction = mrm->ThisWorkerWaitForNextAction();
|
||||
while( nextAction != G4MTRunManager::WorkerActionRequest::ENDWORKER )
|
||||
|
||||
@@ -229,10 +229,11 @@ void G4WorkerThread::SetPinAffinity(G4int affinity) const
|
||||
}
|
||||
G4cout << "Setting affinity to:" << cpuindex << G4endl;
|
||||
|
||||
#if defined(G4MULTITHREADED) // Avoid compilation warning in C90 standard w/o MT
|
||||
G4Thread t = G4THREADSELF();
|
||||
#if defined(G4MULTITHREADED)
|
||||
// Avoid compilation warning in C90 standard w/o MT
|
||||
G4NativeThread t = pthread_self();
|
||||
#else
|
||||
G4Thread t;
|
||||
G4NativeThread t;
|
||||
#endif
|
||||
G4bool success = G4Threading::G4SetPinAffinity(cpuindex,t);
|
||||
if ( ! success )
|
||||
|
||||
Reference in New Issue
Block a user