Skip to content

Commit 4684fc5

Browse files
committed
format
1 parent 6cd06f5 commit 4684fc5

File tree

5 files changed

+13
-21
lines changed

5 files changed

+13
-21
lines changed

analytical_engine/apps/pregel/louvain/auxiliary.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ namespace gs {
2828

2929
// aggregators define
3030
constexpr char change_aggregator[] = "change_aggregator";
31-
constexpr char edge_weight_aggregator[] =
32-
"total_edge_weight_aggregator";
31+
constexpr char edge_weight_aggregator[] = "total_edge_weight_aggregator";
3332
constexpr char actual_quality_aggregator[] = "actual_quality_aggregator";
3433

3534
// major phase of louvain
@@ -44,7 +43,6 @@ constexpr int phase_one_minor_step_0 = 0;
4443
constexpr int phase_one_minor_step_1 = 1;
4544
constexpr int phase_one_minor_step_2 = 2;
4645

47-
4846
template <typename VID_T>
4947
struct LouvainNodeState {
5048
using vid_t = VID_T;

analytical_engine/apps/pregel/louvain/louvain.h

+4-6
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,12 @@ class PregelLouvain
182182
}
183183

184184
// Get the total edge weight of the graph.
185-
edata_t getTotalEdgeWeight(compute_context_t& context,
186-
pregel_vertex_t& v) {
185+
edata_t getTotalEdgeWeight(compute_context_t& context, pregel_vertex_t& v) {
187186
auto& state = v.state();
188187
if (state.reset_total_edge_weight) {
189188
// we just aggregate the total edge weight in previous step.
190-
state.total_edge_weight =
191-
context.template get_aggregated_value<edata_t>(
192-
edge_weight_aggregator);
189+
state.total_edge_weight = context.template get_aggregated_value<edata_t>(
190+
edge_weight_aggregator);
193191
state.reset_total_edge_weight = false;
194192
}
195193
return state.total_edge_weight;
@@ -397,7 +395,7 @@ class PregelLouvain
397395
}
398396

399397
void compressCommunities(pregel_vertex_t& vertex,
400-
grape::IteratorPair<md_t*>& messages) {
398+
grape::IteratorPair<md_t*>& messages) {
401399
auto community_id = vertex.get_gid();
402400
edata_t weight = 0;
403401
std::map<vid_t, edata_t> edge_map;

analytical_engine/apps/pregel/louvain/louvain_app_base.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ class LouvainAppBase
115115
{
116116
// Sync Aggregator
117117
ctx.compute_context().aggregate(change_aggregator,
118-
ctx.GetLocalChangeSum());
118+
ctx.GetLocalChangeSum());
119119
ctx.compute_context().aggregate(edge_weight_aggregator,
120-
ctx.GetLocalEdgeWeightSum());
120+
ctx.GetLocalEdgeWeightSum());
121121
ctx.compute_context().aggregate(actual_quality_aggregator,
122-
ctx.GetLocalQualitySum());
122+
ctx.GetLocalQualitySum());
123123
for (auto& pair : ctx.compute_context().aggregators()) {
124124
grape::InArchive iarc;
125125
std::vector<grape::InArchive> oarcs;
@@ -202,8 +202,8 @@ class LouvainAppBase
202202
ctx.compute_context().template get_aggregated_value<int64_t>(
203203
change_aggregator);
204204
ctx.change_history().push_back(totalChange);
205-
bool to_halt = decide_to_halt(
206-
ctx.change_history(), ctx.tolerance(), ctx.min_progress());
205+
bool to_halt = decide_to_halt(ctx.change_history(), ctx.tolerance(),
206+
ctx.min_progress());
207207
ctx.set_halt(to_halt);
208208
if (ctx.halt()) {
209209
LOG(INFO) << "super step " << current_super_step << " decided to halt.";
@@ -296,7 +296,7 @@ class LouvainAppBase
296296
private:
297297
// sync community id from community hub to community members.
298298
void syncCommunity(const fragment_t& frag, context_t& ctx,
299-
message_manager_t& messages) {
299+
message_manager_t& messages) {
300300
auto& vid_parser = ctx.compute_context().vid_parser();
301301
auto& comm_result = ctx.compute_context().vertex_data();
302302
auto inner_vertices = frag.InnerVertices();

analytical_engine/core/app/pregel/pregel_compute_context.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,7 @@ class PregelComputeContext {
221221
}
222222
}
223223

224-
const vineyard::IdParser<vid_t>& vid_parser() const {
225-
return vid_parser_;
226-
}
224+
const vineyard::IdParser<vid_t>& vid_parser() const { return vid_parser_; }
227225

228226
std::unordered_map<std::string, std::shared_ptr<IAggregator>>& aggregators() {
229227
return aggregators_;

analytical_engine/core/app/pregel/pregel_vertex.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ class PregelVertex {
5555
compute_context_->set_vertex_value(*this, std::move(value));
5656
}
5757

58-
const VD_T& value() {
59-
return compute_context_->get_vertex_value(*this);
60-
}
58+
const VD_T& value() { return compute_context_->get_vertex_value(*this); }
6159

6260
virtual vertex_t vertex() const { return vertex_; }
6361

0 commit comments

Comments
 (0)