{"action":"opened","issue":{"url":"https://api.github.com/repos/carlosjoserg/gaussian-object-modelling/issues/6","labels_url":"https://api.github.com/repos/carlosjoserg/gaussian-object-modelling/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/carlosjoserg/gaussian-object-modelling/issues/6/comments","events_url":"https://api.github.com/repos/carlosjoserg/gaussian-object-modelling/issues/6/events","html_url":"https://github.com/carlosjoserg/gaussian-object-modelling/issues/6","id":122490877,"number":6,"title":"OpenMP fun","user":{"login":"Tabjones","id":1950251,"avatar_url":"https://avatars.githubusercontent.com/u/1950251?v=3","gravatar_id":"","url":"https://api.github.com/users/Tabjones","html_url":"https://github.com/Tabjones","followers_url":"https://api.github.com/users/Tabjones/followers","following_url":"https://api.github.com/users/Tabjones/following{/other_user}","gists_url":"https://api.github.com/users/Tabjones/gists{/gist_id}","starred_url":"https://api.github.com/users/Tabjones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tabjones/subscriptions","organizations_url":"https://api.github.com/users/Tabjones/orgs","repos_url":"https://api.github.com/users/Tabjones/repos","events_url":"https://api.github.com/users/Tabjones/events{/privacy}","received_events_url":"https://api.github.com/users/Tabjones/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/carlosjoserg/gaussian-object-modelling/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-16T12:08:12Z","updated_at":"2015-12-16T12:08:12Z","closed_at":null,"body":"I made some test with openMP, just for fun, the compute function measured is that of the node, so it does fancy stuff with point clouds and spheres also:\r\n\r\n* **test 0 - No openMP** :point_right:  execution time of compute: 785319551 nanoseconds.\r\n* **test 1 - Parallel for loops, let openMP auto collapse nested loop if it can** :point_right: execution time of compute: 660448013 nanoseconds.\r\n* **test 2 - Parallel for loops, but collapse nested loops manually** :point_right: execution time of compute: 664145588 nanoseconds.\r\n\r\nFor what is worth test1 seems the better, so directives to use are:\r\n```\r\n#pragma omp parallel for collapse(2)\r\nfor (...)\r\n{\r\n    for (...)\r\n    {\r\n    }\r\n//no code can be put here. if you do it only parallelize outer loop \r\n//(and you have to remove collapse(2))\r\n}\r\n```\r\n"}}