Skip to content

Commit f39a9aa

Browse files
authored
Merge pull request #1270 from danielpeter/devel
adds elastic PML on GPUs
2 parents 800d494 + ac7e451 commit f39a9aa

27 files changed

Lines changed: 2182 additions & 674 deletions

setup/constants.h.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,7 @@
286286
!!
287287
!!-----------------------------------------------------------
288288

289-
! This option is used when we want to enforce fields values
290-
! somewhere
289+
! This option is used when we want to enforce fields values somewhere
291290
logical, parameter :: USE_ENFORCE_FIELDS = .false.
292291

293292
!------------------------------------------------------

src/gpu/compute_coupling_cuda.cu

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,18 @@ void FC_FUNC_(compute_coupling_ac_el_cuda,
105105
mp->d_coupling_ac_el_jacobian2Dw,
106106
mp->d_ibool,
107107
mp->simulation_type,
108-
backward_simulation);
108+
backward_simulation,
109+
mp->pml_boundary_conditions,
110+
mp->d_spec_to_pml,
111+
mp->nspec_pml_x,
112+
mp->nspec_pml_z,
113+
mp->deltat,
114+
mp->d_displ_elastic_old,
115+
mp->d_rmemory_fsb_displ_elastic,
116+
mp->alphax_store,
117+
mp->alphaz_store,
118+
mp->betax_store,
119+
mp->betaz_store);
109120

110121
//double end_time = get_time();
111122
//printf("Elapsed time: %e\n",end_time-start_time);
@@ -183,7 +194,20 @@ void FC_FUNC_(compute_coupling_el_ac_cuda,
183194
mp->d_coupling_ac_el_jacobian2Dw,
184195
mp->d_ibool,
185196
mp->simulation_type,
186-
backward_simulation);
197+
backward_simulation,
198+
mp->pml_boundary_conditions,
199+
mp->d_spec_to_pml,
200+
mp->nspec_pml_x,
201+
mp->nspec_pml_z,
202+
mp->deltat,
203+
mp->d_potential_acoustic,
204+
mp->d_potential_dot_acoustic,
205+
mp->d_potential_old,
206+
mp->d_rmemory_sfb_potential_ddot_acoustic,
207+
mp->alphax_store,
208+
mp->alphaz_store,
209+
mp->betax_store,
210+
mp->betaz_store);
187211

188212
//double end_time = get_time();
189213
//printf("Elapsed time: %e\n",end_time-start_time);

src/gpu/compute_forces_acoustic_cuda.cu

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ TRACE("Kernel_2_acoustic");
121121
mp->pml_boundary_conditions,
122122
mp->d_spec_to_pml);
123123

124+
// PML elements
124125
if (mp->pml_boundary_conditions){
125126
Kernel_2_acoustic_PML_impl<1><<<grid,threads,0,mp->compute_stream>>>(nb_blocks_to_compute,
126127
d_ibool,
@@ -136,28 +137,25 @@ TRACE("Kernel_2_acoustic");
136137
mp->d_wxgll,
137138
d_rhostore,
138139
mp->d_spec_to_pml,
139-
mp->ALPHA_MAX_PML,
140-
mp->d0_max,
141-
mp->abscissa_norm,
142140
mp->nspec_pml_x,
143141
mp->nspec_pml_z,
144142
mp->deltat,
145143
mp->PML_dpotentialdxl_old,
146144
mp->PML_dpotentialdzl_old,
147145
mp->d_potential_old,
148-
mp->rmemory_acoustic_dux_dx,
149-
mp->rmemory_acoustic_dux_dz,
150-
mp->rmemory_acoustic_dux_dx2,
151-
mp->rmemory_acoustic_dux_dz2,
152-
mp->rmemory_pot_acoustic,
153-
mp->rmemory_pot_acoustic2,
146+
mp->d_rmemory_acoustic_dux_dx,
147+
mp->d_rmemory_acoustic_dux_dz,
148+
mp->d_rmemory_acoustic_dux_dx2,
149+
mp->d_rmemory_acoustic_dux_dz2,
150+
mp->d_rmemory_pot_acoustic,
151+
mp->d_rmemory_pot_acoustic2,
154152
mp->d_potential_dot_acoustic,
155153
mp->d_kappastore,
156154
mp->alphax_store,
157155
mp->alphaz_store,
158156
mp->betax_store,
159157
mp->betaz_store);
160-
} //PML
158+
} // PML
161159
} // compute_wavefield1
162160
if (compute_wavefield_2){
163161
// this run only happens with UNDO_ATTENUATION_AND_OR_PML on

src/gpu/compute_forces_viscoelastic_cuda.cu

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,54 @@ TRACE("Kernel_2");
275275
mp->d_kappav,
276276
mp->d_muv,
277277
mp->simulation_type,
278-
mp->p_sv);
278+
mp->p_sv,
279+
mp->pml_boundary_conditions,
280+
mp->d_spec_to_pml);
281+
282+
// PML elements
283+
if (mp->pml_boundary_conditions){
284+
TRACE("\tKernel_2_noatt_iso_PML_impl 1");
285+
Kernel_2_noatt_iso_PML_impl<1><<<grid,threads,0,mp->compute_stream>>>(nb_blocks_to_compute,
286+
mp->d_ibool,
287+
mp->d_phase_ispec_inner_elastic,mp->num_phase_ispec_elastic,
288+
d_iphase,
289+
mp->d_displ,
290+
mp->d_accel,
291+
mp->d_xix, mp->d_xiz,
292+
mp->d_gammax, mp->d_gammaz,
293+
mp->d_hprime_xx,
294+
mp->d_hprimewgll_xx,
295+
mp->d_wxgll,
296+
mp->d_kappav,
297+
mp->d_muv,
298+
mp->simulation_type,
299+
mp->p_sv,
300+
mp->d_spec_to_pml,
301+
mp->nspec_pml_x,
302+
mp->nspec_pml_z,
303+
mp->deltat,
304+
mp->PML_dux_dxl_old,
305+
mp->PML_dux_dzl_old,
306+
mp->PML_duz_dxl_old,
307+
mp->PML_duz_dzl_old,
308+
mp->d_displ_elastic_old,
309+
mp->d_rmemory_dux_dx,
310+
mp->d_rmemory_dux_dx2,
311+
mp->d_rmemory_duz_dx,
312+
mp->d_rmemory_duz_dx2,
313+
mp->d_rmemory_dux_dz,
314+
mp->d_rmemory_dux_dz2,
315+
mp->d_rmemory_duz_dz,
316+
mp->d_rmemory_duz_dz2,
317+
mp->d_rmemory_displ_elastic,
318+
mp->d_rmemory_displ_elastic2,
319+
mp->d_veloc,
320+
mp->d_rhostore,
321+
mp->alphax_store,
322+
mp->alphaz_store,
323+
mp->betax_store,
324+
mp->betaz_store);
325+
} // PML
279326
}
280327
// backward/reconstructed wavefield
281328
if (compute_wavefield_2){
@@ -295,7 +342,9 @@ TRACE("Kernel_2");
295342
mp->d_kappav,
296343
mp->d_muv,
297344
mp->simulation_type,
298-
mp->p_sv);
345+
mp->p_sv,
346+
mp->pml_boundary_conditions,
347+
mp->d_spec_to_pml);
299348
}
300349
}
301350
} // ANISOTROPY

0 commit comments

Comments
 (0)