/* Schedule them all on the first workstation */
XBT_INFO("------------------- Schedule tasks ---------------------------");
const SD_workstation_t *ws_list = SD_workstation_get_list();
- int totalHosts = SD_workstation_get_number();
+ int totalHosts = SD_workstation_get_count();
qsort((void *) ws_list, totalHosts, sizeof(SD_workstation_t),
name_compare_hosts);
- int count = SD_workstation_get_number();
+ int count = SD_workstation_get_count();
xbt_dynar_foreach(dax, cursor, task) {
if (SD_task_get_kind(task) == SD_TASK_COMP_SEQ) {
if (!strcmp(SD_task_get_name(task), "end"))
XBT_INFO("------------------- Schedule tasks ---------------------------");
const SD_workstation_t *ws_list = SD_workstation_get_list();
- int count = SD_workstation_get_number();
+ int count = SD_workstation_get_count();
xbt_dynar_foreach(dot, cursor, task) {
if (SD_task_get_kind(task) == SD_TASK_COMP_SEQ) {
if (!strcmp(SD_task_get_name(task), "end"))
/* Schedule them all on all the first workstation */
XBT_INFO("------------------- Schedule tasks ---------------------------");
const SD_workstation_t *ws_list = SD_workstation_get_list();
- int count = SD_workstation_get_number();
+ int count = SD_workstation_get_count();
xbt_dynar_foreach(dot, cursor, task) {
if (SD_task_get_kind(task) == SD_TASK_COMP_PAR_AMDAHL) {
SD_task_schedulev(task, count, ws_list);
xbt_dynar_t done = NULL;
xbt_os_cputimer_start(timer);
- send_one(0,SD_workstation_get_number());
+ send_one(0,SD_workstation_get_count());
do {
if (done != NULL && !xbt_dynar_is_empty(done)) {
unsigned int cursor;
SD_config("host/model", "default");
SD_create_environment(argv[1]);
workstations = SD_workstation_get_list();
- total_nworkstations = SD_workstation_get_number();
+ total_nworkstations = SD_workstation_get_count();
for (ctr=0; ctr<total_nworkstations;ctr++){
current_storage_list = SD_workstation_get_mounted_storage_list(workstations[ctr]);
/* test the estimation functions */
workstations = SD_workstation_get_list();
- ws_nr = SD_workstation_get_number();
+ ws_nr = SD_workstation_get_count();
/* Show routes between all workstation */
for (k = 0; k < route_size; k++) {
XBT_INFO("\tLink %s: latency = %f, bandwidth = %f",
SD_link_get_name(route[k]),
- SD_link_get_current_latency(route[k]),
- SD_link_get_current_bandwidth(route[k]));
+ SD_link_get_latency(route[k]),
+ SD_link_get_bandwidth(route[k]));
}
}
}
int i;
double EFT, min_EFT = -1.0;
const SD_workstation_t *workstations = SD_workstation_get_list();
- int nworkstations = SD_workstation_get_number();
+ int nworkstations = SD_workstation_get_count();
SD_workstation_t best_workstation;
best_workstation = workstations[0];
{
unsigned int i, j, k;
int current_nworkstations;
- const int nworkstations = SD_workstation_get_number();
+ const int nworkstations = SD_workstation_get_count();
const SD_workstation_t *workstations = SD_workstation_get_list();
SD_task_t task;
SD_workstation_t *list;
SD_create_environment(argv[1]);
/* Allocating the workstation attribute */
- total_nworkstations = SD_workstation_get_number();
+ total_nworkstations = SD_workstation_get_count();
workstations = SD_workstation_get_list();
for (cursor = 0; cursor < total_nworkstations; cursor++)
while (!xbt_dynar_is_empty((changed_tasks = SD_simulate(-1.0)))) {
XBT_INFO("link1: bw=%.0f, lat=%f",
- SD_route_get_current_bandwidth(workstations[0], workstations[1]),
- SD_route_get_current_latency(workstations[0], workstations[1]));
+ SD_route_get_bandwidth(workstations[0], workstations[1]),
+ SD_route_get_latency(workstations[0], workstations[1]));
XBT_INFO("Jupiter: power=%.0f",
SD_workstation_get_power(workstations[0])*
SD_workstation_get_available_power(workstations[0]));
for (i = 0; i < route_size; i++) {
XBT_INFO(" Link %s: latency = %f, bandwidth = %f",
SD_link_get_name(route[i]),
- SD_link_get_current_latency(route[i]),
- SD_link_get_current_bandwidth(route[i]));
+ SD_link_get_latency(route[i]),
+ SD_link_get_bandwidth(route[i]));
}
XBT_INFO("Route latency = %f, route bandwidth = %f",
- SD_route_get_current_latency(w1, w2),
- SD_route_get_current_bandwidth(w1, w2));
+ SD_route_get_latency(w1, w2),
+ SD_route_get_bandwidth(w1, w2));
XBT_INFO("Communication time for %f bytes between %s and %s: %f",
communication_amount12, name1, name2,
SD_route_get_communication_time(w1, w2, communication_amount12));
argv[1]);
/* getting platform infos */
- n_hosts = SD_workstation_get_number();
+ n_hosts = SD_workstation_get_count();
hosts = SD_workstation_get_list();
/* sorting hosts by hostname */
*/
XBT_PUBLIC(const SD_link_t *) SD_link_get_list(void);
/** @brief Returns the number of links in the whole platform */
-static inline int SD_link_get_number(void) {
+static inline int SD_link_get_count(void) {
return sg_link_count();
}
return sg_link_name(link);
}
/** @brief Returns the current bandwidth of a link (in bytes per second) */
-static inline double SD_link_get_current_bandwidth(SD_link_t link) {
+static inline double SD_link_get_bandwidth(SD_link_t link) {
return sg_link_bandwidth(link);
}
/** @brief Returns the current latency of a link (in seconds) */
-static inline double SD_link_get_current_latency(SD_link_t link){
+static inline double SD_link_get_latency(SD_link_t link){
return sg_link_latency(link);
}
/** @brief Returns the sharing policy of this workstation.
*/
XBT_PUBLIC(SD_workstation_t) SD_workstation_get_by_name(const char *name);
XBT_PUBLIC(const SD_workstation_t *) SD_workstation_get_list(void);
-XBT_PUBLIC(int) SD_workstation_get_number(void);
+XBT_PUBLIC(int) SD_workstation_get_count(void);
XBT_PUBLIC(void) SD_workstation_set_data(SD_workstation_t workstation,
void *data);
XBT_PUBLIC(void *) SD_workstation_get_data(SD_workstation_t workstation);
XBT_PUBLIC(double) SD_workstation_get_computation_time(SD_workstation_t workstation,
double flops_amount);
-XBT_PUBLIC(double) SD_route_get_current_latency(SD_workstation_t src,
+XBT_PUBLIC(double) SD_route_get_latency(SD_workstation_t src,
SD_workstation_t dst);
-XBT_PUBLIC(double) SD_route_get_current_bandwidth(SD_workstation_t src,
+XBT_PUBLIC(double) SD_route_get_bandwidth(SD_workstation_t src,
SD_workstation_t dst);
XBT_PUBLIC(double) SD_route_get_communication_time(SD_workstation_t src,
SD_workstation_t dst,
XBT_DEBUG("Workstation number: %d, link number: %d",
- SD_workstation_get_number(), SD_link_get_number());
+ SD_workstation_get_count(), SD_link_get_count());
#ifdef HAVE_JEDULE
jedule_setup_platform();
#endif
* \see SD_workstation_get_number()
*/
const SD_workstation_t *SD_workstation_get_list(void) {
- xbt_assert(SD_workstation_get_number() > 0, "There is no workstation!");
+ xbt_assert(SD_workstation_get_count() > 0, "There is no workstation!");
if (sd_global->workstation_list == NULL) /* this is the first time the function is called */
sd_global->workstation_list = (SD_workstation_t*)xbt_dynar_to_array(sg_hosts_as_dynar());
* \return the number of existing workstations
* \see SD_workstation_get_list()
*/
-int SD_workstation_get_number(void)
+int SD_workstation_get_count(void)
{
return sg_host_count();
}
if (sd_global->recyclable_route == NULL) {
/* first run */
- sd_global->recyclable_route = xbt_new(SD_link_t, SD_link_get_number());
+ sd_global->recyclable_route = xbt_new(SD_link_t, SD_link_get_count());
}
surf_route = surf_host_model_get_route((surf_host_model_t)surf_host_model, src, dst);
* \param src the first workstation
* \param dst the second workstation
* \return the latency of the route between the two workstations (in seconds)
- * \see SD_route_get_current_bandwidth()
+ * \see SD_route_get_bandwidth()
*/
-double SD_route_get_current_latency(SD_workstation_t src, SD_workstation_t dst)
+double SD_route_get_latency(SD_workstation_t src, SD_workstation_t dst)
{
xbt_dynar_t route = NULL;
double latency;
}
/**
- * \brief Returns the bandwidth of the route between two workstations, i.e. the minimum link bandwidth of all
- * between the workstations.
+ * \brief Returns the bandwidth of the route between two workstations,
+ * i.e. the minimum link bandwidth of all between the workstations.
*
* \param src the first workstation
* \param dst the second workstation
- * \return the bandwidth of the route between the two workstations (in bytes/second)
- * \see SD_route_get_current_latency()
+ * \return the bandwidth of the route between the two workstations
+ * (in bytes/second)
+ * \see SD_route_get_latency()
*/
-double SD_route_get_current_bandwidth(SD_workstation_t src,
- SD_workstation_t dst)
+double SD_route_get_bandwidth(SD_workstation_t src, SD_workstation_t dst)
{
const SD_link_t *links;
min_bandwidth = -1.0;
for (i = 0; i < nb_links; i++) {
- bandwidth = SD_link_get_current_bandwidth(links[i]);
+ bandwidth = SD_link_get_bandwidth(links[i]);
if (bandwidth < min_bandwidth || min_bandwidth == -1.0)
min_bandwidth = bandwidth;
}
min_bandwidth = -1.0;
for (i = 0; i < nb_links; i++) {
- bandwidth = SD_link_get_current_bandwidth(links[i]);
+ bandwidth = SD_link_get_bandwidth(links[i]);
if (bandwidth < min_bandwidth || min_bandwidth == -1.0)
min_bandwidth = bandwidth;
}
SD_task_t task;
const SD_workstation_t *ws_list = SD_workstation_get_list();
- int totalHosts = SD_workstation_get_number();
+ int totalHosts = SD_workstation_get_count();
qsort((void *) ws_list, totalHosts, sizeof(SD_workstation_t),
name_compare_hosts);
- int count = SD_workstation_get_number();
- //fprintf(stdout, "No. workstations: %d, %d\n", count, (dax != NULL));
+ //fprintf(stdout, "No. workstations: %d, %d\n", totalHosts, (dax != NULL));
xbt_dynar_foreach(dax, cursor, task) {
if (SD_task_get_kind(task) == SD_TASK_COMP_SEQ) {
SD_task_schedulel(task, 1, ws_list[0]);
} else {
fprintf(stdout, "Scheduling %s to node: %s\n", SD_task_get_name(task),
- SD_workstation_get_name(ws_list[(cursor) % count]));
- SD_task_schedulel(task, 1, ws_list[(cursor) % count]);
+ SD_workstation_get_name(ws_list[(cursor) % totalHosts]));
+ SD_task_schedulel(task, 1, ws_list[(cursor) % totalHosts]);
}
}
}
SD_create_environment(argv[1]);
workstations = SD_workstation_get_list();
- list_size = SD_workstation_get_number();
+ list_size = SD_workstation_get_count();
/* Random number initialization */
srand( (int) (xbt_os_time()*1000) );
/* Display the result and exit after cleanup */
printf( "%f\n", xbt_os_timer_elapsed(timer) );
printf("Workstation number: %d, link number: %d\n",
- SD_workstation_get_number(), SD_link_get_number());
+ SD_workstation_get_count(), SD_link_get_count());
if(argv[2]){
printf("Wait for %ss\n",argv[2]);
sleep(atoi(argv[2]));
/* creation of the environment */
SD_create_environment(argv[1]);
links = SD_link_get_list();
- int count = SD_link_get_number();
+ int count = SD_link_get_count();
XBT_INFO("Link count: %d", count);
qsort((void *)links, count, sizeof(SD_link_t), cmp_link);
- for(i=0; i<SD_link_get_number();i++){
+ for(i=0; i < count; i++){
XBT_INFO("%s: latency = %.5f, bandwidth = %f",
SD_link_get_name(links[i]),
- SD_link_get_current_latency(links[i]),
- SD_link_get_current_bandwidth(links[i]));
+ SD_link_get_latency(links[i]),
+ SD_link_get_bandwidth(links[i]));
SD_link_set_data(links[i], (void*) user_data);
if(strcmp(user_data, (const char*)SD_link_get_data(links[i]))){
XBT_ERROR("User data was corrupted.");
/* creation of the environment */
SD_create_environment(argv[1]);
printf("Workstation number: %d, link number: %d\n",
- SD_workstation_get_number(), SD_link_get_number());
+ SD_workstation_get_count(), SD_link_get_count());
if (argc >= 3) {
if (!strcmp(argv[2], "ONE_LINK")) {
for (i = 0; i < route_size; i++) {
printf(" Link %s: latency = %f, bandwidth = %f\n",
SD_link_get_name(route[i]),
- SD_link_get_current_latency(route[i]),
- SD_link_get_current_bandwidth(route[i]));
+ SD_link_get_latency(route[i]),
+ SD_link_get_bandwidth(route[i]));
}
printf("Route latency = %f, route bandwidth = %f\n",
- SD_route_get_current_latency(w1, w2),
- SD_route_get_current_bandwidth(w1, w2));
+ SD_route_get_latency(w1, w2),
+ SD_route_get_bandwidth(w1, w2));
}
if (!strcmp(argv[2], "FULL_LINK")) {
workstations = SD_workstation_get_list();
- list_size = SD_workstation_get_number();
+ list_size = SD_workstation_get_count();
for (i = 0; i < list_size; i++) {
w1 = workstations[i];
name1 = SD_workstation_get_name(w1);
for (k = 0; k < route_size; k++) {
printf(" Link %s: latency = %f, bandwidth = %f\n",
SD_link_get_name(route[k]),
- SD_link_get_current_latency(route[k]),
- SD_link_get_current_bandwidth(route[k]));
+ SD_link_get_latency(route[k]),
+ SD_link_get_bandwidth(route[k]));
}
printf(" Route latency = %f, route bandwidth = %f\n",
- SD_route_get_current_latency(w1, w2),
- SD_route_get_current_bandwidth(w1, w2));
+ SD_route_get_latency(w1, w2),
+ SD_route_get_bandwidth(w1, w2));
}
}
}
if (timings) {
XBT_INFO("Parsing time: %fs (%d hosts, %d links)",
- xbt_os_timer_elapsed(parse_time),SD_workstation_get_number(),SD_link_get_number());
+ xbt_os_timer_elapsed(parse_time),SD_workstation_get_count(),
+ SD_link_get_count());
} else {
printf("<?xml version='1.0'?>\n");
printf("<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid.dtd\">\n");
printf("<AS id=\"AS0\" routing=\"Full\">\n");
// Hosts
- totalHosts = SD_workstation_get_number();
+ totalHosts = SD_workstation_get_count();
hosts = SD_workstation_get_list();
qsort((void *) hosts, totalHosts, sizeof(SD_workstation_t),
name_compare_hosts);
}
// Links
- totalLinks = SD_link_get_number();
+ totalLinks = SD_link_get_count();
links = SD_link_get_list();
qsort((void *) links, totalLinks, sizeof(SD_link_t), name_compare_links);
printf("%s\" bandwidth=\"%.0f\" latency=\"%.9f\"",
SD_link_get_name(links[i]),
- SD_link_get_current_bandwidth(links[i]),
- SD_link_get_current_latency(links[i]));
+ SD_link_get_bandwidth(links[i]),
+ SD_link_get_latency(links[i]));
if (SD_link_is_shared(links[i])) {
printf("/>\n");
} else {
size = xbt_dict_length(host_list) + xbt_lib_length(as_router_lib);
printf("Workstation number: %d, link number: %d, elmts number: %d\n",
- SD_workstation_get_number(), SD_link_get_number(), size);
+ SD_workstation_get_count(), SD_link_get_count(), size);
xbt_dict_foreach(host_list, cursor, key, data) {
printf(" - Seen: \"%s\" is type : %d\n", key,