Decision Optimization

 View Only

 cplex c++ control threads and display with CPXsetintparam function

xavier warin's profile image
xavier warin posted Thu August 07, 2025 07:33 AM

Hi

I use OsiCpxSolverInterfrace to define my lp/Mip and i try to control the display and the number of threads.
I get back a pointer on  the env and   with the CPXsetintparam i try to control the behavior:

CPXENVptr  cpxEnvPtr = dynamic_cast<OsiCpxSolverInterface*>(solver)->getEnvironmentPtr();
CPXsetintparam(cpxEnvPtr,CPX_PARAM_THREADS,1); // one thread
CPXsetintparam(cpxEnvPtr,CPX_PARAM_SCRIND,0); // suppress display

But the output is still on the screen and the number of threads  is perhaps not set.
Has someone a way to do this (and tell me why the preceding lines have no effect).
Regards