CS 240A Lecture 3 OpenMP, MPI, and MatlabP examples - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

CS 240A Lecture 3 OpenMP, MPI, and MatlabP examples

Description:

Quick MPI, OpenMP, Matlab*P intros. Computing pi (embarrassingly) in parallel ... Matrix multiplication intro. See Yelick/Demmel s, ... – PowerPoint PPT presentation

Number of Views:70
Avg rating:3.0/5.0
Slides: 9
Provided by: johnrg5
Category:

less

Transcript and Presenter's Notes

Title: CS 240A Lecture 3 OpenMP, MPI, and MatlabP examples


1
CS 240A Lecture 3OpenMP, MPI, and MatlabP
examples
  • Cluster stuff (Viral) HW1 due Wed 4/14 (HW2
    still due 4/26)
  • Quick MPI, OpenMP, MatlabP intros
  • Computing pi (embarrassingly) in parallel
  • Matrix multiplication, intro to blocked
    algorithms

2
Hello, world in MPI
  • include ltstdio.hgt
  • include "mpi.h"
  • int main( int argc, char argv)
  • int rank, size
  • MPI_Init( argc, argv )
  • MPI_Comm_size( MPI_COMM_WORLD, size )
  • MPI_Comm_rank( MPI_COMM_WORLD, rank )
  • printf( "Hello world from process d of
    d\n", rank, size )
  • MPI_Finalize()
  • return 0

3
MPI quick intro
  • See GroppMPItutorial.ps

4
Hello, world in OpenMP
  • include ltomp.hgt
  • include ltstdio.hgt
  • int main()
  • pragma omp parallel
  • int ID omp_get_thread_num()
  • printf(" hello(d) \n", ID)
  • printf(" world(d) \n", ID)

5
OpenMP quick intro
  • See OpenMP_sc99_tutorial.pdf

6
MatlabP quick demo
  • See starpdemo.m

7
Pi by quadrature of 4/(1x2)
  • Sequential code (see pi_sequential.c)
  • OpenMP code (see pi_openmp.c)
  • MPI code (see pi_mpi.c)
  • MatlabP code (see pi_starp.m)

8
Matrix multiplication intro
  • See Yelick/Demmel slides, http//www.cs.berkeley
    .edu/yelick/cs267/lectures/03/lect03-matmul.ppt
Write a Comment
User Comments (0)
About PowerShow.com