Cosmetic changes: converted files to Unix end-of-line convention + fixed copyright notices and dates

time-shift
Sébastien Villemot 2010-02-15 16:52:36 +01:00
parent 44623a1d3f
commit d6faa47807
20 changed files with 222 additions and 162 deletions

View File

@ -59,7 +59,7 @@ function [ErrorCode] = AnalyseComputationalEnviroment(DataInput)
% Then at the point call of this function it is possible react in a best way, in accord % Then at the point call of this function it is possible react in a best way, in accord
% with the ErrorCode. % with the ErrorCode.
% Copyright (C) 2009 Dynare Team % Copyright (C) 2009-2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %

View File

@ -27,7 +27,7 @@ function [alphahat,etahat,atilde, aK] = DiffuseKalmanSmoother1(T,R,Q,Pinf1,Pstar
% Models", S.J. Koopman and J. Durbin (2003, in Journal of Time Series % Models", S.J. Koopman and J. Durbin (2003, in Journal of Time Series
% Analysis, vol. 24(1), pp. 85-98). % Analysis, vol. 24(1), pp. 85-98).
% Copyright (C) 2004-2008 Dynare Team % Copyright (C) 2004-2008,2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %

View File

@ -1,58 +1,56 @@
function [nCPU]= GiveCPUnumber (ComputerInformations) function [nCPU]= GiveCPUnumber (ComputerInformations)
% DESCRIPTION
% DESCRIPTION % This function return the CPUs or cores numer avaiable
% This function return the CPUs or cores numer avaiable % on the computer used for run parallel code.
% on the computer used for run parallel code. %
% INPUTS
% INPUTS % an array contained several fields that describe the hardaware
% an array contained several fields that describe the hardaware % software enviroments of a generic computer.
% software enviroments of a generic computer. %
% % OUTPUTS
% OUTPUTS % The CPUs or Cores numbers of computer.
% The CPUs or Cores numbers of computer. %
% % SPECIAL REQUIREMENTS
% SPECIAL REQUIREMENTS % none
% none
% Copyright (C) 2010 Dynare Team
% Copyright (C) 2005-2009 Dynare Team %
% % This file is part of Dynare.
% This file is part of Dynare. %
% % Dynare is free software: you can redistribute it and/or modify
% Dynare is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by
% it under the terms of the GNU General Public License as published by % the Free Software Foundation, either version 3 of the License, or
% the Free Software Foundation, either version 3 of the License, or % (at your option) any later version.
% (at your option) any later version. %
% % Dynare is distributed in the hope that it will be useful,
% Dynare is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of
% but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details.
% GNU General Public License for more details. %
% % You should have received a copy of the GNU General Public License
% You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
nCPU=-1;
nCPU=-1;
OffSet=27;
OffSet=27;
SringPosition=strfind(ComputerInformations, 'Processors:');
SringPosition=strfind(ComputerInformations, 'Processors:'); nCPU=ComputerInformations(SringPosition+OffSet);
nCPU=ComputerInformations(SringPosition+OffSet);
% We check if there are Processors/Cores more than 9.
% We check if there are Processors/Cores more than 9.
t0=ComputerInformations(SringPosition+OffSet+1);
t0=ComputerInformations(SringPosition+OffSet+1); t1=str2num(t0);
t1=str2num(t0); t1=isempty(t1);
t1=isempty(t1);
% if t1 is 0 the machine have more than 9 CPU.
% if t1 is 0 the machine have more than 9 CPU.
if t1==0
if t1==0 nCPU=strcat(nCPU,t0);
nCPU=strcat(nCPU,t0); end
end
nCPU=str2num(nCPU);
nCPU=str2num(nCPU);
return
return

View File

@ -13,7 +13,7 @@ function McMCDiagnostics(options_, estim_params_, M_)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2005-2008 Dynare Team % Copyright (C) 2005-2008,2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %

View File

@ -11,7 +11,7 @@ function PosteriorIRF(type)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% None % None
% Copyright (C) 2006-2008 Dynare Team % Copyright (C) 2006-2008,2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %

View File

@ -12,7 +12,7 @@ function myoutput=PosteriorIRF_core1(myinputs,fpar,npar,whoiam, ThisMatlab)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% None % None
% Copyright (C) 2006-2008 Dynare Team % Copyright (C) 2006-2008,2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %

View File

