How to launch tasks on a custom thread pool? #5801
Replies: 3 comments 5 replies
-
Would you mind sharing a small example for what you're doing? Just to make sure I fully understand what you're doing and are trying to achieve... |
Beta Was this translation helpful? Give feedback.
-
Apologies for the delayed response, my example is based on one of your stencil examples. The link for it is provided below. I am trying to ensure that each NUMA node works on the same block of the overall grid over all iterations. In my example I used sched_getcpu() to see the history of pus that worked on each partition over time and the results are mixed. When initializing the partitions with a parallel_for on 2 numa nodes, each NUMA node has approximately one half written into their memory, but after that the computational tasks are not split among the 2 NUMA nodes cleanly. I know that in your and my example there are essentially new partitions created and written into memory so that if a partition of timestep 0 was on NUMA node 0, the partition for its next timestep may be computed on NUMA node 1 and thus its data would lie on NUMA node 1s memory. This way remote accesses might still be mitigated if there is a streak of timesteps where one partition is computed on the same NUMA node, even if intermittently there are switches. However, if I wanted to make a clean division of responsibilities among the NUMA nodes that I have, how could I achieve this?
|
Beta Was this translation helpful? Give feedback.
-
@topkanoguzhan I am on it. Will come back to you later in the day. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
Is there an example or a guide on how to schedule a task on a custom thread pool. I followed the resource partitioner guide in the documentation to add a bunch of threads from a NUMA node to a thread pool called "my_thread_pool" exactly like in the documentation, and testing this with
hpx:print-bind
shows that it works as intendend. From the main function executed on the default pool I would now like to launch some of the tasks on the custom thread pool. I was not able to find something in the documentation, but it states that this should be possible.I am trying to know specifically how this could be done with dataflows like these:
V[0] = dataflow( hpx::launch::async, operation, arg1, arg2, ..., argn);
Thank you very much in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions