{"action":"created","issue":{"url":"https://api.github.com/repos/opencobra/cobratoolbox/issues/100","labels_url":"https://api.github.com/repos/opencobra/cobratoolbox/issues/100/labels{/name}","comments_url":"https://api.github.com/repos/opencobra/cobratoolbox/issues/100/comments","events_url":"https://api.github.com/repos/opencobra/cobratoolbox/issues/100/events","html_url":"https://github.com/opencobra/cobratoolbox/issues/100","id":122477846,"number":100,"title":"changeCobraSolver avoid global variables","user":{"login":"AndrasHartmann","id":8862942,"avatar_url":"https://avatars.githubusercontent.com/u/8862942?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrasHartmann","html_url":"https://github.com/AndrasHartmann","followers_url":"https://api.github.com/users/AndrasHartmann/followers","following_url":"https://api.github.com/users/AndrasHartmann/following{/other_user}","gists_url":"https://api.github.com/users/AndrasHartmann/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrasHartmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrasHartmann/subscriptions","organizations_url":"https://api.github.com/users/AndrasHartmann/orgs","repos_url":"https://api.github.com/users/AndrasHartmann/repos","events_url":"https://api.github.com/users/AndrasHartmann/events{/privacy}","received_events_url":"https://api.github.com/users/AndrasHartmann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-16T10:57:21Z","updated_at":"2016-01-21T08:59:43Z","closed_at":null,"body":"Hi,\r\n\r\nI am using Cobra together with parallel toolbox, and the standard in this setting global variables do not get passed from the MATLAB client to the workers. Thus, in every thread the global variables have to be set, e.g. I have to call changeCobraSolver. I think there could be an alternative mechanism for changeCobraSolver which also suits parallel computing."},"comment":{"url":"https://api.github.com/repos/opencobra/cobratoolbox/issues/comments/173504771","html_url":"https://github.com/opencobra/cobratoolbox/issues/100#issuecomment-173504771","issue_url":"https://api.github.com/repos/opencobra/cobratoolbox/issues/100","id":173504771,"user":{"login":"tpfau","id":9972778,"avatar_url":"https://avatars.githubusercontent.com/u/9972778?v=3","gravatar_id":"","url":"https://api.github.com/users/tpfau","html_url":"https://github.com/tpfau","followers_url":"https://api.github.com/users/tpfau/followers","following_url":"https://api.github.com/users/tpfau/following{/other_user}","gists_url":"https://api.github.com/users/tpfau/gists{/gist_id}","starred_url":"https://api.github.com/users/tpfau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpfau/subscriptions","organizations_url":"https://api.github.com/users/tpfau/orgs","repos_url":"https://api.github.com/users/tpfau/repos","events_url":"https://api.github.com/users/tpfau/events{/privacy}","received_events_url":"https://api.github.com/users/tpfau/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T08:59:43Z","updated_at":"2016-01-21T08:59:43Z","body":"The only way I currently see would be to provide an option to select the solver during the call to optimizeCbModel (and all other functions which use solveCobraLP/MILP/...), which would be a lot of code that needs to be altered. \r\nJust one thing though:\r\nMost solvers do possess internal parallelisation methods, so it is not always advisable to actually run them on very few cores (or even only one core), as they might end up being much slower.\r\nE.g. CPLEX will by default always run one simplex instance and fill the remaining available cores with barrier methods, thus, depending on how fast the barrier instances reach the objective, it can happen that there is no speedup at all (if simplex is faster than the barrier runs) or, that two processors are e.g. 10 times fast than one, depending on the problem. \r\n\r\n\r\n"}}