{"action":"created","comment":{"url":"https://api.github.com/repos/gem/oq-risklib/pulls/comments/34132097","id":34132097,"diff_hunk":"@@ -1,23 +1,69 @@\n The concept of effective realizations\n ==============================================\n \n-The management of the logic trees is the most complex thing in the\n-OpenQuake libraries. The problem is that it is necessary to implement logic\n-trees in an efficient way, otherwise the engine will not be able to\n-cope with large computations.\n-To this aim we introduced the concept of *effective\n-realizations*. There are common situations where it is\n-possible to reduce the full logic tree of a computation to a much\n-smaller one. The engine takes full advantage of such situations.\n-\n-Reduction of the logic tree (full enumeration)\n+The management of the logic trees is the most complicated thing in the\n+OpenQuake libraries. The issue is that it is necessary to manage them\n+in an efficient way, by avoiding redundant computation and storage,\n+otherwise the engine will not be able to cope with large computations.\n+\n+Historically the engine did not fare well in the case of complex logic\n+trees. In recent years we improved the situation by introducing the\n+concept of *effective realizations*. After realizing that in many\n+calculations it is possible to reduce the full logic tree (the tree of\n+the potential realizations) to a much smaller one\n+(the tree of the effective realizations), we implemented an engine\n+optimization to take advantage of such situations. Here I will\n+explain how the optimization work.\n+\n+First, it is best to give some terminology.\n+\n+1. for each source model in the source model logic tree there is a\n+   different GMPE logic tree\n+2. the total number of realizations is the sum of the number of realizations\n+   of each GMPE logic tree\n+3. a GMPE logic tree is *trivial* if has no tectonic region types with","path":"doc/effective-realizations.rst","position":34,"original_position":34,"commit_id":"9b6251276dbadf7ec42d95b23f5c38bffbb6a7ad","original_commit_id":"9b6251276dbadf7ec42d95b23f5c38bffbb6a7ad","user":{"login":"micheles","id":2463856,"avatar_url":"https://avatars.githubusercontent.com/u/2463856?v=3","gravatar_id":"","url":"https://api.github.com/users/micheles","html_url":"https://github.com/micheles","followers_url":"https://api.github.com/users/micheles/followers","following_url":"https://api.github.com/users/micheles/following{/other_user}","gists_url":"https://api.github.com/users/micheles/gists{/gist_id}","starred_url":"https://api.github.com/users/micheles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micheles/subscriptions","organizations_url":"https://api.github.com/users/micheles/orgs","repos_url":"https://api.github.com/users/micheles/repos","events_url":"https://api.github.com/users/micheles/events{/privacy}","received_events_url":"https://api.github.com/users/micheles/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2015-07-08T09:55:52Z","updated_at":"2015-07-08T09:55:52Z","html_url":"https://github.com/gem/oq-risklib/pull/315#discussion_r34132097","pull_request_url":"https://api.github.com/repos/gem/oq-risklib/pulls/315","_links":{"self":{"href":"https://api.github.com/repos/gem/oq-risklib/pulls/comments/34132097"},"html":{"href":"https://github.com/gem/oq-risklib/pull/315#discussion_r34132097"},"pull_request":{"href":"https://api.github.com/repos/gem/oq-risklib/pulls/315"}}},"pull_request":{"url":"https://api.github.com/repos/gem/oq-risklib/pulls/315","id":39245832,"html_url":"https://github.com/gem/oq-risklib/pull/315","diff_url":"https://github.com/gem/oq-risklib/pull/315.diff","patch_url":"https://github.com/gem/oq-risklib/pull/315.patch","issue_url":"https://api.github.com/repos/gem/oq-risklib/issues/315","number":315,"state":"open","locked":false,"title":"Added a report tool","user":{"login":"micheles","id":2463856,"avatar_url":"https://avatars.githubusercontent.com/u/2463856?v=3","gravatar_id":"","url":"https://api.github.com/users/micheles","html_url":"https://github.com/micheles","followers_url":"https://api.github.com/users/micheles/followers","following_url":"https://api.github.com/users/micheles/following{/other_user}","gists_url":"https://api.github.com/users/micheles/gists{/gist_id}","starred_url":"https://api.github.com/users/micheles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micheles/subscriptions","organizations_url":"https://api.github.com/users/micheles/orgs","repos_url":"https://api.github.com/users/micheles/repos","events_url":"https://api.github.com/users/micheles/events{/privacy}","received_events_url":"https://api.github.com/users/micheles/received_events","type":"User","site_admin":false},"body":"See https://bugs.launchpad.net/oq-engine/+bug/1471648. Also, a lot of refactoring was done.\r\nThe tests are green: https://ci.openquake.org/job/zdevel_oq-risklib/836/","created_at":"2015-07-06T08:35:03Z","updated_at":"2015-07-08T09:55:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eeae995b6f64e8216e3989c4305373e6fb4f9966","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gem/oq-risklib/pulls/315/commits","review_comments_url":"https://api.github.com/repos/gem/oq-risklib/pulls/315/comments","review_comment_url":"https://api.github.com/repos/gem/oq-risklib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gem/oq-risklib/issues/315/comments","statuses_url":"https://api.github.com/repos/gem/oq-risklib/statuses/9b6251276dbadf7ec42d95b23f5c38bffbb6a7ad","head":{"label":"gem:sampling","ref":"sampling","sha":"9b6251276dbadf7ec42d95b23f5c38bffbb6a7ad","user":{"login":"gem","id":316546,"avatar_url":"https://avatars.githubusercontent.com/u/316546?v=3","gravatar_id":"","url":"https://api.github.com/users/gem","html_url":"https://github.com/gem","followers_url":"https://api.github.com/users/gem/followers","following_url":"https://api.github.com/users/gem/following{/other_user}","gists_url":"https://api.github.com/users/gem/gists{/gist_id}","starred_url":"https://api.github.com/users/gem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gem/subscriptions","organizations_url":"https://api.github.com/users/gem/orgs","repos_url":"https://api.github.com/users/gem/repos","events_url":"https://api.github.com/users/gem/events{/privacy}","received_events_url":"https://api.github.com/users/gem/received_events","type":"Organization","site_admin":false},"repo":{"id":5856509,"name":"oq-risklib","full_name":"gem/oq-risklib","owner":{"login":"gem","id":316546,"avatar_url":"https://avatars.githubusercontent.com/u/316546?v=3","gravatar_id":"","url":"https://api.github.com/users/gem","html_url":"https://github.com/gem","followers_url":"https://api.github.com/users/gem/followers","following_url":"https://api.github.com/users/gem/following{/other_user}","gists_url":"https://api.github.com/users/gem/gists{/gist_id}","starred_url":"https://api.github.com/users/gem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gem/subscriptions","organizations_url":"https://api.github.com/users/gem/orgs","repos_url":"https://api.github.com/users/gem/repos","events_url":"https://api.github.com/users/gem/events{/privacy}","received_events_url":"https://api.github.com/users/gem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gem/oq-risklib","description":"OpenQuake Risk Library","fork":false,"url":"https://api.github.com/repos/gem/oq-risklib","forks_url":"https://api.github.com/repos/gem/oq-risklib/forks","keys_url":"https://api.github.com/repos/gem/oq-risklib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gem/oq-risklib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gem/oq-risklib/teams","hooks_url":"https://api.github.com/repos/gem/oq-risklib/hooks","issue_events_url":"https://api.github.com/repos/gem/oq-risklib/issues/events{/number}","events_url":"https://api.github.com/repos/gem/oq-risklib/events","assignees_url":"https://api.github.com/repos/gem/oq-risklib/assignees{/user}","branches_url":"https://api.github.com/repos/gem/oq-risklib/branches{/branch}","tags_url":"https://api.github.com/repos/gem/oq-risklib/tags","blobs_url":"https://api.github.com/repos/gem/oq-risklib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gem/oq-risklib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gem/oq-risklib/git/refs{/sha}","trees_url":"https://api.github.com/repos/gem/oq-risklib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gem/oq-risklib/statuses/{sha}","languages_url":"https://api.github.com/repos/gem/oq-risklib/languages","stargazers_url":"https://api.github.com/repos/gem/oq-risklib/stargazers","contributors_url":"https://api.github.com/repos/gem/oq-risklib/contributors","subscribers_url":"https://api.github.com/repos/gem/oq-risklib/subscribers","subscription_url":"https://api.github.com/repos/gem/oq-risklib/subscription","commits_url":"https://api.github.com/repos/gem/oq-risklib/commits{/sha}","git_commits_url":"https://api.github.com/repos/gem/oq-risklib/git/commits{/sha}","comments_url":"https://api.github.com/repos/gem/oq-risklib/comments{/number}","issue_comment_url":"https://api.github.com/repos/gem/oq-risklib/issues/comments{/number}","contents_url":"https://api.github.com/repos/gem/oq-risklib/contents/{+path}","compare_url":"https://api.github.com/repos/gem/oq-risklib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gem/oq-risklib/merges","archive_url":"https://api.github.com/repos/gem/oq-risklib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gem/oq-risklib/downloads","issues_url":"https://api.github.com/repos/gem/oq-risklib/issues{/number}","pulls_url":"https://api.github.com/repos/gem/oq-risklib/pulls{/number}","milestones_url":"https://api.github.com/repos/gem/oq-risklib/milestones{/number}","notifications_url":"https://api.github.com/repos/gem/oq-risklib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gem/oq-risklib/labels{/name}","releases_url":"https://api.github.com/repos/gem/oq-risklib/releases{/id}","created_at":"2012-09-18T13:07:14Z","updated_at":"2015-05-08T14:27:00Z","pushed_at":"2015-07-08T09:52:33Z","git_url":"git://github.com/gem/oq-risklib.git","ssh_url":"git@github.com:gem/oq-risklib.git","clone_url":"https://github.com/gem/oq-risklib.git","svn_url":"https://github.com/gem/oq-risklib","homepage":"http://www.globalquakemodel.org/openquake/","size":28488,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":7,"forks":12,"open_issues":7,"watchers":8,"default_branch":"master"}},"base":{"label":"gem:master","ref":"master","sha":"4a55578a97482c4b23db6173c600381c746226e9","user":{"login":"gem","id":316546,"avatar_url":"https://avatars.githubusercontent.com/u/316546?v=3","gravatar_id":"","url":"https://api.github.com/users/gem","html_url":"https://github.com/gem","followers_url":"https://api.github.com/users/gem/followers","following_url":"https://api.github.com/users/gem/following{/other_user}","gists_url":"https://api.github.com/users/gem/gists{/gist_id}","starred_url":"https://api.github.com/users/gem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gem/subscriptions","organizations_url":"https://api.github.com/users/gem/orgs","repos_url":"https://api.github.com/users/gem/repos","events_url":"https://api.github.com/users/gem/events{/privacy}","received_events_url":"https://api.github.com/users/gem/received_events","type":"Organization","site_admin":false},"repo":{"id":5856509,"name":"oq-risklib","full_name":"gem/oq-risklib","owner":{"login":"gem","id":316546,"avatar_url":"https://avatars.githubusercontent.com/u/316546?v=3","gravatar_id":"","url":"https://api.github.com/users/gem","html_url":"https://github.com/gem","followers_url":"https://api.github.com/users/gem/followers","following_url":"https://api.github.com/users/gem/following{/other_user}","gists_url":"https://api.github.com/users/gem/gists{/gist_id}","starred_url":"https://api.github.com/users/gem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gem/subscriptions","organizations_url":"https://api.github.com/users/gem/orgs","repos_url":"https://api.github.com/users/gem/repos","events_url":"https://api.github.com/users/gem/events{/privacy}","received_events_url":"https://api.github.com/users/gem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gem/oq-risklib","description":"OpenQuake Risk Library","fork":false,"url":"https://api.github.com/repos/gem/oq-risklib","forks_url":"https://api.github.com/repos/gem/oq-risklib/forks","keys_url":"https://api.github.com/repos/gem/oq-risklib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gem/oq-risklib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gem/oq-risklib/teams","hooks_url":"https://api.github.com/repos/gem/oq-risklib/hooks","issue_events_url":"https://api.github.com/repos/gem/oq-risklib/issues/events{/number}","events_url":"https://api.github.com/repos/gem/oq-risklib/events","assignees_url":"https://api.github.com/repos/gem/oq-risklib/assignees{/user}","branches_url":"https://api.github.com/repos/gem/oq-risklib/branches{/branch}","tags_url":"https://api.github.com/repos/gem/oq-risklib/tags","blobs_url":"https://api.github.com/repos/gem/oq-risklib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gem/oq-risklib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gem/oq-risklib/git/refs{/sha}","trees_url":"https://api.github.com/repos/gem/oq-risklib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gem/oq-risklib/statuses/{sha}","languages_url":"https://api.github.com/repos/gem/oq-risklib/languages","stargazers_url":"https://api.github.com/repos/gem/oq-risklib/stargazers","contributors_url":"https://api.github.com/repos/gem/oq-risklib/contributors","subscribers_url":"https://api.github.com/repos/gem/oq-risklib/subscribers","subscription_url":"https://api.github.com/repos/gem/oq-risklib/subscription","commits_url":"https://api.github.com/repos/gem/oq-risklib/commits{/sha}","git_commits_url":"https://api.github.com/repos/gem/oq-risklib/git/commits{/sha}","comments_url":"https://api.github.com/repos/gem/oq-risklib/comments{/number}","issue_comment_url":"https://api.github.com/repos/gem/oq-risklib/issues/comments{/number}","contents_url":"https://api.github.com/repos/gem/oq-risklib/contents/{+path}","compare_url":"https://api.github.com/repos/gem/oq-risklib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gem/oq-risklib/merges","archive_url":"https://api.github.com/repos/gem/oq-risklib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gem/oq-risklib/downloads","issues_url":"https://api.github.com/repos/gem/oq-risklib/issues{/number}","pulls_url":"https://api.github.com/repos/gem/oq-risklib/pulls{/number}","milestones_url":"https://api.github.com/repos/gem/oq-risklib/milestones{/number}","notifications_url":"https://api.github.com/repos/gem/oq-risklib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gem/oq-risklib/labels{/name}","releases_url":"https://api.github.com/repos/gem/oq-risklib/releases{/id}","created_at":"2012-09-18T13:07:14Z","updated_at":"2015-05-08T14:27:00Z","pushed_at":"2015-07-08T09:52:33Z","git_url":"git://github.com/gem/oq-risklib.git","ssh_url":"git@github.com:gem/oq-risklib.git","clone_url":"https://github.com/gem/oq-risklib.git","svn_url":"https://github.com/gem/oq-risklib","homepage":"http://www.globalquakemodel.org/openquake/","size":28488,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":7,"forks":12,"open_issues":7,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gem/oq-risklib/pulls/315"},"html":{"href":"https://github.com/gem/oq-risklib/pull/315"},"issue":{"href":"https://api.github.com/repos/gem/oq-risklib/issues/315"},"comments":{"href":"https://api.github.com/repos/gem/oq-risklib/issues/315/comments"},"review_comments":{"href":"https://api.github.com/repos/gem/oq-risklib/pulls/315/comments"},"review_comment":{"href":"https://api.github.com/repos/gem/oq-risklib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gem/oq-risklib/pulls/315/commits"},"statuses":{"href":"https://api.github.com/repos/gem/oq-risklib/statuses/9b6251276dbadf7ec42d95b23f5c38bffbb6a7ad"}}}}