Project

General

Profile

Geant4 EM Physics Code Review Weekly Phone Meeting

Meeting

Date: January 17, 2014 at 9.15 AM US CST (Fermilab local time)
Place: 1-866-740-1260 (ReadyTalk line) (Host : Krzysztof)

Participants:

John Apostolakis
Andrea Dotti
Krzysztof Genser
Soon Yung Jun
Boyana Norris

Discussion

(Summary by Krzysztof)

Andrea reported on his initial inspection of
G4UniversalFluctuation::SampleFluctuations

Some of the comments:

.) the function is split into "electron" and (shorter) "not electron"
part, is there a way to use this fact in the optimization?

.) there seem to be many divisions which one may want to replace with
multiplications esp. inside the loops

.) one may want to cache the handle to the random number generator
(RNG)

.) one should use the array interface of the RNG esp. in cases when
the number of invocations is predictable, like e.g. here:

G4int nb = G4Poisson(p3);
if(nb > 0) {
for (G4int k=0; k<nb; k++) { lossc += w2/(1.-w*G4UniformRand()); }
}

.) in the loop

for (G4int istep=0; istep < nstep; ++istep) ...

istep can only be 1 or 2 and it is not used in the loop body, is there
a way to optimize it?

the expression:

G4double w2 = G4Log(2.*electron_mass_c2*beta2*gam2)-beta2;

or its elements are constant in the loop, one should factor it out
the part (2.*electron_mass_c2*beta2*gam2) is also present earlier in the code.

John checked in his recent changes re top few tens of lines of the code;
to be looked at.

Krzysztof asked if the timing effect pertaining to the recent change
(9.6->10.0) in G4PhysicsVector::Value was known; tbd.

Next meeting January 24th.