Generalizing OMP threading