Skip to main content

How to save a model file in memory rather than disk?

Answered

Comments

1 comment

  • Mario Ruthmair
    • Gurobi Staff

    Hi Jin,

    Since it is usually not allowed to access the memory of a different process, here are some suggestions:

    • If you have enough memory, you could create a RAM-disk in your operating system, i.e., an area in your memory that behaves like a normal disk and has a path. Then you can write/read the MPS file to this RAM-disk.
    • You could communicate between the C++ and the Python process via REST (or something else) to send the model details from C++ to Python.
    • It might make sense to construct the whole model either in C++ or Python and just transfer the data needed for the model formulation.

    Best regards,
    Mario

    0

Please sign in to leave a comment.