Skip to content
Snippets Groups Projects
Commit d912deef authored by Maël Madon's avatar Maël Madon
Browse files

Merge branch 'master' into '20-easy-bf-fast'

# Conflicts:
#   test/test_schedulers_mono.py
parents 6fea48a8 90fe3865
Branches
Tags
1 merge request!19Use the faster implementation of easy backfilling
Pipeline #6071 passed
......@@ -20,10 +20,14 @@ def pytest_generate_tests(metafunc):
metafunc.parametrize('platform_monoC', platforms)
if 'workload_static' in metafunc.fixturenames:
workload_files = glob.glob('test/workloads/static/*.json')
workloads = [Workload(
name=basename(workload_file).replace('.json', ''),
filename=abspath(workload_file)) for workload_file in workload_files]
workload_files = [
"batpaper",
"mixed",
"para_homo"
]
path = 'test/workloads/static'
workloads = [Workload(name=wl, filename=abspath(f"{path}/{wl}.json"))
for wl in workload_files]
metafunc.parametrize('workload_static', workloads)
if 'platform_multiC' in metafunc.fixturenames:
......
job_id,workload_name,profile,submission_time,requested_number_of_resources,requested_time,success,final_state,starting_time,execution_time,finish_time,waiting_time,turnaround_time,stretch,allocated_resources,consumed_energy,metadata
2,w0,10sec,50.000000,1,20.000000,1,COMPLETED_SUCCESSFULLY,50.000000,10.000000,60.000000,0.000000,10.000000,1.000000,1,-1.000000,""
0,w0,100sec,0.000000,1,110.000000,1,COMPLETED_SUCCESSFULLY,0.000000,100.000000,100.000000,0.000000,100.000000,1.000000,0,-1.000000,""
1,w0,100sec,10.000000,2,110.000000,1,COMPLETED_SUCCESSFULLY,100.000000,100.000000,200.000000,90.000000,190.000000,1.900000,0-1,-1.000000,""
3,w0,100sec,300.000000,1,110.000000,1,COMPLETED_SUCCESSFULLY,300.000000,100.000000,400.000000,0.000000,100.000000,1.000000,0,-1.000000,""
4,w0,100sec,310.000000,2,110.000000,1,COMPLETED_SUCCESSFULLY,400.000000,100.000000,500.000000,90.000000,190.000000,1.900000,0-1,-1.000000,""
5,w0,10sec,350.000000,1,80.000000,1,COMPLETED_SUCCESSFULLY,500.000000,10.000000,510.000000,150.000000,160.000000,16.000000,0,-1.000000,""
#!/usr/bin/env python3
from helper import *
import pandas as pd
def test_fcfs(platform_monoC, workload_static):
"""Tests the scheduler fcfs with different platform and workload files"""
......@@ -19,8 +20,39 @@ def test_fcfs(platform_monoC, workload_static):
instance.to_file(robin_filename)
ret = run_robin(robin_filename)
# Checks that there were no execution error
assert ret.returncode == 0
# Checks that the jobs have been executed in FCFS order
jobs = pd.read_csv(f"{output_dir}/_jobs.csv")
jobs.sort_values(by="submission_time", inplace=True)
assert jobs[jobs.success==1].starting_time.is_monotonic_increasing
def test_easy_bf_small_instance():
"""Tests the scheduler easy backfilling on a small instance"""
test_name = 'easy_bf_small_instance'
output_dir, robin_filename, _ = init_instance(test_name)
batcmd = gen_batsim_cmd(
abspath("test/platforms/monocore/2machines.xml"),
abspath("test/workloads/static/backfill.json"), output_dir, "")
instance = RobinInstance(output_dir=output_dir,
batcmd=batcmd,
schedcmd="batmen -v 'easy_bf'",
simulation_timeout=30, ready_timeout=5,
success_timeout=10, failure_timeout=0
)
instance.to_file(robin_filename)
ret = run_robin(robin_filename)
# Checks that there were no execution error
assert ret.returncode == 0
# Checks that backfilling did occur in this small example
assert_expected_output(test_name)
def test_easy_bf(platform_monoC, workload_static):
"""Tests the scheduler easy backfilling with different platform and workload files"""
......
{
"description": "Test easy backfill.",
"nb_res": 2,
"jobs": [
{"id": "0", "profile": "100sec", "res": 1, "walltime":110, "subtime": 0},
{"id": "1", "profile": "100sec", "res": 2, "walltime":110, "subtime": 10},
{"id": "2", "profile": "10sec", "res": 1, "walltime":20, "subtime": 50},
{"id": "3", "profile": "100sec", "res": 1, "walltime":110, "subtime": 300},
{"id": "4", "profile": "100sec", "res": 2, "walltime":110, "subtime": 310},
{"id": "5", "profile": "10sec", "res": 1, "walltime":80, "subtime": 350}
],
"profiles": {
"100sec": {"delay": 100,"type": "delay"},
"10sec": {"delay": 10,"type": "delay"}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment