Parallel Computing: Execute GUI and programm parallel

3 ビュー (過去 30 日間)
Ronron
Ronron 2017 年 1 月 19 日
コメント済み: Walter Roberson 2017 年 2 月 15 日
Hello, I would like to start a GUI (GUIDE) and parallel execute another job. Is there any solution how to realise that problem. When I start the GUI for example in a parfor no User-Interface pops up.

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 1 月 19 日
It is not possible to do graphics from inside a worker.
There is a demonstration around, written by one of the Mathworks people, that deals with collecting results from multiple workers as they come in, and graphing the results. Unfortunately I do not seem to find that at the moment. It might have used parfeval.
The point is that with some care you can transfer data back to a controlling routine that plots data that has been generated by the workers; however, it does not allow multiple workers to draw graphics.
  6 件のコメント
Ronron
Ronron 2017 年 2 月 15 日
That means calling parfevalOnAll before calling the actual function?
I tried the following.
T = parfevalOnAll(@loadNetAssembly,0);
try
import ASAM.HILAPI.dSPACE.MAPort.*;
import ASAM.HILAPI.Implementation.Common.ValueContainer.*;
catch e
error(e.message)
end
F = parfeval(@batchTest,0, myview);
And the function loadNetAssembly looks the following.
function loadNetAssembly()
NET.addAssembly('dSPACE.HILAPI.MAPort');
NET.addAssembly('dSPACE.HILAPI.Common');
NET.addAssembly('ASAM.HILAPI.Implementation');
NET.addAssembly('ASAM.HILAPI.Interfaces');
import ASAM.HILAPI.dSPACE.MAPort.*;
import ASAM.HILAPI.Implementation.Common.ValueContainer.*;
I still get the same error. Sorry if I didn't unserstand it right.
Walter Roberson
Walter Roberson 2017 年 2 月 15 日
I am not familiar with how NET and import works, sorry. Perhaps you need to attach files to the pool ? https://www.mathworks.com/help/distcomp/addattachedfiles.html

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by