From 6a2ac91afadb344cb5c3727d5a134c6255e841fd Mon Sep 17 00:00:00 2001 From: Luc Papeleux <L.Papeleux@ULiege.be> Date: Thu, 25 Jun 2020 10:21:02 +0200 Subject: [PATCH] add PYTHONEXE in launch --- launch.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/launch.py b/launch.py index f884d57..d870c3a 100755 --- a/launch.py +++ b/launch.py @@ -33,6 +33,7 @@ class LaunchJob(ParametricJob): TextPRM(self.pars, 'MAIL_ADDR', 'e-mail address (reports)', os.getenv('USER')) TextPRM(self.pars, 'SMTP_SERV', 'SMTP email server', 'smtp.ulg.ac.be') + TextPRM(self.pars, 'PYTHONEXE', 'Python executable', sys.executable) mtfExe = os.path.abspath(os.path.dirname(__file__))+os.sep+'Metafor' if (not isUnix()): mtfExe = mtfExe+'.exe' @@ -78,19 +79,20 @@ class LaunchJob(ParametricJob): # Actions PRMAction(self.actions, 'a', self.pars['MAIL_ADDR']) - PRMAction(self.actions, 'b', self.pars['EXEC_NAME']) - PRMAction(self.actions, 'c', self.pars['TEST_NAME']) - PRMAction(self.actions, 'c', self.pars['TEST_DIR']) - PRMAction(self.actions, 'd', self.pars['OUTFILE']) - - PRMAction(self.actions, 'e', self.pars['ALGORITHM']) - PRMAction(self.actions, 'f', self.pars['RESTART_STEP']) - PRMAction(self.actions, 'g', self.pars['MULTITEST']) - - PRMAction(self.actions, 'h', self.pars['NICE_VALUE']) - PRMAction(self.actions, 'i', self.pars['AFFINITY']) - PRMAction(self.actions, 'j', self.pars['NB_TASKS']) - PRMAction(self.actions, 'k', self.pars['NB_THREADS']) + PRMAction(self.actions, 'b', self.pars['PYTHONEXE']) + PRMAction(self.actions, 'c', self.pars['EXEC_NAME']) + PRMAction(self.actions, 'd', self.pars['TEST_NAME']) + PRMAction(self.actions, 'd', self.pars['TEST_DIR']) + PRMAction(self.actions, 'e', self.pars['OUTFILE']) + + PRMAction(self.actions, 'f', self.pars['ALGORITHM']) + PRMAction(self.actions, 'g', self.pars['RESTART_STEP']) + PRMAction(self.actions, 'h', self.pars['MULTITEST']) + + PRMAction(self.actions, 'i', self.pars['NICE_VALUE']) + PRMAction(self.actions, 'j', self.pars['AFFINITY']) + PRMAction(self.actions, 'k', self.pars['NB_TASKS']) + PRMAction(self.actions, 'l', self.pars['NB_THREADS']) PRMAction(self.actions, 'm', self.pars['RUNMETHOD']) # At parameters PRMAction(self.actions, 'n', self.pars['AT_TIME']) @@ -309,7 +311,7 @@ class LaunchJob(ParametricJob): if self.launchGui: #self.launchGui.outFile=outfile # starting process (unable to renice it => nice in battery) - prog = 'python' + prog = self.pars['PYTHONEXE'].val # python args -u : unbuffered output (to have output synchronized to output) # -i : force a prompt event even if stdin is not a terminal (else it is not possible to write cmds to python) arg = ['-u', '-i'] @@ -320,7 +322,7 @@ class LaunchJob(ParametricJob): else: #cmd = self.getNiceCmd(int(self.pars['NICE_VALUE'].val)) #cmd = cmd + ['python'] - cmd = ['python'] + cmd = [self.pars['PYTHONEXE'].val] if isUnix(): # shell=False && sans close_fds = True (ca freeze) #Add mtfdir to LD_LIBRARY_PATH to allow launch to find mt*.so if 'LD_LIBRARY_PATH' in os.environ: -- GitLab