Problem 2476 - Different behavior of /random/resetEngineFrom in multithreaded mode and sequential mode
Summary: Different behavior of /random/resetEngineFrom in multithreaded mode and seq...
Status: ASSIGNED
Alias: None
Product: Geant4
Classification: Unclassified
Component: global (show other problems)
Version: 11.0
Hardware: PC Linux
: P4 normal
Assignee: Makoto.Asai
URL:
Depends on:
Blocks:
 
Reported: 2022-03-16 15:42 CET by kroehnke
Modified: 2022-12-15 10:48 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description kroehnke 2022-03-16 15:42:57 CET
Hi,
please have a look to this link:
https://geant4-forum.web.cern.ch/t/random-resetenginefrom-does-not-reproduce-same-engine-states/7383

In short, the results of multithreaded mode with only one thread differ to the results in sequential mode.
Executing a macro with these lines:

# run0
/run/beamOn 50
/random/saveThisRun
#
# run1
/run/beamOn 50
/random/saveThisRun
#
# run2 : restart run0
/random/resetEngineFrom run0.rndm
/run/beamOn 50
#
# run3 : restart run1
/random/resetEngineFrom run1.rndm
/run/beamOn 50


The result is in sequential mode as expected. run0 is equal to run2 and run1 is equal to run3.
But in multithreaded mode (with 1 thread) this in not the case. All four runX are different.


In the attached file "output.txt" in line 116 (see link to Geant4 forum above; third post) you can see a change of the random engine state after G4TaskRunManager::CreateAndStartWorkers().
I think there the differences arise.

Best regards
Henning