Skip to content

Commit 55e120c

Browse files
author
Damian Rouson
authored
Merge pull request #595 from sourceryinstitute/update-docs
Update docs: README, INSTALL, GETTING_STARTED
2 parents cd087a4 + f5420ad commit 55e120c

File tree

3 files changed

+81
-177
lines changed

3 files changed

+81
-177
lines changed

GETTING_STARTED.md

+14-51
Original file line numberDiff line numberDiff line change
@@ -25,39 +25,17 @@ path. This is an experimental script with limited but useful capabilities that w
2525
grow over time. Please submit bug reports and feature requests via our [Issues] page.
2626

2727
The `caf` script liberates the source code and workflow from explicit dependence on the
28-
underlying compiler and communication library in the following ways:
29-
30-
1. With an OpenCoarrays-aware (OCA) CAF compiler, the `caf` script passes the unmodified
31-
source code to the underlying compiler with the necessary arguments for building a
32-
CAF program, embedding the paths to OpenCoarrays libraries (e.g., `libcaf_mpi.a`) installed
33-
in the `lib` subdirectory of the OpenCoarrays installation path. The `caf` script also
34-
embeds the path to the relevant module file in the `mod` subdirectory of the installation
35-
path (e.g., `opencoarrays.mod`). This supports use association with module entities via
36-
`use opencoarrays`.
37-
2. With a non-CAF compiler (including gfortran 4.9), `caf` supports a subset of CAF by
38-
replacing CAF statements with calls to procedures in the [opencoarrays module] before
39-
passing the source code to the compiler.
40-
41-
When using GCC 4.9, we recommend using the `use` statement's `only` clause to
42-
avoid inadvertent procedure name clashes between OpenCoarrays procedures and their
43-
GCC counterparts. For example, use `use opencoarrays, only : co_reduce`.
44-
45-
With a non-OCA and OCA CAF compilers, the extensions that `caf` imports include the collective
46-
subroutines proposed for Fortran 2015 in the draft Technical Specification [TS 18508]
47-
_Additional Parallel Features in Fortran_.
48-
49-
The latter use case provides an opportunity to mix a compiler's CAF support with that of OpenCoarrays.
50-
For example, a non-OCA CAF compiler, such as the Cray or Intel compilers, might support all of a
51-
program's coarray square-bracket syntax, while OpenCoarrays supports the same program's calls to
52-
collective subroutine such as `co_sum` and `co_reduce`.
28+
underlying compiler and communication library by passing the unmodified source code to
29+
the compiler with the necessary arguments for building a parallel Fortran 2018 program,
30+
embedding the paths to OpenCoarrays libraries (e.g., `libcaf_mpi.a`) installed
31+
in the `lib` subdirectory of the OpenCoarrays installation path.
5332

5433
A sample basic workflow
5534
-----------------------
5635

5736
The following program listing, compilation, and execution workflow exemplify
58-
the use of an OCA compiler (e.g., gfortran 5.1.0 or later) in a Linux bash shell
59-
with the `bin` directory of the chosen installation path in the user's PATH
60-
environment variable:
37+
the use of OpenCoarrays with GCC in a Linux bash shell with the `bin`
38+
directory of the chosen installation path in the user's `PATH` environment variable:
6139

