So, I was creating a monitor function to monitor a process for benchmarking.
This is the function
def monitor(target):
worker_process = mp.Process(target=target, args=(5, bounds, num_particles, max_iter, None))
worker_process.start()
p = psutil.Process(worker_process.pid)
cpu_percents = []
while worker_process.is_alive():
test = p.cpu_percent()
if test != 0.0:
cpu_percents.append(test)
worker_process.join()
return cpu_percents
cpu_percents = monitor(target=GSO)
i got the cpu usage of the function that i was monitoring, but the cpu percent()/number of cpus was greater than 100, i don't understand what's going on can someone explain.
reason why i have divided by number of cpus is given in this post