Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
test that the hosts get the cluster's properties
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 25 Jan 2015 22:57:06 +0000 (23:57 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 25 Jan 2015 22:57:06 +0000 (23:57 +0100)
examples/msg/properties/deployment_properties.xml
examples/msg/properties/msg_prop.c
examples/msg/properties/msg_prop.tesh
examples/platforms/prop.xml

index 54e735b..e601c08 100644 (file)
@@ -9,4 +9,6 @@
   </process>
   
   <process host="host2" function="carole" />
+  
+  <process host="host2" function="david" />
 </platform>
index 6ea54d8..c9e881f 100644 (file)
@@ -31,6 +31,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Property test");
 int alice(int argc, char *argv[]);
 int bob(int argc, char *argv[]);
 int carole(int argc, char *argv[]);
+int david(int argc, char *argv[]);
 msg_error_t test_all(const char *platform_file,
                      const char *application_file);
 
@@ -44,7 +45,7 @@ static void test_host(const char*hostname)
   const char *value;
   char exist[] = "Hdd";
 
-  XBT_INFO("== Print the properties of the host");
+  XBT_INFO("== Print the properties of the host '%s'", hostname);
   xbt_dict_foreach(props, cursor, key, data)
       XBT_INFO("  Host property: '%s' -> '%s'", key, data);
 
@@ -85,6 +86,11 @@ int carole(int argc, char *argv[]) {/* Dump what we have on a remote host */
   test_host("host1");
   return 0;
 }
+int david(int argc, char *argv[]) {/* Dump what we have on a remote host */
+  MSG_process_sleep(2); // Wait for alice and carole to be done with its experiment
+  test_host("node-0.acme.org");
+  return 0;
+}
 
 int bob(int argc, char *argv[])
 {
@@ -120,6 +126,7 @@ msg_error_t test_all(const char *platform_file,
   MSG_function_register("alice", alice);
   MSG_function_register("bob", bob);
   MSG_function_register("carole", carole);
+  MSG_function_register("david", david);
 
   MSG_create_environment(platform_file);
 
index d6bb370..a3d97db 100644 (file)
@@ -4,10 +4,15 @@ p Testing a MSG application with properties in the XML for Hosts, Links and Proc
 
 ! 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:@) There are 7 hosts in the environment
+> [  0.000000] (0:@) Host 'node-3.acme.org' runs at 1000000000 flops/s
+> [  0.000000] (0:@) Host 'node-0.acme.org' runs at 1000000000 flops/s
+> [  0.000000] (0:@) Host 'node-4.acme.org' runs at 1000000000 flops/s
+> [  0.000000] (0:@) Host 'node-1.acme.org' runs at 1000000000 flops/s
+> [  0.000000] (0:@) Host 'node-2.acme.org' runs at 1000000000 flops/s
 > [  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) == Print the properties of the host 'host1'
 > [  0.000000] (1:alice@host1)   Host property: 'mem' -> '4'
 > [  0.000000] (1:alice@host1)   Host property: 'Hdd' -> '180'
 > [  0.000000] (1:alice@host1) == Try to get a host property that does not exist
@@ -18,7 +23,7 @@ $ $SG_TEST_EXENV properties/msg_prop$EXEEXT ${srcdir:=.}/../platforms/prop.xml $
 > [  0.000000] (2:bob@host1) == Print the properties of the process
 > [  0.000000] (2:bob@host1)    Process property: SomeProp -> SomeValue
 > [  0.000000] (2:bob@host1) == Try to get a process property that does not exist
-> [  1.000000] (3:carole@host2) == Print the properties of the host
+> [  1.000000] (3:carole@host2) == Print the properties of the host 'host1'
 > [  1.000000] (3:carole@host2)   Host property: 'mem' -> '4'
 > [  1.000000] (3:carole@host2)   Host property: 'Hdd' -> '180'
 > [  1.000000] (3:carole@host2) == Try to get a host property that does not exist
@@ -26,3 +31,13 @@ $ $SG_TEST_EXENV properties/msg_prop$EXEEXT ${srcdir:=.}/../platforms/prop.xml $
 > [  1.000000] (3:carole@host2)    Property: Hdd old value: 180
 > [  1.000000] (3:carole@host2) == Trying to modify a host property
 > [  1.000000] (3:carole@host2)    Property: Hdd old value: 250
+> [  2.000000] (4:david@host2) == Print the properties of the host 'node-0.acme.org'
+> [  2.000000] (4:david@host2)   Host property: 'mem' -> '42'
+> [  2.000000] (4:david@host2)   Host property: 'bla' -> 'acme cluster'
+> [  2.000000] (4:david@host2)   Host property: 'name' -> 'AS2'
+> [  2.000000] (4:david@host2)   Host property: 'Hdd' -> '180'
+> [  2.000000] (4:david@host2) == Try to get a host property that does not exist
+> [  2.000000] (4:david@host2) == Try to get a host property that does exist
+> [  2.000000] (4:david@host2)    Property: Hdd old value: 180
+> [  2.000000] (4:david@host2) == Trying to modify a host property
+> [  2.000000] (4:david@host2)    Property: Hdd old value: 250
index 17246bb..33a34e1 100644 (file)
               <prop id="name" value="AS2"/>
           </AS>
    </AS>
-   
+
+   <cluster id="acme"
+            prefix="node-"    suffix=".acme.org"
+            radical="0-4"     power="1Gf" 
+            bw="125MBps"      lat="50us"
+            bb_bw="2.25GBps"  bb_lat="500us">
+           
+      <prop id="bla" value="acme cluster"/>
+      <prop id="Hdd"  value="180"/>
+      <prop id="mem"  value="42"/>
+   </cluster>
+
    <AS  id="AS4"  routing="Full">
           <host id="host1" power="1Gf">
             <prop id="Hdd" value="180"/>