# cannot safely be run together; need to check the nepi exp_ids
# used more closely
+DIRNAME=$(dirname $0)
COMMAND=$(basename $0)
+if echo $COMMAND | grep -q 6; then
+ $DIRNAME/all-tests2; $DIRNAME/all-tests3; exit
+fi
+
PYTHON=python
version=2
echo $COMMAND | grep -q 3 && { PYTHON=python3; version=3; }
# compute output file name
output="zz.$hash.py$version"
+latest="zz.latest.py$version"
# if there is any pending change, use another name
is_pristine=""
# the current code for analyzing the output is very basic
# this needs to be checked manually for some time
+# create a 'latest' symlink
+ln -f -s $output $latest
+
all_tests >& $output
retcod=$?
from six import next
-from nepi.util import guid
from nepi.util.parallel import ParallelRun
from nepi.util.timefuncs import tnow, tdiffsec, stabsformat, tsformat
from nepi.execution.resource import ResourceFactory, ResourceAction, \
RELEASED = 3
TERMINATED = 4
+# historical note: this class used to be in util/guid.py but is used only here
+# FIXME: This class is not thread-safe. Should it be made thread-safe?
+class GuidGenerator(object):
+ def __init__(self):
+ self._last_guid = 0
+
+ # historical note: this used to be called `next`
+ # which confused 2to3 - and me - while it has
+ # nothing to do at all with the iteration protocol
+ def generate(self, guid = None):
+ if guid == None:
+ guid = self._last_guid + 1
+
+ self._last_guid = self._last_guid if guid <= self._last_guid else guid
+
+ return guid
+
class ExperimentController(object):
"""
.. note::
self._persist = persist
# generator of globally unique ids
- self._guid_generator = guid.GuidGenerator()
+ self._guid_generator = GuidGenerator()
# Resource managers
self._resources = dict()
self._groups = dict()
# generator of globally unique id for groups
- self._group_id_generator = guid.GuidGenerator()
+ self._group_id_generator = GuidGenerator()
# Flag to stop processing thread
self._stop = False
"""
# Get next available guid
# xxx_next_hiccup
- guid = self._guid_generator.next(guid)
+ guid = self._guid_generator.generate(guid)
# Instantiate RM
rm = ResourceFactory.create(rtype, self, guid)
if not group:
new_group = True
# xxx_next_hiccup
- group = self._group_id_generator.next()
+ group = self._group_id_generator.generate()
if group not in self._groups:
self._groups[group] = []
+++ /dev/null
-#
-# NEPI, a framework to manage network experiments
-# Copyright (C) 2013 INRIA
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation;
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# Author: Alina Quereilhac <alina.quereilhac@inria.fr>
-
-# FIXME: This class is not thread-safe.
-# Should it be made thread-safe?
-class GuidGenerator(object):
- def __init__(self):
- self._last_guid = 0
-
- # xxx_next_hiccup - this is used as a plain function, and only in ec.py
- def next(self, guid = None):
- if guid == None:
- guid = self._last_guid + 1
-
- self._last_guid = self._last_guid if guid <= self._last_guid else guid
-
- return guid
-