[Swift-devel] returning primitive values from apps

Glen Hocky hockyg at uchicago.edu
Tue Sep 17 12:03:38 CDT 2013


Currently, schematically I would do something like this as

------------------

struct outdata {
    logfile l;
    returnfile r;
}

(outdata o) app ( a , b ,c ... ){
    run "-logfile" @filename(o.l) "-returnfile" @filename(o.r)
}

o = app(a,b,c)

int r = readData(o.r)

--------------

It wouldn't be as general as the options just suggested, but would one
option be to have a meta-datatype like "intfile" "stringfile" "floatfile"
and "booleanfile"
that automatically performs a readdata to extract a single value from a
file and store it in a variable of that standard type?



On Tue, Sep 17, 2013 at 12:43 PM, Mihael Hategan <hategan at mcs.anl.gov>wrote:

> On Tue, 2013-09-17 at 11:26 -0500, Yadu Nand wrote:
> > Hi Mihael,
> >
> > If say the app has the following syntax :
> >            app (int ret_value) do_math (int x, int y) {
> >                  add x y stdout=ret_value;
> >            }
> >
> >  Would this (hypothetical) syntax entirely avoid the overhead of writing
> > several small files as
> > we see in larger runs ?
>
> Maybe. If you can re-direct stdout straight to memory (only some
> providers support this), then you could read the value without writing
> files on the client side.
>
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-devel/attachments/20130917/9609fcaa/attachment.html>


More information about the Swift-devel mailing list