{"action":"created","comment":{"url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/pulls/comments/209762721","pull_request_review_id":145833648,"id":209762721,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTc2MjcyMQ==","diff_hunk":"@@ -0,0 +1,219 @@\n+//  Copyright (c) 2018 Gabriel Laberge\n+//\n+#include <stdlib.h>\n+#include<ctime>\n+#include <vector>\n+#include<fstream>\n+#include <hpx/hpx_init.hpp>\n+#include <hpx/parallel/algorithms/for_each.hpp>\n+#include <hpx/util/high_resolution_timer.hpp>\n+#include <boost/range/irange.hpp>\n+#include <vector>\n+#include <initializer_list>\n+#include <algorithm>\n+#include <typeinfo>\n+#include <iterator>\n+#include <hpx/parallel/executors/dynamic_chunk_size.hpp>\n+\n+double mysecond()\n+{\n+    return hpx::util::high_resolution_clock::now() * 1e-9;\n+}\n+\n+double random_double(double min,double max){\n+    return (min+1)+(((double) rand())/(double) RAND_MAX)*(max-(min+1));\n+}\n+\n+template<typename T>\n+void vector_generator(std::vector<T> &A,int size,double min,double max){\n+    for(std::size_t r = 0; r < size; r++) {\n+        A.push_back(random_double(min,max));\n+    }\n+}\n+\n+double Mean(std::vector<double> times){\n+    double mean=0;\n+    for(int i(0);i<times.size();i++){\n+        mean+=times[i];\n+    }\n+    return mean/times.size();\n+}\n+\n+double Var(std::vector<double> times){\n+    double mean=Mean(times);\n+    double var=0;\n+    for(int i(0);i<times.size();i++){\n+        var+=std::pow(times[i]-mean,2);\n+    }\n+    return var/(times.size()-1);\n+}\n+\n+void Nothing(int iterations,double chunk_candidate) {\n+    \n+    int vector_size=iterations;\n+    \n+    auto f=[&](int i){\n+    };\n+ \n+\n+    auto time_range = boost::irange(0, vector_size);\n+    double t_chunk=0.0;\n+    double Nrep=10;\n+    double mean_time;\n+    double elapsed_time;\n+    std::vector<double> times(Nrep);\n+    mean_time=0;\n+    for(int j(0);j<Nrep+1;j++){\n+        if(chunk_candidate*vector_size>1){\n+            t_chunk=mysecond();\n+            hpx::parallel::for_each(hpx::parallel::execution::par.with(hpx::parallel::execution::dynamic_chunk_size(vector_size*chunk_candidate)), time_range.begin(), time_range.end(), f);\n+            elapsed_time= mysecond() - t_chunk;\n+\t}\n+        else{\n+\t    t_chunk=mysecond();\n+            hpx::parallel::for_each(hpx::parallel::execution::par.with(hpx::parallel::execution::dynamic_chunk_size(1)), time_range.begin(), time_range.end(), f);\n+            elapsed_time= mysecond() - t_chunk;\n+\t}\n+\tif(j!=0){\n+\t    times[j-1]=elapsed_time;\n+ \t}\n+    }\n+    std::cout<<Mean(times)<<\",\"<<Var(times)<<std::endl;\n+ \n+}\n+\n+   \n+\n+/////////////////////////////////////////////////////////////////////////////////////////////////\n+void Swap(int iterations,float chunk_candidate) {\n+    \n+    int vector_size=iterations;\n+    std::vector<double> A;\n+    std::vector<double> B;\n+    vector_generator(A,vector_size,10,100);\n+    vector_generator(B,vector_size,10,100);\n+\n+    \n+    auto f=[&](int i){","path":"Time_measurement/headers/1_loop_level.h","position":97,"original_position":97,"commit_id":"4373af38b67a1bc82d0605b070cb3f0f91094d97","original_commit_id":"4373af38b67a1bc82d0605b070cb3f0f91094d97","user":{"login":"mcopik","id":720619,"node_id":"MDQ6VXNlcjcyMDYxOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/720619?v=4","gravatar_id":"","url":"https://api.github.com/users/mcopik","html_url":"https://github.com/mcopik","followers_url":"https://api.github.com/users/mcopik/followers","following_url":"https://api.github.com/users/mcopik/following{/other_user}","gists_url":"https://api.github.com/users/mcopik/gists{/gist_id}","starred_url":"https://api.github.com/users/mcopik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcopik/subscriptions","organizations_url":"https://api.github.com/users/mcopik/orgs","repos_url":"https://api.github.com/users/mcopik/repos","events_url":"https://api.github.com/users/mcopik/events{/privacy}","received_events_url":"https://api.github.com/users/mcopik/received_events","type":"User","site_admin":false},"body":"You could use [std::swap](https://en.cppreference.com/w/cpp/algorithm/swap) inside this function.","created_at":"2018-08-13T21:18:29Z","updated_at":"2018-08-13T21:34:41Z","html_url":"https://github.com/STEllAR-GROUP/hpxML/pull/2#discussion_r209762721","pull_request_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/pulls/2","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpxML/pulls/comments/209762721"},"html":{"href":"https://github.com/STEllAR-GROUP/hpxML/pull/2#discussion_r209762721"},"pull_request":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpxML/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/pulls/2","id":207847424,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3ODQ3NDI0","html_url":"https://github.com/STEllAR-GROUP/hpxML/pull/2","diff_url":"https://github.com/STEllAR-GROUP/hpxML/pull/2.diff","patch_url":"https://github.com/STEllAR-GROUP/hpxML/pull/2.patch","issue_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/issues/2","number":2,"state":"open","locked":false,"title":"GSoC submission","user":{"login":"gablabc","id":32692864,"node_id":"MDQ6VXNlcjMyNjkyODY0","avatar_url":"https://avatars2.githubusercontent.com/u/32692864?v=4","gravatar_id":"","url":"https://api.github.com/users/gablabc","html_url":"https://github.com/gablabc","followers_url":"https://api.github.com/users/gablabc/followers","following_url":"https://api.github.com/users/gablabc/following{/other_user}","gists_url":"https://api.github.com/users/gablabc/gists{/gist_id}","starred_url":"https://api.github.com/users/gablabc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gablabc/subscriptions","organizations_url":"https://api.github.com/users/gablabc/orgs","repos_url":"https://api.github.com/users/gablabc/repos","events_url":"https://api.github.com/users/gablabc/events{/privacy}","received_events_url":"https://api.github.com/users/gablabc/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-13T00:00:25Z","updated_at":"2018-08-13T21:34:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33753b0482e26ded7cc0d431398ebbfa79bfae7d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/pulls/2/commits","review_comments_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/pulls/2/comments","review_comment_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/pulls/comments{/number}","comments_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/issues/2/comments","statuses_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/statuses/4373af38b67a1bc82d0605b070cb3f0f91094d97","head":{"label":"gablabc:submodules","ref":"submodules","sha":"4373af38b67a1bc82d0605b070cb3f0f91094d97","user":{"login":"gablabc","id":32692864,"node_id":"MDQ6VXNlcjMyNjkyODY0","avatar_url":"https://avatars2.githubusercontent.com/u/32692864?v=4","gravatar_id":"","url":"https://api.github.com/users/gablabc","html_url":"https://github.com/gablabc","followers_url":"https://api.github.com/users/gablabc/followers","following_url":"https://api.github.com/users/gablabc/following{/other_user}","gists_url":"https://api.github.com/users/gablabc/gists{/gist_id}","starred_url":"https://api.github.com/users/gablabc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gablabc/subscriptions","organizations_url":"https://api.github.com/users/gablabc/orgs","repos_url":"https://api.github.com/users/gablabc/repos","events_url":"https://api.github.com/users/gablabc/events{/privacy}","received_events_url":"https://api.github.com/users/gablabc/received_events","type":"User","site_admin":false},"repo":{"id":134813596,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQ4MTM1OTY=","name":"hpxML","full_name":"gablabc/hpxML","owner":{"login":"gablabc","id":32692864,"node_id":"MDQ6VXNlcjMyNjkyODY0","avatar_url":"https://avatars2.githubusercontent.com/u/32692864?v=4","gravatar_id":"","url":"https://api.github.com/users/gablabc","html_url":"https://github.com/gablabc","followers_url":"https://api.github.com/users/gablabc/followers","following_url":"https://api.github.com/users/gablabc/following{/other_user}","gists_url":"https://api.github.com/users/gablabc/gists{/gist_id}","starred_url":"https://api.github.com/users/gablabc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gablabc/subscriptions","organizations_url":"https://api.github.com/users/gablabc/orgs","repos_url":"https://api.github.com/users/gablabc/repos","events_url":"https://api.github.com/users/gablabc/events{/privacy}","received_events_url":"https://api.github.com/users/gablabc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gablabc/hpxML","description":"Research Repository for Machine Learning Algorithms","fork":true,"url":"https://api.github.com/repos/gablabc/hpxML","forks_url":"https://api.github.com/repos/gablabc/hpxML/forks","keys_url":"https://api.github.com/repos/gablabc/hpxML/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gablabc/hpxML/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gablabc/hpxML/teams","hooks_url":"https://api.github.com/repos/gablabc/hpxML/hooks","issue_events_url":"https://api.github.com/repos/gablabc/hpxML/issues/events{/number}","events_url":"https://api.github.com/repos/gablabc/hpxML/events","assignees_url":"https://api.github.com/repos/gablabc/hpxML/assignees{/user}","branches_url":"https://api.github.com/repos/gablabc/hpxML/branches{/branch}","tags_url":"https://api.github.com/repos/gablabc/hpxML/tags","blobs_url":"https://api.github.com/repos/gablabc/hpxML/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gablabc/hpxML/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gablabc/hpxML/git/refs{/sha}","trees_url":"https://api.github.com/repos/gablabc/hpxML/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gablabc/hpxML/statuses/{sha}","languages_url":"https://api.github.com/repos/gablabc/hpxML/languages","stargazers_url":"https://api.github.com/repos/gablabc/hpxML/stargazers","contributors_url":"https://api.github.com/repos/gablabc/hpxML/contributors","subscribers_url":"https://api.github.com/repos/gablabc/hpxML/subscribers","subscription_url":"https://api.github.com/repos/gablabc/hpxML/subscription","commits_url":"https://api.github.com/repos/gablabc/hpxML/commits{/sha}","git_commits_url":"https://api.github.com/repos/gablabc/hpxML/git/commits{/sha}","comments_url":"https://api.github.com/repos/gablabc/hpxML/comments{/number}","issue_comment_url":"https://api.github.com/repos/gablabc/hpxML/issues/comments{/number}","contents_url":"https://api.github.com/repos/gablabc/hpxML/contents/{+path}","compare_url":"https://api.github.com/repos/gablabc/hpxML/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gablabc/hpxML/merges","archive_url":"https://api.github.com/repos/gablabc/hpxML/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gablabc/hpxML/downloads","issues_url":"https://api.github.com/repos/gablabc/hpxML/issues{/number}","pulls_url":"https://api.github.com/repos/gablabc/hpxML/pulls{/number}","milestones_url":"https://api.github.com/repos/gablabc/hpxML/milestones{/number}","notifications_url":"https://api.github.com/repos/gablabc/hpxML/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gablabc/hpxML/labels{/name}","releases_url":"https://api.github.com/repos/gablabc/hpxML/releases{/id}","deployments_url":"https://api.github.com/repos/gablabc/hpxML/deployments","created_at":"2018-05-25T06:33:50Z","updated_at":"2018-05-25T06:34:01Z","pushed_at":"2018-08-13T19:40:50Z","git_url":"git://github.com/gablabc/hpxML.git","ssh_url":"git@github.com:gablabc/hpxML.git","clone_url":"https://github.com/gablabc/hpxML.git","svn_url":"https://github.com/gablabc/hpxML","homepage":null,"size":157999,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsl-1.0","name":"Boost Software License 1.0","spdx_id":"BSL-1.0","url":"https://api.github.com/licenses/bsl-1.0","node_id":"MDc6TGljZW5zZTI4"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"STEllAR-GROUP:submodules","ref":"submodules","sha":"b515dd3ee106233d0d4116fa9f5de03990a73e06","user":{"login":"STEllAR-GROUP","id":1780988,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3ODA5ODg=","avatar_url":"https://avatars1.githubusercontent.com/u/1780988?v=4","gravatar_id":"","url":"https://api.github.com/users/STEllAR-GROUP","html_url":"https://github.com/STEllAR-GROUP","followers_url":"https://api.github.com/users/STEllAR-GROUP/followers","following_url":"https://api.github.com/users/STEllAR-GROUP/following{/other_user}","gists_url":"https://api.github.com/users/STEllAR-GROUP/gists{/gist_id}","starred_url":"https://api.github.com/users/STEllAR-GROUP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/STEllAR-GROUP/subscriptions","organizations_url":"https://api.github.com/users/STEllAR-GROUP/orgs","repos_url":"https://api.github.com/users/STEllAR-GROUP/repos","events_url":"https://api.github.com/users/STEllAR-GROUP/events{/privacy}","received_events_url":"https://api.github.com/users/STEllAR-GROUP/received_events","type":"Organization","site_admin":false},"repo":{"id":79494015,"node_id":"MDEwOlJlcG9zaXRvcnk3OTQ5NDAxNQ==","name":"hpxML","full_name":"STEllAR-GROUP/hpxML","owner":{"login":"STEllAR-GROUP","id":1780988,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3ODA5ODg=","avatar_url":"https://avatars1.githubusercontent.com/u/1780988?v=4","gravatar_id":"","url":"https://api.github.com/users/STEllAR-GROUP","html_url":"https://github.com/STEllAR-GROUP","followers_url":"https://api.github.com/users/STEllAR-GROUP/followers","following_url":"https://api.github.com/users/STEllAR-GROUP/following{/other_user}","gists_url":"https://api.github.com/users/STEllAR-GROUP/gists{/gist_id}","starred_url":"https://api.github.com/users/STEllAR-GROUP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/STEllAR-GROUP/subscriptions","organizations_url":"https://api.github.com/users/STEllAR-GROUP/orgs","repos_url":"https://api.github.com/users/STEllAR-GROUP/repos","events_url":"https://api.github.com/users/STEllAR-GROUP/events{/privacy}","received_events_url":"https://api.github.com/users/STEllAR-GROUP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/STEllAR-GROUP/hpxML","description":"Research Repository for Machine Learning Algorithms","fork":false,"url":"https://api.github.com/repos/STEllAR-GROUP/hpxML","forks_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/forks","keys_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/keys{/key_id}","collaborators_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/teams","hooks_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/hooks","issue_events_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/issues/events{/number}","events_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/events","assignees_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/assignees{/user}","branches_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/branches{/branch}","tags_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/tags","blobs_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/git/refs{/sha}","trees_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/git/trees{/sha}","statuses_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/statuses/{sha}","languages_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/languages","stargazers_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/stargazers","contributors_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/contributors","subscribers_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/subscribers","subscription_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/subscription","commits_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/commits{/sha}","git_commits_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/git/commits{/sha}","comments_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/comments{/number}","issue_comment_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/issues/comments{/number}","contents_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/contents/{+path}","compare_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/compare/{base}...{head}","merges_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/merges","archive_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/downloads","issues_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/issues{/number}","pulls_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/pulls{/number}","milestones_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/milestones{/number}","notifications_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/labels{/name}","releases_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/releases{/id}","deployments_url":"https://api.github.com/repos/STEllAR-GROUP/hpxML/deployments","created_at":"2017-01-19T20:52:58Z","updated_at":"2018-05-19T11:28:54Z","pushed_at":"2018-08-13T19:40:52Z","git_url":"git://github.com/STEllAR-GROUP/hpxML.git","ssh_url":"git@github.com:STEllAR-GROUP/hpxML.git","clone_url":"https://github.com/STEllAR-GROUP/hpxML.git","svn_url":"https://github.com/STEllAR-GROUP/hpxML","homepage":null,"size":154723,"stargazers_count":3,"watchers_count":3,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"bsl-1.0","name":"Boost Software License 1.0","spdx_id":"BSL-1.0","url":"https://api.github.com/licenses/bsl-1.0","node_id":"MDc6TGljZW5zZTI4"},"forks":1,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpxML/pulls/2"},"html":{"href":"https://github.com/STEllAR-GROUP/hpxML/pull/2"},"issue":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpxML/issues/2"},"comments":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpxML/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpxML/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpxML/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpxML/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpxML/statuses/4373af38b67a1bc82d0605b070cb3f0f91094d97"}},"author_association":"NONE"}}
{"actor":{"display_login":"mcopik"}}