From 50d01395497cdfc3889e4317a9a4ade5194c0f9a Mon Sep 17 00:00:00 2001 From: Caleb Schilly Date: Fri, 24 May 2024 15:48:50 -0400 Subject: [PATCH] #2124: update JSON example and include json validator in docs --- docs/md/node-lb-data.md | 197 ++++++++++++++++++++++++++++++++-------- 1 file changed, 159 insertions(+), 38 deletions(-) diff --git a/docs/md/node-lb-data.md b/docs/md/node-lb-data.md index d729a0bba5..3a4268bff5 100644 --- a/docs/md/node-lb-data.md +++ b/docs/md/node-lb-data.md @@ -52,10 +52,11 @@ and optionally the `index`, `home`, and `collection_id` for that object. "entity": { "collection_id": 7, "home": 0, - "id": 12884901888, + "id": 3407875, "index": [ - 3 + 12 ], + "migratable": true, "type": "object" }, "node": 0, @@ -63,19 +64,24 @@ and optionally the `index`, `home`, and `collection_id` for that object. "subphases": [ { "id": 0, - "time": 0.014743804931640625 + "time": 1.1263000033068238e-05 + }, + { + "id": 1, + "time": 1.1333999964335817e-05 } ], - "time": 0.014743804931640625 + "time": 3.379300005690311e-05 }, { "entity": { "collection_id": 7, "home": 0, - "id": 4294967296, + "id": 3145731, "index": [ - 1 + 11 ], + "migratable": true, "type": "object" }, "node": 0, @@ -83,10 +89,14 @@ and optionally the `index`, `home`, and `collection_id` for that object. "subphases": [ { "id": 0, - "time": 0.013672113418579102 + "time": 1.1653000001388136e-05 + }, + { + "id": 1, + "time": 1.1435000033088727e-05 } ], - "time": 0.013672113418579102 + "time": 3.452300006756559e-05 } ] }, @@ -97,10 +107,36 @@ and optionally the `index`, `home`, and `collection_id` for that object. "entity": { "collection_id": 7, "home": 0, - "id": 12884901888, + "id": 3407875, + "index": [ + 12 + ], + "migratable": true, + "type": "object" + }, + "node": 0, + "resource": "cpu", + "subphases": [ + { + "id": 0, + "time": 3.207300005669822e-05 + }, + { + "id": 1, + "time": 1.1347999816280208e-05 + } + ], + "time": 5.658399982166884e-05 + }, + { + "entity": { + "collection_id": 7, + "home": 0, + "id": 3145731, "index": [ - 3 + 11 ], + "migratable": true, "type": "object" }, "node": 0, @@ -108,10 +144,14 @@ and optionally the `index`, `home`, and `collection_id` for that object. "subphases": [ { "id": 0, - "time": 0.014104127883911133 + "time": 1.3647000059791026e-05 + }, + { + "id": 1, + "time": 1.1320000112391426e-05 } ], - "time": 0.014104127883911133 + "time": 3.787500008911593e-05 } ] } @@ -132,50 +172,40 @@ types, like an `object` or `node` depending on the type of communication. { "communications": [ { - "bytes": 262.0, + "bytes": 1456.0, "from": { - "home": 1, + "home": 0, "id": 1, + "migratable": false, "type": "object" }, - "messages": 1, + "messages": 26, "to": { - "home": 0, - "id": 4294967296, + "home": 1, + "id": 5, + "migratable": false, "type": "object" }, "type": "SendRecv" }, { - "bytes": 96.0, + "bytes": 1456.0, "from": { "home": 0, - "id": 4294967296, - "type": "object" - }, - "messages": 1, - "to": { "id": 1, - "type": "node" - }, - "type": "CollectionToNode" - }, - { - "bytes": 259.0, - "from": { - "id": 0, - "type": "node" + "migratable": false, + "type": "object" }, - "messages": 1, + "messages": 26, "to": { - "home": 0, - "id": 0, + "home": 2, + "id": 9, + "migratable": false, "type": "object" }, - "type": "NodeToCollection" + "type": "SendRecv" } - ], - "id": 0 + ] } ] } @@ -198,6 +228,97 @@ The type of communication lines up with the enum For all the broadcast-like edges, the communication logging will occur on the receive of the broadcast side (one entry per broadcast recipient). +\section JSON_data_files_validator.py + +All input JSON files will be validated using the `JSON_data_files_validator.py` found in the `scripts` directory, which ensures that a given JSON adheres to the following schema: + +\code{.py} +Schema( + { + Optional('type'): And(str, lambda a: a in allowed_types_data, + error=f"{self.get_error_message(allowed_types_data)} must be chosen"), + Optional('metadata'): { + Optional('type'): And(str, lambda a: a in allowed_types_data, + error=f"{self.get_error_message(allowed_types_data)} must be chosen"), + Optional('rank'): int, + Optional('shared_node'): { + 'id': int, + 'size': int, + 'rank': int, + 'num_nodes': int, + }, + Optional('phases'): { + Optional('count'): int, + 'skipped': { + 'list': [int], + 'range': [[int]], + }, + 'identical_to_previous': { + 'list': [int], + 'range': [[int]], + }, + }, + Optional('attributes'): dict + }, + 'phases': [ + { + 'id': int, + 'tasks': [ + { + 'entity': { + Optional('collection_id'): int, + 'home': int, + 'id': int, + Optional('index'): [int], + 'type': str, + 'migratable': bool, + Optional('objgroup_id'): int + }, + 'node': int, + 'resource': str, + Optional('subphases'): [ + { + 'id': int, + 'time': float, + } + ], + 'time': float, + Optional('user_defined'): dict, + Optional('attributes'): dict + }, + ], + Optional('communications'): [ + { + 'type': str, + 'to': { + 'type': str, + 'id': int, + Optional('home'): int, + Optional('collection_id'): int, + Optional('migratable'): bool, + Optional('index'): [int], + Optional('objgroup_id'): int, + }, + 'messages': int, + 'from': { + 'type': str, + 'id': int, + Optional('home'): int, + Optional('collection_id'): int, + Optional('migratable'): bool, + Optional('index'): [int], + Optional('objgroup_id'): int, + }, + 'bytes': float + } + ], + Optional('user_defined'): dict + }, + ] + } +) +\endcode + \section lb-spec-file LB Specification File In order to customize when LB output is enabled and disabled, a LB specification file can be passed to \vt via a command-line flag: