Project

General

Profile

Geant4 EM Physics Code Review Weekly Phone Meeting

Meeting

Date: November 1, 2013 at 10.00 AM US CDT (Fermilab local time)
Place: 1-866-740-1260 (ReadyTalk line) (Host : Krzysztof)

Participants:

Andrea Dotti
Krzysztof Genser
Soon Yung Jun
Boyana Norris

Discussion

(Summary by Krzysztof)

Soon had profiled the 9.6.ref10 release, the results are at:
https://oink.fnal.gov/perfanalysis/g4p/

Soon and Krzysztof looked at the G4VEmProcess and G4VEnergyLossProcess
as well as at the profiling results.

Here is a list of top EM related functions (unordered)

G4KleinNishinaCompton::SampleSecondaries
G4Physics2DVector::Value
G4PhysicsVector::Value
G4SauterGavrilaAngularDistribution::SampleDirection
G4SeltzerBergerModel::SampleSecondaries
G4UniversalFluctuation::SampleFluctuations
G4UrbanMscModel::ComputeGeomPathLength
G4UrbanMscModel::ComputeTruePathLengthLimit
G4UrbanMscModel::SampleCosineTheta
G4UrbanMscModel::SampleDisplacement
G4UrbanMscModel::SampleScattering
G4VDiscreteProcess::PostStepGetPhysicalInteractionLength
G4VEmProcess::GetCurrentLambda
G4VEmProcess::PostStepDoIt
G4VEmProcess::PostStepGetPhysicalInteractionLength
G4VEnergyLossProcess::AlongStepDoIt
G4VEnergyLossProcess::PostStepGetPhysicalInteractionLength
G4VMultipleScattering::AlongStepDoIt
G4VelocityTable::Value

Soon generated the csv lists for some releases. They are available with the csv
extension where the html tables are available e.g.:
https://oink.fnal.gov/perfanalysis/g4p/g4p_9.6.r10a_SimplifiedCalo_01/e-.FTFP_BERT.50.0/prof_big_functions_leaf_count_list_01.csv

Andrea suggested that we may take another look at G4PhysicsVector
as there were some changes done to the code recently.

Krzysztof reported that he noted that the G4Poisson function code
could be improved slightly, but more importantly that just making it
inline gains 30+% CPU in a unit test. Soon noted that the function
used to be inlined (till tag global-V09-06-14 from March 29th).
Soon profiled the modified code and saw about 2% overall gain (see below).
The functions where the code was inlined became slightly more compute
intensive as it was expected, but it was more than offset by the gains
in other functions, e.g. steppers.

We contacted Gabriele today and he agreed to make (and made)
function inline back again.

Krzysztof suggested to recommend that each code change should
be "approved" by another person (to be chosen by the author of
the code change) as it is done in some places where people develop
code used in a "production environment".

In the discussion we noted that the collaboration may not have
enough people and proper infrastructure to be able to do it as of now.
Andrea suggested that may be it should be done for the top 20 compute
intensive functions.

The plan for next week is to work on the items from the todo
list from the previous weeks (profiling r10 and reviewing the code).

We shall meet again on Friday (10am Central).


#  9.6.r10    9.6.r10a     %change     samples
  250.2800    245.5900   -1.8739      higgs.FTFP_BERT.1400.4
    0.0112      0.0109   -2.67857     e-.FTFP_BERT.1.0
    0.0567      0.0549   -3.1746      e-.FTFP_BERT.5.0
    0.1128      0.1094   -3.01418     e-.FTFP_BERT.10.0
    0.5581      0.5395   -3.33274     e-.FTFP_BERT.50.0
    0.0133      0.0131   -1.50376     e-.FTFP_BERT.1.4
    0.0674      0.0661   -1.92878     e-.FTFP_BERT.5.4
    0.1344      0.1320   -1.78571     e-.FTFP_BERT.10.4
    0.6663      0.6515   -2.22122     e-.FTFP_BERT.50.4
    0.0274      0.0271   -1.09489     pi-.FTFP_BERT.1.0
    0.1186      0.1163   -1.93929     pi-.FTFP_BERT.5.0
    0.2208      0.2171   -1.67572     pi-.FTFP_BERT.10.0
    0.9404      0.9224   -1.91408     pi-.FTFP_BERT.50.0
    0.0293      0.0289   -1.36519     pi-.FTFP_BERT.1.4
    0.1241      0.1228   -1.04754     pi-.FTFP_BERT.5.4
    0.2359      0.2325   -1.44129     pi-.FTFP_BERT.10.4
    1.0294      1.0183   -1.0783      pi-.FTFP_BERT.50.4
    0.0289      0.0286   -1.03806     pi-.QGSP_BERT.1.4
    0.1221      0.1202   -1.5561      pi-.QGSP_BERT.5.4
    0.2323      0.2292   -1.33448     pi-.QGSP_BERT.10.4
    0.9771      0.9647   -1.26906     pi-.QGSP_BERT.50.4
    0.0260      0.0255   -1.92308     pi-.QGSP_BIC.1.4
    0.1140      0.1126   -1.22807     pi-.QGSP_BIC.5.4
    0.2206      0.2161   -2.03989     pi-.QGSP_BIC.10.4
    0.9345      0.9227   -1.26271     pi-.QGSP_BIC.50.4
    0.0641      0.0656    2.34009     anti_proton.FTFP_BERT.1.4
    0.1698      0.1689   -0.530035    anti_proton.FTFP_BERT.5.4
    0.2832      0.2826   -0.211864    anti_proton.FTFP_BERT.10.4
    1.1237      1.1113   -1.1035      anti_proton.FTFP_BERT.50.4
    0.0226      0.0225   -0.442478    proton.FTFP_BERT.1.4
    0.1301      0.1290   -0.845503    proton.FTFP_BERT.5.4
    0.2481      0.2469   -0.483676    proton.FTFP_BERT.10.4
    1.1001      1.0893   -0.981729    proton.FTFP_BERT.50.4