MCPcopy Create free account
hub / github.com/Tencent/plato / main

Function main

example/encode_simple.cc:46–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46int main(int argc, char** argv) {
47 plato::stop_watch_t watch;
48 auto& cluster_info = plato::cluster_info_t::get_instance();
49 init(argc, argv);
50 cluster_info.initialize(&argc, &argv);
51
52 plato::graph_info_t graph_info(FLAGS_is_directed);
53 plato::vid_encoder_opts_t opts;
54 opts.src_need_encode_ = FLAGS_src_need_encode;
55 opts.dst_need_encode_ = FLAGS_dst_need_encode;
56 using EDATA = plato::empty_t;
57 using VID_T = uint64_t;
58
59 auto decoder = plato::dummy_decoder<plato::empty_t>;
60 //auto decoder = plato::uint8_t_decoder;
61 plato::vid_encoder_t<EDATA, VID_T, plato::edge_cache_t> data_encoder(opts);
62 //auto graph = plato::create_bcsr_seqs_from_path<EDATA, VID_T>(&graph_info,
63 // FLAGS_input, plato::edge_format_t::CSV, decoder,
64 // FLAGS_alpha, FLAGS_part_by_in, &data_encoder);
65
66 auto tcsr = plato::create_tcsr_hashs_from_path<EDATA, plato::vid_t, std::hash<plato::vid_t>,
67 VID_T, plato::edge_cache_t>(&graph_info, FLAGS_input, plato::edge_format_t::CSV,
68 decoder, &data_encoder);
69
70 auto data = data_encoder.data();
71
72 LOG(INFO) << "data size: " << data.size();
73
74 size_t stride = data.size() / 100;
75 if (stride == 0) stride = 1;
76 for (size_t i = 0; i < data.size(); i += stride) {
77 LOG(INFO) << "pid: " << cluster_info.partition_id_ << " i: " << i << " val: " << data[i];
78 }
79 return 0;
80}
81

Callers

nothing calls this directly

Calls 3

initFunction · 0.70
initializeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected