Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

OpenMP - Reduction -Operator .AND.

Noemi_Gonzalez
Beginner
269 Views
Hello All,
I am currently dealing with the operator .AND. in an OpenMP reduction clause in Fortran. Does anybody know how this reduction works?
Thanks,
0 Kudos
1 Solution
TimP
Honored Contributor III
269 Views
Something like

use ieee_arithmetic
logical result
real a(n)
a = .....
!dir$ omp parallel do reduction(.and. : result)
do i=1,n
result = result .and. .not. ieee_isnan(a(i))
enddo

Do you have an example which is not working?

View solution in original post

0 Kudos
2 Replies
TimP
Honored Contributor III
270 Views
Something like

use ieee_arithmetic
logical result
real a(n)
a = .....
!dir$ omp parallel do reduction(.and. : result)
do i=1,n
result = result .and. .not. ieee_isnan(a(i))
enddo

Do you have an example which is not working?
0 Kudos
Noemi_Gonzalez
Beginner
269 Views
Thank you.
Your post was very helpful, It works.
Noemig4
0 Kudos
Reply