From 44119077db09832fc172266d882719f5c029646e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Guts=29?= Date: Fri, 15 Dec 2023 16:55:24 +0100 Subject: [PATCH] Separate outputs with commas. --- matlab/optimization/cmaes.m | 2 +- .../parallel/AnalyseComputationalEnvironment.m | 16 ++++++++-------- matlab/parallel/distributeJobs.m | 2 +- matlab/parallel/dynareParallelDir.m | 2 +- matlab/parallel/dynareParallelGetFiles.m | 8 ++++---- matlab/parallel/masterParallel.m | 4 ++-- matlab/partial_information/PI_gensys.m | 8 ++++---- matlab/partial_information/PI_gensys_singularC.m | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/matlab/optimization/cmaes.m b/matlab/optimization/cmaes.m index bcbe52494..85b1a9aeb 100644 --- a/matlab/optimization/cmaes.m +++ b/matlab/optimization/cmaes.m @@ -2256,7 +2256,7 @@ ax(2) = max(minxend, ax(2)); axis(ax); % add some annotation lines -[ignore idx] = sort(d.x(end,6:end)); +[ignore, idx] = sort(d.x(end,6:end)); % choose no more than 25 indices idxs = round(linspace(1, size(d.x,2)-5, min(size(d.x,2)-5, 25))); yy = repmat(NaN, 2, size(d.x,2)-5); diff --git a/matlab/parallel/AnalyseComputationalEnvironment.m b/matlab/parallel/AnalyseComputationalEnvironment.m index 2f205d3b7..95f835b42 100644 --- a/matlab/parallel/AnalyseComputationalEnvironment.m +++ b/matlab/parallel/AnalyseComputationalEnvironment.m @@ -175,12 +175,12 @@ for Node=1:length(DataInput) % To obtain a recursive function remove the 'for' if Environment if OScallerWindows - [si1 de1]=system(['ping ', DataInput(Node).ComputerName]); + [si1, de1]=system(['ping ', DataInput(Node).ComputerName]); else - [si1 de1]=system(['ping ', DataInput(Node).ComputerName, ' -c 4']); + [si1, de1]=system(['ping ', DataInput(Node).ComputerName, ' -c 4']); end else - [si1 de1]=system(['ping ', DataInput(Node).ComputerName]); + [si1, de1]=system(['ping ', DataInput(Node).ComputerName]); end if (si1) @@ -387,15 +387,15 @@ for Node=1:length(DataInput) % To obtain a recursive function remove the 'for' else if ~strcmp(DataInput(Node).ComputerName,MasterName) % run on remote machine if strfind([DataInput(Node).MatlabOctavePath], 'octave') % Hybrid computing Matlab(Master)->Octave(Slaves) and Vice Versa! - [NonServeS NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e -u ',DataInput(Node).UserName,' -p ',DataInput(Node).Password,' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' Tracing.m']); + [NonServeS, NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e -u ',DataInput(Node).UserName,' -p ',DataInput(Node).Password,' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' Tracing.m']); else - [NonServeS NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e -u ',DataInput(Node).UserName,' -p ',DataInput(Node).Password,' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' -nosplash -nodesktop -minimize -r Tracing']); + [NonServeS, NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e -u ',DataInput(Node).UserName,' -p ',DataInput(Node).Password,' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' -nosplash -nodesktop -minimize -r Tracing']); end else % run on local machine via the network: user and passwd cannot be used! if strfind([DataInput(Node).MatlabOctavePath], 'octave') % Hybrid computing Matlab(Master)->Octave(Slaves) and Vice Versa! - [NonServeS NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e ',' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' Tracing.m']); + [NonServeS, NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e ',' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' Tracing.m']); else - [NonServeS NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e ',' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' -nosplash -nodesktop -minimize -r Tracing']); + [NonServeS, NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e ',' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' -nosplash -nodesktop -minimize -r Tracing']); end end @@ -570,7 +570,7 @@ for Node=1:length(DataInput) % To obtain a recursive function remove the 'for' % Questo controllo penso che si possa MIGLIORARE!!!!! if isempty (RealCPUnbr) && Environment1==0 - [si0 de0]=system(['psinfo \\',DataInput(Node).ComputerName]); + [si0, de0]=system(['psinfo \\',DataInput(Node).ComputerName]); end RealCPUnbr=GiveCPUnumber(de0,Environment1); diff --git a/matlab/parallel/distributeJobs.m b/matlab/parallel/distributeJobs.m index 08cc91104..336a898db 100644 --- a/matlab/parallel/distributeJobs.m +++ b/matlab/parallel/distributeJobs.m @@ -129,7 +129,7 @@ if SumOfJobs~=NumbersOfJobs % Many choices are possible: % - ... (see above). - [NonServe VeryFast]= min(CPUWeight); + [NonServe, VeryFast]= min(CPUWeight); while SumOfJobs OctaveStandardOutputMessage.txt']); + [check, ax]=system(['ls ' ,filename, ' 2> OctaveStandardOutputMessage.txt']); if check ~= 0 || ~isempty(strfind(ax,'No such file or directory')) ax=[]; diff --git a/matlab/parallel/dynareParallelGetFiles.m b/matlab/parallel/dynareParallelGetFiles.m index f53a35db3..349308c2c 100644 --- a/matlab/parallel/dynareParallelGetFiles.m +++ b/matlab/parallel/dynareParallelGetFiles.m @@ -61,13 +61,13 @@ for indPC=1:length(Parallel) if isempty (FindAst) - [NonServeL NonServeR]= system(['scp ',scp_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,':',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',NamFileInput{jfil,1},NamFileInput{jfil,2},' ',NamFileInput{jfil,1}]); + [NonServeL, NonServeR]= system(['scp ',scp_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,':',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',NamFileInput{jfil,1},NamFileInput{jfil,2},' ',NamFileInput{jfil,1}]); else filenameTemp=NamFileInput{jfil,2}; - [NotUsed FlI]=system(['ssh ',ssh_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' ls ',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',filenameTemp, ' 2> OctaveStandardOutputMessage.txt']); + [NotUsed, FlI]=system(['ssh ',ssh_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' ls ',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',filenameTemp, ' 2> OctaveStandardOutputMessage.txt']); if isempty (FlI) return @@ -81,13 +81,13 @@ for indPC=1:length(Parallel) for i=1: NumFileToCopy Ni=num2str(i); filenameTemp(1,AstPos)=Ni; - [NonServeL NonServeR]= system(['scp ',scp_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,':',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',NamFileInput{jfil,1},filenameTemp,' ',NamFileInput{jfil,1}]); + [NonServeL, NonServeR]= system(['scp ',scp_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,':',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',NamFileInput{jfil,1},filenameTemp,' ',NamFileInput{jfil,1}]); end end else - [NonServeL NonServeR]= system(['scp ',scp_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,':',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',NamFileInput{jfil,1},NamFileInput{jfil,2},' ',NamFileInput{jfil,1}]); + [NonServeL, NonServeR]= system(['scp ',scp_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,':',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',NamFileInput{jfil,1},NamFileInput{jfil,2},' ',NamFileInput{jfil,1}]); end end diff --git a/matlab/parallel/masterParallel.m b/matlab/parallel/masterParallel.m index 3110a4a61..ca0ec02bd 100644 --- a/matlab/parallel/masterParallel.m +++ b/matlab/parallel/masterParallel.m @@ -893,7 +893,7 @@ switch Strategy end if isempty(dir('dynareParallelLogFiles')) - [A B C]=rmdir('dynareParallelLogFiles'); + [A, B, C]=rmdir('dynareParallelLogFiles'); mkdir('dynareParallelLogFiles'); end try @@ -911,7 +911,7 @@ switch Strategy delete(['temp_input.mat']) if newInstance if isempty(dir('dynareParallelLogFiles')) - [A B C]=rmdir('dynareParallelLogFiles'); + [A, B, C]=rmdir('dynareParallelLogFiles'); mkdir('dynareParallelLogFiles'); end end diff --git a/matlab/partial_information/PI_gensys.m b/matlab/partial_information/PI_gensys.m index 42ee00f8a..02ed2fa6d 100644 --- a/matlab/partial_information/PI_gensys.m +++ b/matlab/partial_information/PI_gensys.m @@ -76,7 +76,7 @@ try warning('off','MATLAB:nearlySingularMatrix'); warning('off','MATLAB:singularMatrix'); UAVinv=inv(C2); % i.e. inv(U02'*a1*V02) - [LastWarningTxt LastWarningID]=lastwarn; + [LastWarningTxt, LastWarningID]=lastwarn; if any(any(isinf(UAVinv)))==1 singular=1; end @@ -178,9 +178,9 @@ G0pi=eye(n+FL_RANK+NX); try if isoctave && octave_ver_less_than('9') % Need to force QZ complex on Octave ⩽ 8 (otherwise it returns the real one) - [a b q z]=qz(complex(G0pi),complex(G1pi)); + [a, b, q, z]=qz(complex(G0pi),complex(G1pi)); else - [a b q z]=qz(G0pi,G1pi); + [a, b, q, z]=qz(G0pi,G1pi); end catch try @@ -239,7 +239,7 @@ for i=1:nn end div ; if ~zxz - [a b q z]=qzdiv(div,a,b,q,z); + [a, b, q, z]=qzdiv(div,a,b,q,z); end gev=[diag(a) diag(b)]; diff --git a/matlab/partial_information/PI_gensys_singularC.m b/matlab/partial_information/PI_gensys_singularC.m index 5122898f2..da403d494 100644 --- a/matlab/partial_information/PI_gensys_singularC.m +++ b/matlab/partial_information/PI_gensys_singularC.m @@ -71,7 +71,7 @@ try singular=1; else UAVinv=inv(C2); - [LastWarningTxt LastWarningID]=lastwarn; + [LastWarningTxt, LastWarningID]=lastwarn; if any(any(isinf(UAVinv)))==1 singular=1; end