Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 21 additions & 22 deletions main.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,34 +63,33 @@
parc = feInflateLabels(labs, mask, infl, 'vert', './output/labels_dilated.nii.gz');

%% start parallel pool

disp(['Opening parallel pool with ', num2str(nclust), ' cores...']);

% disp(['Opening parallel pool with ', num2str(nclust), ' cores...']);
%
% create parallel cluster object
clust = parcluster;

%clust = parcluster;
%
% set number of cores from arguments
clust.NumWorkers = nclust;

%clust.NumWorkers = nclust;
%
% set temporary cache directory
tmpdir = tempname('cache');
%tmpdir = tempname('cache');

% make cache dir
OK = mkdir(tmpdir);

%OK = mkdir(tmpdir);
%
% check and set cachedir location
if OK
% set local storage for parpool
clust.JobStorageLocation = tmpdir;
disp(['Cluster Job Storage Location set to: ' clust.JobStorageLocation]);
else
warning('Cluster Job Storage Location was unset. The default may cause failuers.');
end

%if OK
% % set local storage for parpool
% clust.JobStorageLocation = tmpdir;
% disp(['Cluster Job Storage Location set to: ' clust.JobStorageLocation]);
%else
% warning('Cluster Job Storage Location was unset. The default may cause failuers.');
%end
%
% start parpool - close parpool at end of fxn
pool = parpool(clust, nclust, 'IdleTimeout', 120);

clear tmpdir OK
%pool = parpool(clust, nclust, 'IdleTimeout', 120);
%
%clear tmpdir OK

%% create the inputs

Expand Down Expand Up @@ -175,7 +174,7 @@
%% save and exit

% remove parallel pool
delete(pool);
% delete(pool);

disp('Saving outputs...');

Expand Down