From e76a2bc59f4beb1de332b5e96db760efd2e3d28d Mon Sep 17 00:00:00 2001 From: "Joshua J. Cogliati" Date: Tue, 12 Apr 2022 15:15:13 -0600 Subject: [PATCH] Switching to using ray.get instead of ray.wait --- ravenframework/Runners/DistributedMemoryRunner.py | 10 +++++++++- .../cluster_tests/RavenRunsRaven/Code/Inner/Simple.py | 4 +++- tests/cluster_tests/RavenRunsRaven/Code/inner.xml | 2 +- tests/cluster_tests/RavenRunsRaven/code.xml | 2 +- tests/cluster_tests/RavenRunsRaven/rom.xml | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ravenframework/Runners/DistributedMemoryRunner.py b/ravenframework/Runners/DistributedMemoryRunner.py index 10f9e5fd8e..690b01d776 100644 --- a/ravenframework/Runners/DistributedMemoryRunner.py +++ b/ravenframework/Runners/DistributedMemoryRunner.py @@ -69,7 +69,15 @@ 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 + else: + self.thread.finished + #return (self.thread in ray.wait([self.thread], timeout=waitTimeOut)[0]) if im.isLibAvail("ray") else self.thread.finished def _collectRunnerResponse(self): """ 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 dc794d7f21..8a72ebfda1 100644 --- a/tests/cluster_tests/RavenRunsRaven/Code/inner.xml +++ b/tests/cluster_tests/RavenRunsRaven/Code/inner.xml @@ -1,5 +1,5 @@ - + Inner 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