Ignore:
Timestamp:
Mar 21, 2011 11:48:47 PM (8 years ago)
Author:
tkr
Message:

Merging changesets 1539, 1540, 1555, 1556, 1557, and 1558 from trunk

Location:
stable/2.6
Files:
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • stable/2.6

  • stable/2.6/Cbc

  • stable/2.6/Cbc/scripts/run.sh

    r1540 r1615  
    1 #!/usr/bin/env bash
    21#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    32#*                                                                           *
     
    54#*                                                                           *
    65#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    7 # $Id: run.sh,v 1.1 2010/10/12 07:43:55 bzfwolte Exp $
     6# $Id: run.sh,v 1.4 2010/12/14 13:45:18 bzfheinz Exp $
    87
    9 SOLVER=$1
    10 LPS=$2
     8SHELL=$1
     9BINNAME=$2
    1110TSTNAME=$3
    1211TIMELIMIT=$4
    1312HARDMEMLIMIT=$5
     13THREADS=$6
    1414
    15 if test ! -e results
     15# construct paths
     16MIPLIBPATH=`pwd`
     17BINPATH=$MIPLIBPATH/bin
     18CHECKERPATH=$MIPLIBPATH/checker
     19RESULTSPATH=$MIPLIBPATH/results
     20SCRIPTPATH=$MIPLIBPATH/scripts
     21TSTPATH=$MIPLIBPATH/testset
     22
     23# check if the solver link (binary) exists
     24if test ! -e $BINPATH/$BINNAME
    1625then
    17     mkdir results
     26    echo "ERROR: solver link <$BINNAME> does not exist in <bin> folder; see bin/README"
     27    exit;
    1828fi
    1929
    20 OUTFILE=results/check.$SOLVER.$LPS.$TSTNAME.out
    21 RESFILE=results/check.$SOLVER.$LPS.$TSTNAME.res
    22 SOLFILE=results/check.$SOLVER.$LPS.$TSTNAME.sol
     30# check if the test set file/link exists
     31if test ! -e $TSTPATH/$TSTNAME.test
     32then
     33    echo "ERROR: test set file/link <$TSTNAME.test> does not exist in <testset> folder"
     34    exit;
     35fi
    2336
    24 CHECKTOL=-4 # short for 1e-04
     37# grep solver name
     38SOLVER=`echo $BINNAME | sed 's/\([a-zA-Z0-9_-]*\).*/\1/g'`
     39
     40# check if the result folder exist. if not create the result folder
     41if test ! -e $RESULTSPATH
     42then
     43    mkdir $RESULTSPATH
     44fi
     45
     46# construct name of output, results, and temporary solution file 
     47BASENAME=$RESULTSPATH/$TSTNAME.$BINNAME
     48OUTFILE=$BASENAME.out
     49RESFILE=$BASENAME.res
     50SOLFILE=$BASENAME.sol
     51
     52# absolut tolerance for checking linear constraints and objective value
     53LINTOL=1e-4
     54# absolut tolerance for checking integrality constraints
     55INTTOL=1e-4
     56
     57# Note that the MIP gap (gap between primal and dual solution) is not
     58# uniqly defined through all solvers. For example, there is a difference
     59# between SCIP and CPLEX. All solver, however, have the some behaviour in
     60# case of a MIP gap of 0.0.
    2561MIPGAP=0.0
    2662
     63# post system information and current time into the output file
    2764uname -a > $OUTFILE
    2865date >> $OUTFILE
    2966
     67# convert hard memory limit to kilo bytes and post it into the output file
    3068HARDMEMLIMIT=`expr $HARDMEMLIMIT \* 1024`
    3169echo "hard mem limit: $HARDMEMLIMIT k" >> $OUTFILE
    3270
    33 for i in `cat $TSTNAME.test`
     71# loop over all instance names which are listed in the test set file name
     72for i in `cat $TSTPATH/$TSTNAME.test`
    3473do
     74    # check if the current instance exists
    3575    if test -f $i
    3676    then
     
    4181        TIMESTART=`date +"%s"`
    4282        echo @03 $TIMESTART
    43         bash -c " ulimit -v $HARDMEMLIMIT k; ulimit -f 200000; ./run_$SOLVER.sh $SOLVER $LPS $i $TIMELIMIT $SOLFILE $MIPGAP"
     83        $SHELL -c " ulimit -v $HARDMEMLIMIT k; ulimit -f 2000000; $SCRIPTPATH/run_$SOLVER.sh $SOLVER $BINPATH/$BINNAME $i $TIMELIMIT $SOLFILE $THREADS $MIPGAP"
     84        echo
    4485        TIMEEND=`date +"%s"`
    4586        echo @04 $TIMEEND
    4687        echo @05 $TIMELIMIT
    47         if test -f $SOLFILE
     88        # check if a solution file was written
     89        if test -e $SOLFILE
    4890        then
    49             echo ""
    50             # bash -c " ./solchecker $i $SOLFILE $CHECKTOL" 
    51             echo ""
     91            # check if the link to the solution checker exists
     92            if test -f "$CHECKERPATH/bin/solchecker"
     93            then
     94                echo
     95                $SHELL -c " $CHECKERPATH/bin/solchecker $i $SOLFILE $LINTOL $INTTOL" 
     96                echo
     97            else
     98                echo WARNING: solution cannot be checked because solution checker is missing
     99            fi
    52100        fi
    53101        echo -----------------------------
     
    63111date >> $OUTFILE
    64112
    65 if test -f $SOLFILE
     113if test -e $SOLFILE
    66114then
    67115    rm $SOLFILE
    68116fi
    69117
    70 awk -f parse.awk -f parse_$SOLVER.awk $OUTFILE | tee $RESFILE
     118awk -f $SCRIPTPATH/parse.awk -f  $SCRIPTPATH/parse_$SOLVER.awk $OUTFILE | tee $RESFILE
Note: See TracChangeset for help on using the changeset viewer.