| 
        Introduction
       | 
      
        
        
        Shared-memory parallel programs break up large problems into a number of smaller ones and execute them simultaneously 
 
        
        OpenMP programs are limited to a single physical machine 
 
        
        OpenMP libraries are built into all commonly used C, C++, or Fortran compilers 
 
        
         
       | 
    
  
  
  
    
      | 
        A Parallel Hello World Program
       | 
      
        
        
        OpenMP pragmas direct the compiler what to parallelize and how to parallelize it. 
 
        
        By using the environment variable OMP_NUM_THREADS, it is possible to control how many threads are used. 
 
        
        The order in which parallel elements are executed cannot be guaranteed. 
 
        
        A compiler that isn’t aware of OpenMP pragmas will compile a single-threaded program. 
 
        
         
       | 
    
  
  
  
    
      | 
        OpenMP Work Sharing Constructs
       | 
      
        
        
        Data parallelism refers to the execution of the same task simultaneously on multiple computing cores. 
 
        
        Functional parallelism refers to the concurrent execution of different tasks on multiple computing cores. 
 
        
         
       | 
    
  
  
  
    
      | 
        Parallel Operations with Arrays
       | 
      
        
        
        With the parallel for pragma, a loop is executed in parallel 
 
        
        When a variable is accessed by different threads, incorrect results can be produced. 
 
        
        Each thread receives a copy of the variable created by the private clause 
 
        
         
       | 
    
  
  
  
    
      | 
        Race Conditions with OpenMP
       | 
      
        
       | 
    
  
  
  
    
      | 
        OpenMP Tasks
       | 
      
        
        
        OpenMP can manage general parallel tasks 
 
        
        tasks now allow the parallelization of applications exhibiting irregular parallelism such as recursive algorithms, and pointer-based data structures. 
 
        
         
       | 
    
  
  
  
    
      | 
        Calculating Many-Body Potentials
       | 
      
        
       | 
    
  
  
  
    
      | 
        Programming GPUs with OpenMP
       | 
      
        
       | 
    
  
  
  
    
      | 
        Introduction to GPU Programming with OpenACC
       | 
      
        
       |