int TRACE_end() { if (!trace_active) return 1; TRACE_generate_viva_uncat_conf(); TRACE_generate_viva_cat_conf(); /* dump trace buffer */ TRACE_last_timestamp_to_dump = surf_get_clock(); TRACE_paje_dump_buffer(1); /* destroy all data structures of tracing (and free) */ PJ_container_free_all(); PJ_type_free_all(); PJ_container_release(); PJ_type_release(); TRACE_smpi_release(); TRACE_surf_release(); xbt_dict_free(&user_link_variables); xbt_dict_free(&user_host_variables); xbt_dict_free(&declared_marks); xbt_dict_free(&created_categories); /* close the trace file */ TRACE_paje_end(); /* de-activate trace */ trace_active = 0; XBT_DEBUG ("Tracing is off"); XBT_DEBUG("Tracing system is shutdown"); return 0; }
void gras_process_exit() { gras_procdata_exit(); free(_gras_procdata); xbt_dict_free(&_process_properties); xbt_dict_free(&_host_properties); }
int host(int argc, char *argv[]) { msg_file_t file = NULL; char* mount = xbt_strdup("/home"); size_t write; // First open XBT_INFO("\tOpen file '%s'",FILENAME1); file = MSG_file_open(mount,FILENAME1); // Unlink the file XBT_INFO("\tUnlink file '%s'",file->fullname); MSG_file_unlink(file); // Re Open the file wich is in fact created XBT_INFO("\tOpen file '%s'",FILENAME1); file = MSG_file_open(mount,FILENAME1); // Write into the new file write = MSG_file_write(100000,file); // Write for 100Ko XBT_INFO("\tHave written %zu on %s",write,file->fullname); // Close the file XBT_INFO("\tClose file '%s'",file->fullname); MSG_file_close(file); xbt_dict_t dict_ls; char* key; surf_stat_t data = NULL; xbt_dict_cursor_t cursor = NULL; dict_ls = MSG_file_ls(mount,"./"); XBT_INFO(" ");XBT_INFO("ls ./"); xbt_dict_foreach(dict_ls,cursor,key,data){ if(data) XBT_INFO("FILE : %s",key); else XBT_INFO("DIR : %s",key); } xbt_dict_free(&dict_ls); dict_ls = MSG_file_ls(mount,"./doc/simgrid/examples/platforms/"); XBT_INFO(" ");XBT_INFO("ls ./doc/simgrid/examples/platforms/"); xbt_dict_foreach(dict_ls,cursor,key,data){ if(data) XBT_INFO("FILE : %s",key); else XBT_INFO("DIR : %s",key); } xbt_dict_free(&dict_ls); dict_ls = MSG_file_ls(mount,"./doc/simgrid/examples/msg/"); XBT_INFO(" ");XBT_INFO("ls ./doc/simgrid/examples/msg/"); xbt_dict_foreach(dict_ls,cursor,key,data){ if(data) XBT_INFO("FILE : %s",key); else XBT_INFO("DIR : %s",key); } xbt_dict_free(&dict_ls); free(mount); return 0; }
void smpi_bench_destroy(void) { if (allocs) { xbt_dict_free(&allocs); } if (samples) { xbt_dict_free(&samples); } }
void _xbt_replay_action_exit(void) { xbt_dict_free(&xbt_action_queues); xbt_dict_free(&xbt_action_funs); free(action_line); xbt_action_queues = NULL; xbt_action_funs = NULL; action_line = NULL; }
static inline void routing_storage_type_free(void *r) { storage_type_t stype = (storage_type_t) r; free(stype->model); free(stype->type_id); free(stype->content); free(stype->content_type); xbt_dict_free(&(stype->properties)); xbt_dict_free(&(stype->model_properties)); free(stype); }
inline void simbatch_clean(void) { if (config) free(config); #ifdef LOG xbt_dict_free(&book_of_log); #endif xbt_dict_free(&book_of_plugin); }
/* * \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 gras_emul_exit(void) { if (locbuf) free(locbuf); xbt_dict_free(&benchmark_set); xbt_os_timer_free(timer); }
long dataset_number(std::string& host_name, std::string storage_type){ /** Returns a number of dataset on a given storage. Parameters: ---------- @host_name -- name of host @storage_type -- DISK or TAPE */ std::string storage_name = host_name + storage_type; msg_storage_t st = MSG_storage_get_by_name(storage_name.c_str()); xbt_dict_cursor_t cursor = NULL; char *key; double data; long amount = 0; xbt_dict_t storage_content = MSG_storage_get_content(st); xbt_dict_foreach(storage_content, cursor, key, data){ amount++; } xbt_dict_free(&storage_content); xbt_dict_cursor_free(&cursor); return amount; }
void TRACE_TI_end() { xbt_dict_free(&tracing_files); fclose(tracing_file); char *filename = TRACE_get_filename(); XBT_DEBUG("Filename %s is closed", filename); }
/** \ingroup m_task_management * \brief Destroy a #msg_task_t. * * Destructor for #msg_task_t. Note that you should free user data, if any, \b * before calling this function. * * Only the process that owns the task can destroy it. * The owner changes after a successful send. * If a task is successfully sent, the receiver becomes the owner and is * supposed to destroy it. The sender should not use it anymore. * If the task failed to be sent, the sender remains the owner of the task. */ msg_error_t MSG_task_destroy(msg_task_t task) { smx_synchro_t action = NULL; xbt_assert((task != NULL), "Invalid parameter"); if (task->simdata->isused) { /* the task is being sent or executed: cancel it first */ MSG_task_cancel(task); } TRACE_msg_task_destroy(task); xbt_free(task->name); action = task->simdata->compute; if (action) simcall_process_execution_destroy(action); /* parallel tasks only */ xbt_free(task->simdata->host_list); xbt_dict_free(&task->simdata->affinity_mask_db); /* free main structures */ xbt_free(task->simdata); xbt_free(task); return MSG_OK; }
int main(int argc, char **argv) { unsigned int ctr; const SD_workstation_t *workstations; int total_nworkstations; xbt_dict_t current_storage_list; char *mount_name; char *storage_name; xbt_dict_cursor_t cursor = NULL; SD_init(&argc, argv); /* Set the workstation model to default, as storage is not supported by the * ptask_L07 model yet. */ SD_config("host/model", "default"); SD_create_environment(argv[1]); workstations = SD_workstation_get_list(); total_nworkstations = SD_workstation_get_number(); for (ctr=0; ctr<total_nworkstations;ctr++){ current_storage_list = SD_workstation_get_mounted_storage_list(workstations[ctr]); xbt_dict_foreach(current_storage_list,cursor,mount_name,storage_name) XBT_INFO("Workstation '%s' mounts '%s'", SD_workstation_get_name(workstations[ctr]), mount_name); xbt_dict_free(¤t_storage_list); } SD_exit(); return 0; }
int main(int argc, char *argv[]) { msg_error_t res = MSG_OK; MSG_init(&argc, argv); /* Explicit initialization of the action module is required now*/ MSG_action_init(); xbt_assert(argc > 3,"Usage: %s platform_file deployment_file [action_files]\n" "\texample: %s platform.xml deployment.xml actions # if all actions are in the same file\n" "\texample: %s platform.xml deployment.xml # if actions are in separate files, specified in deployment\n", argv[0], argv[0], argv[0]); MSG_create_environment(argv[1]); MSG_launch_application(argv[2]); /* Action registration */ xbt_replay_action_register("open", action_open); xbt_replay_action_register("read", action_read); xbt_replay_action_register("close", action_close); if (!opened_files) opened_files = xbt_dict_new_homogeneous(NULL); /* Actually do the simulation using MSG_action_trace_run */ res = MSG_action_trace_run(argv[3]); // it's ok to pass a NULL argument here XBT_INFO("Simulation time %g", MSG_get_clock()); if (opened_files) xbt_dict_free(&opened_files); /* Explicit finalization of the action module is required now*/ MSG_action_exit(); return res!=MSG_OK; }
Storage::~Storage(){ surf_callback_emit(storageDestructedCallbacks, this); xbt_dict_free(&p_content); xbt_dynar_free(&p_writeActions); free(p_typeId); free(p_contentType); free(p_attach); }
NetworkIBModel::~NetworkIBModel() { xbt_dict_cursor_t cursor = NULL; IBNode* instance = NULL; char *name = NULL; xbt_dict_foreach(active_nodes, cursor, name, instance) delete instance; xbt_dict_free(&active_nodes); }
void mpi_finalize_(int* ierr) { *ierr = MPI_Finalize(); xbt_dynar_free(&op_lookup); op_lookup = NULL; xbt_dynar_free(&datatype_lookup); datatype_lookup = NULL; xbt_dict_free(&request_lookup); request_lookup = NULL; xbt_dynar_free(&comm_lookup); comm_lookup = NULL; }
void smpi_deployment_cleanup_instances(){ xbt_dict_cursor_t cursor = nullptr; s_smpi_mpi_instance_t* instance = nullptr; char *name = nullptr; xbt_dict_foreach(smpi_instances, cursor, name, instance) { if(instance->comm_world!=MPI_COMM_NULL) while (smpi_group_unuse(smpi_comm_group(instance->comm_world)) > 0); xbt_free(instance->comm_world); xbt_barrier_destroy(instance->finalization_barrier); } xbt_dict_free(&smpi_instances); }
WorkstationL07Model::~WorkstationL07Model() { xbt_dict_free(&ptask_parallel_task_link_set); delete surf_cpu_model_pm; delete surf_network_model; ptask_host_count = 0; if (ptask_maxmin_system) { lmm_system_free(ptask_maxmin_system); ptask_maxmin_system = NULL; } }
int main(int argc, char *argv[]) { /* Check the given arguments */ MSG_init(&argc, argv); /* Explicit initialization of the action module is required now*/ MSG_action_init(); // MSG_config("surf/precision","1e-9"); MSG_create_environment(argv[1]); /* Simulation setting */ msg_error_t res = MSG_OK; /* No need to register functions as in classical MSG programs: the actions get started anyway */ MSG_launch_application(argv[2]); char *wh=argv[4]; XBT_INFO("Your choose is %s",wh); xbt_replay_action_register("unlink", simsleep);//register the action xbt_replay_action_register("compute", simsleep);//register the action xbt_replay_action_register("access", simsleep); xbt_replay_action_register("stat", simsleep); xbt_replay_action_register("flush", simsleep); xbt_replay_action_register("readdir", simsleep); xbt_replay_action_register("getxattr", simsleep); xbt_replay_action_register("mkdir", simsleep); xbt_replay_action_register("symlink", simsleep); xbt_replay_action_register("readlink", simsleep); if(strcmp(wh,"action")==0) //decide which mode to run /* Action registration */ { xbt_replay_action_register("open", simopen); xbt_replay_action_register("release", simrelease); xbt_replay_action_register("read", simread); xbt_replay_action_register("creat", simcreat); xbt_replay_action_register("write", simwrite); } else if(strcmp(wh,"sleep")==0){ xbt_replay_action_register("open", simsleep); xbt_replay_action_register("release", simsleep); xbt_replay_action_register("read", simsleep); xbt_replay_action_register("creat", simsleep); xbt_replay_action_register("write", simsleep); } if(!opened_files) {opened_files = xbt_dict_new_homogeneous(NULL);} res = MSG_action_trace_run(argv[3]); // it's ok to pass a NULL argument here XBT_INFO("Simulation time %g", MSG_get_clock()); if(opened_files) {xbt_dict_free(&opened_files);} MSG_action_exit(); return !!MSG_OK; }
static void display_storage_content(msg_storage_t storage){ XBT_INFO("Print the content of the storage element: %s",MSG_storage_get_name(storage)); xbt_dict_cursor_t cursor = NULL; char *file; sg_size_t *psize; xbt_dict_t content = MSG_storage_get_content(storage); if (content){ xbt_dict_foreach(content, cursor, file, psize) XBT_INFO("\t%s size: %llu bytes", file, *psize); } else { XBT_INFO("\tNo content."); } xbt_dict_free(&content); }
boost::unordered_map<std::string, Storage&> &Host::mountedStorages() { if (mounts == NULL) { mounts = new boost::unordered_map<std::string, Storage&> (); xbt_dict_t dict = simcall_host_get_mounted_storage_list(p_inferior); xbt_dict_cursor_t cursor; char *mountname; char *storagename; xbt_dict_foreach(dict, cursor, mountname, storagename) { mounts->insert({mountname, Storage::byName(storagename)}); } xbt_dict_free(&dict); }
AsFloyd::~AsFloyd(){ int i, j; int table_size; table_size = (int)xbt_dynar_length(p_indexNetworkElm); if (p_linkTable == NULL) // Dealing with a parse error in the file? return; /* Delete link_table */ for (i = 0; i < table_size; i++) for (j = 0; j < table_size; j++) { generic_free_route(TO_FLOYD_LINK(i, j)); } xbt_free(p_linkTable); /* Delete bypass dict */ xbt_dict_free(&p_bypassRoutes); /* Delete predecessor and cost table */ xbt_free(p_predecessorTable); xbt_free(p_costTable); }
void NetworkSmpiModel::gapRemove(Action *lmm_action) { xbt_fifo_t fifo; size_t size; NetworkCm02Action *action = static_cast<NetworkCm02Action*>(lmm_action); if (sg_sender_gap > 0.0 && action->senderLinkName_ && action->senderFifoItem_) { fifo = (xbt_fifo_t) xbt_dict_get_or_null(gap_lookup, action->senderLinkName_); xbt_fifo_remove_item(fifo, action->senderFifoItem_); size = xbt_fifo_size(fifo); if (size == 0) { xbt_fifo_free(fifo); xbt_dict_remove(gap_lookup, action->senderLinkName_); size = xbt_dict_length(gap_lookup); if (size == 0) { xbt_dict_free(&gap_lookup); } } } }
void SIMIX_mailbox_exit() { xbt_dict_free(&mailboxes); }
NetworkSmpiModel::~NetworkSmpiModel() { xbt_dict_free(&gap_lookup); }
void TRACE_smpi_release(void) { xbt_dict_free(&keys); xbt_dict_free(&process_category); }
void smpi_bench_destroy(void) { xbt_dict_free(&allocs); xbt_dict_free(&samples); xbt_dict_free(&calls); }
void TRACE_surf_resource_utilization_release() { xbt_dict_free(&platform_variables); }