[Swift-devel] [Swift-commit] r5316 - in branches/release-0.93/src/org/griphyn/vdl: karajan/lib mapping

Mihael Hategan hategan at mcs.anl.gov
Sat Nov 26 01:30:34 CST 2011


On Fri, 2011-11-25 at 20:43 -0600, Michael Wilde wrote:
> What seems to be happening here is that when a mapped file variable is
> assigned to a variable, the mapping is not assigned with it.
> 
> I need to check, but I think that in older revisions (eg 0.92.1 ?) the
> mapping *was* assigned along with the value (i.e. the state) of the
> file variable.
> 
> Whats happening in this case is that when the array [out,out2] is
> created, the file-typed members of the constructed array have only
> default mappings (ie _concurrent/etc) - they have lost their original
> mappings assigned by the single_file_mapper <"filename">.

I think that the problem is in the way the array constructor works. It
is compiled to vdl:createArray() and that function doesn't properly deal
with mapping since it was meant to be used with primitive arrays.

The theoretically equivalent code:
file f[];
f[0] = out; f[1] = out2;

should work properly.

In terms of the mapping it will follow the standard swift mapped data
assignment, which is as follows:
1. if lhs is remappable (e.g. concurrent mapper), set the lhs mapping to
that of the rsh
2. if rhs is not remappable but lhs is, set the rhs mapping to that of
lhs
2. if rhs nor lhs are remappable, do a copy.

What r5316 fixes is code of the form @filename([1, 2, 3]) (i.e. argument
is something that has no mapping), which is what I thought the problem
was.





More information about the Swift-devel mailing list