[Beowulf] dsh command

Ngan, Michael (NIH/NCI) nganm at mail.nih.gov
Tue Jun 22 15:18:35 EDT 2004


I am trying to get a list of processes from all nodes into a temp file so I
can grep it by userid. The following command:

Dsh -a -e 'ps -ef' > temp

Just print the outprint to the screen, instead send them to the temp file. I
wonder what is the correct way to write this command.

Thanks,

Mike

--
Michael Ngan, Contractor                   NCI/NIH
mailto:nganm at mail.nih.gov                8138-6130 Executive Blvd
(W) (301) 402-0324                                Rockville, MD 20852, USA
(H) (301) 208-1610                                 http://linus.nci.nih.gov

-----Original Message-----
From: Mike Davis [mailto:jmdavis at mail2.vcu.edu] 
Sent: Thursday, June 03, 2004 12:54 PM
To: Mark Hahn
Cc: beowulf at beowulf.org
Subject: Re: [Beowulf] KVM to a compute node

The fact is that you can absolutely dispense with KVM for compute nodes 
with the right setup. I have several clusters which only have video 
connected at the head and 2 with KVM to all nodes.

The serial only clusters use cyclades switches connected to each serial 
port. To reach an individual node you can use minicom from the head. 
This works during bootup as well. As long as the machine has power and 
the serial port is not locked you can get in.

Other remote reboot options include apc power switches which can be 
remotely cycled. I use these as well on most of my clusters.

Mike Davis





Mark Hahn wrote:

>>These USB->serial boxes work fine with linux (ours uses the ftdi_sio
kernel
>>    
>>
>
>sounds a bit fragile to me.  if I really wanted serial on a bunch of boxes,
>I'd be most tempted to simply have box N plugged into box N+1.  and use a 
>script to do the appropriate connection, of course.
>
>  
>
>>We use kermit to log on the local console to each machine, and have
aliases
>>for the combination of ssh (to the server) and kermit on the right tty. 
>>    
>>
>
>eeew, why do people still use grossness like kermit for such a simple task?
>here's a bit of serial-port plumbing I wrote over a decade ago (gulp!)
>that works on any unix machine.  feel free to hack it to your port
>names/speeds/etc, remove the silly logging, etc.
>
>/* written by Mark Hahn <hahn at mcmaster.ca> */
>#include <unistd.h>
>#include <sys/time.h>
>#include <fcntl.h>
>#include <stdio.h>
>#include <termios.h>
>#include <stdarg.h>
>
>double gtod() {
>    struct timeval tv;
>    gettimeofday(&tv,0);
>    return tv.tv_sec + 1e-6 * tv.tv_usec;
>}
>double startTime;
>double ts() { 
>    if (startTime == 0.0)
>	startTime = gtod();
>    return gtod() - startTime;
>}
>
>FILE *fpLog = 0;
>void log(char *format,...) {
>    va_list ap;
>    va_start(ap,format);
>
>    if (!fpLog)
>	fpLog = fopen("debug.log","a");
>    fprintf(fpLog,"%2.8f: ",ts());
>    vfprintf(fpLog,format,ap);
>    va_end(ap);
>    fflush(fpLog);
>}
>void fatal(char *format,...) {
>    static FILE *fpLog = 0;
>    va_list ap;
>    va_start(ap,format);
>
>    if (!fpLog)
>	fpLog = fopen("debug.log","a");
>    fprintf(fpLog,"%2.8f: ",ts());
>    vfprintf(fpLog,format,ap);
>    va_end(ap);
>    fclose(fpLog);
>    exit(0);
>}
>
>int 
>main() {
>    struct termios t, tOrg;
>    int fdSer = open("/dev/tty01", O_RDWR);
>
>    log("starting...\n");
>
>    if (fdSer == -1) {
>	perror("open of serial device failed");
>	return 1;
>    }
>    log("opened...\n");
>
>    t.c_iflag = IGNBRK | INPCK;
>    t.c_oflag = 0;
>    t.c_cflag = CS8 | CREAD | CLOCAL | CSTOPB;
>    t.c_lflag = 0;
>    cfsetispeed(&t,B19200);
>    cfsetospeed(&t,B19200);
>    tcsetattr(fdSer,TCSANOW,&t);
>
>    log("serial attr set...\n");
>
>    tcgetattr(0,&t);
>    tOrg = t;
>    t.c_iflag = 0;
>    t.c_lflag = 0;
>    t.c_cc[VTIME] = 1;
>    t.c_cc[VMIN] = 1;
>    tcsetattr(0,TCSANOW,&t);
>
>    log("console attr set...\n");
>    
>    while (1) {
>#define bufSize 4096
>	unsigned char buf[bufSize+1];
>	struct timeval timeout;
>	fd_set readset;
>
>	timeout.tv_sec = 10;
>	timeout.tv_usec = 0;
>
>	FD_ZERO(&readset);
>	FD_SET(0,&readset);
>	FD_SET(fdSer,&readset);
>
>	log("about to select...\n");
>
>	if (select(fdSer+1,&readset,0,0,&timeout) == -1)
>	    continue;
>
>	if (FD_ISSET(0,&readset)) {
>	    log("stdin readable...\n");
>
>	    int c = read(0,buf,bufSize);
>	    if (c > 0) {
>		buf[c] = 0;	
>	        log("got %d bytes from stdin: '%s'...\n",c,buf);
>
>		static unsigned char prev = 0;
>	        log("prev is %02x\n\n",prev);
>		if (prev == 0x1d && buf[0] == 'q')
>		    break;
>		prev = buf[0];
>	        log("writing to serial...\n");
>		write(fdSer,buf,c);
>	        log("serial write done...\n");
>	    }
>	}
>	if (FD_ISSET(fdSer,&readset)) {
>	    log("serial readable...\n");
>	    int c = read(fdSer,buf,bufSize);
>	    if (c > 0) {
>		buf[c] = 0;	
>	        log("got %d bytes from serial: '%s'...\n",c,buf);
>		write(1,buf,c);
>	        log("stdout write done...\n");
>	    }
>	}
>    }
>    tcsetattr(0,TCSANOW,&tOrg);
>    return 0;
>}
>
>_______________________________________________
>Beowulf mailing list, Beowulf at beowulf.org
>To change your subscription (digest mode or unsubscribe) visit
http://www.beowulf.org/mailman/listinfo/beowulf
>
>  
>


_______________________________________________
Beowulf mailing list, Beowulf at beowulf.org
To change your subscription (digest mode or unsubscribe) visit
http://www.beowulf.org/mailman/listinfo/beowulf
_______________________________________________
Beowulf mailing list, Beowulf at beowulf.org
To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf



More information about the Beowulf mailing list