Skip to content
Snippets Groups Projects
Commit 990f3c3b authored by Marco Ratto's avatar Marco Ratto
Browse files

1) Fix compatibility problems with the Port field in unix nodes of the cluster;

2) fix in defining the list of files;
(cherry picked from commit f2cce399)
parent a1843371
No related branches found
No related tags found
No related merge requests found
...@@ -31,14 +31,19 @@ dirlist=[]; ...@@ -31,14 +31,19 @@ dirlist=[];
for indPC=1:length(Parallel), for indPC=1:length(Parallel),
if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), %isunix || (~matlab_ver_less_than('7.4') && ismac), if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), %isunix || (~matlab_ver_less_than('7.4') && ismac),
if Parallel(indPC).Local==0, if Parallel(indPC).Local==0,
if ~isempty(Parallel(indPC).Port),
ssh_token = ['-p ',Parallel(indPC).Port];
else
ssh_token = '';
end
if exist('OCTAVE_VERSION') % Patch for peculiar behaviour of ssh-ls under Linux. if exist('OCTAVE_VERSION') % Patch for peculiar behaviour of ssh-ls under Linux.
% It is necessary to capture the ls warning message. % It is necessary to capture the ls warning message.
% To do it under the ssh protocol it is necessary to redirect the ls message in a text file. % To do it under the ssh protocol it is necessary to redirect the ls message in a text file.
% The file is 'OctaveStandardOutputMessage.txt' and it is % The file is 'OctaveStandardOutputMessage.txt' and it is
% saved in the Model directory. % saved in the Model directory.
[check, ax]=system(['ssh ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' ls ',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',filename, ' 2> OctaveStandardOutputMessage.txt']); [check, ax]=system(['ssh ',ssh_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' ls ',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',filename, ' 2> OctaveStandardOutputMessage.txt']);
else else
[check, ax]=system(['ssh ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' ls ',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',filename]); [check, ax]=system(['ssh ',ssh_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' ls ',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',filename]);
end end
if check ~= 0 || ~isempty(strfind(ax,'No such file or directory')); if check ~= 0 || ~isempty(strfind(ax,'No such file or directory'));
ax=[]; ax=[];
...@@ -62,7 +67,7 @@ for indPC=1:length(Parallel), ...@@ -62,7 +67,7 @@ for indPC=1:length(Parallel),
end end
end end
dirlist = [dirlist, ax]; dirlist = char(dirlist, ax);
else else
if exist('OCTAVE_VERSION'), % Patch for peculiar behaviour of ls under Windows. if exist('OCTAVE_VERSION'), % Patch for peculiar behaviour of ls under Windows.
if Parallel(indPC).Local==0, if Parallel(indPC).Local==0,
...@@ -87,6 +92,6 @@ for indPC=1:length(Parallel), ...@@ -87,6 +92,6 @@ for indPC=1:length(Parallel),
ax=ls(filename); ax=ls(filename);
end end
end end
dirlist = [dirlist; ax]; dirlist = char(dirlist, ax);
end end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment