[haizea-commit] r461 - in trunk: etc src/haizea/common

haizea-commit at mailman.cs.uchicago.edu haizea-commit at mailman.cs.uchicago.edu
Mon Aug 4 10:26:27 CDT 2008


Author: borja
Date: 2008-08-04 10:26:27 -0500 (Mon, 04 Aug 2008)
New Revision: 461

Modified:
   trunk/etc/sample.conf
   trunk/src/haizea/common/config.py
   trunk/src/haizea/common/constants.py
Log:
- Made clock configurable in simulation (i.e., user can choose the simulated clock that was being used so far, or a real clock where time is "real" and everything else is simulated)
- Moved wakeup-interval from opennebula section to scheduling section

Modified: trunk/etc/sample.conf
===================================================================
--- trunk/etc/sample.conf	2008-08-04 15:24:57 UTC (rev 460)
+++ trunk/etc/sample.conf	2008-08-04 15:26:27 UTC (rev 461)
@@ -68,8 +68,19 @@
 
 [simulation]
 
+# Option: clock
+# Required: No (default is to not show the message)
+# Description: Type of clock to use in simulation:
+#     - "simulated": A simulated clock that fastforwards through
+#                    time. Can only use the tracefile request
+#                    frontend
+#     - "real": A real clock is used, but simulated resources and
+#               enactment actions are used. Can only use the RPC
+#               request frontend.
+#clock: simulated
+
 # Option: starttime
-# Required: Yes
+# Required: Only when using the simulated clock
 # Description: Time at which simulated clock will start
 starttime: 2006-11-25 13:00:00
 
@@ -118,6 +129,15 @@
 
 [scheduling]
 
+# Option: wakeup-interval
+# Required: No (default is one minute)
+# Description: Interval at which Haizea will wake up
+#   to manage resources and process pending requests.
+#   This option is not used when using a simulated clock,
+#   since the clock will skip directly to the time where an
+#   event is happening.
+#wakeup-interval: 60
+
 # Option: backfilling
 # Required: Yes
 # Description: Backfilling algorithm to use. Valid values are:

Modified: trunk/src/haizea/common/config.py
===================================================================
--- trunk/src/haizea/common/config.py	2008-08-04 15:24:57 UTC (rev 460)
+++ trunk/src/haizea/common/config.py	2008-08-04 15:26:27 UTC (rev 461)
@@ -127,6 +127,12 @@
     def getInitialTime(self):
         timeopt = self.config.get(constants.SIMULATION_SEC, constants.STARTTIME_OPT)
         return ISO.ParseDateTime(timeopt)
+
+    def getClock(self):
+        if not self.config.has_option(constants.SIMULATION_SEC, constants.CLOCK_OPT):
+            return constants.CLOCK_SIMULATED
+        else:
+            return self.config.get(constants.SIMULATION_SEC, constants.CLOCK_OPT)
     
     def getNumPhysicalNodes(self):
         return self.config.getint(constants.SIMULATION_SEC, constants.NODES_OPT)
@@ -186,12 +192,6 @@
     def getONEvm(self):
         return self.config.get(constants.OPENNEBULA_SEC, constants.ONEVM_OPT)
 
-    def get_wakeup_interval(self):
-        if not self.config.has_option(constants.OPENNEBULA_SEC, constants.WAKEUPINTERVAL_OPT):
-            return 60
-        else:
-            return self.config.getint(constants.OPENNEBULA_SEC, constants.WAKEUPINTERVAL_OPT)
-
     def getONESuspendResumeRate(self):
         if not self.config.has_option(constants.OPENNEBULA_SEC, constants.ESTIMATESUSPENDRATE_OPT):
             return 32
@@ -208,6 +208,12 @@
     # SCHEDULING OPTIONS
     #
 
+    def get_wakeup_interval(self):
+        if not self.config.has_option(constants.SCHEDULING_SEC, constants.WAKEUPINTERVAL_OPT):
+            return 60
+        else:
+            return self.config.getint(constants.SCHEDULING_SEC, constants.WAKEUPINTERVAL_OPT)
+
     def getSuspensionType(self):
         return self.config.get(constants.SCHEDULING_SEC, constants.SUSPENSION_OPT)
 

Modified: trunk/src/haizea/common/constants.py
===================================================================
--- trunk/src/haizea/common/constants.py	2008-08-04 15:24:57 UTC (rev 460)
+++ trunk/src/haizea/common/constants.py	2008-08-04 15:26:27 UTC (rev 461)
@@ -144,6 +144,7 @@
 REUSE_OPT="diskimage-reuse"
 AVOIDREDUNDANT_OPT="avoid-redundant-transfers"
 STATUS_INTERVAL_OPT="status-message-interval"
+CLOCK_OPT="clock"
 
 OPENNEBULA_SEC = "opennebula"
 DB_OPT = "db"
@@ -195,6 +196,9 @@
 DEPLOYMENT_PREDEPLOY = "predeployed-images"
 DEPLOYMENT_TRANSFER = "imagetransfer"
 
+CLOCK_SIMULATED = "simulated"
+CLOCK_REAL = "real"
+
 # Graph configfile sections and options
 TITLE_OPT="title"
 DATAFILE_OPT="datafile"



More information about the Haizea-commit mailing list