6262#endif
6363
6464// forward declarations
65- #ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM
6665namespace Kokkos {
6766template <class DataType , class ... Properties> class View ;
6867class HostSpace ;
@@ -80,7 +79,6 @@ class AoSoA;
8079struct KokkosHandle ;
8180template <class MemorySpace , class ListAlgorithm , class Layout , class BuildTag >
8281class CustomVerletList ;
83- #endif // ESPRESSO_SHARED_MEMORY_PARALLELISM
8482
8583template <typename Callable>
8684concept ParticleCallback = requires (Callable c, Particle &p) {
@@ -168,7 +166,6 @@ struct EuclidianDistance {
168166 * be stored in separate structures.
169167 */
170168class CellStructure : public System ::Leaf<CellStructure> {
171- #ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM
172169public:
173170 static constexpr auto vector_length = 1 ;
174171 struct AoSoA_pack ;
@@ -179,7 +176,6 @@ class CellStructure : public System::Leaf<CellStructure> {
179176 using ListType =
180177 CustomVerletList<Kokkos::HostSpace, ListAlgorithm, Cabana::VerletLayout2D,
181178 Cabana::TeamVectorOpTag>;
182- #endif // ESPRESSO_SHARED_MEMORY_PARALLELISM
183179
184180private:
185181 /* * The local id-to-particle index */
@@ -199,7 +195,6 @@ class CellStructure : public System::Leaf<CellStructure> {
199195 /* * @brief Verlet list skin. */
200196 double m_verlet_skin = 0 .;
201197 double m_verlet_reuse = 0 .;
202- #ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM
203198 int m_cached_max_local_particle_id = 0 ;
204199 std::size_t m_num_local_particles_cached = 0 ;
205200 int m_max_id = 0 ;
@@ -217,7 +212,6 @@ class CellStructure : public System::Leaf<CellStructure> {
217212 /* * The local id-to-index for aosoa data */
218213 std::vector<Particle *> m_unique_particles;
219214 std::shared_ptr<KokkosHandle> m_kokkos_handle;
220- #endif // ESPRESSO_SHARED_MEMORY_PARALLELISM
221215
222216public:
223217 CellStructure (BoxGeometry const &box);
@@ -354,26 +348,18 @@ class CellStructure : public System::Leaf<CellStructure> {
354348 }
355349
356350 /* * @brief whether to use parallel version of @ref for_each_local_particle */
357- bool use_parallel_for_each_local_particle () const {
358- #ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM
359- return true ;
360- #else
361- return false ;
362- #endif
363- }
351+ bool use_parallel_for_each_local_particle () const { return true ; }
364352
365353 /* *
366354 * @brief Run a kernel on all local particles.
367355 * The kernel is assumed to be thread-safe.
368356 */
369357 void for_each_local_particle (ParticleUnaryOp &&f,
370358 bool parallel = true ) const {
371- #ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM
372359 if (parallel and use_parallel_for_each_local_particle ()) {
373360 parallel_for_each_particle_impl (decomposition ().local_cells (), f);
374361 return ;
375362 }
376- #endif
377363 for (auto &p : local_particles ()) {
378364 f (p);
379365 }
@@ -403,10 +389,8 @@ class CellStructure : public System::Leaf<CellStructure> {
403389 return decomposition ().particle_to_cell (p);
404390 }
405391
406- #ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM
407392 void parallel_for_each_particle_impl (std::span<Cell *const > cells,
408393 ParticleUnaryOp &f) const ;
409- #endif
410394
411395public:
412396 /* *
@@ -456,14 +440,12 @@ class CellStructure : public System::Leaf<CellStructure> {
456440 * this node, or -1 if there are no particles on this node.
457441 */
458442 int get_max_local_particle_id () const ;
459- #ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM
460443 int get_cached_max_local_particle_id () const {
461444 return m_cached_max_local_particle_id;
462445 }
463446 std::size_t get_num_local_particles_cached () const {
464447 return m_num_local_particles_cached;
465448 }
466- #endif
467449
468450 /* *
469451 * @brief Remove all particles from the cell system.
@@ -728,7 +710,6 @@ class CellStructure : public System::Leaf<CellStructure> {
728710 }
729711 }
730712
731- #ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM
732713public:
733714 auto get_max_id () const { return m_max_id; }
734715
@@ -787,7 +768,6 @@ class CellStructure : public System::Leaf<CellStructure> {
787768 inline void cell_list_loop (auto &&kernel) {
788769 kernel (m_decomposition->local_cells (), m_decomposition->box ());
789770 }
790- #endif
791771
792772private:
793773 /* * Non-bonded pair loop with verlet lists.
0 commit comments