コード例 #1
0
    def explore_a_reboot(self, hostname):
        if (conf.config.has_option("Machine", "tryReboot") and
            conf.config.getboolean("Machine", "tryReboot")):
                logger.info("cannot ping {}- will try to reboot board".format(hostname))
                version_number = conf.config.get("Machine", "version")
                if version_number is None or version_number == "None" or int(version_number) > 5:
                    raise exceptions.SpinnManException("version number is not defined in pacman.cfg. Please enter and retry")

                boot_file = self.checkfile("scamp-130.boot")
                struct_file = self.checkfile("sark-130.struct")
                config_file = self.checkfile("spin{}.conf".format(version_number))
                boot.boot(hostname, boot_file, config_file, struct_file)
                #used to hold up and wait for spinn board to have completed its boot up (only on rowleys board)
                time.sleep(1.0)
        else:
            raise exceptions.ExploreException("EXPLORE ERROR: Cannot ping"
                                              ,hostname,"- is it active on "
                                                        "the network?")
コード例 #2
0
    def explore_a_reboot(self, hostname):
        if (conf.config.has_option("Machine", "tryReboot")
                and conf.config.getboolean("Machine", "tryReboot")):
            logger.info(
                "cannot ping {}- will try to reboot board".format(hostname))
            version_number = conf.config.get("Machine", "version")
            if version_number is None or version_number == "None" or int(
                    version_number) > 5:
                raise exceptions.SpinnManException(
                    "version number is not defined in pacman.cfg. Please enter and retry"
                )

            boot_file = self.checkfile("scamp-130.boot")
            struct_file = self.checkfile("sark-130.struct")
            config_file = self.checkfile("spin{}.conf".format(version_number))
            boot.boot(hostname, boot_file, config_file, struct_file)
            #used to hold up and wait for spinn board to have completed its boot up (only on rowleys board)
            time.sleep(1.0)
        else:
            raise exceptions.ExploreException(
                "EXPLORE ERROR: Cannot ping", hostname, "- is it active on "
                "the network?")
コード例 #3
0
ファイル: boot.py プロジェクト: BRML/HBP-spinnaker-cerebellum
        print "machineName is not defined in pacman.cfg and has not been specified"
        sys.exit(2)

if configfile is None:
    version = config.get("Machine", "version")
    if version == "None":
        print "version is not defined in pacman.cfg and config file has not been specified"
        sys.exit(2)
    configfile = _checkfile("spin{}.conf".format(version))

if bootfile is None:
    bootfile = _checkfile("scamp-130.boot")

if structfile is None:
    structfile = _checkfile("sark-130.struct")

try:
    conn = SCPConnection(hostname)
    version = conn.version(retries=3)
    print "{} already booted with {} {}".format(hostname, version.desc,
                                                version.ver_num)
except:
    boot(hostname, bootfile, configfile, structfile)
    try:
        conn = SCPConnection(hostname)
        version = conn.version()
        print "{} booted with {} {}".format(hostname, version.desc,
                                            version.ver_num)
    except:
        print "Boot failed!"
コード例 #4
0
version = 5
directory = "data_0.1_0.1"

txrx = Transceiver(hostname)
while True:
    try:
        print("Trying to get version")
        version = txrx.conn.version(retries=3)
        print("Version =", version.desc)
        break
    except:
        print("Couldn't get version, rebooting")
        boot_file = txrx.checkfile("scamp-130.boot")
        struct_file = txrx.checkfile("sark-130.struct")
        config_file = txrx.checkfile("spin{}.conf".format(5))
        boot.boot(hostname, boot_file, config_file, struct_file)
        time.sleep(2.0)

load_targets_path = os.path.join(directory, "pickled_load_targets")
mem_write_targets_path = os.path.join(directory, "pickled_mem_write_targets")
load_targets_file = open(load_targets_path, "rb")
load_targets = pickle.load(load_targets_file)
load_targets_file.close()
mem_write_targets_file = open(mem_write_targets_path, "rb")
mem_write_targets = pickle.load(mem_write_targets_file)
mem_write_targets_file.close()

print("Loading data", file=sys.stderr)
load_progress = ProgressBar(len(load_targets))
for target in load_targets:
    txrx.select(target.x, target.y, target.p)
コード例 #5
0
ファイル: boot.py プロジェクト: BRML/HBP-spinnaker-cerebellum
        print "machineName is not defined in pacman.cfg and has not been specified"
        sys.exit(2)

if configfile is None:
    version = config.get("Machine", "version")
    if version == "None":
        print "version is not defined in pacman.cfg and config file has not been specified"
        sys.exit(2)
    configfile = _checkfile("spin{}.conf".format(version))

if bootfile is None:
    bootfile = _checkfile("scamp-130.boot")

if structfile is None:
    structfile = _checkfile("sark-130.struct")
    
try:
    conn = SCPConnection(hostname)
    version = conn.version(retries=3)
    print "{} already booted with {} {}".format(hostname, version.desc,
             version.ver_num)
except:
    boot(hostname, bootfile, configfile, structfile)
    try:
        conn = SCPConnection(hostname)
        version = conn.version()
        print "{} booted with {} {}".format(hostname, version.desc, 
                version.ver_num)
    except:
        print "Boot failed!"