diff --git a/doc/user_manual/runInfo.tex b/doc/user_manual/runInfo.tex index 32ab2678a6..c57798f5ac 100644 --- a/doc/user_manual/runInfo.tex +++ b/doc/user_manual/runInfo.tex @@ -642,6 +642,7 @@ \subsection{RunInfo: Advanced Users} \item[\%BASE\_WORKING\_DIR\%] Expands to the base working directory given in RunInfo. This will likely be a parent of WORKING\_DIR \item[\%METHOD\%] Expands to the environmental variable \$METHOD \item[\%NUM\_CPUS\%] Expands to the number of cpus to use per single batch. This is NumThreads in the XML file. +\item[\%PYTHON\%] Expands to the python that is used to run RAVEN. \end{description} diff --git a/ravenframework/CustomModes/MPILegacySimulationMode.py b/ravenframework/CustomModes/MPILegacySimulationMode.py index 0da723c4a2..56322753e2 100644 --- a/ravenframework/CustomModes/MPILegacySimulationMode.py +++ b/ravenframework/CustomModes/MPILegacySimulationMode.py @@ -59,7 +59,8 @@ def createAndRunQSUB(runInfoDict): "-l","walltime="+runInfoDict["expectedTime"], "-l","place=free","-v", 'COMMAND="../raven_framework '+ - " ".join(runInfoDict["SimulationFiles"])+'"', + " ".join(runInfoDict["SimulationFiles"])+'",'+ + 'RAVEN_FRAMEWORK_DIR="{}"'.format(frameworkDir), runInfoDict['RemoteRunCommand']] #Change to frameworkDir so we find raven_qsub_command.sh remoteRunCommand = {} diff --git a/ravenframework/Models/Code.py b/ravenframework/Models/Code.py index f936872bb9..64e431cff2 100644 --- a/ravenframework/Models/Code.py +++ b/ravenframework/Models/Code.py @@ -564,6 +564,7 @@ def evaluateSample(self, myInput, samplerType, kwargs): command = command.replace("%BASE_WORKING_DIR%",kwargs['BASE_WORKING_DIR']) command = command.replace("%METHOD%",kwargs['METHOD']) command = command.replace("%NUM_CPUS%",kwargs['NUM_CPUS']) + command = command.replace("%PYTHON%", sys.executable) self.raiseAMessage('Execution command submitted:',command) if platform.system() == 'Windows': diff --git a/ravenframework/Runners/DistributedMemoryRunner.py b/ravenframework/Runners/DistributedMemoryRunner.py index 10f9e5fd8e..9137486877 100644 --- a/ravenframework/Runners/DistributedMemoryRunner.py +++ b/ravenframework/Runners/DistributedMemoryRunner.py @@ -14,7 +14,7 @@ """ Created on Mar 5, 2013 -@author: alfoa, cogljj, crisr +@author: alfoa, cogljj, crisr, talbpw, maljdp """ #External Modules------------------------------------------------------------------------------------ import sys @@ -69,7 +69,17 @@ def isDone(self): if self.thread is None: return True else: - return (self.thread in ray.wait([self.thread], timeout=waitTimeOut)[0]) if im.isLibAvail("ray") else self.thread.finished + if im.isLibAvail("ray"): + try: + ray.get(self.thread, timeout=waitTimeOut) + return True + except ray.exceptions.GetTimeoutError: + return False + #Alternative that was tried: + #return self.thread in ray.wait([self.thread], timeout=waitTimeOut)[0] + #which ran slower in ray 1.9 + else: + return self.thread.finished def _collectRunnerResponse(self): """ diff --git a/ravenframework/raven_ec_qsub_command.sh b/ravenframework/raven_ec_qsub_command.sh index f393fdb165..e5f28a2602 100755 --- a/ravenframework/raven_ec_qsub_command.sh +++ b/ravenframework/raven_ec_qsub_command.sh @@ -8,7 +8,14 @@ fi source /etc/profile.d/modules.sh echo RAVEN_FRAMEWORK_DIR $RAVEN_FRAMEWORK_DIR -source $RAVEN_FRAMEWORK_DIR/../scripts/establish_conda_env.sh --load + +if test -e $RAVEN_FRAMEWORK_DIR/../scripts/establish_conda_env.sh; then + source $RAVEN_FRAMEWORK_DIR/../scripts/establish_conda_env.sh --load +else + echo RAVEN_FRAMEWORK_DIR ERROR + echo FILE $RAVEN_FRAMEWORK_DIR/../scripts/establish_conda_env.sh + echo NOT FOUND +fi module load pbs openmpi which python diff --git a/tests/cluster_tests/RavenRunsRaven/Code/Inner/Simple.py b/tests/cluster_tests/RavenRunsRaven/Code/Inner/Simple.py index 2d13884407..881fa3e310 100644 --- a/tests/cluster_tests/RavenRunsRaven/Code/Inner/Simple.py +++ b/tests/cluster_tests/RavenRunsRaven/Code/Inner/Simple.py @@ -14,6 +14,7 @@ import sys import argparse import configparser +import time def checkAux(): """ @@ -70,7 +71,7 @@ def write(a, b, c, x, y, out): @ In, y, float, float @ In, out, string, filename to write results to """ - print('Writing to', out) + print('Writing to', out, time.ctime()) with open(out, 'w') as f: f.writelines(','.join('abcxy') + '\n') f.writelines(','.join(str(i) for i in [a, b, c, x, y]) + '\n') @@ -82,3 +83,4 @@ def write(a, b, c, x, y, out): a, b, x, y, out = readInput(infileName) c = run(a, b, x, y) write(a, b, c, x, y, out) + print("Goodbye", time.ctime()) diff --git a/tests/cluster_tests/RavenRunsRaven/Code/inner.xml b/tests/cluster_tests/RavenRunsRaven/Code/inner.xml index c962236c76..8a72ebfda1 100644 --- a/tests/cluster_tests/RavenRunsRaven/Code/inner.xml +++ b/tests/cluster_tests/RavenRunsRaven/Code/inner.xml @@ -1,5 +1,5 @@ - + Inner @@ -47,7 +47,7 @@ Simple.py - + diff --git a/tests/cluster_tests/RavenRunsRaven/code.xml b/tests/cluster_tests/RavenRunsRaven/code.xml index 229b3b07fc..cddc0437c3 100644 --- a/tests/cluster_tests/RavenRunsRaven/code.xml +++ b/tests/cluster_tests/RavenRunsRaven/code.xml @@ -1,5 +1,5 @@ - + cluster_tests/RavenRunsRaven.Code talbpaul diff --git a/tests/cluster_tests/RavenRunsRaven/rom.xml b/tests/cluster_tests/RavenRunsRaven/rom.xml index 30772213e8..ae678488f5 100644 --- a/tests/cluster_tests/RavenRunsRaven/rom.xml +++ b/tests/cluster_tests/RavenRunsRaven/rom.xml @@ -1,5 +1,5 @@ - + framework/cluster_tests/RavenRunsRaven.ROM alfoa