LLVM OpenMP 20.0.0git
Macros | Functions
omp_fill_taskqueue.c File Reference
#include <omp.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Macros

#define NUM_TASKS   2000
 Test the task throttling behavior of the runtime.
 

Functions

int main ()
 

Macro Definition Documentation

◆ NUM_TASKS

#define NUM_TASKS   2000

Test the task throttling behavior of the runtime.

Unless OMP_NUM_THREADS is 1, the master thread pushes tasks to its own tasks queue until either of the following happens:

  • the task queue is full, and it starts serializing tasks
  • all tasks have been pushed, and it can begin execution The idea is to create a huge number of tasks which execution are blocked until the master thread comes to execute tasks (they need to be blocking, otherwise the second thread will start emptying the queue). At this point we can check the number of enqueued tasks: iff all tasks have been enqueued, then there was no task throttling. Otherwise there has been some sort of task throttling. If what we detect doesn't match the value of the environment variable, the test is failed.

Definition at line 25 of file omp_fill_taskqueue.c.

Function Documentation

◆ main()

int main ( void  )

Definition at line 28 of file omp_fill_taskqueue.c.

References failed, i, and NUM_TASKS.