Skip to content

Commit 024c3c0

Browse files
committed
fix comments
1 parent 4c5dc70 commit 024c3c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/ccontrol/ccontrol.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ func ShowPartitions(partitionName string, queryAll bool) util.CraneCmdError {
236236
formatDeviceMap(partitionInfo.ResTotal.GetDeviceMap()),
237237
formatDeviceMap(partitionInfo.ResAvail.GetDeviceMap()),
238238
formatDeviceMap(partitionInfo.ResAlloc.GetDeviceMap()),
239-
formatMemToMB(partitionInfo.DefaultMemPerCpu),
240-
formatMemToMB(partitionInfo.MaxMemPerCpu),
239+
util.FormatMemToMB(partitionInfo.DefaultMemPerCpu),
240+
util.FormatMemToMB(partitionInfo.MaxMemPerCpu),
241241
partitionInfo.Hostlist)
242242
}
243243
}
@@ -295,7 +295,7 @@ func ShowReservations(reservationName string, queryAll bool) util.CraneCmdError
295295
str += fmt.Sprintf("DeniedUsers=%s\n", strings.Join(reservationInfo.DeniedUsers, ","))
296296
}
297297
str += fmt.Sprintf("TotalCPU=%.2f AvailCPU=%.2f AllocCPU=%.2f\n", math.Abs(reservationInfo.ResTotal.AllocatableRes.CpuCoreLimit), math.Abs(reservationInfo.ResAvail.AllocatableRes.CpuCoreLimit), math.Abs(reservationInfo.ResAlloc.AllocatableRes.CpuCoreLimit))
298-
str += fmt.Sprintf("TotalMem=%s AvailMem=%s AllocMem=%s\n", formatMemToMB(reservationInfo.ResTotal.AllocatableRes.MemoryLimitBytes), formatMemToMB(reservationInfo.ResAvail.AllocatableRes.MemoryLimitBytes), formatMemToMB(reservationInfo.ResAlloc.AllocatableRes.MemoryLimitBytes))
298+
str += fmt.Sprintf("TotalMem=%s AvailMem=%s AllocMem=%s\n", util.FormatMemToMB(reservationInfo.ResTotal.AllocatableRes.MemoryLimitBytes), util.FormatMemToMB(reservationInfo.ResAvail.AllocatableRes.MemoryLimitBytes), util.FormatMemToMB(reservationInfo.ResAlloc.AllocatableRes.MemoryLimitBytes))
299299
str += fmt.Sprintf("TotalGres=%s AvailGres=%s AllocGres=%s\n", formatDeviceMap(reservationInfo.ResTotal.GetDeviceMap()), formatDeviceMap(reservationInfo.ResAvail.GetDeviceMap()), formatDeviceMap(reservationInfo.ResAlloc.GetDeviceMap()))
300300
fmt.Println(str)
301301
}

0 commit comments

Comments
 (0)