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
30e62cde
Commit
30e62cde
authored
Aug 20, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
if it is a full batch buffered before the decomposition create it this way
parent
27e90ab1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
4 deletions
+28
-4
dream/plugins/Batches/BatchesWIPShort.py
dream/plugins/Batches/BatchesWIPShort.py
+28
-4
No files found.
dream/plugins/Batches/BatchesWIPShort.py
View file @
30e62cde
...
@@ -80,8 +80,21 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
...
@@ -80,8 +80,21 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
proceeded
=
complete
-
(
complete
%
workingBatchSize
)
proceeded
=
complete
-
(
complete
%
workingBatchSize
)
currentCompleted
=
awaiting
%
workingBatchSize
currentCompleted
=
awaiting
%
workingBatchSize
print
buffered
,
proceeded
,
currentCompleted
print
buffered
,
proceeded
,
currentCompleted
bufferedSubBatches
=
int
(
buffered
/
workingBatchSize
)
if
self
.
checkIfStationIsAfterDecomposition
(
data
,
stationId
):
if
buffered
>=
standardBatchUnits
:
bufferedBatches
=
int
(
buffered
/
standardBatchUnits
)
bufferedSubBatches
=
int
((
buffered
-
bufferedBatches
*
standardBatchUnits
)
/
workingBatchSize
)
print
bufferedBatches
,
bufferedSubBatches
for
i
in
range
(
bufferedBatches
):
bufferId
=
self
.
getBuffer
(
data
,
stationId
)
self
.
createBatch
(
data
,
bufferId
,
currentBatchId
,
currentBatchId
,
standardBatchUnits
)
batchCounter
+=
1
currentBatchId
=
'Batch_'
+
str
(
batchCounter
)
+
'_WIP'
# set the buffered sub-batches to the previous station
# set the buffered sub-batches to the previous station
for
i
in
range
(
int
(
buffered
/
workingBatchSize
)
):
for
i
in
range
(
bufferedSubBatches
):
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
=
stationId
)
...
@@ -114,8 +127,7 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
...
@@ -114,8 +127,7 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
batchCounter
+=
1
batchCounter
+=
1
currentBatchId
=
'Batch_'
+
str
(
batchCounter
)
+
'_WIP'
currentBatchId
=
'Batch_'
+
str
(
batchCounter
)
+
'_WIP'
unitsToCompleteBatch
=
standardBatchUnits
unitsToCompleteBatch
=
standardBatchUnits
# for stations that operate on full batches
# for stations that do not share sub-batches with others
else
:
else
:
pass
pass
...
@@ -124,7 +136,7 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
...
@@ -124,7 +136,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'
,
stationId
,
parentBatchId
print
'creating
sub-batch
'
,
stationId
,
parentBatchId
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'
,
...
@@ -137,6 +149,18 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
...
@@ -137,6 +149,18 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
}
}
)
)
# creates a batch in a station
def
createBatch
(
self
,
data
,
stationId
,
batchId
,
batchName
,
numberOfUnits
,
unitsToProcess
=
0
):
print
'creating batch'
,
stationId
,
batchId
,
numberOfUnits
data
[
'graph'
][
'node'
][
stationId
][
'wip'
].
insert
(
0
,{
"_class"
:
'Dream.Batch'
,
"id"
:
batchId
+
'_wip'
,
"name"
:
batchName
+
'_wip'
,
"numberOfUnits"
:
numberOfUnits
,
"unitsToProcess"
:
unitsToProcess
,
}
)
# gets the data and a station id and returns a list with all the stations that the station may share batches
# gets the data and a station id and returns a list with all the stations that the station may share batches
def
findSharingStations
(
self
,
data
,
stationId
):
def
findSharingStations
(
self
,
data
,
stationId
):
nodes
=
data
[
'graph'
][
'node'
]
nodes
=
data
[
'graph'
][
'node'
]
...
...
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