| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | $nmod_calc = 55; |
|---|
| 12 | |
|---|
| 13 | $nMod = 0; |
|---|
| 14 | $nComputed = 0; |
|---|
| 15 | $nSkip = 0; |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | $c = "M"; |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | system( "net use $c: \\\\cumulus\\cumulus_c\$ /persistent:no" ); |
|---|
| 22 | |
|---|
| 23 | $in_dir = "$c:/projects/cloudy/trunk/tsuite/auto/"; |
|---|
| 24 | $out_dir = "$c:/projects/cloudy/trunk/tsuite/auto/"; |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | if( !chdir( $out_dir ) ) |
|---|
| 28 | { |
|---|
| 29 | printf(ioLOG " invalid directory for output of test suite\n"); |
|---|
| 30 | printf(ioLOG " was ==%s==\n",$out_dir ); |
|---|
| 31 | exit(1); |
|---|
| 32 | } |
|---|
| 33 | |
|---|
| 34 | $log_file = "autorun2.log"; |
|---|
| 35 | open( ioLOG , ">$log_file" ); |
|---|
| 36 | printf( ioLOG "have moved to output dir and opened log2 files\n"); |
|---|
| 37 | printf( ioLOG "input dir is $in_dir, out is $out_dir\n"); |
|---|
| 38 | |
|---|
| 39 | $exe = "$c:/projects/Cloudy/current_net/Debug/current_net.exe"; |
|---|
| 40 | $exe = "$c:\\projects\\Cloudy\\trunk\\current_net\\Debug\\current_net.exe"; |
|---|
| 41 | $exe = "$c:/projects/cloudy/trunk/debug/trunk.exe"; |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | printf(ioLOG "exe is $exe\n"); |
|---|
| 46 | |
|---|
| 47 | $TRUE = 1; |
|---|
| 48 | $FALSE = 0; |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | $lgForceCompute = $TRUE; |
|---|
| 52 | |
|---|
| 53 | $lgForceCompute = $FALSE; |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | $errors = "errors.txt"; |
|---|
| 57 | |
|---|
| 58 | $blockrun = "blockfile.txt"; |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | if( !open(EXEFILE, "$exe") ) |
|---|
| 62 | { |
|---|
| 63 | printf( ioLOG "executable did not exist so exiting without running.\n" ); |
|---|
| 64 | printf( STDERR "executable did not exist so exiting without running.\n" ); |
|---|
| 65 | exit(1); |
|---|
| 66 | } |
|---|
| 67 | |
|---|
| 68 | |
|---|
| 69 | |
|---|
| 70 | if( !$lgForceCompute ) |
|---|
| 71 | { |
|---|
| 72 | if( -e $errors ) |
|---|
| 73 | { |
|---|
| 74 | |
|---|
| 75 | if( (-M $errors) < (-M EXEFILE ) ) |
|---|
| 76 | { |
|---|
| 77 | printf( ioLOG "executable older than errors.txt so exit.\n" ); |
|---|
| 78 | |
|---|
| 79 | exit(2); |
|---|
| 80 | } |
|---|
| 81 | |
|---|
| 82 | if( -e $blockrun ) |
|---|
| 83 | { |
|---|
| 84 | printf( ioLOG "blockrun file exists so exit.\n" ); |
|---|
| 85 | |
|---|
| 86 | exit(3); |
|---|
| 87 | } |
|---|
| 88 | } |
|---|
| 89 | } |
|---|
| 90 | |
|---|
| 91 | |
|---|
| 92 | printf( ioLOG "entering loop, exe is $exe \n" ); |
|---|
| 93 | |
|---|
| 94 | while( defined( $input = glob("$in_dir*.in") ) ) |
|---|
| 95 | |
|---|
| 96 | { |
|---|
| 97 | if( $nMod >= $nSkip && $nMod < $nmod_calc ) |
|---|
| 98 | { |
|---|
| 99 | |
|---|
| 100 | $output = $input; |
|---|
| 101 | |
|---|
| 102 | $output =~ s/$in_dir/$out_dir/gi; |
|---|
| 103 | $output =~ s/$in_dir/$out_dir/gi; |
|---|
| 104 | |
|---|
| 105 | $output =~ s/\.in/.out/gi; |
|---|
| 106 | |
|---|
| 107 | |
|---|
| 108 | printf( ioLOG "$input going to $output \n" ); |
|---|
| 109 | system "$exe < $input > $output "; |
|---|
| 110 | ++$nComputed; |
|---|
| 111 | } |
|---|
| 112 | ++$nMod; |
|---|
| 113 | } |
|---|
| 114 | |
|---|
| 115 | printf( ioLOG "$nComputed sims were run\n"); |
|---|
| 116 | |
|---|
| 117 | exit(0); |
|---|