Skip to content

Commit 7ae757e

Browse files
committed
Changes units to GB in gpu module.
1 parent b46128d commit 7ae757e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/modules/gpu

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ init_module_gpu()
3535
printf "%-17s " "#TIME" >$OUT_FILE
3636

3737
for gpu_no in `seq 0 $LAST_GPU_NO`; do
38-
printf "%-17s %-17s " "gpu_${gpu_no}_avail" "gpu_${gpu_no}_used" >>$OUT_FILE
38+
printf "%-17s %-17s " "gpu_${gpu_no}_avail_GB" "gpu_${gpu_no}_used_GB" >>$OUT_FILE
3939
done
4040
printf "\n" >>$OUT_FILE
4141

@@ -60,7 +60,8 @@ collect_data_gpu()
6060

6161
line=$( printf "%-17d " $current_time )
6262
for val in $gpu_free_used; do
63-
line+=$( printf "%-17d " $val )
63+
valgb=$( echo "scale=3; $val/1000" | bc )
64+
line+=$( printf "%-17.3f " $valgb )
6465
done
6566
line+=$( printf "\n" )
6667

@@ -166,7 +167,7 @@ plot_data_gpu()
166167

167168
printf "%s \n" "var options = { " >> $OUT_FILE
168169
printf "%s \n" "chart: {" >> $OUT_FILE
169-
printf "%s \n" "title: 'GPU ${gpu_no} Memory (MB)'," >> $OUT_FILE
170+
printf "%s \n" "title: 'GPU ${gpu_no} Memory (GB)'," >> $OUT_FILE
170171
#printf "%s \n" "subtitle: '(GB)' " >> $OUT_FILE
171172
printf "%s \n" "}," >> $OUT_FILE
172173
printf "%s \n" "width: 600, " >> $OUT_FILE

0 commit comments

Comments
 (0)