hdeeprm.util module

Utilities for parsing and generating Workloads, Platforms and Resource Hierarchies.

hdeeprm.util.generate_platform(platform_file_path: str, gen_platform_xml: bool = True, gen_res_hierarchy: bool = False) → None[source]

HDeepRM JSON Platform -> Batsim-ready XML format + Resource Hierarchy.

Parses a HDeepRM JSON formatted platform definition and outputs both a Batsim-ready XML file and the Resource Hierarchy pickled for the Decision System to understand relations between Cores, Processors and Nodes.

Parameters:
  • platform_file_path (str) – Location of the HDeepRM Platform file in the system.
  • gen_platform_xml (bool) – If True, generate the Platform XML. Defaults to True.
  • gen_res_hierarchy (bool) – If True, generate the Resource Hierarchy. Defaults to False.
hdeeprm.util.generate_workload(workload_file_path: str, nb_cores: int, nb_jobs: int, custom_workload_path: str = None) → None[source]

SWF-formatted Workload -> Batsim-ready JSON format.

Parses a SWF formatted Workload file into a Batsim-ready JSON file. Generates as many jobs as specified in “nb_jobs”. It also generates the job resource requirement limits from the Workload.

Parameters:
  • workload_file_path (str) – Location of the SWF Workload file in the system.
  • nb_cores (int) – Total number of Cores in the Platform.
  • nb_jobs (int) – Total number of jobs for the generated Workload.
  • custom_workload_path (str) – Path for the custom workload JSON file. None by default.