A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
create the loopback after the right configuration is set
[simgrid.git]
/
src
/
surf
/
surf_interface.hpp
diff --git
a/src/surf/surf_interface.hpp
b/src/surf/surf_interface.hpp
index
cdd4d58
..
b9e8b2c
100644
(file)
--- a/
src/surf/surf_interface.hpp
+++ b/
src/surf/surf_interface.hpp
@@
-6,21
+6,14
@@
#ifndef SURF_MODEL_H_
#define SURF_MODEL_H_
#ifndef SURF_MODEL_H_
#define SURF_MODEL_H_
-#include
<cstddef>
+#include
"xbt/signal.hpp"
-#include
<xbt.h>
-#include
<memory>
-#include
<utility>
+#include
"src/surf/surf_private.h"
+#include
"surf/surf.h"
+#include
"xbt/str.h"
#include <boost/intrusive/list.hpp>
#include <boost/intrusive/list.hpp>
-
-#include <xbt/signal.hpp>
-
-#include "xbt/lib.h"
-#include "surf/surf_routing.h"
-#include "surf/surf.h"
-#include "src/surf/surf_private.h"
-#include "src/internal_config.h"
+#include <string>
#define NO_MAX_DURATION -1.0
#define NO_MAX_DURATION -1.0
@@
-35,10
+28,10
@@
extern XBT_PRIVATE double sg_latency_factor;
extern XBT_PRIVATE double sg_bandwidth_factor;
extern XBT_PRIVATE double sg_weight_S_parameter;
extern XBT_PRIVATE int sg_network_crosstraffic;
extern XBT_PRIVATE double sg_bandwidth_factor;
extern XBT_PRIVATE double sg_weight_S_parameter;
extern XBT_PRIVATE int sg_network_crosstraffic;
-extern XBT_PRIVATE
xbt_dynar_t
surf_path;
+extern XBT_PRIVATE
std::vector<std::string>
surf_path;
extern "C" {
extern "C" {
-XBT_PUBLIC(double) surf_get_clock(
void
);
+XBT_PUBLIC(double) surf_get_clock();
}
/** \ingroup SURF_simulation
* \brief List of hosts that have just restarted and whose autorestart process should be restarted.
}
/** \ingroup SURF_simulation
* \brief List of hosts that have just restarted and whose autorestart process should be restarted.
@@
-51,17
+44,12
@@
extern XBT_PRIVATE double sg_sender_gap;
namespace simgrid {
namespace surf {
namespace simgrid {
namespace surf {
-extern XBT_PRIVATE simgrid::xbt::signal<void(void)> surfExitCallbacks;
-
+extern XBT_PRIVATE simgrid::xbt::signal<void()> surfExitCallbacks;
}
}
int XBT_PRIVATE __surf_is_absolute_file_path(const char *file_path);
}
}
int XBT_PRIVATE __surf_is_absolute_file_path(const char *file_path);
-static inline char* sg_storage_name(sg_storage_t storage) {
- return storage->key;
-}
-
/***********
* Classes *
***********/
/***********
* Classes *
***********/
@@
-114,7
+102,6
@@
public:
not_in_the_system /**< Not in the system anymore. Why did you ask ? */
};
not_in_the_system /**< Not in the system anymore. Why did you ask ? */
};
-public:
/**
* @brief Action constructor
*
/**
* @brief Action constructor
*
@@
-213,20
+200,20
@@
public:
void setCategory(const char *category);
/** @brief Get the priority of the current Action */
void setCategory(const char *category);
/** @brief Get the priority of the current Action */
- double getPriority() {
return priority_;
};
+ double getPriority() {
return sharingWeight_;
};
/** @brief Set the priority of the current Action */
/** @brief Set the priority of the current Action */
- virtual void set
Priority
(double priority);
+ virtual void set
SharingWeight
(double priority);
/** @brief Get the state set in which the action is */
ActionList* getStateSet() {return stateSet_;};
s_xbt_swag_hookup_t stateHookup_ = {nullptr,nullptr};
/** @brief Get the state set in which the action is */
ActionList* getStateSet() {return stateSet_;};
s_xbt_swag_hookup_t stateHookup_ = {nullptr,nullptr};
- simgrid::surf::Model
*getModel() {return model_;
}
+ simgrid::surf::Model
* getModel() { return model_;
}
protected:
ActionList* stateSet_;
protected:
ActionList* stateSet_;
- double
priority
_ = 1.0; /**< priority (1.0 by default) */
+ double
sharingWeight
_ = 1.0; /**< priority (1.0 by default) */
int refcount_ = 1;
double remains_; /**< How much of that cost remains to be done in the currently running task */
double maxDuration_ = NO_MAX_DURATION; /*< max_duration (may fluctuate until the task is completed) */
int refcount_ = 1;
double remains_; /**< How much of that cost remains to be done in the currently running task */
double maxDuration_ = NO_MAX_DURATION; /*< max_duration (may fluctuate until the task is completed) */
@@
-364,7
+351,7
@@
private:
typedef struct {
double peak; /**< The peak of the metric, ie its max value */
double scale; /**< Current availability of the metric according to the traces, in [0,1] */
typedef struct {
double peak; /**< The peak of the metric, ie its max value */
double scale; /**< Current availability of the metric according to the traces, in [0,1] */
- tmgr_trace_
iterator
_t event; /**< The associated trace event associated to the metric */
+ tmgr_trace_
event
_t event; /**< The associated trace event associated to the metric */
} s_surf_metric_t;
namespace simgrid {
} s_surf_metric_t;
namespace simgrid {
@@
-388,10
+375,10
@@
public:
virtual ~Resource();
/** @brief Get the Model of the current Resource */
virtual ~Resource();
/** @brief Get the Model of the current Resource */
- Model
*getM
odel() const;
+ Model
* m
odel() const;
/** @brief Get the name of the current Resource */
/** @brief Get the name of the current Resource */
- const char
*getN
ame() const;
+ const char
* cn
ame() const;
bool operator==(const Resource &other) const;
bool operator==(const Resource &other) const;
@@
-401,7
+388,7
@@
public:
* @param event What happened
* @param value [TODO]
*/
* @param event What happened
* @param value [TODO]
*/
- virtual void apply_event(tmgr_trace_
iterator_t event, double value)=
0;
+ virtual void apply_event(tmgr_trace_
event_t event, double value) =
0;
/** @brief Check if the current Resource is used (if it currently serves an action) */
virtual bool isUsed()=0;
/** @brief Check if the current Resource is used (if it currently serves an action) */
virtual bool isUsed()=0;
@@
-422,7
+409,8
@@
private:
public: /* LMM */
/** @brief Get the lmm constraint associated to this Resource if it is part of a LMM component (or null if none) */
public: /* LMM */
/** @brief Get the lmm constraint associated to this Resource if it is part of a LMM component (or null if none) */
- lmm_constraint_t getConstraint() const;
+ lmm_constraint_t constraint() const;
+
protected:
const lmm_constraint_t constraint_ = nullptr;
};
protected:
const lmm_constraint_t constraint_ = nullptr;
};
@@
-436,7
+424,7
@@
namespace std {
{
std::size_t operator()(const simgrid::surf::Resource& r) const
{
{
std::size_t operator()(const simgrid::surf::Resource& r) const
{
- return (std::size_t) xbt_str_hash(r.
getN
ame());
+ return (std::size_t) xbt_str_hash(r.
cn
ame());
}
};
}
}
};
}