Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions energyusage/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import queue
import csv

import utils as utils
import convert as convert
import locate as locate
import report as report
import graph
from . import utils as utils
from . import convert as convert
from . import locate as locate
from . import report as report
from . import graph

DELAY = .1 # in seconds

Expand Down Expand Up @@ -148,11 +148,6 @@ def energy(user_func, *args, powerLoss = 0.8, year, printToScreen, timeseries):
# Subtracting baseline wattage to get more accurate result
process_kwh = convert.to_kwh((process_average - baseline_average)*total_time) / powerLoss

if is_nvidia_gpu:
gpu_file = file("GPU", "")
gpu_file.create_gpu(gpu_baseline_average, gpu_process_average)
files.append(file("GPU", ""))

# Logging
if printToScreen:
utils.log("Final Readings", baseline_average, process_average, difference_average, timedelta)
Expand Down
4 changes: 2 additions & 2 deletions energyusage/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from reportlab.graphics.charts.textlabels import Label

import energyusage.convert as convert
import evaluate as evaluate
import locate
from . import evaluate as evaluate
from . import locate

import math

Expand Down
2 changes: 1 addition & 1 deletion energyusage/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,6 @@ def valid_gpu():
try:
bash_command = "nvidia-smi > /dev/null 2>&1" #we must pipe to ignore error message
output = subprocess.check_call(['bash', '-c', bash_command])
return isinstance(output, float) # directly return a boolean
return isinstance(output, int) # directly return a boolean
except:
return False