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
remove surf_routing.hpp
[simgrid.git]
/
src
/
surf
/
cpu_ti.cpp
diff --git
a/src/surf/cpu_ti.cpp
b/src/surf/cpu_ti.cpp
index
90e5e85
..
6e9afb5
100644
(file)
--- a/
src/surf/cpu_ti.cpp
+++ b/
src/surf/cpu_ti.cpp
@@
-32,8
+32,8
@@
CpuTiTrace::CpuTiTrace(tmgr_trace_t speedTrace)
double time = 0;
int i = 0;
nbPoints_ = speedTrace->event_list.size() + 1;
double time = 0;
int i = 0;
nbPoints_ = speedTrace->event_list.size() + 1;
- timePoints_ =
static_cast<double*>(xbt_malloc0(sizeof(double) * nbPoints_))
;
- integral_ =
static_cast<double*>(xbt_malloc0(sizeof(double) * nbPoints_))
;
+ timePoints_ =
new double[nbPoints_]
;
+ integral_ =
new double[nbPoints_]
;
for (auto val : speedTrace->event_list) {
timePoints_[i] = time;
integral_[i] = integral;
for (auto val : speedTrace->event_list) {
timePoints_[i] = time;
integral_[i] = integral;
@@
-47,8
+47,8
@@
CpuTiTrace::CpuTiTrace(tmgr_trace_t speedTrace)
CpuTiTrace::~CpuTiTrace()
{
CpuTiTrace::~CpuTiTrace()
{
-
xbt_free(timePoints_)
;
-
xbt_free(integral_)
;
+
delete [] timePoints_
;
+
delete [] integral_
;
}
CpuTiTgmr::~CpuTiTgmr()
}
CpuTiTgmr::~CpuTiTgmr()
@@
-252,7
+252,8
@@
double CpuTiTgmr::getPowerScale(double a)
* \param value Percentage of CPU speed available (useful to fixed tracing)
* \return Integration trace structure
*/
* \param value Percentage of CPU speed available (useful to fixed tracing)
* \return Integration trace structure
*/
-CpuTiTgmr::CpuTiTgmr(tmgr_trace_t speedTrace, double value)
+CpuTiTgmr::CpuTiTgmr(tmgr_trace_t speedTrace, double value) :
+ speedTrace_(speedTrace)
{
double total_time = 0.0;
trace_ = 0;
{
double total_time = 0.0;
trace_ = 0;
@@
-274,12
+275,11
@@
CpuTiTgmr::CpuTiTgmr(tmgr_trace_t speedTrace, double value)
}
type_ = TRACE_DYNAMIC;
}
type_ = TRACE_DYNAMIC;
- speedTrace_ = speedTrace;
/* count the total time of trace file */
/* count the total time of trace file */
- for (auto val
: speedTrace->event_list) {
+ for (auto val
: speedTrace->event_list)
total_time += val.delta;
total_time += val.delta;
- }
+
trace_ = new CpuTiTrace(speedTrace);
lastTime_ = total_time;
total_ = trace_->integrateSimple(0, total_time);
trace_ = new CpuTiTrace(speedTrace);
lastTime_ = total_time;
total_ = trace_->integrateSimple(0, total_time);
@@
-360,7
+360,7
@@
Cpu *CpuTiModel::createCpu(simgrid::s4u::Host *host, std::vector<double>* speedP
return new CpuTi(this, host, speedPerPstate, core);
}
return new CpuTi(this, host, speedPerPstate, core);
}
-double CpuTiModel::next
_occuring_e
vent(double now)
+double CpuTiModel::next
OccuringE
vent(double now)
{
double min_action_duration = -1;
{
double min_action_duration = -1;
@@
-459,7
+459,7
@@
void CpuTi::apply_event(tmgr_trace_iterator_t event, double value)
} else if (event == stateEvent_) {
if (value > 0) {
if(isOff())
} else if (event == stateEvent_) {
if (value > 0) {
if(isOff())
-
xbt_dynar_push_as(host_that_restart, char*, (char *)getName
());
+
host_that_restart.push_back(getHost
());
turnOn();
} else {
turnOff();
turnOn();
} else {
turnOff();
@@
-669,9
+669,8
@@
void CpuTi::modified(bool modified){
CpuTiAction::CpuTiAction(CpuTiModel *model_, double cost, bool failed, CpuTi *cpu)
: CpuAction(model_, cost, failed)
CpuTiAction::CpuTiAction(CpuTiModel *model_, double cost, bool failed, CpuTi *cpu)
: CpuAction(model_, cost, failed)
+ , cpu_(cpu)
{
{
- cpu_ = cpu;
- indexHeap_ = -1;
cpu_->modified(true);
}
cpu_->modified(true);
}