# OpenMP and thread-safety of I/Os (write, read...)

**URL:** <https://fortran-lang.discourse.group/t/openmp-and-thread-safety-of-i-os-write-read/4567>\
**Category:** Uncategorized\
**Created:** [October 19, 2022, 2:12pm UTC](https://fortran-lang.discourse.group/t/openmp-and-thread-safety-of-i-os-write-read/4567 "2022-10-19T14:12:02Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![FortranFan](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@FortranFan](https://fortran-lang.discourse.group/u/FortranFan)\
**Post date:** [October 20, 2022, 2:38pm UTC](https://fortran-lang.discourse.group/t/openmp-and-thread-safety-of-i-os-write-read/4567/12 "2022-10-20T14:38:54Z")

</div>

> [@PierU](#):
>
> … I am mainly using ifort, but occasionnaly gfortran too …

@PierU,

As things stand, the issues and challenges and the fixes and workarounds you experience in this area will vary with compiler implementations and also their versions.

If you are “mainly using ifort,” you may also want to inquire at the Intel Fortran forum:

> **[Intel® Fortran Compiler](https://community.intel.com/t5/Intel-Fortran-Compiler/bd-p/fortran-compiler)**
>
> Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Also, please note there is an outstanding support request with Intel re: thread-safety of `list-directed` I/O . So until that gets resolved, you may want to be careful with list-directed IO in any concurrent execution scenarios, OpenMP or otherwise.

And with Intel Fortran, you may want to try to their latest oneAPI version and start with small reproducer-type test cases attempting other IO (besides list-directed) with OpenMP and see if you get them to work. If such cases fail, either post them at the above Intel forum and request assistance with them; or, if you are able to buy their support subscription, then do so to get more direct service via their Software Center:  
[https://supporttickets.intel.com/?lang=en-US](https://supporttickets.intel.com/?lang=en-US)

The small cases can also help you with gfortran and in case of any problems, you may want to follow-up at [GFortran - GCC Wiki](https://gcc.gnu.org/wiki/GFortran#Reporting_bugs).

---

_[View the full topic](https://fortran-lang.discourse.group/t/openmp-and-thread-safety-of-i-os-write-read/4567)._
