| 109 | } |
| 110 | |
| 111 | std::pair<vineyard::ObjectID, int> splitAndGet(grape::CommSpec& comm_spec, |
| 112 | const std::string& ids) { |
| 113 | std::vector<std::string> split; |
| 114 | boost::split(split, ids, boost::is_any_of(",")); |
| 115 | CHECK_EQ(split.size(), comm_spec.worker_num()); |
| 116 | auto my_host_name = getHostName(); |
| 117 | std::vector<std::string> pid_vineyard_id; |
| 118 | { |
| 119 | for (auto str : split) { |
| 120 | if (str.find(my_host_name) != std::string::npos) { |
| 121 | auto trimmed = |
| 122 | str.substr(str.find(my_host_name) + my_host_name.size() + 1); |
| 123 | pid_vineyard_id.push_back(trimmed); |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | CHECK_EQ(pid_vineyard_id.size(), comm_spec.local_num()); |
| 128 | vineyard::ObjectID res_id; |
| 129 | int graphx_pid; |
| 130 | |
| 131 | { |
| 132 | std::vector<std::string> graphx_pid_vm_id; |
| 133 | boost::split(graphx_pid_vm_id, pid_vineyard_id[comm_spec.local_id()], |
| 134 | boost::is_any_of(":")); |
| 135 | CHECK_EQ(graphx_pid_vm_id.size(), 2); |
| 136 | res_id = std::stoull(graphx_pid_vm_id[1]); |
| 137 | graphx_pid = std::stoi(graphx_pid_vm_id[0]); |
| 138 | } |
| 139 | |
| 140 | LOG(INFO) << "worker [" << comm_spec.worker_id() << "], local id [" |
| 141 | << comm_spec.local_id() << "] got pid " << graphx_pid << ", id " |
| 142 | << res_id; |
| 143 | return std::make_pair(res_id, graphx_pid); |
| 144 | } |
| 145 | |
| 146 | template <typename OID_T, typename VID_T, typename VD_T, typename ED_T> |
| 147 | void LoadFragment(vineyard::Client& client, grape::CommSpec& comm_spec) { |