[cig-commits] r20027 - in seismo/3D/SPECFEM3D/trunk/src: decompose_mesh_SCOTCH generate_databases meshfem3D shared specfem3D

danielpeter at geodynamics.org danielpeter at geodynamics.org
Thu May 3 08:41:59 PDT 2012


Author: danielpeter
Date: 2012-05-03 08:41:58 -0700 (Thu, 03 May 2012)
New Revision: 20027

Modified:
   seismo/3D/SPECFEM3D/trunk/src/decompose_mesh_SCOTCH/decompose_mesh_SCOTCH.f90
   seismo/3D/SPECFEM3D/trunk/src/decompose_mesh_SCOTCH/part_decompose_mesh_SCOTCH.f90
   seismo/3D/SPECFEM3D/trunk/src/generate_databases/Makefile.in
   seismo/3D/SPECFEM3D/trunk/src/generate_databases/generate_databases.f90
   seismo/3D/SPECFEM3D/trunk/src/generate_databases/model_external_values.f90
   seismo/3D/SPECFEM3D/trunk/src/generate_databases/model_tomography.f90
   seismo/3D/SPECFEM3D/trunk/src/meshfem3D/meshfem3D.f90
   seismo/3D/SPECFEM3D/trunk/src/shared/serial.f90
   seismo/3D/SPECFEM3D/trunk/src/specfem3D/initialize_simulation.f90
Log:
fixes decomposer integer(long) issues

Modified: seismo/3D/SPECFEM3D/trunk/src/decompose_mesh_SCOTCH/decompose_mesh_SCOTCH.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/decompose_mesh_SCOTCH/decompose_mesh_SCOTCH.f90	2012-05-03 00:10:31 UTC (rev 20026)
+++ seismo/3D/SPECFEM3D/trunk/src/decompose_mesh_SCOTCH/decompose_mesh_SCOTCH.f90	2012-05-03 15:41:58 UTC (rev 20027)
@@ -37,11 +37,11 @@
   integer :: nparts ! e.g. 4 for partitioning for 4 CPUs or 4 processes
 
 ! mesh arrays
-  integer :: nspec
+  integer(long) :: nspec
   integer, dimension(:,:), allocatable  :: elmnts
   integer, dimension(:,:), allocatable  :: mat
   integer, dimension(:), allocatable  :: part
-
+  
   integer :: nnodes
   double precision, dimension(:,:), allocatable  :: nodes_coords
 
@@ -62,13 +62,13 @@
   integer  ::  ninterfaces
   integer  :: my_ninterface
 
-  integer  :: nsize           ! Max number of elements that contain the same node.
+  integer(long)  :: nsize           ! Max number of elements that contain the same node.
   integer  :: nb_edges
 
   integer  :: ispec, inode
   integer  :: ngnod
   integer  :: max_neighbour         ! Real maximum number of neighbours per element
-  integer  :: sup_neighbour   ! Majoration of the maximum number of neighbours per element
+  integer(long)  :: sup_neighbour   ! Majoration of the maximum number of neighbours per element
 
   integer  :: ipart, nnodes_loc, nspec_loc
   integer  :: num_elmnt, num_node, num_mat
@@ -674,8 +674,10 @@
     if( ier /= 0 ) stop 'error allocating array nnodes_elmnts'
     allocate(nodes_elmnts(1:nsize*nnodes),stat=ier)
     if( ier /= 0 ) stop 'error allocating array nodes_elmnts'
+
     call mesh2dual_ncommonnodes(nspec, nnodes, nsize, sup_neighbour, elmnts, xadj, adjncy, nnodes_elmnts, &
          nodes_elmnts, max_neighbour, 1)
+
     print*, 'mesh2dual: '
     print*, '  max_neighbour = ',max_neighbour
 
@@ -788,8 +790,7 @@
     if (ier /= 0) then
        stop 'ERROR : MAIN : Cannot destroy strat'
     endif
-
-
+    
   ! re-partitioning puts poroelastic-elastic coupled elements into same partition
   !  integer  :: nfaces_coupled
   !  integer, dimension(:,:), pointer  :: faces_coupled
@@ -805,7 +806,7 @@
                      nspec2D_moho,ibelm_moho,nodes_ibelm_moho )
 
 
-  ! local number of each element for each partition
+  ! local number of each element for each partition    
     call build_glob2loc_elmnts(nspec, part, glob2loc_elmnts,nparts)
 
   ! local number of each node for each partition
@@ -879,7 +880,6 @@
        ! writes out spectral element indices
        !write(IIN_database,*) nspec_loc
        write(IIN_database) nspec_loc
