Skip to content

Commit f078658

Browse files
author
Dominik Helm
committed
Remove spurious inheritance
1 parent 63f1e46 commit f078658

File tree

6 files changed

+57
-59
lines changed

6 files changed

+57
-59
lines changed

OPAL/si/src/main/scala/org/opalj/fpcf/AnalysisScenario.scala

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -329,59 +329,6 @@ class AnalysisScenario[A](val ps: PropertyStore) {
329329
initializationData
330330
)
331331
}
332-
333-
/**
334-
* Computes the configuration for a specific batch; this method can only handle the situation
335-
* where all analyses can be executed in the same phase.
336-
*/
337-
protected def computePhase(
338-
propertyStore: PropertyStore,
339-
phaseAnalysis: Set[ComputationSpecification[A]],
340-
nextPhaseAnalysis: Set[ComputationSpecification[A]]
341-
): PhaseConfiguration[A] = {
342-
343-
// 1. compute the phase configuration; i.e., find those properties for which we must
344-
// suppress interim updates.
345-
var suppressInterimUpdates: Map[PropertyKind, Set[PropertyKind]] = Map.empty
346-
// Interim updates have to be suppressed when an analysis uses a property for which
347-
// the wrong bounds/not enough bounds are computed.
348-
transformersCS foreach { cs => suppressInterimUpdates += (cs.derivesLazily.get.pk -> cs.uses(ps).map(_.pk)) }
349-
350-
def extractPropertyKinds(analyses: Set[ComputationSpecification[A]]): Set[PropertyKind] = {
351-
analyses.flatMap { analysis =>
352-
(analysis.derivesLazily.toSet ++
353-
analysis.derivesEagerly ++
354-
analysis.derivesCollaboratively ++
355-
analysis.derives.toSet)
356-
.map(_.pk)
357-
}
358-
}
359-
360-
val propertyKindsFromPhaseAnalysis = extractPropertyKinds(phaseAnalysis)
361-
val propertyKindsFromNextPhaseAnalysis = extractPropertyKinds(nextPhaseAnalysis)
362-
363-
val collabProperties = phaseAnalysis.flatMap { analysis => analysis.derivesCollaboratively.map(_.pk) }
364-
365-
// 3. create the batch
366-
val batchBuilder = List.newBuilder[ComputationSpecification[A]]
367-
batchBuilder ++= phaseAnalysis
368-
369-
// FIXME...
370-
371-
// Interim updates can be suppressed when the depender and dependee are not in a cyclic
372-
// relation; however, this could have a negative impact on the effect of deep laziness -
373-
// once we are actually implementing it. For the time being, suppress notifications is always
374-
// advantageous.
375-
376-
val phase1Configuration = PropertyKindsConfiguration(
377-
propertyKindsComputedInThisPhase = propertyKindsFromPhaseAnalysis,
378-
suppressInterimUpdates = suppressInterimUpdates,
379-
propertyKindsComputedInLaterPhase = propertyKindsFromNextPhaseAnalysis,
380-
collaborativelyComputedPropertyKindsFinalizationOrder = List(collabProperties.toList) // FIXME: Compute actual subphase finalization order
381-
)
382-
383-
PhaseConfiguration(phase1Configuration, batchBuilder.result())
384-
}
385332
}
386333

