Issue 83883
Summary [OMPT] Untied tasks schedules
Labels new issue
Assignees
Reporter rpereira-dev
    Something seems wrong with OMPT `task_schedule` events with untied tasks, please see minimal example bellow

LLVM version
```bash
$ clang --version
clang version 19.0.0git (https://github.com/rpereira-dev/llvm-project ed327625cc1de7f0f71c63f3ae59b6ac621e2c76)
Target: x86_64-unknown-linux-gnu
Thread model: posix
```

main.c
```C
int main(void)
{
    # pragma omp parallel
    {   
        # pragma omp single
        {
 # pragma omp task untied
            {}
        }
    }   
 return 0;
}
```

OMPT tool used
```bash
git clone -b llvm/untied-schedule https://github.com/rpereira-dev/ompt-dump.git
```

Compiled and run as
```
clang -Wall -Werror -Wextra -fopenmp main.c
OMP_NUM_THREADS=1 OMP_TOOL_LIBRARIES=path/to/libompt_dump.so ./a.out
```

Outputs
```
  1 [OMPT] [INFO] OMPT_DUMP: OpenMP 201611 and runtime LLVM OMP version: 5.0.20140926
  2 [OMPT] [INFO] Could not register callback 'ompt_callback_device_unload'
  3 [OMPT] [INFO] Could not register callback 'ompt_callback_target_map'
  4 [OMPT] [INFO] Could not register callback 'ompt_callback_target_map_emi'
  5 [OMPT] [INFO] ompt_callback_thread_begin
  6 [OMPT] [INFO] ompt_callback_implicit_task(task_data=0x55c7bf5da440)
  7 [OMPT] [INFO] ompt_callback_parallel_begin
  8 [OMPT] [INFO] ompt_callback_implicit_task(task_data=0x55c7bf5e1280)
  9 [OMPT] [INFO] ompt_callback_work
 10 [OMPT] [INFO] ompt_callback_task_create(encountering_task_data=0x55c7bf5e1280, new_task_data=0x55c7bf6e3900)
 11 [OMPT] [INFO] ompt_callback_task_schedule(prior_task_data=0x55c7bf5e1280, prior_task_status=7, next_task_data=0x55c7bf6e3900)
 12 [OMPT] [INFO] ompt_callback_task_schedule(prior_task_data=0x55c7bf6e3900, prior_task_status=7, next_task_data=0x55c7bf5e1280)
 13 [OMPT] [INFO] ompt_callback_task_schedule(prior_task_data=0x55c7bf6e3900, prior_task_status=7, next_task_data=0x55c7bf6e3900)
 14 [OMPT] [INFO] ompt_callback_task_schedule(prior_task_data=0x55c7bf6e3900, prior_task_status=1, next_task_data=0x55c7bf5e1280)
 15 [OMPT] [INFO] ompt_callback_work
 16 [OMPT] [INFO] ompt_callback_sync_region
 17 [OMPT] [INFO] ompt_callback_sync_region_wait
 18 [OMPT] [INFO] ompt_callback_sync_region_wait
 19 [OMPT] [INFO] ompt_callback_sync_region
 20 [OMPT] [INFO] ompt_callback_implicit_task(task_data=0x55c7bf5e1280)
 21 [OMPT] [INFO] ompt_callback_parallel_end
 22 [OMPT] [INFO] ompt_callback_implicit_task(task_data=0x55c7bf5da440)
 23 [OMPT] [INFO] ompt_callback_thread_end
```

Event Line 11 - The thread switches from its implicit (parent) task `0x55c7bf5e1280` to the untied task `0x55c7bf6e3900`
Event Line 12 - The thread switches from the untied  task `0x55c7bf6e3900` to its implicit (parent) task `0x55c7bf5e1280`
Event Line 13 - The thread switches from the untied  task `0x55c7bf6e3900` to the same untied task `0x55c7bf5e1280` with the same status - (**ERROR: the current task is `0x55c7bf5e1280`**) 
Event Line 14 - [...]

Removing the `untied` clause produces removes events line 13 and 14, which is what we should expect even with `untied` I believe ?
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to