Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] OSError: [WinError 87] The parameter is incorrect #2204

Open
phaniparsa opened this issue Feb 14, 2023 · 1 comment
Open

[Windows] OSError: [WinError 87] The parameter is incorrect #2204

phaniparsa opened this issue Feb 14, 2023 · 1 comment

Comments

@phaniparsa
Copy link

Summary

  • OS: Windows
  • Architecture: 64bit, Intel(R) Xeon(R) CPU E5-2673 v3@2.40 GHz
  • Psutil version: 5.9.0
  • Python version: 3.9.13
  • Type: { core, doc, performance, scripts, tests, wheels, new-api, installation }

Description

I am running the code available in this Git Repo: https://github.com/Merck/Line-of-Therapy-Algorithm/blob/master/Python/rwToT_LoT_main_parallel.py

and especially with the below lines of code:
ctx = multiprocessing.get_context('spawn')
pool = ctx.Pool(nprocesses)
processes = [p.pid for p in pool._pool]
for pid in processes:
p = psutil.Process(pid)
p.nice(5)
pool_results = pool.map(process_chunk, input_chunk)
pool.close()

When setting the niceness value for the process (process was created using multiprocessing), code is throwing the below error:
image

Could you please confirm if this is Bug? If not, could anyone please help me in fixing me this error. Thank you.

@giampaolo
Copy link
Owner

What happens if instead of passing it a number (5) you pass one of the *_PRIORITY_CLASS constants?
https://psutil.readthedocs.io/en/latest/#psutil.REALTIME_PRIORITY_CLASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants