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
Make SIMIX_req_comm(test/wait/testany/waitany) requests to destroy the comm actions.
[simgrid.git]
/
src
/
simix
/
smx_network.c
diff --git
a/src/simix/smx_network.c
b/src/simix/smx_network.c
index
11b84c6
..
a5868d1
100644
(file)
--- a/
src/simix/smx_network.c
+++ b/
src/simix/smx_network.c
@@
-219,6
+219,12
@@
void SIMIX_comm_destroy(smx_action_t action)
SIMIX_comm_destroy_internal_actions(action);
SIMIX_comm_destroy_internal_actions(action);
+ if (action->comm.detached && action->state != SIMIX_DONE) {
+ /* the communication has failed and was detached:
+ * we have to free the buffer */
+ ((void_f_pvoid_t) action->comm.src_data)(action->comm.src_buff);
+ }
+
xbt_free(action);
}
xbt_free(action);
}
@@
-265,8
+271,10
@@
smx_action_t SIMIX_comm_isend(smx_process_t src_proc, smx_rdv_t rdv,
/* If the communication action is detached then decrease the refcount
* by one, so it will be eliminated by the receivers destroy call */
/* If the communication action is detached then decrease the refcount
* by one, so it will be eliminated by the receivers destroy call */
- if(detached)
+ if(detached){
+ action->comm.detached = 1;
action->comm.refcount--;
action->comm.refcount--;
+ }
/* Setup the communication request */
action->comm.src_proc = src_proc;
/* Setup the communication request */
action->comm.src_proc = src_proc;
@@
-500,6
+508,7
@@
static XBT_INLINE void SIMIX_comm_start(smx_action_t action)
void SIMIX_comm_finish(smx_action_t action)
{
void SIMIX_comm_finish(smx_action_t action)
{
+ unsigned int destroy_count = 0;
smx_req_t req;
while ((req = xbt_fifo_shift(action->request_list))) {
smx_req_t req;
while ((req = xbt_fifo_shift(action->request_list))) {
@@
-598,7
+607,11
@@
void SIMIX_comm_finish(smx_action_t action)
req->issuer->waiting_action = NULL;
SIMIX_request_answer(req);
req->issuer->waiting_action = NULL;
SIMIX_request_answer(req);
+ destroy_count++;
}
}
+
+ while(destroy_count-- > 0)
+ SIMIX_comm_destroy(action);
}
void SIMIX_post_comm(smx_action_t action)
}
void SIMIX_post_comm(smx_action_t action)