BookmarkSubscribeRSS Feed
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?

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.

Quartz | Level 8



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


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


Also, what SAS/OR version are you using?

Quartz | Level 8

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

Jade | Level 19

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




Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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
  • 3 in conversation