← Back to team overview

yade-dev team mailing list archive

Re: Note on optimized compilation / optimized coding / profiling results

 

Václav Šmilauer said:     (by the date of Sat, 23 Feb 2008 07:54:00 +0100)

> For openMP, parallel loops must loop over numbers,
> so instead of interactionContainer iterator, it must be rewritten in
> something like this:
>  
>  #pragma parallel for
>  for(int i=0; i<interactions.size(); i++){
>     const Interaction& i(interactions[i]);
>   ...
>  }
> 
> You get the idea, right? If getting "interactions[i]" is just a bit
> slower than pointer arithmetics in old-style array or std::vector, it
> will be much slower in total, I think.

I'm not sure, gotta check this.

I want to point out that I prefer to parallelize stuff using
boost::thread, instead of openMP #pragma parallel. I would prefer to
fork several loops with boost thread, where each loop is for selected
start-end pairs.

Later, possibly, the start-end pairs can be adjusted depending on how
much time was spent on them.

-- 
Janek Kozicki                                                         |
_______________________________________________
yade-dev mailing list
yade-dev@xxxxxxxxxxxxxxxx
https://lists.berlios.de/mailman/listinfo/yade-dev



Follow ups

References