-/* Copyright (c) 2009-2019. The SimGrid Team.
+/* Copyright (c) 2009-2021. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
SD_task_t last_scheduled_task;
};
-static double sg_host_get_available_at(sg_host_t host)
+static double sg_host_get_available_at(const_sg_host_t host)
{
- HostAttribute attr = (HostAttribute)sg_host_get_data(host);
+ const struct _HostAttribute* attr = (HostAttribute)sg_host_get_data(host);
return attr->available_at;
}
sg_host_set_data(host, attr);
}
-static SD_task_t sg_host_get_last_scheduled_task( sg_host_t host){
- HostAttribute attr = (HostAttribute)sg_host_get_data(host);
+static SD_task_t sg_host_get_last_scheduled_task(const_sg_host_t host)
+{
+ const struct _HostAttribute* attr = (HostAttribute)sg_host_get_data(host);
return attr->last_scheduled_task;
}
sg_host_set_data(host, attr);
}
-static xbt_dynar_t get_ready_tasks(xbt_dynar_t dax)
+static xbt_dynar_t get_ready_tasks(const_xbt_dynar_t dax)
{
unsigned int i;
xbt_dynar_t ready_tasks;
return ready_tasks;
}
-static double finish_on_at(SD_task_t task, sg_host_t host)
+static double finish_on_at(const_SD_task_t task, const_sg_host_t host)
{
double result;
if (!xbt_dynar_is_empty(parents)) {
unsigned int i;
double data_available = 0.;
- double redist_time = 0;
double last_data_available;
/* compute last_data_available */
SD_task_t parent;
if (SD_task_get_kind(parent) == SD_TASK_COMM_E2E) {
sg_host_t * parent_host= SD_task_get_workstation_list(parent);
/* Estimate the redistribution time from this parent */
+ double redist_time;
if (SD_task_get_amount(parent) <= 1e-6){
redist_time= 0;
} else {
- redist_time = sg_host_route_latency(parent_host[0], host) +
- SD_task_get_amount(parent) / sg_host_route_bandwidth(parent_host[0], host);
+ redist_time = sg_host_get_route_latency(parent_host[0], host) +
+ SD_task_get_amount(parent) / sg_host_get_route_bandwidth(parent_host[0], host);
}
data_available = SD_task_get_start_time(parent) + redist_time;
}
xbt_dynar_free_container(&parents);
- result = fmax(sg_host_get_available_at(host), last_data_available) + SD_task_get_amount(task) / sg_host_speed(host);
+ result =
+ fmax(sg_host_get_available_at(host), last_data_available) + SD_task_get_amount(task) / sg_host_get_speed(host);
} else {
xbt_dynar_free_container(&parents);
- result = sg_host_get_available_at(host) + SD_task_get_amount(task)/sg_host_speed(host);
+ result = sg_host_get_available_at(host) + SD_task_get_amount(task) / sg_host_get_speed(host);
}
return result;
}
-static sg_host_t SD_task_get_best_host(SD_task_t task)
+static sg_host_t SD_task_get_best_host(const_SD_task_t task)
{
sg_host_t *hosts = sg_host_list();
int nhosts = sg_host_count();