0% found this document useful (0 votes)
56 views

Parallel Computing in Matlab: An Introduction

This document provides an overview of parallel computing in Matlab. It discusses using parallel for-loops (parfor) to offload iterations to worker processes while keeping the client free for interactive work. Batch jobs can also be used to offload work to another session. Batch parallel loops allow running a script in parallel across workers using similar commands to standard batch jobs.

Uploaded by

Shuja Shabbir
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

Parallel Computing in Matlab: An Introduction

This document provides an overview of parallel computing in Matlab. It discusses using parallel for-loops (parfor) to offload iterations to worker processes while keeping the client free for interactive work. Batch jobs can also be used to offload work to another session. Batch parallel loops allow running a script in parallel across workers using similar commands to standard batch jobs.

Uploaded by

Shuja Shabbir
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 8

Parallel Computing in Matlab

An Introduction

Overview

Offload work from client to workers

Run as many as eight workers (newest version)


Can keep client session free for interactive work

Parallel for-loops (parfor)


No iterations may depend on other iterations

No global variables may be changed in the parfor loop


There is some overhead

Using parfor

Use matlabpool open local 2 to open two workers (duo core) Use parfor like a for loop When finished, use matlabpool close

See example: Parforloop.m


See example: test.m

Batch Job

Offload work to another session

Continue using the client interactively


Requires a few more commands than parfor

Batch Job

job=batch('script_name')

wait(job)
load(job,'variable_name') destroy(job) See example three

Batch Parallel Loop


Offload work

Run in parallel

Batch Parallel Loop


job=batch('script_name','matlabpool',1)

Here we have one worker in addition to the one running the batch script for a total of two
wait(job)

load(job,'variable_name')
destroy(job)

You might also like