[Swift-user] Tuning parameters of coaster execution

Mihael Hategan hategan at mcs.anl.gov
Tue Jan 19 13:01:57 CST 2010


On Tue, 2010-01-19 at 13:01 -0500, Andriy Fedorov wrote:
> Mihael,
> 
> The script is very simple:
> 
> iterate cnt {
>   doStuff
> } until (cnt<100);
> 
> I thought this is a parallel construct. Was I wrong?

Short answer: yes.
Long answer: I (and judging by the existence if iterate also "we") don't
understand clearly why the normal parallel foreach couldn't be used to
implement convergence conditions.The plain solution:

a[0] = initialValue;
foreach v, k in a {
  if (a[k] < epsilon) {
    a[k + 1] = f(a[k]);
  }
  else {
    //nothing
  }
}

should work in my view, since it expresses a convergence problem
correctly, without an explicitly sequential operation. But I suppose
that posed some implementation difficulties that were deemed not worth
solving, hence "iterate". I suspect the problem was that of detecting
that certain branches of an if can lead to no more data being put in the
array, which seems difficult to analyze at compile-time or figure out at
run-time.

Mihael




More information about the Swift-user mailing list