[Ipopt] Ipopt output with runcutest

Stefan Vigerske svigerske at gams.com
Mon Nov 25 21:09:54 EST 2019


Hi,

You could modify the Ipopt or the CUTEst/Ipopt interface to add 
additional output.
But the things you mention are already written to the log in some form. 
You would just need to parse it.
I use something like this to make a csv line for one instance:

     awk -v solvername=`basename $d`  '
       BEGIN { exitcode = -200 }
       /Problem/ { prob = $3; }
       /# variables/ { nvars = $4; }
       /# constraints/ { ncons = $4; }
       /Final f/ { objval = $4; }
       /Solve time/ { time = $4; }
       /Exit code/ { exitcode = $4; }
       /Number of Iterations/ { niter = $4; }
       END {
         if( exitcode <= -200 ) { exit 1; }
         # if solved, or solved to acceptable level, or feasible, then 
return objective value, otherwise NA
         if( exitcode != 0 && exitcode != 1 && exitcode != 6 ) objval = 
"NA";
         printf("%s,%s,%d,%d,%s,%s,%d,", prob, solvername, nvars, ncons, 
objval, time, niter);
         if( exitcode == 0 )
           printf("Normal\n");
         else if ( exitcode > 0 )
           printf("Other\n");
         else if( exitcode == -1 )
           printf("IterationLimit\n");
         else if( exitcode == -4 )
           printf("TimeLimit\n");
         else
           printf("Error\n");
       }
     ' $i/output >> $TRCFILE || echo "  Incomplete output for $instance"

Stefan

On 11/25/19 9:42 PM, Yakui Huang wrote:
> Hello,
> 
> I’m using Ipopt to solve problems in CUTEst by calling runcutest. I want to print some results to files, for example, problem dimension, iteration number, objective value etc. However, I cannot find commands or settings in Ipopt to subscribe my output. I need to solve more than 100 problems. So, an easy and friendly output file is necessary. Any documents or commands for subscribing specified output of Ipopt?
> 
> Thank you.
> 
> Regards,
> Yakui Huang
> 
> 
> 
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> https://list.coin-or.org/mailman/listinfo/ipopt
> 



More information about the Ipopt mailing list