Skip to content

Commit

Permalink
updates debug trace outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeter committed May 1, 2021
1 parent d7f3d67 commit 0d3c7b5
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 21 deletions.
13 changes: 13 additions & 0 deletions src/generate_databases/save_arrays_solver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,19 @@ subroutine save_arrays_solver_files(nspec,ibool)
endif ! NPROC > 1
endif !if (SAVE_MESH_FILES_ADDITIONAL)

!debug
! saves ispec number
!allocate(v_tmp_i(nspec),stat=ier)
!if (ier /= 0) call exit_MPI_without_rank('error allocating array 656')
!if (ier /= 0) stop 'error allocating array v_tmp_i'
!do i = 1,nspec
! v_tmp_i(i) = i
!enddo
!filename = prname(1:len_trim(prname))//'ispec_number'
!call write_VTK_data_elem_i(nspec,nglob_unique,xstore_unique,ystore_unique,zstore_unique,ibool, &
! v_tmp_i,filename)
!deallocate(v_tmp_i)

end subroutine save_arrays_solver_files

!
Expand Down
8 changes: 4 additions & 4 deletions src/gpu/assemble_MPI_vector_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void FC_FUNC_(transfer_boun_accel_from_device,
TRANSFER_BOUN_ACCEL_FROM_DEVICE)(long* Mesh_pointer,
realw* send_accel_buffer,
const int* FORWARD_OR_ADJOINT){
TRACE("\ttransfer_boun_accel_from_device");
TRACE("transfer_boun_accel_from_device");

Mesh* mp = (Mesh*)(*Mesh_pointer); //get mesh pointer out of fortran integer container

Expand Down Expand Up @@ -123,7 +123,7 @@ void FC_FUNC_(transfer_boundary_from_device_a,

// asynchronous transfer from device to host

TRACE("\ttransfer_boundary_from_device_a");
TRACE("transfer_boundary_from_device_a");

Mesh* mp = (Mesh*)(*Mesh_pointer); // get Mesh from fortran integer wrapper

Expand Down Expand Up @@ -210,7 +210,7 @@ void FC_FUNC_(transfer_asmbl_accel_to_device,
const int* nibool_interfaces_ext_mesh,
const int* ibool_interfaces_ext_mesh,
const int* FORWARD_OR_ADJOINT) {
TRACE("\ttransfer_asmbl_accel_to_device");
TRACE("transfer_asmbl_accel_to_device");

Mesh* mp = (Mesh*)(*Mesh_pointer); //get mesh pointer out of fortran integer container

Expand Down Expand Up @@ -310,7 +310,7 @@ void FC_FUNC_(transfer_sync_accel_to_device,
const int* nibool_interfaces_ext_mesh,
const int* ibool_interfaces_ext_mesh,
const int* FORWARD_OR_ADJOINT) {
TRACE("\ttransfer_sync_accel_to_device");
TRACE("transfer_sync_accel_to_device");

Mesh* mp = (Mesh*)(*Mesh_pointer); //get mesh pointer out of fortran integer container

Expand Down
2 changes: 1 addition & 1 deletion src/gpu/check_fields_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ void FC_FUNC_(get_norm_elastic_from_device,
long* Mesh_pointer,
int* type) {

TRACE("\tget_norm_elastic_from_device");
TRACE("get_norm_elastic_from_device");
//double start_time = get_time_val();

Mesh* mp = (Mesh*)(*Mesh_pointer); //get mesh pointer out of fortran integer container
Expand Down
8 changes: 4 additions & 4 deletions src/gpu/compute_add_sources_viscoelastic_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void FC_FUNC_(compute_add_sources_el_cuda,
double* h_stf_pre_compute,
int* h_NSOURCES) {

TRACE("\tcompute_add_sources_el_cuda");
TRACE("compute_add_sources_el_cuda");

Mesh* mp = (Mesh*)(*Mesh_pointer); //get mesh pointer out of fortran integer container

Expand Down Expand Up @@ -107,7 +107,7 @@ void FC_FUNC_(compute_add_sources_el_s3_cuda,
double* h_stf_pre_compute,
int* h_NSOURCES) {

TRACE("\tcompute_add_sources_el_s3_cuda");
TRACE("compute_add_sources_el_s3_cuda");
// EPIK_TRACER("compute_add_sources_el_s3_cuda");

Mesh* mp = (Mesh*)(*Mesh_pointer); //get mesh pointer out of fortran integer container
Expand Down Expand Up @@ -176,7 +176,7 @@ void FC_FUNC_(add_source_main_rec_noise_cu,
int* irec_main_noise_f,
int* islice_selected_rec) {

TRACE("\tadd_source_main_rec_noise_cu");
TRACE("add_source_main_rec_noise_cu");

Mesh* mp = (Mesh*)(*Mesh_pointer); //get mesh pointer out of fortran integer container

Expand Down Expand Up @@ -229,7 +229,7 @@ void FC_FUNC_(add_sources_el_sim_type_2_or_3,
int* NTSTEP_BETWEEN_READ_ADJSRC,
int* it) {

TRACE("\tadd_sources_el_sim_type_2_or_3");
TRACE("add_sources_el_sim_type_2_or_3");

Mesh* mp = (Mesh*)(*Mesh_pointer); //get mesh pointer out of fortran integer container

Expand Down
3 changes: 2 additions & 1 deletion src/gpu/compute_coupling_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ void FC_FUNC_(compute_coupling_el_ac_cuda,
field* potential_dot_dot;
realw *accel,*displ;
int backward_simulation;

if (*FORWARD_OR_ADJOINT == 1) {
// forward fields
backward_simulation = 0;
Expand Down Expand Up @@ -237,7 +238,7 @@ void FC_FUNC_(compute_coupling_ocean_cuda,
COMPUTE_COUPLING_OCEAN_CUDA)(long* Mesh_pointer,
int* FORWARD_OR_ADJOINT) {

TRACE("\tcompute_coupling_ocean_cuda");
TRACE("compute_coupling_ocean_cuda");

Mesh* mp = (Mesh*)(*Mesh_pointer); //get mesh pointer out of fortran integer container

Expand Down
4 changes: 2 additions & 2 deletions src/gpu/compute_forces_viscoelastic_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void Kernel_2(int nb_blocks_to_compute,Mesh* mp,int d_iphase,realw d_deltat,
realw* d_rhostore,
const int FORWARD_OR_ADJOINT){

TRACE("\tKernel_2");
TRACE("Kernel_2");

GPU_ERROR_CHECKING("before kernel Kernel 2");

Expand Down Expand Up @@ -1066,7 +1066,7 @@ void FC_FUNC_(compute_forces_viscoelastic_cuda,
int* ATTENUATION,
int* FORWARD_OR_ADJOINT_f) {

TRACE("\tcompute_forces_viscoelastic_cuda");
TRACE("compute_forces_viscoelastic_cuda");
// EPIK_TRACER("compute_forces_viscoelastic_cuda");
//printf("Running compute_forces\n");
//double start_time = get_time_val();
Expand Down
4 changes: 2 additions & 2 deletions src/gpu/compute_stacey_viscoelastic_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void FC_FUNC_(compute_stacey_viscoelastic_cuda,
realw* b_absorb_field,
int* FORWARD_OR_ADJOINT_f) {

TRACE("\tcompute_stacey_viscoelastic_cuda");
TRACE("compute_stacey_viscoelastic_cuda");

Mesh* mp = (Mesh*)(*Mesh_pointer); //get mesh pointer out of fortran integer container
int FORWARD_OR_ADJOINT = *FORWARD_OR_ADJOINT_f;
Expand Down Expand Up @@ -226,7 +226,7 @@ void FC_FUNC_(compute_stacey_viscoelastic_undoatt_cuda,
int* iphasef,
int* FORWARD_OR_ADJOINT_f) {

TRACE("\tcompute_stacey_viscoelastic_undoatt_cuda");
TRACE("compute_stacey_viscoelastic_undoatt_cuda");

Mesh* mp = (Mesh*)(*Mesh_pointer); //get mesh pointer out of fortran integer container
int FORWARD_OR_ADJOINT = *FORWARD_OR_ADJOINT_f;
Expand Down
2 changes: 1 addition & 1 deletion src/gpu/kernels/kernel_3_accel_cuda_device.cu
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ __global__ void kernel_3_accel_cuda_device(realw_p accel,
// because of block and grid sizing problems, there is a small
// amount of buffer at the end of the calculation
if (id < size) {
accel[3*id ] = accel[3*id ] * rmassx[id];;
accel[3*id ] = accel[3*id ] * rmassx[id];
accel[3*id+1] = accel[3*id+1] * rmassy[id];
accel[3*id+2] = accel[3*id+2] * rmassz[id];
}
Expand Down
4 changes: 2 additions & 2 deletions src/gpu/mesh_constants_gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ static inline void get_blocks_xy(int num_blocks, int* num_blocks_x, int* num_blo
}

#if DEBUG == 1
printf("work group - total %d has group size x = %d / y = %d\n",
printf("\twork group - total %d has group size x = %d / y = %d\n",
num_blocks,*num_blocks_x,*num_blocks_y);
#endif

Expand All @@ -794,7 +794,7 @@ static inline void get_blocks_xy(int num_blocks, int* num_blocks_x, int* num_blo
}

#if DEBUG == 1
printf("balancing work group with limit size %d - total %d has group size x = %d / y = %d\n",
printf("\tbalancing work group with limit size %d - total %d has group size x = %d / y = %d\n",
BALANCE_WORK_GROUP_UNITS,num_blocks,*num_blocks_x,*num_blocks_y);
#endif

Expand Down
8 changes: 4 additions & 4 deletions src/gpu/update_displacement_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void FC_FUNC_(update_displacement_cuda,
realw* deltatsqover2_F,
int* FORWARD_OR_ADJOINT) {

TRACE("\tupdate_displacement_cuda");
TRACE("update_displacement_cuda");

Mesh* mp = (Mesh*)(*Mesh_pointer); // get Mesh from fortran integer wrapper

Expand Down Expand Up @@ -130,7 +130,7 @@ void FC_FUNC_(update_displacement_ac_cuda,
realw* deltatover2_F,
realw* deltatsqover2_F,
int* FORWARD_OR_ADJOINT) {
TRACE("\tupdate_displacement_ac_cuda");
TRACE("update_displacement_ac_cuda");
Mesh* mp = (Mesh*)(*Mesh_pointer); // get Mesh from fortran integer wrapper

// safety check
Expand Down Expand Up @@ -226,7 +226,7 @@ void FC_FUNC_(kernel_3_a_cuda,
int* APPROXIMATE_OCEAN_LOAD,
int* FORWARD_OR_ADJOINT) {

TRACE("\tkernel_3_a_cuda");
TRACE("kernel_3_a_cuda");

Mesh* mp = (Mesh*)(*Mesh_pointer); // get Mesh from fortran integer wrapper

Expand Down Expand Up @@ -319,7 +319,7 @@ void FC_FUNC_(kernel_3_b_cuda,
realw* deltatover2_F,
realw* b_deltatover2_F,
int* FORWARD_OR_ADJOINT) {
TRACE("\tkernel_3_b_cuda");
TRACE("kernel_3_b_cuda");

Mesh* mp = (Mesh*)(*Mesh_pointer); // get Mesh from fortran integer wrapper

Expand Down

0 comments on commit 0d3c7b5

Please sign in to comment.