<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div></div><div>Ken</div><div><br></div><div>I completely agree with you.</div><div>I guess checking on hp->h_addr_list[1] was used for optimization. In certain cases this could avoid the need to do a reverse lookup and then go from this new host-name. For instance in version 2.1.11 this mechanism was correctly implemented (the ip count was made outside the if clause). However:</div><div><br></div><div>- this shortcut only works when the initial name is canonical</div><div>- if the host has only one interface (one ip) a reverse lookup will be still done, even when the initial name was in fact canonical</div><div>- if the host is multi-homed, but does not have a canonical name (the first name of each interface is not identical) this procedure will only get the ip addresses of the strain which contains the initial name. And this is independent of weather we do a reverse lookup or not.</div><div><br></div><div>So yes. I agree that it should be no problem to skip the predicate for hp->h_addr_list[1]. I just would like to emphasize that either way if there is no canonical host-name torque will not get the full set of ip's. This should not be a problem. After all one can chose what network torque should communicate on by selecting corresponding host-names in the server_priv/nodes file. Of course I am not aware of the possible reasons torque might want to know any extra ip's.</div><div><br></div><div>Best regards,</div><div>Michael.</div><div><br></div><div>P.S. I am sorry for not submitting a correct e-mail replay, but for some reason the torqueusers mailing list does not send me any messages.</div><div><br></div><br><blockquote type="cite"><div>Michael,</div><div><br></div><div>I looked at the function process_host_name_part in node_func.c and I do not understand why it even cares whether hp->h_addr_list[1] is NULL or not. It appears the function is interested in finding an array of addresses for objname along with an aliases without a :ts in the name and its type.</div><div><br></div><div> if (hp->h_addr_list[1] == NULL)</div><div> {</div><div> /* weren't given canonical name */</div><div><br></div><div>The comment seems to indicate if hp->h_addr_list[1] is NULL then we don't have a canonical name. Can anyone explain why hp->h_addr_list[1] has to be non-null to be canonical?</div><div><br></div><div>Unless there is a compelling reason not to I think we should just skip the predicate for hp->h_addr_list[1] and simply process the address and name information received from gethostbyname().</div><div><br></div><div>Ken Nielson</div><div>Cluster Resources, Inc.</div></blockquote><blockquote type="cite"><blockquote type="cite"><div><br></div><div>----- Original Message -----</div><div>From: "Michael Marti" <michael.marti at ist.utl.pt></div><div>To: torqueusers at supercluster.org</div><div>Sent: Monday, March 30, 2009 7:05:06 PM GMT -07:00 US/Canada Mountain</div><div>Subject: [torqueusers] Problem with canonical hostnames in mom_priv/nodes file</div><div><br></div><div>Dear All</div><div><br></div><div>We are using torque-2.3.6 on aix (AIX r1blade066 3 5 00003222D100)</div><div><br></div><div>On the head-node in /etc/hosts compute nodes have the following entry:</div><div><br></div><div>172.30.30.1 r1blade001 r1blade001m r1blade001q # Rack 1, </div><div>BladeCenter1, blade 1</div><div>172.20.30.1 r1blade001 r1blade001i # Rack 1, BladeCenter1, blade 1</div><div><br></div><div>If we specify the nodes with the m suffix (as in r1blade001m) in the </div><div>file server_priv/nodes everything works. However if we specify the </div><div>host without suffix (as in r1blade001) pbs_server exits with the </div><div>following error:</div><div><br></div><div>PBS_Server: process_host_name_part, no valid IP addresses found for </div><div>'r1blade001' - check name service</div><div>PBS_Server: pbsd_init(setup_nodes), could not create node </div><div>"r1blade001", error = 15010</div><div>PBS_Server: PBS_Server, pbsd_init failed</div><div><br></div><div>In the file src/server/node_func.c in the function </div><div>process_host_name_part() the host ipaddrs are not counted in case we </div><div>had more than one address on line 970. Essentially there should be one </div><div>more section counting the ip addresses after line 1126.</div><div>This is in agreement with the above symptom: if given r1blade001m </div><div>there will be only one IP on line 970. If given r1blade001 there will </div><div>be two IPs on line 970.</div><div><br></div><div>A quick and dirty fix could be to set the second IP to NULL just </div><div>before line 970 thus forcing the server always to assume a non </div><div>canonical name, for which the code is ok.</div><div>My line 969 of file src/server/node_func.c reads:</div><div>h_addr_list[1] = NULL;</div><div><br></div><div>This works for us.</div><div><br></div><div>A better solution of course would be to take the ip counting bit out </div><div>of the if clause on line 970.</div><div><br></div><div>Best regards,</div><div>Michael Marti</div></blockquote></blockquote><div><br></div><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><span><font class="Apple-style-span" face="Verdana"><span class="Apple-style-span" style="font-family: Verdana; ">--<span class="Apple-converted-space"> </span></span><br style="font-family: Verdana; "><span class="Apple-style-span" style="font-family: Verdana; ">----------------------------------------------------------------------------</span><br style="font-family: Verdana; "><span class="Apple-style-span" style="font-family: Helvetica; "><div><span class="Apple-style-span" style="font-family: Verdana; ">Michael Marti</span></div><div><span class="Apple-style-span" style="font-family: Verdana; ">Instituto Superior Técnico<br style="font-family: Verdana; "><div>Instituto de Plasmas e Fusão Nuclear</div><div><div>Complexo Interdisciplinar</div></div><div>Av. Rovisco Pais</div>1049-001 Lisboa<br style="font-family: Verdana; ">Portugal</span></div><div><font class="Apple-style-span" face="Verdana"><br class="webkit-block-placeholder"></font></div></span><br style="font-family: Verdana; "><span class="Apple-style-span" style="font-family: Verdana; ">Tel: +351 218 419 379</span></font></span></div><div><font class="Apple-style-span" face="Verdana"><span class="Apple-style-span" style="font-family: Verdana; ">Fax: +351 218 464 455</span></font></div><div><font class="Apple-style-span" face="Verdana"><span class="Apple-style-span" style="font-family: Verdana; ">Mobile:</span></font><font class="Apple-style-span" face="Verdana"><span class="Apple-style-span" style="font-family: Verdana; "> +351 968 434 327</span></font></div><div><span style="font-size: 12px; "><font class="Apple-style-span" face="Verdana"><span class="Apple-style-span" style="font-family: Verdana; ">----------------------------------------------------------------------------</span><br style="font-family: Verdana; "></font></span></div><br class="Apple-interchange-newline"></span></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"> </div><br></body></html>