Skip to content

Commit 604b461

Browse files
authored
Merge pull request #13 from sourceryinstitute/rm-macros
Update build instructions & remove macros used with nagfor versions < 7.1
2 parents f4b37ca + 2289f35 commit 604b461

File tree

3 files changed

+14
-23
lines changed

3 files changed

+14
-23
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ Downloading, Building, and Running Examples
5757
2. The [Fortran Package Manager].
5858
3. _Optional_: [OpenCoarrays] for parallel execution with the GNU Fortran compiler.
5959

60-
Recent versions of the Cray, Intel, GNU, and NAG compilers suffice. Assert was developed primarily with `gfortran` 11.1.0 and `nagfor` 7.0 Build 7044.
60+
Assert was developed primarily with `gfortran` 11.2.0 and `nagfor` 7.1.
61+
Recent versions of the Cray and Intel compilers should also suffice.
6162

6263
### Downloading, building, and testing
6364

@@ -81,8 +82,12 @@ fpm test --compiler nagfor --flag -fpp
8182
#### Building and testing: multi-image (parallel) execution
8283
With `gfortran` and OpenCoarrays installed,
8384
```
84-
fpm test --compiler caf --runner "cafrun -n 2" designed-to-terminate-normally
85-
fpm test --compiler caf --runner "cafrun -n 2" designed-to-error-terminate
85+
fpm test --compiler caf --runner "cafrun -n 2"
86+
```
87+
To build and test with the Numerical Algorithms Group (NAG) Fortran compiler version
88+
7.1 or later, use
89+
```
90+
fpm test --compiler=nagfor --flag="-coarray=cosmp -fpp -f2018"
8691
```
8792

8893
For documentation on using Assert with other compilers, please submit an issue or pull request.

fpm.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ version = "1.0.0"
33
license = "BSD"
44
author = ["Damian Rouson"]
55
maintainer = "[email protected]"
6-
copyright = "2021 Sourcery Institute"
6+
copyright = "2021-2022 Sourcery Institute"

test/unit-tests/designed-to-error-terminate.f90

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,32 +32,18 @@ program designed_to_error_terminate
3232

3333
contains
3434

35-
pure function both(lhs,rhs) result(lhs_or_rhs)
36-
logical, intent(in) :: lhs,rhs
37-
logical lhs_or_rhs
35+
pure function and(lhs,rhs) result(lhs_and_rhs)
36+
logical, intent(in) :: lhs, rhs
37+
logical lhs_and_rhs
3838

39-
lhs_or_rhs = lhs .and. rhs
39+
lhs_and_rhs = lhs .and. rhs
4040

4141
end function
4242

4343
subroutine co_all(boolean)
4444
logical, intent(inout) :: boolean
4545

46-
#ifndef NAGFOR
47-
call co_reduce(boolean, both)
48-
#else
49-
! Because parallel NAG runs happen in shared memory and because this function is called only once in
50-
! one test, a simplistic, non-scalable reduction algorithm suffices until co_reduce is supported.
51-
block
52-
logical, save :: my_boolean[*]
53-
integer i
54-
55-
my_boolean = boolean
56-
do i=1,num_images()
57-
my_boolean = my_boolean .and. my_boolean[i]
58-
end do
59-
end block
60-
#endif
46+
call co_reduce(boolean, and)
6147

6248
end subroutine
6349

0 commit comments

Comments
 (0)