[Swift-devel] Re: passing types and variables in swift

Mihael Hategan hategan at mcs.anl.gov
Thu Oct 4 23:04:04 CDT 2007


On Thu, 2007-10-04 at 22:39 -0500, Michael Wilde wrote:
> thanks for the info, Yong.
> 
> while we're discussing mappers, could you or Ben clarify:
> 
> - can a mapper be only used on a single variable declaration? ie you can 
> not map a dataset to a variable within a struct?  this would be useful 
> eg to create a struct that has both file and scalar valued members, to 
> set up a parameter sweep where each file needs specific parameters.
> 
> - are mappers processed before the program (or procedure) starts 
> executing? 

There is no concept of mappers being processed. I don't think there's
much value in the discussion if we don't go over that one.

Mappers are objects. Instances of a certain class of objects. One of
their methods is map(swift_variable) which returns a file name. The
other is existing() which returns a list of available things (e.g. all
available indices in an array).

We need to add get/setValue to that, and the respective implementations.
We also need to add relevant code which, before invoking an application,
can get a value from a variable using the above getValue and write it to
a file.

> so you cant use a mapper like an assignment statement to set 
> or reset a variable?
> 
> - mike
> 
> On 10/4/07 10:21 PM, Yong Zhao wrote:
> > Mappers should ideally be able to map primitive types such as string and
> > int, as well as file names. The CSVMapper can read all the values in the
> > file, it is just that it needs to interprete the values according to their
> > types. So If we convey the type info 'RGIparams' to the csv mapper, it
> > should have no problem reading the values.
> > 
> > I actually added getType and setType to the mapper interface, that did
> > not get into the release, but I think it is what it should have.
> > 
> > Yong.
> > 
> > On Thu, 4 Oct 2007 andrewj at uchicago.edu wrote:
> > 
> >> All right, thanks.
> >>
> >> I am just trying to figure out the best way to setup parameter
> >> sweeps.  Ideally, I would like to have some file of directory
> >> of files containing experiments to be run on the Grid
> >> environment and Swift picks them up and automatically sets up
> >> the appropriate WF based on the parameter information in the
> >> files.
> >>
> >>
> >>> On Wed, 3 Oct 2007, andrewj at uchicago.edu wrote:
> >>>
> >>>> could I do something like this:
> >>>>
> >>>> RGIparams RGIinput[] <csv_mapper;file="rgi_runs.txt">;
> >>>>
> >>>> where rgi_runs would contain say
> >>>>
> >>>> 1,2,true
> >>>> 3,4,false
> >>>> 18,20,true
> >>>>
> >>>> and so on..so that the parameters are passed into the workflow?
> >>> no.
> >>>
> >>> mappers only map filenames (or URIs now); they don't map
> >> variable values.
> >>> --
> >> _______________________________________________
> >> Swift-devel mailing list
> >> Swift-devel at ci.uchicago.edu
> >> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
> >>
> > _______________________________________________
> > Swift-devel mailing list
> > Swift-devel at ci.uchicago.edu
> > http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
> > 
> > 
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
> 




More information about the Swift-devel mailing list