Skip to content

Incorrect output from join_node #1969

@DSEAframework

Description

@DSEAframework

Summary

In a graph that merges two tokens, the output from the join_node is not in the expected order when executed with multiple threads.

Version

2022.3.0 extracted from oneapi-tbb-2022.3.0-lin.tgz

Environment

  • Hardware
    Multi-core workstation
  • OS name and version
    Ubuntu 24.04
  • Compiler version
    gcc 13.3

Observed Behavior

The output of a join_node is not correct. The join_node has two inputs. The first input is a sequence of tuples (0,0), (1,1), (2,2), (3, 3)... The second input is a sequence of ints: 0, 1, 2, 3, 4, 5,.... The expected output is a sequence of tuples: ((0,0),0), ((1,1),1), ((2,2),2), ...
The observed output is sometime incorrect: ((0,0),0), ((2,2),1), ((1,1),2), ((3,3),3)
It seems the order of the first port is processed in incorrect order.
If the execution of the code is limited to one core via numactl, the output is correct.

Expected Behavior

The input of the join_node should be stored in a FIFO so that order is preserved. The output of the join_node should be independent of the number of cores and reproducible.

Steps To Reproduce

  1. Extract oneTBB
  2. source oneapi-tbb-2022.3.0/env/vars.sh
  3. Build: g++ main.cpp -ltbb -o test_app
  4. Run ./test_app the program prints !!! if the order of tokens is incorrect

main.cpp

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions