ustatic
 | Total Points: 170 Status Points: 0 Green Belt | |
July 20, 2008 5:17 AM PDT
|
The main file of dll is:
! ss.f90
!
! FUNCTIONS/SUBROUTINES exported from ss.dll:
! ss - subroutine
!
subroutine ss
! Expose subroutine ss to users of this DLL
!
!DEC$ ATTRIBUTES DLLEXPORT::ss
! Variables
! Body of ss
IMPLICIT NONE
!.. Internal solver memory pointer for 64-bit architectures
!.. INTEGER*8 pt(64)
!.. Internal solver memory pointer for 32-bit architectures
!.. INTEGER*4 pt(64)
!.. This is OK in both cases
INTEGER*8 pt(64)
!.. All other variables
INTEGER maxfct, mnum, mtype, phase, n, nrhs, error, msglvl,nia,nja
INTEGER iparm(64)
INTEGER, ALLOCATABLE :: ia(:),ja(:)
REAL*8, ALLOCATABLE :: a(:),b(:,:), x(:,:)
INTEGER i, j, idum, fdense, fngdl, fn, fbanda, fh, fnh,typ
REAL*8 waltime1, waltime2, ddum
open(10,file='1.tmp',status='old',action='read')
open(11,file='2.tmp',status='old',action='read')
open(12,file='3.tmp',status='replace',action='write')
read(10,*) typ,fdense,fngdl,fn,fbanda,nia
n = fn
ALLOCATE (ia(nia))
do i = 1,nia
read(10,*) ia(i)
end do
read(10,*) nja
ALLOCATE (ja(nja),a(nja))
do i=1,nja
read(10,*) ja(i)
end do
do i=1,nja
read(10,*) a(i)
end do
read(11,*) fh,fnh
ALLOCATE (b(fnh,fh),x(fnh,fh))
nrhs = fh
maxfct = 1
mnum = 1
do i=1,fh
do j=1,fnh
read(11,*) b(j,i)
end do
end do
!
! .. Setup Pardiso control parameters und initialize the solvers
! internal adress pointers. This is only necessary for the FIRST
! call of the PARDISO solver.
!
mtype = typ
call pardisoinit(pt, mtype, iparm)
! .. Numbers of Processors ( value of OMP_NUM_THREADS )
iparm(3) = 1
!.. Reordering and Symbolic Factorization, This step also allocates
! all memory that is necessary for the factorization
phase = 11 ! only reordering and symbolic factorization
msglvl = 1 ! with statistical information
CALL pardiso (pt, maxfct, mnum, mtype, phase, n, a, ia, ja, idum, nrhs, iparm, msglvl, ddum, ddum, error)
WRITE(*,*) 'Reordering completed ... '
IF (error .NE. 0) THEN
WRITE(*,*) 'The following ERROR was detected: ', error
WRITE(12,'(a)') error
STOP
END IF
WRITE(*,*) 'Number of nonzeros in factors = ',iparm(18)
WRITE(*,*) 'Number of factorization MFLOPS = ',iparm(19)
!.. Factorization.
phase = 22 ! only factorization
CALL pardiso (pt, maxfct, mnum, mtype, phase, n, a, ia, ja,idum, nrhs, iparm, msglvl, ddum, ddum, error)
WRITE(*,*) 'Factorization completed ... '
IF (error .NE. 0) THEN
WRITE(*,*) 'The following ERROR was detected: ', error
STOP
END IF
!.. Back substitution and iterative refinement
iparm(8) = 1 ! max numbers of iterative refinement steps
phase = 33 ! only factorization
CALL pardiso (pt, maxfct, mnum, mtype, phase, n, a, ia, ja,idum, nrhs, iparm, msglvl, b, x, error)
WRITE(*,*) 'Solve completed ... '
WRITE(*,*) 'The solution of the system is '
if (fnh<20) then
DO i = 1, fh
do j= 1, fnh
WRITE(*,*) ' x(',j,',',i,') = ', x(j,i)
end do
END DO
end if
DO i = 1, fh
do j= 1, fnh
WRITE(12,*) x(j,i)
end do
END DO
!.. Termination and release of memory
phase = -1 ! release internal memory
CALL pardiso (pt, maxfct, mnum, mtype, phase, n, ddum, idum, idum,idum, nrhs, iparm, msglvl, ddum, ddum, error)
CLOSE(10)
CLOSE(11)
CLOSE(12)
DEALLOCATE (ia,ja,a,b,x)
end subroutine ss
In the computer on I have installed intel visual fortran and delphi dll access works fine but in another computer where i don't have installed intel visual fortran the program compiled in delphi crashes at start.
The only entries in configuration of ss are:
Linker->Additional Library Directories = C:Program FilesIntelMKL10.0.3.021ia32lib
Linker->Input->Additional Dependencies = mkl_c.lib libguide.lib mkl_solver.lib mkl_intel_thread.lib mkl_core.lib libiomp5mt.lib
Hope this helps
|
|
|
|
|
|
|