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
cosmetics
[simgrid.git]
/
src
/
surf
/
cpu_interface.cpp
diff --git
a/src/surf/cpu_interface.cpp
b/src/surf/cpu_interface.cpp
index
2f1f7df
..
f9f6a12
100644
(file)
--- a/
src/surf/cpu_interface.cpp
+++ b/
src/surf/cpu_interface.cpp
@@
-22,7
+22,7
@@
namespace surf {
simgrid::xbt::Extension<simgrid::Host, Cpu> Cpu::EXTENSION_ID;
simgrid::xbt::Extension<simgrid::Host, Cpu> Cpu::EXTENSION_ID;
-void Cpu::
i
nit()
+void Cpu::
classI
nit()
{
if (!EXTENSION_ID.valid())
EXTENSION_ID = simgrid::Host::extension_create<simgrid::surf::Cpu>();
{
if (!EXTENSION_ID.valid())
EXTENSION_ID = simgrid::Host::extension_create<simgrid::surf::Cpu>();
@@
-38,10
+38,8
@@
Cpu *getActionCpu(CpuAction *action) {
action->getVariable(), 0)));
}
action->getVariable(), 0)));
}
-simgrid::surf::signal<void(Cpu*)> cpuCreatedCallbacks;
-simgrid::surf::signal<void(Cpu*)> cpuDestructedCallbacks;
-simgrid::surf::signal<void(Cpu*, e_surf_resource_state_t, e_surf_resource_state_t)> cpuStateChangedCallbacks;
simgrid::surf::signal<void(CpuAction*, e_surf_action_state_t, e_surf_action_state_t)> cpuActionStateChangedCallbacks;
simgrid::surf::signal<void(CpuAction*, e_surf_action_state_t, e_surf_action_state_t)> cpuActionStateChangedCallbacks;
+
void cpu_add_traces(){
surf_cpu_model_pm->addTraces();
}
void cpu_add_traces(){
surf_cpu_model_pm->addTraces();
}
@@
-191,15
+189,8
@@
Cpu::Cpu(Model *model, const char *name,
: Cpu(model, name, core, speedPeak, speedScale, SURF_RESOURCE_ON)
{}
: Cpu(model, name, core, speedPeak, speedScale, SURF_RESOURCE_ON)
{}
-void Cpu::onDie()
-{
- cpuDestructedCallbacks(this);
- Resource::onDie();
-}
-
Cpu::~Cpu()
{
Cpu::~Cpu()
{
- this->die();
if (p_constraintCoreId){
for (int i = 0; i < m_core; i++) {
xbt_free(p_constraintCoreId[i]);
if (p_constraintCoreId){
for (int i = 0; i < m_core; i++) {
xbt_free(p_constraintCoreId[i]);
@@
-231,22
+222,12
@@
int Cpu::getCore()
return m_core;
}
return m_core;
}
-void Cpu::setState(e_surf_resource_state_t state)
-{
- e_surf_resource_state_t old = Resource::getState();
- Resource::setState(state);
- cpuStateChangedCallbacks(this, old, state);
-}
-
void Cpu::plug(simgrid::Host* host)
{
if (this->m_host != nullptr)
xbt_die("Already plugged into host %s", host->id().c_str());
host->extension_set(this);
this->m_host = host;
void Cpu::plug(simgrid::Host* host)
{
if (this->m_host != nullptr)
xbt_die("Already plugged into host %s", host->id().c_str());
host->extension_set(this);
this->m_host = host;
- simgrid::surf::cpuCreatedCallbacks(this);
- simgrid::surf::cpuStateChangedCallbacks(this,
- SURF_RESOURCE_ON, this->getState());
}
/**********
}
/**********