0001 function feOpenLocalCluster
0002
0003
0004
0005
0006
0007
0008
0009
0010 if exist('matlabpool','file')
0011 try
0012 if (matlabpool('size') == 0)
0013 if (exist('parcluster','file') == 2)
0014 c = parcluster;
0015 c.NumWorkers = 12;
0016 t = tempname;
0017 OK = mkdir(t);
0018 if OK
0019 c.JobStorageLocation = t;
0020 end
0021 matlabpool(c);
0022 else
0023 matlabpool open;
0024 end
0025 else
0026
0027 end
0028 catch ME
0029 fprintf('\n[feOpenLocalCluster] Problem intializing the cluster: \n\n %s.\n', ME.message)
0030 disp('[feOpenLocalCluster] Many computations will be substantially slower, without the parallel toolbox.')
0031 end
0032 else
0033 disp('[feOpenLocalCluster] Cannot find the Matlab parallel toolbox, not intializing a cluster.')
0034 disp('[feOpenLocalCluster] Many computations will be substantially slower, without the parallel toolbox.')
0035 end
0036
0037 end