Minor modifications to experiment runner
authorAlina Quereilhac <alina.quereilhac@inria.fr>
Wed, 24 Sep 2014 09:49:06 +0000 (11:49 +0200)
committerAlina Quereilhac <alina.quereilhac@inria.fr>
Wed, 24 Sep 2014 09:49:06 +0000 (11:49 +0200)
examples/omf/nitos_omf6_ping.py
src/nepi/execution/runner.py
src/nepi/resources/linux/application.py

index 8626af6..0fcb288 100644 (file)
@@ -1,4 +1,6 @@
 #!/usr/bin/env python
+
+###############################################################################
 #
 #    NEPI, a framework to manage network experiments
 #    Copyright (C) 2013 INRIA
@@ -18,6 +20,8 @@
 #
 # Authors: Alina Quereilhac <alina.quereilhac@inria.fr>
 #         Julien Tribino <julien.tribino@inria.fr>
+#
+###############################################################################
       
 # Topology
 #
@@ -41,7 +45,6 @@
 #        - t2 (t1 + 10s) : Ping stop
 #        - t3 (t2 + 2s) : Kill the application
 #
-#
 
 from nepi.execution.ec import ExperimentController
 from nepi.execution.resource import ResourceAction, ResourceState
index 3a09ff4..0afc730 100644 (file)
@@ -58,7 +58,7 @@ class ExperimentRunner(object):
         :param compute_metric_callback: function to invoke after each 
             experiment run, to compute an experiment metric. 
             It will be invoked with the ec and the run count as arguments,
-            and it must return a numeric value for the computed metric:
+            and it must return the metric value(s) computed for the run
 
                 metric = compute_metric_callback(ec, run)
             
@@ -68,7 +68,7 @@ class ExperimentRunner(object):
             collected metric samples have converged and the experiment runner
             can stop. It will be invoked with the ec, the run count and the
             list of collected metric samples as argument, and it must return
-            either True or False:
+            either True or False
 
                 stop = evaluate_convergence_callback(ec, run, metrics)
 
@@ -124,7 +124,7 @@ class ExperimentRunner(object):
         if len(samples) == 0:
             msg = "0 samples collected"
             raise RuntimeError, msg
-        
+
         x = numpy.array(samples)
         n = len(samples)
         std = x.std()
@@ -152,4 +152,3 @@ class ExperimentRunner(object):
 
         return ec
 
-
index ca9772d..35a7884 100644 (file)
@@ -644,11 +644,13 @@ class LinuxApplication(ResourceManager):
                     (out, err), proc = self.node.kill(self.pid, self.ppid,
                             sudo = self._sudo_kill)
 
+                    """
                     # TODO: check if execution errors occurred
                     if (proc and proc.poll()) or err:
                         msg = " Failed to STOP command '%s' " % self.get("command")
                         self.error(msg, out, err)
-            
+                    """
+
             super(LinuxApplication, self).do_stop()
 
     def do_release(self):