Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions source/elements/oneTBB/source/constrained_arena_helpers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.. SPDX-FileCopyrightText: 2025 Intel Corporation
..
.. SPDX-License-Identifier: CC-BY-4.0
=========================
Constrained Arena Helpers
=========================
**[constrained_arena_helpers]**

Helper interfaces to create and manage multiple ``task_arena`` objects with constraints.

.. code:: cpp
// Defined in header <oneapi/tbb/task_arena.h>
namespace oneapi {
namespace tbb {
std::vector<oneapi::tbb::task_arena> create_numa_task_arenas(
oneapi::tbb::task_arena::constraints other_constraints = {},
unsigned reserved_slots = 0);
} // namespace tbb
} // namespace oneapi
Functions
---------

.. 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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we require that this is the same set of nodes that is returned by tbb::info::numa_nodes()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is fair to require that as well, since the intent of this API is to provide shortcut to a common usage pattern of NUMA-constrained arenas.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the description

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.

.. note::

If error occurs during system topology parsing, returns ``std::vector`` containing single
``task_arena`` object equivalent to ``task_arena(other_constraints, reserved_slots)``.
3 changes: 2 additions & 1 deletion source/elements/oneTBB/source/nested-aux-interfaces.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. SPDX-FileCopyrightText: 2019-2020 Intel Corporation
.. SPDX-FileCopyrightText: 2019-2025 Intel Corporation
..
.. SPDX-License-Identifier: CC-BY-4.0
Expand All @@ -9,6 +9,7 @@
.. toctree::
:maxdepth: 2

constrained_arena_helpers.rst
memory_allocation.rst
mutual_exclusion.rst
timing.rst
Expand Down
Loading