attempt to fix performance issue with omp criticals around global vars