Multiple simulations on a single GPU

133 views
Skip to first unread message

Gert-Jan Both

unread,
Jul 12, 2023, 3:21:06 AM7/12/23
to mumax2
Hi,

I'm running a mumax simulation of a device with multiple input antennas, and I want to simulate the device for several different input configurations. Our device is fairly small so our memory usage is very low, and I run all this on a node of 40GB A100s.

I currently run just one simulation per GPU, but that leaves a lot of unused memory. Given that the devices are the same, parallelisation should be possible, right? Is there a straightforward way to run multiple simulations (of the same shape, etc) on a single GPU?

Thanks!

Gert-Jan

Josh Lauzier

unread,
Jul 12, 2023, 5:09:33 PM7/12/23
to mumax2
Hi,

Unfortunately, there is no way to do this (at least not in a useful fashion). One can technically run multiple simulations at the same time on one GPU, if you simply open two different command lines/terminals, and run the scripts at the same time. But the total time per simulation will increase, so it ends up being a wash. If one simulation takes 5 minutes to run, running 2 simulations back to back will be 5 minutes each, or 10 minutes total. Running 2 at the same time, and both will take 10 minutes (and probably slightly longer, as the GPU will have to do some extra coordination of resources). This is true even for very small systems. You're better off just queueing simulations as normal. Basically, while you can double up on the memory, the computation ends up having to trade back and forth, so there is no time savings.

You might be able to get some savings by reusing things like the demag kernel (mumax tries to do this automatically, so this probably is already being done). Or loading an initial configuration in from an OVF file, instead of having to relax manually every time, if that is how you're obtaining particular initial configurations. But that's about it.

Best,
Josh L.

Gert-Jan Both

unread,
Jul 17, 2023, 3:55:11 AM7/17/23
to mumax2
Thanks for the response! It's what I expected - I already tried running two simulations in parallel and that indeed was slower than just doing things sequentially.

instead of having to relax manually every time, if that is how you're obtaining particular initial configurations
That's a good idea, I'll give it a try!

Best,

Gert-Jan
Reply all
Reply to author
Forward
0 new messages