}
/** Sets the maximal communication rate (in byte/sec). Must be done before start */
- Activity* setRate(double rate);
+ Activity* set_rate(double rate);
/** Specify the data to send */
- Activity* setSrcData(void* buff);
+ Activity* set_src_data(void* buff);
/** Specify the size of the data to send */
- Activity* setSrcDataSize(size_t size);
+ Activity* set_src_data_size(size_t size);
/** Specify the data to send and its size */
- Activity* setSrcData(void* buff, size_t size);
+ Activity* set_src_data(void* buff, size_t size);
/** Specify where to receive the data */
- Activity* setDstData(void** buff);
+ Activity* set_dst_data(void** buff);
/** Specify the buffer in which the data should be received */
- Activity* setDstData(void** buff, size_t size);
+ Activity* set_dst_data(void** buff, size_t size);
/** Retrieve the size of the received data */
- size_t getDstDataSize();
+ size_t get_dst_data_size();
bool test();
Activity* cancel();
/** Retrieve the mailbox on which this comm acts */
- MailboxPtr getMailbox();
+ MailboxPtr get_mailbox();
+
+ XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_rate()") Activity* setRate(double rate) { return set_rate(rate); }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_src_data()") Activity* setSrcData(void* buff)
+ {
+ return set_src_data(buff);
+ }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_src_data()") Activity* setSrcData(void* buff, size_t size)
+ {
+ return set_src_data(buff, size);
+ }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_src_data_size()") Activity* setSrcDataSize(size_t size)
+ {
+ return set_src_data_size(size);
+ }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_dst_data()") Activity* setDstData(void** buff)
+ {
+ return set_dst_data(buff);
+ }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_dst_data()") Activity* setDstData(void** buff, size_t size)
+ {
+ return set_dst_data(buff, size);
+ }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Comm::get_dst_data_size()") size_t getDstDataSize()
+ {
+ return get_dst_data_size();
+ }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Comm::get_mailbox()") MailboxPtr getMailbox() { return get_mailbox(); }
private:
double rate_ = -1;
s4u::Activity* comm = nullptr;
try {
if (mig_speed > 0)
- comm = mbox->put_init(msg, size)->setRate(mig_speed)->wait(timeout);
+ comm = mbox->put_init(msg, size)->set_rate(mig_speed)->wait(timeout);
else
comm = mbox->put_async(msg, size)->wait();
} catch (xbt_ex& e) {
}
}
-Activity* Comm::setRate(double rate)
+Activity* Comm::set_rate(double rate)
{
xbt_assert(state_ == State::inited);
rate_ = rate;
return this;
}
-Activity* Comm::setSrcData(void* buff)
+Activity* Comm::set_src_data(void* buff)
{
xbt_assert(state_ == State::inited);
xbt_assert(dstBuff_ == nullptr, "Cannot set the src and dst buffers at the same time");
srcBuff_ = buff;
return this;
}
-Activity* Comm::setSrcDataSize(size_t size)
+Activity* Comm::set_src_data_size(size_t size)
{
xbt_assert(state_ == State::inited);
srcBuffSize_ = size;
return this;
}
-Activity* Comm::setSrcData(void* buff, size_t size)
+Activity* Comm::set_src_data(void* buff, size_t size)
{
xbt_assert(state_ == State::inited);
srcBuffSize_ = size;
return this;
}
-Activity* Comm::setDstData(void** buff)
+Activity* Comm::set_dst_data(void** buff)
{
xbt_assert(state_ == State::inited);
xbt_assert(srcBuff_ == nullptr, "Cannot set the src and dst buffers at the same time");
dstBuff_ = buff;
return this;
}
-size_t Comm::getDstDataSize(){
+size_t Comm::get_dst_data_size()
+{
xbt_assert(state_ == State::finished);
return dstBuffSize_;
}
-Activity* Comm::setDstData(void** buff, size_t size)
+Activity* Comm::set_dst_data(void** buff, size_t size)
{
xbt_assert(state_ == State::inited);
return false;
}
-MailboxPtr Comm::getMailbox()
+MailboxPtr Comm::get_mailbox()
{
return mailbox_;
}
CommPtr c = put_init();
c->set_remaining(simulatedSize);
- c->setSrcData(payload);
+ c->set_src_data(payload);
c->wait();
}
/** Blocking send with timeout */
CommPtr c = put_init();
c->set_remaining(simulatedSize);
- c->setSrcData(payload);
+ c->set_src_data(payload);
// c->start() is optional.
c->wait(timeout);
}
s4u::CommPtr Mailbox::get_async(void** data)
{
s4u::CommPtr res = get_init();
- res->setDstData(data, sizeof(*data));
+ res->set_dst_data(data, sizeof(*data));
res->start();
return res;
}
{
void* res = nullptr;
CommPtr c = get_init();
- c->setDstData(&res, sizeof(res));
+ c->set_dst_data(&res, sizeof(res));
c->wait();
return res;
}
{
void* res = nullptr;
CommPtr c = get_init();
- c->setDstData(&res, sizeof(res));
+ c->set_dst_data(&res, sizeof(res));
c->wait(timeout);
return res;
}