Runner#

class mumax3c.mumax3.Runner#

Control the default runner.

Parameters:
  • cache_runner (bool) – If True the best way to run mumax3 is only determined once and the result is cached. Subsequent calls to the property runner will return the Mumax3Runner object from the cache. Setting this parameter to False will cause it to check for available methods again. Defaults to True.

  • mumax3_exe (str) – The name or path of the executable mumax3 command. Defaults to mumax3.

  • optirun_exe (str) – The name or path of the executable optirun command. Defaults to optirun.


Methods

__dir__

Default dir() implementation.

__eq__

Return self==value.

__repr__

Return repr(self).

autoselect_runner

Find the best available way to run mumax3.

Properties

runner

Return the default mumax3 runner.


autoselect_runner()#

Find the best available way to run mumax3.

The method tries to find a suitable runner by checking the availability of optirun and mumax3 in this order. If no runner can be found an EnvironmentError is raised.

Raises:

EnvironmentError – If mumax3 cannot be found on host.

Examples

  1. Getting mumax3 Runner.

>>> import mumax3c as mc
...
>>> mc.runner.autoselect_runner()
>>> runner = mc.runner.runner
>>> isinstance(runner, mc.mumax3.Mumax3Runner)
True
property runner#

Return the default mumax3 runner.

The default runner is determined using autoselect_runner(). If cache_runner is True the runner is cached during the first call and the same runner is returned in subsequent calls to this property.

This property also allows to set a specific Mumax3Runner. Before setting, a new runner is first checked to be functional by calling runner.status.

Examples

  1. Getting mumax3 Runner.

>>> import mumax3c as mc
...
>>> runner = mc.runner.runner
>>> isinstance(runner, mc.mumax3.Mumax3Runner)
True