Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion bittensor/commands/overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,18 @@ def run(cli: 'bittensor.cli'):
}
all_hotkey_addresses = list(hotkey_addr_to_wallet.keys())

# Create a copy of the config without the parser and formatter_class.
## This is needed to pass to the ProcessPoolExecutor, which cannot pickle the parser.
copy_config = cli.config.copy()
copy_config['__parser'] = None
copy_config['formatter_class'] = None

# Pull neuron info for all keys.
## Max len(netuids) or 5 threads.
with ProcessPoolExecutor(max_workers=max(len(netuids), 5)) as executor:
results = executor.map(
OverviewCommand._get_neurons_for_netuid,
[(cli.config, netuid, all_hotkey_addresses) for netuid in netuids],
[(copy_config, netuid, all_hotkey_addresses) for netuid in netuids],
)
executor.shutdown(wait=True) # wait for all complete

Expand Down