{"action":"created","issue":{"url":"https://api.github.com/repos/giordano/Cuba.jl/issues/10","repository_url":"https://api.github.com/repos/giordano/Cuba.jl","labels_url":"https://api.github.com/repos/giordano/Cuba.jl/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/giordano/Cuba.jl/issues/10/comments","events_url":"https://api.github.com/repos/giordano/Cuba.jl/issues/10/events","html_url":"https://github.com/giordano/Cuba.jl/issues/10","id":238157454,"number":10,"title":"`nvec` parameter not implemented?","user":{"login":"afniedermayer","id":1711351,"avatar_url":"https://avatars2.githubusercontent.com/u/1711351?v=3","gravatar_id":"","url":"https://api.github.com/users/afniedermayer","html_url":"https://github.com/afniedermayer","followers_url":"https://api.github.com/users/afniedermayer/followers","following_url":"https://api.github.com/users/afniedermayer/following{/other_user}","gists_url":"https://api.github.com/users/afniedermayer/gists{/gist_id}","starred_url":"https://api.github.com/users/afniedermayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afniedermayer/subscriptions","organizations_url":"https://api.github.com/users/afniedermayer/orgs","repos_url":"https://api.github.com/users/afniedermayer/repos","events_url":"https://api.github.com/users/afniedermayer/events{/privacy}","received_events_url":"https://api.github.com/users/afniedermayer/received_events","type":"User","site_admin":false},"labels":[{"id":352110268,"url":"https://api.github.com/repos/giordano/Cuba.jl/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":352110269,"url":"https://api.github.com/repos/giordano/Cuba.jl/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-06-23T14:23:20Z","updated_at":"2017-06-23T16:00:59Z","closed_at":null,"body":"I was trying to use the `nvec` parameter. (I think `nvec` could be used to implement parallelism, this is the way the Mathematica interface to cubalib implements parallelism.) However, I couldn't figure out how to do it. Looking at the code, it looks like the `nvec` parameter isn't passed to the integrand function:\r\nhttps://github.com/giordano/Cuba.jl/blob/master/src/Cuba.jl#L86\r\nand \r\nhttps://github.com/giordano/Cuba.jl/blob/master/src/Cuba.jl#L96\r\n"},"comment":{"url":"https://api.github.com/repos/giordano/Cuba.jl/issues/comments/310705160","html_url":"https://github.com/giordano/Cuba.jl/issues/10#issuecomment-310705160","issue_url":"https://api.github.com/repos/giordano/Cuba.jl/issues/10","id":310705160,"user":{"login":"giordano","id":765740,"avatar_url":"https://avatars3.githubusercontent.com/u/765740?v=3","gravatar_id":"","url":"https://api.github.com/users/giordano","html_url":"https://github.com/giordano","followers_url":"https://api.github.com/users/giordano/followers","following_url":"https://api.github.com/users/giordano/following{/other_user}","gists_url":"https://api.github.com/users/giordano/gists{/gist_id}","starred_url":"https://api.github.com/users/giordano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giordano/subscriptions","organizations_url":"https://api.github.com/users/giordano/orgs","repos_url":"https://api.github.com/users/giordano/repos","events_url":"https://api.github.com/users/giordano/events{/privacy}","received_events_url":"https://api.github.com/users/giordano/received_events","type":"User","site_admin":false},"created_at":"2017-06-23T16:00:59Z","updated_at":"2017-06-23T16:00:59Z","body":"Looking better to how the `x` and `f` arrays are treated when `nvec > 1`, probably I was using the wrong function calls:\r\n```julia\r\njulia> cuhre((x, f) -> f[1,:] = x[1,:], nvec = 1)\r\nComponent:\r\n 1: 0.5 ± 4.291960664289122e-15 (prob.: 0.0)\r\nIntegrand evaluations: 195\r\nFail:                  0\r\nNumber of subregions:  2\r\n\r\njulia> cuhre((x, f) -> f[1,:] = x[1,:], nvec = 2)\r\nComponent:\r\n 1: 0.5 ± 4.291960664289122e-15 (prob.: 0.0)\r\nIntegrand evaluations: 195\r\nFail:                  0\r\nNumber of subregions:  2\r\n\r\njulia> cuhre((x, f) -> f[1,:] = x[1,:], nvec = 4)\r\nComponent:\r\n 1: 0.5 ± 4.291960664289122e-15 (prob.: 0.0)\r\nIntegrand evaluations: 195\r\nFail:                  0\r\nNumber of subregions:  2\r\n```\r\nwhich now are indeed faster than `nvec = 1`:\r\n```julia\r\njulia> @benchmark cuhre((x, f) -> f[1,:] = x[1,:], nvec = 1)\r\nBenchmarkTools.Trial: \r\n  memory estimate:  67.52 KiB\r\n  allocs estimate:  1374\r\n  --------------\r\n  minimum time:     33.144 μs (0.00% GC)\r\n  median time:      35.663 μs (0.00% GC)\r\n  mean time:        48.058 μs (22.65% GC)\r\n  maximum time:     3.921 ms (98.52% GC)\r\n  --------------\r\n  samples:          10000\r\n  evals/sample:     1\r\n\r\njulia> @benchmark cuhre((x, f) -> f[1,:] = x[1,:], nvec = 2)\r\nBenchmarkTools.Trial: \r\n  memory estimate:  34.52 KiB\r\n  allocs estimate:  702\r\n  --------------\r\n  minimum time:     20.266 μs (0.00% GC)\r\n  median time:      21.898 μs (0.00% GC)\r\n  mean time:        28.492 μs (19.39% GC)\r\n  maximum time:     4.049 ms (98.82% GC)\r\n  --------------\r\n  samples:          10000\r\n  evals/sample:     1\r\n\r\njulia> @benchmark cuhre((x, f) -> f[1,:] = x[1,:], nvec = 4)\r\nBenchmarkTools.Trial: \r\n  memory estimate:  18.77 KiB\r\n  allocs estimate:  366\r\n  --------------\r\n  minimum time:     14.691 μs (0.00% GC)\r\n  median time:      15.964 μs (0.00% GC)\r\n  mean time:        19.161 μs (11.79% GC)\r\n  maximum time:     2.996 ms (98.78% GC)\r\n  --------------\r\n  samples:          10000\r\n  evals/sample:     1\r\n```"}}
{"actor":{"display_login":"giordano"}}