def default_partition_func(self): if metis_available(): print "Defaulting to metis partitioner" return metis_partitioner else: print "Defaulting to work-balanced partitioner" return work_balanced_partitioner
from nengo.utils.builder import find_all_io from nengo.utils.compat import is_iterable, itervalues from nengo_mpi import PartitionError from nengo_mpi.spaun_mpi import SpaunStimulus from nengo_mpi.partition.work_balanced import work_balanced_partitioner from nengo_mpi.partition.metis import metis_available, metis_partitioner from nengo_mpi.partition.random import random_partitioner import logging logger = logging.getLogger(__name__) _partitioners = [random_partitioner, work_balanced_partitioner] if metis_available(): _partitioners.append(metis_partitioner) def partitioners(): return _partitioners[:] def get_probed_connections(network): """ Return all connections that have probes in ``network``. """ probed_connections = [] for probe in network.all_probes: if isinstance(probe.target, Connection): probed_connections.append(probe.target) return probed_connections