Skip to content
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 Issue #145. Allow -j (jobs) param to set number slots when used in zeroconf mode. #187

Merged
merged 1 commit into from Jul 12, 2016

Conversation

ericfont
Copy link
Contributor

@ericfont ericfont commented Jul 3, 2016

If server is started in zeroconf mode, the previous behavior was that the number of slots for any server was hardcoded to 4 * number of cpus. This made zeroconf impracticle when different hosts had different core counts.
This commit allows distccd to be invoked in zeroconf mode with the -j parameter to specify total slots for the particular server being invoked.
If no -j specified, then this host will publish its total number of slots to be 2 * number of cores + 2. (Note: this is the same behavior as when invoking a non-zerconf server without specifying -j.)
To maintain backward compatibily, if a distccd zeroconf server doesn't publish a value for slots, then it will be assigned a default total slots equal to the previous behavior of 4 * number of cores.
Note that the meaning of "slots" in the code now always refers to the number of slots per host. (The previous interepration of "slots" was inconsistent, because sometimes it meant the number of slots per core.)

@ericfont ericfont force-pushed the zeroconf-jobs-parameter branch 5 times, most recently from ea46a75 to 6e8300f Compare July 6, 2016 14:31
@ericfont
Copy link
Contributor Author

ericfont commented Jul 6, 2016

I forced updated this PR's commit so that I'm using the word "jobs" to refer to the maximum number of jobs per host, instead of using the word "slots".

If server is started in zeroconf mode, the previous behavior was that the number of jobs for any server was hardcoded to 4 * number of cpus.

This commit allows distccd to be invoked in zeroconf mode with the -j parameter to specify n_jobs, the maximum number of concurrent jobs for this server.

If no -j is specified, then this host will publish its n_jobs to be 2 * number of cores + 2.  (Note: this is the same behavior as when invoking a non-zerconf server without specifying -j.)
To maintain backward compatibily, if a distccd zeroconf server doesn't publish a value for n_jobs, then it will be assigned a default n_jobs equal to the previous behavior of 4 * number of cores.
@TafThorne
Copy link
Collaborator

Thank you.

As this looks to be a helpful extension of existing functionality I am happy to merge in the request. No one else has issued any objections in the last week either.

@TafThorne TafThorne merged commit c8eac97 into distcc:master Jul 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants