From 341ff1fbc70e9a8b66d4cbf0abd553c9b81c76c2 Mon Sep 17 00:00:00 2001 From: Adam Novak Date: Tue, 21 Nov 2023 03:36:53 -0500 Subject: [PATCH] Only count output file usage when using the file store (#4692) --- src/toil/cwl/cwltoil.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/toil/cwl/cwltoil.py b/src/toil/cwl/cwltoil.py index 1b0d0116d5..8a673240a0 100644 --- a/src/toil/cwl/cwltoil.py +++ b/src/toil/cwl/cwltoil.py @@ -2265,13 +2265,20 @@ def __init__( ) preemptible = parsed_value + # We always need space for the temporary files for the job + total_disk = cast(int, req["tmpdirSize"]) * (2**20) + if not getattr(runtime_context, "bypass_file_store", False): + # If using the Toil file store, we also need space for the output + # files, which may need to be stored locally and copied off the + # node. + total_disk += cast(int, req["outdirSize"]) * (2**20) + # If not using the Toil file store, output files just go directly to + # their final homes their space doesn't need to be accounted per-job. + super().__init__( cores=req["cores"], memory=int(req["ram"] * (2**20)), - disk=int( - (cast(int, req["tmpdirSize"]) * (2**20)) - + (cast(int, req["outdirSize"]) * (2**20)) - ), + disk=int(total_disk), accelerators=accelerators, preemptible=preemptible, tool_id=self.cwltool.tool["id"],