Getting access to the data passed to solver

Is there a way to get access to what CVX passes to solvers. I have two reasons for why this is useful:
(1) I need to do a Monto Carlo simulation and want to solve the same problem with different inputs, many times. I would prefer to get the structures and pass them directly to the solver to avoid CVX conversion overhead every time.

(2) I would like to try SDPNAL which seems to be using the same format as SDP3. The documentation however is scarce and I don’t want to spend time figuring out how I should build the necessary structures to pass to SDPNAL. It would be nice to use what CVX passes to SDP3 for this purpose.

EDIT: A related question: Is there some documentation to allow one to extend CVX to interface to other solvers (e.g. SDPNAL) without getting too much into the inner working of CVX. I digged through the code and it was a bit daunting.

There is no way to achieve what you’re attempting with (1). The overhead is unavoidable, even with repeated models with slightly different inputs. That’s the way CVX is designed; not for speed but for your convenience. If you need to eliminate the overhead, your only choice is to bypass CVX altogether and perform the necessary conversions yourself.

The function that implements SDPT3 support is cvx_spdt3.m. I am afraid that no, there is no documentation, and I really can’t help you with it. But roughly speaking, cvx_run_solver is a simple wrapper around the actual call to sdpt3. If SDPNAL really does have the same calling interface, in theory, you could do a simple substitution of SDPT3 for SDPNAL.

For individual models, consider typing help cvx_solver_settings in the MATLAB command line. This provides a way for you to dump out the raw data being fed to your solver, and the output.