You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For optimize.portfolio.rebalancing it would be nice to have an argument that would allow the user to set the parallelization level. For instance, CVXR::psolve has a [parallel] argument. Would it be possible to switch to psolve over solve calls? Because adding a parallelization argument and using psolve would then users with large problems to decide where it would be best to have parallelization for their problem. Another example would be generating random portfolios.
The text was updated successfully, but these errors were encountered:
We can send extra arguments to the solvers (e.g. c("DEoptim", "random", "ROI", "CVXR")) using the "dots" ... argument.
So it may already be possible to pass the parallel argument to CVXR::psolve via dots. This is how we pass parallel and other extra arguments to DEoptim already. Could you try to work up a minimal example of whether this works or not passing the parallel argument via dots?
For random portfolios, the most efficient method is likely the simplex method, which is unlikely to benefit much or at all from parallelization. The 'grid' method is also pretty efficient, as I recall. The sample method is the least efficient, but also supports arbitrary constraints. Without refreshing my memory on the code, which is several (many!) years old at this point, I think allowing parallelization in the sample method would be possible, but would definitely take some refactoring to break up the problem into multiple parallel streams.
So it may already be possible to pass the parallel argument to CVXR::psolve via dots. This is how we pass parallel and other extra arguments to DEoptim already. Could you try to work up a minimal example of whether this works or not passing the parallel argument via dots?
Yes with ... I think passing parallel is already possible. I'll make a mre switching out solve with psolve to see if that works.
The main thing for this issue is that when we call optimize.portfolio.rebalancing we set the number of threads outside of the function. Then inside of optimize.portfolio.rebalancing there is a foreachloop that, based on the number of threads available, does parallelization at the day level. Since their are only two levels of parallelization for this function (rebalancing periods and parallelization from within the optimizers) how would you feel about adding an argument like parallelize or parallelize_days that can be set to true or false? Or we could just have a string of days or model which would leave things open if we want to do something like parallelize over multiple portfolios
For
optimize.portfolio.rebalancing
it would be nice to have an argument that would allow the user to set the parallelization level. For instance,CVXR::psolve
has a [parallel
] argument. Would it be possible to switch topsolve
oversolve
calls? Because adding a parallelization argument and usingpsolve
would then users with large problems to decide where it would be best to have parallelization for their problem. Another example would be generating random portfolios.The text was updated successfully, but these errors were encountered: