Commit c9c7810a authored by Pierre Cazenave's avatar Pierre Cazenave

Add the matlabpool code to actually open the workers rather than letting...

Add the matlabpool code to actually open the workers rather than letting MATLAB try to figure out that it should do it itself
parent 2980dfc0
......@@ -63,6 +63,16 @@ if ftbverbose
fprintf(['begin : ' subname '\n'])
end
wasOpened = false;
if license('test', 'Distrib_Computing_Toolbox')
% We have the Parallel Computing Toolbox, so launch a bunch of workers.
if matlabpool('size') == 0
% Force pool to be local in case we have remote pools available.
matlabpool open local
wasOpened = true;
end
end
varlist = {'lon', 'lat', 'ETWD', 'x1XD', 'time', 'depth', 'pdepthD'};
% Data format:
......@@ -258,6 +268,11 @@ Mobj.ts_times = greg2mjulian(...
pc.time.hms(2), ...
pc.time.hms(3)) + (pc.time.data / 3600 / 24);
% Close the MATLAB pool if we opened it.
if wasOpened
matlabpool close
end
if ftbverbose
fprintf(['end : ' subname '\n'])
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment