为大矩阵并行计算特征值

时间:2013-07-14 14:41:52

标签: multithreading matlab memory-management parallel-processing eigenvalue

我试图使用并行工具箱在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

0 个答案:

没有答案