Parallel running coroutines in Matlab

8 ビュー (過去 30 日間)
D. Plotnick
D. Plotnick 2018 年 4 月 24 日
コメント済み: D. Plotnick 2018 年 4 月 29 日
Hello, I am wondering if there is any way to get a functional co-routine in Matlab, a function that runs alongside another script. The example here is that I have a loop that pulls a subset of large set of data off of the hard drive into active memory and performs operations on it (largely on the GPU), and then saves image products, again to the hard drive. The hard drive read/write operations are fairly slow, so one way to improve performance would be to have the read/write routines running simultaneously as the intermediate operations; writing a finished data subset to one drive while processing the current data subset on the GPU while loading the next subset from another drive.
One could imagine other cases where running multiple functions in parallel would also be of benefit, if they do not need to be performed in a pipeline.
Is this possible in Matlab? Either "legitimately" or using some kludged combination of feval and cellfun?

採用された回答

Joss Knight
Joss Knight 2018 年 4 月 28 日
This is one of the major purposes of the Parallel Computing Toolbox. Start by taking a look at the documentation for Asynchronous Parallel Programming.
  1 件のコメント
D. Plotnick
D. Plotnick 2018 年 4 月 29 日
Helpful as always Joss. This is exactly what I was looking for. I was aware of 'parfor' and the GPU related portions of the PCT, but somehow missed this capability. Cheers! -Dan

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGPU Computing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by