diff --git a/matlab/parallel/AnalyseComputationalEnvironment.m b/matlab/parallel/AnalyseComputationalEnvironment.m index d00ca1b699c5144ea7a72f364dc49dc3f89024ed..7346a513f91b204bcdc119e62a834ee6a0e73c9e 100644 --- a/matlab/parallel/AnalyseComputationalEnvironment.m +++ b/matlab/parallel/AnalyseComputationalEnvironment.m @@ -559,9 +559,9 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' if (DataInput(Node).Local == 1) if Environment if ~ismac - [si0 de0]=system('grep processor /proc/cpuinfo'); + [si0, de0] = system('nproc'); else - [si0 de0]=system('sysctl -n hw.ncpu'); + [si0 de0] = system('sysctl -n hw.ncpu'); Environment1=2; end else @@ -576,7 +576,8 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' end if OStargetUnix if RemoteEnvironment ==1 - [si0 de0]=system(['ssh ',ssh_token,' ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' grep processor /proc/cpuinfo']); + command_string = ['ssh ',ssh_token,' ', ... + DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' nproc']; else % it is MAC [si0 de0]=system(['ssh ',ssh_token,' ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' sysctl -n hw.ncpu']); Environment1=2; @@ -591,7 +592,6 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' RealCPUnbr=''; - % keyboard; RealCPUnbr=GiveCPUnumber(de0,Environment1); % Questo controllo penso che si possa MIGLIORARE!!!!! @@ -603,12 +603,12 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' if isempty (RealCPUnbr) % An error occurred when we try to know the Cpu/Cores % numbers. - disp('It is impossible determine the number of Cpu/Processor avaiable on this machine!') + disp('It is impossible determine the number of Cpu/Processor available on this machine!') skipline() disp('ErrorCode 2.') skipline() if Environment - disp('Check the command "$less /proc/cpuinfo" ... !') + disp('Check the command "$grep - /proc/cpuinfo" ... !') else disp('Check if the pstools are installed and are in machine path! And check the command "psinfo \\"') end diff --git a/matlab/parallel/GiveCPUnumber.m b/matlab/parallel/GiveCPUnumber.m index cc2d45aa38e3674b234239e9d1f93a1edd65ef49..f7e6caf04d8f6d3d1a1c19d3157cfdb9888cd77c 100644 --- a/matlab/parallel/GiveCPUnumber.m +++ b/matlab/parallel/GiveCPUnumber.m @@ -65,9 +65,7 @@ switch Environment return case 1 %LIKE UNIX OPERATING SYSTEM - % Da generalizzare a un numero di CPu maggiore di 9!!! - - nCPU=str2num(ComputerInformations(length(ComputerInformations)-1))+1; + nCPU=str2num(ComputerInformations); case 2 %MAC-OS OPERATING SYSTEM