OpenCMISS-Iron Internal API Documentation
cmiss_parmetis.f90
Go to the documentation of this file.
1 
43 
46 
47  USE base_routines
48  USE kinds
50 
51 #include "macros.h"
52 
53  IMPLICIT NONE
54 
55  PRIVATE
56 
57  !Module parameters
58 
59  !Module types
60 
61  !Module variables
62 
63  !Interfaces
64  INTERFACE
65 
66  SUBROUTINE parmetis_v3_partkway(vtxdist, xadj, adjncy, vwgt, adjwgt, wgtflag, numflag, ncon, nparts, tpwgts, ubvec, &
67  & options, edgecut, part, comm)
68 #ifdef WIN32
69  !DEC$ ATTRIBUTES C, reference, alias:'_ParMETIS_V3_PartKway' :: ParMETIS_V3_PartKway
70 #endif
71  USE kinds
72  INTEGER(INTG) :: vtxdist(*)
73  INTEGER(INTG) :: xadj(*)
74  INTEGER(INTG) :: adjncy(*)
75  INTEGER(INTG) :: vwgt(*)
76  INTEGER(INTG) :: adjwgt(*)
77  INTEGER(INTG) :: wgtflag
78  INTEGER(INTG) :: numflag
79  INTEGER(INTG) :: ncon
80  INTEGER(INTG) :: nparts
81  !REAL(SP) :: tpwgts(*)
82  !REAL(SP) :: ubvec(*)
83  REAL(DP) :: tpwgts(*)
84  REAL(DP) :: ubvec(*)
85  INTEGER(INTG) :: options(*)
86  INTEGER(INTG) :: edgecut
87  INTEGER(INTG) :: part(*)
88  INTEGER(INTG) :: comm
89  END SUBROUTINE parmetis_v3_partkway
90 
91  SUBROUTINE parmetis_v3_partmeshkway(elmdist, eptr, eind, elmwgt, wgtflag, numflag, ncon, ncommonnodes, nparts, tpwgts, &
92  & ubvec, options, edgecut, part, comm)
93 #ifdef WIN32
94  !DEC$ ATTRIBUTES C, reference, alias:'_ParMETIS_V3_PartMeshKway' :: ParMETIS_V3_PartMeshKway
95 #endif
96  USE kinds
97  INTEGER(INTG) :: elmdist(*)
98  INTEGER(INTG) :: eptr(*)
99  INTEGER(INTG) :: eind(*)
100  INTEGER(INTG) :: elmwgt(*)
101  INTEGER(INTG) :: wgtflag
102  INTEGER(INTG) :: numflag
103  INTEGER(INTG) :: ncon
104  INTEGER(INTG) :: ncommonnodes
105  INTEGER(INTG) :: nparts
106  !REAL(SP) :: tpwgts(*)
107  !REAL(SP) :: ubvec(*)
108  REAL(DP) :: tpwgts(*)
109  REAL(DP) :: ubvec(*)
110  INTEGER(INTG) :: options(*)
111  INTEGER(INTG) :: edgecut
112  INTEGER(INTG) :: part(*)
113  INTEGER(INTG) :: comm
114  END SUBROUTINE parmetis_v3_partmeshkway
115 
116  END INTERFACE
117 
119 
120 CONTAINS
121 
122  !
123  !================================================================================================================================
124  !
125 
127  SUBROUTINE parmetis_partkway(VERTEX_DISTANCE,XADJ,ADJNCY,VERTEX_WEIGHT,ADJ_WEIGHT,WEIGHT_FLAG,NUM_FLAG,NCON, &
128  & number_parts,tp_weights,ub_vec,options,number_edges_cut,partition,communicator,err,error,*)
130  !Argument Variables
131  INTEGER(INTG), INTENT(IN) :: VERTEX_DISTANCE(:)
132  INTEGER(INTG), INTENT(IN) :: XADJ(:)
133  INTEGER(INTG), INTENT(IN) :: ADJNCY(:)
134  INTEGER(INTG), INTENT(IN) :: VERTEX_WEIGHT(:)
135  INTEGER(INTG), INTENT(IN) :: ADJ_WEIGHT(:)
136  INTEGER(INTG), INTENT(IN) :: WEIGHT_FLAG
137  INTEGER(INTG), INTENT(IN) :: NUM_FLAG
138  INTEGER(INTG), INTENT(IN) :: NCON
139  INTEGER(INTG), INTENT(IN) :: NUMBER_PARTS
140  !REAL(SP), INTENT(IN) :: TP_WEIGHTS(:)
141  !REAL(SP), INTENT(IN) :: UB_VEC(:)
142  REAL(DP), INTENT(IN) :: TP_WEIGHTS(:)
143  REAL(DP), INTENT(IN) :: UB_VEC(:)
144  INTEGER(INTG), INTENT(IN) :: OPTIONS(:)
145  INTEGER(INTG), INTENT(OUT) :: NUMBER_EDGES_CUT
146  INTEGER(INTG), INTENT(OUT) :: PARTITION(:)
147  INTEGER(INTG), INTENT(IN) :: COMMUNICATOR
148  INTEGER(INTG), INTENT(OUT) :: ERR
149  TYPE(varying_string), INTENT(OUT) :: ERROR
150  !Local Variables
151 
152  enters("PARMETIS_PARTKWAY",err,error,*999)
153 
154  CALL parmetis_v3_partkway(vertex_distance,xadj,adjncy,vertex_weight,adj_weight,weight_flag,num_flag,ncon, &
155  & number_parts,tp_weights,ub_vec,options,number_edges_cut,partition,communicator)
156  IF(err/=0) THEN
157  CALL flagerror("ParMetis error in ParMETIS_V3_PartKway",err,error,*999)
158  ENDIF
159 
160  exits("PARMETIS_PARTKWAY")
161  RETURN
162 999 errorsexits("PARMETIS_PARTKWAY",err,error)
163  RETURN 1
164  END SUBROUTINE parmetis_partkway
165 
166  !
167  !================================================================================================================================
168  !
169 
171  SUBROUTINE parmetis_partmeshkway(ELEMENT_DISTANCE,ELEMENT_PTR,ELEMENT_INDEX,ELEMENT_WEIGHT,WEIGHT_FLAG,NUM_FLAG,NCON, &
172  & number_common_nodes,number_parts,tp_weights,ub_vec,options,number_edges_cut,partition,communicator,err,error,*)
174  !Argument Variables
175  INTEGER(INTG), INTENT(IN) :: ELEMENT_DISTANCE(:)
176  INTEGER(INTG), INTENT(IN) :: ELEMENT_PTR(:)
177  INTEGER(INTG), INTENT(IN) :: ELEMENT_INDEX(:)
178  INTEGER(INTG), INTENT(IN) :: ELEMENT_WEIGHT(:)
179  INTEGER(INTG), INTENT(IN) :: WEIGHT_FLAG
180  INTEGER(INTG), INTENT(IN) :: NUM_FLAG
181  INTEGER(INTG), INTENT(IN) :: NCON
182  INTEGER(INTG), INTENT(IN) :: NUMBER_COMMON_NODES
183  INTEGER(INTG), INTENT(IN) :: NUMBER_PARTS
184  !REAL(SP), INTENT(IN) :: TP_WEIGHTS(:)
185  !REAL(SP), INTENT(IN) :: UB_VEC(:)
186  REAL(DP), INTENT(IN) :: TP_WEIGHTS(:)
187  REAL(DP), INTENT(IN) :: UB_VEC(:)
188  INTEGER(INTG), INTENT(IN) :: OPTIONS(:)
189  INTEGER(INTG), INTENT(OUT) :: NUMBER_EDGES_CUT
190  INTEGER(INTG), INTENT(OUT) :: PARTITION(:)
191  INTEGER(INTG), INTENT(IN) :: COMMUNICATOR
192  INTEGER(INTG), INTENT(OUT) :: ERR
193  TYPE(varying_string), INTENT(OUT) :: ERROR
194  !Local Variables
195 
196  enters("PARMETIS_PARTMESHKWAY",err,error,*999)
197 
198  CALL parmetis_v3_partmeshkway(element_distance,element_ptr,element_index,element_weight,weight_flag,num_flag,ncon, &
199  & number_common_nodes,number_parts,tp_weights,ub_vec,options,number_edges_cut,partition,communicator)
200 
201  IF(err/=0) THEN
202  CALL flagerror("ParMetis error in ParMETIS_V3_PartMeshKway",err,error,*999)
203  ENDIF
204 
205  exits("PARMETIS_PARTMESHKWAY")
206  RETURN
207 999 errorsexits("PARMETIS_PARTMESHKWAY",err,error)
208  RETURN 1
209  END SUBROUTINE parmetis_partmeshkway
210 
211  !
212  !================================================================================================================================
213  !
214 
215 END MODULE cmiss_parmetis
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
subroutine, public exits(NAME)
Records the exit out of the named procedure.
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
subroutine, public parmetis_partmeshkway(ELEMENT_DISTANCE, ELEMENT_PTR, ELEMENT_INDEX, ELEMENT_WEIGHT, WEIGHT_FLAG, NUM_FLAG, NCON, NUMBER_COMMON_NODES, NUMBER_PARTS, TP_WEIGHTS, UB_VEC, OPTIONS, NUMBER_EDGES_CUT, PARTITION, COMMUNICATOR, ERR, ERROR,)
Buffer routine to the ParMetis ParMETIS_V3_PartMeshKway routine.
This module is a CMISS buffer module to the ParMETIS library.
subroutine, public parmetis_partkway(VERTEX_DISTANCE, XADJ, ADJNCY, VERTEX_WEIGHT, ADJ_WEIGHT, WEIGHT_FLAG, NUM_FLAG, NCON, NUMBER_PARTS, TP_WEIGHTS, UB_VEC, OPTIONS, NUMBER_EDGES_CUT, PARTITION, COMMUNICATOR, ERR, ERROR,)
Buffer routine to the ParMetis ParMETIS_V3_PartKway routine.
Flags an error condition.
This module contains all kind definitions.
Definition: kinds.f90:45