IBM Support

Display elapsed time after each iteration in CPLEX engine log

Question & Answer


Question

How to display the elapsed time after each iteration in CPLEX engine log?

Answer

To display the elapsed time in the CPLEX Engine Log, you can use the below awk script. This displays the seconds elapsed in the first column of the engine log.

./cplex -c "read myproblem.lp" opt | awk 'BEGIN { bb = systime(); } /.*/ { printf("%d\t%s\n", systime() - bb, $0); }'

If you are using Windows platform you can still run this command using cygwin. If you have non default parameters being set, include them in a prm file and read it along with the LP file in your awk script.

[{"Product":{"code":"SSSA5P","label":"IBM ILOG CPLEX Optimization Studio"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Interactive Optimizer","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"12.6.1;12.6.0.1;12.6","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21902459