diff --git a/base_loadgen_program/code_axs.py b/base_loadgen_program/code_axs.py index 38b0718..662d5d4 100644 --- a/base_loadgen_program/code_axs.py +++ b/base_loadgen_program/code_axs.py @@ -1,5 +1,6 @@ import os from shutil import copy2 +import datetime from ufun import load_json, save_json @@ -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 diff --git a/base_loadgen_program/data_axs.json b/base_loadgen_program/data_axs.json index be690da..1750f7a 100644 --- a/base_loadgen_program/data_axs.json +++ b/base_loadgen_program/data_axs.json @@ -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" ] ]] ], @@ -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" } ] }