Import Geant4 10.7.1 source tree
This commit is contained in:
@@ -16,6 +16,13 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Jan 25th, 2021 Makoto Asai (tasking-V10-06-14)
|
||||
- G4WorkerTaskRunManager.cc : Correct the way to count the number of events
|
||||
processed in a worker thread. This correction also fixes a rare crash due to
|
||||
accessing to the seed vector more than necessary.
|
||||
- G4TaskRunManager.cc : Reduce number of events per task to evenly distribute
|
||||
evnets to all available threads.
|
||||
|
||||
Nov 12th, 2020 Jonathan Madsen (tasking-V10-06-13)
|
||||
- Added G4Profiler support
|
||||
- Removed TIMEMORY_AUTO_TIMER
|
||||
|
||||
@@ -313,6 +313,26 @@ void G4TaskRunManager::ComputeNumberOfTasks()
|
||||
? (numberOfEventToBeProcessed / grainSize)
|
||||
: 1;
|
||||
|
||||
if(eventModuloDef > 0)
|
||||
{ eventModulo = eventModuloDef; }
|
||||
else
|
||||
{
|
||||
eventModulo = G4int(std::sqrt(G4double(numberOfEventToBeProcessed)));
|
||||
if(eventModulo < 1) eventModulo = 1;
|
||||
}
|
||||
if(eventModulo > nEvtsPerTask)
|
||||
{
|
||||
G4int oldMod = eventModulo;
|
||||
eventModulo = nEvtsPerTask;
|
||||
|
||||
G4ExceptionDescription msgd;
|
||||
msgd << "Event modulo is reduced to " << eventModulo << " (was "
|
||||
<< oldMod << ")" << " to distribute events to all threads.";
|
||||
G4Exception("G4TaskRunManager::InitializeEventLoop()", "Run10035",
|
||||
JustWarning, msgd);
|
||||
}
|
||||
nEvtsPerTask = eventModulo;
|
||||
|
||||
if(fakeRun)
|
||||
nEvtsPerTask = G4GetEnv<G4int>(
|
||||
"G4FORCE_EVENTS_PER_TASK", nEvtsPerTask,
|
||||
@@ -510,30 +530,6 @@ void G4TaskRunManager::InitializeEventLoop(G4int n_event, const char* macroFile,
|
||||
// initialize seeds
|
||||
// If user did not implement InitializeSeeds,
|
||||
// use default: nSeedsPerEvent seeds per event
|
||||
if(eventModuloDef > 0)
|
||||
{
|
||||
eventModulo = eventModuloDef;
|
||||
if(eventModulo > numberOfEventsPerTask)
|
||||
{
|
||||
G4int oldMod = eventModulo;
|
||||
eventModulo = numberOfEventsPerTask;
|
||||
if(eventModulo < 1)
|
||||
eventModulo = 1;
|
||||
|
||||
G4ExceptionDescription msgd;
|
||||
msgd << "Event modulo is reduced to " << eventModulo << " (was "
|
||||
<< oldMod << ")"
|
||||
<< " to distribute events to all threads.";
|
||||
G4Exception("G4TaskRunManager::InitializeEventLoop()", "Run10035",
|
||||
JustWarning, msgd);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
eventModulo = G4int(std::sqrt(G4double(numberOfEventsPerTask)));
|
||||
if(eventModulo < 1)
|
||||
eventModulo = 1;
|
||||
}
|
||||
|
||||
if(n_event > 0)
|
||||
{
|
||||
@@ -682,6 +678,7 @@ G4int G4TaskRunManager::SetUpNEvents(G4Event* evt, G4SeedsQueue* seedsQueue,
|
||||
nmod = numberOfEventToBeProcessed - numberOfEventProcessed;
|
||||
}
|
||||
evt->SetEventID(numberOfEventProcessed);
|
||||
|
||||
if(reseedRequired)
|
||||
{
|
||||
G4RNGHelper* helper = G4RNGHelper::GetInstance();
|
||||
|
||||
@@ -223,13 +223,9 @@ void G4WorkerTaskRunManager::DoEventLoop(G4int n_event, const char* macroFile,
|
||||
if(eventLoopOnGoing)
|
||||
{
|
||||
TerminateOneEvent();
|
||||
if(runAborted)
|
||||
eventLoopOnGoing = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
numberOfEventProcessed++;
|
||||
if(runAborted) eventLoopOnGoing = false;
|
||||
}
|
||||
if(!eventLoopOnGoing) break;
|
||||
}
|
||||
|
||||
// TerminateEventLoop();
|
||||
|
||||
Reference in New Issue
Block a user