root/branches/newmole/scripts/nightly_runL_tsuite_part2.pl

Revision 688, 3.3 kB (checked in by peter, 2 years ago)

Merge changes from mainline upto r685 (second installment).

Mop up a few remaining issues.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1#!perl -w
2
3# this is the "second" script, it must start after the first, and
4# end before the first is done
5
6# this script MUST be run in directory containing the test suite
7# this is the number of models to actually compute here
8# this is run on second slave machine and must end first
9# slave will do this many, master will skip this many
10#>>chng 06 aug 29, from 67 to 62, master found 8 undone model on a backup night
11$nmod_calc = 55;
12
13$nMod = 0;
14$nComputed = 0;
15$nSkip = 0;
16
17# the disk drive
18$c = "M";
19
20# try using net use net use u: \\server-name\share-name\
21system( "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# move to the output directory
27if( !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";
35open( ioLOG , ">$log_file" );
36printf( ioLOG "have moved to output dir and opened log2 files\n");
37printf( 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# cannot use local copy due to bug in server, must use fully resolved path
43#$exe = "Current.exe";
44#$exe = "\\\\cumulus\\cumulus_c\$\\projects\\Cloudy\\trunk\\debug\\Current.exe";
45printf(ioLOG "exe is $exe\n");
46
47$TRUE = 1;
48$FALSE = 0;
49
50# if true then always recompute even when exe is older than results
51$lgForceCompute = $TRUE;
52# if false then only recompute when newer exe than results
53$lgForceCompute = $FALSE;
54
55# file containing any errors, also used for timestamp
56$errors = "errors.txt";
57# this file exists while long checking runs with purify are in pregress
58$blockrun = "blockfile.txt";
59
60# does $exe exist?
61if( !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# see if errors.txt exists, if it does, and younger than exe file, just quit
69# $lgForceCompute set above, option to force recomputing model
70if( !$lgForceCompute  )
71{
72        if( -e $errors )
73        {
74                # is age of errors file smaler than exe file?
75                if( (-M $errors) < (-M EXEFILE ) )
76                {
77                        printf( ioLOG "executable older than errors.txt so exit.\n" );
78                        # no need to run tests, just quit
79                        exit(2);
80                }
81                # this file created when purify test is running
82                if( -e $blockrun )
83                {
84                        printf( ioLOG "blockrun file exists so exit.\n" );
85                        # no need to run tests, just quit
86                        exit(3);
87                }
88        }
89}
90
91
92printf( ioLOG "entering loop, exe is $exe \n" );
93
94while( defined( $input = glob("$in_dir*.in") ) )
95#while( defined( $input = glob("*.in") ) )
96{
97        if( $nMod >= $nSkip && $nMod < $nmod_calc )
98        {
99                # copy input file to fileout to exit it
100                $output = $input;
101                # change input dir name to output
102                $output =~ s/$in_dir/$out_dir/gi;
103                $output =~ s/$in_dir/$out_dir/gi;
104                # change .in to .out
105                $output =~ s/\.in/.out/gi;
106                # $output = "$out_dir"."$output";
107                # system "nice -n 5 $exe < $input  > $output ";
108                printf( ioLOG "$input going to $output \n" );
109                system "$exe < $input  > $output ";
110                ++$nComputed;
111        }
112        ++$nMod;
113}
114
115printf( ioLOG "$nComputed sims were run\n");
116
117exit(0);
Note: See TracBrowser for help on using the browser.