Decision Optimization

Expand all | Collapse all

How to Find the memory (RAM) , CPU Usage when running docplex model

  • 1.  How to Find the memory (RAM) , CPU Usage when running docplex model

    Posted Wed December 02, 2020 10:38 PM
    1. Imagine I ran an optimization model written on docplex successfully. I need to know how I can find to run that model what are the resource usage for using cplex engine. I think we can find this by the cplex optimization studio - profiler section when running OPL models. I need to know how we an get this using python docplex.

    2. In Windows Task Manager enables  monitor the applications, processes, and services currently running  PC. When running cplex optimization studio what is reflected in this services area to show that cplex is running. 

    ------------------------------
    Suresh Abeyweera
    ------------------------------


  • 2.  RE: How to Find the memory (RAM) , CPU Usage when running docplex model

    Posted Mon December 07, 2020 08:43 AM

    Unfortunately, there is no way to track the engine memory for CPLEX MIP/LP in Python. You can have a look at the tracemalloc Python module https://docs.python.org/3/library/tracemalloc.html. It can help to track CPLEX memory and peak memory usage.

    However, if you are using docplex CP (CP Optimizer)  then this feature is available. Here is an example of usage:

    res = mdl.solve()
    infos = res.get_solver_infos()
    infos.write()  # Display all information 
    print(infos['MemoryUsage'])  # Display memory usage of the CP engine
    print(infos['PeakMemoryUsage'])  # Display peak memory usage of the CP engine

    Regards

    Philippe



    ------------------------------
    --
    Philippe Refalo
    IBM ILOG CP Optimizer
    ------------------------------



  • 3.  RE: How to Find the memory (RAM) , CPU Usage when running docplex model

    Posted Tue December 08, 2020 05:45 AM
    Hi Phillipe,

    Thanks for the update.Do you have an any advise on my second question.To be specific if IBM cognos analytics product run in background we can simply see 'IBM cognos' service is running.For TM1 also same we can see relavant service.But for cplex I cannot see that a service called 'IBM cplex' is  there.Do we have a service running from any other name for cplex.

    Regards
    Suresh

    ------------------------------
    Suresh Abeyweera
    ------------------------------