{"action":"created","comment":{"url":"https://api.github.com/repos/pmodels/mpich/pulls/comments/87062255","pull_request_review_id":7689157,"id":87062255,"diff_hunk":"@@ -0,0 +1,168 @@\n+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */\n+/*\n+ *  (C) 2006 by Argonne National Laboratory.\n+ *      See COPYRIGHT in top-level directory.\n+ *\n+ *  Portions of this code were written by Intel Corporation.\n+ *  Copyright (C) 2011-2016 Intel Corporation.  Intel provides this material\n+ *  to Argonne National Laboratory subject to Software Grant and Corporate\n+ *  Contributor License Agreement dated February 8, 2012.\n+ */\n+#ifndef SHM_SHMAM_EAGER_FBOX_INIT_H_INCLUDED\n+#define SHM_SHMAM_EAGER_FBOX_INIT_H_INCLUDED\n+\n+#include \"fbox_types.h\"\n+\n+extern MPIDI_SHMAM_eager_fbox_control_t MPIDI_SHMAM_eager_fbox_control_global;\n+\n+#undef FUNCNAME\n+#define FUNCNAME MPIDI_SHMAM_eager_init\n+#undef FCNAME\n+#define FCNAME MPL_QUOTE(FUNCNAME)\n+MPL_STATIC_INLINE_PREFIX int MPIDI_SHMAM_eager_init(int rank, int grank, int num_local)\n+{\n+    int mpi_errno = MPI_SUCCESS;\n+\n+    int i;\n+\n+    MPIDI_SHMAM_fastbox_t *fastboxes_p = NULL;\n+\n+    MPIR_CHKPMEM_DECL(3);\n+\n+    MPIDI_SHMAM_eager_fbox_control_global.num_seg = 1;\n+    MPIDI_SHMAM_eager_fbox_control_global.my_rank = rank;\n+    MPIDI_SHMAM_eager_fbox_control_global.my_grank = grank;\n+    MPIDI_SHMAM_eager_fbox_control_global.num_local = num_local;\n+\n+    MPIDI_SHMAM_eager_fbox_control_global.last_polled_grank = 0;\n+\n+    MPIR_CHKPMEM_MALLOC(MPIDI_SHMAM_eager_fbox_control_global.seg,\n+                        MPIDU_shm_seg_info_ptr_t,\n+                        MPIDI_SHMAM_eager_fbox_control_global.num_seg *\n+                        sizeof(MPIDU_shm_seg_info_t), mpi_errno, \"mem_region segments\");\n+\n+    /* Request fastboxes region */\n+\n+    mpi_errno =\n+        MPIDU_shm_seg_alloc(num_local * num_local * sizeof(MPIDI_SHMAM_fastbox_t),\n+                            (void **) &fastboxes_p);\n+\n+    if (mpi_errno)\n+        MPIR_ERR_POP(mpi_errno);\n+\n+    /* Request shared collective barrier vars region */\n+\n+    mpi_errno = MPIDU_shm_seg_alloc(MAX(sizeof(MPIDU_shm_barrier_t), MPIDU_SHM_CACHE_LINE_LEN),\n+                                    (void **) &MPIDI_SHMAM_eager_fbox_control_global.\n+                                    barrier_region);\n+\n+    if (mpi_errno)\n+        MPIR_ERR_POP(mpi_errno);\n+\n+    /* Actually allocate the segment and assign regions to the pointers */\n+\n+    mpi_errno = MPIDU_shm_seg_commit(&MPIDI_SHMAM_eager_fbox_control_global.memory,\n+                                     &MPIDI_SHMAM_eager_fbox_control_global.barrier,\n+                                     num_local, grank, 0, rank);\n+\n+    if (mpi_errno)\n+        MPIR_ERR_POP(mpi_errno);\n+\n+    /* Allocate table of pointers to fastboxes */\n+\n+    MPIR_CHKPMEM_MALLOC(MPIDI_SHMAM_eager_fbox_control_global.mailboxes.in,\n+                        MPIDI_SHMAM_fastbox_t **, num_local * sizeof(MPIDI_SHMAM_fastbox_t *),\n+                        mpi_errno, \"fastboxes\");\n+    MPIR_CHKPMEM_MALLOC(MPIDI_SHMAM_eager_fbox_control_global.mailboxes.out,\n+                        MPIDI_SHMAM_fastbox_t **, num_local * sizeof(MPIDI_SHMAM_fastbox_t *),\n+                        mpi_errno, \"fastboxes\");\n+\n+#define MPIDI_SHMAM_MAILBOX_INDEX(sender, receiver) ((num_local) * (sender) + (receiver))","path":"src/mpid/ch4/shm/shmam/eager/fbox/fbox_init.h","position":80,"original_position":80,"commit_id":"be4e9572775eb7735e6a9b9a26506de32dd135d7","original_commit_id":"d26c3a076bb774eda47a3ce0d2edbf1335c4fa61","user":{"login":"pavanbalaji","id":4279602,"avatar_url":"https://avatars.githubusercontent.com/u/4279602?v=3","gravatar_id":"","url":"https://api.github.com/users/pavanbalaji","html_url":"https://github.com/pavanbalaji","followers_url":"https://api.github.com/users/pavanbalaji/followers","following_url":"https://api.github.com/users/pavanbalaji/following{/other_user}","gists_url":"https://api.github.com/users/pavanbalaji/gists{/gist_id}","starred_url":"https://api.github.com/users/pavanbalaji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavanbalaji/subscriptions","organizations_url":"https://api.github.com/users/pavanbalaji/orgs","repos_url":"https://api.github.com/users/pavanbalaji/repos","events_url":"https://api.github.com/users/pavanbalaji/events{/privacy}","received_events_url":"https://api.github.com/users/pavanbalaji/received_events","type":"User","site_admin":false},"body":"Defining something in between a function is rather gross.  Can this be moved to the top?","created_at":"2016-11-08T19:16:31Z","updated_at":"2016-11-08T19:20:54Z","html_url":"https://github.com/pmodels/mpich/pull/2393#discussion_r87062255","pull_request_url":"https://api.github.com/repos/pmodels/mpich/pulls/2393","_links":{"self":{"href":"https://api.github.com/repos/pmodels/mpich/pulls/comments/87062255"},"html":{"href":"https://github.com/pmodels/mpich/pull/2393#discussion_r87062255"},"pull_request":{"href":"https://api.github.com/repos/pmodels/mpich/pulls/2393"}}},"pull_request":{"url":"https://api.github.com/repos/pmodels/mpich/pulls/2393","id":91868350,"html_url":"https://github.com/pmodels/mpich/pull/2393","diff_url":"https://github.com/pmodels/mpich/pull/2393.diff","patch_url":"https://github.com/pmodels/mpich/pull/2393.patch","issue_url":"https://api.github.com/repos/pmodels/mpich/issues/2393","number":2393,"state":"open","locked":false,"title":"Initial SHMAM implementation","user":{"login":"charlesarcher","id":8524519,"avatar_url":"https://avatars.githubusercontent.com/u/8524519?v=3","gravatar_id":"","url":"https://api.github.com/users/charlesarcher","html_url":"https://github.com/charlesarcher","followers_url":"https://api.github.com/users/charlesarcher/followers","following_url":"https://api.github.com/users/charlesarcher/following{/other_user}","gists_url":"https://api.github.com/users/charlesarcher/gists{/gist_id}","starred_url":"https://api.github.com/users/charlesarcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlesarcher/subscriptions","organizations_url":"https://api.github.com/users/charlesarcher/orgs","repos_url":"https://api.github.com/users/charlesarcher/repos","events_url":"https://api.github.com/users/charlesarcher/events{/privacy}","received_events_url":"https://api.github.com/users/charlesarcher/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-01T21:35:44Z","updated_at":"2016-11-08T19:20:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"809a96be02355aeffacac4dd0b47bbdcf58cb836","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pmodels/mpich/pulls/2393/commits","review_comments_url":"https://api.github.com/repos/pmodels/mpich/pulls/2393/comments","review_comment_url":"https://api.github.com/repos/pmodels/mpich/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pmodels/mpich/issues/2393/comments","statuses_url":"https://api.github.com/repos/pmodels/mpich/statuses/be4e9572775eb7735e6a9b9a26506de32dd135d7","head":{"label":"charlesarcher:shmam","ref":"shmam","sha":"be4e9572775eb7735e6a9b9a26506de32dd135d7","user":{"login":"charlesarcher","id":8524519,"avatar_url":"https://avatars.githubusercontent.com/u/8524519?v=3","gravatar_id":"","url":"https://api.github.com/users/charlesarcher","html_url":"https://github.com/charlesarcher","followers_url":"https://api.github.com/users/charlesarcher/followers","following_url":"https://api.github.com/users/charlesarcher/following{/other_user}","gists_url":"https://api.github.com/users/charlesarcher/gists{/gist_id}","starred_url":"https://api.github.com/users/charlesarcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlesarcher/subscriptions","organizations_url":"https://api.github.com/users/charlesarcher/orgs","repos_url":"https://api.github.com/users/charlesarcher/repos","events_url":"https://api.github.com/users/charlesarcher/events{/privacy}","received_events_url":"https://api.github.com/users/charlesarcher/received_events","type":"User","site_admin":false},"repo":{"id":71185690,"name":"mpich","full_name":"charlesarcher/mpich","owner":{"login":"charlesarcher","id":8524519,"avatar_url":"https://avatars.githubusercontent.com/u/8524519?v=3","gravatar_id":"","url":"https://api.github.com/users/charlesarcher","html_url":"https://github.com/charlesarcher","followers_url":"https://api.github.com/users/charlesarcher/followers","following_url":"https://api.github.com/users/charlesarcher/following{/other_user}","gists_url":"https://api.github.com/users/charlesarcher/gists{/gist_id}","starred_url":"https://api.github.com/users/charlesarcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlesarcher/subscriptions","organizations_url":"https://api.github.com/users/charlesarcher/orgs","repos_url":"https://api.github.com/users/charlesarcher/repos","events_url":"https://api.github.com/users/charlesarcher/events{/privacy}","received_events_url":"https://api.github.com/users/charlesarcher/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/charlesarcher/mpich","description":null,"fork":true,"url":"https://api.github.com/repos/charlesarcher/mpich","forks_url":"https://api.github.com/repos/charlesarcher/mpich/forks","keys_url":"https://api.github.com/repos/charlesarcher/mpich/keys{/key_id}","collaborators_url":"https://api.github.com/repos/charlesarcher/mpich/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/charlesarcher/mpich/teams","hooks_url":"https://api.github.com/repos/charlesarcher/mpich/hooks","issue_events_url":"https://api.github.com/repos/charlesarcher/mpich/issues/events{/number}","events_url":"https://api.github.com/repos/charlesarcher/mpich/events","assignees_url":"https://api.github.com/repos/charlesarcher/mpich/assignees{/user}","branches_url":"https://api.github.com/repos/charlesarcher/mpich/branches{/branch}","tags_url":"https://api.github.com/repos/charlesarcher/mpich/tags","blobs_url":"https://api.github.com/repos/charlesarcher/mpich/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/charlesarcher/mpich/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/charlesarcher/mpich/git/refs{/sha}","trees_url":"https://api.github.com/repos/charlesarcher/mpich/git/trees{/sha}","statuses_url":"https://api.github.com/repos/charlesarcher/mpich/statuses/{sha}","languages_url":"https://api.github.com/repos/charlesarcher/mpich/languages","stargazers_url":"https://api.github.com/repos/charlesarcher/mpich/stargazers","contributors_url":"https://api.github.com/repos/charlesarcher/mpich/contributors","subscribers_url":"https://api.github.com/repos/charlesarcher/mpich/subscribers","subscription_url":"https://api.github.com/repos/charlesarcher/mpich/subscription","commits_url":"https://api.github.com/repos/charlesarcher/mpich/commits{/sha}","git_commits_url":"https://api.github.com/repos/charlesarcher/mpich/git/commits{/sha}","comments_url":"https://api.github.com/repos/charlesarcher/mpich/comments{/number}","issue_comment_url":"https://api.github.com/repos/charlesarcher/mpich/issues/comments{/number}","contents_url":"https://api.github.com/repos/charlesarcher/mpich/contents/{+path}","compare_url":"https://api.github.com/repos/charlesarcher/mpich/compare/{base}...{head}","merges_url":"https://api.github.com/repos/charlesarcher/mpich/merges","archive_url":"https://api.github.com/repos/charlesarcher/mpich/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/charlesarcher/mpich/downloads","issues_url":"https://api.github.com/repos/charlesarcher/mpich/issues{/number}","pulls_url":"https://api.github.com/repos/charlesarcher/mpich/pulls{/number}","milestones_url":"https://api.github.com/repos/charlesarcher/mpich/milestones{/number}","notifications_url":"https://api.github.com/repos/charlesarcher/mpich/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/charlesarcher/mpich/labels{/name}","releases_url":"https://api.github.com/repos/charlesarcher/mpich/releases{/id}","deployments_url":"https://api.github.com/repos/charlesarcher/mpich/deployments","created_at":"2016-10-17T22:13:23Z","updated_at":"2016-10-17T22:13:39Z","pushed_at":"2016-11-03T21:52:21Z","git_url":"git://github.com/charlesarcher/mpich.git","ssh_url":"git@github.com:charlesarcher/mpich.git","clone_url":"https://github.com/charlesarcher/mpich.git","svn_url":"https://github.com/charlesarcher/mpich","homepage":"http://www.mpich.org","size":49264,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":false,"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":1,"default_branch":"master"}},"base":{"label":"pmodels:master","ref":"master","sha":"6f4f2515695e8a57f9713c8c309f75d10003bd97","user":{"login":"pmodels","id":15700567,"avatar_url":"https://avatars.githubusercontent.com/u/15700567?v=3","gravatar_id":"","url":"https://api.github.com/users/pmodels","html_url":"https://github.com/pmodels","followers_url":"https://api.github.com/users/pmodels/followers","following_url":"https://api.github.com/users/pmodels/following{/other_user}","gists_url":"https://api.github.com/users/pmodels/gists{/gist_id}","starred_url":"https://api.github.com/users/pmodels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmodels/subscriptions","organizations_url":"https://api.github.com/users/pmodels/orgs","repos_url":"https://api.github.com/users/pmodels/repos","events_url":"https://api.github.com/users/pmodels/events{/privacy}","received_events_url":"https://api.github.com/users/pmodels/received_events","type":"Organization","site_admin":false},"repo":{"id":70918679,"name":"mpich","full_name":"pmodels/mpich","owner":{"login":"pmodels","id":15700567,"avatar_url":"https://avatars.githubusercontent.com/u/15700567?v=3","gravatar_id":"","url":"https://api.github.com/users/pmodels","html_url":"https://github.com/pmodels","followers_url":"https://api.github.com/users/pmodels/followers","following_url":"https://api.github.com/users/pmodels/following{/other_user}","gists_url":"https://api.github.com/users/pmodels/gists{/gist_id}","starred_url":"https://api.github.com/users/pmodels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmodels/subscriptions","organizations_url":"https://api.github.com/users/pmodels/orgs","repos_url":"https://api.github.com/users/pmodels/repos","events_url":"https://api.github.com/users/pmodels/events{/privacy}","received_events_url":"https://api.github.com/users/pmodels/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pmodels/mpich","description":"Official MPICH Repository","fork":false,"url":"https://api.github.com/repos/pmodels/mpich","forks_url":"https://api.github.com/repos/pmodels/mpich/forks","keys_url":"https://api.github.com/repos/pmodels/mpich/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pmodels/mpich/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pmodels/mpich/teams","hooks_url":"https://api.github.com/repos/pmodels/mpich/hooks","issue_events_url":"https://api.github.com/repos/pmodels/mpich/issues/events{/number}","events_url":"https://api.github.com/repos/pmodels/mpich/events","assignees_url":"https://api.github.com/repos/pmodels/mpich/assignees{/user}","branches_url":"https://api.github.com/repos/pmodels/mpich/branches{/branch}","tags_url":"https://api.github.com/repos/pmodels/mpich/tags","blobs_url":"https://api.github.com/repos/pmodels/mpich/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pmodels/mpich/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pmodels/mpich/git/refs{/sha}","trees_url":"https://api.github.com/repos/pmodels/mpich/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pmodels/mpich/statuses/{sha}","languages_url":"https://api.github.com/repos/pmodels/mpich/languages","stargazers_url":"https://api.github.com/repos/pmodels/mpich/stargazers","contributors_url":"https://api.github.com/repos/pmodels/mpich/contributors","subscribers_url":"https://api.github.com/repos/pmodels/mpich/subscribers","subscription_url":"https://api.github.com/repos/pmodels/mpich/subscription","commits_url":"https://api.github.com/repos/pmodels/mpich/commits{/sha}","git_commits_url":"https://api.github.com/repos/pmodels/mpich/git/commits{/sha}","comments_url":"https://api.github.com/repos/pmodels/mpich/comments{/number}","issue_comment_url":"https://api.github.com/repos/pmodels/mpich/issues/comments{/number}","contents_url":"https://api.github.com/repos/pmodels/mpich/contents/{+path}","compare_url":"https://api.github.com/repos/pmodels/mpich/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pmodels/mpich/merges","archive_url":"https://api.github.com/repos/pmodels/mpich/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pmodels/mpich/downloads","issues_url":"https://api.github.com/repos/pmodels/mpich/issues{/number}","pulls_url":"https://api.github.com/repos/pmodels/mpich/pulls{/number}","milestones_url":"https://api.github.com/repos/pmodels/mpich/milestones{/number}","notifications_url":"https://api.github.com/repos/pmodels/mpich/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pmodels/mpich/labels{/name}","releases_url":"https://api.github.com/repos/pmodels/mpich/releases{/id}","deployments_url":"https://api.github.com/repos/pmodels/mpich/deployments","created_at":"2016-10-14T14:39:42Z","updated_at":"2016-11-01T20:39:42Z","pushed_at":"2016-11-08T19:09:34Z","git_url":"git://github.com/pmodels/mpich.git","ssh_url":"git@github.com:pmodels/mpich.git","clone_url":"https://github.com/pmodels/mpich.git","svn_url":"https://github.com/pmodels/mpich","homepage":"http://www.mpich.org","size":50135,"stargazers_count":23,"watchers_count":23,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":326,"forks":16,"open_issues":326,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pmodels/mpich/pulls/2393"},"html":{"href":"https://github.com/pmodels/mpich/pull/2393"},"issue":{"href":"https://api.github.com/repos/pmodels/mpich/issues/2393"},"comments":{"href":"https://api.github.com/repos/pmodels/mpich/issues/2393/comments"},"review_comments":{"href":"https://api.github.com/repos/pmodels/mpich/pulls/2393/comments"},"review_comment":{"href":"https://api.github.com/repos/pmodels/mpich/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pmodels/mpich/pulls/2393/commits"},"statuses":{"href":"https://api.github.com/repos/pmodels/mpich/statuses/be4e9572775eb7735e6a9b9a26506de32dd135d7"}}}}
{"actor":{"display_login":"pavanbalaji"}}