Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stéphane Adjemian
dynare
Commits
838c0cd8
Commit
838c0cd8
authored
Jun 17, 2011
by
Marco Ratto
Browse files
Options
Downloads
Patches
Plain Diff
provisions in testing routines for hybrid unix/win clusters
parent
64e6de59
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/parallel/AnalyseComputationalEnvironment.m
+151
-138
151 additions, 138 deletions
matlab/parallel/AnalyseComputationalEnvironment.m
with
151 additions
and
138 deletions
matlab/parallel/AnalyseComputationalEnvironment.m
+
151
−
138
View file @
838c0cd8
...
@@ -98,13 +98,20 @@ dynareParallelMkDir(RemoteTmpFolder,DataInput);
...
@@ -98,13 +98,20 @@ dynareParallelMkDir(RemoteTmpFolder,DataInput);
ErrorCode
=
0
;
ErrorCode
=
0
;
for
Node
=
1
:
length
(
DataInput
)
% To obtain a recoursive function remove the 'for'
% and use AnalyseComputationalEnvironment with differents input!
% Determine the operating system or software version when necessary
% Determine the operating system or software version when necessary
% for different command types.
% for different command types.
Environment
=~
ispc
;
OScallerUnix
=~
ispc
;
OScallerWindows
=
ispc
;
OStargetUnix
=
strcmpi
(
'unix'
,
DataInput
(
Node
)
.
OperatingSystem
);
OStargetWindows
=
strcmpi
(
'windows'
,
DataInput
(
Node
)
.
OperatingSystem
);
for
Node
=
1
:
length
(
DataInput
)
% To obtain a recoursive function remove the 'for'
Environment
=
(
OScallerUnix
||
OStargetUnix
);
% and use AnalyseComputationalEnvironment with differents input!
disp
(
' '
);
disp
(
' '
);
disp
(
' '
);
disp
(
' '
);
...
@@ -162,7 +169,11 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
...
@@ -162,7 +169,11 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
de1
=
[];
de1
=
[];
if
Environment
if
Environment
if
OScallerWindows
[
si1
de1
]
=
system
([
'ping '
,
DataInput
(
Node
)
.
ComputerName
]);
else
[
si1
de1
]
=
system
([
'ping '
,
DataInput
(
Node
)
.
ComputerName
,
' -c 4'
]);
[
si1
de1
]
=
system
([
'ping '
,
DataInput
(
Node
)
.
ComputerName
,
' -c 4'
]);
end
else
else
[
si1
de1
]
=
system
([
'ping '
,
DataInput
(
Node
)
.
ComputerName
]);
[
si1
de1
]
=
system
([
'ping '
,
DataInput
(
Node
)
.
ComputerName
]);
end
end
...
@@ -205,7 +216,6 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
...
@@ -205,7 +216,6 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
% This check can be removed ... according to the dynare parser
% This check can be removed ... according to the dynare parser
% strategy.
% strategy.
if
(
~
isempty
(
DataInput
(
Node
)
.
Password
))
if
(
~
isempty
(
DataInput
(
Node
)
.
Password
))
disp
(
'[WARNING] The field Password should be empty under unix or mac!'
);
disp
(
'[WARNING] The field Password should be empty under unix or mac!'
);
disp
(
' '
);
disp
(
' '
);
...
@@ -221,7 +231,6 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
...
@@ -221,7 +231,6 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
disp
(
' '
);
disp
(
' '
);
disp
(
' '
);
disp
(
' '
);
end
end
else
else
% This check can be removed ... according to the dynare parser
% This check can be removed ... according to the dynare parser
...
@@ -267,7 +276,7 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
...
@@ -267,7 +276,7 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
% strategy.
% strategy.
if
(
~
isempty
(
DataInput
(
Node
)
.
RemoteDrive
))
if
(
~
isempty
(
DataInput
(
Node
)
.
RemoteDrive
))
disp
(
'[WARNING] The fields RemoteDrive should be empty under unix or ma
x
!'
);
disp
(
'[WARNING] The fields RemoteDrive should be empty under unix or ma
c
!'
);
disp
(
' '
);
disp
(
' '
);
disp
([
'remove the string '
,
DataInput
(
Node
)
.
RemoteDrive
,
' from this field!'
]);
disp
([
'remove the string '
,
DataInput
(
Node
)
.
RemoteDrive
,
' from this field!'
]);
disp
(
' '
);
disp
(
' '
);
...
@@ -402,13 +411,13 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
...
@@ -402,13 +411,13 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
% the path is MatlabOctavePath.
% the path is MatlabOctavePath.
if
Environment
if
Environment
if
exist
(
'OCTAVE_VERSION'
)
if
strfind
([
DataInput
(
Node
)
.
MatlabOctavePath
],
'octave'
)
% Hybrid computing Matlab(Master)->Octave(Slaves) and Vice Versa!
system
([
'ssh '
,
DataInput
(
Node
)
.
UserName
,
'@'
,
DataInput
(
Node
)
.
ComputerName
,
' "cd '
,
DataInput
(
Node
)
.
RemoteDirectory
,
'/'
,
RemoteTmpFolder
,
'; '
,
DataInput
(
Node
)
.
MatlabOctavePath
,
' Tracing.m;" &'
]);
system
([
'ssh '
,
DataInput
(
Node
)
.
UserName
,
'@'
,
DataInput
(
Node
)
.
ComputerName
,
' "cd '
,
DataInput
(
Node
)
.
RemoteDirectory
,
'/'
,
RemoteTmpFolder
,
'; '
,
DataInput
(
Node
)
.
MatlabOctavePath
,
' Tracing.m;" &'
]);
else
else
system
([
'ssh '
,
DataInput
(
Node
)
.
UserName
,
'@'
,
DataInput
(
Node
)
.
ComputerName
,
' "cd '
,
DataInput
(
Node
)
.
RemoteDirectory
,
'/'
,
RemoteTmpFolder
,
'; '
,
DataInput
(
Node
)
.
MatlabOctavePath
,
' -nosplash -nodesktop -minimize -r Tracing;" &'
]);
system
([
'ssh '
,
DataInput
(
Node
)
.
UserName
,
'@'
,
DataInput
(
Node
)
.
ComputerName
,
' "cd '
,
DataInput
(
Node
)
.
RemoteDirectory
,
'/'
,
RemoteTmpFolder
,
'; '
,
DataInput
(
Node
)
.
MatlabOctavePath
,
' -nosplash -nodesktop -minimize -r Tracing;" &'
]);
end
end
else
else
if
exist
(
'OCTAVE_VERSION'
)
if
strfind
([
DataInput
(
Node
)
.
MatlabOctavePath
],
'octave'
)
% Hybrid computing Matlab(Master)->Octave(Slaves) and Vice Versa!
[
NonServeS
NenServeD
]
=
system
([
'start /B psexec \\'
,
DataInput
(
Node
)
.
ComputerName
,
' -e -u '
,
DataInput
(
Node
)
.
UserName
,
' -p '
,
DataInput
(
Node
)
.
Password
,
' -W '
,
DataInput
(
Node
)
.
RemoteDrive
,
':\'
,
DataInput
(
Node
)
.
RemoteDirectory
,
'\'
,
RemoteTmpFolder
' -low '
,
DataInput
(
Node
)
.
MatlabOctavePath
,
' Tracing.m'
]);
[
NonServeS
NenServeD
]
=
system
([
'start /B psexec \\'
,
DataInput
(
Node
)
.
ComputerName
,
' -e -u '
,
DataInput
(
Node
)
.
UserName
,
' -p '
,
DataInput
(
Node
)
.
Password
,
' -W '
,
DataInput
(
Node
)
.
RemoteDrive
,
':\'
,
DataInput
(
Node
)
.
RemoteDirectory
,
'\'
,
RemoteTmpFolder
' -low '
,
DataInput
(
Node
)
.
MatlabOctavePath
,
' Tracing.m'
]);
else
else
[
NonServeS
NenServeD
]
=
system
([
'start /B psexec \\'
,
DataInput
(
Node
)
.
ComputerName
,
' -e -u '
,
DataInput
(
Node
)
.
UserName
,
' -p '
,
DataInput
(
Node
)
.
Password
,
' -W '
,
DataInput
(
Node
)
.
RemoteDrive
,
':\'
,
DataInput
(
Node
)
.
RemoteDirectory
,
'\'
,
RemoteTmpFolder
' -low '
,
DataInput
(
Node
)
.
MatlabOctavePath
,
' -nosplash -nodesktop -minimize -r Tracing'
]);
[
NonServeS
NenServeD
]
=
system
([
'start /B psexec \\'
,
DataInput
(
Node
)
.
ComputerName
,
' -e -u '
,
DataInput
(
Node
)
.
UserName
,
' -p '
,
DataInput
(
Node
)
.
Password
,
' -W '
,
DataInput
(
Node
)
.
RemoteDrive
,
':\'
,
DataInput
(
Node
)
.
RemoteDirectory
,
'\'
,
RemoteTmpFolder
' -low '
,
DataInput
(
Node
)
.
MatlabOctavePath
,
' -nosplash -nodesktop -minimize -r Tracing'
]);
...
@@ -467,7 +476,7 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
...
@@ -467,7 +476,7 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
disp
(
' '
);
disp
(
' '
);
disp
(
'please wait ... '
);
disp
(
'please wait ... '
);
disp
(
' '
);
disp
(
' '
);
pause
(
1
)
pause
(
2
)
if
isempty
(
dynareParallelDir
(
'DynareIsOk.txt'
,
RemoteTmpFolder
,
DataInput
(
Node
)))
if
isempty
(
dynareParallelDir
(
'DynareIsOk.txt'
,
RemoteTmpFolder
,
DataInput
(
Node
)))
ErrorCode
=
8
;
ErrorCode
=
8
;
...
@@ -563,6 +572,10 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
...
@@ -563,6 +572,10 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for'
RealCPUnbr
=
GiveCPUnumber
(
de0
);
RealCPUnbr
=
GiveCPUnumber
(
de0
);
% Questo controllo penso che si possa MIGLIORARE!!!!!
% Questo controllo penso che si possa MIGLIORARE!!!!!
if
isempty
(
RealCPUnbr
)
&&
Environment
==
0
,
[
si0
de0
]
=
system
([
'psinfo \\'
,
DataInput
(
Node
)
.
ComputerName
]);
end
RealCPUnbr
=
GiveCPUnumber
(
de0
);
if
isempty
(
RealCPUnbr
)
if
isempty
(
RealCPUnbr
)
% An error occurred when we try to know the Cpu/Cores
% An error occurred when we try to know the Cpu/Cores
...
...
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