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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stéphane Adjemian
dynare
Commits
3fcfa99f
Commit
3fcfa99f
authored
14 years ago
by
Sébastien Villemot
Browse files
Options
Downloads
Plain Diff
Merge remote branch 'ratto/4.2' into 4.2
parents
7967873f
7dffad33
No related branches found
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
matlab/parallel/dynareParallelGetFiles.m
+42
-5
42 additions, 5 deletions
matlab/parallel/dynareParallelGetFiles.m
matlab/parallel/dynareParallelSendFiles.m
+51
-5
51 additions, 5 deletions
matlab/parallel/dynareParallelSendFiles.m
matlab/pm3.m
+16
-8
16 additions, 8 deletions
matlab/pm3.m
with
109 additions
and
18 deletions
matlab/parallel/dynareParallelGetFiles.m
+
42
−
5
View file @
3fcfa99f
...
@@ -44,7 +44,44 @@ for indPC=1:length(Parallel),
...
@@ -44,7 +44,44 @@ for indPC=1:length(Parallel),
if
~
ispc
,
%isunix || (~matlab_ver_less_than('7.4') && ismac),
if
~
ispc
,
%isunix || (~matlab_ver_less_than('7.4') && ismac),
for
jfil
=
1
:
size
(
NamFileInput
,
1
),
for
jfil
=
1
:
size
(
NamFileInput
,
1
),
% if ~isempty(dynareParallelDir(NamFileInput{jfil,2},[PRCDir,filesep,NamFileInput{jfil,1}],Parallel(indPC))),
% if ~isempty(dynareParallelDir(NamFileInput{jfil,2},[PRCDir,filesep,NamFileInput{jfil,1}],Parallel(indPC))),
if
exist
(
'OCTAVE_VERSION'
)
% Patch for peculiar behaviour of ls under Linux.
% It is necessary to manage the jolly char '*'!
FindAst
=
strfind
(
NamFileInput
{
jfil
,
2
},
'comp_status_random_walk_metropolis_hastings_core*'
);
if
isempty
(
FindAst
)
[
NonServeL
NonServeR
]
=
system
([
'scp '
,
Parallel
(
indPC
)
.
UserName
,
'@'
,
Parallel
(
indPC
)
.
ComputerName
,
':'
,
Parallel
(
indPC
)
.
RemoteDirectory
,
'/'
,
PRCDir
,
'/'
,
NamFileInput
{
jfil
,
1
},
NamFileInput
{
jfil
,
2
},
' '
,
NamFileInput
{
jfil
,
1
}]);
else
filenameTemp
=
NamFileInput
{
jfil
,
2
};
[
NotUsed
FlI
]
=
system
([
'ssh '
,
Parallel
(
indPC
)
.
UserName
,
'@'
,
Parallel
(
indPC
)
.
ComputerName
,
' ls '
,
Parallel
(
indPC
)
.
RemoteDirectory
,
'/'
,
PRCDir
,
'/'
,
filenameTemp
,
' 2> OctaveStandardOutputMessage.txt'
]);
if
isempty
(
FlI
)
return
end
AstPos
=
strfind
(
filenameTemp
,
'.mat'
)
-
1
;
FiMat
=
findstr
(
FlI
,
'.mat'
);
NumFileToCopy
=
length
(
FiMat
);
for
i
=
1
:
NumFileToCopy
Ni
=
num2str
(
i
);
filenameTemp
(
1
,
AstPos
)
=
Ni
;
[
NonServeL
NonServeR
]
=
system
([
'scp '
,
Parallel
(
indPC
)
.
UserName
,
'@'
,
Parallel
(
indPC
)
.
ComputerName
,
':'
,
Parallel
(
indPC
)
.
RemoteDirectory
,
'/'
,
PRCDir
,
'/'
,
NamFileInput
{
jfil
,
1
},
filenameTemp
,
' '
,
NamFileInput
{
jfil
,
1
}]);
end
end
else
[
NonServeL
NonServeR
]
=
system
([
'scp '
,
Parallel
(
indPC
)
.
UserName
,
'@'
,
Parallel
(
indPC
)
.
ComputerName
,
':'
,
Parallel
(
indPC
)
.
RemoteDirectory
,
'/'
,
PRCDir
,
'/'
,
NamFileInput
{
jfil
,
1
},
NamFileInput
{
jfil
,
2
},
' '
,
NamFileInput
{
jfil
,
1
}]);
[
NonServeL
NonServeR
]
=
system
([
'scp '
,
Parallel
(
indPC
)
.
UserName
,
'@'
,
Parallel
(
indPC
)
.
ComputerName
,
':'
,
Parallel
(
indPC
)
.
RemoteDirectory
,
'/'
,
PRCDir
,
'/'
,
NamFileInput
{
jfil
,
1
},
NamFileInput
{
jfil
,
2
},
' '
,
NamFileInput
{
jfil
,
1
}]);
end
% end
% end
end
end
else
else
...
...
This diff is collapsed.
Click to expand it.
matlab/parallel/dynareParallelSendFiles.m
+
51
−
5
View file @
3fcfa99f
...
@@ -44,7 +44,7 @@ for indPC=1:length(Parallel),
...
@@ -44,7 +44,7 @@ for indPC=1:length(Parallel),
if
~
ispc
,
%isunix || (~matlab_ver_less_than('7.4') && ismac),
if
~
ispc
,
%isunix || (~matlab_ver_less_than('7.4') && ismac),
for
jfil
=
1
:
size
(
NamFileInput
,
1
),
for
jfil
=
1
:
size
(
NamFileInput
,
1
),
if
~
isempty
(
NamFileInput
{
jfil
,
1
})
if
~
isempty
(
NamFileInput
{
jfil
,
1
})
system
([
'ssh '
,
Parallel
(
indPC
)
.
UserName
,
'@'
,
Parallel
(
indPC
)
.
ComputerName
,
' mkdir -p '
,
Parallel
(
indPC
)
.
RemoteDirectory
,
'/'
,
PRCDir
,
'/'
,
NamFileInput
{
jfil
,
1
}])
[
NonServeL
NonServeR
]
=
system
([
'ssh '
,
Parallel
(
indPC
)
.
UserName
,
'@'
,
Parallel
(
indPC
)
.
ComputerName
,
' mkdir -p '
,
Parallel
(
indPC
)
.
RemoteDirectory
,
'/'
,
PRCDir
,
'/'
,
NamFileInput
{
jfil
,
1
}])
;
end
end
[
NonServeL
NonServeR
]
=
system
([
'scp '
,
NamFileInput
{
jfil
,
1
},
NamFileInput
{
jfil
,
2
},
' '
,
Parallel
(
indPC
)
.
UserName
,
'@'
,
Parallel
(
indPC
)
.
ComputerName
,
':'
,
Parallel
(
indPC
)
.
RemoteDirectory
,
'/'
,
PRCDir
,
'/'
,
NamFileInput
{
jfil
,
1
}]);
[
NonServeL
NonServeR
]
=
system
([
'scp '
,
NamFileInput
{
jfil
,
1
},
NamFileInput
{
jfil
,
2
},
' '
,
Parallel
(
indPC
)
.
UserName
,
'@'
,
Parallel
(
indPC
)
.
ComputerName
,
':'
,
Parallel
(
indPC
)
.
RemoteDirectory
,
'/'
,
PRCDir
,
'/'
,
NamFileInput
{
jfil
,
1
}]);
end
end
...
@@ -52,10 +52,56 @@ for indPC=1:length(Parallel),
...
@@ -52,10 +52,56 @@ for indPC=1:length(Parallel),
for
jfil
=
1
:
size
(
NamFileInput
,
1
)
for
jfil
=
1
:
size
(
NamFileInput
,
1
)
if
~
isempty
(
NamFileInput
{
jfil
,
1
})
if
~
isempty
(
NamFileInput
{
jfil
,
1
})
if
isempty
(
dynareParallelDir
(
NamFileInput
{
jfil
,
1
},
PRCDir
,
Parallel
(
indPC
)))
if
isempty
(
dynareParallelDir
(
NamFileInput
{
jfil
,
1
},
PRCDir
,
Parallel
(
indPC
)))
if
exist
(
'OCTAVE_VERSION'
)
% Patch for peculiar behaviour of mkdir under Windows.
% It is Necessary because Octave is not able to
% create two nested directory at the same time.
% Remove (if present) the '/' chars. Can be easily transformed
% in a function.
NamFileInputTemp
=
NamFileInput
{
jfil
,
1
};
while
(
1
)
Bs
=
strfind
(
NamFileInputTemp
,
'/'
);
if
isempty
(
Bs
),
break
;
else
NamFileInputTemp
(
1
,
Bs
)
=
'\'
;
end
end
[
NonServeL
NonServeR
]
=
system
([
'mkdir \\'
,
Parallel
(
indPC
)
.
ComputerName
,
'\'
,
Parallel
(
indPC
)
.
RemoteDrive
,
'$\'
,
Parallel
(
indPC
)
.
RemoteDirectory
,
'\'
,
PRCDir
,
'\'
,
NamFileInputTemp
]);
else
mkdir
([
'\\'
,
Parallel
(
indPC
)
.
ComputerName
,
'\'
,
Parallel
(
indPC
)
.
RemoteDrive
,
'$\'
,
Parallel
(
indPC
)
.
RemoteDirectory
,
'\'
,
PRCDir
,
'\'
,
NamFileInput
{
jfil
,
1
}]);
mkdir
([
'\\'
,
Parallel
(
indPC
)
.
ComputerName
,
'\'
,
Parallel
(
indPC
)
.
RemoteDrive
,
'$\'
,
Parallel
(
indPC
)
.
RemoteDirectory
,
'\'
,
PRCDir
,
'\'
,
NamFileInput
{
jfil
,
1
}]);
end
end
end
end
copyfile
([
NamFileInput
{
jfil
,
1
},
NamFileInput
{
jfil
,
2
}],[
'\\'
,
Parallel
(
indPC
)
.
ComputerName
,
'\'
,
Parallel
(
indPC
)
.
RemoteDrive
,
'$\'
,
Parallel
(
indPC
)
.
RemoteDirectory
,
'\'
,
PRCDir
,
'\'
,
NamFileInput
{
jfil
,
1
}])
end
if
exist
(
'OCTAVE_VERSION'
)
% Patch for peculiar behaviour copyfile ls under Windows.
% It is Necessary because Octave is not able to
% use the jolly char '*' with copyfile.
% Remove (if present) the '/' chars. Can be easily transformed
% in a function.
NamFileInputTemp
=
NamFileInput
{
jfil
,
1
};
while
(
1
)
Bs
=
strfind
(
NamFileInputTemp
,
'/'
);
if
isempty
(
Bs
),
break
;
else
NamFileInputTemp
(
1
,
Bs
)
=
'\'
;
end
end
[
NonServeS
NonServeD
]
=
system
([
'copy '
,
NamFileInputTemp
,
NamFileInput
{
jfil
,
2
},
' \\'
,
Parallel
(
indPC
)
.
ComputerName
,
'\'
,
Parallel
(
indPC
)
.
RemoteDrive
,
'$\'
,
Parallel
(
indPC
)
.
RemoteDirectory
,
'\'
,
PRCDir
,
'\'
,
NamFileInputTemp
]);
else
copyfile
([
NamFileInput
{
jfil
,
1
},
NamFileInput
{
jfil
,
2
}],[
'\\'
,
Parallel
(
indPC
)
.
ComputerName
,
'\'
,
Parallel
(
indPC
)
.
RemoteDrive
,
'$\'
,
Parallel
(
indPC
)
.
RemoteDirectory
,
'\'
,
PRCDir
,
'\'
,
NamFileInput
{
jfil
,
1
}]);
end
end
end
end
end
end
end
...
...
This diff is collapsed.
Click to expand it.
matlab/pm3.m
+
16
−
8
View file @
3fcfa99f
...
@@ -147,6 +147,8 @@ localVars.tit3=tit3;
...
@@ -147,6 +147,8 @@ localVars.tit3=tit3;
localVars
.
Mean
=
Mean
;
localVars
.
Mean
=
Mean
;
% Like sequential execution!
% Like sequential execution!
if
~
exist
(
'OCTAVE_VERSION'
)
% Commenting for testing!
% Commenting for testing!
if
isnumeric
(
options_
.
parallel
)
||
ceil
(
size
(
varlist
,
1
)/
MaxNumberOfPlotsPerFigure
)
<
4
,
if
isnumeric
(
options_
.
parallel
)
||
ceil
(
size
(
varlist
,
1
)/
MaxNumberOfPlotsPerFigure
)
<
4
,
fout
=
pm3_core
(
localVars
,
1
,
nvar
,
0
);
fout
=
pm3_core
(
localVars
,
1
,
nvar
,
0
);
...
@@ -158,6 +160,12 @@ else
...
@@ -158,6 +160,12 @@ else
'oo_'
,
oo_
);
'oo_'
,
oo_
);
[
fout
,
nBlockPerCPU
,
totCPU
]
=
masterParallel
(
options_
.
parallel
,
1
,
nvar
,
[],
'pm3_core'
,
localVars
,
globalVars
,
options_
.
parallel_info
);
[
fout
,
nBlockPerCPU
,
totCPU
]
=
masterParallel
(
options_
.
parallel
,
1
,
nvar
,
[],
'pm3_core'
,
localVars
,
globalVars
,
options_
.
parallel_info
);
end
end
else
% For the time being in Octave enviroment the pm3.m is executed only in
% serial modality, to avoid problem with the plots.
fout
=
pm3_core
(
localVars
,
1
,
nvar
,
0
);
end
fprintf
([
'MH: '
tit1
', done!\n'
]);
fprintf
([
'MH: '
tit1
', done!\n'
]);
...
...
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