Commit 25d44fff authored by Brad Kennedy's avatar Brad Kennedy
Browse files

Merge branch 'temp-dev' into 'master'

sbatch support, more robust config parsing, algorithmic setting of memory and timelimits



See merge request !28
parents e2b0b0f4 26fa1d2f
......@@ -48,9 +48,9 @@
%Suite 330, Boston, MA 02111-1307 USA
function properties = batchconfig2propgrid(batchconfig)
num_properties = 16;
for i=1:length(batchconfig);
properties((i*11)-10:(i*11)) = [ ...
properties((i*num_properties)-(num_properties-1):(i*num_properties)) = [ ...
... % basic properties...
PropertyGridField(['exec_func[',num2str(i),']'], batchconfig(i).exec_func, ...
'Type', PropertyType('char', 'row', {'ef_gen_m','ef_current_base', 'ef_sbatch', 'ef_sqsub','ef_qsub','ef_sqsub_sshfm','ef_mshpc'}), ...
......@@ -72,21 +72,26 @@ for i=1:length(batchconfig);
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', ['exec_config[',num2str(i),']']) ...
...% execute properties...
PropertyGridField(['qsub[',num2str(i),'].job_name'], batchconfig(i).job_name, ...
'Type', PropertyType('char','row'), ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', ['job_name'], ...
'Description', ['Parameters for creating the job name (Batch string swap rules apply).']) ...
PropertyGridField(['qsub[',num2str(i),'].session_init'], batchconfig(i).session_init, ...
'Type', PropertyType('char', 'row'), ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', ['session_init'], ...
'Description', ['Code [or file name of a text file containing code] to execute at the begining of a submission session.']) ...
PropertyGridField(['qsub[',num2str(i),'].job_name'], batchconfig(i).job_name, ...
'Type', PropertyType('char','row'), ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', ['job_name'], ...
'Description', ['Parameters for creating the job name (Batch string swap rules apply).']) ...
PropertyGridField(['qsub[',num2str(i),'].job_init'], batchconfig(i).job_init, ...
'Type', PropertyType('char', 'row'), ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', ['job_init'], ...
'Description', ['Code [or file name of a text file containing code] to execute at the begining of a job.']) ...
PropertyGridField(['qsub[',num2str(i),'].mfile_name'], batchconfig(i).mfile_name, ...
'Type', PropertyType('char','row'), ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', ['mfile_name'], ...
'Description', ['Parameters for creating the .m file name (Batch string swap rules apply).']) ...
PropertyGridField(['qsub[',num2str(i),'].m_init'], batchconfig(i).m_init, ...
'Type', PropertyType('char', 'row'), ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
......@@ -96,78 +101,27 @@ for i=1:length(batchconfig);
'Type', PropertyType('cellstr', 'column'), ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', ['qsub_options'], ...
'Description', ['(-r|-W)' char(9) 'timelimit (THIS IS REQUIRED FOR EVERY JOB)' char(10) ...]) ...
char(9) 'provide a runtime limit (elapsed, wallclock time, not summed' char(10) ...
char(9) 'across cpus) specified in any of the following forms:' char(10) ...
char(9) '15' char(9) '(assumed to be minutes)' char(10) ...
char(9) '15m' char(9) '(same)' char(10) ...
char(9) '.25h' char(9) '(same)' char(10) ...
char(9) '2.5h' char(9) '(2 hours 30 minutes)' char(10) ...
char(9) '3.5d' char(9) '(3 days 12 hours)' char(10) ...
char(9) '84:0' char(9) '(same, in LSF''s hours:minutes format)' char(10) ...
char(10) ...
'-i ifile' char(9) 'job reads inputs from ''ifile'' (no default)' char(10) ...
'-o ofile' char(9) 'job output to ''ofile'' (REQUIRED FOR EVERY JOB)' char(10) ...
'-e efile' char(9) 'job errors go to ''efile'' (default: same as -o)' char(10) ...
'' char(10) ...
'-t|--test' char(9) '''test'' mode: short but immediate (preemptive)' char(10) ...
'-q queue' char(9) 'queue name (serial, threaded, mpi; default serial)' char(10) ...
'-f flag' char(9) 'specify certain flags to modify behavior. flags include:' char(10) ...
char(9) 'mpi, interactive, test, mail, permitcoredump' char(10) ...
char(10) ...
'-n ncpus' char(9) 'require n cpus or cores (default 1)' char(10) ...
'-N nnodes' char(9) 'require n nodes (does not imply exclusive use)' char(10) ...
char(10) ...
'--ppn=ppn' char(9) 'start ppn proceses per node' char(10) ...
'--tpp=tpp' char(9) 'permit tpp threads per process (OMP_NUM_THREADS)' char(10) ...
'--gpp=gpp' char(9) 'allocate gpp gpus per process' char(10) ...
char(10) ...
'--mpp=' char(10) ...
'--memperproc=' char(10) char(9) 'amount of memory required by each process. may be specified' char(10) ...
char(9) 'like 64M or 2.5G (M=2^20, G=2^30). for an MPI job, this is ' char(10) ...
char(9) 'the per-rank size. for threaded jobs, it''s the process size,' char(10) ...
char(9) '(that is, not per-thread.)' char(10) ...
char(10) ...
'--nodes=clu[1-4]' char(10) ...
char(9) 'require a specific set of nodes. eg wha[1-4] or' char(10) ...
char(9) 'req666.' char(10) ...
char(10) ...
'--pack' char(9) 'require a minimal number of nodes, so processes occupy' char(10) ...
char(9) 'all cpus per node.' char(10) ...
char(10) ...
'--mail-start' char(9) 'notify when the job starts.' char(10) ...
'--mail-end' char(9) 'notify when the job ends (either normally or not).' char(10) ...
'--mail-abort' char(9) 'notify when the job ends abnormally.' char(10) ...
'-m|--mail' char(9) '(compatibility - same as mail-end)' char(10) ...
char(9) 'this email only goes to your account''s email address.' char(10) ...
char(10) ...
'-w|--waitfor=jobid[,jobid...]]' char(10) ...
char(9) 'wait for a list of jobs to complete' char(10) ...
char(10) ...
'-j|--jobname' char(9) 'provides a name for the job.' char(10) ...
char(10) ...
'--project' char(9) 'specify a project (group) for accounting purposes.' char(10) ...
char(9) 'defaults to the user''s group. may also be given via' char(10) ...
char(9) 'SQ_PROJECT environment variable.' char(10) ...
char(10) ...
'--idfile=fname' char(10) char(9) 'write the jobid into a file named ''fname''.' char(10) ...
char(10) ...
'--nompirun' char(9) 'don''t automatically invoke mpirun for mpi jobs.' char(10) ...
char(9) 'note that you should probably look at mpirun parameters' char(10) ...
char(9) 'sqsub uses, so that you get layout and binding right.' char(10) ...
char(10) ...
'-f flag' char(9) 'specify certain flags to modify behavior.' char(10) ...
char(9) 'Universal flags include: mpi, threaded, test, mail' char(10) ...
char(9) 'on some clusters, other flags have added meaning, such ' char(10) ...
char(9) 'xeon/opteron on Hound, and dual/quad on Goblin and ' char(10) ...
char(9) 'selecting sub-clusters on Kraken (bal/bru/dol/meg/tig/wha/nar)' char(10) ...
char(10) ...
'-h or --help' char(9) 'show brief usage message' char(10) ...
'--man' char(9) 'show man page' char(10) ...
char(10) ...
'-v|--verbose' char(9) 'verbose mode: shows debugging-type details' char(10) ...
'-d|--debug' char(9) 'debug mode: don''t actually submit, but show the command' char(10) ...
]) ...
'Description', 'TODO') ...
PropertyGridField(['qsub[',num2str(i),'].memory'], batchconfig(i).memory, ...
'Type', PropertyType('char', 'row'), ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', ['memory'], ...
'Description', ['Amount of memory required by each process.']) ...
PropertyGridField(['qsub[',num2str(i),'].time_limit'], batchconfig(i).time_limit, ...
'Type', PropertyType('char', 'row'), ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', ['time_limit'], ...
'Description', ['Provide a runtime limit. (elapsed, wallclock time, not summed across cpus)']) ...
PropertyGridField(['qsub[',num2str(i),'].mpi'], batchconfig(i).mpi, ...
'Type', PropertyType('char', 'row', {'true','false'}), ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', ['mpi'], ...
'Description', ['Whether mpi will be used or not. (default: false)']) ...
PropertyGridField(['qsub[',num2str(i),'].num_processors'], batchconfig(i).num_processors, ...
'Type', PropertyType('char', 'row'), ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', ['num_processors'], ...
'Description', ['Number of processors to be used for this job. (default: 1)']) ...
PropertyGridField(['qsub[',num2str(i),'].software'], batchconfig(i).software, ...
'Type', PropertyType('char', 'row', {'matlab','octave','none'}), ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
......
......@@ -5,10 +5,13 @@ function out = config_parse(in)
scan = scan(~cellfun(@isempty, strtrim(scan)));
% Get first non space
indent_vals = cellfun(@max, strfind(scan, ' '), 'UniformOutput', false);
% Adjust indexes
indent_vals = cellfun(@sub_one_or_zero, indent_vals, 'UniformOutput', false);
indent_vals = cellfun(@max, strfind(scan, sprintf('\t')), 'UniformOutput', false);
indent_vals_space = cellfun(@max, strfind(scan, sprintf(' ')), 'UniformOutput', false);
for i=1:numel(indent_vals)
indent_vals{i} = ~isempty(indent_vals{i}) || ~isempty(indent_vals_space{i});
end
scan = strtrim(scan);
......@@ -32,11 +35,5 @@ function out = config_parse(in)
out = t;
end
function x = sub_one_or_zero(x)
if isempty(x)
x = 0;
end
end
function out = config_parse_multilevel(in)
% in is a string or maybe a file descriptor
scan = regexp(in, '[\n]+', 'split');
scan = scan(~cellfun(@isempty, strtrim(scan)));
% Get first non space
% TODO(brad) both spaces and tabs
indent_vals = cellfun(@max, strfind(scan, sprintf('\t')), 'UniformOutput', false);
%indent_vals = cellfun(@max, strfind(scan, sprintf(' ')), 'UniformOutput', false);
% Adjust indexes
indent_vals = cellfun(@sub_one_or_zero, indent_vals, 'UniformOutput', false);
scan = strtrim(scan);
t = tree_new();
[t, ~] = t.add(t, 1, scan{1});
parents_nodes = [1, 2];
parents_lines = [1];
for i=2:numel(indent_vals)
% Indent increased
while ~isempty(parents_lines) ...
&& indent_vals{parents_lines(end)} >= indent_vals{i}
parents_lines = parents_lines(1:end-1);
parents_nodes = parents_nodes(1:end-1);
end
[t, node] = t.add(t, parents_nodes(end), scan{i});
parents_nodes(end+1) = node;
parents_lines(end+1) = i;
end
out = t;
end
function x = sub_one_or_zero(x)
if isempty(x)
x = 0;
end
end
......@@ -32,19 +32,23 @@
%write to the Free Software Foundation, Inc., 59 Temple Place,
%Suite 330, Boston, MA 02111-1307 USA
function batch_config=init_batch_config
function batch_config=init_batch_config()
batch_config.file_name='';
batch_config.exec_func='ef_current_base';
batch_config.replace_string={''};
batch_config.order=[];
batch_config.session_init='';
batch_config.job_name='';
batch_config.mfile_name='';
batch_config.job_init='';
batch_config.m_init='';
batch_config.qsub_options={''};
batch_config.memory='';
batch_config.time_limit='';
batch_config.mpi='false';
batch_config.num_processors='';
batch_config.software='matlab';
batch_config.program_options={''};
......@@ -62,12 +62,17 @@ for li=1:nlevels;
batchconfig(li).exec_func=strtrim(propgrid.Properties((li*4)-3).Value);
batchconfig(li).replace_string=strtrim(propgrid.Properties((li*4)-2).Value);
batchconfig(li).order=propgrid.Properties((li*4)-1).Value;
batchconfig(li).job_name=strtrim(propgrid.Properties((li*4)).Children(1).Value);
batchconfig(li).session_init=strtrim(propgrid.Properties((li*4)).Children(2).Value);
batchconfig(li).session_init=strtrim(propgrid.Properties((li*4)).Children(1).Value);
batchconfig(li).job_name=strtrim(propgrid.Properties((li*4)).Children(2).Value);
batchconfig(li).job_init=strtrim(propgrid.Properties((li*4)).Children(3).Value);
batchconfig(li).m_init=strtrim(propgrid.Properties((li*4)).Children(4).Value);
batchconfig(li).qsub_options=strtrim(propgrid.Properties((li*4)).Children(5).Value);
batchconfig(li).software=strtrim(propgrid.Properties((li*4)).Children(6).Value);
batchconfig(li).program_options=strtrim(propgrid.Properties((li*4)).Children(7).Value);
batchconfig(li).mfile_name=strtrim(propgrid.Properties((li*4)).Children(4).Value);
batchconfig(li).m_init=strtrim(propgrid.Properties((li*4)).Children(5).Value);
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).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
......@@ -43,48 +43,37 @@
function batch_config=text2struct_bc(fname)
batch_config.file_name='';
batch_config = init_batch_config();
batch_config.exec_func='';
batch_config.replace_string={''};
batch_config.order=[];
batch_config.session_init='';
batch_config.job_name='';
batch_config.job_init='';
batch_config.m_init='';
batch_config.qsub_options={''};
batch_config.software='';
batch_config.program_options={''};
keywords=fieldnames(batch_config);
fileID = fopen(fname);
C = textscan(fileID,'%s', 'delimiter', '\n');
C = fread(fileID, '*char')';
t = config_parse(C);
fclose(fileID);
cell_str={C{1}{:}}';
for i=1:length(keywords);
try
key_ind(i)=find(strcmp(keywords{i},cell_str));
catch
key_ind(i)=0;
for i=1:length(keywords)
% Child elements
key_val = t.get_children_contents_of_match(t, ...
@(x) strcmp(x, keywords{i}), 1);
if isempty(key_val)
continue
end
end
key_ind_sort=sort(key_ind);
key_ind_sort(length(key_ind_sort)+1)=length(cell_str)+1;
for i=1:length(keywords);
field_ind=i;
if key_ind(field_ind)+1<=key_ind_sort(find(key_ind_sort==key_ind(field_ind))+1)-1;
key_val=cell_str(key_ind(field_ind)+1:key_ind_sort(find(key_ind_sort==key_ind(field_ind))+1)-1);
if ischar(eval(['batch_config.',keywords{field_ind}]));
batch_config=setfield(batch_config,keywords{i},key_val{:});
end
if iscell(eval(['batch_config.',keywords{field_ind}]));
batch_config=setfield(batch_config,keywords{i},key_val);
end
if isnumeric(eval(['batch_config.',keywords{field_ind}]));
batch_config=setfield(batch_config,keywords{i},str2num(key_val{:}));
% key_val is always a cell array
if iscell(batch_config.(keywords{i}))
batch_config.(keywords{i}) = key_val';
elseif ischar(batch_config.(keywords{i}))
if numel(key_val) ~= 1
error('key_val must be one sized for %s which is a char', ...
keywords{i})
end
batch_config.(keywords{i}) = key_val{1};
elseif isnumeric(batch_config.(keywords{i}))
batch_config.(keywords{i}) = str2num(key_val{:});
end
end
\ No newline at end of file
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
[~,name,~] = fileparts(dfname); % remove extension so filename can be used as a field (no '.' allowed)
if ~isfield(allDims,name)
EEG_temp = pop_loadset('filename',dfname,'filepath',dfpath,'loadmode','info');
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
......@@ -99,8 +99,9 @@ for bfni = 1:length(job_struct(length(job_struct)).batch_dfn)
'histfname', job_struct(end).batch_hfn, ...
'jobid', jobo(job_struct(end).ordernum).id{bfni}, ...
'execstr', job_struct(end).exec_str{bfni}, ...
'execpath', ...
strrep(fullfile(job_struct(end).context_config.log,job_struct(end).m_path),'\','/'));
'execpath', strrep(fullfile(job_struct(end).context_config.log, ...
job_struct(end).m_path),'\','/'), ...
'datapath',job_struct(length(job_struct)).batch_dfp);
end
%% WRITE [SUBSTRINIT,QSUBSTR] TO A *.SUB TEXT FILE IN THE LOG PATH...
......@@ -163,11 +164,58 @@ if ~isempty(g.jobid);
qsubstr_tmp=sprintf('%s --dependency=afterok:%s',qsubstr_tmp, g.jobid);
end
%sbatch_options...
if ~isempty(batch_config.qsub_options);
if ~isempty(batch_config.qsub_options)
for i = 1:length(batch_config.qsub_options)
qsubstr_tmp = [qsubstr_tmp ' ' batch_config.qsub_options{i}];
end
end
dimensions = ef_get_eegdims(g.datapath,g.datafname);
% These variables are eval'd so they will show up as a warning
c = dimensions.channels; %#ok<NASGU> % channels
s = dimensions.samples; %#ok<NASGU> % samples
% memory_allocation...
if ~isempty(batch_config.memory)
byte_size = batch_config.memory(end);
memory_alloc = ['--mem=' num2str(eval(batch_config.memory(1:end-1))) byte_size];
qsubstr_tmp=sprintf('%s %s',qsubstr_tmp,memory_alloc);
end
% time_limit...
if ~isempty(batch_config.time_limit)
time_var = lower(batch_config.time_limit(end));
time_span = eval(batch_config.time_limit(1:end-1));
% Make everything into seconds
switch time_var
case 's'
case 'm'
time_span = time_span * 60;
case 'h'
time_span = time_span * 360;
otherwise
error('End of time_limit field needs to be one of {s, m, h}');
end
time_span = fix(time_span);
hours = fix(time_span / 360);
time_span = mod(time_span, 360);
minutes = fix(time_span / 60);
time_span = mod(time_span, 60);
seconds = fix(time_span);
time_str = sprintf('%02d:%02d:%02d', hours, minutes, seconds);
qsubstr_tmp=sprintf('%s --time=%s',qsubstr_tmp,time_str);
end
% num_processors
if ~isempty(batch_config.num_processors)
num_proc = ['--ntasks=' batch_config.num_processors];
qsubstr_tmp=sprintf('%s %s', qsubstr_tmp,num_proc);
end
%program_options...
program_options='';
if ~isempty(batch_config.program_options);
......@@ -177,12 +225,20 @@ if ~isempty(batch_config.program_options);
end
end
%software...
% TODO(brad) make this not hardcoded
wrappername = 'analysis/support/dependencies/eeglab_asr_amica/plugins/batch_context/batch/exec_func/octave_exit_wrapper.m';
if strcmp(batch_config.mpi, 'true')
g.execstr = sprintf('srun %s', g.execstr);
end
switch batch_config.software
case 'none'
% TODO(brad) unsure what this is checking, find out why we have these
% magic numbers
while g.execstr(end)==10 || g.execstr(end)==13;
% Note: these are stripping the end?
while g.execstr(end)==10 || g.execstr(end)==13
g.execstr=g.execstr(1:end-1);
end
% TODO(brad) this is a hack
......
......@@ -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...
......@@ -154,24 +156,61 @@ qsubstr_tmp=sprintf('%s %s %s',qsubstr_tmp,'-j', ...
qsubstr_tmp=sprintf('%s %s %s',qsubstr_tmp,'-o', ...
[g.execpath,'/',job_nameStr,'.log']);
%jobid wait...
% jobid wait...
if ~isempty(g.jobid);
qsubstr_tmp=sprintf('%s %s %s',qsubstr_tmp,'-w', ...
g.jobid);
end
%qsub_options...
% qsub_options...
if ~isempty(batch_config.qsub_options);
for i=1:length(batch_config.qsub_options);
qsubstr_tmp=sprintf('%s %s',qsubstr_tmp,batch_config.qsub_options{i});
end
end
%program_options...
dimensions = ef_get_eegdims(g.datapath,g.datafname);
% These variables are eval'd so they will show up as a warning
c = dimensions.channels; %#ok<NASGU> % channels
s = dimensions.samples; %#ok<NASGU> % samples
% memory_allocation...
if ~isempty(batch_config.memory);
byte_size = batch_config.memory(end);
memory_alloc = ['--mpp ' num2str(eval(batch_config.memory(1:end-1))) byte_size];
qsubstr_tmp=sprintf('%s %s',qsubstr_tmp,memory_alloc);
end
% 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];
qsubstr_tmp=sprintf('%s %s',qsubstr_tmp,time_limit);
end
% mpi
if strcmp(batch_config.mpi, 'true');
mpi_tag = '-q mpi';
qsubstr_tmp=sprintf('%s %s',qsubstr_tmp,mpi_tag);
end
% num_processors
if ~isempty(batch_config.num_processors);
num_proc = ['-n' batch_config.num_processors];
qsubstr_tmp=sprintf('%s %s', qsubstr_tmp,num_proc);
end
% program_options...
program_options='';
if ~isempty(batch_config.program_options);
for i=1:length(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});
......
......@@ -70,7 +70,8 @@ function [element] = tree_get(tree, elementid)
end