[Swift-devel] array_mapper hangs
Michael Wilde
wilde at mcs.anl.gov
Fri Mar 19 21:01:43 CDT 2010
Sarah,
The script is hanging because its trying to access the values of the array object f[], which is never set. Ie, at the point at which it wants a value for physD[0] and physD[1], physD itself - even though it has been *mapped* - has never been given a *value.
I think that (or some closely similar reason) is why this script hangs.
The *mapper*, however, os working fine. I re-wrote the script to use the same mapper in a context in which physD *is* set, and it then works, as below.
- Mike
$ cat am2.swift
type file;
app (file o) echo (string s)
{
echo s stdout=@o;
}
(file physD[]) maptest() {
foreach s, i in ["x","y"] {
physD[i] = echo(s);
}
}
string outfilenames[];
string conditions[] = ["rest1","emblem"];
foreach cond,c in conditions{
outfilenames[c] = @strcat(cond,"_physio.dat");
}
string sdata[] = ["f1data","f2data"];
file f[] <array_mapper;files=outfilenames>;
f = maptest();
$
$ swift am2.swift
Swift svn swift-r3264 (swift modified locally) cog-r2730 (cog modified locally)
RunID: 20100319-2055-xhecsen3
Progress:
Final status: Finished successfully:2
$ ls *.dat
emblem_physio.dat rest1_physio.dat
$ more *.dat
::::::::::::::
emblem_physio.dat
::::::::::::::
y
::::::::::::::
rest1_physio.dat
::::::::::::::
x
$
----- "Sarah Kenny" <skenny at uchicago.edu> wrote:
> i'm trying to run the following code:
>
> app (file physD[]) maptest(){
> touch @filename(physD[0]) @filename(physD[1]);
> }
>
> string conditions[] = ["rest1","emblem"];
>
> string outfilenames[];
> foreach cond,c in conditions{
> outfilenames[c] = @strcat(cond,"_physio.dat");
> trace(outfilenames[c]);
> }
>
> file f[] <array_mapper;files=outfilenames>;
> f = maptest();
>
> but when i try to run it it hangs indefinitely...in my experience this
> *usually* means 'bad mapping' somewhere...not sure if i just have some
> syntactical error here or if something's up with the array_mapper (?)
>
>
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
--
Michael Wilde
Computation Institute, University of Chicago
Mathematics and Computer Science Division
Argonne National Laboratory
More information about the Swift-devel
mailing list