summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'numbench/modules/__init__.py')
-rw-r--r--numbench/modules/__init__.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/numbench/modules/__init__.py b/numbench/modules/__init__.py
index fdd704e..9696252 100644
--- a/numbench/modules/__init__.py
+++ b/numbench/modules/__init__.py
@@ -18,12 +18,25 @@
import os
from os.path import basename, dirname, realpath
+# List here the "stable" modules in a static and ordered list
+modnames = [
+ 'blas',
+ 'cblas',
+ 'lapack',
+ 'lapacke',
+ 'scalapack',
+ 'fftw'
+]
+
class ModuleNotFoundException(RuntimeError):
pass
def getModulesNames():
+ return modnames
+
+def getAllModulesNames():
files = os.listdir(dirname(realpath(__file__)))
me = basename(__file__)
modnames = []
@@ -32,7 +45,6 @@ def getModulesNames():
modnames.append(f[:-3])
return modnames
-
def loadModule(modname, args=None):
if not modname in getModulesNames():
raise ModuleNotFoundException("module " + modname + " not found")
@@ -42,5 +54,5 @@ def loadModule(modname, args=None):
args = args if type(args) == type('') else ' '.join(args)
# Load the module
- tmp = __import__(modname, fromlist=["Module"])
+ tmp = __import__('numbench.modules.' + modname, fromlist=["Module"])
return tmp.Module(args)