A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rework the OO design of S4U comms
[simgrid.git]
/
src
/
s4u
/
s4u_actor.cpp
diff --git
a/src/s4u/s4u_actor.cpp
b/src/s4u/s4u_actor.cpp
index
71cff82
..
8d05ad2
100644
(file)
--- a/
src/s4u/s4u_actor.cpp
+++ b/
src/s4u/s4u_actor.cpp
@@
-220,48
+220,32
@@
e_smx_state_t execute(double flops) {
}
void* recv(MailboxPtr chan) {
}
void* recv(MailboxPtr chan) {
- void *res = nullptr;
- CommPtr c = Comm::recv_init(chan);
- c->setDstData(&res, sizeof(res));
- c->wait();
- return res;
+ return chan->recv();
}
void* recv(MailboxPtr chan, double timeout)
{
}
void* recv(MailboxPtr chan, double timeout)
{
- void* res = nullptr;
- CommPtr c = Comm::recv_init(chan);
- c->setDstData(&res, sizeof(res));
- c->wait(timeout);
- return res;
+ return chan->recv(timeout);
}
void send(MailboxPtr chan, void* payload, double simulatedSize)
{
}
void send(MailboxPtr chan, void* payload, double simulatedSize)
{
- CommPtr c = Comm::send_init(chan);
- c->setRemains(simulatedSize);
- c->setSrcData(payload);
- // c->start() is optional.
- c->wait();
+ chan->send(payload, simulatedSize);
}
void send(MailboxPtr chan, void* payload, double simulatedSize, double timeout)
{
}
void send(MailboxPtr chan, void* payload, double simulatedSize, double timeout)
{
- CommPtr c = Comm::send_init(chan);
- c->setRemains(simulatedSize);
- c->setSrcData(payload);
- // c->start() is optional.
- c->wait(timeout);
+ chan->send(payload, simulatedSize, timeout);
}
CommPtr isend(MailboxPtr chan, void* payload, double simulatedSize)
{
}
CommPtr isend(MailboxPtr chan, void* payload, double simulatedSize)
{
- return
Comm::send_async(chan,
payload, simulatedSize);
+ return
chan->send_async(
payload, simulatedSize);
}
CommPtr irecv(MailboxPtr chan, void** data)
{
}
CommPtr irecv(MailboxPtr chan, void** data)
{
- return
Comm::recv_async(chan,
data);
+ return
chan->recv_async(
data);
}
aid_t pid()
}
aid_t pid()