Skip to content

Commit

Permalink
Added experiment_begin_timestamp and experiment_end_timestamp(#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
maria-18-git committed Oct 19, 2023
1 parent 7b20949 commit 36e5015
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions base_loadgen_program/code_axs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
from shutil import copy2
import datetime
from ufun import load_json, save_json


Expand Down Expand Up @@ -96,3 +97,8 @@ def get_config_from_sut(config=None, default_val=None, sut_data_runtime=None, su
# If config is not in either, return default_val
print(f"Bailing, set {config} to [{default_val}] ...")
return default_val

def generate_current_timestamp(used_for="unknown"):
timestamp = datetime.datetime.now().strftime("%Y.%m.%dT%H:%M:%S")
#print(f"GENERATING TIMESTAMP: {timestamp} used for: {used_for}")
return timestamp
14 changes: 12 additions & 2 deletions base_loadgen_program/data_axs.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
[ "get", "output_entry" ],
[ "plant", [ "loadgen_mlperf_conf_path",[ "^^", "get", "loadgen_mlperf_conf_path" ] ]],
[ "plant", [ "loadgen_user_conf_path",[ "^^", "get", "loadgen_user_conf_path" ] ]],
[ "plant", [ "experiment_begin_timestamp", [ "^^", "generate_current_timestamp", [], {"used_for": "begin"} ] ]],
[ "save", [], { "deterministic": false } ],
[ "get_path", "data_axs.json" ]
]] ],
Expand All @@ -119,6 +120,15 @@
]] ],

"symlink_to": null,
"postprocess_on_success": [ "^^", "link_to_power_client_entry" ],
"get_and_return_on_success": [ "^^", "case",[ [ "^^", "get", "symlink_to" ], [null, ""], null ], { "default_value": "postprocess_on_success" } ]
"link_to_power_and_register_end_timestamp": [ "^^", "execute", [[
[ "link_to_power_client_entry" ],
[ "plant", [ "experiment_end_timestamp", [ "^^", "generate_current_timestamp", [], { "used_for": "end" } ]]],
[ "save", [], { "deterministic_2": false } ]
]]],
"register_end_timestamp": [ "^^", "execute", [[
[ "get", "output_entry" ],
[ "plant", [ "experiment_end_timestamp", [ "^^", "generate_current_timestamp", [], { "used_for": "end" } ]]],
[ "save", [], { "deterministic_2": false } ]
]]],
"get_and_return_on_success": [ "^^", "case",[ [ "^^", "get", "symlink_to" ], [null, ""], "register_end_timestamp" ], { "default_value": "link_to_power_and_register_end_timestamp" } ]
}

0 comments on commit 36e5015

Please sign in to comment.