Skip to content

Commit

Permalink
Switching to using ray.get instead of ray.wait
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-cogliati-inl committed Apr 12, 2022
1 parent 5f4ba33 commit e76a2bc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
10 changes: 9 additions & 1 deletion ravenframework/Runners/DistributedMemoryRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
4 changes: 3 additions & 1 deletion tests/cluster_tests/RavenRunsRaven/Code/Inner/Simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import sys
import argparse
import configparser
import time

def checkAux():
"""
Expand Down Expand Up @@ -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')
Expand All @@ -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())
2 changes: 1 addition & 1 deletion tests/cluster_tests/RavenRunsRaven/Code/inner.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<Simulation verbosity="debug">
<Simulation verbosity="debug" profile="jobs">

<RunInfo>
<WorkingDir>Inner</WorkingDir>
Expand Down
2 changes: 1 addition & 1 deletion tests/cluster_tests/RavenRunsRaven/code.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<Simulation verbosity="debug">
<Simulation verbosity="debug" profile="jobs">
<TestInfo>
<name>cluster_tests/RavenRunsRaven.Code</name>
<author>talbpaul</author>
Expand Down
2 changes: 1 addition & 1 deletion tests/cluster_tests/RavenRunsRaven/rom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<Simulation verbosity="debug">
<Simulation verbosity="debug" profile="jobs">
<TestInfo>
<name>framework/cluster_tests/RavenRunsRaven.ROM</name>
<author>alfoa</author>
Expand Down

0 comments on commit e76a2bc

Please sign in to comment.