Skip to content

Commit 20feb65

Browse files
authored
fix wcc_opt bugs in hash partition (alibaba#88)
1 parent d92f6dd commit 20feb65

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

examples/analytical_apps/cuda/wcc/wcc_opt.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ class WCCOptContext : public grape::VoidContext<FRAG_T> {
5858
if (frag.fid() == 0) {
5959
messages.InitBuffer(
6060
0, (frag.GetTotalVerticesNum() - frag.InnerVertices().size()) *
61-
sizeof(offset_t) * 2 * 1.5);
61+
sizeof(offset_t) * 2 * 2);
6262
} else {
63-
messages.InitBuffer(
64-
frag.InnerVertices().size() * sizeof(offset_t) * 2 * 1.5, 0);
63+
messages.InitBuffer(frag.Vertices().size() * sizeof(offset_t) * 2 * 1.5,
64+
0);
6565
}
6666
}
6767

@@ -118,6 +118,7 @@ class WCCOpt : public GPUAppBase<FRAG_T, WCCOptContext<FRAG_T>>,
118118
auto d_coo = ctx.coo_frag->DeviceObject();
119119
auto vertices = frag.Vertices();
120120
auto iv = frag.InnerVertices();
121+
auto av = frag.Vertices();
121122
auto dev_mm = messages.DeviceObject();
122123
auto* d_parents = thrust::raw_pointer_cast(ctx.parents.data());
123124
auto& stream = messages.stream();
@@ -200,7 +201,7 @@ class WCCOpt : public GPUAppBase<FRAG_T, WCCOptContext<FRAG_T>>,
200201
}
201202

202203
if (frag.fid() > 0) {
203-
WorkSourceRange<vertex_t> ws_in(iv.begin(), iv.size());
204+
WorkSourceRange<vertex_t> ws_in(av.begin(), av.size());
204205

205206
ForEach(stream, ws_in, [=] __device__(vertex_t v) mutable {
206207
auto offset = vertex2offset(v);

misc/cuda_app_tests.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,16 @@ for np in ${proc_list}; do
120120
RunApp ${np} wcc -lb=${lb} ${SER} --serialization_prefix=./serial/${GRAPH}_wcc
121121
WCCVerify ${GRAPE_HOME}/dataset/${GRAPH}-WCC
122122

123-
RunApp ${np} wcc_opt -lb=${lb} ${SER} --serialization_prefix=./serial/${GRAPH}_wcc_opt
123+
RunApp ${np} wcc_opt -segmented_partition=true -rebalance=true -lb=${lb} ${SER} --serialization_prefix=./serial/${GRAPH}_wcc_opt_tt
124+
WCCVerify ${GRAPE_HOME}/dataset/${GRAPH}-WCC
125+
126+
RunApp ${np} wcc_opt -segmented_partition=true -rebalance=false -lb=${lb} ${SER} --serialization_prefix=./serial/${GRAPH}_wcc_opt_tf
127+
WCCVerify ${GRAPE_HOME}/dataset/${GRAPH}-WCC
128+
129+
RunApp ${np} wcc_opt -segmented_partition=false -rebalance=true -lb=${lb} ${SER} --serialization_prefix=./serial/${GRAPH}_wcc_opt_ft
130+
WCCVerify ${GRAPE_HOME}/dataset/${GRAPH}-WCC
131+
132+
RunApp ${np} wcc_opt -segmented_partition=false -rebalance=false -lb=${lb} ${SER} --serialization_prefix=./serial/${GRAPH}_wcc_opt_ff
124133
WCCVerify ${GRAPE_HOME}/dataset/${GRAPH}-WCC
125134
done
126135
done

0 commit comments

Comments
 (0)