フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Asynchronous parallel processing when a worker is available

4 ビュー (過去 30 日間)
Azura Hashim
Azura Hashim 2017 年 3 月 19 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello,
I need to write a script that:
  1. Builds an input array for a function.
  2. When there is an available worker, assign execution of the function to the worker. Then build the input array for the next worker. If no available worker, continue building a larger array for the input.
  3. The output is added to a result array whenever a worker finishes executing the function. When a worker finishes, it executes the function for the next input array.
  4. Essentially the script keeps building an input array and sends it to a worker whenever there is one available.
Building the input array is also time consuming so that is why it needs to be done in parallel with executing the function.
Can I please get a simple example on how to write this? Otherwise please let me know if there is already an example out there. Looked at using parfeval but can't seem to get it to work is I need.
Thank you very much.

回答 (1 件)

Chinmayi Lanka
Chinmayi Lanka 2017 年 3 月 28 日
The following documentation page provides an example: https://www.mathworks.com/help/distcomp/examples/parfeval-blackjack.html
You will have to modify it a bit but it is a good starting point to understand how to use 'parfeval'

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by