"Logging specific to SIMIX (network)");
static xbt_dict_t rdv_points = NULL;
+unsigned long int smx_total_comms = 0;
static XBT_INLINE void SIMIX_comm_start(smx_action_t action);
static void SIMIX_comm_finish(smx_action_t action);
static XBT_INLINE void SIMIX_rdv_push(smx_rdv_t rdv, smx_action_t comm);
static XBT_INLINE void SIMIX_rdv_remove(smx_rdv_t rdv, smx_action_t comm);
static smx_action_t SIMIX_rdv_get_request(smx_rdv_t rdv, e_smx_comm_type_t type,
- int (*match_fun)(void *, void *), void *);
+ int (*match_fun)(void *, void *), void *);
static void SIMIX_rdv_free(void *data);
void SIMIX_network_init(void)
smx_action_t act;
/* alloc structures */
- act = xbt_new0(s_smx_action_t, 1);
+ act = xbt_mallocator_get(simix_global->action_mallocator);
act->type = SIMIX_ACTION_COMMUNICATE;
act->state = SIMIX_WAITING;
- act->request_list = xbt_fifo_new();
/* set communication */
act->comm.type = type;
#endif
DEBUG1("Create communicate action %p", act);
+ ++smx_total_comms;
return act;
}
TRACE_smx_action_destroy(action);
#endif
- if (action->name)
- xbt_free(action->name);
-
- xbt_fifo_free(action->request_list);
-
+ xbt_free(action->name);
SIMIX_comm_destroy_internal_actions(action);
if (action->comm.detached && action->state != SIMIX_DONE) {
((void_f_pvoid_t) action->comm.src_data)(action->comm.src_buff);
}
- xbt_free(action);
+ xbt_mallocator_release(simix_global->action_mallocator, action);
}
void SIMIX_comm_destroy_internal_actions(smx_action_t action)
/* 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--;
}
return action->comm.dst_data;
}
-void* SIMIX_comm_get_src_buff(smx_action_t action)
-{
- return action->comm.src_buff;
-}
-
-void* SIMIX_comm_get_dst_buff(smx_action_t action)
-{
- return action->comm.dst_buff;
-}
-
-size_t SIMIX_comm_get_src_buff_size(smx_action_t action)
-{
- return action->comm.src_buff_size;
-}
-
-size_t SIMIX_comm_get_dst_buff_size(smx_action_t action)
-{
- size_t buff_size;
-
- if (action->comm.dst_buff_size)
- buff_size = *(action->comm.dst_buff_size);
- else
- buff_size = 0;
-
- return buff_size;
-}
-
smx_process_t SIMIX_comm_get_src_proc(smx_action_t action)
{
return action->comm.src_proc;