diff --git a/include/openmc/particle.h b/include/openmc/particle.h index 042f525bd..b88b7eef5 100644 --- a/include/openmc/particle.h +++ b/include/openmc/particle.h @@ -344,11 +344,11 @@ public: double tally_tracklength_ {0.0}; double tally_leakage_ {0.0}; - bool trace_; //!< flag to show debug information + bool trace_ {false}; //!< flag to show debug information double collision_distance_; - int n_event_; + int n_event_ {0}; }; } // namespace openmc diff --git a/include/openmc/simulation.h b/include/openmc/simulation.h index c06e854dc..6b06b646b 100644 --- a/include/openmc/simulation.h +++ b/include/openmc/simulation.h @@ -49,10 +49,10 @@ extern const RegularMesh* ufs_mesh; extern std::vector k_generation; extern std::vector work_index; -// Threadprivate variables -extern "C" bool trace; //!< flag to show debug information +//// Threadprivate variables +//extern "C" bool trace; //!< flag to show debug information -#pragma omp threadprivate(trace) +//#pragma omp threadprivate(trace) } // namespace simulation diff --git a/src/geometry.cpp b/src/geometry.cpp index efe7100b4..3fd1a5b26 100644 --- a/src/geometry.cpp +++ b/src/geometry.cpp @@ -119,6 +119,12 @@ find_cell_inner(Particle* p, const NeighborList* neighbor_list) } // Announce the cell that the particle is entering. + if( p->trace_ ) + { + std::stringstream msg; + msg << "p->trace = " << p->trace_; + write_message(msg, 1); + } if (found && (settings::verbosity >= 10 || p->trace_)) { std::stringstream msg; msg << " Entering cell " << model::cells[i_cell]->id_; diff --git a/src/simulation.cpp b/src/simulation.cpp index 4083c9770..230e16c17 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -214,6 +214,7 @@ void process_calculate_xs_events(QueueItem * queue, int n) //std::cout << "particle offset = " << queue[i] << std::endl; // Set the random number stream // TODO: Move RNG seeds to particle storage + /* if (p->type_ == Particle::Type::neutron) { p->stream_ = STREAM_TRACKING; } else { @@ -251,6 +252,8 @@ void process_calculate_xs_events(QueueItem * queue, int n) if (p->write_track_) write_particle_track(*p); if (settings::check_overlaps) check_cell_overlap(p); + */ + p->event_calculate_xs_I(); } if( lost_particles > 0 ) @@ -260,6 +263,7 @@ void process_calculate_xs_events(QueueItem * queue, int n) for( int i = 0; i < n; i++ ) { Particle * p = particles + queue[i].idx; + /* // Calculate microscopic and macroscopic cross sections if (p->material_ != MATERIAL_VOID) { if (settings::run_CE) { @@ -276,6 +280,8 @@ void process_calculate_xs_events(QueueItem * queue, int n) p->macro_xs_.fission = 0.0; p->macro_xs_.nu_fission = 0.0; } + */ + p->event_calculate_xs_II(); } int start = advance_particle_queue_length; @@ -298,7 +304,7 @@ void process_advance_particle_events() #pragma omp parallel for schedule(dynamic, DYNAMIC_SIZE) for (int i = 0; i < advance_particle_queue_length; i++) { Particle * p = particles + advance_particle_queue[i].idx; - p->trace_ == (p->id_ == 0); + //p->trace_ == (p->id_ == 0); // Sample a distance to collision double d_collision; @@ -908,7 +914,6 @@ int openmc_next_batch(int* status) // ==================================================================== // LOOP OVER PARTICLES - /* #pragma omp parallel for schedule(runtime) for (int64_t i_work = 1; i_work <= simulation::work_per_rank; ++i_work) { // grab source particle from bank @@ -918,7 +923,7 @@ int openmc_next_batch(int* status) // transport particle p.transport(); } - */ + /* #pragma omp parallel for schedule(runtime) for (int64_t i_work = 1; i_work <= simulation::work_per_rank; ++i_work) { // grab source particle from bank @@ -928,6 +933,7 @@ int openmc_next_batch(int* status) // transport particle p.transport_history_based(); } + */ //transport(); @@ -1245,9 +1251,11 @@ void initialize_history(Particle* p, int64_t index_source) // set particle trace p->trace_ = false; + /* if (simulation::current_batch == settings::trace_batch && simulation::current_gen == settings::trace_gen && p->id_ == settings::trace_particle) p->trace_ = true; + */ // Set particle track. p->write_track_ = false;