If you make a yMMSL file with two components with F_INIT and O_F ports, and hook them up in a loop, the manager will hang if you try to start it.
ymmsl_version: v0.1
model:
name: simple_hang
components:
a:
implementation: a
ports:
f_init: i
o_f: o
b:
implementation: b
ports:
f_init: i
o_f: o
conduits:
a.o: b.i
b.o: a.i
settings: {}
resources:
a:
threads: 1
b:
threads: 1
implementations:
a:
executable: a
b:
executable: b
The problem is in ModelGraph.calc_predecessors() which tries to find a next component to process that has all its predecessors already processed. If there aren't any, it keeps trying.
I think that we need to check at the end of the loop if started and finished are both empty. If that's the case, then nothing has changed, and therefore nothing will change, so we should quit the loop. If there are still items in todo or doing, then we have a loop and should generate an error message.
If you make a yMMSL file with two components with F_INIT and O_F ports, and hook them up in a loop, the manager will hang if you try to start it.
The problem is in
ModelGraph.calc_predecessors()
which tries to find a next component to process that has all its predecessors already processed. If there aren't any, it keeps trying.I think that we need to check at the end of the loop if
started
andfinished
are both empty. If that's the case, then nothing has changed, and therefore nothing will change, so we should quit the loop. If there are still items intodo
ordoing
, then we have a loop and should generate an error message.