[Swift-devel] Re: fixed_array_mapper versus array_mapper on output
Mihael Hategan
hategan at mcs.anl.gov
Mon Feb 14 12:44:09 CST 2011
I made the array_mapper static in swift trunk r4089.
It seems that the code in there assumes that the files= argument is a
closed array anyway. I am not entirely convinced this would work ok, but
please give it a try.
Another solution might be to add a @join function and then use the fixed
array mapper.
Mihael
On Mon, 2011-02-14 at 02:11 -0600, Allan Espinosa wrote:
> Making my question more concrete, how you suggest going about my workflow:
>
> string seis_str[];
> string peak_str[];
>
> foreach var,i in vars {
> seis_str[i] = @strcat(loc_sub, "/Seismogram_", site.name, "_", rup.source,
> "_", rup.index, "_", i, ".grm");
> peak_str[i] = @strcat(loc_sub, "/PeakVals_", site.name, "_", rup.source,
> "_", rup.index, "_", i, ".bsa");
> }
>
> Seismogram seis[] <array_mapper; files=seis_str>;
> PeakValue peak[] <array_mapper; files=peak_str>;
>
> (seis, peak) = seispeak_agg(sub, vars, site, rup.size);
>
>
> Should I hack around to force this into a fixed_array_mapper?
>
> -Allan
>
> 2011/2/12 Allan Espinosa <aespinosa at cs.uchicago.edu>:
> > Moving thread to devel for brainstorming possible solutions:
> >
> > 1. implement a join() function: @join(array, ", ");
> > 2. fix array_mapper
> >
> > 2011/2/12 Allan Espinosa <aespinosa at cs.uchicago.edu>:
> >> For an array output data structure, the two mappers behave differently
> >>
> >> type file;
> >>
> >> app(file o[])
> >> split(file i){
> >> split "-l" 1 @filename(i) "seqout.";
> >> }
> >>
> >> /*file out[] <array_mapper; files=["seqout.aa", "seqout.ab",
> >> "seqout.ac", // Does not work
> >> "seqout.ad"]>;*/
> >> file out[] <fixed_array_mapper; files="seqout.aa, seqout.ab,
> >> seqout.ac, seqout.ad">; // Works
> >>
> >> file input <"seq.in">;
> >> out = split(input);
>
>
More information about the Swift-devel
mailing list