Closed tasansal closed 6 months ago
This PR includes modifications to the blocked_io.py and mdio.py scripts to enhance CPU utilization reconfigurability through environment variables.
blocked_io.py
mdio.py
The MDIO__IMPORT__CPU_COUNT and MDIO__EXPORT__CPU_COUNT allow users to specify how many cores to use.
MDIO__IMPORT__CPU_COUNT
MDIO__EXPORT__CPU_COUNT
If the variables don't exist, it will use all the available cores of the machine.
NUM_CORES
default_cpus = cpu_count(logical=True) NUM_CPUS = int(os.getenv("MDIO__IMPORT__CPU_COUNT", default_cpus))
default_cpus = cpu_count(logical=True) NUM_CPUS = int(os.getenv("MDIO__EXPORT__CPU_COUNT", default_cpus))
These changes aim to provide better control over CPU usage through environment variables.
Overview
This PR includes modifications to the
blocked_io.py
andmdio.py
scripts to enhance CPU utilization reconfigurability through environment variables.The
MDIO__IMPORT__CPU_COUNT
andMDIO__EXPORT__CPU_COUNT
allow users to specify how many cores to use.If the variables don't exist, it will use all the available cores of the machine.
Changes in
blocked_io.py
NUM_CORES
definition with a more flexible approach:Changes in
mdio.py
Summary
These changes aim to provide better control over CPU usage through environment variables.