diff --git a/graph_viz.ipynb b/graph_viz.ipynb index a2f083c9a12018f826bdb885b3fe682e4af9528a..0d14f11cbd8f67985133c3d0e0a22dc148be8e83 100644 --- a/graph_viz.ipynb +++ b/graph_viz.ipynb @@ -85,7 +85,7 @@ "source": [ "With another value for the threshold:\n", "\n", - "*Note: a threshold of 0 with the Arrival delimitation method will populate only sessions containing jobs submitted at the same time (so most likely only single-job sessions)*" + "*Note: a threshold of 0 with the Arrival delimitation method will populate only single-job sessions*" ] }, { diff --git a/src/user_session_builder.py b/src/user_session_builder.py index f2a1e6c3f2d59d3c83c69c0b714fd95c78f6b5e4..d2ec6e1a8a0d21cb0432ba43a1f4bc52acb5b6b3 100644 --- a/src/user_session_builder.py +++ b/src/user_session_builder.py @@ -50,15 +50,15 @@ class User: if self.delim_approach == 'arrival': inter_arrival_time = date_now - self.__last_submit_time - return (inter_arrival_time > self.delim_threshold) + return (inter_arrival_time >= self.delim_threshold) elif self.delim_approach == 'last': think_time = date_now - self.__last_finish_time - return (think_time > self.delim_threshold) + return (think_time >= self.delim_threshold) else: # 'max' delimitation approach think_time = date_now - self.__max_finish_time - return (think_time > self.delim_threshold) + return (think_time >= self.delim_threshold) def __sessions_finished_at_time(self, t): """Return the list of session that were finished at time t""" @@ -92,7 +92,7 @@ class User: for s_id in self.__sessions_in_progress.copy(): sess = self.sessions[s_id] - if date_now > sess.max_finish_time: # ie sess is finished + if date_now >= sess.max_finish_time: # ie sess is finished self.__sessions_in_progress.discard(s_id) self.__current_dep = self.__current_dep - set( sess.preceding_sessions) diff --git a/test/expected_output/many_following.SABjson b/test/expected_output/many_following.SABjson index f493068072e54bd124e3866a227ef3bb03f729bd..e54feeccbd1d1df41146d50ffdd2e5cd1aafd194 100644 --- a/test/expected_output/many_following.SABjson +++ b/test/expected_output/many_following.SABjson @@ -36,9 +36,9 @@ }, { "id": 3, - "first_submit_time": 2001.0, + "first_submit_time": 2000.0, "preceding_sessions": [1], - "thinking_time_after_preceding_session": [1001], + "thinking_time_after_preceding_session": [1000], "nb_jobs": 1, "jobs": [ { @@ -52,9 +52,9 @@ }, { "id": 4, - "first_submit_time": 2002.0, + "first_submit_time": 2000.0, "preceding_sessions": [1], - "thinking_time_after_preceding_session": [1002], + "thinking_time_after_preceding_session": [1000], "nb_jobs": 1, "jobs": [ { @@ -68,9 +68,9 @@ }, { "id": 5, - "first_submit_time": 2003.0, + "first_submit_time": 2000.0, "preceding_sessions": [1], - "thinking_time_after_preceding_session": [1003], + "thinking_time_after_preceding_session": [1000], "nb_jobs": 1, "jobs": [ { diff --git a/test/expected_output/many_preceding.SABjson b/test/expected_output/many_preceding.SABjson index bb25f652f0de4f3679da8eb98497cdfd8a09008e..37f7c3f6badb208969ee7bc5ebb87a0112f37690 100644 --- a/test/expected_output/many_preceding.SABjson +++ b/test/expected_output/many_preceding.SABjson @@ -1,5 +1,5 @@ { - "description": "A session (session 6) depends on five others, with a think time of 1000s. Slightly different than batmen version.", + "description": "A session (session 6) depends on five others, with a think time of 1000s.", "nb_res": 16, "sessions": [ { @@ -20,14 +20,14 @@ }, { "id": 2, - "first_submit_time": 1001.0, + "first_submit_time": 1000.0, "preceding_sessions": [], "thinking_time_after_preceding_session": [], "nb_jobs": 1, "jobs": [ { "id": 2, - "profile": "1500", + "profile": "2000", "res": 16, "subtime": 0.0, "walltime": 2592000.0 @@ -36,7 +36,7 @@ }, { "id": 3, - "first_submit_time": 1002.0, + "first_submit_time": 1000.0, "preceding_sessions": [], "thinking_time_after_preceding_session": [], "nb_jobs": 1, diff --git a/test/test_output_sanity.py b/test/test_output_sanity.py index 1bcff7e02fa73415689aa56a14caab22c020cba6..4f089882043f19ea65b507e52aefd47543073e18 100644 --- a/test/test_output_sanity.py +++ b/test/test_output_sanity.py @@ -41,10 +41,10 @@ def SABjson_sanity_check(SABjson_file, arrival_threshold=None): if arrival_threshold is not None and previous_job_subtime != -1: interrarrival = job_sub_time - previous_job_subtime if job == session["jobs"][0]: - assert interrarrival > arrival_threshold * 60, f"Session {s_id} was started but the interrarrival time was not suffisiant" + assert interrarrival >= arrival_threshold * 60, f"Session {s_id} was started but the interrarrival time was not suffisiant" else: job_id = job["id"] - assert interrarrival <= arrival_threshold * 60, f"Job {job_id} in session {s_id} should be in a new session" + assert interrarrival < arrival_threshold * 60, f"Job {job_id} in session {s_id} should be in a new session" s_id += 1 fd.close() diff --git a/test/workload/many_following.swf b/test/workload/many_following.swf index 01ea036504b2f066a2480f85952d209437552972..b79994d9aeab3f80f94e182b08251071d6cc0f10 100644 --- a/test/workload/many_following.swf +++ b/test/workload/many_following.swf @@ -3,7 +3,7 @@ 1 0 0 1000 16 -1 -1 16 2592000 -1 1 1 1 -1 -1 -1 -1 -1 2 2000 0 2000 16 -1 -1 16 2592000 -1 1 1 1 -1 -1 -1 -1 -1 - 3 2001 0 1000 16 -1 -1 16 2592000 -1 1 1 1 -1 -1 -1 -1 -1 - 4 2002 0 1000 16 -1 -1 16 2592000 -1 1 1 1 -1 -1 -1 -1 -1 - 5 2003 0 1000 16 -1 -1 16 2592000 -1 1 1 1 -1 -1 -1 -1 -1 + 3 2000 50 1000 16 -1 -1 16 2592000 -1 1 1 1 -1 -1 -1 -1 -1 + 4 2000 50 1000 16 -1 -1 16 2592000 -1 1 1 1 -1 -1 -1 -1 -1 + 5 2000 50 1000 16 -1 -1 16 2592000 -1 1 1 1 -1 -1 -1 -1 -1 6 3000 0 1000 16 -1 -1 16 2592000 -1 1 1 1 -1 -1 -1 -1 -1 diff --git a/test/workload/many_preceding.swf b/test/workload/many_preceding.swf index 107c63f297ecd0e3e12e524e1689b10223d212a8..b6dc4337b474cc1c0881075e64ca61d8809714f9 100644 --- a/test/workload/many_preceding.swf +++ b/test/workload/many_preceding.swf @@ -2,8 +2,8 @@ ; Expected to produce many_preceding.SABjson with arrival_t0 1 1000 1000 1000 16 -1 -1 16 2592000 -1 1 1 1 -1 -1 -1 -1 -1 - 2 1001 499 1500 16 -1 -1 16 2592000 -1 1 1 1 -1 -1 -1 -1 -1 - 3 1002 998 1000 16 -1 -1 16 2592000 -1 1 1 1 -1 -1 -1 -1 -1 + 2 1000 0 2000 16 -1 -1 16 2592000 -1 1 1 1 -1 -1 -1 -1 -1 + 3 1000 1000 1000 16 -1 -1 16 2592000 -1 1 1 1 -1 -1 -1 -1 -1 4 1500 500 1000 16 -1 -1 16 2592000 -1 1 1 1 -1 -1 -1 -1 -1 5 2000 0 1000 16 -1 -1 16 2592000 -1 1 1 1 -1 -1 -1 -1 -1 6 4000 0 1000 16 -1 -1 16 2592000 -1 1 1 1 -1 -1 -1 -1 -1