janus : exploiting parallelism via hindsight
DESCRIPTION
Janus : exploiting parallelism via hindsight. Roman Manevich. Omer Tripp. John Field. Mooly Sagiv. the PMD code analyzer. the PMD code analyzer. popular open-source code analyzer (~2,000 weekly downloads). the PMD code analyzer. popular open-source code analyzer (~2,000 weekly downloads). - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/1.jpg)
John Field
Janus: exploiting parallelism via hindsight
Omer Tripp Roman Manevich
Mooly Sagiv
![Page 2: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/2.jpg)
the PMD code analyzer
![Page 3: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/3.jpg)
the PMD code analyzerpopular open-source code analyzer (~2,000 weekly
downloads)
![Page 4: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/4.jpg)
the PMD code analyzerpopular open-source code analyzer (~2,000 weekly
downloads)
scans source files modularly =>
parallelization opportunity
![Page 5: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/5.jpg)
the main loop of PMD (simplified)
![Page 6: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/6.jpg)
the main loop of PMD
analyze files in parallel
![Page 7: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/7.jpg)
the main loop of PMD
but.. (shared as local)
![Page 8: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/8.jpg)
the main loop of PMD
hmm.. can’t we “localize” ctx?
![Page 9: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/9.jpg)
the main loop of PMDnot so fast.. (happens sometimes, deep down the stack)
![Page 10: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/10.jpg)
the main loop of PMD
no cloning =>
![Page 11: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/11.jpg)
the main loop of PMD
reuse => @atomic ≈ @sequential
![Page 12: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/12.jpg)
the main loop of PMDto summarize..
![Page 13: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/13.jpg)
the main loop of PMDto summarize..available
parallelism
![Page 14: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/14.jpg)
the main loop of PMDto summarize..available
parallelismmissed by write-set approach
![Page 15: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/15.jpg)
Janus: sequence-based detection/* offlin
e */
![Page 16: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/16.jpg)
T1
ctx.sourceCodeFilename = …;…String fname=ctx.sourceCodeFilename;…
T2
ctx.sourceCodeFilename = …;…String fname=ctx.sourceCodeFilename;…
Janus: sequence-based detection/* offlin
e */
![Page 17: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/17.jpg)
T1
ctx.sourceCodeFilename = …;…String fname=ctx.sourceCodeFilename;…
T2
ctx.sourceCodeFilename = …;…String fname=ctx.sourceCodeFilename;…
Janus: sequence-based detection/* offlin
e */
![Page 18: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/18.jpg)
Janus: sequence-based detectionT1
ctx.sourceCodeFilename = …;…ctx.setAttribute(s, …);…
T2
ctx.sourceCodeFilename = …;…… = ctx.getAttribute(s);…
/* offline */
![Page 19: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/19.jpg)
Janus: sequence-based detectionT1
ctx.sourceCodeFilename = …;…ctx.setAttribute(s, …);…
T2
ctx.sourceCodeFilename = …;…… = ctx.getAttribute(s);…
/* offline */
![Page 20: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/20.jpg)
Janus: sequence-based detectionT1
ctx.sourceCodeFilename = …;…ctx.setAttribute(s, …);…
T2
ctx.sourceCodeFilename = …;…… = ctx.getAttribute(s);…
/* offline */
![Page 21: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/21.jpg)
the main loop of PMD
in paper:• more real-world examples• more coding patterns encouraging refined conflict detection
![Page 22: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/22.jpg)
![Page 23: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/23.jpg)
running example
Reverse-Delete MST
G’ = G(e1 … en) = SortEdgesByDecreasingWeight() for i=1 … n
G’.RemoveEdge(ei)if (!G’.HasPath(ei.u, ei.v))
G’.AddEdge(ei)return G’
![Page 24: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/24.jpg)
running example
Reverse-Delete MST
G’ = G(e1 … en) = SortEdgesByDecreasingWeight() for i=1 … n
G’.RemoveEdge(ei)if (!G’.HasPath(ei.u, ei.v))
G’.AddEdge(ei)return G’
ordered
![Page 25: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/25.jpg)
running example
Reverse-Delete MST
G’ = G(e1 … en) = SortEdgesByDecreasingWeight() for i=1 … n
G’.RemoveEdge(ei)if (!G’.HasPath(ei.u, ei.v))
G’.AddEdge(ei)return G’
heavy
![Page 26: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/26.jpg)
running example
Reverse-Delete MST
G’ = G(e1 … en) = SortEdgesByDecreasingWeight() for i=1 … n
G’.RemoveEdge(ei)if (!G’.HasPath(ei.u, ei.v))
G’.AddEdge(ei)return G’
identity if edge restored (available parallelism)
![Page 27: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/27.jpg)
take I: blind parallelism
Reverse-Delete MST
G’ = G(e1 … en) = SortEdgesByDecreasingWeight() for i=1 … n
G’.RemoveEdge(ei)if (!G’.HasPath(ei.u, ei.v))
G’.AddEdge(ei)return G’
parallel for // broken but fast
![Page 28: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/28.jpg)
take II: write-set speculation
Reverse-Delete MST
G’ = G(e1 … en)= SortEdgesByDecreasingWeight() for i=1 … n
G’.RemoveEdge(ei)if (!G’.HasPath(ei.u, ei.v))
G’.AddEdge(ei)return G’
/* with boosting *
/
@atomic // exploit graph semantics: node ≈ location
![Page 29: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/29.jpg)
take II: write-set speculation/* with b
oosting */
can we exploit the available
parallelism with this
approach?
![Page 30: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/30.jpg)
the write-set approach in action
T1 T2
v1 v2uG:
![Page 31: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/31.jpg)
the write-set approach in action
RemoveEdge(u,v1) RemoveEdge(u,v2)T1 T2
v1 v2uG:
![Page 32: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/32.jpg)
the write-set approach in action
RemoveEdge(u,v1) RemoveEdge(u,v2)T1 T2
v1 v2uG:
![Page 33: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/33.jpg)
the write-set approach in action
RemoveEdge(u,v1)b = HasPath(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)
T1 T2
v1 v2uG:
![Page 34: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/34.jpg)
the write-set approach in action
RemoveEdge(u,v1)b = HasPath(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)
T1 T2
v1 v2uG:
![Page 35: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/35.jpg)
the write-set approach in action
RemoveEdge(u,v1)b = HasPath(u,v1)test b
RemoveEdge(u,v2)b = HasPath(u,v2)test b
T1 T2
v1 v2uG:
![Page 36: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/36.jpg)
the write-set approach in action
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
![Page 37: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/37.jpg)
the write-set approach in action
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
![Page 38: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/38.jpg)
take III: online commutativity checking
/* with boosting *
/
Reverse-Delete MST
G’ = G(e1 … en)= SortEdgesByDecreasingWeight() for i=1 … n
G’.RemoveEdge(ei)if (!G’.HasPath(ei.u, ei.v))
G’.AddEdge(ei)return G’
@atomic // full commutativity checking
![Page 39: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/39.jpg)
precise checking in action
v1 v2uG:
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
![Page 40: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/40.jpg)
precise checking in action
v1 v2uG:
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
![Page 41: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/41.jpg)
precise checking in action
v1 v2uG:
RemoveEdge(u,v1); HasPath(u,v1); AddEdge(u,v1)
RemoveEdge(u,v2); HasPath(u,v2); AddEdge(u,v2)
∙
RemoveEdge(u,v2); HasPath(u,v2); AddEdge(u,v2)
RemoveEdge(u,v1); HasPath(u,v1); AddEdge(u,v1)
∙
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
≡
![Page 42: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/42.jpg)
precise checking in action
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
RemoveEdge(u,v1); HasPath(u,v1); AddEdge(u,v1)
RemoveEdge(u,v2); HasPath(u,v2); AddEdge(u,v2)
∙
RemoveEdge(u,v2); HasPath(u,v2); AddEdge(u,v2)
RemoveEdge(u,v1); HasPath(u,v1); AddEdge(u,v1)
∙≡
![Page 43: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/43.jpg)
but.. can we really afford this?
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
![Page 44: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/44.jpg)
but.. can we really afford this?
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
expensive instrumentation
![Page 45: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/45.jpg)
but.. can we really afford this?
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
expensive instrumentation
+
![Page 46: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/46.jpg)
but.. can we really afford this?
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
expensive instrumentation
expensive conflict detection+
![Page 47: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/47.jpg)
but.. can we really afford this?
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
expensive instrumentation
expensive conflict detection+
![Page 48: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/48.jpg)
but.. can we really afford this?
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
expensive instrumentation
expensive conflict detection+poor performance
![Page 49: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/49.jpg)
take III: Janus/* with b
oosting */
Reverse-Delete MST
G’ = G(e1 … en)= SortEdgesByDecreasingWeight() for i=1 … n
G’.RemoveEdge(ei)if (!G’.HasPath(ei.u, ei.v))
G’.AddEdge(ei)return G’
@atomic // accurate checking utilizing offline data!
![Page 50: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/50.jpg)
the Janus approach
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
![Page 51: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/51.jpg)
the Janus approach
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
sequence-based detection
![Page 52: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/52.jpg)
the Janus approach
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
sequence-based detection => accurate
![Page 53: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/53.jpg)
the Janus approach
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
sequence-based detection
candidate sequences learned ahead of production runs, in profiling
=> accurate
![Page 54: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/54.jpg)
the Janus approach
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
sequence-based detection
candidate sequences learned ahead of production runs, in profiling
commutativity testing done offline
=> accurate
![Page 55: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/55.jpg)
the Janus approach
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
sequence-based detection
candidate sequences gleaned ahead of production runs, in profiling
commutativity testing done offline
=> accurate=> cheap
![Page 56: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/56.jpg)
![Page 57: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/57.jpg)
the Janus flow
offline
![Page 58: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/58.jpg)
the Janus flowfind candidate sequences via
profiling*ST runs*single
locations
offline
![Page 59: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/59.jpg)
the Janus flowfind candidate sequences via
profiling*ST runs*single
locations
offlinelow instrumentation
overhead
![Page 60: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/60.jpg)
the Janus flowfind candidate sequences via
profiling*ST runs*single
locations
test sequences for
commutativity
offline
![Page 61: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/61.jpg)
the Janus flowfind candidate sequences via
profiling*ST runs*single
locations
test sequences for
commutativity
cache (generalized version) of
commutative sequences
offline
![Page 62: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/62.jpg)
the Janus flowfind candidate sequences via
profiling*ST runs*single
locations
test sequences for
commutativity
cache (generalized version) of
commutative sequences
offline
cheap conflict detection
![Page 63: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/63.jpg)
the Janus flowfind candidate sequences via
profiling*ST runs*single
locations
test sequences for
commutativity
cache (generalized version) of
commutative sequences
offline
![Page 64: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/64.jpg)
the Janus flowfind candidate sequences via
profiling*ST runs*single
locations
test sequences for
commutativity
cache (generalized version) of
commutative sequences
offline
online
![Page 65: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/65.jpg)
the Janus flow
consult sequence cache
when attempting to
commit a transaction
find candidate sequences via
profiling*ST runs*single
locations
test sequences for
commutativity
cache (generalized version) of
commutative sequences
offline
online
![Page 66: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/66.jpg)
the Janus flow
consult sequence cache
when attempting to
commit a transaction
find candidate sequences via
profiling*ST runs*single
locations
test sequences for
commutativity
cache (generalized version) of
commutative sequences
offline
online
miss perform write-set detection
![Page 67: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/67.jpg)
the Janus flow
consult sequence cache
when attempting to
commit a transaction
miss perform write-set detection
online
soundness
![Page 68: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/68.jpg)
![Page 69: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/69.jpg)
the Janus flow
consult sequence cache
when attempting to
commit a transaction
find candidate sequences via
profiling*ST runs*single
locations
test sequences for
commutativity
cache (generalized version) of
commutative sequences
offline
online
miss perform write-set detection
user input
![Page 70: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/70.jpg)
the Janus spec: data
n1:v1
n2:v2 n3:v2
n4:v1
![Page 71: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/71.jpg)
the Janus spec: data
n1:v1
node data
n1 v1
… …
neighbor node
n2 n1
n1 n2
n3 n1
… …
n2:v2 n3:v2
n4:v1
![Page 72: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/72.jpg)
the Janus spec: operationsnode data
n1 V1
n2 v2
n1:v1
n2:v2
![Page 73: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/73.jpg)
the Janus spec: operationsnode data
n1 V1
n2 v2
n1:v1
n2:v2
public void addnode(n) { nodes.add(n); }
![Page 74: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/74.jpg)
the Janus spec: operations
public void addnode(n) { nodes.add(n); }
node data
n1 V1
n2 v2
insert <n.d,n> into “nodes”
n1:v1
n2:v2
![Page 75: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/75.jpg)
the Janus spec: operationsnode data
n1 V1
n2 v2
n1:v1
n2:v2
n1:v1
n2:v2
n.d:n
public void addnode(n) { nodes.add(n); }
insert <n.d,n> into “nodes”
![Page 76: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/76.jpg)
the Janus spec: operationsnode data
n1 V1
n2 v2
n1:v1
n2:v2
node data
n1 v1
n2 v2
n n.d
n1:v1
n2:v2
n.d:n
public void addnode(n) { nodes.add(n); }
insert <n.d,n> into “nodes”
![Page 77: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/77.jpg)
the Janus flow
consult sequence cache
when attempting to
commit a transaction
find candidate sequences via
profiling*ST runs*single
locations
test sequences for
commutativity
cache (generalized version) of
commutative sequences
offline
online
miss perform write-set detection
![Page 78: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/78.jpg)
sequence mining
v1 v2uG:
![Page 79: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/79.jpg)
sequence mining
v1 v2uG:
G’ = G
![Page 80: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/80.jpg)
sequence mining
v1 v2uG:
G’ = G(e1 … en) = SortEdgesByDecreasingWeight()
![Page 81: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/81.jpg)
sequence mining
RemoveEdge(u,v1)T1
v1 v2uG:
G’ = G(e1 … en) = SortEdgesByDecreasingWeight()
![Page 82: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/82.jpg)
sequence mining
RemoveEdge(u,v1)b = HasPath(u,v1)
T1
v1 v2uG:
G’ = G(e1 … en) = SortEdgesByDecreasingWeight()
![Page 83: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/83.jpg)
sequence mining
RemoveEdge(u,v1)b = HasPath(u,v1)
T1
v1 v2uG:
G’ = G(e1 … en) = SortEdgesByDecreasingWeight()
RemoveEdge/T1; HasPath/T1
![Page 84: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/84.jpg)
sequence mining
RemoveEdge(u,v1)b = HasPath(u,v1)test b
T1
v1 v2uG:
G’ = G(e1 … en) = SortEdgesByDecreasingWeight()
RemoveEdge/T1; HasPath/T1
![Page 85: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/85.jpg)
sequence mining
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
T1
v1 v2uG:
G’ = G(e1 … en) = SortEdgesByDecreasingWeight()
RemoveEdge/T1; HasPath/T1
![Page 86: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/86.jpg)
sequence mining
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
T1
v1 v2uG:
G’ = G(e1 … en) = SortEdgesByDecreasingWeight()
RemoveEdge/T1; HasPath/T1; AddEdge/T1
![Page 87: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/87.jpg)
sequence mining
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)T1 T2
v1 v2uG:
G’ = G(e1 … en) = SortEdgesByDecreasingWeight()
RemoveEdge/T1; HasPath/T1; AddEdge/T1
![Page 88: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/88.jpg)
sequence mining
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)T1 T2
v1 v2uG:
G’ = G(e1 … en) = SortEdgesByDecreasingWeight()
RemoveEdge/T1; HasPath/T1; AddEdge/T1
RemoveEdge/T2
![Page 89: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/89.jpg)
sequence mining
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)
T1 T2
v1 v2uG:
G’ = G(e1 … en) = SortEdgesByDecreasingWeight()
RemoveEdge/T1; HasPath/T1; AddEdge/T1
RemoveEdge/T2
![Page 90: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/90.jpg)
sequence mining
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test b
T1 T2
v1 v2uG:
G’ = G(e1 … en) = SortEdgesByDecreasingWeight()
RemoveEdge/T1; HasPath/T1; AddEdge/T1
RemoveEdge/T2; HasPath/T2
![Page 91: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/91.jpg)
sequence mining
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
G’ = G(e1 … en) = SortEdgesByDecreasingWeight()
RemoveEdge/T1; HasPath/T1; AddEdge/T1
RemoveEdge/T2; HasPath/T2
![Page 92: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/92.jpg)
sequence mining
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
G’ = G(e1 … en) = SortEdgesByDecreasingWeight()
RemoveEdge/T1; HasPath/T1; AddEdge/T1
RemoveEdge/T2; HasPath/T2; AddEdge/T2
![Page 93: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/93.jpg)
sequence mining
RemoveEdge(u,v1)b = HasPath(u,v1)test bAddEdge(u,v1)
RemoveEdge(u,v2)b = HasPath(u,v2)test bAddEdge(u,v2)
T1 T2
v1 v2uG:
G’ = G(e1 … en) = SortEdgesByDecreasingWeight()
return G’
RemoveEdge/T1; HasPath/T1; AddEdge/T1
RemoveEdge/T2; HasPath/T2; AddEdge/T2
![Page 94: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/94.jpg)
the Janus flow
consult sequence cache
when attempting to
commit a transaction
find candidate sequences via
profiling*ST runs*single
locations
test sequences for
commutativity
cache (generalized version) of
commutative sequences
offline
online
miss perform write-set detection
![Page 95: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/95.jpg)
commutativity checking
RemoveEdge(u,v1
); HasPath(u,v1); AddEdge(u,v1)
RemoveEdge(u,v2
); HasPath(u,v2); AddEdge(u,v2)
∙
RemoveEdge(u,v2
); HasPath(u,v2); AddEdge(u,v2)
RemoveEdge(u,v1
); HasPath(u,v1); AddEdge(u,v1)
∙
![Page 96: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/96.jpg)
commutativity checking
RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y)
RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z)
∙
RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z)
RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y)
∙
![Page 97: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/97.jpg)
commutativity checking
ɸ0 = encode(G)ɸ1 = ɸ0 ˄ {x,y} ϵ “edges”…ɸk = ɸk-1 ˄ {x,y} ϵ “edges”…ɸk+1 = ɸk ˄ {x,y} ϵ “edges”…ɸm = ɸm-1 ˄ {x,y} ϵ “edges”
ψ0 = encode(G)ψ1 = ψ0 ˄ {x,z} ϵ “edges”…ψk = ψk-1 ˄ {x,z} ϵ “edges”…ψk+1 = ψk ˄ {x,y} ϵ “edges”…ψm = ψm-1 ˄ {x,y} ϵ “edges”
RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y)
RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z)
∙
RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z)
RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y)
∙
![Page 98: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/98.jpg)
commutativity checking
ɸ0 = encode(G)ɸ1 = ɸ0 ˄ {x,y} ϵ “edges”…ɸk = ɸk-1 ˄ {x,y} ϵ “edges”…ɸk+1 = ɸk ˄ {x,y} ϵ “edges”…ɸm = ɸm-1 ˄ {x,y} ϵ “edges”
ψ0 = encode(G)ψ1 = ψ0 ˄ {x,z} ϵ “edges”…ψk = ψk-1 ˄ {x,z} ϵ “edges”…ψk+1 = ψk ˄ {x,y} ϵ “edges”…ψm = ψm-1 ˄ {x,y} ϵ “edges”
RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y)
RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z)
∙
RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z)
RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y)
∙
test: ¬(ѱ ≡ ɸ)
![Page 99: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/99.jpg)
commutativity checking
ɸ0 = encode(G)ɸ1 = ɸ0 ˄ {x,y} ϵ “edges”…ɸk = ɸk-1 ˄ {x,y} ϵ “edges”…ɸk+1 = ɸk ˄ {x,y} ϵ “edges”…ɸm = ɸm-1 ˄ {x,y} ϵ “edges”
ψ0 = encode(G)ψ1 = ψ0 ˄ {x,z} ϵ “edges”…ψk = ψk-1 ˄ {x,z} ϵ “edges”…ψk+1 = ψk ˄ {x,y} ϵ “edges”…ψm = ψm-1 ˄ {x,y} ϵ “edges”
RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y)
RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z)
∙
RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z)
RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y)
∙
test: ¬(ѱ ≡ ɸ)
in paper:• encoding rules• “projection” : sound commutativity checking for sequences induced by individual memory locations
![Page 100: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/100.jpg)
the Janus flow
consult sequence cache
when attempting to
commit a transaction
find candidate sequences via
profiling*ST runs*single
locations
test sequences for
commutativity
cache (generalized version) of
commutative sequences
offline
online
miss perform write-set detection
![Page 101: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/101.jpg)
generalization RemoveEdge(x,y); HasPath(x,y);
AddEdge(x,y)S1= RemoveEdge(x,z); HasPath(x,z);
AddEdge(x,z)S2=
![Page 102: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/102.jpg)
generalization RemoveEdge(x,y); HasPath(x,y);
AddEdge(x,y)S1= RemoveEdge(x,z); HasPath(x,z);
AddEdge(x,z)S2=
[S1 S2]G // “concrete” seq.s commute
![Page 103: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/103.jpg)
generalization RemoveEdge(x,y); HasPath(x,y);
AddEdge(x,y)S1= RemoveEdge(x,z); HasPath(x,z);
AddEdge(x,z)S2=
[S1 S2]G // “concrete” seq.s commute
S1(G) = S1∙S1(G) // idempotentS2(G) = S2∙S2(G) // idempotent
![Page 104: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/104.jpg)
generalization RemoveEdge(x,y); HasPath(x,y);
AddEdge(x,y)S1= RemoveEdge(x,z); HasPath(x,z);
AddEdge(x,z)S2=
[S1 S2]G // “concrete” seq.s commute
S1(G) = S1∙S1(G) // idempotentS2(G) = S2∙S2(G) // idempotent
![Page 105: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/105.jpg)
generalization RemoveEdge(x,y); HasPath(x,y);
AddEdge(x,y)S1= RemoveEdge(x,z); HasPath(x,z);
AddEdge(x,z)S2=
[S1 S2]G // “concrete” seq.s commute
S1(G) = S1∙S1(G) // idempotentS2(G) = S2∙S2(G) // idempotent
[S1+ S2
+]G // Kleene-cross generalization
![Page 106: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/106.jpg)
generalization RemoveEdge(x,y); HasPath(x,y);
AddEdge(x,y)S1= RemoveEdge(x,z); HasPath(x,z);
AddEdge(x,z)S2=
[S1 S2]G // “concrete” seq.s commute
S1(G) = S1∙S1(G) // idempotentS2(G) = S2∙S2(G) // idempotent
[S1+ S2
+]G // Kleene-cross generalization
++
![Page 107: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/107.jpg)
the Janus flow
consult sequence cache
when attempting to
commit a transaction
find candidate sequences via
profiling*ST runs*single
locations
test sequences for
commutativity
cache (generalized version) of
commutative sequences
offline
online
specialized spec
miss perform write-set detection
![Page 108: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/108.jpg)
specialized commutativity specstate operation operation
![Page 109: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/109.jpg)
specialized commutativity specstate operation operation
any AddEdge(x,z)/ff AddEdge(x,y)/tt
![Page 110: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/110.jpg)
specialized commutativity specstate operation operation
any AddEdge(x,z)/ff AddEdge(x,y)/tt
any HasPath(z,w)/tt AddEdge(x,y)/ff
![Page 111: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/111.jpg)
specialized commutativity specstate operation operation
any AddEdge(x,z)/ff AddEdge(x,y)/tt
any HasPath(z,w)/tt AddEdge(x,y)/ff
…
![Page 112: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/112.jpg)
specialized commutativity specstate operation operation
any AddEdge(x,z)/ff AddEdge(x,y)/tt
any HasPath(z,w)/tt AddEdge(x,y)/ff
…
any[ RemoveEdge(x,z)/tt;
HasPath(x,z)/ff; AddEdge(x,z)/tt ]+
[ RemoveEdge(x,y)/tt; HasPath(x,y)/ff;
AddEdge(x,y)/tt ]+
![Page 113: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/113.jpg)
specialized commutativity specstate operation operation
any AddEdge(x,z)/ff AddEdge(x,y)/tt
any HasPath(z,w)/tt AddEdge(x,y)/ff
…
any[ RemoveEdge(x,z)/tt;
HasPath(x,z)/ff; AddEdge(x,z)/tt ]+
[ RemoveEdge(x,y)/tt; HasPath(x,y)/ff;
AddEdge(x,y)/tt ]+
tailored for given application
![Page 114: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/114.jpg)
the Janus flow
consult sequence cache
when attempting to
commit a transaction
find candidate sequences via
profiling*ST runs*single
locations
test sequences for
commutativity
cache (generalized version) of
commutative sequences
offline
online
miss perform write-set detection
![Page 115: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/115.jpg)
parallelization protocol
shared state [k]
shared state [k+1]
shared state [k+2]
privatized state [k]
privatized state [k’]
a1
a2
.
.
.
.
.an
b1
b2
.
.
.
.
.bm
(a1 … an) (b∙ 1 … bm) Sk ≡ (b1 … bm) (a∙ 1 … an) Sk
![Page 116: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/116.jpg)
parallelization protocol
shared state [k]
shared state [k+1]
shared state [k+2]
privatized state [k]
privatized state [k’]
a1
a2
.
.
.
.
.an
b1
b2
.
.
.
.
.bm
(a1 … an) (b∙ 1 … bm) Sk ≡ (b1 … bm) (a∙ 1 … an) Sk
![Page 117: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/117.jpg)
parallelization protocol
shared state [k]
shared state [k+1]
shared state [k+2]
privatized state [k]
privatized state [k’]
shared state [k+3]
replay on shared
state
bi
![Page 118: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/118.jpg)
parallelization protocol
shared state [k]
shared state [k+1]
shared state [k+2]
privatized state [k]
privatized state [k’]
a1
a2
.
.
.
.
.an
b1
b2
.
.
.
.
.bm
(a1 … an) (b∙ 1 … bm) Sk ≡ (b1 … bm) (a∙ 1 … an) Sk
![Page 119: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/119.jpg)
parallelization protocol
shared state [k]
shared state [k+1]
shared state [k+2]
privatized state [k+2]
retr
y
![Page 120: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/120.jpg)
parallel reverse-delete MST
![Page 121: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/121.jpg)
parallel reverse-delete MST
![Page 122: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/122.jpg)
parallel reverse-delete MST
![Page 123: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/123.jpg)
parallel reverse-delete MST
![Page 124: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/124.jpg)
parallel reverse-delete MST
RemoveEdge(u,v1
)HasPath(u,v1)AddEdge(u,v1)
![Page 125: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/125.jpg)
parallel reverse-delete MST
RemoveEdge(u,v1
)HasPath(u,v1)AddEdge(u,v1)
![Page 126: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/126.jpg)
parallel reverse-delete MST
RemoveEdge(u,v1
)HasPath(u,v1)AddEdge(u,v1)RemoveEdge(u,v2
)HasPath(u,v2)AddEdge(u,v2)
![Page 127: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/127.jpg)
parallel reverse-delete MST
RemoveEdge(u,v1
)HasPath(u,v1)AddEdge(u,v1)RemoveEdge(u,v2
)HasPath(u,v2)AddEdge(u,v2)
![Page 128: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/128.jpg)
parallel reverse-delete MST
RemoveEdge(u,v1
)HasPath(u,v1)AddEdge(u,v1)RemoveEdge(u,v2
)HasPath(u,v2)AddEdge(u,v2)
RemoveEdge(u,v3
)HasPath(u,v3)AddEdge(u,v3)
![Page 129: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/129.jpg)
parallel reverse-delete MST
RemoveEdge(u,v1
)HasPath(u,v1)AddEdge(u,v1)RemoveEdge(u,v2
)HasPath(u,v2)AddEdge(u,v2)
RemoveEdge(u,v3
)HasPath(u,v3)AddEdge(u,v3)
?
![Page 130: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/130.jpg)
parallel reverse-delete MST
RemoveEdge(u,v1
)HasPath(u,v1)AddEdge(u,v1)RemoveEdge(u,v2
)HasPath(u,v2)AddEdge(u,v2)
RemoveEdge(u,v3
)HasPath(u,v3)AddEdge(u,v3) x.f =
y;||z = x.f;
![Page 131: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/131.jpg)
parallel reverse-delete MST
RemoveEdge(u,v1
)HasPath(u,v1)AddEdge(u,v1)RemoveEdge(u,v2
)HasPath(u,v2)AddEdge(u,v2)
RemoveEdge(u,v3
)HasPath(u,v3)AddEdge(u,v3)
dope!
![Page 132: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/132.jpg)
parallel reverse-delete MST
RemoveEdge(u,v1
)HasPath(u,v1)AddEdge(u,v1)RemoveEdge(u,v2
)HasPath(u,v2)AddEdge(u,v2)
RemoveEdge(u,v3
)HasPath(u,v3)AddEdge(u,v3)
state operation operation
…
any[ RemoveEdge(x,z)/tt;
HasPath(x,z)/ff; AddEdge(x,z)/tt ]+
[ RemoveEdge(x,y)/tt; HasPath(x,y)/ff;
AddEdge(x,y)/tt ]+
b
![Page 133: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/133.jpg)
parallel reverse-delete MST
RemoveEdge(u,v1
)HasPath(u,v1)AddEdge(u,v1)RemoveEdge(u,v2
)HasPath(u,v2)AddEdge(u,v2)
RemoveEdge(u,v3
)HasPath(u,v3)AddEdge(u,v3)that’
s better..
![Page 134: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/134.jpg)
![Page 135: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/135.jpg)
benchmarksdescription name
utility for synchronizing pairs of directories JFileSync
greedy graph-coloring algorithm JGraphT-1 (coloring)
saturation-degree node-ordering algorithm for heuristic graph coloring
JGraphT-2 (ordering)
Java source code analyzer PMD
machine-learning library for data-mining tasks Weka
![Page 136: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/136.jpg)
Seq 1 2 3 4 5 6 7 80
0.5
1
1.5
2
2.5
Fine-grained conflict detection
Coarse-grained conflict detection
Sequential
Seq 1 2 3 4 5 6 7 80
0.5
1
1.5
2
2.5
Seq 1 2 3 4 5 6 7 80
0.5
1
1.5
2
2.5
Seq 1 2 3 4 5 6 7 80
0.5
1
1.5
2
2.5
Seq 1 2 3 4 5 6 7 80
0.5
1
1.5
2
2.5
Weka
PMD
JGraphT-2
JFileSync
JGraphT-1 speedup
![Page 137: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/137.jpg)
Fine-grained conflict detection
Coarse-grained conflict detection
1 2 3 4 5 6 7 80
0.51
1.52
2.53
3.54
4.5
Weka
1 2 3 4 5 6 7 80
0.51
1.52
2.53
3.54
4.5
JFileSync
1 2 3 4 5 6 7 80
0.51
1.52
2.53
3.54
4.5
PMD
1 2 3 4 5 6 7 80
0.51
1.52
2.53
3.54
4.5
JGraphT-2
1 2 3 4 5 6 7 80
0.51
1.52
2.53
3.54
4.5
JGraphT-1 retries
![Page 138: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/138.jpg)
0%
10%
20%
30%
40%
50%
60%
70%
80%
90%
WekaPMDJGraphT-2 JFileSyncJGraphT-1
misses
W/ seq. abstraction W/O seq. abstraction
![Page 139: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/139.jpg)
conclusions
profiling is useful for speculation• prevalent behaviors (dependencies) => effective
specialization• speculation = safety net
Janus enables practical accuracy boosting
• lifts commutativity checking to sequences of operations• runtime overhead comparable to write-set approach
![Page 140: Janus : exploiting parallelism via hindsight](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815f85550346895dce8b46/html5/thumbnails/140.jpg)