- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello to everyone!
Yesterday I was looking at the new F2008 standards and I noticed a new type of loop, the DO CONCURRENT. I discovered it is now implemented in Fortran Composer XE 2011. I red its description and I think it is very similar (perhaps equal) to the forall statement. Is this new statement replacing the forall? Or there are some differences between these statements? Thank you very much for all the answers.
Yesterday I was looking at the new F2008 standards and I noticed a new type of loop, the DO CONCURRENT. I discovered it is now implemented in Fortran Composer XE 2011. I red its description and I think it is very similar (perhaps equal) to the forall statement. Is this new statement replacing the forall? Or there are some differences between these statements? Thank you very much for all the answers.
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, DO CONCURRENT is "FORALL done right". The problem with FORALL was its semantics as a series of array assignments that had to be executed one after the other. Many people thought of FORALL as a "parallel DO", which it was not, and it was difficult to parallelize effectively. DO CONCURRENT is much simpler and specifies that each "instance" of the DO body can be executed in any order. The Intel compiler will try to parallelize DO CONCURRENT when /parallel is specified.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, thank you very much for your quick answer. I must admit that I'm a little shocked because I always admitted that the compiler could easily parallelize the forall statement, since it also specifies that each iteration of the loop could be executed in any order. Personally, I thought that the forall statement was created precisely to allow an easy parallelization of the code. One more question, if inside the DO CONCURRENT exists more than one code statement, they are serially executed, like in the forall? Thank you.
Pedro
Pedro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The statements within the DO CONCURRENT are executed in order, in each "iteration", but there is no dependence on other iterations. FORALL could have array assignments only, but each assignment needed to be completed by all iterations before the next one executed, effectively creating a "wait for all" after each assignment. Yes, the idea of FORALL was to help with parallelization, but like a lot of High-Performance Fortran, the obsolete variant from which FORALL comes, it was not well thought through and parallelization was much more difficult than it seemed it would.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Steve. Now I really understand the differences between the forall and the do concurrent. I must admit that I am surprised with your "revelations". I have one side question to make: when will be implemented the block construct? It's one of the F2008 features that I find very useful. Thank again for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't tell you at this time when BLOCK will appear in our compiler.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok. I will keep an eye on Intel Fortran releases. I understand that implement all the 2008 features will take some time. Tank you very much for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just noticed that DO CONCURRENT accepts the !DIR$ VECTOR ..... directives where FORALL did not.
gfortran 4.7 (getting close to release) supports DO CONCURRENT.
gfortran 4.7 (getting close to release) supports DO CONCURRENT.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page