BioCMAMC-ST
move_kernel.hpp
1#ifndef __SIMULATION_MOVE_KERNEL_HPP__
2#define __SIMULATION_MOVE_KERNEL_HPP__
3
4#include "Kokkos_Macros.hpp"
5#include <Kokkos_Assert.hpp>
6#include <Kokkos_Core.hpp>
7#include <Kokkos_Printf.hpp>
8#include <Kokkos_Random.hpp>
9#include <biocma_cst_config.hpp>
10#include <cassert>
11#include <common/common.hpp>
12#include <mc/alias.hpp>
13#include <mc/domain.hpp>
14#include <mc/events.hpp>
15#include <mc/prng/prng.hpp>
16#include <mc/traits.hpp>
17#include <simulation/probability_leaving.hpp>
18#include <simulation/probe.hpp>
19#include <utility>
20
22{
23 constexpr bool enable_leave = true;
24 constexpr bool disable_leave = false;
25 constexpr bool disable_move = false;
26 constexpr bool enable_move = true;
27
28 struct TagMove
29 {
30 };
31
32 struct TagLeave
33 {
34 };
35
37 {
38 };
39
44 {
45 };
46
51 {
52 std::size_t moved;
53 std::size_t dead;
54
55 KOKKOS_INLINE_FUNCTION MoveLeaveTally&
57 {
58 moved += other.moved;
59 dead += other.dead;
60 return *this;
61 }
62 };
63
71 KOKKOS_INLINE_FUNCTION std::size_t
75 cumulative_probability,
76 const std::size_t i_compartment,
77 const double random_number)
78 {
79 const int max_neighbor = static_cast<int>(neighbors.extent(1));
80
81 KOKKOS_ASSERT(max_neighbor >= 1);
82 KOKKOS_ASSERT(random_number <= 1. && random_number >= 0.);
83 KOKKOS_ASSERT(neighbors.extent(1) == cumulative_probability.extent(1));
84
85 // Do not use cumulative_probability(i_compartment, max_neighbor - 1)==1
86 // Bcause proba can be 0.999999999
87 // KOKKOS_ASSERT(cumulative_probability(i_compartment, max_neighbor -
88 // 1)>0.95); //5% relative
89
90 // v1.1: This assert was there to be sure that the particle will leave but
91 // actually
92 // not needed because if rand< then left will be the last at the the ned of
93 // the loop
94 // KOKKOS_ASSERT(cumulative_probability(i_compartment, max_neighbor - 1)
95 // >= random_number);
96
97 int left = 0;
98 int right = max_neighbor - 1;
99 while (left < right)
100 {
101 const int mid = (left + right) >> 1; // NOLINT
102 const auto pm = cumulative_probability(i_compartment, mid);
103 const int mask = static_cast<int>(random_number > pm);
104 left = mask * (mid + 1) + (1 - mask) * left;
105 right = mask * right + (1 - mask) * mid;
106 }
107 KOKKOS_ASSERT(left >= 0 && static_cast<size_t>(left) < neighbors.extent(1));
108 return neighbors(i_compartment, left);
109 }
110
111 template <typename ViewType1>
112 KOKKOS_INLINE_FUNCTION void
113 find_flow(const ViewType1& leaving_flow,
114 const std::size_t position,
116 MC::LeavingFlow::float_type& _liquid_volume)
117 {
118 std::size_t i_flow = 0;
119 const std::size_t n_flow = leaving_flow.size();
120 val_flow = 0.;
121 _liquid_volume = 0.;
122 // do-while because n_flow is likely to be 1
123 do
124 {
125 const auto& [index, flow, liquid_volume] = leaving_flow(i_flow++);
126 if (position == index)
127 {
128 val_flow = flow;
129 _liquid_volume = liquid_volume;
130 break;
131 }
132 } while (i_flow < n_flow);
133 }
134
136 {
137 using TeamPolicy = Kokkos::TeamPolicy<ComputeSpace>;
138 using TeamMember = TeamPolicy::member_type;
139 MoveFunctor() = default;
140 MoveFunctor(std::size_t p_team_move,
141 std::size_t p_team_leave,
143 MC::ParticleStatus _status,
145 MC::pool_type _random_pool,
146 MC::EventContainer _events,
148 MC::ParticleRefTime _t_ref)
149 : MoveFunctor(p_team_move,
150 p_team_leave,
151 0,
152 std::move(p),
153 std::move(_status),
154 0,
155 std::move(m),
156 std::move(_random_pool),
157 std::move(_events),
158 std::move(_probes),
159 std::move(_t_ref),
160 false,
161 false) {};
162
163 MoveFunctor(std::size_t p_team_move,
164 std::size_t p_team_leave,
165 double _d_t,
167 MC::ParticleStatus _status,
168 std::size_t n_p,
170 MC::pool_type _random_pool,
171 MC::EventContainer _events,
173 MC::ParticleRefTime _t_ref,
174 bool b_move,
175 bool b_leave)
176 : current_time(0.), d_t(_d_t), positions(std::move(p)),
177 n_particles(n_p), move(std::move(m)),
178 random_pool(_random_pool), // NOLINT
179 status(std::move(_status)), events(std::move(_events)),
180 probes(std::move(_probes)), p_times(std::move(_t_ref)),
181 m_p_team_leave(p_team_leave), m_p_team_move(p_team_move),
182 m_enable_move(b_move), m_enable_leave(b_leave) {};
183
184 void
185 update(double absolute_time,
186 double _d_t,
187 std::size_t n_p,
189 MC::ParticlePositions _positions,
190 MC::ParticleStatus _status,
191 MC::ParticleRefTime _t_ref,
192 bool b_move,
193 bool b_leave)
194 {
195 current_time = absolute_time;
196 this->d_t = _d_t;
197 this->n_particles = n_p;
198 m_enable_leave = b_leave;
199 m_enable_move = b_move;
200 this->p_times = _t_ref;
201 this->move = std::move(move_i);
202 this->positions = std::move(_positions);
203 this->status = std::move(_status);
204 }
205
206 [[nodiscard]] bool
208 {
210 }
211
212 KOKKOS_INLINE_FUNCTION void
214 const Kokkos::TeamPolicy<ComputeSpace>::member_type& team,
215 MoveLeaveTally& local_tally) const
216 {
217 const std::size_t N = m_p_team_move;
218 const std::size_t p0 = team.league_rank() * N;
219 const auto upper_bound = ((p0 + N) >= n_particles) ? n_particles - p0 : N;
220
221 KOKKOS_ASSERT(upper_bound > 0 && upper_bound <= n_particles);
222
223 const auto& rp = random_pool;
224 const auto& proba = move.move_probability;
225 const std::size_t p = team.team_size();
226 const std::size_t m = (upper_bound + p - 1) / p;
227
228 std::size_t team_move_count = 0;
229 Kokkos::parallel_reduce(
230 Kokkos::TeamThreadRange(team, 0, p),
231 [&](const std::size_t tid, std::size_t& moved_count)
232 {
233 auto gen = rp.get_state();
234
235 for (std::size_t k = 0; k < m; ++k)
236 {
237 const std::size_t idx = tid + k * p; // stride p
238
239 if (idx >= upper_bound)
240 {
241 break;
242 }
243 const std::size_t flat_index = p0 + idx;
244
245 if (status(flat_index) != MC::Status::Idle)
246 {
247 continue;
248 }
249
250 bool moved = false;
251 const std::size_t next
252 = next_compartment(positions(flat_index), proba, gen, moved);
253 if (moved)
254 {
255 positions(flat_index) = next;
256 ++moved_count;
257 }
258 }
259
260 rp.free_state(gen);
261 },
262 team_move_count);
263
264 team.team_barrier();
265 Kokkos::single(Kokkos::PerTeam(team),
266 [&]() { local_tally.moved += team_move_count; });
267 }
268
269 KOKKOS_INLINE_FUNCTION void
271 const Kokkos::TeamPolicy<ComputeSpace>::member_type& team_handle,
272 std::size_t& local_dead_count) const
273 {
274 (void)_tag;
275 const std::size_t count = m_p_team_leave;
276 const std::size_t p0 = team_handle.league_rank() * count;
277 const std::size_t n_particle = n_particles;
278
279 const auto upper_bound
280 = ((p0 + count) >= n_particle) ? n_particle - p0 : count;
281
282 KOKKOS_ASSERT(upper_bound > 0 && upper_bound <= n_particle);
283 std::size_t team_dead_count = 0;
284 const auto& lf = move.leaving_flow;
285 Kokkos::parallel_reduce(
286 Kokkos::TeamThreadRange(team_handle, 0, upper_bound),
287 [&](const std::size_t idx, std::size_t& thread_dead_count)
288 {
289 const auto flat_index = p0 + idx;
290 handle_exit(flat_index, lf, thread_dead_count);
291 },
292 team_dead_count);
293
294 team_handle.team_barrier();
295 Kokkos::single(
296 Kokkos::PerTeam(team_handle),
297 [&]()
298 {
299 if constexpr (AutoGenerated::FlagCompileTime::enable_event_counter)
300 {
301 events.add<MC::EventType::Exit>(team_dead_count);
302 }
303 local_dead_count += team_dead_count;
304 });
305 }
306
309
312 KOKKOS_INLINE_FUNCTION void
314 const Kokkos::TeamPolicy<ComputeSpace>::member_type& team,
315 MoveLeaveTally& local_tally) const
316 {
317 const std::size_t N = m_p_team_move;
318 const std::size_t p0 = team.league_rank() * N;
319 const auto upper_bound = ((p0 + N) >= n_particles) ? n_particles - p0 : N;
320
321 KOKKOS_ASSERT(upper_bound > 0 && upper_bound <= n_particles);
322
323 const auto& rp = random_pool;
324 const auto& lf = move.leaving_flow;
325 const auto& proba = move.move_probability;
326
327 const std::size_t p = team.team_size();
328 const std::size_t m = (upper_bound + p - 1) / p;
329
330 MoveLeaveTally team_tally{ 0, 0 };
331
332 Kokkos::parallel_reduce(
333 Kokkos::TeamThreadRange(team, 0, p),
334 [&](const std::size_t tid, MoveLeaveTally& acc)
335 {
336 auto gen = rp.get_state();
337
338 for (std::size_t k = 0; k < m; ++k)
339 {
340 const std::size_t idx = tid + k * p; // stride p
341
342 if (idx >= upper_bound)
343 {
344 break;
345 }
346 const std::size_t flat_index = p0 + idx;
347
348 const bool is_idle = status(flat_index) == MC::Status::Idle;
349 std::size_t position = positions(flat_index);
350
351 if (is_idle)
352 {
353 bool moved = false;
354 const std::size_t next
355 = next_compartment(position, proba, gen, moved);
356 // Only movers write back. Most particles stay put in a
357 // step, so an unconditional store dirties every cache line of
358 // `positions` to rewrite the value it already held.
359 if (moved)
360 {
361 positions(flat_index) = next;
362 position = next;
363 ++acc.moved;
364 }
365 }
366
367 // Only idle particles may exit: an already-Exit one in an
368 // outlet compartment would otherwise be recounted every step
369 // and overshoot inactive_counter.
370 if (is_idle)
371 {
372 handle_exit_at(flat_index, lf, position, gen, acc.dead);
373 }
374 }
375
376 rp.free_state(gen);
377 },
378 team_tally);
379
380 team.team_barrier();
381
382 Kokkos::single(Kokkos::PerTeam(team),
383 [&]() { local_tally += team_tally; });
384 }
385
386 bool
387 do_move() const
388 {
389 return this->m_enable_move;
390 }
391
392 bool
393 do_leave() const
394 {
395 return m_enable_leave;
396 }
397
398 KOKKOS_INLINE_FUNCTION void
400 const Kokkos::TeamPolicy<ComputeSpace>::member_type& team_handle,
401 MoveLeaveTally& local_tally) const
402 {
403
404 (void)_tag;
405
406 const auto& lf = move.leaving_flow;
407
408 // In 0d, the flow is the same for every particle
409 // Only one member of the team calculate lambda and
410 // broadcast it to other members
411 double lambda = 0.;
412 Kokkos::single(
413 Kokkos::PerTeam(team_handle),
414 [&lf, dt = this->d_t](double& local_lambda)
415 {
416 const auto& [_, flow_value, liquid_volume] = lf(0);
417
418 local_lambda = dt * flow_value / liquid_volume;
419 },
420 lambda);
421
422 team_handle.team_barrier();
423 // In 0d context we can even be sure that flow will never be 0
424 // Note: if flow is 0, proba will be 0 and then the result will be the
425 // same Can we remove the condition?
426 //
427 if (lambda == 0.)
428 {
429 return;
430 }
431 const std::size_t N = m_p_team_leave;
432 const std::size_t p0 = team_handle.league_rank() * N;
433 const auto upper_bound = ((p0 + N) >= n_particles) ? n_particles - p0 : N;
434
435 KOKKOS_ASSERT(upper_bound > 0 && upper_bound <= n_particles);
436
437 const auto& rp = random_pool;
438
439 const std::size_t p = team_handle.team_size();
440
441 const std::size_t m = (upper_bound + p - 1) / p;
442
443 std::size_t team_dead_count = 0;
444
445 // For each thread of the team we assigm m iterations
446 // This divide the number of call of get_state by m and may reduce
447 // contention especially on CPU typically P = 1 on cpu then m is
448 // equal to npt (128-4096)
449 Kokkos::parallel_reduce(
450 Kokkos::TeamThreadRange(team_handle, 0, p),
451 [&](const std::size_t tid, std::size_t& dead_count)
452 {
453 auto gen = rp.get_state();
454
455 for (std::size_t k = 0; k < m; ++k)
456 {
457 const std::size_t idx = tid + k * p; // stride p
458
459 if (idx >= upper_bound)
460 {
461 break;
462 }
463 const std::size_t flat_index = p0 + idx;
464
465 if (status(flat_index) != MC::Status::Idle)
466 {
467 continue;
468 }
469 const double r = gen.drand(0., 1.);
471 probability_leaving<decltype(r), precision_tag>(r, lambda),
472 flat_index,
473 dead_count);
474 }
475 rp.free_state(gen);
476 },
477 team_dead_count);
478
479 team_handle.team_barrier();
480
481 Kokkos::single(Kokkos::PerTeam(team_handle),
482 [&]() { local_tally.dead += team_dead_count; });
483 }
484
489 template <typename GenType>
490 KOKKOS_FORCEINLINE_FUNCTION std::size_t
492 const std::size_t i_current_compartment,
493 const MC::MoveProbabilityView<ComputeSpace, true>& move_probability,
494 GenType& gen,
495 bool& moved) const
496 {
497 KOKKOS_ASSERT(
498 i_current_compartment < move.liquid_volume.extent(0)
499 && "Particle position is incorect (greater than compartment number)");
500
501 moved = move_probability(i_current_compartment) > gen.frand(0.F, 1.F);
502
503 if (!moved)
504 {
505 return i_current_compartment;
506 }
507
508 const auto next = __find_next_compartment(move.neighbors,
509 move.cumulative_probability,
510 i_current_compartment,
511 gen.frand(0.F, 1.F));
512 KOKKOS_ASSERT(
513 next < move.liquid_volume.extent(0)
514 && " Position after move is greater than compartment number");
515 return next;
516 }
517
521 template <typename ExecSpace, typename GenType>
522 KOKKOS_FORCEINLINE_FUNCTION void
524 const std::size_t idx,
525 const Kokkos::View<const MC::LeavingFlow*, ExecSpace>& leaving_flow,
526 const std::size_t position,
527 GenType& gen,
528 std::size_t& dead_count) const
529 {
530 MC::LeavingFlow::float_type found_flow_value = 0.;
531 MC::LeavingFlow::float_type found_liquid_volume = 0.;
532 find_flow(leaving_flow, position, found_flow_value, found_liquid_volume);
533
534 // Only a few particles sit in an outlet compartment
535 if (found_flow_value != 0.)
536 {
537 const auto r = gen.frand(0., 1.);
538 KOKKOS_ASSERT(found_liquid_volume > 0.);
539 KOKKOS_ASSERT(found_flow_value > 0.);
541 r, found_liquid_volume, found_flow_value, d_t),
542 idx,
543 dead_count);
544 }
545 }
546
547 template <typename ExecSpace>
548 KOKKOS_FORCEINLINE_FUNCTION std::size_t
550 const std::size_t idx,
551 const Kokkos::View<const MC::LeavingFlow*, ExecSpace>& leaving_flow,
552 std::size_t& dead_count) const
553 {
554
555 const std::size_t position = positions(idx);
556 // Strategy:
557 // first find the value of leaving flow (0-> particle doesn´t leave)
558 // do-while +early break is ok as n_flow is likely <10
559 // second: calculate probability leaving, flow=0 => p=0 theres no need
560 // to check condition
561 MC::LeavingFlow::float_type found_flow_value = 0.;
562 MC::LeavingFlow::float_type found_liquid_volume = 0.;
563 find_flow(leaving_flow, position, found_flow_value, found_liquid_volume);
564
565 // Cases
566 // only for few particles
567 if (found_flow_value != 0.)
568 {
569
570 auto gen = random_pool.get_state();
571 const auto r = gen.frand(0., 1.);
572 random_pool.free_state(gen);
573
574 KOKKOS_ASSERT(found_liquid_volume > 0.);
575 KOKKOS_ASSERT(found_flow_value > 0.);
577 r, found_liquid_volume, found_flow_value, d_t);
578 perform_exit(p, idx, dead_count);
579 }
580
581 return 0;
582 }
583
584 KOKKOS_INLINE_FUNCTION void
585 perform_exit(const bool proba,
586 const std::size_t idx,
587 std::size_t& dead_count) const
588 {
589
590 if (proba)
591 {
592 ++dead_count;
593
594 if constexpr (AutoGenerated::FlagCompileTime::use_probe)
595 {
596 auto time = current_time - p_times(idx, 0);
597 using mem_space = ComputeSpace::memory_space;
598 // DO this betore age is reset to 0
599 const auto _ = probes.set<mem_space>(time);
600 }
601
602 p_times(idx, 0) = current_time;
604 }
605 }
607 double d_t{};
609 std::size_t n_particles{};
616 std::size_t m_p_team_leave{};
617 std::size_t m_p_team_move{};
618
621 };
622} // namespace Simulation::KernelInline
623
624namespace Kokkos
625{
626 template <>
627 struct reduction_identity<Simulation::KernelInline::MoveLeaveTally>
628 {
629 KOKKOS_FORCEINLINE_FUNCTION static Simulation::KernelInline::MoveLeaveTally
631 {
632 return { 0, 0 };
633 }
634 };
635} // namespace Kokkos
636
637#endif
Definition move_kernel.hpp:625
std::conditional_t< is_const, Kokkos::View< const std::size_t **, Kokkos::LayoutRight, ExecSpace, Kokkos::MemoryTraits< Kokkos::RandomAccess > >, Kokkos::View< std::size_t **, Kokkos::LayoutRight, ExecSpace > > NeighborsView
Definition alias.hpp:216
ParticleAgesBase< ComputeSpace > ParticleRefTime
Definition alias.hpp:149
std::conditional_t< is_const, Kokkos::View< const double *, ExecSpace, Kokkos::MemoryTraits< Kokkos::RandomAccess > >, Kokkos::View< double *, ExecSpace > > MoveProbabilityView
d_t * flow / volume per compartment. Owned by ReactorDomain
Definition alias.hpp:183
Kokkos::View< Status *, ComputeSpace > ParticleStatus
Definition alias.hpp:144
@ Exit
Remove particle from list due to move in domain.
Definition events.hpp:22
ParticlePositionT< ComputeSpace > ParticlePositions
Definition alias.hpp:143
@ Idle
Definition alias.hpp:126
@ Exit
Definition alias.hpp:128
gen_pool_type< Kokkos::DefaultExecutionSpace > pool_type
Definition alias.hpp:100
std::conditional_t< is_const, Kokkos::View< const double **, Kokkos::LayoutRight, ExecSpace, Kokkos::MemoryTraits< Kokkos::RandomAccess > >, Kokkos::View< double **, Kokkos::LayoutRight, ExecSpace > > CumulativeProbabilityView
Definition alias.hpp:207
Definition cycle_reducer.hpp:13
constexpr bool enable_leave
Definition move_kernel.hpp:23
constexpr bool enable_move
Definition move_kernel.hpp:26
constexpr bool disable_leave
Definition move_kernel.hpp:24
KOKKOS_INLINE_FUNCTION bool probability_leaving(const T random_number, const double lambda)
Definition probability_leaving.hpp:26
KOKKOS_INLINE_FUNCTION std::size_t __find_next_compartment(const MC::NeighborsView< ComputeSpace, true > &neighbors, const MC::CumulativeProbabilityView< ComputeSpace, true > &cumulative_probability, const std::size_t i_compartment, const double random_number)
probably overkill binary search to find next compartment
Definition move_kernel.hpp:72
KOKKOS_INLINE_FUNCTION void find_flow(const ViewType1 &leaving_flow, const std::size_t position, MC::LeavingFlow::float_type &val_flow, MC::LeavingFlow::float_type &_liquid_volume)
Definition move_kernel.hpp:113
int precision_tag
Definition probability_leaving.hpp:12
constexpr bool disable_move
Definition move_kernel.hpp:25
Namespace that contains classes and structures related to simulation handling.
Definition host_specific.hpp:12
Probes< AutoGenerated::probe_buffer_size > ProbeAutogeneratedBuffer
Definition probe.hpp:150
static KOKKOS_FORCEINLINE_FUNCTION Simulation::KernelInline::MoveLeaveTally sum()
Definition move_kernel.hpp:630
Structure to store information about domain needed during MC cycle data is likely to change between e...
Definition domain.hpp:29
Use to count events that occurs during Monte-Carlo processing cycles.
Definition events.hpp:168
double float_type
Definition domain.hpp:19
bool do_move() const
Definition move_kernel.hpp:387
MoveFunctor(std::size_t p_team_move, std::size_t p_team_leave, MC::ParticlePositions p, MC::ParticleStatus _status, MC::DomainState< ComputeSpace > m, MC::pool_type _random_pool, MC::EventContainer _events, ProbeAutogeneratedBuffer _probes, MC::ParticleRefTime _t_ref)
Definition move_kernel.hpp:140
KOKKOS_FORCEINLINE_FUNCTION std::size_t next_compartment(const std::size_t i_current_compartment, const MC::MoveProbabilityView< ComputeSpace, true > &move_probability, GenType &gen, bool &moved) const
Definition move_kernel.hpp:491
MC::ParticleRefTime p_times
Definition move_kernel.hpp:615
bool m_enable_leave
Definition move_kernel.hpp:620
void update(double absolute_time, double _d_t, std::size_t n_p, MC::DomainState< ComputeSpace > move_i, MC::ParticlePositions _positions, MC::ParticleStatus _status, MC::ParticleRefTime _t_ref, bool b_move, bool b_leave)
Definition move_kernel.hpp:185
double current_time
Definition move_kernel.hpp:606
KOKKOS_INLINE_FUNCTION void operator()(TagLeave _tag, const Kokkos::TeamPolicy< ComputeSpace >::member_type &team_handle, std::size_t &local_dead_count) const
Definition move_kernel.hpp:270
MoveFunctor(std::size_t p_team_move, std::size_t p_team_leave, double _d_t, MC::ParticlePositions p, MC::ParticleStatus _status, std::size_t n_p, MC::DomainState< ComputeSpace > m, MC::pool_type _random_pool, MC::EventContainer _events, ProbeAutogeneratedBuffer _probes, MC::ParticleRefTime _t_ref, bool b_move, bool b_leave)
Definition move_kernel.hpp:163
KOKKOS_INLINE_FUNCTION void operator()(TagMove, const Kokkos::TeamPolicy< ComputeSpace >::member_type &team, MoveLeaveTally &local_tally) const
Definition move_kernel.hpp:213
bool need_launch() const
Definition move_kernel.hpp:207
Kokkos::TeamPolicy< ComputeSpace > TeamPolicy
Definition move_kernel.hpp:137
TeamPolicy::member_type TeamMember
Definition move_kernel.hpp:138
MC::ParticlePositions positions
Definition move_kernel.hpp:608
std::size_t m_p_team_move
Definition move_kernel.hpp:617
double d_t
Definition move_kernel.hpp:607
MC::DomainState< ComputeSpace, true > move
Definition move_kernel.hpp:610
KOKKOS_FORCEINLINE_FUNCTION std::size_t handle_exit(const std::size_t idx, const Kokkos::View< const MC::LeavingFlow *, ExecSpace > &leaving_flow, std::size_t &dead_count) const
Definition move_kernel.hpp:549
KOKKOS_FORCEINLINE_FUNCTION void handle_exit_at(const std::size_t idx, const Kokkos::View< const MC::LeavingFlow *, ExecSpace > &leaving_flow, const std::size_t position, GenType &gen, std::size_t &dead_count) const
Definition move_kernel.hpp:523
std::size_t n_particles
Definition move_kernel.hpp:609
MC::EventContainer events
Definition move_kernel.hpp:613
ProbeAutogeneratedBuffer probes
Definition move_kernel.hpp:614
KOKKOS_INLINE_FUNCTION void perform_exit(const bool proba, const std::size_t idx, std::size_t &dead_count) const
Definition move_kernel.hpp:585
KOKKOS_INLINE_FUNCTION void operator()(TagMoveLeave, const Kokkos::TeamPolicy< ComputeSpace >::member_type &team, MoveLeaveTally &local_tally) const
Definition move_kernel.hpp:313
MC::ParticleStatus status
Definition move_kernel.hpp:612
bool m_enable_move
Definition move_kernel.hpp:619
std::size_t m_p_team_leave
Definition move_kernel.hpp:616
KOKKOS_INLINE_FUNCTION void operator()(TagLeaveB0D _tag, const Kokkos::TeamPolicy< ComputeSpace >::member_type &team_handle, MoveLeaveTally &local_tally) const
Definition move_kernel.hpp:399
MC::pool_type random_pool
Definition move_kernel.hpp:611
bool do_leave() const
Definition move_kernel.hpp:393
Definition move_kernel.hpp:51
std::size_t dead
Definition move_kernel.hpp:53
std::size_t moved
Definition move_kernel.hpp:52
KOKKOS_INLINE_FUNCTION MoveLeaveTally & operator+=(const MoveLeaveTally &other)
Definition move_kernel.hpp:56
Definition move_kernel.hpp:37
Definition move_kernel.hpp:33
Definition move_kernel.hpp:44
Definition move_kernel.hpp:29