Problem 1706 - Large performance penalty when using GPS with low energy primaries (mutex/lock issue)
Summary: Large performance penalty when using GPS with low energy primaries (mutex/loc...
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: event (show other problems)
Version: 10.1
Hardware: All All
: P5 major
Assignee: Andrea Dotti
URL:
Depends on:
Blocks:
 
Reported: 2015-01-29 05:03 CET by Andrea Dotti
Modified: 2015-04-06 22:44 CEST (History)
1 user (show)

See Also:


Attachments
10.0 Vs 10.1 (38.41 KB, image/png)
2015-01-29 05:04 CET, Andrea Dotti
Details
Source of lock (25.68 KB, image/png)
2015-01-29 05:04 CET, Andrea Dotti
Details

Note You need to log in before you can comment on or make changes to this problem.
Description Andrea Dotti 2015-01-29 05:03:27 CET
In Version 10.1 to reduce memory consumption a locking of mutex in GPS was introduced in G4SingleParticleSource::GeneratePrimaryVertex (see attachment lock-where.png). When primaries are of low energy and setup is simple the generation of primaries is highly penalized with a moderate number of threads (>8) because the mutex plays a major role.

As an example, in case of 24 threads, only 4 threads are efficiently used (see compare.png, where the blue bars represent the time spent with a given number of threads running for 10.1 and the yellow bars represent the same quantity for 10.0).

A strategy to remove the lock is needed, because this can dramatically impact medical applications, however this is not completely trivial as it requires understanding concurrency issues in the underlying classes.

Andrea
Comment 1 Andrea Dotti 2015-01-29 05:04:15 CET
Created attachment 308 [details]
10.0 Vs 10.1
Comment 2 Andrea Dotti 2015-01-29 05:04:49 CET
Created attachment 309 [details]
Source of lock
Comment 3 Linlin Zhang 2015-02-15 10:26:41 CET
Hello, 

I would like to know whether this bug is being debugged, and how long time it will take to be solved? 

Thanks,
Linlin
Comment 4 Andrea Dotti 2015-02-16 21:15:21 CET
Hello Linlin,
I am working on that, but I cannot yet say how long it will take, it is not so easy.
In the meantime, you can use Version 10.0

Andrea
Comment 5 Andrea Dotti 2015-02-26 02:09:57 CET
Proposed and accepted correction tag: event-V10-01-03

Need a large scale testing if succesfull will be included in ref-02 and the next 10.1 patch release.
Comment 6 Linlin Zhang 2015-03-02 03:44:29 CET
Thanks Andrea for the informing. It is great to see that the bug is fixed. Hope to see the future released version.

Linlin
Comment 7 Andrea Dotti 2015-04-06 22:44:54 CEST
Solved in 10.1.re03