diff --git a/Project.toml b/Project.toml index a907cfe..0bd6a04 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GreenFlux" uuid = "ccad5352-7643-4eb2-b711-e9c298e87bf0" authors = ["Eduardo Cueto Mendoza"] -version = "0.1.0" +version = "0.0.4" [deps] CUDAapi = "3895d2a7-ec45-59b8-82bb-cfc6a382f9b3" diff --git a/src/power/powerdraw.jl b/src/power/powerdraw.jl index e12ab4d..0699461 100644 --- a/src/power/powerdraw.jl +++ b/src/power/powerdraw.jl @@ -34,17 +34,20 @@ function gpupowerdraw() usagestr = "" capstr = "" if g[5] == "N/A" - usagestr = "0.0" + usagestr = "0W" else usagestr = usagestr * g[5] end if g[7] == "N/A" - capstr = "0.0" + capstr = "0W" else capstr = capstr * g[7] end - powerdraw = vcat(powerdraw, parse(Float64,usagestr)) - powercap = vcat(powercap, parse(Float64,capstr)) + regexw = r"(\d+)" + wattusg = match(regexw,usagestr) + wattcap = match(regexw,capstr) + powerdraw = vcat(powerdraw, parse(Float64,wattusg.match)) + powercap = vcat(powercap, parse(Float64,wattcap.match)) end usage[count] = mean(powerdraw) cap[count] = mean(powercap)