[cig-commits] r21057 - in seismo/3D/SPECFEM3D/trunk/src: cuda shared specfem3D

danielpeter at geodynamics.org danielpeter at geodynamics.org
Tue Nov 20 03:50:33 PST 2012


Author: danielpeter
Date: 2012-11-20 03:50:33 -0800 (Tue, 20 Nov 2012)
New Revision: 21057

Modified:
   seismo/3D/SPECFEM3D/trunk/src/cuda/compute_forces_elastic_cuda.cu
   seismo/3D/SPECFEM3D/trunk/src/shared/force_ftz.c
   seismo/3D/SPECFEM3D/trunk/src/specfem3D/compute_add_sources_poroelastic.f90
Log:
bug fix for force_ftz.c and compute_forces_elastic_cuda.cu

Modified: seismo/3D/SPECFEM3D/trunk/src/cuda/compute_forces_elastic_cuda.cu
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/cuda/compute_forces_elastic_cuda.cu	2012-11-20 01:52:16 UTC (rev 21056)
+++ seismo/3D/SPECFEM3D/trunk/src/cuda/compute_forces_elastic_cuda.cu	2012-11-20 11:50:33 UTC (rev 21057)
@@ -39,6 +39,7 @@
 
 #ifdef USE_TEXTURES_FIELDS
 texture<realw, cudaTextureType1D, cudaReadModeElementType> d_displ_tex;
+texture<realw, cudaTextureType1D, cudaReadModeElementType> d_veloc_tex;
 texture<realw, cudaTextureType1D, cudaReadModeElementType> d_accel_tex;
 #endif
 
@@ -801,7 +802,7 @@
   if(ATTENUATION){
     // use first order Taylor expansion of displacement for local storage of stresses 
     // at this current time step, to fix attenuation in a consistent way
-#ifdef USE_TEXTURES
+#ifdef USE_TEXTURES_FIELDS
     s_dummyx_loc_att[tx] = s_dummyx_loc[tx] + d_deltat * tex1Dfetch(d_veloc_tex, iglob);
     s_dummyy_loc_att[tx] = s_dummyy_loc[tx] + d_deltat * tex1Dfetch(d_veloc_tex, iglob + NGLOB);
     s_dummyz_loc_att[tx] = s_dummyz_loc[tx] + d_deltat * tex1Dfetch(d_veloc_tex, iglob + 2*NGLOB);

Modified: seismo/3D/SPECFEM3D/trunk/src/shared/force_ftz.c
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/shared/force_ftz.c	2012-11-20 01:52:16 UTC (rev 21056)
+++ seismo/3D/SPECFEM3D/trunk/src/shared/force_ftz.c	2012-11-20 11:50:33 UTC (rev 21057)
@@ -51,6 +51,7 @@
 #define FTZ_BIT 15
 #define UNDERFLOW_EXCEPTION_MASK 11
 
+#ifdef __GNUC__ // only use these features on gnu compiler
 #ifdef HAVE_XMMINTRIN
   #define FORCE_FTZ
   #include <xmmintrin.h>
@@ -58,10 +59,12 @@
   #include <emmintrin.h>
   #define FORCE_FTZ
 #endif
+#endif // __GNUC__
 
 void
 FC_FUNC_(force_ftz,FORCE_FTZ)()
 {
+#ifdef __GNUC__
 #ifdef FORCE_FTZ
   unsigned int x;
 
@@ -71,4 +74,5 @@
   x |= (1 << UNDERFLOW_EXCEPTION_MASK);
   _mm_setcsr(x);
 #endif
+#endif // __GNUC__ 
 }

Modified: seismo/3D/SPECFEM3D/trunk/src/specfem3D/compute_add_sources_poroelastic.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/specfem3D/compute_add_sources_poroelastic.f90	2012-11-20 01:52:16 UTC (rev 21056)
+++ seismo/3D/SPECFEM3D/trunk/src/specfem3D/compute_add_sources_poroelastic.f90	2012-11-20 11:50:33 UTC (rev 21057)
@@ -146,12 +146,12 @@
               !f0 = hdur(isource) !! using hdur as a FREQUENCY just to avoid changing CMTSOLUTION file format
               !t0 = 1.2d0/f0
 
-              if (it == 1 .and. myrank == 0) then
-                print *,'using a source of dominant frequency ',f0
+!              if (it == 1 .and. myrank == 0) then
+!                print *,'using a source of dominant frequency ',f0
 !chris
 !                print *,'lambda_S at dominant frequency = ',3000./sqrt(3.)/f0
 !                print *,'lambda_S at highest significant frequency = ',3000./sqrt(3.)/(2.5*f0)
-              endif
+!              endif
 
               if( USE_RICKER_TIME_FUNCTION ) then
                  stf = comp_source_time_function_rickr(dble(it-1)*DT-t0-tshift_src(isource),hdur(isource))



More information about the CIG-COMMITS mailing list