Skip to content

Commit 950e0cd

Browse files
author
Damian Rouson
committed
Update docs: README, INSTALL, GETTING_STARTED
1 parent cd087a4 commit 950e0cd

File tree

3 files changed

+56
-170
lines changed

3 files changed

+56
-170
lines changed

GETTING_STARTED.md

Lines changed: 13 additions & 51 deletions
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 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
---

INSTALL.md

Lines changed: 13 additions & 58 deletions
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+
a 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

Lines changed: 30 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -40,41 +40,25 @@ notebook.
4040
Overview
4141
--------
4242

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.
43+
[OpenCoarrays] supports [Fortran 2018] compilers by providing a
44+
parallel application binary interface (ABI) that abstracts away the
45+
underlying parallel programming model, which can be the Message
46+
Passing Interface ([MPI]) or [OpenSHMEM]. Parallel Fortran 2018
47+
programs may be written and compiled into object files once, and
48+
then linked or relinked to either MPI or OpenSHMEM without modifying
49+
or recompiling the Fortran source. Not a single line of source code
50+
need change to switch parallel programming models. The default MPI,
51+
which we expect to provide the broadest support for Fortran 2018 for
52+
the foreseeable future. However, having the option to parallel
53+
programming models at link-time aids portability and performance
54+
(see [Rouson et al. 2017] and [Rasmussen et al. 2018]).
55+
56+
OpenCoarrays provides a compiler wrapper (`caf`), parallel runtime
57+
libraries (`libcaf_mpi` and `libcaf_openshmem`), and a parallel
58+
executable file launcher (`cafrun`). The wrapper and launcher
59+
provide a uniform abstraction for compiling and executing parallel
60+
Fortran 2018 programs without direct reference to the underlying
61+
parallel programming model.
7862

7963
Downloads
8064
---------
@@ -84,33 +68,21 @@ Please see our [Releases] page.
8468
Compatibility
8569
-------------
8670

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.
71+
The GNU Compiler Collection ([GCC]) Fortran front end ([gfortran]) has
72+
used OpenCoarrays since the GCC 5.1.0 release . Discussions are under
73+
way around incorporating OpenCoarrays into other compilers.
9774

9875
Prerequisites
9976
-------------
10077

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.
78+
Buildin OpenCoarrays requires the following packages:
79+
* MPI
80+
* CMake
81+
* A Fortran 2018 compiler (currently only GCC is supported).
82+
* _Optional_: OpenSHMEM
83+
If you use a package manager or the OpenCoarrays installer, any
84+
missing prerequisites will be built for you.
10885

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].
11486

11587
Installation
11688
------------
@@ -136,10 +108,7 @@ A list of open issues can be viewed on the
136108
Support
137109
-------
138110

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]].
111+
Please submit bug reports and feature requests via our [Issues] page.
143112

144113
Acknowledgements
145114
----------------

0 commit comments

Comments
 (0)