Skip to content

GPU out of memory error when directly evaluating magnet properties from returned magnet #157

@ilateur

Description

@ilateur

It's easier to show than to explain. When a magnet is returned from a function and some property is immediately evaluated, the program gives an error. When that magnet is first given a name it is fine.

from mumaxplus import World, Grid, Ferromagnet

def make_magnet():
    world = World((1e-9, 1e-9, 1e-9))
    magnet = Ferromagnet(world, Grid((2, 2, 2)))
    magnet.msat = 1
    magnet.aex = 1
    return magnet

# This works
magnet = make_magnet()
print(magnet.exchange_energy())

# This Gives the error `GPUassert: out of memory`
print(make_magnet().exchange_energy())

I guess world instantly gets destroyed in the compact version?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions