MP2: further directions and tips - PowerPoint PPT Presentation

View by Category
About This Presentation
Title:

MP2: further directions and tips

Description:

MP2: further directions and tips. Useful for everyone, irrespective of which ... Let the system map cells to processors. Use the array reduction library to add ... – PowerPoint PPT presentation

Number of Views:10
Avg rating:3.0/5.0
Slides: 6
Provided by: laxmika
Learn more at: http://charm.cs.uiuc.edu
Category:
Tags: directions | further | map | mp2 | tips

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: MP2: further directions and tips


1
MP2 further directions and tips
  • Useful for everyone, irrespective of which
    paradigm you are using

2
Shared memory Pthreads
  • Race conditions
  • What is a race condition e.g. when two different
    outcomes are possible (typically, one unintended)
    depending on which processor gets there first
  • Eliminate using mutual exclusion primitives
    (locks)
  • Deadlocks
  • Two (or more) processes waiting for each other
  • E.g.
  • Process1 lock(A), lock(B) work unlock(A)
    unlock(B)
  • Process2 lock(B), lock(A) work unlock(A)
    unlock(B)
  • How to avoid order the locks

3
Shared memory Pthreads
  • In the molecular dynamics MP
  • decide which iterations to assign to processors
  • I.e. how to group them
  • You must use number of threads number of
    processors
  • requirement (may be artificial requirement, but
    there are reasons why)

4
MPI
  • Number of processes number of processors
  • Assume there are many more cells than processors
  • Decide which processes will work on which cells
  • How to represent the local cells?
  • How to implement communication
  • who sends what data to whom?
  • Initial broadcast of parameters
  • In each step use MPI s reduce functions to add
    up energies.

5
Charm
  • Use chare arrays to implement cells
  • Let the system map cells to processors
  • Use the array reduction library to add up
    energies
  • Example new jacobi-skeleton program with
    reduction
  • Use readonly variables (struct) to store params
About PowerShow.com