[Swift-devel] Multiple output files

Jonathan Ozik jozik at uchicago.edu
Thu Mar 20 21:51:41 CDT 2014


Hi Mike,

I've included my comments below. Also, please let me know if I should sign up for any mailing list in addition to swift-user, which I'm already signed up on.

Thank you,

Jonathan

On Mar 20, 2014, at 8:53 PM, Michael Wilde <wilde at anl.gov> wrote:

> Hi Jonathan,
> 
> On 3/20/14, 6:04 PM, Jonathan Ozik wrote:
>> Mike,
>> 
>> Thank you for the detailed information.
>> Regarding the "collect files of this pattern into an array" semantics, is the "file system mapper" not intended for this?
> No, its not. Mihael and others may need to correct me here, but basically the issue is this:
> 
> An app *can* return multiple files - even an array of files - but not an array of files whose names and count is not known before the app is launched.
This functionality would be exactly what I'd be looking for. If an app can return multiple files I'd just need to know where and how I'd have to specify the patterns for those files (or do I need to know the exact names?) and how to make it so that the app returns those files. I've looked through the user guide and a few of the tutorials but I don't believe I've seen any example that fits this general functionality.

For example, if I have an executable "repast" that outputs files with patterns specified by globs, how do I make use of that knowledge to pick up those files and return them from an app?

> 
> The User Guide does not yet cover this adequately, but output mappings may be static or dynamic. Static means the names and quantify of files is determined when the mapping is made. Dynamic means the mapping is made on demand, as files are created. Such mappings for example can be used to map the elements of the array when they are filled within a foreach loop by an app that returns one file per invocation.
I see, the one file per app invocation is probably not going to work for our use case, but I still think that I'm missing some crucial understandings of what conditions are required to point to and use generated or existing files within swift. That is, other than "stdout=@filename", how do I indicate that I'd like to return a file, say "myoutput.dat", from an app invocation? Apologies if this is too simple of a question but, like I said, I feel like I'm missing some crucial information... 

> 
> What we do not have - but have long known that we need - is the ability to declare that all the files created by a *single* app invocation which match a specified pattern be returned as an array.
> 
> Mihael: is this something you could implement in the near future - after we agree on the semantics?
> 
> Justin, Tim, do you want to comment on this from a Swift/T perspective?
> 
> Thanks,
> 
> - Mike
>> I think I'm stumbling on the notion of what output, in terms of files, can be produced using an "app" element in a swift script. Most of the examples have stdout (or stderr) pointing to a file, but I'm not sure I've found an example where side effects (e.g., files produced by a process) can be retrieved. Is this possible?
>> 
>> Jonathan
>> 
>> On Mar 19, 2014, at 7:03 PM, Michael Wilde <wilde at anl.gov> wrote:
>> 
>>> Hi Jonathan,
>>> 
>>> You are thinking about this exactly right, and have (quickly) hit one of our programmability weaknesses.
>>> 
>>> At the moment, there is no good way to do this. We have had much discussion on it, though, and plan to create such "collect files of this pattern into an array" semantics.
>>> 
>>> What we do for now is one of these two work-arounds:
>>> 
>>> - write a single tarfile as output (in a wrapper script for the app, which tars files of the appropriate pattern, like "*.simout"
>>> 
>>> - write the files directly to a specific (shared) directory instead of the Swift "app task directory" (called "job directory" in the current User Guide.  Then return a single file with a list of these file names, and map that using an array_mapper if the results need to be passed to a next stage
>>> 
>>> We should see if we can get a prototype of such a feature to you in short order. But hopefully just to get things working, one of the above methods will suffice for you, for now.
>>> 
>>> Im cc'ing swift-devel to see what we can do.
>>> 
>>> Thanks for reminding us of this fairly common need!
>>> 
>>> - Mike
>>> 
>>> On 3/19/14, 5:57 PM, Jonathan Ozik wrote:
>>>> Mike,
>>>> 
>>>> Perhaps I'm not thinking about this correctly, but I'm trying to figure out how to collect output files that are generated by a simulation run. The scenario is that the Repast executable is run and, after it is run, there are files that are output into some location. There can be an arbitrary number of such output files per simulation run but, if necessary, it would be possible to pre-specify which files to look for. Is there a simple way to indicate to swift that it should collect all the files matching a particular pattern within a directory? It looks like the mappers might work here but as far as I understand the mappers are defined prior to calls to executables. Again, I might just not be thinking about this in a "swift" enough way.
>>>> 
>>>> Jonathan
>>>> 
>>> -- 
>>> Michael Wilde
>>> Mathematics and Computer Science          Computation Institute
>>> Argonne National Laboratory               The University of Chicago
>>> 
> 
> -- 
> Michael Wilde
> Mathematics and Computer Science          Computation Institute
> Argonne National Laboratory               The University of Chicago
> 




More information about the Swift-devel mailing list