XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process);
-simgrid::kernel::activity::Exec::Exec(const char*name, sg_host_t hostarg)
+simgrid::kernel::activity::Exec::Exec(const char*name, sg_host_t host) :
+ host_(host)
{
if (name)
this->name = name;
this->state = SIMIX_RUNNING;
- this->host = hostarg;
}
simgrid::kernel::activity::Exec::~Exec()
void simgrid::kernel::activity::Exec::post()
{
- if (host && host->isOff()) {/* FIMXE: handle resource failure for parallel tasks too */
+ if (host_ && host_->isOff()) {/* FIMXE: handle resource failure for parallel tasks too */
/* If the host running the synchro failed, notice it. This way, the asking
* process can be killed if it runs on that host itself */
state = SIMIX_FAILED;
void post() override;
double remains();
- sg_host_t host = nullptr; /* The host where the execution takes place. If nullptr, then this is a parallel exec (and only surf knows the hosts) */
+ sg_host_t host_ = nullptr; /* The host where the execution takes place. If nullptr, then this is a parallel exec (and only surf knows the hosts) */
surf_action_t surf_exec = nullptr; /* The Surf execution action encapsulated */
surf::Action* timeoutDetector = nullptr;
};
link.latency = cluster->lat;
link.policy = cluster->sharing_policy;
sg_platf_new_link(&link);
- Link *linkUp, *linkDown;
+ Link* linkUp;
+ Link* linkDown;
if (link.policy == SURF_LINK_FULLDUPLEX) {
char *tmp_link = bprintf("%s_UP", link_id);
linkUp = Link::byName(tmp_link);
namespace simgrid {
namespace s4u {
-File::File(const char*fullpath, void *userdata) {
+File::File(const char* fullpath, void* userdata) : path_(fullpath)
+{
// this cannot fail because we get a xbt_die if the mountpoint does not exist
pimpl_ = simcall_file_open(fullpath, Host::current());
- path_ = fullpath;
}
File::~File() {
namespace s4u {
boost::unordered_map <std::string, Storage *> *Storage::storages_ = new boost::unordered_map<std::string, Storage*> ();
-Storage::Storage(std::string name, smx_storage_t inferior) {
- name_ = name;
- pimpl_ = inferior;
-
+Storage::Storage(std::string name, smx_storage_t inferior) :
+ name_(name), pimpl_(inferior)
+{
storages_->insert({name, this});
}
-Storage::~Storage() {
- // TODO Auto-generated destructor stub
-}
+Storage::~Storage() = default;
smx_storage_t Storage::inferior() {
return pimpl_;
* \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;
}
type_ = TRACE_DYNAMIC;
- speedTrace_ = speedTrace;
/* count the total time of trace file */
- for (auto val: speedTrace->event_list) {
+ for (auto val : speedTrace->event_list)
total_time += val.delta;
- }
+
trace_ = new CpuTiTrace(speedTrace);
lastTime_ = total_time;
total_ = trace_->integrateSimple(0, total_time);
CpuTiAction::CpuTiAction(CpuTiModel *model_, double cost, bool failed, CpuTi *cpu)
: CpuAction(model_, cost, failed)
+ , cpu_(cpu)
{
- cpu_ = cpu;
- indexHeap_ = -1;
cpu_->modified(true);
}
double getRemains() override;
CpuTi *cpu_;
- int indexHeap_;
+ int indexHeap_ = -1;
int suspended_ = 0;
public:
boost::intrusive::list_member_hook<> action_ti_hook;
return new L07Action(this, host_nb, host_list, flops_amount, bytes_amount, rate);
}
-
L07Action::L07Action(Model *model, int host_nb, sg_host_t *host_list,
double *flops_amount, double *bytes_amount, double rate)
: CpuAction(model, 1, 0)
+ , computationAmount_(flops_amount)
+ , communicationAmount_(bytes_amount)
+ , rate_(rate)
{
int nb_link = 0;
int nb_used_host = 0; /* Only the hosts with something to compute (>0 flops) are counted) */
nb_used_host++;
XBT_DEBUG("Creating a parallel task (%p) with %d hosts and %d unique links.", this, host_nb, nb_link);
- this->computationAmount_ = flops_amount;
- this->communicationAmount_ = bytes_amount;
this->latency_ = latency;
- this->rate_ = rate;
this->variable_ = lmm_variable_new(model->getMaxminSystem(), this, 1.0,
(rate > 0 ? rate : -1.0),
}
//add a limiter link (shared link to account for maximal bandwidth of the node)
- linkUp = linkDown = nullptr;
+ linkUp = nullptr;
+ linkDown = nullptr;
if(cluster->limiter_link!=0){
char *tmp_link = bprintf("%s_limiter", link_id);
XBT_DEBUG("<limiter\tid=\"%s\"\tbw=\"%f\"/>", tmp_link, cluster->limiter_link);