{"action":"closed","issue":{"url":"https://api.github.com/repos/ctmm-initiative/ctmm/issues/16","repository_url":"https://api.github.com/repos/ctmm-initiative/ctmm","labels_url":"https://api.github.com/repos/ctmm-initiative/ctmm/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/ctmm-initiative/ctmm/issues/16/comments","events_url":"https://api.github.com/repos/ctmm-initiative/ctmm/issues/16/events","html_url":"https://github.com/ctmm-initiative/ctmm/issues/16","id":288264209,"number":16,"title":"speed up overlap, integrate parallel to ctmm","user":{"login":"xhdong-umd","id":25039897,"avatar_url":"https://avatars0.githubusercontent.com/u/25039897?v=4","gravatar_id":"","url":"https://api.github.com/users/xhdong-umd","html_url":"https://github.com/xhdong-umd","followers_url":"https://api.github.com/users/xhdong-umd/followers","following_url":"https://api.github.com/users/xhdong-umd/following{/other_user}","gists_url":"https://api.github.com/users/xhdong-umd/gists{/gist_id}","starred_url":"https://api.github.com/users/xhdong-umd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xhdong-umd/subscriptions","organizations_url":"https://api.github.com/users/xhdong-umd/orgs","repos_url":"https://api.github.com/users/xhdong-umd/repos","events_url":"https://api.github.com/users/xhdong-umd/events{/privacy}","received_events_url":"https://api.github.com/users/xhdong-umd/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":20,"created_at":"2018-01-12T22:27:02Z","updated_at":"2018-02-08T15:37:05Z","closed_at":"2018-02-08T15:37:05Z","author_association":"CONTRIBUTOR","body":"@chfleming I tried to add parallel option for overlap since I thought it need to calculation many combinations of animal and they should be independent from each other.\r\n\r\nI added a branch `parallel_overlap`, made the calculation parallel by animal combinations. However I'm not seeing speed improvement with bigger data set and combinations. \r\n\r\nOnly after profiling the function I realized the major time consuming part is that overlap calculate the akde of telemetry objects. \r\n\r\nI'm wondering if the example in overlap help can be added with these lines, since user may just following the example and didn't realize sometimes they should use existing home range objects if available.\r\n\r\n```r\r\nAKDE <- akde(buffalo[1:2], CTMM = FITS)\r\n\r\n# AKDE overlap between these two buffalo\r\noverlap(AKDE,FITS)\r\n\r\n# or you can use telemetry object directly, \r\n# and overlap will calculate AKDE first automatically, \r\n# which can take some time so reusing existing AKDE is a good idea.\r\noverlap(buffalo[1:2],FITS)\r\n```\r\n\r\nSo the actual overlap calculation never take much time, and there is no need to parallelize it, right?\r\n\r\nThough I'm wondering if you want to integrate the generic parallel functions into ctmm. At least the often used `FITS <- lapply(1:2, function(i) ctmm.fit(buffalo[[i]],GUESS[[i]]) )` can be parallelized.\r\n\r\nI noticed the previously export `par_fit_tele` is actually using `ctmm.select`, not `ctmm.fit`. I renamed it into `par_try_models`, and wrote a new `par_fit_models` as the parallel version of `ctmm.fit`. Thus the line above can be written as `par_fit_models(buffalo[1:2])`.\r\n\r\nIf you feel it's useful to use parallel in more places inside ctmm, we can move the parallel functions into ctmm so it doesn't depend on ctmmweb, since the parallel functions only require `parallel` package."}}
{"actor":{"display_login":"xhdong-umd"}}