Skip to content
Snippets Groups Projects
Commit 4c7960fb authored by Johannes Pfeifer's avatar Johannes Pfeifer Committed by Stéphane Adjemian
Browse files

AnalyseComputationalEnvironment.m: print out command that caused error as well as system response

parent 3a622738
Branches
Tags
No related merge requests found
...@@ -284,14 +284,19 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' ...@@ -284,14 +284,19 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
else else
ssh_token = ''; ssh_token = '';
end end
command_string=['ssh ',ssh_token,' ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' ls ',DataInput(Node).RemoteDirectory,'/',RemoteTmpFolder,'/'];
[si2 de2]=system(['ssh ',ssh_token,' ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' ls ',DataInput(Node).RemoteDirectory,'/',RemoteTmpFolder,'/']); [si2 de2]=system(command_string);
if (si2) if (si2)
disp ('Remote Directory does not exist or is not reachable!') disp ('Remote Directory does not exist or is not reachable!')
skipline() skipline()
disp('ErrorCode 5.') disp('ErrorCode 5.')
skipline(2) skipline(2)
disp('The command causing the error was:')
disp(command_string)
disp('The system returned:')
disp(de2)
skipline(2)
ErrorCode=5; ErrorCode=5;
return return
end end
...@@ -317,13 +322,19 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' ...@@ -317,13 +322,19 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
si2=[]; si2=[];
de2=[]; de2=[];
[si2 de2]=system(['dir \\',DataInput(Node).ComputerName,'\',DataInput(Node).RemoteDrive,'$\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder]); command_string=['dir \\',DataInput(Node).ComputerName,'\',DataInput(Node).RemoteDrive,'$\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder];
[si2 de2]=system(command_string);
if (si2) if (si2)
disp ('Remote Directory does not exist or it is not reachable!') disp ('Remote Directory does not exist or it is not reachable!')
skipline() skipline()
disp('ErrorCode 5.') disp('ErrorCode 5.')
skipline(2) skipline(2)
disp('The command causing the error was:')
disp(command_string)
disp('The system returned:')
disp(de2)
skipline(2)
ErrorCode=5; ErrorCode=5;
return return
end end
...@@ -576,19 +587,30 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' ...@@ -576,19 +587,30 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
end end
if OStargetUnix if OStargetUnix
if RemoteEnvironment ==1 if RemoteEnvironment ==1
[si0 de0]=system(['ssh ',ssh_token,' ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' grep processor /proc/cpuinfo']); command_string=['ssh ',ssh_token,' ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' grep processor /proc/cpuinfo'];
[si0 de0]=system(command_string);
else % it is MAC else % it is MAC
[si0 de0]=system(['ssh ',ssh_token,' ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' sysctl -n hw.ncpu']); command_string=['ssh ',ssh_token,' ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' sysctl -n hw.ncpu'];
[si0 de0]=system(command_string);
Environment1=2; Environment1=2;
end end
else else
[si0 de0]=system(['ssh ',ssh_token,' ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' psinfo']); command_string=['ssh ',ssh_token,' ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' psinfo'];
[si0 de0]=system(command_string);
end end
else else
[si0 de0]=system(['psinfo \\',DataInput(Node).ComputerName,' -u ',DataInput(Node).UserName,' -p ',DataInput(Node).Password]); command_string=['psinfo \\',DataInput(Node).ComputerName,' -u ',DataInput(Node).UserName,' -p ',DataInput(Node).Password];
[si0 de0]=system(command_string);
end end
end end
if (si0)
disp('The command causing the error was:')
disp(command_string)
disp('The system returned:')
disp(de0)
skipline(2)
end
RealCPUnbr=''; RealCPUnbr='';
% keyboard; % keyboard;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment