subgroupcheck.sage: ensure that progress dots are printed consistently by all threads.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2021-03-01 19:06:09 +00:00
parent c51449a535
commit b4a8d29ca1
1 changed files with 4 additions and 2 deletions

View File

@ -51,15 +51,17 @@ def real_worker(which, p, omega, wid, workers):
print("Worker %d for %s" % (wid, which))
lowest = 1<<240
dot = workers*65536
dot = 0
x = omega^wid
m = omega^workers
for i in range(wid, 1<<32, workers):
if i % dot == 1:
if dot == 65536:
sys.stdout.write('.')
sys.stdout.flush()
dot = 0
dot += 1
if int(x) < lowest:
lowest = int(x)