]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
add option to select mpi module
authorCédric Aguerre <cedric.aguerre@edf.fr>
Mon, 16 Feb 2015 16:24:24 +0000 (17:24 +0100)
committerCédric Aguerre <cedric.aguerre@edf.fr>
Wed, 4 Mar 2015 12:41:00 +0000 (13:41 +0100)
bin/salomeContext.py

index 785bebefca614d43c540c0911d833ab8e3fe062e..99638321c0f89fa3f9149f811de6cadda15c2600 100644 (file)
@@ -234,6 +234,21 @@ class SalomeContext:
       # try to default to "start" command
       command = "_runAppli"
 
+    mpi_module_option = "--with_mpi_module="
+    mpi_module = [x for x in args if x.startswith(mpi_module_option)]
+    if mpi_module:
+      mpi_module = mpi_module[0][len(mpi_module_option):]
+      print "Trying to load MPI module: %s..."%mpi_module,
+      import subprocess
+      try:
+        subprocess.call(["module", "load", mpi_module])
+        print " OK"
+      except:
+        print " ** Failed **"
+        pass
+      options = [x for x in options if not x.startswith(mpi_module_option)]
+      pass
+
     try:
       res = getattr(self, command)(options) # run appropriate method
       return res or (None, None)