Extract array of DSI arrays from an instance of a dmapped array?

I am doing performance testing in a custom distribution hierarchy, and I need to access an array class that supports the associated array. I can access the support domain through array.domain , but there seems to be nothing for the array of the underlying array.

For example, how can I extract BlockArr / LocBlockArr from a distributed array A of a block in the following code:

 const Space = {1..8, 1..8}; const D: domain(2) dmapped Block(boundingBox=Space) = Space; var A: [D] int; var A_BlockArr_obj : BockArr = A.??? 
+5
source share
1 answer

Suppose you wanted to access some method or field from a base array class. In Chapel 1.16 you can write:

 var A_obj = A._value; A_obj.foo(); writeln(A_obj.myField); 

The _value method returns the base array class (or a privatized copy if you enabled privatization). The same method can be called for domains and distributions. Please note that this is intentionally undocumented and may change in future releases.

In Chapel 1.17 (to be released in April 2018), method calls and field calls on arrays, domains, and distributions are now passed back to the support class, so you could write:

 A.foo(); writeln(A.myField); 

These method calls and field calls will be called on the privatized instance of the class, if possible.

+5
source

Source: https://habr.com/ru/post/1274737/


All Articles