@ -1,5 +1,22 @@
function myoutput=PosteriorIRF_core2(myinputs,fpar,npar,whoiam, ThisMatlab) function myoutput=PosteriorIRF_core2(myinputs,fpar,npar,whoiam, ThisMatlab)
% Copyright (C) 2006-2008,2010 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/>.
global options_ M_ global options_ M_
if nargin<4, if nargin<4,

View File

@ -25,7 +25,7 @@ function ReshapeMatFiles(type, type2)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2003-2007 Dynare Team % Copyright (C) 2003-2007,2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %

View File

@ -1,40 +1,37 @@
function [] = Tracing() function [] = Tracing()
% DESCRIPTION
% DESCRIPTION % This function is used to test the correct execution of a matlab section
% This function is used to test the correct execution of a matlab section % on remote machine.
% on remote machine. %
% % If no error happen the function simply create a file.
% If no error happen the function simply create a file. %
% INPUTS
% INPUTS % ...
% ... %
% % OUTPUTS
% OUTPUTS % ...
% ... %
% % SPECIAL REQUIREMENTS
% SPECIAL REQUIREMENTS % none
% none
% Copyright (C) 2010 Dynare Team
% Copyright (C) 2005-2009 Dynare Team %
% % This file is part of Dynare.
% This file is part of Dynare. %
% % Dynare is free software: you can redistribute it and/or modify
% Dynare is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by
% it under the terms of the GNU General Public License as published by % the Free Software Foundation, either version 3 of the License, or
% the Free Software Foundation, either version 3 of the License, or % (at your option) any later version.
% (at your option) any later version. %
% % Dynare is distributed in the hope that it will be useful,
% Dynare is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of
% but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details.
% GNU General Public License for more details. %
% % You should have received a copy of the GNU General Public License
% You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
fid = fopen('Tracing.txt','w+');
fclose (fid);
fid = fopen('Tracing.txt','w+');
fclose (fid); exit
exit

View File

