size_t longest_prefix_length = 0;
XBT_DEBUG("Search for storage name for '%s' on '%s'", fullpath.c_str(), host->get_cname());
size_t longest_prefix_length = 0;
XBT_DEBUG("Search for storage name for '%s' on '%s'", fullpath.c_str(), host->get_cname());
XBT_DEBUG("See '%s'", mnt.first.c_str());
mount_point_ = fullpath.substr(0, mnt.first.length());
XBT_DEBUG("See '%s'", mnt.first.c_str());
mount_point_ = fullpath.substr(0, mnt.first.length());
"\t\tStorage Id: '%s'\n"
"\t\tStorage Type: '%s'\n"
"\t\tFile Descriptor Id: %d",
"\t\tStorage Id: '%s'\n"
"\t\tStorage Type: '%s'\n"
"\t\tFile Descriptor Id: %d",
- get_path(), size_, mount_point_.c_str(), local_storage_->get_cname(), local_storage_->getType(), desc_id);
+ get_path(), size_, mount_point_.c_str(), local_storage_->get_cname(), local_storage_->get_type(), desc_id);
XBT_DEBUG("READ %s on disk '%s'", get_path(), local_storage_->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 = local_storage_->read(std::min(size, size_ - current_position_));
XBT_DEBUG("READ %s on disk '%s'", get_path(), local_storage_->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 = local_storage_->read(std::min(size, size_ - current_position_));
- * \param size of the file to write
- * \param fd is a the file descriptor
- * \return the number of bytes successfully write or -1 if an error occurred
+ * @param size of the file to write
+ * @return the number of bytes successfully write or -1 if an error occurred
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 */
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 */
{
/* Find the host where the file is physically located and read it */
Storage* storage_src = local_storage_;
{
/* Find the host where the file is physically located and read it */
Storage* storage_src = local_storage_;
seek(0, SEEK_SET);
XBT_DEBUG("READ %s on disk '%s'", get_path(), local_storage_->get_cname());
// if the current position is close to the end of the file, we may not be able to read the requested size
seek(0, SEEK_SET);
XBT_DEBUG("READ %s on disk '%s'", get_path(), local_storage_->get_cname());
// if the current position is close to the end of the file, we may not be able to read the requested size
std::string mount_point = std::string(fullpath).substr(0, elm.first.size());
if (mount_point == elm.first && elm.first.length() > longest_prefix_length) {
/* The current mount name is found in the full path and is bigger than the previous*/
std::string mount_point = std::string(fullpath).substr(0, elm.first.size());
if (mount_point == elm.first && elm.first.length() > longest_prefix_length) {
/* The current mount name is found in the full path and is bigger than the previous*/
if (storage_dest != nullptr) {
/* Mount point found, retrieve the host the storage is attached to */
if (storage_dest != nullptr) {
/* Mount point found, retrieve the host the storage is attached to */
} else {
XBT_WARN("Can't find mount point for '%s' on destination host '%s'", fullpath, host->get_cname());
return -1;
}
XBT_DEBUG("Initiate data transfer of %llu bytes between %s and %s.", read_size, src_host->get_cname(),
} else {
XBT_WARN("Can't find mount point for '%s' on destination host '%s'", fullpath, host->get_cname());
return -1;
}
XBT_DEBUG("Initiate data transfer of %llu bytes between %s and %s.", read_size, src_host->get_cname(),
Host* m_host_list[] = {src_host, dst_host};
double* flops_amount = new double[2]{0, 0};
double* bytes_amount = new double[4]{0, static_cast<double>(read_size), 0, 0};
Host* m_host_list[] = {src_host, dst_host};
double* flops_amount = new double[2]{0, 0};
double* bytes_amount = new double[4]{0, static_cast<double>(read_size), 0, 0};
- * \param fd : file object that identifies the stream
- * \param offset : number of bytes to offset from origin
- * \param origin : Position used as reference for the offset. It is specified by one of the following constants defined
+ * @param fd : file object that identifies the stream
+ * @param offset : number of bytes to offset from origin
+ * @param origin : Position used as reference for the offset. It is specified by one of the following constants defined
* in \<stdio.h\> exclusively to be used as arguments for this function (SEEK_SET = beginning of file,
* SEEK_CUR = current position of the file pointer, SEEK_END = end of file)
*/
* in \<stdio.h\> exclusively to be used as arguments for this function (SEEK_SET = beginning of file,
* SEEK_CUR = current position of the file pointer, SEEK_END = end of file)
*/
- * \brief Copy a file to another location on a remote host.
- * \param file : the file to move
- * \param host : the remote host where the file has to be copied
- * \param fullpath : the complete path destination on the remote host
- * \return If successful, the function returns 0. Otherwise, it returns -1.
+ * @brief Copy a file to another location on a remote host.
+ * @param file : the file to move
+ * @param host : the remote host where the file has to be copied
+ * @param fullpath : the complete path destination on the remote host
+ * @return If successful, the function returns 0. Otherwise, it returns -1.
- * \brief Move a file to another location on a remote host.
- * \param file : the file to move
- * \param host : the remote host where the file has to be moved
- * \param fullpath : the complete path destination on the remote host
- * \return If successful, the function returns 0. Otherwise, it returns -1.
+ * @brief Move a file to another location on a remote host.
+ * @param file : the file to move
+ * @param host : the remote host where the file has to be moved
+ * @param fullpath : the complete path destination on the remote host
+ * @return If successful, the function returns 0. Otherwise, it returns -1.
{
xbt_assert((host != nullptr), "Invalid parameters");
xbt_dict_t contents = xbt_dict_new_homogeneous(nullptr);
{
xbt_assert((host != nullptr), "Invalid parameters");
xbt_dict_t contents = xbt_dict_new_homogeneous(nullptr);
xbt_dict_set(contents, elm.first.c_str(), sg_storage_get_content(elm.second), nullptr);
return contents;
xbt_dict_set(contents, elm.first.c_str(), sg_storage_get_content(elm.second), nullptr);
return contents;