Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xronos fails to compile procedure containing sequence of if statements #2

Open
robstewart57 opened this issue Feb 28, 2015 · 2 comments

Comments

@robstewart57
Copy link

The following actor contains a procedure that implements a lookup table with a sequence of if statements:
https://gist.github.com/robstewart57/436cb0fb0dfd880a4c01

The complete project is here:
http://www.macs.hw.ac.uk/~rs46/files/xronos-example.zip

The compiler fails with either a heap exception or GC exception. This is the stack trace:

java.util.HashMap.keySet(HashMap.java:997), java.util.HashSet.iterator(HashSet.java:170),
java.util.AbstractCollection.retainAll(AbstractCollection.java:403),
org.xronos.openforge.schedule.GlobalResourceSequencer.addDependencies(GlobalResourceSequencer.java:544),
org.xronos.openforge.schedule.GlobalResourceSequencer.visit(GlobalResourceSequencer.java:288),
org.xronos.openforge.lim.Branch.accept(Branch.java:87),
org.xronos.openforge.schedule.GlobalResourceSequencer.processModule(GlobalResourceSequencer.java:247),
org.xronos.openforge.schedule.GlobalResourceSequencer.visit(GlobalResourceSequencer.java:184),
org.xronos.openforge.lim.Block.accept(Block.java:94),
org.xronos.openforge.schedule.GlobalResourceSequencer.visit(GlobalResourceSequencer.java:277),
org.xronos.openforge.lim.Branch.accept(Branch.java:87),
org.xronos.openforge.schedule.GlobalResourceSequencer.processModule(GlobalResourceSequencer.java:247),
org.xronos.openforge.schedule.GlobalResourceSequencer.visit(GlobalResourceSequencer.java:184),
org.xronos.openforge.lim.Block.accept(Block.java:94),
org.xronos.openforge.schedule.GlobalResourceSequencer.visit(GlobalResourceSequencer.java:277),
org.xronos.openforge.lim.Branch.accept(Branch.java:87),
org.xronos.openforge.schedule.GlobalResourceSequencer.processModule(GlobalResourceSequencer.java:247),
org.xronos.openforge.schedule.GlobalResourceSequencer.visit(GlobalResourceSequencer.java:184),
org.xronos.openforge.lim.Block.accept(Block.java:94)
org.xronos.openforge.schedule.GlobalResourceSequencer.visit(GlobalResourceSequencer.java:281),
org.xronos.openforge.lim.Branch.accept(Branch.java:87),
org.xronos.openforge.schedule.GlobalResourceSequencer.processModule(GlobalResourceSequencer.java:247),
org.xronos.openforge.schedule.GlobalResourceSequencer.visit(GlobalResourceSequencer.java:184),
org.xronos.openforge.lim.Block.accept(Block.java:94),
org.xronos.openforge.schedule.GlobalResourceSequencer.visit(GlobalResourceSequencer.java:277),
org.xronos.openforge.lim.Branch.accept(Branch.java:87),
org.xronos.openforge.schedule.GlobalResourceSequencer.processModule(GlobalResourceSequencer.java:247),
org.xronos.openforge.schedule.GlobalResourceSequencer.visit(GlobalResourceSequencer.java:184),
org.xronos.openforge.lim.Block.accept(Block.java:94),
org.xronos.openforge.schedule.GlobalResourceSequencer.visit(GlobalResourceSequencer.java:277),
org.xronos.openforge.lim.Branch.accept(Branch.java:87),
org.xronos.openforge.schedule.GlobalResourceSequencer.processModule(GlobalResourceSequencer.java:247)
@robstewart57
Copy link
Author

I should add, the exceptions are thrown when running eclipse with a 512Mb heap. When running with a 1024Mb heap, compilation runs forever (I waited for 30 minutes) and in that time did not throw an error.

@endrix
Copy link
Member

endrix commented Feb 28, 2015

I tested too, Forge does not like so much nested ifs, i would suggest you to implemented as an array, it will be faster and less logic, I think that the problem come from the scheduling of the operators in LIM. I would investigate that after my thesis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants