Skip to content

Commit f267b84

Browse files
author
Joeri Hermans
committed
Update README
1 parent d615339 commit f267b84

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

gpus.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@ func ParseAllocatedGPUs() float64 {
4545
if len(line) > 0 {
4646
line = strings.Trim(line, "\"")
4747
descriptor := strings.TrimPrefix(line, "gpu:")
48-
job_gpus, err := strconv.ParseFloat(descriptor, 64)
49-
if err != nil {
50-
num_gpus += job_gpus
51-
}
48+
job_gpus, _ := strconv.ParseFloat(descriptor, 64)
49+
num_gpus += job_gpus
5250
}
5351
}
5452
}
@@ -68,12 +66,8 @@ func ParseTotalGPUs() float64 {
6866
descriptor := strings.Fields(line)[1]
6967
descriptor = strings.TrimPrefix(descriptor, "gpu:")
7068
descriptor = strings.Split(descriptor, "(")[0]
71-
node_gpus, err := strconv.ParseFloat(descriptor, 64)
72-
log.Infof("Number of GPUs %f", node_gpus)
73-
if err != nil {
74-
log.Infof("Adding GPUs %f", node_gpus)
75-
num_gpus += node_gpus
76-
}
69+
node_gpus, _ := strconv.ParseFloat(descriptor, 64)
70+
num_gpus += node_gpus
7771
}
7872
}
7973
}

0 commit comments

Comments
 (0)