Cabana 0.8.0-dev
 
Loading...
Searching...
No Matches
Cabana_Halo.hpp
Go to the documentation of this file.
1/****************************************************************************
2 * Copyright (c) 2018-2023 by the Cabana authors *
3 * All rights reserved. *
4 * *
5 * This file is part of the Cabana library. Cabana is distributed under a *
6 * BSD 3-clause license. For the licensing terms see the LICENSE file in *
7 * the top-level directory. *
8 * *
9 * SPDX-License-Identifier: BSD-3-Clause *
10 ****************************************************************************/
11
16#ifndef CABANA_HALO_HPP
17#define CABANA_HALO_HPP
18
19#include <Cabana_AoSoA.hpp>
21#include <Cabana_Core_Config.hpp>
22#include <Cabana_Slice.hpp>
23
24#include <Kokkos_Core.hpp>
25#include <Kokkos_Profiling_ScopedRegion.hpp>
26
27#include <mpi.h>
28
29#include <exception>
30#include <vector>
31
32namespace Cabana
33{
34//---------------------------------------------------------------------------//
59template <class MemorySpace, class BuildType = Export,
60 class CommSpaceType = Mpi>
61class Halo : public CommunicationPlan<MemorySpace, CommSpaceType>
62{
63 public:
65 using commspace_type = CommSpaceType;
66
107 template <class IdViewType, class RankViewType, typename T = BuildType,
108 std::enable_if_t<std::is_same<T, Export>::value, int> = 0>
109 Halo( MPI_Comm comm, const std::size_t num_local,
110 const IdViewType& element_ids, const RankViewType& element_ranks,
111 const std::vector<int>& neighbor_ranks )
112 : CommunicationPlan<MemorySpace, CommSpaceType>( comm )
113 {
114 build( num_local, element_ids, element_ranks, neighbor_ranks );
115 }
116
149 template <class IdViewType, class RankViewType, typename T = BuildType,
150 std::enable_if_t<std::is_same<T, Export>::value, int> = 0>
151 Halo( MPI_Comm comm, const std::size_t num_local,
152 const IdViewType& element_ids, const RankViewType& element_ranks )
153 : CommunicationPlan<MemorySpace, CommSpaceType>( comm )
154 {
155 build( num_local, element_ids, element_ranks );
156 }
157
198 template <class IdViewType, class RankViewType, typename T = BuildType,
199 std::enable_if_t<std::is_same<T, Import>::value, int> = 0>
200 Halo( MPI_Comm comm, const std::size_t num_local,
201 const IdViewType& element_ids, const RankViewType& element_ranks,
202 const std::vector<int>& neighbor_ranks )
203 : CommunicationPlan<MemorySpace, CommSpaceType>( comm )
204 {
205 build( num_local, element_ids, element_ranks, neighbor_ranks );
206 }
207
239 template <class IdViewType, class RankViewType, typename T = BuildType,
240 std::enable_if_t<std::is_same<T, Import>::value, int> = 0>
241 Halo( MPI_Comm comm, const std::size_t num_local,
242 const IdViewType& element_ids, const RankViewType& element_ranks )
243 : CommunicationPlan<MemorySpace, CommSpaceType>( comm )
244 {
245 build( num_local, element_ids, element_ranks );
246 }
247
253 template <class IdViewType, class RankViewType, typename T = BuildType,
254 std::enable_if_t<std::is_same<T, Export>::value, int> = 0>
255 void build( const std::size_t num_local, const IdViewType& element_ids,
256 const RankViewType& element_ranks,
257 const std::vector<int>& neighbor_ranks )
258 {
259 _num_local = num_local;
260 if ( element_ids.size() != element_ranks.size() )
261 throw std::runtime_error( "Cabana::Halo (export): ids and ranks "
262 "views are different sizes!" );
263
264 auto neighbor_ids = this->createWithTopology(
265 BuildType(), element_ranks, neighbor_ranks );
266 this->createExportSteering( neighbor_ids, element_ranks, element_ids );
267 }
268
274 template <class IdViewType, class RankViewType, typename T = BuildType,
275 std::enable_if_t<std::is_same<T, Export>::value, int> = 0>
276 void build( const std::size_t num_local, const IdViewType& element_ids,
277 const RankViewType& element_ranks )
278 {
279 _num_local = num_local;
280 if ( element_ids.size() != element_ranks.size() )
281 throw std::runtime_error( "Cabana::Halo (export): ids and ranks "
282 "views are different sizes!" );
283
284 auto neighbor_ids =
285 this->createWithoutTopology( BuildType(), element_ranks );
286 this->createExportSteering( neighbor_ids, element_ranks, element_ids );
287 }
288
294 template <class IdViewType, class RankViewType, typename T = BuildType,
295 std::enable_if_t<std::is_same<T, Import>::value, int> = 0>
296 void build( const std::size_t num_local, const IdViewType& element_ids,
297 const RankViewType& element_ranks,
298 const std::vector<int>& neighbor_ranks )
299 {
300 _num_local = num_local;
301 if ( element_ids.size() != element_ranks.size() )
302 throw std::runtime_error( "Cabana::Halo (import): ids and ranks "
303 "views are different sizes!" );
304
305 auto neighbor_ids_ranks_indices = this->createWithTopology(
306 BuildType(), element_ranks, element_ids, neighbor_ranks );
307 this->createExportSteering( std::get<0>( neighbor_ids_ranks_indices ),
308 std::get<1>( neighbor_ids_ranks_indices ),
309 std::get<2>( neighbor_ids_ranks_indices ) );
310 }
311
317 template <class IdViewType, class RankViewType, typename T = BuildType,
318 std::enable_if_t<std::is_same<T, Import>::value, int> = 0>
319 void build( const std::size_t num_local, const IdViewType& element_ids,
320 const RankViewType& element_ranks )
321 {
322 _num_local = num_local;
323 if ( element_ids.size() != element_ranks.size() )
324 throw std::runtime_error( "Cabana::Halo (import): ids and ranks "
325 "views are different sizes!" );
326
327 auto neighbor_ids_ranks_indices = this->createWithoutTopology(
328 BuildType(), element_ranks, element_ids );
329 this->createExportSteering( std::get<0>( neighbor_ids_ranks_indices ),
330 std::get<1>( neighbor_ids_ranks_indices ),
331 std::get<2>( neighbor_ids_ranks_indices ) );
332 }
333
339 std::size_t numLocal() const { return _num_local; }
340
348 std::size_t numGhost() const { return this->totalNumImport(); }
349
350 private:
351 std::size_t _num_local;
352};
353
354//---------------------------------------------------------------------------//
356template <typename>
357struct is_halo_impl : public std::false_type
358{
359};
360
361template <typename MemorySpace, typename BuildType, typename CommSpaceType>
362struct is_halo_impl<Halo<MemorySpace, BuildType, CommSpaceType>>
363 : public std::true_type
364{
365};
367
369template <class T>
370struct is_halo : public is_halo_impl<typename std::remove_cv<T>::type>::type
371{
372};
373
383template <class Halo, class ParticleData>
385 const Halo& halo, const ParticleData& particles,
386 typename std::enable_if<( is_halo<Halo>::value ), int>::type* = 0 )
387{
388 // Check that the data is the right size.
389 return ( particles.size() == halo.numLocal() + halo.numGhost() );
390}
391
392template <class HaloType, class AoSoAType, class SFINAE = void>
393class Gather;
394
395//---------------------------------------------------------------------------//
407template <class HaloType, class AoSoAType>
408class Gather<HaloType, AoSoAType,
409 typename std::enable_if<is_aosoa<AoSoAType>::value>::type>
410 : public CommunicationData<HaloType, CommunicationDataAoSoA<AoSoAType>>
411{
412 public:
413 static_assert( is_halo<HaloType>::value, "" );
414
416 using commspace_type = typename HaloType::commspace_type;
418 using base_type =
421 using plan_type = typename base_type::plan_type;
423 using execution_space = typename base_type::execution_space;
425 using memory_space = typename base_type::memory_space;
427 using data_type = typename base_type::data_type;
429 using buffer_type = typename base_type::buffer_type;
430
443 Gather( HaloType halo, AoSoAType aosoa, const double overallocation = 1.0 )
444 : base_type( halo, aosoa, overallocation )
445 {
446 reserve( _comm_plan, aosoa );
447 }
448
450 auto totalSend() { return _comm_plan.totalNumExport(); }
452 auto totalReceive() { return _comm_plan.totalNumImport(); }
454 auto totalSend( const HaloType& halo ) { return halo.totalNumExport(); }
456 auto totalReceive( const HaloType& halo ) { return halo.totalNumImport(); }
457
461 void apply() override { applyImpl( execution_space{}, commspace_type{} ); }
462
466 template <class ExecutionSpace, class CommSpaceType>
467 std::enable_if_t<std::is_same<CommSpaceType, Mpi>::value, void>
468 applyImpl( ExecutionSpace, CommSpaceType );
469
470 // Future: Add applyImpl that is enabled for other CommSpaceType types.
471
478 void reserve( const HaloType& halo, AoSoAType& aosoa )
479 {
480 if ( !haloCheckValidSize( halo, aosoa ) )
481 throw std::runtime_error(
482 "Cabana::Gather:reserve: "
483 "AoSoA is the wrong size for gather! (Label: " +
484 aosoa.label() + ")" );
485
486 this->reserveImpl( halo, aosoa, totalSend( halo ),
487 totalReceive( halo ) );
488 }
489
497 void reserve( const HaloType& halo, AoSoAType& aosoa,
498 const double overallocation )
499 {
500 if ( !haloCheckValidSize( halo, aosoa ) )
501 throw std::runtime_error(
502 "Cabana::Gather:reserve: "
503 "AoSoA is the wrong size for gather! (Label: " +
504 aosoa.label() + ")" );
505
506 this->reserveImpl( halo, aosoa, totalSend( halo ), totalReceive( halo ),
507 overallocation );
508 }
509
510 private:
511 using base_type::_comm_plan;
512 using base_type::_recv_size;
513 using base_type::_send_size;
514};
515
527template <class HaloType, class SliceType>
528class Gather<HaloType, SliceType,
529 typename std::enable_if<is_slice<SliceType>::value>::type>
530 : public CommunicationData<HaloType, CommunicationDataSlice<SliceType>>
531{
532 public:
533 static_assert( is_halo<HaloType>::value, "" );
534
536 using commspace_type = typename HaloType::commspace_type;
538 using base_type =
541 using plan_type = typename base_type::plan_type;
543 using execution_space = typename base_type::execution_space;
545 using memory_space = typename base_type::memory_space;
547 using data_type = typename base_type::data_type;
549 using buffer_type = typename base_type::buffer_type;
550
563 Gather( HaloType halo, SliceType slice, const double overallocation = 1.0 )
564 : base_type( halo, slice, overallocation )
565 {
566 reserve( _comm_plan, slice );
567 }
568
570 auto totalSend() { return _comm_plan.totalNumExport(); }
572 auto totalReceive() { return _comm_plan.totalNumImport(); }
574 auto totalSend( const HaloType& halo ) { return halo.totalNumExport(); }
576 auto totalReceive( const HaloType& halo ) { return halo.totalNumImport(); }
577
581 void apply() override { applyImpl( execution_space{}, commspace_type{} ); }
582
586 template <class ExecutionSpace, class CommSpaceType>
587 std::enable_if_t<std::is_same<CommSpaceType, Mpi>::value, void>
588 applyImpl( ExecutionSpace, CommSpaceType );
589
590 // Future: Add applyImpl that is enabled for other CommSpaceType types.
591
600 void reserve( const HaloType& halo, const SliceType& slice,
601 const double overallocation )
602 {
603 if ( !haloCheckValidSize( halo, slice ) )
604 throw std::runtime_error(
605 "Cabana::Gather:reserve: "
606 "Slice is the wrong size for gather! (Label: " +
607 slice.label() + ")" );
608
609 // Cannot use totalSend(), totalReceive() because it may be inconsistent
610 // with the new plan.
611 this->reserveImpl( halo, slice, totalSend( halo ), totalReceive( halo ),
612 overallocation );
613 }
614
620 void reserve( const HaloType& halo, const SliceType& slice )
621 {
622 if ( !haloCheckValidSize( halo, slice ) )
623 throw std::runtime_error(
624 "Cabana::Gather:reserve: "
625 "Slice is the wrong size for gather! (Label: " +
626 slice.label() + ")" );
627
628 this->reserveImpl( halo, slice, totalSend( halo ),
629 totalReceive( halo ) );
630 }
631
632 private:
633 using base_type::_comm_plan;
634 using base_type::_recv_size;
635 using base_type::_send_size;
636};
637
638//---------------------------------------------------------------------------//
652template <class HaloType, class ParticleDataType>
653auto createGather( const HaloType& halo, const ParticleDataType& data,
654 const double overallocation = 1.0 )
655{
656 return Gather<HaloType, ParticleDataType>( halo, data, overallocation );
657}
658
659//---------------------------------------------------------------------------//
677template <class HaloType, class ParticleDataType>
678void gather( const HaloType& halo, ParticleDataType& data )
679{
680 auto gather = createGather( halo, data );
681 gather.apply();
682}
683
684/**********
685 * SCATTER *
686 **********/
687
688//---------------------------------------------------------------------------//
700template <class HaloType, class SliceType>
702 : public CommunicationData<HaloType, CommunicationDataSlice<SliceType>>
703{
704 public:
705 static_assert( is_halo<HaloType>::value, "" );
706
708 using commspace_type = typename HaloType::commspace_type;
710 using base_type =
713 using plan_type = typename base_type::plan_type;
715 using execution_space = typename base_type::execution_space;
717 using memory_space = typename base_type::memory_space;
719 using data_type = typename base_type::data_type;
721 using buffer_type = typename base_type::buffer_type;
722
735 Scatter( HaloType halo, SliceType slice, const double overallocation = 1.0 )
736 : base_type( halo, slice, overallocation )
737 {
738 reserve( _comm_plan, slice );
739 }
740
742 auto totalSend() { return _comm_plan.totalNumImport(); }
744 auto totalReceive() { return _comm_plan.totalNumExport(); }
746 auto totalSend( const HaloType& halo ) { return halo.totalNumImport(); }
748 auto totalReceive( const HaloType& halo ) { return halo.totalNumExport(); }
749
753 void apply() override { applyImpl( execution_space{}, commspace_type{} ); }
754
758 template <class ExecutionSpace, class CommSpaceType>
759 std::enable_if_t<std::is_same<CommSpaceType, Mpi>::value, void>
760 applyImpl( ExecutionSpace, CommSpaceType );
761
762 // Future: Add applyImpl that is enabled for other CommSpaceType types.
763
773 void reserve( const HaloType& halo, const SliceType& slice,
774 const double overallocation )
775 {
776 if ( !haloCheckValidSize( halo, slice ) )
777 throw std::runtime_error(
778 "Cabana::Scatter::reserve: "
779 "Slice is the wrong size for scatter! (Label: " +
780 slice.label() + ")" );
781
782 this->reserveImpl( halo, slice, totalSend( halo ), totalReceive( halo ),
783 overallocation );
784 }
785
791 void reserve( const HaloType& halo, const SliceType& slice )
792 {
793 if ( !haloCheckValidSize( halo, slice ) )
794 throw std::runtime_error(
795 "Cabana::Scatter::reserve: "
796 "Slice is the wrong size for scatter! (Label: " +
797 slice.label() + ")" );
798
799 this->reserveImpl( halo, slice, totalSend( halo ),
800 totalReceive( halo ) );
801 }
802
803 private:
804 using base_type::_comm_plan;
805 using base_type::_recv_size;
806 using base_type::_send_size;
807};
808
809} // end namespace Cabana
810
811// Include communication backends from what is enabled in CMake.
812#ifdef Cabana_ENABLE_MPI
814#endif // Enable MPI
815
816namespace Cabana
817{
818
832template <class HaloType, class SliceType>
833auto createScatter( const HaloType& halo, const SliceType& slice,
834 const double overallocation = 1.0,
835 typename std::enable_if<( is_halo<HaloType>::value &&
837 int>::type* = 0 )
838{
839 return Scatter<HaloType, SliceType>( halo, slice, overallocation );
840}
841
842//---------------------------------------------------------------------------//
860template <class HaloType, class SliceType>
861void scatter( const HaloType& halo, SliceType& slice,
862 typename std::enable_if<( is_halo<HaloType>::value &&
864 int>::type* = 0 )
865{
866 auto scatter = createScatter( halo, slice );
867 scatter.apply();
868}
869
870//---------------------------------------------------------------------------//
871
872} // end namespace Cabana
873
874#endif // end CABANA_HALO_HPP
Array-of-Struct-of-Arrays particle data structure.
Multi-node communication patterns. Base class.
Multi-node particle scatter/gather, Mpi implementations.
Slice a single particle property from an AoSoA.
Definition Cabana_CommunicationPlanBase.hpp:964
std::size_t totalNumImport() const
Get the total number of imports this rank will do.
Definition Cabana_CommunicationPlanBase.hpp:522
void createExportSteering(const PackViewType &neighbor_ids, const RankViewType &element_export_ranks)
Create the export steering vector.
Definition Cabana_CommunicationPlanBase.hpp:569
MPI_Comm comm() const
Get the MPI communicator.
Definition Cabana_CommunicationPlanBase.hpp:465
Kokkos::View< size_type *, memory_space > createWithTopology(ExecutionSpace exec_space, Export, const RankViewType &element_export_ranks, const std::vector< int > &neighbor_ranks)
Neighbor and export rank creator. Use this when you already know which ranks neighbor each other (i....
Definition Cabana_CommunicationPlan_Mpi.hpp:107
Kokkos::View< size_type *, memory_space > createWithoutTopology(ExecutionSpace exec_space, Export, const RankViewType &element_export_ranks)
Export rank creator. Use this when you don't know who you will receiving from - only who you are send...
Definition Cabana_CommunicationPlan_Mpi.hpp:272
CommunicationPlan(MPI_Comm comm)
Constructor.
Definition Cabana_CommunicationPlan_Mpi.hpp:59
auto totalSend(const HaloType &halo)
Total gather send size for this rank.
Definition Cabana_Halo.hpp:454
typename base_type::memory_space memory_space
Kokkos memory space.
Definition Cabana_Halo.hpp:425
auto totalReceive(const HaloType &halo)
Total gather receive size for this rank.
Definition Cabana_Halo.hpp:456
typename HaloType::commspace_type commspace_type
Communication space type.
Definition Cabana_Halo.hpp:416
void apply() override
Perform the gather operation.
Definition Cabana_Halo.hpp:461
void reserve(const HaloType &halo, AoSoAType &aosoa, const double overallocation)
Reserve new buffers as needed and update the halo and AoSoA data.
Definition Cabana_Halo.hpp:497
auto totalSend()
Total gather send size for this rank.
Definition Cabana_Halo.hpp:450
typename base_type::data_type data_type
Communication data type.
Definition Cabana_Halo.hpp:427
Gather(HaloType halo, AoSoAType aosoa, const double overallocation=1.0)
Definition Cabana_Halo.hpp:443
auto totalReceive()
Total gather receive size for this rank.
Definition Cabana_Halo.hpp:452
typename base_type::buffer_type buffer_type
Communication buffer type.
Definition Cabana_Halo.hpp:429
typename base_type::plan_type plan_type
Communication plan type (Halo)
Definition Cabana_Halo.hpp:421
typename base_type::execution_space execution_space
Kokkos execution space.
Definition Cabana_Halo.hpp:423
std::enable_if_t< std::is_same< CommSpaceType, Mpi >::value, void > applyImpl(ExecutionSpace, CommSpaceType)
Vanilla Mpi implementation of the gather operation.
void reserve(const HaloType &halo, AoSoAType &aosoa)
Reserve new buffers as needed and update the halo and AoSoA data.
Definition Cabana_Halo.hpp:478
CommunicationData< HaloType, CommunicationDataAoSoA< AoSoAType > > base_type
Base type.
Definition Cabana_Halo.hpp:418
auto totalSend(const HaloType &halo)
Total gather send size for this rank.
Definition Cabana_Halo.hpp:574
typename base_type::memory_space memory_space
Kokkos memory space.
Definition Cabana_Halo.hpp:545
typename base_type::buffer_type buffer_type
Communication buffer type.
Definition Cabana_Halo.hpp:549
CommunicationData< HaloType, CommunicationDataSlice< SliceType > > base_type
Base type.
Definition Cabana_Halo.hpp:538
void apply() override
Perform the gather operation.
Definition Cabana_Halo.hpp:581
auto totalReceive()
Total gather receive size for this rank.
Definition Cabana_Halo.hpp:572
Gather(HaloType halo, SliceType slice, const double overallocation=1.0)
Definition Cabana_Halo.hpp:563
std::enable_if_t< std::is_same< CommSpaceType, Mpi >::value, void > applyImpl(ExecutionSpace, CommSpaceType)
Vanilla Mpi implementation of the gather operation.
auto totalReceive(const HaloType &halo)
Total gather receive size for this rank.
Definition Cabana_Halo.hpp:576
void reserve(const HaloType &halo, const SliceType &slice, const double overallocation)
Reserve new buffers as needed and update the halo and slice data.
Definition Cabana_Halo.hpp:600
typename base_type::execution_space execution_space
Kokkos execution space.
Definition Cabana_Halo.hpp:543
typename HaloType::commspace_type commspace_type
Communication space type.
Definition Cabana_Halo.hpp:536
typename base_type::plan_type plan_type
Communication plan type (Halo)
Definition Cabana_Halo.hpp:541
auto totalSend()
Total gather send size for this rank.
Definition Cabana_Halo.hpp:570
void reserve(const HaloType &halo, const SliceType &slice)
Reserve new buffers as needed and update the halo and slice data.
Definition Cabana_Halo.hpp:620
typename base_type::data_type data_type
Communication data type.
Definition Cabana_Halo.hpp:547
Definition Cabana_Halo.hpp:393
A communication plan for scattering and gathering of ghosted data.
Definition Cabana_Halo.hpp:62
CommSpaceType commspace_type
Communication space type.
Definition Cabana_Halo.hpp:65
void build(const std::size_t num_local, const IdViewType &element_ids, const RankViewType &element_ranks)
Export rank (re)build interface.
Definition Cabana_Halo.hpp:276
std::size_t numGhost() const
Get the number of ghost elements this rank. Use this to resize a data structure for scatter/gather op...
Definition Cabana_Halo.hpp:348
void build(const std::size_t num_local, const IdViewType &element_ids, const RankViewType &element_ranks, const std::vector< int > &neighbor_ranks)
Neighbor and export rank (re)build interface.
Definition Cabana_Halo.hpp:255
std::size_t numLocal() const
Get the number of elements locally owned by this rank.
Definition Cabana_Halo.hpp:339
Halo(MPI_Comm comm, const std::size_t num_local, const IdViewType &element_ids, const RankViewType &element_ranks)
Export rank constructor. Use this when you don't know who you will receiving from - only who you are ...
Definition Cabana_Halo.hpp:151
Halo(MPI_Comm comm, const std::size_t num_local, const IdViewType &element_ids, const RankViewType &element_ranks, const std::vector< int > &neighbor_ranks)
Neighbor and export rank constructor. Use this when you don't know who you will receiving from - only...
Definition Cabana_Halo.hpp:109
Synchronously scatter data from the ghosts to the local decomposition of a slice using the halo rever...
Definition Cabana_Halo.hpp:703
void reserve(const HaloType &halo, const SliceType &slice)
Reserve new buffers as needed and update the halo and slice data.
Definition Cabana_Halo.hpp:791
CommunicationData< HaloType, CommunicationDataSlice< SliceType > > base_type
Base type.
Definition Cabana_Halo.hpp:710
typename base_type::memory_space memory_space
Kokkos memory space.
Definition Cabana_Halo.hpp:717
auto totalSend(const HaloType &halo)
Total gather send size for this rank.
Definition Cabana_Halo.hpp:746
typename base_type::data_type data_type
Communication data type.
Definition Cabana_Halo.hpp:719
void reserve(const HaloType &halo, const SliceType &slice, const double overallocation)
Reserve new buffers as needed and update the halo and slice data. Reallocation only occurs if there i...
Definition Cabana_Halo.hpp:773
typename HaloType::commspace_type commspace_type
Communication space type.
Definition Cabana_Halo.hpp:708
typename base_type::plan_type plan_type
Communication plan type (Halo).
Definition Cabana_Halo.hpp:713
std::enable_if_t< std::is_same< CommSpaceType, Mpi >::value, void > applyImpl(ExecutionSpace, CommSpaceType)
Vanilla Mpi implementation of the scatter operation.
auto totalReceive()
Total scatter receive size for this rank.
Definition Cabana_Halo.hpp:744
void apply() override
Perform the scatter operation.
Definition Cabana_Halo.hpp:753
typename base_type::buffer_type buffer_type
Communication buffer type.
Definition Cabana_Halo.hpp:721
typename base_type::execution_space execution_space
Kokkos execution space.
Definition Cabana_Halo.hpp:715
auto totalReceive(const HaloType &halo)
Total gather receive size for this rank.
Definition Cabana_Halo.hpp:748
Scatter(HaloType halo, SliceType slice, const double overallocation=1.0)
Definition Cabana_Halo.hpp:735
auto totalSend()
Total scatter send size for this rank.
Definition Cabana_Halo.hpp:742
Core: particle data structures and algorithms.
Definition Cabana_AoSoA.hpp:36
void gather(const HaloType &halo, ParticleDataType &data)
Synchronously gather data from the local decomposition to the ghosts using the halo forward communica...
Definition Cabana_Halo.hpp:678
AoSoA_t::template member_slice_type< M > slice(const AoSoA_t &aosoa, const std::string &slice_label="")
Create a slice from an AoSoA.
Definition Cabana_AoSoA.hpp:77
void scatter(const HaloType &halo, SliceType &slice, typename std::enable_if<(is_halo< HaloType >::value &&is_slice< SliceType >::value), int >::type *=0)
Synchronously scatter data from the ghosts to the local decomposition of a slice using the halo rever...
Definition Cabana_Halo.hpp:861
auto createScatter(const HaloType &halo, const SliceType &slice, const double overallocation=1.0, typename std::enable_if<(is_halo< HaloType >::value &&is_slice< SliceType >::value), int >::type *=0)
Create the scatter.
Definition Cabana_Halo.hpp:833
auto createGather(const HaloType &halo, const ParticleDataType &data, const double overallocation=1.0)
Create the gather.
Definition Cabana_Halo.hpp:653
bool haloCheckValidSize(const Halo &halo, const ParticleData &particles, typename std::enable_if<(is_halo< Halo >::value), int >::type *=0)
Ensure the particle size matches the total halo (local and ghost) size.
Definition Cabana_Halo.hpp:384
Export-based tag - default.
Definition Cabana_Tags.hpp:38
Vanilla MPI backend tag - default.
Definition Cabana_Tags.hpp:28
Halo static type checker.
Definition Cabana_Halo.hpp:371
Slice static type checker.
Definition Cabana_Slice.hpp:868