Skip to content

Commit

Permalink
adds pressure/displ/veloc/accel seismogram outputs for elastic/acoust…
Browse files Browse the repository at this point in the history
…ic domains
  • Loading branch information
danielpeter committed Apr 29, 2021
1 parent 1aaa844 commit c7590b6
Show file tree
Hide file tree
Showing 21 changed files with 767 additions and 466 deletions.
6 changes: 3 additions & 3 deletions src/gpu/compute_add_sources_acoustic_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ void get_stf_for_gpu(field* stf_pre_compute, double* h_stf_pre_compute, int * ru
//Conversion to GPU precision
//Converts source time function to the field format. The stf value is saved only into its corresponding run. For other runs, a zero will be added

for (int i_source=0;i_source < NSOURCES;i_source++){
for (int i_run=0;i_run < NB_RUNS_ACOUSTIC_GPU;i_run++){
for (int i_source=0; i_source < NSOURCES; i_source++){
for (int i_run=0; i_run < NB_RUNS_ACOUSTIC_GPU; i_run++){
if (run_number_of_the_source[i_source] == i_run){
realw_to_field[i_run]= (realw)h_stf_pre_compute[i_source];
realw_to_field[i_run] = (realw) h_stf_pre_compute[i_source];
}
else{
realw_to_field[i_run] = 0.0f;
Expand Down
34 changes: 16 additions & 18 deletions src/gpu/compute_forces_viscoelastic_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
void Kernel_2(int nb_blocks_to_compute,Mesh* mp,int d_iphase,realw d_deltat,
const int COMPUTE_AND_STORE_STRAIN,
const int ATTENUATION,
const int ANISOTROPY,
int* d_ibool,
realw* d_xix,realw* d_xiy,realw* d_xiz,
realw* d_etax,realw* d_etay,realw* d_etaz,
Expand Down Expand Up @@ -179,7 +178,7 @@ void Kernel_2(int nb_blocks_to_compute,Mesh* mp,int d_iphase,realw d_deltat,
d_factor_common_kappa,
R_trace,d_epsilondev_trace,
alphaval,betaval,gammaval,
ANISOTROPY,
mp->ANISOTROPY,
d_c11store,d_c12store,d_c13store,
d_c14store,d_c15store,d_c16store,
d_c22store,d_c23store,d_c24store,
Expand Down Expand Up @@ -225,7 +224,7 @@ void Kernel_2(int nb_blocks_to_compute,Mesh* mp,int d_iphase,realw d_deltat,
d_factor_common_kappa,
R_trace,d_epsilondev_trace,
alphaval,betaval,gammaval,
ANISOTROPY,
mp->ANISOTROPY,
d_c11store,d_c12store,d_c13store,
d_c14store,d_c15store,d_c16store,
d_c22store,d_c23store,d_c24store,
Expand Down Expand Up @@ -273,7 +272,7 @@ void Kernel_2(int nb_blocks_to_compute,Mesh* mp,int d_iphase,realw d_deltat,
d_factor_common_kappa,
d_b_R_trace,d_b_epsilondev_trace,
mp->d_b_alphaval,mp->d_b_betaval,mp->d_b_gammaval,
ANISOTROPY,
mp->ANISOTROPY,
d_c11store,d_c12store,d_c13store,
d_c14store,d_c15store,d_c16store,
d_c22store,d_c23store,d_c24store,
Expand Down Expand Up @@ -319,7 +318,7 @@ void Kernel_2(int nb_blocks_to_compute,Mesh* mp,int d_iphase,realw d_deltat,
d_factor_common_kappa,
d_b_R_trace,d_b_epsilondev_trace,
mp->d_b_alphaval,mp->d_b_betaval,mp->d_b_gammaval,
ANISOTROPY,
mp->ANISOTROPY,
d_c11store,d_c12store,d_c13store,
d_c14store,d_c15store,d_c16store,
d_c22store,d_c23store,d_c24store,
Expand All @@ -339,7 +338,7 @@ void Kernel_2(int nb_blocks_to_compute,Mesh* mp,int d_iphase,realw d_deltat,
}
}else{
// compute kernels without attenuation
if (ANISOTROPY){
if (mp->ANISOTROPY){
TRACE("\tKernel_2: Kernel_2_noatt_ani_impl");
// full anisotropy
// forward wavefields -> FORWARD_OR_ADJOINT == 1
Expand All @@ -366,7 +365,7 @@ void Kernel_2(int nb_blocks_to_compute,Mesh* mp,int d_iphase,realw d_deltat,
epsilondev_xz,epsilondev_yz,
epsilon_trace_over_3,
mp->simulation_type,
ANISOTROPY,
mp->ANISOTROPY,
d_c11store,d_c12store,d_c13store,
d_c14store,d_c15store,d_c16store,
d_c22store,d_c23store,d_c24store,
Expand Down Expand Up @@ -406,7 +405,7 @@ void Kernel_2(int nb_blocks_to_compute,Mesh* mp,int d_iphase,realw d_deltat,
epsilondev_xz,epsilondev_yz,
epsilon_trace_over_3,
mp->simulation_type,
ANISOTROPY,
mp->ANISOTROPY,
d_c11store,d_c12store,d_c13store,
d_c14store,d_c15store,d_c16store,
d_c22store,d_c23store,d_c24store,
Expand Down Expand Up @@ -449,7 +448,7 @@ void Kernel_2(int nb_blocks_to_compute,Mesh* mp,int d_iphase,realw d_deltat,
d_b_epsilondev_xz,d_b_epsilondev_yz,
d_b_epsilon_trace_over_3,
mp->simulation_type,
ANISOTROPY,
mp->ANISOTROPY,
d_c11store,d_c12store,d_c13store,
d_c14store,d_c15store,d_c16store,
d_c22store,d_c23store,d_c24store,
Expand Down Expand Up @@ -489,7 +488,7 @@ void Kernel_2(int nb_blocks_to_compute,Mesh* mp,int d_iphase,realw d_deltat,
d_b_epsilondev_xz,d_b_epsilondev_yz,
d_b_epsilon_trace_over_3,
mp->simulation_type,
ANISOTROPY,
mp->ANISOTROPY,
d_c11store,d_c12store,d_c13store,
d_c14store,d_c15store,d_c16store,
d_c22store,d_c23store,d_c24store,
Expand Down Expand Up @@ -1022,17 +1021,17 @@ void Kernel_2(int nb_blocks_to_compute,Mesh* mp,int d_iphase,realw d_deltat,
} // ATTENUATION

// Cuda timing
if (CUDA_TIMING ){
if (ATTENUATION ){
if (CUDA_TIMING){
if (ATTENUATION){
stop_timing_gpu(&start,&stop,"Kernel_2_att_impl");
}else{
if (ANISOTROPY ){
if (mp->ANISOTROPY){
stop_timing_gpu(&start,&stop,"Kernel_2_noatt_ani_impl");
}else{
if (mp->gravity ){
if (mp->gravity){
stop_timing_gpu(&start,&stop,"Kernel_2_noatt_iso_grav_impl");
}else{
if (COMPUTE_AND_STORE_STRAIN ){
if (COMPUTE_AND_STORE_STRAIN){
stop_timing_gpu(&start,&stop,"Kernel_2_noatt_iso_strain_impl");
}else{
realw time;
Expand Down Expand Up @@ -1065,7 +1064,6 @@ void FC_FUNC_(compute_forces_viscoelastic_cuda,
int* nspec_inner_elastic,
int* COMPUTE_AND_STORE_STRAIN,
int* ATTENUATION,
int* ANISOTROPY,
int* FORWARD_OR_ADJOINT_f) {

TRACE("\tcompute_forces_viscoelastic_cuda");
Expand Down Expand Up @@ -1129,7 +1127,7 @@ void FC_FUNC_(compute_forces_viscoelastic_cuda,

Kernel_2(nb_blocks_to_compute,mp,*iphase,*deltat,
*COMPUTE_AND_STORE_STRAIN,
*ATTENUATION,*ANISOTROPY,
*ATTENUATION,
mp->d_ibool + offset,
mp->d_xix + offset,mp->d_xiy + offset,mp->d_xiz + offset,
mp->d_etax + offset,mp->d_etay + offset,mp->d_etaz + offset,
Expand Down Expand Up @@ -1178,7 +1176,7 @@ void FC_FUNC_(compute_forces_viscoelastic_cuda,
// no mesh coloring: uses atomic updates
Kernel_2(num_elements,mp,*iphase,*deltat,
*COMPUTE_AND_STORE_STRAIN,
*ATTENUATION,*ANISOTROPY,
*ATTENUATION,
mp->d_ibool,
mp->d_xix,mp->d_xiy,mp->d_xiz,
mp->d_etax,mp->d_etay,mp->d_etaz,
Expand Down
4 changes: 2 additions & 2 deletions src/gpu/kernels/Kernel_2_acoustic_impl.cu
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Kernel_2_acoustic_impl(const int nb_blocks_to_compute,

// local padded index
offset = working_element*NGLL3_PADDED + tx;
ispec_irreg = d_irregular_element_number[working_element] -1;
ispec_irreg = d_irregular_element_number[working_element] - 1;
// global index
iglob = d_ibool[offset] - 1;

Expand Down Expand Up @@ -623,7 +623,7 @@ Kernel_2_acoustic_single_impl(const int nb_blocks_to_compute,

// local padded index
offset = working_element*NGLL3_PADDED + tx;
ispec_irreg = d_irregular_element_number[working_element] -1;
ispec_irreg = d_irregular_element_number[working_element] - 1;
// global index
iglob = d_ibool[offset] - 1;

Expand Down
Loading

0 comments on commit c7590b6

Please sign in to comment.