[Ipopt] Suppressing warning messages

Stefan Vigerske stefan at math.hu-berlin.de
Sun Sep 18 07:17:39 EDT 2011


Hi,

>> I think suppress_all_output option gets active AFTER all options have
>> been read (see IpoptApplication::Initialize(istream&)). So output caused
>> while reading the option file are still printed.
>>
>> You could try to call the IpoptApplication constructor with argument
>> "false". Then you should have no output from the beginning on.
>>
>
> I should explain how we are using Ipopt. First we are using the Python wrapper, Pyipopt ( http://code.google.com/p/pyipopt/ ). It uses the C interface to Ipopt. So here is sequence of calls:
>
> 	1. Pyipopt calls CreateIpoptProblem
>
> 	2. CreateIpoptProblem calls the constructor IpoptApplication with NO arguments. ( So unfortunately, your second idea won't work unless I modify the Ipopt code, which would be easy, but I don't want to start my own fork of Ipopt ! )

If you contribute your modifications back to Ipopt, you may not have to 
start an own fork :-).
E.g., a parameter to pass a user callback function for writing Ipopt 
messages could be added to CreateIpoptProblem. If given, 
CreateIpoptProblem could add a journal that uses this callback for 
writing messages, instead of using the default journal.

For example, in my code I have a class MyJournal derived from 
Ipopt:Journal which implements the PrintImpl(), PrintfImpl() and 
FlushBufferImpl() functions. Then I do
    ipopt = new IpoptApplication(false);
    SmartPtr<Journal> jrnl = new MyJournal(gev, "console", 
J_ITERSUMMARY);
    jrnl->SetPrintLevel(J_DBG, J_NONE);
    if( !ipopt->Jnlst()->AddJournal(jrnl) )
       /* ERROR */


> We don't read the options from a file. Rather we make calls to Pyipopt's add_XXX_option methods which in turn call Ipopt's C interface functions, AddIpoptXXXOption.

Strange that they are called AddIpoptXXXOption if they actually set an 
option, but do not add further ones.

> I had been setting suppress_all_output to yes after all the other options had been set so I got excited that setting it first might help, but it didn't.

Maybe it works if you first set only suppress_all_output and an iterlim 
of 0 via the AddIpoptXXXOption and call IpoptSolve(), so it calls the 
Initialize() function and removes all journals from the 
IpoptApplication. Afterwards you reset the iterlim to a useful value and 
set all other options and to the normal IpoptSolver().
I haven't tried this workaround.

Stefan

> I can dig through the Ipopt code some more but that journaling system, while it seems very powerful, is kind of hard to follow! So that's why I was hoping someone would have solved my problem before.
>
> Thanks for helping.
>
>
>> Stefan
>>
>>> Hi,
>>>
>>>   For the purposes of some tests, I would like to suppress all output from Ipopt. I am already setting "suppress_all_output" to "yes". But I still get messages like the three below sent to the screen. Is there an option to suppress these too?
>>>
>>> ( We are making use of Ipopt in a larger system ,http://openmdao.org/ . Our tests include some intentional errors. We are checking our error handling. )
>>>
>>> Thanks in advance for the help!
>>>
>>>
>>> 1. Tried to set Option: invalid_parameter_name. It is not a valid option. Please check the list of available options.
>>>
>>> 2.  Setting: "-99" is not a valid setting for Option: max_iter. Check the option documentation.
>>>
>>> 3.
>>> ### max_iter (Integer) ###
>>> Category: Convergence
>>> Description: Maximum number of iterations.
>>> 0<= (3000)<= +inf
>>> ...Warning: overflow encountered in double_scalars
>>> _______________________________________________
>>> Ipopt mailing list
>>> Ipopt at list.coin-or.org
>>> http://list.coin-or.org/mailman/listinfo/ipopt
>>>
>>
>
> -----------------------
> Herb Schilling
> hschilling at nasa.gov
>
>
>
>



More information about the Ipopt mailing list