Content-Length: 335988 | pFad | http://github.com/LLNL/merlin/pull/442/commits/672b1a70885b341976d78fff2d94448357ec11d3

86 feature/new-status by bgunnar5 · Pull Request #442 · LLNL/merlin · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/new-status #442

Merged
merged 19 commits into from
Oct 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix lint issue and add test for avg/std dev calc
  • Loading branch information
bgunnar5 committed Sep 27, 2023
commit 672b1a70885b341976d78fff2d94448357ec11d3
2 changes: 1 addition & 1 deletion merlin/study/status.py
Original file line number Diff line number Diff line change
@@ -338,7 +338,7 @@ def get_step_statuses(self, step_workspace: str, started_step_name: str) -> Dict
dict_deep_merge(step_statuses[started_step_name], statuses_read)

LOG.info(
f"Done traversing '{step_workspace}'. Read in {num_statuses_read} " \
f"Done traversing '{step_workspace}'. Read in {num_statuses_read} "
f"{'statuses' if num_statuses_read != 1 else 'status'}."
)

57 changes: 57 additions & 0 deletions tests/unit/study/test_status.py
Original file line number Diff line number Diff line change
@@ -269,6 +269,63 @@ def test_display(self):
state_info_diff = DeepDiff(state_info, status_test_variables.DISPLAY_INFO[step_name], ignore_order=True)
self.assertEqual(state_info_diff, {})

def test_get_runtime_avg_std_dev(self):
"""
Test the functionality that calculates the run time average and standard
deviation for each step. This test covers the get_runtime_avg_std_dev method.
"""
dummy_step_status = {
"dummy_step": {
"dummy_step_PARAM.1": {
"task_queue": "dummy_queue",
"worker_name": "dummy_worker",
"dummy_step/PARAM.1/00": {
"status": "FINISHED",
"return_code": "MERLIN_SUCCESS",
"elapsed_time": "0d:02h:00m:00s",
"run_time": "0d:01h:38m:27s", # 3600 + 2280 + 27 = 5907 seconds
"restarts": 0,
},
"dummy_step/PARAM.1/01": {
"status": "FINISHED",
"return_code": "MERLIN_SUCCESS",
"elapsed_time": "0d:02h:00m:00s",
"run_time": "0d:01h:45m:08s", # 3600 + 2700 + 8 = 6308 seconds
"restarts": 0,
},
},
"dummy_step_PARAM.2": {
"task_queue": "dummy_queue",
"worker_name": "dummy_worker",
"dummy_step/PARAM.2/00": {
"status": "FINISHED",
"return_code": "MERLIN_SUCCESS",
"elapsed_time": "0d:02h:00m:00s",
"run_time": "0d:01h:52m:33s", # 3600 + 3120 + 33 = 6753 seconds
"restarts": 0,
},
"dummy_step/PARAM.2/01": {
"status": "FINISHED",
"return_code": "MERLIN_SUCCESS",
"elapsed_time": "0d:02h:00m:00s",
"run_time": "0d:01h:08m:40s", # 3600 + 480 + 40 = 4120 seconds
"restarts": 0,
},
},
}
}

status_obj = Status(args=self.args, spec_display=False, file_or_ws=status_test_variables.VALID_WORKSPACE_PATH)
status_obj.get_runtime_avg_std_dev(dummy_step_status, "dummy_step")

# Set expected values
expected_avg = "01h:36m:12s" # Mean is 5772 seconds = 01h:36m:12s
expected_std_dev = "±16m:40s" # Std dev is 1000 seconds = 16m:40s

# Make sure the values were calculated as expected
self.assertEqual(dummy_step_status["dummy_step"]["avg_run_time"], expected_avg)
self.assertEqual(dummy_step_status["dummy_step"]["run_time_std_dev"], expected_std_dev)


if __name__ == "__main__":
unittest.main()








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/LLNL/merlin/pull/442/commits/672b1a70885b341976d78fff2d94448357ec11d3

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy