← Back to team overview

yade-dev team mailing list archive

Re: Energy tracing vs. multithread?

 

Hi,

I've been looking into OpenMPAcumulator.
Questions :
- Can I register the attribute  OMPAc <> plasticDissipation?
- Assuming the answer is no : I need to register a storage variable Real plasticDissipation2 for initialisation, so that saving/loading will not reset plastic energy. The problem is it needs a plasticDissipation2=plasticDissipation _before_ saving. Where could I do that? - plasticDissipation2 should be registered but hidden for the user, who has to use getPlasticDissipation() instead. Is that possible?

Thanks for suggestions.

Bruno



What will happen if two threads increment the value at the same time?
Pretty much random things (garbage, not incremented, etc), depending on
atomicity of reads/writes. There is OpenMPAcuumulator template for this
purpose, used e.g. for unbalanced force callback.









Follow ups

References