Skip to content

Commit 55d76e0

Browse files
author
Thomas Koenig
committed
Added better documention how to run a coarray program.
1 parent a9aa47e commit 55d76e0

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

tutorial.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -695,26 +695,40 @@ program main
695695

696696
## Using gfortran
697697

698-
At the time of writing of this document, this may unfortunately
699-
be challenging.
700698
The [GNU Fortran compiler](https://gcc.gnu.org/onlinedocs/gfortran/)
701-
two possiblitites: Use of the `-fcoarray=lib` option and using
702-
[OpenCoarrays](http://www.opencoarrays.org/). You may also need
703-
to have MPI installed to run it.
699+
supports [OpenCoarrays](http://www.opencoarrays.org/). If you do not
700+
have it in your Linux distribution, you can follow the [installation
701+
instructions](https://github.com/sourceryinstitute/OpenCoarrays/blob/main/INSTALL.md) .
702+
Compilation then will be done via
703+
```
704+
$ mpif90 hello.f90 -lcaf_mpi
705+
```
706+
and the program can then be run by
707+
```
708+
$ mpiexec -n 10 ./a.out
709+
```
704710

705711
Another possibilility currently under development is the [shared
706-
memory coarray
707-
branch](https://gcc.gnu.org/git/?p=gcc.git;a=tree;h=refs/heads/devel/coarray_native;hb=refs/heads/devel/coarray_native).
712+
memory coarray branch](https://gcc.gnu.org/git/?p=gcc.git;a=tree;h=refs/heads/devel/coarray_native;hb=refs/heads/devel/coarray_native).
708713
This will work without any additional libraries and currently under active development, but does not yet have all
709714
features implemented.
710715

711716
## Using ifort
712717

713-
Refer to the [ifort documentation](https://software.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top.html)
714-
for details.
718+
If you use `ifort`, you can use the `-coarray` option, as in
719+
```
720+
$ ifort -coarray hello.f90
721+
```
722+
and then run the executable. This will give you the shared memory
723+
version. For more details refer to the manpage of ifort.
715724

716725
## Using NAG Fortran
717726

718-
Refer to the [NAG Fortran compiler documentation](https://www.nag.com/content/nag-fortran-compiler) for details.
727+
If you use `nagfor`, you can use the `-coarray` option, as in
728+
```
729+
$ nagfor -coarray hello.f90
730+
```
731+
and then run the executable. This will give yo the shared memory
732+
version. For more details refert to the manpage of nagfor.
719733

720734

0 commit comments

Comments
 (0)