我正在尝试在大型集群上运行并行作业;所有代码和功能在我的计算机上都可以正常工作(Mac OS 10.7 和 Matlab v7.13.0.564 (R2011b)),但是集群上有些东西不起作用(unix-redhat 5.5 - kernel = 2.6.18-238.12.1.el5 Matlab v7.13.0.564 (R2011b)
以下是在我的机器上正常运行但在集群上失败的命令序列。该函数add2nums
位于子目录./lib
中,并且也在下面记录。
function out = add2nums(num1, num2)
out = num1+num2;
end
发生了什么事,我该如何解决?
>> addpath('./lib')
>> which add2nums
/My_Matlab_Path/lib/add2nums.m (matlab sees the function on my machine and on unix cluster)
>> sched = findResource('scheduler','type','local');
>> job = createParallelJob(sched,'configuration','local');
>> task = createTask(job,@add2nums,1,{[1 2],[3 4]},'CaptureCommandWindowOutput',true);
>> addpath('./lib')
>> submit(job)
>> waitForState(job)
>> task
task =
Task ID 1 from Job ID 19 Information
====================================
State : finished
Function : @add2nums
StartTime : Tue Aug 07 10:27:44 MDT 2012
Running Duration : 0 days 0h 0m 1s
- Task Result Properties
ErrorIdentifier : MATLAB:UndefinedFunction
ErrorMessage : Undefined function 'add2nums' for input arguments of type 'double'.