| 3 | | # This script calls the run_parallel.pl script to run the test suite |
|---|
| 4 | | # in parallel on suitable machines. The syntax is: |
|---|
| 5 | | # |
|---|
| 6 | | # runall.pl cloudy.exe |
|---|
| 7 | | # |
|---|
| 8 | | # or |
|---|
| 9 | | # |
|---|
| 10 | | # runall.pl cloudy.exe 16 |
|---|
| 11 | | # |
|---|
| 12 | | # where the first parameter is the name of the Cloudy executable. It |
|---|
| 13 | | # should either be in your search path, or the full pathname should |
|---|
| 14 | | # be used. The second number is the number of processors to use. It |
|---|
| 15 | | # can be any number >= 0. However, using numbers larger than roughly |
|---|
| 16 | | # 16 will not give any speed advantage since the time will then be |
|---|
| 17 | | # set by the longest running test sims. The second number is optional |
|---|
| 18 | | # and will default to the number of processosrs on your computer |
|---|
| 19 | | # (this number is only correctly determined under Linux and Windows, |
|---|
| 20 | | # it will be set to 1 on other systems). |
|---|
| 21 | | # |
|---|
| 22 | | # If the number of processors is set to 0, the script will exit after |
|---|
| 23 | | # creating the Makefile (i.e., the test suite will not be run). |
|---|
| 24 | | # |
|---|
| 25 | | # NB NB - The script will first delete any remaining output from a |
|---|
| 26 | | # previous run of the test suite by calling the script clean_tsuite.pl |
|---|
| 27 | | # (this includes calls with the number of processors set to 0) ! |
|---|
| 28 | | # |
|---|
| 29 | | # The script uses "gmake" (GNU make) to run the test cases. In case |
|---|
| 30 | | # that doesn't exist, you can try replacing the two calls below with |
|---|
| 31 | | # "make". If the version is not too old, that should work as well |
|---|
| 32 | | # provided it supports the -j parameter for parallel execution. |
|---|
| 33 | | # |
|---|
| 34 | | # Peter van Hoof |
|---|
| | 11 | # after all the models are run the "checkall.pl" script can be run |
|---|
| | 12 | # to check that everything went ok |
|---|
| 36 | | system "./run_parallel.pl @ARGV"; |
|---|
| | 14 | # if there is already an exe file in this dir, back it up before |
|---|
| | 15 | # bringing in a new one, in case we need to run the old models |
|---|
| | 16 | if(-e "trunk.exe" ) |
|---|
| | 17 | { |
|---|
| | 18 | system("copy \"trunk.exe\" \"cloudy_bak.exe\" "); |
|---|
| | 19 | } |
|---|
| | 20 | |
|---|
| | 21 | # the path to the executable version of the code |
|---|
| | 22 | |
|---|
| | 23 | #$exe = "c:/projects/cloudy/trunk/icl/release/cloudy_icl.exe"; |
|---|
| | 24 | #$exe = "c:/projects/cloudy/trunk/source/sys_icl/cloudy.exe"; |
|---|
| | 25 | |
|---|
| | 26 | #$exe = "c:/Projects/Cloudy/trunk/debug/trunk.exe"; |
|---|
| | 27 | $exe = "c:/projects/cloudy/trunk/release/trunk.exe"; |
|---|
| | 28 | |
|---|
| | 29 | #$exe = "c:/Projects/Cloudy/trunk/vs08/debug/vs08.exe"; |
|---|
| | 30 | #$exe = "c:/projects/cloudy/trunk/vs08/release/vs08.exe"; |
|---|
| | 31 | |
|---|
| | 32 | #$exe = "c:/projects/cloudy/newmole/debug/newmole.exe"; |
|---|
| | 33 | #$exe = "c:/projects/cloudy/newmole/icl/release/cloudy_icl.exe"; |
|---|
| | 34 | |
|---|
| | 35 | #$exe = "c:/projects/cloudy/trunk/gcc/release/cloudy_gcc.exe"; |
|---|
| | 36 | #$exe = "c:/projects/cloudy/trunk/source/sys_gcc/cloudy.exe"; |
|---|
| | 37 | |
|---|
| | 38 | # count total number of sims we compute |
|---|
| | 39 | $nMod = 0; |
|---|
| | 40 | |
|---|
| | 41 | # sets number to skip - will start tests after skipping the first |
|---|
| | 42 | # nSkip in alphabetical order. set to 0 to so all sims |
|---|
| | 43 | $nSkip = 0; |
|---|
| | 44 | |
|---|
| | 45 | # total number to do, usually much larger than the total |
|---|
| | 46 | # to do them all |
|---|
| | 47 | $nLimit = 700; |
|---|
| | 48 | |
|---|
| | 49 | # loop over the *.in files |
|---|
| | 50 | # and runs the test, producinig the *.out files |
|---|
| | 51 | while ( defined( $input = glob("*.in") ) ) |
|---|
| | 52 | { |
|---|
| | 53 | if ( $nMod>=$nSkip && $nMod < $nLimit ) |
|---|
| | 54 | { |
|---|
| | 55 | print( "$input going to " ); |
|---|
| | 56 | $output = $input; |
|---|
| | 57 | $output =~ s/\.in//gi; |
|---|
| | 58 | if( -e "$output".".out" ) |
|---|
| | 59 | { |
|---|
| | 60 | rename( "$output".".out" , "$output".".bak" ); |
|---|
| | 61 | } |
|---|
| | 62 | $out = "$output".".out"; |
|---|
| | 63 | print("$output\n"); |
|---|
| | 64 | # actually execute the code, first uses nice |
|---|
| | 65 | # system "nice -n 5 $exe < $input > $out"; |
|---|
| | 66 | system "$exe < $input > $out"; |
|---|
| | 67 | } |
|---|
| | 68 | ++$nMod; |
|---|
| | 69 | } |
|---|
| | 70 | |
|---|
| | 71 | print("\n=========================\n"); |
|---|
| | 72 | printf( "\n %i simulations were computed, and %i were skipped.\n ",$nMod,$nSkip); |
|---|
| | 73 | print("Now use the checkall.pl script to check results.\n"); |
|---|
| | 74 | print("=========================\n"); |
|---|