Optimizing OpenMP code