Skip to content

Commit

Permalink
Modify behaviour to request all rules in a group to be set as preempt…
Browse files Browse the repository at this point in the history
…ible instances
  • Loading branch information
sposadac committed Aug 4, 2021
1 parent 883c792 commit df666da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/snakefiles/rules.rst
Expand Up @@ -1341,7 +1341,7 @@ However, if we would add ``group: "mygroup"`` to rule ``c``, all jobs would end
Alternatively, groups can be defined via the command line interface.
This enables to almost arbitrarily partition the DAG, e.g. in order to safe network traffic, see :ref:`here <job_grouping>`.
For execution on the cloud using Google Life Science API and preemptible instances, note than if any of the rules in a group is included in the subset of rules to be executed using preembtible instances (with command line option ``--preemptible-rules``), the group will be also scheduled to be executed on a preemptible instance.
For execution on the cloud using Google Life Science API and preemptible instances, we expect all rules in the group to be homogenously set as preemptible instances (e.g., with command-line option ``--preemptible-rules``), such that a preemptible VM is requested for the execution of the group job.
Piped output
------------
Expand Down
8 changes: 7 additions & 1 deletion snakemake/executors/google_lifesciences.py
Expand Up @@ -512,7 +512,13 @@ def _generate_job_resources(self, job):
)

if job.is_group():
preemptible = any(rule in self.preemptible_rules for rule in job.rules)
preemptible = all(rule in self.preemptible_rules for rule in job.rules)
if not preemtible and any(
rule in self.preemptible_rules for rule in job.rules
):
raise WorkflowError(
"All grouped rules should be homogenously set as preemptible rules"
)
else:
preemptible = job.rule.name in self.preemptible_rules
# We add the size for the image itself (10 GB) to bootDiskSizeGb
Expand Down

0 comments on commit df666da

Please sign in to comment.