# Basic OpenMP Test Program Not Exiting

**URL:** <https://fortran-lang.discourse.group/t/basic-openmp-test-program-not-exiting/9413>\
**Category:** Uncategorized\
**Created:** [March 19, 2025, 8:43pm UTC](https://fortran-lang.discourse.group/t/basic-openmp-test-program-not-exiting/9413 "2025-03-19T20:43:28Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![JohnCampbell](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@JohnCampbell](https://fortran-lang.discourse.group/u/JohnCampbell)\
**Post date:** [March 21, 2025, 12:18am UTC](https://fortran-lang.discourse.group/t/basic-openmp-test-program-not-exiting/9413/10 "2025-03-21T00:18:55Z")

</div>

This problem with using CALL OMP\_SET\_NUM\_THREADS(nthreads) was introduced after Gfortran ver 11.1.0 on the Windows version supplied by [equation.com](http://equation.com)  
implementation. I have not been able to get a response to reporting this issue.  
I have not tested other sources of Windows versions of Gfortran, since 11.1.0.

As noted, using the NUM\_THREADS clause fixed the issue, but this requires a rework of all previous codes.

I have previously noted this issue, including at the end of:

> [@OpenMP and FORTRAN](https://fortran-lang.discourse.group/t/openmp-and-fortran/7807):
>
> Hi, I put my 30-year old FORTRAN code on 2D Euler-flow turbulence simulations here: It runs fine in my 12-core-CPU-15GB RAM laptop with all cores getting triggered, but wondering if I still missed any trick in optimization like gfortran -O3 -Ofast -openmp hooks. Added openmp stuff like: USE OMP\_LIB !$OMP PARALLEL Am I missing any other trick in the book … Thanks, Suki

Non Windows versions do not have this problem.

---

_[View the full topic](https://fortran-lang.discourse.group/t/basic-openmp-test-program-not-exiting/9413)._
