Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
luoxiaojian committed Sep 19, 2024
1 parent 9ed0fab commit f900f43
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions examples/analytical_apps/pagerank/pagerank_vc.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class PageRankVC
#endif
typename fragment_t::template both_vertex_array_t<int> degree(
frag.Vertices(), 0);
#ifdef TRACKING_MEMORY_ALLOCATIONS
#ifdef TRACKING_MEMORY
// allocate degree array for both src and dst vertices
MemoryTracker::GetInstance().allocate(frag.Vertices().size() *
sizeof(int));
Expand Down Expand Up @@ -91,7 +91,7 @@ class PageRankVC

messages.GatherMasterVertices<fragment_t, int, NumericSum<int>>(
frag, degree, ctx.master_degree);
#ifdef TRACKING_MEMORY_ALLOCATIONS
#ifdef TRACKING_MEMORY
// deallocate degree array for both src and dst vertices
MemoryTracker::GetInstance().deallocate(frag.Vertices().size() *
sizeof(int));
Expand Down
2 changes: 1 addition & 1 deletion examples/analytical_apps/pagerank/pagerank_vc_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class PageRankVCContext : public VertexDataContext<FRAG_T, double> {
next_result.Init(fragment.Vertices());
master_degree.Init(fragment.MasterVertices());

#ifdef TRACKING_MEMORY_ALLOCATIONS
#ifdef TRACKING_MEMORY
MemoryTracker::GetInstance().allocate(fragment.Vertices().size() *
sizeof(double));
MemoryTracker::GetInstance().allocate(fragment.Vertices().size() *
Expand Down
4 changes: 2 additions & 2 deletions examples/analytical_apps/run_app_vc.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ void CreateAndQueryVC(const CommSpec& comm_spec, const std::string& out_prefix,
ImmutableVertexcutFragment<int64_t, grape::EmptyType, grape::EmptyType>;
std::shared_ptr<FRAG_T> fragment = LoadVertexcutGraph<FRAG_T>(
FLAGS_efile, FLAGS_vertex_num, comm_spec, graph_spec);
#ifdef TRACKING_MEMORY_ALLOCATIONS
#ifdef TRACKING_MEMORY
VLOG(1) << "[worker-" << comm_spec.worker_id() << "] after loading graph: "
<< MemoryTracker::GetInstance().GetMemoryUsageInfo();
#endif
using AppType = APP_T<FRAG_T>;
auto app = std::make_shared<AppType>();
DoQuery<FRAG_T, AppType, Args...>(fragment, app, comm_spec, spec, out_prefix,
args...);
#ifdef TRACKING_MEMORY_ALLOCATIONS
#ifdef TRACKING_MEMORY
VLOG(1) << "[worker-" << comm_spec.worker_id() << "] after query: "
<< MemoryTracker::GetInstance().GetMemoryUsageInfo();
#endif
Expand Down
3 changes: 1 addition & 2 deletions grape/fragment/basic_vc_ds_fragment_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ class BasicVCDSFragmentLoader {
thread_local_cache_size);
#endif
while (got_edges_.Get(cur)) {
size_t cur_size = cur.size();
foreach_rval(cur, [&edges_cache, this](oid_t src, oid_t dst,
edata_t data) {
int bucket_id = bucketer_->get_bucket_id(src, dst);
Expand All @@ -190,7 +189,7 @@ class BasicVCDSFragmentLoader {
#ifdef TRACKING_MEMORY
// deallocate edge shuffle-in buffer
MemoryTracker::GetInstance().deallocate(
(sizeof(oid_t) + sizeof(oid_t) + sizeof(edata_t)) * cur_size);
(sizeof(oid_t) + sizeof(oid_t) + sizeof(edata_t)) * cur.size());
#endif
}
for (int i = 0; i < bucket_num_ * bucket_num_; ++i) {
Expand Down

0 comments on commit f900f43

Please sign in to comment.