フィルターのクリア

Using NET Assembly in parallel pool/ worker/ parfeval

1 回表示 (過去 30 日間)
Ronron
Ronron 2017 年 2 月 16 日
回答済み: Ronron 2017 年 2 月 21 日
I would like to pass an object from a class of a NET Assymbly in a parallel pool by executing the function via parfeval. I always get the following error.
"Warning: Cannot load an object of class 'MAPort': No matching constructor signature found."
I already tried the following things.
First I loaded the NET Assembly by usind spmd ... end
spmd
try
NET.addAssembly('dSPACE.HILAPI.MAPort');
import ASAM.HILAPI.dSPACE.MAPort.*;
catch e
error(e.message)
end
end
Secondly I tried to load the library by calling parfevalForALL.
F2 = parfevalOnAll(@loadNetAssembly,0);
function loadNetAssembly()
try
NET.addAssembly('dSPACE.HILAPI.MAPort');
import ASAM.HILAPI.dSPACE.MAPort.*;
catch e
error(e.message);
end
I also tried to import the classes everywhere. And after trying a lot yesterday it worked. But today it didn't work again and I didn't change the code. So I really don't know whats the right way. Can anyone help?

回答 (1 件)

Ronron
Ronron 2017 年 2 月 21 日
I can answer to my question myself. Actually the problem is the specific NET Assembly that I wanted to use in the parallel pool. I just found out, that the ASAM.HILAPI does not support multithreading in Matlab. So it is a specific problem according to the Assmebly.

カテゴリ

Help Center および File ExchangeAsynchronous Parallel Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by