From 2d99721ee67b27a4c2f65970710eac0afd22bd0f Mon Sep 17 00:00:00 2001 From: Arkadiusz Szczepkowicz Date: Tue, 25 Jun 2024 15:31:38 +0200 Subject: [PATCH] #2291: Use shortest possible LBDatafile example --- examples/LBDatafile_example.json | 107 ++---------------- scripts/check_lb_data_files.sh | 2 +- scripts/generate_and_validate_lb_data_file.py | 10 +- 3 files changed, 16 insertions(+), 103 deletions(-) diff --git a/examples/LBDatafile_example.json b/examples/LBDatafile_example.json index c4a3b38595..50b4e47433 100644 --- a/examples/LBDatafile_example.json +++ b/examples/LBDatafile_example.json @@ -39,47 +39,18 @@ "subphases": [ { "id": 0, - "time": 0.037242 + "time": 0.037584 }, { "id": 1, - "time": 0.03718499999999997 + "time": 0.037717999999999995 }, { "id": 2, - "time": 0.03715999999999997 + "time": 0.038012000000000004 } ], - "time": 0.11158699999999994 - }, - { - "entity": { - "collection_id": 7, - "home": 0, - "id": 524291, - "index": [ - 1 - ], - "migratable": true, - "type": "object" - }, - "node": 0, - "resource": "cpu", - "subphases": [ - { - "id": 0, - "time": 0.037272 - }, - { - "id": 1, - "time": 0.03724400000000003 - }, - { - "id": 2, - "time": 0.037127999999999994 - } - ], - "time": 0.11164400000000002 + "time": 0.113314 }, { "entity": { @@ -95,32 +66,15 @@ }, { "entity": { - "collection_id": 7, "home": 0, - "id": 1048579, - "index": [ - 3 - ], - "migratable": true, + "id": 4194316, + "migratable": false, + "objgroup_id": 1048579, "type": "object" }, "node": 0, "resource": "cpu", - "subphases": [ - { - "id": 0, - "time": 0.037580999999999996 - }, - { - "id": 1, - "time": 0.037215 - }, - { - "id": 2, - "time": 0.037173999999999985 - } - ], - "time": 0.11196999999999999 + "time": 0.0 }, { "entity": { @@ -134,51 +88,10 @@ "subphases": [ { "id": 0, - "time": 2.1999999999999884e-05 - } - ], - "time": 2.1999999999999884e-05 - }, - { - "entity": { - "collection_id": 7, - "home": 0, - "id": 786435, - "index": [ - 2 - ], - "migratable": true, - "type": "object" - }, - "node": 0, - "resource": "cpu", - "subphases": [ - { - "id": 0, - "time": 0.03727900000000001 - }, - { - "id": 1, - "time": 0.037498000000000004 - }, - { - "id": 2, - "time": 0.03705200000000003 + "time": 2.2000000000000318e-05 } ], - "time": 0.11182900000000004 - }, - { - "entity": { - "home": 0, - "id": 4194316, - "migratable": false, - "objgroup_id": 1048579, - "type": "object" - }, - "node": 0, - "resource": "cpu", - "time": 0.0 + "time": 2.2000000000000318e-05 }, { "entity": { diff --git a/scripts/check_lb_data_files.sh b/scripts/check_lb_data_files.sh index 47095bfc41..2256403dec 100755 --- a/scripts/check_lb_data_files.sh +++ b/scripts/check_lb_data_files.sh @@ -42,7 +42,7 @@ do done # Use vt to generate LB Datafile -if ! python3 "${path_to_vt_src_dir}/scripts/generate_and_validate_lb_data_file.py" -v \ +if ! python3 "${path_to_vt_src_dir}/scripts/generate_and_validate_lb_data_file.py" -c \ -b "${path_to_vt_build_dir}" -f "LBData_from_lb_iter.0.json" -r "${path_to_vt_src_dir}/examples/LBDatafile_example.json" then exit 3; diff --git a/scripts/generate_and_validate_lb_data_file.py b/scripts/generate_and_validate_lb_data_file.py index 12739bc359..4fd7b173c5 100644 --- a/scripts/generate_and_validate_lb_data_file.py +++ b/scripts/generate_and_validate_lb_data_file.py @@ -12,12 +12,12 @@ def generate(vt_build, out_file_name): out_dir = "--vt_lb_data_dir=" + vt_build out_file = "--vt_lb_data_file=" + out_file_name - args = (exe_path, "4", "1.0", "1", "--vt_lb", "--vt_lb_interval=1", "--vt_lb_name=RotateLB", "--vt_lb_data", "--vt_lb_data_compress=false", out_dir, out_file) + args = (exe_path, "1", "1.0", "1", "--vt_lb", "--vt_lb_interval=1", "--vt_lb_name=RotateLB", "--vt_lb_data", "--vt_lb_data_compress=false", out_dir, out_file) return_code = subprocess.call(args) if return_code != 0: sys.exit(return_code) -def validate(vt_build, file_to_validate, reference_file): +def compare(vt_build, file_to_validate, reference_file): """ Compares file to validate wih reference """ @@ -42,7 +42,7 @@ def main(): parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group(required=True) group.add_argument("--generate", "-g", dest='generate', required=False, action='store_true') - group.add_argument("--validate", "-v", dest='validate', required=False, action='store_true') + group.add_argument("--compare", "-c", dest='compare', required=False, action='store_true') parser.add_argument("--vt-build-dir", "-b", dest='vt_build_dir', required=True) parser.add_argument("--file-name", "-f", dest='file_name', required=True) @@ -51,8 +51,8 @@ def main(): if args.generate: generate(args.vt_build_dir, args.file_name) - if args.validate: - validate(args.vt_build_dir, args.file_name, args.reference_file) + if args.compare: + compare(args.vt_build_dir, args.file_name, args.reference_file) if __name__ == '__main__':