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] Renamed smpi_*_data_exe as a first step for overhaul of the privatization
[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
7007143
..
d490799
100644
(file)
--- a/
src/smpi/mpi/smpi_request.cpp
+++ b/
src/smpi/mpi/smpi_request.cpp
@@
-221,11
+221,11
@@
MPI_Request Request::rma_recv_init(void *buf, int count, MPI_Datatype datatype,
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
if(op==MPI_OP_NULL){
- request = new Request(buf
==MPI_BOTTOM ? nullptr : buf, count, datatype, src, dst, tag
,
-
comm,
RMA | NON_PERSISTENT | RECV | PREPARED);
+ request = new Request(buf
== MPI_BOTTOM ? nullptr : buf, count, datatype, src, dst, tag, comm
,
+ RMA | NON_PERSISTENT | RECV | PREPARED);
}else{
- request = new Request(buf
==MPI_BOTTOM ? nullptr : buf, count, datatype, src, dst, tag
,
-
comm,
RMA | NON_PERSISTENT | RECV | PREPARED | ACCUMULATE);
+ request = new Request(buf
== MPI_BOTTOM ? nullptr : buf, count, datatype, src, dst, tag, comm
,
+ RMA | NON_PERSISTENT | RECV | PREPARED | ACCUMULATE);
request->op_ = op;
}
return request;
@@
-233,16
+233,16
@@
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,
-
comm, PERSISTENT | RECV | PREPARED);
+ 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,
+ comm, PERSISTENT | RECV | PREPARED);
}
MPI_Request Request::isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
{
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);
+ request
= new Request(buf ==
MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
+ comm->group()->index(dst), tag, comm, NON_PERSISTENT | ISEND | SEND);
request->start();
return request;
}
@@
-250,8
+250,8
@@
MPI_Request Request::isend(void *buf, int count, MPI_Datatype datatype, int dst,
MPI_Request Request::issend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
{
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);
+ request
= new Request(buf ==
MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
+ comm->group()->index(dst), tag,
comm, NON_PERSISTENT | ISEND | SSEND | SEND);
request->start();
return request;
}
@@
-260,9
+260,9
@@
MPI_Request Request::issend(void *buf, int count, MPI_Datatype datatype, int dst
MPI_Request Request::irecv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm)
{
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(), tag, comm
,
-
NON_PERSISTENT | RECV);
+ request
= new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype,
+
src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : comm->group()->index(src), smpi_process()->index()
,
+
tag, comm,
NON_PERSISTENT | RECV);
request->start();
return request;
}
@@
-278,8
+278,8
@@
void Request::recv(void *buf, int count, MPI_Datatype datatype, int src, int tag
void Request::send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
{
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);
+ request
= new Request(buf ==
MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
+ comm->group()->index(dst), tag, comm, NON_PERSISTENT | SEND);
request->start();
wait(&request, MPI_STATUS_IGNORE);
@@
-289,8
+289,8
@@
void Request::send(void *buf, int count, MPI_Datatype datatype, int dst, int tag
void Request::ssend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
{
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);
+ request
= new Request(buf ==
MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process()->index(),
+ comm->group()->index(dst), tag, comm, NON_PERSISTENT | SSEND | SEND);
request->start();
wait(&request,MPI_STATUS_IGNORE);
@@
-401,9
+401,8
@@
void Request::start()
if (not(old_type_->flags() & DT_FLAG_DERIVED)) {
oldbuf = buf_;
if (not process->replaying() && oldbuf != nullptr && size_ != 0) {
- if((smpi_privatize_global_variables != 0)
- && (static_cast<char*>(buf_) >= smpi_start_data_exe)
- && (static_cast<char*>(buf_) < smpi_start_data_exe + smpi_size_data_exe )){
+ if ((smpi_privatize_global_variables != 0) && (static_cast<char*>(buf_) >= smpi_data_exe_start) &&
+ (static_cast<char*>(buf_) < smpi_data_exe_start + smpi_data_exe_size)) {
XBT_DEBUG("Privatization : We are sending from a zone inside global memory. Switch data segment ");
smpi_switch_data_segment(src_);
}
@@
-508,8
+507,8
@@
int Request::test(MPI_Request * request, MPI_Status * status) {
if (flag) {
finish_wait(request,status);
nsleeps=1;//reset the number of sleeps we will do next time
- if (*request != MPI_REQUEST_NULL && ((*request)->flags_ & PERSISTENT)
==
0)
- *request = MPI_REQUEST_NULL;
+ if (*request != MPI_REQUEST_NULL && ((*request)->flags_ & PERSISTENT)
==
0)
+
*request = MPI_REQUEST_NULL;
} else if (xbt_cfg_get_boolean("smpi/grow-injected-times")){
nsleeps++;
}
@@
-694,10
+693,10
@@
void Request::finish_wait(MPI_Request* request, MPI_Status * status)
(datatype->flags() & DT_FLAG_DERIVED)) { // && (not smpi_is_shared(req->old_buf_))){
if (not smpi_process()->replaying()) {
- if
( smpi_privatize_global_variables != 0 && (static_cast<char*>(req->old_buf_) >= smpi_start_data_exe)
-
&& ((char*)req->old_buf_ < smpi_start_data_exe + smpi_size_data_exe ))
{
-
XBT_VERB("Privatization : We are unserializing to a zone in global memory Switch data segment ");
-
smpi_switch_data_segment(smpi_process()->index());
+ if
(smpi_privatize_global_variables != 0 && (static_cast<char*>(req->old_buf_) >= smpi_data_exe_start) &&
+
((char*)req->old_buf_ < smpi_data_exe_start + smpi_data_exe_size))
{
+ XBT_VERB("Privatization : We are unserializing to a zone in global memory Switch data segment ");
+ smpi_switch_data_segment(smpi_process()->index());
}
}
@@
-862,7
+861,7
@@
int Request::waitall(int count, MPI_Request requests[], MPI_Status status[])
if (not accumulates.empty()) {
std::sort(accumulates.begin(), accumulates.end(), sort_accumulates);
- for (auto req : accumulates) {
+ for (auto
&
req : accumulates) {
finish_wait(&req, status);
}
}
@@
-885,7
+884,7
@@
int Request::waitsome(int incount, MPI_Request requests[], int *indices, MPI_Sta
status[index] = *pstat;
}
if (requests[index] != MPI_REQUEST_NULL && (requests[index]->flags_ & NON_PERSISTENT))
-
requests[index]=
MPI_REQUEST_NULL;
+
requests[index] =
MPI_REQUEST_NULL;
}else{
return MPI_UNDEFINED;
}