diff --git a/run_service.py b/run_service.py index 8c041ba..d606fbf 100755 --- a/run_service.py +++ b/run_service.py @@ -2,6 +2,7 @@ import psutil import pickle import arguments from time import sleep +from pathlib import Path import subprocess as sub from arguments import makeArguments @@ -89,15 +90,26 @@ with open("configuration.pkl", "wb") as f: sleep(3) +cpu_watt = "cpu_watt.sh" +ram = "mem_free.sh" +gpu = "radeontop.sh" + +path_cpu_watt = Path(cpu_watt) +path_ram = Path(ram) +path_gpu = Path(gpu) + +path_cpu_watt = str(Path(cpu_watt).absolute()) + '/' + cpu_watt +path_ram = str(Path(ram).absolute()) + '/' + ram +path_gpu = str(Path(gpu).absolute()) + '/' + gpu if cmd[1] == "main_frequentist.py": - cmd2 = ["./cpu_watt.sh", "freq_{}_cpu_watts".format(wide)] - cmd3 = ["./mem_free.sh", "freq_{}_ram_use".format(wide)] - cmd4 = ["./radeontop.sh", "freq_{}_flop_app".format(wide)] + cmd2 = [path_cpu_watt, "freq_{}_cpu_watts".format(wide)] + cmd3 = [path_ram, "freq_{}_ram_use".format(wide)] + cmd4 = [path_gpu, "freq_{}_flop_app".format(wide)] elif cmd[1] == "main_bayesian.py": - cmd2 = ["./cpu_watt.sh", "bayes_{}_cpu_watts".format(wide)] - cmd3 = ["./mem_free.sh", "bayes_{}_ram_use".format(wide)] - cmd4 = ["./radeontop.sh", "bayes_{}_flop_app".format(wide)] + cmd2 = [path_cpu_watt, "bayes_{}_cpu_watts".format(wide)] + cmd3 = [path_ram, "bayes_{}_ram_use".format(wide)] + cmd4 = [path_gpu, "bayes_{}_flop_app".format(wide)] path = sub.check_output(['pwd'])