[Bug 1287] New: simple mapper throws error if mapped variable not used
https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=1287 Summary: simple mapper throws error if mapped variable not used Product: Swift Version: trunk Platform: All OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: General AssignedTo: [email protected] ReportedBy: [email protected] For instance, If there is a simple mapper declaration as: file result[] <simple_mapper; location="outdir", prefix="res", suffix=".dat">; and the variable is unused in the subsequent calls to apps, the error is: Execution failed: java.lang.IllegalArgumentException: Directory not found: outdir Variable declaration @ model_lmp, line: 14 Caused by: java.lang.IllegalArgumentException: Directory not found: outdir at org.griphyn.vdl.mapping.file.AbstractFileMapper.existing(AbstractFileMapper.java:232) at org.griphyn.vdl.mapping.file.AbstractFileMapper.existing(AbstractFileMapper.java:214) at org.griphyn.vdl.mapping.nodes.InitMapper.checkInputs(InitMapper.java:179) at org.griphyn.vdl.mapping.nodes.InitMapper.initialize(InitMapper.java:125) at org.griphyn.vdl.mapping.nodes.RootFutureArrayDataNode.init(RootFutureArrayDataNode.java:56) at org.griphyn.vdl.karajan.lib.New.initHandle(New.java:232) at org.griphyn.vdl.karajan.lib.New.function(New.java:180) at org.griphyn.vdl.karajan.lib.SwiftFunction.runBody(SwiftFunction.java:110) at org.globus.cog.karajan.compiled.nodes.InternalFunction.run(InternalFunction.java:157) at org.globus.cog.karajan.compiled.nodes.CompoundNode.runChild(CompoundNode.java:91) at org.globus.cog.karajan.compiled.nodes.SetVarK.run(SetVarK.java:51) at org.globus.cog.karajan.compiled.nodes.CompoundNode.runChild(CompoundNode.java:91) at org.globus.cog.karajan.compiled.nodes.FramedInternalFunction.run(FramedInternalFunction.java:63) at k.thr.LWThread.run(LWThread.java:228) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) I think this should be a warning. -- Configure bugmail: https://bugzilla.mcs.anl.gov/swift/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=1287 Michael Wilde <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |[email protected] --- Comment #1 from Michael Wilde <[email protected]> 2014-06-11 14:14:07 --- This is not a bug, per se. If a variable is not assigned to, Swift assumes that its an input variable, and hence expects the mapped object to exist (ie the mapper is invoked to read the mapped dir and find any existing files). Perhaps if the variable is neither set nor read, Swift should print a warning to that effect instead. Mihael, is there enough info at compile time to detect this "third" case? Either way, we should document this in the user guide (ie how Swift determines input vars vs output vars). -- Configure bugmail: https://bugzilla.mcs.anl.gov/swift/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=1287 --- Comment #2 from Mihael Hategan <[email protected]> 2014-06-11 14:26:53 --- (In reply to comment #1)
This is not a bug, per se.
I had the same feeling at first, but I think that, while not a major issue, this should result in an unused variable warning at most.
If a variable is not assigned to, Swift assumes that its an input variable, and hence expects the mapped object to exist (ie the mapper is invoked to read the mapped dir and find any existing files).
Perhaps if the variable is neither set nor read, Swift should print a warning to that effect instead.
Mihael, is there enough info at compile time to detect this "third" case?
There should be. The compiler keeps track of variables read from (to mark them as input) and also of writes (to close when writes are done), so yes.
Either way, we should document this in the user guide (ie how Swift determines input vars vs output vars).
It's pretty simple: a variable is an input if it's never assigned to. -- Configure bugmail: https://bugzilla.mcs.anl.gov/swift/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=1287 Mihael Hategan <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #3 from Mihael Hategan <[email protected]> 2014-08-16 18:24:47 --- trunk git-rev: 5f9fc11906e11a95e3670c562580c1dd9481f3dc heads/master 5970 adds unused variable detection. A warning is printed about unused variables and they are removed from the kml file, so such errors do not occur. -- Configure bugmail: https://bugzilla.mcs.anl.gov/swift/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
bugzilla-daemon@mcs.anl.gov