stk::parallel::DistributedIndex Class Reference

#include <DistributedIndex.hpp>

List of all members.


Detailed Description

Parallel cross-reference index for a collection of keys.

operations

All methods use parallel collective communication operations.

Each processor constructs a DistributedIndex with its local collection of keys. The resulting DistributedIndex may be queried for

key space

When construction the key space is partitioned into N spans defined by a minimum and maximum key value for each span.

Definition at line 39 of file DistributedIndex.hpp.

Public Types

typedef uint64_t KeyType
typedef int ProcType
typedef std::pair< KeyType,
KeyType
KeySpan
typedef std::pair< KeyType,
ProcType
KeyProc

Public Member Functions

 ~DistributedIndex ()
 DistributedIndex (ParallelMachine comm, const std::vector< KeySpan > &partition_spans)
 Construct a parallel index with a parititioning of the key space.
void query (std::vector< KeyProc > &sharing_of_local_keys) const
 Query with which process the local added keys are shared.
void query (const std::vector< KeyType > &keys, std::vector< KeyProc > &sharing_of_keys) const
 Query which processors added the given keys.
void update_keys (const std::vector< KeyType > &add_new_keys, const std::vector< KeyType > &remove_existing_keys)
 Update a parallel index with new and changed keys.
void generate_new_keys (const std::vector< size_t > &requests, std::vector< std::vector< KeyType > > &requested_keys)
 Request a collection of unused keys.

Friends

class ::UnitTestSTKParallelDistributedIndex


Constructor & Destructor Documentation

stk::parallel::DistributedIndex::DistributedIndex ( ParallelMachine  comm,
const std::vector< KeySpan > &  partition_spans 
)

Construct a parallel index with a parititioning of the key space.

To guarantee parallel consistency process zero broadcasts the partition bounds and all other processes accept those bounds.

The vector of spans must be well-ordered and not overlap; e.g., partition_spans[i].first <= partition_spans[i].second partition_spans[i].second < partition_spans[i+1].first

Definition at line 72 of file DistributedIndex.cpp.


Member Function Documentation

void stk::parallel::DistributedIndex::query ( const std::vector< KeyType > &  keys,
std::vector< KeyProc > &  sharing_of_keys 
) const

Query which processors added the given keys.

The local processor is in the output if it submitted a queried key.

void stk::parallel::DistributedIndex::update_keys ( const std::vector< KeyType > &  add_new_keys,
const std::vector< KeyType > &  remove_existing_keys 
)

Update a parallel index with new and changed keys.

FIRST: Remove this process' participation in the existing keys. SECOND: Add this process' participation in the new keys.

void stk::parallel::DistributedIndex::generate_new_keys ( const std::vector< size_t > &  requests,
std::vector< std::vector< KeyType > > &  requested_keys 
)

Request a collection of unused keys.

Each process inputs its independent request for keys which do not currenly appear in the distributed index. The output keys are grouped by partition_spans. The output keys are guaranteed to be unique among all processes. The output keys are added into the distributed index.

Multiple request should be bundled to reduce parallel communication costs. The output 'requested_keys' are sorted according to the policy.

The the 'first' member of the requests are the lower bound value for the keys.

Exceptions:
Throw an exception on all process if any request cannot be satisfied.

Definition at line 714 of file DistributedIndex.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Jul 13 09:27:33 2010 for Sierra Toolkit by  doxygen 1.4.7