From 260ae20a08e5edf3bcd810b457c4a8648c78c39c Mon Sep 17 00:00:00 2001 From: luoxiaojian Date: Wed, 18 Sep 2024 14:06:32 +0800 Subject: [PATCH] trim logs --- examples/analytical_apps/bc/bc_context.h | 5 ---- .../analytical_apps/bfs/bfs_opt_context.h | 5 ---- examples/analytical_apps/sssp/sssp_opt.h | 28 ------------------- grape/communication/sync_comm.h | 24 ++++++++-------- 4 files changed, 12 insertions(+), 50 deletions(-) diff --git a/examples/analytical_apps/bc/bc_context.h b/examples/analytical_apps/bc/bc_context.h index 2978719b..e9b385fc 100644 --- a/examples/analytical_apps/bc/bc_context.h +++ b/examples/analytical_apps/bc/bc_context.h @@ -56,11 +56,6 @@ class BCContext : public VertexDataContext { LOG(INFO) << "[frag-" << frag.fid() << "] BC(0) = " << centrality_value[s]; } -#ifdef PROFILING - VLOG(2) << "preprocess_time: " << preprocess_time << "s."; - VLOG(2) << "exec_time: " << exec_time << "s."; - VLOG(2) << "postprocess_time: " << postprocess_time << "s."; -#endif } oid_t source_id; diff --git a/examples/analytical_apps/bfs/bfs_opt_context.h b/examples/analytical_apps/bfs/bfs_opt_context.h index 08fe6967..c69b7ba5 100644 --- a/examples/analytical_apps/bfs/bfs_opt_context.h +++ b/examples/analytical_apps/bfs/bfs_opt_context.h @@ -49,11 +49,6 @@ class BFSOptContext : public VertexDataContext { for (auto v : inner_vertices) { os << frag.GetId(v) << " " << partial_result[v] << std::endl; } -#ifdef PROFILING - VLOG(2) << "preprocess_time: " << preprocess_time << "s."; - VLOG(2) << "exec_time: " << exec_time << "s."; - VLOG(2) << "postprocess_time: " << postprocess_time << "s."; -#endif } oid_t source_id; diff --git a/examples/analytical_apps/sssp/sssp_opt.h b/examples/analytical_apps/sssp/sssp_opt.h index 0203803a..679c8546 100644 --- a/examples/analytical_apps/sssp/sssp_opt.h +++ b/examples/analytical_apps/sssp/sssp_opt.h @@ -56,10 +56,6 @@ class SSSPOpt : public ParallelAppBase, vertex_t source; bool native_source = frag.GetInnerVertex(ctx.source_id, source); -#ifdef PROFILING - ctx.exec_time -= GetCurrentTime(); -#endif - ctx.next_modified.ParallelClear(GetThreadPool()); // Get the channel. Messages assigned to this channel will be sent by the @@ -83,17 +79,9 @@ class SSSPOpt : public ParallelAppBase, } } -#ifdef PROFILING - ctx.exec_time += GetCurrentTime(); - ctx.postprocess_time -= GetCurrentTime(); -#endif - messages.ForceContinue(); ctx.next_modified.Swap(ctx.curr_modified); -#ifdef PROFILING - ctx.postprocess_time += GetCurrentTime(); -#endif } /** @@ -109,10 +97,6 @@ class SSSPOpt : public ParallelAppBase, auto& channels = messages.Channels(); -#ifdef PROFILING - ctx.preprocess_time -= GetCurrentTime(); -#endif - ctx.next_modified.ParallelClear(GetThreadPool()); // parallel process and reduce the received messages @@ -124,11 +108,6 @@ class SSSPOpt : public ParallelAppBase, } }); -#ifdef PROFILING - ctx.preprocess_time += GetCurrentTime(); - ctx.exec_time -= GetCurrentTime(); -#endif - // incremental evaluation. ForEach(ctx.curr_modified, inner_vertices, [&frag, &ctx](int tid, vertex_t v) { @@ -146,10 +125,6 @@ class SSSPOpt : public ParallelAppBase, // put messages into channels corresponding to the destination fragments. -#ifdef PROFILING - ctx.exec_time += GetCurrentTime(); - ctx.postprocess_time -= GetCurrentTime(); -#endif auto outer_vertices = frag.OuterVertices(); ForEach(ctx.next_modified, outer_vertices, [&channels, &frag, &ctx](int tid, vertex_t v) { @@ -164,9 +139,6 @@ class SSSPOpt : public ParallelAppBase, } ctx.next_modified.Swap(ctx.curr_modified); -#ifdef PROFILING - ctx.postprocess_time += GetCurrentTime(); -#endif } void EstimateMessageSize(const fragment_t& frag, size_t& send_size, diff --git a/grape/communication/sync_comm.h b/grape/communication/sync_comm.h index 2417fb29..3ca50cc9 100644 --- a/grape/communication/sync_comm.h +++ b/grape/communication/sync_comm.h @@ -95,8 +95,8 @@ static inline void send_buffer(const T* ptr, size_t len, int dst_worker_id, const size_t chunk_size_in_bytes = chunk_num * sizeof(T); int iter = len / chunk_num; size_t remaining = (len % chunk_num) * sizeof(T); - LOG(INFO) << "sending large buffer in " << iter + (remaining != 0) - << " iterations"; + VLOG(10) << "sending large buffer in " << iter + (remaining != 0) + << " iterations"; for (int i = 0; i < iter; ++i) { MPI_Send(ptr, chunk_size_in_bytes, MPI_CHAR, dst_worker_id, tag, comm); ptr += chunk_num; @@ -120,8 +120,8 @@ static inline void isend_buffer(const T* ptr, size_t len, int dst_worker_id, const size_t chunk_size_in_bytes = chunk_num * sizeof(T); int iter = len / chunk_num; size_t remaining = (len % chunk_num) * sizeof(T); - LOG(INFO) << "isending large buffer in " << iter + (remaining != 0) - << " iterations"; + VLOG(10) << "isending large buffer in " << iter + (remaining != 0) + << " iterations"; for (int i = 0; i < iter; ++i) { MPI_Request req; MPI_Isend(ptr, chunk_size_in_bytes, MPI_CHAR, dst_worker_id, tag, comm, @@ -147,8 +147,8 @@ static inline void recv_buffer(T* ptr, size_t len, int src_worker_id, int tag, const size_t chunk_size_in_bytes = chunk_num * sizeof(T); int iter = len / chunk_num; size_t remaining = (len % chunk_num) * sizeof(T); - LOG(INFO) << "recving large buffer in " << iter + (remaining != 0) - << " iterations"; + VLOG(10) << "recving large buffer in " << iter + (remaining != 0) + << " iterations"; for (int i = 0; i < iter; ++i) { MPI_Recv(ptr, chunk_size_in_bytes, MPI_CHAR, src_worker_id, tag, comm, MPI_STATUS_IGNORE); @@ -177,8 +177,8 @@ static inline void irecv_buffer(T* ptr, size_t len, int src_worker_id, int tag, const size_t chunk_size_in_bytes = chunk_num * sizeof(T); int iter = len / chunk_num; size_t remaining = (len % chunk_num) * sizeof(T); - LOG(INFO) << "irecving large buffer in " << iter + (remaining != 0) - << " iterations"; + VLOG(10) << "irecving large buffer in " << iter + (remaining != 0) + << " iterations"; for (int i = 0; i < iter; ++i) { MPI_Irecv(ptr, chunk_size_in_bytes, MPI_CHAR, src_worker_id, tag, comm, &reqs[i]); @@ -202,8 +202,8 @@ static inline void irecv_buffer(T* ptr, size_t len, int src_worker_id, int tag, const size_t chunk_size_in_bytes = chunk_num * sizeof(T); int iter = len / chunk_num; size_t remaining = (len % chunk_num) * sizeof(T); - LOG(INFO) << "irecving large buffer in " << iter + (remaining != 0) - << " iterations"; + VLOG(10) << "irecving large buffer in " << iter + (remaining != 0) + << " iterations"; for (int i = 0; i < iter; ++i) { MPI_Request req; MPI_Irecv(ptr, chunk_size_in_bytes, MPI_CHAR, src_worker_id, tag, comm, @@ -236,8 +236,8 @@ static inline void bcast_buffer(T* ptr, size_t len, int root, MPI_Comm comm) { const size_t chunk_size_in_bytes = chunk_num * sizeof(T); int iter = len / chunk_num; size_t remaining = (len % chunk_num) * sizeof(T); - LOG(INFO) << "bcast large buffer in " << iter + (remaining != 0) - << " iterations"; + VLOG(10) << "bcast large buffer in " << iter + (remaining != 0) + << " iterations"; for (int i = 0; i < iter; ++i) { MPI_Bcast(ptr, chunk_size_in_bytes, MPI_CHAR, root, comm); ptr += chunk_num;