Commit 4be6a921 authored by Luca Tornatore's avatar Luca Tornatore
Browse files

.

parent e20c8569
Loading
Loading
Loading
Loading
+1 −1
Changes for OpenMP/examples/tasks/basic_task_examples/00_simple_nowait.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ int main( int argc, char **argv )
 #pragma omp parallel
  {

    #pragma omp single nowait
   #pragma omp single nowait     // NOTE the nowait
    {
      printf( " »Yuk yuk, here is thread %d from "
	      "within the single region\n", omp_get_thread_num() );
+9 −0
Changes for OpenMP/examples/tasks/basic_task_examples/00_simple_taskwait.c: 9 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -63,6 +63,9 @@ int main( int argc, char **argv )
		"running task B\n", omp_get_thread_num() );
      }

      // the taskwait instructs the encountering task to wait
      // for the completion of previously generated tasks
      // 
     #pragma omp taskwait
      fflush(stdout);
      printf(" «Yuk yuk, it is still me, thread %d "
@@ -70,8 +73,14 @@ int main( int argc, char **argv )
      
    }

    // what changes if we uncomment the followin taskyield, while
    // commenting the subsequent barrier?
    // hint: the taskwiat is about completing the tasks generated previously
    // in the parallel region by the encountering task
    // --> generated *by the encountering task*
   #pragma omp taskwait

    // a barrier is always a TSP, a task scheduling point
    //#pragma omp barrier
    
    printf(" :Hi, here is thread %d after the end "