{
SD_init(&argc, argv);
SD_create_environment(argv[1]);
- const sg_host_t *hosts = sg_host_list();
+ sg_host_t *hosts = sg_host_list();
SD_task_t t1 = SD_task_create_comp_seq("t1", NULL, 25000000);
SD_task_t c1 = SD_task_create_comm_e2e("c1", NULL, 125000000);
}
}
SD_exit();
+ xbt_free(hosts);
return 0;
}
/* Schedule them all on the first workstation */
XBT_INFO("------------------- Schedule tasks ---------------------------");
- const sg_host_t *ws_list = sg_host_list();
+ sg_host_t *ws_list = sg_host_list();
int count = sg_host_count();
xbt_dynar_foreach(dot, cursor, task) {
SD_task_schedulel(task, 1, ws_list[cursor % count]);
}
}
+ xbt_free(ws_list);
XBT_INFO("------------------- Run the schedule ---------------------------");
SD_simulate(-1);
/* Schedule them all on the first host */
XBT_INFO("------------------- Schedule tasks ---------------------------");
- const sg_host_t *ws_list = sg_host_list();
+ sg_host_t *host_list = sg_host_list();
int hosts_count = sg_host_count();
- qsort((void *) ws_list, hosts_count, sizeof(sg_host_t), name_compare_hosts);
+ qsort((void *) host_list, hosts_count, sizeof(sg_host_t), name_compare_hosts);
xbt_dynar_foreach(dax, cursor, task) {
if (SD_task_get_kind(task) == SD_TASK_COMP_SEQ) {
if (!strcmp(SD_task_get_name(task), "end"))
- SD_task_schedulel(task, 1, ws_list[0]);
+ SD_task_schedulel(task, 1, host_list[0]);
else
- SD_task_schedulel(task, 1, ws_list[cursor % hosts_count]);
+ SD_task_schedulel(task, 1, host_list[cursor % hosts_count]);
}
}
+ xbt_free(host_list);
XBT_INFO("------------------- Run the schedule ---------------------------");
SD_simulate(-1);
/* 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]);
- const sg_host_t *workstations = sg_host_list();
- int total_nworkstations = sg_host_count();
+ sg_host_t *hosts = sg_host_list();
+ int total_nhosts = sg_host_count();
- for (ctr=0; ctr<total_nworkstations;ctr++){
- current_storage_list = sg_host_get_mounted_storage_list(workstations[ctr]);
+ for (ctr=0; ctr<total_nhosts;ctr++){
+ current_storage_list = sg_host_get_mounted_storage_list(hosts[ctr]);
xbt_dict_foreach(current_storage_list,cursor,mount_name,storage_name)
- XBT_INFO("Workstation '%s' mounts '%s'", sg_host_get_name(workstations[ctr]), mount_name);
+ XBT_INFO("Workstation '%s' mounts '%s'", sg_host_get_name(hosts[ctr]), mount_name);
xbt_dict_free(¤t_storage_list);
}
SD_exit();
+ xbt_free(hosts);
return 0;
}
/* Schedule them all on all the first host*/
XBT_INFO("------------------- Schedule tasks ---------------------------");
- const sg_host_t *hosts = sg_host_list();
+ sg_host_t *hosts = sg_host_list();
int count = sg_host_count();
xbt_dynar_foreach(dot, cursor, task) {
if (SD_task_get_kind(task) == SD_TASK_COMP_PAR_AMDAHL) {
SD_task_schedulev(task, count, hosts);
}
}
+ xbt_free(hosts);
XBT_INFO("------------------- Run the schedule ---------------------------");
SD_simulate(-1);
XBT_INFO("Computation time for %f flops on %s: %f", comp_amount2, name2, comp_amount2/sg_host_speed(h2));
XBT_INFO("Route between %s and %s:", name1, name2);
- const SD_link_t *route = SD_route_get_list(h1, h2);
+ SD_link_t *route = SD_route_get_list(h1, h2);
int route_size = SD_route_get_size(h1, h2);
- for (int i = 0; i < route_size; i++) {
+ for (int i = 0; i < route_size; i++)
XBT_INFO(" Link %s: latency = %f, bandwidth = %f", sg_link_name(route[i]), sg_link_latency(route[i]),
sg_link_bandwidth(route[i]));
- }
+ xbt_free(route);
XBT_INFO("Route latency = %f, route bandwidth = %f", SD_route_get_latency(h1, h2), SD_route_get_bandwidth(h1, h2));
XBT_INFO("Communication time for %f bytes between %s and %s: %f", comm_amount12, name1, name2,
SD_route_get_latency(h1, h2) + comm_amount12 / SD_route_get_bandwidth(h1, h2));
SD_create_environment(argv[1]);
- const sg_host_t *hosts = sg_host_list();
+ sg_host_t *hosts = sg_host_list();
/* creation of some typed tasks and their dependencies */
/* chain of five tasks, three compute tasks with two data transfers in between */
XBT_DEBUG("Tasks destroyed. Exiting SimDag...");
SD_exit();
+ xbt_free(hosts);
return 0;
}