Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
preprocessor
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
Dynare
preprocessor
Commits
6e015f9b
Commit
6e015f9b
authored
Jun 9, 2011
by
Houtan Bastani
Browse files
Options
Downloads
Patches
Plain Diff
ParallelDynare: set weights for all nodes in preprocessor
parent
7a9bb51c
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
ConfigFile.cc
+11
-20
11 additions, 20 deletions
ConfigFile.cc
ConfigFile.hh
+2
-2
2 additions, 2 deletions
ConfigFile.hh
with
13 additions
and
22 deletions
ConfigFile.cc
+
11
−
20
View file @
6e015f9b
...
@@ -277,7 +277,7 @@ ConfigFile::getConfigFileInfo(const string ¶llel_config_file)
...
@@ -277,7 +277,7 @@ ConfigFile::getConfigFileInfo(const string ¶llel_config_file)
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
else
else
member_nodes
[
node_name
]
=
NULL
;
member_nodes
[
node_name
]
=
1.0
;
node_name
=
token
;
node_name
=
token
;
}
}
else
else
...
@@ -289,7 +289,7 @@ ConfigFile::getConfigFileInfo(const string ¶llel_config_file)
...
@@ -289,7 +289,7 @@ ConfigFile::getConfigFileInfo(const string ¶llel_config_file)
cerr
<<
"ERROR (in config file): Misspecification of weights passed to Members option."
<<
endl
;
cerr
<<
"ERROR (in config file): Misspecification of weights passed to Members option."
<<
endl
;
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
member_nodes
[
node_name
]
=
new
double
(
weight
)
;
member_nodes
[
node_name
]
=
weight
;
}
}
catch
(
bad_lexical_cast
&
)
catch
(
bad_lexical_cast
&
)
{
{
...
@@ -299,7 +299,7 @@ ConfigFile::getConfigFileInfo(const string ¶llel_config_file)
...
@@ -299,7 +299,7 @@ ConfigFile::getConfigFileInfo(const string ¶llel_config_file)
}
}
if
(
!
node_name
.
empty
())
if
(
!
node_name
.
empty
())
if
(
member_nodes
.
find
(
node_name
)
==
member_nodes
.
end
())
if
(
member_nodes
.
find
(
node_name
)
==
member_nodes
.
end
())
member_nodes
[
node_name
]
=
NULL
;
member_nodes
[
node_name
]
=
1.0
;
else
else
{
{
cerr
<<
"ERROR (in config file): Node entered twice in specification of cluster."
<<
endl
;
cerr
<<
"ERROR (in config file): Node entered twice in specification of cluster."
<<
endl
;
...
@@ -480,19 +480,14 @@ ConfigFile::transformPass()
...
@@ -480,19 +480,14 @@ ConfigFile::transformPass()
else
else
cluster_it
=
clusters
.
find
(
cluster_name
);
cluster_it
=
clusters
.
find
(
cluster_name
);
member_nodes_t
member_nodes
=
cluster_it
->
second
->
member_nodes
;
double
weight_denominator
=
0.0
;
double
weight_denominator
=
0.0
;
for
(
member_nodes_t
::
const_iterator
it
=
member_nodes
.
begin
();
for
(
member_nodes_t
::
const_iterator
it
=
cluster_it
->
second
->
member_nodes
.
begin
();
it
!=
member_nodes
.
end
();
it
++
)
it
!=
cluster_it
->
second
->
member_nodes
.
end
();
it
++
)
if
(
it
->
second
)
weight_denominator
+=
it
->
second
;
weight_denominator
+=
*
it
->
second
;
else
weight_denominator
+=
1.0
;
for
(
member_nodes_t
::
iterator
it
=
member_nodes
.
begin
();
for
(
member_nodes_t
::
iterator
it
=
cluster_it
->
second
->
member_nodes
.
begin
();
it
!=
member_nodes
.
end
();
it
++
)
it
!=
cluster_it
->
second
->
member_nodes
.
end
();
it
++
)
if
(
it
->
second
)
it
->
second
/=
weight_denominator
;
*
it
->
second
/=
weight_denominator
;
}
}
void
void
...
@@ -538,12 +533,8 @@ ConfigFile::writeCluster(ostream &output) const
...
@@ -538,12 +533,8 @@ ConfigFile::writeCluster(ostream &output) const
<<
"'RemoteDirectory', '"
<<
it
->
second
->
remoteDirectory
<<
"', "
<<
"'RemoteDirectory', '"
<<
it
->
second
->
remoteDirectory
<<
"', "
<<
"'DynarePath', '"
<<
it
->
second
->
dynarePath
<<
"', "
<<
"'DynarePath', '"
<<
it
->
second
->
dynarePath
<<
"', "
<<
"'MatlabOctavePath', '"
<<
it
->
second
->
matlabOctavePath
<<
"', "
<<
"'MatlabOctavePath', '"
<<
it
->
second
->
matlabOctavePath
<<
"', "
<<
"'OperatingSystem', '"
<<
it
->
second
->
operatingSystem
<<
"', "
;
<<
"'OperatingSystem', '"
<<
it
->
second
->
operatingSystem
<<
"', "
<<
"'NodeWeight', '"
<<
(
cluster_it
->
second
->
member_nodes
.
find
(
it
->
first
))
->
second
<<
"', "
;
if
(
cluster_it
->
second
->
member_nodes
.
find
(
it
->
first
)
->
second
)
output
<<
"'NodeWeight', '"
<<
*
(
cluster_it
->
second
->
member_nodes
.
find
(
it
->
first
)
->
second
)
<<
"', "
;
else
output
<<
"'NodeWeight', '', "
;
if
(
it
->
second
->
singleCompThread
)
if
(
it
->
second
->
singleCompThread
)
output
<<
"'SingleCompThread', 'true');"
<<
endl
;
output
<<
"'SingleCompThread', 'true');"
<<
endl
;
...
...
This diff is collapsed.
Click to expand it.
ConfigFile.hh
+
2
−
2
View file @
6e015f9b
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
using
namespace
std
;
using
namespace
std
;
typedef
map
<
string
,
double
*
>
member_nodes_t
;
typedef
map
<
string
,
double
>
member_nodes_t
;
class
SlaveNode
class
SlaveNode
...
@@ -60,7 +60,7 @@ public:
...
@@ -60,7 +60,7 @@ public:
~
Cluster
();
~
Cluster
();
protected:
protected:
const
member_nodes_t
member_nodes
;
member_nodes_t
member_nodes
;
};
};
//! The abstract representation of a "config" file
//! 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