source: releases/2.8.8/Cbc/scripts/run.sh

Last change on this file was 1854, checked in by stefan, 6 years ago

fix svn keywords property

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2#*                                                                           *
3#*            This file is part of the test engine for MIPLIB2010            *
4#*                                                                           *
5#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
6# $Id: run.sh 1854 2013-01-28 00:02:55Z stefan $
7
8SHELL=$1
9BINNAME=$2
10TSTNAME=$3
11TIMELIMIT=$4
12HARDMEMLIMIT=$5
13THREADS=$6
14
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
25then
26    echo "ERROR: solver link <$BINNAME> does not exist in <bin> folder; see bin/README"
27    exit;
28fi
29
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
36
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.
61MIPGAP=0.0
62
63# post system information and current time into the output file
64uname -a > $OUTFILE
65date >> $OUTFILE
66
67# convert hard memory limit to kilo bytes and post it into the output file
68HARDMEMLIMIT=`expr $HARDMEMLIMIT \* 1024`
69echo "hard mem limit: $HARDMEMLIMIT k" >> $OUTFILE
70
71# loop over all instance names which are listed in the test set file name
72for i in `cat $TSTPATH/$TSTNAME.test` 
73do 
74    # check if the current instance exists
75    if test -f $i
76    then
77        echo @01 $i ===========     
78        echo -----------------------------
79        date
80        echo -----------------------------
81        TIMESTART=`date +"%s"`
82        echo @03 $TIMESTART
83        $SHELL -c " ulimit -v $HARDMEMLIMIT k; ulimit -f 2000000; $SCRIPTPATH/run_$SOLVER.sh $SOLVER $BINPATH/$BINNAME $i $TIMELIMIT $SOLFILE $THREADS $MIPGAP"
84        echo
85        TIMEEND=`date +"%s"`
86        echo @04 $TIMEEND
87        echo @05 $TIMELIMIT
88        # check if a solution file was written
89        if test -e $SOLFILE
90        then
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
100        fi
101        echo -----------------------------
102        date
103        echo -----------------------------
104        echo
105        echo =ready=
106    else
107        echo @02 FILE NOT FOUND: $i ===========
108    fi
109done 2>&1 | tee -a $OUTFILE
110
111date >> $OUTFILE
112
113if test -e $SOLFILE
114then
115    rm $SOLFILE
116fi
117
118awk -f $SCRIPTPATH/parse.awk -f  $SCRIPTPATH/parse_$SOLVER.awk $OUTFILE | tee $RESFILE
Note: See TracBrowser for help on using the repository browser.