XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_ti, surf_cpu,
"Logging specific to the SURF CPU TRACE INTEGRATION module");
-static void cpu_ti_action_update_index_heap(void *action, int i);
+namespace simgrid {
+namespace surf {
+
+static inline
+void cpu_ti_action_update_index_heap(void *action, int i)
+{
+ ((simgrid::surf::CpuTiAction*)action)->updateIndexHeap(i);
+}
/*********
* Trace *
return low;
}
+}
+}
+
/*************
* CallBacks *
*************/
static void cpu_ti_define_callbacks()
{
- sg_platf_postparse_add_cb(cpu_add_traces);
+ sg_platf_postparse_add_cb(simgrid::surf::cpu_add_traces);
}
/*********
xbt_assert(!surf_cpu_model_pm,"CPU model already initialized. This should not happen.");
xbt_assert(!surf_cpu_model_vm,"CPU model already initialized. This should not happen.");
- surf_cpu_model_pm = new CpuTiModel();
- surf_cpu_model_vm = new CpuTiModel();
+ surf_cpu_model_pm = new simgrid::surf::CpuTiModel();
+ surf_cpu_model_vm = new simgrid::surf::CpuTiModel();
cpu_ti_define_callbacks();
- Model *model_pm = static_cast<Model*>(surf_cpu_model_pm);
- Model *model_vm = static_cast<Model*>(surf_cpu_model_vm);
+ simgrid::surf::Model *model_pm = static_cast<simgrid::surf::Model*>(surf_cpu_model_pm);
+ simgrid::surf::Model *model_vm = static_cast<simgrid::surf::Model*>(surf_cpu_model_vm);
xbt_dynar_push(all_existing_models, &model_pm);
xbt_dynar_push(all_existing_models, &model_vm);
}
+namespace simgrid {
+namespace surf {
+
CpuTiModel::CpuTiModel() : CpuModel()
{
p_runningActionSetThatDoesNotNeedBeingChecked = new ActionList();
tmgr_trace_t speedTrace,
int core,
e_surf_resource_state_t stateInitial,
- tmgr_trace_t stateTrace,
- xbt_dict_t cpuProperties)
+ tmgr_trace_t stateTrace)
{
xbt_assert(core==1,"Multi-core not handled with this model yet");
- sg_host_t host = sg_host_by_name(name);
xbt_assert(xbt_dynar_getfirst_as(speedPeak, double) > 0.0,
"Speed has to be >0.0. Did you forget to specify the mandatory speed attribute?");
CpuTi *cpu = new CpuTi(this, name, speedPeak, pstate, speedScale, speedTrace,
- core, stateInitial, stateTrace, cpuProperties);
- sg_host_surfcpu_register(host, cpu);
+ core, stateInitial, stateTrace);
return cpu;
}
************/
CpuTi::CpuTi(CpuTiModel *model, const char *name, xbt_dynar_t speedPeak,
int pstate, double speedScale, tmgr_trace_t speedTrace, int core,
- e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
- xbt_dict_t properties)
- : Cpu(model, name, properties, core, 0, speedScale, stateInitial)
+ e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace)
+ : Cpu(model, name, core, 0, speedScale, stateInitial)
{
p_speedEvent = NULL;
m_speedScale = speedScale;
* Action *
**********/
-static void cpu_ti_action_update_index_heap(void *action, int i)
-{
-((CpuTiAction*)action)->updateIndexHeap(i);
-}
-
CpuTiAction::CpuTiAction(CpuTiModel *model_, double cost, bool failed,
CpuTi *cpu)
: CpuAction(model_, cost, failed)
return m_remains;
}
-#endif /* SURF_MODEL_CPUTI_H_ */
+}
+}
+#endif /* SURF_MODEL_CPUTI_H_ */