[Swift-devel] Re: Heap space being exhausted

Mihael Hategan hategan at mcs.anl.gov
Thu Jun 3 21:02:47 CDT 2010


On Thu, 2010-06-03 at 19:07 -0500, Allan Espinosa wrote:
> I see. so in this workflow there will be a slow start:
> 
> foreach ai,i in a[] {
>   y[i] = f(x[i]);
>   foreach bj,j in b[] {
>      z[j] = g(y[i], bj);
>   }
> }
> 
> at the start the number of threads will be <= maxthreads, then when
> some y[i]'s become available there will now be maxthreads*maxthreads
> threads running.

Right. The restriction is on each foreach <b>instance</b>. Basically
each different scope is an instance. I.e. think of a foreach as a
parallelFor in Karajan, which defines a different scope for each
iteration.





More information about the Swift-devel mailing list