[cig-commits] r8594 - seismo/2D/SPECFEM2D/trunk
walter at geodynamics.org
walter at geodynamics.org
Fri Dec 7 15:59:25 PST 2007
Author: walter
Date: 2007-12-07 15:59:24 -0800 (Fri, 07 Dec 2007)
New Revision: 8594
Modified:
seismo/2D/SPECFEM2D/trunk/assemble_MPI.F90
seismo/2D/SPECFEM2D/trunk/construct_acoustic_surface.f90
seismo/2D/SPECFEM2D/trunk/part_unstruct.F90
Log:
added comments.
Modified: seismo/2D/SPECFEM2D/trunk/assemble_MPI.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/assemble_MPI.F90 2007-11-04 23:19:28 UTC (rev 8593)
+++ seismo/2D/SPECFEM2D/trunk/assemble_MPI.F90 2007-12-07 23:59:24 UTC (rev 8594)
@@ -11,6 +11,23 @@
!
!========================================================================
+!====================================================================================
+!
+! This file contains subroutines related to assembling (of the mass matrix, potential_dot_dot and
+! accel_elastic).
+! Those subroutines are for the most part not used in the sequential version.
+!
+!====================================================================================
+
+
+!-----------------------------------------------
+! Determines the points that are on the interfaces with other partitions, to help
+! build the communication buffers, and determines which elements are considered 'inner'
+! (no points in common with other partitions) and 'outer' (at least one point in common
+! with neighbouring partitions).
+! We have both acoustic and elastic buffers, for coupling between acoustic and elastic elements
+! led us to have two sets of communications.
+!-----------------------------------------------
subroutine prepare_assemble_MPI (nspec,ibool, &
knods, ngnod, &
npoin, elastic, &
@@ -146,6 +163,10 @@
end subroutine prepare_assemble_MPI
+!-----------------------------------------------
+! Get the points (ixmin, ixmax, izmin and izmax) on an node/edge for one element.
+! 'sens' is used to have DO loops with increment equal to 'sens' (-/+1).
+!-----------------------------------------------
subroutine get_edge ( ngnod, n, type, e1, e2, ixmin, ixmax, izmin, izmax, sens )
implicit none
@@ -248,6 +269,12 @@
#ifdef USE_MPI
+
+!-----------------------------------------------
+! Creation of persistent communication requests (send and recv) for acoustic elements.
+! Should be disposed of if using Paraver (with MPItrace), since it does not instrument persistent
+! communications yet.
+!-----------------------------------------------
subroutine create_MPI_req_SEND_RECV_ac( &
ninterface, ninterface_acoustic, &
nibool_interfaces_acoustic, &
@@ -296,6 +323,11 @@
end subroutine create_MPI_req_SEND_RECV_ac
+!-----------------------------------------------
+! Creation of persistent communication requests (send and recv) for elastic elements.
+! Should be disposed of if using Paraver (with MPItrace), since it does not instrument persistent
+! communications yet.
+!-----------------------------------------------
subroutine create_MPI_req_SEND_RECV_el( &
ninterface, ninterface_elastic, &
nibool_interfaces_elastic, &
@@ -345,6 +377,9 @@
end subroutine create_MPI_req_SEND_RECV_el
+!-----------------------------------------------
+! Assembling the mass matrix.
+!-----------------------------------------------
subroutine assemble_MPI_scalar(myrank,array_val1, array_val2,npoin, &
ninterface, max_interface_size, max_ibool_interfaces_size_ac, max_ibool_interfaces_size_el, &
ibool_interfaces_acoustic,ibool_interfaces_elastic, nibool_interfaces_acoustic,nibool_interfaces_elastic, my_neighbours)
@@ -425,6 +460,11 @@
end subroutine assemble_MPI_scalar
+!-----------------------------------------------
+! Assembling potential_dot_dot for acoustic elements :
+! the buffers are filled, and the send and recv are started here.
+! We use MPI_Start (MPI_Startall is not used, since it causes problems in OpenMPI prior to v1.2).
+!-----------------------------------------------
subroutine assemble_MPI_vector_ac_start(array_val1,npoin, &
ninterface, ninterface_acoustic, &
inum_interfaces_acoustic, &
@@ -483,6 +523,11 @@
end subroutine assemble_MPI_vector_ac_start
+!-----------------------------------------------
+! Assembling accel_elastic for elastic elements :
+! the buffers are filled, and the send and recv are started here.
+! We use MPI_Start (MPI_Startall is not used, since it causes problems in OpenMPI prior to v1.2).
+!-----------------------------------------------
subroutine assemble_MPI_vector_el_start(array_val2,npoin, &
ninterface, ninterface_elastic, &
inum_interfaces_elastic, &
@@ -543,6 +588,11 @@
end subroutine assemble_MPI_vector_el_start
+!-----------------------------------------------
+! Assembling potential_dot_dot for acoustic elements :
+! We wait for the completion of the communications, and add the contributions received
+! for the points on the interfaces.
+!-----------------------------------------------
subroutine assemble_MPI_vector_ac_wait(array_val1,npoin, &
ninterface, ninterface_acoustic, &
inum_interfaces_acoustic, &
@@ -598,6 +648,11 @@
end subroutine assemble_MPI_vector_ac_wait
+!-----------------------------------------------
+! Assembling accel_elastic for elastic elements :
+! We wait for the completion of the communications, and add the contributions received
+! for the points on the interfaces.
+!-----------------------------------------------
subroutine assemble_MPI_vector_el_wait(array_val2,npoin, &
ninterface, ninterface_elastic, &
inum_interfaces_elastic, &
@@ -655,6 +710,9 @@
#endif
+!-----------------------------------------------
+! Dummy subroutine, to be able to stop the code whether sequential or parallel.
+!-----------------------------------------------
subroutine exit_MPI(error_msg)
implicit none
Modified: seismo/2D/SPECFEM2D/trunk/construct_acoustic_surface.f90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/construct_acoustic_surface.f90 2007-11-04 23:19:28 UTC (rev 8593)
+++ seismo/2D/SPECFEM2D/trunk/construct_acoustic_surface.f90 2007-12-07 23:59:24 UTC (rev 8594)
@@ -11,6 +11,14 @@
!
!========================================================================
+
+!-----------------------------------------------
+! From array 'surface' (element, type : node/edge, node(s) ) that describes the
+! acoustic free surface, determines the points (ixmin, ixmax, izmin and izmax) on the surface
+! for each element.
+! We chose to have ixmin <= ixmax and izmin <= izmax, so as to be able to have DO loops on it with
+! an increment of +1.
+!-----------------------------------------------
subroutine construct_acoustic_surface ( nspec, ngnod, knods, nsurface, surface, tab_surface )
implicit none
@@ -51,6 +59,9 @@
end subroutine construct_acoustic_surface
+!-----------------------------------------------
+! Get the points (ixmin, ixmax, izmin and izmax) on an node/edge for one element.
+!-----------------------------------------------
subroutine get_acoustic_edge ( ngnod, n, type, e1, e2, ixmin, ixmax, izmin, izmax )
implicit none
Modified: seismo/2D/SPECFEM2D/trunk/part_unstruct.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/part_unstruct.F90 2007-11-04 23:19:28 UTC (rev 8593)
+++ seismo/2D/SPECFEM2D/trunk/part_unstruct.F90 2007-12-07 23:59:24 UTC (rev 8594)
@@ -11,6 +11,13 @@
!
!========================================================================
+!====================================================================================
+!
+! This module contains subroutines related to unstructured meshes and partitioning of the
+! corresponding graphs.
+!
+!====================================================================================
+
module part_unstruct
implicit none
@@ -438,8 +445,7 @@
! 5/ second node, if relevant.
! No interface between acoustic and elastic elements.
!--------------------------------------------------
-
- subroutine Construct_interfaces(nelmnts, nparts, part, elmnts, xadj, adjncy, tab_interfaces, &
+ subroutine Construct_interfaces(nelmnts, nparts, part, elmnts, xadj, adjncy, tab_interfaces, &
tab_size_interfaces, ninterfaces, nb_materials, cs_material, num_material)
include 'constants.h'
@@ -760,7 +766,6 @@
!--------------------------------------------------
! Write a surface (elements and nodes on the surface) pertaining to iproc partition in the corresponding Database
!--------------------------------------------------
-
subroutine Write_surface_database(IIN_database, nsurface, surface, &
nsurface_loc, iproc, glob2loc_elmnts, &
glob2loc_nodes_nparts, glob2loc_nodes_parts, glob2loc_nodes, part, num_phase)
@@ -844,7 +849,7 @@
! Set absorbing boundaries by elements instead of edges.
! Excludes points that have both absorbing condition and coupled fluid/solid relation (this is the
! reason arrays ibegin_..., iend_... were included here).
- ! Under development : exluding points that have two different normal.
+ ! Under development : exluding points that have two different normals in two different elements.
!--------------------------------------------------
subroutine merge_abs_boundaries(nelemabs, nelemabs_merge, abs_surface, abs_surface_char, abs_surface_merge, &
More information about the cig-commits
mailing list