[distcc] Suggestion about host selection
Christophe LYON
christophe.lyon at st.com
Thu Jun 19 11:56:15 GMT 2008
On 18.06.2008 17:32, Fergus Henderson wrote:
> On Wed, Jun 18, 2008 at 7:22 AM, <thomas at schuerger.com
> <mailto:thomas at schuerger.com>> wrote:
>
> Hi,
>
> when given a list of hosts in DISTCC_HOSTS, e.g.
>
> DISTCC_HOSTS="host1/6 host2/2 host3/3"
>
> The documentation states that the hosts are given priority as specified,
> so host1 is the preferred host. I looked at the distcc code and was
> surprised to find that this "list of preference" is interpreted somewhat
> differently than I expected.
>
>
> I think you have misread the code.
>
> (Which distcc version are you using? Though this code hasn't changed
> between distcc 2.18.3 and distcc 3.0.)
>
> The code does the following (this is in dcc_lock_one() in src/where.c):
>
> while (1) {
> for (i_cpu = 0; i_cpu < 50; i_cpu++) {
> for (h = hostlist; h; h = h->next) {
>
> The middle loop is over slot number. The inner loop is over hosts.
> It tries slot 0, host 0, and then slot 0, host 1, and then slot 0, host
> 2, etc.
> before trying slot 1, host 1, and then slot 1, host 1, and then slot 1,
> host 2, etc.
>
Well,
I don't think Thomas has misread the code: I understand he says the same
thing as you.
But distcc's man page says: "distcc prefers hosts towards the start of
the list, so machines should be listed in descending order of speed."
I understand this statement the same way as Thomas, that is:
host0_slot0, host0_slot1, host0_slot2, host1_slot0, host1_slot1, ....
which is not what the actual code does.
Christophe
More information about the distcc
mailing list