Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 555 Bytes

2023-10-05-test-cpus.md

File metadata and controls

31 lines (22 loc) · 555 Bytes
layout title description category tags
post
Testing full use of CPUs
Testing full use of CPUs
notebook
programming
python
deep learning

{% include JB/setup %}

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)