Conversation
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
|
Hey @leonardogalliano, this is a great PR, thanks a lot for this extensive work which is super useful. |
|
Yep we can do that! I made a small modification. Now we can define a callback with instead of with Then to store the callback we add the algorithm I've realised it's not a big change, but it's true that it's a bit cleaner. Is this what you had in mind in #68 ? Or should |
|
This is great! Yes the implementation is way more concise that I what I first imagined. |
|
In principle a callback can be any function, for now there is nothing special about them. The And regarding the name of the macro I don't have preferences, pick the one you like the most! |
|
I chose to delete the export of the macro because callback seems like a pretty generic name. So users have to use |
|
Ok there's a problem with Enzyme :'( and the |
|
Nice! Ok for the macro changes. Enzyme is always a pain... It used to work with the previous version of Project.toml when I did the PR, but it looks the new versions are not anymore compatible with Julia 1.9? |
|
Should work now @leonardogalliano ! |
Callbacks previously depended on the full
Simulationobject and were designed to return quantities averaged over all parallel chains. This made it difficult to monitor per-chain observables (e.g. the instantaneous potential energy of each chain independently).While the conceptual change is simple, implementing it required non-trivial refactoring across the codebase. Google Antigravity helped.
Changes
StoreCallbacksalgorithm now stores results independently for each chain.trajectories/folder has been renamed tochains/, reflecting the fact that it contains heterogeneous data (trajectories, configurations, restart files, etc.), not just trajectories.callback_acceptancehas been removed. Acceptance tracking is now handled by a dedicated algorithm,StoreAcceptance, which stores per-move acceptance information in the appropriate folders. This is more consistent with Arianna’s design philosophy.StoreParametershas been redesigned. Previously, it created aparameters/folder for each move containing onlyparameters.dat, which was unintuitive.moves/folder, with one subfolder per move, containing all move-related data (parameters, acceptance, etc.).StoreObjectivealgorithm has been introduced. It stores the average rewardmoves/. Previously, there was no systematic way to trackStoreAcceptance;trajectories/tochains/.Backward compatibility and ParticlesMC
The main compatibility issue concerns, of course, ParticlesMC. Merging this PR will require a new Arianna release and a corresponding update of ParticlesMC.
The required changes in ParticlesMC should be manageable:
callback_energyto take system as inputcallback_acceptancewithStoreAcceptancein all example and test filestrajectories/tochains/.