MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / main

Function main

flow-rs/examples/graph.rs:46–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44
45#[flow_rs::rt::main]
46async fn main() {
47 let matches = App::new("graph")
48 .version("1.0.0")
49 .author("megengine <megengine@megvii.com>")
50 .arg(
51 Arg::new("DATA_NUM")
52 .long("data")
53 .short('d')
54 .value_name("N")
55 .about("Data number")
56 .multiple_occurrences(false)
57 .required(false),
58 )
59 .arg(
60 Arg::new("CONCURRENCY")
61 .long("concurrency")
62 .short('c')
63 .value_name("N")
64 .about("Concurrency")
65 .multiple_occurrences(false)
66 .required(false),
67 )
68 .arg(
69 Arg::new("NODE_NUM")
70 .long("node")
71 .short('n')
72 .value_name("N")
73 .about("Node number")
74 .multiple_occurrences(false)
75 .required(false),
76 )
77 .get_matches();
78 let node_num = matches
79 .value_of("NODE_NUM")
80 .unwrap_or("1")
81 .parse::<usize>()
82 .unwrap();
83 let concurrency = matches
84 .value_of("CONCURRENCY")
85 .unwrap_or("1")
86 .parse::<usize>()
87 .unwrap();
88 let data_num = matches
89 .value_of("DATA_NUM")
90 .unwrap_or("1")
91 .parse::<usize>()
92 .unwrap();
93
94 let mut connects = vec![];
95 let mut nodes = vec![];
96 for i in 1..=node_num {
97 nodes.push(format!(
98 r#"
99[[graphs.nodes]]
100name = "trans{}"
101ty = "Transport"
102cloned = {}
103 "#,

Callers

nothing calls this directly

Calls 9

joinFunction · 0.85
pushMethod · 0.80
template_fileMethod · 0.80
buildMethod · 0.45
inputMethod · 0.45
outputMethod · 0.45
startMethod · 0.45
sendMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected