-/* Copyright (c) 2009-2011, 2013-2015. The SimGrid Team.
+/* Copyright (c) 2009-2011, 2013-2016. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
*********/
void surf_cpu_model_init_Cas01()
{
- char *optim = xbt_cfg_get_string(_sg_cfg_set, "cpu/optim");
-
xbt_assert(!surf_cpu_model_pm);
xbt_assert(!surf_cpu_model_vm);
+ char *optim = xbt_cfg_get_string(_sg_cfg_set, "cpu/optim");
if (!strcmp(optim, "TI")) {
surf_cpu_model_init_ti();
return;
}
surf_cpu_model_pm = new simgrid::surf::CpuCas01Model();
+ xbt_dynar_push(all_existing_models, &surf_cpu_model_pm);
+
surf_cpu_model_vm = new simgrid::surf::CpuCas01Model();
+ xbt_dynar_push(all_existing_models, &surf_cpu_model_vm);
sg_platf_postparse_add_cb(simgrid::surf::cpu_add_traces);
-
- simgrid::surf::Model *model_pm = surf_cpu_model_pm;
- simgrid::surf::Model *model_vm = surf_cpu_model_vm;
- xbt_dynar_push(all_existing_models, &model_pm);
- xbt_dynar_push(all_existing_models, &model_vm);
}
namespace simgrid {
p_cpuRunningActionSetThatDoesNotNeedBeingChecked = new ActionList();
- if (getUpdateMechanism() == UM_LAZY) {
- shareResources = &CpuCas01Model::shareResourcesLazy;
- updateActionsState = &CpuCas01Model::updateActionsStateLazy;
-
- } else if (getUpdateMechanism() == UM_FULL) {
- shareResources = &CpuCas01Model::shareResourcesFull;
- updateActionsState = &CpuCas01Model::updateActionsStateFull;
- } else
- xbt_die("Invalid cpu update mechanism!");
-
- if (!p_maxminSystem) {
- p_maxminSystem = lmm_system_new(m_selectiveUpdate);
- }
+ p_maxminSystem = lmm_system_new(m_selectiveUpdate);
if (getUpdateMechanism() == UM_LAZY) {
p_actionHeap = xbt_heap_new(8, NULL);
return action;
}
-double CpuCas01::getCurrentPowerPeak()
-{
- return m_speedPeak;
-}
-
/**********
* Action *
**********/
-/* Copyright (c) 2013-2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2013-2016. The SimGrid Team. All rights reserved. */
/* 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. */
CpuCas01Model();
~CpuCas01Model();
- double (CpuCas01Model::*shareResources)(double now);
- void (CpuCas01Model::*updateActionsState)(double now, double delta);
-
Cpu *createCpu(simgrid::Host *host, xbt_dynar_t speedPeak, int pstate,
double speedScale,
tmgr_trace_t speedTrace, int core,
e_surf_resource_state_t state_initial,
- tmgr_trace_t state_trace);
- double shareResourcesFull(double now);
- void addTraces();
+ tmgr_trace_t state_trace) override;
+ double shareResourcesFull(double now) override;
+ void addTraces() override;
ActionList *p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
};
int pstate, double speedScale, tmgr_trace_t speedTrace, int core,
e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace) ;
~CpuCas01();
- void updateState(tmgr_trace_event_t event_type, double value, double date);
- CpuAction *execute(double size);
- CpuAction *sleep(double duration);
+ void updateState(tmgr_trace_event_t event_type, double value, double date) override;
+ CpuAction *execute(double size) override;
+ CpuAction *sleep(double duration) override;
- double getCurrentPowerPeak();
bool isUsed() override;
void setStateEvent(tmgr_trace_event_t stateEvent);
void setPowerEvent(tmgr_trace_event_t stateEvent);
- xbt_dynar_t getSpeedPeakList();
+ xbt_dynar_t getSpeedPeakList();
private:
+
tmgr_trace_event_t p_stateEvent;
tmgr_trace_event_t p_speedEvent;
};
-/* Copyright (c) 2004-2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2004-2016. The SimGrid Team. All rights reserved. */
/* 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. */
protected:
ActionLmmListPtr p_modifiedSet;
- lmm_system_t p_maxminSystem;
+ lmm_system_t p_maxminSystem = nullptr;
e_UM_t p_updateMechanism = UM_UNDEFINED;
int m_selectiveUpdate;
xbt_heap_t p_actionHeap;