Programs with intel TBB are not simulated correctly

31 views
Skip to first unread message

Kobe Bergmans

unread,
Feb 23, 2023, 5:44:57 AM2/23/23
to Sniper simulator
Hello,

I am currently working on my master's thesis and I would like to use snipersim to evaluate my code. My current codebase uses a combination of openMP, Boost, and Intel TBB. I have not been able to simulate my code using sniper because errors or incorrect results keep showing up.

First, I tried to run my normally compiled code (compiled with dpcpp, icx and gcc) on Ubuntu 20.04 with intel oneapi version 2021.4.0. Every piece of code which contained function calls to tbb gave following error before the program was started:
error while loading shared libraries: libtbb.so.12: cannot open shared object file: No such file or directory

So, I thought the oneapi version of TBB was not supported. To solve this issue I installed the apt package 'libtbb-dev' (version 2020.1-2) and made a minimal code example to eliminate all other variables. The minimal code example is given below. I ran this code using the command:
../../snipersim/run-sniper -n 2 -c gainestown -d ./Sniper_Out/ -- ./tbb_test
The result of this command is given below. The results are correct, but only 1 core was used in the simulation. Furthermore, after the execution of the program following error is thrown:
free(): invalid pointer
which also gives a Pin error code 6.

At this moment I am stuck and I don't know how I can get my TBB code running with sniper. Can anyone around here help me?

Kind regards,
Kobe Bergmans


Minimal code example:
#include <iostream>
#include <unistd.h>

#include <tbb/parallel_for.h>

int main() {
    tbb::parallel_for(0, 10, [=](int i) {
        sleep(1);
        std::cout << "Iteration: " << i << std::endl;
    });

    return 0;
}

Output of minimal example run using sniper:
[SNIPER] Start
[SNIPER] --------------------------------------------------------------------------------
[SNIPER] Sniper using SIFT/trace-driven frontend
[SNIPER] Running full application in DETAILED mode
[SNIPER] --------------------------------------------------------------------------------
[SNIPER] Enabling performance models
[SNIPER] Setting instrumentation mode to DETAILED
[RECORD-TRACE] Using the Pin frontend (sift/recorder)
Iteration: 0
Iteration: 1
Iteration: 2
Iteration: 3
Iteration: 4
Iteration: 5
Iteration: 6
Iteration: 7
Iteration: 8
Iteration: 9
free(): invalid pointer
[TRACE:0] -- DONE --
Pin app terminated abnormally due to signal 6.
[SNIPER] Disabling performance models
[SNIPER] Leaving ROI after 20.93 seconds
[SNIPER] Simulated 3.5M instructions, 3.7M cycles, 0.94 IPC
[SNIPER] Simulation speed 166.4 KIPS (83.2 KIPS / target core - 12016.1ns/instr)
[SNIPER] Setting instrumentation mode to FAST_FORWARD
[SNIPER] End
[SNIPER] Elapsed time: 21.11 seconds
Reply all
Reply to author
Forward
Message has been deleted
0 new messages