字符串匹配:使用Wait时进入无限循环(作业,'完成#39;)

时间:2014-04-22 00:36:15

标签: 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)


matches = fetchOutputs(job1);

Caused by:

    Error using feval

    Undefined function handle.

代码

% 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);

1 个答案:

答案 0 :(得分:0)

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

我认为问题在于它没有将boyer_horsepool识别为函数。没有更多的背景,很难做任何进一步的事情。尝试将该函数移动到相同的.m文件中,并仔细检查拼写和参数计数。

另外,尝试getAllOutputArguments(job1)。这是一个很长的镜头,但它可能会奏效。

祝你好运!

相关问题