- double result;
-
- const auto& parents = task->get_dependencies();
-
- if (not parents.empty()) {
- double data_available = 0.;
- double last_data_available;
- /* compute last_data_available */
- last_data_available = -1.0;
- for (const auto& parent : parents) {
- /* normal case */
- if (const auto* comm = dynamic_cast<sg4::Comm*>(parent.get())) {
- auto source = comm->get_source();
- XBT_DEBUG("transfer from %s to %s", source->get_cname(), host->get_cname());
- /* Estimate the redistribution time from this parent */
- double redist_time;
- if (comm->get_remaining() <= 1e-6) {
- redist_time = 0;
- } else {
- redist_time = sg_host_get_route_latency(source, host) +
- comm->get_remaining() / sg_host_get_route_bandwidth(source, host);
- }
- // We use the user data field to store the finish time of the predecessor of the comm, i.e., its potential start
- // time
- data_available = *comm->get_data<double>() + redist_time;
- }
-
- /* no transfer, control dependency */
- if (const auto* exec = dynamic_cast<sg4::Exec*>(parent.get())) {
- data_available = exec->get_finish_time();
+ double data_available = 0.;
+ double last_data_available = -1.0;
+ /* compute last_data_available */
+ for (const auto& parent : task->get_dependencies()) {
+ /* normal case */
+ if (const auto* comm = dynamic_cast<sg4::Comm*>(parent.get())) {
+ auto source = comm->get_source();
+ XBT_DEBUG("transfer from %s to %s", source->get_cname(), host->get_cname());
+ /* Estimate the redistribution time from this parent */
+ double redist_time;
+ if (comm->get_remaining() <= 1e-6) {
+ redist_time = 0;
+ } else {
+ redist_time =
+ sg_host_get_route_latency(source, host) + comm->get_remaining() / sg_host_get_route_bandwidth(source, host);