OpenGATE / Gate

Official public repository of Gate
http://www.opengatecollaboration.org
GNU Lesser General Public License v3.0
236 stars 263 forks source link

Infinite loop/stuck particle in voxelized phantoms with emstandard_opt4 and GATE v9.3 #628

Open cpommranz opened 1 year ago

cpommranz commented 1 year ago

GATE/Geant4 enters an infinite loop when using the emstandard_opt4 physics list for voxelized phantoms. An infinite number of steps with step length 0 and dE 0 is produced (see tracking output below). Geant4 does not detect the stuck particle and does not try to force push it, as it typically does to unstuck particles.

Log output:

[...]


  • G4Track Information: Particle = e-, Track ID = 3, Parent ID = 1

Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName 0 -9.69 2.08 -1.83 0.237 0 0 0 test_voxel_phys_Z initStep 1 -9.86 2.05 -1.8 0.229 0.00721 0.18 0.18 test_voxel_phys_Z msc 2 -10 2.03 -1.77 0.216 0.0133 0.142 0.322 test_voxel_phys_Z msc 3 -10 2.03 -1.77 0.216 3.5e-06 0.00128 0.323 test_voxel_phys_Z msc 4 -10 2.03 -1.77 0.216 8.8e-05 0.00336 0.326 test_voxel_phys_Z Transportation 5 -10 2.03 -1.77 0.216 0 0 0.326 test_voxel_phys_Z eIoni 6 -10 2.03 -1.77 0.216 0 0 0.326 test_voxel_phys_Z eIoni 7 -10 2.03 -1.77 0.216 0 0 0.326 test_voxel_phys_Z eIoni 8 -10 2.03 -1.77 0.216 0 0 0.326 test_voxel_phys_Z eIoni 9 -10 2.03 -1.77 0.216 0 0 0.326 test_voxel_phys_Z eIoni 10 -10 2.03 -1.77 0.216 0 0 0.326 test_voxel_phys_Z eIoni 11 -10 2.03 -1.77 0.216 0 0 0.326 test_voxel_phys_Z eIoni 12 -10 2.03 -1.77 0.216 0 0 0.326 test_voxel_phys_Z eIoni 13 -10 2.03 -1.77 0.216 0 0 0.326 test_voxel_phys_Z eIoni 14 -10 2.03 -1.77 0.216 0 0 0.326 test_voxel_phys_Z eIoni 15 -10 2.03 -1.77 0.216 0 0 0.326 test_voxel_phys_Z eIoni 16 -10 2.03 -1.77 0.216 0 0 0.326 test_voxel_phys_Z eIoni 17 -10 2.03 -1.77 0.216 0 0 0.326 test_voxel_phys_Z eIoni 18 -10 2.03 -1.77 0.216 0 0 0.326 test_voxel_phys_Z eIoni 19 -10 2.03 -1.77 0.216 0 0 0.326 test_voxel_phys_Z eIoni 20 -10 2.03 -1.77 0.216 0 0 0.326 test_voxel_phys_Z eIoni [...]

The issue is gone when switching to the emstandard_opt3 physics list. I cannot reproduce this issue with GATE v9.1 and Geant4 v10.7.2, so it seems to be a recent regression. I'm currently not sure if this issue is related to GATE or rather Geant4 itself. I will investigate further. A minimal working example is available here: minimal_working_example.zip. Please be prepared to kill the process before running the example, as the vast amount of Hits produced in the infinite loop quickly eats up memory.

NikEfth commented 11 months ago

Hi @cpommranz. Your comment helped me a lot in my own situation. I don't have voxelized phantoms, but I noticed the same behaviour starting, at least one year, ago. Probably, a bit more. Using the _opt3 it works fine for me, too. Have you find the source of this regression?

Kind Regards, Nikos

cpommranz commented 11 months ago

Hi @NikEfth. I tested two more configurations:

So, this seems to be a regression in the Geant4 v11.1 series. Please note, that GATE v9.3 is only tested with the Geant4 v11.1 series. It compiles fine against Geant4 v11.2.0, but I haven't run the benchmarks.

NikEfth commented 11 months ago

Thank you. I did as you said and installed geant 11.2 (for the tag v11.2) but unfortunately, the memory leak persists. I think that it is much slower than previously, but I will need to run a full sim to know for sure.