BookmarkSubscribeRSS Feed
DocMartin
Quartz | Level 8
I'm running an optimization routine using PROC OPTMODEL. On my previous computer (an old Surface) it was painfully slow. I was able to get a new laptop with 16GB memory, the latest Intel quad processor, and an SSD drive. Yet my algorithms run "only" three times faster. I've tried using the PERFORMANCE statement and there was no change. Is there any way to make PROC OPTMODEL use all four processors and/or speed up the run time?
5 REPLIES 5
RobPratt
SAS Super FREQ

PROC OPTMODEL uses all four processors by default, and you should see messages like this in the log:

NOTE: Problem generation will use 4 threads.

NOTE: The ___ algorithm is using up to 4 threads.

 

But you should not expect linear speedup from optimization algorithms.  Beyond the usual overhead of any parallel implementation, some parts of the algorithms are serial, and the speedup you see strongly depends on the type of problem and the specific data for your instance.

 

If you are able to share your code and data, I'll be glad to take a look and possibly provide some specific recommendations to speed things up.

DocMartin
Quartz | Level 8

Rob,

 

I appreciate your reply. But I can't share the algorithm's code as it's proprietary.

 

But here is part of the log file:

NOTE: The OPTLSO procedure is executing in single-machine mode.

NOTE: The OPTLSO algorithm is using up to 4 threads.

NOTE: The problem has 344 variables (343 integer, 1 continuous).

NOTE: The problem has 0 constraints (0 linear, 0 nonlinear).

NOTE: The problem has 1 FCMP function definitions.

NOTE: The deterministic parallel mode is enabled.

 

Thanks! Andrew

RobPratt
SAS Super FREQ

Your subject line says OPTMODEL, but your log says OPTLSO.  Was OPTMODEL just a typo?

 

Also, what SAS/OR version are you using?

DocMartin
Quartz | Level 8

Yikes!!!! I meant to state that I was using OPTLSO. Sorry about that.

mkeintz
PROC Star

I see a message referring to FCMP function definition.  It the function is called once per item in the optimization process, there could be lots of time-consuming context changes in the computing algorithm.  I have found that sometimes using a sas macro instead of a user-defined function performing the same operation can be faster.  Sometime all the function really offers is compact syntax.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1415 views
  • 0 likes
  • 3 in conversation