Skip to content

mem_mb and mem_mib do not match mem when mem is specified with unit. #2774

@BEFH

Description

@BEFH

Snakemake version

Version 8.9.0

Describe the bug

When mem is specified with a unit, the mem_mb and mem_mib resources do not make sense. For example, when the request is mem="2G", mem_mb is 1907 and mem_mib is 954.

If 2G is supposed to be gigabyes, then mem_mb should be 2000 and mem_mib should be 1907. If 2G is supposed to be gibibytes, then mem_mb should be 2147 and mem_mib should be 2048.

Logs

[Fri Mar 22 14:02:58 2024]
rule test:
    output: test.txt
    jobid: 1
    reason: Missing output files: test.txt
    threads: 6
    resources: mem_mb=1907, mem_mib=954, disk_mb=1000, disk_mib=954, tmpdir=<TBD>, lsf_project=acc_LOAD, lsf_queue=premium, runtime=2880, mem=2G

Minimal example

Here is a test rule:

rule test:
  output: "test.txt"
  threads: 6
  resources:
    runtime="2d",
    mem="2G"
  shell: ".echo test > {output}"

Additional context

This may be partially related to #2695
I am using the lsf executor plugin, and I am trying to troubleshoot if this is partially due to something I did in the plugin (mem_mib is not shown when not using the cluster and mem_mb is what mem_mib should be if 2G is gigabytes), but I don't remember doing anything that could change the printed resources.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions