← Back to team overview

yade-dev team mailing list archive

Re: [Bug 729079] Re: Performance optimization of InsertionSortCollider

 

>
> Because Insertion sorting is a serial algo. It haven't a isolated data
> for different threads and haven't a mechanism to exchange data between
> threads. So, threadA can write to data from threadB (and will do it).
Perhaps I get you wrong, but there is no need for explicit mechanisms to
isolate threads and exchange data with openmp (though explicit
mechanisms can be more optimal than basic openmp in some cases, we have
some in Yade, e.g. for summing forces). I'm not saying it is foolproof
in all cases, but parallelizing a serial algo the non-intrusive way is
exactly what OpenMP is supposed to do (that's what Anton did).

So, if insert() is safe, we are left with the only question: can threadA
invalidate some data used by threadB during the sort? I couldn't spot
such case, but I didn't spend so much time on it. Did you find one?

B.




Follow ups

References