Skip to content

Commit

Permalink
change to count using allowed processes
Browse files Browse the repository at this point in the history
  • Loading branch information
camfairchild committed Jul 25, 2022
1 parent 0885919 commit 5ac648b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bittensor/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import math
import multiprocessing
import numbers

import os
import random
import time
from dataclasses import dataclass
Expand Down Expand Up @@ -242,7 +242,8 @@ def solve_for_difficulty_fast( subtensor, wallet, num_processes: Optional[int] =
to increase the transparency of the process while still keeping the speed.
"""
if num_processes == None:
num_processes = multiprocessing.cpu_count()
# get the number of allowed processes for this process
num_processes = len(os.sched_getaffinity(0))

if update_interval is None:
update_interval = 50_000
Expand Down

0 comments on commit 5ac648b

Please sign in to comment.