Skip to content
Snippets Groups Projects
Commit 008042d6 authored by ESCOBAR MUNOZ Juan's avatar ESCOBAR MUNOZ Juan
Browse files

Juan 15/03/2022:tools.f90, Cray OpenACC PB , for atomic to work ,replace acc...

Juan 15/03/2022:tools.f90, Cray OpenACC PB , for atomic to work ,replace acc kernels -> acc parallel
parent c02eeb85
No related branches found
No related tags found
No related merge requests found
...@@ -178,7 +178,7 @@ if (.not. mppdb_initialized ) then ...@@ -178,7 +178,7 @@ if (.not. mppdb_initialized ) then
ic = 0 ic = 0
!$acc kernels ! acc kernels
!To allow comparisons... (i1 is not fully used) !To allow comparisons... (i1 is not fully used)
!Can be removed in production !Can be removed in production
...@@ -188,7 +188,7 @@ ic = 0 ...@@ -188,7 +188,7 @@ ic = 0
! different runs of this subroutine BUT final result should be the same ! different runs of this subroutine BUT final result should be the same
!Comment the following line + atomic directives to have consistent values for debugging !Comment the following line + atomic directives to have consistent values for debugging
!Warning: huge impact on performance !Warning: huge impact on performance
!$acc loop private(idx) independent !$acc parallel loop private(idx) independent
do ji = 1, size( ltab, 1 ) do ji = 1, size( ltab, 1 )
if ( ltab(ji ) ) then if ( ltab(ji ) ) then
!$acc atomic capture !$acc atomic capture
...@@ -198,7 +198,7 @@ ic = 0 ...@@ -198,7 +198,7 @@ ic = 0
i1(idx) = ji i1(idx) = ji
end if end if
end do end do
!$acc end kernels ! acc end kernels
else else
...@@ -248,7 +248,7 @@ if (.not. mppdb_initialized ) then ...@@ -248,7 +248,7 @@ if (.not. mppdb_initialized ) then
ic = 0 ic = 0
!$acc kernels ! acc kernels
!To allow comparisons... (i1/i2 are not fully used) !To allow comparisons... (i1/i2 are not fully used)
!Can be removed in production !Can be removed in production
...@@ -259,7 +259,7 @@ ic = 0 ...@@ -259,7 +259,7 @@ ic = 0
! different runs of this subroutine BUT final result should be the same ! different runs of this subroutine BUT final result should be the same
!Comment the following line + atomic directives to have consistent values for debugging !Comment the following line + atomic directives to have consistent values for debugging
!Warning: huge impact on performance !Warning: huge impact on performance
!$acc loop collapse(2) private(idx) independent !$acc parallel loop collapse(2) private(idx) independent
do jj = 1, size( ltab, 2 ) do jj = 1, size( ltab, 2 )
do ji = 1, size( ltab, 1 ) do ji = 1, size( ltab, 1 )
if ( ltab(ji, jj ) ) then if ( ltab(ji, jj ) ) then
...@@ -272,7 +272,7 @@ ic = 0 ...@@ -272,7 +272,7 @@ ic = 0
end if end if
end do end do
end do end do
!$acc end kernels ! acc end kernels
else else
...@@ -325,7 +325,7 @@ if (.not. mppdb_initialized ) then ...@@ -325,7 +325,7 @@ if (.not. mppdb_initialized ) then
ic = 0 ic = 0
!$acc kernels ! acc kernels
!To allow comparisons... (i1/i2/i3 are not fully used) !To allow comparisons... (i1/i2/i3 are not fully used)
!Can be removed in production !Can be removed in production
...@@ -337,11 +337,13 @@ ic = 0 ...@@ -337,11 +337,13 @@ ic = 0
! different runs of this subroutine BUT final result should be the same ! different runs of this subroutine BUT final result should be the same
!Comment the following line + atomic directives to have consistent values for debugging !Comment the following line + atomic directives to have consistent values for debugging
!Warning: huge impact on performance !Warning: huge impact on performance
!$acc loop collapse(3) private(idx) independent !#ifdef MNH_COMPILER_NVHPC
!!$ do jk = 1, size( ltab, 3 ) !$acc parallel loop collapse(3) private(idx) independent
!!$ do jj = 1, size( ltab, 2 ) !#endif
!!$ do ji = 1, size( ltab, 1 ) do jk = 1, size( ltab, 3 )
do concurrent ( ji=1:size(ltab,1) , jj=1:size(ltab,2) , jk=1:size(ltab,3 ) ) do jj = 1, size( ltab, 2 )
do ji = 1, size( ltab, 1 )
!!$ do concurrent ( ji=1:size(ltab,1) , jj=1:size(ltab,2) , jk=1:size(ltab,3 ) )
if ( ltab(ji, jj, jk ) ) then if ( ltab(ji, jj, jk ) ) then
!$acc atomic capture !$acc atomic capture
ic = ic +1 ic = ic +1
...@@ -352,9 +354,9 @@ ic = 0 ...@@ -352,9 +354,9 @@ ic = 0
i3(idx) = jk i3(idx) = jk
end if end if
end do end do
!!$ end do end do
!!$ end do end do
!$acc end kernels ! acc end kernels
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment