MCPcopy Create free account
hub / github.com/Niko1221/Strata / wait

Method wait

engine/src/tp/mpi_runtime.cpp:45–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45void MpiRuntime::wait(MPI_Request& request, const char* operation, bool idle, bool short_poll) {
46 const auto start = std::chrono::steady_clock::now();
47 const auto deadline = start + timeout_;
48 for (;;) {
49 int completed = 0;
50 check(MPI_Test(&request, &completed, MPI_STATUS_IGNORE), operation);
51 if (completed) return;
52 const auto now = std::chrono::steady_clock::now();
53 if (!idle && now >= deadline) fail(std::string(operation) + ": timeout");
54 if (short_poll && now - start < std::chrono::milliseconds(2)) std::this_thread::yield();
55 else std::this_thread::sleep_for(idle ? std::chrono::microseconds(1000) : std::chrono::microseconds(50));
56 }
57}
58
59void MpiRuntime::broadcast(std::span<std::byte> bytes) {
60 if (bytes.empty() || bytes.size() > max_prompt_bytes) fail("broadcast payload must contain 1 byte..8 MiB");

Callers 15

closeMethod · 0.45
run_onceMethod · 0.45
wait_nextMethod · 0.45
releaseMethod · 0.45
initMethod · 0.45
forward_batchMethod · 0.45
probe_p2pFunction · 0.45
h2d_syncFunction · 0.45
~InkSyclModelMethod · 0.45
loadMethod · 0.45
wait_next_epochFunction · 0.45
run_moe_hybridFunction · 0.45

Calls 4

nowFunction · 0.50
checkFunction · 0.50
failFunction · 0.50
stringFunction · 0.50

Tested by 8

closeMethod · 0.36
run_onceMethod · 0.36
closeMethod · 0.36
mainFunction · 0.36
mainFunction · 0.36
mainFunction · 0.36
mainFunction · 0.36
mainFunction · 0.36