{"action":"created","comment":{"url":"https://api.github.com/repos/ORNL-CEES/Cap/pulls/comments/63046194","id":63046194,"diff_hunk":"@@ -0,0 +1,49 @@\n+/* Copyright (c) 2016, the Cap authors.\n+ *\n+ * This file is subject to the Modified BSD License and may not be distributed\n+ * without copyright and license information. Please refer to the file LICENSE\n+ * for the text and further information on this license.\n+ */\n+\n+#define BOOST_TEST_MODULE Timer\n+\n+#include \"main.cc\"\n+\n+#include <cap/timer.h>\n+#include <boost/test/unit_test.hpp>\n+#include <chrono>\n+#include <fstream>\n+#include <thread>\n+\n+namespace cap\n+{\n+BOOST_AUTO_TEST_CASE(test_timer)\n+{\n+  unsigned int const tolerance = 10;\n+  Timer timer(boost::mpi::communicator(), \"test\");\n+\n+  timer.start();\n+  std::this_thread::sleep_for(std::chrono::milliseconds(200));\n+  timer.stop();\n+  boost::chrono::process_cpu_clock::duration duration =\n+      timer.get_elapsed_time();\n+  boost::chrono::milliseconds ms =\n+      boost::chrono::duration_cast<boost::chrono::milliseconds>(duration);\n+  BOOST_TEST(std::abs(ms.count() - 200) < tolerance);\n+\n+  timer.start();\n+  std::this_thread::sleep_for(std::chrono::milliseconds(200));\n+  timer.stop();\n+  duration = timer.get_elapsed_time();\n+  ms = boost::chrono::duration_cast<boost::chrono::milliseconds>(duration);\n+  BOOST_TEST(std::abs(ms.count() - 400) < 2 * tolerance);\n+\n+  timer.reset();\n+  timer.start();\n+  std::this_thread::sleep_for(std::chrono::milliseconds(200));\n+  timer.stop();\n+  duration = timer.get_elapsed_time();\n+  ms = boost::chrono::duration_cast<boost::chrono::milliseconds>(duration);\n+  BOOST_TEST(std::abs(ms.count() - 200) < tolerance);\n+}\n+}","path":"cpp/test/test_timer.cc","position":49,"original_position":49,"commit_id":"84802cc9e29e630b6fb4460d1e89ddd0d10ccd03","original_commit_id":"84802cc9e29e630b6fb4460d1e89ddd0d10ccd03","user":{"login":"dalg24","id":296978,"avatar_url":"https://avatars.githubusercontent.com/u/296978?v=3","gravatar_id":"","url":"https://api.github.com/users/dalg24","html_url":"https://github.com/dalg24","followers_url":"https://api.github.com/users/dalg24/followers","following_url":"https://api.github.com/users/dalg24/following{/other_user}","gists_url":"https://api.github.com/users/dalg24/gists{/gist_id}","starred_url":"https://api.github.com/users/dalg24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dalg24/subscriptions","organizations_url":"https://api.github.com/users/dalg24/orgs","repos_url":"https://api.github.com/users/dalg24/repos","events_url":"https://api.github.com/users/dalg24/events{/privacy}","received_events_url":"https://api.github.com/users/dalg24/received_events","type":"User","site_admin":false},"body":"OK","created_at":"2016-05-12T15:55:50Z","updated_at":"2016-05-12T15:55:50Z","html_url":"https://github.com/ORNL-CEES/Cap/pull/154#discussion_r63046194","pull_request_url":"https://api.github.com/repos/ORNL-CEES/Cap/pulls/154","_links":{"self":{"href":"https://api.github.com/repos/ORNL-CEES/Cap/pulls/comments/63046194"},"html":{"href":"https://github.com/ORNL-CEES/Cap/pull/154#discussion_r63046194"},"pull_request":{"href":"https://api.github.com/repos/ORNL-CEES/Cap/pulls/154"}}},"pull_request":{"url":"https://api.github.com/repos/ORNL-CEES/Cap/pulls/154","id":69690749,"html_url":"https://github.com/ORNL-CEES/Cap/pull/154","diff_url":"https://github.com/ORNL-CEES/Cap/pull/154.diff","patch_url":"https://github.com/ORNL-CEES/Cap/pull/154.patch","issue_url":"https://api.github.com/repos/ORNL-CEES/Cap/issues/154","number":154,"state":"open","locked":false,"title":"Add timer and use ML","user":{"login":"Rombur","id":368538,"avatar_url":"https://avatars.githubusercontent.com/u/368538?v=3","gravatar_id":"","url":"https://api.github.com/users/Rombur","html_url":"https://github.com/Rombur","followers_url":"https://api.github.com/users/Rombur/followers","following_url":"https://api.github.com/users/Rombur/following{/other_user}","gists_url":"https://api.github.com/users/Rombur/gists{/gist_id}","starred_url":"https://api.github.com/users/Rombur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rombur/subscriptions","organizations_url":"https://api.github.com/users/Rombur/orgs","repos_url":"https://api.github.com/users/Rombur/repos","events_url":"https://api.github.com/users/Rombur/events{/privacy}","received_events_url":"https://api.github.com/users/Rombur/received_events","type":"User","site_admin":false},"body":"Add a timer class using boost and replace Block Jacobi by ML. This makes the code at least five times faster.","created_at":"2016-05-11T15:19:14Z","updated_at":"2016-05-12T15:55:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0070ea147ba28de619d87f129e74918f53ab7ad","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ORNL-CEES/Cap/pulls/154/commits","review_comments_url":"https://api.github.com/repos/ORNL-CEES/Cap/pulls/154/comments","review_comment_url":"https://api.github.com/repos/ORNL-CEES/Cap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ORNL-CEES/Cap/issues/154/comments","statuses_url":"https://api.github.com/repos/ORNL-CEES/Cap/statuses/84802cc9e29e630b6fb4460d1e89ddd0d10ccd03","head":{"label":"Rombur:scaling","ref":"scaling","sha":"84802cc9e29e630b6fb4460d1e89ddd0d10ccd03","user":{"login":"Rombur","id":368538,"avatar_url":"https://avatars.githubusercontent.com/u/368538?v=3","gravatar_id":"","url":"https://api.github.com/users/Rombur","html_url":"https://github.com/Rombur","followers_url":"https://api.github.com/users/Rombur/followers","following_url":"https://api.github.com/users/Rombur/following{/other_user}","gists_url":"https://api.github.com/users/Rombur/gists{/gist_id}","starred_url":"https://api.github.com/users/Rombur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rombur/subscriptions","organizations_url":"https://api.github.com/users/Rombur/orgs","repos_url":"https://api.github.com/users/Rombur/repos","events_url":"https://api.github.com/users/Rombur/events{/privacy}","received_events_url":"https://api.github.com/users/Rombur/received_events","type":"User","site_admin":false},"repo":{"id":50516122,"name":"Cap","full_name":"Rombur/Cap","owner":{"login":"Rombur","id":368538,"avatar_url":"https://avatars.githubusercontent.com/u/368538?v=3","gravatar_id":"","url":"https://api.github.com/users/Rombur","html_url":"https://github.com/Rombur","followers_url":"https://api.github.com/users/Rombur/followers","following_url":"https://api.github.com/users/Rombur/following{/other_user}","gists_url":"https://api.github.com/users/Rombur/gists{/gist_id}","starred_url":"https://api.github.com/users/Rombur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rombur/subscriptions","organizations_url":"https://api.github.com/users/Rombur/orgs","repos_url":"https://api.github.com/users/Rombur/repos","events_url":"https://api.github.com/users/Rombur/events{/privacy}","received_events_url":"https://api.github.com/users/Rombur/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Rombur/Cap","description":"A library for modeling energy storage devices.","fork":true,"url":"https://api.github.com/repos/Rombur/Cap","forks_url":"https://api.github.com/repos/Rombur/Cap/forks","keys_url":"https://api.github.com/repos/Rombur/Cap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Rombur/Cap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Rombur/Cap/teams","hooks_url":"https://api.github.com/repos/Rombur/Cap/hooks","issue_events_url":"https://api.github.com/repos/Rombur/Cap/issues/events{/number}","events_url":"https://api.github.com/repos/Rombur/Cap/events","assignees_url":"https://api.github.com/repos/Rombur/Cap/assignees{/user}","branches_url":"https://api.github.com/repos/Rombur/Cap/branches{/branch}","tags_url":"https://api.github.com/repos/Rombur/Cap/tags","blobs_url":"https://api.github.com/repos/Rombur/Cap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Rombur/Cap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Rombur/Cap/git/refs{/sha}","trees_url":"https://api.github.com/repos/Rombur/Cap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Rombur/Cap/statuses/{sha}","languages_url":"https://api.github.com/repos/Rombur/Cap/languages","stargazers_url":"https://api.github.com/repos/Rombur/Cap/stargazers","contributors_url":"https://api.github.com/repos/Rombur/Cap/contributors","subscribers_url":"https://api.github.com/repos/Rombur/Cap/subscribers","subscription_url":"https://api.github.com/repos/Rombur/Cap/subscription","commits_url":"https://api.github.com/repos/Rombur/Cap/commits{/sha}","git_commits_url":"https://api.github.com/repos/Rombur/Cap/git/commits{/sha}","comments_url":"https://api.github.com/repos/Rombur/Cap/comments{/number}","issue_comment_url":"https://api.github.com/repos/Rombur/Cap/issues/comments{/number}","contents_url":"https://api.github.com/repos/Rombur/Cap/contents/{+path}","compare_url":"https://api.github.com/repos/Rombur/Cap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Rombur/Cap/merges","archive_url":"https://api.github.com/repos/Rombur/Cap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Rombur/Cap/downloads","issues_url":"https://api.github.com/repos/Rombur/Cap/issues{/number}","pulls_url":"https://api.github.com/repos/Rombur/Cap/pulls{/number}","milestones_url":"https://api.github.com/repos/Rombur/Cap/milestones{/number}","notifications_url":"https://api.github.com/repos/Rombur/Cap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Rombur/Cap/labels{/name}","releases_url":"https://api.github.com/repos/Rombur/Cap/releases{/id}","deployments_url":"https://api.github.com/repos/Rombur/Cap/deployments","created_at":"2016-01-27T15:17:09Z","updated_at":"2016-01-27T15:17:10Z","pushed_at":"2016-05-11T20:49:02Z","git_url":"git://github.com/Rombur/Cap.git","ssh_url":"git@github.com:Rombur/Cap.git","clone_url":"https://github.com/Rombur/Cap.git","svn_url":"https://github.com/Rombur/Cap","homepage":"http://cap.readthedocs.org","size":1527,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ORNL-CEES:master","ref":"master","sha":"c083a1499be6d01996b32251028de22332bcca01","user":{"login":"ORNL-CEES","id":6653148,"avatar_url":"https://avatars.githubusercontent.com/u/6653148?v=3","gravatar_id":"","url":"https://api.github.com/users/ORNL-CEES","html_url":"https://github.com/ORNL-CEES","followers_url":"https://api.github.com/users/ORNL-CEES/followers","following_url":"https://api.github.com/users/ORNL-CEES/following{/other_user}","gists_url":"https://api.github.com/users/ORNL-CEES/gists{/gist_id}","starred_url":"https://api.github.com/users/ORNL-CEES/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ORNL-CEES/subscriptions","organizations_url":"https://api.github.com/users/ORNL-CEES/orgs","repos_url":"https://api.github.com/users/ORNL-CEES/repos","events_url":"https://api.github.com/users/ORNL-CEES/events{/privacy}","received_events_url":"https://api.github.com/users/ORNL-CEES/received_events","type":"Organization","site_admin":false},"repo":{"id":50514800,"name":"Cap","full_name":"ORNL-CEES/Cap","owner":{"login":"ORNL-CEES","id":6653148,"avatar_url":"https://avatars.githubusercontent.com/u/6653148?v=3","gravatar_id":"","url":"https://api.github.com/users/ORNL-CEES","html_url":"https://github.com/ORNL-CEES","followers_url":"https://api.github.com/users/ORNL-CEES/followers","following_url":"https://api.github.com/users/ORNL-CEES/following{/other_user}","gists_url":"https://api.github.com/users/ORNL-CEES/gists{/gist_id}","starred_url":"https://api.github.com/users/ORNL-CEES/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ORNL-CEES/subscriptions","organizations_url":"https://api.github.com/users/ORNL-CEES/orgs","repos_url":"https://api.github.com/users/ORNL-CEES/repos","events_url":"https://api.github.com/users/ORNL-CEES/events{/privacy}","received_events_url":"https://api.github.com/users/ORNL-CEES/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ORNL-CEES/Cap","description":"A library for modeling energy storage devices.","fork":false,"url":"https://api.github.com/repos/ORNL-CEES/Cap","forks_url":"https://api.github.com/repos/ORNL-CEES/Cap/forks","keys_url":"https://api.github.com/repos/ORNL-CEES/Cap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ORNL-CEES/Cap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ORNL-CEES/Cap/teams","hooks_url":"https://api.github.com/repos/ORNL-CEES/Cap/hooks","issue_events_url":"https://api.github.com/repos/ORNL-CEES/Cap/issues/events{/number}","events_url":"https://api.github.com/repos/ORNL-CEES/Cap/events","assignees_url":"https://api.github.com/repos/ORNL-CEES/Cap/assignees{/user}","branches_url":"https://api.github.com/repos/ORNL-CEES/Cap/branches{/branch}","tags_url":"https://api.github.com/repos/ORNL-CEES/Cap/tags","blobs_url":"https://api.github.com/repos/ORNL-CEES/Cap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ORNL-CEES/Cap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ORNL-CEES/Cap/git/refs{/sha}","trees_url":"https://api.github.com/repos/ORNL-CEES/Cap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ORNL-CEES/Cap/statuses/{sha}","languages_url":"https://api.github.com/repos/ORNL-CEES/Cap/languages","stargazers_url":"https://api.github.com/repos/ORNL-CEES/Cap/stargazers","contributors_url":"https://api.github.com/repos/ORNL-CEES/Cap/contributors","subscribers_url":"https://api.github.com/repos/ORNL-CEES/Cap/subscribers","subscription_url":"https://api.github.com/repos/ORNL-CEES/Cap/subscription","commits_url":"https://api.github.com/repos/ORNL-CEES/Cap/commits{/sha}","git_commits_url":"https://api.github.com/repos/ORNL-CEES/Cap/git/commits{/sha}","comments_url":"https://api.github.com/repos/ORNL-CEES/Cap/comments{/number}","issue_comment_url":"https://api.github.com/repos/ORNL-CEES/Cap/issues/comments{/number}","contents_url":"https://api.github.com/repos/ORNL-CEES/Cap/contents/{+path}","compare_url":"https://api.github.com/repos/ORNL-CEES/Cap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ORNL-CEES/Cap/merges","archive_url":"https://api.github.com/repos/ORNL-CEES/Cap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ORNL-CEES/Cap/downloads","issues_url":"https://api.github.com/repos/ORNL-CEES/Cap/issues{/number}","pulls_url":"https://api.github.com/repos/ORNL-CEES/Cap/pulls{/number}","milestones_url":"https://api.github.com/repos/ORNL-CEES/Cap/milestones{/number}","notifications_url":"https://api.github.com/repos/ORNL-CEES/Cap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ORNL-CEES/Cap/labels{/name}","releases_url":"https://api.github.com/repos/ORNL-CEES/Cap/releases{/id}","deployments_url":"https://api.github.com/repos/ORNL-CEES/Cap/deployments","created_at":"2016-01-27T14:56:58Z","updated_at":"2016-01-27T15:01:13Z","pushed_at":"2016-05-11T20:49:02Z","git_url":"git://github.com/ORNL-CEES/Cap.git","ssh_url":"git@github.com:ORNL-CEES/Cap.git","clone_url":"https://github.com/ORNL-CEES/Cap.git","svn_url":"https://github.com/ORNL-CEES/Cap","homepage":"http://cap.readthedocs.org","size":1543,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":12,"forks":3,"open_issues":12,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ORNL-CEES/Cap/pulls/154"},"html":{"href":"https://github.com/ORNL-CEES/Cap/pull/154"},"issue":{"href":"https://api.github.com/repos/ORNL-CEES/Cap/issues/154"},"comments":{"href":"https://api.github.com/repos/ORNL-CEES/Cap/issues/154/comments"},"review_comments":{"href":"https://api.github.com/repos/ORNL-CEES/Cap/pulls/154/comments"},"review_comment":{"href":"https://api.github.com/repos/ORNL-CEES/Cap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ORNL-CEES/Cap/pulls/154/commits"},"statuses":{"href":"https://api.github.com/repos/ORNL-CEES/Cap/statuses/84802cc9e29e630b6fb4460d1e89ddd0d10ccd03"}}}}