This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Manually track num_max_thread #12380
Merged
cjolivier01
merged 8 commits into
apache:master
from
azai91:fix/use-cached-thread-count
Nov 15, 2018
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e9ed61c
use cached version of get thread max
azai91 2c0b0e9
reserve core affects omp singleton
azai91 f9d8746
omp_thread_max_ updated in one line
azai91 9be6f2e
remove enabled block
azai91 e217013
add brackets
azai91 fbeb081
re-add excluded reserved
azai91 2145a7e
add missing var
azai91 467d812
refactor macro
azai91 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
You mention you want to call
omp_get_max_threads()
once and cache the results. This is another place where the API is called (in addition to line 55). Is that intentional? will it not create the same issue?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.
these are the lines I changed. I removed the call and replaced it with the cached result.
the only call is in the constructor (line 55).
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.
Sorry - I was referring to line 90.
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.
@azai91 Can you address @lupesko comments? I also found this change suspicious. It seems once omp_thread_max_ is set to 1 in line 77, all the subsequent call to this function will return 1 if the env variable is set. Which means, this stops multithreading altogether in the operator. Could you provide a test case to verify this change actually works? Thanks