Skip to content

Commit

Permalink
fix 474
Browse files Browse the repository at this point in the history
  • Loading branch information
dehann committed Dec 16, 2019
1 parent a8e14be commit 7aad120
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/CliqStateMachine.jl
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,11 @@ function determineCliqNeedDownMsg_StateMachine(csmc::CliqStateMachineContainer)
return attemptCliqInitDown_StateMachine
# HALF DUPLICATED IN STEP 4
elseif cliqst == :marginalized
# go to 1
return isCliqUpSolved_StateMachine
## NOTE -- what about notifyCliqUpInitStatus! ??
# go to 10
return determineCliqIfDownSolve_StateMachine
# return determineCliqIfDownSolve_StateMachine
end

# go to 8b
Expand All @@ -550,6 +553,7 @@ function blockCliqSiblingsParentChildrenNeedDown_StateMachine(csmc::CliqStateMac
infocsm(csmc, "6c, check/block sibl&prnt :needdownmsg")
blockCliqSiblingsParentNeedDown(csmc.tree, csmc.cliq, logger=csmc.logger)

# go to 7
return determineCliqNeedDownMsg_StateMachine
end

Expand Down Expand Up @@ -583,7 +587,7 @@ end
$SIGNATURES

Notes
- State machine function nr. 4
- State machine function nr.4
"""
function isCliqNull_StateMachine(csmc::CliqStateMachineContainer)

Expand Down Expand Up @@ -637,6 +641,7 @@ function doesCliqNeeddownmsg_StateMachine(csmc::CliqStateMachineContainer)

if cliqst != :null
if cliqst != :needdownmsg
# go to 6c
return blockCliqSiblingsParentChildrenNeedDown_StateMachine
end
else
Expand All @@ -661,9 +666,11 @@ function doesCliqNeeddownmsg_StateMachine(csmc::CliqStateMachineContainer)
return blockCliqSiblingsParentChildrenNeedDown_StateMachine
end # != :null

areChildDown = areCliqChildrenNeedDownMsg(csmc.tree, csmc.cliq)
infocsm(csmc, "4b, areCliqChildrenNeedDownMsg(csmc.tree, csmc.cliq)=$(areChildDown)")
# if cliqst == :needdownmsg
if areCliqChildrenNeedDownMsg(csmc.tree, csmc.cliq)
infocsm(csmc, "4, must deal with child :needdownmsg")
if areChildDown
infocsm(csmc, "4b, must deal with child :needdownmsg")
csmc.forceproceed = true
else
# go to 5
Expand Down
5 changes: 5 additions & 0 deletions src/TreeBasedInitialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ function blockCliqUntilParentDownSolved(prnt::Graphs.ExVertex; logger=ConsoleLog
with_logger(logger) do
@info "blockCliqUntilParentDownSolved, prntcliq=$(prnt.index) | $lbl | going to fetch initdownchannel..."
end
flush(logger.stream)
while fetch(getData(prnt).initDownChannel) != :downsolved
# @sync begin
# @async begin
Expand Down Expand Up @@ -355,8 +356,12 @@ function blockCliqUntilChildrenHaveUpStatus(tree::BayesTree,
with_logger(logger) do
@info "cliq $(prnt.index), child $(ch.index) status is $(chst), isready(initUpCh)=$(isready(getData(ch).initUpChannel))."
end
flush(logger.stream)
ret[ch.index] = fetch(getData(ch).initUpChannel)
end
with_logger(logger) do
@info "cliq $(prnt.index), fetched all."
end
return ret
end

Expand Down

0 comments on commit 7aad120

Please sign in to comment.