{"action":"created","comment":{"url":"https://api.github.com/repos/ofi-cray/libfabric-cray/pulls/comments/28736556","id":28736556,"diff_hunk":"@@ -278,3 +380,69 @@ int _gnix_job_disable_affinity_apply(void)\n \treturn gnix_write_proc_job(\"disable_affinity_apply\");\n }\n \n+\n+int _gnix_job_fma_limit(uint32_t dev_id, uint8_t ptag, uint32_t *limit)\n+{\n+\tgni_return_t status;\n+\tgni_job_res_desc_t job_res_desc;\n+\n+\tif (!limit) {\n+\t\treturn -FI_EINVAL;\n+\t}\n+\n+\tstatus = GNI_GetJobResInfo(dev_id, ptag, GNI_JOB_RES_FMA, &job_res_desc);\n+\tif (status) {\n+\t\tGNIX_ERR(FI_LOG_FABRIC, \"GNI_GetJobResInfo(%d, %d) failed, status=%s\\n\",\n+\t\t\t dev_id, ptag, gni_err_str[status]);\n+\t\treturn -FI_EINVAL;\n+\t}\n+\n+\t*limit = job_res_desc.limit;\n+\n+\treturn 0;\n+}\n+\n+int _gnix_pes_on_node(uint32_t *num_pes)\n+{\n+\tint rc;\n+\n+\tif (!num_pes) {\n+\t\treturn -FI_EINVAL;\n+\t}\n+\n+\trc = gnix_alps_init();\n+\tif (rc) {\n+\t\tGNIX_ERR(FI_LOG_FABRIC, \"gnix_alps_init() failed, ret=%d(%s)\\n\",\n+\t\t\t       rc, strerror(errno));\n+\t\treturn rc;\n+\t}\n+\n+\t*num_pes = gnix_appLayout.numPesHere;\n+\n+\treturn 0;\n+}\n+\n+int _gnix_nics_per_rank(uint32_t *nics_per_rank)\n+{\n+\tint rc;\n+\tuint32_t npes, fmas;\n+\n+\tif (!nics_per_rank) {\n+\t\treturn -FI_EINVAL;\n+\t}\n+\n+\trc = _gnix_job_fma_limit(gnix_device_id, gnix_app_ptag, &fmas);\n+\tif (rc) {\n+\t\treturn rc;\n+\t}\n+\n+\trc = _gnix_pes_on_node(&npes);\n+\tif (rc) {\n+\t\treturn rc;\n+\t}\n+\n+\t*nics_per_rank = fmas / npes;\n+\n+\treturn 0;","path":"prov/gni/src/gnix_util.c","position":235,"original_position":235,"commit_id":"584691947510fab84a76e1c58325fc342b25bb08","original_commit_id":"584691947510fab84a76e1c58325fc342b25bb08","user":{"login":"hppritcha","id":7818666,"avatar_url":"https://avatars.githubusercontent.com/u/7818666?v=3","gravatar_id":"","url":"https://api.github.com/users/hppritcha","html_url":"https://github.com/hppritcha","followers_url":"https://api.github.com/users/hppritcha/followers","following_url":"https://api.github.com/users/hppritcha/following{/other_user}","gists_url":"https://api.github.com/users/hppritcha/gists{/gist_id}","starred_url":"https://api.github.com/users/hppritcha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hppritcha/subscriptions","organizations_url":"https://api.github.com/users/hppritcha/orgs","repos_url":"https://api.github.com/users/hppritcha/repos","events_url":"https://api.github.com/users/hppritcha/events{/privacy}","received_events_url":"https://api.github.com/users/hppritcha/received_events","type":"User","site_admin":false},"body":"same here","created_at":"2015-04-20T22:47:54Z","updated_at":"2015-04-20T22:47:54Z","html_url":"https://github.com/ofi-cray/libfabric-cray/pull/104#discussion_r28736556","pull_request_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/pulls/104","_links":{"self":{"href":"https://api.github.com/repos/ofi-cray/libfabric-cray/pulls/comments/28736556"},"html":{"href":"https://github.com/ofi-cray/libfabric-cray/pull/104#discussion_r28736556"},"pull_request":{"href":"https://api.github.com/repos/ofi-cray/libfabric-cray/pulls/104"}}},"pull_request":{"url":"https://api.github.com/repos/ofi-cray/libfabric-cray/pulls/104","id":33699868,"html_url":"https://github.com/ofi-cray/libfabric-cray/pull/104","diff_url":"https://github.com/ofi-cray/libfabric-cray/pull/104.diff","patch_url":"https://github.com/ofi-cray/libfabric-cray/pull/104.patch","issue_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/issues/104","number":104,"state":"open","locked":false,"title":"Add interfaces to find max nics/rank.","user":{"login":"ztiffany","id":10633253,"avatar_url":"https://avatars.githubusercontent.com/u/10633253?v=3","gravatar_id":"","url":"https://api.github.com/users/ztiffany","html_url":"https://github.com/ztiffany","followers_url":"https://api.github.com/users/ztiffany/followers","following_url":"https://api.github.com/users/ztiffany/following{/other_user}","gists_url":"https://api.github.com/users/ztiffany/gists{/gist_id}","starred_url":"https://api.github.com/users/ztiffany/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ztiffany/subscriptions","organizations_url":"https://api.github.com/users/ztiffany/orgs","repos_url":"https://api.github.com/users/ztiffany/repos","events_url":"https://api.github.com/users/ztiffany/events{/privacy}","received_events_url":"https://api.github.com/users/ztiffany/received_events","type":"User","site_admin":false},"body":"Fixes ofi-cray/libfabric-cray#49.\r\n\r\nSigned-off-by: Zach Tiffany <ztiffany@cray.com>\r\n\r\n@hppritcha @bturrubiates @sungeunchoi \r\n\r\nThis mod pulls a lot more info out of alps and stores it in global variables.  The alps initialization is done when the first domain is created and freed when a fabric is closed.","created_at":"2015-04-20T19:54:16Z","updated_at":"2015-04-20T22:47:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f66e67ead6721fe652ebfead21690333f3f0c78","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/pulls/104/commits","review_comments_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/pulls/104/comments","review_comment_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/issues/104/comments","statuses_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/statuses/584691947510fab84a76e1c58325fc342b25bb08","head":{"label":"ztiffany:req_list","ref":"req_list","sha":"584691947510fab84a76e1c58325fc342b25bb08","user":{"login":"ztiffany","id":10633253,"avatar_url":"https://avatars.githubusercontent.com/u/10633253?v=3","gravatar_id":"","url":"https://api.github.com/users/ztiffany","html_url":"https://github.com/ztiffany","followers_url":"https://api.github.com/users/ztiffany/followers","following_url":"https://api.github.com/users/ztiffany/following{/other_user}","gists_url":"https://api.github.com/users/ztiffany/gists{/gist_id}","starred_url":"https://api.github.com/users/ztiffany/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ztiffany/subscriptions","organizations_url":"https://api.github.com/users/ztiffany/orgs","repos_url":"https://api.github.com/users/ztiffany/repos","events_url":"https://api.github.com/users/ztiffany/events{/privacy}","received_events_url":"https://api.github.com/users/ztiffany/received_events","type":"User","site_admin":false},"repo":{"id":32935123,"name":"libfabric-cray","full_name":"ztiffany/libfabric-cray","owner":{"login":"ztiffany","id":10633253,"avatar_url":"https://avatars.githubusercontent.com/u/10633253?v=3","gravatar_id":"","url":"https://api.github.com/users/ztiffany","html_url":"https://github.com/ztiffany","followers_url":"https://api.github.com/users/ztiffany/followers","following_url":"https://api.github.com/users/ztiffany/following{/other_user}","gists_url":"https://api.github.com/users/ztiffany/gists{/gist_id}","starred_url":"https://api.github.com/users/ztiffany/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ztiffany/subscriptions","organizations_url":"https://api.github.com/users/ztiffany/orgs","repos_url":"https://api.github.com/users/ztiffany/repos","events_url":"https://api.github.com/users/ztiffany/events{/privacy}","received_events_url":"https://api.github.com/users/ztiffany/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ztiffany/libfabric-cray","description":"Open Fabric Interfaces","fork":true,"url":"https://api.github.com/repos/ztiffany/libfabric-cray","forks_url":"https://api.github.com/repos/ztiffany/libfabric-cray/forks","keys_url":"https://api.github.com/repos/ztiffany/libfabric-cray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ztiffany/libfabric-cray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ztiffany/libfabric-cray/teams","hooks_url":"https://api.github.com/repos/ztiffany/libfabric-cray/hooks","issue_events_url":"https://api.github.com/repos/ztiffany/libfabric-cray/issues/events{/number}","events_url":"https://api.github.com/repos/ztiffany/libfabric-cray/events","assignees_url":"https://api.github.com/repos/ztiffany/libfabric-cray/assignees{/user}","branches_url":"https://api.github.com/repos/ztiffany/libfabric-cray/branches{/branch}","tags_url":"https://api.github.com/repos/ztiffany/libfabric-cray/tags","blobs_url":"https://api.github.com/repos/ztiffany/libfabric-cray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ztiffany/libfabric-cray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ztiffany/libfabric-cray/git/refs{/sha}","trees_url":"https://api.github.com/repos/ztiffany/libfabric-cray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ztiffany/libfabric-cray/statuses/{sha}","languages_url":"https://api.github.com/repos/ztiffany/libfabric-cray/languages","stargazers_url":"https://api.github.com/repos/ztiffany/libfabric-cray/stargazers","contributors_url":"https://api.github.com/repos/ztiffany/libfabric-cray/contributors","subscribers_url":"https://api.github.com/repos/ztiffany/libfabric-cray/subscribers","subscription_url":"https://api.github.com/repos/ztiffany/libfabric-cray/subscription","commits_url":"https://api.github.com/repos/ztiffany/libfabric-cray/commits{/sha}","git_commits_url":"https://api.github.com/repos/ztiffany/libfabric-cray/git/commits{/sha}","comments_url":"https://api.github.com/repos/ztiffany/libfabric-cray/comments{/number}","issue_comment_url":"https://api.github.com/repos/ztiffany/libfabric-cray/issues/comments{/number}","contents_url":"https://api.github.com/repos/ztiffany/libfabric-cray/contents/{+path}","compare_url":"https://api.github.com/repos/ztiffany/libfabric-cray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ztiffany/libfabric-cray/merges","archive_url":"https://api.github.com/repos/ztiffany/libfabric-cray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ztiffany/libfabric-cray/downloads","issues_url":"https://api.github.com/repos/ztiffany/libfabric-cray/issues{/number}","pulls_url":"https://api.github.com/repos/ztiffany/libfabric-cray/pulls{/number}","milestones_url":"https://api.github.com/repos/ztiffany/libfabric-cray/milestones{/number}","notifications_url":"https://api.github.com/repos/ztiffany/libfabric-cray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ztiffany/libfabric-cray/labels{/name}","releases_url":"https://api.github.com/repos/ztiffany/libfabric-cray/releases{/id}","created_at":"2015-03-26T15:19:55Z","updated_at":"2015-03-26T15:19:56Z","pushed_at":"2015-04-20T19:50:16Z","git_url":"git://github.com/ztiffany/libfabric-cray.git","ssh_url":"git@github.com:ztiffany/libfabric-cray.git","clone_url":"https://github.com/ztiffany/libfabric-cray.git","svn_url":"https://github.com/ztiffany/libfabric-cray","homepage":"http://ofiwg.github.io/libfabric/","size":6355,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"ofi-cray:master","ref":"master","sha":"37433d789900ec036c796bca4d37932593db3718","user":{"login":"ofi-cray","id":10637979,"avatar_url":"https://avatars.githubusercontent.com/u/10637979?v=3","gravatar_id":"","url":"https://api.github.com/users/ofi-cray","html_url":"https://github.com/ofi-cray","followers_url":"https://api.github.com/users/ofi-cray/followers","following_url":"https://api.github.com/users/ofi-cray/following{/other_user}","gists_url":"https://api.github.com/users/ofi-cray/gists{/gist_id}","starred_url":"https://api.github.com/users/ofi-cray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofi-cray/subscriptions","organizations_url":"https://api.github.com/users/ofi-cray/orgs","repos_url":"https://api.github.com/users/ofi-cray/repos","events_url":"https://api.github.com/users/ofi-cray/events{/privacy}","received_events_url":"https://api.github.com/users/ofi-cray/received_events","type":"Organization","site_admin":false},"repo":{"id":29607348,"name":"libfabric-cray","full_name":"ofi-cray/libfabric-cray","owner":{"login":"ofi-cray","id":10637979,"avatar_url":"https://avatars.githubusercontent.com/u/10637979?v=3","gravatar_id":"","url":"https://api.github.com/users/ofi-cray","html_url":"https://github.com/ofi-cray","followers_url":"https://api.github.com/users/ofi-cray/followers","following_url":"https://api.github.com/users/ofi-cray/following{/other_user}","gists_url":"https://api.github.com/users/ofi-cray/gists{/gist_id}","starred_url":"https://api.github.com/users/ofi-cray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofi-cray/subscriptions","organizations_url":"https://api.github.com/users/ofi-cray/orgs","repos_url":"https://api.github.com/users/ofi-cray/repos","events_url":"https://api.github.com/users/ofi-cray/events{/privacy}","received_events_url":"https://api.github.com/users/ofi-cray/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ofi-cray/libfabric-cray","description":"Open Fabric Interfaces","fork":true,"url":"https://api.github.com/repos/ofi-cray/libfabric-cray","forks_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/forks","keys_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/teams","hooks_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/hooks","issue_events_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/issues/events{/number}","events_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/events","assignees_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/assignees{/user}","branches_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/branches{/branch}","tags_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/tags","blobs_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/git/refs{/sha}","trees_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/statuses/{sha}","languages_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/languages","stargazers_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/stargazers","contributors_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/contributors","subscribers_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/subscribers","subscription_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/subscription","commits_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/commits{/sha}","git_commits_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/git/commits{/sha}","comments_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/comments{/number}","issue_comment_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/issues/comments{/number}","contents_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/contents/{+path}","compare_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/merges","archive_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/downloads","issues_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/issues{/number}","pulls_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/pulls{/number}","milestones_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/milestones{/number}","notifications_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/labels{/name}","releases_url":"https://api.github.com/repos/ofi-cray/libfabric-cray/releases{/id}","created_at":"2015-01-21T19:30:52Z","updated_at":"2015-04-20T20:18:21Z","pushed_at":"2015-04-20T20:18:21Z","git_url":"git://github.com/ofi-cray/libfabric-cray.git","ssh_url":"git@github.com:ofi-cray/libfabric-cray.git","clone_url":"https://github.com/ofi-cray/libfabric-cray.git","svn_url":"https://github.com/ofi-cray/libfabric-cray","homepage":"http://ofiwg.github.io/libfabric/","size":10008,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":25,"forks":3,"open_issues":25,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ofi-cray/libfabric-cray/pulls/104"},"html":{"href":"https://github.com/ofi-cray/libfabric-cray/pull/104"},"issue":{"href":"https://api.github.com/repos/ofi-cray/libfabric-cray/issues/104"},"comments":{"href":"https://api.github.com/repos/ofi-cray/libfabric-cray/issues/104/comments"},"review_comments":{"href":"https://api.github.com/repos/ofi-cray/libfabric-cray/pulls/104/comments"},"review_comment":{"href":"https://api.github.com/repos/ofi-cray/libfabric-cray/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ofi-cray/libfabric-cray/pulls/104/commits"},"statuses":{"href":"https://api.github.com/repos/ofi-cray/libfabric-cray/statuses/584691947510fab84a76e1c58325fc342b25bb08"}}}}