Commit 0199ba09 authored by mikec1's avatar mikec1 Committed by Brad Kennedy
Browse files

Changes to batch file fields - some abstracted, some added

parent da598352
......@@ -70,8 +70,9 @@ for li=1:nlevels;
batchconfig(li).qsub_options=strtrim(propgrid.Properties((li*4)).Children(6).Value);
batchconfig(li).memory=strtrim(propgrid.Properties((li*4)).Children(7).Value);
batchconfig(li).time_limit=strtrim(propgrid.Properties((li*4)).Children(8).Value);
batchconfig(li).num_processors=strtrim(propgrid.Properties((li*4)).Children(9).Value);
batchconfig(li).software=strtrim(propgrid.Properties((li*4)).Children(10).Value);
batchconfig(li).program_options=strtrim(propgrid.Properties((li*4)).Children(11).Value);
batchconfig(li).mpi=strtrim(propgrid.Properties((li*4)).Children(9).Value);
batchconfig(li).num_processors=strtrim(propgrid.Properties((li*4)).Children(10).Value);
batchconfig(li).software=strtrim(propgrid.Properties((li*4)).Children(11).Value);
batchconfig(li).program_options=strtrim(propgrid.Properties((li*4)).Children(12).Value);
end
% Copyright (C) 2017 Brock University Cognitive and Affective Neuroscience Lab
%
% Code written by Michael Cichonski
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program (LICENSE.txt file in the root directory); if not,
% write to the Free Software Foundation, Inc., 59 Temple Place,
% Suite 330, Boston, MA 02111-1307 USA
function dimensions = ef_get_eegdims(dfpath,dfname)
persistent allDims;
if isempty(allDims)
allDims = struct();
end
if ~isfield(allDims,dfname)
EEG_temp = pop_loadset('filename',dfname,'filepath',dfpath,'loadmode','info');
[~,name,~] = fileparts(dfname); % remove extension so filename can be used as a field (no '.' allowed)
allDims.(name) = struct('channels',EEG_temp.nbchan,'samples',EEG_temp.pnts);
end
dimensions = allDims.(name);
......@@ -22,7 +22,7 @@
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program (LICENSE.txt file in the root directory); if not,
% along with this program (LICENSE.txt file in the root directory); if not,
% write to the Free Software Foundation, Inc., 59 Temple Place,
% Suite 330, Boston, MA 02111-1307 USA
......@@ -41,4 +41,3 @@ function ef_print_error(err)
builtin('disp', ['Stack trace not available, error was' err.message]);
end
end
......@@ -101,7 +101,8 @@ for bfni = 1:length(job_struct(length(job_struct)).batch_dfn)
'histfname',job_struct(length(job_struct)).batch_hfn, ...
'jobid',jobo(job_struct(length(job_struct)).ordernum).id{bfni}, ...
'execstr',job_struct(length(job_struct)).exec_str{bfni}, ...
'execpath',strrep(fullfile(job_struct(length(job_struct)).context_config.log,job_struct(length(job_struct)).m_path),'\','/'));
'execpath',strrep(fullfile(job_struct(length(job_struct)).context_config.log,job_struct(length(job_struct)).m_path),'\','/'), ...
'datapath',job_struct(length(job_struct)).batch_dfp);
end
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
......@@ -129,6 +130,7 @@ try g.histfname; catch, g.histfname='';end
try g.jobid; catch, g.jobid ='';end
try g.execstr; catch, g.execstr ='';end
try g.execpath; catch, g.execpath ='';end
try g.datapath; catch, g.datapath ='';end
%% BUILD THE QSUBSTR
%build the job name JOBNAME_STR...
......@@ -165,6 +167,47 @@ if ~isempty(batch_config.qsub_options);
qsubstr_tmp=sprintf('%s %s',qsubstr_tmp,batch_config.qsub_options{i});
end
end
dimensions = ef_get_eegdims(g.datapath,g.datafname);
c = dimensions.channels; % channels
s = dimensions.samples; % samples
%memory_allocation...
memory_alloc='';
if ~isempty(batch_config.memory);
byte_size = batch_config.memory(end);
memory_alloc = ['--mpp ' num2str(eval(batch_config.memory(1:end-1))) byte_size];
else
memory_alloc = '--mpp 1G'; % default: 1G
end
qsubstr_tmp=sprintf('%s %s',qsubstr_tmp,memory_alloc);
%time_limit...
time_limit='';
if ~isempty(batch_config.time_limit);
time_var = batch_config.time_limit(end);
time_limit = ['-r ' num2str(eval(batch_config.time_limit(1:end-1))) time_var];
else
time_limit = '-r 1h'; % default: 1h
end
qsubstr_tmp=sprintf('%s %s',qsubstr_tmp,time_limit);
%mpi
mpi_tag ='';
if strcmp(batch_config.mpi, 'true');
mpi_tag = '--ppn 1 -q mpi';
end
qsubstr_tmp=sprintf('%s %s',qsubstr_tmp,mpi_tag);
%num_processors
num_proc='';
if ~isempty(batch_config.num_processors);
num_proc = ['-n' batch_config.num_processors];
else
num_proc = '-n 1';
end
qsubstr_tmp=sprintf('%s %s', qsubstr_tmp,num_proc);
%program_options...
program_options='';
if ~isempty(batch_config.program_options);
......@@ -172,6 +215,7 @@ if ~isempty(batch_config.program_options);
program_options=sprintf('%s %s',program_options,batch_config.program_options{i});
end
end
% software...
wrappername = 'analysis/support/dependencies/eeglab_asr_amica/plugins/batch_context/batch/exec_func/octave_exit_wrapper.m';
switch batch_config.software
......
......@@ -112,8 +112,6 @@ else
for i=1:length(result_ind);
id_result{i}=result{result_ind(i)};
end
job_struct(end).jobids={};
for bfi=1:length(job_struct(end).batch_dfn);
jobidstr=strtrim(id_result{bfi});
......
Supports Markdown
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