6240
```fortran
6341
$ cat tally.f90
@@ -89,31 +67,15 @@ where "4" is the number of images to be launched at program start-up.
8967
An advanced workflow
9068
--------------------
9169

92-
To extend the capabilities of a non-OCA CAF compiler (e.g., the Intel or Cray compilers),
93-
access the types and procedures of the [opencoarrays module] by use association. We
94-
recommend using a `use` statement with an `only` clause to reduce the likelihood of a
95-
name clash with the compiler's native CAf support. For example, insert the following
96-
at line 2 of `tally.f90` above:
97-
98-
```fortran
99-
use opencoarrays, only : co_sum
100-
```
101-
102-
To extend the capabilities of a non-CAF compiler (e.g., GCC 4.9), use an unqualified
103-
`use` statement with no `only` clause. The latter practice reduces the likelihood of
104-
name clashes with the compiler's or programs existing capabilities.
105-
106-
If the `caf` compiler wrapper cannot process the source code in question, invoke
107-
the underlying communication library directly:
108-
109-
```bash
110-
mpifort -fcoarray=lib -L/opt/opencoarrays/ tally.f90 \ -lcaf_mpi -o htally -I<OpenCoarrays-install-path>/mod
111-
```
112-
113-
and also run the program with the lower-level communication library:
70+
If you prefer to invoke the compiler directly, first run `caf` and `cafrun` with the `--show` flag
71+
to see the proper linking and file includes. For example, on a macOS system where OpenCoarrays
72+
was installed via the [homebrew] package manager, the following results:
11473

11574
```bash
116-
mpiexec -np <number-of-images> ./tally
75+
$ caf --show
76+
/usr/local/bin/gfortran -I/usr/local/Cellar/opencoarrays/2.2.0/include/OpenCoarrays-2.2.0_GNU-8.2.0 -fcoarray=lib -Wl,-flat_namespace -Wl,-commons,use_dylibs -L/usr/local/Cellar/libevent/2.1.8/lib -L/usr/local/Cellar/open-mpi/3.1.1/lib ${@} /usr/local/Cellar/opencoarrays/2.2.0/lib/libcaf_mpi.a /usr/local/lib/libmpi_usempif08.dylib /usr/local/lib/libmpi_usempi_ignore_tkr.dylib /usr/local/lib/libmpi_mpifh.dylib /usr/local/lib/libmpi.dylib
77+
$ cafrun --show
78+
/usr/local/bin/mpiexec -n <number_of_images> /path/to/coarray_Fortran_program [arg4 [arg5 [...]]]
11779
```
11880
11981
---
@@ -137,3 +99,4 @@ mpiexec -np <number-of-images> ./tally
13799
[The caf compiler wrapper]: #the-caf-compiler-wrapper
138100
[The cafrun program launcher]: #the-cafrun-program-launcher
139101
[pdf img]: https://img.shields.io/badge/PDF-GETTING_STARTED.md-6C2DC7.svg?style=flat-square "Download as PDF"
102+
[homebrew]: https://brew.sh

INSTALL.md

+13-58
Original file line numberDiff line numberDiff line change
@@ -250,55 +250,49 @@ Execute `./install.sh --help` or `./install.sh -h` to see a list of flags
250250
that can be passed to the installer. Below are examples of useful combinations
251251
of flags. Each flag also has a single-character version not shown here.
252252

253-
1. Install after building any missing prerequisites -- all source, build,
254-
and installation files will be inside the OpenCoarrays source tree under
255-
prerequisites/installations:
253+
1. If you don't care about tailoring installation locations,use
256254

257255
```
258256
./install.sh
259257
```
260258

261-
1. Install non-interactively by assuming a "yes" answer to all
262-
questions
259+
2. Or build faster by multithreading, skipping user queries, and also specify
260+
an installation destination for all packages that must be built:
263261

264262
```
265-
./install.sh --yes-to-all
263+
./install.sh \
264+
--prefix-root ${HOME}/software \
265+
--num-threads 4 \
266+
--yes-to-all
266267
```
267268

268-
1. Install with the specified compilers, overriding the default
269-
compilers:
269+
3. Specify the compilers to be used (overriding what is in your `PATH`) as follows:
270270

271271
```
272272
./install.sh --with-fortran <path-to-gcc-bin>/gfortran \
273273
--with-cxx <path-to-gcc-bin>/g++ \
274274
--with-c <path-to-gcc-bin>/gcc
275275
```
276276

277-
Without the latter arguments, [`install.sh`] will attempt to install the
278-
default GCC version even if a newer version is available. This happens
279-
to protect users from instability in cases when known one or more
280-
known regressions exist in the newer compiler.
281-
282-
1. Install only a specific prerequisite package (the default version):
283-
277+
4. Install only a specific prerequisite package (the default version):
284278
```
285279
./install.sh --package mpich
286280
```
287281

288-
1. Install a specific version of a prerequisite:
282+
5. Install a specific version of a prerequisite:
289283

290284
```
291285
./install.sh --package cmake --install-version 3.7.0
292286
```
293287

294-
1. Download a prerequisite package (e.g., gcc/gfortran/g++ below) but
288+
6. Download a prerequisite package (e.g., gcc/gfortran/g++ below) but
295289
don't build or install it:
296290

297291
```
298292
./install.sh --only-download gcc
299293
```
300294

301-
1. Print the default URL, version, or download mechanism that the
295+
7. Print the default URL, version, or download mechanism that the
302296
script will use for a given prerequisite package (e.g., mpich
303297
below) on this system:
304298

@@ -308,51 +302,12 @@ of flags. Each flag also has a single-character version not shown here.
308302
./install.sh --print-downloader mpich
309303
```
310304

