[Paper Review] Parallel Programming with MatlabMPI
This paper presents MatlabMPI, a lightweight, pure-Matlab implementation of the MPI standard that uses file I/O to enable parallel programming in MATLAB across shared and distributed memory systems. It achieves near-identical bandwidth to C-based MPI for large messages and demonstrated a speedup of over 64 on 64 processors in an image filtering application, proving the viability of MPI-like parallelism in MATLAB with minimal code overhead.
MatlabMPI is a Matlab implementation of the Message Passing Interface (MPI) standard and allows any Matlab program to exploit multiple processors. MatlabMPI currently implements the basic six functions that are the core of the MPI point-to-point communications standard. The key technical innovation of MatlabMPI is that it implements the widely used MPI ``look and feel'' on top of standard Matlab file I/O, resulting in an extremely compact (~100 lines) and ``pure'' implementation which runs anywhere Matlab runs. The performance has been tested on both shared and distributed memory parallel computers. MatlabMPI can match the bandwidth of C based MPI at large message sizes. A test image filtering application using MatlabMPI achieved a speedup of ~70 on a parallel computer.
Motivation & Objective
- To enable efficient parallel execution of MATLAB programs on multi-processor systems using a widely adopted communication model.
- To overcome the lack of widespread adoption of previous MATLAB parallelization solutions by leveraging the de facto standard MPI interface.
- To provide a portable, minimal, and fully compatible MPI-like interface within the MATLAB environment using only standard file I/O operations.
- To demonstrate that MATLAB programs can achieve high performance and strong scaling in embarrassingly parallel workloads through a lightweight, pure-MATLAB implementation.
Proposed method
- Implementing a subset of the MPI point-to-point communication standard using only standard MATLAB file I/O operations.
- Mapping MPI function calls (e.g., MPI_Send, MPI_Recv) to file-based message passing, where messages are written to and read from shared directories.
- Using a shared directory accessible to all nodes as the communication medium, eliminating the need for low-level system calls or external libraries.
- Designing the system to be fully portable across all platforms where MATLAB runs, relying only on standard MATLAB functionality.
- Optimizing message handling to minimize latency overhead and maximize bandwidth for large messages.
- Validating the implementation on a shared-memory SGI Origin2000 system and comparing performance to C-based MPI.
Experimental results
Research questions
- RQ1Can a pure-MATLAB implementation of MPI be both efficient and portable across diverse computing platforms?
- RQ2How does the performance of file-I/O-based MPI compare to native C-based MPI, especially for large message sizes?
- RQ3Can MATLAB applications achieve strong speedup in embarrassingly parallel workloads using this file-based MPI abstraction?
- RQ4To what extent does the use of file I/O as a communication mechanism affect latency and bandwidth in parallel MATLAB programs?
- RQ5Can the MPI model be effectively adapted to MATLAB without requiring low-level system access or compiler extensions?
Key findings
- MatlabMPI achieves bandwidth performance comparable to C-based MPI for large messages (e.g., ~1 MB), demonstrating that file I/O can be a viable communication mechanism at scale.
- The implementation achieves a speedup of over 64 on 64 processors in a 2D image filtering application, with super-linear speedup observed due to improved cache utilization.
- Latency in MatlabMPI is approximately 35 milliseconds per message, which is significantly higher than C MPI, but this is acceptable for coarse-grained parallel applications.
- The system is extremely compact, with only around 100 lines of code, and runs on any platform where MATLAB is installed, ensuring broad portability.
- The use of file I/O enables advanced features such as large buffer support, message recording, multicasting, and one-sided communication with minimal additional complexity.
- The approach is extensible and could be adapted to other scripting languages like Python, IDL, or Perl, suggesting broader applicability beyond MATLAB.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.