How to use .jar in parfor with windows client and linux workers (R2017a)?

2 次查看(过去 30 天)
Hello,
I test R2017a cluster. Client is Windows machine. Workers is Linux (Mint and Ubintu). I have an error when import .jar inside parpool:
1. Start cluster (with attaching *.jar):
if isempty(gcp('nocreate')), parpool('MJSP17', 'SpmdEnabled', false, 'AttachedFiles', {'RCaller-2.1.1.jar'}); end
2. Call import java-class on all workers:
pctRunOnAll javaaddpath 'RCaller-2.1.1.jar';
2-nd step generate warnings (also for all workers):
Warning: Invalid file or directory
'/var/lib/mdce/mm-mskuo-002_mm-mskuo-002_worker01_mlworker_log/matlab/work/RCaller-2.1.1.jar'.
> In javaclasspath>local_validate_dynamic_path (line 271)
In javaclasspath>local_javapath (line 187)
In javaclasspath (line 124)
In javaaddpath (line 71)
Warning: Invalid file or directory
'/var/lib/mdce/mm-mskuo-002_mm-mskuo-002_worker02_mlworker_log/matlab/work/RCaller-2.1.1.jar'.
> In javaclasspath>local_validate_dynamic_path (line 271)
In javaclasspath>local_javapath (line 187)
In javaclasspath (line 124)
In javaaddpath (line 71)
Warning: Invalid file or directory
'/var/lib/mdce/mm-mskuo-002_mm-mskuo-002_worker03_mlworker_log/matlab/work/RCaller-2.1.1.jar'.
Trying to get attached folder gives an error:
folder = getAttachedFilesFolder;
Warning: Unexpected error trying to invoke getAttachedFilesFolder.
> In getAttachedFilesFolder (line 136)
How to use .jar in parfor with heterogeneous cluster (windows client and linux workers) in MATLAB R2017a?
All those steps (1-2) work properly if I use Linux client and Linux workers.
Thank you!

采纳的回答

Jonas
Jonas 2017-6-1
I solve this problem (in two steps):
1. Project path have to be absolute ( C:\Projects\Project1), but not UNC syntax ( \\client_name\Projects\Project1);
2. *.jar-file have to be in the root project folder ( C:\Projects\Project1\RCaller-2.1.1.jar), but not in subfolder ( C:\Projects\Project1\rcaller\RCaller-2.1.1.jar). Even if all subfolders are added as pathes ( addpath('rcaller')).
I hope it helps to somebody.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Parallel Computing Fundamentals 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by