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
This paper provides an initial meta-framework for the drives toward memory affinity for C++, given the direction from Toronto 2017 SG1 meeting that we should look towards defining affinity for C++ before looking at inaccessible memory as a solution to the separate memory problem towards supporting heterogeneous and distributed computing.
@@ -62,18 +68,20 @@ The goal was that this would enable scaling up for heterogeneous and distributed
62
68
63
69
The problem of effectively partitioning a system’s topology is one which has been so for some time, and there are a range of third party libraries / standards which provides APIs to solve the problem. In order to standardise this process for the C++ standard we must carefully look at all of these. Below is a list of the libraries and standards which define an interface for affinity:
Libraries such as the Portable Hardware Locality (hwloc) [9] provide a low level of hardware abstraction and offer a solution for the portability problem by supporting many platforms and operating systems. This and similar approaches may provide detailed hardware information in a tree-like structure. However, even some current systems cannot be represented correctly by a tree, where the number of hops between two sockets vary between socket pairs [14].
79
87
@@ -94,6 +102,66 @@ There are some additional challenges which we have been investigating but are no
94
102
* Migrating data from memory allocated in one partition to another
95
103
* Defining memory placement algorithms or policies
The first task in allowing C++ applications to leverage memory locality is to provide the ability to query a **system** for its **resource topology** (commonly represented as a tree or graph) and traverse its **execution resources**.
The interface described above describes an execution resource as an object which cannot be user constructed, copied or moved, only referenced. It provides an interface for recursively querying the partitions and concurrency of it’s child execution resources via the member functions `concurrency`, `partition_size` and `partition` and it’s parent execution resource via the member function `member_of`. This interface is designed to match the design of `thread_execution_resource_t` [8]. Note that the resource is not limited to be an **execution resource**, but also a general resource where no execution can take place but memory can be allocated such as off-chip memory.
163
231
@@ -185,7 +253,7 @@ namespace std::this_system {
185
253
execution_resource &resource();
186
254
}
187
255
```
188
-
*Listing 3: Interface for querying the execution resources available within a system*
256
+
*Listing 4: Interface for querying the execution resources available within a system*
189
257
190
258
The **resource** function in the `this_system` namespace will return the root **execution resource** of the current system.
191
259
@@ -198,7 +266,7 @@ for (int i = 0 ; i < partition_size(); i++) {
*Listing 4: Example of querying the execution resources available within a system*
269
+
*Listing 5: Example of querying the execution resources available within a system*
202
270
203
271
| Straw Poll |
204
272
|------------|
@@ -217,7 +285,7 @@ struct execution_context {
217
285
...
218
286
};
219
287
```
220
-
*Listing 5: Extension to execution_context interface*
288
+
*Listing 6: Extension to execution_context interface*
221
289
222
290
The **execution context** constructor described above allows constructing an **execution context** from any **execution resource** within a **system’s resource topology**. The constructed **execution context** can then execute work on any resource under that **execution resource**.
223
291
@@ -238,7 +306,7 @@ for (int i = 0; i < resource.partition_size(); i++) {
0 commit comments