[Swift-devel] Swift hanging on array close?

Michael Wilde wilde at mcs.anl.gov
Fri Jul 9 15:18:09 CDT 2010


In the following script, two nested foreach stmts fill a sparse array. @filenames(array) is then passed to an ext mapper.

This seems to hang: the ext mapper is never called.

This code in on the mcs net in ~wilde/swift/lab/sgflow.

Mihael and/or Justin, can you take a look? The FL group needs this for a tutorial next week (and has lots more to do, so a quick fix or workaround this afternoon would be very helpful)

Thanks,

Mike

type file;

# <bus> is integer between 1 and 30
# <power> is in megawatts

app (file o) sgflow (int bus, int power)
{
  sgflow bus power stdout=@o;
}
app (file o) mkgraph (file i)
{
  awk "-f" "/home/turam/tmp/mkgraph.awk" @filename(i) stdout=@o;
}

app (file o) mktable (file i)
{
  awk "-f" "/home/turam/tmp/SGsplitter.awk" stdin=@i;
}

file ofiles[] <ext;exec="ofiles.map">;

string nbus = @arg("nbus","1");
string nplevel = @arg("nplevel", "2");
foreach bus in [1:@toint(nbus)] {
  foreach plevel in [1:@toint(nplevel)] {
    # file o<single_file_mapper; file=@strcat("out.","bus.",bus,".pow.",plevel)>;
    ofiles[bus*@toint(nplevel)+plevel] = sgflow(bus,plevel);
  }
}

file i <ext;exec="mktableinput.sh",o="out.csv",i=@filenames(ofiles)>;

# ^^^^ hangs here - mktableinput.sh is never called.
# trace(@filenames(ofiles)) also hangs.

file otable <"otable.txt">;
otable = mktable(i);

----
ofiles.map is hardcoded to return ofile.3 and ofile.4 - this works, and those files get the expected output.

-- 
Michael Wilde
Computation Institute, University of Chicago
Mathematics and Computer Science Division
Argonne National Laboratory




More information about the Swift-devel mailing list