1) used Environment input argument to GiveCPUnumber to fix bug with hybrid unix/windows clusters;

2) removed return after failure of ping; some machines like hal can be connected but do not allow ping;
time-shift
Marco Ratto 2013-04-05 17:28:43 +02:00
parent 09bc0a0aaa
commit 0fb688136e
2 changed files with 9 additions and 9 deletions

View File

@ -189,13 +189,13 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
end
if (si1)
disp(['It is impossibile to be connected to the computer with name "',DataInput(Node).ComputerName,'" using the network!']);
disp(['It is impossibile to ping to the computer with name "',DataInput(Node).ComputerName,'" using the network!']);
disp(' ');
disp('ErrorCode 3.');
ErrorCode=3;
disp(' ');
disp(' ');
return;
% return;
else
disp('Check on ComputerName Variable ..... Ok!');
disp(' ');
@ -609,13 +609,13 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
RealCPUnbr='';
% keyboard;
RealCPUnbr=GiveCPUnumber(de0);
RealCPUnbr=GiveCPUnumber(de0,Environment);
% Questo controllo penso che si possa MIGLIORARE!!!!!
if isempty (RealCPUnbr) && Environment==0,
[si0 de0]=system(['psinfo \\',DataInput(Node).ComputerName]);
end
RealCPUnbr=GiveCPUnumber(de0);
RealCPUnbr=GiveCPUnumber(de0,Environment);
if isempty (RealCPUnbr)
% An error occurred when we try to know the Cpu/Cores

View File

@ -1,4 +1,4 @@
function [nCPU]= GiveCPUnumber (ComputerInformations)
function [nCPU]= GiveCPUnumber (ComputerInformations, Environment)
% PARALLEL CONTEXT
% In a parallel context this function return the CPUs or cores numer avaiable
% on the computer used for run parallel code.
@ -33,13 +33,13 @@ function [nCPU]= GiveCPUnumber (ComputerInformations)
nCPU='';
Enviroment=-1;
if nargin < 2,
% Determine a specific operating system or software version when necessary
% for different command (sintax, name, ...).
Enviroment=~ispc; %isunix || (~matlab_ver_less_than('7.4') && ismac);
Environment=~ispc; %isunix || (~matlab_ver_less_than('7.4') && ismac);
end
switch Enviroment
switch Environment
case 0 %WINDOWS OPERATING SYSTEM
OffSet=27;