MATLAB Answers

0

Matlab on AWS doesn't seem to recognize (@)Class-folders

Sander Groeneweg さんによって質問されました 2018 年 10 月 17 日
最新アクティビティ Sander Groeneweg さんによって 編集されました 2018 年 10 月 18 日
Hi,
I recently started working with the Parallel Computing Toolbox and now I want to extend the performance by using the AmazonWebServices. For simple scripts this works fine already.
Now I want to segment some neuroimaging data using the SPM12-toolbox. Parallel-Computing on my local computer doesn't cause any problems, but when use AWS, I get the following Error:
"An UndefinedFunction error was thrown on the workers for 'list'. This might be because the file containing 'list' is not accessible on the workers. Use addAttachedFiles(pool, files) to specify the required files to be attached. For more information see the documentation for 'parallel.Pool/addAttachedFiles'.
... Caused by: Undefined function 'list' for input arguments of type 'cell'."
The function "list" is located in a class folder "@foldername". When I copy "list" into a path folder, "list" is recognized and I get an error for the function "match", which is located in another class folder. However, when I put every function into a single path folder SPM12 crashes (they must have had a reason to do this). So that doesn't seem to be a solution.
addAttachedFiles(gcp,{'C:\...\@foldername\list.m'}) doesn't add "list" to AWS either.
Does anybody know a workaround for this problem?
Best regards, Sander

  0 件のコメント

サインイン to comment.

1 件の回答

回答者: Philip Borghesani 2018 年 10 月 17 日

You must add the complete @foldername folder. The clue here is Caused by: Undefined function 'list' for input arguments of type 'cell'." Your class was not correctly copied to the worker machines (most likely because the constructor was not found) and was converted to a structure.

  1 件のコメント

Sander Groeneweg 2018 年 10 月 18 日
Unfortunately I still get the same error message:
"Error using cfg_repeat/list (line 112) An UndefinedFunction error was thrown on the workers for 'list'. This might be because the file containing 'list' is not accessible on the workers. Use addAttachedFiles(pool, files) to specify the required files to be attached. For more information see the documentation for 'parallel.Pool/addAttachedFiles'.
Caused by: Undefined function 'list' for input arguments of type 'cell'."
As you recommended I added the @foldernames via
addAttachedFiles(gcp,{'C:\...\@foldername'})
resulting in gcp:
Attached files for parallel pool:
C:\Program Files\MATLAB\spm12\spm12\matlabbatch\@cfg_branch
C:\Program Files\MATLAB\spm12\spm12\matlabbatch\@cfg_choice
C:\Program Files\MATLAB\spm12\spm12\matlabbatch\@cfg_const
C:\Program Files\MATLAB\spm12\spm12\matlabbatch\@cfg_dep
C:\Program Files\MATLAB\spm12\spm12\matlabbatch\@cfg_entry
C:\Program Files\MATLAB\spm12\spm12\matlabbatch\@cfg_exbranch
C:\Program Files\MATLAB\spm12\spm12\matlabbatch\@cfg_files
C:\Program Files\MATLAB\spm12\spm12\matlabbatch\@cfg_intree
C:\Program Files\MATLAB\spm12\spm12\matlabbatch\@cfg_inv_out
C:\Program Files\MATLAB\spm12\spm12\matlabbatch\@cfg_item
C:\Program Files\MATLAB\spm12\spm12\matlabbatch\@cfg_leaf
C:\Program Files\MATLAB\spm12\spm12\matlabbatch\@cfg_mchoice
C:\Program Files\MATLAB\spm12\spm12\matlabbatch\@cfg_menu
C:\Program Files\MATLAB\spm12\spm12\matlabbatch\@cfg_repeat

サインイン to comment.



Translated by