You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module nestedForallThrows {
configconst flag =true;
procmain() throws {
forall i inzip(1..10, 1..10) {
var x = foo();
forall j in1..10 {
writeln(i,j);
}
}
}
procfoo() throws {
if flag {
thrownew Error();
}
return0;
}
}
Results in internal error: did not find the insertion point [resolution/lowerIterators.cpp:2154]. This issue is there on main and also on Chapel 2.3.
Looking deeper, I see that we place iterator break blocks based on _freeIterator calls. I see in the AST that we don't even have a _freeIterator for the follower of the outer forall. That's why we can't find a place to insert the iterator break block.
Some more notes:
change either loop to for and it works
make the outer loop non-zip and it works
it doesn't matter if the inner loop is zippered or not.
The text was updated successfully, but these errors were encountered:
This PR is to assist #4176.
That PR makes `toSymEntry` a throwing function. Unfortunately, in the
histogram code, there are some nested foralls which are subject to [an
existing bug in the Chapel
compiler](chapel-lang/chapel#26912) that gets
exposed by making `toSymEntry` a throwing function. This PR adjusts the
histogram code to avoid that bug.
In general, the change here shouldn't be seen as a workaround, although
the implementation could still be less than ideal. When you have nested
`forall`s, in almost all cases, the outer one will grab all the cores in
the system, forcing the inner one to be sequential one. Where this PR
makes changes, it feels way more important for the inner loop to execute
in parallel compared to the outer one. Therefore, I expect the change
here to be an improvement for performance as well.
Signed-off-by: Engin Kayraklioglu <e-kayrakli@users.noreply.github.com>
Results in
internal error: did not find the insertion point [resolution/lowerIterators.cpp:2154]
. This issue is there onmain
and also on Chapel 2.3.Looking deeper, I see that we place iterator break blocks based on
_freeIterator
calls. I see in the AST that we don't even have a_freeIterator
for the follower of the outerforall
. That's why we can't find a place to insert the iterator break block.Some more notes:
for
and it worksThe text was updated successfully, but these errors were encountered: