0001
0002
0003
0004
0005
0006
0007 PROGRAM DMUMPS_DKE
0008 IMPLICIT NONE
0009 INCLUDE 'mpif.h'
0010 INCLUDE 'dmumps_struc.h'
0011 TYPE (DMUMPS_STRUC) mumps_par
0012 INTEGER IERR, I
0013
0014
0015
0016 double precision:: dimvalu
0017 integer:: rw,rc,lengthin,lengthout
0018
0019
0020
0021
0022
0023 CALL MPI_INIT(IERR)
0024
0025 mumps_par%COMM = MPI_COMM_WORLD
0026
0027
0028 mumps_par%JOB = -1
0029 mumps_par%SYM = 0
0030 mumps_par%PAR = 1
0031 CALL DMUMPS(mumps_par)
0032
0033 IF ( mumps_par%MYID .eq. 0 ) THEN
0034
0035
0036
0037
0038
0039 inquire(iolength=lengthin) dimvalu
0040
0041
0042
0043 open(unit=77,file='MUMPS_N_in.bin',access='direct',
0044 *form='unformatted',status='old',recl=lengthin,iostat=rc,err=300)
0045 read(unit=77,rec=1,iostat=rw) ZZ
0046 mumps_par%N = ZZ
0047 close(77)
0048
0049
0050
0051
0052 open(unit=77,file='MUMPS_NA_in.bin',access='direct',
0053 *form='unformatted',status='old',recl=lengthin,iostat=rc,err=301)
0054 read(unit=77,rec=1,iostat=rw) ZZ
0055 mumps_par%NZ = ZZ
0056 close(77)
0057
0058
0059
0060 ALLOCATE( mumps_par%IRN ( mumps_par%NZ ) )
0061 ALLOCATE( mumps_par%JCN ( mumps_par%NZ ) )
0062 ALLOCATE( mumps_par%A( mumps_par%NZ ) )
0063 ALLOCATE( mumps_par%RHS ( mumps_par%N ) )
0064
0065
0066
0067 open(unit=77,file='MUMPS_AI_in.bin',access='direct',
0068 *form='unformatted',status='old',recl=lengthin,iostat=rc,err=302)
0069 open(unit=78,file='MUMPS_AJ_in.bin',access='direct',
0070 *form='unformatted',status='old',recl=lengthin,iostat=rc,err=303)
0071 open(unit=79,file='MUMPS_AV_in.bin',access='direct',
0072 *form='unformatted',status='old',recl=lengthin,iostat=rc,err=304)
0073
0074 DO I = 1, mumps_par%NZ
0075 read(unit=77,rec=I,iostat=rw) ZZ
0076 mumps_par%IRN(I) = ZZ
0077 read(unit=78,rec=I,iostat=rw) ZZ
0078 mumps_par%JCN(I) = ZZ
0079 read(unit=79,rec=I,iostat=rw) ZZ
0080 mumps_par%A(I) = ZZ
0081 END DO
0082
0083 close(77)
0084 close(78)
0085 close(79)
0086
0087
0088
0089 open(unit=77,file='MUMPS_B_in.bin',access='direct',
0090 *form='unformatted',status='old',recl=lengthin,iostat=rc,err=305)
0091
0092 DO I = 1, mumps_par%N
0093 read(unit=77,rec=I,iostat=rw) ZZ
0094 mumps_par%RHS(I) = ZZ
0095 END DO
0096
0097 close(77)
0098
0099 END IF
0100
0101 mumps_par%JOB = 6
0102 CALL DMUMPS(mumps_par)
0103
0104 IF ( mumps_par%MYID .eq. 0 ) THEN
0105
0106
0107
0108 inquire(iolength=lengthout) dimvalu
0109
0110
0111
0112 open(unit=77,file='MUMPS_X_out.bin',access='direct',
0113 *form='unformatted',status='replace',
0114 *recl=lengthout,iostat=rc,err=400)
0115
0116
0117 do i=1,mumps_par%N
0118 write(unit=77,rec=I,iostat=rw) mumps_par%RHS(I)
0119 enddo
0120
0121 close(77)
0122
0123 GOTO 1000
0124
0125
0126
0127
0128 END IF
0129
0130
0131
0132
0133
0134
0135
0136 300 continue
0137 print*,'PROBLEM IN READING INPUT FILE MUMPS_N_in.bin'
0138 GOTO 1000
0139 301 continue
0140 print*,'PROBLEM IN READING INPUT FILE MUMPS_NA_in.bin'
0141 GOTO 1000
0142 302 continue
0143 print*,'PROBLEM IN READING INPUT FILE MUMPS_AI_in.bin'
0144 GOTO 1000
0145 303 continue
0146 print*,'PROBLEM IN READING INPUT FILE MUMPS_AJ_in.bin'
0147 GOTO 1000
0148 304 continue
0149 print*,'PROBLEM IN READING INPUT FILE MUMPS_AV_in.bin'
0150 GOTO 1000
0151 305 continue
0152 print*,'PROBLEM IN READING INPUT FILE MUMPS_B_in.bin'
0153 GOTO 1000
0154
0155 400 continue
0156 print*,
0157 *'PROBLEM IN WRITING OUTPUT FILE MUMPS_X_out.bin'
0158 GOTO 1000
0159
0160
0161
0162
0163
0164 1000 IF ( mumps_par%MYID .eq. 0 )THEN
0165 DEALLOCATE( mumps_par%IRN )
0166 DEALLOCATE( mumps_par%JCN )
0167 DEALLOCATE( mumps_par%A )
0168 DEALLOCATE( mumps_par%RHS )
0169 END IF
0170
0171 mumps_par%JOB = -2
0172 CALL DMUMPS(mumps_par)
0173 CALL MPI_FINALIZE(IERR)
0174
0175 STOP
0176 END
0177