mumax / 3

GPU-accelerated micromagnetic simulator
Other
459 stars 151 forks source link

Modifying Maximum Regions #124

Closed kahlos closed 1 month ago

kahlos commented 7 years ago

How viable is it to add a parameter that allows you to modify the maximum number of regions from 256? There would be a tradeoff with memory consumption. But it would be very helpful to increase or decrease this based on the model.

On a cursory look through the code, I didn't see much besides an NREGIONS parameter. Would it be very involved getting this to work? Or is it as easy as changing the size or number bytes storing the region index?

godsic commented 7 years ago

yes, some of the cuda would need some love. go side should be straightforward. @kahlos would you be willing to work on this project?

kahlos commented 7 years ago

Yes I certainly am willing to get this working. Though I could do with a few tips if you know which parts to look at.

Do you think it would work as I'm hoping? Decreased memory with less regions and vice versa. And no other effects besides memory consumption?

barnex commented 7 years ago

The problem is that exchange uses memory proportional to NREGIONS squared(!). I would advise against increasing it.

On 5 Sep 2017 7:36 am, "Callum Vincent" notifications@github.com wrote:

Yes I certainly am willing to get this working. Though I could do with a few tips if you know which parts to look at.

Do you think it would work as I'm hoping? Decreased memory with less regions and vice versa. And no other effects besides memory consumption?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mumax/3/issues/124#issuecomment-327075772, or mute the thread https://github.com/notifications/unsubscribe-auth/AAZ3Amnayip-slMJc0JF2hZ8Vzq2KdVpks5sfN3WgaJpZM4PMO5X .

aleste2 commented 7 years ago

It can be done, but you have to change a lot of code, as regions are now 8-bit type (limited to 256). Changing to word type (16 bit) all along the code should work.

kahlos commented 7 years ago

Hmm okay, thanks all for the advice! I'll poke around the code when I have some free time and test this.

JonathanMaes commented 1 month ago

Due to the prohibitive performance impact associated with increasing the number of regions, mumax³ will stick to supporting a maximum of 256. Pull requests whose performance impact can be kept to a minimum are always welcome.