openmp implementation using priority queue