Fixed loop exiting
This commit is contained in:
parent
76e54a682a
commit
761fb92d2d
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import math, sys, os, time, pp, math, re
|
import math, sys, os, time, pp, math, re
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
|
|
||||||
# tuple of all parallel python servers to connect with
|
# tuple of all parallel python servers to connect with
|
||||||
ppservers = ()
|
ppservers = ()
|
||||||
#ppservers = ("10.0.0.1",)
|
#ppservers = ("10.0.0.1",)
|
||||||
@ -8,9 +9,11 @@ ppservers = ()
|
|||||||
# Number of jobs to run
|
# Number of jobs to run
|
||||||
parts = 1000000
|
parts = 1000000
|
||||||
|
|
||||||
|
|
||||||
jobs = []
|
jobs = []
|
||||||
current = 0
|
current = 0
|
||||||
|
|
||||||
|
|
||||||
def backtesting(ind):
|
def backtesting(ind):
|
||||||
er1 = str(ind)
|
er1 = str(ind)
|
||||||
ou1 = str(ind * 1024)
|
ou1 = str(ind * 1024)
|
||||||
@ -42,10 +45,10 @@ print("Starting pp with", job_server.get_ncpus(), "workers")
|
|||||||
|
|
||||||
|
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
i = 0
|
index = 1
|
||||||
while parts < i:
|
while parts > index:
|
||||||
i += 1
|
|
||||||
jobs.append(job_server.submit(backtesting, (index,)))
|
jobs.append(job_server.submit(backtesting, (index,)))
|
||||||
|
index += 1
|
||||||
while True:
|
while True:
|
||||||
for job in jobs:
|
for job in jobs:
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user