salilab / pmi

Python Modeling Interface
https://integrativemodeling.org/nightly/doc/ref/namespaceIMP_1_1pmi.html
11 stars 11 forks source link

Don't call Model.update() from restraint get_output() methods #239

Closed sethaxen closed 6 years ago

sethaxen commented 6 years ago

Most (if not all) restraints call IMP.Model.update() at the beginning of their get_output() methods. Consequently, the outputting process repeatedly updates the model unnecessarily (see here). For systems where the scoring function itself is inexpensive, these redundant calls can dominate the runtime. It seems it would be better if either IMP.pmi.output.Output updated the model once before getting outputs or if it assumed that the model was updated, leaving it to the method that triggers saving of outputs (e.g. IMP.pmi.macros.ReplicaExchange0) to update the model once before outputting.

Do the PMI architects see any fatal flaws here?

Pellarin commented 6 years ago

It is ok with me

Sent from my iPhone

On Jun 20, 2018, at 10:32 PM, Seth Axen notifications@github.com wrote:

Most (if not all) restraints call IMP.Model.update() at the beginning of their get_output() methods. Consequently, the outputting process repeatedly updates the model unnecessarily (see here). For systems where the scoring function itself is inexpensive, these redundant calls can dominate the runtime. It seems it would be better if either IMP.pmi.output.Output updated the model once before getting outputs or if it assumed that the model was updated, leaving it to the method that triggers saving of outputs (e.g. IMP.pmi.macros.ReplicaExchange0) to update the model once before outputting.

Do the PMI architects see any fatal flaws here?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.