A common pitfall is to believe that all threads of a parallel region should instantiate (create) tasks but this is not typically the case unless you want to create as many tasks as the number of threads times the number of elements to process. Therefore, in OpenMP task codes you'll find something similar to
#pragma omp parallel
#pragma omp single
...
#pragma omp task
{ code for a given task; }
...