16366, “ronawho”, “Task private variables create more vars than tasks”, “2020-09-10T16:53:10Z”
I couldn’t figure out how to word this well in the title, but when using task private vars I see variables being created for things other than each task. For a simple case of iterating over a range, I see an extra variable being created.
var a: atomic int;
record R {
proc init() { a.add(1); }
}
forall i in 1..here.maxTaskPar with (var r = new R()) { }
writeln(here.maxTaskPar);
writeln(a); // expecting maxTaskPar but is maxTaskPar+1
For the actual code I was using when I ran into this I see 2 extra variables being created, and I’m creating aggregators that allocate local and remote memory, which is expensive.