Zoltan2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t > Class Template Referenceabstract

Zoltan2_Directory is an abstract base class. More...

#include <Zoltan2_Directory.hpp>

Inheritance diagram for Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >:
Inheritance graph
[legend]

Public Types

enum  Update_Mode { Replace = 0, Add, Aggregate, AggregateAdd }
 Update_Mode determines how update executes. More...
 

Public Member Functions

 Zoltan2_Directory (Teuchos::RCP< const Teuchos::Comm< int > > comm_, bool use_lid_, int debug_level_)
 Construct Zoltan2_Directory (abstract class). More...
 
virtual ~Zoltan2_Directory ()
 Destructor currently does nothing. More...
 
int update (size_t length, const gid_t *gid, const lid_t *lid, const user_t *user, const int *partition, Update_Mode update_mode)
 update is called by user to submit new data. More...
 
int find (size_t length, const gid_t *gid, lid_t *lid, user_t *user, int *partition, int *owner, bool throw_if_missing=true)
 Can be Replace, Add, or Aggregate. More...
 
int remove (size_t length, const gid_t *gid)
 if true will throw if a gid is not found. This is used by the unit tests to properly assess if remove has worked. More...
 
int print () const
 gids to remove. More...
 
void stats () const
 stats. New Kokkos mode needs further development. More...
 
bool is_use_lid () const
 returns true if the directory is handling local ids. More...
 
void get_locally_managed_gids (std::vector< gid_t > &local_gids) const
 
void remap_user_data_as_unique_gids ()
 
size_t node_map_size () const
 

Protected Types

typedef Kokkos::UnorderedMap
< gid_t,
Zoltan2_Directory_Node< gid_t,
lid_t, user_t >
, Kokkos::HostSpace > 
node_map_t
 

Protected Member Functions

int update_local (gid_t *gid, lid_t *lid, user_t *user, int partition, int owner)
 
int find_local (gid_t *gid, lid_t *lid, user_t *user, int *partition, int *owner, bool throw_if_missing=true) const
 
int remove_local (gid_t *gid)
 
void allocate ()
 
int copy (const Zoltan2_Directory< gid_t, lid_t, user_t > &dd)
 
unsigned int hash_proc (const gid_t &gid) const
 
virtual bool is_Zoltan2_Directory_Vector () const =0
 
virtual void update_local_user (const user_t *pRaw, user_t &dst)=0
 
virtual void user_to_raw (const user_t &src, user_t *pRaw) const =0
 
virtual void raw_to_user (const user_t *pRaw, user_t &dst) const =0
 
virtual size_t size_of_value_type () const =0
 
virtual size_t get_update_msg_size (const user_t &data) const =0
 
virtual size_t get_update_msg_size (const user_t *pRaw) const =0
 
virtual size_t get_local_find_msg_size (gid_t *gid, bool throw_if_missing=true) const =0
 
virtual size_t get_incoming_find_msg_size (Zoltan2_DD_Find_Msg< gid_t, lid_t > *msg) const =0
 

Protected Attributes

size_t find_msg_size
 
size_t update_msg_size
 
size_t remove_msg_size
 
node_map_t node_map
 
Teuchos::RCP< const
Teuchos::Comm< int > > 
comm
 
bool use_lid
 
int debug_level
 
size_t max_id_size
 
Update_Mode mode
 

Detailed Description

template<typename gid_t, typename lid_t, typename user_t>
class Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >

Zoltan2_Directory is an abstract base class.

The user will implement Zoltan2_Directory_Simple or Zoltan2_Directory_Vector in the current form and this class provides all the shared methods.

Definition at line 124 of file Zoltan2_Directory.hpp.

Member Typedef Documentation

template<typename gid_t, typename lid_t, typename user_t>
typedef Kokkos::UnorderedMap<gid_t, Zoltan2_Directory_Node<gid_t,lid_t,user_t>, Kokkos::HostSpace> Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::node_map_t
protected

Definition at line 254 of file Zoltan2_Directory.hpp.

Member Enumeration Documentation

template<typename gid_t, typename lid_t, typename user_t>
enum Zoltan2::Zoltan2_Directory::Update_Mode

