cvxgrp / CVXR

An R modeling language for convex optimization problems.

Home Page:https://cvxr.rbind.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how can I configure the solver to run on multiple threads?

mvlp opened this issue · comments

commented

I managed to do this on one pc (pure luck) and I would like to repeat the configuration on another pc but I am not getting it. I did not use de parallel=TRUE argument. ECOS and SCS are running in multiple cores without my control. Any tips? It follows my session info with the packages that I used in the multi-threaded version:

`R version 3.6.2 (2019-12-12)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.6 LTS

Matrix products: default
BLAS: /usr/lib/openblas-base/libblas.so.3
LAPACK: /usr/lib/libopenblasp-r0.2.18.so

locale:
[1] LC_CTYPE=pt_BR.UTF-8 LC_NUMERIC=C LC_TIME=pt_BR.UTF-8 LC_COLLATE=pt_BR.UTF-8
[5] LC_MONETARY=pt_BR.UTF-8 LC_MESSAGES=pt_BR.UTF-8 LC_PAPER=pt_BR.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=pt_BR.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] reticulate_1.14 zoo_1.8-7 CVXR_1.0

loaded via a namespace (and not attached):
[1] Rcpp_1.0.3 magrittr_1.5 MASS_7.3-51.5 bit_1.1-15.1
[5] lattice_0.20-38 R6_2.4.1 stringr_1.4.0 tools_3.6.2
[9] matrixcalc_1.0-3 grid_3.6.2 R.oo_1.23.0 audio_0.1-6
[13] R.matlab_3.6.2 SharpeR_1.2.0 bit64_0.9-7 Matrix_1.2-18
[17] gmp_0.5-13.5 beepr_1.3 R.utils_2.9.2 riskParityPortfolio_0.2.1
[21] stringi_1.4.5 compiler_3.6.2 Rmpfr_0.7-2 arrangements_1.1.8
[25] R.methodsS3_1.7.1 lubridate_1.7.4 expm_0.999-4 jsonlite_1.6 `

Our approach is to let the solvers behave as they normally would. Some solvers accept options for num_cores etc., via environment variables and they seem to work fine (e.g. MOSEK, GUROBI).

I would be curious how you did this with ECOS and SCS.

commented

I have both proprietary solvers (mosek and gurobi) installed manually and also installed inside anaconda. I was trying to use both at different times. Is there a chance that an environment variable have been modified and changed the behavior of the others?

CVXR doesn't touch any environment variables: that would be bad design. You are free to do so to get the behavior you desire.