#include "simgrid/s4u/File.hpp"
#include "simgrid/s4u/Host.hpp"
#include "simgrid/s4u/Storage.hpp"
#include "simgrid/s4u/File.hpp"
#include "simgrid/s4u/Host.hpp"
#include "simgrid/s4u/Storage.hpp"
/* Find the host where the file is physically located and read it */
msg_storage_t storage_src = simgrid::s4u::Storage::byName(fd->storageId);
msg_host_t attached_host = storage_src->getHost();
/* Find the host where the file is physically located and read it */
msg_storage_t storage_src = simgrid::s4u::Storage::byName(fd->storageId);
msg_host_t attached_host = storage_src->getHost();
if (strcmp(attached_host->getCname(), MSG_host_self()->getCname())) {
/* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
if (strcmp(attached_host->getCname(), MSG_host_self()->getCname())) {
/* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
{
msg_file_t fd = new simgrid::s4u::File(fullpath, MSG_host_self());
fd->desc_id = MSG_host_get_file_descriptor_id(MSG_host_self());
{
msg_file_t fd = new simgrid::s4u::File(fullpath, MSG_host_self());
fd->desc_id = MSG_host_get_file_descriptor_id(MSG_host_self());
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*/
const char* MSG_storage_get_name(msg_storage_t storage)
{
xbt_assert((storage != nullptr), "Invalid parameters");
const char* MSG_storage_get_name(msg_storage_t storage)
{
xbt_assert((storage != nullptr), "Invalid parameters");
xbt_dict_set(as_dict, elm.first.c_str(), xbt_strdup(elm.second.c_str()), nullptr);
}
return as_dict;
xbt_dict_set(as_dict, elm.first.c_str(), xbt_strdup(elm.second.c_str()), nullptr);
}
return as_dict;
{
std::map<std::string, simgrid::s4u::Storage*>* storage_map = simgrid::s4u::allStorages();
xbt_dynar_t res = xbt_dynar_new(sizeof(msg_storage_t),nullptr);
{
std::map<std::string, simgrid::s4u::Storage*>* storage_map = simgrid::s4u::allStorages();
xbt_dynar_t res = xbt_dynar_new(sizeof(msg_storage_t),nullptr);
xbt_dict_t MSG_storage_get_content(msg_storage_t storage)
{
std::map<std::string, sg_size_t>* content = storage->getContent();
xbt_dict_t MSG_storage_get_content(msg_storage_t storage)
{
std::map<std::string, sg_size_t>* content = storage->getContent();
*psize = entry.second;
xbt_dict_set(content_as_dict, entry.first.c_str(), psize, nullptr);
}
*psize = entry.second;
xbt_dict_set(content_as_dict, entry.first.c_str(), psize, nullptr);
}
xbt_assert((storage != nullptr), "Invalid parameters");
return storage->getHost()->getCname();
}
xbt_assert((storage != nullptr), "Invalid parameters");
return storage->getHost()->getCname();
}