Skip to content

Commit c5e5b3a

Browse files
committed
fix simple vertex/adj list init bugs
1 parent cd3ce9f commit c5e5b3a

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

modules/graph/grin/c/test.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,11 +964,20 @@ void test_partition(int argc, char** argv) {
964964
}
965965

966966

967-
void test_topology_structure(int argc, char** argv) {
967+
void test_topology_vertex_list(int argc, char** argv) {
968968
GRIN_GRAPH g = get_graph(argc, argv);
969969

970970
printf("vnum: %zu, enum: %zu\n", grin_get_vertex_num(g), grin_get_edge_num(g));
971971

972+
#ifdef GRIN_ENABLE_GRAPH_PARTITION
973+
GRIN_VERTEX_LIST vl = grin_get_vertex_list(g);
974+
GRIN_VERTEX_TYPE vtype = grin_get_vertex_type_by_name(g, "person");
975+
GRIN_VERTEX_LIST svl = grin_select_type_for_vertex_list(g, vtype, vl);
976+
GRIN_VERTEX_LIST mvl = grin_select_master_for_vertex_list(g, svl);
977+
size_t mvl_sz = grin_get_vertex_list_size(g, mvl);
978+
printf("master vertex list size: %zu\n", mvl_sz);
979+
#endif
980+
972981
grin_destroy_graph(g);
973982
}
974983

@@ -1061,7 +1070,7 @@ void test_topology_adjacent_list(int argc, char** argv, GRIN_DIRECTION dir) {
10611070
}
10621071

10631072
void test_topology(int argc, char** argv) {
1064-
test_topology_structure(argc, argv);
1073+
test_topology_vertex_list(argc, argv);
10651074
test_topology_adjacent_list(argc, argv, OUT);
10661075
test_topology_adjacent_list(argc, argv, IN);
10671076
}

modules/graph/grin/src/topology/adjacentlist.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ GRIN_ADJACENT_LIST grin_get_adjacent_list(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_V
2828
al->etype = _g->edge_label_num();
2929
if (al->etype == 1) {
3030
al->is_simple = true;
31+
al->etype = 0;
3132
__grin_init_simple_adjacent_list(_g, al);
3233
} else {
3334
al->is_simple = false;

modules/graph/grin/src/topology/vertexlist.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ GRIN_VERTEX_LIST grin_get_vertex_list(GRIN_GRAPH g) {
2626
vl->vtype = _g->vertex_label_num();
2727
if (vl->vtype == 1) {
2828
vl->is_simple = true;
29+
vl->vtype = 0;
2930
__grin_init_simple_vertex_list(_g, vl);
3031
} else {
3132
vl->is_simple = false;

0 commit comments

Comments
 (0)