MCPcopy Create free account
hub / github.com/alibaba/GraphScope / main

Function main

analytical_engine/test/run_string_oid.cc:72–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72int main(int argc, char** argv) {
73 if (argc < 6) {
74 printf(
75 "usage: ./run_string_oid <ipc_socket> <e_label_num> <efiles...> "
76 "<v_label_num> <vfiles...> [directed]\n");
77 return 1;
78 }
79 int index = 1;
80 std::string ipc_socket = std::string(argv[index++]);
81
82 int edge_label_num = atoi(argv[index++]);
83 std::vector<std::string> efiles;
84 for (int i = 0; i < edge_label_num; ++i) {
85 efiles.push_back(argv[index++]);
86 }
87
88 int vertex_label_num = atoi(argv[index++]);
89 std::vector<std::string> vfiles;
90 for (int i = 0; i < vertex_label_num; ++i) {
91 vfiles.push_back(argv[index++]);
92 }
93
94 int directed = 1;
95 if (argc > index) {
96 directed = atoi(argv[index]);
97 }
98
99 grape::InitMPIComm();
100 {
101 grape::CommSpec comm_spec;
102 comm_spec.Init(MPI_COMM_WORLD);
103
104 vineyard::Client client;
105 VINEYARD_CHECK_OK(client.Connect(ipc_socket));
106
107 LOG(INFO) << "Connected to IPCServer: " << ipc_socket;
108
109 vineyard::ObjectID fragment_id;
110 {
111 auto loader = std::make_unique<
112 gs::ArrowFragmentLoader<vineyard::property_graph_types::OID_TYPE,
113 vineyard::property_graph_types::VID_TYPE>>(
114 client, comm_spec, efiles, vfiles, directed != 0);
115 fragment_id =
116 bl::try_handle_all([&loader]() { return loader->LoadFragment(); },
117 [](const vineyard::GSError& e) {
118 LOG(FATAL) << e.error_msg;
119 return 0;
120 },
121 [](const bl::error_info& unmatched) {
122 LOG(FATAL) << "Unmatched error " << unmatched;
123 return 0;
124 });
125 }
126
127 LOG(INFO) << "[worker-" << comm_spec.worker_id()
128 << "] loaded graph to vineyard ...";
129

Callers

nothing calls this directly

Calls 5

worker_idMethod · 0.80
RunFunction · 0.70
push_backMethod · 0.65
InitMethod · 0.65
LoadFragmentMethod · 0.45

Tested by

no test coverage detected