311-
1. Install a prerelease branch (e.g., trunk below) of the GCC repository:
305+
8. Install a prerelease branch (e.g., trunk below) of the GCC repository:
312306

313307
```
314308
./install.sh --package gcc --install-branch trunk
315309
```
316310

317-
1. Install to a specific location:
318-
319-
```
320-
./install.sh --install-prefix /opt/gnu/
321-
```
322-
323-
If the path provided in the install prefix requires sudo privileges,
324-
the user will be prompted for a password after the package download
325-
and build complete and just before installing to the specified path.
326-
327-
1. Install a prerequisite package from a non-default URL:
328-
329-
```
330-
./install.sh --package gcc \
331-
--from-url https://github.com/sourceryinstitute/gcc/archive/teams-20170919.tar.gz \
332-
--install-version teams-20170919
333-
```
334-
335-
The latter command will install the Sourcery Institute GCC fork that provides
336-
experimental support for the Fortran 2015 teams feature.
337-
338-
1. Speed up a GCC build at a higher risk of a faild build:
339-
340-
```
341-
./install.sh --package gcc --disable-bootstrap
342-
```
343-
344-
If the latter command works, it could reduce GCC's build time from
345-
hours down to minutes.
346-
347-
1. Speed up a GCC build with multithreading at a risk of a failed build:
348-
349-
```
350-
./install.sh --package gcc --num-threads 4
351-
```
352-
353-
The latter command sometimes fails if the GCC build system has not fully
354-
specified dependencies between source files.
355-
356311
[top]
357312

358313
## Advanced Installation from Source ##

README.md

+54-68
Original file line numberDiff line numberDiff line change
@@ -29,52 +29,33 @@ OpenCoarrays
2929

3030
News
3131
----
32-
33-
You can now [try OpenCoarrays online] as a [Jupyter] [notebook kernel]
34-
using [Binder]! No downloads, configuration or installation required!
35-
Please note: the default [index.ipynb] notebook is read only. You can
36-
execute it, but if you want to make changes you should create a copy
37-
of it or create an entirely new [CAF kernel][notebook kernel]
38-
notebook.
32+
### Upcoming events ###
33+
* Nov. 5-8, 2018: "[Writing Fortran 2018 Today]" course by OpenCoarrays contributors Damian Rouson and Izaak Beekman.
34+
* Nov. 13, 2018: [Intel Speakerships at SC18] presentation by Damian Rouson and Sameer Shende
35+
* Nov. 16, 2018: SC18 [PAW-ATM Workshop] presentation by OpenCoarrays contributor Soren Rasmussen.
3936

4037
Overview
4138
--------
4239

