From 18689b42dcc690deea7f27dc909379f603aaa1a9 Mon Sep 17 00:00:00 2001 From: "Filipe G. Vieira" <1151762+fgvieira@users.noreply.github.com> Date: Thu, 15 Feb 2024 11:12:39 +0100 Subject: [PATCH] fix: binary mem (#2695) ### Description ### QC * [ ] The PR contains a test case for the changes or the changes are already covered by an existing test case. * [ ] The documentation (`docs/`) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake). --- snakemake/resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snakemake/resources.py b/snakemake/resources.py index 98a5d0c4b..8db3fd483 100644 --- a/snakemake/resources.py +++ b/snakemake/resources.py @@ -619,7 +619,7 @@ def infer_resources(name, value, resources: dict): raise WorkflowError( f"Cannot parse mem or disk value into size in MB for setting {inferred_name} resource: {value}" ) - resources[inferred_name] = max(int(round(in_bytes / 1000 / 1000)), 1) + resources[inferred_name] = max(int(round(in_bytes / 1024 / 1024)), 1) elif name == "runtime" and isinstance(value, str): try: resources["runtime"] = max(int(round(parse_timespan(value) / 60)), 1)