[Gate-users] very different computation times while runing simulations in parallel
David Leibold
D.Leibold at tudelft.nl
Thu Mar 31 12:16:53 CEST 2022
Dear Sarah,
some remarks:
* If I am not mistaken, the nanoparticles you create have a radius of 500 nm, but the repeater has a step size of 5 nm, so you end up with one big chunk of overlapping volumes. I am not sure whether Gate even likes that, I had problems with that in the past once.
* You define the source as a cylinder. By default, a source emits particles in all directions. I don’t know what scenario you would like to simulate, but there is the option to limit the angle so that you get a parallel beam or any angle you like. (I can give you a code example if you need it). (On that note: if one uses a parallel beam, the absorbed dose will probably be very sensitive to the orientation of the nanoparticle grid.)
Those two points might already explain why you receive less dose than you expected in the previous mail you sent.
Running Gate simulations in parallel shouldn’t be a problem.
I think there might be a way to check the absorbed dose (even though it’s a bit cumbersome). You can include phase space actors in your setup, which record every particle that leaves a certain volume, and they record e.g. the position and energy of a particle. Hence, you can place planes (so very thin boxes, filled with, in your case, air) around your cell and then compare the ingoing and outgoing energy; the difference should be absorbed in you cell or nanoparticles. Then you can of course emit the water sphere of the cell to see whether there’s a difference.
I attached a code example for a phase space actor, which is attached to a dedicated volume (“PhS_BeforePlane”). The options that define which parameters are saved also include direction, position and energy, which you can switch off if you want.
If I remember correctly, I always needed a crystalSD detector, otherwise the phase space actor would not record anything. Please see the example script “Geometry.mac” below, which you can use to define a detector. Just place the detector volume somewhere away from your cell and source and disregard the output (that’s the line "/gate/CTscanner/placement/setTranslation 0. 0. 0. mm”)
One more note about the physics list: It is highly recommended to use a pre-built physics list (e.g. emstandard opt.4) instead of building one yourself. Having said that, I don’t have any experience with the selection of physics lists.
I hope that helps!
Best regards,
David
#======================================================
# PHASE SPACE DETECTOR
#======================================================
#
# This snippet shows how to add a phase space actor.
# First define its volume - you can also attach the
# phase space actor to an already existing volume:
/gate/world/daughters/name PhS_BeforePlane
/gate/world/daughters/insert box
/gate/PhS_BeforePlane/setMaterial Vacuum
/gate/PhS_BeforePlane/geometry/setXLength 500 mm
/gate/PhS_BeforePlane/geometry/setYLength 500 mm
/gate/PhS_BeforePlane/geometry/setZLength 2 mm
/gate/PhS_BeforePlane/placement/setTranslation 0 0 194 mm
/gate/PhS_BeforePlane/vis/setColor white
/gate/PhS_BeforePlane/vis/setVisible true
# Add the phase space actor to the volume:
/gate/actor/addActor PhaseSpaceActor PhS_b
/gate/actor/PhS_b/attachTo PhS_BeforePlane
/gate/actor/PhS_b/save output/output-PhS-b.root
# Define which parameters you would like to save:
/gate/actor/PhS_b/enableParticleName true
/gate/actor/PhS_b/enableEkine true
/gate/actor/PhS_b/enableXPosition false
/gate/actor/PhS_b/enableYPosition false
/gate/actor/PhS_b/enableZPosition false
/gate/actor/PhS_b/enableXDirection true
/gate/actor/PhS_b/enableYDirection true
/gate/actor/PhS_b/enableZDirection true
/gate/actor/PhS_b/enableWeight false
/gate/actor/PhS_b/enableMass false
/gate/actor/PhS_b/enableProductionProcess false
/gate/actor/PhS_b/enableProductionVolume true
/gate/actor/PhS_b/useVolumeFrame false
/gate/actor/PhS_b/enableTime false
/gate/actor/PhS_b/enablePrimaryEnergy false
/gate/actor/PhS_b/enableEmissionPoint false
/gate/actor/PhS_b/storeOutgoingParticles true
# PS: There are many more parameters available.
#======================================================
# GEOMETRY.MAC
#======================================================
#
# This snippet defines a simple flat panel CT detector.
#
# The system level descriptions of the CT scanner are:
# module / cluster / pixel
#######################################################
# CT SCANNER
#######################################################
/gate/world/daughters/name CTscanner
/gate/world/daughters/insert box
/gate/CTscanner/placement/setTranslation 0. 0. 0. mm
/gate/CTscanner/geometry/setXLength 0.1 nm
/gate/CTscanner/geometry/setYLength 0.1 nm
/gate/CTscanner/geometry/setZLength 0.1 nm
/gate/CTscanner/setMaterial Vacuum
/gate/CTscanner/vis/forceWireframe
/gate/CTscanner/vis/setColor white
#######################################################
# CT SCANNER -> MODULE
#######################################################
/gate/CTscanner/daughters/name module
/gate/CTscanner/daughters/insert box
/gate/module/geometry/setXLength 0.1 nm
/gate/module/geometry/setYLength 0.1 nm
/gate/module/geometry/setZLength 0.1 nm
/gate/module/setMaterial Vacuum
/gate/module/vis/forceWireframe
/gate/module/vis/setColor white
#######################################################
# CT SCANNER -> MODULE -> CLUSTER
#######################################################
/gate/module/daughters/name cluster
/gate/module/daughters/insert box
/gate/cluster/geometry/setXLength 0.1 nm
/gate/cluster/geometry/setYLength 0.1 nm
/gate/cluster/geometry/setZLength 0.1 nm
/gate/cluster/setMaterial Vacuum
/gate/cluster/vis/forceWireframe
/gate/cluster/vis/setColor green
#######################################################
# ATTACHING THE LEVELS TO THE SYSTEM
#######################################################
/gate/systems/CTscanner/module/attach module
/gate/systems/CTscanner/cluster_0/attach cluster
# Attach a sensitive detector:
/gate/cluster/attachCrystalSD
On 31 Mar2022, at 09:36, Sarah Blind <sarah.blind at univ-lorraine.fr<mailto:sarah.blind at univ-lorraine.fr>> wrote:
Dear Gate users,
I'm analysing the deposited dose in Gy of the irradiation simulation of a cell with in its inside a certain number of nanoparticles composed of 16% bismuth.
Looking at the deposited dose on the nanoparticles focci, for several simulations I obtain very different results and computation times:
* Simulation 1 : 105,545 Gy with a computation time of ~10h,
* Simulation 2 : 10.07 Gy with a computation time of ~ 2h.
I run these two simulations in parallel, each in a different file and a different number for setEngineSeed.
I have a gamma beam and I send 300 000 Bq for a 60 secondes irradiation simulation on 35^3 nanoparticles.
I think the simulation 2 failed ; can the fact that I run several simulations at the same time be a problem ?
If this speak to anyone, thank your for your advices!
Sarah Blind
PS: Here is my code:
MAIN.MAC
/gate/geometry/setMaterialDatabase ../data/GateMaterials.db
/control/execute world.mac
/control/execute physics.mac
/control/execute detectors.mac
/gate/run/initialize
/control/execute 5sourceSpectrumMeV.mac
/gate/application/setTimeSlice 60. s
/gate/application/setTimeStart 0. s
/gate/application/setTimeStop 60. s
/gate/random/setEngineName MersenneTwister
/gate/random/setEngineSeed auto
/gate/application/start
WORLD.MAC
/gate/world/geometry/setXLength 30 um
/gate/world/geometry/setYLength 30 um
/gate/world/geometry/setZLength 30 um
/gate/world/setMaterial Air
/gate/world/daughters/name cell
/gate/world/daughters/insert sphere
/gate/cell/geometry/setRmin 0.0 mm
/gate/cell/geometry/setRmax 10 um
/gate/cell/placement/setTranslation 0 0 0 um
/gate/cell/setMaterial G4_WATER
/gate/cell/vis/setVisible 1
/gate/cell/vis/setColor blue
/gate/cell/vis/forceSolid false
/gate/cell/daughters/name NP
/gate/cell/daughters/insert sphere
/gate/NP/geometry/setRmin 0 mm
/gate/NP/geometry/setRmax 0.5 um
/gate/NP/placement/setTranslation 0 0 0 mm
/gate/NP/setMaterial AGuIX_bis
/gate/NP/repeaters/insert cubicArray
/gate/NP/cubicArray/setRepeatNumberX 30
/gate/NP/cubicArray/setRepeatNumberY 30
/gate/NP/cubicArray/setRepeatNumberZ 30
/gate/NP/cubicArray/setRepeatVector 5 5 5 nm
PHYSICS.MAC
/gate/physics/addPhysicsList QGSP_BERT_EMV
/gate/physics/Gamma/SetCutInRegion world 50 nm
/gate/physics/Electron/SetCutInRegion world 50 nm
/gate/physics/Gamma/SetCutInRegion cell 20 nm
/gate/physics/Electron/SetCutInRegion cell 20 nm
/gate/physics/Gamma/SetCutInRegion NP 0.5 nm
/gate/physics/Electron/SetCutInRegion NP 0.5 nm
/gate/random/setEngineName MersenneTwister
/gate/physics/addAtomDeexcitation
/gate/physics/addProcess PhotoElectric gamma
/gate/physics/processes/PhotoElectric/setModel LivermoreModel
/gate/physics/processes/PhotoElectric/setAugerElectron true
/gate/physics/processes/PhotoElectric/setDeltaRayCut 10 eV
/gate/physics/processes/PhotoElectric/setXRayCut 10 eV
/gate/physics/processes/PhotoElectric/setStepFunction e- 0.2 0.1 nm
/gate/physics/addProcess Compton gamma
/gate/physics/processes/Compton/setModel LivermoreModel
/gate/physics/processes/Compton/setStepFunction e- 0.2 0.1 nm
/gate/physics/addProcess RayleighScattering
/gate/physics/processes/RayleighScattering/setModel LivermoreModel
/gate/physics/addProcess GammaConversion
/gate/physics/processes/GammaConversion/setModel LivermoreModel
/gate/physics/addProcess ElectronIonisation
/gate/physics/processes/ElectronIonisation/setModel LivermoreModel e-
/gate/physics/processes/ElectronIonisation/setModel PenelopeModel e+
/gate/physics/processes/ElectronIonisation/setStepFunction e- 0.2 0.1 nm
/gate/physics/addProcess Bremsstrahlung e-
/gate/physics/addProcess Bremsstrahlung e+
/gate/physics/processes/Bremsstrahlung/setModel LivermoreModel e-
/gate/physics/processes/Bremsstrahlung/setModel PenelopeModel e+
/gate/physics/addProcess eMultipleScattering e-
/gate/physics/addProcess eMultipleScattering e+
/gate/physics/processes/eMultipleScattering/setModel UrbanModel e-
/gate/physics/processes/eMultipleScattering/setModel UrbanModel e+
/gate/physics/SetMinKineticEnergyInRegion world 1 eV
/gate/physics/SetMinKineticEnergyInRegion cell 1 eV
/gate/physics/ActivateSpecialCuts gamma
DETECTOR.MAC
/gate/actor/addActor DoseActor dose
/gate/actor/dose/save output/dose1.hdr
/gate/actor/dose/attachTo cell
/gate/actor/dose/stepHitType random
/gate/actor/dose/setPosition 0.0 0.0 0.0 mm
/gate/actor/dose/setSize 20 20 20 um
/gate/actor/dose/setResolution 400 400 400
/gate/actor/dose/saveEveryNSeconds 30
SOURCE.MAC
/gate/source/addSource mybeam gps
/gate/source/mybeam/gps/particle gamma
/gate/source/mybeam/gps/ene/type User
/gate/source/mybeam/gps/hist/type energy
/gate/source/mybeam/setActivity 300000. becquerel
[histogram]
/gate/source/mybeam/gps/position 0 0 15 um
/gate/source/mybeam/gps/pos/type Volume
/gate/source/mybeam/gps/pos/shape Cylinder
/gate/source/mybeam/gps/pos/inner_radius 0 mm
/gate/source/mybeam/gps/pos/radius 10 um
/gate/source/mybeam/gps/pos/halfz 0.01 um
/gate/source/mybeam/gps/ang/type beam2d
_______________________________________________
Gate-users mailing list
Gate-users at lists.opengatecollaboration.org<mailto:Gate-users at lists.opengatecollaboration.org>
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.opengatecollaboration.org_mailman_listinfo_gate-2Dusers&d=DwIGaQ&c=XYzUhXBD2cD-CornpT4QE19xOJBbRy-TBPLK0X9U2o8&r=lfXR69GFfS7NT-Wp5HZqbtBDrbYoilDdmNEG7fKW7aM&m=Bzn1GhBXnPo5zy9l36RSh3NBLojZBJWyWg5X_ZW2C3s&s=_5vtJlajzMmvlWxA7aHHksJzRsaN1Xx6AvI8ZnKpgKU&e=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20220331/5409e687/attachment-0001.html>
More information about the Gate-users
mailing list