项目文件夹

文件
Da Zheng b9e4a5b742 [Test] add regression tests for graph partitioning. (#1561)
* add tests.

* 111

* fix

* Update asv.conf.json

* fix.

* benchmark partition with livejournal.

* fix benchmark

* fix.

* fix.

* remove ogb

* Revert "Update asv.conf.json"

This reverts commit dd327a5564f4ef01795e444e79b17265b9c8b391.

* change branch

* depend pandas

* Revert "change branch"

This reverts commit 1d4f93756492a93f2e3cde07229a59a31a8c380b.

* Update README.md

Co-authored-by: VoVAllen <jz1749@nyu.edu>
Co-authored-by: Jinjing Zhou <VoVAllen@users.noreply.github.com>
2020-05-28 22:28:57 +08:00

18 行
733 B
Python

import dgl
from dgl import distributed as dgl_distributed
import argparse, time
from utils import get_graph
parser = argparse.ArgumentParser(description='partition')
parser.add_argument("--dataset", type=str, default='livejournal',
help="specify the graph for partitioning")
parser.add_argument("--num_parts", type=int, default=16,
help="the number of partitions")
args = parser.parse_args()
g = get_graph(args.dataset)
print('{}: |V|={}, |E|={}'.format(args.dataset, g.number_of_nodes(), g.number_of_edges()))
start = time.time()
dgl_distributed.partition_graph(g, args.dataset, args.num_parts, '/tmp', num_hops=1, part_method="metis")
print('Time: {} seconds'.format(time.time() - start))