XBT_PUBLIC void sg_host_route(sg_host_t from, sg_host_t to, xbt_dynar_t links);
XBT_PUBLIC double sg_host_route_latency(sg_host_t from, sg_host_t to);
XBT_PUBLIC double sg_host_route_bandwidth(sg_host_t from, sg_host_t to);
+void sg_host_send_to(sg_host_t from, sg_host_t to, double byte_amount);
+
XBT_PUBLIC void sg_host_dump(sg_host_t ws);
XBT_PUBLIC void sg_host_get_actor_list(sg_host_t host, xbt_dynar_t whereto);
if (host->get_name() != Host::current()->get_name() && read_size > 0) {
/* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
XBT_DEBUG("File is on %s remote host, initiate data transfer of %llu bytes.", host->get_cname(), read_size);
- std::vector<Host*> m_host_list = {Host::current(), host};
- std::vector<double> flops_amount = {0., 0.};
- std::vector<double> bytes_amount = {0., 0., static_cast<double>(read_size), 0.};
-
- this_actor::parallel_execute(m_host_list, flops_amount, bytes_amount);
+ host->send_to(Host::current(), read_size);
}
return read_size;
if (host->get_name() != Host::current()->get_name()) {
/* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
XBT_DEBUG("File is on %s remote host, initiate data transfer of %llu bytes.", host->get_cname(), size);
- std::vector<Host*> m_host_list = {Host::current(), host};
- std::vector<double> flops_amount = {0, 0};
- std::vector<double> bytes_amount = {0, static_cast<double>(size), 0, 0};
-
- this_actor::parallel_execute(m_host_list, flops_amount, bytes_amount);
+ Host::current()->send_to(host, size);
}
XBT_DEBUG("WRITE %s on disk '%s'. size '%llu/%llu' '%llu:%llu'", get_path(), local_storage_->get_cname(), size, size_, sg_storage_get_size_used(local_storage_), sg_storage_get_size(local_storage_));
XBT_DEBUG("Initiate data transfer of %llu bytes between %s and %s.", read_size, src_host->get_cname(),
storage_dest->get_host()->get_cname());
- std::vector<Host*> m_host_list = {src_host, dst_host};
- std::vector<double> flops_amount = {0, 0};
- std::vector<double> bytes_amount = {0, static_cast<double>(read_size), 0, 0};
-
- this_actor::parallel_execute(m_host_list, flops_amount, bytes_amount);
+ src_host->send_to(dst_host, read_size);
/* Create file on remote host, write it and close it */
File* fd = new File(fullpath, dst_host, nullptr);
}
}
+void Host::send_to(Host* dest, double byte_amount)
+{
+ std::vector<Host*> m_host_list = {this, dest};
+ std::vector<double> flops_amount = {0, 0};
+ std::vector<double> bytes_amount = {0, byte_amount, 0, 0};
+ this_actor::parallel_execute(m_host_list, flops_amount, bytes_amount);
+}
+
/** Get the properties assigned to a host */
const std::unordered_map<std::string, std::string>* Host::get_properties() const
{
return min_bandwidth;
}
+void sg_host_send_to(sg_host_t from, sg_host_t to, double byte_amount)
+{
+ from->send_to(to, byte_amount);
+}
+
/** @brief Displays debugging information about a host */
void sg_host_dump(sg_host_t host)
{