2011-05-04 10:21:25 +02:00
|
|
|
function [PRCDirSnapshot]=dynareParallelGetNewFiles(PRCDir,Parallel,PRCDirSnapshot)
|
|
|
|
% PARALLEL CONTEXT
|
|
|
|
% In a parallel context, this is a specialized function able to ...
|
|
|
|
%
|
|
|
|
%
|
|
|
|
% INPUTS
|
2011-05-10 10:07:18 +02:00
|
|
|
%
|
|
|
|
% o PRCDir [] ...
|
|
|
|
% o Parallel [] ...
|
|
|
|
% o PRCDirSnapshot [] ...
|
|
|
|
%
|
2011-05-04 10:21:25 +02:00
|
|
|
%
|
|
|
|
% OUTPUTS
|
2011-05-10 10:07:18 +02:00
|
|
|
% o PRCDirSnapshot [] ...
|
2011-05-04 10:21:25 +02:00
|
|
|
%
|
|
|
|
%
|
|
|
|
%
|
2022-04-13 13:15:19 +02:00
|
|
|
% Copyright © 2009-2017 Dynare Team
|
2011-05-04 10:21:25 +02:00
|
|
|
%
|
|
|
|
% This file is part of Dynare.
|
|
|
|
%
|
|
|
|
% Dynare is free software: you can redistribute it and/or modify
|
|
|
|
% it under the terms of the GNU General Public License as published by
|
|
|
|
% the Free Software Foundation, either version 3 of the License, or
|
|
|
|
% (at your option) any later version.
|
|
|
|
%
|
|
|
|
% Dynare is distributed in the hope that it will be useful,
|
|
|
|
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
% GNU General Public License for more details.
|
|
|
|
%
|
|
|
|
% You should have received a copy of the GNU General Public License
|
2021-06-09 17:33:48 +02:00
|
|
|
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
2011-05-04 10:21:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
NewFilesFromSlaves={};
|
|
|
|
|
|
|
|
% try
|
2017-05-16 12:42:01 +02:00
|
|
|
for indPC=1:length(Parallel)
|
2017-05-16 15:10:20 +02:00
|
|
|
|
2017-05-16 12:42:01 +02:00
|
|
|
if Parallel(indPC).Local==0
|
2011-05-04 10:21:25 +02:00
|
|
|
[NewFilesFromSlaves, PRCDirSnapshot{indPC}]=dynareParallelFindNewFiles(PRCDirSnapshot{indPC},Parallel(indPC), PRCDir);
|
2017-05-16 12:42:01 +02:00
|
|
|
if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem)
|
2011-05-04 10:21:25 +02:00
|
|
|
fS='/';
|
|
|
|
else
|
|
|
|
fS='\';
|
|
|
|
end
|
|
|
|
|
|
|
|
if ~isempty(NewFilesFromSlaves)
|
2013-04-05 17:29:40 +02:00
|
|
|
pause(1);
|
2011-05-04 10:21:25 +02:00
|
|
|
|
|
|
|
for i=1:length(NewFilesFromSlaves)
|
|
|
|
SlashNumberAndPosition=[];
|
|
|
|
PRCDirPosition=findstr(NewFilesFromSlaves{i}, ([PRCDir]));
|
|
|
|
sT=NewFilesFromSlaves{i};
|
|
|
|
sT(1:(PRCDirPosition+length([PRCDir]))-2)=[];
|
|
|
|
sT(1)='.';
|
|
|
|
SlashNumberAndPosition=findstr(sT,fS);
|
|
|
|
fileaddress={sT(1:SlashNumberAndPosition(end)),sT(SlashNumberAndPosition(end)+1:end)};
|
|
|
|
dynareParallelGetFiles(fileaddress,PRCDir,Parallel(indPC));
|
|
|
|
|
2012-02-10 22:43:11 +01:00
|
|
|
disp('New file copied in local -->');
|
|
|
|
disp(fileaddress{2});
|
|
|
|
disp('<--');
|
2011-05-04 10:21:25 +02:00
|
|
|
|
|
|
|
end
|
|
|
|
else
|
|
|
|
continue
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|