-
        call write_partition_database(IIN_database, ipart, nspec_loc, nspec, elmnts, &
                                   glob2loc_elmnts, glob2loc_nodes_nparts, &
                                   glob2loc_nodes_parts, glob2loc_nodes, part, mat, ngnod, 2)

Modified: seismo/3D/SPECFEM3D/trunk/src/decompose_mesh_SCOTCH/part_decompose_mesh_SCOTCH.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/decompose_mesh_SCOTCH/part_decompose_mesh_SCOTCH.f90	2012-05-03 00:10:31 UTC (rev 20026)
+++ seismo/3D/SPECFEM3D/trunk/src/decompose_mesh_SCOTCH/part_decompose_mesh_SCOTCH.f90	2012-05-03 15:41:58 UTC (rev 20027)
@@ -55,9 +55,9 @@
   ! Creating dual graph (adjacency is defined by 'ncommonnodes' between two elements).
   !-----------------------------------------------
   subroutine mesh2dual_ncommonnodes(nelmnts, nnodes, nsize, sup_neighbour, elmnts,&
-                        xadj, adjncy, &
-                        nnodes_elmnts, nodes_elmnts, &
-                        max_neighbour, ncommonnodes)
+                                    xadj, adjncy, &
+                                    nnodes_elmnts, nodes_elmnts, &
+                                    max_neighbour, ncommonnodes)
 
     integer(long), intent(in)  :: nelmnts
     integer, intent(in)  :: nnodes

Modified: seismo/3D/SPECFEM3D/trunk/src/generate_databases/Makefile.in
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/generate_databases/Makefile.in	2012-05-03 00:10:31 UTC (rev 20026)
+++ seismo/3D/SPECFEM3D/trunk/src/generate_databases/Makefile.in	2012-05-03 15:41:58 UTC (rev 20027)
@@ -193,12 +193,17 @@
 $O/parallel.o:  ${SHARED}/constants.h ${SHARED}/parallel.f90
 	${MPIFCCOMPILE_CHECK} -c -o $O/parallel.o ${SHARED}/parallel.f90
 
+###
+###
+###
+
 $O/model_external_values.o:  ${SHARED}/constants.h model_external_values.f90
-	${MPIFCCOMPILE_CHECK} -c -o $O/model_external_values.o model_external_values.f90
+	${FCCOMPILE_CHECK} -c -o $O/model_external_values.o model_external_values.f90
 
 $O/model_tomography.o:  ${SHARED}/constants.h model_tomography.f90
-	${MPIFCCOMPILE_CHECK} -c -o $O/model_tomography.o model_tomography.f90
+	${FCCOMPILE_CHECK} -c -o $O/model_tomography.o model_tomography.f90
 
+
 ###
 ### serial compilation without optimization
 ###

Modified: seismo/3D/SPECFEM3D/trunk/src/generate_databases/generate_databases.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/generate_databases/generate_databases.f90	2012-05-03 00:10:31 UTC (rev 20026)
+++ seismo/3D/SPECFEM3D/trunk/src/generate_databases/generate_databases.f90	2012-05-03 15:41:58 UTC (rev 20027)
@@ -386,7 +386,9 @@
   if(sizeprocs /= NPROC) then
     if( myrank == 0 ) then
       write(IMAIN,*) 'error: number of processors supposed to run on: ',NPROC
-      write(IMAIN,*) 'error: number of processors actually run on: ',sizeprocs
+      write(IMAIN,*) 'error: number of MPI processors actually run on: ',sizeprocs
+      print*, 'error: number of processors supposed to run on: ',NPROC
+      print*, 'error: number of MPI processors actually run on: ',sizeprocs      
     endif
     call exit_MPI(myrank,'wrong number of MPI processes')
   endif

Modified: seismo/3D/SPECFEM3D/trunk/src/generate_databases/model_external_values.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/generate_databases/model_external_values.f90	2012-05-03 00:10:31 UTC (rev 20026)
+++ seismo/3D/SPECFEM3D/trunk/src/generate_databases/model_external_values.f90	2012-05-03 15:41:58 UTC (rev 20027)
@@ -62,8 +62,6 @@
   implicit none
 
   include "constants.h"
-  ! standard include of the MPI library
-  include 'mpif.h'
 
   integer :: myrank
 
@@ -83,7 +81,7 @@
   !if(myrank == 0) call read_external_model()
 
   ! broadcast the information read on the master to the nodes
-  !call MPI_BCAST(MEXT_V%dvs,size(MEXT_V%dvs),MPI_DOUBLE_PRECISION,0,MPI_COMM_WORLD,ier)
+  !call bcast_all_dp(MEXT_V%dvs, size(MEXT_V%dvs))
 
   end subroutine model_external_broadcast
 

Modified: seismo/3D/SPECFEM3D/trunk/src/generate_databases/model_tomography.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/generate_databases/model_tomography.f90	2012-05-03 00:10:31 UTC (rev 20026)
+++ seismo/3D/SPECFEM3D/trunk/src/generate_databases/model_tomography.f90	2012-05-03 15:41:58 UTC (rev 20027)
@@ -67,8 +67,6 @@
   implicit none
 
   ! include "constants.h"
-  ! include "precision.h"
-  ! include 'mpif.h'
   integer :: myrank
 
   ! all processes read in same file
@@ -80,12 +78,13 @@
   ! only master reads in model file
   !if(myrank == 0) call read_external_model()
   ! broadcast the information read on the master to the nodes, e.g.
-  !call MPI_BCAST(nrecord,1,MPI_INTEGER,0,MPI_COMM_WORLD,ier)
+  !call bcast_all_i(nrecord,1)
+  
   !if( myrank /= 0 ) then
   ! allocate( vp_tomography(1:nrecord) ,stat=ier)
   ! if( ier /= 0 ) stop 'error allocating array vp_tomography'
   !endif
-  !call MPI_BCAST(vp_tomography,size(vp_tomography),CUSTOM_MPI_TYPE,0,MPI_COMM_WORLD,ier)
+  !call bcast_all_cr(vp_tomography,size(vp_tomography))
 
   end subroutine model_tomography_broadcast
 

Modified: seismo/3D/SPECFEM3D/trunk/src/meshfem3D/meshfem3D.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/meshfem3D/meshfem3D.f90	2012-05-03 00:10:31 UTC (rev 20026)
+++ seismo/3D/SPECFEM3D/trunk/src/meshfem3D/meshfem3D.f90	2012-05-03 15:41:58 UTC (rev 20027)
@@ -402,7 +402,12 @@
 
 ! check that the code is running with the requested nb of processes
   if(sizeprocs /= NPROC) then
-    print*,'error requested nproc',NPROC,'not equal to size proc',sizeprocs
+    if( myrank == 0 ) then
+      write(IMAIN,*) 'error: number of processors supposed to run on: ',NPROC
+      write(IMAIN,*) 'error: number of MPI processors actually run on: ',sizeprocs
+      print*, 'error: number of processors supposed to run on: ',NPROC
+      print*, 'error: number of MPI processors actually run on: ',sizeprocs      
+    endif
     call exit_MPI(myrank,'wrong number of MPI processes')
   endif
 

Modified: seismo/3D/SPECFEM3D/trunk/src/shared/serial.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/shared/serial.f90	2012-05-03 00:10:31 UTC (rev 20026)
+++ seismo/3D/SPECFEM3D/trunk/src/shared/serial.f90	2012-05-03 15:41:58 UTC (rev 20027)
@@ -38,7 +38,13 @@
 !
 
   double precision function wtime()
-  wtime = 0.d0
+  real :: ct
+
+  ! note: for simplicity, we take cpu_time which returns the elapsed CPU time in seconds
+  !          (instead of wall clock time for parallel MPI function)
+  call cpu_time(ct)
+
+  wtime = ct
   end function wtime
 
 !

Modified: seismo/3D/SPECFEM3D/trunk/src/specfem3D/initialize_simulation.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/specfem3D/initialize_simulation.f90	2012-05-03 00:10:31 UTC (rev 20026)
+++ seismo/3D/SPECFEM3D/trunk/src/specfem3D/initialize_simulation.f90	2012-05-03 15:41:58 UTC (rev 20027)
@@ -187,7 +187,15 @@
   call world_size(sizeprocs)
 
   ! check that the code is running with the requested nb of processes
-  if(sizeprocs /= NPROC) call exit_MPI(myrank,'wrong number of MPI processes')
+  if(sizeprocs /= NPROC) then
+    if( myrank == 0 ) then
+      write(IMAIN,*) 'error: number of processors supposed to run on: ',NPROC
+      write(IMAIN,*) 'error: number of MPI processors actually run on: ',sizeprocs
+      print*, 'error: number of processors supposed to run on: ',NPROC
+      print*, 'error: number of MPI processors actually run on: ',sizeprocs      
+    endif
+    call exit_MPI(myrank,'wrong number of MPI processes')
+  endif
 
   ! check that we have at least one source
   if(NSOURCES < 1) call exit_MPI(myrank,'need at least one source')



More information about the CIG-COMMITS mailing list