{"action":"created","comment":{"url":"https://api.github.com/repos/uber/horovod/pulls/comments/175459146","pull_request_review_id":104988054,"id":175459146,"diff_hunk":"@@ -1167,8 +1170,20 @@ void BackgroundThreadLoop(HorovodGlobalState& state) {\n   // We will ask for multiple threads, so other libraries like mpi4py can\n   // be used together with Horovod if multi-threaded MPI is installed.\n   int provided;\n-  MPI_Init_thread(NULL, NULL, MPI_THREAD_MULTIPLE, &provided);\n \n+  // Calls MPI_Init if horovod_global.auto_mpi_init is set otherwise prints warning\n+  if(horovod_global.auto_mpi_init){\n+    int is_mpi_initialized= 0;\n+    MPI_Initialized(&is_mpi_initialized);\n+    if(!is_mpi_initialized)\n+      MPI_Init_thread(NULL, NULL, MPI_THREAD_MULTIPLE, &provided);\n+  }else{\n+    MPI_Query_thread(&provided);","path":"horovod/common/operations.cc","position":32,"original_position":32,"commit_id":"e1cafebd7e6319ab3f3526868a15ca4eab381585","original_commit_id":"e1cafebd7e6319ab3f3526868a15ca4eab381585","user":{"login":"alsrgv","id":16640218,"avatar_url":"https://avatars2.githubusercontent.com/u/16640218?v=4","gravatar_id":"","url":"https://api.github.com/users/alsrgv","html_url":"https://github.com/alsrgv","followers_url":"https://api.github.com/users/alsrgv/followers","following_url":"https://api.github.com/users/alsrgv/following{/other_user}","gists_url":"https://api.github.com/users/alsrgv/gists{/gist_id}","starred_url":"https://api.github.com/users/alsrgv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alsrgv/subscriptions","organizations_url":"https://api.github.com/users/alsrgv/orgs","repos_url":"https://api.github.com/users/alsrgv/repos","events_url":"https://api.github.com/users/alsrgv/events{/privacy}","received_events_url":"https://api.github.com/users/alsrgv/received_events","type":"User","site_admin":false},"body":"Here, let's check that MPI has been initialized & provided thread level == MPI_THREAD_MULTIPLE.  If those are both true, we don't need a warning.  If they are false, we should provide a warning and say that process will now likely crash.","created_at":"2018-03-19T14:43:01Z","updated_at":"2018-03-19T14:47:44Z","html_url":"https://github.com/uber/horovod/pull/218#discussion_r175459146","pull_request_url":"https://api.github.com/repos/uber/horovod/pulls/218","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/uber/horovod/pulls/comments/175459146"},"html":{"href":"https://github.com/uber/horovod/pull/218#discussion_r175459146"},"pull_request":{"href":"https://api.github.com/repos/uber/horovod/pulls/218"}}},"pull_request":{"url":"https://api.github.com/repos/uber/horovod/pulls/218","id":175681843,"html_url":"https://github.com/uber/horovod/pull/218","diff_url":"https://github.com/uber/horovod/pull/218.diff","patch_url":"https://github.com/uber/horovod/pull/218.patch","issue_url":"https://api.github.com/repos/uber/horovod/issues/218","number":218,"state":"open","locked":false,"title":"Support for not calling MPI_Init_thread()/MPI_Finalize() in Horovod lifecycle","user":{"login":"lkmokadam","id":8169825,"avatar_url":"https://avatars1.githubusercontent.com/u/8169825?v=4","gravatar_id":"","url":"https://api.github.com/users/lkmokadam","html_url":"https://github.com/lkmokadam","followers_url":"https://api.github.com/users/lkmokadam/followers","following_url":"https://api.github.com/users/lkmokadam/following{/other_user}","gists_url":"https://api.github.com/users/lkmokadam/gists{/gist_id}","starred_url":"https://api.github.com/users/lkmokadam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lkmokadam/subscriptions","organizations_url":"https://api.github.com/users/lkmokadam/orgs","repos_url":"https://api.github.com/users/lkmokadam/repos","events_url":"https://api.github.com/users/lkmokadam/events{/privacy}","received_events_url":"https://api.github.com/users/lkmokadam/received_events","type":"User","site_admin":false},"body":"enhancement #216 and fix for potential bug due to this enhancement. \r\n\r\nimport all module after disabling MPI.Init and MPI.Finalize and \r\n   i)hvd.init(mpi_init=True, mpi_finalize=False) (run_1.py)\r\n        or \r\n   ii) calling MPI.Init (run_2.py) \r\n\r\nNew function:\r\nhvd.close()\r\n\r\ncloses horovod if mpi_finalize=False. Provides mechanism to make sure that horovod thread will not \r\ncall MPI_Finalize while other MPI threads still running.\r\nif mpi_finalize=true, this function has no effect","created_at":"2018-03-17T03:56:56Z","updated_at":"2018-03-19T14:47:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7624db03fd499a5e6511a7586c0e023faabb8fb5","assignee":{"login":"alsrgv","id":16640218,"avatar_url":"https://avatars2.githubusercontent.com/u/16640218?v=4","gravatar_id":"","url":"https://api.github.com/users/alsrgv","html_url":"https://github.com/alsrgv","followers_url":"https://api.github.com/users/alsrgv/followers","following_url":"https://api.github.com/users/alsrgv/following{/other_user}","gists_url":"https://api.github.com/users/alsrgv/gists{/gist_id}","starred_url":"https://api.github.com/users/alsrgv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alsrgv/subscriptions","organizations_url":"https://api.github.com/users/alsrgv/orgs","repos_url":"https://api.github.com/users/alsrgv/repos","events_url":"https://api.github.com/users/alsrgv/events{/privacy}","received_events_url":"https://api.github.com/users/alsrgv/received_events","type":"User","site_admin":false},"assignees":[{"login":"alsrgv","id":16640218,"avatar_url":"https://avatars2.githubusercontent.com/u/16640218?v=4","gravatar_id":"","url":"https://api.github.com/users/alsrgv","html_url":"https://github.com/alsrgv","followers_url":"https://api.github.com/users/alsrgv/followers","following_url":"https://api.github.com/users/alsrgv/following{/other_user}","gists_url":"https://api.github.com/users/alsrgv/gists{/gist_id}","starred_url":"https://api.github.com/users/alsrgv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alsrgv/subscriptions","organizations_url":"https://api.github.com/users/alsrgv/orgs","repos_url":"https://api.github.com/users/alsrgv/repos","events_url":"https://api.github.com/users/alsrgv/events{/privacy}","received_events_url":"https://api.github.com/users/alsrgv/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/uber/horovod/pulls/218/commits","review_comments_url":"https://api.github.com/repos/uber/horovod/pulls/218/comments","review_comment_url":"https://api.github.com/repos/uber/horovod/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/horovod/issues/218/comments","statuses_url":"https://api.github.com/repos/uber/horovod/statuses/e1cafebd7e6319ab3f3526868a15ca4eab381585","head":{"label":"lkmokadam:bug-fix-217","ref":"bug-fix-217","sha":"e1cafebd7e6319ab3f3526868a15ca4eab381585","user":{"login":"lkmokadam","id":8169825,"avatar_url":"https://avatars1.githubusercontent.com/u/8169825?v=4","gravatar_id":"","url":"https://api.github.com/users/lkmokadam","html_url":"https://github.com/lkmokadam","followers_url":"https://api.github.com/users/lkmokadam/followers","following_url":"https://api.github.com/users/lkmokadam/following{/other_user}","gists_url":"https://api.github.com/users/lkmokadam/gists{/gist_id}","starred_url":"https://api.github.com/users/lkmokadam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lkmokadam/subscriptions","organizations_url":"https://api.github.com/users/lkmokadam/orgs","repos_url":"https://api.github.com/users/lkmokadam/repos","events_url":"https://api.github.com/users/lkmokadam/events{/privacy}","received_events_url":"https://api.github.com/users/lkmokadam/received_events","type":"User","site_admin":false},"repo":{"id":124947256,"name":"MultiCommHorovod","full_name":"lkmokadam/MultiCommHorovod","owner":{"login":"lkmokadam","id":8169825,"avatar_url":"https://avatars1.githubusercontent.com/u/8169825?v=4","gravatar_id":"","url":"https://api.github.com/users/lkmokadam","html_url":"https://github.com/lkmokadam","followers_url":"https://api.github.com/users/lkmokadam/followers","following_url":"https://api.github.com/users/lkmokadam/following{/other_user}","gists_url":"https://api.github.com/users/lkmokadam/gists{/gist_id}","starred_url":"https://api.github.com/users/lkmokadam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lkmokadam/subscriptions","organizations_url":"https://api.github.com/users/lkmokadam/orgs","repos_url":"https://api.github.com/users/lkmokadam/repos","events_url":"https://api.github.com/users/lkmokadam/events{/privacy}","received_events_url":"https://api.github.com/users/lkmokadam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lkmokadam/MultiCommHorovod","description":"Distributed training framework for TensorFlow.","fork":true,"url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod","forks_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/forks","keys_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/teams","hooks_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/hooks","issue_events_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/issues/events{/number}","events_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/events","assignees_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/assignees{/user}","branches_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/branches{/branch}","tags_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/tags","blobs_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/git/refs{/sha}","trees_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/statuses/{sha}","languages_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/languages","stargazers_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/stargazers","contributors_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/contributors","subscribers_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/subscribers","subscription_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/subscription","commits_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/commits{/sha}","git_commits_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/git/commits{/sha}","comments_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/comments{/number}","issue_comment_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/issues/comments{/number}","contents_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/contents/{+path}","compare_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/merges","archive_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/downloads","issues_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/issues{/number}","pulls_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/pulls{/number}","milestones_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/milestones{/number}","notifications_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/labels{/name}","releases_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/releases{/id}","deployments_url":"https://api.github.com/repos/lkmokadam/MultiCommHorovod/deployments","created_at":"2018-03-12T20:26:57Z","updated_at":"2018-03-19T03:31:09Z","pushed_at":"2018-03-19T03:31:07Z","git_url":"git://github.com/lkmokadam/MultiCommHorovod.git","ssh_url":"git@github.com:lkmokadam/MultiCommHorovod.git","clone_url":"https://github.com/lkmokadam/MultiCommHorovod.git","svn_url":"https://github.com/lkmokadam/MultiCommHorovod","homepage":null,"size":317,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"uber:master","ref":"master","sha":"9ec30f81baa8ccef548b25ef1a9beb7c5843730a","user":{"login":"uber","id":538264,"avatar_url":"https://avatars3.githubusercontent.com/u/538264?v=4","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":99846383,"name":"horovod","full_name":"uber/horovod","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars3.githubusercontent.com/u/538264?v=4","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/horovod","description":"Distributed training framework for TensorFlow.","fork":false,"url":"https://api.github.com/repos/uber/horovod","forks_url":"https://api.github.com/repos/uber/horovod/forks","keys_url":"https://api.github.com/repos/uber/horovod/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/horovod/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/horovod/teams","hooks_url":"https://api.github.com/repos/uber/horovod/hooks","issue_events_url":"https://api.github.com/repos/uber/horovod/issues/events{/number}","events_url":"https://api.github.com/repos/uber/horovod/events","assignees_url":"https://api.github.com/repos/uber/horovod/assignees{/user}","branches_url":"https://api.github.com/repos/uber/horovod/branches{/branch}","tags_url":"https://api.github.com/repos/uber/horovod/tags","blobs_url":"https://api.github.com/repos/uber/horovod/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/horovod/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/horovod/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/horovod/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/horovod/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/horovod/languages","stargazers_url":"https://api.github.com/repos/uber/horovod/stargazers","contributors_url":"https://api.github.com/repos/uber/horovod/contributors","subscribers_url":"https://api.github.com/repos/uber/horovod/subscribers","subscription_url":"https://api.github.com/repos/uber/horovod/subscription","commits_url":"https://api.github.com/repos/uber/horovod/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/horovod/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/horovod/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/horovod/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/horovod/contents/{+path}","compare_url":"https://api.github.com/repos/uber/horovod/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/horovod/merges","archive_url":"https://api.github.com/repos/uber/horovod/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/horovod/downloads","issues_url":"https://api.github.com/repos/uber/horovod/issues{/number}","pulls_url":"https://api.github.com/repos/uber/horovod/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/horovod/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/horovod/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/horovod/labels{/name}","releases_url":"https://api.github.com/repos/uber/horovod/releases{/id}","deployments_url":"https://api.github.com/repos/uber/horovod/deployments","created_at":"2017-08-09T19:39:59Z","updated_at":"2018-03-19T12:45:24Z","pushed_at":"2018-03-19T14:11:47Z","git_url":"git://github.com/uber/horovod.git","ssh_url":"git@github.com:uber/horovod.git","clone_url":"https://github.com/uber/horovod.git","svn_url":"https://github.com/uber/horovod","homepage":null,"size":327,"stargazers_count":1780,"watchers_count":1780,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":238,"mirror_url":null,"archived":false,"open_issues_count":60,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":238,"open_issues":60,"watchers":1780,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/horovod/pulls/218"},"html":{"href":"https://github.com/uber/horovod/pull/218"},"issue":{"href":"https://api.github.com/repos/uber/horovod/issues/218"},"comments":{"href":"https://api.github.com/repos/uber/horovod/issues/218/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/horovod/pulls/218/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/horovod/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/horovod/pulls/218/commits"},"statuses":{"href":"https://api.github.com/repos/uber/horovod/statuses/e1cafebd7e6319ab3f3526868a15ca4eab381585"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alsrgv"}}