Adding default writing problem and solution file, if the optimizer returns an error code.

This commit is contained in:
jensen.bo@gmail.com
2012-06-27 07:01:00 +00:00
parent 49f2a704f0
commit 107fca5c37

View File

@@ -47,6 +47,18 @@ void ExLogCallbackFunction(enum SlmStream str, const char *strprint, void *handl
#define CheckReturnKey(__ret__)\
{\
if( (__ret__) != SlmRetOk ) {\
VLOG(0) <<"Writing problem to : sulum_error.mps";\
int wret = SlmWriteProblem(model_,"sulum_error.mps");\
if( (wret) != SlmRetOk )\
{\
VLOG(0) <<"Error writing problem to : sulum_error.mps : "<<(wret);\
}\
VLOG(0) <<"Writing solution to : sulum_error.sol";\
wret = SlmWriteSolution(model_,"sulum_error.sol");\
if( (wret) != SlmRetOk )\
{\
VLOG(0) <<"Error writing solution to : sulum_error.sol : "<<(wret);\
}\
LOG(FATAL) <<"Error Sulum API call failed : at line "<<__LINE__<<" ret : "<<(__ret__);\
}\
}