[Swift-devel] readData2

Ben Clifford benc at hawaga.org.uk
Wed Oct 15 05:38:47 CDT 2008


I wrote a test for this, committed in r2301.

I got a bit stuck with an issue that I thought wasn't a problem any more, 
but apparently still is.

In the test, I initially said something like:

matrix m = readData2(..)

int s = m[1] + m[2];

outfile = echo(s);

which hangs.

Changing the s line to:

int s;
s=m[1]+m[2];

removes the hang - in the former case, the expression gets evaluated in 
the sequential bit where variables are defined; in the latter, the s 
variable is defined without a value and the expression evaluation happens 
in parallel bit where data dependencies work right.

A solution in this case would be to make int s=<expr> compile to the same 
definition + parallel code, rather than having that sequential.

However, I think that wil break other pieces of code - I think, for 
example, mapper parameters which rely on variables having their values 
defined 'before' (where 'before' is an implementation specific, rather 
than SwiftScript specific temporal ordering)

Language-wise, the appropriate behaviour is to be properly dataset 
dependent for all use of values in SwiftScript, I think - that's been 
discussed before, and is not trivial to do. But the above is one more 
quantum of motivation.

-- 




More information about the Swift-devel mailing list