1

I would like to run the matlab kmeans using 4 lab

I open matlabpool

if ~matlabpool('size')
    matlabpool open 4; % Invokes workers
end

I set the option for the kmeans

stream = RandStream('mlfg6331_64');  % Random number stream
options = statset('UseParallel','always','UseSubstreams','always',...
    'Streams',stream);

Then I run the kmeans

            [clustersFirstHalf,fCentr] = kmeans(first_partition,cIdx,'Options',options,...
                'distance','sqEuclidean',...
                'emptyaction','singleton',...
                'replicates',37,...
                'start','cluster');

I get this warning message...

Warning: Using parfor without matlabpool. 
> In processParallelAndStreamOptions>parforValidateStreamOptions at 173
  In processParallelAndStreamOptions at 78
  In kmeans at 254
  In kmeans>loopBody at 360
  In smartForReduce>(parfor body) at 111
  In parallel_function>make_general_channel/channel_general at 879
  In remoteParallelFunction at 30 

matlabpool is open...so it is very weird...

I'm using MATLAB R2012b on linux.... Can any of you help me?

gabboshow
  • 5,359
  • 12
  • 48
  • 98
  • 1
    Is this different from your [previous question](http://stackoverflow.com/questions/26474841/warning-using-parfor-without-matlabpool)? You are supposed to edit the original, not post a new one. I'm going to flag as dup unless there is a substantive difference I'm not seeing. – chappjc Oct 21 '14 at 15:50
  • @chappjc I think this is more clear...I've deleted the previous one...it was not answered yet – gabboshow Oct 21 '14 at 15:54
  • 1
    OK, but you should not do it that way. Remember that when you edit your post it goes to the top of the list in the "Active" tab. – chappjc Oct 21 '14 at 15:57
  • add the version of software you are using in the post. – NKN Oct 21 '14 at 18:22
  • @NKN MATLAB R2012b on linux...(edited the question) – gabboshow Oct 21 '14 at 18:52

0 Answers0