Skip to content

Missing field in ctypedef struct job_resources #380

@njcarriero

Description

@njcarriero

The definition of the struct job_resources in slurm/extra.pxi is out of sync wrt the definition in SchedMD's src/common/job_resources.h. The field next_step_node_inx is missing, leading to core dumps in pyslurm's job.get_resource_layout_per_node method. Adding it appears to have resolved the segfault.


diff --git a/pyslurm/slurm/extra.pxi b/pyslurm/slurm/extra.pxi
index 09dfae7..c6a8a42 100644
--- a/pyslurm/slurm/extra.pxi
+++ b/pyslurm/slurm/extra.pxi
@@ -153,6 +153,7 @@ ctypedef struct job_resources:
     uint16_t  cr_type
     uint64_t *memory_allocated
     uint64_t *memory_used
+    uint32_t  next_step_node_inx
     uint32_t  nhosts
     bitstr_t *node_bitmap
     uint32_t  node_req

FWIW, the comment block prior to get_resource_layout_per_node is out of date wrt to SchedMD's code. The code on which the function was modeled is no longer in src/api/job_info.c. It has been moved to src/scontrol/info_job.c.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions