[cig-commits] [commit] devel: fixed overflow of degrees-of-freedom counters when more that 2 gigapoints; added comment about Zlib -lz to the users manual (4981f6c)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Sat Feb 8 07:02:21 PST 2014


Repository : ssh://geoshell/specfem3d

On branch  : devel
Link       : https://github.com/geodynamics/specfem3d/compare/41975332bd5a4dd2b596402d11e34b520f3bd311...40388be746766d729c7c8d54a9f2541f787ffad1

>---------------------------------------------------------------

commit 4981f6c33ad3b26579e7b89bd403eaef33ffa5e1
Author: Dimitri Komatitsch <komatitsch at lma.cnrs-mrs.fr>
Date:   Sat Feb 8 16:00:03 2014 +0100

    fixed overflow of degrees-of-freedom counters when more that 2 gigapoints; added comment about Zlib -lz to the users manual


>---------------------------------------------------------------

4981f6c33ad3b26579e7b89bd403eaef33ffa5e1
 doc/USER_MANUAL/manual_SPECFEM3D_Cartesian.pdf    | Bin 12634307 -> 12634639 bytes
 doc/USER_MANUAL/manual_SPECFEM3D_Cartesian.tex    |   5 +++++
 src/generate_databases/finalize_databases.f90     |  13 ++++++++++---
 src/generate_databases/generate_databases_par.f90 |   5 ++++-
 src/meshfem3D/meshfem3D.f90                       |   8 ++++++--
 5 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/doc/USER_MANUAL/manual_SPECFEM3D_Cartesian.pdf b/doc/USER_MANUAL/manual_SPECFEM3D_Cartesian.pdf
index a16950d..a3713da 100644
Binary files a/doc/USER_MANUAL/manual_SPECFEM3D_Cartesian.pdf and b/doc/USER_MANUAL/manual_SPECFEM3D_Cartesian.pdf differ
diff --git a/doc/USER_MANUAL/manual_SPECFEM3D_Cartesian.tex b/doc/USER_MANUAL/manual_SPECFEM3D_Cartesian.tex
index 5ff3e7b..89cdf1b 100644
--- a/doc/USER_MANUAL/manual_SPECFEM3D_Cartesian.tex
+++ b/doc/USER_MANUAL/manual_SPECFEM3D_Cartesian.tex
@@ -425,6 +425,11 @@ that you use the Intel icc C compiler to compile Scotch, i.e., use:
 \begin{lyxcode}
 ./configure~CC=icc~FC=ifort~MPIFC=mpif90
 \end{lyxcode}
+
+When compiling the SCOTCH source code, if you get a message such as: "ld: cannot find -lz",
+the Zlib compression development library is probably missing on your machine and you will need to install it or ask your system administrator to 
+do so. On Linux machines the package is often called "zlib1g-dev" or similar. (thus "sudo apt-get install zlib1g-dev" would install it)
+
 To compile a serial version of the code for small meshes that fits
 on one compute node and can therefore be run serially, run \texttt{configure}
 with the \texttt{-{}-without-mpi} option to suppress all calls to
diff --git a/src/generate_databases/finalize_databases.f90 b/src/generate_databases/finalize_databases.f90
index fd49c13..14fd25e 100644
--- a/src/generate_databases/finalize_databases.f90
+++ b/src/generate_databases/finalize_databases.f90
@@ -25,7 +25,6 @@
 !=====================================================================
 !
 
-
   subroutine finalize_databases
 
 ! checks user input parameters
@@ -36,8 +35,12 @@
   integer :: i
 
 ! print number of points and elements in the mesh
-  call sum_all_i(NGLOB_AB,nglob_total)
   call sum_all_i(NSPEC_AB,nspec_total)
+
+! this can overflow if more than 2 Gigapoints in the whole mesh, thus replaced with double precision version
+! call sum_all_i(NGLOB_AB,nglob_total)
+  call sum_all_dp(dble(NGLOB_AB),nglob_total)
+
   call sync_all()
   if(myrank == 0) then
     write(IMAIN,*)
@@ -48,8 +51,12 @@
     write(IMAIN,*) 'total number of points in each slice: ',NGLOB_AB
     write(IMAIN,*)
     write(IMAIN,*) 'total number of elements in entire mesh: ',nspec_total
+! the float() statement below are for the case of more than 2 Gigapoints per mesh, in which
+! case and integer(kind=4) counter would overflow and display an incorrect negative value;
+! converting it to float fixes the problem (but then prints some extra decimals equal to zero).
+! Another option would be to declare the sum as integer(kind=8) and then print it.
     write(IMAIN,*) 'total number of points in entire mesh: ',nglob_total
-    write(IMAIN,*) 'total number of DOFs in entire mesh: ',nglob_total*NDIM
+    write(IMAIN,*) 'total number of DOFs in entire mesh: ',nglob_total*dble(NDIM)
     write(IMAIN,*)
     write(IMAIN,*) 'total number of time steps in the solver will be: ',NSTEP
     write(IMAIN,*)
diff --git a/src/generate_databases/generate_databases_par.f90 b/src/generate_databases/generate_databases_par.f90
index 418df98..c4550b7 100644
--- a/src/generate_databases/generate_databases_par.f90
+++ b/src/generate_databases/generate_databases_par.f90
@@ -162,7 +162,10 @@
   integer, dimension(:), allocatable  :: ibelm_moho
   integer, dimension(:,:), allocatable  :: nodes_ibelm_moho
 
-  integer :: nglob_total,nspec_total
+  integer :: nspec_total
+! this can overflow if more than 2 Gigapoints in the whole mesh, thus replaced with double precision version
+! integer :: nglob_total
+  double precision :: nglob_total
 
   logical,dimension(:),allocatable :: ispec_is_surface_external_mesh,iglob_is_surface_external_mesh
   integer :: nfaces_surface_ext_mesh,nfaces_surface_glob_ext_mesh
diff --git a/src/meshfem3D/meshfem3D.f90 b/src/meshfem3D/meshfem3D.f90
index 2b6b9f4..9e79ca6 100644
--- a/src/meshfem3D/meshfem3D.f90
+++ b/src/meshfem3D/meshfem3D.f90
@@ -847,8 +847,12 @@
     write(IMAIN,*) 'total number of points in each slice: ',NGLOB_AB
     write(IMAIN,*)
     write(IMAIN,*) 'total number of elements in entire mesh: ',NSPEC_AB*NPROC
-    write(IMAIN,*) 'total number of points in entire mesh: ',NGLOB_AB*NPROC
-    write(IMAIN,*) 'total number of DOFs in entire mesh: ',NGLOB_AB*NPROC*NDIM
+! the float() statements here are for the case of more than 2 Gigapoints per mesh, in which
+! case and integer(kind=4) counter would overflow and display an incorrect negative value;
+! converting it to float fixes the problem (but then prints some extra decimals equal to zero).
+! Another option would be to declare the sum as integer(kind=8) and then print it.
+    write(IMAIN,*) 'total number of points in entire mesh: ',dble(NGLOB_AB)*dble(NPROC)
+    write(IMAIN,*) 'total number of DOFs in entire mesh: ',dble(NGLOB_AB)*dble(NPROC*NDIM)
     write(IMAIN,*)
     ! write information about precision used for floating-point operations
     if(CUSTOM_REAL == SIZE_REAL) then



More information about the CIG-COMMITS mailing list