class Cpu;
class LinkImpl;
class HostImpl;
- class Storage;
+ class StorageImpl;
}
namespace trace_mgr {
class trace;
#include "surf/surf_routing.h"
#include "surf/datatypes.h"
#include "xbt/lib.h"
-#include "surf/surf_routing.h"
#include "simgrid/datatypes.h"
#include "simgrid/forward.h"
typedef simgrid::surf::Cpu surf_Cpu;
typedef simgrid::surf::HostModel surf_HostModel;
typedef simgrid::surf::NetworkModel surf_NetworkModel;
-typedef simgrid::surf::Storage surf_Storage;
+typedef simgrid::surf::StorageImpl surf_Storage;
typedef simgrid::surf::StorageModel surf_StorageModel;
typedef simgrid::surf::Resource surf_Resource;
typedef simgrid::surf::HostImpl surf_Host;
typedef struct surf_Cpu surf_Cpu;
typedef struct surf_HostModel surf_HostModel;
typedef struct surf_NetworkModel surf_NetworkModel;
-typedef struct surf_Storage surf_Storage;
+typedef struct surf_StorageImpl surf_Storage;
typedef struct surf_StorageModel surf_StorageModel;
typedef struct surf_Resource surf_Resource;
typedef struct surf_Host surf_Host;
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "../surf/StorageImpl.hpp"
#include "simgrid/s4u/Host.hpp"
#include "src/msg/msg_private.h"
-#include "src/surf/storage_interface.hpp"
#include <numeric>
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_io, msg, "Logging specific to MSG (io)");
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "../surf/StorageImpl.hpp"
#include "simgrid/s4u/Storage.hpp"
#include "simgrid/simix.hpp"
-#include "src/surf/storage_interface.hpp"
#include "xbt/lib.h"
#include <unordered_map>
#include "simgrid/s4u/Host.hpp"
#include "src/surf/surf_interface.hpp"
-#include "src/surf/storage_interface.hpp"
#include "src/surf/xml/platf.hpp"
#include "smx_private.h"
#include "xbt/ex.h" /* ex_backtrace_display */
+
#include "mc/mc.h"
-#include "src/mc/mc_replay.h"
#include "simgrid/sg_config.h"
+#include "src/mc/mc_replay.h"
+#include "src/surf/StorageImpl.hpp"
#include "src/smpi/smpi_process.hpp"
host.extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
});
- simgrid::surf::storageCreatedCallbacks.connect([](simgrid::surf::Storage* storage) {
+ simgrid::surf::storageCreatedCallbacks.connect([](simgrid::surf::StorageImpl* storage) {
const char* name = storage->cname();
// TODO, create sg_storage_by_name
sg_storage_t s = xbt_lib_get_elm_or_null(storage_lib, name);
piface_->pimpl_ = this;
}
-simgrid::surf::Storage* HostImpl::findStorageOnMountList(const char* mount)
+simgrid::surf::StorageImpl* HostImpl::findStorageOnMountList(const char* mount)
{
XBT_DEBUG("Search for storage name '%s' on '%s'", mount, piface_->cname());
if (storage_.find(mount) == storage_.end())
xbt_lib_foreach(storage_lib, cursor, key, data)
{
if (xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != nullptr) {
- simgrid::surf::Storage* storage = static_cast<simgrid::surf::Storage*>(
+ simgrid::surf::StorageImpl* storage = static_cast<simgrid::surf::StorageImpl*>(
xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
if (not strcmp(static_cast<const char*>(storage->attach_), piface_->cname())) {
storages->push_back(storage->cname());
Action* HostImpl::open(const char* fullpath)
{
- simgrid::surf::Storage* st = nullptr;
+ simgrid::surf::StorageImpl* st = nullptr;
size_t longest_prefix_length = 0;
std::string path;
std::string mount_name;
Action* HostImpl::close(surf_file_t fd)
{
- simgrid::surf::Storage* st = findStorageOnMountList(fd->mount);
+ simgrid::surf::StorageImpl* st = findStorageOnMountList(fd->mount);
XBT_DEBUG("CLOSE %s on disk '%s'", fd->name, st->cname());
return st->close(fd);
}
Action* HostImpl::read(surf_file_t fd, sg_size_t size)
{
- simgrid::surf::Storage* st = findStorageOnMountList(fd->mount);
+ simgrid::surf::StorageImpl* st = findStorageOnMountList(fd->mount);
XBT_DEBUG("READ %s on disk '%s'", fd->name, st->cname());
return st->read(fd, size);
}
Action* HostImpl::write(surf_file_t fd, sg_size_t size)
{
- simgrid::surf::Storage* st = findStorageOnMountList(fd->mount);
+ simgrid::surf::StorageImpl* st = findStorageOnMountList(fd->mount);
XBT_DEBUG("WRITE %s on disk '%s'", fd->name, st->cname());
return st->write(fd, size);
}
return -1;
} else {
- simgrid::surf::Storage* st = findStorageOnMountList(fd->mount);
+ simgrid::surf::StorageImpl* st = findStorageOnMountList(fd->mount);
/* Check if the file is on this storage */
if (st->content_->find(fd->name) == st->content_->end()) {
XBT_WARN("File %s is not on disk %s. Impossible to unlink", fd->name, st->cname());
xbt_dynar_t HostImpl::getInfo(surf_file_t fd)
{
- simgrid::surf::Storage* st = findStorageOnMountList(fd->mount);
+ simgrid::surf::StorageImpl* st = findStorageOnMountList(fd->mount);
sg_size_t* psize = xbt_new(sg_size_t, 1);
*psize = fd->size;
xbt_dynar_t info = xbt_dynar_new(sizeof(void*), nullptr);
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "surf_interface.hpp"
-#include "storage_interface.hpp"
#include "cpu_interface.hpp"
#include "network_interface.hpp"
#include "src/surf/PropertyHolder.hpp"
+#include "StorageImpl.hpp"
#include <xbt/base.h>
#ifndef SURF_HOST_INTERFACE_HPP_
virtual ~HostImpl() = default;
/** @brief Return the storage of corresponding mount point */
- virtual simgrid::surf::Storage* findStorageOnMountList(const char* storage);
+ virtual simgrid::surf::StorageImpl* findStorageOnMountList(const char* storage);
/** @brief Get the xbt_dict_t of mount_point: Storage */
virtual xbt_dict_t getMountedStorageList();
*/
virtual int fileMove(surf_file_t fd, const char* fullpath);
- std::map<std::string, simgrid::surf::Storage*> storage_;
+ std::map<std::string, simgrid::surf::StorageImpl*> storage_;
simgrid::s4u::Host* piface_ = nullptr;
simgrid::s4u::Host* getHost() { return piface_; }
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "storage_interface.hpp"
+#include "StorageImpl.hpp"
+
#include "surf_private.h"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/join.hpp>
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_storage, surf, "Logging specific to the SURF storage module");
xbt_lib_t storage_lib;
-int MSG_STORAGE_LEVEL = -1; // Msg storage level
-int SURF_STORAGE_LEVEL = -1;
-simgrid::surf::StorageModel *surf_storage_model = nullptr;
+int MSG_STORAGE_LEVEL = -1; // Msg storage level
+int SURF_STORAGE_LEVEL = -1;
+simgrid::surf::StorageModel* surf_storage_model = nullptr;
namespace simgrid {
namespace surf {
* Callbacks *
*************/
-simgrid::xbt::signal<void(Storage*)> storageCreatedCallbacks;
-simgrid::xbt::signal<void(Storage*)> storageDestructedCallbacks;
-simgrid::xbt::signal<void(Storage*, int, int)> storageStateChangedCallbacks; // signature: wasOn, isOn
+simgrid::xbt::signal<void(StorageImpl*)> storageCreatedCallbacks;
+simgrid::xbt::signal<void(StorageImpl*)> storageDestructedCallbacks;
+simgrid::xbt::signal<void(StorageImpl*, int, int)> storageStateChangedCallbacks; // signature: wasOn, isOn
simgrid::xbt::signal<void(StorageAction*, Action::State, Action::State)> storageActionStateChangedCallbacks;
/*********
* Model *
*********/
-StorageModel::StorageModel(): Model()
+StorageModel::StorageModel() : Model()
{
maxminSystem_ = lmm_system_new(true /* lazy update */);
}
-StorageModel::~StorageModel(){
+StorageModel::~StorageModel()
+{
lmm_system_free(maxminSystem_);
surf_storage_model = nullptr;
}
* Resource *
************/
-Storage::Storage(Model* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite,
- const char* type_id, const char* content_name, sg_size_t size, const char* attach)
+StorageImpl::StorageImpl(Model* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite,
+ const char* type_id, const char* content_name, sg_size_t size, const char* attach)
: Resource(model, name, lmm_constraint_new(maxminSystem, this, MAX(bread, bwrite)))
, size_(size)
, usedSize_(0)
constraintWrite_ = lmm_constraint_new(maxminSystem, this, bwrite);
}
-Storage::~Storage(){
+StorageImpl::~StorageImpl()
+{
storageDestructedCallbacks(this);
if (content_ != nullptr) {
for (auto entry : *content_)
free(attach_);
}
-std::map<std::string, sg_size_t*>* Storage::parseContent(const char* filename)
+std::map<std::string, sg_size_t*>* StorageImpl::parseContent(const char* filename)
{
usedSize_ = 0;
if ((not filename) || (strcmp(filename, "") == 0))
usedSize_ += size;
sg_size_t* psize = new sg_size_t;
- *psize = size;
+ *psize = size;
parse_content->insert({tokens.front(), psize});
}
} while (not fs->eof());
return parse_content;
}
-bool Storage::isUsed()
+bool StorageImpl::isUsed()
{
THROW_UNIMPLEMENTED;
return false;
}
-void Storage::apply_event(tmgr_trace_event_t /*event*/, double /*value*/)
+void StorageImpl::apply_event(tmgr_trace_event_t /*event*/, double /*value*/)
{
THROW_UNIMPLEMENTED;
}
-void Storage::turnOn() {
+void StorageImpl::turnOn()
+{
if (isOff()) {
Resource::turnOn();
storageStateChangedCallbacks(this, 0, 1);
}
}
-void Storage::turnOff() {
+void StorageImpl::turnOff()
+{
if (isOn()) {
Resource::turnOff();
storageStateChangedCallbacks(this, 1, 0);
}
}
-std::map<std::string, sg_size_t*>* Storage::getContent()
+std::map<std::string, sg_size_t*>* StorageImpl::getContent()
{
/* For the moment this action has no cost, but in the future we could take in account access latency of the disk */
return content_;
}
-sg_size_t Storage::getFreeSize(){
+sg_size_t StorageImpl::getFreeSize()
+{
return size_ - usedSize_;
}
-sg_size_t Storage::getUsedSize(){
+sg_size_t StorageImpl::getUsedSize()
+{
return usedSize_;
}
/**********
* Action *
**********/
-StorageAction::StorageAction(Model* model, double cost, bool failed, Storage* storage,
+StorageAction::StorageAction(Model* model, double cost, bool failed, StorageImpl* storage,
e_surf_action_storage_type_t type)
: Action(model, cost, failed), type_(type), storage_(storage), file_(nullptr)
{
progress_ = 0;
};
-StorageAction::StorageAction(Model* model, double cost, bool failed, lmm_variable_t var, Storage* storage,
+StorageAction::StorageAction(Model* model, double cost, bool failed, lmm_variable_t var, StorageImpl* storage,
e_surf_action_storage_type_t type)
: Action(model, cost, failed, var), type_(type), storage_(storage), file_(nullptr)
{
progress_ = 0;
}
-void StorageAction::setState(Action::State state){
+void StorageAction::setState(Action::State state)
+{
Action::State old = getState();
Action::setState(state);
storageActionStateChangedCallbacks(this, old, state);
}
-
}
}
* @brief Callbacks handler which emit the callbacks after Storage creation *
* @details Callback functions have the following signature: `void(Storage*)`
*/
-XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::Storage*)>) storageCreatedCallbacks;
+XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::StorageImpl*)>) storageCreatedCallbacks;
/** @ingroup SURF_callbacks
* @brief Callbacks handler which emit the callbacks after Storage destruction *
* @details Callback functions have the following signature: `void(StoragePtr)`
*/
-XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::Storage*)>) storageDestructedCallbacks;
+XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::StorageImpl*)>) storageDestructedCallbacks;
/** @ingroup SURF_callbacks
* @brief Callbacks handler which emit the callbacks after Storage State changed *
- * @details Callback functions have the following signature: `void(StorageAction *action, int previouslyOn, int currentlyOn)`
+ * @details Callback functions have the following signature: `void(StorageAction *action, int previouslyOn, int
+ * currentlyOn)`
*/
-XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::Storage*, int, int)>) storageStateChangedCallbacks;
+XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::StorageImpl*, int, int)>) storageStateChangedCallbacks;
/** @ingroup SURF_callbacks
* @brief Callbacks handler which emit the callbacks after StorageAction State changed *
- * @details Callback functions have the following signature: `void(StorageAction *action, simgrid::surf::Action::State old, simgrid::surf::Action::State current)`
+ * @details Callback functions have the following signature: `void(StorageAction *action, simgrid::surf::Action::State
+ * old, simgrid::surf::Action::State current)`
*/
-XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::StorageAction*, simgrid::surf::Action::State, simgrid::surf::Action::State)>) storageActionStateChangedCallbacks;
+XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::StorageAction*, simgrid::surf::Action::State,
+ simgrid::surf::Action::State)>)
+storageActionStateChangedCallbacks;
/*********
* Model *
StorageModel();
~StorageModel();
- virtual Storage* createStorage(const char* id, const char* type_id, const char* content_name, const char* attach) = 0;
+ virtual StorageImpl* createStorage(const char* id, const char* type_id, const char* content_name,
+ const char* attach) = 0;
- std::vector<Storage*> p_storageList;
+ std::vector<StorageImpl*> p_storageList;
};
/************
* @brief SURF storage interface class
* @details A Storage represent a storage unit (e.g.: hard drive, usb key)
*/
-class Storage : public simgrid::surf::Resource,
- public simgrid::surf::PropertyHolder {
+class StorageImpl : public simgrid::surf::Resource, public simgrid::surf::PropertyHolder {
public:
-
/** @brief Storage constructor */
- Storage(Model* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite, const char* type_id,
- const char* content_name, sg_size_t size, const char* attach);
+ StorageImpl(Model* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite,
+ const char* type_id, const char* content_name, sg_size_t size, const char* attach);
- ~Storage();
+ ~StorageImpl();
/** @brief Check if the Storage is used (if an action currently uses its resources) */
bool isUsed() override;
std::map<std::string, sg_size_t*>* content_;
sg_size_t size_;
sg_size_t usedSize_;
- char * typeId_;
- char* attach_; //FIXME: this is the name of the host. Use the host directly
+ char* typeId_;
+ char* attach_; // FIXME: this is the name of the host. Use the host directly
/**
* @brief Open a file
*
* @return The StorageAction corresponding to the opening
*/
- virtual StorageAction *open(const char* mount, const char* path)=0;
+ virtual StorageAction* open(const char* mount, const char* path) = 0;
/**
* @brief Close a file
* @param fd The file descriptor to close
* @return The StorageAction corresponding to the closing
*/
- virtual StorageAction *close(surf_file_t fd)=0;
+ virtual StorageAction* close(surf_file_t fd) = 0;
/**
* @brief Read a file
* @param size The size in bytes to read
* @return The StorageAction corresponding to the reading
*/
- virtual StorageAction *read(surf_file_t fd, sg_size_t size)=0;
+ virtual StorageAction* read(surf_file_t fd, sg_size_t size) = 0;
/**
* @brief Write a file
* @param size The size in bytes to write
* @return The StorageAction corresponding to the writing
*/
- virtual StorageAction *write(surf_file_t fd, sg_size_t size)=0;
+ virtual StorageAction* write(surf_file_t fd, sg_size_t size) = 0;
/**
* @brief Get the content of the current Storage
std::vector<StorageAction*> writeActions_;
- lmm_constraint_t constraintWrite_; /* Constraint for maximum write bandwidth*/
- lmm_constraint_t constraintRead_; /* Constraint for maximum write bandwidth*/
+ lmm_constraint_t constraintWrite_; /* Constraint for maximum write bandwidth*/
+ lmm_constraint_t constraintRead_; /* Constraint for maximum write bandwidth*/
};
/**********
* @brief The possible type of action for the storage component
*/
typedef enum {
- READ=0, /**< Read a file */
- WRITE, /**< Write in a file */
- STAT, /**< Stat a file */
- OPEN, /**< Open a file */
- CLOSE /**< Close a file */
+ READ = 0, /**< Read a file */
+ WRITE, /**< Write in a file */
+ STAT, /**< Stat a file */
+ OPEN, /**< Open a file */
+ CLOSE /**< Close a file */
} e_surf_action_storage_type_t;
/** @ingroup SURF_storage_interface
* @param storage The Storage associated to this StorageAction
* @param type [description]
*/
- StorageAction(Model *model, double cost, bool failed, Storage *storage,
- e_surf_action_storage_type_t type);
+ StorageAction(Model* model, double cost, bool failed, StorageImpl* storage, e_surf_action_storage_type_t type);
- /**
- * @brief StorageAction constructor
- *
- * @param model The StorageModel associated to this StorageAction
- * @param cost The cost of this StorageAction in [TODO]
- * @param failed [description]
- * @param var The lmm variable associated to this StorageAction if it is part of a LMM component
- * @param storage The Storage associated to this StorageAction
- * @param type [description]
- */
- StorageAction(Model *model, double cost, bool failed, lmm_variable_t var,
- Storage *storage, e_surf_action_storage_type_t type);
+ /**
+ * @brief StorageAction constructor
+ *
+ * @param model The StorageModel associated to this StorageAction
+ * @param cost The cost of this StorageAction in [TODO]
+ * @param failed [description]
+ * @param var The lmm variable associated to this StorageAction if it is part of a LMM component
+ * @param storage The Storage associated to this StorageAction
+ * @param type [description]
+ */
+ StorageAction(Model* model, double cost, bool failed, lmm_variable_t var, StorageImpl* storage,
+ e_surf_action_storage_type_t type);
void setState(simgrid::surf::Action::State state) override;
e_surf_action_storage_type_t type_;
- Storage* storage_;
+ StorageImpl* storage_;
surf_file_t file_;
double progress_;
};
-
}
}
typedef struct s_storage_type {
- char *model;
- char *content;
- char *type_id;
+ char* model;
+ char* content;
+ char* type_id;
xbt_dict_t properties;
std::map<std::string, std::string>* model_properties;
sg_size_t size;
typedef s_storage_type_t* storage_type_t;
typedef struct surf_file {
- char *name;
- char *mount;
+ char* name;
+ char* mount;
sg_size_t size;
sg_size_t current_position;
} s_surf_file_t;
#include <xbt/base.h>
-#include "storage_interface.hpp"
+#include "StorageImpl.hpp"
#include "cpu_interface.hpp"
-#include "src/surf/HostImpl.hpp"
#include "network_interface.hpp"
+#include "src/surf/HostImpl.hpp"
#ifndef SURF_HOST_CLM03_HPP_
#define SURF_HOST_CLM03_HPP_
#include <string>
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_parse);
-XBT_PRIVATE std::map<std::string, simgrid::surf::Storage*> mount_list;
+XBT_PRIVATE std::map<std::string, simgrid::surf::StorageImpl*> mount_list;
XBT_PRIVATE std::vector<std::string> known_storages;
namespace simgrid {
void** data;
xbt_lib_foreach(storage_lib, cursor, key, data) {
if (xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != nullptr) {
- simgrid::surf::Storage* storage =
- static_cast<simgrid::surf::Storage*>(xbt_lib_get_or_null(storage_lib, key, SURF_STORAGE_LEVEL));
+ simgrid::surf::StorageImpl* storage =
+ static_cast<simgrid::surf::StorageImpl*>(xbt_lib_get_or_null(storage_lib, key, SURF_STORAGE_LEVEL));
simgrid::kernel::routing::NetPoint* host_elm = sg_netpoint_by_name_or_null(storage->attach_);
if (not host_elm)
surf_parse_error("Unable to attach storage %s: host %s does not exist.", storage->cname(), storage->attach_);
simgrid::s4u::onPlatformCreated.connect(check_disk_attachment);
instr_routing_define_callbacks();
- SURF_STORAGE_LEVEL = xbt_lib_add_level(storage_lib, [](void *self) {
- delete static_cast<simgrid::surf::Storage*>(self);
- });
+ SURF_STORAGE_LEVEL =
+ xbt_lib_add_level(storage_lib, [](void* self) { delete static_cast<simgrid::surf::StorageImpl*>(self); });
}
/*********
namespace simgrid {
namespace surf {
-Storage* StorageN11Model::createStorage(const char* id, const char* type_id, const char* content_name,
- const char* attach)
+StorageImpl* StorageN11Model::createStorage(const char* id, const char* type_id, const char* content_name,
+ const char* attach)
{
storage_type_t storage_type = storage_types.at(type_id);
double Bwrite = surf_parse_get_bandwidth(storage_type->model_properties->at("Bwrite").c_str(),
"property Bwrite, storage", type_id);
- Storage* storage = new StorageN11(this, id, maxminSystem_, Bread, Bwrite, type_id, (char*)content_name,
- storage_type->size, (char*)attach);
+ StorageImpl* storage = new StorageN11(this, id, maxminSystem_, Bread, Bwrite, type_id, (char*)content_name,
+ storage_type->size, (char*)attach);
xbt_lib_set(storage_lib, id, SURF_STORAGE_LEVEL, storage);
storageCreatedCallbacks(storage);
StorageN11::StorageN11(StorageModel* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite,
const char* type_id, char* content_name, sg_size_t size, char* attach)
- : Storage(model, name, maxminSystem, bread, bwrite, type_id, content_name, size, attach)
+ : StorageImpl(model, name, maxminSystem, bread, bwrite, type_id, content_name, size, attach)
{
XBT_DEBUG("Create resource with Bread '%f' Bwrite '%f' and Size '%llu'", bread, bwrite, size);
}
* Action *
**********/
-StorageN11Action::StorageN11Action(Model *model, double cost, bool failed, Storage *storage, e_surf_action_storage_type_t type)
-: StorageAction(model, cost, failed,
- lmm_variable_new(model->getMaxminSystem(), this, 1.0, -1.0 , 3),
- storage, type) {
+StorageN11Action::StorageN11Action(Model* model, double cost, bool failed, StorageImpl* storage,
+ e_surf_action_storage_type_t type)
+ : StorageAction(model, cost, failed, lmm_variable_new(model->getMaxminSystem(), this, 1.0, -1.0, 3), storage, type)
+{
XBT_IN("(%s,%g", storage->cname(), cost);
// Must be less than the max bandwidth for all actions
#include <xbt/base.h>
-#include "storage_interface.hpp"
+#include "StorageImpl.hpp"
#ifndef STORAGE_N11_HPP_
#define STORAGE_N11_HPP_
class StorageN11Model : public StorageModel {
public:
- Storage* createStorage(const char* id, const char* type_id, const char* content_name, const char* attach) override;
+ StorageImpl* createStorage(const char* id, const char* type_id, const char* content_name,
+ const char* attach) override;
double nextOccuringEvent(double now) override;
void updateActionsState(double now, double delta) override;
};
* Resource *
************/
-class StorageN11 : public Storage {
+class StorageN11 : public StorageImpl {
public:
StorageN11(StorageModel* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite,
const char* type_id, char* content_name, sg_size_t size, char* attach);
class StorageN11Action : public StorageAction {
public:
- StorageN11Action(Model *model, double cost, bool failed, Storage *storage, e_surf_action_storage_type_t type);
+ StorageN11Action(Model* model, double cost, bool failed, StorageImpl* storage, e_surf_action_storage_type_t type);
void suspend();
int unref();
void cancel();
bool isSuspended();
void setMaxDuration(double duration);
void setPriority(double priority);
-
};
}
}
sg_size_t surf_storage_get_size(surf_resource_t resource){
- return static_cast<simgrid::surf::Storage*>(surf_storage_resource_priv(resource))->size_;
+ return static_cast<simgrid::surf::StorageImpl*>(surf_storage_resource_priv(resource))->size_;
}
sg_size_t surf_storage_get_free_size(surf_resource_t resource){
- return static_cast<simgrid::surf::Storage*>(surf_storage_resource_priv(resource))->getFreeSize();
+ return static_cast<simgrid::surf::StorageImpl*>(surf_storage_resource_priv(resource))->getFreeSize();
}
sg_size_t surf_storage_get_used_size(surf_resource_t resource){
- return static_cast<simgrid::surf::Storage*>(surf_storage_resource_priv(resource))->getUsedSize();
+ return static_cast<simgrid::surf::StorageImpl*>(surf_storage_resource_priv(resource))->getUsedSize();
}
xbt_dict_t surf_storage_get_properties(surf_resource_t resource){
- return static_cast<simgrid::surf::Storage*>(surf_storage_resource_priv(resource))->getProperties();
+ return static_cast<simgrid::surf::StorageImpl*>(surf_storage_resource_priv(resource))->getProperties();
}
const char* surf_storage_get_host(surf_resource_t resource){
- return static_cast<simgrid::surf::Storage*>(surf_storage_resource_priv(resource))->attach_;
+ return static_cast<simgrid::surf::StorageImpl*>(surf_storage_resource_priv(resource))->attach_;
}
const char* surf_storage_get_name(surf_resource_t resource){
- return static_cast<simgrid::surf::Storage*>(surf_storage_resource_priv(resource))->cname();
+ return static_cast<simgrid::surf::StorageImpl*>(surf_storage_resource_priv(resource))->cname();
}
void surf_cpu_action_set_bound(surf_action_t action, double bound) {
static inline void surf_storage_free(void *r)
{
- delete static_cast<simgrid::surf::Storage*>(r);
+ delete static_cast<simgrid::surf::StorageImpl*>(r);
}
void sg_version_check(int lib_version_major,int lib_version_minor,int lib_version_patch) {
src/surf/xml/simgrid_dtd.c
src/surf/xml/surfxml_sax_cb.cpp
- src/surf/storage_interface.hpp
+ src/surf/StorageImpl.hpp
src/surf/storage_n11.hpp
src/surf/surf_interface.hpp
src/surf/surf_private.h
src/surf/plugins/host_load.cpp
src/surf/PropertyHolder.cpp
src/surf/sg_platf.cpp
- src/surf/storage_interface.cpp
+ src/surf/StorageImpl.cpp
src/surf/storage_n11.cpp
src/surf/surf_c_bindings.cpp
src/surf/surf_interface.cpp