From 533576d6618029a465155dcba166adf478400dbe Mon Sep 17 00:00:00 2001 From: jthorn Date: Tue, 28 Sep 2004 13:54:42 +0000 Subject: += more debugging code (all inside #ifdef AEILOCALINTERP_DEBUG or AEILOCALINTERP_DEBUG2) git-svn-id: http://svn.aei.mpg.de/numrel/AEIThorns/AEILocalInterp/trunk@26 0f49ee68-0e4f-0410-9b9c-b2c123ded7ef --- src/template.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/src/template.c b/src/template.c index 816071c..6b231b9 100644 --- a/src/template.c +++ b/src/template.c @@ -209,8 +209,8 @@ @version $Header$ @@*/ -#undef AEILOCALINTERP_DEBUG /* define this for verbose debugging output */ -#undef AEILOCALINTERP_DEBUG2 /* define this for even more verbose debugging output */ +#undef AEILOCALINTERP_DEBUG /* define this for verbose debugging output */ +#undef AEILOCALINTERP_DEBUG2 /* define this for even more verbose debugging output */ /******************************************************************************/ @@ -921,6 +921,20 @@ fflush(stdout); { const int ibndry_min = 2*axis; const int ibndry_max = 2*axis + 1; + #ifdef AEILOCALINTERP_DEBUG2 + printf("axis=%d ibndry_{min,max}=%d,%d MOLECULE_SIZE=%d\n", + axis, ibndry_min, ibndry_max, MOLECULE_SIZE); + printf(" coord_origin[%d]=%g coord_delta[%d]=%g\n", + axis, (double)coord_origin[axis], + axis, (double)coord_delta[axis]); + printf(" input_array_[min,max]_subscripts[%d]=[%d,%d]\n", + axis, + (int)input_array_min_subscripts[axis], + (int)input_array_max_subscripts[axis]); + printf(" N_boundary_points_to_omit[ibndry_[min,max]]=[%d,%d]\n", + (int)N_boundary_points_to_omit[ibndry_min], + (int)N_boundary_points_to_omit[ibndry_max]); + #endif const int mp_status = AEILocalInterp_molecule_posn (coord_origin[axis], coord_delta[axis], input_array_min_subscripts[axis] @@ -1261,6 +1275,28 @@ case CCTK_VARIABLE_REAL: LOAD_DATA_REAL(input_array_ptr_real, STRIDE_IJK, &data); + #if defined(AEILOCALINTERP_DEBUG2) \ + && (N_DIMS == 2) && (MOLECULE_SIZE == 4) + /* we assume a cubical molecule :( */ + printf("AEILocalInterp:: loaded data is:\n"); + printf(" data_m1_m1 = %g\n", (double) data.data_m1_m1); + printf(" data_0_m1 = %g\n", (double) data.data_0_m1); + printf(" data_p1_m1 = %g\n", (double) data.data_p1_m1); + printf(" data_p2_m1 = %g\n", (double) data.data_p2_m1); + printf(" data_m1_0 = %g\n", (double) data.data_m1_0); + printf(" data_0_0 = %g\n", (double) data.data_0_0); + printf(" data_p1_0 = %g\n", (double) data.data_p1_0); + printf(" data_p2_0 = %g\n", (double) data.data_p2_0); + printf(" data_m1_p1 = %g\n", (double) data.data_m1_p1); + printf(" data_0_p1 = %g\n", (double) data.data_0_p1); + printf(" data_p1_p1 = %g\n", (double) data.data_p1_p1); + printf(" data_p2_p1 = %g\n", (double) data.data_p2_p1); + printf(" data_m1_p2 = %g\n", (double) data.data_m1_p2); + printf(" data_0_p2 = %g\n", (double) data.data_0_p2); + printf(" data_p1_p2 = %g\n", (double) data.data_p1_p2); + printf(" data_p2_p2 = %g\n", (double) data.data_p2_p2); + fflush(stdout); + #endif break; } @@ -1486,6 +1522,16 @@ case CCTK_VARIABLE_REAL: { CCTK_REAL *const output_array_ptr_real = (CCTK_REAL *) output_arrays[out]; + #ifdef AEILOCALINTERP_DEBUG2 + if ((pt & (pt-1)) == 0) /* pt is 0 or a power of 2 */ + then { + printf(" result addr is %p\n", + (void *) &output_array_ptr_real[pt]); + printf(" previous value there was %g\n", + output_array_ptr_real[pt]); + fflush(stdout); + } + #endif output_array_ptr_real[pt] = (CCTK_REAL) result; break; } -- cgit v1.2.3