:type root_dir: str
.. note::
-
- This class is the only one used by the User. Indeed, the user "talks"
- only with the Experiment Controller and this latter forward to
- the different Resources Manager the order provided by the user.
+ This class is the only one used by the User. Indeed, the user "talks"
+ only with the Experiment Controller and this latter forward to
+ the different Resources Manager the order provided by the user.
"""
def resources(self):
""" Returns the list of all the Resource Manager Id
- :rtype: set
+ :rtype: set
+
"""
return self._resources.keys()
:param rtype: Type of the RM
:type rtype: str
- :return : Id of the RM
- :rtype: int
+ :return: Id of the RM
+ :rtype: int
"""
# Get next available guid
guid = self._guid_generator.next(guid)
:param guid: Guid of the RM
:type guid: int
- :return : List of attributes
+ :return: List of attributes
:rtype: list
"""
rm = self.get_resource(guid)
:param guid2: Second guid to connect
:type guid: ResourceManager
-
"""
rm1 = self.get_resource(guid1)
rm2 = self.get_resource(guid2)
conditions.append((group, state, time))
def get_connected(self, rtype):
- """ Return the list of RM with the type 'rtype'
+ """ Return the list of RM with the type 'rtype'
:param rtype: Type of the RM we look for
:type rtype: str
- :return : list of guid
+ :return: list of guid
"""
connected = []
for guid in self.connections:
def set_with_conditions(self, name, value, group, state, time):
""" Set value 'value' on attribute with name 'name' when 'time'
- has elapsed since all elements in 'group' have reached state
- 'state'
+ has elapsed since all elements in 'group' have reached state
+ 'state'
:param name: Name of the attribute to set
:type name: str
:type state: str
:param time: Time to wait after 'state' is reached on all RMs in group. (e.g. '2s')
:type time: str
-
"""
reschedule = False
.. note::
- This class is thread safe.
- All calls to C Extensions are made atomic by the GIL in the CPython implementation.
- heapq.heappush, heapq.heappop, and list access are therefore thread-safe """
+ This class is thread safe.
+ All calls to C Extensions are made atomic by the GIL in the CPython implementation.
+ heapq.heappush, heapq.heappop, and list access are therefore thread-safe.
+
+ """
def __init__(self):
super(HeapScheduler, self).__init__()
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-"""
+
class Server(object):
def __init__(self, root_dir = ".", log_level = "ERROR",
self._ctrl_sock.close()
except:
pass
-"""
+
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.
-c
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
pass
- def start(self):
+ def start(self):
"""Start the RM. It means nothing special for an interface for now
It becomes STARTED as soon as this method starts.
import logging
import hashlib
-from parser import sfa_sfav1
+from sfa_sfav1 import SFAResourcesParser
import subprocess
import warnings
def get_api(slice_id = None, sfi_auth = None, sfi_user = None,
sfi_registry = None, sfi_sm = None, timeout = None, private_key = None):
- key = cls.make_key(aggregate = 'ple', slice_id, sfi_auth, sfi_user, sfi_registry, sfi_sm,
- timeout, private_key)
+ key = cls.make_key(slice_id, sfi_auth, sfi_user, sfi_registry,
+ sfi_sm, timeout, private_key, aggregate = 'ple')
api = cls._apis.get(key)
cls.lock.acquire()
api._fetch_resources_info(resources = False)