OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
cfac_determinant.F File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine cmumps_updatedeter (piv, deter, nexp)
subroutine cmumps_updatedeter_scaling (piv, deter, nexp)
subroutine cmumps_getdeter2d (block_size, ipiv, myrow, mycol, nprow, npcol, a, local_m, local_n, n, myid, deter, nexp, sym)
subroutine cmumps_deter_reduction (comm, deter_in, nexp_in, deter_out, nexp_out, nprocs)
subroutine cmumps_deterreduce_func (inv, inoutv, nel, datatype)
subroutine cmumps_deter_square (deter, nexp)
subroutine cmumps_deter_scaling_inverse (deter, nexp)
subroutine cmumps_deter_sign_perm (deter, n, visited, perm)
subroutine cmumps_par_root_minmax_piv_upd (block_size, ipiv, myrow, mycol, nprow, npcol, a, local_m, local_n, n, myid, dkeep, keep, sym)

Function/Subroutine Documentation

◆ cmumps_deter_reduction()

subroutine cmumps_deter_reduction ( integer, intent(in) comm,
complex, intent(in) deter_in,
integer, intent(in) nexp_in,
complex, intent(out) deter_out,
integer, intent(out) nexp_out,
integer, intent(in) nprocs )

Definition at line 87 of file cfac_determinant.F.

90 IMPLICIT NONE
91 INTEGER, intent(in) :: COMM, NPROCS
92 COMPLEX, intent(in) :: DETER_IN
93 INTEGER,intent(in) :: NEXP_IN
94 COMPLEX,intent(out):: DETER_OUT
95 INTEGER,intent(out):: NEXP_OUT
96 INTEGER :: IERR_MPI
98 INTEGER TWO_SCALARS_TYPE, DETERREDUCE_OP
99 COMPLEX :: INV(2)
100 COMPLEX :: OUTV(2)
101 include 'mpif.h'
102 IF (nprocs .EQ. 1) THEN
103 deter_out = deter_in
104 nexp_out = nexp_in
105 RETURN
106 ENDIF
107 CALL mpi_type_contiguous(2, mpi_complex,
108 & two_scalars_type,
109 & ierr_mpi)
110 CALL mpi_type_commit(two_scalars_type, ierr_mpi)
112 & .true.,
113 & deterreduce_op,
114 & ierr_mpi)
115 inv(1)=deter_in
116 inv(2)=cmplx(nexp_in,kind=kind(inv))
117 CALL mpi_allreduce( inv, outv, 1, two_scalars_type,
118 & deterreduce_op, comm, ierr_mpi)
119 CALL mpi_op_free(deterreduce_op, ierr_mpi)
120 CALL mpi_type_free(two_scalars_type, ierr_mpi)
121 deter_out = outv(1)
122 nexp_out = int(outv(2))
123 RETURN
float cmplx[2]
Definition pblas.h:136
subroutine cmumps_deterreduce_func(inv, inoutv, nel, datatype)
subroutine mpi_type_free(newtyp, ierr_mpi)
Definition mpi.f:399
subroutine mpi_type_contiguous(length, datatype, newtype, ierr_mpi)
Definition mpi.f:406
subroutine mpi_allreduce(sendbuf, recvbuf, cnt, datatype, operation, comm, ierr)
Definition mpi.f:103
subroutine mpi_type_commit(newtyp, ierr_mpi)
Definition mpi.f:393
subroutine mpi_op_create(func, commute, op, ierr)
Definition mpi.f:412
subroutine mpi_op_free(op, ierr)
Definition mpi.f:421

◆ cmumps_deter_scaling_inverse()

subroutine cmumps_deter_scaling_inverse ( real, intent(inout) deter,
integer, intent(inout) nexp )

Definition at line 154 of file cfac_determinant.F.

155 IMPLICIT NONE
156 INTEGER, intent (inout) :: NEXP
157 REAL, intent (inout) :: DETER
158 deter=1.0e0/deter
159 nexp=-nexp
160 RETURN

◆ cmumps_deter_sign_perm()

subroutine cmumps_deter_sign_perm ( complex, intent(inout) deter,
integer, intent(in) n,
integer, dimension(n), intent(inout) visited,
integer, dimension(n), intent(in) perm )

Definition at line 162 of file cfac_determinant.F.

