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
[SMPI] Remove index() from smpi_pmpi_win.cpp
[simgrid.git]
/
src
/
smpi
/
mpi
/
smpi_request.cpp
diff --git
a/src/smpi/mpi/smpi_request.cpp
b/src/smpi/mpi/smpi_request.cpp
index
ad6d8e0
..
0f31243
100644
(file)
--- a/
src/smpi/mpi/smpi_request.cpp
+++ b/
src/smpi/mpi/smpi_request.cpp
@@
-179,19
+179,19
@@
MPI_Request Request::send_init(void *buf, int count, MPI_Datatype datatype, int
{
return new Request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
- comm->group()->
index(dst)
, tag, comm, PERSISTENT | SEND | PREPARED);
+ comm->group()->
actor(dst)->getPid()-1
, tag, comm, PERSISTENT | SEND | PREPARED);
}
MPI_Request Request::ssend_init(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
{
return new Request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
- comm->group()->
index(dst)
, tag, comm, PERSISTENT | SSEND | SEND | PREPARED);
+ comm->group()->
actor(dst)->getPid()-1
, tag, comm, PERSISTENT | SSEND | SEND | PREPARED);
}
MPI_Request Request::isend_init(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
{
return new Request(buf==MPI_BOTTOM ? nullptr : buf , count, datatype, smpi_process()->index(),
- comm->group()->
index(dst)
, tag,comm, PERSISTENT | ISEND | SEND | PREPARED);
+ comm->group()->
actor(dst)->getPid()-1
, tag,comm, PERSISTENT | ISEND | SEND | PREPARED);
}
@@
-213,7
+213,7
@@
MPI_Request Request::rma_send_init(void *buf, int count, MPI_Datatype datatype,
MPI_Request Request::recv_init(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm)
{
return new Request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype,
- src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : comm->group()->
index(src)
,
+ src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : comm->group()->
actor(src)->getPid()-1
,
smpi_process()->index(), tag, comm, PERSISTENT | RECV | PREPARED);
}
@@
-235,7
+235,7
@@
MPI_Request Request::rma_recv_init(void *buf, int count, MPI_Datatype datatype,
MPI_Request Request::irecv_init(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm)
{
return new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype,
- src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : comm->group()->
index(src)
, smpi_process()->index(), tag,
+ src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : comm->group()->
actor(src)->getPid()-1
, smpi_process()->index(), tag,
comm, PERSISTENT | RECV | PREPARED);
}
@@
-243,7
+243,7
@@
MPI_Request Request::isend(void *buf, int count, MPI_Datatype datatype, int dst,
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
- comm->group()->
index(dst)
, tag, comm, NON_PERSISTENT | ISEND | SEND);
+ comm->group()->
actor(dst)->getPid()-1
, tag, comm, NON_PERSISTENT | ISEND | SEND);
request->start();
return request;
}
@@
-252,7
+252,7
@@
MPI_Request Request::issend(void *buf, int count, MPI_Datatype datatype, int dst
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
- comm->group()->
index(dst)
, tag, comm, NON_PERSISTENT | ISEND | SSEND | SEND);
+ comm->group()->
actor(dst)->getPid()-1
, tag, comm, NON_PERSISTENT | ISEND | SSEND | SEND);
request->start();
return request;
}
@@
-262,7
+262,7
@@
MPI_Request Request::irecv(void *buf, int count, MPI_Datatype datatype, int src,
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype,
- src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : comm->group()->
index(src)
, smpi_process()->index(),
+ src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : comm->group()->
actor(src)->getPid()-1
, smpi_process()->index(),
tag, comm, NON_PERSISTENT | RECV);
request->start();
return request;
@@
-280,7
+280,7
@@
void Request::send(void *buf, int count, MPI_Datatype datatype, int dst, int tag
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
- comm->group()->
index(dst)
, tag, comm, NON_PERSISTENT | SEND);
+ comm->group()->
actor(dst)->getPid()-1
, tag, comm, NON_PERSISTENT | SEND);
request->start();
wait(&request, MPI_STATUS_IGNORE);
@@
-291,7
+291,7
@@
void Request::ssend(void *buf, int count, MPI_Datatype datatype, int dst, int ta
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
- comm->group()->
index(dst)
, tag, comm, NON_PERSISTENT | SSEND | SEND);
+ comm->group()->
actor(dst)->getPid()-1
, tag, comm, NON_PERSISTENT | SSEND | SEND);
request->start();
wait(&request,MPI_STATUS_IGNORE);
@@
-304,8
+304,8
@@
void Request::sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,int d
{
MPI_Request requests[2];
MPI_Status stats[2];
- int myid=smpi_process()->index();
- if ((comm->group()->
index(dst) == myid) && (comm->group()->index(src)
== myid)){
+
unsigned
int myid=smpi_process()->index();
+ if ((comm->group()->
actor(dst)->getPid()-1 == myid) && (comm->group()->actor(src)->getPid()-1
== myid)){
Datatype::copy(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype);
return;
}
@@
-333,7
+333,7
@@
void Request::start()
if ((flags_ & RECV) != 0) {
this->print_request("New recv");
- simgrid::smpi::Process* process = smpi_process_remote(
dst_
);
+ simgrid::smpi::Process* process = smpi_process_remote(
simgrid::s4u::Actor::byPid(dst_+1)
);
int async_small_thresh = xbt_cfg_get_int("smpi/async-small-thresh");
@@
-378,14
+378,14
@@
void Request::start()
// we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later
real_size_=size_;
action_ = simcall_comm_irecv(
- process->process(), mailbox, buf_, &real_size_, &match_recv,
+ process->process()
->getImpl()
, mailbox, buf_, &real_size_, &match_recv,
process->replaying() ? &smpi_comm_null_copy_buffer_callback : smpi_comm_copy_data_callback, this, -1.0);
XBT_DEBUG("recv simcall posted");
if (async_small_thresh != 0 || (flags_ & RMA) != 0 )
xbt_mutex_release(mut);
} else { /* the RECV flag was not set, so this is a send */
- simgrid::smpi::Process* process = smpi_process_remote(
dst_
);
+ simgrid::smpi::Process* process = smpi_process_remote(
simgrid::s4u::Actor::byPid(dst_+1)
);
int rank = src_;
if (TRACE_smpi_view_internals()) {
TRACE_smpi_send(rank, rank, dst_, tag_, size_);
@@
-628,11
+628,11
@@
void Request::iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
double speed = simgrid::s4u::Actor::self()->getHost()->getSpeed();
double maxrate = xbt_cfg_get_double("smpi/iprobe-cpu-usage");
MPI_Request request = new Request(nullptr, 0, MPI_CHAR, source == MPI_ANY_SOURCE ? MPI_ANY_SOURCE :
- comm->group()->
index(source)
, comm->rank(), tag, comm, PERSISTENT | RECV);
+ comm->group()->
actor(source)->getPid()-1
, comm->rank(), tag, comm, PERSISTENT | RECV);
if (smpi_iprobe_sleep > 0) {
smx_activity_t iprobe_sleep = simcall_execution_start(
"iprobe", /* flops to executek*/ nsleeps * smpi_iprobe_sleep * speed * maxrate, /* priority */ 1.0,
- /* performance bound */ maxrate * speed, smpi_process()->process()->host);
+ /* performance bound */ maxrate * speed, smpi_process()->process()->
getImpl()->
host);
simcall_execution_wait(iprobe_sleep);
}
// behave like a receive, but don't do it