[cig-commits] r20999 - seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH

percygalvez at geodynamics.org percygalvez at geodynamics.org
Wed Nov 7 01:01:25 PST 2012


Author: percygalvez
Date: 2012-11-07 01:01:24 -0800 (Wed, 07 Nov 2012)
New Revision: 20999

Modified:
   seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/decompose_mesh_SCOTCH.f90
   seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/program_decompose_mesh_SCOTCH.f90
Log:
Adding a simple clock time routine to generate an output decompose.output to check how well the run goes and what takes long

Modified: seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/decompose_mesh_SCOTCH.f90
===================================================================
--- seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/decompose_mesh_SCOTCH.f90	2012-11-07 07:06:50 UTC (rev 20998)
+++ seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/decompose_mesh_SCOTCH.f90	2012-11-07 09:01:24 UTC (rev 20999)
@@ -83,13 +83,39 @@
   integer :: q_flag,aniso_flag,idomain_id
   double precision :: vp,vs,rho
 
+  character(len=*),Parameter :: FMT1 = "( ' # Date = ', i2.2, '/', i2.2, '/', i4.4, '; time = ',i2.2, ':', i2.2, ':', i2.2 )"
+
   contains
-  
   !----------------------------------------------------------------------------------------------
+  ! time subroutine open
+  !---------------------------------------------------------------------------------------------- 
+  subroutine clock_time(sentence)
+  ! Ouput file for decomposition time control.
+
+    character(len=17) :: OUTPUT_FILE='/decompose.output'
+    character(len=*) :: sentence
+    ! To check time .
+    integer*4 :: today(3),now(3)
+    integer   :: IOUT=178
+     
+    open(unit=IOUT, file=localpath_name(1:len_trim(localpath_name))//OUTPUT_FILE,&
+         status='unknown', form='formatted', iostat = ierr, access='append')
+
+    write(6,*) 'Writing a message'
+    write(IOUT,*) trim(sentence) 
+    call idate(today) 
+    call itime(now)
+    write(IOUT,FMT1) today(2), today(1), today(3), now
+    close(IOUT)     
+
+  end subroutine clock_time
+
+  !----------------------------------------------------------------------------------------------
   ! reads in mesh files
   !----------------------------------------------------------------------------------------------
   subroutine read_mesh_files
-
+    call clock_time('STARTING A NEW MESH')
+    call clock_time('Reading mesh files')
   ! sets number of nodes per element
     ngnod = esize
 
@@ -388,12 +414,14 @@
     close(98)
     if( nspec2D_moho > 0 ) print*, '  nspec2D_moho = ', nspec2D_moho
 
+    call clock_time('Star reading fault nodes')
     call read_fault_files(localpath_name)
     if (ANY_FAULT) then 
       call save_nodes_coords(nodes_coords,nnodes)
       call close_faults(nodes_coords,nnodes)    
     end if 
-
+    call clock_time('End reading fault nodes')
+  
   end subroutine read_mesh_files
   
   !----------------------------------------------------------------------------------------------
@@ -401,7 +429,9 @@
   !----------------------------------------------------------------------------------------------
   
   subroutine check_valence
-  
+ 
+    call clock_time('Check mesh files') 
+ 
     allocate(mask_nodes_elmnts(nnodes))
     allocate(used_nodes_elmnts(nnodes))
     mask_nodes_elmnts(:) = .false.
@@ -433,6 +463,7 @@
 
     implicit none
 
+    call clock_time('scotch_partitioning') 
     elmnts(:,:) = elmnts(:,:) - 1
 
     ! determines maximum neighbors based on 1 common node
@@ -530,8 +561,10 @@
   !                   sup_neighbour, nsize, &
   !                   nparts, part, nfaces_coupled, faces_coupled)
 
+    call clock_time('Sart Scotch fault repartioning files')
   ! re-partitioning transfers two coupled elements on fault side 1 and side 2 to the same partition
     if (ANY_FAULT) call fault_repartition (nspec, nnodes, elmnts, nsize, nparts, part, esize, nodes_coords)
+    call clock_time('End Scotch fault repartioning files')
      
   ! re-partitioning puts moho-surface coupled elements into same partition
     call moho_surface_repartitioning (nspec, nnodes, elmnts, &
@@ -539,21 +572,25 @@
                      nspec2D_moho,ibelm_moho,nodes_ibelm_moho )
    
 
+    call clock_time('Constructing_glob2loc_elements')
   ! local number of each element for each partition
     call Construct_glob2loc_elmnts(nspec, part, glob2loc_elmnts,nparts)
 
 
+    call clock_time('Constructing_glob2loc_nodes')
   ! local number of each node for each partition
     call Construct_glob2loc_nodes(nspec, nnodes,nsize, nnodes_elmnts, nodes_elmnts, part, &
          glob2loc_nodes_nparts, glob2loc_nodes_parts, glob2loc_nodes, nparts)
 
 
+    call clock_time('Start Constructing_mpi_interfaces')
   ! mpi interfaces 
     ! acoustic/elastic boundaries WILL BE SEPARATED into different MPI partitions
     call Construct_interfaces(nspec, sup_neighbour, part, elmnts, &
                              xadj, adjncy, tab_interfaces, &
                              tab_size_interfaces, ninterfaces, &
                              nparts)
+    call clock_time('End Constructing_mpi_interfaces')
 
     !or: uncomment if you want acoustic/elastic boundaries NOT to be separated into different MPI partitions
     !call Construct_interfaces_no_ac_el_sep(nspec, sup_neighbour, part, elmnts, &
@@ -570,7 +607,9 @@
   !----------------------------------------------------------------------------------------------
   
   subroutine write_mesh_databases
-
+   
+    call clock_time('Writing mesh databaes')
+    
     allocate(my_interfaces(0:ninterfaces-1))
     allocate(my_nb_interfaces(0:ninterfaces-1))
 

Modified: seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/program_decompose_mesh_SCOTCH.f90
===================================================================
--- seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/program_decompose_mesh_SCOTCH.f90	2012-11-07 07:06:50 UTC (rev 20998)
+++ seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/program_decompose_mesh_SCOTCH.f90	2012-11-07 09:01:24 UTC (rev 20999)
@@ -7,7 +7,7 @@
                                   write_mesh_databases
   implicit none
   integer :: i
-  character(len=256) :: arg(3)  
+  character(len=256) :: arg(3),outputfile   
   
 !  include './constants_decompose_mesh_SCOTCH.h'
 
@@ -41,6 +41,6 @@
   
 ! writes out database files  
   call write_mesh_databases()
-   
+
 end program pre_meshfem3D
 



More information about the CIG-COMMITS mailing list