43-
[OpenCoarrays] is an open-source software project
44-
that supports the coarray Fortran (CAF) parallel programming features
45-
of the Fortran 2008 standard and several features proposed for Fortran
46-
2015 in the draft Technical Specification [TS 18508] _Additional
47-
Parallel Features in Fortran_.
48-
49-
OpenCoarrays provides a compiler wrapper (named `caf`), a runtime
50-
library (named `libcaf_mpi.a` by default), and an executable file
51-
launcher (named `cafrun`). With OpenCoarrays-aware compilers, the
52-
compiler wrapper passes the provided source code to the chosen
53-
compiler (`mpifort` by default). For non-OpenCoarrays-aware compilers,
54-
the wrapper transforms CAF syntax into OpenCoarrays procedure calls
55-
before invoking the chosen compiler on the transformed code. The
56-
runtime library supports compiler communication and synchronization
57-
requests by invoking a lower-level communication library--the Message
58-
Passing Interface ([MPI]) by default. The launcher passes execution
59-
to the chosen communication library's parallel program launcher
60-
(`mpiexec` by default).
61-
62-
OpenCoarrays defines an application binary interface ([ABI]) that
63-
translates high-level communication and synchronization requests into
64-
low-level calls to a user-specified communication library. This
65-
design decision liberates compiler teams from hardwiring
66-
communication-library choice into their compilers and it frees Fortran
67-
programmers to express parallel algorithms once and reuse identical
68-
CAF source with whichever communication library is most efficient for
69-
a given hardware platform. The communication substrate for
70-
OpenCoarrays built with the preferred build system, CMake, is the
71-
Message Passing Interface ([MPI]).
72-
73-
OpenCoarrays enables CAF application developers to express parallel
74-
algorithms without hardwiring a particular version of a particular
75-
communication library or library version into their codes. Such
76-
abstraction makes application code less sensitive to the evolution of
77-
the underlying communication libraries and hardware platforms.
40+
[OpenCoarrays] supports [Fortran 2018] compilers by providing a
41+
parallel application binary interface (ABI) that abstracts away the
42+
underlying parallel programming model, which can be the Message
43+
Passing Interface ([MPI]) or [OpenSHMEM]. Parallel Fortran 2018
44+
programs may be written and compiled into object files once, and
45+
then linked or relinked to either MPI or [OpenSHMEM] without modifying
46+
or recompiling the Fortran source. Not a single line of source code
47+
need change to switch parallel programming models. The default MPI,
48+
which we expect to provide the broadest support for Fortran 2018 for
49+
the foreseeable future. However, having the option to parallel
50+
programming models at link-time aids portability and performance
51+
(see [Rouson et al. (2017)] and [Rasmussen et al. (2018)]).
52+
53+
OpenCoarrays provides a compiler wrapper (`caf`), parallel runtime
54+
libraries (`libcaf_mpi` and `libcaf_openshmem`), and a parallel
55+
executable file launcher (`cafrun`). The wrapper and launcher
56+
provide a uniform abstraction for compiling and executing parallel
57+
Fortran 2018 programs without direct reference to the underlying
58+
parallel programming model.
7859

7960
Downloads
8061
---------
@@ -84,39 +65,35 @@ Please see our [Releases] page.
8465
Compatibility
8566
-------------
8667

87-
The GNU Compiler Collection ([GCC]) Fortran front end ([gfortran]) is
88-
OpenCoarrays-aware for release versions 5.1.0 and higher. Users of
89-
other compilers, including earlier versions of gfortran, can access a
90-
limited subset of CAF features via the provided [opencoarrays module].
91-
After installation, please execute the `caf` script (which is
92-
installed in the `bin` directory of the installation path) with no
93-
arguments to see a list of the corresponding limitations. Please also
94-
notify the corresponding compiler vendor and the OpenCoarrays team
95-
that you would like for a future version of the compiler to be
96-
OpenCoarrays-aware.
68+
The GNU Compiler Collection ([GCC]) Fortran front end ([gfortran]) has
69+
used OpenCoarrays since the GCC 5.1.0 release . Discussions are under
70+
way around incorporating OpenCoarrays into other compilers.
9771

9872
Prerequisites
9973
-------------
10074

101-
We expect our LIBCAF_MPI library to be the default OpenCoarrays
102-
library. LIBCAF_MPI is the most straightforward to install and use,
103-
the most robust in terms of its internal complexity, and the most
104-
frequently updated and maintained. Building LIBCAF_MPI requires prior
105-
installation of an MPI implementation. We recommend [MPICH] generally
106-
or, if available, [MVAPICH] for better performance. [OpenMPI] is
107-
another option.
75+
Building OpenCoarrays requires
76+
77+
* An MPI implementation (default: [MPICH]).
78+
* CMake.
79+
* A Fortran compiler (default: [GCC]).
80+
* _Optional_: An [OpenSHMEM] implementation.
81+
82+
If you use a package manager or the OpenCoarrays installer, any
83+
missing prerequisites will be built for you.
10884

