{"action":"created","comment":{"url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/comments/108596074","pull_request_review_id":29636737,"id":108596074,"diff_hunk":"@@ -969,3 +969,74 @@ def test_non_exist_interface(self):\n         except ArgsNotCorrect, e:\n             assert \"Specified racadm interface {} doesn\\'t exist\".\\\n                        format(fake_interface) in str(e)\n+\n+class numa_configuration(unittest.TestCase):\n+\n+    def setUp(self):\n+        self.numactl = model.NumaCtl()\n+        self.numactl._socket_list = [0, 1]\n+        self.numactl._core_list = [0, 1, 2, 3, 4, 8, 9, 10, 11, 12]\n+        self.numactl._core_map = {\n+            (0, 0): [0, 20], (1, 0): [1, 21],\n+            (0, 1): [2, 22], (1, 1): [3, 23],\n+            (0, 2): [4, 24], (1, 2): [5, 25],\n+            (0, 3): [6, 26], (1, 3): [7, 27],\n+            (0, 4): [8, 28], (1, 4): [9, 29],\n+            (0, 8): [10, 30], (1, 8): [11, 31],\n+            (0, 9): [12, 32], (1, 9): [13, 33],\n+            (0, 10): [14, 34], (1, 10): [15, 35],\n+            (0, 11): [16, 36], (1, 11): [17, 37],\n+            (0, 12): [18, 38], (1, 12): [19, 39]\n+        }\n+        self.numactl._core_map_avai = {\n+            (0, 0): [False, False], (1, 0): [False, False],\n+            (0, 1): [True, True], (1, 1): [True, True],\n+            (0, 2): [True, True], (1, 2): [True, True],\n+            (0, 3): [True, True], (1, 3): [True, True],\n+            (0, 4): [True, True], (1, 4): [True, True],\n+            (0, 8): [True, True], (1, 8): [True, True],\n+            (0, 9): [True, True], (1, 9): [True, True],\n+            (0, 10): [True, True], (1, 10): [True, True],\n+            (0, 11): [True, True], (1, 11): [True, True],\n+            (0, 12): [True, True], (1, 12): [True, True]\n+        }\n+\n+    def tearDown(self):\n+        self.numactl = None\n+\n+    def test_cpu_assign(self):\n+        assert self.numactl.get_cpu_list(4) == [2, 22, 4, 24]\n+\n+    def test_cpu_assign_scattered_1(self):\n+        assert self.numactl.get_cpu_list(3) == [2, 22, 4]\n+        assert self.numactl.get_cpu_list(1) == [24]\n+\n+    def test_cpu_assign_scattered_2(self):\n+        assert self.numactl.get_cpu_list(3) == [2, 22, 4]\n+        assert self.numactl.get_cpu_list(3) == [6, 26, 24]\n+\n+    def test_cpu_assign_hyper_thread(self):\n+        assert self.numactl.get_cpu_list(8) == [2, 22, 4, 24, 6, 26, 8, 28]\n+        assert self.numactl.get_cpu_list(8) == [10, 30, 12, 32, 14, 34, 16, 36]\n+        assert self.numactl.get_cpu_list(8) == [3, 23, 5, 25, 7,27, 9, 29]\n+        assert self.numactl.get_cpu_list(8) == [11, 31, 13, 33, 15, 35, 17, 37]\n+\n+    def test_no_enough_core_1(self):\n+        try:\n+            self.numactl.get_cpu_list(19)\n+        except Exception, e:\n+            assert str(e) == \"All sockets don't have enough processor to bind.\"\n+\n+    def test_no_enough_core_2(self):\n+        assert self.numactl.get_cpu_list(16) == [2, 22, 4, 24,\n+                                                6, 26, 8, 28,\n+                                                10, 30, 12, 32,\n+                                                14, 34, 16, 36]","path":"test/unit/test_model.py","position":86,"original_position":86,"commit_id":"cf9c89d9910c7771380b540048faa3bcd5f3de49","original_commit_id":"cf9c89d9910c7771380b540048faa3bcd5f3de49","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars3.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"continuation line under-indented for visual indent","created_at":"2017-03-29T05:56:16Z","updated_at":"2017-03-29T05:56:16Z","html_url":"https://github.com/InfraSIM/infrasim-compute/pull/226#discussion_r108596074","pull_request_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/226","_links":{"self":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/comments/108596074"},"html":{"href":"https://github.com/InfraSIM/infrasim-compute/pull/226#discussion_r108596074"},"pull_request":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/226"}}},"pull_request":{"url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/226","id":113123341,"html_url":"https://github.com/InfraSIM/infrasim-compute/pull/226","diff_url":"https://github.com/InfraSIM/infrasim-compute/pull/226.diff","patch_url":"https://github.com/InfraSIM/infrasim-compute/pull/226.patch","issue_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/issues/226","number":226,"state":"open","locked":false,"title":"Update numactl logic","user":{"login":"turtle-fly","id":3271116,"avatar_url":"https://avatars2.githubusercontent.com/u/3271116?v=3","gravatar_id":"","url":"https://api.github.com/users/turtle-fly","html_url":"https://github.com/turtle-fly","followers_url":"https://api.github.com/users/turtle-fly/followers","following_url":"https://api.github.com/users/turtle-fly/following{/other_user}","gists_url":"https://api.github.com/users/turtle-fly/gists{/gist_id}","starred_url":"https://api.github.com/users/turtle-fly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turtle-fly/subscriptions","organizations_url":"https://api.github.com/users/turtle-fly/orgs","repos_url":"https://api.github.com/users/turtle-fly/repos","events_url":"https://api.github.com/users/turtle-fly/events{/privacy}","received_events_url":"https://api.github.com/users/turtle-fly/received_events","type":"User","site_admin":false},"body":"Update method to select physical cpu to bind:\r\n- Assign a whole core (with all hyper thread processor) first if\r\nrequirement is no less than 2\r\n- Assgin scattered processor then\r\n- Ensure all binded processor for one qemu is on the same socket\r\n(or unnecessary context switch may reduce performance)\r\n\r\nPair with @JuneZhou19 ","created_at":"2017-03-29T05:56:07Z","updated_at":"2017-03-29T05:56:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"84868e1d483dedb3b7782f938d708ea039cd9a8e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/226/commits","review_comments_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/226/comments","review_comment_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/comments{/number}","comments_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/issues/226/comments","statuses_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/statuses/cf9c89d9910c7771380b540048faa3bcd5f3de49","head":{"label":"turtle-fly:feature/numactl_on_same_core","ref":"feature/numactl_on_same_core","sha":"cf9c89d9910c7771380b540048faa3bcd5f3de49","user":{"login":"turtle-fly","id":3271116,"avatar_url":"https://avatars2.githubusercontent.com/u/3271116?v=3","gravatar_id":"","url":"https://api.github.com/users/turtle-fly","html_url":"https://github.com/turtle-fly","followers_url":"https://api.github.com/users/turtle-fly/followers","following_url":"https://api.github.com/users/turtle-fly/following{/other_user}","gists_url":"https://api.github.com/users/turtle-fly/gists{/gist_id}","starred_url":"https://api.github.com/users/turtle-fly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turtle-fly/subscriptions","organizations_url":"https://api.github.com/users/turtle-fly/orgs","repos_url":"https://api.github.com/users/turtle-fly/repos","events_url":"https://api.github.com/users/turtle-fly/events{/privacy}","received_events_url":"https://api.github.com/users/turtle-fly/received_events","type":"User","site_admin":false},"repo":{"id":61001172,"name":"infrasim-compute","full_name":"turtle-fly/infrasim-compute","owner":{"login":"turtle-fly","id":3271116,"avatar_url":"https://avatars2.githubusercontent.com/u/3271116?v=3","gravatar_id":"","url":"https://api.github.com/users/turtle-fly","html_url":"https://github.com/turtle-fly","followers_url":"https://api.github.com/users/turtle-fly/followers","following_url":"https://api.github.com/users/turtle-fly/following{/other_user}","gists_url":"https://api.github.com/users/turtle-fly/gists{/gist_id}","starred_url":"https://api.github.com/users/turtle-fly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turtle-fly/subscriptions","organizations_url":"https://api.github.com/users/turtle-fly/orgs","repos_url":"https://api.github.com/users/turtle-fly/repos","events_url":"https://api.github.com/users/turtle-fly/events{/privacy}","received_events_url":"https://api.github.com/users/turtle-fly/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/turtle-fly/infrasim-compute","description":null,"fork":true,"url":"https://api.github.com/repos/turtle-fly/infrasim-compute","forks_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/forks","keys_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/keys{/key_id}","collaborators_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/teams","hooks_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/hooks","issue_events_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/issues/events{/number}","events_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/events","assignees_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/assignees{/user}","branches_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/branches{/branch}","tags_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/tags","blobs_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/git/refs{/sha}","trees_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/git/trees{/sha}","statuses_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/statuses/{sha}","languages_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/languages","stargazers_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/stargazers","contributors_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/contributors","subscribers_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/subscribers","subscription_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/subscription","commits_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/commits{/sha}","git_commits_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/git/commits{/sha}","comments_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/comments{/number}","issue_comment_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/issues/comments{/number}","contents_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/contents/{+path}","compare_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/compare/{base}...{head}","merges_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/merges","archive_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/downloads","issues_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/issues{/number}","pulls_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/pulls{/number}","milestones_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/milestones{/number}","notifications_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/labels{/name}","releases_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/releases{/id}","deployments_url":"https://api.github.com/repos/turtle-fly/infrasim-compute/deployments","created_at":"2016-06-13T02:26:28Z","updated_at":"2016-06-13T02:26:29Z","pushed_at":"2017-03-29T05:55:09Z","git_url":"git://github.com/turtle-fly/infrasim-compute.git","ssh_url":"git@github.com:turtle-fly/infrasim-compute.git","clone_url":"https://github.com/turtle-fly/infrasim-compute.git","svn_url":"https://github.com/turtle-fly/infrasim-compute","homepage":null,"size":19747,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"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":"InfraSIM:master","ref":"master","sha":"c1f7dbe3de459452f6e35d5d0f03f550e81f30a8","user":{"login":"InfraSIM","id":15829902,"avatar_url":"https://avatars0.githubusercontent.com/u/15829902?v=3","gravatar_id":"","url":"https://api.github.com/users/InfraSIM","html_url":"https://github.com/InfraSIM","followers_url":"https://api.github.com/users/InfraSIM/followers","following_url":"https://api.github.com/users/InfraSIM/following{/other_user}","gists_url":"https://api.github.com/users/InfraSIM/gists{/gist_id}","starred_url":"https://api.github.com/users/InfraSIM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/InfraSIM/subscriptions","organizations_url":"https://api.github.com/users/InfraSIM/orgs","repos_url":"https://api.github.com/users/InfraSIM/repos","events_url":"https://api.github.com/users/InfraSIM/events{/privacy}","received_events_url":"https://api.github.com/users/InfraSIM/received_events","type":"Organization","site_admin":false},"repo":{"id":60502320,"name":"infrasim-compute","full_name":"InfraSIM/infrasim-compute","owner":{"login":"InfraSIM","id":15829902,"avatar_url":"https://avatars0.githubusercontent.com/u/15829902?v=3","gravatar_id":"","url":"https://api.github.com/users/InfraSIM","html_url":"https://github.com/InfraSIM","followers_url":"https://api.github.com/users/InfraSIM/followers","following_url":"https://api.github.com/users/InfraSIM/following{/other_user}","gists_url":"https://api.github.com/users/InfraSIM/gists{/gist_id}","starred_url":"https://api.github.com/users/InfraSIM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/InfraSIM/subscriptions","organizations_url":"https://api.github.com/users/InfraSIM/orgs","repos_url":"https://api.github.com/users/InfraSIM/repos","events_url":"https://api.github.com/users/InfraSIM/events{/privacy}","received_events_url":"https://api.github.com/users/InfraSIM/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/InfraSIM/infrasim-compute","description":null,"fork":false,"url":"https://api.github.com/repos/InfraSIM/infrasim-compute","forks_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/forks","keys_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/keys{/key_id}","collaborators_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/teams","hooks_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/hooks","issue_events_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/issues/events{/number}","events_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/events","assignees_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/assignees{/user}","branches_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/branches{/branch}","tags_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/tags","blobs_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/git/refs{/sha}","trees_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/git/trees{/sha}","statuses_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/statuses/{sha}","languages_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/languages","stargazers_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/stargazers","contributors_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/contributors","subscribers_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/subscribers","subscription_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/subscription","commits_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/commits{/sha}","git_commits_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/git/commits{/sha}","comments_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/comments{/number}","issue_comment_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/issues/comments{/number}","contents_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/contents/{+path}","compare_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/compare/{base}...{head}","merges_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/merges","archive_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/downloads","issues_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/issues{/number}","pulls_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls{/number}","milestones_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/milestones{/number}","notifications_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/labels{/name}","releases_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/releases{/id}","deployments_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/deployments","created_at":"2016-06-06T06:01:41Z","updated_at":"2017-03-02T08:44:51Z","pushed_at":"2017-03-29T05:56:07Z","git_url":"git://github.com/InfraSIM/infrasim-compute.git","ssh_url":"git@github.com:InfraSIM/infrasim-compute.git","clone_url":"https://github.com/InfraSIM/infrasim-compute.git","svn_url":"https://github.com/InfraSIM/infrasim-compute","homepage":null,"size":19751,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":7,"forks":14,"open_issues":7,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/226"},"html":{"href":"https://github.com/InfraSIM/infrasim-compute/pull/226"},"issue":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/issues/226"},"comments":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/issues/226/comments"},"review_comments":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/226/comments"},"review_comment":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/226/commits"},"statuses":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/statuses/cf9c89d9910c7771380b540048faa3bcd5f3de49"}}}}
{"actor":{"display_login":"houndci-bot"}}