import math, time
def isprime(n):
"""Returns True if n is prime and False otherwise"""
if not isinstance(n, int):
raise TypeError("argument passed to is_prime is not of 'int' type")
if n < 2:
return False
if n == 2:
return True
max = int(math.ceil(math.sqrt(n)))
i = 2
while i 1:
ncpus = int(sys.argv[1])
# Creates jobserver with ncpus workers
job_server = pp.Server(ncpus, ppservers=ppservers)
else:
# Creates jobserver with automatically detected number of workers
job_server = pp.Server(ppservers=ppservers)
print "Starting pp with", job_server.get_ncpus(), "workers"
start_time = time.time()
# job1 = job_server.submit(sum_primes, (100,), (isprime,), ("math",))
job_server.submit(func(), ("D:\\Dev\\Python\\pp\\arcgis_test", ), (), ("arcgisscripting", "os"))
print "Time elapsed: ", time.time() - start_time, "s"
job_server.print_stats()