New utility to close remote slaves when using the options of leaving slaves open after finishing a job.

time-shift
Marco Ratto 2010-02-12 17:25:58 +01:00
parent 5bb4ff02bc
commit 0764c03001
1 changed files with 14 additions and 0 deletions

14
matlab/closeSlave.m Normal file
View File

@ -0,0 +1,14 @@
function closeSlave(Parallel),
% In a parallelc context, this utility closes all remote matlab instances
% called by masteParallelMan (which leaves open remote matlab instances)
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