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

provisions in testing routines for hybrid unix/win clusters

parent 64e6de59
No related branches found
No related tags found
No related merge requests found
...@@ -98,13 +98,20 @@ dynareParallelMkDir(RemoteTmpFolder,DataInput); ...@@ -98,13 +98,20 @@ dynareParallelMkDir(RemoteTmpFolder,DataInput);
ErrorCode=0; ErrorCode=0;
for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
% and use AnalyseComputationalEnvironment with differents input!
% Determine the operating system or software version when necessary % Determine the operating system or software version when necessary
% for different command types. % for different command types.
Environment=~ispc;
OScallerUnix=~ispc;
OScallerWindows=ispc;
OStargetUnix=strcmpi('unix',DataInput(Node).OperatingSystem);
OStargetWindows=strcmpi('windows',DataInput(Node).OperatingSystem);
for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' Environment= (OScallerUnix || OStargetUnix);
% and use AnalyseComputationalEnvironment with differents input!
disp(' '); disp(' ');
disp(' '); disp(' ');
...@@ -162,7 +169,11 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' ...@@ -162,7 +169,11 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
de1=[]; de1=[];
if Environment if Environment
if OScallerWindows
[si1 de1]=system(['ping ', DataInput(Node).ComputerName]);
else
[si1 de1]=system(['ping ', DataInput(Node).ComputerName, ' -c 4']); [si1 de1]=system(['ping ', DataInput(Node).ComputerName, ' -c 4']);
end
else else
[si1 de1]=system(['ping ', DataInput(Node).ComputerName]); [si1 de1]=system(['ping ', DataInput(Node).ComputerName]);
end end
...@@ -205,7 +216,6 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' ...@@ -205,7 +216,6 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
% This check can be removed ... according to the dynare parser % This check can be removed ... according to the dynare parser
% strategy. % strategy.
if (~isempty(DataInput(Node).Password)) if (~isempty(DataInput(Node).Password))
disp('[WARNING] The field Password should be empty under unix or mac!'); disp('[WARNING] The field Password should be empty under unix or mac!');
disp(' '); disp(' ');
...@@ -221,7 +231,6 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' ...@@ -221,7 +231,6 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
disp(' '); disp(' ');
disp(' '); disp(' ');
end end
else else
% This check can be removed ... according to the dynare parser % This check can be removed ... according to the dynare parser
...@@ -267,7 +276,7 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' ...@@ -267,7 +276,7 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
% strategy. % strategy.
if (~isempty(DataInput(Node).RemoteDrive)) if (~isempty(DataInput(Node).RemoteDrive))
disp('[WARNING] The fields RemoteDrive should be empty under unix or max!'); disp('[WARNING] The fields RemoteDrive should be empty under unix or mac!');
disp(' '); disp(' ');
disp(['remove the string ',DataInput(Node).RemoteDrive,' from this field!']); disp(['remove the string ',DataInput(Node).RemoteDrive,' from this field!']);
disp(' '); disp(' ');
...@@ -402,13 +411,13 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' ...@@ -402,13 +411,13 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
% the path is MatlabOctavePath. % the path is MatlabOctavePath.
if Environment if Environment
if exist('OCTAVE_VERSION') if strfind([DataInput(Node).MatlabOctavePath], 'octave') % Hybrid computing Matlab(Master)->Octave(Slaves) and Vice Versa!
system(['ssh ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' "cd ',DataInput(Node).RemoteDirectory,'/',RemoteTmpFolder, '; ', DataInput(Node).MatlabOctavePath, ' Tracing.m;" &']); system(['ssh ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' "cd ',DataInput(Node).RemoteDirectory,'/',RemoteTmpFolder, '; ', DataInput(Node).MatlabOctavePath, ' Tracing.m;" &']);
else else
system(['ssh ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' "cd ',DataInput(Node).RemoteDirectory,'/',RemoteTmpFolder, '; ', DataInput(Node).MatlabOctavePath, ' -nosplash -nodesktop -minimize -r Tracing;" &']); system(['ssh ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' "cd ',DataInput(Node).RemoteDirectory,'/',RemoteTmpFolder, '; ', DataInput(Node).MatlabOctavePath, ' -nosplash -nodesktop -minimize -r Tracing;" &']);
end end
else else
if exist('OCTAVE_VERSION') if strfind([DataInput(Node).MatlabOctavePath], 'octave') % Hybrid computing Matlab(Master)->Octave(Slaves) and Vice Versa!
[NonServeS NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e -u ',DataInput(Node).UserName,' -p ',DataInput(Node).Password,' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' Tracing.m']); [NonServeS NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e -u ',DataInput(Node).UserName,' -p ',DataInput(Node).Password,' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' Tracing.m']);
else else
[NonServeS NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e -u ',DataInput(Node).UserName,' -p ',DataInput(Node).Password,' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' -nosplash -nodesktop -minimize -r Tracing']); [NonServeS NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e -u ',DataInput(Node).UserName,' -p ',DataInput(Node).Password,' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' -nosplash -nodesktop -minimize -r Tracing']);
...@@ -467,7 +476,7 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' ...@@ -467,7 +476,7 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
disp(' '); disp(' ');
disp('please wait ... '); disp('please wait ... ');
disp(' '); disp(' ');
pause(1) pause(2)
if isempty(dynareParallelDir('DynareIsOk.txt',RemoteTmpFolder,DataInput(Node))) if isempty(dynareParallelDir('DynareIsOk.txt',RemoteTmpFolder,DataInput(Node)))
ErrorCode=8; ErrorCode=8;
...@@ -563,6 +572,10 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' ...@@ -563,6 +572,10 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
RealCPUnbr=GiveCPUnumber(de0); RealCPUnbr=GiveCPUnumber(de0);
% Questo controllo penso che si possa MIGLIORARE!!!!! % Questo controllo penso che si possa MIGLIORARE!!!!!
if isempty (RealCPUnbr) && Environment==0,
[si0 de0]=system(['psinfo \\',DataInput(Node).ComputerName]);
end
RealCPUnbr=GiveCPUnumber(de0);
if isempty (RealCPUnbr) if isempty (RealCPUnbr)
% An error occurred when we try to know the Cpu/Cores % An error occurred when we try to know the Cpu/Cores
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment