- /* Find the host where the file is physically located and read it */
- Host* host = localStorage->getHost();
- XBT_DEBUG("READ %s on disk '%s'", getPath(), localStorage->get_cname());
- // if the current position is close to the end of the file, we may not be able to read the requested size
- sg_size_t read_size = localStorage->read(std::min(size, size_ - current_position_));
- current_position_ += read_size;
-
- if (strcmp(host->get_cname(), Host::current()->get_cname())) {
- /* 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);
- Host* m_host_list[] = {Host::current(), host};
- double* flops_amount = new double[2]{0, 0};
- double* bytes_amount = new double[4]{0, 0, static_cast<double>(read_size), 0};
-
- this_actor::parallel_execute(2, m_host_list, flops_amount, bytes_amount);
+ if (local_disk_) {
+ /* Find the host where the file is physically located and read it */
+ XBT_DEBUG("READ %s on disk '%s'", get_path(), local_disk_->get_cname());
+ // if the current position is close to the end of the file, we may not be able to read the requested size
+ read_size = local_disk_->read(std::min(size, size_ - current_position_));
+ current_position_ += read_size;