Problem 1539

Summary: Extended example OpNovice has G4Exception for 4 or more threads.
Product: Geant4 Reporter: John Watts <john.w.watts>
Component: processes/opticalAssignee: gum
Status: RESOLVED FIXED    
Severity: normal    
Priority: P5    
Version: other   
Hardware: PC   
OS: Linux   
Attachments: tar ball of output

Description John Watts 2013-12-11 18:25:21 CET
When I run the extended optical example, OpNovice, for Geant4.10.00 with more the 3 thread I get G4Exception:

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : TRACK101
      issued by : G4VParticleChange::AddSecondary
Secondary Bug is full. The track is deleted
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW ------

I capture the output from a run with the following command:
../../optical-install/bin/OpNovice -m OpNovice.in -t 4  >output 2>&1
Which redirect G4Err into output.
The beamOn in OpNovice was change to produce 4 event so that there would events on 4 threads.
The number  of exceptions varies from run to run.
When I run 3 thread I don’t get exceptions.
I am running a 64-bit Scientific Linux version 6.4 with gcc 4.4.7. Enclose is a tar ball of the output file. If I remove the optical processes from the physicslist I don't get exceptions.

OpNovice.in:

/control/verbose 2
/tracking/verbose 3
#
/gun/particle e+
/gun/energy 500 keV
#
/run/beamOn 4
#
#/process/inactivate Scintillation
#/OpNovice/phys/verbose 0
#
#/run/beamOn
Comment 1 John Watts 2013-12-11 18:27:30 CET
Created attachment 243 [details]
tar ball of output
Comment 2 gum 2013-12-11 21:02:20 CET
*** Problem 1538 has been marked as a duplicate of this problem. ***
Comment 3 gum 2013-12-18 03:21:34 CET
Thank you for reporting this bug. We are in the process of correcting the 'race condition' in OpNovicePhysicsList with tag OpNovice-V10-00-01. In fact, similar unwanted race conditions exist in G4OpticalPhysics and, to keep the existing functionality, additional changes are necessary in the processes G4Cerenkov, G4Scintillation etc. themselves. The changed code will be available with the first patch01 for release V10.

The origin for the 'race condition' arises from the fact that OpNovicePhysicsList keeps private pointers to physics processes and hence was not correctly migrated to MT.

Thank you again for pointing this out so quickly. For whatever reason this error/race-condition escaped our MT system testing.