//without losing the event ascending order (considering all CPU's)
double smaller = -1;
xbt_swag_foreach(_action, p_runningActionSet) {
- action = (ActionLmmPtr) _action;
+ action = dynamic_cast<ActionLmmPtr>(static_cast<ActionPtr>(_action));
if (smaller < 0) {
smaller = action->m_lastUpdate;
continue;
class CpuAction : virtual public Action {
public:
CpuAction(){};
- CpuAction(ModelPtr model, double cost, bool failed): Action(model, cost, failed) {};
+ CpuAction(ModelPtr model, double cost, bool failed)
+ : Action(model, cost, failed) {};
};
class CpuActionLmm : public ActionLmm, public CpuAction {
public:
CpuActionLmm(){};
- CpuActionLmm(ModelPtr model, double cost, bool failed): ActionLmm(model, cost, failed), CpuAction(model, cost, failed) {};
+ CpuActionLmm(ModelPtr model, double cost, bool failed)
+ : Action(model, cost, failed), ActionLmm(model, cost, failed), CpuAction(model, cost, failed) {};
void updateRemainingLazy(double now);
};
}
}
-static void net_define_callbacks(void)
+void net_define_callbacks(void)
{
/* Figuring out the network links */
sg_platf_link_add_cb(net_parse_link_init);
*********/
extern NetworkCm02ModelPtr surf_network_model;
-
+void net_define_callbacks(void);
/*********
* Model *
xbt_dynar_t getRoute(RoutingEdgePtr src, RoutingEdgePtr dst); //FIXME: kill field? That is done by the routing nowadays
//FIXME: virtual void addTraces() =0;
void (*f_networkSolve)(lmm_system_t) = lmm_solve;
- double latencyFactor(double size);
- double bandwidthFactor(double size);
- double bandwidthConstraint(double rate, double bound, double size);
+ virtual double latencyFactor(double size);
+ virtual double bandwidthFactor(double size);
+ virtual double bandwidthConstraint(double rate, double bound, double size);
bool m_haveGap = false;
};
if (surf_network_model)
return;
surf_network_model = new NetworkSmpiModel();
-
+ net_define_callbacks();
xbt_dynar_push(model_list, &surf_network_model);
+ //network_solve = lmm_solve;
xbt_cfg_setdefault_double(_sg_cfg_set, "network/sender_gap", 10e-6);
xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 8775);
}
}
-double NetworkSmpiModel::latencyFactor(double size)
+double NetworkSmpiModel::bandwidthFactor(double size)
{
if (!smpi_bw_factor)
smpi_bw_factor =
return current;
}
-double NetworkSmpiModel::bandwidthFactor(double size)
+double NetworkSmpiModel::latencyFactor(double size)
{
if (!smpi_lat_factor)
smpi_lat_factor =
class NetworkSmpiModel;
typedef NetworkSmpiModel *NetworkSmpiModelPtr;
-class NetworkSmpiLink;
-typedef NetworkSmpiLink *NetworkSmpiLinkPtr;
-
-class NetworkSmpiLinkLmm;
-typedef NetworkSmpiLinkLmm *NetworkSmpiLinkLmmPtr;
-
-class NetworkSmpiAction;
-typedef NetworkSmpiAction *NetworkSmpiActionPtr;
-
-class NetworkSmpiActionLmm;
-typedef NetworkSmpiActionLmm *NetworkSmpiActionLmmPtr;
-
/*********
* Tools *
*********/
class NetworkSmpiModel : public NetworkCm02Model {
public:
- NetworkSmpiModel(){};
+ NetworkSmpiModel() : NetworkCm02Model() {m_haveGap=true;};
void gapAppend(double size, const NetworkCm02LinkLmmPtr link, NetworkCm02ActionLmmPtr action);
void gapRemove(ActionLmmPtr action);
double latencyFactor(double size);
* Resource *
************/
-class NetworkSmpiLinkLmm : public NetworkCm02LinkLmm {
-public:
- NetworkSmpiLinkLmm(NetworkSmpiModelPtr model, const char *name, xbt_dict_t props,
- lmm_system_t system,
- double constraint_value,
- tmgr_history_t history,
- e_surf_resource_state_t state_init,
- tmgr_trace_t state_trace,
- double metric_peak,
- tmgr_trace_t metric_trace,
- double lat_initial,
- tmgr_trace_t lat_trace,
- e_surf_link_sharing_policy_t policy);
-};
-
/**********
* Action *
**********/
-class NetworkSmpiActionLmm : public NetworkCm02ActionLmm {
-public:
- NetworkSmpiActionLmm(ModelPtr model, double cost, bool failed);
-};