XBT_PUBLIC(double) SIMIX_communication_get_remains(smx_comm_t comm);
XBT_PUBLIC(void *) SIMIX_communication_get_data(smx_comm_t comm);
+XBT_PUBLIC(void *) SIMIX_communication_get_src_buf(smx_comm_t comm);
+XBT_PUBLIC(void *) SIMIX_communication_get_dst_buf(smx_comm_t comm);
+XBT_PUBLIC(void *) SIMIX_communication_get_src_buf_size(smx_comm_t comm);
+XBT_PUBLIC(void *) SIMIX_communication_get_dst_buf_size(smx_comm_t comm);
+
/*****Networking*****/
XBT_PUBLIC(void) SIMIX_network_set_copy_data_callback(void (*callback)(smx_comm_t, size_t));
XBT_PUBLIC(void) SIMIX_network_copy_pointer_callback(smx_comm_t comm, size_t buff_size);
TRACE_msg_task_execute_start (task);
#endif
-
xbt_assert1((!simdata->compute) && (task->simdata->refcount == 1),
"This task is executed somewhere else. Go fix your code! %d", task->simdata->refcount);
t_simdata->refcount++;
msg_global->sent_msg++;
-
process->simdata->waiting_task = task;
/* Send it by calling SIMIX network layer */
int MSG_comm_test(msg_comm_t comm) {
return SIMIX_network_test(comm);
}
-MSG_error_t MSG_comm_wait(msg_comm_t comm,double timeout) {
+
+MSG_error_t MSG_comm_wait(msg_comm_t comm, double timeout) {
xbt_ex_t e;
MSG_error_t res = MSG_OK;
TRY {
SIMIX_network_wait(comm,timeout);
- // (*task)->simdata->refcount--;
+
+ if(!(comm->src_proc == SIMIX_process_self()))
+ {
+ m_task_t task;
+ task = (m_task_t) SIMIX_communication_get_src_buf(comm);
+ task->simdata->refcount--;
+ }
/* FIXME: these functions are not tracable */
} CATCH(e){
return comm->data;
}
+XBT_PUBLIC(void *) SIMIX_communication_get_src_buf(smx_comm_t comm)
+{
+ return comm->src_buff;
+}
+XBT_PUBLIC(void *) SIMIX_communication_get_dst_buf(smx_comm_t comm)
+{
+ return comm->dst_buff;
+}
+XBT_PUBLIC(void *) SIMIX_communication_get_src_buf_size(smx_comm_t comm)
+{
+ return comm->src_buff_size;
+}
+XBT_PUBLIC(void *) SIMIX_communication_get_dst_buf_size(smx_comm_t comm)
+{
+ return comm->dst_buff_size;
+}
+
/******************************************************************************/
/* Synchronous Communication */
/******************************************************************************/