error detects in labs in spmd

5 views (last 30 days)
huda nawaf
huda nawaf on 24 Jan 2014
Commented: huda nawaf on 28 Jan 2014
I have problem with this code , I can not know what is the reason.
this error what I got:
Starting matlabpool using the 'local' configuration ... connected to 2 labs. Lab 2:
ans =
??? Error using ==> spmd_feval at 8 Error detected on lab(s) 2
Error in ==> test at 7 Nofusers=700;k1=1;
Caused by:
You must call TIC without an output argument before calling TOC
without an input argument.
Error stack:
(No remote error stack)
%%%the code%% clc;clear;close all;
N=2; % Number of your CPU core, in my case, 4
matlabpool(N) % open N multicores for the parallel computation
spmd % similar with for loop
for i=1:Nofusers
fclose all
matlabpool close % you must close the multicore calculation statement

Answers (1)

Walter Roberson
Walter Roberson on 24 Jan 2014
Your nesting appears to be off. You have the "matlabpool close" and the "toc" before it inside the spmd block.
Each lab is effectively a different MATLAB session. The "tic" before the spmd block is not in the same session as the "toc" inside the spmd block.
huda nawaf
huda nawaf on 28 Jan 2014
In fact, the last example to know which time I have to depend and why serial faster than parallel. But my problem in first code is to know if I used spmd correctly. thanks

Sign in to comment.


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!