{"action":"created","comment":{"url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/comments/39933706","id":39933706,"diff_hunk":"@@ -1,36 +1,43 @@\n import multiprocessing as mp\n+import numpy as np\n import time\n import matplotlib.pyplot as plt\n \n # Sleep for t seconds\n def burnTime(t):\n-    time.sleep(t)\n+\ttime.sleep(t)\n \n # Main\n if __name__ == '__main__':\n-    N = 16  # The number of jobs\n-    P = 4   # The number of processes\n+\tN = 16  # The number of jobs\n+\tP = 4   # The number of processes\n \n     # A thread pool of P processes\n-    pool = mp.Pool(P)\n+\tpool = mp.Pool(P)\n \n     # Use a variety of wait times\n-    ratio = []\n-    wait_time = []\n+\tratio = []\n+\twait_time = [10**-6,5*10**-6,7.5*10**-6,10**-5,5*10**-5,7.5*10**-5,10**-4,5*10**-4,7.5*10**-4,10**-3,5*10**-3,7.5*10**-3,10**-2,5*10**-2,7.5*10**-2,10**-1,5*10**-1,7.5*10**-1,1]\n \n-    for t in wait_time:\n-        # Compute jobs serially and in parallel\n-        # Use time.time() to compute the elapsed time for each\n-        serialTime = 1\n-        parallelTime = 1\n+\tfor t in wait_time:\n+    \t# Compute jobs serially and in parallel\n+\t\t# Use time.time() to compute the elapsed time for each\n+\t\tbefore = time.time()\n+\t\tfor i in range(16):\n+\t\t\tburnTime(t)\n+\t\tserialTime = time.time()-before\n+\t\t\n+\t\tbefore = time.time()\n+\t\tpool.map(burnTime(t), range(N))","path":"HW0/P6/P6B.py","position":42,"original_position":42,"commit_id":"2afe811f7f55fd01830ce2f0d0f1e5f6896963c4","original_commit_id":"2afe811f7f55fd01830ce2f0d0f1e5f6896963c4","user":{"login":"virgodi","id":14116972,"avatar_url":"https://avatars.githubusercontent.com/u/14116972?v=3","gravatar_id":"","url":"https://api.github.com/users/virgodi","html_url":"https://github.com/virgodi","followers_url":"https://api.github.com/users/virgodi/followers","following_url":"https://api.github.com/users/virgodi/following{/other_user}","gists_url":"https://api.github.com/users/virgodi/gists{/gist_id}","starred_url":"https://api.github.com/users/virgodi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/virgodi/subscriptions","organizations_url":"https://api.github.com/users/virgodi/orgs","repos_url":"https://api.github.com/users/virgodi/repos","events_url":"https://api.github.com/users/virgodi/events{/privacy}","received_events_url":"https://api.github.com/users/virgodi/received_events","type":"User","site_admin":false},"body":"Thanks for the explanation ! This is all very new to me...","created_at":"2015-09-20T19:59:33Z","updated_at":"2015-09-20T19:59:33Z","html_url":"https://github.com/harvard-cs205/cs205-homework/pull/136#discussion_r39933706","pull_request_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/136","_links":{"self":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/comments/39933706"},"html":{"href":"https://github.com/harvard-cs205/cs205-homework/pull/136#discussion_r39933706"},"pull_request":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/136"}}},"pull_request":{"url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/136","id":44792444,"html_url":"https://github.com/harvard-cs205/cs205-homework/pull/136","diff_url":"https://github.com/harvard-cs205/cs205-homework/pull/136.diff","patch_url":"https://github.com/harvard-cs205/cs205-homework/pull/136.patch","issue_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/136","number":136,"state":"open","locked":false,"title":"Hw0b - Virgile Audi","user":{"login":"virgodi","id":14116972,"avatar_url":"https://avatars.githubusercontent.com/u/14116972?v=3","gravatar_id":"","url":"https://api.github.com/users/virgodi","html_url":"https://github.com/virgodi","followers_url":"https://api.github.com/users/virgodi/followers","following_url":"https://api.github.com/users/virgodi/following{/other_user}","gists_url":"https://api.github.com/users/virgodi/gists{/gist_id}","starred_url":"https://api.github.com/users/virgodi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/virgodi/subscriptions","organizations_url":"https://api.github.com/users/virgodi/orgs","repos_url":"https://api.github.com/users/virgodi/repos","events_url":"https://api.github.com/users/virgodi/events{/privacy}","received_events_url":"https://api.github.com/users/virgodi/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-11T15:01:25Z","updated_at":"2015-09-20T19:59:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6c412db700040bdc65b7a2119170f9d8b57ae3a7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/136/commits","review_comments_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/136/comments","review_comment_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/136/comments","statuses_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/statuses/2afe811f7f55fd01830ce2f0d0f1e5f6896963c4","head":{"label":"virgodi:HW0b","ref":"HW0b","sha":"2afe811f7f55fd01830ce2f0d0f1e5f6896963c4","user":{"login":"virgodi","id":14116972,"avatar_url":"https://avatars.githubusercontent.com/u/14116972?v=3","gravatar_id":"","url":"https://api.github.com/users/virgodi","html_url":"https://github.com/virgodi","followers_url":"https://api.github.com/users/virgodi/followers","following_url":"https://api.github.com/users/virgodi/following{/other_user}","gists_url":"https://api.github.com/users/virgodi/gists{/gist_id}","starred_url":"https://api.github.com/users/virgodi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/virgodi/subscriptions","organizations_url":"https://api.github.com/users/virgodi/orgs","repos_url":"https://api.github.com/users/virgodi/repos","events_url":"https://api.github.com/users/virgodi/events{/privacy}","received_events_url":"https://api.github.com/users/virgodi/received_events","type":"User","site_admin":false},"repo":{"id":42017143,"name":"cs205-homework","full_name":"virgodi/cs205-homework","owner":{"login":"virgodi","id":14116972,"avatar_url":"https://avatars.githubusercontent.com/u/14116972?v=3","gravatar_id":"","url":"https://api.github.com/users/virgodi","html_url":"https://github.com/virgodi","followers_url":"https://api.github.com/users/virgodi/followers","following_url":"https://api.github.com/users/virgodi/following{/other_user}","gists_url":"https://api.github.com/users/virgodi/gists{/gist_id}","starred_url":"https://api.github.com/users/virgodi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/virgodi/subscriptions","organizations_url":"https://api.github.com/users/virgodi/orgs","repos_url":"https://api.github.com/users/virgodi/repos","events_url":"https://api.github.com/users/virgodi/events{/privacy}","received_events_url":"https://api.github.com/users/virgodi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/virgodi/cs205-homework","description":"","fork":true,"url":"https://api.github.com/repos/virgodi/cs205-homework","forks_url":"https://api.github.com/repos/virgodi/cs205-homework/forks","keys_url":"https://api.github.com/repos/virgodi/cs205-homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/virgodi/cs205-homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/virgodi/cs205-homework/teams","hooks_url":"https://api.github.com/repos/virgodi/cs205-homework/hooks","issue_events_url":"https://api.github.com/repos/virgodi/cs205-homework/issues/events{/number}","events_url":"https://api.github.com/repos/virgodi/cs205-homework/events","assignees_url":"https://api.github.com/repos/virgodi/cs205-homework/assignees{/user}","branches_url":"https://api.github.com/repos/virgodi/cs205-homework/branches{/branch}","tags_url":"https://api.github.com/repos/virgodi/cs205-homework/tags","blobs_url":"https://api.github.com/repos/virgodi/cs205-homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/virgodi/cs205-homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/virgodi/cs205-homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/virgodi/cs205-homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/virgodi/cs205-homework/statuses/{sha}","languages_url":"https://api.github.com/repos/virgodi/cs205-homework/languages","stargazers_url":"https://api.github.com/repos/virgodi/cs205-homework/stargazers","contributors_url":"https://api.github.com/repos/virgodi/cs205-homework/contributors","subscribers_url":"https://api.github.com/repos/virgodi/cs205-homework/subscribers","subscription_url":"https://api.github.com/repos/virgodi/cs205-homework/subscription","commits_url":"https://api.github.com/repos/virgodi/cs205-homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/virgodi/cs205-homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/virgodi/cs205-homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/virgodi/cs205-homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/virgodi/cs205-homework/contents/{+path}","compare_url":"https://api.github.com/repos/virgodi/cs205-homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/virgodi/cs205-homework/merges","archive_url":"https://api.github.com/repos/virgodi/cs205-homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/virgodi/cs205-homework/downloads","issues_url":"https://api.github.com/repos/virgodi/cs205-homework/issues{/number}","pulls_url":"https://api.github.com/repos/virgodi/cs205-homework/pulls{/number}","milestones_url":"https://api.github.com/repos/virgodi/cs205-homework/milestones{/number}","notifications_url":"https://api.github.com/repos/virgodi/cs205-homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/virgodi/cs205-homework/labels{/name}","releases_url":"https://api.github.com/repos/virgodi/cs205-homework/releases{/id}","created_at":"2015-09-06T20:03:51Z","updated_at":"2015-09-06T20:03:52Z","pushed_at":"2015-09-11T17:50:37Z","git_url":"git://github.com/virgodi/cs205-homework.git","ssh_url":"git@github.com:virgodi/cs205-homework.git","clone_url":"https://github.com/virgodi/cs205-homework.git","svn_url":"https://github.com/virgodi/cs205-homework","homepage":null,"size":181,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"harvard-cs205:master","ref":"master","sha":"c56c8eb364fec71d50312e3780ed6d1191a613ee","user":{"login":"harvard-cs205","id":13456002,"avatar_url":"https://avatars.githubusercontent.com/u/13456002?v=3","gravatar_id":"","url":"https://api.github.com/users/harvard-cs205","html_url":"https://github.com/harvard-cs205","followers_url":"https://api.github.com/users/harvard-cs205/followers","following_url":"https://api.github.com/users/harvard-cs205/following{/other_user}","gists_url":"https://api.github.com/users/harvard-cs205/gists{/gist_id}","starred_url":"https://api.github.com/users/harvard-cs205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harvard-cs205/subscriptions","organizations_url":"https://api.github.com/users/harvard-cs205/orgs","repos_url":"https://api.github.com/users/harvard-cs205/repos","events_url":"https://api.github.com/users/harvard-cs205/events{/privacy}","received_events_url":"https://api.github.com/users/harvard-cs205/received_events","type":"Organization","site_admin":false},"repo":{"id":40614104,"name":"cs205-homework","full_name":"harvard-cs205/cs205-homework","owner":{"login":"harvard-cs205","id":13456002,"avatar_url":"https://avatars.githubusercontent.com/u/13456002?v=3","gravatar_id":"","url":"https://api.github.com/users/harvard-cs205","html_url":"https://github.com/harvard-cs205","followers_url":"https://api.github.com/users/harvard-cs205/followers","following_url":"https://api.github.com/users/harvard-cs205/following{/other_user}","gists_url":"https://api.github.com/users/harvard-cs205/gists{/gist_id}","starred_url":"https://api.github.com/users/harvard-cs205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harvard-cs205/subscriptions","organizations_url":"https://api.github.com/users/harvard-cs205/orgs","repos_url":"https://api.github.com/users/harvard-cs205/repos","events_url":"https://api.github.com/users/harvard-cs205/events{/privacy}","received_events_url":"https://api.github.com/users/harvard-cs205/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/harvard-cs205/cs205-homework","description":"","fork":false,"url":"https://api.github.com/repos/harvard-cs205/cs205-homework","forks_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/forks","keys_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/teams","hooks_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/hooks","issue_events_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/events{/number}","events_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/events","assignees_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/assignees{/user}","branches_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/branches{/branch}","tags_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/tags","blobs_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/statuses/{sha}","languages_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/languages","stargazers_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/stargazers","contributors_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/contributors","subscribers_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/subscribers","subscription_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/subscription","commits_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/contents/{+path}","compare_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/merges","archive_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/downloads","issues_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues{/number}","pulls_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls{/number}","milestones_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/milestones{/number}","notifications_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/labels{/name}","releases_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/releases{/id}","created_at":"2015-08-12T17:18:15Z","updated_at":"2015-09-17T01:30:31Z","pushed_at":"2015-09-19T14:49:47Z","git_url":"git://github.com/harvard-cs205/cs205-homework.git","ssh_url":"git@github.com:harvard-cs205/cs205-homework.git","clone_url":"https://github.com/harvard-cs205/cs205-homework.git","svn_url":"https://github.com/harvard-cs205/cs205-homework","homepage":null,"size":16490,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":99,"mirror_url":null,"open_issues_count":184,"forks":99,"open_issues":184,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/136"},"html":{"href":"https://github.com/harvard-cs205/cs205-homework/pull/136"},"issue":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/136"},"comments":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/136/comments"},"review_comments":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/136/comments"},"review_comment":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/136/commits"},"statuses":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/statuses/2afe811f7f55fd01830ce2f0d0f1e5f6896963c4"}}}}