-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preview support for virtual threads #3871
Conversation
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
2d3fdd4
to
3449e18
Compare
Signed-off-by: Paolo Di Tommaso <[email protected]>
3449e18
to
3724404
Compare
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
51e03f8
to
7bc8d06
Compare
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Doing some stress tests using this script that upload 300 files and download ~200 files. Using platform (classic) thread it took ~ 9 mins
Using virtual threads 7 min and 35 secs
Test scriptprocess foo {
publishDir "s3://nextflow-ci/outputs"
input:
val x
output:
path 'hello*'
"""
head -c 50737410 </dev/urandom > hello${x}.txt
"""
}
process bar {
input:
path x
"""
head $x
"""
}
workflow {
channel.of(1..300) | foo
channel.fromPath('s3://nextflow-ci/uploads/*') | bar
} |
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
ce41258
to
258dfdf
Compare
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Hi Paolo 👋 Just curious about this improvement - going through the code it seems that it'll impact the file copy and task monitoring mechanism. However, for some reason when you mentioned about virtual threads last year, I thought it was in the context of replacing GPars library as it wasn't being frequently updated (ref https://github.com/GPars/GPars). Did I misunderstand the overall intent then 🤔 ? |
Also GPars will benefit from virtual thread thanks this |
Ah, I see now - so basically you're swapping the underlying primitives for the abstractions (DataFlow) in GPars library using the virtual threads! |
Yeah! |
Signed-off-by: Paolo Di Tommaso <[email protected]>
modules/nextflow/src/main/groovy/nextflow/util/VirtualThreadPool.groovy
Outdated
Show resolved
Hide resolved
…ol.groovy [ci skip] Signed-off-by: Paolo Di Tommaso <[email protected]>
modules/nextflow/src/test/groovy/nextflow/util/ThreadPoolHelperTest.groovy
Outdated
Show resolved
Hide resolved
…rTest.groovy [ci skip]] Signed-off-by: Paolo Di Tommaso <[email protected]>
modules/nextflow/src/main/groovy/nextflow/util/VirtualThreadPool.groovy
Outdated
Show resolved
Hide resolved
…ol.groovy [ci skip] Signed-off-by: Paolo Di Tommaso <[email protected]>
This commit adds support for Java virtual threads. To enable this feature, the following variable should be declared in the launching environment: ``` export NXF_ENABLE_VIRTUAL_THREADS ``` Note, this feature it's required the use of Java 19 or later. Signed-off-by: Paolo Di Tommaso <[email protected]>
This PR implements a preliminary support for virtual threads