{"action":"created","issue":{"url":"https://api.github.com/repos/joblib/joblib/issues/374","repository_url":"https://api.github.com/repos/joblib/joblib","labels_url":"https://api.github.com/repos/joblib/joblib/issues/374/labels{/name}","comments_url":"https://api.github.com/repos/joblib/joblib/issues/374/comments","events_url":"https://api.github.com/repos/joblib/joblib/issues/374/events","html_url":"https://github.com/joblib/joblib/issues/374","id":163014168,"number":374,"title":"Self Organizing Map (SOM) Package for Python (SOMPY) issue with njob > 1","user":{"login":"jiperez91","id":18615862,"avatar_url":"https://avatars.githubusercontent.com/u/18615862?v=3","gravatar_id":"","url":"https://api.github.com/users/jiperez91","html_url":"https://github.com/jiperez91","followers_url":"https://api.github.com/users/jiperez91/followers","following_url":"https://api.github.com/users/jiperez91/following{/other_user}","gists_url":"https://api.github.com/users/jiperez91/gists{/gist_id}","starred_url":"https://api.github.com/users/jiperez91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiperez91/subscriptions","organizations_url":"https://api.github.com/users/jiperez91/orgs","repos_url":"https://api.github.com/users/jiperez91/repos","events_url":"https://api.github.com/users/jiperez91/events{/privacy}","received_events_url":"https://api.github.com/users/jiperez91/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-06-29T20:04:48Z","updated_at":"2016-06-30T14:21:36Z","closed_at":null,"body":"Hi everyone:\r\n\r\nI'm a student of Computer Engineering and I'm trying to use the Self Organizing Map (SOM) Package for Python (SOMPY). I want to speed up the algorithm (reducing the total time elapsed) and I see that in the code it uses Joblib. The train function has a parameter (njob) that I think it can help me. I have been studying the function and supposedly I have to put njob = 6 in order to use all the cores of my processor. The problem is when I call the train function with njob = 6, the algorithm is slower than with njob = 1. I've been reading this post http://stackoverflow.com/questions/21027477/joblib-parallel-multiple-cpus-slower-than-single but I still don't understand why.\r\n\r\nThis is the project: https://github.com/sevamoo/SOMPY\r\n\r\nI REALLY need this algorithm to run faster.\r\n\r\nI will be really grateful if you can help me with this problem.\r\n\r\nThank you for your time."},"comment":{"url":"https://api.github.com/repos/joblib/joblib/issues/comments/229673086","html_url":"https://github.com/joblib/joblib/issues/374#issuecomment-229673086","issue_url":"https://api.github.com/repos/joblib/joblib/issues/374","id":229673086,"user":{"login":"jiperez91","id":18615862,"avatar_url":"https://avatars.githubusercontent.com/u/18615862?v=3","gravatar_id":"","url":"https://api.github.com/users/jiperez91","html_url":"https://github.com/jiperez91","followers_url":"https://api.github.com/users/jiperez91/followers","following_url":"https://api.github.com/users/jiperez91/following{/other_user}","gists_url":"https://api.github.com/users/jiperez91/gists{/gist_id}","starred_url":"https://api.github.com/users/jiperez91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiperez91/subscriptions","organizations_url":"https://api.github.com/users/jiperez91/orgs","repos_url":"https://api.github.com/users/jiperez91/repos","events_url":"https://api.github.com/users/jiperez91/events{/privacy}","received_events_url":"https://api.github.com/users/jiperez91/received_events","type":"User","site_admin":false},"created_at":"2016-06-30T14:21:36Z","updated_at":"2016-06-30T14:21:36Z","body":"Yes, I tried but they don't know either.\r\n\r\nLook this simple example (it calculates the square root of numbers between 0 and 1000):\r\n\r\n`\r\nfrom math import sqrt\r\nimport time\r\nfrom sklearn.externals.joblib import Parallel, delayed\r\n\r\nif __name__ == \"__main__\":\r\n    t_temp  = time.time()\r\n    Parallel(n_jobs=2)(delayed(sqrt)(i) for i in xrange(1000))\r\n    t_temp2 = time.time()\r\n    print(t_temp2-t_temp)\r\n`\r\n\r\nAgain, with njob > 1 is slower than njob = 1. So i don't understand how Joblib works."}}
{"actor":{"display_login":"jiperez91"}}