Skip to content

Commit

Permalink
Merge pull request #1174 from Twisol/feature/castello--engine-efficiency
Browse files Browse the repository at this point in the history
Improve engine peformance on ancestry traversal
  • Loading branch information
mattdailis authored Mar 28, 2024
2 parents 0b098c7 + e5ae0f5 commit 53643b3
Show file tree
Hide file tree
Showing 35 changed files with 401 additions and 272 deletions.
3 changes: 3 additions & 0 deletions constraints/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ java {

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
3 changes: 3 additions & 0 deletions contrib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ java {

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
3 changes: 3 additions & 0 deletions db-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jacocoTestReport {

task e2eTest(type: Test) {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

dependencies {
Expand Down
4 changes: 4 additions & 0 deletions e2e-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ task e2eTest(type: Test) {
// Run the tests in parallel to improve performance
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
useJUnitPlatform()

testLogging {
exceptionFormat = 'full'
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ void beforeEach() throws IOException, InterruptedException {
// Insert the Plan
fooPlan = hasura.createPlan(
fooId,
"Foo Plan - Simulation Tests",
"Foo Plan - Scheduling Tests",
"720:00:00",
planStartTimestamp);

Expand Down
3 changes: 3 additions & 0 deletions examples/banananation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ java {

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
3 changes: 3 additions & 0 deletions examples/config-with-defaults/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jar {

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
3 changes: 3 additions & 0 deletions examples/config-without-defaults/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jar {

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
3 changes: 3 additions & 0 deletions examples/foo-missionmodel/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jar {

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
3 changes: 3 additions & 0 deletions examples/minimal-mission-model/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jar {

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
3 changes: 3 additions & 0 deletions examples/streamline-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jar {

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
3 changes: 3 additions & 0 deletions merlin-driver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ test {
useJUnitPlatform {
includeEngines 'jqwik', 'junit-jupiter'
}
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ void simulateTask(final MissionModel<Model> missionModel, final TaskFactory<Retu
}

// Schedule all activities.
final var taskId = engine.scheduleTask(elapsedTime, task);
final var spanId = engine.scheduleTask(elapsedTime, task);

// Drive the engine until we're out of time.
// TERMINATION: Actually, we might never break if real time never progresses forward.
while (!engine.isTaskComplete(taskId)) {
while (!engine.getSpan(spanId).isComplete()) {
final var batch = engine.extractNextJobs(Duration.MAX_VALUE);

// Increment real time, if necessary.
Expand Down Expand Up @@ -233,9 +233,11 @@ private static <Model, Output> TaskFactory<Unit> makeTaskFactory(
{
// Emit the current activity (defined by directiveId)
return executor -> scheduler0 -> TaskStatus.calling((TaskFactory<Output>) (executor1 -> scheduler1 -> {
scheduler1.pushSpan();
scheduler1.emit(directiveId, activityTopic);
return task.create(executor1).step(scheduler1);
}), scheduler2 -> {
scheduler2.popSpan();
// When the current activity finishes, get the list of the activities that needed this activity to finish to know their start time
final List<Pair<ActivityDirectiveId, Duration>> dependents = resolved.get(directiveId) == null ? List.of() : resolved.get(directiveId);
// Iterate over the dependents
Expand Down

This file was deleted.

Loading

0 comments on commit 53643b3

Please sign in to comment.