batchSimos
914 Bytes
#!/usr/local/bin/perl5 -w
#
# Copyright (C) 1996-1998 by the Board of Trustees
# of Leland Stanford Junior University.
#
# This file is part of the SimOS distribution.
# See LICENSE file for terms of the license.
#
$firstrun = shift(@ARGV)
|| die "usage: batchSimos firstrun lastrun dir command";
$lastrun = shift(@ARGV)
|| die "usage: batchSimos firstrun lastrun dir command";
$dir = shift(@ARGV)
|| die "usage: batchSimos firstrun lastrun dir command";
$simos = "@ARGV";
foreach $run ($firstrun..$lastrun) {
($sec,$min,$hour,$mday,$mon) = localtime(time);
printf "%02d/%02d %02d:%02d:%02d ", $mon, $mday, $hour, $min, $sec;
print "starting simos[$run]: $simos\n";
$runname = sprintf("%03d", $run);
system "$simos -o runnum $run 1> $dir/run.$runname.out 2>&1 < /dev/null";
rename("cpu.log", "$dir/cpu.log.$runname");
}