[Gate-users] GATE IN MULTICORE PROCESSOR STAND ALONE WORKSTATION
Josh Knowland
jknowland at lucernodynamics.com
Wed Jun 10 16:06:10 CEST 2020
I forgot to add that my process does result in multiple output files, so you will likely need to combine them afterwards. I use singles data, so it’s a simple matter of combining the text files. I’m not sure how you would combine different output files (root, etc.)
From: Gate-users <gate-users-bounces at lists.opengatecollaboration.org> On Behalf Of Josh Knowland
Sent: Wednesday, June 10, 2020 10:03 AM
To: Mohammed REZZOUG <nmedrezz at gmail.com>; gate-users at lists.opengatecollaboration.org
Subject: Re: [Gate-users] GATE IN MULTICORE PROCESSOR STAND ALONE WORKSTATION
Hello Mohammed,
This is actually a topic that I have experience with.
I run my simulations remotely on a 64-core virtual machine through Azure, but the process should be the same.
Here is the workflow I use:
Generate a macro that does what I want. Test it out with a small activity to make sure. Create multiple copies of the macro, each with a different output filename. You can also use different time-slices if you want to, but all other information can be the same (volume names, etc. do not need to change). Run all the macros concurrently using a shell script like below. Each process will be put on a different core and htop will display CPU usage. It’s also possible to insert a command to send you an email alert when all the scripts are finished. It will depend on your mail server, so I haven’t shown a specific example here.
#!/bin/bash
(
(
Gate macro_00.mac > macro_00_log.txt &
Gate macro_01.mac > macro_01_log.txt &
Gate macro_02.mac > macro_02_log.txt &
Gate macro_03.mac > macro_03_log.txt &
Gate macro_04.mac > macro_04_log.txt &
Gate macro_05.mac > macro_05_log.txt &
Gate macro_06.mac > macro_06_log.txt &
Gate macro_07.mac > macro_07_log.txt &
Gate macro_08.mac > macro_08_log.txt &
Gate macro_09.mac > macro_09_log.txt &
Gate macro_10.mac > macro_10_log.txt &
wait
)
# insert command to send email here
) &
htop
An alternative approach is to use parameterized macros. For this, you’d create one macro with GATE parameters as place holders using braces. Then, the script file would call that macro multiple times while changing the parameters. For instance, you could run one simulation by splitting it over time by using parameters for timestart and timestop like this in the macro:
/gate/application/setTimeSlice 0.125 s
/gate/application/setTimeStart {timestart} s
/gate/application/setTimeStop {timestop} s
Then the script would define the parameters for each process:
#!/bin/bash
(
(
Gate -a [timestart,0.000][timestop,0.125] paramMacro.mac > output_00_log.txt &
Gate -a [timestart,0.125][timestop,0.250] paramMacro.mac > output_01_log.txt &
Gate -a [timestart,0.250][timestop,0.375] paramMacro.mac > output_02_log.txt &
Gate -a [timestart,0.375][timestop,0.500] paramMacro.mac > output_03_log.txt &
Gate -a [timestart,0.500][timestop,0.625] paramMacro.mac > output_04_log.txt &
Gate -a [timestart,0.625][timestop,0.750] paramMacro.mac > output_05_log.txt &
Gate -a [timestart,0.750][timestop,0.875] paramMacro.mac > output_06_log.txt &
Gate -a [timestart,0.875][timestop,1.000] paramMacro.mac > output_07_log.txt &
wait
)
wait
# insert command to send email here
) &
htop
I hope that helps!
Josh
From: Gate-users <gate-users-bounces at lists.opengatecollaboration.org<mailto:gate-users-bounces at lists.opengatecollaboration.org>> On Behalf Of Mohammed REZZOUG
Sent: Wednesday, June 10, 2020 10:35 AM
To: gate-users at lists.opengatecollaboration.org<mailto:gate-users at lists.opengatecollaboration.org>
Subject: [Gate-users] GATE IN MULTICORE PROCESSOR STAND ALONE WORKSTATION
Dear Gate users
I am using the a workstation with 24 cores. The problem at hand is that when I run the code
and analyze my processor, I find that only one core is being used. It takes a long time for
the simulation to get executed even for primitive problems.
In the manual there are instructions about parallel processing using
clusters but there is no mention about multi core systems.
Is it possible to divide the work among the cores of my system like in
clusters ?
---
Mohammed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20200610/e30e29bd/attachment-0001.html>
More information about the Gate-users
mailing list