{"action":"created","issue":{"url":"https://api.github.com/repos/fbpic/fbpic/issues/19","repository_url":"https://api.github.com/repos/fbpic/fbpic","labels_url":"https://api.github.com/repos/fbpic/fbpic/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/fbpic/fbpic/issues/19/comments","events_url":"https://api.github.com/repos/fbpic/fbpic/issues/19/events","html_url":"https://github.com/fbpic/fbpic/issues/19","id":188616855,"number":19,"title":"Higher order particle shape factors","user":{"login":"MKirchen","id":7448619,"avatar_url":"https://avatars.githubusercontent.com/u/7448619?v=3","gravatar_id":"","url":"https://api.github.com/users/MKirchen","html_url":"https://github.com/MKirchen","followers_url":"https://api.github.com/users/MKirchen/followers","following_url":"https://api.github.com/users/MKirchen/following{/other_user}","gists_url":"https://api.github.com/users/MKirchen/gists{/gist_id}","starred_url":"https://api.github.com/users/MKirchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MKirchen/subscriptions","organizations_url":"https://api.github.com/users/MKirchen/orgs","repos_url":"https://api.github.com/users/MKirchen/repos","events_url":"https://api.github.com/users/MKirchen/events{/privacy}","received_events_url":"https://api.github.com/users/MKirchen/received_events","type":"User","site_admin":false},"labels":[{"id":449620979,"url":"https://api.github.com/repos/fbpic/fbpic/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":470837318,"url":"https://api.github.com/repos/fbpic/fbpic/labels/gpu","name":"gpu","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":{"login":"Escapado","id":5439360,"avatar_url":"https://avatars.githubusercontent.com/u/5439360?v=3","gravatar_id":"","url":"https://api.github.com/users/Escapado","html_url":"https://github.com/Escapado","followers_url":"https://api.github.com/users/Escapado/followers","following_url":"https://api.github.com/users/Escapado/following{/other_user}","gists_url":"https://api.github.com/users/Escapado/gists{/gist_id}","starred_url":"https://api.github.com/users/Escapado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Escapado/subscriptions","organizations_url":"https://api.github.com/users/Escapado/orgs","repos_url":"https://api.github.com/users/Escapado/repos","events_url":"https://api.github.com/users/Escapado/events{/privacy}","received_events_url":"https://api.github.com/users/Escapado/received_events","type":"User","site_admin":false},"assignees":[{"login":"Escapado","id":5439360,"avatar_url":"https://avatars.githubusercontent.com/u/5439360?v=3","gravatar_id":"","url":"https://api.github.com/users/Escapado","html_url":"https://github.com/Escapado","followers_url":"https://api.github.com/users/Escapado/followers","following_url":"https://api.github.com/users/Escapado/following{/other_user}","gists_url":"https://api.github.com/users/Escapado/gists{/gist_id}","starred_url":"https://api.github.com/users/Escapado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Escapado/subscriptions","organizations_url":"https://api.github.com/users/Escapado/orgs","repos_url":"https://api.github.com/users/Escapado/repos","events_url":"https://api.github.com/users/Escapado/events{/privacy}","received_events_url":"https://api.github.com/users/Escapado/received_events","type":"User","site_admin":false},{"login":"MKirchen","id":7448619,"avatar_url":"https://avatars.githubusercontent.com/u/7448619?v=3","gravatar_id":"","url":"https://api.github.com/users/MKirchen","html_url":"https://github.com/MKirchen","followers_url":"https://api.github.com/users/MKirchen/followers","following_url":"https://api.github.com/users/MKirchen/following{/other_user}","gists_url":"https://api.github.com/users/MKirchen/gists{/gist_id}","starred_url":"https://api.github.com/users/MKirchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MKirchen/subscriptions","organizations_url":"https://api.github.com/users/MKirchen/orgs","repos_url":"https://api.github.com/users/MKirchen/repos","events_url":"https://api.github.com/users/MKirchen/events{/privacy}","received_events_url":"https://api.github.com/users/MKirchen/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/fbpic/fbpic/milestones/2","html_url":"https://github.com/fbpic/fbpic/milestones/Future","labels_url":"https://api.github.com/repos/fbpic/fbpic/milestones/2/labels","id":2127505,"number":2,"title":"Future","description":"","creator":{"login":"RemiLehe","id":6685781,"avatar_url":"https://avatars.githubusercontent.com/u/6685781?v=3","gravatar_id":"","url":"https://api.github.com/users/RemiLehe","html_url":"https://github.com/RemiLehe","followers_url":"https://api.github.com/users/RemiLehe/followers","following_url":"https://api.github.com/users/RemiLehe/following{/other_user}","gists_url":"https://api.github.com/users/RemiLehe/gists{/gist_id}","starred_url":"https://api.github.com/users/RemiLehe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RemiLehe/subscriptions","organizations_url":"https://api.github.com/users/RemiLehe/orgs","repos_url":"https://api.github.com/users/RemiLehe/repos","events_url":"https://api.github.com/users/RemiLehe/events{/privacy}","received_events_url":"https://api.github.com/users/RemiLehe/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":1,"state":"open","created_at":"2016-11-10T16:30:30Z","updated_at":"2016-11-17T17:03:21Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-11-10T20:59:15Z","updated_at":"2016-11-29T17:13:00Z","closed_at":null,"body":"@Escapado and me did several implementation of the charge and current deposition for linear and higher order (mainly cubic) shape factors. We benchmarked the different implementations and it was not easy to beat the original implementation of the deposition in terms of speed. (Actually, I was quite surprised that the original implementation is really fast compared to all other possible implementations we tried).\r\n\r\nIn summary, we developed a new implementation that relies on both, looping over the sorted particles and atomically adding the summed local arrays to the global grid array. Thereby, we can remove the add_J and add_rho kernels. Also, the implementation can be done in a nice way with cuda thread local arrays and for loops. However, thread-local arrays are stored in global memory  instead of registers, which makes this implementation 2 times slower than the original implementation. \r\n\r\nWe solved this performance issue by explicitly unrolling the for loops and storing the different values directly to the registers. By this, we now have the same performance as with the original implementation, however, the code is again very long and does not look nice (however, performance is more important in that case!).\r\n\r\nFurthermore we made two decision:\r\n\r\n- The new implementation is restricted to work either with linear shapes or with cubic shapes in both dimensions (I think this restrictions is \"okay\" as we don't really need quadratic shapes and also it should be fine to have always the same shape factors in both dimensions)\r\n\r\n- We decided to keep the original implementation (without atomic adds) in order to be able to compare  the different implementations with more use cases in the future. (This is up to discussion)\r\n\r\n@RemiLehe Any thoughts on this?"},"comment":{"url":"https://api.github.com/repos/fbpic/fbpic/issues/comments/263634300","html_url":"https://github.com/fbpic/fbpic/issues/19#issuecomment-263634300","issue_url":"https://api.github.com/repos/fbpic/fbpic/issues/19","id":263634300,"user":{"login":"RemiLehe","id":6685781,"avatar_url":"https://avatars.githubusercontent.com/u/6685781?v=3","gravatar_id":"","url":"https://api.github.com/users/RemiLehe","html_url":"https://github.com/RemiLehe","followers_url":"https://api.github.com/users/RemiLehe/followers","following_url":"https://api.github.com/users/RemiLehe/following{/other_user}","gists_url":"https://api.github.com/users/RemiLehe/gists{/gist_id}","starred_url":"https://api.github.com/users/RemiLehe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RemiLehe/subscriptions","organizations_url":"https://api.github.com/users/RemiLehe/orgs","repos_url":"https://api.github.com/users/RemiLehe/repos","events_url":"https://api.github.com/users/RemiLehe/events{/privacy}","received_events_url":"https://api.github.com/users/RemiLehe/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T17:13:00Z","updated_at":"2016-11-29T17:13:00Z","body":"Great! Thanks a lot for the implementation, and for your careful performance optimization! \r\nThe new kernel looks great, and is very readable. \r\n\r\nOne very minor remark: would you mind renaming the kernel `gather_field_gpu` to `gather_field_gpu_linear` for clarity? "}}
{"actor":{"display_login":"RemiLehe"}}