Skip to content

Commit 4065c02

Browse files
committed
Do some clean up
1 parent ee1277d commit 4065c02

File tree

2 files changed

+8
-34
lines changed

2 files changed

+8
-34
lines changed

src/simulation/m_igr.fpp

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,9 @@ contains
9191

9292
subroutine s_initialize_igr_module()
9393
#ifdef __NVCOMPILER_GPU_UNIFIED_MEM
94-
integer :: igr_temps_total
95-
integer :: igr_temps_on_gpu
96-
integer :: igr_temps_on_cpu
94+
integer :: igr_temps_on_gpu = 3
9795
character(len=10) :: igr_temps_on_gpu_str
9896

99-
! initialize
100-
if (igr_iter_solver == 1) then ! Jacobi iteration
101-
igr_temps_total = 3
102-
else
103-
igr_temps_total = 2
104-
end if
105-
igr_temps_on_gpu = igr_temps_total
106-
igr_temps_on_cpu = 0
107-
10897
call get_environment_variable("NVIDIA_IGR_TEMPS_ON_GPU", igr_temps_on_gpu_str)
10998

11099
if (trim(igr_temps_on_gpu_str) == "0") then
@@ -119,17 +108,10 @@ contains
119108
igr_temps_on_gpu = 3
120109
end if
121110

122-
! trim if needed
123-
if ( igr_temps_on_gpu > igr_temps_total ) then
124-
igr_temps_on_gpu = igr_temps_total
125-
end if
126-
igr_temps_on_cpu = igr_temps_total - igr_temps_on_gpu
127-
128111
! create map
129-
temp_on_gpu(1:3) = -1
130-
temp_on_gpu(1:igr_temps_total) = 0
112+
temp_on_gpu(1:3) = 0
131113
temp_on_gpu(1:igr_temps_on_gpu) = 1
132-
print*, temp_on_gpu(1:3)
114+
!print*, temp_on_gpu(1:3)
133115
#endif
134116

135117
if (viscous) then
@@ -148,16 +130,12 @@ contains
148130
@:ALLOCATE(jac(idwbuff(1)%beg:idwbuff(1)%end, &
149131
idwbuff(2)%beg:idwbuff(2)%end, &
150132
idwbuff(3)%beg:idwbuff(3)%end))
151-
@:PREFER_GPU(jac)
152-
153133
@:ALLOCATE(jac_rhs(-1:m,-1:n,-1:p))
154-
@:PREFER_GPU(jac_rhs)
155134

156135
if (igr_iter_solver == 1) then ! Jacobi iteration
157136
@:ALLOCATE(jac_old(idwbuff(1)%beg:idwbuff(1)%end, &
158137
idwbuff(2)%beg:idwbuff(2)%end, &
159138
idwbuff(3)%beg:idwbuff(3)%end))
160-
@:PREFER_GPU(jac_old)
161139
end if
162140
#else
163141

@@ -167,8 +145,7 @@ contains
167145
idwbuff(3)%beg:idwbuff(3)%end))
168146
@:PREFER_GPU(jac)
169147
else
170-
print*, 'jac on CPU'
171-
148+
!print*, 'jac on CPU'
172149
allocate(pool_host1(idwbuff(1)%beg:idwbuff(1)%end, &
173150
idwbuff(2)%beg:idwbuff(2)%end, &
174151
idwbuff(3)%beg:idwbuff(3)%end))
@@ -182,8 +159,7 @@ contains
182159
@:ALLOCATE(jac_rhs(-1:m,-1:n,-1:p))
183160
@:PREFER_GPU(jac_rhs)
184161
else
185-
print*, 'jac_rhs on CPU'
186-
162+
!print*, 'jac_rhs on CPU'
187163
allocate(pool_host2(-1:m,-1:n,-1:p))
188164

189165
jac_rhs(-1:m,-1:n,-1:p) => pool_host2(:,:,:)
@@ -196,8 +172,7 @@ contains
196172
idwbuff(3)%beg:idwbuff(3)%end))
197173
@:PREFER_GPU(jac_old)
198174
else
199-
print*, 'jac_old on CPU'
200-
175+
!print*, 'jac_old on CPU'
201176
allocate(pool_host3(idwbuff(1)%beg:idwbuff(1)%end, &
202177
idwbuff(2)%beg:idwbuff(2)%end, &
203178
idwbuff(3)%beg:idwbuff(3)%end))

src/simulation/m_time_steppers.fpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,11 @@ module m_time_steppers
7575
integer, private :: num_ts !<
7676
!! Number of time stages in the time-stepping scheme
7777

78-
integer, private :: out_of_core
79-
8078
$:GPU_DECLARE(create='[q_cons_ts,q_prim_vf,q_T_sf,rhs_vf,q_prim_ts,rhs_mv,rhs_pb,max_dt]')
8179

8280
#ifdef __NVCOMPILER_GPU_UNIFIED_MEM
8381
real(wp), allocatable, dimension(:, :, :, :), pinned, target :: q_cons_ts_pool_host
82+
integer, private :: out_of_core
8483
#endif
8584

8685
contains
@@ -92,10 +91,10 @@ contains
9291

9392
integer :: i, j !< Generic loop iterators
9493

94+
#ifdef __NVCOMPILER_GPU_UNIFIED_MEM
9595
character(len=10) :: out_of_core_str
9696
out_of_core = 0
9797

98-
#ifdef __NVCOMPILER_GPU_UNIFIED_MEM
9998
call get_environment_variable("MFC_OUT_OF_CORE", out_of_core_str)
10099

101100
if (trim(out_of_core_str) == "0") then

0 commit comments

Comments
 (0)