[Swift-devel] script mapper

Michael Wilde wilde at mcs.anl.gov
Wed Oct 31 19:44:26 CDT 2007


Very nice. Youre a step ahead as usual. Im sitting here with Andrew 
cranking data for the grant proposal and my head hurts.

Would be nice to do a simple example with short names suitable for the 
mapper section of the user guide. if you get to that first, great, if 
not one of us will.

Is this commited/commitable?


So the mapper is called "ext", takes a script via exec=, and then 
arbitrary mapper-specific args?

And always is used to map an array?

Im not sure this question makes sense, but can the same technique be 
used to shell out to a mapper that returns a struct or array of structs 
like the tabular mapper you did for Andrew? The main difference being 
that the tabular file doesnt need to exist before the program starts?

- Mike


On 10/31/07 7:19 PM, Mihael Hategan wrote:
> Well, there were no objections so here it is:
> 
> file fs[]
> <ext;exec="../php/list-frames.php",s=@arg("GPS_start_time"),e=@arg("GPS_end_time")>;
> 
> foreach f in fs {
>         print(@filename(f));
> }
> 
> The script produces space separated pairs of a path and a file name. The
> path is similar to what you would do in Swift. In the above case it
> produces something like:
> 
> [0] file1
> [1] file2
> etc.
> 
> This can be used with arbitrary things, such as:
> [0].somefield.array[3] file
> 
> The mapper arguments, except "exec", are mapped to command line
> arguments prefixed with a hyphen. So the above example causes the
> following to happen:
> 
> swift Plot1Chan.swift -GPS_start_time=877890090 -GPS_end_time=877543210
> ...
> list-frames.php -s 877890090 -e 877543210
> 
> Mihael
> 
> On Wed, 2007-10-31 at 17:21 -0500, Mihael Hategan wrote:
>> I'm working on a script mapper for swift. Basically it allows executing
>> some form of local executable which spells on stdout (swift_path,
>> file_path) pairs. This was motivated by my unwilingness to deal with a
>> potentially deadlocking swift because the CSV mapper was used wrong in
>> I2U2/LIGO (didn't actually get there, but wanted to avoid it).
>>
>> I believe Mike suggested something like this anyway.
>>
>> If you think I'm going in the wrong direction, it would be nice if you
>> said so before I get deeper into it.
>>
>> Mihael
>>
>> _______________________________________________
>> Swift-devel mailing list
>> Swift-devel at ci.uchicago.edu
>> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
>>
> 
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
> 
> 



More information about the Swift-devel mailing list