@@ -31,6 +31,10 @@ function [ErrorCode] = AnalyseComputationalEnvironment(DataInput, DataInputAdd)
% field RemoteTmpFolder (the temporary directory created/destroyed on remote
% computer) is used.
ifispc,
[tempo,MasterName]=system('hostname');
MasterName=deblank(MasterName);
end
RemoteTmpFolder=DataInputAdd.RemoteTmpFolder;
dynareParallelMkDir(RemoteTmpFolder,DataInput);
...
...
@@ -295,8 +299,13 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
si2=[];
de2=[];
if~isempty(DataInput(Node).Port),
ssh_token=['-p ',DataInput(Node).Port];
else
ssh_token='';
end
[si2de2]=system(['ssh ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' ls ',DataInput(Node).RemoteDirectory,'/',RemoteTmpFolder,'/']);
[si2de2]=system(['ssh ',ssh_token,' ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' ls ',DataInput(Node).RemoteDirectory,'/',RemoteTmpFolder,'/']);
if(si2)
disp('Remote Directory does not exist or is not reachable!');
...
...
@@ -332,7 +341,7 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
ifexist('OCTAVE_VERSION')% Patch for peculiar behaviour of ssh-ls under Linux.
% 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.
% The file is 'OctaveStandardOutputMessage.txt' and it is
% 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
[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
ifcheck~=0||~isempty(strfind(ax,'No such file or directory'));
ax=[];
...
...
@@ -62,7 +67,7 @@ for indPC=1:length(Parallel),
end
end
dirlist=[dirlist,ax];
dirlist=char(dirlist,ax);
else
ifexist('OCTAVE_VERSION'),% Patch for peculiar behaviour of ls under Windows.