Message: Changing Geometry/Optical Parameters Between Runs: Out of Memory Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Changing Geometry/Optical Parameters Between Runs: Out of Memory 

Forum: Run Management
Date: 25 Jun, 2018
From: Scott Dow <Scott Dow>


So I've been attempting to automate a simulation to have many runs with various 1. dimensions for different volumes and 2. Optical parameters (Rayleigh scattering length, absorption length, etc.) I have been accomplishing this with the following code:

runManager->Initialize(); UImanager->ApplyCommand("/control/execute physics.mac"); //some physics settings

for(G4int i = Start_Run;i<Stop_Run;i++){

        //Code for setting parameters would go here, but irrelevant (they are global variables)

	UImanager->ApplyCommand("/control/execute physics.mac"); //this just ensure 

However! After setting it to complete 176 runs, the linux kernel kills my program before it reaches that mark, due to having no more memory (according to linux). |

My impression is that "ReinitializeGeometry" takes care of deleting all the memory allocated for physical, logical, etc. volumes, so that using something like: "G4Tubs* Column_tubs = new G4Tubs(.....);" wouldn't cause memory to be created and not destroyed after each run. However, at one point in my code, I have a loop where I allocate memory for new, unnamed physical placement volumes using the same logical volume each time. Are physical volumes created in this way deleted by ReinitializeGeometry?

ALSO! One last thing. What about optical and logicalbordersurfaces? Are these deleted as well? I'm on the lookout for any allocated memory that is somehow not getting deleted, as I suspect this is the problem.

I would greatly appreciate any help and suggestions! Thank you!

 Add Message Add Message
to: "Changing Geometry/Optical Parameters Between Runs: Out of Memory"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]