diff --git a/slurmio/slurmio.py b/slurmio/slurmio.py index 5ffd3ae..0c3838c 100644 --- a/slurmio/slurmio.py +++ b/slurmio/slurmio.py @@ -166,6 +166,6 @@ def _trackable_resources(self) -> dict: def convert_mem_to_bytes(s): if s.endswith("G"): - return int(s[:-1]) * 10**6 + return int(s[:-1]) * 10**9 else: return int(s) diff --git a/tests/tests/test_slurmio.py b/tests/tests/test_slurmio.py index 04df970..08b8023 100644 --- a/tests/tests/test_slurmio.py +++ b/tests/tests/test_slurmio.py @@ -20,8 +20,8 @@ def test_slurm_environment(): assert 12 == params.allocated_cores assert 1 == params.requested_nodes assert 1 == params.allocated_nodes - assert 18000000 == params.requested_memory - assert 18000000 == params.allocated_memory + assert 18 * 1e9 == params.requested_memory + assert 18 * 1e9 == params.allocated_memory assert "12" == params._trackable_resources["cpu"] assert "18G" == params._trackable_resources["mem"] assert "1" == params._trackable_resources["node"]