diff --git a/include/openmc/event.h b/include/openmc/event.h index 93a3314c2a..8de6bf9d54 100644 --- a/include/openmc/event.h +++ b/include/openmc/event.h @@ -17,13 +17,13 @@ namespace openmc { // In the event-based model, instead of moving or sorting the particles // themselves based on which event they need, a queue is used to store the // index (and other useful info) for each event type. -// The QueueItem struct holds the relevant information about a particle needed +// The EventQueueItem struct holds the relevant information about a particle needed // for sorting the queue. For very high particle counts, a sorted queue has the // potential to result in greatly improved cache efficiency. However, sorting // will introduce some overhead due to the sorting process itself, and may not // result in any benefits if not enough particles are present for them to achieve // consistent locality improvements. -struct QueueItem{ +struct EventQueueItem{ int64_t idx; //!< particle index in event-based particle buffer Particle::Type type; //!< particle type int64_t material; //!< material that particle is in @@ -33,7 +33,7 @@ struct QueueItem{ // TODO: Currently, material IDs are not usually unique to material // types. When unique material type IDs are available, we can alter the // material field in this struct to contain the material type instead. - bool operator<(const QueueItem& rhs) const + bool operator<(const EventQueueItem& rhs) const { return std::tie(type, material, E) < std::tie(rhs.type, rhs.material, rhs.E); } @@ -49,11 +49,11 @@ namespace simulation { // vector, as they will be shared between threads and may be appended to at the // same time. To facilitate this, the SharedArray thread_safe_append() method // is provided which controls the append operations using atomics. -extern SharedArray calculate_fuel_xs_queue; -extern SharedArray calculate_nonfuel_xs_queue; -extern SharedArray advance_particle_queue; -extern SharedArray surface_crossing_queue; -extern SharedArray collision_queue; +extern SharedArray calculate_fuel_xs_queue; +extern SharedArray calculate_nonfuel_xs_queue; +extern SharedArray advance_particle_queue; +extern SharedArray surface_crossing_queue; +extern SharedArray collision_queue; // Particle buffer extern std::vector particles; @@ -75,7 +75,7 @@ void free_event_queues(void); //! \param queue The queue to append the particle to //! \param p A pointer to the particle //! \param buffer_idx The particle's actual index in the particle buffer -void enqueue_particle(SharedArray& queue, const Particle* p, int64_t buffer_idx); +void enqueue_particle(SharedArray& queue, const Particle* p, int64_t buffer_idx); //! Enqueues a particle based on if it is in fuel or a non-fuel material //! \param buffer_idx The particle's actual index in the particle buffer @@ -88,7 +88,7 @@ void process_init_events(int64_t n_particles, int64_t source_offset); //! Executes the calculate XS event for all particles in this event's buffer //! \param queue A reference to the desired XS lookup queue -void process_calculate_xs_events(SharedArray& queue); +void process_calculate_xs_events(SharedArray& queue); //! Executes the advance particle event for all particles in this event's buffer void process_advance_particle_events(); diff --git a/src/event.cpp b/src/event.cpp index 50e64f46a2..01a61e06fd 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -11,11 +11,11 @@ namespace openmc { namespace simulation { -SharedArray calculate_fuel_xs_queue; -SharedArray calculate_nonfuel_xs_queue; -SharedArray advance_particle_queue; -SharedArray surface_crossing_queue; -SharedArray collision_queue; +SharedArray calculate_fuel_xs_queue; +SharedArray calculate_nonfuel_xs_queue; +SharedArray advance_particle_queue; +SharedArray surface_crossing_queue; +SharedArray collision_queue; std::vector particles; @@ -47,7 +47,7 @@ void free_event_queues(void) simulation::particles.clear(); } -void enqueue_particle(SharedArray& queue, const Particle* p, int64_t buffer_idx) +void enqueue_particle(SharedArray& queue, const Particle* p, int64_t buffer_idx) { int64_t idx = queue.thread_safe_append(); @@ -78,7 +78,7 @@ void process_init_events(int64_t n_particles, int64_t source_offset) simulation::time_event_init.stop(); } -void process_calculate_xs_events(SharedArray& queue) +void process_calculate_xs_events(SharedArray& queue) { simulation::time_event_calculate_xs.start();