-
Notifications
You must be signed in to change notification settings - Fork 135
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
Feature flag to set num-threads to host threads #641
base: master
Are you sure you want to change the base?
Feature flag to set num-threads to host threads #641
Conversation
Currently, num-threads is hardcoded to 12. This PR sets the value to the number of cores return by sysctl, or "host threads". This may improve vertical scaling in some situations for larger core machines.
ec5fdc6
to
6948f6e
Compare
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 is nice, presuming there's no side-effects on reproducibility.
@@ -318,6 +319,14 @@ bool SwiftRunner::ProcessArgument( | |||
++itr; | |||
new_arg = output_file_map_path_; | |||
changed = true; | |||
} else if (use_host_num_threads_ && arg == "-num-threads") { |
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 should probably be an error or something instead? like you shouldn't pass this and enable this feature at the same time I don't think?
@@ -102,7 +103,7 @@ static bool StripPrefix(const std::string &prefix, std::string &str) { | |||
|
|||
SwiftRunner::SwiftRunner(const std::vector<std::string> &args, | |||
bool force_response_file) | |||
: force_response_file_(force_response_file) { | |||
: force_response_file_(force_response_file), use_host_num_threads_(false) { |
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.
since the other feature bools aren't here you shouldn't need this one here either i don't think?
Currently, num-threads is hardcoded to 12. This PR sets the value to the
number of cores return by sysctl, or "host threads". This may improve
vertical scaling in some situations for larger core machines.