@ -1,14 +1,31 @@
function closeSlave(Parallel), function closeSlave(Parallel),
% In a parallelc context, this utility closes all remote matlab instances % In a parallelc context, this utility closes all remote matlab instances
% called by masteParallelMan (which leaves open remote matlab instances) % called by masteParallelMan (which leaves open remote matlab instances)
delete( 'slaveParallel_input*.mat'); % Copyright (C) 2010 Dynare Team
for indPC=1:length(Parallel), %
if Parallel(indPC).Local==0, % This file is part of Dynare.
if isunix || (~matlab_ver_less_than('7.4') && ismac), %
system(['ssh ',Parallel(indPC).user,'@',Parallel(indPC).PcName,' rm -fr ',Parallel(indPC).RemoteFolder,'/slaveParallel_input*.mat']); % Dynare is free software: you can redistribute it and/or modify
else % it under the terms of the GNU General Public License as published by
mydelete('slaveParallel_input*.mat',['\\',Parallel(indPC).PcName,'\',Parallel(indPC).RemoteDrive,'$\',Parallel(indPC).RemoteFolder,'\']); % the Free Software Foundation, either version 3 of the License, or
end % (at your option) any later version.
end %
end % 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/>.
delete( 'slaveParallel_input*.mat');
for indPC=1:length(Parallel),
if Parallel(indPC).Local==0,
if isunix || (~matlab_ver_less_than('7.4') && ismac),
system(['ssh ',Parallel(indPC).user,'@',Parallel(indPC).PcName,' rm -fr ',Parallel(indPC).RemoteFolder,'/slaveParallel_input*.mat']);
else
mydelete('slaveParallel_input*.mat',['\\',Parallel(indPC).PcName,'\',Parallel(indPC).RemoteDrive,'$\',Parallel(indPC).RemoteFolder,'\']);
end
end
end

View File

@ -1,37 +1,36 @@
function [nCPU, totCPU, nBlockPerCPU] = distributeJobs(Parallel, fBlock, nBlock) function [nCPU, totCPU, nBlockPerCPU] = distributeJobs(Parallel, fBlock, nBlock)
% Determine the total number of available CPUs, and the number of threads to run on each CPU
% Determine the total number of available CPUs, and the number of threads to run on each CPU
% Copyright (C) 2010 Dynare Team
% Copyright (C) 2009 Dynare Team %
% % This file is part of Dynare.
% This file is part of Dynare. %
% % Dynare is free software: you can redistribute it and/or modify
% Dynare is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by
% it under the terms of the GNU General Public License as published by % the Free Software Foundation, either version 3 of the License, or
% the Free Software Foundation, either version 3 of the License, or % (at your option) any later version.
% (at your option) any later version. %
% % Dynare is distributed in the hope that it will be useful,
% Dynare is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of
% but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details.
% GNU General Public License for more details. %
% % You should have received a copy of the GNU General Public License
% You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
totCPU=0;
totCPU=0; for j=1:length(Parallel),
for j=1:length(Parallel), nCPU(j)=length(Parallel(j).NumCPU);
nCPU(j)=length(Parallel(j).NumCPU); totCPU=totCPU+nCPU(j);
totCPU=totCPU+nCPU(j); end
end
nCPU=cumsum(nCPU);
nCPU=cumsum(nCPU); offset0 = fBlock-1;
offset0 = fBlock-1; if (nBlock-offset0)>totCPU,
if (nBlock-offset0)>totCPU, diff = mod((nBlock-offset0),totCPU);
diff = mod((nBlock-offset0),totCPU); nBlockPerCPU(1:diff) = ceil((nBlock-offset0)/totCPU);
nBlockPerCPU(1:diff) = ceil((nBlock-offset0)/totCPU); nBlockPerCPU(diff+1:totCPU) = floor((nBlock-offset0)/totCPU);
nBlockPerCPU(diff+1:totCPU) = floor((nBlock-offset0)/totCPU); else
else nBlockPerCPU(1:nBlock-offset0)=1;
nBlockPerCPU(1:nBlock-offset0)=1; totCPU = nBlock-offset0;
totCPU = nBlock-offset0; end
end

View File

@ -11,7 +11,7 @@ function global_initialization()
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2003-2008 Dynare Team % Copyright (C) 2003-2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %

View File

@ -19,7 +19,7 @@ function independent_metropolis_hastings(TargetFun,ProposalFun,xparam1,vv,mh_bou
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% None. % None.
% Copyright (C) 2006-2008 Dynare Team % Copyright (C) 2006-2008,2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %

View File

@ -29,7 +29,7 @@ function [fOutVar,nBlockPerCPU, totCPU] = masterParallel(Parallel,fBlock,nBlock,
% the number of CPU declared in "Parallel", if % the number of CPU declared in "Parallel", if
% the number of required threads is lower) % the number of required threads is lower)
% Copyright (C) 2009 Dynare Team % Copyright (C) 2009-2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %

View File

@ -31,7 +31,7 @@ function [fOutVar,nBlockPerCPU, totCPU] = masterParallelMan(Parallel,fBlock,nBlo
% the number of CPU declared in "Parallel", if % the number of CPU declared in "Parallel", if
% the number of required threads is lower) % the number of required threads is lower)
% Copyright (C) 2009 Dynare Team % Copyright (C) 2009-2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %

View File

@ -1,6 +1,6 @@
function pm3(n1,n2,ifil,B,tit1,tit2,tit3,tit_tex,names1,names2,name3,DirectoryName,var_type) function pm3(n1,n2,ifil,B,tit1,tit2,tit3,tit_tex,names1,names2,name3,DirectoryName,var_type)
% Copyright (C) 2007-2009 Dynare Team % Copyright (C) 2007-2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %

View File

@ -1,5 +1,21 @@
function myoutput=pm3_core(myinputs,fpar,nvar,whoiam, ThisMatlab) function myoutput=pm3_core(myinputs,fpar,nvar,whoiam, ThisMatlab)
% Copyright (C) 2007-2010 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/>.
if nargin<4, if nargin<4,
whoiam=0; whoiam=0;

View File

@ -18,7 +18,7 @@ function prior_posterior_statistics(type,Y,gend,data_index,missing_value)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2005-2009 Dynare Team % Copyright (C) 2005-2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %

View File

@ -1,5 +1,21 @@
function myoutput=prior_posterior_statistics_core(myinputs,fpar,B,whoiam, ThisMatlab) function myoutput=prior_posterior_statistics_core(myinputs,fpar,B,whoiam, ThisMatlab)
% Copyright (C) 2005-2010 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/>.
if nargin<4, if nargin<4,
whoiam=0; whoiam=0;

View File

@ -19,7 +19,7 @@ function random_walk_metropolis_hastings(TargetFun,ProposalFun,xparam1,vv,mh_bou
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% None. % None.
% Copyright (C) 2006-2008 Dynare Team % Copyright (C) 2006-2008,2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %