Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
1a6f4a36
Commit
1a6f4a36
authored
Sep 11, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Nov 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BatchDecomposition correction in canDispose loop
parent
a7b9cc20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
21 deletions
+30
-21
dream/simulation/BatchDecomposition.py
dream/simulation/BatchDecomposition.py
+30
-21
No files found.
dream/simulation/BatchDecomposition.py
View file @
1a6f4a36
...
...
@@ -90,6 +90,7 @@ class BatchDecomposition(CoreObject):
self
.
expectedSignals
[
'isRequested'
]
=
1
self
.
expectedSignals
[
'interruptionStart'
]
=
1
self
.
expectedSignals
[
'initialWIP'
]
=
1
self
.
printTrace
(
self
.
id
,
waitEvent
=
'(isRequested), interruptionStart, initialWIP'
)
receivedEvent
=
yield
self
.
env
.
any_of
([
self
.
isRequested
,
self
.
interruptionStart
,
self
.
initialWIP
])
# if an interruption has occurred
if
self
.
interruptionStart
in
receivedEvent
:
...
...
@@ -99,7 +100,7 @@ class BatchDecomposition(CoreObject):
# wait till it is over
self
.
expectedSignals
[
'interruptionEnd'
]
=
1
self
.
printTrace
(
self
.
id
,
waitEvent
=
'interruptionEnd'
)
yield
self
.
interruptionEnd
transmitter
,
eventTime
=
self
.
interruptionEnd
.
value
...
...
@@ -118,6 +119,7 @@ class BatchDecomposition(CoreObject):
else
:
requestingObject
,
eventTime
=
self
.
isRequested
.
value
assert
requestingObject
==
self
.
giver
,
'the giver is not the requestingObject'
self
.
printTrace
(
self
.
id
,
isRequested
=
requestingObject
.
id
)
self
.
isRequested
=
self
.
env
.
event
()
break
...
...
@@ -151,8 +153,10 @@ class BatchDecomposition(CoreObject):
if
not
signaling
:
# if there was no success wait till the receiver is available
while
1
:
self
.
printTrace
(
self
.
id
,
waitEvent
=
'canDispose'
)
self
.
expectedSignals
[
'canDispose'
]
=
1
yield
self
.
canDispose
self
.
printTrace
(
self
.
id
,
canDispose
=
''
)
transmitter
,
eventTime
=
self
.
canDispose
.
value
self
.
canDispose
=
self
.
env
.
event
()
# signal the receiver again and break
...
...
@@ -160,32 +164,37 @@ class BatchDecomposition(CoreObject):
self
.
waitEntityRemoval
=
True
self
.
expectedSignals
[
'entityRemoved'
]
=
1
self
.
printTrace
(
self
.
id
,
waitEvent
=
'entityRemoved'
)
yield
self
.
entityRemoved
self
.
printTrace
(
self
.
id
,
received
=
''
)
transmitter
,
eventTime
=
self
.
entityRemoved
.
value
self
.
waitEntityRemoval
=
False
break
break
# for the consecutive times wait till the receiver is available and then signalReceiver
# we know that the receiver is occupied with the previous sub-batch
else
:
while
1
:
self
.
expectedSignals
[
'canDispose'
]
=
1
yield
self
.
canDispose
transmitter
,
eventTime
=
self
.
canDispose
.
value
self
.
canDispose
=
self
.
env
.
event
()
signaling
=
self
.
signalReceiver
()
if
signaling
:
self
.
waitEntityRemoval
=
True
self
.
expectedSignals
[
'entityRemoved'
]
=
1
yield
self
.
entityRemoved
transmitter
,
eventTime
=
self
.
entityRemoved
.
value
self
.
waitEntityRemoval
=
False
break
if
not
self
.
signalReceiver
():
while
1
:
self
.
printTrace
(
self
.
id
,
waitEvent
=
'canDispose'
)
# or entityRemoved')
self
.
expectedSignals
[
'canDispose'
]
=
1
yield
self
.
canDispose
self
.
printTrace
(
self
.
id
,
canDispose
=
''
)
transmitter
,
eventTime
=
self
.
canDispose
.
value
self
.
canDispose
=
self
.
env
.
event
()
if
not
self
.
getActiveObjectQueue
():
break
signaling
=
self
.
signalReceiver
()
if
signaling
:
self
.
waitEntityRemoval
=
True
self
.
expectedSignals
[
'entityRemoved'
]
=
1
self
.
printTrace
(
self
.
id
,
waitEvent
=
'entityRemoved'
)
yield
self
.
entityRemoved
self
.
printTrace
(
self
.
id
,
received
=
'entityRemoved'
)
transmitter
,
eventTime
=
self
.
entityRemoved
.
value
self
.
waitEntityRemoval
=
False
break
self
.
entityRemoved
=
self
.
env
.
event
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment