return ready_tasks;
}
-static double finish_on_at(SD_task_t task, const_sg_host_t host)
+static double finish_on_at(const_SD_task_t task, const_sg_host_t host)
{
double result;
return result;
}
-static sg_host_t SD_task_get_best_host(SD_task_t task)
+static sg_host_t SD_task_get_best_host(const_SD_task_t task)
{
sg_host_t *hosts = sg_host_list();
int nhosts = sg_host_count();
XBT_PUBLIC void* sg_actor_self_data();
XBT_PUBLIC void sg_actor_self_data_set(void* data);
XBT_PUBLIC void sg_actor_self_execute(double flops);
-XBT_PUBLIC void sg_actor_ref(sg_actor_t actor);
-XBT_PUBLIC void sg_actor_unref(sg_actor_t actor);
+XBT_PUBLIC void sg_actor_ref(const_sg_actor_t actor);
+XBT_PUBLIC void sg_actor_unref(const_sg_actor_t actor);
XBT_PUBLIC void* sg_actor_data(const_sg_actor_t actor);
XBT_PUBLIC void sg_actor_data_set(sg_actor_t actor, void* userdata);
std::vector<sg_host_t> resource_list;
void add_child(Container* child);
void add_resources(std::vector<sg_host_t> hosts);
- void create_hierarchy(sg_netzone_t from_as);
+ void create_hierarchy(const_sg_netzone_t from_as);
std::vector<int> get_hierarchy();
std::string get_hierarchy_as_string();
void print(FILE *file);
#include <simgrid/simdag.h>
SG_BEGIN_DECL
-XBT_PUBLIC void jedule_log_sd_event(SD_task_t task);
+XBT_PUBLIC void jedule_log_sd_event(const_SD_task_t task);
XBT_PUBLIC void jedule_sd_init(void);
XBT_PUBLIC void jedule_sd_exit(void);
XBT_PUBLIC void jedule_sd_dump(const char* filename);
typedef sg_netzone_t msg_netzone_t;
XBT_PUBLIC msg_netzone_t MSG_zone_get_root();
-XBT_PUBLIC const char* MSG_zone_get_name(msg_netzone_t zone);
+XBT_PUBLIC const char* MSG_zone_get_name(const_sg_netzone_t zone);
XBT_PUBLIC msg_netzone_t MSG_zone_get_by_name(const char* name);
-XBT_PUBLIC void MSG_zone_get_sons(msg_netzone_t zone, xbt_dict_t whereto);
-XBT_PUBLIC const char* MSG_zone_get_property_value(msg_netzone_t zone, const char* name);
-XBT_PUBLIC void MSG_zone_set_property_value(msg_netzone_t zone, const char* name, char* value);
-XBT_PUBLIC void MSG_zone_get_hosts(msg_netzone_t zone, xbt_dynar_t whereto);
+XBT_PUBLIC void MSG_zone_get_sons(const_sg_netzone_t zone, xbt_dict_t whereto);
+XBT_PUBLIC const char* MSG_zone_get_property_value(const_sg_netzone_t zone, const char* name);
+XBT_PUBLIC void MSG_zone_set_property_value(msg_netzone_t zone, const char* name, const char* value);
+XBT_PUBLIC void MSG_zone_get_hosts(const_sg_netzone_t zone, xbt_dynar_t whereto);
/* ******************************** Hosts ************************************ */
/** @brief Host datatype.
XBT_PUBLIC const char* MSG_vm_get_name(const_sg_vm_t vm);
XBT_PUBLIC void MSG_vm_set_ramsize(msg_vm_t vm, size_t size);
-XBT_PUBLIC size_t MSG_vm_get_ramsize(msg_vm_t vm);
-XBT_PUBLIC msg_host_t MSG_vm_get_pm(msg_vm_t vm);
+XBT_PUBLIC size_t MSG_vm_get_ramsize(const_sg_vm_t vm);
+XBT_PUBLIC msg_host_t MSG_vm_get_pm(const_sg_vm_t vm);
XBT_PUBLIC void MSG_vm_set_bound(msg_vm_t vm, double bound);
XBT_PUBLIC void MSG_vm_start(msg_vm_t vm);
/* ******************************** Storage ********************************* */
typedef sg_storage_t msg_storage_t;
-XBT_PUBLIC const char* MSG_storage_get_name(msg_storage_t storage);
+XBT_PUBLIC const char* MSG_storage_get_name(const_sg_storage_t storage);
XBT_PUBLIC msg_storage_t MSG_storage_get_by_name(const char* name);
-XBT_PUBLIC xbt_dict_t MSG_storage_get_properties(msg_storage_t storage);
+XBT_PUBLIC xbt_dict_t MSG_storage_get_properties(const_sg_storage_t storage);
XBT_PUBLIC void MSG_storage_set_property_value(msg_storage_t storage, const char* name, const char* value);
-XBT_PUBLIC const char* MSG_storage_get_property_value(msg_storage_t storage, const char* name);
+XBT_PUBLIC const char* MSG_storage_get_property_value(const_sg_storage_t storage, const char* name);
XBT_PUBLIC xbt_dynar_t MSG_storages_as_dynar();
XBT_PUBLIC void MSG_storage_set_data(msg_storage_t storage, void* data);
-XBT_PUBLIC void* MSG_storage_get_data(msg_storage_t storage);
-XBT_PUBLIC const char* MSG_storage_get_host(msg_storage_t storage);
+XBT_PUBLIC void* MSG_storage_get_data(const_sg_storage_t storage);
+XBT_PUBLIC const char* MSG_storage_get_host(const_sg_storage_t storage);
XBT_PUBLIC sg_size_t MSG_storage_read(msg_storage_t storage, sg_size_t size);
XBT_PUBLIC sg_size_t MSG_storage_write(msg_storage_t storage, sg_size_t size);
XBT_PUBLIC aid_t MSG_process_self_PID();
XBT_PUBLIC aid_t MSG_process_self_PPID();
XBT_PUBLIC const char* MSG_process_self_name();
-XBT_PUBLIC void MSG_process_ref(msg_process_t process);
-XBT_PUBLIC void MSG_process_unref(msg_process_t process);
+XBT_PUBLIC void MSG_process_ref(const_sg_actor_t process);
+XBT_PUBLIC void MSG_process_unref(const_sg_actor_t process);
/** @brief Object representing an ongoing communication between processes.
*
XBT_PUBLIC int MSG_sem_acquire_timeout(msg_sem_t sem, double timeout);
XBT_PUBLIC void MSG_sem_release(msg_sem_t sem);
XBT_PUBLIC int MSG_sem_get_capacity(msg_sem_t sem);
-XBT_PUBLIC void MSG_sem_destroy(msg_sem_t sem);
+XBT_PUBLIC void MSG_sem_destroy(const_sg_sem_t sem);
XBT_PUBLIC int MSG_sem_would_block(msg_sem_t sem);
/** @brief Opaque type representing a barrier identifier */
std::cv_status wait_until(const std::unique_lock<Mutex>& lock, double timeout_time);
std::cv_status wait_for(const std::unique_lock<Mutex>& lock, double duration);
- template <class P> bool wait_until(std::unique_lock<Mutex> & lock, double timeout_time, P pred)
+ template <class P> bool wait_until(const std::unique_lock<Mutex>& lock, double timeout_time, P pred)
{
while (not pred())
if (this->wait_until(lock, timeout_time) == std::cv_status::timeout)
};
#ifndef DOXYGEN /* Internal use only, no need to expose it */
-template <class T> XBT_PRIVATE void get_filtered_netzones_recursive(s4u::NetZone* current, std::vector<T*>* whereto)
+template <class T>
+XBT_PRIVATE void get_filtered_netzones_recursive(const s4u::NetZone* current, std::vector<T*>* whereto)
{
static_assert(std::is_base_of<kernel::routing::NetZoneImpl, T>::value,
"Filtering netzones is only possible for subclasses of kernel::routing::NetZoneImpl");
void shutdown();
void destroy() override;
- Host* get_pm();
+ Host* get_pm() const;
void set_pm(Host* pm);
- size_t get_ramsize();
+ size_t get_ramsize() const;
void set_ramsize(size_t ramsize);
void set_bound(double bound);
XBT_PUBLIC const char* sg_vm_get_name(const_sg_vm_t vm);
XBT_PUBLIC void sg_vm_set_ramsize(sg_vm_t vm, size_t size);
-XBT_PUBLIC size_t sg_vm_get_ramsize(sg_vm_t vm);
+XBT_PUBLIC size_t sg_vm_get_ramsize(const_sg_vm_t vm);
XBT_PUBLIC void sg_vm_set_bound(sg_vm_t vm, double bound);
-XBT_PUBLIC sg_host_t sg_vm_get_pm(sg_vm_t vm);
+XBT_PUBLIC sg_host_t sg_vm_get_pm(const_sg_vm_t vm);
XBT_PUBLIC void sg_vm_start(sg_vm_t vm);
XBT_PUBLIC void sg_vm_suspend(sg_vm_t vm);
JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getSons(JNIEnv * env, jobject jas) {
int index = 0;
jobjectArray jtable;
- sg_netzone_t self_as = jnetzone_get_native(env, jas);
+ const simgrid::s4u::NetZone* self_as = jnetzone_get_native(env, jas);
jclass cls = env->FindClass("org/simgrid/msg/As");
}
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getProperty(JNIEnv *env, jobject jas, jobject jname) {
- simgrid::s4u::NetZone* as = jnetzone_get_native(env, jas);
+ const simgrid::s4u::NetZone* as = jnetzone_get_native(env, jas);
if (not as) {
jxbt_throw_notbound(env, "as", jas);
jobjectArray jtable;
jobject jhost;
jstring jname;
- simgrid::s4u::NetZone* as = jnetzone_get_native(env, jas);
+ const simgrid::s4u::NetZone* as = jnetzone_get_native(env, jas);
jclass cls = jxbt_get_class(env, "org/simgrid/msg/Host");
if (not cls)
JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getAttachedStorage(JNIEnv * env, jobject jhost)
{
- msg_host_t host = jhost_get_native(env, jhost);
+ const_sg_host_t host = jhost_get_native(env, jhost);
if (not host) {
jxbt_throw_notbound(env, "host", jhost);
}
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getProperty(JNIEnv *env, jobject jstorage, jobject jname) {
- msg_storage_t storage = jstorage_get_native(env, jstorage);
+ const_sg_storage_t storage = jstorage_get_native(env, jstorage);
if (not storage) {
jxbt_throw_notbound(env, "storage", jstorage);
}
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getHost(JNIEnv * env,jobject jstorage) {
- msg_storage_t storage = jstorage_get_native(env, jstorage);
+ const_sg_storage_t storage = jstorage_get_native(env, jstorage);
if (not storage) {
jxbt_throw_notbound(env, "storage", jstorage);
}
JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_nativeFinalize(JNIEnv * env, jobject obj) {
- sg_mutex_t mutex = (sg_mutex_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Mutex_bind);
+ const_sg_mutex_t mutex = (sg_mutex_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Mutex_bind);
sg_mutex_destroy(mutex);
}
}
JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_nativeFinalize(JNIEnv * env, jobject obj) {
- sg_sem_t sem;
+ const_sg_sem_t sem;
sem = (sg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
sg_sem_destroy(sem);
*/
static int l_host_get_property_value(lua_State * L)
{
- sg_host_t ht = sglua_check_host(L, 1);
+ const_sg_host_t ht = sglua_check_host(L, 1);
const char *prop = luaL_checkstring(L, 2);
lua_pushstring(L, sg_host_get_property_value(ht,prop));
return 1;
XBT_DEBUG(" linkContainers %s <-> %s", src->get_cname(), dst->get_cname());
}
-static void recursiveGraphExtraction(simgrid::s4u::NetZone* netzone, container_t container,
+static void recursiveGraphExtraction(const simgrid::s4u::NetZone* netzone, container_t container,
std::set<std::string>* filter)
{
if (not TRACE_platform_topology()) {
#define GRAPHICATOR_SUPPORT_FUNCTIONS
static void recursiveXBTGraphExtraction(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
- std::map<std::string, xbt_edge_t>* edges, sg_netzone_t netzone,
+ std::map<std::string, xbt_edge_t>* edges, const_sg_netzone_t netzone,
container_t container)
{
if (not netzone->get_children().empty()) {
XBT_PRIVATE void TRACE_smpi_recv(int src, int dst, int tag);
XBT_PRIVATE void TRACE_smpi_init(int rank);
/* SMPI + LB (load balancer) */
-XBT_PRIVATE void TRACE_smpi_process_change_host(int rank, sg_host_t new_host);
+XBT_PRIVATE void TRACE_smpi_process_change_host(int rank, const_sg_host_t new_host);
class smpi_trace_call_location_t {
public:
}
}
-void Container::create_hierarchy(sg_netzone_t from_as)
+void Container::create_hierarchy(const_sg_netzone_t from_as)
{
if (from_as->get_children().empty()) {
// I am no AS
jedule_t my_jedule;
-void jedule_log_sd_event(SD_task_t task)
+void jedule_log_sd_event(const_SD_task_t task)
{
xbt_assert(task != nullptr);
void jedule_sd_init()
{
- sg_netzone_t root_comp = simgrid::s4u::Engine::get_instance()->get_netzone_root();
+ const_sg_netzone_t root_comp = simgrid::s4u::Engine::get_instance()->get_netzone_root();
XBT_DEBUG("root name %s\n", root_comp->get_cname());
my_jedule = new simgrid::jedule::Jedule(root_comp->get_name());
}
/** @brief Take an extra reference on that process to prevent it to be garbage-collected */
-void MSG_process_ref(msg_process_t process)
+void MSG_process_ref(const_sg_actor_t process)
{
sg_actor_ref(process);
}
/** @brief Release a reference on that process so that it can get be garbage-collected */
-void MSG_process_unref(msg_process_t process)
+void MSG_process_unref(const_sg_actor_t process)
{
sg_actor_unref(process);
}
{
return sg_zone_get_root();
}
-const char* MSG_zone_get_name(sg_netzone_t zone)
+const char* MSG_zone_get_name(const_sg_netzone_t zone)
{
return sg_zone_get_name(zone);
}
{
return sg_zone_get_by_name(name);
}
-void MSG_zone_get_sons(sg_netzone_t zone, xbt_dict_t whereto)
+void MSG_zone_get_sons(const_sg_netzone_t zone, xbt_dict_t whereto)
{
return sg_zone_get_sons(zone, whereto);
}
-const char* MSG_zone_get_property_value(sg_netzone_t zone, const char* name)
+const char* MSG_zone_get_property_value(const_sg_netzone_t zone, const char* name)
{
return sg_zone_get_property_value(zone, name);
}
-void MSG_zone_set_property_value(sg_netzone_t zone, const char* name, char* value)
+void MSG_zone_set_property_value(sg_netzone_t zone, const char* name, const char* value)
{
sg_zone_set_property_value(zone, name, value);
}
-void MSG_zone_get_hosts(sg_netzone_t zone, xbt_dynar_t whereto)
+void MSG_zone_get_hosts(const_sg_netzone_t zone, xbt_dynar_t whereto)
{
sg_zone_get_hosts(zone, whereto);
}
/* ************************** Storages *************************** */
-const char* MSG_storage_get_name(sg_storage_t storage)
+const char* MSG_storage_get_name(const_sg_storage_t storage)
{
return sg_storage_get_name(storage);
}
{
return sg_storage_get_by_name(name);
}
-xbt_dict_t MSG_storage_get_properties(sg_storage_t storage)
+xbt_dict_t MSG_storage_get_properties(const_sg_storage_t storage)
{
return sg_storage_get_properties(storage);
}
{
sg_storage_set_property_value(storage, name, value);
}
-const char* MSG_storage_get_property_value(sg_storage_t storage, const char* name)
+const char* MSG_storage_get_property_value(const_sg_storage_t storage, const char* name)
{
return sg_storage_get_property_value(storage, name);
}
{
sg_storage_set_data(storage, data);
}
-void* MSG_storage_get_data(sg_storage_t storage)
+void* MSG_storage_get_data(const_sg_storage_t storage)
{
return sg_storage_get_data(storage);
}
-const char* MSG_storage_get_host(sg_storage_t storage)
+const char* MSG_storage_get_host(const_sg_storage_t storage)
{
return sg_storage_get_host(storage);
}
{
sg_vm_set_ramsize(vm, size);
}
-size_t MSG_vm_get_ramsize(sg_vm_t vm)
+size_t MSG_vm_get_ramsize(const_sg_vm_t vm)
{
return sg_vm_get_ramsize(vm);
}
-sg_host_t MSG_vm_get_pm(sg_vm_t vm)
+sg_host_t MSG_vm_get_pm(const_sg_vm_t vm)
{
return sg_vm_get_pm(vm);
}
{
return sg_sem_get_capacity(sem);
}
-void MSG_sem_destroy(sg_sem_t sem)
+void MSG_sem_destroy(const_sg_sem_t sem)
{
sg_sem_destroy(sem);
}
size_t longest_prefix_length = 0;
if (local_storage_) {
/* Find the host that owns the storage where the file has to be copied */
- Storage* storage_dest = nullptr;
+ const Storage* storage_dest = nullptr;
for (auto const& elm : host->get_mounted_storages()) {
std::string mount_point = std::string(fullpath).substr(0, elm.first.size());
simgrid::s4u::Host* host = cpu->get_host();
if (host != nullptr) {
// If it's a VM, take the corresponding PM
- simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
+ const simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
if (vm) // If it's a VM, take the corresponding PM
host = vm->get_pm();
simgrid::s4u::Exec::on_start.connect([](simgrid::s4u::Actor const&, simgrid::s4u::Exec const& activity) {
if (activity.get_host_number() == 1) { // We only run on one host
simgrid::s4u::Host* host = activity.get_host();
- simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
+ const simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
if (vm != nullptr)
host = vm->get_pm();
xbt_assert(host != nullptr);
simgrid::s4u::Exec::on_start.connect([](simgrid::s4u::Actor const&, simgrid::s4u::Exec const& activity) {
if (activity.get_host_number() == 1) { // We only run on one host
simgrid::s4u::Host* host = activity.get_host();
- simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
+ const simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
if (vm != nullptr)
host = vm->get_pm();
xbt_assert(host != nullptr);
simgrid::s4u::Exec::on_completion.connect([](simgrid::s4u::Actor const&, simgrid::s4u::Exec const& activity) {
if (activity.get_host_number() == 1) { // We only run on one host
simgrid::s4u::Host* host = activity.get_host();
- simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
+ const simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
if (vm != nullptr)
host = vm->get_pm();
xbt_assert(host != nullptr);
/** @brief Get the physical host on which the given VM is running */
s4u::Host* get_physical_host() { return physical_host_; }
- sg_size_t get_ramsize() { return ramsize_; }
+ sg_size_t get_ramsize() const { return ramsize_; }
void set_ramsize(sg_size_t ramsize) { ramsize_ = ramsize; }
- s4u::VirtualMachine::state get_state() { return vm_state_; }
+ s4u::VirtualMachine::state get_state() const { return vm_state_; }
void set_state(s4u::VirtualMachine::state state) { vm_state_ = state; }
int get_core_amount() { return core_amount_; }
Host::destroy();
}
-simgrid::s4u::Host* VirtualMachine::get_pm()
+simgrid::s4u::Host* VirtualMachine::get_pm() const
{
return pimpl_vm_->get_physical_host();
}
return kernel::actor::simcall([this]() { return pimpl_vm_->get_state(); });
}
-size_t VirtualMachine::get_ramsize()
+size_t VirtualMachine::get_ramsize() const
{
return pimpl_vm_->get_ramsize();
}
}
/** @brief Get the physical host of a given VM. */
-sg_host_t sg_vm_get_pm(sg_vm_t vm)
+sg_host_t sg_vm_get_pm(const_sg_vm_t vm)
{
return vm->get_pm();
}
vm->set_ramsize(size);
}
-size_t sg_vm_get_ramsize(sg_vm_t vm)
+size_t sg_vm_get_ramsize(const_sg_vm_t vm)
{
return vm->get_ramsize();
}
}
/** @brief Take an extra reference on that actor to prevent it to be garbage-collected */
-void sg_actor_ref(sg_actor_t actor)
+void sg_actor_ref(const_sg_actor_t actor)
{
intrusive_ptr_add_ref(actor);
}
/** @brief Release a reference on that actor so that it can get be garbage-collected */
-void sg_actor_unref(sg_actor_t actor)
+void sg_actor_unref(const_sg_actor_t actor)
{
intrusive_ptr_release(actor);
}
/* Ensure that transfer tasks have unique names even though a file is used several times */
void uniq_transfer_task_name(SD_task_t task)
{
- SD_task_t child = *(task->successors->begin());
- SD_task_t parent = *(task->predecessors->begin());
+ const_SD_task_t child = *(task->successors->begin());
+ const_SD_task_t parent = *(task->predecessors->begin());
std::string new_name =
std::string(SD_task_get_name(parent)) + "_" + SD_task_get_name(task) + "_" + SD_task_get_name(child);
}
/**************** Functions to trace the migration of tasks. *****************/
-void TRACE_smpi_process_change_host(int rank, sg_host_t new_host)
+void TRACE_smpi_process_change_host(int rank, const_sg_host_t new_host)
{
if (not TRACE_smpi_is_enabled()) return;
static simgrid::mc::RemoteClient* process;
-static uintptr_t eval_binary_operation(simgrid::dwarf::ExpressionContext& state, int op, uintptr_t a, uintptr_t b)
+static uintptr_t eval_binary_operation(simgrid::dwarf::ExpressionContext const& state, int op, uintptr_t a, uintptr_t b)
{
Dwarf_Op ops[15];
ops[0].atom = DW_OP_const8u;
static void vm_migrate(msg_vm_t vm, msg_host_t dst_pm)
{
- msg_host_t src_pm = MSG_vm_get_pm(vm);
+ const_sg_host_t src_pm = MSG_vm_get_pm(vm);
double mig_sta = MSG_get_clock();
MSG_vm_migrate(vm, dst_pm);
double mig_end = MSG_get_clock();
return 0;
}
-static void vm_migrate_async(const_sg_vm_t vm, msg_host_t dst_pm)
+static void vm_migrate_async(const_sg_vm_t vm, const_sg_host_t dst_pm)
{
const char* vm_name = MSG_vm_get_name(vm);
const char* dst_pm_name = MSG_host_get_name(dst_pm);
sg_size_t write = MSG_file_write(file, MSG_file_get_size(file) * 1024);
XBT_INFO("Have written %llu bytes to '%s'.", write, filename);
- msg_host_t src = MSG_host_self();
+ const_sg_host_t src = MSG_host_self();
msg_host_t dest = MSG_host_by_name(argv[3]);
if (xbt_str_parse_int(argv[5], "Argument 5 (move or copy) must be an int, not '%s'")) {
XBT_INFO("Move '%s' (of size %llu) from '%s' to '%s'", filename, MSG_file_get_size(file), MSG_host_get_name(src),
int main(int argc, char** argv)
{
unsigned int cur;
- msg_storage_t st;
+ const_sg_storage_t st;
MSG_init(&argc, argv);
MSG_storage_file_system_init();
static int bob(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
/* this host also tests the properties of the AS*/
- msg_netzone_t root = MSG_zone_get_root();
+ const_sg_netzone_t root = MSG_zone_get_root();
XBT_INFO("== Print the properties of the AS");
XBT_INFO(" Process property: filename -> %s", MSG_zone_get_property_value(root, "filename"));
XBT_INFO(" Process property: date -> %s", MSG_zone_get_property_value(root, "date"));
return strcmp(sg_host_get_name(*(const sg_host_t*)n1), sg_host_get_name(*(const sg_host_t*)n2));
}
-static void scheduleDAX(xbt_dynar_t dax)
+static void scheduleDAX(const_xbt_dynar_t dax)
{
unsigned int cursor;
SD_task_t task;
unsigned int totalLinks = sg_link_count();
simgrid::s4u::Link** links = sg_link_list();
- std::sort(links, links + totalLinks,
- [](simgrid::s4u::Link* a, simgrid::s4u::Link* b) { return strcmp(sg_link_name(a), sg_link_name(b)) < 0; });
+ std::sort(links, links + totalLinks, [](const simgrid::s4u::Link* a, const simgrid::s4u::Link* b) {
+ return strcmp(sg_link_name(a), sg_link_name(b)) < 0;
+ });
for (unsigned int i = 0; i < totalLinks; i++) {
- simgrid::s4u::Link* link = links[i];
+ const simgrid::s4u::Link* link = links[i];
std::printf(" <link id=\"");
std::printf("%s\" bandwidth=\"%.0f\" latency=\"%.9f\"", link->get_cname(), link->get_bandwidth(), link->get_latency());
unsigned int totalHosts = sg_host_count();
sg_host_t* hosts = sg_host_list();
std::sort(hosts, hosts + totalHosts,
- [](sg_host_t a, sg_host_t b) { return strcmp(sg_host_get_name(a), sg_host_get_name(b)) < 0; });
+ [](const_sg_host_t a, const_sg_host_t b) { return strcmp(sg_host_get_name(a), sg_host_get_name(b)) < 0; });
std::vector<simgrid::kernel::routing::NetPoint*> netpoints =
simgrid::s4u::Engine::get_instance()->get_all_netpoints();
std::sort(netpoints.begin(), netpoints.end(),