Skip to content
Snippets Groups Projects
Commit 2f58e500 authored by Jonas Greitemann's avatar Jonas Greitemann
Browse files

Install PT update callback & use it to update pt

Previously, the client-side `update::parallel_tempering` actually took
care itself of updating the phase space point, rather than calling into
update_phase_point(...). This bypassed the observable-management that is
done in the pt_adapter (as well as potentially any other intermediate
simulation adapters).

The fix I eventually came up with is not a thing of beauty: simulations
which want to use PT must define a `install_pt_update_callback(...)`
member function as part of their SVM interface; otherwise it is not
necessary. This hands it a callback function which invokes
`update_phase_point` on the `pt_adapter`. The simulation should store
this callback and eventually pass it on to `pt::negotiate_update`. Never
should the client code invoke the callback itself.

A (somewhat more elegant alternative) would be to make
`update_phase_point` a virtual function and invoke it polymorphically
that way. This would be more elegant for most codes, but it would still
not help for frustmag, where the individual updates do not have access
to the simulation class. This may be subject to refactoring.

Also, right now the simulation is crashing still.
parent e2e2bbd0
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment