예제 #1
0
 def __setstate__(self, state):
     try:
         self.logger.log(1, "restart: initializing base system class")
         BGBaseSystem.__setstate__(self, state)
         self.process_groups.item_cls = BGSimProcessGroup
         self.node_card_cache = dict()
         try:
             self.failed_components = state['failed_components']
         except KeyError:
             self.failed_components = set()
         try:
             self.config_file = state['config_file']
         except KeyError:
             self.config_file = os.path.expandvars(get_config_option('system', 'def_file', ""))
         if self.config_file:
             self.logger.log(1, "restart: loading machine configuration")
             self.configure(self.config_file)
             self.logger.log(1, "restart: restoring partition state")
             self._restore_partition_state(state)
             self.logger.log(1, "restart: recomputing partition state")
             self._recompute_partition_state()
     except:
         self.logger.error("A fatal error occurred while restarting the system component", exc_info=True)
         print "A fatal error occurred while restarting the system component.  Terminating."
         sys.exit(1)
예제 #2
0
 def __init__(self, *args, **kwargs):
     BGBaseSystem.__init__(self, *args, **kwargs)
     self.process_groups.item_cls = BGSimProcessGroup
     self.config_file = kwargs.get("config_file", None)
     self.failed_components = sets.Set()
     if self.config_file is not None:
         self.configure(self.config_file)
예제 #3
0
 def __setstate__(self, state):
     try:
         self.logger.log(1, "restart: initializing base system class")
         BGBaseSystem.__setstate__(self, state)
         self.process_groups.item_cls = BGSimProcessGroup
         self.node_card_cache = dict()
         try:
             self.failed_components = state['failed_components']
         except KeyError:
             self.failed_components = set()
         try:
             self.config_file = state['config_file']
         except KeyError:
             self.config_file = os.path.expandvars(
                 get_config_option('system', 'def_file', ""))
         if self.config_file:
             self.logger.log(1, "restart: loading machine configuration")
             self.configure(self.config_file)
             self.logger.log(1, "restart: restoring partition state")
             self._restore_partition_state(state)
             self.logger.log(1, "restart: recomputing partition state")
             self._recompute_partition_state()
     except:
         self.logger.error(
             "A fatal error occurred while restarting the system component",
             exc_info=True)
         print "A fatal error occurred while restarting the system component.  Terminating."
         sys.exit(1)
예제 #4
0
 def __init__ (self, *args, **kwargs):
     BGBaseSystem.__init__(self, *args, **kwargs)
     self.process_groups.item_cls = BGSimProcessGroup
     self.config_file = kwargs.get("config_file", None)
     self.failed_components = sets.Set()
     if self.config_file is not None:
         self.configure(self.config_file)
예제 #5
0
 def __init__(self, *args, **kwargs):
     BGBaseSystem.__init__(self, *args, **kwargs)
     sys.setrecursionlimit(5000)
     self.process_groups.item_cls = BGProcessGroup
     self.diag_pids = dict()
     self.configure()
     # initiate the process before starting any threads
     thread.start_new_thread(self.update_partition_state, tuple())
예제 #6
0
 def __setstate__(self, state):
     BGBaseSystem.__setstate__(self, state)
     self.config_file = state['config_file']
     self.process_groups.item_cls = BGSimProcessGroup
     if self.config_file is not None:
         self.configure(self.config_file)
     self.update_relatives()
     self._restore_partition_state(state)
예제 #7
0
 def __setstate__(self, state):
     BGBaseSystem.__setstate__(self, state)
     self.config_file = state['config_file']
     self.process_groups.item_cls = BGSimProcessGroup
     if self.config_file is not None:
         self.configure(self.config_file)
     self.update_relatives()
     self._restore_partition_state(state)
예제 #8
0
파일: simulator.py 프로젝트: wtangiit/Qsim
 def __init__ (self, *args, **kwargs):
     BGBaseSystem.__init__(self, *args, **kwargs)
     sys.setrecursionlimit(5000) #why this magic number?
     self.process_groups.item_cls = BGSimProcessGroup
     self.config_file = kwargs.get("config_file", None)
     self.failed_components = set()
     if self.config_file is not None:
         self.configure(self.config_file)
예제 #9
0
 def __init__ (self, *args, **kwargs):
     BGBaseSystem.__init__(self, *args, **kwargs)
     sys.setrecursionlimit(5000)
     self.process_groups.item_cls = BGProcessGroup
     self.diag_pids = dict()
     self.configure()
     # initiate the process before starting any threads
     thread.start_new_thread(self.update_partition_state, tuple())
예제 #10
0
 def __init__(self, *args, **kwargs):
     BGBaseSystem.__init__(self, *args, **kwargs)
     sys.setrecursionlimit(5000)  #why this magic number?
     self.process_groups.item_cls = BGSimProcessGroup
     self.config_file = kwargs.get("config_file", None)
     self.failed_components = set()
     if self.config_file is not None:
         self.configure(self.config_file)
예제 #11
0
    def __setstate__(self, state):
        BGBaseSystem.__setstate__(self, state)
        self.process_groups.item_cls = BGProcessGroup
        self.configure()
        self.update_relatives()
        self._restore_partition_state(state)

        # initiate the process before starting any threads
        thread.start_new_thread(self.update_partition_state, tuple())
