0

我正在尝试使用并行工具箱在 matlab 上计算大矩阵的特征值。我第一次尝试:

 A = rand(10000,2000);
A = A*A';
matlabpool open 2
spmd
    C = codistributed(A);
    tic
    [V,D] = eig(C);
    time = gop(@max, toc) % Time for all labs in the pool to complete.  
end
matlabpool close

代码开始执行:

Starting matlabpool using the 'local' profile ... connected to 2 labs.

但是,几分钟后,我收到以下错误:

Error using distcompserialize
Out of Memory during serialization

Error in spmdlang.RemoteSpmdExecutor/initiateComputation (line 82)
                fcns  = distcompMakeByteBufferHandle( ...

Error in spmdlang.spmd_feval_impl (line 14)
    blockExecutor.initiateComputation();

Error in spmd_feval (line 8)
        spmdlang.spmd_feval_impl( varargin{:} );

然后,我尝试应用我在并行工具箱中的教程视频中看到的内容:

>> job = createParallelJob('configuration', 'local');
>> task = createTask(job, @eig, 1, {A});
>> submit(job);
waitForState(job, 'finished');
>> results = getAllOutputArguments(job)
>> destroy(job);

但是经过两个小时的计算,我得到了:

results = 

   Empty cell array: 2-by-0

我的电脑有 2 Gi 内存和 intel duoCPU (2*2Ghz)

我的问题如下: 1/看第一个错误,我想我的内存不足以解决这个问题。有没有办法可以划分输入数据,以便我的计算机可以处理这个矩阵?2/为什么我的第二个结果是空的?(经过2小时的计算......)

编辑:@pm89

你是对的,执行过程中发生了错误:

job =

Parallel Job ID 3 Information
=============================

              UserName : bigTree
                 State : finished
            SubmitTime : Sun Jul 14 19:20:01 CEST 2013
             StartTime : Sun Jul 14 19:20:22 CEST 2013
      Running Duration : 0 days 0h 3m 16s

- Data Dependencies

      FileDependencies : {}
      PathDependencies : {}

- Associated Task(s)

       Number Pending  : 0
       Number Running  : 0
       Number Finished : 2
      TaskID of errors : [1  2]

- Scheduler Dependent (Parallel Job)

MaximumNumberOfWorkers : 2
MinimumNumberOfWorkers : 1
4

0 回答 0