I have a Python script launching a C++ executable.
The C++ executable is a multithreaded program that usually takes several hours to run. The way the C++ code is written, it will run on all the cores of the CPU if possible.
However, when I run the Python script and check my task manager, I read that the Python script is only using 30% of my CPU. I think this 30% includes the CPU usage of the subprocess running the executable as well, because the executable appears in the task manager with 0% CPU usage (but it's indeed running and producing results). Sometimes the executable will spike to 7% CPU usage and go right back down to 0%.
Is there a way I can increase the CPU usage of this subprocess to save time?
EDIT: Maybe i should specify that this Python script is communicating with the C++ subprocess through a pipe. While it's running, the subprocess sends back a lot of information through the pipe that the Python script uploads to a database which might explain the high CPU usage of the script.