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::ParticleAges _ages)
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(_ages),
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::ParticleAges _ages,
174 bool b_move,
175 bool b_leave)
176 : d_t(_d_t), positions(std::move(p)), n_particles(n_p),
177 move(std::move(m)), random_pool(_random_pool), // NOLINT
178 status(std::move(_status)), events(std::move(_events)),
179 probes(std::move(_probes)), ages(std::move(_ages)),
180 m_p_team_leave(p_team_leave), m_p_team_move(p_team_move),
181 m_enable_move(b_move), m_enable_leave(b_leave) {};
182
183 void
184 update(double _d_t,
185 std::size_t n_p,
187 MC::ParticlePositions _positions,
188 MC::ParticleStatus _status,
189 MC::ParticleAges _ages,
190 bool b_move,
191 bool b_leave)
192 {
193
194 this->d_t = _d_t;
195 this->n_particles = n_p;
196 m_enable_leave = b_leave;
197 m_enable_move = b_move;
198 this->move = std::move(move_i);
199 this->positions = std::move(_positions);
200 this->status = std::move(_status);
201 this->ages = std::move(_ages);
202 }
203
204 [[nodiscard]] bool
206 {
208 }
209
210 KOKKOS_INLINE_FUNCTION void
212 const Kokkos::TeamPolicy<ComputeSpace>::member_type& team,
213 MoveLeaveTally& local_tally) const
214 {
215 const std::size_t N = m_p_team_move;
216 const std::size_t p0 = team.league_rank() * N;
217 const auto upper_bound = ((p0 + N) >= n_particles) ? n_particles - p0 : N;
218
219 KOKKOS_ASSERT(upper_bound > 0 && upper_bound <= n_particles);
220
221 const auto& rp = random_pool;
222 const auto& proba = move.move_probability;
223 const std::size_t p = team.team_size();
224 const std::size_t m = (upper_bound + p - 1) / p;
225
226 std::size_t team_move_count = 0;
227 Kokkos::parallel_reduce(
228 Kokkos::TeamThreadRange(team, 0, p),
229 [&](const std::size_t tid, std::size_t& moved_count)
230 {
231 auto gen = rp.get_state();
232
233 for (std::size_t k = 0; k < m; ++k)
234 {
235 const std::size_t idx = tid + k * p; // stride p
236
237 if (idx >= upper_bound)
238 {
239 break;
240 }
241 const std::size_t flat_index = p0 + idx;
242
243 if (status(flat_index) != MC::Status::Idle)
244 {
245 continue;
246 }
247
248 bool moved = false;
249 const std::size_t next
250 = next_compartment(positions(flat_index), proba, gen, moved);
251 if (moved)
252 {
253 positions(flat_index) = next;
254 ++moved_count;
255 }
256 }
257
258 rp.free_state(gen);
259 },
260 team_move_count);
261
262 team.team_barrier();
263 Kokkos::single(Kokkos::PerTeam(team),
264 [&]() { local_tally.moved += team_move_count; });
265 }
266
267 KOKKOS_INLINE_FUNCTION void
269 const Kokkos::TeamPolicy<ComputeSpace>::member_type& team_handle,
270 std::size_t& local_dead_count) const
271 {
272 (void)_tag;
273 const std::size_t count = m_p_team_leave;
274 const std::size_t p0 = team_handle.league_rank() * count;
275 const std::size_t n_particle = n_particles;
276
277 const auto upper_bound
278 = ((p0 + count) >= n_particle) ? n_particle - p0 : count;
279
280 KOKKOS_ASSERT(upper_bound > 0 && upper_bound <= n_particle);
281 std::size_t team_dead_count = 0;
282 const auto& lf = move.leaving_flow;
283 Kokkos::parallel_reduce(
284 Kokkos::TeamThreadRange(team_handle, 0, upper_bound),
285 [&](const std::size_t idx, std::size_t& thread_dead_count)
286 {
287 const auto flat_index = p0 + idx;
288 ages(flat_index, 0) += d_t;
289 handle_exit(flat_index, lf, thread_dead_count);
290 },
291 team_dead_count);
292
293 team_handle.team_barrier();
294 Kokkos::single(
295 Kokkos::PerTeam(team_handle),
296 [&]()
297 {
298 if constexpr (AutoGenerated::FlagCompileTime::enable_event_counter)
299 {
300 events.add<MC::EventType::Exit>(team_dead_count);
301 }
302 local_dead_count += team_dead_count;
303 });
304 }
305
308
311 KOKKOS_INLINE_FUNCTION void
313 const Kokkos::TeamPolicy<ComputeSpace>::member_type& team,
314 MoveLeaveTally& local_tally) const
315 {
316 const std::size_t N = m_p_team_move;
317 const std::size_t p0 = team.league_rank() * N;
318 const auto upper_bound = ((p0 + N) >= n_particles) ? n_particles - p0 : N;
319
320 KOKKOS_ASSERT(upper_bound > 0 && upper_bound <= n_particles);
321
322 const auto& rp = random_pool;
323 const auto& lf = move.leaving_flow;
324 const auto& proba = move.move_probability;
325
326 const std::size_t p = team.team_size();
327 const std::size_t m = (upper_bound + p - 1) / p;
328
329 MoveLeaveTally team_tally{ 0, 0 };
330
331 Kokkos::parallel_reduce(
332 Kokkos::TeamThreadRange(team, 0, p),
333 [&](const std::size_t tid, MoveLeaveTally& acc)
334 {
335 auto gen = rp.get_state();
336
337 for (std::size_t k = 0; k < m; ++k)
338 {
339 const std::size_t idx = tid + k * p; // stride p
340
341 if (idx >= upper_bound)
342 {
343 break;
344 }
345 const std::size_t flat_index = p0 + idx;
346
347 const bool is_idle = status(flat_index) == MC::Status::Idle;
348 std::size_t position = positions(flat_index);
349
350 if (is_idle)
351 {
352 bool moved = false;
353 const std::size_t next
354 = next_compartment(position, proba, gen, moved);
355 // Only movers write back. Most particles stay put in a
356 // step, so an unconditional store dirties every cache line of
357 // `positions` to rewrite the value it already held.
358 if (moved)
359 {
360 positions(flat_index) = next;
361 position = next;
362 ++acc.moved;
363 }
364 }
365
366 ages(flat_index, 0) += d_t;
367
368 // Only idle particles may exit: an already-Exit one in an
369 // outlet compartment would otherwise be recounted every step
370 // and overshoot inactive_counter.
371 if (is_idle)
372 {
373 handle_exit_at(flat_index, lf, position, gen, acc.dead);
374 }
375 }
376
377 rp.free_state(gen);
378 },
379 team_tally);
380
381 team.team_barrier();
382
383 Kokkos::single(Kokkos::PerTeam(team),
384 [&]() { local_tally += team_tally; });
385 }
386
387 bool
388 do_move() const
389 {
390 return this->m_enable_move;
391 }
392
393 bool
394 do_leave() const
395 {
396 return m_enable_leave;
397 }
398
399 KOKKOS_INLINE_FUNCTION void
401 const Kokkos::TeamPolicy<ComputeSpace>::member_type& team_handle,
402 MoveLeaveTally& local_tally) const
403 {
404
405 (void)_tag;
406
407 const auto& lf = move.leaving_flow;
408
409 // In 0d, the flow is the same for every particle
410 // Only one member of the team calculate lambda and
411 // broadcast it to other members
412 double lambda = 0.;
413 Kokkos::single(
414 Kokkos::PerTeam(team_handle),
415 [&lf, dt = this->d_t](double& local_lambda)
416 {
417 const auto& [_, flow_value, liquid_volume] = lf(0);
418
419 local_lambda = dt * flow_value / liquid_volume;
420 },
421 lambda);
422
423 team_handle.team_barrier();
424 // In 0d context we can even be sure that flow will never be 0
425 // Note: if flow is 0, proba will be 0 and then the result will be the
426 // same Can we remove the condition?
427 //
428 if (lambda == 0.)
429 {
430 return;
431 }
432 const std::size_t N = m_p_team_leave;
433 const std::size_t p0 = team_handle.league_rank() * N;
434 const auto upper_bound = ((p0 + N) >= n_particles) ? n_particles - p0 : N;
435
436 KOKKOS_ASSERT(upper_bound > 0 && upper_bound <= n_particles);
437
438 const auto& rp = random_pool;
439
440 const std::size_t p = team_handle.team_size();
441
442 const std::size_t m = (upper_bound + p - 1) / p;
443
444 std::size_t team_dead_count = 0;
445
446 // For each thread of the team we assigm m iterations
447 // This divide the number of call of get_state by m and may reduce
448 // contention especially on CPU typically P = 1 on cpu then m is
449 // equal to npt (128-4096)
450 Kokkos::parallel_reduce(
451 Kokkos::TeamThreadRange(team_handle, 0, p),
452 [&](const std::size_t tid, std::size_t& dead_count)
453 {
454 auto gen = rp.get_state();
455
456 for (std::size_t k = 0; k < m; ++k)
457 {
458 const std::size_t idx = tid + k * p; // stride p
459
460 if (idx >= upper_bound)
461 {
462 break;
463 }
464 const std::size_t flat_index = p0 + idx;
465
466 if (status(flat_index) != MC::Status::Idle)
467 {
468 continue;
469 }
470 const double r = gen.drand(0., 1.);
471 ages(flat_index, 0) += d_t;
473 probability_leaving<decltype(r), precision_tag>(r, lambda),
474 flat_index,
475 dead_count);
476 }
477 rp.free_state(gen);
478 },
479 team_dead_count);
480
481 team_handle.team_barrier();
482
483 Kokkos::single(Kokkos::PerTeam(team_handle),
484 [&]() { local_tally.dead += team_dead_count; });
485 }
486
491 template <typename GenType>
492 KOKKOS_FORCEINLINE_FUNCTION std::size_t
494 const std::size_t i_current_compartment,
495 const MC::MoveProbabilityView<ComputeSpace, true>& move_probability,
496 GenType& gen,
497 bool& moved) const
498 {
499 KOKKOS_ASSERT(
500 i_current_compartment < move.liquid_volume.extent(0)
501 && "Particle position is incorect (greater than compartment number)");
502
503 moved = move_probability(i_current_compartment) > gen.frand(0.F, 1.F);
504
505 if (!moved)
506 {
507 return i_current_compartment;
508 }
509
510 const auto next = __find_next_compartment(move.neighbors,
511 move.cumulative_probability,
512 i_current_compartment,
513 gen.frand(0.F, 1.F));
514 KOKKOS_ASSERT(
515 next < move.liquid_volume.extent(0)
516 && " Position after move is greater than compartment number");
517 return next;
518 }
519
523 template <typename ExecSpace, typename GenType>
524 KOKKOS_FORCEINLINE_FUNCTION void
526 const std::size_t idx,
527 const Kokkos::View<const MC::LeavingFlow*, ExecSpace>& leaving_flow,
528 const std::size_t position,
529 GenType& gen,
530 std::size_t& dead_count) const
531 {
532 MC::LeavingFlow::float_type found_flow_value = 0.;
533 MC::LeavingFlow::float_type found_liquid_volume = 0.;
534 find_flow(leaving_flow, position, found_flow_value, found_liquid_volume);
535
536 // Only a few particles sit in an outlet compartment
537 if (found_flow_value != 0.)
538 {
539 const auto r = gen.frand(0., 1.);
540 KOKKOS_ASSERT(found_liquid_volume > 0.);
541 KOKKOS_ASSERT(found_flow_value > 0.);
543 r, found_liquid_volume, found_flow_value, d_t),
544 idx,
545 dead_count);
546 }
547 }
548
549 template <typename ExecSpace>
550 KOKKOS_FORCEINLINE_FUNCTION std::size_t
552 const std::size_t idx,
553 const Kokkos::View<const MC::LeavingFlow*, ExecSpace>& leaving_flow,
554 std::size_t& dead_count) const
555 {
556
557 const std::size_t position = positions(idx);
558 // Strategy:
559 // first find the value of leaving flow (0-> particle doesn´t leave)
560 // do-while +early break is ok as n_flow is likely <10
561 // second: calculate probability leaving, flow=0 => p=0 theres no need
562 // to check condition
563 MC::LeavingFlow::float_type found_flow_value = 0.;
564 MC::LeavingFlow::float_type found_liquid_volume = 0.;
565 find_flow(leaving_flow, position, found_flow_value, found_liquid_volume);
566
567 // Cases
568 // only for few particles
569 if (found_flow_value != 0.)
570 {
571
572 auto gen = random_pool.get_state();
573 const auto r = gen.frand(0., 1.);
574 random_pool.free_state(gen);
575
576 KOKKOS_ASSERT(found_liquid_volume > 0.);
577 KOKKOS_ASSERT(found_flow_value > 0.);
579 r, found_liquid_volume, found_flow_value, d_t);
580 perform_exit(p, idx, dead_count);
581 }
582
583 return 0;
584 }
585
586 KOKKOS_INLINE_FUNCTION void
587 perform_exit(const bool proba,
588 const std::size_t idx,
589 std::size_t& dead_count) const
590 {
591
592 if (proba)
593 {
594 ++dead_count;
595
596 if constexpr (AutoGenerated::FlagCompileTime::use_probe)
597 {
598 using mem_space = ComputeSpace::memory_space;
599 // DO this betore age is reset to 0
600 const auto _ = probes.set<mem_space>(ages(idx, 0));
601 }
602
603 ages(idx, 0) = 0;
605 }
606 else
607 {
608 // ages(idx, 0) += d_t;
609 }
610 }
611
612 double d_t{};
614 std::size_t n_particles{};
621 std::size_t m_p_team_leave{};
622 std::size_t m_p_team_move{};
623
626 };
627} // namespace Simulation::KernelInline
628
629namespace Kokkos
630{
631 template <>
632 struct reduction_identity<Simulation::KernelInline::MoveLeaveTally>
633 {
634 KOKKOS_FORCEINLINE_FUNCTION static Simulation::KernelInline::MoveLeaveTally
636 {
637 return { 0, 0 };
638 }
639 };
640} // namespace Kokkos
641
642#endif
Definition move_kernel.hpp:630
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:215
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:182
Kokkos::View< Status *, ComputeSpace > ParticleStatus
Definition alias.hpp:141
Kokkos::View< uint64_t *, ComputeSpace > ParticlePositions
Definition alias.hpp:140
@ Exit
Remove particle from list due to move in domain.
Definition events.hpp:22
@ Idle
Definition alias.hpp:126
@ Exit
Definition alias.hpp:128
ParticleAgesBase< ComputeSpace > ParticleAges
Definition alias.hpp:144
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:206
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:635
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
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::ParticleAges _ages, bool b_move, bool b_leave)
Definition move_kernel.hpp:163
bool do_move() const
Definition move_kernel.hpp:388
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:493
bool m_enable_leave
Definition move_kernel.hpp:625
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::ParticleAges _ages)
Definition move_kernel.hpp:140
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:268
KOKKOS_INLINE_FUNCTION void operator()(TagMove, const Kokkos::TeamPolicy< ComputeSpace >::member_type &team, MoveLeaveTally &local_tally) const
Definition move_kernel.hpp:211
bool need_launch() const
Definition move_kernel.hpp:205
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:613
std::size_t m_p_team_move
Definition move_kernel.hpp:622
double d_t
Definition move_kernel.hpp:612
MC::DomainState< ComputeSpace, true > move
Definition move_kernel.hpp:615
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:551
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:525
std::size_t n_particles
Definition move_kernel.hpp:614
MC::EventContainer events
Definition move_kernel.hpp:618
ProbeAutogeneratedBuffer probes
Definition move_kernel.hpp:619
KOKKOS_INLINE_FUNCTION void perform_exit(const bool proba, const std::size_t idx, std::size_t &dead_count) const
Definition move_kernel.hpp:587
KOKKOS_INLINE_FUNCTION void operator()(TagMoveLeave, const Kokkos::TeamPolicy< ComputeSpace >::member_type &team, MoveLeaveTally &local_tally) const
Definition move_kernel.hpp:312
void update(double _d_t, std::size_t n_p, MC::DomainState< ComputeSpace > move_i, MC::ParticlePositions _positions, MC::ParticleStatus _status, MC::ParticleAges _ages, bool b_move, bool b_leave)
Definition move_kernel.hpp:184
MC::ParticleStatus status
Definition move_kernel.hpp:617
MC::ParticleAges ages
Definition move_kernel.hpp:620
bool m_enable_move
Definition move_kernel.hpp:624
std::size_t m_p_team_leave
Definition move_kernel.hpp:621
KOKKOS_INLINE_FUNCTION void operator()(TagLeaveB0D _tag, const Kokkos::TeamPolicy< ComputeSpace >::member_type &team_handle, MoveLeaveTally &local_tally) const
Definition move_kernel.hpp:400
MC::pool_type random_pool
Definition move_kernel.hpp:616
bool do_leave() const
Definition move_kernel.hpp:394
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