diff --git a/examples/analytical_apps/pagerank/pagerank_vc_context.h b/examples/analytical_apps/pagerank/pagerank_vc_context.h index 00f3dd96..efdff3ac 100644 --- a/examples/analytical_apps/pagerank/pagerank_vc_context.h +++ b/examples/analytical_apps/pagerank/pagerank_vc_context.h @@ -16,6 +16,7 @@ limitations under the License. #ifndef EXAMPLES_ANALYTICAL_APPS_PAGERANK_PAGERANK_VC_CONTEXT_H_ #define EXAMPLES_ANALYTICAL_APPS_PAGERANK_PAGERANK_VC_CONTEXT_H_ +#include "grape/grape.h" #include "grape/utils/memory_tracker.h" #include @@ -24,9 +25,8 @@ namespace grape { template class PageRankVCContext : public VertexDataContext { - using oid_t = typename FRAG_T::oid_t; - public: + using oid_t = typename FRAG_T::oid_t; explicit PageRankVCContext(const FRAG_T& fragment) : VertexDataContext(fragment), master_result(this->data()) { @@ -64,7 +64,7 @@ class PageRankVCContext : public VertexDataContext { #ifdef PROFILING VLOG(2) << "[frag-" << frag.fid() << "]: init degree: " << t0 << " s, " << "calc master result: " << t1 << " s, " - << "propogate: " << t2 << " s"; + << "propagate: " << t2 << " s"; #endif } diff --git a/examples/analytical_apps/run_app_vc.h b/examples/analytical_apps/run_app_vc.h index 6a9a2b5b..5aa95d6c 100644 --- a/examples/analytical_apps/run_app_vc.h +++ b/examples/analytical_apps/run_app_vc.h @@ -38,7 +38,7 @@ void CreateAndQueryVC(const CommSpec& comm_spec, const std::string& out_prefix, graph_spec.load_concurrency = FLAGS_load_concurrency; using FRAG_T = - ImmutableVertexcutFragment; + ImmutableVertexcutFragment; std::shared_ptr fragment = LoadVertexcutGraph( FLAGS_efile, FLAGS_vertex_num, comm_spec, graph_spec); #ifdef TRACKING_MEMORY diff --git a/grape/fragment/basic_vc_fragment_loader.h b/grape/fragment/basic_vc_fragment_loader.h index fc04523e..6ce26a21 100644 --- a/grape/fragment/basic_vc_fragment_loader.h +++ b/grape/fragment/basic_vc_fragment_loader.h @@ -119,7 +119,7 @@ class BasicVCFragmentLoader { std::vector scan_threads; for (int i = 0; i < load_concurrency_; ++i) { scan_threads.emplace_back( - [this, &bucket_edge_num, &thread_local_bucket_edge_num](int tid) { + [this, &thread_local_bucket_edge_num](int tid) { auto& vec = thread_local_bucket_edge_num[tid]; vec.clear(); vec.resize(bucket_num_ * bucket_num_, 0); diff --git a/grape/fragment/immutable_vertexcut_fragment.h b/grape/fragment/immutable_vertexcut_fragment.h index 010f7265..3adb1bf2 100644 --- a/grape/fragment/immutable_vertexcut_fragment.h +++ b/grape/fragment/immutable_vertexcut_fragment.h @@ -36,13 +36,16 @@ template class ImmutableVertexcutFragment {}; template <> -class ImmutableVertexcutFragment - : public FragmentBase { +class ImmutableVertexcutFragment + : public FragmentBase { public: - using oid_t = int64_t; + using oid_t = uint64_t; + using vid_t = uint64_t; using edata_t = EmptyType; using vdata_t = EmptyType; + using vertex_t = Vertex; using vertices_t = VertexRange; + using vertex_range_t = VertexRange; using both_vertices_t = DualVertexRange; using edge_t = Edge; using base_t = FragmentBase; @@ -74,6 +77,8 @@ class ImmutableVertexcutFragment using base_t::fid_; using base_t::fnum_; + inline const EmptyType& GetData(const vertex_t& v) const { return data_; } + void Init(const CommSpec& comm_spec, int64_t vnum, std::vector&& edges, int bucket_num = 1, std::vector&& bucket_edge_offsets = {}) { @@ -146,6 +151,7 @@ class ImmutableVertexcutFragment const vertices_t& DestinationVertices() const { return dst_vertices_; } const both_vertices_t& Vertices() const { return vertices_; } + const vertices_t& InnerVertices() const { return master_vertices_; } const vertices_t& MasterVertices() const { return master_vertices_; } #ifdef USE_EDGE_ARRAY @@ -245,6 +251,7 @@ class ImmutableVertexcutFragment } int GetBucketNum() const { return bucket_num_; } + oid_t GetId(const Vertex& v) const { return v.GetValue(); } private: void buildBucket(int thread_num) { @@ -334,6 +341,7 @@ class ImmutableVertexcutFragment #endif int bucket_num_; std::vector bucket_edge_offsets_; + EmptyType data_; }; } // namespace grape diff --git a/grape/vertex_map/partitioner.h b/grape/vertex_map/partitioner.h index 0210e755..12f6b39c 100644 --- a/grape/vertex_map/partitioner.h +++ b/grape/vertex_map/partitioner.h @@ -269,8 +269,9 @@ template struct VCPartitioner {}; template <> -struct VCPartitioner { - using vertices_t = VertexRange; +struct VCPartitioner { + using oid_t = uint64_t; + using vertices_t = VertexRange; public: VCPartitioner() {} @@ -287,11 +288,11 @@ struct VCPartitioner { vchunk_ = master_vchunk_ * fnum_sr_; } - fid_t get_edge_partition(const int64_t& src, const int64_t& dst) const { + fid_t get_edge_partition(const oid_t& src, const oid_t& dst) const { return coord_to_fid(get_vertex_coord(src), get_vertex_coord(dst)); } - fid_t get_vertex_coord(const int64_t& v) const { return v / vchunk_; } + fid_t get_vertex_coord(const oid_t& v) const { return v / vchunk_; } fid_t coord_to_fid(const fid_t& src, const fid_t& dst) const { return src * fnum_sr_ + dst;