1- [ This document is formatted with GitHub-Flavored Markdown. ] :#
2- [ For better viewing, including hyperlinks, read it online at ] :#
1+ [ This document is formatted with GitHub-Flavored Markdown. ] :#
2+ [ For better viewing, including hyperlinks, read it online at ] :#
33[ https://github.com/sourceryinstitute/opencoarrays/blob/master/GETTING_STARTED.md ] :#
44
55# [ Getting Started] ( #getting-started ) #
1010
1111<a name =" the-caf-compiler-wrapper " >
1212## The caf compiler wrapper ##
13- </a >
13+ </a >
1414
15- The preferred method for compiling a CAF program is by invoking the "caf" bash script
15+ The preferred method for compiling a CAF program is by invoking the "caf" bash script
1616that the OpenCoarrays CMake scripts install in the "bin" subdirectory of the installation
17- path. This is an experimental script with limited but useful capabilities that will
17+ path. This is an experimental script with limited but useful capabilities that will
1818grow over time. Please submit bug reports and feature requests via our [ Issues] page.
1919
2020The "caf" script liberates the source code and workflow from explicit dependence on the
21- underlying compiler and communication library in the following ways:
21+ underlying compiler and communication library in the following ways:
2222
23231 . With an OpenCoarrays-aware (OCA) CAF compiler, the "caf" script passes the unmodified
24- source code to the underlying compiler with the necessary arguments for building a
25- CAF program, embedding the paths to OpenCoarrays libraries (e.g., libcaf_mpi.a) installed
26- in the "lib" subdirectory of the OpenCoarrays installation path. The "caf" script also
24+ source code to the underlying compiler with the necessary arguments for building a
25+ CAF program, embedding the paths to OpenCoarrays libraries (e.g., libcaf_mpi.a) installed
26+ in the "lib" subdirectory of the OpenCoarrays installation path. The "caf" script also
2727 embeds the path to the relevant module file in the "mod" subdirectory of the installation
2828 path (e.g., opencoarrays.mod). This supports use association with module entities via
2929 `` use opencoarrays `` .
30- 2 . With a non-CAF compiler (including gfortran 4.9), "caf" supports a subset of CAF by
30+ 2 . With a non-CAF compiler (including gfortran 4.9), "caf" supports a subset of CAF by
3131 replacing CAF statements with calls to procedures in the [ opencoarrays module] before
32- passing the source code to the compiler.
32+ passing the source code to the compiler.
3333
3434When using GCC 4.9, we recommend using the ` use ` statement's "only" clause to
35- avoid inadvertent procedure name clashes between OpenCoarrays procedures and their
35+ avoid inadvertent procedure name clashes between OpenCoarrays procedures and their
3636GCC counerparts. For example, use "use opencoarrays, only : co_reduce".
3737
3838With a non-OCA and OCA CAF compilers, the extensions that "caf" imports include the collective
3939subroutines proposed for Fortran 2015 in the draft Technical Specification [ TS 18508]
4040_ Additional Parallel Features in Fortran_ .
4141
42- The latter use case provides an opportunity to mix a compiler's CAF support with that of OpenCoarrays.
43- For example, a non-OCA CAF compiler, such as the Cray or Intel compilers, might support all of a
44- program's coarray square-bracket syntax, while OpenCoarrays supports the same program's calls to
42+ The latter use case provides an opportunity to mix a compiler's CAF support with that of OpenCoarrays.
43+ For example, a non-OCA CAF compiler, such as the Cray or Intel compilers, might support all of a
44+ program's coarray square-bracket syntax, while OpenCoarrays supports the same program's calls to
4545collective subroutine such as ` co_sum ` and ` co_reduce ` .
4646
4747<a name =" a-sample-basic-workflow " >
4848## A sample basic workflow ##
4949</a >
5050
51- The following program listing, compilation, and execution workflow exemplify
52- the use of an OCA compiler (e.g., gfortran 5.1.0 or later) in a Linux bash shell
53- with the "bin" directory of the chosen installation path in the user's PATH
51+ The following program listing, compilation, and execution workflow exemplify
52+ the use of an OCA compiler (e.g., gfortran 5.1.0 or later) in a Linux bash shell
53+ with the "bin" directory of the chosen installation path in the user's PATH
5454environment variable:
5555
56- $ cat tally.f90
56+ $ cat tally.f90
5757 program main
5858 use iso_c_binding, only : c_int
5959 use iso_fortran_env, only : error_unit
6060 implicit none
6161 integer(c_int) :: tally
62- tally = this_image() ! this image's contribution
62+ tally = this_image() ! this image's contribution
6363 call co_sum(tally)
6464 verify: block
6565 integer(c_int) :: image
@@ -69,7 +69,7 @@ environment variable:
6969 end if
7070 end block verify
7171 ! Wait for all images to pass the test
72- sync all
72+ sync all
7373 if (this_image()==1) print *,"Test passed"
7474 end program
7575 $ caf tally.f90 -o tally
@@ -82,7 +82,7 @@ where "4" is the number of images to be launched at program start-up.
8282## An advanced workflow </a > ##
8383
8484To extend the capabilities of a non-OCA CAF compiler (e.g., the Intel or Cray compilers),
85- access the types and procedures of the [ opencoarrays module] by use assocication. We
85+ access the types and procedures of the [ opencoarrays module] by use assocication. We
8686recommend using a ` use ` statement with an ` only ` clause to reduce the likelihood of a
8787name clash with the compiler's native CAf support. For eample, innsert the following
8888at line 2 of ` tally.f90 ` above:
0 commit comments