Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dóra Kocsis
dynare
Commits
58c4c483
Commit
58c4c483
authored
Sep 06, 2010
by
Marco Ratto
Browse files
Added MatlabPath to the Parallel structure
parent
c2145876
Changes
1
Hide whitespace changes
Inline
Side-by-side
matlab/masterParallel.m
View file @
58c4c483
...
...
@@ -76,7 +76,11 @@ function [fOutVar,nBlockPerCPU, totCPU] = masterParallel(Parallel,fBlock,nBlock,
if
~
isempty
(
Parallel_info
)
Strategy
=
Parallel_info
.
leaveSlaveOpen
;
end
for
j
=
1
:
length
(
Parallel
),
if
empty
(
Parallel
(
j
)
.
MatlabPath
),
Parallel
(
j
)
.
MatlabPath
=
'matlab'
;
end
end
if
Strategy
==
0
display
(
'User Strategy Now Is Open/Close (0)'
);
else
...
...
@@ -200,13 +204,13 @@ for j=1:totCPU,
if
exist
(
'OCTAVE_VERSION'
)
command1
=
[
'octave --eval fParallel\('
,
int2str
(
offset
+
1
),
','
,
int2str
(
sum
(
nBlockPerCPU
(
1
:
j
))),
','
,
int2str
(
j
),
','
,
int2str
(
indPC
),
',\
''
'
,
fname
,
'\
''
\) &'
];
else
command1
=
[
'm
atlab -nosplash -nodesktop -minimize -r fParallel\('
,
int2str
(
offset
+
1
),
','
,
int2str
(
sum
(
nBlockPerCPU
(
1
:
j
))),
','
,
int2str
(
j
),
','
,
int2str
(
indPC
),
',\
''
'
,
fname
,
'\
''
\) &'
];
command1
=
[
M
atlab
Path
,
'
-nosplash -nodesktop -minimize -r fParallel\('
,
int2str
(
offset
+
1
),
','
,
int2str
(
sum
(
nBlockPerCPU
(
1
:
j
))),
','
,
int2str
(
j
),
','
,
int2str
(
indPC
),
',\
''
'
,
fname
,
'\
''
\) &'
];
end
else
if
exist
(
'OCTAVE_VERSION'
)
command1
=
[
'start /B psexec -W '
,
DyMo
,
' -a '
,
int2str
(
Parallel
(
indPC
)
.
NumCPU
(
j
-
nCPU0
)),
' -low octave --eval fParallel('
,
int2str
(
offset
+
1
),
','
,
int2str
(
sum
(
nBlockPerCPU
(
1
:
j
))),
','
,
int2str
(
j
),
','
,
int2str
(
indPC
),
',
''
'
,
fname
,
'
''
)'
];
else
command1
=
[
'start /B psexec -W '
,
DyMo
,
' -a '
,
int2str
(
Parallel
(
indPC
)
.
NumCPU
(
j
-
nCPU0
)),
' -low
m
atlab -nosplash -nodesktop -minimize -r fParallel('
,
int2str
(
offset
+
1
),
','
,
int2str
(
sum
(
nBlockPerCPU
(
1
:
j
))),
','
,
int2str
(
j
),
','
,
int2str
(
indPC
),
',
''
'
,
fname
,
'
''
)'
];
command1
=
[
'start /B psexec -W '
,
DyMo
,
' -a '
,
int2str
(
Parallel
(
indPC
)
.
NumCPU
(
j
-
nCPU0
)),
' -low
'
,
M
atlab
Path
,
'
-nosplash -nodesktop -minimize -r fParallel('
,
int2str
(
offset
+
1
),
','
,
int2str
(
sum
(
nBlockPerCPU
(
1
:
j
))),
','
,
int2str
(
j
),
','
,
int2str
(
indPC
),
',
''
'
,
fname
,
'
''
)'
];
end
end
else
% Parallel(indPC).Local==0: Run using network on remote machine or also on local machine.
...
...
@@ -265,7 +269,7 @@ for j=1:totCPU,
if
exist
(
'OCTAVE_VERSION'
),
command1
=
[
'ssh '
,
Parallel
(
indPC
)
.
user
,
'@'
,
Parallel
(
indPC
)
.
PcName
,
' "cd '
,
Parallel
(
indPC
)
.
RemoteFolder
,
'; octave --eval fParallel\('
,
int2str
(
offset
+
1
),
','
,
int2str
(
sum
(
nBlockPerCPU
(
1
:
j
))),
','
,
int2str
(
j
),
','
,
int2str
(
indPC
),
',\
''
'
,
fname
,
'\
''
\);" &'
];
else
command1
=
[
'ssh '
,
Parallel
(
indPC
)
.
user
,
'@'
,
Parallel
(
indPC
)
.
PcName
,
' "cd '
,
Parallel
(
indPC
)
.
RemoteFolder
,
';
m
atlab -nosplash -nodesktop -minimize -r fParallel\('
,
int2str
(
offset
+
1
),
','
,
int2str
(
sum
(
nBlockPerCPU
(
1
:
j
))),
','
,
int2str
(
j
),
','
,
int2str
(
indPC
),
',\
''
'
,
fname
,
'\
''
\);" &'
];
command1
=
[
'ssh '
,
Parallel
(
indPC
)
.
user
,
'@'
,
Parallel
(
indPC
)
.
PcName
,
' "cd '
,
Parallel
(
indPC
)
.
RemoteFolder
,
';
'
,
M
atlab
Path
,
'
-nosplash -nodesktop -minimize -r fParallel\('
,
int2str
(
offset
+
1
),
','
,
int2str
(
sum
(
nBlockPerCPU
(
1
:
j
))),
','
,
int2str
(
j
),
','
,
int2str
(
indPC
),
',\
''
'
,
fname
,
'\
''
\);" &'
];
end
else
if
~
strcmp
(
Parallel
(
indPC
)
.
PcName
,
MasterName
),
% Run on a remote machine!
...
...
@@ -274,7 +278,7 @@ for j=1:totCPU,
' -low octave --eval fParallel('
,
int2str
(
offset
+
1
),
','
,
int2str
(
sum
(
nBlockPerCPU
(
1
:
j
))),
','
,
int2str
(
j
),
','
,
int2str
(
indPC
),
',
''
'
,
fname
,
'
''
)'
];
else
command1
=
[
'start /B psexec \\'
,
Parallel
(
indPC
)
.
PcName
,
' -e -u '
,
Parallel
(
indPC
)
.
user
,
' -p '
,
Parallel
(
indPC
)
.
passwd
,
' -W '
,
Parallel
(
indPC
)
.
RemoteDrive
,
':\'
,
Parallel
(
indPC
)
.
RemoteFolder
,
'\ -a '
,
int2str
(
Parallel
(
indPC
)
.
NumCPU
(
j
-
nCPU0
)),
...
' -low
m
atlab -nosplash -nodesktop -minimize -r fParallel('
,
int2str
(
offset
+
1
),
','
,
int2str
(
sum
(
nBlockPerCPU
(
1
:
j
))),
','
,
int2str
(
j
),
','
,
int2str
(
indPC
),
',
''
'
,
fname
,
'
''
)'
];
' -low
'
,
M
atlab
Path
,
'
-nosplash -nodesktop -minimize -r fParallel('
,
int2str
(
offset
+
1
),
','
,
int2str
(
sum
(
nBlockPerCPU
(
1
:
j
))),
','
,
int2str
(
j
),
','
,
int2str
(
indPC
),
',
''
'
,
fname
,
'
''
)'
];
end
else
% Run on the local machine via the network
if
exist
(
'OCTAVE_VERSION'
),
...
...
@@ -282,7 +286,7 @@ for j=1:totCPU,
' -low octave --eval fParallel('
,
int2str
(
offset
+
1
),
','
,
int2str
(
sum
(
nBlockPerCPU
(
1
:
j
))),
','
,
int2str
(
j
),
','
,
int2str
(
indPC
),
',
''
'
,
fname
,
'
''
)'
];
else
command1
=
[
'start /B psexec \\'
,
Parallel
(
indPC
)
.
PcName
,
' -e -W '
,
Parallel
(
indPC
)
.
RemoteDrive
,
':\'
,
Parallel
(
indPC
)
.
RemoteFolder
,
'\ -a '
,
int2str
(
Parallel
(
indPC
)
.
NumCPU
(
j
-
nCPU0
)),
...
' -low
m
atlab -nosplash -nodesktop -minimize -r fParallel('
,
int2str
(
offset
+
1
),
','
,
int2str
(
sum
(
nBlockPerCPU
(
1
:
j
))),
','
,
int2str
(
j
),
','
,
int2str
(
indPC
),
',
''
'
,
fname
,
'
''
)'
];
' -low
'
,
M
atlab
Path
,
'
-nosplash -nodesktop -minimize -r fParallel('
,
int2str
(
offset
+
1
),
','
,
int2str
(
sum
(
nBlockPerCPU
(
1
:
j
))),
','
,
int2str
(
j
),
','
,
int2str
(
indPC
),
',
''
'
,
fname
,
'
''
)'
];
end
end
end
...
...
@@ -296,16 +300,16 @@ for j=1:totCPU,
%command1=['octave --eval fParallel\(',int2str(offset+1),',',int2str(sum(nBlockPerCPU(1:j))),',',int2str(j),',',int2str(indPC),',\''',fname,'\''\) &'];
command1
=
[
'octave --eval slaveParallel\('
,
int2str
(
j
),
','
,
int2str
(
indPC
),
'\) &'
];
else
%command1=[
'm
atlab -nosplash -nodesktop -minimize -r fParallel\(',int2str(offset+1),',',int2str(sum(nBlockPerCPU(1:j))),',',int2str(j),',',int2str(indPC),',\''',fname,'\''\) &'];
command1
=
[
'm
atlab -nosplash -nodesktop -minimize -r slaveParallel\('
,
int2str
(
j
),
','
,
int2str
(
indPC
),
'\) &'
];
%command1=[
M
atlab
Path,'
-nosplash -nodesktop -minimize -r fParallel\(',int2str(offset+1),',',int2str(sum(nBlockPerCPU(1:j))),',',int2str(j),',',int2str(indPC),',\''',fname,'\''\) &'];
command1
=
[
M
atlab
Path
,
'
-nosplash -nodesktop -minimize -r slaveParallel\('
,
int2str
(
j
),
','
,
int2str
(
indPC
),
'\) &'
];
end
else
if
exist
(
'OCTAVE_VERSION'
)
%command1=['start /B psexec -W ',DyMo, ' -a ',int2str(Parallel(indPC).NumCPU(j-nCPU0)),' -low octave --eval fParallel(',int2str(offset+1),',',int2str(sum(nBlockPerCPU(1:j))),',',int2str(j),',',int2str(indPC),',''',fname,''')'];
command1
=
[
'start /B psexec -W '
,
DyMo
,
' -a '
,
int2str
(
Parallel
(
indPC
)
.
NumCPU
(
j
-
nCPU0
)),
' -low octave --eval slaveParallel('
,
int2str
(
j
),
','
,
int2str
(
indPC
),
')'
];
else
%command1=['start /B psexec -W ',DyMo, ' -a ',int2str(Parallel(indPC).NumCPU(j-nCPU0)),' -low
m
atlab -nosplash -nodesktop -minimize -r fParallel(',int2str(offset+1),',',int2str(sum(nBlockPerCPU(1:j))),',',int2str(j),',',int2str(indPC),',''',fname,''')'];
command1
=
[
'start /B psexec -W '
,
DyMo
,
' -a '
,
int2str
(
Parallel
(
indPC
)
.
NumCPU
(
j
-
nCPU0
)),
' -low
m
atlab -nosplash -nodesktop -minimize -r slaveParallel('
,
int2str
(
j
),
','
,
int2str
(
indPC
),
')'
];
%command1=['start /B psexec -W ',DyMo, ' -a ',int2str(Parallel(indPC).NumCPU(j-nCPU0)),' -low
',M
atlab
Path,'
-nosplash -nodesktop -minimize -r fParallel(',int2str(offset+1),',',int2str(sum(nBlockPerCPU(1:j))),',',int2str(j),',',int2str(indPC),',''',fname,''')'];
command1
=
[
'start /B psexec -W '
,
DyMo
,
' -a '
,
int2str
(
Parallel
(
indPC
)
.
NumCPU
(
j
-
nCPU0
)),
' -low
'
,
M
atlab
Path
,
'
-nosplash -nodesktop -minimize -r slaveParallel('
,
int2str
(
j
),
','
,
int2str
(
indPC
),
')'
];
end
end
...
...
@@ -375,7 +379,7 @@ for j=1:totCPU,
if
exist
(
'OCTAVE_VERSION'
),
command1
=
[
'ssh '
,
Parallel
(
indPC
)
.
user
,
'@'
,
Parallel
(
indPC
)
.
PcName
,
' "cd '
,
Parallel
(
indPC
)
.
RemoteFolder
,
'; octave --eval slaveParallel\('
,
int2str
(
j
),
','
,
int2str
(
indPC
),
'\);" &'
];
else
command1
=
[
'ssh '
,
Parallel
(
indPC
)
.
user
,
'@'
,
Parallel
(
indPC
)
.
PcName
,
' "cd '
,
Parallel
(
indPC
)
.
RemoteFolder
,
';
m
atlab -nosplash -nodesktop -minimize -r slaveParallel\('
,
int2str
(
j
),
','
,
int2str
(
indPC
),
'\);" &'
];
command1
=
[
'ssh '
,
Parallel
(
indPC
)
.
user
,
'@'
,
Parallel
(
indPC
)
.
PcName
,
' "cd '
,
Parallel
(
indPC
)
.
RemoteFolder
,
';
'
,
M
atlab
Path
,
'
-nosplash -nodesktop -minimize -r slaveParallel\('
,
int2str
(
j
),
','
,
int2str
(
indPC
),
'\);" &'
];
end
else
if
~
strcmp
(
Parallel
(
indPC
)
.
PcName
,
MasterName
),
% Run on a remote machine.
...
...
@@ -384,7 +388,7 @@ for j=1:totCPU,
' -low octave --eval slaveParallel('
,
int2str
(
j
),
','
,
int2str
(
indPC
),
')'
];
else
command1
=
[
'start /B psexec \\'
,
Parallel
(
indPC
)
.
PcName
,
' -e -u '
,
Parallel
(
indPC
)
.
user
,
' -p '
,
Parallel
(
indPC
)
.
passwd
,
' -W '
,
Parallel
(
indPC
)
.
RemoteDrive
,
':\'
,
Parallel
(
indPC
)
.
RemoteFolder
,
'\ -a '
,
int2str
(
Parallel
(
indPC
)
.
NumCPU
(
j
-
nCPU0
)),
...
' -low
m
atlab -nosplash -nodesktop -minimize -r slaveParallel('
,
int2str
(
j
),
','
,
int2str
(
indPC
),
')'
];
' -low
'
,
M
atlab
Path
,
'
-nosplash -nodesktop -minimize -r slaveParallel('
,
int2str
(
j
),
','
,
int2str
(
indPC
),
')'
];
end
else
% Run on the local machine via the network.
if
exist
(
'OCTAVE_VERSION'
),
...
...
@@ -392,7 +396,7 @@ for j=1:totCPU,
' -low octave --eval slaveParallel('
,
int2str
(
j
),
','
,
int2str
(
indPC
),
')'
];
else
command1
=
[
'start /B psexec \\'
,
Parallel
(
indPC
)
.
PcName
,
' -e -W '
,
Parallel
(
indPC
)
.
RemoteDrive
,
':\'
,
Parallel
(
indPC
)
.
RemoteFolder
,
'\ -a '
,
int2str
(
Parallel
(
indPC
)
.
NumCPU
(
j
-
nCPU0
)),
...
' -low
m
atlab -nosplash -nodesktop -minimize -r slaveParallel('
,
int2str
(
j
),
','
,
int2str
(
indPC
),
')'
];
' -low
'
,
M
atlab
Path
,
'
-nosplash -nodesktop -minimize -r slaveParallel('
,
int2str
(
j
),
','
,
int2str
(
indPC
),
')'
];
end
end
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment