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
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
Pablo Winant
preprocessor
Commits
f022f666
Verified
Commit
f022f666
authored
Feb 13, 2020
by
Houtan Bastani
Browse files
Options
Downloads
Patches
Plain Diff
dragonfly: support ProgramPath config file option
parent
ac4749ed
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
src/ConfigFile.cc
+14
-13
14 additions, 13 deletions
src/ConfigFile.cc
src/ConfigFile.hh
+4
-4
4 additions, 4 deletions
src/ConfigFile.hh
with
18 additions
and
17 deletions
src/ConfigFile.cc
+
14
−
13
View file @
f022f666
/*
/*
* Copyright © 2010-20
19
Dynare Team
* Copyright © 2010-20
20
Dynare Team
*
*
* This file is part of Dynare.
* This file is part of Dynare.
*
*
...
@@ -56,7 +56,7 @@ Path::Path(vector<string> includepath_arg)
...
@@ -56,7 +56,7 @@ Path::Path(vector<string> includepath_arg)
SlaveNode
::
SlaveNode
(
string
computerName_arg
,
string
port_arg
,
int
minCpuNbr_arg
,
int
maxCpuNbr_arg
,
string
userName_arg
,
SlaveNode
::
SlaveNode
(
string
computerName_arg
,
string
port_arg
,
int
minCpuNbr_arg
,
int
maxCpuNbr_arg
,
string
userName_arg
,
string
password_arg
,
string
remoteDrive_arg
,
string
remoteDirectory_arg
,
string
password_arg
,
string
remoteDrive_arg
,
string
remoteDirectory_arg
,
string
dynare
Path_arg
,
string
matlabOctavePath_arg
,
bool
singleCompThread_arg
,
int
numberOfThreadsPerJob_arg
,
string
program
Path_arg
,
string
matlabOctavePath_arg
,
bool
singleCompThread_arg
,
int
numberOfThreadsPerJob_arg
,
string
operatingSystem_arg
)
:
string
operatingSystem_arg
)
:
computerName
{
move
(
computerName_arg
)},
computerName
{
move
(
computerName_arg
)},
port
{
move
(
port_arg
)},
port
{
move
(
port_arg
)},
...
@@ -66,7 +66,7 @@ SlaveNode::SlaveNode(string computerName_arg, string port_arg, int minCpuNbr_arg
...
@@ -66,7 +66,7 @@ SlaveNode::SlaveNode(string computerName_arg, string port_arg, int minCpuNbr_arg
password
{
move
(
password_arg
)},
password
{
move
(
password_arg
)},
remoteDrive
{
move
(
remoteDrive_arg
)},
remoteDrive
{
move
(
remoteDrive_arg
)},
remoteDirectory
{
move
(
remoteDirectory_arg
)},
remoteDirectory
{
move
(
remoteDirectory_arg
)},
dynare
Path
{
move
(
dynare
Path_arg
)},
program
Path
{
move
(
program
Path_arg
)},
matlabOctavePath
{
move
(
matlabOctavePath_arg
)},
matlabOctavePath
{
move
(
matlabOctavePath_arg
)},
singleCompThread
{
singleCompThread_arg
},
singleCompThread
{
singleCompThread_arg
},
numberOfThreadsPerJob
{
numberOfThreadsPerJob_arg
},
numberOfThreadsPerJob
{
numberOfThreadsPerJob_arg
},
...
@@ -168,7 +168,7 @@ ConfigFile::getConfigFileInfo(const string &config_file)
...
@@ -168,7 +168,7 @@ ConfigFile::getConfigFileInfo(const string &config_file)
}
}
string
name
,
computerName
,
port
,
userName
,
password
,
remoteDrive
,
string
name
,
computerName
,
port
,
userName
,
password
,
remoteDrive
,
remoteDirectory
,
dynare
Path
,
matlabOctavePath
,
operatingSystem
,
remoteDirectory
,
program
Path
,
matlabOctavePath
,
operatingSystem
,
global_init_file
;
global_init_file
;
vector
<
string
>
includepath
;
vector
<
string
>
includepath
;
int
minCpuNbr
{
0
},
maxCpuNbr
{
0
};
int
minCpuNbr
{
0
},
maxCpuNbr
{
0
};
...
@@ -202,7 +202,7 @@ ConfigFile::getConfigFileInfo(const string &config_file)
...
@@ -202,7 +202,7 @@ ConfigFile::getConfigFileInfo(const string &config_file)
addParallelConfFileElement
(
inNode
,
inCluster
,
member_nodes
,
name
,
addParallelConfFileElement
(
inNode
,
inCluster
,
member_nodes
,
name
,
computerName
,
port
,
minCpuNbr
,
maxCpuNbr
,
userName
,
computerName
,
port
,
minCpuNbr
,
maxCpuNbr
,
userName
,
password
,
remoteDrive
,
remoteDirectory
,
password
,
remoteDrive
,
remoteDirectory
,
dynare
Path
,
matlabOctavePath
,
singleCompThread
,
numberOfThreadsPerJob
,
program
Path
,
matlabOctavePath
,
singleCompThread
,
numberOfThreadsPerJob
,
operatingSystem
);
operatingSystem
);
//! Reset communication vars / option defaults
//! Reset communication vars / option defaults
...
@@ -236,7 +236,7 @@ ConfigFile::getConfigFileInfo(const string &config_file)
...
@@ -236,7 +236,7 @@ ConfigFile::getConfigFileInfo(const string &config_file)
}
}
name
=
userName
=
computerName
=
port
=
password
=
remoteDrive
name
=
userName
=
computerName
=
port
=
password
=
remoteDrive
=
remoteDirectory
=
dynare
Path
=
matlabOctavePath
=
remoteDirectory
=
program
Path
=
matlabOctavePath
=
operatingSystem
=
global_init_file
=
""
;
=
operatingSystem
=
global_init_file
=
""
;
includepath
.
clear
();
includepath
.
clear
();
minCpuNbr
=
maxCpuNbr
=
0
;
minCpuNbr
=
maxCpuNbr
=
0
;
...
@@ -353,8 +353,9 @@ ConfigFile::getConfigFileInfo(const string &config_file)
...
@@ -353,8 +353,9 @@ ConfigFile::getConfigFileInfo(const string &config_file)
remoteDrive
=
tokenizedLine
.
back
();
remoteDrive
=
tokenizedLine
.
back
();
else
if
(
!
tokenizedLine
.
front
().
compare
(
"RemoteDirectory"
))
else
if
(
!
tokenizedLine
.
front
().
compare
(
"RemoteDirectory"
))
remoteDirectory
=
tokenizedLine
.
back
();
remoteDirectory
=
tokenizedLine
.
back
();
else
if
(
!
tokenizedLine
.
front
().
compare
(
"DynarePath"
))
else
if
(
!
tokenizedLine
.
front
().
compare
(
"DynarePath"
)
dynarePath
=
tokenizedLine
.
back
();
||
!
tokenizedLine
.
front
().
compare
(
"ProgramPath"
))
programPath
=
tokenizedLine
.
back
();
else
if
(
!
tokenizedLine
.
front
().
compare
(
"MatlabOctavePath"
))
else
if
(
!
tokenizedLine
.
front
().
compare
(
"MatlabOctavePath"
))
matlabOctavePath
=
tokenizedLine
.
back
();
matlabOctavePath
=
tokenizedLine
.
back
();
else
if
(
!
tokenizedLine
.
front
().
compare
(
"NumberOfThreadsPerJob"
))
else
if
(
!
tokenizedLine
.
front
().
compare
(
"NumberOfThreadsPerJob"
))
...
@@ -445,7 +446,7 @@ ConfigFile::getConfigFileInfo(const string &config_file)
...
@@ -445,7 +446,7 @@ ConfigFile::getConfigFileInfo(const string &config_file)
addParallelConfFileElement
(
inNode
,
inCluster
,
member_nodes
,
name
,
addParallelConfFileElement
(
inNode
,
inCluster
,
member_nodes
,
name
,
computerName
,
port
,
minCpuNbr
,
maxCpuNbr
,
userName
,
computerName
,
port
,
minCpuNbr
,
maxCpuNbr
,
userName
,
password
,
remoteDrive
,
remoteDirectory
,
password
,
remoteDrive
,
remoteDirectory
,
dynare
Path
,
matlabOctavePath
,
singleCompThread
,
numberOfThreadsPerJob
,
program
Path
,
matlabOctavePath
,
singleCompThread
,
numberOfThreadsPerJob
,
operatingSystem
);
operatingSystem
);
configFile
.
close
();
configFile
.
close
();
...
@@ -479,7 +480,7 @@ void
...
@@ -479,7 +480,7 @@ void
ConfigFile
::
addParallelConfFileElement
(
bool
inNode
,
bool
inCluster
,
const
member_nodes_t
&
member_nodes
,
const
string
&
name
,
ConfigFile
::
addParallelConfFileElement
(
bool
inNode
,
bool
inCluster
,
const
member_nodes_t
&
member_nodes
,
const
string
&
name
,
const
string
&
computerName
,
const
string
&
port
,
int
minCpuNbr
,
int
maxCpuNbr
,
const
string
&
userName
,
const
string
&
computerName
,
const
string
&
port
,
int
minCpuNbr
,
int
maxCpuNbr
,
const
string
&
userName
,
const
string
&
password
,
const
string
&
remoteDrive
,
const
string
&
remoteDirectory
,
const
string
&
password
,
const
string
&
remoteDrive
,
const
string
&
remoteDirectory
,
const
string
&
dynare
Path
,
const
string
&
matlabOctavePath
,
bool
singleCompThread
,
int
numberOfThreadsPerJob
,
const
string
&
program
Path
,
const
string
&
matlabOctavePath
,
bool
singleCompThread
,
int
numberOfThreadsPerJob
,
const
string
&
operatingSystem
)
const
string
&
operatingSystem
)
{
{
//! ADD NODE
//! ADD NODE
...
@@ -497,14 +498,14 @@ ConfigFile::addParallelConfFileElement(bool inNode, bool inCluster, const member
...
@@ -497,14 +498,14 @@ ConfigFile::addParallelConfFileElement(bool inNode, bool inCluster, const member
}
}
else
else
slave_nodes
.
emplace
(
name
,
SlaveNode
{
computerName
,
port
,
minCpuNbr
,
maxCpuNbr
,
userName
,
slave_nodes
.
emplace
(
name
,
SlaveNode
{
computerName
,
port
,
minCpuNbr
,
maxCpuNbr
,
userName
,
password
,
remoteDrive
,
remoteDirectory
,
dynare
Path
,
password
,
remoteDrive
,
remoteDirectory
,
program
Path
,
matlabOctavePath
,
singleCompThread
,
numberOfThreadsPerJob
,
matlabOctavePath
,
singleCompThread
,
numberOfThreadsPerJob
,
operatingSystem
});
operatingSystem
});
//! ADD CLUSTER
//! ADD CLUSTER
else
if
(
inCluster
)
else
if
(
inCluster
)
if
(
minCpuNbr
>
0
||
maxCpuNbr
>
0
||
!
userName
.
empty
()
if
(
minCpuNbr
>
0
||
maxCpuNbr
>
0
||
!
userName
.
empty
()
||
!
password
.
empty
()
||
!
remoteDrive
.
empty
()
||
!
remoteDirectory
.
empty
()
||
!
password
.
empty
()
||
!
remoteDrive
.
empty
()
||
!
remoteDirectory
.
empty
()
||
!
dynare
Path
.
empty
()
||
!
matlabOctavePath
.
empty
()
||
!
operatingSystem
.
empty
())
||
!
program
Path
.
empty
()
||
!
matlabOctavePath
.
empty
()
||
!
operatingSystem
.
empty
())
{
{
cerr
<<
"Invalid option passed to [cluster]."
<<
endl
;
cerr
<<
"Invalid option passed to [cluster]."
<<
endl
;
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
...
@@ -728,7 +729,7 @@ ConfigFile::writeCluster(ostream &output) const
...
@@ -728,7 +729,7 @@ ConfigFile::writeCluster(ostream &output) const
<<
"'Password', '"
<<
slave_node
.
second
.
password
<<
"', "
<<
"'Password', '"
<<
slave_node
.
second
.
password
<<
"', "
<<
"'RemoteDrive', '"
<<
slave_node
.
second
.
remoteDrive
<<
"', "
<<
"'RemoteDrive', '"
<<
slave_node
.
second
.
remoteDrive
<<
"', "
<<
"'RemoteDirectory', '"
<<
slave_node
.
second
.
remoteDirectory
<<
"', "
<<
"'RemoteDirectory', '"
<<
slave_node
.
second
.
remoteDirectory
<<
"', "
<<
"'
Dynare
Path', '"
<<
slave_node
.
second
.
dynare
Path
<<
"', "
<<
"'
Program
Path', '"
<<
slave_node
.
second
.
program
Path
<<
"', "
<<
"'MatlabOctavePath', '"
<<
slave_node
.
second
.
matlabOctavePath
<<
"', "
<<
"'MatlabOctavePath', '"
<<
slave_node
.
second
.
matlabOctavePath
<<
"', "
<<
"'OperatingSystem', '"
<<
slave_node
.
second
.
operatingSystem
<<
"', "
<<
"'OperatingSystem', '"
<<
slave_node
.
second
.
operatingSystem
<<
"', "
<<
"'NodeWeight', '"
<<
(
cluster_it
->
second
.
member_nodes
.
find
(
slave_node
.
first
))
->
second
<<
"', "
<<
"'NodeWeight', '"
<<
(
cluster_it
->
second
.
member_nodes
.
find
(
slave_node
.
first
))
->
second
<<
"', "
...
...
This diff is collapsed.
Click to expand it.
src/ConfigFile.hh
+
4
−
4
View file @
f022f666
/*
/*
* Copyright © 2010-20
19
Dynare Team
* Copyright © 2010-20
20
Dynare Team
*
*
* This file is part of Dynare.
* This file is part of Dynare.
*
*
...
@@ -63,7 +63,7 @@ class SlaveNode
...
@@ -63,7 +63,7 @@ class SlaveNode
public:
public:
SlaveNode
(
string
computerName_arg
,
string
port_arg
,
int
minCpuNbr_arg
,
int
maxCpuNbr_arg
,
string
userName_arg
,
SlaveNode
(
string
computerName_arg
,
string
port_arg
,
int
minCpuNbr_arg
,
int
maxCpuNbr_arg
,
string
userName_arg
,
string
password_arg
,
string
remoteDrive_arg
,
string
remoteDirectory_arg
,
string
password_arg
,
string
remoteDrive_arg
,
string
remoteDirectory_arg
,
string
dynare
Path_arg
,
string
matlabOctavePath_arg
,
bool
singleCompThread_arg
,
int
numberOfThreadsPerJob_arg
,
string
program
Path_arg
,
string
matlabOctavePath_arg
,
bool
singleCompThread_arg
,
int
numberOfThreadsPerJob_arg
,
string
operatingSystem_arg
);
string
operatingSystem_arg
);
protected:
protected:
...
@@ -71,7 +71,7 @@ protected:
...
@@ -71,7 +71,7 @@ protected:
int
minCpuNbr
,
maxCpuNbr
;
int
minCpuNbr
,
maxCpuNbr
;
const
string
userName
,
password
;
const
string
userName
,
password
;
const
string
remoteDrive
,
remoteDirectory
;
const
string
remoteDrive
,
remoteDirectory
;
const
string
dynare
Path
,
matlabOctavePath
;
const
string
program
Path
,
matlabOctavePath
;
const
bool
singleCompThread
;
const
bool
singleCompThread
;
const
int
numberOfThreadsPerJob
;
const
int
numberOfThreadsPerJob
;
const
string
operatingSystem
;
const
string
operatingSystem
;
...
@@ -113,7 +113,7 @@ private:
...
@@ -113,7 +113,7 @@ private:
void
addParallelConfFileElement
(
bool
inNode
,
bool
inCluster
,
const
member_nodes_t
&
member_nodes
,
const
string
&
name
,
void
addParallelConfFileElement
(
bool
inNode
,
bool
inCluster
,
const
member_nodes_t
&
member_nodes
,
const
string
&
name
,
const
string
&
computerName
,
const
string
&
port
,
int
minCpuNbr
,
int
maxCpuNbr
,
const
string
&
userName
,
const
string
&
computerName
,
const
string
&
port
,
int
minCpuNbr
,
int
maxCpuNbr
,
const
string
&
userName
,
const
string
&
password
,
const
string
&
remoteDrive
,
const
string
&
remoteDirectory
,
const
string
&
password
,
const
string
&
remoteDrive
,
const
string
&
remoteDirectory
,
const
string
&
dynare
Path
,
const
string
&
matlabOctavePath
,
bool
singleCompThread
,
int
numberOfThreadsPerJob
,
const
string
&
program
Path
,
const
string
&
matlabOctavePath
,
bool
singleCompThread
,
int
numberOfThreadsPerJob
,
const
string
&
operatingSystem
);
const
string
&
operatingSystem
);
public:
public:
//! Parse config file
//! Parse 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