[cig-commits] r13230 - seismo/3D/SPECFEM3D/trunk/UTILS/external_mesh/pre_meshfem3D_asteroid_subdivide
nlegoff at geodynamics.org
nlegoff at geodynamics.org
Sun Nov 2 16:14:41 PST 2008
Author: nlegoff
Date: 2008-11-02 16:14:41 -0800 (Sun, 02 Nov 2008)
New Revision: 13230
Modified:
seismo/3D/SPECFEM3D/trunk/UTILS/external_mesh/pre_meshfem3D_asteroid_subdivide/compil_all.sh
seismo/3D/SPECFEM3D/trunk/UTILS/external_mesh/pre_meshfem3D_asteroid_subdivide/pre_meshfem3D.f90
Log:
added (in comments) SCOTCH partitioner.
Modified: seismo/3D/SPECFEM3D/trunk/UTILS/external_mesh/pre_meshfem3D_asteroid_subdivide/compil_all.sh
===================================================================
--- seismo/3D/SPECFEM3D/trunk/UTILS/external_mesh/pre_meshfem3D_asteroid_subdivide/compil_all.sh 2008-11-02 23:44:49 UTC (rev 13229)
+++ seismo/3D/SPECFEM3D/trunk/UTILS/external_mesh/pre_meshfem3D_asteroid_subdivide/compil_all.sh 2008-11-03 00:14:41 UTC (rev 13230)
@@ -9,3 +9,5 @@
gfortran -c pre_meshfem3D.f90
gfortran pre_meshfem3D.o part_pre_meshfem3D.o ~/utils/metis-4.0/libmetis.a
+#gfortran pre_meshfem3D.o part_pre_meshfem3D.o ~/utils/scotch_5.1/lib/libscotchmetis.a ~/utils/scotch_5.1/lib/libscotch.a ~/utils/scotch_5.1/lib/libscotcherr.a
+#gfortran pre_meshfem3D.o part_pre_meshfem3D.o ~/utils/scotch_5.1/lib/libscotch.a ~/utils/scotch_5.1/lib/libscotcherr.a
Modified: seismo/3D/SPECFEM3D/trunk/UTILS/external_mesh/pre_meshfem3D_asteroid_subdivide/pre_meshfem3D.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/UTILS/external_mesh/pre_meshfem3D_asteroid_subdivide/pre_meshfem3D.f90 2008-11-02 23:44:49 UTC (rev 13229)
+++ seismo/3D/SPECFEM3D/trunk/UTILS/external_mesh/pre_meshfem3D_asteroid_subdivide/pre_meshfem3D.f90 2008-11-03 00:14:41 UTC (rev 13230)
@@ -5,6 +5,11 @@
include './constants_pre_meshfem3D.h'
+!!!! NL NL for SCOTCH
+! include "./scotchf.h"
+!!!!
+
+
integer, parameter :: nparts=96
@@ -54,6 +59,17 @@
logical, dimension(:), allocatable :: mask_nodes_elmnts
integer, dimension(:), allocatable :: used_nodes_elmnts
+!!!! NL NL for SCOTCH partitioner
+! double precision, dimension(SCOTCH_GRAPHDIM) :: SCOTCHGRAPH
+! double precision, dimension(SCOTCH_STRATDIM) :: SCOTCHSTRAT
+! character(len=256), parameter ::
+!scotch_strategy='b{sep=m{vert=100,low=h,asc=f}x}'
+! !character(len=256), parameter ::
+!scotch_strategy='b{strat=m{asc=g,low=g,rat=1.0,type=h,vert=4}}'
+! integer :: IERR
+!!!! NL NL
+
+
ngnod = esize
! read the elements, material and nodes files
@@ -111,7 +127,7 @@
! adjncy(:) = adjncy(:) + 1
! xadj(:) = xadj(:) + 1
allocate(vwgt(0:nspec-1))
- nb_edges = xadj(nspec)
+ nb_edges = xadj(nspec+1)
allocate(adjwgt(0:nb_edges-1))
vwgt(:) = 1
adjwgt(:) = 1
@@ -132,7 +148,61 @@
! partitioning
call METIS_PartGraphRecursive(nspec, xadj(1), adjncy(1), vwgt(0), adjwgt(0), wgtflag, num_start, nparts, &
metis_options, edgecut, part(1));
-
+
+!!!! NL NL for SCOTCH partitioner
+!!$ call scotchfstratinit (SCOTCHSTRAT(1), IERR)
+!!$ IF (IERR .NE. 0) THEN
+!!$ PRINT *, 'ERROR : MAIN : Cannot initialize strat'
+!!$ STOP
+!!$ ENDIF
+!!$
+!!$ call scotchfstratgraphmap (SCOTCHSTRAT(1), trim(scotch_strategy), IERR)
+!!$ IF (IERR .NE. 0) THEN
+!!$ PRINT *, 'ERROR : MAIN : Cannot build strat'
+!!$ STOP
+!!$ ENDIF
+!!$ CALL SCOTCHFGRAPHINIT (SCOTCHGRAPH (1), IERR)
+!!$ IF (IERR .NE. 0) THEN
+!!$ PRINT *, 'ERROR : MAIN : Cannot initialize graph'
+!!$ STOP
+!!$ ENDIF
+!!$
+!!$ CALL SCOTCHFGRAPHBUILD (SCOTCHGRAPH (1), 0, nspec, &
+!!$ xadj (1), xadj (1), &
+!!$ xadj (1), xadj (1), &
+!!$ nb_edges, &
+!!$ adjncy (1), adjncy (1), IERR)
+!!$ IF (IERR .NE. 0) THEN
+!!$ PRINT *, 'ERROR : MAIN : Cannot build graph'
+!!$ STOP
+!!$ ENDIF
+!!$
+!!$ CALL SCOTCHFGRAPHCHECK (SCOTCHGRAPH (1), IERR)
+!!$ IF (IERR .NE. 0) THEN
+!!$ PRINT *, 'ERROR : MAIN : Invalid check'
+!!$ STOP
+!!$ ENDIF
+!!$
+!!$ call scotchfgraphpart (SCOTCHGRAPH (1), nparts, SCOTCHSTRAT(1),part(1),IERR)
+!!$ IF (IERR .NE. 0) THEN
+!!$ PRINT *, 'ERROR : MAIN : Cannot part graph'
+!!$ STOP
+!!$ ENDIF
+!!$
+!!$ CALL SCOTCHFGRAPHEXIT (SCOTCHGRAPH (1), IERR)
+!!$ IF (IERR .NE. 0) THEN
+!!$ PRINT *, 'ERROR : MAIN : Cannot destroy graph'
+!!$ STOP
+!!$ ENDIF
+!!$
+!!$ call scotchfstratexit (SCOTCHSTRAT(1), IERR)
+!!$ IF (IERR .NE. 0) THEN
+!!$ PRINT *, 'ERROR : MAIN : Cannot destroy strat'
+!!$ STOP
+!!$ ENDIF
+!!!! NL NL
+
+
! local number of each element for each partition
call Construct_glob2loc_elmnts(nspec, part, nparts, glob2loc_elmnts)
More information about the CIG-COMMITS
mailing list