Skip to content

Commit b0ec36c

Browse files
committed
build(NAG): exploit nagfor 7.1 co_reduce
1 parent 009ec08 commit b0ec36c

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

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)