{"action":"created","issue":{"url":"https://api.github.com/repos/openturns/openturns/issues/266","repository_url":"https://api.github.com/repos/openturns/openturns","labels_url":"https://api.github.com/repos/openturns/openturns/issues/266/labels{/name}","comments_url":"https://api.github.com/repos/openturns/openturns/issues/266/comments","events_url":"https://api.github.com/repos/openturns/openturns/issues/266/events","html_url":"https://github.com/openturns/openturns/pull/266","id":162103735,"number":266,"title":"Make ot.PythonFunction (optionally) distributed with multiprocessing","user":{"login":"felipeam86","id":5644836,"avatar_url":"https://avatars.githubusercontent.com/u/5644836?v=3","gravatar_id":"","url":"https://api.github.com/users/felipeam86","html_url":"https://github.com/felipeam86","followers_url":"https://api.github.com/users/felipeam86/followers","following_url":"https://api.github.com/users/felipeam86/following{/other_user}","gists_url":"https://api.github.com/users/felipeam86/gists{/gist_id}","starred_url":"https://api.github.com/users/felipeam86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felipeam86/subscriptions","organizations_url":"https://api.github.com/users/felipeam86/orgs","repos_url":"https://api.github.com/users/felipeam86/repos","events_url":"https://api.github.com/users/felipeam86/events{/privacy}","received_events_url":"https://api.github.com/users/felipeam86/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-06-24T08:54:03Z","updated_at":"2016-06-24T13:50:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openturns/openturns/pulls/266","html_url":"https://github.com/openturns/openturns/pull/266","diff_url":"https://github.com/openturns/openturns/pull/266.diff","patch_url":"https://github.com/openturns/openturns/pull/266.patch"},"body":"This pull request adds the optional argument `n_cpus` to PythonFunction. If it is set, it distributes `func` with multiprocessing on the number of cpus specified by `n_cpus`. If `n_cpus=-1`, it uses all the cores of the machine. if `n_cpus=1`, it does nothing. If `n_cpus` and `func_sample` are both given as arguments, `n_cpus` will be ignored and samples will be handled by `func_sample`.\r\n\r\nThis function is limited to distributing `func` calls on the machine you are working on. More advanced distribution techniques will be develloped for [otwrapy.Parallelizer](http://felipeam86.github.io/otwrapy/_generated/otwrapy.Parallelizer.html#otwrapy.Parallelizer)\r\n"},"comment":{"url":"https://api.github.com/repos/openturns/openturns/issues/comments/228350809","html_url":"https://github.com/openturns/openturns/pull/266#issuecomment-228350809","issue_url":"https://api.github.com/repos/openturns/openturns/issues/266","id":228350809,"user":{"login":"felipeam86","id":5644836,"avatar_url":"https://avatars.githubusercontent.com/u/5644836?v=3","gravatar_id":"","url":"https://api.github.com/users/felipeam86","html_url":"https://github.com/felipeam86","followers_url":"https://api.github.com/users/felipeam86/followers","following_url":"https://api.github.com/users/felipeam86/following{/other_user}","gists_url":"https://api.github.com/users/felipeam86/gists{/gist_id}","starred_url":"https://api.github.com/users/felipeam86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felipeam86/subscriptions","organizations_url":"https://api.github.com/users/felipeam86/orgs","repos_url":"https://api.github.com/users/felipeam86/repos","events_url":"https://api.github.com/users/felipeam86/events{/privacy}","received_events_url":"https://api.github.com/users/felipeam86/received_events","type":"User","site_admin":false},"created_at":"2016-06-24T13:50:45Z","updated_at":"2016-06-24T13:50:45Z","body":"Initially I thought about adding this functionality with multiprocessing to avoid imposing a dependency. But the thing is that I really think that `joblib` is worth the trouble ! My two main reasons are :\r\n\r\n- If an exception is raised, it prints the original traceback of what raised the exception (mulriprocessing does not do this)\r\n- It has a progress \"bar\" by default\r\n\r\nWhat do you think if we add joblib as the default backend, but optional. That is, if joblib is installed, it is used by default, otherwise func is distributed with multiprocessing. Take a look at this [commit](https://github.com/openturns/openturns/commit/556f7e9dbf699308387ff25147539530babb55a1) and let me know what you think"}}
{"actor":{"display_login":"felipeam86"}}