diff --git a/matlab/parallel/AnalyseComputationalEnvironment.m b/matlab/parallel/AnalyseComputationalEnvironment.m index ab8465a38f3daec0476cc01445d0e4bfa54e7dc9..f3bf88c36f8fc14daa69521655aab0a86d635c5f 100644 --- a/matlab/parallel/AnalyseComputationalEnvironment.m +++ b/matlab/parallel/AnalyseComputationalEnvironment.m @@ -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 diff --git a/matlab/parallel/GiveCPUnumber.m b/matlab/parallel/GiveCPUnumber.m index 355d48506e5e465d02ab57b943832092c7ede367..c858d258fdd5ea6324ec341203a9ea5ccfebfe7b 100644 --- a/matlab/parallel/GiveCPUnumber.m +++ b/matlab/parallel/GiveCPUnumber.m @@ -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;