File indexing completed on 2024-04-06 11:56:35
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 BEGIN {
0014 use File::Basename;
0015 unshift(@INC, dirname($0)."/mpslib");
0016 }
0017 use Mpslib;
0018
0019 $seconds = 60;
0020
0021
0022 while (@ARGV) {
0023 $arg = shift(ARGV);
0024 if ($arg =~ /\A-/) {
0025 if ($arg =~ "h") {
0026 $helpwanted = 1;
0027 }
0028 elsif ($arg =~ "d") {
0029 $localdir = 1;
0030 }
0031 $optionstring = "$optionstring$arg";
0032 }
0033 else {
0034 $i = $i + 1;
0035 if ($i eq 1) {
0036 $seconds = $arg;
0037 }
0038 }
0039 }
0040
0041 if ($helpwanted != 0 ) {
0042 print "Usage:\n mps_auto.pl [options] [seconds]";
0043 print "\nTry to submit merge job every 'seconds' (default: 60, min: 20) seconds.";
0044 print "\nStops in case of a problem in a mille job.";
0045 print "\nKnown options:";
0046 print "\n -h This help.\n";
0047 exit;
0048 }
0049
0050
0051 if ($seconds <20) {
0052 print "Set seconds to 20\n";
0053 $seconds = 20;
0054 }
0055
0056 $done = 0;
0057
0058 $iter = 0;
0059 while ($done == 0) {
0060 if ($iter != 0) {
0061 print "mps_stat.py > /dev/null; mps_fetch.py\n";
0062 system "mps_stat.py > /dev/null; mps_fetch.py";
0063 read_db();
0064
0065 for ($i=0; $i<$nJobs; ++$i) {
0066 if ($JOBSTATUS[$i] ne "RUN" && $JOBSTATUS[$i] ne "DONE"
0067 && $JOBSTATUS[$i] ne "OK" && $JOBSTATUS[$i] ne "PEND"
0068 && !$JOBSTATUS[$i] =~ /DISABLED/) {
0069 $done = 1;
0070 print "Mille job $i in unknown or bad status $JOBSTATUS[$i], stopping.\n";
0071 }
0072 }
0073 if ($done == 0) {
0074 print "mps_fire.py -m; date; sleep $seconds\n";
0075 system "mps_fire.py -m; date; sleep $seconds";
0076 }
0077 }
0078 $iter = $iter + 1;
0079
0080 read_db();
0081 $i = (@JOBID) - 1;
0082 if (@JOBSTATUS[$i] ne "SETUP") {
0083 $done = 1;
0084 break;
0085 }
0086 }