Fatal User Error 1002: '#pragma omp single' improperly nested in a work-sharing construct

GROMACS version:2025.2
GROMACS modification: No
Hello Gromacs users,

I built Gromacs version 2025.2 on Windows 11 by using Microsoft Visual Studio with GPU. The MD simulations started well both with and without the GPU, but when I ran the simulation with position restraints, I got the following error at the start of the calculation:

Fatal User Error 1002: '#pragma omp single' improperly nested in a work-sharing construct

Could you please help me solve this problem? I think I should re-compile Gromacs, maybe by adding -DGMX_OPENMP=ON ?

Hi!

What is the exact version of Visual Studio you are using and the full error message?

The error actually originated because you already have OpenMP enabled. But looks like the Visual Studio compiler does not like our code.

Disabling OpenMP ( -DGMX_OPENMP=OFF) would be one solution, but it will significantly reduce the performance. If you share more details, perhaps we can find a fix or a more narrow workaround.