Commit 67199aab authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Merge pull request #344 from rattoma/master

Parallel debug and several fixes of GSA toolbox
parents 76ca912d 9a622298
......@@ -289,24 +289,42 @@ if options_gsa.rmse,
options_.filtered_vars=0;
end
% dynare_MC([],OutputDirectoryName,data,rawdata,data_info);
prior_posterior_statistics('gsa',dataset_);
if options_.bayesian_irf
PosteriorIRF('gsa');
if options_gsa.pprior
TmpDirectoryName = ([M_.dname filesep 'gsa' filesep 'prior']);
else
TmpDirectoryName = ([M_.dname filesep 'gsa' filesep 'mc']);
end
if exist(TmpDirectoryName,'dir');
mydelete([M_.fname '_filter_step_ahead*.mat'],[TmpDirectoryName filesep]);
mydelete([M_.fname '_inno*.mat'],[TmpDirectoryName filesep]);
mydelete([M_.fname '_smooth*.mat'],[TmpDirectoryName filesep]);
mydelete([M_.fname '_update*.mat'],[TmpDirectoryName filesep]);
filparam = dir([TmpDirectoryName filesep M_.fname '_param*.mat']);
for j=1:length(filparam),
if isempty(strmatch([M_.fname '_param_irf'],filparam(j).name))
delete([TmpDirectoryName filesep filparam(j).name]);
end
end
options_gsa.load_rmse=0;
% else
% if options_gsa.load_rmse==0,
% disp('You already saved a MC filter/smoother analysis ')
% disp('Do you want to overwrite ?')
% pause;
% if options_gsa.pprior
% delete([OutputDirectoryName,'/',fname_,'_prior_*.mat'])
% else
% delete([OutputDirectoryName,'/',fname_,'_mc_*.mat'])
% end
% dynare_MC([],OutputDirectoryName);
% options_gsa.load_rmse=0;
% end
end
prior_posterior_statistics('gsa',dataset_);
if options_.bayesian_irf
PosteriorIRF('gsa');
end
options_gsa.load_rmse=0;
% else
% if options_gsa.load_rmse==0,
% disp('You already saved a MC filter/smoother analysis ')
% disp('Do you want to overwrite ?')
% pause;
% if options_gsa.pprior
% delete([OutputDirectoryName,'/',fname_,'_prior_*.mat'])
% else
% delete([OutputDirectoryName,'/',fname_,'_mc_*.mat'])
% end
% dynare_MC([],OutputDirectoryName);
% options_gsa.load_rmse=0;
% end
end
end
......
......@@ -310,9 +310,6 @@ else
dyn_saveas(hh,[OutDir '/' fname_ '_rmse_mc_lnprior',int2str(ifig) ],options_);
end
end
if ~options_.nodisplay
close(hh);
end
end
end
ifig=0;
......@@ -341,9 +338,6 @@ else
dyn_saveas(hh,[OutDir '/' fname_ '_rmse_mc_lnlik',int2str(ifig) ],options_);
end
end
if ~options_.nodisplay
close(hh);
end
end
end
ifig=0;
......@@ -372,9 +366,6 @@ else
dyn_saveas(hh,[OutDir '/' fname_ '_rmse_mc_lnpost',int2str(ifig)],options_);
end
end
if ~options_.nodisplay
close(hh);
end
end
end
end
......@@ -524,7 +515,6 @@ else
end
end
end
close all
end
for j=1:size(SP,2),
......
......@@ -100,9 +100,6 @@ if opt_gsa.load_ident_files==0,
title(M_.exo_names(j,:),'interpreter','none')
if mod(j,6)==0 | j==M_.exo_nbr,
dyn_saveas(hh,[OutputDirectoryName,'/',fname_,'_vdec_exo_',int2str(ifig)],options_);
if ~options_.nodisplay
close(hh);
end
end
end
end
......@@ -226,9 +223,6 @@ if opt_gsa.morris==1,
xlabel(' ')
title('All variance decomposition')
dyn_saveas(hh,[OutputDirectoryName,'/',fname_,'_morris_vdec'],options_);
if ~options_.nodisplay
close(hh);
end
else
save([OutputDirectoryName,'/',fname_,'_morris_IDE'],'vdec')
......@@ -745,9 +739,6 @@ if opt_gsa.morris==1,
xlabel(' ')
title('\mu in the model')
dyn_saveas(hh,[OutputDirectoryName,'/',fname_,'_morrismu_par'],options_);
if ~options_.nodisplay
close(hh);
end
hh=dyn_figure(options_); %bar(SAsignorm(:,irel))
% boxplot(SAsignorm','whis',10,'symbol','r.')
......@@ -763,9 +754,6 @@ if opt_gsa.morris==1,
xlabel(' ')
title('\sigma in the model')
dyn_saveas(hh,[OutputDirectoryName,'/',fname_,'_morrissig_par'],options_);
if ~options_.nodisplay
close(hh);
end
% figure, bar(SAnorm(:,irel)')
% set(gca,'xtick',[1:j0])
......
......@@ -141,9 +141,6 @@ for j=1:size(anamendo,1)
if ~options_.nograph,
hf=dyn_figure(options_); hist(y0,30), title([namendo,' vs. ', namexo])
dyn_saveas(hf,[xdir,'/', namendo,'_vs_', namexo],options_);
if ~options_.nodisplay
close(hf);
end
end
% if ~isempty(iy),
% si(:,js) = redform_private(x0(iy,:), y0(iy), pshape, pd, iload, pnames, namendo, namexo, xdir, options_gsa_);
......@@ -198,9 +195,6 @@ for j=1:size(anamendo,1)
title([logflag,' ',namendo,' vs. ',namexo],'interpreter','none')
if iplo==9,
dyn_saveas(hfig,[dirname,'/',M_.fname,'_redform_', namendo,'_vs_shocks_',logflag,num2str(ifig)],options_);
if ~options_.nodisplay
close(hfig);
end
end
end
......@@ -209,9 +203,6 @@ for j=1:size(anamendo,1)
end
if iplo<9 && iplo>0 && ifig && ~options_.nograph,
dyn_saveas(hfig,[dirname,'/',M_.fname,'_redform_', namendo,'_vs_shocks_',logflag,num2str(ifig)],options_);
if ~options_.nodisplay
close(hfig);
end
end
ifig=0;
iplo=0;
......@@ -252,9 +243,6 @@ for j=1:size(anamendo,1)
if ~options_.nograph,
hf=dyn_figure(options_); hist(y0,30), title([namendo,' vs. ', namlagendo])
dyn_saveas(hf,[xdir,'/', namendo,'_vs_', namlagendo],options_);
if ~options_.nodisplay
close(hf);
end
end
if ~isempty(iy) && ~isempty(iyc),
delete([xdir, '/*cut*.*'])
......@@ -305,9 +293,6 @@ for j=1:size(anamendo,1)
title([logflag,' ',namendo,' vs. ',namlagendo,'(-1)'],'interpreter','none')
if iplo==9,
dyn_saveas(hfig,[dirname,'/',M_.fname,'_redform_', namendo,'_vs_lags_',logflag,num2str(ifig)],options_);
if ~options_.nodisplay
close(hfig);
end
end
end
......@@ -316,9 +301,6 @@ for j=1:size(anamendo,1)
end
if iplo<9 && iplo>0 && ifig && ~options_.nograph,
dyn_saveas(hfig,[dirname,'/',M_.fname,'_redform_', namendo,'_vs_lags_',logflag,num2str(ifig)],options_);
if ~options_.nodisplay
close(hfig);
end
end
end
......@@ -378,9 +360,6 @@ if iload==0,
if ~options_.nograph,
hfig=dyn_figure(options_); hist(y0,30), title([namy,' vs. ', namx])
dyn_saveas(hfig,[xdir,'/', namy,'_vs_', namx],options_);
if ~options_.nodisplay
close(hfig);
end
end
% gsa_ = gsa_sdp_dyn(y0, x0, -2, [],[],[],1,fname, pnames);
nrun=length(y0);
......@@ -396,7 +375,9 @@ if iload==0,
gsa_.x0=x00(1:nfit,:);
if ~options_.nograph,
hfig=gsa_sdp_plot(gsa_,fname,pnames,iii(1:min(12,np)));
close(hfig);
if options_.nodisplay
close(hfig);
end
end
gsa_.x0=x0(1:nfit,:);
% copyfile([fname,'_est.mat'],[fname,'.mat'])
......@@ -405,9 +386,6 @@ if iload==0,
plot(y0(1:nfit),[gsa_.fit y0(1:nfit)],'.'),
title([namy,' vs. ', namx,' fit'])
dyn_saveas(hfig,[xdir,'/', namy,'_vs_', namx,'_fit'],options_);
if ~options_.nodisplay
close(hfig);
end
if nfit<nrun,
npred=[nfit+1:nrun];
yf = ss_anova_fcast(x0(npred,:), gsa_);
......@@ -415,9 +393,6 @@ if iload==0,
plot(y0(npred),[yf y0(npred)],'.'),
title([namy,' vs. ', namx,' pred'])
dyn_saveas(hfig,[xdir,'/', namy,'_vs_', namx,'_pred'],options_);
if ~options_.nodisplay
close(hfig);
end
end
end
......@@ -430,9 +405,6 @@ else
plot(y0,[yf y0],'.'),
title([namy,' vs. ', namx,' pred'])
dyn_saveas(hfig,[xdir,'/', namy,'_vs_', namx,'_pred'],options_);
if ~options_.nodisplay
close(hfig);
end
end
end
% si = gsa_.multivariate.si;
......
......@@ -91,9 +91,6 @@ for j=1:size(anamendo,1),
title([namendo,' vs. ',namexo],'interpreter','none')
if iplo==9,
dyn_saveas(hh,[dirname,'/',M_.fname,'_', namendo,'_vs_shock_',num2str(ifig)],options_);
if ~options_.nodisplay
close(hh);
end
end
end
......@@ -101,9 +98,6 @@ for j=1:size(anamendo,1),
end
if iplo<9 && iplo>0 && ifig,
dyn_saveas(hh,[dirname,'/',M_.fname,'_', namendo,'_vs_shocks_',num2str(ifig)],options_);
if ~options_.nodisplay
close(hh);
end
end
iplo=0;
......@@ -138,9 +132,6 @@ for j=1:size(anamendo,1),
title([namendo,' vs. ',namlagendo,'(-1)'],'interpreter','none')
if iplo==9,
dyn_saveas(hh,[dirname,'/',M_.fname,'_', namendo,'_vs_lags_',num2str(ifig)],options_);
if ~options_.nodisplay
close(hh);
end
end
end
end
......
......@@ -98,8 +98,5 @@ for i=1:ceil(nparplot/12),
title([ftit{j},'. p-value ', num2str(proba(ipar(j)),2)],'interpreter','none')
end
dyn_saveas(hh,[dirname,'/',fname_,'_',aname,'_SA_',int2str(i)],options_);
if ~options_.nodisplay
close(hh);
end
end
end
......@@ -110,9 +110,6 @@ for j=1:npar,
title(['cc = ',num2str(c0(i2(jx),j))])
if (mod(j2,12)==0) && j2>0,
dyn_saveas(hh,[dirname,'/',fig_nam_,int2str(ifig)],options_);
if ~options_.nodisplay
close(hh);
end
end
end
end
......@@ -121,9 +118,6 @@ for j=1:npar,
end
if ~options_.nograph && (j==(npar)) && j2>0 && (mod(j2,12)~=0),
dyn_saveas(hh,[dirname,'/',fig_nam_,int2str(ifig)],options_);
if ~options_.nodisplay
close(hh);
end
end
end
......
......@@ -31,6 +31,10 @@ function [ErrorCode] = AnalyseComputationalEnvironment(DataInput, DataInputAdd)
% field RemoteTmpFolder (the temporary directory created/destroyed on remote
% computer) is used.
if ispc,
[tempo, MasterName]=system('hostname');
MasterName=deblank(MasterName);
end
RemoteTmpFolder=DataInputAdd.RemoteTmpFolder;
dynareParallelMkDir(RemoteTmpFolder,DataInput);
......@@ -295,8 +299,13 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
si2=[];
de2=[];
if ~isempty(DataInput(Node).Port),
ssh_token = ['-p ',DataInput(Node).Port];
else
ssh_token = '';
end
[si2 de2]=system(['ssh ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' ls ',DataInput(Node).RemoteDirectory,'/',RemoteTmpFolder,'/']);
[si2 de2]=system(['ssh ',ssh_token,' ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' ls ',DataInput(Node).RemoteDirectory,'/',RemoteTmpFolder,'/']);
if (si2)
disp ('Remote Directory does not exist or is not reachable!');
......@@ -332,7 +341,7 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
si2=[];
de2=[];
[s12 de2]=system(['dir \\',DataInput(Node).ComputerName,'\',DataInput(Node).RemoteDrive,'$\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder]);
[si2 de2]=system(['dir \\',DataInput(Node).ComputerName,'\',DataInput(Node).RemoteDrive,'$\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder]);
if (si2)
disp ('Remote Directory does not exist or it is not reachable!');
......@@ -416,18 +425,32 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
% machine when the user is .UserName with password .Password and
% the path is MatlabOctavePath.
if Environment
if Environment,
if ~isempty(DataInput(Node).Port),
ssh_token = ['-p ',DataInput(Node).Port];
else
ssh_token = '';
end
if strfind([DataInput(Node).MatlabOctavePath], 'octave') % Hybrid computing Matlab(Master)->Octave(Slaves) and Vice Versa!
system(['ssh ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' "cd ',DataInput(Node).RemoteDirectory,'/',RemoteTmpFolder, '; ', DataInput(Node).MatlabOctavePath, ' Tracing.m;" &']);
system(['ssh ',ssh_token,' ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' "cd ',DataInput(Node).RemoteDirectory,'/',RemoteTmpFolder, '; ', DataInput(Node).MatlabOctavePath, ' Tracing.m;" &']);
else
system(['ssh ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' "cd ',DataInput(Node).RemoteDirectory,'/',RemoteTmpFolder, '; ', DataInput(Node).MatlabOctavePath, ' -nosplash -nodesktop -minimize -r Tracing;" &']);
system(['ssh ',ssh_token,' ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' "cd ',DataInput(Node).RemoteDirectory,'/',RemoteTmpFolder, '; ', DataInput(Node).MatlabOctavePath, ' -nosplash -nodesktop -minimize -r Tracing;" &']);
end
else
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']);
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']);
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']);
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']);
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']);
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']);
end
end
end
% Timer da fissare, nei valori di attesa!
......@@ -568,10 +591,15 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
end
else
if Environment,
if ~isempty(DataInput(Node).Port),
ssh_token = ['-p ',DataInput(Node).Port];
else
ssh_token = '';
end
if OStargetUnix,
[si0 de0]=system(['ssh ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' grep processor /proc/cpuinfo']);
[si0 de0]=system(['ssh ',ssh_token,' ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' grep processor /proc/cpuinfo']);
else
[si0 de0]=system(['ssh ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' psinfo']);
[si0 de0]=system(['ssh ',ssh_token,' ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' psinfo']);
end
else
[si0 de0]=system(['psinfo \\',DataInput(Node).ComputerName,' -u ',DataInput(Node).UserName,' -p ',DataInput(Node).Password]);
......
......@@ -39,7 +39,7 @@ end
s=warning('off');
if partial==1
save('slaveParallel_break','partial')
save('slaveParallel_break.mat','partial')
for indPC=1:length(Parallel),
if (Parallel(indPC).Local==0),
dynareParallelSendFiles('slaveParallel_break.mat',TmpFolder,Parallel(indPC));
......@@ -63,12 +63,14 @@ for indPC=1:length(Parallel),
if (Parallel(indPC).Local==0),
dynareParallelDelete( 'slaveParallel_input*.mat',TmpFolder,Parallel(indPC));
end
%else
delete( 'slaveParallel_input*.mat');
delete( 'slaveJob*.mat');
pause(1)
delete(['slaveParallel_*.log']);
%end
delete ConcurrentCommand1.bat;
end
while(1)
......@@ -76,7 +78,6 @@ while(1)
for indPC=1:length(Parallel),
if (Parallel(indPC).Local==0),
dynareParallelRmDir(TmpFolder,Parallel(indPC)),
end
end
break
......
......@@ -41,7 +41,12 @@ end
for indPC=1:length(Parallel),
if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem),
[NonServeS NonServeD]=system(['ssh ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' rm -f ',Parallel(indPC).RemoteDirectory,'/',pname,fname]);
if ~isempty(Parallel(indPC).Port),
ssh_token = ['-p ',Parallel(indPC).Port];
else
ssh_token = '';
end
[NonServeS NonServeD]=system(['ssh ',ssh_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' rm -f ',Parallel(indPC).RemoteDirectory,'/',pname,fname]);
else
delete(['\\',Parallel(indPC).ComputerName,'\',Parallel(indPC).RemoteDrive,'$\',Parallel(indPC).RemoteDirectory,'\',pname,fname]);
end
......
function dynareParallelDeleteNewFiles(PRCDir,Parallel,PRCDirSnapshot)
function dynareParallelDeleteNewFiles(PRCDir,Parallel,PRCDirSnapshot,varargin)
% PARALLEL CONTEXT
% In a parallel context, this is a specialized function able to ...
%
......@@ -55,11 +55,17 @@ for indPC=1:length(Parallel),
sT(1)='.';
SlashNumberAndPosition=findstr(sT,fS);
fileaddress={sT(1:SlashNumberAndPosition(end)),sT(SlashNumberAndPosition(end)+1:end)};
exception_flag=0;
for indexc=1:length(varargin)
exception_flag=exception_flag+(~isempty(strfind(fileaddress{2},varargin{indexc})));
end
if exception_flag==0,
dynareParallelDelete(fileaddress{2},[PRCDir,fS,fileaddress{1}],Parallel(indPC));
disp('New file deleted in remote -->');
disp(fileaddress{2});
disp('<--');
end
end
else
......
......@@ -31,14 +31,19 @@ dirlist=[];
for indPC=1:length(Parallel),
if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), %isunix || (~matlab_ver_less_than('7.4') && ismac),
if Parallel(indPC).Local==0,
if ~isempty(Parallel(indPC).Port),
ssh_token = ['-p ',Parallel(indPC).Port];
else
ssh_token = '';
end
if exist('OCTAVE_VERSION') % Patch for peculiar behaviour of ssh-ls under Linux.
% It is necessary to capture the ls warning message.
% To do it under the ssh protocol it is necessary to redirect the ls message in a text file.
% The file is 'OctaveStandardOutputMessage.txt' and it is
% saved in the Model directory.
[check, ax]=system(['ssh ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' ls ',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',filename, ' 2> OctaveStandardOutputMessage.txt']);
[check, ax]=system(['ssh ',ssh_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' ls ',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',filename, ' 2> OctaveStandardOutputMessage.txt']);
else
[check, ax]=system(['ssh ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' ls ',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',filename]);
[check, ax]=system(['ssh ',ssh_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' ls ',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',filename]);
end
if check ~= 0 || ~isempty(strfind(ax,'No such file or directory'));
ax=[];
......@@ -62,7 +67,7 @@ for indPC=1:length(Parallel),
end
end
dirlist = [dirlist, ax];
dirlist = char(dirlist, ax);
else
if exist('OCTAVE_VERSION'), % Patch for peculiar behaviour of ls under Windows.
if Parallel(indPC).Local==0,
......@@ -87,6 +92,6 @@ for indPC=1:length(Parallel),
ax=ls(filename);
end
end
dirlist = [dirlist; ax];
dirlist = char(dirlist, ax);
end
end
......@@ -36,6 +36,16 @@ NamFileInput0=NamFileInput;
for indPC=1:length(Parallel),
if Parallel(indPC).Local==0,
if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), %isunix || (~matlab_ver_less_than('7.4') && ismac),
if ~isempty(Parallel(indPC).Port),
ssh_token = ['-p ',Parallel(indPC).Port];
else
ssh_token = '';
end
if ~isempty(Parallel(indPC).Port),
scp_token = ['-P ',Parallel(indPC).Port];
else
scp_token = '';
end
if ischar(NamFileInput0),
for j=1:size(NamFileInput0,1),
NamFile(j,:)={['./'],deblank(NamFileInput0(j,:))};
......@@ -51,13 +61,13 @@ for indPC=1:length(Parallel),
if isempty (FindAst)
[NonServeL NonServeR]= system(['scp ',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 ',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
......@@ -71,13 +81,13 @@ for indPC=1:length(Parallel),
for i=1: NumFileToCopy
Ni=num2str(i);
filenameTemp(1,AstPos)=Ni;
[NonServeL NonServeR]= system(['scp ',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 ',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
......
......@@ -37,9 +37,14 @@ if (~ispc || strcmpi('unix',Parallel.OperatingSystem))
fileList={};
currentPath=[];
if ~isempty(Parallel.Port),
ssh_token = ['-p ',Parallel.Port];
else
ssh_token = '';
end
% Get the data for the current remote directory.
[Flag fL]=system(['ssh ',Parallel.UserName,'@',Parallel.ComputerName,' ls ',Parallel.RemoteDirectory,'/',PRCDir, ' -R -p -1']);
[Flag fL]=system(['ssh ',ssh_token,' ',' ',Parallel.UserName,'@',Parallel.ComputerName,' ls ',Parallel.RemoteDirectory,'/',PRCDir, ' -R -p -1']);
% Format the return value fL.
......
......@@ -37,7 +37,12 @@ end
for indPC=1:length(Parallel)
if Parallel(indPC).Local==0,
if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), %isunix || (~matlab_ver_less_than('7.4') && ismac),
[NonServeS NonServeD]=system(['ssh ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' mkdir -p ',Parallel(indPC).RemoteDirectory,'/',PRCDir]);
if ~isempty(Parallel(indPC).Port),
ssh_token = ['-p ',Parallel(indPC).Port];