ILOG CPLEX 11.0 User's Manual > Programming Considerations > Managing Input and Output > Controlling Message Channels > Callable Library Routines for Message Channels |
Callable Library Routines for Message Channels |
INDEX PREVIOUS NEXT |
Interactive Optimizer and the Callable Library define several message channels for flexible control over message output:
cpxresults
for messages containing status and progress information;
cpxerror
for messages issued when a task cannot be completed;
cpxwarning
for messages issued when a nonfatal difficulty is encountered; or when an action taken may have side-effects; or when an assumption made may have side-effects;
cpxlog
for messages containing information that would not conventionally be displayed on screen but could be useful in a log file.
Output messages flow through message channels to destinations. Message channels are associated with destinations through their destination list. Messages from routines of the ILOG CPLEX Callable Library are assigned internally to one of those predefined channels. Those default channels are C pointers to ILOG CPLEX objects; they are initialized by CPXopenCPLEX
; they are not global variables. Your application accesses these objects by calling the routine CPXgetchannels
. You can use these predefined message channels for your own application messages. You can also define new channels.
An application using routines from the ILOG CPLEX Callable Library produces no output messages unless the application specifies message handling instructions through one or more calls to the message handling routines of the Callable Library. In other words, the destination list of each channel is initially empty.
Messages from multiple channels may be sent to one destination. All predefined ILOG CPLEX channels can be directed to a single file by a call to CPXsetlogfile
. Similarly, all predefined ILOG CPLEX channels except cpxlog
can be directed to the screen by the CPX_PARAM_SCRIND
parameter. For a finer level of control, or to define destinations for application-specific messages, use the following message handling routines, all documented in the ILOG CPLEX Reference Manual:
CPXmsg
writes a message to a predefined channel;
CPXflushchannel
flushes a channel to its associated destination;
CPXdisconnectchannel
flushes a channel and clears its destination list;
CPXdelchannel
flushes a channel, clears its destination list, frees memory for that channel;
CPXaddchannel
adds a channel;
CPXaddfpdest
adds a destination file to the list of destinations associated with a channel;
CPXdelfpdest
deletes a destination from the destination list of a channel;
CPXaddfuncdest
adds a destination function to a channel;
CPXdelfuncdest
deletes a destination function to a channel;
Once channel destinations are established, messages can be sent to multiple destinations by a single call to a message-handling routine.
Copyright © 1987-2007 ILOG S.A. All rights reserved. Legal terms. | PREVIOUS NEXT |