Java MPI in MATLAB*P - PowerPoint PPT Presentation

About This Presentation
Title:

Java MPI in MATLAB*P

Description:

Java functions operate on double[] buffers. Conversion is done automagically. Pass-by-value across the Java-MATLAB interface, so methods return buffers ... – PowerPoint PPT presentation

Number of Views:32
Avg rating:3.0/5.0
Slides: 15
Provided by: maxgo4
Learn more at: http://web.mit.edu
Category:
Tags: matlab | mpi | buffers | java | reserved

less

Transcript and Presenter's Notes

Title: Java MPI in MATLAB*P


1
Java MPI in MATLABP
  • Max Goldman Da Guo

2
Overview
  • Allow nodes to communicate during mm mode
    computation
  • Implement MPI primitives in Java
  • Interface to these methods in MATLABP
  • Why Java?
  • MATLAB already runs a JVM
  • Java well suited to network programming

3
Results
  • Basic implementation that works
  • And some not-so-basic things that work
  • Performance looks promising
  • Error handling needs improvement
  • Some quirks

4
Basic Architecture
5
Creating the Network
10.0.0.1 10.0.0.2
  • Problem each node needs to know every other IP
    address
  • One-time communication through frontend
  • Each node opens a socket to every other node

10.0.0.110.0.0.2
6
Passing Data
  • Java functions operate on double buffers
  • Conversion is done automagically
  • Pass-by-value across the Java-MATLAB interface,
    so methods return buffers
  • In MPI spec, functions take output pointers
  • Everything comes back as a column!
  • Didnt want to add another wrapper, so users must
    use columns or reshape themselves

7
Making the Call
  • mmpi(fname, varargin)
  • Function fname can contain MPI calls
  • Will be passed directly to mm()
  • Forces MPI to be separated from p code
  • Eliminates confusion due to e.g. different
    indexing
  • Can use mmpi() any number of times
  • Function does not have to go all the way from
    init to fnlz

8
Making the Call Part II
  • Inside mmpi
  • First check network, build if needed
  • Thenpasscontrolto mm

function result simpletest(arg) import
mpi. MPI.init if MPI.COMM_WORLD.rank 0
data 42 MPI.COMM_WORLD.send(data, 1, 1,
13) result 0 elseif MPI.COMM_WORLD.rank
1 got MPI.COMM_WORLD.recv(1, 0, 13) result
got(1) end MPI.fnlz
  • Quirks

9
MPI Functions (Methods)
  • Class MPI
  • init and fnlz finalize reserved in Java
  • Class Comm (MPI.COMM_WORLD)
  • send basic send
  • recv basic receive
  • bcast
  • reduce
  • scatter
  • gather
  • scan uses parallel prefix

10
Tests
  • Calculate the sum of numbers 1--40000

11
Tests (cont.)
  • Find the approximate value of Pi

12
Tests (cont.)
  • Find maximum value in 40000 random numbers

13
Tests (cont.)
  • Scan example

14
Demo
Write a Comment
User Comments (0)
About PowerShow.com