Using DLL functions with parfeval
Mostrar comentarios más antiguos
Hello Everybody,
I have a script which does basically the following:
loadlibrary('myDLL','myHEADER')
p=parpool(2)
f=parfeval(p,@myFunction,numout,inputs...)
However, the DLL 'myDLL' is not known if I use calllib in myFunction. When I am using myFunction without parfeval, everything is fine. So I assume that I need to declare myDLL as input in parfeval or make it somehow global.
Using calllib in myFunction is not an option since it is too time consuming. I also do not use any unloadlibrary before using parfeval.
Thanks in advance
Alexander
Respuesta aceptada
Más respuestas (1)
Ronron
el 15 de Feb. de 2017
Hello, I would like to use classes from a NET assemby in parfeval. But I get the error
"Warning: Cannot load an object of class 'MAPort': No matching constructor signature found."
I tried the following.
p = parpool(2);
% execute loadlibrary on all workers:
spmd
try
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.*;
catch e
error(e.message)
end
end
F = parfeval(@batchTest,0, myview);
The object myview consits of an object of the type MAPort, so that the object can't be loaded. How can I solve the problem? I would appreciate any help!
Thanks, Ronja
1 comentario
Titus Edelhofer
el 17 de Sept. de 2018
Hi Ronja,
I understand the NET.addAssembly works on your MATLAB Client? In this case it's probably a path problem, i.e., your "normal" MATLAB has the .NET dll located on the path, your workers don't ...
Titus
Categorías
Más información sobre Parallel Computing Fundamentals en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!