Use of OMP_NUM_THREADS=1 for Python Multiprocessing

后端 未结 2 1920
Happy的楠姐
Happy的楠姐 2020-12-19 05:05

I heard that using OMP_NUM_THREADS=1 before calling a Python script that use multiprocessing make the script faster.

Is it true or not ? If yes, why so

2条回答
  •  没有蜡笔的小新
    2020-12-19 05:29

    Resolved in comments:

    OMP_NUM_THREADS is an option for OpenMP, a C/C++/Fortran API for doing multi-threading within a process.
    It's unclear how that's even related to Python multiprocessing.
    Is your Python program calling modules written in C that use OpenMP internally? – Wyzard

提交回复
热议问题