[Swift-user] iterate adding dependencies
Max Hutchinson
maxhutch at gmail.com
Wed Jun 17 15:49:38 CDT 2015
Hello,
I'm using an iterate loop like this:
progress[0] = 0.;
step = 5;
iterate i {
// Build executable
if (i == 0){
// Run from initial condition
output[i] = run_new();
} else {
// Resume from old run
output[i] = run_old(output[i-1]);
}
// Expensive post-processing
refined[i] = post_process(output[i]);
progress[i+1] = progress[i] + step;
} until (progress[i] < 100.);
run_old doesn't depend on refined, but will not run until the post_process
application completes (which is a while; it is expensive). I'm inferring
that iterate is sequential at the iteration-granularity.
Is this intentional? I think that iterate is the natural way to express
this computation, but the serialization of run_old wrt post_process is very
expensive. Is there a case where the assumption that iterations are
evaluated sequentially changes the result of the program?
Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-user/attachments/20150617/b3530437/attachment.html>
More information about the Swift-user
mailing list