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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Frédéric Karamé
dynare
Commits
dbf57b37
Commit
dbf57b37
authored
Jun 9, 2011
by
Houtan Bastani
Browse files
Options
Downloads
Patches
Plain Diff
ParallelDynare: set weights for all nodes in preprocessor
parent
85989df0
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
preprocessor/ConfigFile.cc
+11
-20
11 additions, 20 deletions
preprocessor/ConfigFile.cc
preprocessor/ConfigFile.hh
+2
-2
2 additions, 2 deletions
preprocessor/ConfigFile.hh
with
13 additions
and
22 deletions
preprocessor/ConfigFile.cc
+
11
−
20
View file @
dbf57b37
...
...
@@ -277,7 +277,7 @@ ConfigFile::getConfigFileInfo(const string ¶llel_config_file)
exit
(
EXIT_FAILURE
);
}
else
member_nodes
[
node_name
]
=
NULL
;
member_nodes
[
node_name
]
=
1.0
;
node_name
=
token
;
}
else
...
...
@@ -289,7 +289,7 @@ ConfigFile::getConfigFileInfo(const string ¶llel_config_file)
cerr
<<
"ERROR (in config file): Misspecification of weights passed to Members option."
<<
endl
;
exit
(
EXIT_FAILURE
);
}
member_nodes
[
node_name
]
=
new
double
(
weight
)
;
member_nodes
[
node_name
]
=
weight
;
}
catch
(
bad_lexical_cast
&
)
{
...
...
@@ -299,7 +299,7 @@ ConfigFile::getConfigFileInfo(const string ¶llel_config_file)
}
if
(
!
node_name
.
empty
())
if
(
member_nodes
.
find
(
node_name
)
==
member_nodes
.
end
())
member_nodes
[
node_name
]
=
NULL
;
member_nodes
[
node_name
]
=
1.0
;
else
{
cerr
<<
"ERROR (in config file): Node entered twice in specification of cluster."
<<
endl
;
...
...
@@ -480,19 +480,14 @@ ConfigFile::transformPass()
else
cluster_it
=
clusters
.
find
(
cluster_name
);
member_nodes_t
member_nodes
=
cluster_it
->
second
->
member_nodes
;
double
weight_denominator
=
0.0
;
for
(
member_nodes_t
::
const_iterator
it
=
member_nodes
.
begin
();
it
!=
member_nodes
.
end
();
it
++
)
if
(
it
->
second
)
weight_denominator
+=
*
it
->
second
;
else
weight_denominator
+=
1.0
;
for
(
member_nodes_t
::
const_iterator
it
=
cluster_it
->
second
->
member_nodes
.
begin
();
it
!=
cluster_it
->
second
->
member_nodes
.
end
();
it
++
)
weight_denominator
+=
it
->
second
;
for
(
member_nodes_t
::
iterator
it
=
member_nodes
.
begin
();
it
!=
member_nodes
.
end
();
it
++
)
if
(
it
->
second
)
*
it
->
second
/=
weight_denominator
;
for
(
member_nodes_t
::
iterator
it
=
cluster_it
->
second
->
member_nodes
.
begin
();
it
!=
cluster_it
->
second
->
member_nodes
.
end
();
it
++
)
it
->
second
/=
weight_denominator
;
}
void
...
...
@@ -538,12 +533,8 @@ ConfigFile::writeCluster(ostream &output) const
<<
"'RemoteDirectory', '"
<<
it
->
second
->
remoteDirectory
<<
"', "
<<
"'DynarePath', '"
<<
it
->
second
->
dynarePath
<<
"', "
<<
"'MatlabOctavePath', '"
<<
it
->
second
->
matlabOctavePath
<<
"', "
<<
"'OperatingSystem', '"
<<
it
->
second
->
operatingSystem
<<
"', "
;
if
(
cluster_it
->
second
->
member_nodes
.
find
(
it
->
first
)
->
second
)
output
<<
"'NodeWeight', '"
<<
*
(
cluster_it
->
second
->
member_nodes
.
find
(
it
->
first
)
->
second
)
<<
"', "
;
else
output
<<
"'NodeWeight', '', "
;
<<
"'OperatingSystem', '"
<<
it
->
second
->
operatingSystem
<<
"', "
<<
"'NodeWeight', '"
<<
(
cluster_it
->
second
->
member_nodes
.
find
(
it
->
first
))
->
second
<<
"', "
;
if
(
it
->
second
->
singleCompThread
)
output
<<
"'SingleCompThread', 'true');"
<<
endl
;
...
...
This diff is collapsed.
Click to expand it.
preprocessor/ConfigFile.hh
+
2
−
2
View file @
dbf57b37
...
...
@@ -25,7 +25,7 @@
using
namespace
std
;
typedef
map
<
string
,
double
*
>
member_nodes_t
;
typedef
map
<
string
,
double
>
member_nodes_t
;
class
SlaveNode
...
...
@@ -60,7 +60,7 @@ public:
~
Cluster
();
protected:
const
member_nodes_t
member_nodes
;
member_nodes_t
member_nodes
;
};
//! The abstract representation of a "config" file
...
...
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