GitHub PullRequestReviewCommentEvent at 2014-07-28 00:04:46
Repository: openmc
Actor: wbinventor
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/wbinventor/openmc/pulls/comments/15442996","id":15442996,"diff_hunk":"@@ -233,8 +240,119 @@ subroutine finalize_batch()\n       ! batch in case no state point is written\n       call calculate_combined_keff()\n     end if\n-\n+    \n   end subroutine finalize_batch\n+  \n+!===============================================================================\n+! CHECK_BATCH checks whether to check the trigger and whether the trigger \n+! threshold is reached. \n+!===============================================================================\n+  subroutine check_batch()\n+    implicit none\n+    integer :: n1   ! # number of predicted batches where trigger is reached\n+    \n+    ! Check the batches when current_batch meet following requirements\n+      ! 1. Current_batch is not smaller than n_basic_batches\n+      ! 2. Trigger_on equals true\n+      ! 3. Current_batch can be expressed as (n_basic_batches + n * batch_interval)\n+      !    or current_batch equals n_batches\n+    if((current_batch >= n_basic_batches) .and. trigger_on) then\n+      if(mod((current_batch - n_basic_batches), n_batch_interval) == 0 .or. &\n+      current_batch == n_batches) then\n+        ! Get the combined keff and compare it with trigger threshold if needed\n+        call calculate_combined_keff()\n+        ! Check the trigger and out put the result\n+        call check_for_trigger()\n+       \n+        ! When trigger threshold is reached, write information \n+        if(reach_trigger) then\n+          message = \"Trigger has been reached in batch \" &\n+                 // trim(to_str(current_batch))\n+          call write_message()\n+      \n+        ! When trigger is not reached write information   \n+        elseif(trig_dis % temp_name == CHAR_EIGENVALUE) then\n+          message = \"Trigger isn't reached, the max uncertainty/threshold is \" &\n+          // trim(to_str(trig_dis % max_ratio)) // \" for \" &\n+          // trim(trig_dis % temp_name)\n+          call write_message()\n+        elseif (trig_dis % temp_nuclide /= NO_NUCLIDE) then\n+          message = \"Trigger isn't reached, the max uncertainty/threshold is \" &\n+            // trim(to_str(trig_dis % max_ratio)) // \" of \" & \n+            // trim(trig_dis % temp_nuclide) // \" for \" &\n+            // trim(trig_dis % temp_name) // \" in tally \" &\n+            // trim(to_str(trig_dis % id))\n+          call write_message()\n+        else\n+          message =  \"Trigger isn't reached, the max uncertainty/threshold is \" &\n+          // trim(to_str(trig_dis % max_ratio)) //\" for \"&\n+          // trim(trig_dis % temp_name) //\" in tally \"// trim(to_str(trig_dis % id))\n+          call write_message()\n+        end if \n+    \n+        if(reach_trigger .or. current_batch == n_batches) then\n+           ! Get n_batches for state_point file\n+           n_batches = current_batch\n+        call write_last_state_point()\n+         ! If batch_interval is not set, then estimate it.\n+        else if (no_batch_interval) then\n+          n_batch_interval = int((current_batch-n_inactive)*(trig_dis%max_ratio**2)) &\n+                            + n_inactive-n_basic_batches + 1\n+          n1 = n_batch_interval + n_basic_batches\n+         ! If the number of estimated batch is bigger than the n_batches print \n+         ! it and stop. \n+          if(n_batches < n1) then \n+            call write_last_state_point()\n+            message = \"The estimated number of batches is \" // trim(to_str(n1)) &\n+                   // \"---bigger than max batches, please reset max batches.\"\n+            call write_message\n+            call free_memory()\n+#ifdef MPI\n+            ! Abort MPI\n+            call MPI_ABORT(MPI_COMM_WORLD, code, mpi_err)","path":"src/eigenvalue.F90","position":115,"original_position":114,"commit_id":"c20909524152bcec5d6e91951aa16b0498c75a59","original_commit_id":"fb53e0bee9145af6167dc79fa5883abc43efb5cf","user":{"login":"wbinventor","id":209492,"avatar_url":"https://avatars.githubusercontent.com/u/209492?","gravatar_id":"02e570eb966be9932d3cac5aee9d99ec","url":"https://api.github.com/users/wbinventor","html_url":"https://github.com/wbinventor","followers_url":"https://api.github.com/users/wbinventor/followers","following_url":"https://api.github.com/users/wbinventor/following{/other_user}","gists_url":"https://api.github.com/users/wbinventor/gists{/gist_id}","starred_url":"https://api.github.com/users/wbinventor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wbinventor/subscriptions","organizations_url":"https://api.github.com/users/wbinventor/orgs","repos_url":"https://api.github.com/users/wbinventor/repos","events_url":"https://api.github.com/users/wbinventor/events{/privacy}","received_events_url":"https://api.github.com/users/wbinventor/received_events","type":"User","site_admin":false},"body":"After thinking about this, I am pretty sure that we should definitely only print a warning message and keep the simulation going up to ``max_batches``. The reason is that most simulations are submitted as jobs on a cluster and no user will be sitting and watching the output to see this message in realtime. So OpenMC should not exit the simulation early and should instead try to reduce the uncertainty as much as possible, even if the predicted number of batches is much greater than ``max_batches``.\r\n\r\n@paulromano may end up disagreeing with me on this when he reviews the final pull request, but I would implement it this way for now.","created_at":"2014-07-28T00:04:46Z","updated_at":"2014-07-28T00:04:46Z","html_url":"https://github.com/wbinventor/openmc/pull/1#discussion_r15442996","pull_request_url":"https://api.github.com/repos/wbinventor/openmc/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/wbinventor/openmc/pulls/comments/15442996"},"html":{"href":"https://github.com/wbinventor/openmc/pull/1#discussion_r15442996"},"pull_request":{"href":"https://api.github.com/repos/wbinventor/openmc/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/wbinventor/openmc/pulls/1","id":18920433,"html_url":"https://github.com/wbinventor/openmc/pull/1","diff_url":"https://github.com/wbinventor/openmc/pull/1.diff","patch_url":"https://github.com/wbinventor/openmc/pull/1.patch","issue_url":"https://api.github.com/repos/wbinventor/openmc/issues/1","number":1,"state":"open","title":"Tally trigger","user":{"login":"shenqicang","id":7658056,"avatar_url":"https://avatars.githubusercontent.com/u/7658056?","gravatar_id":"8f0a50feb9e8160324d8d8b3b8683e52","url":"https://api.github.com/users/shenqicang","html_url":"https://github.com/shenqicang","followers_url":"https://api.github.com/users/shenqicang/followers","following_url":"https://api.github.com/users/shenqicang/following{/other_user}","gists_url":"https://api.github.com/users/shenqicang/gists{/gist_id}","starred_url":"https://api.github.com/users/shenqicang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shenqicang/subscriptions","organizations_url":"https://api.github.com/users/shenqicang/orgs","repos_url":"https://api.github.com/users/shenqicang/repos","events_url":"https://api.github.com/users/shenqicang/events{/privacy}","received_events_url":"https://api.github.com/users/shenqicang/received_events","type":"User","site_admin":false},"body":"This is the OpenMC code with tally precision triggers and corresponding documentation. There are some changes in the tally_header file. This Pull request fulfills issue #264.","created_at":"2014-07-25T21:31:35Z","updated_at":"2014-07-28T00:04:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"96667346a2c1788c0509d8f9310cce8f91eca82c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wbinventor/openmc/pulls/1/commits","review_comments_url":"https://api.github.com/repos/wbinventor/openmc/pulls/1/comments","review_comment_url":"https://api.github.com/repos/wbinventor/openmc/pulls/comments/{number}","comments_url":"https://api.github.com/repos/wbinventor/openmc/issues/1/comments","statuses_url":"https://api.github.com/repos/wbinventor/openmc/statuses/c20909524152bcec5d6e91951aa16b0498c75a59","head":{"label":"shenqicang:tally_trigger","ref":"tally_trigger","sha":"c20909524152bcec5d6e91951aa16b0498c75a59","user":{"login":"shenqicang","id":7658056,"avatar_url":"https://avatars.githubusercontent.com/u/7658056?","gravatar_id":"8f0a50feb9e8160324d8d8b3b8683e52","url":"https://api.github.com/users/shenqicang","html_url":"https://github.com/shenqicang","followers_url":"https://api.github.com/users/shenqicang/followers","following_url":"https://api.github.com/users/shenqicang/following{/other_user}","gists_url":"https://api.github.com/users/shenqicang/gists{/gist_id}","starred_url":"https://api.github.com/users/shenqicang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shenqicang/subscriptions","organizations_url":"https://api.github.com/users/shenqicang/orgs","repos_url":"https://api.github.com/users/shenqicang/repos","events_url":"https://api.github.com/users/shenqicang/events{/privacy}","received_events_url":"https://api.github.com/users/shenqicang/received_events","type":"User","site_admin":false},"repo":{"id":21573966,"name":"openmc","full_name":"shenqicang/openmc","owner":{"login":"shenqicang","id":7658056,"avatar_url":"https://avatars.githubusercontent.com/u/7658056?","gravatar_id":"8f0a50feb9e8160324d8d8b3b8683e52","url":"https://api.github.com/users/shenqicang","html_url":"https://github.com/shenqicang","followers_url":"https://api.github.com/users/shenqicang/followers","following_url":"https://api.github.com/users/shenqicang/following{/other_user}","gists_url":"https://api.github.com/users/shenqicang/gists{/gist_id}","starred_url":"https://api.github.com/users/shenqicang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shenqicang/subscriptions","organizations_url":"https://api.github.com/users/shenqicang/orgs","repos_url":"https://api.github.com/users/shenqicang/repos","events_url":"https://api.github.com/users/shenqicang/events{/privacy}","received_events_url":"https://api.github.com/users/shenqicang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shenqicang/openmc","description":"OpenMC Monte Carlo Code","fork":true,"url":"https://api.github.com/repos/shenqicang/openmc","forks_url":"https://api.github.com/repos/shenqicang/openmc/forks","keys_url":"https://api.github.com/repos/shenqicang/openmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shenqicang/openmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shenqicang/openmc/teams","hooks_url":"https://api.github.com/repos/shenqicang/openmc/hooks","issue_events_url":"https://api.github.com/repos/shenqicang/openmc/issues/events{/number}","events_url":"https://api.github.com/repos/shenqicang/openmc/events","assignees_url":"https://api.github.com/repos/shenqicang/openmc/assignees{/user}","branches_url":"https://api.github.com/repos/shenqicang/openmc/branches{/branch}","tags_url":"https://api.github.com/repos/shenqicang/openmc/tags","blobs_url":"https://api.github.com/repos/shenqicang/openmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shenqicang/openmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shenqicang/openmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/shenqicang/openmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shenqicang/openmc/statuses/{sha}","languages_url":"https://api.github.com/repos/shenqicang/openmc/languages","stargazers_url":"https://api.github.com/repos/shenqicang/openmc/stargazers","contributors_url":"https://api.github.com/repos/shenqicang/openmc/contributors","subscribers_url":"https://api.github.com/repos/shenqicang/openmc/subscribers","subscription_url":"https://api.github.com/repos/shenqicang/openmc/subscription","commits_url":"https://api.github.com/repos/shenqicang/openmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/shenqicang/openmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/shenqicang/openmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/shenqicang/openmc/issues/comments/{number}","contents_url":"https://api.github.com/repos/shenqicang/openmc/contents/{+path}","compare_url":"https://api.github.com/repos/shenqicang/openmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shenqicang/openmc/merges","archive_url":"https://api.github.com/repos/shenqicang/openmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shenqicang/openmc/downloads","issues_url":"https://api.github.com/repos/shenqicang/openmc/issues{/number}","pulls_url":"https://api.github.com/repos/shenqicang/openmc/pulls{/number}","milestones_url":"https://api.github.com/repos/shenqicang/openmc/milestones{/number}","notifications_url":"https://api.github.com/repos/shenqicang/openmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shenqicang/openmc/labels{/name}","releases_url":"https://api.github.com/repos/shenqicang/openmc/releases{/id}","created_at":"2014-07-07T14:40:11Z","updated_at":"2014-07-25T15:26:21Z","pushed_at":"2014-07-27T23:37:03Z","git_url":"git://github.com/shenqicang/openmc.git","ssh_url":"git@github.com:shenqicang/openmc.git","clone_url":"https://github.com/shenqicang/openmc.git","svn_url":"https://github.com/shenqicang/openmc","homepage":"http://mit-crpg.github.io/openmc/","size":21323,"stargazers_count":1,"watchers_count":1,"language":"FORTRAN","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"develop"}},"base":{"label":"wbinventor:develop","ref":"develop","sha":"81c75279ed48becb584e70c9950caa7cf6fd1187","user":{"login":"wbinventor","id":209492,"avatar_url":"https://avatars.githubusercontent.com/u/209492?","gravatar_id":"02e570eb966be9932d3cac5aee9d99ec","url":"https://api.github.com/users/wbinventor","html_url":"https://github.com/wbinventor","followers_url":"https://api.github.com/users/wbinventor/followers","following_url":"https://api.github.com/users/wbinventor/following{/other_user}","gists_url":"https://api.github.com/users/wbinventor/gists{/gist_id}","starred_url":"https://api.github.com/users/wbinventor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wbinventor/subscriptions","organizations_url":"https://api.github.com/users/wbinventor/orgs","repos_url":"https://api.github.com/users/wbinventor/repos","events_url":"https://api.github.com/users/wbinventor/events{/privacy}","received_events_url":"https://api.github.com/users/wbinventor/received_events","type":"User","site_admin":false},"repo":{"id":17599847,"name":"openmc","full_name":"wbinventor/openmc","owner":{"login":"wbinventor","id":209492,"avatar_url":"https://avatars.githubusercontent.com/u/209492?","gravatar_id":"02e570eb966be9932d3cac5aee9d99ec","url":"https://api.github.com/users/wbinventor","html_url":"https://github.com/wbinventor","followers_url":"https://api.github.com/users/wbinventor/followers","following_url":"https://api.github.com/users/wbinventor/following{/other_user}","gists_url":"https://api.github.com/users/wbinventor/gists{/gist_id}","starred_url":"https://api.github.com/users/wbinventor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wbinventor/subscriptions","organizations_url":"https://api.github.com/users/wbinventor/orgs","repos_url":"https://api.github.com/users/wbinventor/repos","events_url":"https://api.github.com/users/wbinventor/events{/privacy}","received_events_url":"https://api.github.com/users/wbinventor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wbinventor/openmc","description":"OpenMC Monte Carlo Code","fork":true,"url":"https://api.github.com/repos/wbinventor/openmc","forks_url":"https://api.github.com/repos/wbinventor/openmc/forks","keys_url":"https://api.github.com/repos/wbinventor/openmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wbinventor/openmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wbinventor/openmc/teams","hooks_url":"https://api.github.com/repos/wbinventor/openmc/hooks","issue_events_url":"https://api.github.com/repos/wbinventor/openmc/issues/events{/number}","events_url":"https://api.github.com/repos/wbinventor/openmc/events","assignees_url":"https://api.github.com/repos/wbinventor/openmc/assignees{/user}","branches_url":"https://api.github.com/repos/wbinventor/openmc/branches{/branch}","tags_url":"https://api.github.com/repos/wbinventor/openmc/tags","blobs_url":"https://api.github.com/repos/wbinventor/openmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wbinventor/openmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wbinventor/openmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/wbinventor/openmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wbinventor/openmc/statuses/{sha}","languages_url":"https://api.github.com/repos/wbinventor/openmc/languages","stargazers_url":"https://api.github.com/repos/wbinventor/openmc/stargazers","contributors_url":"https://api.github.com/repos/wbinventor/openmc/contributors","subscribers_url":"https://api.github.com/repos/wbinventor/openmc/subscribers","subscription_url":"https://api.github.com/repos/wbinventor/openmc/subscription","commits_url":"https://api.github.com/repos/wbinventor/openmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/wbinventor/openmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/wbinventor/openmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/wbinventor/openmc/issues/comments/{number}","contents_url":"https://api.github.com/repos/wbinventor/openmc/contents/{+path}","compare_url":"https://api.github.com/repos/wbinventor/openmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wbinventor/openmc/merges","archive_url":"https://api.github.com/repos/wbinventor/openmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wbinventor/openmc/downloads","issues_url":"https://api.github.com/repos/wbinventor/openmc/issues{/number}","pulls_url":"https://api.github.com/repos/wbinventor/openmc/pulls{/number}","milestones_url":"https://api.github.com/repos/wbinventor/openmc/milestones{/number}","notifications_url":"https://api.github.com/repos/wbinventor/openmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wbinventor/openmc/labels{/name}","releases_url":"https://api.github.com/repos/wbinventor/openmc/releases{/id}","created_at":"2014-03-10T16:36:03Z","updated_at":"2014-07-26T03:42:04Z","pushed_at":"2014-07-26T03:42:03Z","git_url":"git://github.com/wbinventor/openmc.git","ssh_url":"git@github.com:wbinventor/openmc.git","clone_url":"https://github.com/wbinventor/openmc.git","svn_url":"https://github.com/wbinventor/openmc","homepage":"http://mit-crpg.github.io/openmc/","size":13811,"stargazers_count":0,"watchers_count":0,"language":"FORTRAN","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/wbinventor/openmc/pulls/1"},"html":{"href":"https://github.com/wbinventor/openmc/pull/1"},"issue":{"href":"https://api.github.com/repos/wbinventor/openmc/issues/1"},"comments":{"href":"https://api.github.com/repos/wbinventor/openmc/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/wbinventor/openmc/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/wbinventor/openmc/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/wbinventor/openmc/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/wbinventor/openmc/statuses/c20909524152bcec5d6e91951aa16b0498c75a59"}}}}