I made a simple multiprocessing code, but I think it doesn't work.
When I tried this code at my laptop, I checked the processor through activity monitor app, and it showed that some processors worked. So, with this code, I ran it at workstation(Core up to 28 and used 24), and checked it again through task manager. But, CPU usage doesn't increase, just processors increased.
# Multiprocessing
def multi(input_field):
result = subvolume.label(input_field)
return result
test_list = [resampled_sub_1, resampled_sub_2, resampled_sub_3,
resampled_sub_4, resampled_sub_5]
if __name__ == '__main__':
pool = multiprocessing.Pool(processes=24)
results = pool.map(multi, test_list)
pool.close()
pool.join()
When multiprocessing is done right, I think CPU usage increased than this. Where did I do something wrong?