From Newsgroup: comp.lang.ada
Great news for the Ada community!
Many Ada users were excited about the support for light-weight
parallelism in the Ada 2022 standard, but disappointed it was not
yet implemented in an Ada compiler.
ARG member Richard Wai recently posted announcements about support
for the Ada 2022 parallel "for" and parallel "do" features. A copy
is provided below for your information.
Richard wrote: "We would love to have more members of the Ada community
try-out these features." If you do, please keep us all informed!
Dirk Craeynest
-- cut here ------- >8 ------- >8 ------- >8 ------- >8 ------- >8 -----
[ Copied from the ada-lang.io forum [1] -- dc ]
Ada 2022 'parallel' implementation beta for FSF GCC/GNAT
Richard-Wai
I am very pleased to announce that the core Ada 2022 "parallel"
features have been implemented for mainline FSF GNAT as part of a
successful Google Summer of Code project. The patch is now ready
for beta testing.
We are preparing to formally submit this patch to the FSF GCC project,
to have it incorporated into GCC trunk, and therefore all future
FSF GCC releases. Before we make that submission, we hope to seek
additional feedback from the Ada community.
This patch introduces most core capabilities for the parallel keyword, including:
* Parallel loops
* Parallel blocks
* Early exit
* Chunking
This patch does NOT yet support Parallel Iterators - but this is
being actively worked on and hopefully will be completed soon.
The GSoC project work was hosted on the Ada Rapporteur Group's own
GCC mirror github repo, and the stable version of the parallel beta
release currently lives at [2].
This branch can be built and bootstrapped as-is on most mainstream
platforms using FSF GCC 15, with a standard build process.
No additional libraries or build flags are needed, as the parallel
features do not imply any new complier, runtime, or platform
dependencies.
Additionally, Maxim Reznik has made available binary builds of the
parallel support beta for most popular platforms. He also includes instructions on how to get going with Alire. Look for the "GCC with
parallel PREVIEW" release at [3]. Expand the "Assets" area at the
bottom of the section to download binary builds for your platform.
By default, GNAT will expand parallel loops/blocks into sequential
(regular) loops resp. blocks. To get actual parallelization of
parallel constructs, the existence of an Ada "light weight threading"
library (formally an Ada subsystem a la the Ada Reference Manual
10.1-3) is required. GNAT will detect the presence of the "LWT"
subsystem at compile-time, and if "withed", will generate calls to
the LWT subsystem during expansion. It is therefore conventional
that the unit containing the main subprogram "withs" LWT. Refer to
the example programs included with the reference LWT subsystem to
see how this works.
A reference LWT subsystem implementation currently lives under
the Parasail language project [4]. This may be separated from the
Parasail repository at a later time. This LWT implementation is also
an official Alire crate of the same name, and Maxim's instructions
detail how to install LWT and use the beta toolchain under Alire.
The reference LWT subsystem could potentially be incorporated into
the GNAT standard library (libgnat) at some point in the future, but
it was decided to keep the first iteration as simple and digestible
as possible.
This is only the first phase, and we look forward to additional
refinements in the future!
[1]
https://forum.ada-lang.io/t/ada-2022-parallel-implementation-beta-for-fsf-gcc-gnat/4054
[2]
https://github.com/Ada-Rapporteur-Group/gcc-mirror/tree/devel/arg-proto/ada2022-parallel-release
[3]
https://github.com/reznikmm/GNAT-FSF-builds/releases
[4]
https://github.com/parasail-lang/parasail
***
Note that Alire is NOT required to beta test this build, and simply
making the sources of the LWT reference implementation available to
the compiler is sufficient (using -I for gcc or gnatmake).
There are also some Ada 2022 parallel example programs under
lwt/a22_examples, and these can be build and run with the vanilla
FSF GNAT toolchain as follows (Linux/UNIX):
$ git clone
https://github.com/parasail-lang/parasail
$ cd parasail/lwt/a22_examples
$ gnatmake -gnat2022 -I../ n_queens.adb
$ ./n_queens
***
We would love to have more members of the Ada community try-out these
features. Please let me know if you need any support getting set up,
or if you have any other questions.
-- cut here ------- >8 ------- >8 ------- >8 ------- >8 ------- >8 -----
--- Synchronet 3.21a-Linux NewsLink 1.2