Commit 130be063 authored by MOMMESSIN Clement's avatar MOMMESSIN Clement

Trying to make tests work

parent 7f2068a2
......@@ -102,29 +102,19 @@ def execute_cl(
stderr=None,
on_failure=None,
verbose=False):
try:
if verbose:
print("Starting: {}".format(" ".join(cl)), end="")
if stdout:
print(" 1>{}".format(stdout.name), end="")
if stderr:
print(" 2>{}".format(stderr.name), end="")
print()
if verbose:
print("Starting: {}".format(" ".join(cl)), end="")
if stdout:
print(" 1>{}".format(stdout.name), end="")
if stderr:
print(" 2>{}".format(stderr.name), end="")
print()
exec = subprocess.Popen(
cl, stdout=stdout, stderr=stderr)
exec.name = name
return exec
exec = subprocess.Popen(
cl, stdout=stdout, stderr=stderr,
preexec_fn=os.setsid)
exec.name = name
return exec
except PermissionError:
print(
"Failed to run {}: {}".format(name,
" ".join(sched_cl)),
file=sys.stderr)
if on_failure:
return on_failure(name, cl)
else:
sys.exit(2)
def terminate_cl(p, terminate=False):
......
......@@ -47,24 +47,16 @@ class TestCommand(UserCommand):
description = 'Run tests'
user_options = [
('batsim-bin=', None, 'Path/to/batsim/binary'),
('workloads-basedir=', None, 'Path/to/batsim/workloads'),
('platforms-basedir=', None, 'Path/to/batsim/platforms')
('batsim-bin=', None, 'Path/to/batsim/binary')
]
def initialize_options(self):
self.batsim_bin = None
self.workloads_basedir = None
self.platforms_basedir = None
def finalize_options(self):
self.args = []
if self.batsim_bin is not None:
self.args.append('BATSIMBIN=--batsim-bin=' + str(self.batsim_bin))
if self.workloads_basedir is not None:
self.args.append('WORKLOADSDIR=--workloads-basedir=' + str(self.workloads_basedir))
if self.platforms_basedir is not None:
self.args.append('PLATFORMSDIR=--platforms-basedir=' + str(self.platforms_basedir))
def run(self):
if len(self.args) > 0:
......
......@@ -13,7 +13,7 @@ simuls: testIntervals $(SIMULS_OUT) coverage_html
fi
coverage_html: ../.coverage
cd ..; coverage html -i -d tests/coverage_html
cd ..; python3 -m coverage html -i -d tests/coverage_html
testIntervals: generate
cd ..; python3 -m coverage run -a schedulers/intervalContainer.py
......@@ -30,7 +30,7 @@ gantts_okular: $(GANTTS_OUT)
python3 ../../../../evalys/evalys/gantt.py $* $*/gantt.png
generate:
python3 generate.py $(BATSIMBIN) $(WORKLOADSDIR) $(PLATFORMSDIR)
python3 generate.py $(BATSIMBIN)
clean:
rm tests/*/out_jobs.csv
......
......@@ -7,94 +7,6 @@ import os.path
import json
import copy
'''
def generate_energy(
workloads_basedir,
platforms_basedir,
batsim_bin,
batsim_args,
options):
schedulers = []
budgets = [0, 2, 0.5]
name_allow = {}
name_allow[(True, False)] = "energyBud"
name_allow[(True, True)] = "reducePC"
name_allow[(False, True)] = "PC"
name_allow[(False, False)] = "SHIT"
name_shut = {}
name_shut[True] = "SHUT"
name_shut[False] = "IDLE"
schedulers += [{
"name_expe": "easyEnergyBudget_" + str(b) + "_" + name_allow[allow] + "_" + name_shut[shut],
"name":"easyEnergyBudget",
"verbose":True,
"protection":True,
"interpreter": "coverage",
"options": {
"budget_total": 100 * b * 100 + 30 * (7 - b) * 100,
"budget_start": 10,
"budget_end": 110,
"allow_FCFS_jobs_to_use_budget_saved_measured": allow[0],
"reduce_powercap_to_save_energy": allow[1],
"monitoring_period":5,
"power_idle": 30.0,
"power_compute": 100.0,
"opportunist_shutdown": shut,
"pstate_switchon": 0,
"pstate_switchoff": 1,
"timeto_switchoff": 5,
"timeto_switchon": 25
}
} for b in budgets for allow in [(True, False), (True, True), (False, True)] for shut in [True, False]]
budgets = [1000 * 7 * 30 + 30 * 3 * 70, 1000 * 7 * 30]
schedulers += [
{"name_expe": "easyEnergyBudget_" + str(b) + "on1000_" +
name_allow[allow] + "_" + name_shut[shut],
"name": "easyEnergyBudget", "verbose": True, "protection": True,
"interpreter": "coverage",
"options":
{"budget_total": b, "budget_start": 10, "budget_end": 1010,
"allow_FCFS_jobs_to_use_budget_saved_measured": allow[0],
"reduce_powercap_to_save_energy": allow[1],
"monitoring_period": 5, "power_idle": 30.0, "power_compute": 100.0,
"opportunist_shutdown": shut, "pstate_switchon": 0,
"pstate_switchoff": 1, "timeto_switchoff": 5, "timeto_switchon": 25}}
for b in budgets
for allow in [(True, False),
(True, True),
(False, True)] for shut in [True, False]]
workloads_to_use = [os.path.join(workloads_basedir, "stupid.json")]
options += [{
# where all output files (stdins, stderrs, csvs...) will be outputed.
"output-dir": "SELF",
# if set to "SELF" then output on the same dir as this option file.
"export": "out", # The export filename prefix used to generate simulation output
"batsim": {
"executable": {
"path": batsim_bin,
"args": batsim_args,
},
"platform": os.path.join(platforms_basedir, "energy_platform_homogeneous_no_net.xml"),
"workload": w,
"energy": True, # Enables energy-aware experiments
"disable-schedule-tracing": True, # remove paje output
"verbosity": "information" # Sets the Batsim verbosity level. Available values
# are : quiet, network-only,
# information (default), debug.
},
"scheduler": copy.deepcopy(s)
} for s in schedulers for w in workloads_to_use]
'''
def generate_basic(
workloads_basedir,
......@@ -106,7 +18,7 @@ def generate_basic(
schedulers += [
{
"name_expe": "basic_filler_sched",
"name_expe": "basic_filler_sched_",
"name": "fillerSched",
"verbose": False,
"protection": True,
......@@ -155,7 +67,7 @@ def generate_sched_static(
schedulers += [
{
"name_expe": "sched_fillerSched",
"name_expe": "sched_fillerSched_",
"name": "schedFiller",
"verbose": False,
"protection": True,
......@@ -165,7 +77,7 @@ def generate_sched_static(
"dynamic":False
},
{
"name_expe": "sched_backfilling",
"name_expe": "sched_backfilling_",
"name": "schedEasySjfBackfill",
"verbose": False,
"protection": True,
......@@ -177,7 +89,7 @@ def generate_sched_static(
]
workloads_to_use = [
os.path.join(workloads_basedir, "simple_delay_workload.json")]
os.path.join(workloads_basedir, "test_delays.json")]
options += [{
# where all output files (stdins, stderrs, csvs...) will be outputed.
......@@ -215,7 +127,7 @@ def generate_sched_script(
schedulers += [
{
"name_expe": "sched_fillerSched",
"name_expe": "sched_fillerSched_",
"name": "schedFiller",
"verbose": False,
"protection": True,
......@@ -224,7 +136,7 @@ def generate_sched_script(
}
},
{
"name_expe": "sched_backfilling",
"name_expe": "sched_backfilling_",
"name": "schedEasySjfBackfill",
"verbose": False,
"protection": True,
......@@ -347,7 +259,7 @@ def do_generate(options):
workload_name = opt["batsim"]["workload-script"]["path"]
except KeyError:
workload_name = ""
opt["scheduler"]["name_expe"] += "_" + os.path.splitext(
opt["scheduler"]["name_expe"] += os.path.splitext(
os.path.basename(workload_name))[0]
new_dir = "tests/" + opt["scheduler"]["name_expe"]
......@@ -364,34 +276,26 @@ def main(args):
options = []
basic = False
energy = False
sched = False
workloads_basedir = "../../workloads"
platforms_basedir = "../../platforms"
workloads_basedir = "tests/workloads"
platforms_basedir = "tests/platforms"
batsim_bin = None
batsim_args = []
for arg in args:
if arg == "--basic":
basic = True
elif arg == "--energy":
energy = True
elif arg == "--sched":
sched = True
elif arg.startswith("--workloads-basedir="):
workloads_basedir = arg.split("=")[1]
elif arg.startswith("--platforms-basedir="):
platforms_basedir = arg.split("=")[1]
elif arg.startswith("--batsim-bin="):
batsim_bin = arg.split("=")[1]
else:
print("Unknown argument: {}".format(arg))
return 1
if not energy and not sched and not basic:
if not sched and not basic:
basic = True
energy = True
sched = True
if not batsim_bin:
......@@ -406,15 +310,6 @@ def main(args):
batsim_args,
options)
''' easyEnergyBudget scheduler is no longer maintained
if energy:
generate_energy(
workloads_basedir,
platforms_basedir,
batsim_bin,
batsim_args,
options)'''
if sched:
generate_sched(
workloads_basedir,
......
This diff is collapsed.
{
"nb_res": 7,
"jobs": [
{"id":1, "subtime":0, "walltime": 100, "res": 2, "profile": "5"},
{"id":2, "subtime":0.1, "walltime": 10, "res": 6, "profile": "1"},
{"id":3, "subtime":0.1, "walltime": 50, "res": 1, "profile": "5"},
{"id":4, "subtime":0.2, "walltime": 10, "res": 1, "profile": "1"},
{"id":5, "subtime":0.2, "walltime": 10, "res": 1, "profile": "1"},
{"id":6, "subtime":0.2, "walltime": 10, "res": 1, "profile": "1"},
{"id":7, "subtime":0.2, "walltime": 10, "res": 1, "profile": "1"},
{"id":8, "subtime":0.2, "walltime": 10, "res": 1, "profile": "1"},
{"id":9, "subtime":0.2, "walltime": 10, "res": 1, "profile": "1"},
{"id":10, "subtime":0.2, "walltime": 10, "res": 1, "profile": "1"},
{"id":21, "subtime":10, "walltime": 10, "res": 1, "profile": "1"},
{"id":22, "subtime":10.1, "walltime": 100, "res": 1, "profile": "5"},
{"id":23, "subtime":11, "walltime": 10, "res": 7, "profile": "1"},
{"id":24, "subtime":11, "walltime": 10, "res": 1, "profile": "1"},
{"id":25, "subtime":11.5, "walltime": 5000, "res": 1, "profile": "5"},
{"id":26, "subtime":12, "walltime": 10, "res": 1, "profile": "1"},
{"id":40, "subtime":30, "walltime": 10, "res": 2, "profile": "1"},
{"id":41, "subtime":30.1, "walltime": 10, "res": 2, "profile": "1"},
{"id":42, "subtime":30.2, "walltime": 100, "res": 2, "profile": "5"},
{"id":43, "subtime":30.3, "walltime": 10, "res": 6, "profile": "1"},
{"id":44, "subtime":30.4, "walltime": 100, "res": 1, "profile": "5"},
{"id":45, "subtime":30.5, "walltime": 10, "res": 1, "profile": "1"},
{"id":50, "subtime":40, "walltime": 1000, "res": 5, "profile": "5"},
{"id":51, "subtime":40.1, "walltime": 10, "res": 6, "profile": "1"},
{"id":52, "subtime":40.2, "walltime": 10, "res": 2, "profile": "1"},
{"id":53, "subtime":40.2, "walltime": 2, "res": 1, "profile": "1"},
{"id":54, "subtime":40.2, "walltime": 2, "res": 1, "profile": "1"},
{"id":60, "subtime":50, "walltime": 100, "res": 1, "profile": "10"},
{"id":61, "subtime":50.1, "walltime": 100, "res": 1, "profile": "5"},
{"id":62, "subtime":50.2, "walltime": 10, "res": 6, "profile": "1"},
{"id":63, "subtime":50.3, "walltime": 10, "res": 5, "profile": "1"},
{"id":64, "subtime":50.4, "walltime": 10, "res": 1, "profile": "1"},
{"id":70, "subtime":70, "walltime": 100, "res": 1, "profile": "10"},
{"id":71, "subtime":70.1, "walltime": 100, "res": 1, "profile": "5"},
{"id":72, "subtime":70.2, "walltime": 10, "res": 6, "profile": "1"},
{"id":73, "subtime":70.3, "walltime": 10, "res": 1, "profile": "1"},
{"id":80, "subtime":90, "walltime": 100, "res": 1, "profile": "10"},
{"id":81, "subtime":90.1, "walltime": 100, "res": 1, "profile": "5"},
{"id":82, "subtime":90.2, "walltime": 10, "res": 6, "profile": "1"},
{"id":83, "subtime":90.3, "walltime": 10, "res": 1, "profile": "1"},
{"id":84, "subtime":90.4, "walltime": 10, "res": 5, "profile": "1"},
{"id":90, "subtime":110, "walltime": 10, "res": 3, "profile": "1"},
{"id":91, "subtime":110.1, "walltime": 100, "res": 1, "profile": "5"},
{"id":92, "subtime":110.2, "walltime": 10, "res": 6, "profile": "1"},
{"id":93, "subtime":110.3, "walltime": 10, "res": 1, "profile": "1"},
{"id":94, "subtime":110.4, "walltime": 10, "res": 1, "profile": "1"},
{"id":95, "subtime":110.5, "walltime": 10, "res": 1, "profile": "1"},
{"id":96, "subtime":110.6, "walltime": 10, "res": 1, "profile": "1"},
{"id":97, "subtime":110.7, "walltime": 10, "res": 1, "profile": "1"},
{"id":98, "subtime":110.7, "walltime": 10, "res": 1, "profile": "1"},
{"id":99, "subtime":110.7, "walltime": 10, "res": 1, "profile": "1"},
{"id":100, "subtime":110.7, "walltime": 10, "res": 1, "profile": "1"},
{"id":101, "subtime":110.7, "walltime": 10, "res": 1, "profile": "1"},
{"id":111, "subtime":130, "walltime": 100, "res": 3, "profile": "5"},
{"id":112, "subtime":130.1, "walltime": 10, "res": 5, "profile": "1"},
{"id":113, "subtime":130.2, "walltime": 100000, "res": 1, "profile": "1"},
{"id":114, "subtime":130.3, "walltime": 100000, "res": 1, "profile": "5"},
{"id":115, "subtime":130.4, "walltime": 10, "res": 1, "profile": "1"},
{"id":120, "subtime":140, "walltime": 100, "res": 3, "profile": "5"},
{"id":121, "subtime":140.1, "walltime": 10, "res": 5, "profile": "1"},
{"id":122, "subtime":140.2, "walltime": 10, "res": 1, "profile": "1"},
{"id":123, "subtime":140.3, "walltime": 10, "res": 1, "profile": "1"},
{"id":124, "subtime":140.4, "walltime": 10, "res": 1, "profile": "1"},
{"id":130, "subtime":150, "walltime": 1000, "res": 5, "profile": "5"},
{"id":131, "subtime":150.1, "walltime": 100, "res": 1, "profile": "1"},
{"id":132, "subtime":150.2, "walltime": 100, "res": 2, "profile": "10"},
{"id":133, "subtime":150.3, "walltime": 2, "res": 1, "profile": "1"},
{"id":134, "subtime":150.4, "walltime": 10, "res": 6, "profile": "1"},
{"id":135, "subtime":150.6, "walltime": 2, "res": 1, "profile": "1"},
{"id":136, "subtime":150.6, "walltime": 2, "res": 2, "profile": "1"},
{"id":137, "subtime":150.6, "walltime": 2, "res": 1, "profile": "1"},
{"id":138, "subtime":150.6, "walltime": 2, "res": 1, "profile": "1"},
{"id":139, "subtime":150.6, "walltime": 2, "res": 1, "profile": "1"}
],
"profiles": {
"1": {
"type": "parallel_homogeneous",
"cpu": 100e6,
"com": 0
},
"5": {
"type": "parallel_homogeneous",
"cpu": 500e6,
"com": 0
},
"10": {
"type": "parallel_homogeneous",
"cpu": 1000e6,
"com": 0
}
}
}
{
"version": 0,
"date": "Wed 6 Sep 17:41:23 CEST 2017",
"description": "Simple workload with delays for testing purposes.",
"jobs": [
{
"id": 0,
"profile": "delay",
"res": 4,
"walltime": 300,
"subtime": 0.0
},
{
"id": 1,
"profile": "delay",
"res": 8,
"walltime": 300,
"subtime": 0.1
},
{
"id": 2,
"profile": "delay",
"res": 16,
"walltime": 300,
"subtime": 0.2
},
{
"id": 3,
"profile": "delay",
"res": 16,
"walltime": 300,
"subtime": 0.3
},
{
"id": 4,
"profile": "delay",
"res": 4,
"walltime": 300,
"subtime": 0.4
},
{
"id": 5,
"profile": "delay",
"res": 4,
"walltime": 300,
"subtime": 0.5
},
{
"id": 6,
"profile": "delay",
"res": 4,
"walltime": 300,
"subtime": 0.5
},
{
"id": 7,
"profile": "delay",
"res": 4,
"walltime": 300,
"subtime": 0.5
},
{
"id": 8,
"profile": "delay",
"res": 4,
"walltime": 300,
"subtime": 0.5
},
{
"id": 9,
"profile": "delay",
"res": 4,
"walltime": 300,
"subtime": 0.5
},
{
"id": 10,
"profile": "delay",
"res": 33,
"walltime": 300,
"subtime": 0.6
},
{
"id": 11,
"profile": "delay",
"res": 32,
"walltime": 300,
"subtime": 0.6
}
],
"nb_res": 32,
"profiles": {
"delay": {
"type": "delay",
"delay": 96.00
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment