# Do vs do concurrent

**URL:** <https://fortran-lang.discourse.group/t/do-vs-do-concurrent/7829>\
**Category:** Uncategorized\
**Created:** [April 12, 2024, 12:37pm UTC](https://fortran-lang.discourse.group/t/do-vs-do-concurrent/7829 "2024-04-12T12:37:05Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![hkvzjal](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/hkvzjal/32/3055_2.png) [@hkvzjal](https://fortran-lang.discourse.group/u/hkvzjal)\
**Post date:** [April 12, 2024, 12:53pm UTC](https://fortran-lang.discourse.group/t/do-vs-do-concurrent/7829/2 "2024-04-12T12:53:08Z")

</div>

Do concurrent by itself won’t do anything more than a simple do… To start exploring what you can do with `do concurrent` you have to activate OpenMP or with intel compilers `-qparallel`.

Oh well, you could get one thing though, `do concurrent` implies that only pure functions can be called within. So it is a good warning for “future proof” development.

You will find a lot of information in these discussions:

> [@DO CONCURRENT: compiler flags to enable parallelization](https://fortran-lang.discourse.group/t/do-concurrent-compiler-flags-to-enable-parallelization/4300):
>
> If I understand correctly, a do concurrent construct does not necessarily imply that the code inside the block will run in parallel, because (for instance) the compiler might estimate that the compute task does not justify the overhead of parallelization. On the other hand, I have doubts about what must be done to allow the compiler to consider a possible parallelization. More specifically, my questions are: Is it correct that parallelization of do and do concurrent loops is deactivated by de…

> [@Clarification on DO CONCURRENT](https://fortran-lang.discourse.group/t/clarification-on-do-concurrent/1647/6):
>
> I have a question. What is the difference between a variable with SHARED locality compared with one with unspecified locality (in a do concurrent of course)? Are there examples of different behaviour, or is the SHARED locality just a guarantee given by the programmer to the compiler? Or examples where without the SHARED locality the code is non conforming. Thanks

---

_[View the full topic](https://fortran-lang.discourse.group/t/do-vs-do-concurrent/7829)._
