/* L-9 MCS 572 Mon 30 Jan 2012 : hello_openmp.c */

#include <stdio.h>
#include <omp.h>

int main ( int argc, char *argv[] )
{
   omp_set_num_threads(8);

   #pragma omp parallel
   {
      #pragma omp master
      {
         printf("Hello from the master thread %d!\n",
                omp_get_thread_num());
      }
      printf("Thread %d says hello.\n",omp_get_thread_num());
      
      #pragma omp single
      {
         printf("Only one thread %d says more ...\n",
                omp_get_thread_num());
      }
   }
   return 0;
} 

