OpenMP I
摘要
The Open Multi-Processing library (OpenMP) is an open-source library that provides simple extensions to allow multi-threaded programming in C/C++ and Fortran. OpenMP is structured largely around the use of compiler directives to enable, disable, and modify parallel subsections of otherwise serial code. The main difference between OpenMP and MPI is that an OpenMP program runs as a single process on the operating system, and so all the threads within the program have access to a single memory space. This chapter introduces OpenMP, first showing how to include the library and build executables that use it, then continuing with how to use the compiler directives to control and refine the parallel regions, and finishing up with variable scoping and reduction operations.