[Openmp-commits] [openmp] Draft: [OpenMP] Fix td_tdg_task_id underflow with taskloop and taskgraph (PR #150877)

via Openmp-commits openmp-commits at lists.llvm.org
Wed Jul 30 07:41:51 PDT 2025


jprotze wrote:

Even with a localized counter as implemented with your latest commit, I think this decrement can be problematic.

Is it really important to avoid spurious holes in the numbering of task IDs? As I understand, this is just used for accessing the `record_map` entries (which is actually a vector, not a map). Checking the code, I realized that for resizing the vector, the code will do a lot of rather small allocs for `successorList`, that might never be used. I would recommend to delay these allocs until the entry is really used.

A bigger issue is, that the accesses to the `record_map` are not protected. If one thread triggers the resize code for the vector, other threads might still access the vector and writes might get lost.

https://github.com/llvm/llvm-project/pull/150877


More information about the Openmp-commits mailing list