Home > matlab > parallel > dynareParallelFindNewFiles.m

dynareParallelFindNewFiles

PURPOSE ^

PARALLEL CONTEXT

SYNOPSIS ^

function [NewFilesFrom, NewFileList]=dynareParallelFindNewFiles(FileList,Parallel, PRCDir)

DESCRIPTION ^

 PARALLEL CONTEXT
 In a parallel context, this function  checks if in 'dirName' and its sub-directory
 there are other files in addition to 'FileList'.
 If 'Yes' the variable 'NewFiles' is a list of these file.


 INPUTS
  o dirName                     []   ...
  o Parallel                    []   ...
  o PRCDir                      []   ...

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [NewFilesFrom, NewFileList]=dynareParallelFindNewFiles(FileList,Parallel, PRCDir)
0002 
0003 % PARALLEL CONTEXT
0004 % In a parallel context, this function  checks if in 'dirName' and its sub-directory
0005 % there are other files in addition to 'FileList'.
0006 % If 'Yes' the variable 'NewFiles' is a list of these file.
0007 %
0008 %
0009 % INPUTS
0010 %  o dirName                     []   ...
0011 %  o Parallel                    []   ...
0012 %  o PRCDir                      []   ...
0013 
0014 %  OUTPUTS
0015 %  o NewFilesFrom          []   ...
0016 %  o NewFileList           []   ...
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 NewFilesFrom={};
0037 
0038 LfL=length(FileList);
0039                                         % The first call ...
0040 NewFileList = dynareParallelListAllFiles('Root',PRCDir,Parallel);
0041 
0042 
0043 LnFl=length(NewFileList);
0044 
0045 RelativePosition=1;
0046 
0047 for i=1:LnFl
0048     
0049     % Exception Handling
0050     
0051     % If you comment the code below all new file will be copied!
0052     
0053     % 1. The comp_status* files are managed separately.
0054     
0055     FiCoS=strfind(NewFileList{i},'comp_status_');
0056     if ~isempty(FiCoS)
0057         continue
0058     end
0059     
0060     % 2. For the time being is not necessary to always copy *.log
0061     %    and *.txt files.
0062     
0063     nC1 = strfind(NewFileList{i}, '.log');
0064     nC2 = strfind(NewFileList{i}, '.txt');
0065     
0066     if (~isempty(nC1) || ~isempty(nC2))
0067         continue
0068     end
0069     
0070     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0071     
0072     
0073     N=strmatch(NewFileList{i},FileList,'exact');
0074     if isempty(N)
0075         NewFilesFrom{RelativePosition}=NewFileList{i};
0076         RelativePosition=RelativePosition+1;
0077     end
0078 end
0079

Generated on Tue 22-May-2012 02:40:23 by m2html © 2005