387334
/**

OPAL/si/src/main/scala/org/opalj/fpcf/scheduling/IndependentPhaseMergeScheduling.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import org.opalj.graphs.topologicalSort
1212
* Merges independent batches to optimize parallelism.
1313
*/
1414
class IndependentPhaseMergeScheduling[A](ps: PropertyStore, scheduleLazyTransformerInAllBatches: Boolean)
15-
extends AnalysisScenario[A](ps) with SchedulingStrategy[A] {
15+
extends SchedulingStrategy[A] {
1616

1717
val name = "IPMS"
1818

OPAL/si/src/main/scala/org/opalj/fpcf/scheduling/MaximumPhaseScheduling.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import org.opalj.graphs.topologicalSort
1313
*/
1414

1515
class MaximumPhaseScheduling[A](ps: PropertyStore, scheduleLazyTransformerInAllBatches: Boolean)
16-
extends AnalysisScenario[A](ps) with SchedulingStrategy[A] {
16+
extends SchedulingStrategy[A] {
1717

1818
val name = "MPS"
1919

OPAL/si/src/main/scala/org/opalj/fpcf/scheduling/SchedulingStrategy.scala

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,58 @@ trait SchedulingStrategy[A] {
1818
): List[PhaseConfiguration[A]]
1919

2020
/**
21-
* Common helper method for computing a phase/batch.
22-
* Can be overridden by subclasses if needed.
21+
* Computes the configuration for a specific batch; this method can only handle the situation
22+
* where all analyses can be executed in the same phase.
2323
*/
24+
protected def computePhase(
25+
ps: PropertyStore,
26+
currentPhaseAnalyses: Set[ComputationSpecification[A]],
27+
nextPhaseAnalyses: Set[ComputationSpecification[A]]
28+
): PhaseConfiguration[A] = {
29+
30+
// 1. compute the phase configuration; i.e., find those properties for which we must
31+
// suppress interim updates.
32+
var suppressInterimUpdates: Map[PropertyKind, Set[PropertyKind]] = Map.empty
33+
// Interim updates have to be suppressed when an analysis uses a property for which
34+
// the wrong bounds/not enough bounds are computed.
35+
currentPhaseAnalyses foreach {
36+
case cs if cs.computationType == Transformer =>
37+
suppressInterimUpdates += (cs.derivesLazily.get.pk -> cs.uses(ps).map(_.pk))
38+
}
39+
40+
def extractPropertyKinds(analyses: Set[ComputationSpecification[A]]): Set[PropertyKind] = {
41+
analyses.flatMap { analysis =>
42+
(analysis.derivesLazily.toSet ++
43+
analysis.derivesEagerly ++
44+
analysis.derivesCollaboratively ++
45+
analysis.derives.toSet)
46+
.map(_.pk)
47+
}
48+
}
49+
50+
val propertyKindsFromPhaseAnalysis = extractPropertyKinds(currentPhaseAnalyses)
51+
val propertyKindsFromNextPhaseAnalysis = extractPropertyKinds(nextPhaseAnalyses)
52+
53+
val collabProperties = currentPhaseAnalyses.flatMap { analysis => analysis.derivesCollaboratively.map(_.pk) }
54+
55+
// 3. create the batch
56+
val batchBuilder = List.newBuilder[ComputationSpecification[A]]
57+
batchBuilder ++= currentPhaseAnalyses
58+
59+
// FIXME...
60+
61+
// Interim updates can be suppressed when the depender and dependee are not in a cyclic
62+
// relation; however, this could have a negative impact on the effect of deep laziness -
63+
// once we are actually implementing it. For the time being, suppress notifications is always
64+
// advantageous.
65+
66+
val phase1Configuration = PropertyKindsConfiguration(
67+
propertyKindsComputedInThisPhase = propertyKindsFromPhaseAnalysis,
68+
suppressInterimUpdates = suppressInterimUpdates,
69+
propertyKindsComputedInLaterPhase = propertyKindsFromNextPhaseAnalysis,
70+
collaborativelyComputedPropertyKindsFinalizationOrder = List(collabProperties.toList) // FIXME: Compute actual subphase finalization order
71+
)
72+
73+
PhaseConfiguration(phase1Configuration, batchBuilder.result())
74+
}
2475
}

OPAL/si/src/main/scala/org/opalj/fpcf/scheduling/SinglePhaseScheduling.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package scheduling
77
* Single Phase Scheduling (SPS) Strategy.
88
* Schedules all computations in a single batch without considering dependencies.
99
*/
10-
class SinglePhaseScheduling[A](ps: PropertyStore) extends AnalysisScenario[A](ps) with SchedulingStrategy[A] {
10+
class SinglePhaseScheduling[A](ps: PropertyStore) extends SchedulingStrategy[A] {
1111

1212
override def schedule(
1313
ps: PropertyStore,

OPAL/si/src/main/scala/org/opalj/fpcf/scheduling/SmallestPhaseMergeScheduling.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import org.opalj.graphs.topologicalSort
1212
* Merging batches based on the number of analyses to keep merged batches of similar sizes.
1313
*/
1414
class SmallestPhaseMergeScheduling[A](ps: PropertyStore, scheduleLazyTransformerInAllBatches: Boolean)
15-
extends AnalysisScenario[A](ps) with SchedulingStrategy[A] {
15+
extends SchedulingStrategy[A] {
1616

1717
val name = "SPMS"
1818

0 commit comments

Comments
 (0)