00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00027 #ifndef util_ParallelIndex_hpp
00028 #define util_ParallelIndex_hpp
00029
00030 #include <utility>
00031 #include <vector>
00032
00033 #include <util/Basics.hpp>
00034 #include <util/Parallel.hpp>
00035
00036 namespace phdmesh {
00037
00045 class ParallelIndex {
00046 public:
00047
00048 typedef uint64_type key_type ;
00049
00050 typedef std::pair< key_type , key_type > KeyProc ;
00051
00052 struct LessKeyProc {
00053 bool operator()( const KeyProc & lhs , const KeyProc & rhs ) const
00054 { return lhs < rhs ; }
00055
00056 bool operator()( const KeyProc & lhs , const key_type rhs ) const
00057 { return lhs.first < rhs ; }
00058 };
00059
00060 ~ParallelIndex();
00061
00062 ParallelIndex( ParallelMachine , const std::vector<key_type> & );
00063
00067 void query( std::vector<KeyProc> & ) const ;
00068
00072 void query( const std::vector<key_type> & , std::vector<KeyProc> & ) const ;
00073
00074 private:
00075 ParallelIndex();
00076 ParallelIndex( const ParallelIndex & );
00077 ParallelIndex & operator = ( const ParallelIndex & );
00078
00079 ParallelMachine m_comm ;
00080 std::vector<KeyProc> m_key_proc ;
00081 };
00082
00083 }
00084
00085
00086
00087 #endif
00088