How can I compile source code with openmp?And why is the openmp compiled with gcc so inefficient?

khalil: <p>I compile pytorch(1.5.0) source code with the following setting:<br>
GCC-7.4.0<br>
cmake-3.10.3<br>
python3.7.6</p>
<p>And I export the following environment variables:<br>
export USE_CUDA=0<br>
export USE_OPENMP=1</p>
<p>I build it successfully but I found it can not use multi CPU cores(or make full use of CPU cores?).I set different number of threads and the execution time has not changed.Just like this:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/1/f/1fe308043034a0bc683a15219f07e461c2fb3125.png" data-download-href="https://discuss.pytorch.org/uploads/default/1fe308043034a0bc683a15219f07e461c2fb3125" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/1/f/1fe308043034a0bc683a15219f07e461c2fb3125.png" alt="image" data-base62-sha1="4y5dglFjcxCbk2aXkIvlCWfUv77" width="690" height="113" data-dominant-color="060606"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1120×185 5.44 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>And when I test the utilization of CPU,I found that only one core was 100 percent utilized, and all the others were 3 to 4 percent utilized.</p>
<p>Then I use pip to install pytorch and I find the situation is different.What caused this ？<br>
I print the DLLs:<br>
compile source code:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/d/a/da98a1c3183d042246147aeeca4c29e5e05a8e33.png" data-download-href="https://discuss.pytorch.org/uploads/default/da98a1c3183d042246147aeeca4c29e5e05a8e33" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/d/a/da98a1c3183d042246147aeeca4c29e5e05a8e33.png" alt="image" data-base62-sha1="vbN6fHCkjrYTVueCXQ5I125ySJR" width="690" height="207" data-dominant-color="0E0F0E"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1011×304 10.8 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>pip install:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/c/a/cad3fcebb982670f3127e975fb38d1334de8cd50.png" data-download-href="https://discuss.pytorch.org/uploads/default/cad3fcebb982670f3127e975fb38d1334de8cd50" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/c/a/cad3fcebb982670f3127e975fb38d1334de8cd50.png" alt="image" data-base62-sha1="sWiD8ctDLQuWAx96MO65xhu3mY8" width="690" height="102" data-dominant-color="0B0B0B"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1319×195 9.01 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>The lipgomp.so is different and Is it the reason?</p>