#include <stdio.h> #include <omp.h> int main (void) { #pragma omp parallel { int tid = omp_get_thread_num (); printf ("Hello world from thread %d\n", tid); #pragma omp master { int nthreads = omp_get_max_threads (); int procs = omp_get_num_procs (); printf ("%d threads and %d processors\n", nthreads, procs); } } }