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.
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.
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.
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.
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.