def run(self, force=<NUM_LIT:0>, verbose=<NUM_LIT:2>, ipyclient=None):
<EOL>if force:<EOL><INDENT>self.refresh()<EOL><DEDENT>inst = None<EOL>try:<EOL><INDENT>if not ipyclient:<EOL><INDENT>args = self._ipcluster.items() + [("<STR_LIT>", "<STR_LIT>")] <EOL>ipyclient = ip.core.parallel.get_client(**dict(args)) <EOL><DEDENT>if verbose == <NUM_LIT:2>:<EOL><INDENT>ip.cluster_info(ipyclient)<EOL><DEDENT>targets = get_targets(ipyclient)<EOL>lbview = ipyclient.load_balanced_view(targets=targets)<EOL>self._ipcluster["<STR_LIT>"] = ipyclient[:].apply(os.getpid).get_dict()<EOL>if not self._chunksize:<EOL><INDENT>if self.params.method != '<STR_LIT>':<EOL><INDENT>self._store_N_samples(ncpus=len(lbview))<EOL><DEDENT>else:<EOL><INDENT>self._store_equal_samples(ncpus=len(lbview))<EOL><DEDENT><DEDENT>start = time.time()            <EOL>if not self.trees.tree:<EOL><INDENT>if verbose:<EOL><INDENT>print("<STR_LIT>".format(self.params.nquartets))<EOL><DEDENT>self._inference(start, lbview, quiet=verbose == <NUM_LIT:0>)<EOL>if verbose:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if verbose:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT><DEDENT>start = time.time()<EOL>if self.params.nboots:<EOL><INDENT>if self.checkpoint.boots == self.params.nboots:<EOL><INDENT>if verbose:<EOL><INDENT>print("<STR_LIT>".format(self.params.nboots))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>while self.checkpoint.boots < self.params.nboots:<EOL><INDENT>if self.files.mapfile:<EOL><INDENT>self._sample_bootseq_array_map()<EOL><DEDENT>else:<EOL><INDENT>self._sample_bootseq_array() <EOL><DEDENT>self.checkpoint.boots += <NUM_LIT:1><EOL>self._inference(start, lbview, quiet=verbose == <NUM_LIT:0>)<EOL><DEDENT><DEDENT>if verbose:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT><DEDENT>self.files.stats = os.path.join(self.dirs, self.name+"<STR_LIT>")<EOL>if not self.kwargs.get("<STR_LIT>"):<EOL><INDENT>self._compute_tree_stats(ipyclient)<EOL><DEDENT>else:<EOL><INDENT>self._finalize_stats(ipyclient)<EOL><DEDENT><DEDENT>except KeyboardInterrupt as inst:<EOL><INDENT>LOGGER.info("<STR_LIT>")<EOL>print("<STR_LIT>")<EOL><DEDENT>except IPyradWarningExit as inst:<EOL><INDENT>LOGGER.info("<STR_LIT>", inst)<EOL>print(inst)<EOL><DEDENT>except Exception as inst:<EOL><INDENT>LOGGER.info("<STR_LIT>", inst)<EOL>print("<STR_LIT>".format(inst))<EOL><DEDENT>finally:<EOL><INDENT>try:<EOL><INDENT>self._save()                <EOL>if ipyclient:<EOL><INDENT>ipyclient.abort()<EOL>LOGGER.info("<STR_LIT>", self._ipcluster["<STR_LIT>"])<EOL>for engine_id, pid in self._ipcluster["<STR_LIT>"].items():<EOL><INDENT>LOGGER.info("<STR_LIT>", engine_id)<EOL>LOGGER.info("<STR_LIT>", pid)<EOL>LOGGER.info("<STR_LIT>", ipyclient.queue_status()[engine_id]["<STR_LIT>"])<EOL>if ipyclient.queue_status()[engine_id]["<STR_LIT>"]:<EOL><INDENT>LOGGER.info('<STR_LIT>'.format(engine_id, pid))<EOL>os.kill(pid, <NUM_LIT:2>)<EOL><DEDENT><DEDENT>time.sleep(<NUM_LIT:1>)<EOL>if '<STR_LIT>' in self._ipcluster["<STR_LIT>"]:<EOL><INDENT>LOGGER.info("<STR_LIT>")<EOL>ipyclient.shutdown(hub=True, block=False)<EOL>ipyclient.close()<EOL>LOGGER.info("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>if not ipyclient.outstanding:<EOL><INDENT>ipyclient.purge_everything()<EOL><DEDENT>else:<EOL><INDENT>ipyclient.shutdown(hub=True, block=False)<EOL>ipyclient.close()<EOL>print("<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT>if inst:<EOL><INDENT>raise inst<EOL><DEDENT><DEDENT>except Exception as inst2:<EOL><INDENT>print("<STR_LIT>".format(inst2))<EOL>LOGGER.error("<STR_LIT>", inst2)<EOL><DEDENT><DEDENT>
Run quartet inference on a SNP alignment and distribute work
across an ipyparallel cluster (ipyclient). Unless passed an 
ipyclient explicitly, it looks for a running ipcluster instance
running from the defautl ("") profile, and will raise an exception
if one is not found within a set time limit. If not using the default
profile then you can set "profile" as an argument to the tetrad object. 
Parameter settings influencing the run (e.g., nquartets, method) should
be set on the tetrad Class object itself. 

Parameters
----------
force (bool):
    Overwrite results for an object with this name if they exist.
verbose (int):
    0=print nothing, 1=print progress bars, 2=print progress bars and
    print cluster info. 
ipyclient (ipyparallel.Client object):
    Default is None (use running Default ipcluster instance). To use
    a different ipcluster instance start a Client class object 
    and pass it in as an argument here.