+ if (size == 0) /* Nothing to write, return */
+ return 0;
+
+ /* Find the host where the file is physically located (remote or local)*/
+ Host* host = localStorage->getHost();
+
+ if (strcmp(host->getCname(), Host::current()->getCname())) {
+ /* 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->getCname(), size);
+ Host* m_host_list[] = {Host::current(), host};
+ double* flops_amount = new double[2]{0, 0};
+ double* bytes_amount = new double[4]{0, static_cast<double>(size), 0, 0};
+
+ this_actor::parallel_execute(2, m_host_list, flops_amount, bytes_amount);
+ }
+