Skip to content

[Code scan] Remote job submission crashes when resources are omitted #133

Open

Description

@njzjz

Source: Codex global repository scan of deepmodeling/dpti at commit b719828.
Project: DeepModeling Agent Code Scan

Problem
_set_default_resource(None) creates a local dict but does not return it. Public remote-job script generation paths call _set_default_resource(resources) or _set_default_resource(res) and then immediately dereference the original argument, which is still None. Omitted resources therefore crash instead of using defaults.

Code references

def _set_default_resource(res) :

_default_item(res, 'with_mpi', False)

_set_default_resource(resources)

_set_default_resource(res)

_set_default_resource(res)

Reproduction
Call _make_script(..., resources=None) on CloudMachineJob, or _make_script(..., res=None) on SlurmJob or PBSJob.

Expected result
Default resources should be returned and assigned before any dictionary access, or None should be rejected with a clear validation error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions