[Swift-user] How does swift mapping to files that do not yet exist work?

Jonathan Margoliash jmargolpeople at gmail.com
Tue Jul 3 16:48:16 CDT 2012


Hello swift user base,

I have been having trouble with a bit of swift code for a while now, and
despite my hesitancy to ask other people to debug my code, I believe my
issue may be more of a lack of understanding of swift than a simple syntax
error, so I have decided to send out this email. Specifically, I have a
single_file_mapper mapping to a file which does not yet exist when my code
is run, in hopes that the file being mapped to will be written to by a an
app call. However, when I try running my code, I get the error back from
swift

Execution failed:
    File not found: *filename *(in this case new_point1_1.mat)
*
*This paradigm of referencing files that do not yet exist has worked before
in swift, so I do not know what the problem is here. Hopefully it is not a
simple syntax bug. Anyway, thank you for your help,

Jonathan

----- My Code: ----------

#cce_ua.swift
type file;

int num_complexes = @toint(@arg("num_complexes"));
int num_simplexes_per_complex = @toint(@arg("num_simplexes_per_complex"));

app (file output, file log) cce_ua (file input1, file input2, int number,
file input3)
{
   cce_ua @input1 @input2 @output number @input3 stdout=@filename(log)
stderr=@filename(log);
   #located at _RUNDIR_/swat/cce_ua.sh
}

file inSCE<single_file_mapper;file="SCE_Par.mat">;
file inrunswat<single_file_mapper;file="RunSwat.m">;

foreach i in [1:num_complexes]
{
    foreach j in [1:num_simplexes_per_complex]
    {
        # These files already exist in the local directory
        file input<single_file_mapper; file=@strcat("simplex", i, "_", j,
".mat")>;
        # These files do not exist in the local directory at runtime
        file output<single_file_mapper; file=@strcat("new_point", i, "_",
j, ".mat")>;
        file log<single_file_mapper; file=@strcat("cce_ua", i, "_", j,
"_log.txt")>;

        (output, log) = cce_ua(inSCE, input, i*num_simplexes_per_complex +
j, inrunswat);
    }
}


---- The command line call to swift (broken up over multiple lines) ---
swift -tc.file swift_files/executable_locations -sites.file
swift_files/sites.xml cce_ua.swift -num_complexes=2
-num_simplexes_per_complex=1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-user/attachments/20120703/be1ae8d8/attachment.html>


More information about the Swift-user mailing list