RFR: 8370315: [IR-Framework] Allow scenarios to be run in parallel [v3]
Damon Fenacci
dfenacci at openjdk.org
Wed Nov 5 15:54:49 UTC 2025
> ## Issue
> Today, the only practical ways to run IR Framework scenarios in parallel seems to be:
> * spawning threads manually in a single test, or
> * letting jtreg treat each scenario as a separate test (the only way to potentially distribute across hosts).
>
> This makes it a bit cumbersome to use host CPU cores efficiently when running multiple scenarios within the same test.
>
> ## Change
> This change introduces a method `TestFramework::startParallel` to execute multiple scenarios concurrently. The implementation:
> * launches one task per scenario and runs them in parallel (by default, the maximum concurrency should match the host’s available cores)
> * captures each task’s `System.out` into a dedicated buffer and flushes it when the task completes to avoid interleaved output between scenarios (Note: only call paths within the `compile.lib.ir_framework` package are modified to per-task output streams. `ProcessTools` methods still write directly to `stdout`, so their output may interleave).
> * adds an option `-DForceSequentialScenarios=true` to force all scenarios to be run sequentially.
>
> ## Testing
> * Tier 1-3+
> * explicit `ir_framework.tests` runs
> * added IR-Framework test `TestDForceSequentialScenarios.java` to test forcing sequential testing (checkin the output order) and added a parallel run to `TestScenatios.java` (as well as adding `ForceSequentialScenarios` flag to `TestDFlags.java`)
>
> As reference: a comparison of the execution time between sequential and parallel of all IR-Framework tests using scenarios on our machines (linux x64/aarch64, macosx x64/aarch64, windows x64 with different number of cores, so the results for a single test might not be relevant) gave me an average speedup of 1.9.
Damon Fenacci has updated the pull request incrementally with three additional commits since the last revision:
- JDK-8370315: use check function
- Apply suggestion from @chhagedorn
Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
- JDK-8370315: add exceptions as they arise
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/28065/files
- new: https://git.openjdk.org/jdk/pull/28065/files/c9295971..4e9cc0a2
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=28065&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=28065&range=01-02
Stats: 16 lines in 2 files changed: 1 ins; 8 del; 7 mod
Patch: https://git.openjdk.org/jdk/pull/28065.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28065/head:pull/28065
PR: https://git.openjdk.org/jdk/pull/28065
More information about the hotspot-compiler-dev
mailing list