Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
RadioObservatory
LOFAR
Commits
39f6e0f7
Commit
39f6e0f7
authored
18 years ago
by
blaakmeer
Browse files
Options
Downloads
Patches
Plain Diff
BugID: 802
Fixed ACC parameter inconsistencies
parent
77d2aab8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc
+35
-17
35 additions, 17 deletions
MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc
with
35 additions
and
17 deletions
MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc
+
35
−
17
View file @
39f6e0f7
...
@@ -413,14 +413,33 @@ uint16_t OnlineControl::doClaim(const string& cntlrName)
...
@@ -413,14 +413,33 @@ uint16_t OnlineControl::doClaim(const string& cntlrName)
string
processScope
(
"AC.process"
);
string
processScope
(
"AC.process"
);
string
onlineCtrlPrefix
(
globalParameterSet
()
->
locateModule
(
"OnlineCtrl"
)
+
"OnlineCtrl."
);
string
onlineCtrlPrefix
(
globalParameterSet
()
->
locateModule
(
"OnlineCtrl"
)
+
"OnlineCtrl."
);
string
procName
,
newProcName
,
node
Name
;
string
procName
,
startstoptype
,
executable
,
host
Name
;
string
ldName
(
getName
().
c_str
());
string
ldName
(
getName
().
c_str
());
procName
=
globalParameterSet
()
->
getString
(
onlineCtrlPrefix
+
"ApplCtrl.application"
);
procName
=
globalParameterSet
()
->
getString
(
onlineCtrlPrefix
+
"ApplCtrl.ACCprocess.name"
);
startstoptype
=
globalParameterSet
()
->
getString
(
onlineCtrlPrefix
+
"ApplCtrl.ACCprocess.startstopType"
);
executable
=
globalParameterSet
()
->
getString
(
onlineCtrlPrefix
+
"ApplCtrl.ACCprocess.executable"
);
hostName
=
globalParameterSet
()
->
getString
(
onlineCtrlPrefix
+
"ApplCtrl.ACCprocess.hostname"
);
itsCepAppParams
.
adoptCollection
(
globalParameterSet
()
->
makeSubset
(
onlineCtrlPrefix
+
"ApplCtrl"
,
"AC"
));
itsCepAppParams
.
adoptCollection
(
globalParameterSet
()
->
makeSubset
(
onlineCtrlPrefix
+
"ApplCtrl"
,
"AC"
));
itsCepAppParams
.
adoptCollection
(
globalParameterSet
()
->
makeSubset
(
onlineCtrlPrefix
+
procName
,
procName
));
itsCepAppParams
.
adoptCollection
(
globalParameterSet
()
->
makeSubset
(
onlineCtrlPrefix
+
procName
,
procName
));
// add some keys to cope with the differences between the OTDB and ACC
itsCepAppParams
.
replace
(
"AC.process[0].count"
,
"1"
);
itsCepAppParams
.
replace
(
"AC.application"
,
procName
);
itsCepAppParams
.
replace
(
"AC.process[1].ID"
,
procName
);
itsCepAppParams
.
replace
(
"AC.hostname"
,
hostName
);
itsCepAppParams
.
replace
(
formatString
(
"%s.%s[0].startstoptype"
,
procName
.
c_str
(),
procName
.
c_str
()),
startstoptype
);
itsCepAppParams
.
replace
(
formatString
(
"%s.%s[0].executable"
,
procName
.
c_str
(),
procName
.
c_str
()),
executable
);
// create nodelist
vector
<
string
>
nodes
=
globalParameterSet
()
->
getStringVector
(
"Observation.VirtualInstrument.BGLNodeList"
);
int
nodeIndex
=
1
;
for
(
vector
<
string
>::
iterator
it
=
nodes
.
begin
();
it
!=
nodes
.
end
();
++
it
)
{
itsCepAppParams
.
replace
(
formatString
(
"AC.%s[%d].node"
,
procName
.
c_str
(),
nodeIndex
++
),
*
it
);
}
}
}
catch
(
APSException
&
)
catch
(
APSException
&
)
{
{
...
@@ -446,10 +465,10 @@ uint16_t OnlineControl::doPrepare(const string& cntlrName)
...
@@ -446,10 +465,10 @@ uint16_t OnlineControl::doPrepare(const string& cntlrName)
// schedule all ACC commands
// schedule all ACC commands
time_t
startTime
=
to_time_t
(
itsStartTime
);
time_t
startTime
=
to_time_t
(
itsStartTime
);
time_t
initTime
=
startTime
-
itsCepAppParams
.
getTime
(
"AC.timeout
.
init"
);
time_t
initTime
=
startTime
-
itsCepAppParams
.
getTime
(
"AC.timeout
_
init"
);
time_t
defineTime
=
initTime
-
itsCepAppParams
.
getTime
(
"AC.timeout
.
define"
)
-
time_t
defineTime
=
initTime
-
itsCepAppParams
.
getTime
(
"AC.timeout
_
define"
)
-
itsCepAppParams
.
getTime
(
"AC.timeout
.
startup"
);
itsCepAppParams
.
getTime
(
"AC.timeout
_
startup"
);
time_t
bootTime
=
defineTime
-
itsCepAppParams
.
getTime
(
"AC.timeout
.
createsubsets"
);
time_t
bootTime
=
defineTime
-
itsCepAppParams
.
getTime
(
"AC.timeout
_
createsubsets"
);
time_t
now
=
time
(
0
);
time_t
now
=
time
(
0
);
time_t
stopTime
=
to_time_t
(
itsStopTime
);
time_t
stopTime
=
to_time_t
(
itsStopTime
);
LOG_DEBUG
(
formatString
(
"%d boot %s"
,
bootTime
,
ctime
(
&
bootTime
)));
LOG_DEBUG
(
formatString
(
"%d boot %s"
,
bootTime
,
ctime
(
&
bootTime
)));
...
@@ -459,12 +478,11 @@ uint16_t OnlineControl::doPrepare(const string& cntlrName)
...
@@ -459,12 +478,11 @@ uint16_t OnlineControl::doPrepare(const string& cntlrName)
LOG_DEBUG
(
formatString
(
"%d now %s time %d"
,
now
,
ctime
(
&
now
),
time
(
0
)));
LOG_DEBUG
(
formatString
(
"%d now %s time %d"
,
now
,
ctime
(
&
now
),
time
(
0
)));
LOG_DEBUG
(
formatString
(
"%d stop %s"
,
stopTime
,
ctime
(
&
stopTime
)));
LOG_DEBUG
(
formatString
(
"%d stop %s"
,
stopTime
,
ctime
(
&
stopTime
)));
string
hostName
,
remoteParamPath
;
string
hostName
;
hostName
=
itsCepAppParams
.
getString
(
"AC.hostname"
);
hostName
=
itsCepAppParams
.
getString
(
"AC.hostname"
);
remoteParamPath
=
itsCepAppParams
.
getString
(
"AC.remoteParamPath"
);
if
(
now
>
bootTime
)
if
(
now
>
bootTime
)
{
{
APLCommon
::
APLUtilities
::
remoteCopy
(
paramFileName
,
hostName
,
remoteParamPath
);
APLCommon
::
APLUtilities
::
remoteCopy
(
paramFileName
,
hostName
,
LOFAR_SHARE_LOCATION
);
LOG_WARN
(
"Cannot guarantee all CEP processes are started in time."
);
LOG_WARN
(
"Cannot guarantee all CEP processes are started in time."
);
}
}
else
else
...
@@ -489,7 +507,7 @@ uint16_t OnlineControl::doPrepare(const string& cntlrName)
...
@@ -489,7 +507,7 @@ uint16_t OnlineControl::doPrepare(const string& cntlrName)
assert
(
0
);
assert
(
0
);
break
;
break
;
}
}
APLCommon
::
APLUtilities
::
remoteCopy
(
paramFileName
,
hostName
,
remoteParamPath
);
APLCommon
::
APLUtilities
::
remoteCopy
(
paramFileName
,
hostName
,
LOFAR_SHARE_LOCATION
);
}
}
}
}
catch
(
APSException
&
)
catch
(
APSException
&
)
...
@@ -508,7 +526,7 @@ void OnlineControl::doRelease(GCFEvent& /*event*/)
...
@@ -508,7 +526,7 @@ void OnlineControl::doRelease(GCFEvent& /*event*/)
string
hostName
,
remoteFile
,
resultFile
;
string
hostName
,
remoteFile
,
resultFile
;
hostName
=
itsCepAppParams
.
getString
(
"AC.hostname"
);
hostName
=
itsCepAppParams
.
getString
(
"AC.hostname"
);
resultFile
=
formatString
(
"ACC-%s_result.param"
,
getName
().
c_str
());
resultFile
=
formatString
(
"ACC-%s_result.param"
,
getName
().
c_str
());
remoteFile
=
itsCepAppParams
.
getString
(
"AC.remoteParamPath"
)
+
string
(
"/"
)
+
resultFile
;
remoteFile
=
string
(
LOFAR_SHARE_LOCATION
)
+
string
(
"/"
)
+
resultFile
;
APLCommon
::
APLUtilities
::
copyFromRemote
(
hostName
,
remoteFile
,
resultFile
);
APLCommon
::
APLUtilities
::
copyFromRemote
(
hostName
,
remoteFile
,
resultFile
);
itsResultParams
.
adoptFile
(
resultFile
);
itsResultParams
.
adoptFile
(
resultFile
);
// itsResultParams.replace(KVpair(formatString("%s.quality", getName().c_str()), (int) _qualityGuard.getQuality()));
// itsResultParams.replace(KVpair(formatString("%s.quality", getName().c_str()), (int) _qualityGuard.getQuality()));
...
@@ -541,9 +559,9 @@ void OnlineControl::appBooted(uint16 result)
...
@@ -541,9 +559,9 @@ void OnlineControl::appBooted(uint16 result)
if
(
result
==
(
AcCmdMaskOk
|
AcCmdMaskScheduled
))
if
(
result
==
(
AcCmdMaskOk
|
AcCmdMaskScheduled
))
{
{
time_t
startTime
=
to_time_t
(
itsStartTime
);
time_t
startTime
=
to_time_t
(
itsStartTime
);
time_t
initTime
=
startTime
-
itsCepAppParams
.
getTime
(
"AC.timeout
.
init"
);
time_t
initTime
=
startTime
-
itsCepAppParams
.
getTime
(
"AC.timeout
_
init"
);
time_t
defineTime
=
initTime
-
itsCepAppParams
.
getTime
(
"AC.timeout
.
define"
)
-
time_t
defineTime
=
initTime
-
itsCepAppParams
.
getTime
(
"AC.timeout
_
define"
)
-
itsCepAppParams
.
getTime
(
"AC.timeout
.
startup"
);
itsCepAppParams
.
getTime
(
"AC.timeout
_
startup"
);
itsCepApplication
.
define
(
defineTime
);
itsCepApplication
.
define
(
defineTime
);
}
}
else
if
(
result
==
0
)
// Error
else
if
(
result
==
0
)
// Error
...
@@ -559,7 +577,7 @@ void OnlineControl::appDefined(uint16 result)
...
@@ -559,7 +577,7 @@ void OnlineControl::appDefined(uint16 result)
if
(
result
==
(
AcCmdMaskOk
|
AcCmdMaskScheduled
))
if
(
result
==
(
AcCmdMaskOk
|
AcCmdMaskScheduled
))
{
{
time_t
startTime
=
to_time_t
(
itsStartTime
);
time_t
startTime
=
to_time_t
(
itsStartTime
);
time_t
initTime
=
startTime
-
itsCepAppParams
.
getTime
(
"AC.timeout
.
init"
);
time_t
initTime
=
startTime
-
itsCepAppParams
.
getTime
(
"AC.timeout
_
init"
);
itsCepApplication
.
init
(
initTime
);
itsCepApplication
.
init
(
initTime
);
}
}
...
@@ -630,7 +648,7 @@ void OnlineControl::appRecovered(uint16 /*result*/)
...
@@ -630,7 +648,7 @@ void OnlineControl::appRecovered(uint16 /*result*/)
{
{
time_t
startTime
=
to_time_t
(
itsStartTime
);
time_t
startTime
=
to_time_t
(
itsStartTime
);
time_t
reinitTime
=
startTime
-
itsCepAppParams
.
getTime
(
"AC.timeout
.
reinit"
);
time_t
reinitTime
=
startTime
-
itsCepAppParams
.
getTime
(
"AC.timeout
_
reinit"
);
string
paramFileName
(
formatString
(
"ACC-%s.param"
,
getName
().
c_str
()));
string
paramFileName
(
formatString
(
"ACC-%s.param"
,
getName
().
c_str
()));
...
...
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