// Compile with: g++ -o PiOMP -fopenmp PiOMP.cpp #include #include #include #include #include using namespace std; int piRnd(long n) { long count = 0; // use re-entrant random gen drand48_data dbuf; // init random seed differently for each thread srand48_r(time(0) + omp_get_thread_num(), &dbuf); double x, y; for ( long i = 0; i