예제 #12
0
    def __setstate__(self, state):
        BGBaseSystem.__setstate__(self, state)
        self.process_groups.item_cls = BGProcessGroup
        self.configure()
        self.update_relatives()
        self._restore_partition_state(state)

        # initiate the process before starting any threads
        thread.start_new_thread(self.update_partition_state, tuple())
예제 #13
0
 def __init__ (self, *args, **kwargs):
     BGBaseSystem.__init__(self, *args, **kwargs)
     sys.setrecursionlimit(5000) #why this magic number?
     self.process_groups.item_cls = BGSimProcessGroup
     self.node_card_cache = dict()
     self.failed_components = set()
     self.config_file = kwargs.get("config_file", get_config_option('bgsystem', 'system_def_file', None))
     if self.config_file is not None:
         self.logger.log(1, "init: loading machine configuration")
         self.configure(self.config_file)
         self.logger.log(1, "init: recomputing partition state")
         self._recompute_partition_state()
예제 #14
0
 def __init__(self, *args, **kwargs):
     BGBaseSystem.__init__(self, *args, **kwargs)
     sys.setrecursionlimit(5000)  #why this magic number?
     self.process_groups.item_cls = BGSimProcessGroup
     self.node_card_cache = dict()
     self.failed_components = set()
     self.config_file = kwargs.get(
         "config_file",
         get_config_option('bgsystem', 'system_def_file', None))
     if self.config_file is not None:
         self.logger.log(1, "init: loading machine configuration")
         self.configure(self.config_file)
         self.logger.log(1, "init: recomputing partition state")
         self._recompute_partition_state()
예제 #15
0
 def __getstate__(self):
     state = {}
     state.update(BGBaseSystem.__getstate__(self))
     state.update({
             'simulator_version':3,
             'config_file':self.config_file})
     return state
예제 #16
0
    def __init__ (self, *args, **kwargs):
        BGBaseSystem.__init__(self, *args, **kwargs)
        sys.setrecursionlimit(5000)
        self.process_groups.item_cls = BGProcessGroup
        self.bp_cache = dict()
        self.node_card_cache = dict()
        self.wire_cache = dict()
        self.busted_switches = set()
        self.busted_wires = set()
        self.logger.debug("init: loading machine configuration")
        self.configure()
        self.logger.debug("init: recomputing partition state")
        self._recompute_partition_state()

        # initiate the process before starting any threads
        thread.start_new_thread(self.update_partition_state, tuple())
예제 #17
0
 def __getstate__(self):
     state = {}
     state.update(BGBaseSystem.__getstate__(self))
     state.update({
             'simulator_version':4,
             'config_file':self.config_file,
             'failed_components': self.failed_components})
     return state
예제 #18
0
 def __getstate__(self):
     state = {}
     state.update(BGBaseSystem.__getstate__(self))
     state.update({
         'simulator_version': 4,
         'config_file': self.config_file,
         'failed_components': self.failed_components
     })
     return state
예제 #19
0
    def validate_job(self, spec):
        """validate a job for submission

        Arguments:
        spec -- job specification dictionary
        """
        spec = BGBaseSystem.validate_job(self, spec)
        if not self._validate_kernel(spec['kernel']):
            raise JobValidationError("kernel does not exist")
        return spec
예제 #20
0
    def validate_job(self, spec):
        """validate a job for submission

        Arguments:
        spec -- job specification dictionary
        """
        spec = BGBaseSystem.validate_job(self, spec)
        if not self._validate_kernel(spec['kernel']):
            raise JobValidationError("kernel does not exist")
        return spec
예제 #21
0
    def __setstate__(self, state):
        try:
            BGBaseSystem.__setstate__(self, state)
            self.process_groups.item_cls = BGProcessGroup
            self.bp_cache = dict()
            self.node_card_cache = dict()
            self.wire_cache = dict()
            self.busted_switches = set()
            self.busted_wires = set()
            self.logger.debug("restart: loading machine configuration")
            self.configure()
            self.logger.debug("restart: restoring partition state")
            self._restore_partition_state(state)
            self.logger.debug("restart: recomputing partition state")
            self._recompute_partition_state()
        except:
            self.logger.error("A fatal error occurred while restarting the system component", exc_info=True)
            print "A fatal error occurred while restarting the system component.  Terminating."
            sys.exit(1)

        # initiate the process before starting any threads
        thread.start_new_thread(self.update_partition_state, tuple())
예제 #22
0
 def __getstate__(self):
     state = {}
     state.update(BGBaseSystem.__getstate__(self))
     state.update({
             'bgsystem_version':3})
     return state
예제 #23
0
 def __getstate__(self):
     state = {}
     state.update(BGBaseSystem.__getstate__(self))
     state.update({'bgsystem_version': 3})
     return state
예제 #24
0
 def __getstate__(self):
     state = {}
     state.update(BGBaseSystem.__getstate__(self))
     state.update({'simulator_version': 3, 'config_file': self.config_file})
     return state