[Swift-user] Swift v0.4 released (external mapper example)

Michael Wilde wilde at mcs.anl.gov
Wed Mar 19 17:41:19 CDT 2008


Here's a trivial example, not perhaps the most clear, but runnable:.

The ext mapper is a script that returns two columns:

<swift-expression> <physicalname>

Swift expression is an index or field reference expression relative to a 
  structured swift object (array or structure, possibly nested).

Physical name is the filename or gridftp URI of the physical object to 
be mapped to that swift expression.

The example below, mapping is done to a simple array, so the 
swift-expressions are [0], [1], etc.

But they could be for example [0].data, [0].info, etc if you were 
mapping an array of structures of two fields, .info and .data.

Ben or Mihael, please clarify or correct.

- Mike



UC64$ cat awf8.swift

type pcapfile;
type angleout;
type anglecenter;

(angleout ofile, anglecenter cfile) angle4 (pcapfile ifile)
{
   app { angle4 @ifile @ofile @cfile; }
}

pcapfile pcapfiles[]<ext; exec="map1">;

// gsiftp://tp-osg.ci.uchicago.edu// disks/ci-gpfs/angle/  spool_1/ 
anl2-1182294000-dump.1.167.pcap.gz

angleout    of[] 
<structured_regexp_mapper;source=pcapfiles,match="(spool_.*)/(.*)\.pcap\.gz",transform="_output/of/\1/of.\2.angle">;
anglecenter cf[] 
<structured_regexp_mapper;source=pcapfiles,match="(spool_.*)/(.*)\.pcap\.gz",transform="_output/cf/\1/cf.\2.center">;

foreach pf,i in pcapfiles {
   (of[i],cf[i]) = angle4(pf);
}

UC64$ cat map1

#! /bin/sh
awk <angle-t '
BEGIN { server="gsiftp://tp-osg.ci.uchicago.edu//disks/ci-gpfs/angle"; }
{ printf "[%d] %s/%s\n", i++, server, $0 }'

UC64$

UC64$ cat angle-t
spool_1/anl2-1182294000-dump.1.167.pcap.gz
spool_1/anl2-1182295800-dump.1.170.pcap.gz
spool_1/anl2-1182296400-dump.1.171.pcap.gz
spool_2/anl2-1182397800-dump.1.340.pcap.gz
spool_2/anl2-1182398400-dump.1.341.pcap.gz
spool_2/anl2-1182399000-dump.1.342.pcap.gz
UC64$



On 3/19/08 5:14 PM, Luciano Piccoli wrote:
> 
> Is there an example of usage of the new external mapper? I grep'd 
> through the examples and did not find any reference.
> Thanks,
> Luciano
> 
> Ben Clifford wrote:
>> Swift 0.4 is released.
>>
>> You can download it from http://www.ci.uchicago.edu/swift/downloads/
>>
>> In addition, there are a few pages of release notes detailing the 
>> substantial changes since v0.3 here: 
>> http://www.ci.uchicago.edu/swift/packages/release-notes-0.4.txt
>>
>>   
> 
> 
> _______________________________________________
> Swift-user mailing list
> Swift-user at ci.uchicago.edu
> http://mail.ci.uchicago.edu/mailman/listinfo/swift-user
> 
> 



More information about the Swift-user mailing list