XBT_INFO(" Property: %s old value: %s", exist, value);
XBT_INFO("== Trying to modify a host property");
- xbt_dict_set(props, exist, xbt_strdup("250"), NULL);
+ MSG_host_set_property_value(thehost, exist, xbt_strdup("250"), NULL);
/* Test if we have changed the value */
value = MSG_host_get_property_value(thehost, exist);
msg_error_t test_all(const char *platform_file,
const char *application_file)
{
+ int host_number;
+ unsigned int i;
+ double speed;
+ xbt_dynar_t hosts;
+ msg_host_t host;
MSG_function_register("alice", alice);
MSG_function_register("bob", bob);
MSG_function_register("carole", carole);
MSG_create_environment(platform_file);
+
+ host_number = MSG_get_host_number();
+ XBT_INFO("There are %d hosts in the environment", host_number);
+
+ hosts = MSG_hosts_as_dynar();
+
+ xbt_dynar_foreach(hosts, i, host){
+ XBT_INFO("Host '%s' runs at %.0f flops/s",MSG_host_get_name(host),
+ MSG_get_host_speed(host));
+ }
+
MSG_launch_application(application_file);
return MSG_main();
! output sort
$ $SG_TEST_EXENV properties/msg_prop$EXEEXT ${srcdir:=.}/../platforms/prop.xml ${srcdir:=.}/properties/deployment_properties.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [ 0.000000] (0:@) There are 2 hosts in the environment
+> [ 0.000000] (0:@) Host 'host1' runs at 1000000000 flops/s
+> [ 0.000000] (0:@) Host 'host2' runs at 1000000000 flops/s
> [ 0.000000] (1:alice@host1) == Print the properties of the host
> [ 0.000000] (1:alice@host1) Host property: 'SG_TEST_Hdd' -> '180'
> [ 0.000000] (1:alice@host1) Host property: 'SG_TEST_mem' -> '4'