Commit 20aea394 authored by Brad Kennedy's avatar Brad Kennedy
Browse files

Fixed ssh from matlab, using a better dialog box for password and only prompt for password once

Merge branch 'brad-ssh-renames'
parents 31293c28 89797286
......@@ -47,91 +47,97 @@
% Suite 330, Boston, MA 02111-1307 USA
function properties = batchconfig2propgrid(batchconfig)
num_properties = 16;
for i=1:length(batchconfig);
properties((i*num_properties)-(num_properties-1):(i*num_properties)) = [ ...
num_properties = 17;
for i=1:length(batchconfig) % 1 based indexing is awful
properties(((i-1)*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'}), ...
'Category', [batchconfig(i).file_name], ...
'Type', PropertyType('char', 'row', {'ef_current_base', 'ef_sbatch', 'ef_sqsub'}), ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', ['exec_func[',num2str(i),']'], ...
'Description', ['Name of the function that will execute the htb files.']) ...
'Description', 'Name of the function that will execute the htb files.') ...
PropertyGridField(['replace_string[',num2str(i),']'], batchconfig(i).replace_string, ...
'Type', PropertyType('cellstr', 'column'), ...
'Category', [batchconfig(i).file_name], ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', ['replace_string[',num2str(i),']'], ...
'Description', ['The cell array of strings to swap into the History Template script files.']) ...
'Description', 'The cell array of strings to swap into the History Template script files.') ...
PropertyGridField(['order[',num2str(i),']'], batchconfig(i).order, ...
'Type', PropertyType('denserealdouble','matrix'), ...
'Category', [batchconfig(i).file_name], ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', ['order[',num2str(i),']'], ...
'Description', ['values representing the sequence order.']) ...
'Description', 'values representing the sequence order.') ...
... % execute head...
PropertyGridField(['qsub[',num2str(i),']'], [], ...
'Category', [batchconfig(i).file_name], ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', ['exec_config[',num2str(i),']']) ...
...% execute properties...
PropertyGridField(['qsub[',num2str(i),'].session_init'], batchconfig(i).session_init, ...
'Type', PropertyType('char', 'row'), ...
'Category', [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.']) ...
'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', [batchconfig(i).file_name], ...
'DisplayName', ['job_name'], ...
'Description', ['Parameters for creating the job name (Batch string swap rules apply).']) ...
'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', [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.']) ...
'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', [batchconfig(i).file_name], ...
'DisplayName', ['mfile_name'], ...
'Description', ['Parameters for creating the .m file name (Batch string swap rules apply).']) ...
'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', [batchconfig(i).file_name], ...
'DisplayName', ['m_init'], ...
'Description', ['Code [or file name of a text file containing code] to execute at the begining of the m file.']) ...
PropertyGridField(['qsub[',num2str(i),'].qsub_options'], batchconfig(i).qsub_options, ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', 'm_init', ...
'Description', 'Code [or file name of a text file containing code] to execute at the begining of the m file.') ...
PropertyGridField(['qsub[',num2str(i),'].submit_options'], batchconfig(i).submit_options, ...
'Type', PropertyType('cellstr', 'column'), ...
'Category', [batchconfig(i).file_name], ...
'DisplayName', ['qsub_options'], ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', 'submit_options', ...
'Description', get_scheduler_options(batchconfig(i).exec_func)) ...
PropertyGridField(['qsub[',num2str(i),'].memory'], batchconfig(i).memory, ...
'Type', PropertyType('char', 'row'), ...
'Category', [batchconfig(i).file_name], ...
'DisplayName', ['memory'], ...
'Description', ['Amount of memory required by each process.']) ...
'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', [batchconfig(i).file_name], ...
'DisplayName', ['time_limit'], ...
'Description', ['Provide a runtime limit. (elapsed, wallclock time, not summed across cpus)']) ...
'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', [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, ...
'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_tasks'], batchconfig(i).num_tasks, ...
'Type', PropertyType('char', 'row'), ...
'Category', [batchconfig(i).file_name], ...
'DisplayName', ['num_processors'], ...
'Description', ['Number of processors to be used for this job. (default: 1)']) ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', 'num_tasks', ...
'Description', 'Number of processors to be used for this job. (default: 1)') ...
PropertyGridField(['qsub[',num2str(i),'].threads_per_task'], batchconfig(i).threads_per_task, ...
'Type', PropertyType('char', 'row'), ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', 'threads_per_task', ...
'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', [batchconfig(i).file_name], ...
'DisplayName', ['software'], ...
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', 'software', ...
'Description', ['Name of the software to used in executing the code from History file number', num2str(i)]) ...
PropertyGridField(['qsub[',num2str(i),'].program_options'], batchconfig(i).program_options, ...
'Type', PropertyType('cellstr', 'column'), ...
'Category', [batchconfig(i).file_name], ...
'DisplayName', ['program_options'], ...
'Description', ['Options ???.']) ...
];
'Category', ['Level ',num2str(i),' - ',batchconfig(i).file_name], ...
'DisplayName', 'program_options', ...
'Description', 'Options ???.') ...
];
end
end
......
......@@ -41,11 +41,12 @@ batch_config.job_name='';
batch_config.mfile_name='';
batch_config.job_init='';
batch_config.m_init='';
batch_config.qsub_options={''};
batch_config.submit_options={''};
batch_config.memory='';
batch_config.time_limit='';
batch_config.mpi='false';
batch_config.num_processors='';
batch_config.num_tasks='';
batch_config.threads_per_task='';
batch_config.software='matlab';
batch_config.program_options={''};
......@@ -54,21 +54,36 @@ nlevels=npg/4;
if nargin==1;
batchconfig=init_batch_config;
end
exec_properties = {
'session_init', ...
'job_name', ...
'job_init', ...
'mfile_name', ...
'm_init', ...
'submit_options', ...
'memory', ...
'time_limit', ...
'mpi', ...
'num_tasks', ...
'threads_per_task', ...
'software', ...
'program_options' ...
};
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).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).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);
% Some aliases
propi = li - 1;
pp = propgrid.Properties;
ppexec_conf = propgrid.Properties(li*4);
batchconfig(li).exec_func = strtrim(pp(propi*4+1).Value);
batchconfig(li).replace_string = strtrim(pp(propi*4+2).Value);
batchconfig(li).order = pp(propi*4+3).Value;
for i = 1:length(exec_properties)
batchconfig(li).(exec_properties{i}) = ...
strtrim(ppexec_conf.Children(i).Value);
end
end
......@@ -44,32 +44,44 @@ batch_config = init_batch_config();
batch_config.exec_func='';
batch_config.software='';
keywords=fieldnames(batch_config);
keywords = fieldnames(batch_config);
% Backwards compatibility
backwards_compat = struct('qsub_options', 'submit_options', ...
'num_processors', 'num_tasks');
backwards_fields = fields(backwards_compat);
keywords = [keywords; backwards_fields];
% Open file
fileID = fopen(fname);
C = fread(fileID, '*char')';
t = config_parse(C);
fclose(fileID);
for i=1:length(keywords)
kw = keywords{i};
% Child elements
key_val = t.get_children_contents_of_match(t, ...
@(x) strcmp(x, keywords{i}), 1);
@(x) strcmp(x, kw), 1);
if isempty(key_val)
continue
end
% 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}))
% Backwards compatibility check, changes any item in backwards_compat
if isfield(backwards_compat, kw)
kw = backwards_compat.(kw);
end
if iscell(batch_config.(kw))
batch_config.(kw) = key_val';
elseif ischar(batch_config.(kw))
if numel(key_val) ~= 1
error('key_val must be one sized for %s which is a char', ...
keywords{i})
kw)
end
batch_config.(keywords{i}) = key_val{1};
elseif isnumeric(batch_config.(keywords{i}))
batch_config.(keywords{i}) = str2num(key_val{:});
batch_config.(kw) = key_val{1};
elseif isnumeric(batch_config.(kw))
batch_config.(kw) = str2num(key_val{:});
end
end
......@@ -121,14 +121,13 @@ if ~isempty(batch_config.mpi)
end
num_proc = 1;
if ~isempty(batch_config.num_processors)
num_proc = str2double(batch_config.num_processors);
if ~isempty(batch_config.num_tasks)
num_proc = str2double(batch_config.num_tasks);
end
num_thread_per_proc = 1;
if isfield(batch_config, 'num_thread_per_proc') ...
&& ~isempty(batch_config.num_thread_per_proc)
num_thread_per_proc = str2double(batch_config.num_thread_per_proc);
if ~isempty(batch_config.threads_per_task)
num_thread_per_proc = str2double(batch_config.threads_per_task);
end
program = batch_config.software;
......@@ -137,7 +136,7 @@ program_options = batch_config.program_options;
exec_str = tjob.exec_str{data_filename_index};
generic_opts = batch_config.qsub_options;
generic_opts = batch_config.submit_options;
is_octave = strcmp(program, 'octave') || strcmp(program, 'matlab');
%% Wrapper file for octave
......
......@@ -4,8 +4,9 @@
% >> out = read_jobs(driver, result_str)
%
% Inputs:
% driver - the driver we are using, should be subtype of ef_base_driver
% job_spec - results of the output of running the submission script
% driver - the driver we are using, should be subtype of ef_base_driver
% result_str - results of the output of running the submission script,
% must be of type char
%
% Outputs:
% out - scheduler independent format for the concrete scheduler
......
% rsub_sshfs() - Submits the batch pipeline defined by job_struct structure
% created by pop_runhtb() to the SHARCNET scheduler via sshfrommatlab calls
% (given that this is being called by a Microsoft based OS [Windows]). This
% function makes use of the sshfrommatlab toolbox included in the
% "external" folder of the this plugin.
%
% Usage:
% >> job_struct=rsub_sshfm(job_struct)
%
%
% Required Inputs:
% job_struct = structure created by pop_runhtb that contains the
% combined information required to submit a batch pipeline
% to the SHARCNET scheduler.
%
% Outputs:
% job_struct = updated intput.
%
% Notes:
% This function is called to submit a batch pipeline to the SHARCNET
% scheduler when the batch_config.exec_func is set to ef_sqsub and the
% "Remote submit communication method" is set to "sshfrommatlab".
%
% See also: pop_runhtb(), ef_sqsub()
% Copyright (C) 2017 Brock University Cognitive and Affective Neuroscience Lab
%
% Code written by James A. Desjardins, Allan Campopiano, and Andrew Lofts
%
% 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 job_struct=rsub_sshfm(job_struct)
% Removed Order inds
% no More order inds (1) and (2)
% job_struct(length(job_struct))
%% LOAD THE QSUB.TXT FILE...
if ~isfield(job_struct(length(job_struct)),'user_password');
if isfield(job_struct(length(job_struct)).context_config,'remote_user_name');
job_struct(length(job_struct)).user_password=logindlg('Title',[job_struct(length(job_struct)).context_config.remote_user_name,'@',job_struct(length(job_struct)).context_config.remote_exec_host],'Password','only');
else
[job_struct(length(job_struct)).context_coonfig.remote_user_name,job_struct(length(job_struct)).user_password]=logindlg('Title',job_struct(length(job_struct)).context_config.remote_exec_host);
end
end
%% INITIATE THE SSH CONNECTION...
conn=sshfrommatlab(job_struct(length(job_struct)).context_config.remote_user_name, ...
job_struct(length(job_struct)).context_config.remote_exec_host, ...
job_struct(1).user_password);
%% SFTP FROMMATLAB M FILES TO THE REMOTE LOG...
zip([fullfile(job_struct(length(job_struct)).context_config.log,job_struct(length(job_struct)).m_path),'.zip'], ...
'*.*',fullfile(job_struct(length(job_struct)).context_config.log,job_struct(length(job_struct)).m_path));
job_struct(length(job_struct)).remote_log=fullfile(job_struct(length(job_struct)).remote_work, ...
job_struct(length(job_struct)).context_config.log, ...
[job_struct(length(job_struct)).m_path,'.zip']);
job_struct(length(job_struct)).remote_log=strrep(job_struct(length(job_struct)).remote_log,'\','/');
sftpfrommatlab(job_struct(length(job_struct)).context_config.remote_user_name, ...
job_struct(length(job_struct)).context_config.remote_exec_host, ...
job_struct(1).user_password, ...
fullfile(cd,fullfile(job_struct(length(job_struct)).context_config.log, ...
[job_struct(length(job_struct)).m_path,'.zip'])), ...
job_struct(length(job_struct)).remote_log)
%% GET THE QSUBSTR... UPDATE TO EXECUTION OF BASH SCRIPT...
%job_struct;
unzipcom=['cd ',job_struct(length(job_struct)).remote_work,'; ', ...
'unzip ',[strrep(fullfile(job_struct(length(job_struct)).context_config.log,job_struct(length(job_struct)).m_path),'\','/'),'.zip -d '], ...
strrep(fullfile(job_struct(length(job_struct)).context_config.log,job_struct(length(job_struct)).m_path),'\','/'),'; ' ...
' chmod 755 ',strrep(fullfile(job_struct(length(job_struct)).context_config.log,job_struct(length(job_struct)).m_path),'\','/'),'/submit.sh; ', ...
strrep(fullfile(job_struct(length(job_struct)).context_config.log,job_struct(length(job_struct)).m_path),'\','/'),'/submit.sh;'];
%% ISSUE THE SQSUBSTR...
[conn,result]=sshfrommatlabissue(conn,unzipcom);
disp(result)
%% COLLECT THE NEW JOBIDS FROM THE SCHEDULLER...
job_struct(length(job_struct)).jobids={};
for bfi=1:length(job_struct(length(job_struct)).batch_dfn);
jobidstr=strtrim(result{length(result)-length(job_struct(length(job_struct)).batch_dfn)+bfi});
sinds=strfind(jobidstr,' ');
job_struct(length(job_struct)).jobids{bfi}=jobidstr(sinds(end)+1:end);
end
%% CLOSE SSHFROMMATLAB CONNECTION...
sshfrommatlabclose(conn);
......@@ -3,12 +3,14 @@
% that this is being called by a Unix based OS [Linux or Mac]).
%
% Usage:
% >> job_struct=rsub_sys(job_struct)
% >> job_struct=rsub_sys(job_struct, driver, password)
%
% Required Inputs:
% job_struct = structure created by pop_runhtb that contains the
% combined information required to submit a batch pipeline
% to the SHARCNET scheduler.
% job_struct = structure created by pop_runhtb that contains the
% combined information required to submit a batch pipeline
% to the SHARCNET scheduler.
% driver = scheduler driver
% sshfm_opts = password for sshfm if used, and other opts
%
% Outputs:
% job_struct = updated intput.
......@@ -40,8 +42,9 @@
% write to the Free Software Foundation, Inc., 59 Temple Place,
% Suite 330, Boston, MA 02111-1307 USA
function job_struct=rsub_sys(job_struct, driver)
function job_struct=rsub_sys(job_struct, driver, sshfm_opts)
issshfm = nargin > 2 && ~isempty(sshfm_opts);
tjob = job_struct(end);
cc = tjob.context_config;
......@@ -59,13 +62,21 @@ tjob.remote_log = strrep(tjob.remote_log, '\', '/');
job_struct(end).remote_log = tjob.remote_log;
%% SECURE COPY M FILE TO REMOTE HOST...
cmdstr = sprintf('scp %s %s@%s:%s', ...
fullfile(cd, cc.log, [tjob.m_path,'.zip']), ...
cc.remote_user_name, ...
cc.remote_exec_host, ...
tjob.remote_log);
system_cmd_or_error(cmdstr, 'Failed to copy to remote');
ziplocal = fullfile(cd, cc.log, [tjob.m_path,'.zip']);
if ~issshfm
cmdstr = sprintf('scp %s %s@%s:%s', ...
ziplocal, ...
cc.remote_user_name, ...
cc.remote_exec_host, ...
tjob.remote_log);
system_cmd_or_error(cmdstr, 'Failed to copy to remote');
else
ssh2_conn = ssh2_config(cc.remote_exec_host, cc.remote_user_name, ...
sshfm_opts.password);
[localpath, localname, localext ] = fileparts(ziplocal);
ssh2_conn = scp_put(ssh2_conn, [localname localext], ...
tjob.remote_log, localpath);
end
%% GET THE QSUBSTR... UPDATE TO EXECUTION OF BASH SCRIPT...
......@@ -74,17 +85,26 @@ long_mpath = fullfile(cc.log, tjob.m_path);
sshhost = sprintf('%s@%s', cc.remote_user_name, cc.remote_exec_host);
sys_str = ['ssh %s ''cd %s && unzip %s.zip -d %s' ...
' && rm %s.zip && chmod +x %s/submit.sh && %s/submit.sh'''];
cmdstr = sprintf(sys_str, sshhost, ...
cmd_str = ['cd %s && unzip %s.zip -d %s' ...
' && rm %s.zip && chmod +x %s/submit.sh && %s/submit.sh'];
cmd_str = sprintf(cmd_str, ...
tjob.remote_work, ...
long_mpath, long_mpath, ...
long_mpath, ...
long_mpath, ...
long_mpath);
result_str = system_cmd_or_error(cmdstr, 'Failed to submit script');
if ~issshfm
sys_str = sprintf('ssh %s ''%s''', sshhost, cmd_str);
result_str = system_cmd_or_error(sys_str, 'Failed to submit script');
else
ssh2_conn = ssh2_command(ssh2_conn, cmd_str);
result_str = ssh2_conn.command_result;
% result_str is cell array, we must change it to one string
result_str = sprintf('%s\n', result_str{:});
% remove last newline
result_str = result_str(1:end-1);
ssh2_close(ssh2_conn);
end
%% COLLECT THE NEW JOBIDS FROM THE SCHEDULER...
......
......@@ -24,7 +24,8 @@
% Copyright (C) 2017 Brock University Cognitive and Affective Neuroscience Lab
%
% Code written by James A. Desjardins, Allan Campopiano, and Andrew Lofts
% Code written by James A. Desjardins, Allan Campopiano, Andrew Lofts,
% and Brad Kennedy
%
% 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
......@@ -60,7 +61,7 @@ catch %if nonexistent in workspace
context_config = init_context_config;
end
rsub_meth_cell = {'system', 'sshfrommatlab', 'none'};
rsub_meth_cell = {'system', 'ssh2', 'none'};
%% HANDLE batch_config...
PropGridStr_batchconfig = ...
......@@ -256,6 +257,7 @@ end %End of solo file selected if statement
%% START BATCHING PROCEDURE...
starttime = datestr(now, 'yyyy-mm-ddTHH-MM-SS');
password_sshfm = '';
for hi=1:length(htb_fname)
%% DO FOR EACH HISTORY FILES FILE...
......@@ -296,7 +298,7 @@ for hi=1:length(htb_fname)
job_struct(hi).starttime = starttime;
job_struct(hi).exec_str = {''};
if strcmp(batch_config(hi).exec_func,'ef_current_base')
job_struct=ef_current_base(job_struct);
job_struct = ef_current_base(job_struct);
else
switch batch_config(hi).exec_func
case 'ef_sqsub'
......@@ -315,9 +317,16 @@ for hi=1:length(htb_fname)
switch rsub_meth
case 'system'
job_struct = rsub_sys(job_struct, driver);
case 'sshfrommatlab'
case 'ssh2'
disp('submitting jobs using sshfrommatlab...')
job_struct = rsub_sshfm(job_struct);
if isempty(password_sshfm)
password_sshfm = passwordEntryDialog(...
'WindowName', sprintf('Password for %s on %s', ...
context_config.remote_user_name, ...
context_config.remote_exec_host));
end
sshfm_opts.password = password_sshfm;
job_struct = rsub_sys(job_struct, driver, sshfm_opts);
case 'none'
disp('The job files are generated ... finished.');
end
......
Copyright (c) 2010, Jeremy Smith
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN