필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
Jonas
Jonas 2017년 6월 1일
답변: Jonas 2017년 6월 1일
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