apps.crc_idle ======================= .. autoapi-nested-parse:: Command line application for listing idle Slurm resources. The application relies on the info command to identify idle resources and summarize how many resources are available on each cluster partition. Resource summaries are provided for GPU and CPU partitions. Module Contents --------------- .. py:class:: CrcIdle Bases: :py:obj:`apps.utils.cli.BaseParser` Display idle Slurm resources. .. py:attribute:: cluster_types .. py:method:: get_cluster_list(args: argparse.Namespace) -> tuple[str] Return a list of clusters specified by command line arguments. Returns a tuple of clusters specified by command line arguments. If no clusters were specified, then return a tuple of all cluster names. :param args: Parsed command line arguments :returns: A tuple of cluster names .. py:method:: _count_idle_cpu_resources(cluster: str, partition: str) -> dict[int, dict[str, int]] :staticmethod: Return the idle CPU resources on a given cluster partition. :param cluster: The cluster to print a summary for. :param partition: The partition in the parent cluster. :returns: A dictionary mapping the number of idle resources to a dictionary with the number of nodes with that many idle resources, minimum free memory, and maximum free memory on these nodes. .. py:method:: _count_idle_gpu_resources(cluster: str, partition: str) -> dict[int, dict[str, int]] :staticmethod: Return idle GPU resources on a given cluster partition. If the host node is in a `drain` state, the GPUs are reported as unavailable. :param cluster: The cluster to print a summary for. :param partition: The partition in the parent cluster. :returns: A dictionary mapping the number of idle resources to the number of nodes with that many idle resources. .. py:method:: count_idle_resources(cluster: str, partition: str) -> dict[int, dict[str, int]] Determine the number of idle resources on a given cluster partition. The returned dictionary maps the number of idle resources (e.g., cores) to the number of nodes in the partition having that many resources idle. :param cluster: The cluster to print a summary for. :param partition: The partition in the parent cluster. :returns: A dictionary mapping idle resources to number of nodes. .. py:method:: print_partition_summary(cluster: str, partition: str, idle_resources: dict) -> None Print a summary of idle resources in a single partition :param cluster: The cluster to print a summary for :param partition: The partition in the parent cluster :param idle_resources: Dictionary mapping idle resources to number of nodes .. py:method:: app_logic(args: argparse.Namespace) -> None Logic to evaluate when executing the application. :param args: Parsed command line arguments.