#include "surf_private.h"
#include "surf.hpp"
-#include "network.hpp"
-#include "cpu.hpp"
+#include "network_interface.hpp"
+#include "cpu_interface.hpp"
#include "workstation.hpp"
#include "vm_workstation.hpp"
#include "simix/smx_host_private.h"
"Logging specific to SURF (kernel)");
}
+
+
/*********
* Utils *
*********/
static xbt_parmap_t surf_parmap = NULL; /* parallel map on models */
#endif
-static double *surf_mins = NULL; /* return value of share_resources for each model */
-static int surf_min_index; /* current index in surf_mins */
-static double min; /* duration determined by surf_solve */
-
double NOW = 0;
+double *surf_mins = NULL; /* return value of share_resources for each model */
+int surf_min_index; /* current index in surf_mins */
+double surf_min; /* duration determined by surf_solve */
double surf_get_clock(void)
{
static XBT_INLINE void surf_link_free(void *r)
{
- delete dynamic_cast<NetworkCm02LinkPtr>(static_cast<ResourcePtr>(r));
+ delete dynamic_cast<NetworkLinkPtr>(static_cast<ResourcePtr>(r));
}
static XBT_INLINE void surf_workstation_free(void *r)
#ifdef CONTEXT_THREADS
xbt_parmap_destroy(surf_parmap);
+#endif
+
xbt_free(surf_mins);
surf_mins = NULL;
-#endif
+
xbt_dynar_free(&host_that_restart);
xbt_dynar_free(&surf_path);
*********/
Model::Model(string name)
- : m_name(name), m_resOnCB(0), m_resOffCB(0),
- m_actSuspendCB(0), m_actCancelCB(0), m_actResumeCB(0),
- p_maxminSystem(0)
+ : p_maxminSystem(0), m_name(name),
+ m_resOnCB(0), m_resOffCB(0),
+ m_actCancelCB(0), m_actSuspendCB(0), m_actResumeCB(0)
{
ActionPtr action = NULL;
p_readyActionSet = xbt_swag_new(xbt_swag_offset(*action, p_stateHookup));
return min;
}
-double Model::shareResourcesFull(double now) {
+double Model::shareResourcesFull(double /*now*/) {
THROW_UNIMPLEMENTED;
}
xbt_die("Invalid cpu update mechanism!");
}
-void Model::updateActionsStateLazy(double now, double delta)
+void Model::updateActionsStateLazy(double /*now*/, double /*delta*/)
{
}
-void Model::updateActionsStateFull(double now, double delta)
+void Model::updateActionsStateFull(double /*now*/, double /*delta*/)
{
}
************/
Resource::Resource(surf_model_t model, const char *name, xbt_dict_t props)
- : m_name(xbt_strdup(name)), m_running(true), p_model(model), m_properties(props)
+ : m_name(xbt_strdup(name)), m_properties(props), p_model(model), m_running(true)
{}
-Resource::Resource(){
- //FIXME:free(m_name);
- //FIXME:xbt_dict_free(&m_properties);
-}
+Resource::Resource()
+: m_name(NULL), m_properties(NULL), p_model(NULL)
+{}
const char *Resource::getName()
{
}
}
-ResourceLmm::ResourceLmm(surf_model_t model, const char *name, xbt_dict_t props,
- lmm_system_t system,
+ResourceLmm::ResourceLmm(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)
- : Resource(model, name, props)
{
p_constraint = lmm_constraint_new(system, this, constraint_value);
p_stateCurrent = state_init;
p_power.peak = metric_peak;
if (metric_trace)
p_power.event = tmgr_history_add_trace(history, metric_trace, 0.0, 0, static_cast<ResourcePtr>(this));
+ else
+ p_power.event = NULL;
}
/**********
Action::Action(){}
Action::Action(ModelPtr model, double cost, bool failed):
- m_cost(cost), p_model(model), m_failed(failed), m_remains(cost),
- m_refcount(1), m_priority(1.0), m_maxDuration(NO_MAX_DURATION),
- m_start(surf_get_clock()), m_finish(-1.0)
+ m_priority(1.0),
+ m_failed(failed),
+ m_start(surf_get_clock()), m_finish(-1.0),
+ m_remains(cost),
+ m_maxDuration(NO_MAX_DURATION),
+ m_cost(cost),
+ p_model(model),
+ m_refcount(1),
+ p_data(NULL)
{
#ifdef HAVE_TRACING
p_category = NULL;