/* File: hello1.cpp Simple use of '#pragma omp parallel' This version uses printf which is "critical" compile with: g++ hello1.cpp -fopenmp */ #include #include #include using namespace std ; int main() { cout << "Hello from master thread." << endl ; #pragma omp parallel { printf("Team member %d reporting from team of %d.\n", omp_get_thread_num(), omp_get_num_threads() ); } cout << "Master thread finished, goodbye." << endl ; }