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

test: added a test to see the feedback mechanism delaying a job in case of fully loaded platform

parent de59f7df
No related branches found
No related tags found
1 merge request!2Feature "replay with feedback" ready and tested
{"users": [{"name": "jolene", "category": "fb_user_think_time_only", "param": {"input_json": "test/workloads/split_by_user/load_platform_SAB.json"}}]}
\ No newline at end of file
{
"users": [
{
"name": "jolene",
"category": "fb_user_think_time_only",
"param": {
"input_json": "test/workloads/split_by_user/proto_SABjson_v2.json"
}
}
]
}
\ No newline at end of file
{"users": [{"name": "jolene", "category": "fb_user_think_time_only", "param": {"input_json": "test/workloads/split_by_user/proto_SABjson_v2.json"}}]}
\ No newline at end of file
from helper import *
import json
from test_users import run_user, assert_exec_time_equals_profile
Workload = namedtuple('Workload', ['name', 'filename'])
Platform = namedtuple('Platform', ['name', 'filename'])
empty_workload = Workload(name='empty_workload', filename='test/workloads/multicore/empty_workload.json')
empty_workload = Workload(
name='empty_workload', filename='test/workloads/multicore/empty_workload.json')
two_machine_platform = Platform(name='two_machine_platform', filename='test/platforms/multicore/toy_pform_taurus_like.xml')
two_machine_platform = Platform(
name='two_machine_platform', filename='test/platforms/multicore/toy_pform_taurus_like.xml')
users = [
"fb_user_think_time_only",
]
def test_fb_user_think_time_only():
out_dir = run_user("fb_user_think_time_only", two_machine_platform, empty_workload)
user_category = 'fb_user_think_time_only'
user_description = {
"users": [
{
"name": "jolene",
"category": user_category,
"param": {
"input_json": "test/workloads/split_by_user/proto_SABjson_v2.json"
}
}
]
}
with open(f'test/schedconf/{user_category}.json', 'w') as user_description_file:
json.dump(user_description, user_description_file)
out_dir = run_user(user_category,
two_machine_platform, empty_workload)
# assert_exec_time_equals_profile(out_dir)
def test_fb_user_fully_loaded_platform():
user_category = 'fb_user_think_time_only'
test_name = 'fb_user_fully_loaded_platform'
user_description = {
"users": [
{
"name": "jolene",
"category": user_category,
"param": {
"input_json": "test/workloads/split_by_user/load_platform_SAB.json"
}
}
]
}
with open(f'test/schedconf/{test_name}.json', 'w') as user_description_file:
json.dump(user_description, user_description_file)
out_dir = run_user(test_name,
two_machine_platform, empty_workload)
# assert_exec_time_equals_profile(out_dir)
{
"description": "Test feedback when platform is fully loaded.",
"command": "command used to generate the file. We can suppose that it's generated with arrival delimitation approach and threshold = 60mn = 3600s.",
"date": "data of generation of the file",
"nb_res": 16,
"sessions": [
{
"id": 1,
"first_submit_time": 0.0,
"preceding_sessions": [],
"thinking_time_after_preceding_session": [],
"nb_jobs": 1,
"jobs": [
{
"id": 1,
"profile": "1000",
"res": 16,
"subtime": 0.0,
"walltime": 2592000.0
}
]
},
{
"id": 2,
"first_submit_time": 2000.0,
"preceding_sessions": [1],
"thinking_time_after_preceding_session": [1000],
"nb_jobs": 1,
"jobs": [
{
"id": 2,
"profile": "1000",
"res": 16,
"subtime": 0.0,
"walltime": 2592000.0
}
]
},
{
"id": 3,
"first_submit_time": 10000.0,
"preceding_sessions": [
2
],
"thinking_time_after_preceding_session": [
7000.0
],
"nb_jobs": 1,
"jobs": [
{
"id": 3,
"profile": "1000",
"res": 16,
"subtime": 0.0,
"walltime": 2592000.0
}
]
},
{
"id": 4,
"first_submit_time": 12000.0,
"preceding_sessions": [
3
],
"thinking_time_after_preceding_session": [
1000.0
],
"nb_jobs": 1,
"jobs": [
{
"id": 4,
"profile": "1000",
"res": 16,
"subtime": 0.0,
"walltime": 2592000.0
}
]
},
{
"id": 5,
"first_submit_time": 9000.0,
"preceding_sessions": [
2
],
"thinking_time_after_preceding_session": [
6000.0
],
"nb_jobs": 2,
"jobs": [
{
"id": 5,
"profile": "5000",
"res": 16,
"subtime": 0.0,
"walltime": 2592000.0
},
{
"id": 6,
"profile": "5000",
"res": 16,
"subtime": 0.0,
"walltime": 2592000.0
}
]
}
]
}
\ 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