109-
We offer an unsupported LIBCAF_GASNet alternative. We intend for
110-
LIBCAF_GASNet to be an "expert" alternative capable of outperforming
111-
MPI for some applications on some platforms. LIBCAF_GASNet requires
112-
greater care to configure and use and building LIBCAF_GASNet requires
113-
prior installation of [GASNet].
11485

11586
Installation
11687
------------
11788

11889
Please see the [INSTALL.md] file.
11990

91+
Or [try OpenCoarrays online] as a [Jupyter] [notebook kernel]
92+
using [Binder] with no downloads, configuration or installation required.
93+
The default [index.ipynb] notebook is read only, but you can
94+
execute it, copy it to make changes, or create an entirely
95+
new [CAF kernel][notebook kernel] notebook.
96+
12097
Getting Started
12198
---------------
12299

@@ -136,16 +113,14 @@ A list of open issues can be viewed on the
136113
Support
137114
-------
138115

139-
* Please submit bug reports and feature requests via our [Issues] page.
140-
* Please submit questions regarding installation and use via our
141-
[Google Group] by signing into [Google Groups] or [subscribing] and
142-
sending email to [[email protected]].
116+
Please submit bug reports and feature requests via our [Issues] page.
143117

144118
Acknowledgements
145119
----------------
146120

147121
We gratefully acknowledge support from the following institutions:
148122

123+
* [Arm] for approving compiler engineer contributions of code.
149124
* [National Center for Atmospheric Research] for access to the
150125
Yellowstone/Caldera supercomputers and for logistics support during
151126
the initial development of OpenCoarrays.
@@ -191,6 +166,15 @@ to aid in development efforts.
191166
[Contributing]: #contributing
192167
[Acknowledgements]: #acknowledgements
193168

169+
[Fortran 2018]: http://isotc.iso.org/livelink/livelink?func=ll&objId=19442438&objAction=Open&viewType=1
170+
[Rouson et al. (2017)]: https://github.com/sourceryinstitute/coarray-icar-paw17/blob/master/main.pdf
171+
[Rasmussen et al. (2018)]: https://github.com/scrasmussen/coarray-icar-paw18/blob/master/main.pdf
172+
[Arm]: https://www.arm.com
173+
[PAW-ATM Workshop]: http://sourceryinstitute.github.io/PAW/
174+
[Writing Fortran 2018 Today]: https://writing-fortran-2018-today.eventbrite.com
175+
[Intel Speakerships at SC18]: https://easychair.org/cfp/IntelSpeakershipsatSC18
176+
177+
[OpenSHMEM]: http://www.openshmem.org
194178
[sourcery-institute logo]: http://www.sourceryinstitute.org/uploads/4/9/9/6/49967347/sourcery-logo-rgb-hi-rez-1.png
195179
[OpenCoarrays]: http://www.opencoarrays.org
196180
[ABI]: https://gcc.gnu.org/onlinedocs/gfortran/Coarray-Programming.html#Coarray-Programming
@@ -233,5 +217,7 @@ to aid in development efforts.
233217
[release img]: https://img.shields.io/github/release/sourceryinstitute/OpenCoarrays.svg?style=flat-square "Latest release badge"
234218
[pdf img]: https://img.shields.io/badge/PDF-README.md-6C2DC7.svg?style=flat-square "Download this readme as a PDF"
235219
[twitter img]: https://img.shields.io/twitter/url/http/shields.io.svg?style=social
220+
https://www.eventbrite.com/e/writing-fortran-2018-today-object-oriented-parallel-programming-tickets-48982176007
221+
[Writing Fortran 2018 Today]: https://writing-fortran-2018-today.eventbrite.com
236222

237223
[default tweet]: https://twitter.com/intent/tweet?hashtags=HPC,Fortran,PGAS&related=zbeekman,gnutools,HPCwire,HPC_Guru,hpcprogrammer,SciNetHPC,DegenerateConic,jeffdotscience,travisci&text=Stop%20programming%20w%2F%20the%20%23MPI%20docs%20in%20your%20lap%2C%20try%20Coarray%20Fortran%20w%2F%20OpenCoarrays%20%26%20GFortran!&url=https%3A//github.com/sourceryinstitute/OpenCoarrays

0 commit comments

Comments
 (0)