[Swift-user] example of @length

Michael Wilde wilde at mcs.anl.gov
Wed May 2 12:51:24 CDT 2012


Heather, its best to avoid the use of length() where possible.

Can you instead do (for example):

  foreach j, i in inputfiles {
     x[i] = f(j);
  }

?

- Mike

----- Original Message -----
> From: "Heather Stoller" <heather.stoller at gmail.com>
> To: swift-user at ci.uchicago.edu
> Sent: Wednesday, May 2, 2012 12:47:53 PM
> Subject: [Swift-user] example of @length
> Hello,
> 
> Does anyone have an example of how to use @length?
> 
> I have tried a few things, most recently
> @length(inputfiles)
> without success.
> 
> Cheers!
> Heather
> 
> 
> complete script below.
> 
> type file;
> 
> file inputfiles1[] <ext;exec="mapper.py",filename=@arg("in1")>;
> file inputfiles2[] <ext;exec="mapper.py",filename=@arg("in2")>;
> 
> app (file o) cat (file i1, file i2)
> {
> cat @i1 @i2 stdout=@o;
> }
> 
> foreach j in [0:@length(inputfiles1)] {
> file c<concurrent_mapper;
> prefix="map.",
> suffix=".out">;
> c = cat(inputfiles1[j], inputfiles2[j]);
> }
> 
> 
> _______________________________________________
> Swift-user mailing list
> Swift-user at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-user

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




More information about the Swift-user mailing list