[Swift-user] what is wrong with restart5.swift?

Mihael Hategan hategan at mcs.anl.gov
Sun May 25 11:56:44 CDT 2008


It doesn't look like it should fail.

On Sun, 2008-05-25 at 10:32 +0000, Ben Clifford wrote:
> Look at the below code and tell me if you think it should work or not 
> (i.e. if its buggy or not). It fails for me with a 'multiple mappings 
> point to the same file' error.
> 
> helperA, B, and C all write the word 'foo' into the filename passed as 
> argument (so most of the intermediate data ends up getting ignored 
> deliberately).
> 
> (I came up with this whilst working on testing for concurrent mapper and 
> restarts, but it fails irrespective of restarts when I think it should 
> work; however the reason for failure does not leap out at me)
> 
> type file;
> 
> (file t) a(file i) {
>     app {
>         helperA @filename(t);
>     }
> }
> 
> (file t) b(file i) {
>     app {
>         helperB @filename(t);
>     }
> }
> 
> (file t) c(file i) {
>     app {
>         helperC @filename(t);
>     }
> }
> 
> (file r) q(file i, int n) {
> file t;
> switch(n) {
> case 1: t=a(i); r=c(t);
> case 2: t=b(i); r=c(t);
> case 3: t=c(i); r=c(t);
> }
> }
> 
> file J <"restart.in">;
> 
> file X[];
> 
> file Y[];
> 
> foreach i in [1:3] {
>   X[i] = q(J,i);
> }
> 
> foreach x,j in X {
> Y[j] = q(x,j);
> }
> 
> 
> _______________________________________________
> Swift-user mailing list
> Swift-user at ci.uchicago.edu
> http://mail.ci.uchicago.edu/mailman/listinfo/swift-user




More information about the Swift-user mailing list