SAS Optimization, and SAS Simulation Studio

turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-31-2016 06:53 AM - edited 05-31-2016 06:58 AM

Hi,

Is there a way to configure proc optmodel to gracefully exit (and save the solutions that it has found so far) when it runs out of memory?

I am solving a binary linear model with the MILP solver. The relaxed problem finishes quickly but the branch and cut algorythm is getting stuck. After many iterations (1.5 days runing) the algorythm runs out of memory and terminates without saving the 7 solutions that it had found up to that point. The gap was not small (~35%) so I may not want to use any of those solutions anyway, but I would like to see the best one, at the very least. Unfortunatelty, the solver is terminating with status "OUT_OF_MEMORY", solution status "OUTMEM_NOSOL", and the create data statements saves zero (0) observations.

Here are some questions that come to mind in this situation:

- Is there an option for me to tell optmodel to save the best integer solution found (despite this exit status)?

- Or what could I do to have proc optmodel save a solution every "x" iterations or every "x" hours? e.g. gracefully exit solver with a timeout (I could use maxtime for that), save the best integer solution, and then continue solving from that same point (without having to start over again from the root of the search tree.) I could include this in a loop, so that not everything is lost if we suddenly hit a "out of memory" error... but this only makes sense if there is a way to continue with the branching and cutting seamlesly.
- Or is there a way to tell OPTMODEL to save the search tree in disk so that it never runs out of memory? FYI I am using the system options to increase memory and cpu (-memsize 4096M -cpucount 8.) According to the log, SAS is getting this amount of memory and the Branch and Cut algorithm is taking advantage of all 8 processors. It seems to me that, if there was a way for optmodel to use disk when the tree becomes very large, this amount of memory could be enough... and solving the problem would be just a matter of waiting longer, solving just to 90%, etc.

Of course, I am also tweaking the solver options (probe, nodesel, cutting plane levels, etc.) to see if there is a way to converge faster to the solution. So far, all the runs are ending up in a similar way. I am attaching the SAS log produced by the SOLVE statement in one of those runs. It would be nice to be able to see what are the options producing (hence this question.) Since the question is not specific to this particular problem, I am not including the model code itself, but let me know if any other information would help.

Would appreciate any pointers!

Accepted Solutions

Solution

05-31-2016
12:04 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to carlosmirandad

05-31-2016 11:39 AM

This issue was inadvertently introduced in SAS/OR 14.1 and will be fixed in the next release. Until then, a workaround is to replace the SOLVE statement with the following statements:

```
save mps mpsdata;
submit;
proc optmilp data=mpsdata primalout=primalout;
run;
endsubmit;
read data primalout into [_N_] _VAR_[_N_]=_VALUE_;
```

You can add any solver options to the PROC OPTMILP statement.

If you would like assistance reducing the solve time for your specific problem, please post more details, preferably including code and data.

All Replies

Solution

05-31-2016
12:04 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to carlosmirandad

05-31-2016 11:39 AM

This issue was inadvertently introduced in SAS/OR 14.1 and will be fixed in the next release. Until then, a workaround is to replace the SOLVE statement with the following statements:

```
save mps mpsdata;
submit;
proc optmilp data=mpsdata primalout=primalout;
run;
endsubmit;
read data primalout into [_N_] _VAR_[_N_]=_VALUE_;
```

You can add any solver options to the PROC OPTMILP statement.

If you would like assistance reducing the solve time for your specific problem, please post more details, preferably including code and data.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to RobPratt

05-31-2016 12:05 PM

Thanks Rob. Appreciate the prompt response.