Skip to content

[Code scan] Omit empty queue and zero-GPU scheduler directives #611

Description

@njzjz

Found by a Codex global repository scan of deepmodeling/dpdispatcher at commit 98a9e08.

Problem
Several scheduler headers emit queue or GPU directives even when the corresponding resource value is empty or zero.

Relevant code

pbs_script_header_dict["queue_name_line"] = f"#PBS -q {resources.queue_name}"

pbs_script_header_dict["queue_name_line"] = f"#PBS -q {resources.queue_name}"

"lsf_nodes_line": f"#BSUB -n {resources.number_node * resources.cpu_per_node}",
"lsf_ptile_line": f"#BSUB -R 'span[ptile={resources.cpu_per_node}]'",
"lsf_partition_line": f"#BSUB -q {resources.queue_name}",

"JH_UniScheduler_nodes_line": f"#JSUB -n {resources.number_node * resources.cpu_per_node}",
"JH_UniScheduler_ptile_line": f"#JSUB -R 'span[ptile={resources.cpu_per_node}]'",
"JH_UniScheduler_partition_line": f"#JSUB -q {resources.queue_name}",
}
custom_gpu_line = resources.kwargs.get("custom_gpu_line", None)
if not custom_gpu_line:
script_header_dict["JH_UniScheduler_number_gpu_line"] = (
f"#JSUB -gpgpu {resources.gpu_per_node}"

fugaku_script_header_dict["queue_name_line"] = (
f'#PJM -L "rscgrp={resources.queue_name}"'

Impact
Default CPU jobs can generate directives such as #PBS -q , #BSUB -q , #JSUB -q , #JSUB -gpgpu 0, or rscgrp=. Some scheduler installations reject these instead of applying defaults.

Suggested fix
Follow the Slurm-style behavior: omit queue directives when queue_name is empty and omit GPU directives when gpu_per_node == 0, unless a scheduler-specific custom line is explicitly supplied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions