795
questions
0
votes
1
answer
199
views
Can't install library with vcpkg using MinGW compiler
I'm trying to install the tbb library on Windows using the MinGW C++ compiler g++ and the vcpkg package manager. However, running .\vcpkg install tbb --triplet=x64-mingw-static --host-triplet=x64-...
0
votes
0
answers
46
views
tbb freezes glfw window
When I use tbb::parallel_invoke to separate the input loop from the render loop into two different threads, both loops are running, but the window from glfw freezes immediately.
The following is the ...
1
vote
0
answers
61
views
vsruntime DLLs conflict after delvewheel repair
I am building wheel package for pypi, that usually is OK, but after updating some thirdparties I've got an error:
>>> from meshlib import mrmeshpy as mm
Traceback (most recent call last):
...
1
vote
1
answer
171
views
Thread pool design
I have a design question about thread pool. Consider the following code:
int main() {
auto po = std::execution::par_unseq;
// If Parallel STL uses TBB as the backend, I think the thread pool
/...
0
votes
1
answer
35
views
Automate "Set the oneAPI Environment" every time when I start VSCode
I find out that I have to CTRL+SHIFT+P > Intel oneAPI: Initialize environment variables every time when I start up VSCode. Otherwise there are build errors "fatal error: oneapi/tbb.h: No such ...
0
votes
1
answer
68
views
C++23 tbb:parallel_reduce with std::multiplies as reduction
I want to multiplies all the elements of a vector. However, the following code snippet
long doulbe sum = parallel_reduce(
blocked_range<long double>(0, sum1.size()), 1.0L /* Identity for ...
0
votes
0
answers
57
views
Compilation Error using TBB: inlining failed in call to ‘always_inline’ [duplicate]
I want to use the TBB library for my Project, but the compilation fails with this error:
/usr/lib/gcc/x86_64-linux-gnu/12/include/waitpkgintrin.h: In function ‘void tbb::detail::r1::prolonged_pause()’:...
0
votes
0
answers
38
views
g++ not picking up tbb library during linking [duplicate]
I installed libtbb
~/work$ sudo find / -name "libtbb.*"
/usr/lib/x86_64-linux-gnu/libtbb.so
/usr/lib/x86_64-linux-gnu/libtbb.so.2
Version of g++
$ g++ --version
g++ (Ubuntu 7.5.0-3ubuntu1~...
0
votes
1
answer
134
views
Is Intel TBB concurrent vector of doubles lock-free?
I am writing C++ multithreaded code using GCC C++20 on Intel Broadwell XEONs or AMD EPYC 7551s, Intel TBB, and Pagmo2 libraries for optimization problems. If I declare concurrent_vector<double> ...
0
votes
0
answers
47
views
C++ TBB: How to run multiple `tbb::task_arena` in parallel?
I have a performance critical lambda function p which calculates something and writes its result to an external data structure:
class Foo {
...
std::vector<int> v;
auto p = [&]() {
...
0
votes
0
answers
75
views
Uninstal TBB, "Threading Building Blocks"
ERROR: Cannot uninstall 'TBB'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
cara menghapus ...
0
votes
0
answers
51
views
How to eliminate the overhead of utilizing threadpools in nested for-loops
I am trying to multithread the p2-loop in the inner loop of the following nested loops in C++. I don't want the outer loop to be multithreaded due to shared data.
// OUTER LOOP
for ( int l = 0; l < ...
0
votes
0
answers
55
views
The implementation of tbb::parallel_for gives a sigsev segmentation error
I was compiling a program named autoremesher on Ubuntu 22.04. It's an open source project, and I was requested to remove it's GUI. That I did and removed it's dependency from QT framework, except for ...
1
vote
1
answer
103
views
How to link a library in Rtools on Windows?
I am trying to use a library (Intel TBB) in my R package on Windows, but not sure how to write makevars.win.
I have Rtools installed, and there are the library under include:
C:\RBuildTools\4.3\x86_64-...
1
vote
0
answers
33
views
Update Node from OneTBB Library
Is there a way to have joiner/indexer or composite node with an update policy? The update policy has the requirement:
The output is ready once at least one port receives a value.
Mechanism to check ...
0
votes
1
answer
66
views
How do I reference the instance of tbb::task_group_context which is being passed in through the tbb::parallel_for loop
tbb::task_group_context tg;
SomeClass someObject;
tbb:: parallel_for(tbb::blocked_range<size_t>(0, num, grainSize),
someObject,
tbb::simple_partitioner(),
...
0
votes
0
answers
94
views
Deadlock between tbb::task_group and thread barrier
In my application i am using Intel OneAPI TBB for parallelism. I am isolating work on NUMA nodes using task_arenas. I have a couple of parallel tasks I need to execute on each NUMA node for which I am ...
-1
votes
1
answer
232
views
Error installing tbb on MacOS using homebrew
I'm trying to install tbb on MacOS using Homebrew, and I get the following error message:
==> cmake --build build/shared
Last 15 lines from /Users/inspectorgloomy/Library/Logs/Homebrew/tbb/02.cmake:...
1
vote
0
answers
72
views
Chunk a map with Intel TBB parallel_for
I want to traverse my std::map in parallel with parallel_for.
As the tutorial says, we cannot randomly access it, so I chose parallel_for_each.
std::map<std::string, std::string> map_; // ...
0
votes
1
answer
99
views
Comparison of intel tbb and Qt threadpool
I'm developing a Qt application with multithreading.
I used divided my task and put them into the Qt thread pool.
But later I found intel tbb which is a professional lib for multithreading, too.
I ...
1
vote
1
answer
121
views
When find() of tbb::concurrent_hash_map is used in parallel with iteration, the amount of data obtained is inconsistent with the size of the map?
I have two threads, one is doing find() on a tbb::concurrent_hash_map and the other is traversing this map without doing any insertion or deletion. The strange thing is that if find() is not executed, ...
4
votes
1
answer
682
views
C++ parallel STL Vectorized algorithm not implemented p2408
I'm compiling the C++ code below with g++ 14.0.0:
g++ -I/path/to/c++/14.0.0 -L/path/to/c++/libstdc++ -ltbb -std=c++23 -o main main.cc
#include <iostream> ...
1
vote
0
answers
127
views
TBB parallel_sort is slow for huge std::vector
Given an std::vector containing 5k CGAL::Line_2, I need to compute all the intersection points and sort them in increasing lexicographic order. I am using exact arithmetic, in particular ...
0
votes
0
answers
44
views
tbb parallel_for crashes when the number of threads exceeds the maxproc on the system
During Parallel_for execution, tbb crashes with the following message:
thread_monitor Resource temporarily unavailable in pthread_create
Does tbb throw an exception when it encounters this problem ? ...
0
votes
1
answer
124
views
Why tbb::enumerable_thread_specific does not accept types with not-const references in constructor arguments?
I would like to create thread local storage using tbb::enumerable_thread_specific for elements of type that takes not-const reference in the constructor. Unfortunetly, it does not work from the box, ...
4
votes
0
answers
191
views
Visual Studio generated suspicious assembly code when a oneAPI TBB header is present in a PCH
After building the code shown below in Visual Studio 2022 version 17.7.6 and running it, an exception std::length_error is thrown within MS C++ STL implementation. It attempts to create a vector using ...
2
votes
1
answer
108
views
How to implement boost::serialize for tbb::concurrent_vector
I am using tbb::concurrent_vector in place of std::vector in some places but am also using boost serialization in order to serialise the containers, and concurrent_vector does not come with one ...
0
votes
0
answers
51
views
creation of threads in TBB thread pool when the number of threads have exceeded max number of processes
I ran into a problem while running a multi threaded code which gave the following error:
"Resource temporarily unavailable"
what does TBB do when the number of threads exceed the number of ...
3
votes
1
answer
331
views
Why tbb::this_task_arena::max_concurrency() cannot increase without limitation?
My MacOS system is 2 GHz 4 Intel Core i5, and when I set:
tbb::global_control gc(tbb::global_control::max_allowed_parallelism, 10);
I can only get 8 returned by tbb::this_task_arena::max_concurrency()...
0
votes
5
answers
4k
views
Cannot update TBB using pip: distutils installed project
I ran a full update of all PyPi packages on my laptop (Ubuntu 22.04, Python 3.9), and I've resolved all dependency issues except one: Daal requires a different version of TBB than what I have. I ...
0
votes
1
answer
173
views
How to install onAPI/tbb on alpine
I'm currently running alpine on a docker, and I've tried installing the tbb library of intel's oneAPI via pip and also tried making it from source, and none of the those did work, is there any way to ...
1
vote
1
answer
73
views
Calling tbb::parallel_for inside a while loop
I would like to call tbb::parallel_for inside a while loop with different sets of data. Is my understanding correct that only after all the threads have finished executing in the 1st iteration of the ...
2
votes
0
answers
404
views
Concurrent Iteration and Modification in TBB's concurrent_unordered_map
I am working on an architecture where multiple threads concurrently insert, update, and read elements from a shared map. After researching, I found that Intel TBB's concurrent_hash_map seems suitable ...
2
votes
2
answers
665
views
Python: Numba with threading layer resolution issue
I'm trying to install Numba, along with tbb (or omb) as a threading layer. Even though I've installed both tdd and omb and can see them installed in my virtual environment, at runtime (or using the ...
1
vote
2
answers
164
views
tbb parallel_for: Object with intrusive list node can be part of only one intrusive list simultaneously
I'm currently porting a program that was originally written on Windows 10 to a redhat system (VERSION_ID="8.8") that has g++ version 8.50. 20210514 (Red Hat 8.5.0-18). I installed tbb with ...
-8
votes
4
answers
869
views
Fastest way to bring a range [from, to] of 64-bit integers into pseudo-random order, with same results across all platforms?
Given some interval [a, b] of indices (64-bit unsigned integers), I would like to quickly obtain an array that contains all of these indices ordered according to a uniformly distributed hash function, ...
1
vote
1
answer
439
views
Why is clearing a tbb::concurrent_unordered_map so much slower than clearing a std::unordered_map?
I have a tbb::concurrent_unordered_map<size_t, std::vector<size_t>> - or, alternatively, an std::unordered_map<size_t, std::vector<size_t>>.
Clearing the map, either by calling ...
0
votes
1
answer
648
views
Using tbb parallel for to iterate over std::map
I have two questions:
I understand that I can use tbb::parallel(0, n, 1)[](i) {f(i)} to do a parallel for loop. What's the best way to parallel loop over a const std::map?
If I want to append all ...
0
votes
1
answer
351
views
Can Intel oneTBB co-exist with OpenMP?
I have a quick theoretical question. Can Intel oneTBB (Thread Building Blocks) co-exist with OpenMP (Open MultiProcessing) in one code base? Both are parallel runtimes for shared memory architectures. ...
0
votes
1
answer
259
views
Race condition in tbb::concurrent_queue
I am having a data race problem on tbb::concurrent_queue. Here is the code, producer and consumer functions are running on separate threads:
tbb::concurrent_queue<std::string> valid_json_queue;
...
1
vote
1
answer
117
views
intel openTBB task arenas behaviour
Is it guaranteed that all tasks in the task_arena will be executed on the same threads set? for example I would have a rendering thread to call opengl API. Can I use something like that? Documentation ...
3
votes
1
answer
312
views
tbb::parallel_reduce vs tbb::parallel_deterministic_reduce
Threading Building Blocks (TBB) library provides two functions for performing reduction over a range:
parallel_reduce, and
parallel_deterministic_reduce.
Which one of two shall be selected if I want ...
1
vote
1
answer
616
views
calling for_each with execution policy par_unseq and yet links without tbb
In a source file called holes5.cpp, I have this code:
cdtt is a Lamda with side effects.
for (int depth=0; depth<10; depth++)
{
auto rng = views::iota(0, (int)decision_tree.size()) |
...
0
votes
1
answer
380
views
what brings about a dependency on tbb?
Using g++12 and CMake.
I have a source file
holes5.cpp
which does not
#include <execution>
and does not need to link to tbb.
Now if I add
#include <execution>
it does not require ...
2
votes
2
answers
195
views
Dead Lock in TBB
Could please someone explain to me how did I end up in a dead lock situation below:
This is a reprensatative example of what I was doing.
#include <unordered_map>
#include <memory>
#...
3
votes
2
answers
813
views
Reader/Writer: multiple heavy readers, only 1 write per day
I have a huge tbb::concurrent_unordered_map that gets "read" heavily by multiple (~60) threads concurrently.
Once per day I need to clear it (either fully, or selectively). Erasing is ...
0
votes
2
answers
612
views
thread_local storage, constructors, destructors, and tbb
It's my understanding that tbb may maintain pool threads for reuse... is there a way to ensure that data that I have declared using a modern C++ implementation as thread_local and with a non-trivial (...
0
votes
1
answer
519
views
Does parallel_for_each (tbb) process each element of array in a different thread?
From the documentation of oneapi:
The sequence form parallel_for_each(first, last, body) applies a function object body over a sequence [first,last). Items may be processed in parallel.
What does ...
0
votes
1
answer
265
views
oneTBB data flow graph, how to write a node with single input, but output multiple times
I want to use oneTBB to write such a node, that can receive a value, and then generate a vector of int. But instead of sending the vector as a single output, I want to send each vector element as a ...
0
votes
1
answer
290
views
Why the Intel oneAPI tbb::blocked_range3d run code many times have different value?
I run this example many time, every time blocked_range3d has different value?
I test this because I make my blocked_range2d+for to blocked_range3d, and it make a lot error vaule. Is it my code have ...