fix(slurm): correct PartitionInfoMaximums CpusPerNode/CpusPerSocket types to Uint32NoVal

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
dailz
2026-04-10 11:39:29 +08:00
parent 34ba617cbf
commit 30f0fbc34b
3 changed files with 5 additions and 5 deletions

View File

@@ -307,7 +307,7 @@ func mapPartition(pi slurm.PartitionInfo) model.PartitionResponse {
}
var maxCPUsPerNode *int32
if pi.Maximums != nil {
maxCPUsPerNode = pi.Maximums.CpusPerNode
maxCPUsPerNode = mapUint32NoValToInt32(pi.Maximums.CpusPerNode)
}
var minNodes *int32
if pi.Minimums != nil {

View File

@@ -54,8 +54,8 @@ type PartitionInfoMaximumsOversubscribe struct {
// PartitionInfoMaximums represents maximum resource limits for a partition (v0.0.40_partition_info.maximums).
type PartitionInfoMaximums struct {
CpusPerNode *int32 `json:"cpus_per_node,omitempty"`
CpusPerSocket *int32 `json:"cpus_per_socket,omitempty"`
CpusPerNode *Uint32NoVal `json:"cpus_per_node,omitempty"`
CpusPerSocket *Uint32NoVal `json:"cpus_per_socket,omitempty"`
MemoryPerCPU *int64 `json:"memory_per_cpu,omitempty"`
PartitionMemoryPerCPU *Uint64NoVal `json:"partition_memory_per_cpu,omitempty"`
PartitionMemoryPerNode *Uint64NoVal `json:"partition_memory_per_node,omitempty"`

View File

@@ -43,8 +43,8 @@ func TestPartitionInfoRoundTrip(t *testing.T) {
},
GraceTime: Ptr(int32(300)),
Maximums: &PartitionInfoMaximums{
CpusPerNode: Ptr(int32(128)),
CpusPerSocket: Ptr(int32(64)),
CpusPerNode: &Uint32NoVal{Set: Ptr(true), Number: Ptr(int64(128))},
CpusPerSocket: &Uint32NoVal{Set: Ptr(true), Number: Ptr(int64(64))},
MemoryPerCPU: Ptr(int64(8192)),
PartitionMemoryPerCPU: &Uint64NoVal{Set: Ptr(true), Number: Ptr(int64(8192))},
PartitionMemoryPerNode: &Uint64NoVal{Set: Ptr(true), Number: Ptr(int64(262144))},