Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed an issue where dependencies were not being set #238

Merged
merged 5 commits into from
May 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
can_skip and in_queue are now methods
YHordijk committed May 17, 2024
commit 15790b6e7f8fb2adce18121c09826e830041e2d0
6 changes: 2 additions & 4 deletions src/tcutility/job/generic.py
Original file line number Diff line number Diff line change
@@ -75,7 +75,6 @@ def __exit__(self, exc_type, exc_value, exc_tb):
return True
self.run()

@property
def can_skip(self):
'''
Check whether the job can be skipped. We check this by loading the calculation and checking if the job status was fatal.
@@ -90,7 +89,6 @@ def can_skip(self):
res = results.read(self.workdir)
return not res.status.fatal

@property
def in_queue(self):
'''
Check whether the job is currently managed by slurm.
@@ -234,8 +232,8 @@ def dependency(self, otherjob: 'Job'):
Set a dependency between this job and otherjob.
This means that this job will run after the other job is finished running succesfully.
'''
print(otherjob, otherjob.slurm_job_id, otherjob.can_skip, otherjob.in_queue)
if otherjob.can_skip and not otherjob.in_queue:
print(otherjob, otherjob.slurm_job_id, otherjob.can_skip(), otherjob.in_queue())
if otherjob.can_skip() and not otherjob.in_queue():
return

if hasattr(otherjob, 'slurm_job_id'):