


PARALLEL CONTEXT In a parallel context, this is a specialized function able to ... INPUTS o PRCDir [] ... o Parallel [] ... o PRCDirSnapshot [] ... OUTPUTS o PRCDirSnapshot [] ... Copyright (C) 2009-2011 Dynare Team 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 along with Dynare. If not, see <http://www.gnu.org/licenses/>.


0001 function [PRCDirSnapshot]=dynareParallelGetNewFiles(PRCDir,Parallel,PRCDirSnapshot) 0002 % PARALLEL CONTEXT 0003 % In a parallel context, this is a specialized function able to ... 0004 % 0005 % 0006 % INPUTS 0007 % 0008 % o PRCDir [] ... 0009 % o Parallel [] ... 0010 % o PRCDirSnapshot [] ... 0011 % 0012 % 0013 % OUTPUTS 0014 % o PRCDirSnapshot [] ... 0015 % 0016 % 0017 % 0018 % Copyright (C) 2009-2011 Dynare Team 0019 % 0020 % This file is part of Dynare. 0021 % 0022 % Dynare is free software: you can redistribute it and/or modify 0023 % it under the terms of the GNU General Public License as published by 0024 % the Free Software Foundation, either version 3 of the License, or 0025 % (at your option) any later version. 0026 % 0027 % Dynare is distributed in the hope that it will be useful, 0028 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0029 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0030 % GNU General Public License for more details. 0031 % 0032 % You should have received a copy of the GNU General Public License 0033 % along with Dynare. If not, see <http://www.gnu.org/licenses/>. 0034 0035 0036 NewFilesFromSlaves={}; 0037 0038 % try 0039 for indPC=1:length(Parallel), 0040 0041 if Parallel(indPC).Local==0; 0042 [NewFilesFromSlaves, PRCDirSnapshot{indPC}]=dynareParallelFindNewFiles(PRCDirSnapshot{indPC},Parallel(indPC), PRCDir); 0043 if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), 0044 fS='/'; 0045 else 0046 fS='\'; 0047 end 0048 0049 if ~isempty(NewFilesFromSlaves) 0050 0051 for i=1:length(NewFilesFromSlaves) 0052 SlashNumberAndPosition=[]; 0053 PRCDirPosition=findstr(NewFilesFromSlaves{i}, ([PRCDir])); 0054 sT=NewFilesFromSlaves{i}; 0055 sT(1:(PRCDirPosition+length([PRCDir]))-2)=[]; 0056 sT(1)='.'; 0057 SlashNumberAndPosition=findstr(sT,fS); 0058 fileaddress={sT(1:SlashNumberAndPosition(end)),sT(SlashNumberAndPosition(end)+1:end)}; 0059 dynareParallelGetFiles(fileaddress,PRCDir,Parallel(indPC)); 0060 0061 disp('New file copied in local -->'); 0062 disp(fileaddress{2}); 0063 disp('<--'); 0064 0065 end 0066 else 0067 continue 0068 end 0069 0070 0071 end 0072 end 0073 0074 0075