From: Arnaud Giersch Date: Thu, 10 Dec 2020 20:24:29 +0000 (+0100) Subject: Don't define (nor use) any MSG symbol when MSG is not built in. X-Git-Tag: v3.26~18 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8c1bb9876d01938d54708e9c20d7a69ac613f302?hp=ee6a764f17a132153060b0956781f59077b9d02f Don't define (nor use) any MSG symbol when MSG is not built in. --- diff --git a/examples/s4u/cloud-capping/s4u-cloud-capping.cpp b/examples/s4u/cloud-capping/s4u-cloud-capping.cpp index b39b519125..e2c1e67ca4 100644 --- a/examples/s4u/cloud-capping/s4u-cloud-capping.cpp +++ b/examples/s4u/cloud-capping/s4u-cloud-capping.cpp @@ -227,7 +227,7 @@ static void master_main() XBT_INFO("# 10. (c) migrate"); simgrid::s4u::Host* pm1 = simgrid::s4u::Host::by_name("Fafard"); - MSG_vm_migrate(vm0, pm1); + sg_vm_migrate(vm0, pm1); XBT_INFO(" "); XBT_INFO("# 10. (d) Put an activity again on the VM."); diff --git a/include/simgrid/plugins/dvfs.h b/include/simgrid/plugins/dvfs.h index 3f7ed88e74..d3819692b9 100644 --- a/include/simgrid/plugins/dvfs.h +++ b/include/simgrid/plugins/dvfs.h @@ -14,7 +14,9 @@ SG_BEGIN_DECL XBT_PUBLIC void sg_host_dvfs_plugin_init(); +#if SIMGRID_HAVE_MSG #define MSG_host_dvfs_plugin_init() sg_host_dvfs_plugin_init() +#endif // SIMGRID_HAVE_MSG SG_END_DECL diff --git a/include/simgrid/plugins/energy.h b/include/simgrid/plugins/energy.h index a9f4ae1c5b..800c7526e7 100644 --- a/include/simgrid/plugins/energy.h +++ b/include/simgrid/plugins/energy.h @@ -28,6 +28,8 @@ XBT_PUBLIC int sg_link_energy_is_inited(); XBT_PUBLIC void sg_wifi_energy_plugin_init(); +#if SIMGRID_HAVE_MSG + #define MSG_host_energy_plugin_init() sg_host_energy_plugin_init() #define MSG_host_get_consumed_energy(host) sg_host_get_consumed_energy(host) #define MSG_host_get_idle_consumption_at(host,pstate) sg_host_get_idle_consumption_at((host), (pstate)) @@ -36,6 +38,8 @@ XBT_PUBLIC void sg_wifi_energy_plugin_init(); #define MSG_host_get_power_range_slope_at(host,pstate) sg_host_get_power_range_slope_at((host), (pstate)) #define MSG_host_get_current_consumption(host) sg_host_get_current_consumption(host) +#endif // SIMGRID_HAVE_MSG + SG_END_DECL #endif diff --git a/include/simgrid/plugins/file_system.h b/include/simgrid/plugins/file_system.h index 835f63e224..aa768f146d 100644 --- a/include/simgrid/plugins/file_system.h +++ b/include/simgrid/plugins/file_system.h @@ -20,7 +20,6 @@ // C interface //////////////// -typedef sg_file_t msg_file_t; // MSG backwards compatibility SG_BEGIN_DECL XBT_PUBLIC void sg_storage_file_system_init(); @@ -53,6 +52,10 @@ XBT_PUBLIC xbt_dict_t sg_storage_get_content(const_sg_storage_t storage); XBT_PUBLIC xbt_dict_t sg_host_get_storage_content(sg_host_t host); +#if SIMGRID_HAVE_MSG + +typedef sg_file_t msg_file_t; // MSG backwards compatibility + #define MSG_file_open(fullpath, data) sg_file_open((fullpath), (data)) #define MSG_file_read(fd, size) sg_file_read((fd), (size)) #define MSG_file_write(fd, size) sg_file_write((fd), (size)) @@ -77,6 +80,8 @@ XBT_PUBLIC xbt_dict_t sg_host_get_storage_content(sg_host_t host); #define MSG_host_get_storage_content(st) sg_host_get_storage_content(st) +#endif // SIMGRID_HAVE_MSG + SG_END_DECL // C++ interface diff --git a/include/simgrid/plugins/live_migration.h b/include/simgrid/plugins/live_migration.h index 4b32738f3e..7afe4b7be7 100644 --- a/include/simgrid/plugins/live_migration.h +++ b/include/simgrid/plugins/live_migration.h @@ -28,6 +28,8 @@ XBT_PUBLIC int sg_vm_is_migrating(const_sg_vm_t vm); XBT_PUBLIC sg_vm_t sg_vm_create_migratable(sg_host_t pm, const char* name, int coreAmount, int ramsize, int mig_netspeed, int dp_intensity); +#if SIMGRID_HAVE_MSG + #define MSG_vm_live_migration_plugin_init() sg_vm_live_migration_plugin_init() #define MSG_vm_create_migratable(pm, name, coreAmount, ramsize, mig_netspeed, dp_intensity) \ @@ -36,6 +38,8 @@ XBT_PUBLIC sg_vm_t sg_vm_create_migratable(sg_host_t pm, const char* name, int c #define MSG_vm_is_migrating(vm) sg_vm_is_migrating(vm) #define MSG_vm_migrate(vm, dst_pm) sg_vm_migrate((vm), (dst_pm)) +#endif // SIMGRID_HAVE_MSG + SG_END_DECL #endif diff --git a/include/simgrid/plugins/load.h b/include/simgrid/plugins/load.h index a9e3f91b13..16c067996b 100644 --- a/include/simgrid/plugins/load.h +++ b/include/simgrid/plugins/load.h @@ -28,6 +28,8 @@ XBT_PUBLIC double sg_link_get_avg_load(const_sg_link_t link); XBT_PUBLIC double sg_link_get_min_instantaneous_load(const_sg_link_t link); XBT_PUBLIC double sg_link_get_max_instantaneous_load(const_sg_link_t link); +#if SIMGRID_HAVE_MSG + #define MSG_host_load_plugin_init() sg_host_load_plugin_init() /** @brief Returns the current load of that host, as a ratio = achieved_flops / (core_current_speed * core_amount) * @@ -37,6 +39,8 @@ XBT_PUBLIC double sg_link_get_max_instantaneous_load(const_sg_link_t link); #define MSG_host_get_computed_flops(host) sg_host_get_computed_flops(host) #define MSG_host_get_avg_load(host) sg_host_get_avg_load(host) +#endif // SIMGRID_HAVE_MSG + SG_END_DECL #endif