Skip to content

Commit

Permalink
#2291: Use shortest possible LBDatafile example
Browse files Browse the repository at this point in the history
  • Loading branch information
thearusable authored and cwschilly committed Sep 20, 2024
1 parent ec2b979 commit 2d99721
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 103 deletions.
107 changes: 10 additions & 97 deletions examples/LBDatafile_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/check_lb_data_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions scripts/generate_and_validate_lb_data_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand All @@ -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)
Expand All @@ -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__':
Expand Down

0 comments on commit 2d99721

Please sign in to comment.