Closed andre-merzky closed 4 years ago
Yeah, I kind of expected that you stumble over that line :-) I am a bit hesitant to change more code, and we need to get this out fast. But then again it looks good... Please do some small tests and commit if you are confident that the multi-pilot case remains functional. Small test case:
#!/usr/bin/env python3
import time
import radical.pilot as rp
try:
session = rp.Session()
pmgr = rp.PilotManager(session=session)
pdesc = rp.ComputePilotDescription({
'resource': 'local.localhost',
'runtime': 60,
'cores': 1
})
pilots = pmgr.submit_pilots([pdesc] * 4)
while True:
time.sleep(1)
states = [p.state for p in pilots]
print(states)
if rp.PMGR_ACTIVE in states:
time.sleep(60)
states = [p.state for p in pilots]
print(states)
assert(len(set(states)) == 1), states
break
except:
session.close(download=False)
raise
Thanks!
@andre-merzky sorry, took some time for me to figure out things! your test works fine, and I see that for Job
instances attribute id
contains data from get_id
. Thus just to keep method get_id
inside Container.get_task
is enough (works for Task
-instances and Task
-based such as Job
-instances). All good! Thanks!
agree with these made changes and have more to confirm: currently we have
t.get_id() == id
inContainer.get_task
here, and originally it wast.id
(before I updated it to use_id
which was taken fromTask.get_id
). Thus wouldt.get_id
givet.id
(which will work only forJob
instances)? or should we make it explicit: