[Gate-users] How to use multithread on Gate 7.2
Marc Verderi
verderi at in2p3.fr
Mon Jun 26 16:04:14 CEST 2017
Dear all,
Are the points that prevent GATE to adopt the MT identified ?
Making a G4 code thread-safe must definitely be done with care, but for
examples, TOPAS is fully MT compliant, the CMS LHC experiment has
started production in MT mode and ALICE is on the way, etc. Assuming
things will be much easier with a yet-to-be-defined product "geant5"
(you meant Geant-V ?) is somewhat a bet. ;)
Let me remind that the benefit GATE could have from running in MT
mode is when/if using a large geometry (eg : geometry from CT scan
system). Assuming the memory usage of the application is :
[1] (geometry + cross-section tables) + [2] (G4 memory work for
tracking) + [3] (hit collection / scoring data),
then the G4 MT brings a real advantage if [1] is of the order or larger
than [2] + [3] (and the more [1] is larger, the larger the advantage
is). As [1] is "almost constant" (constant after initialization) it is
shared among the threads during the events processing. In the case of
the 24 cores mentioned, [1] will be present only one time in memory in
MT mode, while it would be present 24 times if using independent
applications. In this case, you may reach the point that you don't have
enough memory to serve all the cores (hence you loose computing power).
This is not a theoretical point, but experienced.
To give some idea, in a test we run with a simplified CMS geometry,
[1] is ~ 200 MB, [2] ~ 10 MB and [3] is ~ 0 (no scoring). This, of
course, totally depends on the application, and it would be interesting
to have an idea of the memory pattern(s) for GATE.
Cheers,
Marc
On 26/06/2017 12:01, David Boersma wrote:
> Hi Mery MB,
>
> We would love to run GATE in multithreaded mode, but for the time
> being that is not yet working. We think we may have to wait until
> Geant5 (no typo: Geant version five) is released. That will not happen
> any time soon. Also GATE internally needs a lot of work to be
> "thread-safe".
>
> So in order to make full use of your multicore system, I would advise
> to treat it as a "cluster". You can install your favorite job
> submission system (I am using HTCondor, which is very easy to install
> on Ubuntu) and then just split up your simulation into many jobs that
> can be run in parallel. Make sure that you never exceed the available
> RAM (by being careful with your GATE macro, configuring your job
> management system to not allow more jobs when the RAM is almost
> completely used, or by throwing more money at it and installing more
> RAM, or etc). Also be careful with hyperthreading. On my own "number
> cruncher", the "htop" program reports 16 cores, but physically it has
> actually only 8 cores. I noticed that hyperthreading slows down GATE,
> even if there is enough RAM. So on my system I configure HTCondor to
> *not* use hyperthreading, running 8 jobs in parallel gives a slightly
> higher throughput than running 16 jobs in parallel: with 16, each
> individual job runs a bit more that 2x slower than with 8. YMMV.
>
> There are several tools and scripts/programs floating around to assist
> you running GATE on clusters. AFAIK, all these tools (including "gjs"
> that is included in the GATE source tree) are tailored for specific
> use cases. If you tell us about your own intended use case then maybe
> some other mailing list members with similar use cases can advertise
> their favorite cluster tool to you.
>
> (BTW: if anyone with some real concurrent programming experience
> happens to read this message, please feel free to have a look at our
> code, and share your thoughts and ideas about the way forward to
> MT-GATE on the gate-devel mailing list.)
>
> Good luck,
> David Boersma
>
>
> Den 25/06/2017 kl. 11:26, skrev Mery MB:
>> Dear All Gate Developer and User
>>
>> I want to run my Gate program on a 24 core PC. How can I use all core
>> for one program in Gate?
>>
>> How we can use the Multi threaded option in Gate Programs?
>> we should add some sentences to the program?
>>
>> I will thank you if some one can help me in this issue.
>>
>> Best Regards
>>
>>
>> _______________________________________________
>> Gate-users mailing list
>> Gate-users at lists.opengatecollaboration.org
>> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
>>
> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
More information about the Gate-users
mailing list