File tree Expand file tree Collapse file tree
tests/regression_tests/surface_source Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,6 +107,9 @@ class SharedArray {
107107 // ! \param size The new size of the container
108108 void resize (int64_t size) { size_ = size; }
109109
110+ // ! Return whether the array is full
111+ bool full () const { return size_ == capacity_; }
112+
110113 // ! Return the number of elements that the container has currently allocated
111114 // ! space for.
112115 int64_t capacity () { return capacity_; }
Original file line number Diff line number Diff line change @@ -468,7 +468,8 @@ void Particle::cross_surface()
468468 write_message (1 , " Crossing surface {}" , surf->id_ );
469469 }
470470
471- if (surf->surf_source_ && simulation::current_batch == settings::n_batches) {
471+ if (surf->surf_source_ && simulation::current_batch > settings::n_inactive &&
472+ !simulation::surf_source_bank.full ()) {
472473 SourceSite site;
473474 site.r = r ();
474475 site.u = u ();
Original file line number Diff line number Diff line change 77import openmc
88
99from tests .testing_harness import PyAPITestHarness
10+ from tests .regression_tests import config
1011
1112
1213@pytest .fixture
@@ -118,10 +119,14 @@ def _cleanup(self):
118119
119120@pytest .mark .surf_source_op ('write' )
120121def test_surface_source_write (model ):
122+ # Test result is based on 1 MPI process
123+ np = config ['mpi_np' ]
124+ config ['mpi_np' ] = '1'
121125 harness = SurfaceSourceTestHarness ('statepoint.10.h5' ,
122126 model ,
123127 'inputs_true_write.dat' )
124128 harness .main ()
129+ config ['mpi_np' ] = np
125130
126131
127132@pytest .mark .surf_source_op ('read' )
You can’t perform that action at this time.
0 commit comments