[J3] [SC22WG5.6408] Kickstarting proposals for F202Y features
Jeff Hammond
jehammond at nvidia.com
Tue Jul 5 14:00:44 UTC 2022
On 4Jul 2022, at 11:43 PM, Van Snyder <van.snyder at sbcglobal.net<mailto:van.snyder at sbcglobal.net>> wrote:
External email: Use caution opening links or attachments
On Mon, 2022-07-04 at 09:10 +0000, Jeff Hammond via J3 wrote:
From:Jeff Hammond <jehammond at nvidia.com<mailto:jehammond at nvidia.com>>My desired features for 2Y are:
1. fetch-and-op atomics in DO CONCURRENT
2. asynchronous blocks / tasks (equivalent to OpenACC async and OpenMP non-dependent tasks)
Ada had tasks in the 1976 requirements and the 1983 standard. They pondered asynchronous blocks and concluded they're too unreliable. As described by Burns and Wellings in "oncurrent and Real Time Programming in Ada," another concept called a "protected variable" was introduced to cope with the inherent inefficiency of tasking. Protected variables are essentially the same thing as coroutines.
It's easier, and probably more reliable, to stand on the shoulders of giants than to re-invent the wheel from scratch.
If you think we should limit Fortran 2026 to what Ada was willing to do in 1983, I don’t know what to tell you. Fortran isn’t Ada and it has been almost 40 years since that decision. Many aspects of computing have changed and we do things today that were almost unimaginable in 1983.
As far as giants go, many other programming languages, particularly those designed after 1983, have made different choices, and offer one or more forms of asynchronous task parallelism (async, coroutines, futures, etc). These languages are more widely used (in the sense of being written, as opposed to living in ROM in some DOD warehouse) than Fortran, so perhaps we ought to consider whether asynchrony is an essential feature of a 21st century programming language.
C++ https://en.cppreference.com/w/cpp/thread/async
C# https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/
Go https://go.dev/tour/concurrency/1
Java https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/FutureTask.html
Kotlin https://kotlinlang.org/docs/async-programming.html#threading
Python https://docs.python.org/3/library/asyncio-task.html
Scala https://docs.scala-lang.org/overviews/core/futures.html
Swift https://docs.swift.org/swift-book/LanguageGuide/Concurrency.html
We can also see that Fortran programmers already use precisely this feature from OpenMP or OpenACC, and most of the major Fortran compilers support one or both of these, so there is established practice using this feature in Fortran applications and implementation it in Fortran compilers. Certainly within an important subset of the Fortran user community, they have been proven to be reliable enough to use on a range of systems.
I’ll also note that the lack of asynchrony in Fortran is the single greatest impediment to me writing pure Fortran. This is the one thing that I absolutely cannot do in a reasonable way without stepping outside the language to use CUDA, OpenACC, or OpenMP.
Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20220705/0f5b2926/attachment.htm>
More information about the J3
mailing list