# Question about OpenMP support

**URL:** <https://gromacs.bioexcel.eu/t/question-about-openmp-support/4065>\
**Category:** User discussions\
**Created:** [April 25, 2022, 1:42am UTC](https://gromacs.bioexcel.eu/t/question-about-openmp-support/4065 "2022-04-25T01:42:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![syk1311](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@syk1311](https://gromacs.bioexcel.eu/u/syk1311)\
**Post date:** [April 25, 2022, 1:42am UTC](https://gromacs.bioexcel.eu/t/question-about-openmp-support/4065/1 "2022-04-25T01:42:09Z")

</div>

GROMACS version:2021.3  
GROMACS modification: No

 ![Screenshot from 2022-04-25 09-30-35](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/5/5f61700ff1c14735d8192ec93a52d539124de7d0.png)  
 ![Screenshot from 2022-04-25 09-36-03](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/b/ba38737f5291dce10931b4ac95f3727e86364420.png)  
My GPU is NVIDIA RTX A4000. In the first picture, OpenMP support: enabled (GMX\_OPENMP\_MAX\_THREADS = 64). But in the second picture, when I run the simulation, it only uses 16 OpenMP threads. How can I use more OpenMP threads during my simulation?  
Thank you very much.

---

<div class="post-metadata">

**Author:** ![ggsmith123](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/ggsmith123/32/520_2.png) [@ggsmith123](https://gromacs.bioexcel.eu/u/ggsmith123)\
**Post date:** [April 25, 2022, 4:09pm UTC](https://gromacs.bioexcel.eu/t/question-about-openmp-support/4065/2 "2022-04-25T16:09:30Z")

</div>

I don’t know that I can help that much since I’m no expert, but this sounds like CPU core parallelism to me. I always understood the GPU use to be in the CUDA, not the openMP. Your computer probably has 16 CPU cores; I don’t think you can use more threads than that.

Greg

---

<div class="post-metadata">

**Author:** ![pszilard](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/pszilard/32/21_2.png) [@pszilard](https://gromacs.bioexcel.eu/u/pszilard)\
**Post date:** [April 26, 2022, 9:37am UTC](https://gromacs.bioexcel.eu/t/question-about-openmp-support/4065/3 "2022-04-26T09:37:47Z")

</div>

> [@ggsmith123](#):
>
> this sounds like CPU core parallelism to me. I always understood the GPU use to be in the CUDA, not the openMP. Your computer probably has 16 CPU cores; I don’t think you can use more threads than that.

Correct.

> OpenMP support: enabled (GMX\_OPENMP\_MAX\_THREADS = 64).

This means that OpenMP multi-threading for using multiple CPU cores (potentially paired with with a GPU) is possible, and at most 64 threads can be used per MPI rank.

The log file contains a hardware detection section which will tell you what is the number of CPU physical cores and CPU hardware threads (also called logical cores), this will determine the number of threads `mdrun` uses by default.

---

<div class="post-metadata">

**Author:** ![syk1311](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@syk1311](https://gromacs.bioexcel.eu/u/syk1311)\
**Post date:** [April 27, 2022, 1:02am UTC](https://gromacs.bioexcel.eu/t/question-about-openmp-support/4065/4 "2022-04-27T01:02:18Z")

</div>

Thank you very much. I checked my log file.

```auto
Running on 1 node with total 8 cores, 16 logical cores, 1 compatible GPU
Hardware detected:
  CPU info:
    Vendor: Intel
    Brand: 11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz
    Family: 6 Model: 167 Stepping: 1
    Features: aes apic avx avx2 avx512f avx512cd avx512bw avx512vl avx512secondFMA clfsh cmov cx8 cx16 f16c fma htt intel lahf mmx msr nonstop_tsc pcid pclmuldq pdcm pdpe1gb popcnt pse rdrnd rdtscp sha sse2 sse3 sse4.1 sse4.2 ssse3 tdt x2apic
    Number of AVX-512 FMA units: 1 (AVX2 is faster w/o 2 AVX-512 FMA units)
  Hardware topology: Basic
    Sockets, cores, and logical processors:
      Socket 0: [0 8] [1 9] [2 10] [3 11] [4 12] [5 13] [6 14] [7 15]
  GPU info:
    Number of GPUs detected: 1
    #0: NVIDIA NVIDIA RTX A4000, compute cap.: 8.6, ECC: no, stat: compatible

++++ PLEASE READ AND CITE THE FOLLOWING REFERENCE ++++

```

If I want the simulation to run faster, how should I modify the parameters of mdrun?

---

<div class="post-metadata">

**Author:** ![pszilard](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/pszilard/32/21_2.png) [@pszilard](https://gromacs.bioexcel.eu/u/pszilard)\
**Post date:** [April 27, 2022, 9:56am UTC](https://gromacs.bioexcel.eu/t/question-about-openmp-support/4065/5 "2022-04-27T09:56:25Z")

</div>

> [@syk1311](#):
>
> `Running on 1 node with total 8 cores, 16 logical cores, 1 compatible GPU`

The above shows that you have an 8-core 16-thread CPU, so `mdrun` correctly started 16 threads to use all CPU resources.

You might want to try the GPU-resident mode using `-update gpu` which could give better performance, possibly moving the bonded or PME work back to the quite fast CPU you have, i.e. `-update gpu -bonded cpu` or `-update gpu -pme cpu`.
