|
2 | 2 | * @file ComponentImpl.hpp |
3 | 3 | * @brief Definition of `Component`, included by model translation units. |
4 | 4 | * |
5 | | - * `gather` copies the internal variables, then those at each port, into a |
6 | | - * local array where the model evaluates, and the scatters add the results back. |
7 | | - * Devices at the same bus add to the same entries, so a parallel evaluation |
8 | | - * must synchronize those additions. |
| 5 | + * A component evaluates on a local copy. `gather` copies its own variables, |
| 6 | + * then the variables at each port, into one fixed-size array, the model |
| 7 | + * evaluates there, and the scatter functions add the results back into the |
| 8 | + * system vectors. |
| 9 | + * |
| 10 | + * Gathers only read, so they are safe in parallel. Scatters are not: every |
| 11 | + * device at a bus adds to that bus's entries, so those additions must be |
| 12 | + * synchronized, and buses with many devices are the likely bottleneck. |
9 | 13 | */ |
10 | 14 |
|
11 | 15 | #pragma once |
@@ -91,7 +95,7 @@ namespace GridKit |
91 | 95 | return 0; |
92 | 96 | } |
93 | 97 |
|
94 | | - /// Internal, then each port's variables |
| 98 | + /// Copy the internal variables, then the variables each port reads from its component, into `x` |
95 | 99 | template <typename scalar_type, typename index_type> |
96 | 100 | void Component<scalar_type, index_type>::gather(ScalarT* x) const |
97 | 101 | { |
|
0 commit comments