Update_Mode determines how update executes.

Enumerator
Replace 

The new value replaces the original value.

Add 

All values from different procs are summed.

Aggregate 

For std::vector user data, aggregates all data so for example [1,2,5] and [3,5] becomes [1,2,3,5].

AggregateAdd 

In progress and needs discussion. Currently this mode will use operator== to determine if two items match and then user operator += to aggregate them together, which allows a custom struct user data type to define how aggregation works. Did this for graph metrics work. Note that this mode currently won't worry about sorting the order but that could be handled through operator>.

Definition at line 127 of file Zoltan2_Directory.hpp.

Constructor & Destructor Documentation

template<typename gid_t, typename lid_t, typename user_t>
Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::Zoltan2_Directory ( Teuchos::RCP< const Teuchos::Comm< int > >  comm_,
bool  use_lid_,
int  debug_level_ 
)
inline

Construct Zoltan2_Directory (abstract class).

Parameters
comm_Teuchos comm provided by user.
use_lid_are local IDs being submitted and read.
debug_level_debug level controls output

Definition at line 142 of file Zoltan2_Directory.hpp.

template<typename gid_t, typename lid_t, typename user_t>
virtual Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::~Zoltan2_Directory ( )
inlinevirtual

Destructor currently does nothing.

Definition at line 153 of file Zoltan2_Directory.hpp.

Member Function Documentation

template<typename gid_t , typename lid_t , typename user_t >
int Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::update ( size_t  length,
const gid_t *  gid,
const lid_t *  lid,
const user_t user,
const int *  partition,
Update_Mode  update_mode 
)

update is called by user to submit new data.

Parameters
lidgids being updated.
userlids if used.
partitionuser data if used.
update_modepartition data if used.

Definition at line 163 of file Zoltan2_Directory_Impl.hpp.

template<typename gid_t , typename lid_t , typename user_t >
int Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::find ( size_t  length,
const gid_t *  gid,
lid_t *  lid,
user_t user,
int *  partition,
int *  owner,
bool  throw_if_missing = true 
)

Can be Replace, Add, or Aggregate.

find is called by user to get data back from directory.

Parameters
lidgids to find.
userlids to find if being used.
partitionuser data to find if being used.
ownerpartition data to find if used.
throw_if_missingowner data to find if used.

Definition at line 568 of file Zoltan2_Directory_Impl.hpp.

template<typename gid_t , typename lid_t , typename user_t >
int Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::remove ( size_t  length,
const gid_t *  gid 
)

if true will throw if a gid is not found. This is used by the unit tests to properly assess if remove has worked.

remove eliminates these gids from the directory .

Definition at line 950 of file Zoltan2_Directory_Impl.hpp.

template<typename gid_t , typename lid_t , typename user_t >
int Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::print ( ) const

gids to remove.

print output. New Kokkos mode needs further development.

Definition at line 887 of file Zoltan2_Directory_Impl.hpp.

template<typename gid_t , typename lid_t , typename user_t >
void Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::stats ( ) const

stats. New Kokkos mode needs further development.

Definition at line 931 of file Zoltan2_Directory_Impl.hpp.

template<typename gid_t, typename lid_t, typename user_t>
bool Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::is_use_lid ( ) const
inline

returns true if the directory is handling local ids.

Definition at line 189 of file Zoltan2_Directory.hpp.

template<typename gid_t, typename lid_t, typename user_t>
void Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::get_locally_managed_gids ( std::vector< gid_t > &  local_gids) const
inline

Definition at line 191 of file Zoltan2_Directory.hpp.

template<typename gid_t, typename lid_t, typename user_t>
void Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::remap_user_data_as_unique_gids ( )
inline

Definition at line 209 of file Zoltan2_Directory.hpp.

template<typename gid_t, typename lid_t, typename user_t>
size_t Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::node_map_size ( ) const
inline

Definition at line 230 of file Zoltan2_Directory.hpp.

template<typename gid_t , typename lid_t , typename user_t >
int Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::update_local ( gid_t *  gid,
lid_t *  lid,
user_t user,
int  partition,
int  owner 
)
protected

Definition at line 418 of file Zoltan2_Directory_Impl.hpp.

