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 propertyrunner
will return theMumax3Runner
object from the cache. Setting this parameter toFalse
will cause it to check for available methods again. Defaults toTrue
.mumax3_exe (str) – The name or path of the executable
mumax3
command. Defaults tomumax3
.optirun_exe (str) – The name or path of the executable
optirun
command. Defaults tooptirun
.
Methods
__dir__
Default dir() implementation.
__eq__
Return self==value.
__repr__
Return repr(self).
Find the best available way to run mumax3.
Properties
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
andmumax3
in this order. If no runner can be found anEnvironmentError
is raised.- Raises:
EnvironmentError – If mumax3 cannot be found on host.
Examples
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()
. Ifcache_runner
isTrue
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 callingrunner.status
.Examples
Getting mumax3 Runner.
>>> import mumax3c as mc ... >>> runner = mc.runner.runner >>> isinstance(runner, mc.mumax3.Mumax3Runner) True