Skip to content

Conversation

isaevil
Copy link
Contributor

@isaevil isaevil commented Oct 2, 2025

Add a page that describes helper APIs to simplify constrained arena creations. Currently it is a single function oneapi::tbb::create_numa_task_arenas from corresponding RFC.

@isaevil isaevil force-pushed the add-numa-arena-helper branch from 93dbd8a to f819fc1 Compare October 2, 2025 09:32
Signed-off-by: Isaev, Ilya <[email protected]>
@isaevil
Copy link
Contributor Author

isaevil commented Oct 2, 2025

@aleksei-fedotov @akukanov Please take a look.

@akukanov akukanov added the TBB label Oct 2, 2025
.. cpp:function:: std::vector<oneapi::tbb::task_arena> create_numa_task_arenas(oneapi::tbb::task_arena::constraints other_constraints = {}, unsigned reserved_slots = 0)

Returns a ``std::vector`` of ``task_arena`` objects, each bound to a separate NUMA node.
The number of created ``task_arena`` is equal to the number of NUMA nodes available on the system.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall it be less strict and, thus, more accurate?

Suggested change
The number of created ``task_arena`` is equal to the number of NUMA nodes available on the system.
The number of created ``task_arena`` is equal to the number of NUMA nodes detected on the system.


.. cpp:function:: std::vector<oneapi::tbb::task_arena> create_numa_task_arenas(oneapi::tbb::task_arena::constraints other_constraints = {}, unsigned reserved_slots = 0)

Returns a ``std::vector`` of ``task_arena`` objects, each bound to a separate NUMA node.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it closer to the proposed RFC?

Suggested change
Returns a ``std::vector`` of ``task_arena`` objects, each bound to a separate NUMA node.
Returns a ``std::vector`` of non-initialized ``task_arena`` objects, each bound to a separate NUMA node.

.. SPDX-License-Identifier: CC-BY-4.0

=========================
Constrained Arena Helpers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps, task_arena Helpers might be more suitable as a name in case we would want to extend this page with other helpers, thus, avoiding creating a new one?

Functions
---------

.. cpp:function:: std::vector<oneapi::tbb::task_arena> create_numa_task_arenas(oneapi::tbb::task_arena::constraints other_constraints = {}, unsigned reserved_slots = 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shorten?

Suggested change
.. cpp:function:: std::vector<oneapi::tbb::task_arena> create_numa_task_arenas(oneapi::tbb::task_arena::constraints other_constraints = {}, unsigned reserved_slots = 0)
.. cpp:function:: std::vector<oneapi::tbb::task_arena> create_numa_task_arenas(oneapi::tbb::task_arena::constraints constraints = {}, unsigned reserved_slots = 0)

Comment on lines +31 to +33
It optionally takes additional ``other_constraints`` argument to be applied to each created
``task_arena``, ignoring ``numa_id`` value. The second optional ``reserved_slots`` argument
allows to reserve a number of slots in each created ``task_arena`` for application threads.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps,

Suggested change
It optionally takes additional ``other_constraints`` argument to be applied to each created
``task_arena``, ignoring ``numa_id`` value. The second optional ``reserved_slots`` argument
allows to reserve a number of slots in each created ``task_arena`` for application threads.
Additional ``constraints`` argument can be specified to further limit the threads joined
the ``task_arena`` objects. The ``numa_id`` value in the ``constraints`` argument is
ignored. The ``reserved_slots`` argument allows reserving specified number of slots in
``task_arena`` objects for application threads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants