Skip to content

Commit dfde1b9

Browse files
authored
Merge pull request #757 from sourceryinstitute/reorganize
Reorganize & rename subdirectories, remove dead code, and document archival code
2 parents 2e11277 + 5f0f968 commit dfde1b9

37 files changed

+151
-3699
lines changed

CMakeLists.txt

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ if($ENV{OPENCOARRAYS_DEVELOPER})
2828
endif()
2929
option(CAF_RUN_DEVELOPER_TESTS "Run tests intended only for developers" ${_TF})
3030
mark_as_advanced(CAF_RUN_DEVELOPER_TESTS)
31-
option( CAF_ENABLE_ISO_Fortran_BINDING
32-
"Build and install F2018 C interop iso_fortran_binding.h header; experimental!"
33-
${_TF} )
34-
3531

3632
# Name project and specify source languages
3733
# Parse version from .VERSION file so that more info can be added and easier to get from scripts
@@ -701,7 +697,7 @@ add_custom_target( hash_installed
701697
#---------------------------------------------------------------------------------------
702698
# Define macro for adding CAF tests, and ensuring proper flags are passed to MPI runtime
703699
#---------------------------------------------------------------------------------------
704-
# Test for OpenMPI moved to src/mpi/CMakeLists.txt and passed back up through set(... PARENT_SCOPE)
700+
# Test for OpenMPI moved to src/runtime-libraries/mpi/CMakeLists.txt and passed back up through set(... PARENT_SCOPE)
705701
function(add_caf_test name num_caf_img test_target)
706702
# Function to add MPI tests.
707703
if(TARGET ${test_target})
@@ -973,16 +969,6 @@ add_installation_script_test(installation-scripts.sh src/tests/installation/)
973969
if( CAF_ENABLE_FAILED_IMAGES AND ( NOT
974970
( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" ) AND ( "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" ) )
975971
)
976-
message ( WARNING
977-
"ISO_Fortran_BINDING has only been tested with recent GCC C compilers on x86_64 architectures!
978-
Some people have reported problems on other architectures or using other C compilers (Clang).
979-
There are likely bugs present; use at your own risk!")
980-
endif()
981-
982-
# Test ISO_Fortran_binding library
983-
if( CAF_ENABLE_ISO_Fortran_BINDING OR ( CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER} ) )
984-
# See https://github.com/sourceryinstitute/OpenCoarrays/issues/523#issuecomment-401613209
985-
add_test(NAME ISO_Fortran_binding_tests COMMAND "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ISO_Fortran_binding_tests")
986972
endif()
987973

988974
# Lint the Travis-CI scripts

README.md

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[https://github.com/sourceryinstitute/OpenCoarrays/blob/master/README.md]:#
66
<div align="center">
77

8-
[![Sourcery Institute][sourcery-institute logo]][Sourcery, Inc.]
8+
[![Sourcery Institute][sourcery-institute logo]][Sourcery Institute]
99

1010
OpenCoarrays
1111
============
@@ -30,25 +30,22 @@ OpenCoarrays
3030
Overview
3131
--------
3232

33-
[OpenCoarrays] supports [Fortran 2018] compilers by providing a
34-
parallel application binary interface (ABI) that abstracts away the
35-
underlying parallel programming model, which can be the Message
36-
Passing Interface ([MPI]) or [OpenSHMEM]. Parallel Fortran 2018
37-
programs may be written and compiled into object files once and
38-
then linked or re-linked to either MPI or [OpenSHMEM] without modifying
39-
or recompiling the Fortran source. Not a single line of source code
40-
need change to switch parallel programming models. The default
41-
programming model is MPI because it provides the broadest capability
42-
for supporting Fortran 2018 features. However, having the option to
43-
change parallel programming models at link-time may enhance portability
44-
and performance (see [Rouson et al. (2017)]).
45-
46-
OpenCoarrays provides a compiler wrapper (`caf`), parallel runtime
47-
libraries (`libcaf_mpi` and `libcaf_openshmem`), and a parallel
48-
executable file launcher (`cafrun`). The wrapper and launcher
49-
provide a uniform abstraction for compiling and executing parallel
50-
Fortran 2018 programs without direct reference to the underlying
51-
parallel programming model.
33+
[OpenCoarrays] supports the GNU Compiler Collection ([GCC]) Fortran compiler
34+
([`gfortran`]) by providing a parallel application binary interface (ABI) that
35+
abstracts away the underlying communication library. OpenCoarrays thus enables
36+
`gfortran` to support Fortran's parallel programming features, often called
37+
"Coarray Fortran," without making direct reference to the back-end communication
38+
library: the Message Passing Interface (MPI). This ensures that Fortran
39+
programs and Fortran compilers may take advantage of other communication
40+
libraries without costly refactoring. Work is underway on the [Caffeine]
41+
project to support alternative communication libraries and alternative compilers
42+
by defining a compiler-independent parallel ABI atop the [GASNet-EX] exascale
43+
networking middleware.
44+
45+
OpenCoarrays provides a compiler wrapper (`caf`), a parallel runtime library
46+
(`libcaf_mpi`), and a program launcher (`cafrun`). The wrapper and launcher
47+
provide a uniform abstraction for compiling and executing Coarray Fortran
48+
without direct reference to the underlying MPI layer.
5249

5350
Downloads
5451
---------
@@ -58,22 +55,20 @@ Please see our [Releases] page.
5855
Compatibility
5956
-------------
6057

61-
The GNU Compiler Collection ([GCC]) Fortran front end ([gfortran]) has
62-
used OpenCoarrays since the GCC 5.1.0 release . Discussions are under
63-
way around incorporating OpenCoarrays into other compilers.
58+
The OpenCoarrays ABI was adopted by `gfortran` in release the GCC 5.1.0 release
59+
and `gfortran` continues to work with OpenCoarrays as of this writing.
6460

6561
Prerequisites
6662
-------------
6763

6864
Building OpenCoarrays requires
6965

70-
* An MPI implementation (default: [MPICH]).
71-
* CMake.
72-
* A Fortran compiler (default: [GCC]).
73-
* _Optional_: An [OpenSHMEM] implementation.
66+
* An MPI implementation,
67+
* CMake, and
68+
* The GCC C and Fortran compilers: `gcc` and `gfortran`.
7469

75-
If you use a package manager or the OpenCoarrays installer, any
76-
missing prerequisites will be built for you.
70+
If you use a package manager or the OpenCoarrays installer, any missing
71+
prerequisites will be built for you.
7772

7873

7974
Installation
@@ -124,6 +119,12 @@ Acknowledgments
124119

125120
We gratefully acknowledge support from the following institutions:
126121

122+
* The U.S. Nuclear Regulatory Commission ([NRC]) for funding the work that led to support for
123+
- the Windows operating system,
124+
- the `random_init` subroutine, and
125+
- `co_broadcast` of derived-type objects with `allocatable` components.
126+
* The National Aeronautics and Space Administration [NASA] for funding the work that led to
127+
support for the `co_broadcast` of derived-type objects.
127128
* [Arm] for approving compiler engineer contributions of code.
128129
* [National Center for Atmospheric Research] for access to the
129130
Yellowstone/Caldera supercomputers and for logistics support during
@@ -137,7 +138,7 @@ We gratefully acknowledge support from the following institutions:
137138
of Energy under Contract No. DE-AC02-05CH11231, for access to the
138139
Hopper and Edison supercomputers under the OpenCoarrays project
139140
start allocation.
140-
* [Sourcery, Inc.], for financial support for the domain registration,
141+
* [Archaeologic Inc.] for financial support for the domain registration,
141142
web hosting, advanced development, and conference travel.
142143

143144
Donate
@@ -169,7 +170,6 @@ to aid in development efforts.
169170
[Contributing]: #contributing
170171
[Acknowledgments]: #acknowledgments
171172

172-
[Fortran 2018]: https://j3-fortran.org/doc/year/18/18-007r1.pdf
173173
[Arm]: https://www.arm.com
174174

175175
[OpenSHMEM]: http://www.openshmem.org/site/
@@ -178,9 +178,9 @@ to aid in development efforts.
178178
[ABI]: https://gcc.gnu.org/onlinedocs/gfortran/Coarray-Programming.html#Coarray-Programming
179179
[MPI]: https://www.mpi-forum.org/
180180
[GCC]: https://gcc.gnu.org
181-
[gfortran]: https://gcc.gnu.org/wiki/GFortran
181+
[`gfortran`]: https://gcc.gnu.org/wiki/GFortran
182182
[MPICH]: https://www.mpich.org
183-
[Sourcery, Inc.]: http://www.sourceryinstitute.org
183+
[Sourcery Institute]: http://www.sourceryinstitute.org
184184
[Google]: https://www.google.com
185185
[CINECA]: https://www.cineca.it/en
186186
[NERSC]: https://www.nersc.gov
@@ -210,7 +210,10 @@ to aid in development efforts.
210210
[release img]: https://img.shields.io/github/release/sourceryinstitute/OpenCoarrays.svg?style=flat-square "Latest release badge"
211211
[pdf img]: https://img.shields.io/badge/PDF-README.md-6C2DC7.svg?style=flat-square "Download this readme as a PDF"
212212
[twitter img]: https://img.shields.io/twitter/url/http/shields.io.svg?style=social
213-
[Writing Fortran 2018 Today]: https://www.eventbrite.com/e/writing-fortran-2018-today-object-oriented-parallel-programming-tickets-48982176007
214-
[Rouson et al. (2017)]: http://www.opencoarrays.org/uploads/6/9/7/4/69747895/a4-rouson.pdf
213+
[NRC]: https://www.nrc.gov
214+
[NASA]: https://www.nasa.gov
215+
[Caffeine]: https://go.lbl.gov/caffeine
216+
[Archaeologic Inc.]: https://www.archaeologic.codes
217+
[GASNet-EX]: https://go.lbl.gov/gasnet
215218

216219
[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

install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181

8282
### Start of boilerplate -- do not edit this block #######################
8383
export OPENCOARRAYS_SRC_DIR="${OPENCOARRAYS_SRC_DIR:-${PWD%/}}"
84-
if [[ ! -f "${OPENCOARRAYS_SRC_DIR}/src/libcaf.h" ]]; then
84+
if [[ ! -f "${OPENCOARRAYS_SRC_DIR}/src/runtime-libraries/mpi/mpi_caf.c" ]]; then
8585
echo "Please run this script inside the top-level OpenCoarrays source directory or "
8686
echo "set OPENCOARRAYS_SRC_DIR to the OpenCoarrays source directory path."
8787
exit 1
@@ -332,6 +332,7 @@ elif [[ "${arg_p:-}" == "opencoarrays" ]]; then
332332
fi
333333
fi
334334

335+
335336
elif [[ "${arg_p:-}" == "ofp" ]]; then
336337

337338
# Install Xcode command line tools (CLT) if on macOS and if needed

prerequisites/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
export OPENCOARRAYS_SRC_DIR="${OPENCOARRAYS_SRC_DIR:-${PWD%prerequisites*}}"
3434
export __usage=${OPENCOARRAYS_SRC_DIR}/prerequisites/build.sh-usage
35-
if [[ ! -f "${OPENCOARRAYS_SRC_DIR}/src/libcaf.h" ]]; then
35+
if [[ ! -f "${OPENCOARRAYS_SRC_DIR}/src/runtime-libraries/mpi/mpi_caf.c" ]]; then
3636
echo "Please run this script inside the OpenCoarrays source \"prerequisites\" subdirectory"
3737
echo "or set OPENCOARRAYS_SRC_DIR to the top-level OpenCoarrays source directory path."
3838
exit 1

src/CMakeLists.txt

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
set(directories_to_build mpi tests)
2-
if( CAF_ENABLE_ISO_Fortran_BINDING OR ( CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER} ) )
3-
list( APPEND directories_to_build iso-fortran-binding )
4-
endif()
5-
foreach(directory ${directories_to_build})
6-
add_subdirectory(${directory})
7-
endforeach()
1+
add_subdirectory(application-binary-interface )
2+
add_subdirectory(runtime-libraries )
3+
add_subdirectory(tests)
84

95
set(N_CPU ${N_CPU} PARENT_SCOPE)
106
set(HOST_NAME ${HOST_NAME} PARENT_SCOPE)
117

128
if(openmpi)
139
set(openmpi ${openmpi} PARENT_SCOPE)
1410
endif()
15-
16-
install( FILES libcaf.h libcaf-gfortran-descriptor.h libcaf-version-def.h
17-
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
18-
)

src/Makefile

Lines changed: 0 additions & 84 deletions
This file was deleted.

src/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
OpenCoarrays Runtime Libraries
2+
==============================
3+
4+
One original goal of the OpenCoarrays project was to provide a transparent application binary interface (ABI) supported by interchangeable parallel runtime libraries based on a range of communication libraries. The following header files in this directory define that ABI:
5+
6+
* libcaf.h
7+
* libcaf-gfortran-descriptor.h
8+
* libcaf-version-def.h:
9+
10+
where the above files are in dependency order: each file depends on the file(s) listed below it. The [runtime-libraries](./runtime-libraries) subdirectory contains runtimes based on the following communication libraries:
11+
12+
* Message Passing Interface (MPI)
13+
* OpenSHMEM
14+
* GASNet
15+
16+
We currently maintain, build, and test only the MPI runtime. The GASNet and OpenSHMEM runtime library source code serve only to provide detailed, open-source documentation of the research described by [Fanfarillo et al. (2014)] and [Rouson et al. (2017)]. For a Fortran 2018 parallel runtime library based on the more recent GASNet-EX exascale networking middleware described by [Bonachea and Hargrove (2018)], please see the [Caffeine] repository.
17+
18+
One exception regarding the transparent nature of the ABI is the [opencoarrays module], which provides a public function that returns the underlying MPI communicator. This capability can be useful for using coarray Fortran to drive an ensemble of simulations using pre-existing MPI as described in [Rouson, McCreight, and Fanfarillo (2017)].
19+
20+
[Fanfarillo et al. (2014)]: http://dx.doi.org/10.1145/2676870.2676876
21+
[Rouson et al. (2017)]: https://doi.org/10.1145/3144779.3169104
22+
[Bonachea and Hargrove (2018)]: https://doi.org/10.25344/S4QP4W
23+
[Caffeine]: https://go.lbl.gov/caffeine
24+
[opencoarrays module]: ./runtime-libraries/mpi/opencoarrays.F90
25+
[Rouson, McCreight, and Fanfarillo (2017)]: https://doi.org/10.1145/3144779.3169110
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
install( FILES libcaf.h libcaf-gfortran-descriptor.h libcaf-version-def.h
2+
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
3+
)

src/libcaf-gfortran-descriptor.h renamed to src/application-binary-interface/libcaf-gfortran-descriptor.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
3030

3131
#include "libcaf-version-def.h"
3232

33-
/* GNU Fortran's array descriptor. Keep in sync with libgfortran.h. To be
34-
replaced by TS29113's ISO_Fortran_binding.h with CFI_cdesc_t. */
33+
/* GNU Fortran's array descriptor. Keep in sync with libgfortran.h. */
3534

3635
enum
3736
{ BT_UNKNOWN = 0, BT_INTEGER, BT_LOGICAL, BT_REAL, BT_COMPLEX,

0 commit comments

Comments
 (0)