From 2f6073d31932d0603b5a9b6962691ff0db3d6895 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Aguerre?= Date: Mon, 16 Feb 2015 17:24:24 +0100 Subject: [PATCH] add option to select mpi module --- bin/salomeContext.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bin/salomeContext.py b/bin/salomeContext.py index e9ea9040a..fffbfadca 100644 --- a/bin/salomeContext.py +++ b/bin/salomeContext.py @@ -269,6 +269,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) -- 2.39.2