{"action":"created","issue":{"url":"https://api.github.com/repos/deeptools/pyBigWig/issues/69","repository_url":"https://api.github.com/repos/deeptools/pyBigWig","labels_url":"https://api.github.com/repos/deeptools/pyBigWig/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/deeptools/pyBigWig/issues/69/comments","events_url":"https://api.github.com/repos/deeptools/pyBigWig/issues/69/events","html_url":"https://github.com/deeptools/pyBigWig/issues/69","id":363729579,"node_id":"MDU6SXNzdWUzNjM3Mjk1Nzk=","number":69,"title":"pyBigWig using 30+ cores","user":{"login":"goodez","id":29620914,"node_id":"MDQ6VXNlcjI5NjIwOTE0","avatar_url":"https://avatars1.githubusercontent.com/u/29620914?v=4","gravatar_id":"","url":"https://api.github.com/users/goodez","html_url":"https://github.com/goodez","followers_url":"https://api.github.com/users/goodez/followers","following_url":"https://api.github.com/users/goodez/following{/other_user}","gists_url":"https://api.github.com/users/goodez/gists{/gist_id}","starred_url":"https://api.github.com/users/goodez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goodez/subscriptions","organizations_url":"https://api.github.com/users/goodez/orgs","repos_url":"https://api.github.com/users/goodez/repos","events_url":"https://api.github.com/users/goodez/events{/privacy}","received_events_url":"https://api.github.com/users/goodez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-25T19:21:12Z","updated_at":"2018-09-25T19:33:10Z","closed_at":null,"author_association":"NONE","body":"Is there any way to limit the number of cores used? I am using pyBigWig within a very simple python script that should not need 30+ cores. Or perhaps there is a UNIX trick I can use when launching my script to use less cores? The script is single-threaded, but I believe pyBigWig is using the extra cores."},"comment":{"url":"https://api.github.com/repos/deeptools/pyBigWig/issues/comments/424472439","html_url":"https://github.com/deeptools/pyBigWig/issues/69#issuecomment-424472439","issue_url":"https://api.github.com/repos/deeptools/pyBigWig/issues/69","id":424472439,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDQ3MjQzOQ==","user":{"login":"dpryan79","id":6399000,"node_id":"MDQ6VXNlcjYzOTkwMDA=","avatar_url":"https://avatars3.githubusercontent.com/u/6399000?v=4","gravatar_id":"","url":"https://api.github.com/users/dpryan79","html_url":"https://github.com/dpryan79","followers_url":"https://api.github.com/users/dpryan79/followers","following_url":"https://api.github.com/users/dpryan79/following{/other_user}","gists_url":"https://api.github.com/users/dpryan79/gists{/gist_id}","starred_url":"https://api.github.com/users/dpryan79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpryan79/subscriptions","organizations_url":"https://api.github.com/users/dpryan79/orgs","repos_url":"https://api.github.com/users/dpryan79/repos","events_url":"https://api.github.com/users/dpryan79/events{/privacy}","received_events_url":"https://api.github.com/users/dpryan79/received_events","type":"User","site_admin":false},"created_at":"2018-09-25T19:33:10Z","updated_at":"2018-09-25T19:33:10Z","author_association":"COLLABORATOR","body":"It's quite likely that numpy is causing this, particularly if you've installed it via conda. At the beginning of your script, try adding the following:\r\n\r\n```\r\nimport os\r\n\r\n# This should force numpy to run single threaded. See issue #697\r\n# This module MUST be imported before numpy\r\n# Note that these environment variables are internal to deepTools (they won't exist on the shell after the command completes)\r\nif 'MKL_NUM_THREADS' not in os.environ:\r\n    os.environ['MKL_NUM_THREADS'] = 'sequential'\r\nif 'NUMEXPR_NUM_THREADS' not in os.environ:\r\n    os.environ['NUMEXPR_NUM_THREADS'] = '1'\r\nif 'OMP_NUM_THREADS' not in os.environ:\r\n    os.environ['OMP_NUM_THREADS'] = '1'\r\nif 'VECLIB_MAXIMUM_THREADS' not in os.environ:\r\n    os.environ['VECLIB_MAXIMUM_THREADS'] = '1\r\n```\r\n\r\nI've placed that code at the very beginning of all the deepTools executables to prevent similar issues with numpy."}}
{"actor":{"display_login":"dpryan79"}}