• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Open MP
 

Open MP

on

  • 580 views

 

Statistics

Views

Total Views
580
Views on SlideShare
580
Embed Views
0

Actions

Likes
1
Downloads
8
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Open MP Open MP Presentation Transcript

    • Agenda
      Background
      Multiprocessing Programming
      Preference
      Programming Model
      Parallel Section
      Clauses
      Synchronization
    • Background
      Parallel has no semantic impact
      Concurrency has a substantial semantic impact
    • Background
      Symmetric Multi Processor(SMP)
      Shared Memory Multiprocessing Programming
      OpenMP
      Massively Parallel Processor(MPP)
      Message Passing Interface Programming
      MPI
    • Background
    • Multiprocessing Programming
    • Multiprocessing Programming
      General Threading Model
      Main thread executes the program’s main function
      Main thread creates subthreads, witch execute other functions in the program.
      Subthreads can also create additional threads.
    • Multiprocessing Programming
      Benefits
      Increased performance and better resource utilization
      Even on single processor systems – for hiding latency and increasing throughput
      IPC thread shared memory is more efficient
      Risk
      Increases complexity of the application
      Difficult to debug (data races, deadlocks, etc.)
    • OpenMP Preference (later VS2005)
    • OpenMP Preference (later GCC 4.2)
    • Programming Model
      Generate multi-thread code by referencing directive code
      Compiler is required to support openMP
      To eliminate synchronization and dependency
    • Programming Model
    • Parallel Section (for)
      #pragmaomp for [clause [clause …] ]
      {
      for loop
      }
    • Parallel Section (sections)
      #pragmaomp sections [clause [clause …] ] {
      [#progmaomp section]
      structured code block
      }
    • Clauses
      private(var1, …)
      to block sharing selected values with threads
      shared(var1, …)
      to share selected values with threads
      schedule(type [, chunk_size])
      to divide work with threads for equality
      static
      dynamic
    • Synchronization (critical section)
      Declaring critical section in parallel section
      Running only single thread at moment
      #pragmaomp critical [(name)]
      {
      structured code block
      }
    • https://computing.llnl.gov/tutorials/openMP/