[Swift-devel] duplicate mappings detector

Mihael Hategan hategan at mcs.anl.gov
Sun Nov 18 05:04:57 CST 2012


I added a duplicate mapping detector to trunk. It was motivated by a
not-so-simple script a user sent. It works at run-time, but it provides
a more clear message than "file not found" or "the cache already
contains...":

Duplicate mapping found:
	h5part_files (line 272) is used to read from
file://localhost/run-0/sph-0/sph.output.h5part
	sphOut (line 234) is used to write to
file://localhost/run-0/sph-0/sph.output.h5part

It only produces a warning on stderr, since there might be cases when
duplicating mappings may work (it's still incorrect, but if the current
implementation allows it, we should at least talk before making it an
error), such as with iterate and files mapped across iterations.

Reads through multiple variables from the same file are allowed (since
they don't produce nondeterminism). Reads and writes are not allowed
together. Nor are multiple writes. These are determined based on the
input parameter to the mapper. This may not detect all problems since,
for non-input variables, it only makes the check if a static mapper is
specified, but it's a start.

It might not work quite right, so let me know if you find cases when you
get a warning but you shouldn't.




More information about the Swift-devel mailing list