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

some comments and cosmethics

parent 37ebb654
Branches
Tags
No related merge requests found
......@@ -200,7 +200,6 @@ end
for j=1:totCPU,
if Strategy==1
command1 = ' ';
end
......@@ -292,8 +291,8 @@ for j=1:totCPU,
if Parallel(indPC).Local == 1, % 0.1 Run on the local machine (localhost).
if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), % Hybrid computing Matlab(Master)->Octave(Slaves) and Vice Versa!
if strfind([Parallel(indPC).MatlabOctavePath], 'octave')
if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), % Hybrid computing Windows(Master)-> Unix(Slaves)!
if strfind([Parallel(indPC).MatlabOctavePath], 'octave') % Hybrid computing Matlab(Master)->Octave(Slaves) and Vice Versa!
command1=['octave --eval "default_save_options(''-v7''); addpath(''',Parallel(indPC).DynarePath,'''), dynareroot = dynare_config(); fParallel(',int2str(offset+1),',',int2str(sum(nBlockPerCPU(1:j))),',',int2str(j),',',int2str(indPC),',''',fname,''')" &'];
else
command1=[Parallel(indPC).MatlabOctavePath,' -nosplash -nodesktop -minimize ',compThread,' -r "addpath(''',Parallel(indPC).DynarePath,'''), dynareroot = dynare_config(); fParallel(',int2str(offset+1),',',int2str(sum(nBlockPerCPU(1:j))),',',int2str(j),',',int2str(indPC),',''',fname,''')" &'];
......@@ -311,11 +310,11 @@ for j=1:totCPU,
dynareParallelSendFiles(NamFileInput,PRCDir,Parallel(indPC));
end
if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), % Hybrid computing Matlab(Master)->Octave(Slaves) and Vice Versa!
if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), % Hybrid computing Windows(Master)-> Unix(Slaves)!
if ispc, token='start /B ';
else token = '';
end
if strfind([Parallel(indPC).MatlabOctavePath], 'octave'),
if strfind([Parallel(indPC).MatlabOctavePath], 'octave'),% Hybrid computing Matlab(Master)->Octave(Slaves) and Vice Versa!
command1=[token, 'ssh ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' "cd ',Parallel(indPC).RemoteDirectory,'/',PRCDir, '; octave --eval \"default_save_options(''-v7''); addpath(''',Parallel(indPC).DynarePath,'''), dynareroot = dynare_config(); fParallel(',int2str(offset+1),',',int2str(sum(nBlockPerCPU(1:j))),',',int2str(j),',',int2str(indPC),',''',fname,''');\" " &'];
else
command1=[token, 'ssh ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' "cd ',Parallel(indPC).RemoteDirectory,'/',PRCDir, '; ',Parallel(indPC).MatlabOctavePath,' -nosplash -nodesktop -minimize ',compThread,' -r \"addpath(''',Parallel(indPC).DynarePath,'''), dynareroot = dynare_config(); fParallel(',int2str(offset+1),',',int2str(sum(nBlockPerCPU(1:j))),',',int2str(j),',',int2str(indPC),',''',fname,''');\" " &'];
......@@ -346,7 +345,7 @@ for j=1:totCPU,
case 1
if Parallel(indPC).Local == 1 && newInstance, % 1.1 Run on the local machine.
if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem),
if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), % Hybrid computing Windows(Master)-> Unix(Slaves)!
% Hybrid computing Matlab(Master)-> Octave(Slaves) and Vice Versa!
if strfind([Parallel(indPC).MatlabOctavePath], 'octave')
command1=['octave --eval "default_save_options(''-v7''); addpath(''',Parallel(indPC).DynarePath,'''), dynareroot = dynare_config(); slaveParallel(',int2str(j),',',int2str(indPC),')" &'];
......@@ -370,7 +369,7 @@ for j=1:totCPU,
dynareParallelSendFiles(['slaveJob',int2str(j),'.mat'],PRCDir,Parallel(indPC));
delete(['slaveJob',int2str(j),'.mat']);
dynareParallelSendFiles(['slaveParallel_input',int2str(j),'.mat'],PRCDir,Parallel(indPC))
if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem),
if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), % Hybrid computing Windows(Master)-> Unix(Slaves)!
if ispc, token='start /B ';
else token = '';
end
......@@ -402,6 +401,10 @@ for j=1:totCPU,
end
end
else
% When the user user strategy is equal to 1, you must
% do PRCDirSnapshot here to to avoid problems of
% synchronization.
if isempty(PRCDirSnapshot{indPC}),
PRCDirSnapshot(indPC)=dynareParallelSnapshot(PRCDir,Parallel(indPC));
else
......@@ -433,7 +436,7 @@ end
% the slaves ...
% If the compuation is 'Local' it is not necessary to do it ...
if Strategy==0 || newInstance,
if Strategy==0 || newInstance, % See above.
PRCDirSnapshot=dynareParallelSnapshot(PRCDir,Parallel(1:totSlaves));
% Run the slaves.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment