DASH  0.3.0
dash::halo::HaloUpdateEnv< HaloBlockT, SigReady > Class Template Reference

Public Types

using HaloMemory_t = HaloMemory< HaloBlockT >
 
using Element_t = typename HaloBlockT::Element_t
 
using Team_t = dash::Team
 

Public Member Functions

 HaloUpdateEnv (const HaloBlockT &halo_block, Element_t *local_memory, Team_t &team, const TeamSpec_t &tspec)
 
void update ()
 Initiates a blocking halo region update for all halo elements. More...
 
void update_at (region_index_t index)
 Initiates a blocking halo region update for all halo elements within the the given region. More...
 
void update_async ()
 Initiates an asychronous halo region update for all halo elements. More...
 
void update_async_at (region_index_t index)
 Initiates an asychronous halo region update for all halo elements within the given region. More...
 
void wait ()
 Waits until all halo updates are finished. More...
 
void wait (region_index_t index)
 Waits until the halo updates for the given halo region is finished. More...
 
void prepare_update ()
 
HaloMemory_thalo_memory ()
 Returns the halo memory management object HaloMemory. More...
 
const HaloMemory_thalo_memory () const
 Returns the halo memory management object HaloMemory. More...
 
BlockEnv_t block_env ()
 Returns the halo environment information object BlockEnvironment. More...
 
const BlockEnv_tblock_env () const
 Returns the halo environment information object BlockEnvironment. More...
 

Detailed Description

template<typename HaloBlockT, SignalReady SigReady>
class dash::halo::HaloUpdateEnv< HaloBlockT, SigReady >

Definition at line 540 of file HaloMemory.h.

Member Function Documentation

◆ block_env() [1/2]

template<typename HaloBlockT, SignalReady SigReady>
BlockEnv_t dash::halo::HaloUpdateEnv< HaloBlockT, SigReady >::block_env ( )
inline

Returns the halo environment information object BlockEnvironment.

Definition at line 682 of file HaloMemory.h.

682 { return _halo_block.block_env(); }

◆ block_env() [2/2]

template<typename HaloBlockT, SignalReady SigReady>
const BlockEnv_t& dash::halo::HaloUpdateEnv< HaloBlockT, SigReady >::block_env ( ) const
inline

Returns the halo environment information object BlockEnvironment.

Definition at line 687 of file HaloMemory.h.

687 { return _halo_block.block_env() ; }

◆ halo_memory() [1/2]

template<typename HaloBlockT, SignalReady SigReady>
HaloMemory_t& dash::halo::HaloUpdateEnv< HaloBlockT, SigReady >::halo_memory ( )
inline

Returns the halo memory management object HaloMemory.

Definition at line 672 of file HaloMemory.h.

Referenced by dash::halo::HaloMatrixWrapper< MatrixT, SigReady >::set_custom_halos(), and dash::halo::HaloMatrixWrapper< MatrixT, SigReady >::stencil_operator().

672 { return _halo_memory; }

◆ halo_memory() [2/2]

template<typename HaloBlockT, SignalReady SigReady>
const HaloMemory_t& dash::halo::HaloUpdateEnv< HaloBlockT, SigReady >::halo_memory ( ) const
inline

Returns the halo memory management object HaloMemory.

Definition at line 677 of file HaloMemory.h.

677 { return _halo_memory; }

◆ update()

template<typename HaloBlockT, SignalReady SigReady>
void dash::halo::HaloUpdateEnv< HaloBlockT, SigReady >::update ( )
inline

Initiates a blocking halo region update for all halo elements.

Definition at line 577 of file HaloMemory.h.

Referenced by dash::halo::HaloMatrixWrapper< MatrixT, SigReady >::update().

577  {
578  prepare_update();
579  for(auto& data : _region_data) {
580  update_halo_intern(data.first, data.second);
581  }
582  wait();
583  }
void wait()
Waits until all halo updates are finished.
Definition: HaloMemory.h:629

◆ update_async()

template<typename HaloBlockT, SignalReady SigReady>
void dash::halo::HaloUpdateEnv< HaloBlockT, SigReady >::update_async ( )
inline

Initiates an asychronous halo region update for all halo elements.

Definition at line 605 of file HaloMemory.h.

Referenced by dash::halo::HaloMatrixWrapper< MatrixT, SigReady >::update_async().

605  {
606  prepare_update();
607  for(auto& data : _region_data) {
608  update_halo_intern(data.first, data.second);
609  }
610  }

◆ update_async_at()

template<typename HaloBlockT, SignalReady SigReady>
void dash::halo::HaloUpdateEnv< HaloBlockT, SigReady >::update_async_at ( region_index_t  index)
inline

Initiates an asychronous halo region update for all halo elements within the given region.

TODO: find a solution for prepare update

Definition at line 618 of file HaloMemory.h.

Referenced by dash::halo::HaloMatrixWrapper< MatrixT, SigReady >::update_async_at().

618  {
619  auto it_find = _region_data.find(index);
620  if(it_find != _region_data.end()) {
621  update_halo_intern(it_find->first, it_find->second);
622  }
623  }
constexpr std::enable_if< std::is_integral< IndexType >::value, IndexType >::type index(IndexType idx)
Definition: Iterator.h:60

◆ update_at()

template<typename HaloBlockT, SignalReady SigReady>
void dash::halo::HaloUpdateEnv< HaloBlockT, SigReady >::update_at ( region_index_t  index)
inline

Initiates a blocking halo region update for all halo elements within the the given region.

TODO: find a solution for prepare update

Definition at line 591 of file HaloMemory.h.

Referenced by dash::halo::HaloMatrixWrapper< MatrixT, SigReady >::update_at().

591  {
592  auto it_find = _region_data.find(index);
593  if(it_find != _region_data.end()) {
594  update_halo_intern(it_find->first, it_find->second);
595  dart_wait_local(&it_find->second.handle);
596  if(SigReady == SignalReady::ON) {
597  _signal_env.put_ready_signal_blocking(it_find->first);
598  }
599  }
600  }
constexpr std::enable_if< std::is_integral< IndexType >::value, IndexType >::type index(IndexType idx)
Definition: Iterator.h:60
dart_ret_t dart_wait_local(dart_handle_t *handle)
Wait for the local completion of an operation.

◆ wait() [1/2]

template<typename HaloBlockT, SignalReady SigReady>
void dash::halo::HaloUpdateEnv< HaloBlockT, SigReady >::wait ( )
inline

Waits until all halo updates are finished.

Only useful for asynchronous halo updates.

Definition at line 629 of file HaloMemory.h.

Referenced by dash::halo::HaloMatrixWrapper< MatrixT, SigReady >::wait().

629  {
630  for(auto& region : _region_data) {
631  dart_wait_local(&region.second.handle);
632  if(SigReady == SignalReady::ON) {
633  _signal_env.put_ready_signal_async(region.first);
634  }
635  }
636  if(SigReady == SignalReady::ON) {
637  _signal_env.wait_put_ready_signals();
638  }
639  }
dart_ret_t dart_wait_local(dart_handle_t *handle)
Wait for the local completion of an operation.

◆ wait() [2/2]

template<typename HaloBlockT, SignalReady SigReady>
void dash::halo::HaloUpdateEnv< HaloBlockT, SigReady >::wait ( region_index_t  index)
inline

Waits until the halo updates for the given halo region is finished.

Only useful for asynchronous halo updates.

Definition at line 645 of file HaloMemory.h.

645  {
646  auto it_find = _region_data.find(index);
647  if(it_find == _region_data.end()) {
648  return;
649  }
650 
651  dart_wait_local(&it_find->second.handle);
652  if(SigReady == SignalReady::ON) {
653  _signal_env.put_ready_signal_blocking(it_find->first);
654  }
655  }
constexpr std::enable_if< std::is_integral< IndexType >::value, IndexType >::type index(IndexType idx)
Definition: Iterator.h:60
dart_ret_t dart_wait_local(dart_handle_t *handle)
Wait for the local completion of an operation.

The documentation for this class was generated from the following file: