Hi John,

I would like to report a problem I have identified with using “call omp_set_num_threads (n)”, which has appeared when on Windows 10 using Gfortran version 11.3.0, (12.3.0 and 14.1.0).

Prior versions ( 9.2.0, 10.2.0 and 11.1.0 run to completion.

The reproducer program below does not exit, but hangs after the last print statement. ( I wonder if there are excess threads outside the END DO?)

I have experienced this problem for a while now, mainly with small demonstration programs on https://fortran-lang.discourse.group <https://fortran-lang.discourse.group>, but now have identified the cause of the program hanging.

I have listed a simple reproducer below which exhibits the problem if "call omp_set_num_threads (4)" is included. I am not aware that this form of usage of omp_set_num_threads has been made obsolete ?

I tried your program on Linux (current trunk and 11.4), Cygwin under
Windows (11.4.0) and the mingw-w64 cross compiler under Cygwin (also
11.4.0). None of these compilers had issues,so

> I am unsure where the bug is located. It could be in either Gfortran
> or Equation.com's windows thread interface modifications.

it seems to be a bug introduced by equation.com, which should be
reported to them.

Maybe you are better off using the mingw-64 compiler, available from
their website (together with msys2).

Best regards

        Thomas

Reply via email to