3 icon indicating copy to clipboard operation
3 copied to clipboard

Modifying Maximum Regions

Open kahlos opened this issue 7 years ago • 5 comments

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?

kahlos avatar Sep 04 '17 20:09 kahlos

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

godsic avatar Sep 04 '17 21:09 godsic

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?

kahlos avatar Sep 05 '17 05:09 kahlos

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" [email protected] 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 .

barnex avatar Sep 05 '17 10:09 barnex

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.

aleste2 avatar Sep 07 '17 07:09 aleste2

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

kahlos avatar Sep 07 '17 10:09 kahlos