What is OpenMP?

What is the high level description of OpenMP?

The Wikipedia article reads: “OpenMP (Open Multi-Processing) is an application programming interface (API) that supports multi-platform collaborative multi-processor memory programming in C, C ++ and Fortran on many architectures, including Unix and Microsoft Windows platforms. It consists of a set of compiler directives, library routines, and environment variables that affect runtime behavior. " What?

How does it compare to other concurrency approaches like threads, thread pools and job theft?

+3
source share
1 answer

C/++ , (, , ) .

, . :

# pragma omp parallel \
  shared ( n, x, y ) \
  private ( i ) \
  reduction ( + : xdoty )

# pragma omp for

  for ( i = 0; i < n; i++ )
  {
    xdoty = xdoty + x[i] * y[i];
  }
+2

Source: https://habr.com/ru/post/1760587/


All Articles