Repository navigation
Add partition docs - #622
abirchfield wants to merge 1 commit into
Conversation
nkoukpaizan
left a comment
There was a problem hiding this comment.
The ideas in the specifications overall look good to me. A few comments about wording and what's included in this PR.
- I would keep the two cases in
examples/out of this PR. The figures are already inGridKit/Model/PhasorDynamics/Partitionand nicely rendered in the README. And for now, I wouldn't include*partition.json filesfor larger systems as inWECC240.partition.json. - I would also remove
WECC240.pngfor now. The notional diagrams are sufficient to illustrate the specifications. If/when we implement WECC240, we can revisit the figure. @lukelowry if you want to improve it in the meantime, I recommend making it publication-ready (larger fonts for buses, bolder lines, etc).
| This example shows how multi-level hierarchical partitions can be implemented | ||
| with partition groups. | ||
|
|
||
| File name: `deep.partition.json` |
There was a problem hiding this comment.
deep.partition.json is missing from this PR, but is on lukel/partition-dev. I would only keep the inlined json code for this PR.
| 2. A `PartitionGroup` is a container for partitions and other | ||
| partition groups. It functions as an intermediate node | ||
| in the partition hierarchy. | ||
| Partition groups do not contain any buses directly. |
There was a problem hiding this comment.
| Partition groups do not contain any buses directly. | |
| Partition groups do not list any buses directly. |
I wouldn't make the ownership of external buses a hard requirement in the specifications. Implementation-wise, #620 supports either, and lukel/partition-dev keeps all of them at the root level.
| 3. Every bus must appear somewhere, | ||
| either as `external` or `internal`, but not both. | ||
| 4. Internal buses must only appear uniquely in one `Partition`. |
There was a problem hiding this comment.
We need a rule to reject systems where an external bus is only listed in one partition. It should be internal there, or also listed in the partitions it connects to.
There was a problem hiding this comment.
My suggestion would be to have coupling buses belong to the system and be at the same level as partitions. I understand in that case there would ambiguity where components connected directly to the coupling bus belong, but I think that could be addressed.
| 5. Each `Component` that has bus ports shall be assigned to the first | ||
| `Partition` containing all its bus ports. If none exists, |
There was a problem hiding this comment.
"First" in the json file order?
| 4. Internal buses must only appear uniquely in one `Partition`. | ||
| 5. Each `Component` that has bus ports shall be assigned to the first | ||
| `Partition` containing all its bus ports. If none exists, | ||
| raise a `BadPartition` exception. |
There was a problem hiding this comment.
| raise a `BadPartition` exception. | |
| raise an error/exception. |
| The concept of "Partition" is used in phasor dynamics in GridKit to refer | ||
| to dividing up a system model into smaller parts | ||
| **for the purpose of parallel simulation** and other | ||
| solver acceleration techniques. | ||
| Dividing up a system for _modeling convenience_ (like having physically | ||
| meaningful areas corresponding to particular utilities, | ||
| containerized subcomponents, template aggregate models | ||
| for multi-instantiation, etc.) | ||
| is a fundamentally different goal. It is not | ||
| appropriate to use divisions driven by modeling for solver acceleration. |
There was a problem hiding this comment.
I don't think the partition specification ties us to either goal. We could still express modeling choices in the same format, only that we may ignore load balance, etc.
There was a problem hiding this comment.
I agree and I think at this point we only need to have specs on how to define subsystems within a larger system in a JSON input. We can use that definition to create meaningful physical subsystems such as areas within a grid or coarse-grained partitions for parallel computations or partitions for a multimethod integration.
| If a `Component` assigned to a partition is | ||
| connected to an unassigned `Component`, | ||
| assign to the same partition. This process needs to be repeated until no further | ||
| assignments occur. |
There was a problem hiding this comment.
| If a `Component` assigned to a partition is | |
| connected to an unassigned `Component`, | |
| assign to the same partition. This process needs to be repeated until no further | |
| assignments occur. | |
| Place signal-connected devices together, in the first partition containing all bus ports of all of them. Signal nodes go with the devices that use them. |
| assignments occur. | ||
| If a `Component` is left unassigned or if two connected | ||
| components are assigned to different partitions, | ||
| raise a `BadPartition` exception. |
There was a problem hiding this comment.
| raise a `BadPartition` exception. | |
| raise an error/exception. |
|
|
||
| ## Validation Rules and Component Assignment | ||
|
|
||
| Any violation of the rules below results in a `BadPartition` exception. |
There was a problem hiding this comment.
| Any violation of the rules below results in a `BadPartition` exception. | |
| Any violation of the rules below results in an error/exception. |
This comment was marked as duplicate.
This comment was marked as duplicate.
pelesh
left a comment
There was a problem hiding this comment.
This is a very good starting point.
I would limit the scope of this PR just to addressing #619 and specifying JSON input file format for hierarchical modeling. I would focus here on a JSON specs for uniquely defining (arbitrary) subsystems within a system model. Some of the documentation is implementation specific but I don't think we need to go in that detail here.
| This file defines a nested, hierarchical structure of containers | ||
| of type `Partition` and `PartitionGroup`. |
There was a problem hiding this comment.
I would prefer name Subsystem rather than partition. It would follow current engineering-inspired naming scheme component --> subsystem -->system.
I also don't see a need for PartitionGroup. A subsystem may be composed of components or other subsystems. I don't see significant difference between Partition and PartitionGroup objects as defined and would suggest the simpler solution.
There was a problem hiding this comment.
agreed, i don't think PartitionGroup is necessary. from what i can tell, it should be possible to combine any partitions. delineating when this may occur in the format seems redundant.
There was a problem hiding this comment.
I think the reason for this is for validation purposes - PartitionGroups can only contain buses and Partitions while Partitions contain actual components. A partitioned integrator can simulate a PartitionGroup while a normal monolithic integrator can simulate a Partition.
| 3. Every bus must appear somewhere, | ||
| either as `external` or `internal`, but not both. | ||
| 4. Internal buses must only appear uniquely in one `Partition`. |
There was a problem hiding this comment.
My suggestion would be to have coupling buses belong to the system and be at the same level as partitions. I understand in that case there would ambiguity where components connected directly to the coupling bus belong, but I think that could be addressed.
| Partitions for a system are defined in a JSON file, usually called | ||
| `[model_name].partition.json`, which is separate from the system model | ||
| definition | ||
| but refers to buses by number from the system model definition. | ||
| Defining a partition file for a system is optional, but needed to enable | ||
| parallel model evaluation for some solvers. |
There was a problem hiding this comment.
| Partitions for a system are defined in a JSON file, usually called | |
| `[model_name].partition.json`, which is separate from the system model | |
| definition | |
| but refers to buses by number from the system model definition. | |
| Defining a partition file for a system is optional, but needed to enable | |
| parallel model evaluation for some solvers. | |
| Partitions are defined in a JSON file with an extension of `partition.json`. Partitions are separate from but reference a system model definition through bus numbers specified in the system model. Defining a partition file for a system is optional, but may be necessary for parallel model evaluation depending upon the solver. |
we should remove the reference to [model_name] in the name. in the implementation of this format, i think it would be better to specify the partitioning scheme through the simulation interface. something like
./DynamicSimulation --model [model file] --partition [partition file]
where the --partition argument is optional, as partitioning is not necessary.
| The concept of "Partition" is used in phasor dynamics in GridKit to refer | ||
| to dividing up a system model into smaller parts | ||
| **for the purpose of parallel simulation** and other | ||
| solver acceleration techniques. | ||
| Dividing up a system for _modeling convenience_ (like having physically | ||
| meaningful areas corresponding to particular utilities, | ||
| containerized subcomponents, template aggregate models | ||
| for multi-instantiation, etc.) | ||
| is a fundamentally different goal. It is not | ||
| appropriate to use divisions driven by modeling for solver acceleration. |
There was a problem hiding this comment.
| The concept of "Partition" is used in phasor dynamics in GridKit to refer | |
| to dividing up a system model into smaller parts | |
| **for the purpose of parallel simulation** and other | |
| solver acceleration techniques. | |
| Dividing up a system for _modeling convenience_ (like having physically | |
| meaningful areas corresponding to particular utilities, | |
| containerized subcomponents, template aggregate models | |
| for multi-instantiation, etc.) | |
| is a fundamentally different goal. It is not | |
| appropriate to use divisions driven by modeling for solver acceleration. | |
| A partition of a phasor dynamics system model specifies a division of the model into smaller parts. Partitioning may be done to facilitate parallel simulation, for modeling convenience, or for some other reason. This document is only concerned with the manner in which a partition scheme is specified. |
i think this better introduces the document
| In the future it is envisioned that signals may also be part of the | ||
| partition definition, allowing connected components to be in separate | ||
| partitions. For now, only buses can divide partitions. |
There was a problem hiding this comment.
it would be better to move the comments relating to future work later in the document, in a separate section, so that we can focus on the current iteration of the format (and later, the implementation) at the start.
| As mentioned above, there are two types of objects in a `partition.json` file: | ||
| partitions and partition groups. | ||
|
|
||
| 1. A `Partition` is a container for buses that is a leaf node of the partition |
There was a problem hiding this comment.
I'm curious why a partition is a container of buses rather than components. At the last meeting @abirchfield you hinted there was some issue with that approach. Components seem more natural to me because they would require less JSON configuration. You just need disjoint sets of component ID/indices. In contrast, the approach in this PR requires specifying both internal and external buses for each partition. This seems more error prone for human specification and leaves some ambiguity about what partition a component resides in if it only connects to external buses (if that's possible?).
There was a problem hiding this comment.
@Steven-Roberts As I understand from what @abirchfield said in the meeting every bus (more or less) has components which are only attached to those buses (at least in the way the models are currently designed). So any external bus must have components which are attached only to them.
Description
Adding documentation for JSON format for Partitions. See the README for detailed description and justification
Proposed changes
Add README for partitions, along with examples for TenGen and WECC240. Implementation out-of-scope, but see
lukel/partitioned-case-dev branch for a working prototype.
Checklist
N/A - no new code