Parallel processing 字符串匹配:使用Wait(作业“已完成”)时进入infinte循环

Parallel processing 字符串匹配:使用Wait(作业“已完成”)时进入infinte循环,parallel-processing,matlab,Parallel Processing,Matlab,我正在使用MATLAB PCT对字符串匹配算法进行并行化。我正在使用createJob和几个任务,其中我正在传递要搜索的文本、模式和其他参数。我得到以下错误。任何想法。任务目标的boyer_horsepool函数看起来不错 Error using parallel.Job/fetchOutputs (line 677) An error occurred during execution of Task with ID 1. Error in stringmatch (line 42)

我正在使用MATLAB PCT对字符串匹配算法进行并行化。我正在使用createJob和几个任务,其中我正在传递要搜索的文本、模式和其他参数。我得到以下错误。任何想法。任务目标的boyer_horsepool函数看起来不错

Error using parallel.Job/fetchOutputs (line 677)


An error occurred during execution of Task with ID 1.

Error in stringmatch (line 42)


matches = fetchOutputs(job1);

Caused by:

    Error using feval

    Undefined function handle.
代码


嗯,我可能错了,但看起来你的语法很好

我认为问题在于它没有将博伊尔·胡斯普尔(boyer_horsepool)视为一个函数。如果没有更多的背景,很难做进一步的事情。尝试将该函数移动到同一个.m文件中,并仔细检查拼写和参数计数

另外,请尝试getAllOutputArgumentsjob1。这是一个很长的机会,但它可能会工作


祝你好运

确切地说,它没有识别boyer_horsepool函数。我已将所有函数放置在本地。在createTask外部(即不在createTask内部)进行的函数调用工作正常。无论如何,我也会试着利用你的线索。
% create the job 

parallel.defaultClusterProfile('local');
cluster = parcluster(); 
job1 = createJob(cluster);

% create the tasks

for index = 1: num_tasks

    ret = createTask(job1, @boyer_horsepool, 1, {haystack, needle, nlength, startValues(index), endValues(index)});

    fprintf('For index %d the crateTask value is ?\n',index); 

    disp(class(ret));

    %disp(ret);

end

% Submit and wait for the results
submit(job1);       
wait(job1);

% Report the number of matches    
matches = fetchOutputs(job1);

delete(job1);