oneapi-src / oneTBB

oneAPI Threading Building Blocks (oneTBB)
https://oneapi-src.github.io/oneTBB/
Apache License 2.0
5.46k stars 992 forks source link

Fix TBB context name for VTune profiler #165

Closed anton-malakhov closed 19 hours ago

anton-malakhov commented 5 years ago

VTune has the ability to show user tasks on the timeline and summary views. TBB reports it as defined here:

TBB_STRING_RESOURCE(CUSTOM_CTX, "tbb_custom")

However, it turns out to be misleading because what is actually reported looks like activity of TBB scheduler but not a tbb::task while what I read in VTune can be interpreted as a tbb::task run time. My suggestion is to rename it as something like tbb-context or TBB dispatch, which will give the right hint to guess the logic behind these reports in VTune.

alexey-katranov commented 5 years ago

tbb_custom is used for user provided contexts and for backward compatibility of the applications built before the feature was introduced. Therefore, the reported information should relate to the user code and TBB tasks. If you feel that VTune reports misleading information, can you provide a VTune picture or some details about your use case (incl. used TBB version)

anton-malakhov commented 5 years ago

The code creates tbb::task_group and runs thousands tasks through it. What is confusing is that TBB reports an aggregated region where task scheduler works (without going to sleep?) but in VTune it looks like a single "task". It creates misleading associations between VTune's "task" and TBB's task. So, my request is to fix the wording (referring to the right entity like the context or dispatch) or make it obvious in some other way, e.g. if VTune/TBB shows how many TBB tasks are aggregated in VTune's one.

akukanov commented 5 years ago

Changing the string to something more informative makes sense. How about "tbb_unspecified_tasks"?

Counting and reporting the number of "aggregated" tasks should better be requested as a VTune feature - we cannot do it solely in TBB.

nofuturre commented 1 week ago

@anton-malakhov is this issue still relevant?