Skip to content
Snippets Groups Projects

Draft: Support newer TBB (incl. Intel oneAPI TBB)

Closed Thomas Madlener requested to merge thmadlen/Gaudi:intel-oneapi-tbb into master
1 unresolved thread

Forwarded from https://github.com/key4hep/Gaudi/pull/3

Main changes:

  • Prefer finding TBB through TBBConfig.cmake over the included FindTBB.cmake module
  • Remove explicit version from tbb::spin_rw_mutex_v3 (FIXME: needs version check verification)
  • tbb/tbb_stddef.h was removed from recent versions
  • tbb::task_arena must now be constructed with the threadpool size, so we use a shared_ptr

Status:

  • Compiles with newer TBB version but needs must more extensive testing:
    • does the CMake change find the 'right' locations?
    • does this now still work with older TBB and with all newer TBBs?

This should fix #270 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
58 58
59 59 virtual void initThisThread() override;
60 60
61 tbb::task_arena* getArena() { return &m_arena; }
61 std::shared_ptr<tbb::task_arena> getArena() { return m_arena; }
  • There is only a single user of getArena in Gaudi -- and the only thing it does is call enqueue. So would it not be better to not expose the (presence of an) underlying tbb::task_arena in ThreadPoolSvc.h and instead implement an enqueue function which forwards to the underlying thread pool?

    Basically, add

    template <typename F>
    void enqueue( F&& f ) {
        m_arena->enqueue( std:forward<F>(f) );
    }

    and remove getArena.

    After all, it is 'expected' that any thread pool offers some enqueue functionality to submit tasks to the pool...

  • Please register or sign in to reply
  • Edited by Software for LHCb
  • As discussed on Wednesday this is not compatible with older TBB versions. Our ATLAS jobs are all failing with

    AvalancheSchedulerSvc                                        0   FATAL Cannot find valid TBB task_arena
  • Author Contributor

    Thanks for the feedback so far. Just a quick update from our side: We are working on support for older TBB versions at the moment as well. Also the comment above from Gerhard is in the works.

  • I tested this MR with TBB 2021.9.0 and with 2020_U2. It compile in both cases, but in both cases some tests are failing with the message reported by @fwinkl.

    @thmadlen, which version of TBB did you use for the tests?

  • Author Contributor

    We didn't test this very thoroughly yet, apart from getting things to compile again to unblock some of our builds. We are still working on getting things to run again.

  • Juan Miguel Carceller mentioned in merge request !1495 (merged)

    mentioned in merge request !1495 (merged)

  • Please register or sign in to reply
    Loading