-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
fix #4332: setting ZSTD_NBTHREADS=0 via environment variable #4334
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,3 @@ zstd -T0 -f file -q ; zstd -t file.zst | |
zstd -T0 --auto-threads=logical -f file -q ; zstd -t file.zst | ||
zstd -T0 --auto-threads=physical -f file -q ; zstd -t file.zst | ||
zstd -T0 --jobsize=1M -f file -q ; zstd -t file.zst | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add a test here that tests the environment variable works? If we print the number of threads under some verbosity we could do something like:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, definitely, |
||
|
||
# multi-thread decompression warning test | ||
zstd -T0 -f file -q ; zstd -t file.zst; zstd -T0 -d file.zst -o file3 | ||
zstd -T0 -f file -q ; zstd -t file.zst; zstd -T2 -d file.zst -o file4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added due to Issue #2918. This may be a useful warning to keep.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue is, with current code,
there is nothing to tell that
nbWorkers
wasn't set.Whether it's set via the environment variable, or via the core count detection, it's necessarily set to "some value".
There is no difference with a user setting this value manually via command line.
Therefore, on any modern system with >= 8 logical cores,
nbWorkers >= 2
, and consequently always triggers this warning.This could be solved by adding yet another variable, which would track if
nbWorkers
was set explicitly, or if it happens to be set to a value>1
just as a consequence of automatic core count detection. We would also have to decide if settingnbWorkers
via environment variable count or not to trigger this warning.So it's a bit more work, a bit more questions, and specific to the topic of displaying a warning during decompression mode. It felt it could deserve its own PR for proper focus.