Worker unable to find mex file

5 ビュー (過去 30 日間)
Maria
Maria 2021 年 10 月 1 日
コメント済み: Raymond Norris 2021 年 10 月 5 日
Hi,
I am making some tests with Matlab Parallel Server. I am trying the interactive mode, and I have a function with a parfor. Inside this parfor, there is a mex file. The remote cluster I use has Linux, and the mex files have been created in Linux. The client where I am running Matlab is Windows.
When I try running the file, I get the following error:
Worker unable to find file.
and the name of the mex file. I was reading that the best is to have a networked file share which the worker machines can access. I have placed the mex file in this networked file share, but I get the same error. When I tried running mex files in a parfor directly under Linux, I did not have this problem. Do I need to do something specific when I am running from a Windows client?

採用された回答

Raymond Norris
Raymond Norris 2021 年 10 月 2 日
I'm assuming you are using parpool? How are you setting the worker's path on the Linux cluster to find the MEX-file? One option is to use pctRunOnAll.
  6 件のコメント
Maria
Maria 2021 年 10 月 5 日
So, fixed it!
I did like this
job1 = batch(c,@myFunction,1,{inputs },'Pool',N-1,'CurrentFolder','.','AutoAddClientPath',false,'AdditionalPaths',ap,'AttachedFiles',{'file1.mexa64' 'file2.mexa64'});
The fields
'CurrentFolder','.','AutoAddClientPath',false,
Are there because the client is windows but the cluster is in Linux, I wanted to be sure that the paths were not messed up.
The 'AdditionalPaths' uses
ap = {'/data_matlab/maria/myfolder/'};
And this
'AttachedFiles',{'file1.mexa64' 'file2.mexa64'}
solved the issue with the mex.
Raymond Norris
Raymond Norris 2021 年 10 月 5 日
Correct. That's because on your client, the client is looking for and attaching file1.dll. It's unaware that MATLAB will be running on Linux. You're approach to attach the mexa64 is the right way.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Parallel Server についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by