I am having an issue with an implementation of force collision biasing (example GB02, but from scratch) when using multiple threads. When run in multithread mode with only one thread running it works fine. When using multiple worker threads it will occasionally tell me things like
G4WT1 > G4VParticleChange::CheckSecondary : the global time of secondary goes back comapared to the parent !! Difference: 7.04569[ns] G4WT1 > neutron E=38.0654 pos=0, 0, 5e-05 time=12.0707 parent time=19.1164 -------- EEEE ------- G4Exception-START -------- EEEE ------- *** G4Exception : TRACK001 issued by : G4VParticleChange::CheckSecondary() Secondary with illegal energy/momentum *** Event Must Be Aborted *** G4WT1 > G4Track (0x2adc00680230) - track ID = 1, parent ID = 0 G4WT1 > Particle type : neutron - creator process : not available G4WT1 > Kinetic energy : 19.9572 MeV - Momentum direction : (0,0,-1) G4WT1 > Step length : 0 fm - total energy deposit : 0 eV G4WT1 > Pre-step point : (0,0,0.05) - Physical volume : targetPhys (HDPE) G4WT1 > - defined by : CoupledTransportation - step status : 1 G4WT1 > Post-step point : (0,0,0.05) - Physical volume : targetPhys (HDPE) G4WT1 > - defined by : biasWrapper(0) - step status : 4 G4WT1 > *** Note: Step information might not be properly updated.
I’m guessing that it is an issue with threads sharing information when they are not supposed to as increasing the number of threads increases the chances of it happening, but looking through the example I don’t see any thread local or static declarations, or anything else that I am missing. Does anyone have any experience with these types of errors when using biasing?