-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#2291: Extract LBDatafile schema to separate python file
- Loading branch information
1 parent
8da76ec
commit 6221608
Showing
3 changed files
with
88 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ compile_commands.json | |
*.lo | ||
*.o | ||
*.obj | ||
*.pyc | ||
|
||
# Precompiled Headers | ||
*.gch | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
from schema import And, Optional, Schema | ||
|
||
LBDatafile_schema = Schema( | ||
{ | ||
Optional('type'): And(str, "LBDatafile", error="'LBDatafile' must be chosen."), | ||
Optional('metadata'): { | ||
Optional('type'): And(str, "LBDatafile", error="'LBDatafile' 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 | ||
}, | ||
] | ||
} | ||
) |