Skip to content
Snippets Groups Projects
Commit b86b22c0 authored by Marco Ratto's avatar Marco Ratto
Browse files

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;
(cherry picked from commit 0fb68813)
parent c11e168f
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment