Speeding up MATLAB and Simulink Applications 2009 The MathWorks, Inc. Customer Tour 2009
Today s Schedule Introduction to Parallel Computing with MATLAB and Simulink Break Master Class on Speeding Up MATLAB OR Master Class on Optimizing Simulation Performance in Simulink 2
Large Problems and Large Data Find new cancer therapies High-quality 3-D images of protein complexes Millions of projections Schematic of the 26S proteasome. Working on this problem for 10 years Computational Biology 3
Large Problems and Large Data Optimize stock portfolios High-fidelity simulations of risk-return relationship Thousands of stocks Millions of time points Data is too large for desktop computer Computational Finance 4
High-Performance Hardware is Available GPGPU, FPGA Single processor Multicore Multiprocessor Cluster Grid, Cloud 5
Grids and Clouds Offer Dynamic, Large-Scale Resources Cloud computing Resizable compute capacity Grid computing Sharing computing and storage resources 6
Parallel Computing with MATLAB Goals Simple and portable Straightforward speed up of users programs Interactive programming Portable code Scalable Deployable Integrated into organization s infrastructure 7
MATLAB Pool Extends Desktop MATLAB Worker Worker Worker TOOLBOXES BLOCKSETS Worker Worker Worker Worker Worker 8
Programming Parallel MATLAB Applications Level of control Level of effort Minimal None Some Straightforward Extensive Extensive 9
Programming Parallel MATLAB Applications Level of effort None Support built into Toolboxes and Blocksets: Optimization Toolbox Genetic Algorithm and Direct Search Toolbox SystemTest Real Time Workshop Simulink Design Optimization Straightforward Extensive 10
Example: Built-in Support for Parallelism in Other Tools Use built-in support for Parallel Computing Toolbox in Optimization Toolbox Optimize in parallel using fmincon Use pool of MATLAB workers 11
Example: Built-in Support for Parallelism in Other Tools Use built-in support for Parallel Computing Toolbox in Simulink Design Optimization Parameter estimation of a model in parallel Use pool of MATLAB workers 12
Programming Parallel MATLAB Applications Level of effort None Support built into Toolboxes and Blocksets: Optimization Toolbox Genetic Algorithm and Direct Search Toolbox SystemTest Real Time Workshop Simulink Design Optimization Straightforward Extensive 14
Long Computations with Independent Tasks Task Parallelism Task 1 Task 2 Task 3 Task 4 Time Time 15
Example: Multiple Independent Simulations Stochastic simulations of model Use pool of MATLAB workers Convert for to parfor 16
Speed up of MATLAB Programs Max Planck Institute Find new cancer therapies High-quality 3-D images of protein complexes Millions of projections Simulations run on 64 MATLAB workers "Parallel Computing Toolbox enabled us to speed up our processing by 20 to 30 times. We were able to use our cluster from MATLAB without having to be experts in parallel programming or having to learn another programming language." Andreas Korinek Max Planck Institute of Biochemistry 17
Programming Parallel MATLAB Applications Level of effort None Support built into Toolboxes and Blocksets Straightforward Simple programming constructs: parfor Extensive 18
Large Data Problems 11 26 41 12 27 42 13 28 43 14 29 44 15 30 45 16 31 46 17 32 47 17 33 48 11 26 41 12 27 42 13 28 43 19 34 49 20 35 50 21 36 51 22 37 52 19
Large Data Problems Data Parallelism 11 26 41 12 27 42 13 28 43 14 29 44 15 30 45 16 31 46 17 32 47 17 33 48 19 34 49 20 35 50 21 36 51 22 37 52 11 26 41 12 27 42 13 28 43 14 29 44 15 30 45 16 31 46 17 32 47 17 33 48 19 34 49 20 35 50 21 36 51 22 37 52 20
Example: Multiple Independent Simulations Use pool of MATLAB workers Distribute data across computers Run functions and matrix operations in parallel 21
Programming Parallel MATLAB Applications Level of effort None Support built into Toolboxes and Blocksets Straightforward Simple programming constructs: parfor distributed array spmd Extensive Full control of parallelization: job and task MATLAB and MPI 22
Parallel Computing with MATLAB Goals Simple and portable Scalable Support parallelism on desktop Treat large resources as extensions of desktop Deployable Integrated into organization s infrastructure 23
Run 8 Local Workers on Desktop Parallel Computing Toolbox Desktop Computer Parallel Computing Toolbox 24
Scale up with No Code Changes MATLAB Distributed Computing Server Computer Cluster Desktop Computer MATLAB Distributed Computing Server Parallel Computing Toolbox Scheduler 25
Extend Desktop to the Grid and Cloud Desktop Computer Parallel Computing Toolbox 26
I wrote and debugged my program by using multiple MATLAB workers on a workstation. I then ran it on the EGEE Grid and reduced computation time from 5 days to just 6 hours. Pavel Ivanov Optics Group, University of Bristol 27
Example: Multiple Independent Simulations on Amazon EC2 Stochastic simulations of model Use pool of MATLAB workers Convert for to parfor 28
Parallel Computing with MATLAB Goals Simple and portable Scalable Deployable Simple path from development to enterprise systems Integrated into organization s infrastructure 29
Deployment of MATLAB Applications Parallel q Share application with others who do not use MATLAB Standalone executables or components (C++, Java, C#, etc.) Royalty-free distribution Oil Exploration PTG shaker rig. MRI imaging 30
Oil Exploration PTG shaker rig. MRI imaging 31
Parallel Computing with MATLAB Goals Simple and portable Scalable Deployable Integrated into organization s infrastructure Dynamic licensing Support for third-party schedulers 32
Licensing Parallel Computing Tools Desktop Computer Parallel Computing Toolbox Cluster, Grid or Cloud MATLAB Distributed Computing Server Scheduler 33
Licensing MATLAB Distributed Computing Server Only product required on cluster All-product installation Cluster, Grid or Cloud MATLAB Distributed Computing Server One license key per worker Not per core, processor, Scheduler Available in worker packs of 8, 16, 32, 64, 34
Dynamic Licensing Access by Multiple Users Users have access to their licensed products Cluster, Grid or Cloud MATLAB Distributed Computing Server Cluster is extension of desktop Can exit MATLAB after submitting work Scheduler 35
Support for Schedulers Integrated with product MathWorks job manager Supported by product Platform LSF Windows HPC Server 2008 (and CCS 2003) PBS family PBS Professional TORQUE Open API for other schedulers Sun Grid Engine glite 36
Works on all Platforms Supported by MATLAB 37
Parallel Computing with MATLAB Simple and portable Straightforward program speed up Interactive parallel programming Portable code Deployable Simple path from development to enterprise systems Scalable Support parallelism on desktop Treat large resource as extensions of desktop Integrated into organization Dynamic licensing Support for third-party schedulers 38
Today s Schedule Introduction to Parallel Computing with MATLAB and Simulink Break Master Class on Speeding Up MATLAB OR Master Class on Optimizing Simulation Performance in Simulink 39
2009 The MathWorks, Inc. Customer Tour 2009