Since we’ve been testing GPUs, for the sake of completeness, here’s how one can make all the CPU power in a machine go to work.
Brrrr…
#!/usr/bin/env python
"""
Test using all CPUs with parmap.
"""
import parmap
def do(n):
i = 0
for i in range(n):
n += 1
parmap.map(do, [1000000000] * 1000, pm_processes=28)