Commit 630acdd6 authored by Georgios Dagkakis's avatar Georgios Dagkakis

correction so that the receiver is correctly identified

parent 9c758f6c
...@@ -69,6 +69,7 @@ class BatchesWIPShort(plugin.InputPreparationPlugin): ...@@ -69,6 +69,7 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
print stationId, self.checkIfStationIsAfterDecomposition(data, stationId),self.getBuffer(data, stationId) print stationId, self.checkIfStationIsAfterDecomposition(data, stationId),self.getBuffer(data, stationId)
awaiting=stationWIPData[1] awaiting=stationWIPData[1]
complete=stationWIPData[2] complete=stationWIPData[2]
startingBatchCounter=batchCounter
if not awaiting: if not awaiting:
awaiting=0 awaiting=0
awaiting=int(awaiting) awaiting=int(awaiting)
...@@ -95,9 +96,17 @@ class BatchesWIPShort(plugin.InputPreparationPlugin): ...@@ -95,9 +96,17 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
# set the buffered sub-batches to the previous station # set the buffered sub-batches to the previous station
for i in range(bufferedSubBatches): for i in range(bufferedSubBatches):
receiver=None
if startingBatchCounter!=batchCounter and bufferedSubBatches % (standardBatchUnits/workingBatchSize):
if (proceeded or currentCompleted):
receiver=stationId
else:
receiver=self.getParallelStations(data, stationId)[0]
bufferId=self.getPredecessors(data, stationId)[0] bufferId=self.getPredecessors(data, stationId)[0]
self.createSubBatch(data, bufferId, currentBatchId, currentBatchId, subBatchCounter, self.createSubBatch(data, bufferId, currentBatchId, currentBatchId, subBatchCounter,
workingBatchSize,receiver=stationId) workingBatchSize,receiver=receiver)
subBatchCounter+=1 subBatchCounter+=1
unitsToCompleteBatch-=workingBatchSize unitsToCompleteBatch-=workingBatchSize
if unitsToCompleteBatch==0: if unitsToCompleteBatch==0:
...@@ -161,7 +170,7 @@ class BatchesWIPShort(plugin.InputPreparationPlugin): ...@@ -161,7 +170,7 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
# creates a sub-batch in a station # creates a sub-batch in a station
def createSubBatch(self,data,stationId,parentBatchId,parentBatchName,subBatchId,numberOfUnits, def createSubBatch(self,data,stationId,parentBatchId,parentBatchName,subBatchId,numberOfUnits,
unitsToProcess=0,receiver=None): unitsToProcess=0,receiver=None):
print 'creating sub-batch',stationId,parentBatchId print 'creating sub-batch',stationId,parentBatchId,receiver
data['graph']['node'][stationId]['wip'].insert(0,{ data['graph']['node'][stationId]['wip'].insert(0,{
"_class": 'Dream.SubBatch', "_class": 'Dream.SubBatch',
"id": parentBatchId+'_SB_'+str(subBatchId)+'_wip', "id": parentBatchId+'_SB_'+str(subBatchId)+'_wip',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment