int SoapyRemoteDevice::acquireWriteBuffer( SoapySDR::Stream *stream, size_t &handle, void **buffs, const long timeoutUs) { auto data = (ClientStreamData *)stream; auto ep = data->endpoint; if (not ep->waitSend(timeoutUs)) return SOAPY_SDR_TIMEOUT; return ep->acquireSend(handle, buffs); }
/*! Starts sending the data to the specified rank \param dstRank is the destination rank */ void DataCommunicator::startSend(int dstRank) { // Wait for the previous send to finish waitSend(dstRank); // Id of the buffer int id = m_sendIds.at(dstRank); // If the buffer is a double buffer, swap it SendBuffer &sendBuffer = m_sendBuffers[id]; if (sendBuffer.isDouble()) { sendBuffer.swap(); } // Start the send OBinaryStream &buffer = sendBuffer.getBack(); MPI_Isend(buffer.rawData(), buffer.capacity(), MPI_CHAR, dstRank, m_tag, m_communicator, &m_sendRequests[id]); }