继续:"How do dmapped domains in chapel language get actually mapped onto?"
Continuation on: "How do dmapped domains in chapel language get actually mapped onto?"
克雷,很抱歉为了回答的清晰再次站起来!在此 answer 之后,我又收到了一些关于域映射的问题。如果您能消除我对域映射的疑虑,我将不胜感激。
我希望,我已经按顺序排列了问题。
1.) 什么是域映射? - 域映射定义了从域和数组的全局数组索引到集群中的一组区域设置的映射。
我已经总结了我从研究论文和其他ppt中了解到的内容,可能有错误。请随时更正答案。
const Domain = {1..8,1..8} dmapped Block( {1..8,1..8} )
此处 {1..8,1..8}
是索引space(域),使用 Block
-分布域映射分布到语言环境boundingBox = {1..8,1..8}
来自 Block
域映射构造函数,
proc block( boundingBox: domain,
targetlocales:[] locale = Locales,
datapartasks = ...,
dataparmingranularity = ...
)
Block
domain-map 只想知道 boundingBoX
, targetlocales
和 datapar*
'-s 并且不需要 domain
,这里是 {1..8,1..8}
。由于在 chapel 内部创建域映射的许多接口,其中一些接口对用户隐藏了一些信息,我发现很难把事情弄对。
所以我的问题是:Block
domain-map 是否在 targetlocales
上创建了实例,其中包含 [=25] 等本地索引集=] on locale 1
, {1..2,1..2}
on locale 2
(这些数字只是示例,因此来说明映射过程 ) ?
在之前的回答中,Brad Chamberlain 博士提到
"dmapped Block clause() creates instances on the target locales. Each instance of the Block domain map class stores the boundingbox and set of target locales"
我没有从中找到意义:(
总的来说,请解释域映射、域和数组是如何协同工作的。我研究了一些步骤,但都遗漏了一些我需要完全理解域映射的信息。
In this presentation 在幻灯片 No:34 中,本地实例域映射和域仅存储索引 space,没有什么特别的。
- 在之前的回答中,Brad Chamberlain博士也提到
" a given domain map implementation may be very space efficient and minimal, or it can allocate everything on every locale redundantly, as its author thinks best",
在这种情况下,"allocate everything on every locale redundantly" 究竟是什么意思?是否将整个数组存储在每个位置?
- 在 PGAS 中,域映射、域、数组的全局实例在所有语言环境中都是可见的?。我也希望对它们的每个查询都通过全局实例进行。
我恳请您确定域映射所需的接口,正如您在文档中提到的那样。
如果我对此有一些解释,我将不胜感激。
非常感谢你。
1.) What are domain maps ?
域映射是一个礼拜堂 class,其目的是描述如何实现域以及在这些域上声明的任何数组。实际上,他们指定:
- 如何实现根据域映射声明的域,包括如何将它们存储在内存中以及如何实现编译器可能需要的方法(如迭代、成员测试等)
- 如何实现根据该域声明的数组,包括如何将它们存储在内存中以及如何实现编译器可能需要的方法(如迭代、随机访问等)
The block domain map only wants to know about the boundingBox, targetlocales, and datapar's, and there is no need for domain, here in this case {1..8,1..8}.
这是正确的,在学习 Block
分布时,这常常是一个混淆点。让我们用一个稍微人为的例子来说明这一点:
const D = {1..4, 1..4} dmapped Block({1..8, 1..8});
此声明表示,二维索引的平面应通过尽可能均匀地阻塞语言环境之间的边界框 {1..8, 1..8}
来分布到语言环境。如果我在 4 个区域设置中 运行,区域设置 0 将拥有边界框的 {1..4, 1..4}
,这意味着它将在 2D 平面中拥有 {-inf..4, -inf..4}
(其中,inf
表示意思是 "infinity" 实际上,-inf
将由一个小整数表示)。同样,区域设置 3 将拥有边界框的 {5..8, 5..8}
或二维平面的 {5..inf, 5..inf}
。
如您所见,上面的 {1..8, 1..8}
只是 Block
域映射的一个参数,因此与 D
的值无关,仅与它的实现有关。因为 D
的值为 {1..4, 1..4}
,它完全属于区域设置 0,因为它完全适合该区域设置的 2D 平面部分。如果它是 {2..5, 2..5}
,区域设置 0 将拥有 {2..4, 2..4}
,区域设置 1 将拥有 {2..4, 5..5}
,区域设置 2 将拥有 {5..5, 2..4}
,区域设置 3 将拥有 {5..5, 5..5}
。
因为 Block 分布由这个边界框域参数化,这常常导致混淆为什么在像上面那样的声明中使用两个域,特别是因为它们在实践中通常是相同的。这与域映射本身无关,而是与 Block 域映射的构造函数期望域作为其参数之一这一事实有关。相比之下,Cyclic
和 BlockCyclic
域映射不接受域参数,因此通常更容易理解。
Did the Block domain map creates instances on targetlocales which holds the local index sets...
是的,在实践中,Block
域映射创建了一个 LocBlock
class 的实例,它存储了每个语言环境的本地索引集——例如,{-inf..4, inf..4}
on locale 0,{-inf..4, 5..inf}
在语言环境 1 上,等等。对于我之前的示例。
Each instance of the Block domain map class stores the boundingbox and set of target locales
是的,每个语言环境还存储了 Block
域映射 class 的副本,它存储了参数化域映射的所有关键参数,以便可以通过以下方式推断它定义的分布每个语言环境都是孤立的。
In this presentation in slide no : 34,the local instance domain maps and domains store only the index space,nothing special.
没错,本地块域映射 class 的作用是存储该区域设置(幻灯片中的区域设置 #4 或 L4)拥有的二维平面部分。同样,本地 Block 域 class 的作用是存储该区域设置所拥有的域索引集部分。这些并不特殊,但它们分别对于定义分布和分布式域很重要。
2.In the previous answer,Dr.Brad has also mention that " a given domain map implementation may be very space efficient and minimal, or it can allocate everything on every locale redundantly, as its author thinks best", in this context what "allocate everything on every locale redundantly" actually means ? whether storing the whole array on each locality ?
是的,"allocate everything on every locale redundantly" 我的意思是每个语言环境都存储整个数组。这可能不是特别可扩展,但关键是语言和域映射框架只要支持预期的接口,就不会说明数组的存储方式。因此,域图的作者可以选择这样做。
- In PGAS, the Global instance of domain map,domain,array is visible across all locales ?. And I also hope that each query to them takes place through the global instances.
您是正确的,由于 Chapel 的 PGAS(分区全球地址 Space)模型,classes 的全局实例在所有语言环境中都是可见的。也就是说,由于域之间的通信非常昂贵,而且这些对象往往很少更改它们的字段,因此在实践中我们倾向于跨区域复制它们。在幻灯片 34 中,您提到的标签“(逻辑上)”是指:每个对象都有一个概念副本,但实际上我们倾向于跨区域复制它们(域地图的作者可能或可能不会像他们希望的那样这样做)。
I kindly request you to determine the required interfaces for domain map as you mention in the documentation.
域映射接口的当前文档可用 here. The current sources for the Block
domain map which implement the 6 descriptors ({global, local} x {domain map, domain, array}) can be found here。
克雷,很抱歉为了回答的清晰再次站起来!在此 answer 之后,我又收到了一些关于域映射的问题。如果您能消除我对域映射的疑虑,我将不胜感激。
我希望,我已经按顺序排列了问题。
1.) 什么是域映射? - 域映射定义了从域和数组的全局数组索引到集群中的一组区域设置的映射。
我已经总结了我从研究论文和其他ppt中了解到的内容,可能有错误。请随时更正答案。
const Domain = {1..8,1..8} dmapped Block( {1..8,1..8} )
此处 {1..8,1..8}
是索引space(域),使用 Block
-分布域映射分布到语言环境boundingBox = {1..8,1..8}
来自 Block
域映射构造函数,
proc block( boundingBox: domain,
targetlocales:[] locale = Locales,
datapartasks = ...,
dataparmingranularity = ...
)
Block
domain-map 只想知道 boundingBoX
, targetlocales
和 datapar*
'-s 并且不需要 domain
,这里是 {1..8,1..8}
。由于在 chapel 内部创建域映射的许多接口,其中一些接口对用户隐藏了一些信息,我发现很难把事情弄对。
所以我的问题是:Block
domain-map 是否在 targetlocales
上创建了实例,其中包含 [=25] 等本地索引集=] on locale 1
, {1..2,1..2}
on locale 2
(这些数字只是示例,因此来说明映射过程 ) ?
在之前的回答中,Brad Chamberlain 博士提到
"dmapped Block clause() creates instances on the target locales. Each instance of the Block domain map class stores the boundingbox and set of target locales"
我没有从中找到意义:(
总的来说,请解释域映射、域和数组是如何协同工作的。我研究了一些步骤,但都遗漏了一些我需要完全理解域映射的信息。
In this presentation 在幻灯片 No:34 中,本地实例域映射和域仅存储索引 space,没有什么特别的。
- 在之前的回答中,Brad Chamberlain博士也提到
" a given domain map implementation may be very space efficient and minimal, or it can allocate everything on every locale redundantly, as its author thinks best",
在这种情况下,"allocate everything on every locale redundantly" 究竟是什么意思?是否将整个数组存储在每个位置?
- 在 PGAS 中,域映射、域、数组的全局实例在所有语言环境中都是可见的?。我也希望对它们的每个查询都通过全局实例进行。
我恳请您确定域映射所需的接口,正如您在文档中提到的那样。
如果我对此有一些解释,我将不胜感激。
非常感谢你。
1.) What are domain maps ?
域映射是一个礼拜堂 class,其目的是描述如何实现域以及在这些域上声明的任何数组。实际上,他们指定:
- 如何实现根据域映射声明的域,包括如何将它们存储在内存中以及如何实现编译器可能需要的方法(如迭代、成员测试等)
- 如何实现根据该域声明的数组,包括如何将它们存储在内存中以及如何实现编译器可能需要的方法(如迭代、随机访问等)
The block domain map only wants to know about the boundingBox, targetlocales, and datapar's, and there is no need for domain, here in this case {1..8,1..8}.
这是正确的,在学习 Block
分布时,这常常是一个混淆点。让我们用一个稍微人为的例子来说明这一点:
const D = {1..4, 1..4} dmapped Block({1..8, 1..8});
此声明表示,二维索引的平面应通过尽可能均匀地阻塞语言环境之间的边界框 {1..8, 1..8}
来分布到语言环境。如果我在 4 个区域设置中 运行,区域设置 0 将拥有边界框的 {1..4, 1..4}
,这意味着它将在 2D 平面中拥有 {-inf..4, -inf..4}
(其中,inf
表示意思是 "infinity" 实际上,-inf
将由一个小整数表示)。同样,区域设置 3 将拥有边界框的 {5..8, 5..8}
或二维平面的 {5..inf, 5..inf}
。
如您所见,上面的 {1..8, 1..8}
只是 Block
域映射的一个参数,因此与 D
的值无关,仅与它的实现有关。因为 D
的值为 {1..4, 1..4}
,它完全属于区域设置 0,因为它完全适合该区域设置的 2D 平面部分。如果它是 {2..5, 2..5}
,区域设置 0 将拥有 {2..4, 2..4}
,区域设置 1 将拥有 {2..4, 5..5}
,区域设置 2 将拥有 {5..5, 2..4}
,区域设置 3 将拥有 {5..5, 5..5}
。
因为 Block 分布由这个边界框域参数化,这常常导致混淆为什么在像上面那样的声明中使用两个域,特别是因为它们在实践中通常是相同的。这与域映射本身无关,而是与 Block 域映射的构造函数期望域作为其参数之一这一事实有关。相比之下,Cyclic
和 BlockCyclic
域映射不接受域参数,因此通常更容易理解。
Did the Block domain map creates instances on targetlocales which holds the local index sets...
是的,在实践中,Block
域映射创建了一个 LocBlock
class 的实例,它存储了每个语言环境的本地索引集——例如,{-inf..4, inf..4}
on locale 0,{-inf..4, 5..inf}
在语言环境 1 上,等等。对于我之前的示例。
Each instance of the Block domain map class stores the boundingbox and set of target locales
是的,每个语言环境还存储了 Block
域映射 class 的副本,它存储了参数化域映射的所有关键参数,以便可以通过以下方式推断它定义的分布每个语言环境都是孤立的。
In this presentation in slide no : 34,the local instance domain maps and domains store only the index space,nothing special.
没错,本地块域映射 class 的作用是存储该区域设置(幻灯片中的区域设置 #4 或 L4)拥有的二维平面部分。同样,本地 Block 域 class 的作用是存储该区域设置所拥有的域索引集部分。这些并不特殊,但它们分别对于定义分布和分布式域很重要。
2.In the previous answer,Dr.Brad has also mention that " a given domain map implementation may be very space efficient and minimal, or it can allocate everything on every locale redundantly, as its author thinks best", in this context what "allocate everything on every locale redundantly" actually means ? whether storing the whole array on each locality ?
是的,"allocate everything on every locale redundantly" 我的意思是每个语言环境都存储整个数组。这可能不是特别可扩展,但关键是语言和域映射框架只要支持预期的接口,就不会说明数组的存储方式。因此,域图的作者可以选择这样做。
- In PGAS, the Global instance of domain map,domain,array is visible across all locales ?. And I also hope that each query to them takes place through the global instances.
您是正确的,由于 Chapel 的 PGAS(分区全球地址 Space)模型,classes 的全局实例在所有语言环境中都是可见的。也就是说,由于域之间的通信非常昂贵,而且这些对象往往很少更改它们的字段,因此在实践中我们倾向于跨区域复制它们。在幻灯片 34 中,您提到的标签“(逻辑上)”是指:每个对象都有一个概念副本,但实际上我们倾向于跨区域复制它们(域地图的作者可能或可能不会像他们希望的那样这样做)。
I kindly request you to determine the required interfaces for domain map as you mention in the documentation.
域映射接口的当前文档可用 here. The current sources for the Block
domain map which implement the 6 descriptors ({global, local} x {domain map, domain, array}) can be found here。