LabWindows/CVI

Content Type
Programming Language
Current manual

sections Directive

sections Directive

Specifies that the region contains sections of code to divide among the threads. The threads then execute their assigned sections of code.

Binding thread set: current team

Format

#pragma omp sections [clause[ [,]clause] ..] newline
   {
      #pragma omp section
      {
         code block
      }
   }

Example

int main()
{
   #pragma omp parallel
      {
         #pragma omp section
         printf("This is from thread %d\n", omp_get_thread_num());
         #pragma omp section
         printf("This is from thread %d\n", omp_get_thread_num());
      }
}

In This Section
Was this information helpful?