80 likes | 300 Views
An Introduction. Parallel Computing in Matlab. 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
E N D
An Introduction Parallel Computing in Matlab
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)