[Swift-user] regarding Swift/Turbine compiler

Tim Armstrong tim.g.armstrong at gmail.com
Fri Nov 9 11:54:18 CST 2012


Hi Hao,
  Sorry for the confusion - which documentation are you looking at, out of
curiosity?

Basically, my advice would be to not worry about annotating the loops
unless you are seeing performance problems.  The default settings for
foreach loops should give good performance in most use cases. By default
they use a recursive loop splitting algorithm that is a good balance
between parallelism and control-flow overhead.

Here are a few rules of thumb about specific options:

   - The @unroll annotation is mainly useful if you have inter-iteration
   dependencies, as it can allow the compiler to optimize across loop
   iterations.  E.g. in the example below it could save an array lookup by
   optimizing across iterations after unrolling:

foreach x, i in A {
   B[i] = A[i] + A[i+1];

}

   - The @async annotation is rarely if ever useful: it tends to add
   additional overhead from more task spawns without meaningfully increasing
   parallelism, since any leaf functions within the loop body are spawned off
   as tasks regardless.

- Tim

On Fri, Nov 9, 2012 at 1:39 AM, Hao Yang <yanghao0614 at gmail.com> wrote:

> Hi, all:
>
> I am trying Swift/Turbine Compiler (STC). It seems that for foreach loops,
> the default mode is to run  every iteration locally, if @async annotation
> is provided, then the iterations will be launched on other remote turbine
> engines, if there is app function inside a iteration, the iterations will
> be launched on workers. I am wondering what is the criteria for making
> these decisions (whether to run locally, on other engines or on workers) if
> the goal is to optimize the performance?  If @unroll annotation is used to
> optimize performance, how can one choose a good unrolling factor?
>
> Thank you.
>
> --
> Best Regards,
> Hao Yang
> Networked Systems Laboratory
> Electrical and Computer Engineering
> The University of British Columbia
>
>
>
> _______________________________________________
> Swift-user mailing list
> Swift-user at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-user/attachments/20121109/c4d17e46/attachment.html>


More information about the Swift-user mailing list