-/* Copyright (c) 2016. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2016-2017. 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. */
virtual ~EngineImpl();
kernel::routing::NetZoneImpl* netRoot_ = nullptr;
-protected:
+private:
std::unordered_map<std::string, simgrid::kernel::routing::NetPoint*> netpoints_;
friend simgrid::s4u::Engine;
};
* preserve the signal mask when switching. This saves a system call (at least on Linux) on each context switch.
*/
class RawContext : public Context {
-protected:
+private:
void* stack_ = nullptr;
/** pointer to top the stack stack */
void* stack_top_ = nullptr;
+
public:
friend class RawContextFactory;
RawContext(std::function<void()> code,
int dp_enabled = 0;
double dp_updated_by_deleted_tasks = 0;
-protected:
- simgrid::s4u::Host* hostPM_;
-
public:
e_surf_vm_state_t getState();
void setState(e_surf_vm_state_t state);
bool isMigrating = false;
private:
+ simgrid::s4u::Host* hostPM_;
s_vm_params_t params_;
int coreAmount_;
-
-protected:
e_surf_vm_state_t vmState_ = SURF_VM_STATE_CREATED;
};
class Topo {
public:
virtual ~Topo()=default;
- protected:
- MPI_Comm comm_;
+ MPI_Comm getComm() const { return comm_; }
+ void setComm(MPI_Comm comm) { comm_ = comm; }
+ private:
+ MPI_Comm comm_;
};
*comm_cart = MPI_COMM_NULL;
}
}
- comm_=*comm_cart;
+ setComm(*comm_cart);
}
Topo_Cart* Topo_Cart::sub(const int remain_dims[], MPI_Comm *newcomm) {
}
}
}
- return new Topo_Cart(comm_, newNDims, newDims, newPeriodic, 0, newcomm);
+ return new Topo_Cart(getComm(), newNDims, newDims, newPeriodic, 0, newcomm);
}
int Topo_Cart::coords(int rank, int maxdims, int coords[]) {
return MPI_ERR_DIMS;
}
- this->coords(comm_->rank(),ndims_, position);
+ this->coords(getComm()->rank(), ndims_, position);
position[direction] += disp;
if(position[direction] < 0 ||
// **** ConfigurationElement ****
class ConfigurationElement {
-protected:
+private:
std::string key;
std::string desc;
bool isdefault = true;
{
dynamic_cast<TypedConfigurationElement<T>&>(*this).setDefaultValue(std::move(value));
}
+ void unsetDefault() { isdefault = false; }
bool isDefault() const { return isdefault; }
std::string const& getDescription() const { return desc; }
void update()
{
if (old_callback)
- this->old_callback(key.c_str());
+ this->old_callback(getKey().c_str());
if (this->callback)
this->callback(this->content);
}
void setDefaultValue(T value)
{
- if (this->isdefault) {
+ if (this->isDefault()) {
this->content = std::move(value);
this->update();
} else {
- XBT_DEBUG("Do not override configuration variable '%s' with value '%s' because it was already set.", key.c_str(),
- to_string(value).c_str());
+ XBT_DEBUG("Do not override configuration variable '%s' with value '%s' because it was already set.",
+ getKey().c_str(), to_string(value).c_str());
}
}
};
void TypedConfigurationElement<T>::setStringValue(const char* value) // override
{
this->content = ConfigType<T>::parse(value);
- this->isdefault = false;
+ this->unsetDefault();
this->update();
}