|
2 | 2 | # partition.pyx - interface to work with partitions in slurm |
3 | 3 | ######################################################################### |
4 | 4 | # Copyright (C) 2023 Toni Harzendorf <[email protected]> |
5 | | -# Copyright (C) 2023 PySlurm Developers |
| 5 | +# Copyright (C) 2025 PySlurm Developers |
6 | 6 | # |
7 | 7 | # This file is part of PySlurm |
8 | 8 | # |
@@ -31,6 +31,7 @@ from pyslurm.core.error import RPCError, verify_rpc |
31 | 31 | from pyslurm.utils.ctime import timestamp_to_date, _raw_time |
32 | 32 | from pyslurm.constants import UNLIMITED |
33 | 33 | from pyslurm.settings import LOCAL_CLUSTER |
| 34 | +from pyslurm.core.slurmctld.config import _get_memory |
34 | 35 | from pyslurm import xcollections |
35 | 36 | from pyslurm.utils.helpers import ( |
36 | 37 | uid_to_name, |
@@ -832,21 +833,3 @@ cdef _concat_job_default_str(typ, val, char **job_defaults_str): |
832 | 833 | current.update({typ : _val}) |
833 | 834 |
|
834 | 835 | cstr.from_dict(job_defaults_str, current) |
835 | | - |
836 | | - |
837 | | -def _get_memory(value, per_cpu): |
838 | | - if value != slurm.NO_VAL64: |
839 | | - if value & slurm.MEM_PER_CPU and per_cpu: |
840 | | - if value == slurm.MEM_PER_CPU: |
841 | | - return UNLIMITED |
842 | | - return u64_parse(value & (~slurm.MEM_PER_CPU)) |
843 | | - |
844 | | - # For these values, Slurm interprets 0 as being equal to |
845 | | - # INFINITE/UNLIMITED |
846 | | - elif value == 0 and not per_cpu: |
847 | | - return UNLIMITED |
848 | | - |
849 | | - elif not value & slurm.MEM_PER_CPU and not per_cpu: |
850 | | - return u64_parse(value) |
851 | | - |
852 | | - return None |
0 commit comments