Ignore:
Timestamp:
Dec 19, 2010 11:42:58 PM (10 years ago)
Author:
tkr
Message:

Updates to scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/scripts/parse.awk

    r1540 r1555  
    55#*                                                                           *
    66#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    7 # $Id: parse.awk,v 1.1 2010/10/07 16:14:36 bzfwolte Exp $
     7# $Id: parse.awk,v 1.2 2010/12/14 08:38:22 bzfwolte Exp $
    88
    99function abs(x)
     
    2020}
    2121BEGIN {
    22    printf("------------------+------+-------+-------+--------+---------\n");
    23    printf("Name              | Gap%% | Nodes |  Time | Status | Solution \n");
    24    printf("------------------+------+-------+-------+--------+---------\n");
     22   printf("----------------------------+----------------+----------------+------+-------+-------+--------+---------\n");
     23   printf("Name                        |   Dual Bound   |  Primal Bound  | Gap%% | Nodes |  Time | Status | Solution \n");
     24   printf("----------------------------+----------------+----------------+------+-------+-------+--------+---------\n");
    2525
    2626   infty = +1e+20;
     
    2828   largegap = 1e+04;
    2929
     30   # initialize summary data
     31   nsolved = 0;
     32   nstopped = 0;
     33   nfailed = 0;
     34
    3035   # initialize data to be set in parse_<solver>.awk
    3136   solver = "?";
    3237   solverversion = "?";
    33    lps = "none";
    34    lpsversion = "-";
     38   solverremark = "";
    3539}
    3640# instance name
     
    5660   aborted = 1;
    5761   timeout = 0;
    58    solstatus = "unkown";
     62   solstatus = "none";
     63   read_error = 0;
    5964}
    6065# time
     
    6368/@05/ { timelimit = $2; }
    6469# solution status
     70/Read SOL:/ {
     71   solstatus = "--";
     72}
    6573/Check SOL:/ {
    6674   intcheck = $4;
     
    92100   # determine solving status
    93101   status = "";
    94    if( aborted )
    95       status = "abort";
     102   if( aborted && !read_error)
     103     status = "abort";
     104   else if (aborted && read_error)
     105     status = "noread";
    96106   else if( timeout )
    97       status = "timeout";
     107     status = "stopped";
    98108   else
    99       status = "ok";
     109     status = "ok";
    100110
    101    # compute gap
     111   # determine overall status from solving status and solution status:
     112
     113   # instance solved correctly (including case that no solution was found)
     114   if( status == "ok" && (solstatus == "ok" || solstatus == "--") )
     115      nsolved++;
     116   # incorrect solving process or infeasible solution (including errors with solution checker)
     117   else if( status == "abort" || (solstatus == "fail" || solstatus == "error") )
     118      nfailed++;
     119   # stopped due to imposed limits
     120   else if ( status == "stopped" )
     121      nstopped++;
     122   else
     123     nnoread++;
     124 
     125  # compute gap
    102126   temp = pb;
    103127   pb = 1.0*temp;
     
    125149      gapstr = " Large";
    126150
    127    printf("%-18s %6s %7d %7d %8s %9s\n", prob, gapstr, bbnodes, time, status, solstatus);
     151   printf("%-28s %16.9g %16.9g %6s %7d %7d %8s %9s\n", prob, db, pb, gapstr, bbnodes, time, status, solstatus);
    128152}
    129153END {
    130    printf("------------------+------+-------+-------+--------+---------\n");
     154   printf("----------------------------+----------------+----------------+------+-------+-------+--------+---------\n");
     155   printf("\n");
     156   printf("solved/stopped/noread/failed: %d/%d/%d/%d\n", nsolved, nstopped, nnoread, nfailed);
     157   printf("\n");
    131158   printf("@02 timelimit: %g\n", timelimit);
    132    printf("@01 %s(%s)%s(%s)\n", solver, solverversion, lps, lpsversion);
     159   printf("@01 %s(%s)%s\n", solver, solverversion, solverremark);
    133160}
Note: See TracChangeset for help on using the changeset viewer.