163 IMPLICIT NONE
164 COMPLEX, intent(inout) :: DETER
165 INTEGER, intent(in) :: N
166 INTEGER, intent(inout) :: VISITED(N)
167 INTEGER, intent(in) :: PERM(N)
168 INTEGER I, J, K
169 k = 0
170 DO i = 1, n
171 IF (visited(i) .GT. n) THEN
172 visited(i)=visited(i)-n-n-1
173 cycle
174 ENDIF
175 j = perm(i)
176 DO WHILE (j.NE.i)
177 visited(j) = visited(j) + n + n + 1
178 k = k + 1
179 j = perm(j)
180 ENDDO
181 ENDDO
182 IF (mod(k,2).EQ.1) THEN
183 deter = -deter
184 ENDIF
185 RETURN

◆ cmumps_deter_square()

subroutine cmumps_deter_square ( complex, intent(inout) deter,
integer, intent(inout) nexp )

Definition at line 146 of file cfac_determinant.F.

147 IMPLICIT NONE
148 INTEGER, intent (inout) :: NEXP
149 COMPLEX, intent (inout) :: DETER
150 deter=deter*deter
151 nexp=nexp+nexp
152 RETURN

◆ cmumps_deterreduce_func()

subroutine cmumps_deterreduce_func ( complex, dimension ( 2 * nel ), intent(in) inv,
complex, dimension ( 2 * nel ), intent(inout) inoutv,
integer, intent(in) nel,
integer, intent(in) datatype )

Definition at line 125 of file cfac_determinant.F.

126 IMPLICIT NONE
127#if defined(WORKAROUNDINTELILP64MPI2INTEGER) || defined(WORKAROUNDILP64MPICUSTOMREDUCE)
128 INTEGER(4), INTENT(IN) :: NEL, DATATYPE
129#else
130 INTEGER, INTENT(IN) :: NEL, DATATYPE
131#endif
132 COMPLEX, INTENT(IN) :: INV ( 2 * NEL )
133 COMPLEX, INTENT(INOUT) :: INOUTV ( 2 * NEL )
134 INTEGER I, TMPEXPIN, TMPEXPINOUT
135 DO i = 1, nel
136 tmpexpin = int(inv(i*2))
137 tmpexpinout = int(inoutv(i*2))
138 CALL cmumps_updatedeter(inv(i*2-1),
139 & inoutv(i*2-1),
140 & tmpexpinout)
141 tmpexpinout = tmpexpinout + tmpexpin
142 inoutv(i*2) = cmplx(tmpexpinout,kind=kind(inoutv))
143 ENDDO
144 RETURN
subroutine cmumps_updatedeter(piv, deter, nexp)

◆ cmumps_getdeter2d()

subroutine cmumps_getdeter2d ( integer, intent(in) block_size,
integer, dimension(local_m), intent(in) ipiv,
integer, intent(in) myrow,
integer, intent(in) mycol,
integer, intent(in) nprow,
integer, intent(in) npcol,
complex, dimension(*), intent(in) a,
integer, intent(in) local_m,
integer, intent(in) local_n,
integer, intent(in) n,
integer, intent(in) myid,
complex, intent(inout) deter,
integer, intent(inout) nexp,
integer, intent(in) sym )

Definition at line 41 of file cfac_determinant.F.

45 IMPLICIT NONE
46 INTEGER, intent (in) :: SYM
47 INTEGER, intent (inout) :: NEXP
48 COMPLEX, intent (inout) :: DETER
49 INTEGER, intent (in) :: BLOCK_SIZE, NPROW, NPCOL,
50 & LOCAL_M, LOCAL_N, N
51 INTEGER, intent (in) :: MYROW, MYCOL, MYID, IPIV(LOCAL_M)
52 COMPLEX, intent(in) :: A(*)
53 INTEGER I,IMX,DI,NBLOCK,IBLOCK,ILOC,JLOC,
54 & ROW_PROC,COL_PROC, K
55 di = local_m + 1
56 nblock = ( n - 1 ) / block_size
57 DO iblock = 0, nblock
58 row_proc = mod( iblock, nprow )
59 IF ( myrow.EQ.row_proc ) THEN
60 col_proc = mod( iblock, npcol )
61 IF ( mycol.EQ.col_proc ) THEN
62 iloc = ( iblock / nprow ) * block_size
63 jloc = ( iblock / npcol ) * block_size
64 i = iloc + jloc * local_m + 1
65 imx = min(iloc+block_size,local_m)
66 & + (min(jloc+block_size,local_n)-1)*local_m
67 & + 1
68 k=1
69 DO WHILE ( i .LT. imx )
70 CALL cmumps_updatedeter(a(i),deter,nexp)
71 IF (sym.EQ.1) THEN
72 CALL cmumps_updatedeter(a(i),deter,nexp)
73 ENDIF
74 IF (sym.NE.1) THEN
75 IF (ipiv(iloc+k) .NE. iblock*block_size+k) THEN
76 deter = -deter
77 ENDIF
78 ENDIF
79 k = k + 1
80 i = i + di
81 END DO
82 END IF
83 END IF
84 END DO
85 RETURN
#define min(a, b)
Definition macros.h:20

