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
Biggest commit ever (SIMIX2): the user processes can now run in parallel
[simgrid.git]
/
src
/
smpi
/
smpi_base.c
diff --git
a/src/smpi/smpi_base.c
b/src/smpi/smpi_base.c
index
688a805
..
08d9b30
100644
(file)
--- a/
src/smpi/smpi_base.c
+++ b/
src/smpi/smpi_base.c
@@
-73,12
+73,12
@@
void smpi_mpi_start(MPI_Request request)
smpi_process_post_recv(request);
print_request("New recv", request);
request->pair =
smpi_process_post_recv(request);
print_request("New recv", request);
request->pair =
- SIMIX_
network
_irecv(request->rdv, request->buf, &request->size);
+ SIMIX_
req_comm
_irecv(request->rdv, request->buf, &request->size);
} else {
smpi_process_post_send(request->comm, request); // FIXME
print_request("New send", request);
request->pair =
} else {
smpi_process_post_send(request->comm, request); // FIXME
print_request("New send", request);
request->pair =
- SIMIX_
network
_isend(request->rdv, request->size, -1.0,
+ SIMIX_
req_comm
_isend(request->rdv, request->size, -1.0,
request->buf, request->size, NULL);
}
}
request->buf, request->size, NULL);
}
}
@@
-187,12
+187,12
@@
static void finish_wait(MPI_Request * request, MPI_Status * status)
status->MPI_SOURCE = (*request)->src;
status->MPI_TAG = (*request)->tag;
status->MPI_ERROR = MPI_SUCCESS;
status->MPI_SOURCE = (*request)->src;
status->MPI_TAG = (*request)->tag;
status->MPI_ERROR = MPI_SUCCESS;
- status->count = SIMIX_
communication_get_dst_bu
f_size((*request)->pair);
+ status->count = SIMIX_
req_comm_get_dst_buf
f_size((*request)->pair);
}
}
- SIMIX_
communication
_destroy((*request)->pair);
+ SIMIX_
req_comm
_destroy((*request)->pair);
print_request("finishing wait", *request);
if ((*request)->complete == 1) {
print_request("finishing wait", *request);
if ((*request)->complete == 1) {
- SIMIX_rdv_destroy((*request)->rdv);
+ SIMIX_r
eq_r
dv_destroy((*request)->rdv);
} else {
(*request)->match->complete = 1;
(*request)->match->match = MPI_REQUEST_NULL;
} else {
(*request)->match->complete = 1;
(*request)->match->match = MPI_REQUEST_NULL;
@@
-236,7
+236,7
@@
int smpi_mpi_testany(int count, MPI_Request requests[], int *index,
void smpi_mpi_wait(MPI_Request * request, MPI_Status * status)
{
print_request("wait", *request);
void smpi_mpi_wait(MPI_Request * request, MPI_Status * status)
{
print_request("wait", *request);
- SIMIX_
network
_wait((*request)->pair, -1.0);
+ SIMIX_
req_comm
_wait((*request)->pair, -1.0);
finish_wait(request, status);
}
finish_wait(request, status);
}
@@
-259,7
+259,7
@@
int smpi_mpi_waitany(int count, MPI_Request requests[],
}
if (index == MPI_UNDEFINED) {
// Otherwise, wait for a request to complete
}
if (index == MPI_UNDEFINED) {
// Otherwise, wait for a request to complete
- comms = xbt_dynar_new(sizeof(smx_
comm
_t), NULL);
+ comms = xbt_dynar_new(sizeof(smx_
action
_t), NULL);
map = xbt_new(int, count);
size = 0;
DEBUG0("Wait for one of");
map = xbt_new(int, count);
size = 0;
DEBUG0("Wait for one of");
@@
-272,7
+272,7
@@
int smpi_mpi_waitany(int count, MPI_Request requests[],
}
}
if (size > 0) {
}
}
if (size > 0) {
- index = SIMIX_
network
_waitany(comms);
+ index = SIMIX_
req_comm
_waitany(comms);
index = map[index];
finish_wait(&requests[index], status);
}
index = map[index];
finish_wait(&requests[index], status);
}
@@
-286,22
+286,20
@@
int smpi_mpi_waitany(int count, MPI_Request requests[],
void smpi_mpi_waitall(int count, MPI_Request requests[],
MPI_Status status[])
{
void smpi_mpi_waitall(int count, MPI_Request requests[],
MPI_Status status[])
{
- int index;
+ int index
, c
;
MPI_Status stat;
MPI_Status stat;
+ MPI_Status *pstat = status == MPI_STATUS_IGNORE ? MPI_STATUS_IGNORE : &stat;
- while (count > 0) {
- index = smpi_mpi_waitany(count, requests, &stat);
+ c = count;
+ while (c > 0) {
+ index = smpi_mpi_waitany(count, requests, pstat);
if (index == MPI_UNDEFINED) {
break;
}
if (status != MPI_STATUS_IGNORE) {
if (index == MPI_UNDEFINED) {
break;
}
if (status != MPI_STATUS_IGNORE) {
- memcpy(&status[index],
&stat, sizeof(stat)
);
+ memcpy(&status[index],
pstat, sizeof *pstat
);
}
}
- // FIXME: check this -v
- // Move the last request to the found position
- requests[index] = requests[count - 1];
- requests[count - 1] = MPI_REQUEST_NULL;
- count--;
+ c--;
}
}
}
}