How to save a model file in memory rather than disk?
回答済みDear all,
I am currently working on a large model and I am seeking your expertise on a matter. Currently, we construct the model in C++, but we need to add some constraints in Python. We then save the model as an MPS file in C++, which we then read in Python. Unfortunately, this process is taking up a significant amount of time.
I am wondering if anyone has any suggestions on how to optimize this process. Is there a way to store the model in memory rather than writing and reading it from a disk?
Thank you for your time and I appreciate any suggestions you may have.
Best regards,
Jin
0
-
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,
Mario0
サインインしてコメントを残してください。
コメント
1件のコメント