Hi would it be possible to support the pickling of a gurobi model in the python api.
I would like to use the multiprocessing module in python and it requires that the arguments to the function that is forked into a new process are picklable.
At the moment this happens when I try to pickle a gurobi model.
>>> import gurobipy
>>> m = gurobipy.Model()
>>> import pickle
>>> pickle.dumps(m)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/pickle.py", line 1374, in dumps
Pickler(file, protocol).dump(obj)
File "/usr/lib/python2.7/pickle.py", line 224, in dump
self.save(obj)
File "/usr/lib/python2.7/pickle.py", line 306, in save
rv = reduce(self.proto)
File "/usr/lib/python2.7/copy_reg.py", line 74, in _reduce_ex
getstate = self.__getstate__
File "model.pxi", line 118, in gurobipy.Model.__getattr__ (../../src/python/gurobipy.c:30205)
File "model.pxi", line 1077, in gurobipy.Model.getAttr (../../src/python/gurobipy.c:38499)
gurobipy.GurobiError: Unknown attribute '__getstate__'
>>>
Thanks stu
--
Stuart Mitchell
PhD Engineering Science
Extraordinary Freelance Programmer and Optimisation Guru