template<typename gid_t , typename lid_t , typename user_t >
int Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::find_local ( gid_t *  gid,
lid_t *  lid,
user_t user,
int *  partition,
int *  owner,
bool  throw_if_missing = true 
) const
protected

Definition at line 821 of file Zoltan2_Directory_Impl.hpp.

template<typename gid_t , typename lid_t , typename user_t >
int Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::remove_local ( gid_t *  gid)
protected

Definition at line 1051 of file Zoltan2_Directory_Impl.hpp.

template<typename gid_t , typename lid_t , typename user_t >
void Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::allocate ( )
protected

Definition at line 81 of file Zoltan2_Directory_Impl.hpp.

template<typename gid_t , typename lid_t , typename user_t >
int Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::copy ( const Zoltan2_Directory< gid_t, lid_t, user_t > &  dd)
protected

Definition at line 156 of file Zoltan2_Directory_Impl.hpp.

template<typename gid_t , typename lid_t , typename user_t >
unsigned int Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::hash_proc ( const gid_t &  gid) const
protected

Definition at line 1079 of file Zoltan2_Directory_Impl.hpp.

template<typename gid_t, typename lid_t, typename user_t>
virtual bool Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::is_Zoltan2_Directory_Vector ( ) const
protectedpure virtual
template<typename gid_t, typename lid_t, typename user_t>
virtual void Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::update_local_user ( const user_t pRaw,
user_t dst 
)
protectedpure virtual
template<typename gid_t, typename lid_t, typename user_t>
virtual void Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::user_to_raw ( const user_t src,
user_t pRaw 
) const
protectedpure virtual
template<typename gid_t, typename lid_t, typename user_t>
virtual void Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::raw_to_user ( const user_t pRaw,
user_t dst 
) const
protectedpure virtual
template<typename gid_t, typename lid_t, typename user_t>
virtual size_t Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::size_of_value_type ( ) const
protectedpure virtual
template<typename gid_t, typename lid_t, typename user_t>
virtual size_t Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::get_update_msg_size ( const user_t data) const
protectedpure virtual
template<typename gid_t, typename lid_t, typename user_t>
virtual size_t Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::get_update_msg_size ( const user_t pRaw) const
protectedpure virtual
template<typename gid_t, typename lid_t, typename user_t>
virtual size_t Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::get_local_find_msg_size ( gid_t *  gid,
bool  throw_if_missing = true 
) const
protectedpure virtual
template<typename gid_t, typename lid_t, typename user_t>
virtual size_t Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::get_incoming_find_msg_size ( Zoltan2_DD_Find_Msg< gid_t, lid_t > *  msg) const
protectedpure virtual

Member Data Documentation

template<typename gid_t, typename lid_t, typename user_t>
size_t Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::find_msg_size
protected

Definition at line 247 of file Zoltan2_Directory.hpp.

template<typename gid_t, typename lid_t, typename user_t>
size_t Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::update_msg_size
protected

Definition at line 248 of file Zoltan2_Directory.hpp.

template<typename gid_t, typename lid_t, typename user_t>
size_t Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::remove_msg_size
protected

Definition at line 249 of file Zoltan2_Directory.hpp.

template<typename gid_t, typename lid_t, typename user_t>
node_map_t Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::node_map
protected

Definition at line 255 of file Zoltan2_Directory.hpp.

template<typename gid_t, typename lid_t, typename user_t>
Teuchos::RCP<const Teuchos::Comm<int> > Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::comm
protected

Definition at line 271 of file Zoltan2_Directory.hpp.

template<typename gid_t, typename lid_t, typename user_t>
bool Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::use_lid
protected

Definition at line 273 of file Zoltan2_Directory.hpp.

template<typename gid_t, typename lid_t, typename user_t>
int Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::debug_level
protected

Definition at line 274 of file Zoltan2_Directory.hpp.

template<typename gid_t, typename lid_t, typename user_t>
size_t Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::max_id_size
protected

Definition at line 276 of file Zoltan2_Directory.hpp.

template<typename gid_t, typename lid_t, typename user_t>
Update_Mode Zoltan2::Zoltan2_Directory< gid_t, lid_t, user_t >::mode
protected

Definition at line 277 of file Zoltan2_Directory.hpp.


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