Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marco Ratto
dynare
Commits
927c735e
Commit
927c735e
authored
5 years ago
by
Sébastien Villemot
Browse files
Options
Downloads
Plain Diff
Merge branch 'processor_nbr_4.5' into '4.5'
fix finding CPU's number larger than 9. Hand cherry-picked from
0d2fa74e
See merge request
!1652
parents
5740e2f0
2a182334
Branches
utilsx
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#1321
passed
5 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/parallel/AnalyseComputationalEnvironment.m
+6
-6
6 additions, 6 deletions
matlab/parallel/AnalyseComputationalEnvironment.m
matlab/parallel/GiveCPUnumber.m
+1
-3
1 addition, 3 deletions
matlab/parallel/GiveCPUnumber.m
with
7 additions
and
9 deletions
matlab/parallel/AnalyseComputationalEnvironment.m
+
6
−
6
View file @
927c735e
...
...
@@ -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 avai
l
able 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
...
...
This diff is collapsed.
Click to expand it.
matlab/parallel/GiveCPUnumber.m
+
1
−
3
View file @
927c735e
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment