{"action":"created","issue":{"url":"https://api.github.com/repos/numbbo/coco/issues/707","repository_url":"https://api.github.com/repos/numbbo/coco","labels_url":"https://api.github.com/repos/numbbo/coco/issues/707/labels{/name}","comments_url":"https://api.github.com/repos/numbbo/coco/issues/707/comments","events_url":"https://api.github.com/repos/numbbo/coco/issues/707/events","html_url":"https://github.com/numbbo/coco/issues/707","id":136633017,"number":707,"title":"documentation: parallelization of the suite","user":{"login":"Ulfgard","id":15045382,"avatar_url":"https://avatars.githubusercontent.com/u/15045382?v=3","gravatar_id":"","url":"https://api.github.com/users/Ulfgard","html_url":"https://github.com/Ulfgard","followers_url":"https://api.github.com/users/Ulfgard/followers","following_url":"https://api.github.com/users/Ulfgard/following{/other_user}","gists_url":"https://api.github.com/users/Ulfgard/gists{/gist_id}","starred_url":"https://api.github.com/users/Ulfgard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ulfgard/subscriptions","organizations_url":"https://api.github.com/users/Ulfgard/orgs","repos_url":"https://api.github.com/users/Ulfgard/repos","events_url":"https://api.github.com/users/Ulfgard/events{/privacy}","received_events_url":"https://api.github.com/users/Ulfgard/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/numbbo/coco/labels/Documentation","name":"Documentation","color":"ff8000"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2016-02-26T08:52:50Z","updated_at":"2016-03-02T12:59:49Z","closed_at":null,"body":"Hi,\r\n\r\nI am wondering whether it is possible to parallelize the functions of the suite (e.g. going through each problem and starting a thread for each). This is because currently evaluation can take a long time and 94% of my cores are idle.\r\n\r\nI am looking at this simple loop:\r\n\r\n```C\r\ncoco_suite_t* suite = coco_suite(\"bbob-biobj\", \"year: 2016\", \"dimensions: 5\");\r\ncoco_observer_t* observer = coco_observer(\"bbob-biobj\", \"...\");\r\n\r\ncoco_problem_t* problem;\r\nwhile ((problem = coco_suite_get_next_problem(suite, observer)) != NULL) {\r\n    //this while loop should be run in parallel\r\n}\r\n```\r\n\r\nthe problem is, that this is not a \"nice\" loop for easy parallelization with OpenMP. for that a for loop over all problem numbers would be much easier.\r\n\r\nI am currently thinking about the following solution in C++:\r\n\r\n```C++\r\n//first query all problems\r\nstd::vector<coco_problem_t*> problems;\r\ncoco_problem_t* problem;\r\nwhile ((problem = coco_suite_get_next_problem(suite, observer)) != NULL) {\r\n    problems.push_back(problem);\r\n}\r\n//run them in parallel\r\nPARALLEL_FOR(std::size_t i = 0; problems.size(); ++i){\r\n    //...\r\n}\r\n```\r\n\r\nBut the documentation does not state whether the observer is thread safe, whether several independent observers are possible or whether the problem instances actually exist after the next call of of coco_suite_get_next_problem.\r\n"},"comment":{"url":"https://api.github.com/repos/numbbo/coco/issues/comments/191229863","html_url":"https://github.com/numbbo/coco/issues/707#issuecomment-191229863","issue_url":"https://api.github.com/repos/numbbo/coco/issues/707","id":191229863,"user":{"login":"ttusar","id":13745935,"avatar_url":"https://avatars.githubusercontent.com/u/13745935?v=3","gravatar_id":"","url":"https://api.github.com/users/ttusar","html_url":"https://github.com/ttusar","followers_url":"https://api.github.com/users/ttusar/followers","following_url":"https://api.github.com/users/ttusar/following{/other_user}","gists_url":"https://api.github.com/users/ttusar/gists{/gist_id}","starred_url":"https://api.github.com/users/ttusar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttusar/subscriptions","organizations_url":"https://api.github.com/users/ttusar/orgs","repos_url":"https://api.github.com/users/ttusar/repos","events_url":"https://api.github.com/users/ttusar/events{/privacy}","received_events_url":"https://api.github.com/users/ttusar/received_events","type":"User","site_admin":false},"created_at":"2016-03-02T12:59:49Z","updated_at":"2016-03-02T12:59:49Z","body":"I was assuming that parallelization of the experiments would be done by splitting the suite using `suite_options` rather than the code above, which is using a poorly tested approach. I would guess the problems that you describe stem from this. If you are able to share your code snippet, I can try to reproduce the problem and find a fix for it. "}}