{"action":"created","comment":{"url":"https://api.github.com/repos/openucx/ucx/pulls/comments/36020114","id":36020114,"diff_hunk":"@@ -1012,3 +1027,106 @@ ucs_status_t ucx_perf_run(ucx_perf_params_t *params, ucx_perf_result_t *result)\n out:\n     return status;\n }\n+\n+\n+/* multiple threads sharing the same worker/iface */\n+\n+typedef struct {\n+    pthread_t pt;\n+    int tid;\n+    int ntid;\n+    ucx_perf_context_t perf;\n+    ucx_perf_params_t params;\n+    ucx_perf_result_t result;\n+} ucx_perf_thread_context_t;\n+\n+static ucs_status_t* ucx_perf_thread_statuses;\n+static pthread_barrier_t ucx_perf_thread_barrier;\n+\n+static void* ucx_perf_thread_run_test(void* tctx_) {\n+    ucx_perf_thread_context_t* tctx = (ucx_perf_thread_context_t*) tctx_;\n+    ucx_perf_params_t* params = &tctx->params;\n+    ucx_perf_result_t* result = &tctx->result;\n+    ucx_perf_context_t* perf = &tctx->perf;\n+    int tid = tctx->tid;\n+//    int rid = rte_call(perf, group_index);\n+    int i;\n+\n+    if (params->warmup_iter > 0) {\n+        ucx_perf_set_warmup(perf, params);\n+        ucx_perf_thread_statuses[tid] = ucx_perf_funcs[params->api].run(perf);\n+        pthread_barrier_wait(&ucx_perf_thread_barrier);\n+        for (i = 0; i < tctx->ntid; i++) {\n+            if (ucx_perf_thread_statuses[i] != UCS_OK) {\n+                goto out;\n+            }\n+        }\n+        if (0 == tid) {\n+            rte_call(perf, barrier);\n+            ucx_perf_test_reset(perf, params);\n+        }\n+    }\n+\n+    /* Run test */\n+    pthread_barrier_wait(&ucx_perf_thread_barrier);\n+    ucx_perf_thread_statuses[tid] = ucx_perf_funcs[params->api].run(perf);\n+    pthread_barrier_wait(&ucx_perf_thread_barrier);\n+    for (i = 0; i < tctx->ntid; i++) {\n+        if (ucx_perf_thread_statuses[i] != UCS_OK) {\n+            goto out;\n+        }\n+    }\n+    if (0 == tid) {\n+        rte_call(perf, barrier);\n+        ucx_perf_calc_result(perf, result);\n+        rte_call(perf, report, result, 1);\n+    }\n+\n+out:\n+    return (void*)ucx_perf_thread_statuses[tid];\n+}\n+\n+static int ucx_perf_thread_spawn(ucx_perf_params_t* params, \n+                                 ucx_perf_result_t* result) {\n+    ucx_perf_context_t perf;\n+    ucs_status_t status = UCS_OK;","path":"src/tools/perf/libperf.c","position":140,"original_position":140,"commit_id":"8f441dfa22d619c87c79721de791441eb6b0da98","original_commit_id":"8f441dfa22d619c87c79721de791441eb6b0da98","user":{"login":"yosefe","id":2255631,"avatar_url":"https://avatars.githubusercontent.com/u/2255631?v=3","gravatar_id":"","url":"https://api.github.com/users/yosefe","html_url":"https://github.com/yosefe","followers_url":"https://api.github.com/users/yosefe/followers","following_url":"https://api.github.com/users/yosefe/following{/other_user}","gists_url":"https://api.github.com/users/yosefe/gists{/gist_id}","starred_url":"https://api.github.com/users/yosefe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosefe/subscriptions","organizations_url":"https://api.github.com/users/yosefe/orgs","repos_url":"https://api.github.com/users/yosefe/repos","events_url":"https://api.github.com/users/yosefe/events{/privacy}","received_events_url":"https://api.github.com/users/yosefe/received_events","type":"User","site_admin":false},"body":"why is this initialization needed? see line 1104","created_at":"2015-07-31T21:53:32Z","updated_at":"2015-07-31T21:53:32Z","html_url":"https://github.com/openucx/ucx/pull/336#discussion_r36020114","pull_request_url":"https://api.github.com/repos/openucx/ucx/pulls/336","_links":{"self":{"href":"https://api.github.com/repos/openucx/ucx/pulls/comments/36020114"},"html":{"href":"https://github.com/openucx/ucx/pull/336#discussion_r36020114"},"pull_request":{"href":"https://api.github.com/repos/openucx/ucx/pulls/336"}}},"pull_request":{"url":"https://api.github.com/repos/openucx/ucx/pulls/336","id":41180080,"html_url":"https://github.com/openucx/ucx/pull/336","diff_url":"https://github.com/openucx/ucx/pull/336.diff","patch_url":"https://github.com/openucx/ucx/pull/336.patch","issue_url":"https://api.github.com/repos/openucx/ucx/issues/336","number":336,"state":"open","locked":false,"title":"Tests mt","user":{"login":"abouteiller","id":5197733,"avatar_url":"https://avatars.githubusercontent.com/u/5197733?v=3","gravatar_id":"","url":"https://api.github.com/users/abouteiller","html_url":"https://github.com/abouteiller","followers_url":"https://api.github.com/users/abouteiller/followers","following_url":"https://api.github.com/users/abouteiller/following{/other_user}","gists_url":"https://api.github.com/users/abouteiller/gists{/gist_id}","starred_url":"https://api.github.com/users/abouteiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abouteiller/subscriptions","organizations_url":"https://api.github.com/users/abouteiller/orgs","repos_url":"https://api.github.com/users/abouteiller/repos","events_url":"https://api.github.com/users/abouteiller/events{/privacy}","received_events_url":"https://api.github.com/users/abouteiller/received_events","type":"User","site_admin":false},"body":"Adding some multithreading testing capabilities: in this version, all threads share the same worker and talk to the same ep, iface. More advanced use of workers/iface per thread with exclusive modes will be investigated when this basic scenario works. \r\n\r\n","created_at":"2015-07-29T22:32:09Z","updated_at":"2015-07-31T21:53:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"40baaf929ac99733109e831975ec1457a4c0f7b5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openucx/ucx/pulls/336/commits","review_comments_url":"https://api.github.com/repos/openucx/ucx/pulls/336/comments","review_comment_url":"https://api.github.com/repos/openucx/ucx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openucx/ucx/issues/336/comments","statuses_url":"https://api.github.com/repos/openucx/ucx/statuses/8f441dfa22d619c87c79721de791441eb6b0da98","head":{"label":"abouteiller:tests-mt","ref":"tests-mt","sha":"8f441dfa22d619c87c79721de791441eb6b0da98","user":{"login":"abouteiller","id":5197733,"avatar_url":"https://avatars.githubusercontent.com/u/5197733?v=3","gravatar_id":"","url":"https://api.github.com/users/abouteiller","html_url":"https://github.com/abouteiller","followers_url":"https://api.github.com/users/abouteiller/followers","following_url":"https://api.github.com/users/abouteiller/following{/other_user}","gists_url":"https://api.github.com/users/abouteiller/gists{/gist_id}","starred_url":"https://api.github.com/users/abouteiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abouteiller/subscriptions","organizations_url":"https://api.github.com/users/abouteiller/orgs","repos_url":"https://api.github.com/users/abouteiller/repos","events_url":"https://api.github.com/users/abouteiller/events{/privacy}","received_events_url":"https://api.github.com/users/abouteiller/received_events","type":"User","site_admin":false},"repo":{"id":39916609,"name":"ucx","full_name":"abouteiller/ucx","owner":{"login":"abouteiller","id":5197733,"avatar_url":"https://avatars.githubusercontent.com/u/5197733?v=3","gravatar_id":"","url":"https://api.github.com/users/abouteiller","html_url":"https://github.com/abouteiller","followers_url":"https://api.github.com/users/abouteiller/followers","following_url":"https://api.github.com/users/abouteiller/following{/other_user}","gists_url":"https://api.github.com/users/abouteiller/gists{/gist_id}","starred_url":"https://api.github.com/users/abouteiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abouteiller/subscriptions","organizations_url":"https://api.github.com/users/abouteiller/orgs","repos_url":"https://api.github.com/users/abouteiller/repos","events_url":"https://api.github.com/users/abouteiller/events{/privacy}","received_events_url":"https://api.github.com/users/abouteiller/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abouteiller/ucx","description":"Unified Communication X : ","fork":true,"url":"https://api.github.com/repos/abouteiller/ucx","forks_url":"https://api.github.com/repos/abouteiller/ucx/forks","keys_url":"https://api.github.com/repos/abouteiller/ucx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abouteiller/ucx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abouteiller/ucx/teams","hooks_url":"https://api.github.com/repos/abouteiller/ucx/hooks","issue_events_url":"https://api.github.com/repos/abouteiller/ucx/issues/events{/number}","events_url":"https://api.github.com/repos/abouteiller/ucx/events","assignees_url":"https://api.github.com/repos/abouteiller/ucx/assignees{/user}","branches_url":"https://api.github.com/repos/abouteiller/ucx/branches{/branch}","tags_url":"https://api.github.com/repos/abouteiller/ucx/tags","blobs_url":"https://api.github.com/repos/abouteiller/ucx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abouteiller/ucx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abouteiller/ucx/git/refs{/sha}","trees_url":"https://api.github.com/repos/abouteiller/ucx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abouteiller/ucx/statuses/{sha}","languages_url":"https://api.github.com/repos/abouteiller/ucx/languages","stargazers_url":"https://api.github.com/repos/abouteiller/ucx/stargazers","contributors_url":"https://api.github.com/repos/abouteiller/ucx/contributors","subscribers_url":"https://api.github.com/repos/abouteiller/ucx/subscribers","subscription_url":"https://api.github.com/repos/abouteiller/ucx/subscription","commits_url":"https://api.github.com/repos/abouteiller/ucx/commits{/sha}","git_commits_url":"https://api.github.com/repos/abouteiller/ucx/git/commits{/sha}","comments_url":"https://api.github.com/repos/abouteiller/ucx/comments{/number}","issue_comment_url":"https://api.github.com/repos/abouteiller/ucx/issues/comments{/number}","contents_url":"https://api.github.com/repos/abouteiller/ucx/contents/{+path}","compare_url":"https://api.github.com/repos/abouteiller/ucx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abouteiller/ucx/merges","archive_url":"https://api.github.com/repos/abouteiller/ucx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abouteiller/ucx/downloads","issues_url":"https://api.github.com/repos/abouteiller/ucx/issues{/number}","pulls_url":"https://api.github.com/repos/abouteiller/ucx/pulls{/number}","milestones_url":"https://api.github.com/repos/abouteiller/ucx/milestones{/number}","notifications_url":"https://api.github.com/repos/abouteiller/ucx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abouteiller/ucx/labels{/name}","releases_url":"https://api.github.com/repos/abouteiller/ucx/releases{/id}","created_at":"2015-07-29T21:12:11Z","updated_at":"2015-07-29T21:14:49Z","pushed_at":"2015-07-30T21:22:03Z","git_url":"git://github.com/abouteiller/ucx.git","ssh_url":"git@github.com:abouteiller/ucx.git","clone_url":"https://github.com/abouteiller/ucx.git","svn_url":"https://github.com/abouteiller/ucx","homepage":" http://www.openucx.org","size":5171,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openucx:master","ref":"master","sha":"e3d63cc246268750a93759ced60ce792d669f9d6","user":{"login":"openucx","id":13118737,"avatar_url":"https://avatars.githubusercontent.com/u/13118737?v=3","gravatar_id":"","url":"https://api.github.com/users/openucx","html_url":"https://github.com/openucx","followers_url":"https://api.github.com/users/openucx/followers","following_url":"https://api.github.com/users/openucx/following{/other_user}","gists_url":"https://api.github.com/users/openucx/gists{/gist_id}","starred_url":"https://api.github.com/users/openucx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openucx/subscriptions","organizations_url":"https://api.github.com/users/openucx/orgs","repos_url":"https://api.github.com/users/openucx/repos","events_url":"https://api.github.com/users/openucx/events{/privacy}","received_events_url":"https://api.github.com/users/openucx/received_events","type":"Organization","site_admin":false},"repo":{"id":25379390,"name":"ucx","full_name":"openucx/ucx","owner":{"login":"openucx","id":13118737,"avatar_url":"https://avatars.githubusercontent.com/u/13118737?v=3","gravatar_id":"","url":"https://api.github.com/users/openucx","html_url":"https://github.com/openucx","followers_url":"https://api.github.com/users/openucx/followers","following_url":"https://api.github.com/users/openucx/following{/other_user}","gists_url":"https://api.github.com/users/openucx/gists{/gist_id}","starred_url":"https://api.github.com/users/openucx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openucx/subscriptions","organizations_url":"https://api.github.com/users/openucx/orgs","repos_url":"https://api.github.com/users/openucx/repos","events_url":"https://api.github.com/users/openucx/events{/privacy}","received_events_url":"https://api.github.com/users/openucx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openucx/ucx","description":"Unified Communication X : ","fork":false,"url":"https://api.github.com/repos/openucx/ucx","forks_url":"https://api.github.com/repos/openucx/ucx/forks","keys_url":"https://api.github.com/repos/openucx/ucx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openucx/ucx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openucx/ucx/teams","hooks_url":"https://api.github.com/repos/openucx/ucx/hooks","issue_events_url":"https://api.github.com/repos/openucx/ucx/issues/events{/number}","events_url":"https://api.github.com/repos/openucx/ucx/events","assignees_url":"https://api.github.com/repos/openucx/ucx/assignees{/user}","branches_url":"https://api.github.com/repos/openucx/ucx/branches{/branch}","tags_url":"https://api.github.com/repos/openucx/ucx/tags","blobs_url":"https://api.github.com/repos/openucx/ucx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openucx/ucx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openucx/ucx/git/refs{/sha}","trees_url":"https://api.github.com/repos/openucx/ucx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openucx/ucx/statuses/{sha}","languages_url":"https://api.github.com/repos/openucx/ucx/languages","stargazers_url":"https://api.github.com/repos/openucx/ucx/stargazers","contributors_url":"https://api.github.com/repos/openucx/ucx/contributors","subscribers_url":"https://api.github.com/repos/openucx/ucx/subscribers","subscription_url":"https://api.github.com/repos/openucx/ucx/subscription","commits_url":"https://api.github.com/repos/openucx/ucx/commits{/sha}","git_commits_url":"https://api.github.com/repos/openucx/ucx/git/commits{/sha}","comments_url":"https://api.github.com/repos/openucx/ucx/comments{/number}","issue_comment_url":"https://api.github.com/repos/openucx/ucx/issues/comments{/number}","contents_url":"https://api.github.com/repos/openucx/ucx/contents/{+path}","compare_url":"https://api.github.com/repos/openucx/ucx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openucx/ucx/merges","archive_url":"https://api.github.com/repos/openucx/ucx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openucx/ucx/downloads","issues_url":"https://api.github.com/repos/openucx/ucx/issues{/number}","pulls_url":"https://api.github.com/repos/openucx/ucx/pulls{/number}","milestones_url":"https://api.github.com/repos/openucx/ucx/milestones{/number}","notifications_url":"https://api.github.com/repos/openucx/ucx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openucx/ucx/labels{/name}","releases_url":"https://api.github.com/repos/openucx/ucx/releases{/id}","created_at":"2014-10-17T22:17:24Z","updated_at":"2015-07-31T20:34:05Z","pushed_at":"2015-07-31T21:45:58Z","git_url":"git://github.com/openucx/ucx.git","ssh_url":"git@github.com:openucx/ucx.git","clone_url":"https://github.com/openucx/ucx.git","svn_url":"https://github.com/openucx/ucx","homepage":" http://www.openucx.org","size":5171,"stargazers_count":17,"watchers_count":17,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":36,"forks":10,"open_issues":36,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openucx/ucx/pulls/336"},"html":{"href":"https://github.com/openucx/ucx/pull/336"},"issue":{"href":"https://api.github.com/repos/openucx/ucx/issues/336"},"comments":{"href":"https://api.github.com/repos/openucx/ucx/issues/336/comments"},"review_comments":{"href":"https://api.github.com/repos/openucx/ucx/pulls/336/comments"},"review_comment":{"href":"https://api.github.com/repos/openucx/ucx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openucx/ucx/pulls/336/commits"},"statuses":{"href":"https://api.github.com/repos/openucx/ucx/statuses/8f441dfa22d619c87c79721de791441eb6b0da98"}}}}