Skip to content

Conversation

@RobBuchananCompPhys
Copy link
Contributor

@RobBuchananCompPhys RobBuchananCompPhys commented Dec 22, 2025

Untitled-2025-03-03-1239

This PR aims to combat the issue we ran into while working on the Dissolve2 atomShake unit test, namely, that the generator parts of the graph can run unnecessarily on subsequent runs where the source ConfigurationNode is modified (i.e. via the "Temperature" option).

This aims to be one of two variants of this solution that I am exploring, so there may well be two PRs in the end.

Ultimately, to accomplish this we need to be able to notify the generator nodes (such as InsertNode) that the changes to the state of source configuration necessitate or preclude their re-running.

For example, in the schematic above, in panel A) the graph performs its first run, and all nodes run as usual. In B), we change the temperature of the configuration at its source, which precludes a second run of the generator. Finally, in C), we modify the species population in the generator itself, so everything runs once again.

This is achieved by a system of flagging that is set on the actual Configuration instance being pointed to. When an option/input is set in certain nodes, we can call an overloaded onValueSet method which can be used to set flags on a node's data member - in this case, the Configuration::regenerateRequired_ flag is set to false when the "Temperature" option is set. Conversely, when the "Population" or "Density" is changed, the flag is true.

This gives us a way to communicate this information between relevant nodes, but does not affect other configuration/generator sources that might exist in a more complex graph.

One limitation to the method demonstrated here, is that after modifying the node option the user must individually run the ConfigurationNode before re-running the entire graph.

@RobBuchananCompPhys RobBuchananCompPhys force-pushed the dissolve2/configuration-validation branch 2 times, most recently from 23c93ba to e612c02 Compare December 22, 2025 11:32
@RobBuchananCompPhys RobBuchananCompPhys marked this pull request as ready for review December 23, 2025 11:35
@RobBuchananCompPhys RobBuchananCompPhys force-pushed the dissolve2/configuration-validation branch from c0d721a to a42c032 Compare December 23, 2025 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants