(chpl version 1.16.0.e43acc7)
I'm starting to learn the DSI interface and have run into a confusing issue when constructing a Domain class from the dsiNewRectangularDom function in the Distribution class:
class MyDist : BaseDist {
proc MyDist( fold_dimensions ...?dims ){ }
proc dsiNewRectangularDom(param rank: int, type idxType, param stridable: bool, inds) {
var dom = new MyDom( rank=rank, idxType=idxType, stridable=stridable, dist=this);
return dom;
}
}
class MyDom : BaseRectangularDom { }
class MyArr : BaseArr { }
config const n = 4;
config const m = 8;
const base_domain = {1..#n,1..#m};
const mapped_domain = base_domain dmapped MyDist( 1 );
(This is very basic code, and I don't expect it to fully compile, but I'm stuck on this part.)
This produces the compile error:
file.chpl:5: In function 'dsiNewRectangularDom':
file.chpl:6: error: unresolved call 'MyDom.init(rank=2, idxType=type int(64), stridable=0, dist=MyDist)'
file.chpl:11: note: candidates are: MyDom.init(_arrs, _arrs_containing_dom: int(64), _arrsLock: atomicbool, _free_when_no_arrs: bool, pid: int(64), param rank: int(64), type idxType, param stridable: bool)
(see this TIO instance)
I'm a bit confused about where this init function comes from. I'm following the behavior of Block, BlockDist, and BlockDom (in particular BlockDist.chpl:533 where Block.dsiNewRectangularDom calls BlockDom's constructor. Since MyDom inherits from BaseRectangularDom, I (1) don't need to declare the rank, idxType, etc member variables, and (2) don't need to define the MyDom( rank, idxType, ... ) constructor. I also don't see a BlockDom.init function that I could learn from.
What am I missing?