yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #04286
Re: Energy tracing vs. multithread?
> 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?
No, the accumulator is not serializable (and is not meant to be, it is
just a special increment-only variable). You could, though add a private
bool doReset, which would be an additional (optional) parameter to the
ctor (True by default) which would prevent reset() from doing anything.
That would be the easiest, I think.
BTW the accumulator implementation is not very good, since the values
for different threads are in the same memory part, hence cores have to
synchronize that memory among themselves (happens on hardware level,
which is still much faster than with mutexes etc), but it will not scale
very well. It is less acute fro ForceContainer, where _force components
for different threads might be long enough to be in different cache
lines; but it is not enforced, though.
BTW2 regarding dropping Wm3 and moving to eigen: eigen has support for
taucs solver with its sparse matrices, see
http://eigen.tuxfamily.org/dox/TutorialSparse.html
Cheers, v.
Follow ups
References