check for possible circular remote runs on the same local folder project

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2704 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
ratto 2009-05-27 15:56:04 +00:00
parent 3b91eb8649
commit ff22cece76
1 changed files with 17 additions and 1 deletions

View File

@ -105,7 +105,23 @@ end
end
else
% keyboard;
if ~( strcmpi(Parallel(indPC).PcName,MasterName) & strcmpi([Parallel(indPC).RemoteDrive,':\',Parallel(indPC).RemoteFolder],pwd))
if isunix,
[tempo, RemoteName]=system(['ssh ',Parallel(indPC).user,'@',Parallel(indPC).PcName,' "ifconfig | grep \''inet addr:\''| grep -v \''127.0.0.1\'' | cut -d: -f2 | awk \''{ print $1}\''"']);
RemoteName=RemoteName(1:end-1);
RemoteFolder = Parallel(indPC).RemoteFolder;
else
RemoteName = Parallel(indPC).PcName;
RemoteFolder = [Parallel(indPC).RemoteDrive,':\',Parallel(indPC).RemoteFolder];
end
remoteFlag=1;
if strcmpi(RemoteName,MasterName),
if ~copyfile(['P_',fname,'_',int2str(j),'End.txt'],RemoteFolder),
remoteFlag=0;
end
end
if remoteFlag,
if j==nCPU0+1,
if isunix,
system(['ssh ',Parallel(indPC).user,'@',Parallel(indPC).PcName,' rm -fr ',Parallel(indPC).RemoteFolder,'/*']);