route_size = SD_route_get_size(w1, w2);
for (k = 0; k < route_size; k++) {
XBT_INFO("\tLink %s: latency = %f, bandwidth = %f",
- SD_link_get_name(route[k]),
- SD_link_get_latency(route[k]),
- SD_link_get_bandwidth(route[k]));
+ sg_link_name(route[k]),
+ sg_link_latency(route[k]),
+ sg_link_bandwidth(route[k]));
}
}
}
route_size = SD_route_get_size(w1, w2);
for (i = 0; i < route_size; i++) {
XBT_INFO(" Link %s: latency = %f, bandwidth = %f",
- SD_link_get_name(route[i]),
- SD_link_get_latency(route[i]),
- SD_link_get_bandwidth(route[i]));
+ sg_link_name(route[i]),
+ sg_link_latency(route[i]),
+ sg_link_bandwidth(route[i]));
}
XBT_INFO("Route latency = %f, route bandwidth = %f",
SD_route_get_latency(w1, w2),
@see SD_task_management */
typedef enum {
SD_NOT_SCHEDULED = 0, /**< @brief Initial state (not valid for SD_watch and SD_unwatch). */
- SD_SCHEDULABLE = 0x0001, /**< @brief A task becomes SD_SCHEDULABLE as soon as its dependencies are satisfied */
+ SD_SCHEDULABLE = 0x0001, /**< @brief A task becomes SD_SCHEDULABLE as soon as its dependencies are satisfied */
SD_SCHEDULED = 0x0002, /**< @brief A task becomes SD_SCHEDULED when you call function
SD_task_schedule. SD_simulate will execute it when it becomes SD_RUNNABLE. */
SD_RUNNABLE = 0x0004, /**< @brief A scheduled task becomes runnable is SD_simulate as soon as its dependencies are satisfied. */
* @{
*/
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_count(void) {
- return sg_link_count();
-}
-/** @brief Returns the user data of a link */
-static inline void *SD_link_get_data(SD_link_t link) {
- return sg_link_data(link);
-}
-
-/** @brief Sets the user data of a link
- *
- * The new data can be \c NULL. The old data should have been freed first
- * if it was not \c NULL.
- */
-static inline void SD_link_set_data(SD_link_t link, void *data) {
- sg_link_data_set(link, data);
-}
-/** @brief Returns the name of a link */
-static inline const char *SD_link_get_name(SD_link_t link) {
- return sg_link_name(link);
-}
-/** @brief Returns the current bandwidth of a link (in bytes per second) */
-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_latency(SD_link_t link){
- return sg_link_latency(link);
-}
-/** @brief Returns the sharing policy of this workstation.
- * @return true if the link is shared, and false if it's a fatpipe
- */
-static inline int SD_link_is_shared(SD_link_t link) {
- return sg_link_is_shared(link);
-}
/** @} */
/************************** Workstation handling ****************************/
XBT_DEBUG("Workstation number: %d, link number: %d",
- SD_workstation_get_count(), SD_link_get_count());
+ SD_workstation_get_count(), sg_link_count());
#ifdef HAVE_JEDULE
jedule_setup_platform();
#endif
if (sd_global->recyclable_route == NULL) {
/* first run */
- sd_global->recyclable_route = xbt_new(SD_link_t, SD_link_get_count());
+ sd_global->recyclable_route = xbt_new(SD_link_t, sg_link_count());
}
surf_route = surf_host_model_get_route((surf_host_model_t)surf_host_model, src, dst);
min_bandwidth = -1.0;
for (i = 0; i < nb_links; i++) {
- bandwidth = SD_link_get_bandwidth(links[i]);
+ bandwidth = sg_link_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_bandwidth(links[i]);
+ bandwidth = sg_link_bandwidth(links[i]);
if (bandwidth < min_bandwidth || min_bandwidth == -1.0)
min_bandwidth = bandwidth;
}
/* 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_count(), SD_link_get_count());
+ SD_workstation_get_count(), sg_link_count());
if(argv[2]){
printf("Wait for %ss\n",argv[2]);
sleep(atoi(argv[2]));
"SimDag test basic_link_test");
static int cmp_link(const void*a, const void*b) {
- const char *nameA = SD_link_get_name(*(SD_link_t*)a);
- const char *nameB = SD_link_get_name(*(SD_link_t*)b);
+ const char *nameA = sg_link_name(*(SD_link_t*)a);
+ const char *nameB = sg_link_name(*(SD_link_t*)b);
return strcmp( nameA, nameB );
}
/* creation of the environment */
SD_create_environment(argv[1]);
links = SD_link_get_list();
- int count = SD_link_get_count();
+ int count = sg_link_count();
XBT_INFO("Link count: %d", count);
qsort((void *)links, count, sizeof(SD_link_t), cmp_link);
for(i=0; i < count; i++){
XBT_INFO("%s: latency = %.5f, bandwidth = %f",
- SD_link_get_name(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]))){
+ sg_link_name(links[i]),
+ sg_link_latency(links[i]),
+ sg_link_bandwidth(links[i]));
+ sg_link_data_set(links[i], (void*) user_data);
+ if(strcmp(user_data, (const char*)sg_link_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_count(), SD_link_get_count());
+ SD_workstation_get_count(), sg_link_count());
if (argc >= 3) {
if (!strcmp(argv[2], "ONE_LINK")) {
printf("Route size %d\n", route_size);
for (i = 0; i < route_size; i++) {
printf(" Link %s: latency = %f, bandwidth = %f\n",
- SD_link_get_name(route[i]),
- SD_link_get_latency(route[i]),
- SD_link_get_bandwidth(route[i]));
+ sg_link_name(route[i]),
+ sg_link_latency(route[i]),
+ sg_link_bandwidth(route[i]));
}
printf("Route latency = %f, route bandwidth = %f\n",
SD_route_get_latency(w1, w2),
printf(" Route size %d\n", route_size);
for (k = 0; k < route_size; k++) {
printf(" Link %s: latency = %f, bandwidth = %f\n",
- SD_link_get_name(route[k]),
- SD_link_get_latency(route[k]),
- SD_link_get_bandwidth(route[k]));
+ sg_link_name(route[k]),
+ sg_link_latency(route[k]),
+ sg_link_bandwidth(route[k]));
}
printf(" Route latency = %f, route bandwidth = %f\n",
SD_route_get_latency(w1, w2),
static int name_compare_links(const void *n1, const void *n2)
{
char name1[80], name2[80];
- strcpy(name1, SD_link_get_name(*((SD_link_t *) n1)));
- strcpy(name2, SD_link_get_name(*((SD_link_t *) n2)));
+ strcpy(name1, sg_link_name(*((SD_link_t *) n1)));
+ strcpy(name2, sg_link_name(*((SD_link_t *) n2)));
return strcmp(name1, name2);
}
if (timings) {
XBT_INFO("Parsing time: %fs (%d hosts, %d links)",
xbt_os_timer_elapsed(parse_time),SD_workstation_get_count(),
- SD_link_get_count());
+ sg_link_count());
} else {
printf("<?xml version='1.0'?>\n");
printf("<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid.dtd\">\n");
}
// Links
- totalLinks = SD_link_get_count();
+ totalLinks = sg_link_count();
links = SD_link_get_list();
qsort((void *) links, totalLinks, sizeof(SD_link_t), name_compare_links);
printf(" <link id=\"");
printf("%s\" bandwidth=\"%.0f\" latency=\"%.9f\"",
- SD_link_get_name(links[i]),
- SD_link_get_bandwidth(links[i]),
- SD_link_get_latency(links[i]));
- if (SD_link_is_shared(links[i])) {
+ sg_link_name(links[i]),
+ sg_link_bandwidth(links[i]),
+ sg_link_latency(links[i]));
+ if (sg_link_is_shared(links[i])) {
printf("/>\n");
} else {
printf(" sharing_policy=\"FATPIPE\"/>\n");
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_count(), SD_link_get_count(), size);
+ SD_workstation_get_count(), sg_link_count(), size);
xbt_dict_foreach(host_list, cursor, key, data) {
printf(" - Seen: \"%s\" is type : %d\n", key,