/* * \brief Frees private data of a host (internal call only) */ void __MSG_host_priv_free(msg_host_priv_t priv) { if (priv == NULL) return; unsigned int size = xbt_dict_size(priv->dp_objs); if (size > 0) XBT_WARN("dp_objs: %u pending task?", size); xbt_dict_free(&priv->dp_objs); xbt_dict_free(&priv->affinity_mask_db); xbt_dynar_free(&priv->file_descriptor_table); free(priv); }
/* * \brief Frees private data of a host (internal call only) */ void __MSG_host_priv_free(msg_host_priv_t priv) { unsigned int size = xbt_dict_size(priv->dp_objs); if (size > 0) XBT_WARN("dp_objs: %u pending task?", size); xbt_dict_free(&priv->dp_objs); xbt_dict_free(&priv->affinity_mask_db); #ifdef MSG_USE_DEPRECATED free(priv->mailboxes); #endif free(priv); }
void NetworkIBModel::updateIBfactors(NetworkActionPtr action, IBNode *from, IBNode * to, int remove) { if (from == to)//disregard local comms (should use loopback) return; bool* updated=(bool*)xbt_malloc0(xbt_dict_size(active_nodes)*sizeof(bool)); ActiveComm* comm=NULL; if(remove){ if(to->ActiveCommsDown[from]==1) to->ActiveCommsDown.erase(from); else to->ActiveCommsDown[from]-=1; to->nbActiveCommsDown--; for (std::vector<ActiveComm*>::iterator it= from->ActiveCommsUp.begin(); it != from->ActiveCommsUp.end(); ++it) { if((*it)->action==action){ comm=(*it); from->ActiveCommsUp.erase(it); break; } } action->unref(); }else{ action->ref(); ActiveComm* comm=new ActiveComm(); comm->action=action; comm->destination=to; from->ActiveCommsUp.push_back(comm); to->ActiveCommsDown[from]+=1; to->nbActiveCommsDown++; } XBT_DEBUG("IB - Updating %d", from->id); updateIBfactors_rec(from, updated); XBT_DEBUG("IB - Finished updating %d", from->id); if(comm) delete comm; xbt_free(updated); }