Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't define (nor use) any MSG symbol when MSG is not built in.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 10 Dec 2020 20:24:29 +0000 (21:24 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 10 Dec 2020 20:55:39 +0000 (21:55 +0100)
examples/s4u/cloud-capping/s4u-cloud-capping.cpp
include/simgrid/plugins/dvfs.h
include/simgrid/plugins/energy.h
include/simgrid/plugins/file_system.h
include/simgrid/plugins/live_migration.h
include/simgrid/plugins/load.h

index b39b519..e2c1e67 100644 (file)
@@ -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.");
index 3f7ed88..d381969 100644 (file)
@@ -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
 
index a9f4ae1..800c752 100644 (file)
@@ -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
index 835f63e..aa768f1 100644 (file)
@@ -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
index 4b32738..7afe4b7 100644 (file)
@@ -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
index a9e3f91..16c0679 100644 (file)
@@ -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