<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2658.34">
<TITLE>RE: [MPICH] how to start up mpd conveniently</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Martin:</FONT>
</P>
<P><FONT SIZE=2>Excellent! That works faster than using lsof -- good one!</FONT>
</P>
<P><FONT SIZE=2>Simon </FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Martin Kleinschmidt [<A HREF="mailto:mk@theochem.uni-duesseldorf.de">mailto:mk@theochem.uni-duesseldorf.de</A>] </FONT>
<BR><FONT SIZE=2>Sent: September 27, 2006 4:35 AM</FONT>
<BR><FONT SIZE=2>To: mpich-discuss@mcs.anl.gov</FONT>
<BR><FONT SIZE=2>Cc: Galton, Simon</FONT>
<BR><FONT SIZE=2>Subject: Re: [MPICH] how to start up mpd conveniently</FONT>
</P>
<P><FONT SIZE=2>Hi Simon,</FONT>
</P>
<P><FONT SIZE=2>On Di, 26 Sep 2006, Galton, Simon wrote:</FONT>
</P>
<P><FONT SIZE=2>>I worked out a process to allow nodes to join an existing ring in our </FONT>
<BR><FONT SIZE=2>>Linux cluster with dual-cpu cluster nodes:</FONT>
</P>
<P><FONT SIZE=2>thanks, helps a lot!</FONT>
</P>
<BR>
<P><FONT SIZE=2>>#!/bin/sh</FONT>
<BR><FONT SIZE=2>>headnode=node1</FONT>
<BR><FONT SIZE=2>>echo -n $"Joining mpd ring hosted by $headnode: "</FONT>
<BR><FONT SIZE=2>>port=`ssh $headnode lsof | grep python2 | grep TCP | grep \* | cut -d: </FONT>
<BR><FONT SIZE=2>>-f2 | cut -d' ' -f1`</FONT>
</P>
<P><FONT SIZE=2>this pipe brought up more than 1 line:</FONT>
</P>
<P><FONT SIZE=2>[root@node2 root]# rsh node1 /usr/sbin/lsof | grep python2 | grep TCP | grep \*</FONT>
<BR><FONT SIZE=2>python2.3 857 mk 4u IPv4 12933799 TCP *:60191 (LISTEN)</FONT>
<BR><FONT SIZE=2>python2.3 857 mk 6u IPv4 12933815 TCP *:60194 (LISTEN)</FONT>
<BR><FONT SIZE=2>python2.3 857 mk 13u IPv4 12933823 TCP *:60199 (LISTEN)</FONT>
<BR><FONT SIZE=2>python2.3 1176 mk 4u IPv4 12936272 TCP *:60314 (LISTEN)</FONT>
<BR><FONT SIZE=2>python2.3 1176 mk 6u IPv4 12936288 TCP *:60317 (LISTEN)</FONT>
<BR><FONT SIZE=2>python2.3 1176 mk 13u IPv4 12936296 TCP *:60322 (LISTEN)</FONT>
<BR><FONT SIZE=2>python2.3 1183 mk 4u IPv4 12936419 TCP *:60328 (LISTEN)</FONT>
<BR><FONT SIZE=2>python2.3 1183 mk 6u IPv4 12936435 TCP *:60331 (LISTEN)</FONT>
<BR><FONT SIZE=2>python2.3 1183 mk 13u IPv4 12936443 TCP *:60336 (LISTEN)</FONT>
<BR><FONT SIZE=2>python2.3 1188 mk 3u IPv4 12936469 TCP *:60341 (LISTEN)</FONT>
<BR><FONT SIZE=2>python2.3 1191 mk 4u IPv4 12936548 TCP *:60342 (LISTEN)</FONT>
<BR><FONT SIZE=2>python2.3 1191 mk 6u IPv4 12936564 TCP *:60345 (LISTEN)</FONT>
<BR><FONT SIZE=2>python2.3 1191 mk 13u IPv4 12936572 TCP *:60350 (LISTEN)</FONT>
<BR><FONT SIZE=2>python2.3 32230 root 4u IPv4 12925107 TCP *:60149 (LISTEN)</FONT>
</P>
<P><FONT SIZE=2>of which I only need the last. Of course one could add "grep root" to the pipe, but I found that one could also use mpdtrace -l :</FONT></P>
<P><FONT SIZE=2>port=`rsh $headnode mpdtrace -l | grep "$headnode"_ | awk '{print $1}' | sed 's/'$headnode'_//'`</FONT>
</P>
<BR>
<P><FONT SIZE=2> ...martin</FONT>
</P>
<br><br><table bgcolor=white style="color:black"><tr><td><br>CONFIDENTIAL AND PRIVILEGED INFORMATION NOTICE<br>
<br>
This e-mail, and any attachments, may contain information that<br>
is confidential, subject to copyright, or exempt from disclosure.<br>
Any unauthorized review, disclosure, retransmission, <br>
dissemination or other use of or reliance on this information <br>
may be unlawful and is strictly prohibited. <br>
<br>
AVIS D'INFORMATION CONFIDENTIELLE ET PRIVILÉGIÉE<br>
<br>
Le présent courriel, et toute pièce jointe, peut contenir de <br>
l'information qui est confidentielle, régie par les droits <br>
d'auteur, ou interdite de divulgation. Tout examen, <br>
divulgation, retransmission, diffusion ou autres utilisations <br>
non autorisées de l'information ou dépendance non autorisée <br>
envers celle-ci peut être illégale et est strictement interdite.</td></tr></table></BODY>
</HTML>