- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I am using intel fortan compiler with imslwith visual studio 2008 and x64 architecture. I am tryiing to run "ScaLAPACK example test for subroutine lslrb" given in C:\\Program Files (x86)\\VNI\\imsl\\fnl600\\Intel64\\examples\\mpi_scalapack folder. I am having an error Cannot open include file 'mpif.h'. How can I include this. Do I have to buy any extra library?
Thanks in advance.
Regards,
skravoof
I am using intel fortan compiler with imslwith visual studio 2008 and x64 architecture. I am tryiing to run "ScaLAPACK example test for subroutine lslrb" given in C:\\Program Files (x86)\\VNI\\imsl\\fnl600\\Intel64\\examples\\mpi_scalapack folder. I am having an error Cannot open include file 'mpif.h'. How can I include this. Do I have to buy any extra library?
Thanks in advance.
Regards,
skravoof
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you have some version of MPI or MPICH installed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have installed MPICH 2 and did the same. Program compiled but failed to build with 38 errors. I think I am doing some thing wrong? the error list is
some of the errors are as follows.
Error 7 error LNK2019: unresolved external symbol GRIDINFO_INT_mp_MP_ICTXT referenced in function MAIN__ lalrb_parall.obj
Error 8 error LNK2019: unresolved external symbol GRIDINFO_INT_mp_MP_MB referenced in function MAIN__ lalrb_parall.obj
Error 9 error LNK2019: unresolved external symbol GRIDINFO_INT_mp_MP_NB referenced in function MAIN__ lalrb_parall.obj
Error 10 error LNK2019: unresolved external symbol RITITM referenced in function MAIN__ lalrb_parall.obj
Error 11 error LNK2019: unresolved external symbol UMACH referenced in function MAIN__ lalrb_parall.obj
I had atttached the code for your reference.
Regards,
skravoof
!-----------------------------------------------------------------------
! IMSL Name: S_LSLRB_SL/D_LSLRB_SL (Single/Double precision version)
!
! Computer: pc64ms/SINGLE
!
! Revised: October 1, 2006
!
! Purpose: ScaLAPACK example test for subroutine lslrb.
!
! Usage: call s_lslrb_sl
!
! Copyright: 2006 by IMSL, Inc. All Rights Reserved.
!
! Warranty: IMSL warrants only that IMSL testing has been applied
! to this code. No other warranty, expressed or implied,
! is applicable.
!
!-----------------------------------------------------------------------
!
program main
!
USE MPI_SETUP_INT
IMPLICIT NONE
INCLUDE 'mpif.h'
! SPECIFICATIONS FOR LOCAL VARIABLES
integer ichk(500), j, lev, nof, nout, ntemp, ij, ntest, leichk
! Declare variables
INTEGER LDA, M, N, NLCA, NUCA, NRA, DESCA(9), DESCX(9)
INTEGER INFO, MXCOL, MXLDA
real(kind(1e0)), ALLOCATABLE :: A(:,:), B(:), X(:)
real(kind(1e0)), ALLOCATABLE :: A0(:,:), B0(:), X0(:)
real(kind(1e0)) ans, ermax, rels, zero
character aname(2)*20
! SPECIFICATIONS FOR SUBROUTINES
! external e1chk, e1pos, rititm, umach, wrirn, wrtrl, lslrb, &
! ststn, testn, testr, wrrrn
! SPECIFICATIONS FOR FUNCTIONS
! external n1rnof, n1rty
integer n1rnof, n1rty
! SPECIFICATIONS FOR PARAMETERS
PARAMETER (LDA=3, N= 6, NLCA=1, NUCA=1)
! Set up for EIAT utilities
!
ij = 0
ntest = 0
leichk = 500
!
ermax = 10.0e-5
zero = 0.0e0
!
lev = 1
call rititm (1, lev)
call umach (2, nout)
if (lev .eq. 0) then
call e1pos (0, 0, 0)
call e1chk (-1234.0d0)
else
call e1pos (0, -1, 0)
end if
aname(1) = 'S_LSLRB '
! Set up for MPI
MP_NPROCS = MP_SETUP()
IF(MP_RANK .EQ. 0) THEN
ALLOCATE (A(LDA,N), B(N), X(N))
! Set values for A in band form, and B
A(1,:) = (/ 0.0, 0.0, -3.0, 0.0, -1.0, -3.0 /)
A(2,:) = (/ 10.0, 10.0, 15.0, 10.0, 1.0, 6.0 /)
A(3,:) = (/ 0.0, 0.0, 0.0, -5.0, 0.0, 0.0 /)
!
B = (/ 10.0, 7.0, 45.0, 33.0, -34.0, 31.0 /)
ENDIF
NRA = NLCA + NUCA + 1
M = 2*NLCA + 2*NUCA + 1
! Set up a 1D processor grid and
! its context ID, MP_ICTXT
CALL SCALAPACK_SETUP(M, N, .FALSE., .TRUE.)
! Get the array descriptor entities MXLDA,
! and MXCOL
CALL SCALAPACK_GETDIM(M, N, MP_MB, MP_NB, MXLDA, MXCOL)
MXLDA = M
! Set up the array descriptors
CALL DESCINIT(DESCA, NRA, N, MP_MB, MP_NB, 0, 0, MP_ICTXT, MXLDA, INFO)
CALL DESCINIT(DESCX, 1, N, 1, MP_NB, 0, 0, MP_ICTXT, 1, INFO)
! Allocate space for the local arrays
ALLOCATE (A0(MXLDA,MXCOL), B0(MXCOL), X0(MXCOL))
! Map input arrays to the processor grid
CALL SCALAPACK_MAP(A, DESCA, A0)
CALL SCALAPACK_MAP(B, DESCX, B0, 1, .FALSE.)
! Solve the system of equations
CALL LSLRB (A0, NLCA, NUCA, B0, X0)
! Unmap the results from the distributed
! arrays back to a non-distributed array.
! After the unmap, only Rank=0 has the full
! array.
CALL SCALAPACK_UNMAP(X0, DESCX, X, 1, .FALSE.)
ans = 1.7047619047619047e0
IF(MP_RANK .EQ. 0) THEN
call testr (x, n, ichk, leichk, aname, ans,&
ntest, ermax, rels, ij, 1)
if (lev .ge. 2 .or. (lev.eq.1.and.n1rty(1).ge.3)) then
! Print results.
! Only Rank=0 has the solution, X.
write (nout,99999)
call wrtrl ('ScaLAPACK interface example for S_LSLRB.', 80)
CALL WRRRN ('X', X, 1, N, 1)
endif
nof = n1rnof(2)
call ststn (nof, ichk, leichk, aname, zero, ntest, ermax, ij, 1)
ntemp = ntest
call ststn (nof, ichk, ntemp, aname, zero, ntest, ermax, ij, 1)
ENDIF
IF (MP_RANK .EQ. 0) DEALLOCATE(A, B, X)
DEALLOCATE(A0, B0, X0)
! Exit ScaLAPACK usage
CALL SCALAPACK_EXIT(MP_ICTXT)
! Shut down MPI
MP_NPROCS = MP_SETUP('FINAL')
99999 format (1x, 72('-'))
end program main
some of the errors are as follows.
Error 7 error LNK2019: unresolved external symbol GRIDINFO_INT_mp_MP_ICTXT referenced in function MAIN__ lalrb_parall.obj
Error 8 error LNK2019: unresolved external symbol GRIDINFO_INT_mp_MP_MB referenced in function MAIN__ lalrb_parall.obj
Error 9 error LNK2019: unresolved external symbol GRIDINFO_INT_mp_MP_NB referenced in function MAIN__ lalrb_parall.obj
Error 10 error LNK2019: unresolved external symbol RITITM referenced in function MAIN__ lalrb_parall.obj
Error 11 error LNK2019: unresolved external symbol UMACH referenced in function MAIN__ lalrb_parall.obj
I had atttached the code for your reference.
Regards,
skravoof
!-----------------------------------------------------------------------
! IMSL Name: S_LSLRB_SL/D_LSLRB_SL (Single/Double precision version)
!
! Computer: pc64ms/SINGLE
!
! Revised: October 1, 2006
!
! Purpose: ScaLAPACK example test for subroutine lslrb.
!
! Usage: call s_lslrb_sl
!
! Copyright: 2006 by IMSL, Inc. All Rights Reserved.
!
! Warranty: IMSL warrants only that IMSL testing has been applied
! to this code. No other warranty, expressed or implied,
! is applicable.
!
!-----------------------------------------------------------------------
!
program main
!
USE MPI_SETUP_INT
IMPLICIT NONE
INCLUDE 'mpif.h'
! SPECIFICATIONS FOR LOCAL VARIABLES
integer ichk(500), j, lev, nof, nout, ntemp, ij, ntest, leichk
! Declare variables
INTEGER LDA, M, N, NLCA, NUCA, NRA, DESCA(9), DESCX(9)
INTEGER INFO, MXCOL, MXLDA
real(kind(1e0)), ALLOCATABLE :: A(:,:), B(:), X(:)
real(kind(1e0)), ALLOCATABLE :: A0(:,:), B0(:), X0(:)
real(kind(1e0)) ans, ermax, rels, zero
character aname(2)*20
! SPECIFICATIONS FOR SUBROUTINES
! external e1chk, e1pos, rititm, umach, wrirn, wrtrl, lslrb, &
! ststn, testn, testr, wrrrn
! SPECIFICATIONS FOR FUNCTIONS
! external n1rnof, n1rty
integer n1rnof, n1rty
! SPECIFICATIONS FOR PARAMETERS
PARAMETER (LDA=3, N= 6, NLCA=1, NUCA=1)
! Set up for EIAT utilities
!
ij = 0
ntest = 0
leichk = 500
!
ermax = 10.0e-5
zero = 0.0e0
!
lev = 1
call rititm (1, lev)
call umach (2, nout)
if (lev .eq. 0) then
call e1pos (0, 0, 0)
call e1chk (-1234.0d0)
else
call e1pos (0, -1, 0)
end if
aname(1) = 'S_LSLRB '
! Set up for MPI
MP_NPROCS = MP_SETUP()
IF(MP_RANK .EQ. 0) THEN
ALLOCATE (A(LDA,N), B(N), X(N))
! Set values for A in band form, and B
A(1,:) = (/ 0.0, 0.0, -3.0, 0.0, -1.0, -3.0 /)
A(2,:) = (/ 10.0, 10.0, 15.0, 10.0, 1.0, 6.0 /)
A(3,:) = (/ 0.0, 0.0, 0.0, -5.0, 0.0, 0.0 /)
!
B = (/ 10.0, 7.0, 45.0, 33.0, -34.0, 31.0 /)
ENDIF
NRA = NLCA + NUCA + 1
M = 2*NLCA + 2*NUCA + 1
! Set up a 1D processor grid and
! its context ID, MP_ICTXT
CALL SCALAPACK_SETUP(M, N, .FALSE., .TRUE.)
! Get the array descriptor entities MXLDA,
! and MXCOL
CALL SCALAPACK_GETDIM(M, N, MP_MB, MP_NB, MXLDA, MXCOL)
MXLDA = M
! Set up the array descriptors
CALL DESCINIT(DESCA, NRA, N, MP_MB, MP_NB, 0, 0, MP_ICTXT, MXLDA, INFO)
CALL DESCINIT(DESCX, 1, N, 1, MP_NB, 0, 0, MP_ICTXT, 1, INFO)
! Allocate space for the local arrays
ALLOCATE (A0(MXLDA,MXCOL), B0(MXCOL), X0(MXCOL))
! Map input arrays to the processor grid
CALL SCALAPACK_MAP(A, DESCA, A0)
CALL SCALAPACK_MAP(B, DESCX, B0, 1, .FALSE.)
! Solve the system of equations
CALL LSLRB (A0, NLCA, NUCA, B0, X0)
! Unmap the results from the distributed
! arrays back to a non-distributed array.
! After the unmap, only Rank=0 has the full
! array.
CALL SCALAPACK_UNMAP(X0, DESCX, X, 1, .FALSE.)
ans = 1.7047619047619047e0
IF(MP_RANK .EQ. 0) THEN
call testr (x, n, ichk, leichk, aname, ans,&
ntest, ermax, rels, ij, 1)
if (lev .ge. 2 .or. (lev.eq.1.and.n1rty(1).ge.3)) then
! Print results.
! Only Rank=0 has the solution, X.
write (nout,99999)
call wrtrl ('ScaLAPACK interface example for S_LSLRB.', 80)
CALL WRRRN ('X', X, 1, N, 1)
endif
nof = n1rnof(2)
call ststn (nof, ichk, leichk, aname, zero, ntest, ermax, ij, 1)
ntemp = ntest
call ststn (nof, ichk, ntemp, aname, zero, ntest, ermax, ij, 1)
ENDIF
IF (MP_RANK .EQ. 0) DEALLOCATE(A, B, X)
DEALLOCATE(A0, B0, X0)
! Exit ScaLAPACK usage
CALL SCALAPACK_EXIT(MP_ICTXT)
! Shut down MPI
MP_NPROCS = MP_SETUP('FINAL')
99999 format (1x, 72('-'))
end program main

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page