Skip to content

Commit

Permalink
Updatd will_run_on_cluster to now warn if to_cluster is active but DR…
Browse files Browse the repository at this point in the history
…MAA is not present
  • Loading branch information
Acribbs committed Dec 31, 2024
1 parent 243f74e commit f1f9274
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cgatcore/pipeline/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,11 +440,14 @@ def join_statements(statements, infile, outfile=None):


def will_run_on_cluster(options):
run_on_cluster = options.get("to_cluster", True) and \
not options.get("without_cluster", False) and \
HAS_DRMAA and \
GLOBAL_SESSION is not None
return run_on_cluster
wants_cluster = options.get("to_cluster", True) and \
not options.get("without_cluster", False)

if wants_cluster and not HAS_DRMAA:
raise ValueError("Cluster execution requested (to_cluster=True) but DRMAA library is not available. "
"Please install drmaa package in your environment to enable cluster execution.")

return wants_cluster and HAS_DRMAA and GLOBAL_SESSION is not None


class Executor(object):
Expand Down

0 comments on commit f1f9274

Please sign in to comment.