◆ cmumps_par_root_minmax_piv_upd()

subroutine cmumps_par_root_minmax_piv_upd ( integer, intent(in) block_size,
integer, dimension(local_m), intent(in) ipiv,
integer, intent(in) myrow,
integer, intent(in) mycol,
integer, intent(in) nprow,
integer, intent(in) npcol,
complex, dimension(*), intent(in) a,
integer, intent(in) local_m,
integer, intent(in) local_n,
integer, intent(in) n,
integer, intent(in) myid,
real, dimension(230), intent(inout) dkeep,
integer, dimension(500), intent(in) keep,
integer, intent(in) sym )

Definition at line 187 of file cfac_determinant.F.

194 IMPLICIT NONE
195 INTEGER, intent (in) :: BLOCK_SIZE, NPROW, NPCOL,
196 & LOCAL_M, LOCAL_N, N, SYM
197 INTEGER, intent (in) :: MYROW, MYCOL, MYID, IPIV(LOCAL_M)
198 COMPLEX, intent(in) :: A(*)
199 REAL, INTENT(INOUT) :: DKEEP(230)
200 INTEGER, INTENT(IN) :: KEEP(500)
201 INTEGER I,IMX,DI,NBLOCK,IBLOCK,ILOC,JLOC,
202 & ROW_PROC,COL_PROC, K
203 REAL :: ABSPIVOT
204 di = local_m + 1
205 nblock = ( n - 1 ) / block_size
206 DO iblock = 0, nblock
207 row_proc = mod( iblock, nprow )
208 IF ( myrow.EQ.row_proc ) THEN
209 col_proc = mod( iblock, npcol )
210 IF ( mycol.EQ.col_proc ) THEN
211 iloc = ( iblock / nprow ) * block_size
212 jloc = ( iblock / npcol ) * block_size
213 i = iloc + jloc * local_m + 1
214 imx = min(iloc+block_size,local_m)
215 & + (min(jloc+block_size,local_n)-1)*local_m
216 & + 1
217 k=1
218 DO WHILE ( i .LT. imx )
219 IF (sym.NE.1) THEN
220 abspivot = abs(a(i))
221 ELSE
222 abspivot = abs(a(i)*a(i))
223 ENDIF
225 & ( abspivot,
226 & dkeep, keep, .false.)
227 k = k + 1
228 i = i + di
229 END DO
230 END IF
231 END IF
232 END DO
233 RETURN
subroutine cmumps_update_minmax_pivot(diag, dkeep, keep, nullpivot)

◆ cmumps_updatedeter()

subroutine cmumps_updatedeter ( complex, intent(in) piv,
complex, intent(inout) deter,
integer, intent(inout) nexp )

Definition at line 14 of file cfac_determinant.F.

15 IMPLICIT NONE
16 COMPLEX, intent(in) :: PIV
17 COMPLEX, intent(inout) :: DETER
18 INTEGER, intent(inout) :: NEXP
19 REAL R_PART, C_PART
20 INTEGER NEXP_LOC
21 deter=deter*piv
22 r_part=real(deter)
23 c_part=aimag(deter)
24 nexp_loc = exponent(abs(r_part)+abs(c_part))
25 nexp = nexp + nexp_loc
26 r_part=scale(r_part, -nexp_loc)
27 c_part=scale(c_part, -nexp_loc)
28 deter=cmplx(r_part,c_part,kind=kind(deter))
29 RETURN

◆ cmumps_updatedeter_scaling()

subroutine cmumps_updatedeter_scaling ( real, intent(in) piv,
real, intent(inout) deter,
integer, intent(inout) nexp )

Definition at line 31 of file cfac_determinant.F.

32 IMPLICIT NONE
33 REAL, intent(in) :: PIV
34 REAL, intent(inout) :: DETER
35 INTEGER, intent(inout) :: NEXP
36 deter=deter*fraction(piv)
37 nexp=nexp+exponent(piv)+exponent(deter)
38 deter=fraction(deter)
39 RETURN