[Swift-user] would rm be a valid app?

Michael Wilde wilde at mcs.anl.gov
Thu Jan 17 12:34:18 CST 2013


Philosophically, its better not to use rm explicitly in a swift script, as this issue should ideally be transparent to the application-level logic of the script.

If instead of mapping the file, you let Swift determine the file name (i.e by implicitly using the "concurrent" mapper) then by default Swift will remove intermediate files as soon as they are no longer needed within the scripts' execution.

A technical problem with using rm explicitly is that in the default data management mode, the app is operating on a *copy* of the input data. rm will only have the desired effect if the file being rm'ed is under CDM "DIRECT" mode, then the actual mapped file will be deleted. If thats done, then the script writer is responsible for being sure that the file wont be needed again later in the workflow.

- Mike


----- Original Message -----
> From: "Neil Best" <nbest at ci.uchicago.edu>
> To: swift-user at ci.uchicago.edu
> Sent: Thursday, January 17, 2013 11:04:21 AM
> Subject: [Swift-user] would rm be a valid app?
> I wanted to use Swift to clean up files that are no longer needed. It
> seemed natural to define rm as an app then script this:
> 
> type file;
> 
> string oldGrbFiles[] = readData( "data/oldGrbFiles.txt");
> 
> file grb[]<array_mapper; files=oldGrbFiles>;
> 
> app rm (file f) {
> rm @f;
> }
> 
> foreach g in grb {
> rm( g);
> }
> 
> 
> Swift runs happily and tasks complete but the number of files in the
> subfolder that I am trying to clean out does not change. I suspect
> that what is being rm-ed are the Swift-ified copies of the mapped
> input files. I simply want a distributed "make clean". Is this
> feasible?
> _______________________________________________
> 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