← Back to team overview

yade-dev team mailing list archive

Re: [Branch ~yade-pkg/yade/git-trunk] Rev 3486: Parallelization of interaction loops in Law2_..._Capillarity (which is in fact not a LawFunctor h...

 

On 04/12/14 18:46, Bruno Chareyre wrote:
> On 03/12/14 22:57, Jerome Duriez wrote:
>> Hi,
>>
>> General discussions apart, what is the problem with this commit ?
>
> I don't know if there is a problem or not.
> I guess you checked that it gives the same result before/after and
> -j1/-jN.
> Did you check also the fusion detection?
>
After a quick look, there is a problem here:
https://github.com/yade/trunk/blob/master/pkg/dem/Law2_ScGeom_CapillaryPhys_Capillarity.cpp#L117
This insert() method is not thread-safe. If two threads are inserting at
the same time the result is undefined.
It needs a "critical" clause (this will surely kill the performance) or
a better design.

B


Follow ups

References