{"action":"created","issue":{"url":"https://api.github.com/repos/prioritizr/prioritizr/issues/46","repository_url":"https://api.github.com/repos/prioritizr/prioritizr","labels_url":"https://api.github.com/repos/prioritizr/prioritizr/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/prioritizr/prioritizr/issues/46/comments","events_url":"https://api.github.com/repos/prioritizr/prioritizr/issues/46/events","html_url":"https://github.com/prioritizr/prioritizr/issues/46","id":273184487,"number":46,"title":"prioritizr / gurobi uses only one thread","user":{"login":"domisch","id":8987803,"avatar_url":"https://avatars2.githubusercontent.com/u/8987803?v=4","gravatar_id":"","url":"https://api.github.com/users/domisch","html_url":"https://github.com/domisch","followers_url":"https://api.github.com/users/domisch/followers","following_url":"https://api.github.com/users/domisch/following{/other_user}","gists_url":"https://api.github.com/users/domisch/gists{/gist_id}","starred_url":"https://api.github.com/users/domisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domisch/subscriptions","organizations_url":"https://api.github.com/users/domisch/orgs","repos_url":"https://api.github.com/users/domisch/repos","events_url":"https://api.github.com/users/domisch/events{/privacy}","received_events_url":"https://api.github.com/users/domisch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-11T23:26:46Z","updated_at":"2017-11-12T00:31:13Z","closed_at":null,"author_association":"NONE","body":"Dear prioritizr-team,\r\nI'm running a Marxan problem using Gurobi on a Linux VM with 32 cores. I've read that Gurobi should use all available resources automatically, but apparently only one thread is used (as printed in the console and also shown in the system monitor, and thus solving the problem takes a very long time). Is there a way I could specify the number of threads? Below is the code I use (and I've sent the data to Jeff in a previous email a while ago), but the problem also persists when using the examples from the manual/vignette.\r\nThanks a lot in advance, Sami\r\n\r\nmp02 <- marxan_problem(x = pu, spec = spec_02, puvspr = puvspr, bound = bound, blm = 0.3, \r\n                        asymmetric_connectivity=T, add_gurobi_solver)\r\nms_02 <- solve(mp02)\r\n\r\nConsole output:\r\nOptimize a model with 715517 rows, 365092 columns and 1646043 nonzeros\r\nVariable types: 0 continuous, 365092 integer (365092 binary)\r\nCoefficient statistics:\r\n  Matrix range     [2e-03, 1e+00]\r\n  Objective range  [6e-05, 1e+03]\r\n  Bounds range     [1e+00, 1e+00]\r\n  RHS range        [5e+01, 2e+03]\r\n.....\r\nExplored 1 nodes (704823 simplex iterations) in 42843.74 seconds\r\nThread count was 1 (of 32 available processors)"},"comment":{"url":"https://api.github.com/repos/prioritizr/prioritizr/issues/comments/343704761","html_url":"https://github.com/prioritizr/prioritizr/issues/46#issuecomment-343704761","issue_url":"https://api.github.com/repos/prioritizr/prioritizr/issues/46","id":343704761,"user":{"login":"mstrimas","id":7296482,"avatar_url":"https://avatars3.githubusercontent.com/u/7296482?v=4","gravatar_id":"","url":"https://api.github.com/users/mstrimas","html_url":"https://github.com/mstrimas","followers_url":"https://api.github.com/users/mstrimas/followers","following_url":"https://api.github.com/users/mstrimas/following{/other_user}","gists_url":"https://api.github.com/users/mstrimas/gists{/gist_id}","starred_url":"https://api.github.com/users/mstrimas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mstrimas/subscriptions","organizations_url":"https://api.github.com/users/mstrimas/orgs","repos_url":"https://api.github.com/users/mstrimas/repos","events_url":"https://api.github.com/users/mstrimas/events{/privacy}","received_events_url":"https://api.github.com/users/mstrimas/received_events","type":"User","site_admin":false},"created_at":"2017-11-12T00:31:13Z","updated_at":"2017-11-12T00:31:13Z","author_association":"CONTRIBUTOR","body":"Hi,\r\n\r\nYou'll need to use the `threads` argument of `add_gurobi_solver()`:\r\n\r\n```\r\nlibrary(prioritizr)\r\np <- problem(sim_pu_raster, sim_features) %>%\r\n  add_min_set_objective() %>%\r\n  add_relative_targets(0.1) %>%\r\n  add_binary_decisions() %>% \r\n  add_gurobi_solver(threads = 6)\r\nsolve(p)\r\n```"}}
{"actor":{"display_login":"mstrimas"}}