File: chkmachine

package info (click to toggle)
mpich 1.1.0-3
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 22,116 kB
  • ctags: 27,349
  • sloc: ansic: 193,435; sh: 11,172; fortran: 6,545; makefile: 5,801; cpp: 5,020; tcl: 3,548; asm: 3,536; csh: 1,079; java: 614; perl: 183; awk: 168; sed: 70; f90: 62
file content (61 lines) | stat: -rwxr-xr-x 1,289 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#! /usr/local/bin/perl5
# /usr/local/perl5.002/bin/perl
#
#
$debug = 0;
$username = getlogin || (getpwuid($<))[0] ;
$rsh = "rsh";
#
# This is an experimental perl program to check on the state of machines 
# in the machines list.  Use chkserv to check on the servers.
#
# Get the list of machines
$machinelist="/home/MPI/mpich/util/machines/machines.sun4";
#
# Read command line for overrides
while ($_ = $ARGV[0]) {
    shift;
    print "Processing argument $_\n" if $debug;
    if ($_ eq "-debug") {
	$debug = 1;
	}
    elsif ($_ eq "-machinelist") {
	$machinelist = $ARGV[0];
	shift;
	}
    elsif ($_ eq "-arch") {
	$machinelist = "/home/MPI/mpich/util/machines/machines.$ARGV[0]";
	shift;
	}
    elsif ($_ eq "-user") {
	$username = $ARGV[0];
	shift;
        }
    else {
	die "Unrecognized argument $_\n";
	}
    }

if ($username eq "") {
    die "Could not get username!\n";
    }
#
#
open( FLIST, $machinelist ) || die "Could not open $machinelist" ;
# Force output to be flushed
$| = 1;
#
while (<FLIST>) {
    # Skip comment lines
    if (/^#/) { next ; }
    # remove end-of-line
    chop;
    # Remove cluster size (optional)
    ($hostname,$clustersize) = split(/:/);
    print "Read $hostname from process $$\n" if $debug; 

    system("rup $hostname");
}
close( FLIST );
0;