simulation round, s/he has to allocate and free a dynar and use it as argument
to this function. The former SD_simulate (double how_long) now returns void.
+ MSG
+ - The netzone are now available from the MSG API.
+ The old names still work, but are now deprecated.
+
SMPI
- New algorithm to privatize globals: dlopen, with dynamic loading tricks
- New option: smpi/keep-temps to not cleanup temp files
static int bob(int argc, char *argv[])
{
/* this host also tests the properties of the AS*/
- msg_as_t root = MSG_environment_get_routing_root();
+ msg_as_t root = MSG_zone_get_root();
XBT_INFO("== Print the properties of the AS");
- XBT_INFO(" Process property: filename -> %s", MSG_environment_as_get_property_value(root, "filename"));
- XBT_INFO(" Process property: date -> %s", MSG_environment_as_get_property_value(root, "date"));
- XBT_INFO(" Process property: author -> %s", MSG_environment_as_get_property_value(root, "author"));
+ 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"));
+ XBT_INFO(" Process property: author -> %s", MSG_zone_get_property_value(root, "author"));
/* Get the property list of current bob process */
xbt_dict_t props = MSG_process_get_properties(MSG_process_self());
XBT_PUBLIC(double) MSG_get_clock();
XBT_PUBLIC(unsigned long int) MSG_get_sent_msg();
-/************************** Environment ***********************************/
-XBT_PUBLIC(msg_netzone_t) MSG_environment_get_routing_root();
-XBT_PUBLIC(const char*) MSG_environment_as_get_name(msg_netzone_t as);
-XBT_PUBLIC(msg_netzone_t) MSG_environment_as_get_by_name(const char* name);
-XBT_PUBLIC(xbt_dict_t) MSG_environment_as_get_routing_sons(msg_netzone_t as);
-XBT_PUBLIC(const char*) MSG_environment_as_get_property_value(msg_netzone_t as, const char* name);
-XBT_PUBLIC(void) MSG_environment_as_set_property_value(msg_netzone_t netzone, const char* name, char* value);
-XBT_PUBLIC(xbt_dynar_t) MSG_environment_as_get_hosts(msg_netzone_t as);
+/************************** Net Zones ***********************************/
+XBT_PUBLIC(msg_netzone_t) MSG_zone_get_root();
+XBT_PUBLIC(const char*) MSG_zone_get_name(msg_netzone_t zone);
+XBT_PUBLIC(msg_netzone_t) MSG_zone_get_by_name(const char* name);
+XBT_PUBLIC(xbt_dict_t) MSG_zone_get_sons(msg_netzone_t zone);
+XBT_PUBLIC(const char*) MSG_zone_get_property_value(msg_netzone_t as, const char* name);
+XBT_PUBLIC(void) MSG_zone_set_property_value(msg_netzone_t netzone, const char* name, char* value);
+XBT_PUBLIC(xbt_dynar_t) MSG_zone_get_hosts(msg_netzone_t zone);
+
+/* Deprecated forms of the previous functions */
+static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_root since v3.16")
+ msg_netzone_t MSG_environment_get_routing_root() {
+ return MSG_zone_get_root();
+}
+static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_name since v3.16")
+ const char* MSG_environment_as_get_name(msg_netzone_t zone) {
+ return MSG_zone_get_name(zone);
+}
+static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_by_name since v3.16")
+ msg_netzone_t MSG_environment_as_get_by_name(const char* name) {
+ return MSG_zone_get_by_name(name);
+}
+static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_sons since v3.16")
+ xbt_dict_t MSG_environment_as_get_routing_sons(msg_netzone_t zone) {
+ return MSG_zone_get_sons(zone);
+}
+static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_property_value since v3.16")
+ const char* MSG_environment_as_get_property_value(msg_netzone_t zone, const char* name) {
+ return MSG_zone_get_property_value(zone, name);
+}
+static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_set_property_value since v3.16")
+ void MSG_environment_as_set_property_value(msg_netzone_t zone, const char* name, char* value) {
+ MSG_zone_set_property_value(zone, name, value);
+}
+static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_hosts since v3.16")
+ xbt_dynar_t MSG_environment_as_get_hosts(msg_netzone_t zone) {
+ return MSG_zone_get_hosts(zone);
+}
/************************** File handling ***********************************/
XBT_PUBLIC(sg_size_t) MSG_file_read(msg_file_t fd, sg_size_t size);
__attribute__((__format__ (__scanf__, format_idx, arg_idx)))
#endif
-#define XBT_ATTRIB_NORETURN __attribute__((__noreturn__))
-#define XBT_ATTRIB_UNUSED __attribute__((__unused__))
-#define XBT_ATTRIB_DEPRECATED(m) __attribute__((__deprecated__(m)))
+#define XBT_ATTRIB_NORETURN __attribute__((noreturn))
+#define XBT_ATTRIB_UNUSED __attribute__((unused))
+#define XBT_ATTRIB_DEPRECATED(m) __attribute__((deprecated(m)))
/* Constructor priorities exist since gcc 4.3. Apparently, they are however not
* supported on Macs. */
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Msg_environmentGetRoutingRoot(JNIEnv * env, jclass cls)
{
- msg_netzone_t as = MSG_environment_get_routing_root();
+ msg_netzone_t as = MSG_zone_get_root();
jobject jas = jnetzone_new_instance(env);
if (!jas) {
jxbt_throw_jni(env, "java As instantiation failed");
}
const char *name = env->GetStringUTFChars(static_cast<jstring>(jname), 0);
- const char *property = MSG_environment_as_get_property_value(as, name);
+ const char* property = MSG_zone_get_property_value(as, name);
if (!property) {
return nullptr;
}
}
}
-msg_netzone_t MSG_environment_get_routing_root()
+msg_netzone_t MSG_zone_get_root()
{
return simgrid::s4u::Engine::instance()->netRoot();
}
-const char* MSG_environment_as_get_name(msg_netzone_t netzone)
+const char* MSG_zone_get_name(msg_netzone_t netzone)
{
return netzone->name();
}
-msg_netzone_t MSG_environment_as_get_by_name(const char* name)
+msg_netzone_t MSG_zone_get_by_name(const char* name)
{
return simgrid::s4u::Engine::instance()->netzoneByNameOrNull(name);
}
-xbt_dict_t MSG_environment_as_get_routing_sons(msg_netzone_t netzone)
+xbt_dict_t MSG_zone_get_sons(msg_netzone_t netzone)
{
xbt_dict_t res = xbt_dict_new_homogeneous(nullptr);
for (auto elem : *netzone->children()) {
return res;
}
-const char* MSG_environment_as_get_property_value(msg_netzone_t netzone, const char* name)
+const char* MSG_zone_get_property_value(msg_netzone_t netzone, const char* name)
{
return netzone->property(name);
}
-void MSG_environment_as_set_property_value(msg_netzone_t netzone, const char* name, char* value)
+void MSG_zone_set_property_value(msg_netzone_t netzone, const char* name, char* value)
{
netzone->setProperty(name, value);
}
-xbt_dynar_t MSG_environment_as_get_hosts(msg_netzone_t netzone)
+xbt_dynar_t MSG_zone_get_hosts(msg_netzone_t netzone)
{
xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), nullptr);