{"action":"created","comment":{"url":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments/61952425","id":61952425,"diff_hunk":"@@ -395,20 +400,14 @@ module LocaleModel {\n     const node = chpl_nodeFromLocaleID(loc);\n     if (node == chpl_nodeID) {\n       if __primitive(\"task_get_serial\") then\n-        // don't call the runtime nb execute_on function if we can stay local\n         chpl_ftable_call(fn, args);\n       else\n-        // We'd like to use a begin, but unfortunately doing so as\n-        // follows does not compile for --no-local:\n-        // begin chpl_ftable_call(fn, args);\n-        chpl_comm_execute_on_nb(node, chpl_sublocFromLocaleID(loc),\n-                          fn, args, args_size);\n+        chpl_task_taskCallFTable(fn, args, args_size, c_sublocid_any);\n     } else {\n-      const subloc = chpl_sublocFromLocaleID(loc);\n       if __primitive(\"task_get_serial\") then\n-        chpl_comm_execute_on(node, subloc, fn, args, args_size);\n+        chpl_comm_execute_on(node, c_sublocid_any, fn, args, args_size);\n       else\n-        chpl_comm_execute_on_nb(node, subloc, fn, args, args_size);\n+        chpl_comm_execute_on_nb(node, c_sublocid_any, fn, args, args_size);","path":"modules/internal/localeModels/flat/LocaleModel.chpl","position":51,"original_position":51,"commit_id":"45a70603747b1d99847ad6b88d772af17a40b6b3","original_commit_id":"45a70603747b1d99847ad6b88d772af17a40b6b3","user":{"login":"gbtitus","id":7740880,"avatar_url":"https://avatars.githubusercontent.com/u/7740880?v=3","gravatar_id":"","url":"https://api.github.com/users/gbtitus","html_url":"https://github.com/gbtitus","followers_url":"https://api.github.com/users/gbtitus/followers","following_url":"https://api.github.com/users/gbtitus/following{/other_user}","gists_url":"https://api.github.com/users/gbtitus/gists{/gist_id}","starred_url":"https://api.github.com/users/gbtitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbtitus/subscriptions","organizations_url":"https://api.github.com/users/gbtitus/orgs","repos_url":"https://api.github.com/users/gbtitus/repos","events_url":"https://api.github.com/users/gbtitus/events{/privacy}","received_events_url":"https://api.github.com/users/gbtitus/received_events","type":"User","site_admin":false},"body":"Nope, I was wrong.  It's better to use 'any' here.  There are checks in the runtime about not using 'none' in places where it would be hard to do the check differently for flat and numa.","created_at":"2016-05-03T20:42:42Z","updated_at":"2016-05-03T20:42:42Z","html_url":"https://github.com/chapel-lang/chapel/pull/3817#discussion_r61952425","pull_request_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/3817","_links":{"self":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments/61952425"},"html":{"href":"https://github.com/chapel-lang/chapel/pull/3817#discussion_r61952425"},"pull_request":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/3817"}}},"pull_request":{"url":"https://api.github.com/repos/chapel-lang/chapel/pulls/3817","id":68720015,"html_url":"https://github.com/chapel-lang/chapel/pull/3817","diff_url":"https://github.com/chapel-lang/chapel/pull/3817.diff","patch_url":"https://github.com/chapel-lang/chapel/pull/3817.patch","issue_url":"https://api.github.com/repos/chapel-lang/chapel/issues/3817","number":3817,"state":"open","locked":false,"title":"Simplify and speed up chpl_executeOn().","user":{"login":"gbtitus","id":7740880,"avatar_url":"https://avatars.githubusercontent.com/u/7740880?v=3","gravatar_id":"","url":"https://api.github.com/users/gbtitus","html_url":"https://github.com/gbtitus","followers_url":"https://api.github.com/users/gbtitus/followers","following_url":"https://api.github.com/users/gbtitus/following{/other_user}","gists_url":"https://api.github.com/users/gbtitus/gists{/gist_id}","starred_url":"https://api.github.com/users/gbtitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbtitus/subscriptions","organizations_url":"https://api.github.com/users/gbtitus/orgs","repos_url":"https://api.github.com/users/gbtitus/repos","events_url":"https://api.github.com/users/gbtitus/events{/privacy}","received_events_url":"https://api.github.com/users/gbtitus/received_events","type":"User","site_admin":false},"body":"For chpl_executeOnNB()s that are network-local we've been (ab)using\r\nchpl_comm_execute_on_NB() to initiate an asynchronous local task.  Here\r\nwe update the tasking layer interface to do this directly instead.\r\n\r\nSpecifically, we add chpl_task_taskCall() and chpl_task_taskCallFTable(),\r\nwhich create tasks to call a pointed-to function or a function out of\r\nchpl_ftable[], respectively.  The former is implemented in each of the\r\ntasking layers, while the latter is just a thin shim in chpl-tasks.h.  As\r\npart of doing this I also adjusted chpl_task_startMovedTask() so that it\r\nand chpl_task_taskCall() share most of their code, since the two are\r\nquite similar.  (In fact, when chpl_comm_execute_on_NB() was being used\r\nto do asynchronous local calls chpl_task_startMovedTask() was the tool it\r\nused to do so.)\r\n\r\nWith these available, I adjusted chpl_executeOnNB() in the flat and numa\r\nlocale models to use chpl_task_taskCallFTable() in the local, parallel\r\ncase.  While in that code I also did some cleanup, reordering an if-stmt\r\nin numa so that it tested for local instead of nonlocal (more natural\r\nand now matches flat), fixing white space here and there, and removing\r\nsome superfluous or incorrect comments.\r\n\r\nI believe there is a performance improvement that could still be made in\r\nthis code.  executeOn body argument bundles are dynamically allocated by\r\nthe calling code, then freed by that code after the task creation\r\nrequest is made to the runtime.  Because the bundle free() occurs right\r\naway, in the executeOnNB case probably before the task actually runs,\r\nthe runtime has to make a copy of the bundle for the task to use.  If we\r\ncould change the compiler/runtime contract so that the emitted code\r\nallocated the bundle and the runtime was responsible for freeing it, we\r\ncould save the extra allocate/copy/free in the executeOnNB case.","created_at":"2016-05-03T15:00:48Z","updated_at":"2016-05-03T20:42:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"49d8fda99790fdf07cdba27183aef1f344018ea4","assignee":{"login":"ronawho","id":1588337,"avatar_url":"https://avatars.githubusercontent.com/u/1588337?v=3","gravatar_id":"","url":"https://api.github.com/users/ronawho","html_url":"https://github.com/ronawho","followers_url":"https://api.github.com/users/ronawho/followers","following_url":"https://api.github.com/users/ronawho/following{/other_user}","gists_url":"https://api.github.com/users/ronawho/gists{/gist_id}","starred_url":"https://api.github.com/users/ronawho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronawho/subscriptions","organizations_url":"https://api.github.com/users/ronawho/orgs","repos_url":"https://api.github.com/users/ronawho/repos","events_url":"https://api.github.com/users/ronawho/events{/privacy}","received_events_url":"https://api.github.com/users/ronawho/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/3817/commits","review_comments_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/3817/comments","review_comment_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/issues/3817/comments","statuses_url":"https://api.github.com/repos/chapel-lang/chapel/statuses/45a70603747b1d99847ad6b88d772af17a40b6b3","head":{"label":"gbtitus:taskCall","ref":"taskCall","sha":"45a70603747b1d99847ad6b88d772af17a40b6b3","user":{"login":"gbtitus","id":7740880,"avatar_url":"https://avatars.githubusercontent.com/u/7740880?v=3","gravatar_id":"","url":"https://api.github.com/users/gbtitus","html_url":"https://github.com/gbtitus","followers_url":"https://api.github.com/users/gbtitus/followers","following_url":"https://api.github.com/users/gbtitus/following{/other_user}","gists_url":"https://api.github.com/users/gbtitus/gists{/gist_id}","starred_url":"https://api.github.com/users/gbtitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbtitus/subscriptions","organizations_url":"https://api.github.com/users/gbtitus/orgs","repos_url":"https://api.github.com/users/gbtitus/repos","events_url":"https://api.github.com/users/gbtitus/events{/privacy}","received_events_url":"https://api.github.com/users/gbtitus/received_events","type":"User","site_admin":false},"repo":{"id":21912579,"name":"chapel","full_name":"gbtitus/chapel","owner":{"login":"gbtitus","id":7740880,"avatar_url":"https://avatars.githubusercontent.com/u/7740880?v=3","gravatar_id":"","url":"https://api.github.com/users/gbtitus","html_url":"https://github.com/gbtitus","followers_url":"https://api.github.com/users/gbtitus/followers","following_url":"https://api.github.com/users/gbtitus/following{/other_user}","gists_url":"https://api.github.com/users/gbtitus/gists{/gist_id}","starred_url":"https://api.github.com/users/gbtitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbtitus/subscriptions","organizations_url":"https://api.github.com/users/gbtitus/orgs","repos_url":"https://api.github.com/users/gbtitus/repos","events_url":"https://api.github.com/users/gbtitus/events{/privacy}","received_events_url":"https://api.github.com/users/gbtitus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gbtitus/chapel","description":"a Productive Parallel Programming Language","fork":true,"url":"https://api.github.com/repos/gbtitus/chapel","forks_url":"https://api.github.com/repos/gbtitus/chapel/forks","keys_url":"https://api.github.com/repos/gbtitus/chapel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gbtitus/chapel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gbtitus/chapel/teams","hooks_url":"https://api.github.com/repos/gbtitus/chapel/hooks","issue_events_url":"https://api.github.com/repos/gbtitus/chapel/issues/events{/number}","events_url":"https://api.github.com/repos/gbtitus/chapel/events","assignees_url":"https://api.github.com/repos/gbtitus/chapel/assignees{/user}","branches_url":"https://api.github.com/repos/gbtitus/chapel/branches{/branch}","tags_url":"https://api.github.com/repos/gbtitus/chapel/tags","blobs_url":"https://api.github.com/repos/gbtitus/chapel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gbtitus/chapel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gbtitus/chapel/git/refs{/sha}","trees_url":"https://api.github.com/repos/gbtitus/chapel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gbtitus/chapel/statuses/{sha}","languages_url":"https://api.github.com/repos/gbtitus/chapel/languages","stargazers_url":"https://api.github.com/repos/gbtitus/chapel/stargazers","contributors_url":"https://api.github.com/repos/gbtitus/chapel/contributors","subscribers_url":"https://api.github.com/repos/gbtitus/chapel/subscribers","subscription_url":"https://api.github.com/repos/gbtitus/chapel/subscription","commits_url":"https://api.github.com/repos/gbtitus/chapel/commits{/sha}","git_commits_url":"https://api.github.com/repos/gbtitus/chapel/git/commits{/sha}","comments_url":"https://api.github.com/repos/gbtitus/chapel/comments{/number}","issue_comment_url":"https://api.github.com/repos/gbtitus/chapel/issues/comments{/number}","contents_url":"https://api.github.com/repos/gbtitus/chapel/contents/{+path}","compare_url":"https://api.github.com/repos/gbtitus/chapel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gbtitus/chapel/merges","archive_url":"https://api.github.com/repos/gbtitus/chapel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gbtitus/chapel/downloads","issues_url":"https://api.github.com/repos/gbtitus/chapel/issues{/number}","pulls_url":"https://api.github.com/repos/gbtitus/chapel/pulls{/number}","milestones_url":"https://api.github.com/repos/gbtitus/chapel/milestones{/number}","notifications_url":"https://api.github.com/repos/gbtitus/chapel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gbtitus/chapel/labels{/name}","releases_url":"https://api.github.com/repos/gbtitus/chapel/releases{/id}","deployments_url":"https://api.github.com/repos/gbtitus/chapel/deployments","created_at":"2014-07-16T18:39:09Z","updated_at":"2016-01-14T23:12:27Z","pushed_at":"2016-05-03T15:00:23Z","git_url":"git://github.com/gbtitus/chapel.git","ssh_url":"git@github.com:gbtitus/chapel.git","clone_url":"https://github.com/gbtitus/chapel.git","svn_url":"https://github.com/gbtitus/chapel","homepage":"http://chapel.cray.com/","size":364244,"stargazers_count":2,"watchers_count":2,"language":"Chapel","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"chapel-lang:master","ref":"master","sha":"e4e18d3e3cf02c8a8a627f9b7bb1d7a11ad76834","user":{"login":"chapel-lang","id":7597261,"avatar_url":"https://avatars.githubusercontent.com/u/7597261?v=3","gravatar_id":"","url":"https://api.github.com/users/chapel-lang","html_url":"https://github.com/chapel-lang","followers_url":"https://api.github.com/users/chapel-lang/followers","following_url":"https://api.github.com/users/chapel-lang/following{/other_user}","gists_url":"https://api.github.com/users/chapel-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/chapel-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chapel-lang/subscriptions","organizations_url":"https://api.github.com/users/chapel-lang/orgs","repos_url":"https://api.github.com/users/chapel-lang/repos","events_url":"https://api.github.com/users/chapel-lang/events{/privacy}","received_events_url":"https://api.github.com/users/chapel-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":21663285,"name":"chapel","full_name":"chapel-lang/chapel","owner":{"login":"chapel-lang","id":7597261,"avatar_url":"https://avatars.githubusercontent.com/u/7597261?v=3","gravatar_id":"","url":"https://api.github.com/users/chapel-lang","html_url":"https://github.com/chapel-lang","followers_url":"https://api.github.com/users/chapel-lang/followers","following_url":"https://api.github.com/users/chapel-lang/following{/other_user}","gists_url":"https://api.github.com/users/chapel-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/chapel-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chapel-lang/subscriptions","organizations_url":"https://api.github.com/users/chapel-lang/orgs","repos_url":"https://api.github.com/users/chapel-lang/repos","events_url":"https://api.github.com/users/chapel-lang/events{/privacy}","received_events_url":"https://api.github.com/users/chapel-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chapel-lang/chapel","description":"a Productive Parallel Programming Language","fork":false,"url":"https://api.github.com/repos/chapel-lang/chapel","forks_url":"https://api.github.com/repos/chapel-lang/chapel/forks","keys_url":"https://api.github.com/repos/chapel-lang/chapel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chapel-lang/chapel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chapel-lang/chapel/teams","hooks_url":"https://api.github.com/repos/chapel-lang/chapel/hooks","issue_events_url":"https://api.github.com/repos/chapel-lang/chapel/issues/events{/number}","events_url":"https://api.github.com/repos/chapel-lang/chapel/events","assignees_url":"https://api.github.com/repos/chapel-lang/chapel/assignees{/user}","branches_url":"https://api.github.com/repos/chapel-lang/chapel/branches{/branch}","tags_url":"https://api.github.com/repos/chapel-lang/chapel/tags","blobs_url":"https://api.github.com/repos/chapel-lang/chapel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chapel-lang/chapel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chapel-lang/chapel/git/refs{/sha}","trees_url":"https://api.github.com/repos/chapel-lang/chapel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chapel-lang/chapel/statuses/{sha}","languages_url":"https://api.github.com/repos/chapel-lang/chapel/languages","stargazers_url":"https://api.github.com/repos/chapel-lang/chapel/stargazers","contributors_url":"https://api.github.com/repos/chapel-lang/chapel/contributors","subscribers_url":"https://api.github.com/repos/chapel-lang/chapel/subscribers","subscription_url":"https://api.github.com/repos/chapel-lang/chapel/subscription","commits_url":"https://api.github.com/repos/chapel-lang/chapel/commits{/sha}","git_commits_url":"https://api.github.com/repos/chapel-lang/chapel/git/commits{/sha}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/comments{/number}","issue_comment_url":"https://api.github.com/repos/chapel-lang/chapel/issues/comments{/number}","contents_url":"https://api.github.com/repos/chapel-lang/chapel/contents/{+path}","compare_url":"https://api.github.com/repos/chapel-lang/chapel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chapel-lang/chapel/merges","archive_url":"https://api.github.com/repos/chapel-lang/chapel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chapel-lang/chapel/downloads","issues_url":"https://api.github.com/repos/chapel-lang/chapel/issues{/number}","pulls_url":"https://api.github.com/repos/chapel-lang/chapel/pulls{/number}","milestones_url":"https://api.github.com/repos/chapel-lang/chapel/milestones{/number}","notifications_url":"https://api.github.com/repos/chapel-lang/chapel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chapel-lang/chapel/labels{/name}","releases_url":"https://api.github.com/repos/chapel-lang/chapel/releases{/id}","deployments_url":"https://api.github.com/repos/chapel-lang/chapel/deployments","created_at":"2014-07-09T18:15:54Z","updated_at":"2016-04-30T16:38:08Z","pushed_at":"2016-05-03T19:59:05Z","git_url":"git://github.com/chapel-lang/chapel.git","ssh_url":"git@github.com:chapel-lang/chapel.git","clone_url":"https://github.com/chapel-lang/chapel.git","svn_url":"https://github.com/chapel-lang/chapel","homepage":"http://chapel.cray.com/","size":469750,"stargazers_count":257,"watchers_count":257,"language":"Chapel","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":100,"mirror_url":null,"open_issues_count":17,"forks":100,"open_issues":17,"watchers":257,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/3817"},"html":{"href":"https://github.com/chapel-lang/chapel/pull/3817"},"issue":{"href":"https://api.github.com/repos/chapel-lang/chapel/issues/3817"},"comments":{"href":"https://api.github.com/repos/chapel-lang/chapel/issues/3817/comments"},"review_comments":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/3817/comments"},"review_comment":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/3817/commits"},"statuses":{"href":"https://api.github.com/repos/chapel-lang/chapel/statuses/45a70603747b1d99847ad6b88d772af17a40b6b3"}}}}