I’m trying to debug a program in visual studio with fortran compiler and using mkl library (symmetric matrix solvers by CG) and I face into these errors:
I thought its because of codeline’s length that is too large and code turns into comments with green colour. I searched a lot and I tried this method below,but it didn’t work:
Visual Studio 2010
intel parallel studio 2013
Can you help me with this problem?
Here is my code:
! Copyright(C) 2005-2012 Intel Corporation. All Rights Reserved.
!
! The source code, information and material ("Material") contained herein is
! owned by Intel Corporation or its suppliers or licensors, and title to such
! Material remains with Intel Corporation or its suppliers or licensors. The
! Material contains proprietary information of Intel or its suppliers and
! licensors. The Material is protected by worldwide copyright laws and treaty
! provisions. No part of the Material may be used, copied, reproduced,
! modified, published, uploaded, posted, transmitted, distributed or disclosed
! in any way without Intel's prior express written permission. No license
! under any patent, copyright or other intellectual property rights in the
! Material is granted to or conferred upon you, either expressly, by
! implication, inducement, estoppel or otherwise. Any license under such
! intellectual property rights must be express and approved by Intel in
! writing.
!
! *Third Party trademarks are the property of their respective owners.
!
! Unless otherwise agreed by Intel in writing, you may not remove or alter
! this notice or any other notice embedded in Materials by Intel or Intel's
! suppliers or licensors in any way.
!
!*******************************************************************************
! Content: Intel MKL RCI (P)CG Fortran-77 example
!
!*******************************************************************************
!---------------------------------------------------------------------------
! Example program for solving symmetric positive definite system of equations.
! Simplest case: no preconditioning and no the user-defined stopping tests.
!---------------------------------------------------------------------------
PROGRAM rci_pcg_f77_test_1
IMPLICIT NONE
INCLUDE 'mkl_rci.fi'
!---------------------------------------------------------------------------
! Define arrays for the upper triangle of the coefficient matrix and rhs vector
! Compressed sparse row storage is used for sparse representation
!---------------------------------------------------------------------------
INTEGER N, RCI_request, itercount, expected_itercount, i
PARAMETER (N=9)
PARAMETER (expected_itercount=9)
DOUBLE PRECISION rhs(N), INITIAL_TIME, END_TIME, TIME
INTEGER IA(10)
INTEGER JA(33)
DOUBLE PRECISION A(33)
! Fill all arrays containing matrix data.
DATA IA /1,4,8,11,15,20,24,27,31,34/
DATA JA /1,2,4,1,2,3,5,2,3,6,1,4,5,7,2,4,5,6,8,3,5,6,9,4,7,8,5,7,8,9,6,8,9/
DATA A /2,-1,-1,-1,3,-1,-1,-1,2,-1,-1,3,-1,-1,-1,-1,4,-1,-1,-1,-1,3,-1,-1,2,-1,-1,-1,3,-1,-1,-1,4/
!---------------------------------------------------------------------------
! Allocate storage for the solver ?par and the initial solution vector
!---------------------------------------------------------------------------
INTEGER length
PARAMETER (length=256)
DOUBLE PRECISION expected_sol(N)
!---------------------------------------------------------------------------
! Some additional variables to use with the RCI (P)CG solver
!---------------------------------------------------------------------------
DOUBLE PRECISION solution(N)
DATA expected_sol/150,100,75,100,75,50,75,50,0/
INTEGER ipar(length)
DOUBLE PRECISION dpar(length),TMP(N,4)
DOUBLE PRECISION DNRM2, Euclidean_norm
EXTERNAL DNRM2
CALL CPU_TIME(INITIAL_TIME)
!---------------------------------------------------------------------------
! Initialize the right hand side through matrix-vector product
!---------------------------------------------------------------------------
rhs(1)=100
rhs(N)=-100
!CALL MKL_DCSRSYMV('U', N, A, IA, JA, expected_sol, rhs)
!---------------------------------------------------------------------------
! Initialize the initial guess
!---------------------------------------------------------------------------
DO I=1, N
solution(I)=1.D0
ENDDO
!---------------------------------------------------------------------------
! Initialize the solver
!---------------------------------------------------------------------------
CALL dcg_init(N, solution,rhs, RCI_request,ipar,dpar,TMP)
IF (RCI_request .NE. 0 ) GOTO 999
!---------------------------------------------------------------------------
! Set the desired parameters:
! LOGICAL parameters:
! do residual stopping test
! do not request for the user defined stopping test
! DOUBLE PRECISION parameters
! set the relative tolerance to 1.0D-5 instead of default value 1.0D-6
!---------------------------------------------------------------------------
ipar(9)=1
ipar(10)=0
dpar(1)=1.D-5
!---------------------------------------------------------------------------
! Check the correctness and consistency of the newly set parameters
!---------------------------------------------------------------------------
CALL dcg_check(N,solution,rhs,RCI_request,ipar,dpar,TMP)
IF (RCI_request .NE. 0 ) GOTO 999
!---------------------------------------------------------------------------
! Compute the solution by RCI (P)CG solver without preconditioning
! Reverse Communications starts here
!---------------------------------------------------------------------------
1 CALL dcg(N,solution,rhs,RCI_request,ipar,dpar,TMP)
!---------------------------------------------------------------------------
! If RCI_request=0, then the solution was found with the required precision
!---------------------------------------------------------------------------
IF (RCI_request .EQ. 0) THEN
GOTO 700
!---------------------------------------------------------------------------
! If RCI_request=1, then compute the vector A*TMP(:,1)
! and put the result in vector TMP(:,2)
!---------------------------------------------------------------------------
ELSEIF (RCI_request .EQ. 1) THEN
CALL MKL_DCSRSYMV('U', N, A, IA, JA, TMP, TMP(1,2))
GOTO 1
ELSE
!---------------------------------------------------------------------------
! If RCI_request=anything else, then dcg subroutine failed
! to compute the solution vector: solution(N)
!---------------------------------------------------------------------------
GOTO 999
ENDIF
!---------------------------------------------------------------------------
! Reverse Communication ends here
! Get the current iteration number
!---------------------------------------------------------------------------
700 CALL dcg_get(N,solution,rhs,RCI_request,ipar,dpar,TMP,itercount)
!---------------------------------------------------------------------------
! Print solution vector: solution(N) and number of iterations: itercount
!---------------------------------------------------------------------------
WRITE(*, *) ' The system has been solved '
WRITE(*, *) ' The following solution obtained '
WRITE(*,800) (solution(i),i =1,N)
WRITE(*, *) ' expected solution '
WRITE(*,800)(expected_sol(i),i =1,N)
800 FORMAT(3(F10.3))
WRITE(*,900)(itercount)
900 FORMAT(' Number of iterations: ',1(I2))
DO I=1,N
expected_sol(I)=expected_sol(I)-solution(I)
ENDDO
Euclidean_norm=DNRM2(N,expected_sol,1)
WRITE(*, *)
WRITE(*, *) ' The Norm of error is: '
WRITE(*, 1000) Euclidean_norm
1000 FORMAT(E11.3)
CALL CPU_TIME(END_TIME)
TIME = END_TIME - INITIAL_TIME
PRINT*, 'The Project Time is: ', TIME
pause
!---------------------------------------------------------------------------
! Release internal MKL memory that might be used for computations
! NOTE: It is important to call the routine below to avoid memory leaks
! unless you disable MKL Memory Manager
!---------------------------------------------------------------------------
CALL MKL_FREEBUFFERS
IF (itercount.EQ.expected_itercount .AND.
1 Euclidean_norm.LE.1.0D-12) THEN
WRITE( *,'(A,A)') 'This example has successfully PASSED',
1 ' through all steps of computation!'
STOP 0
ELSE
WRITE( *,'(A,A,A,I5,A,A,A,E12.5,A)') 'This example may have',
1 ' FAILED as either the number of iterations differs from the',
2 ' expected number of iterations ',expected_itercount,' or the',
3 ' computed solution differs much from the expected solution (',
4 'Euclidean norm is ',Euclidean_norm,'), or both.'
STOP 1
ENDIF
!---------------------------------------------------------------------------
! Release internal MKL memory that might be used for computations
! NOTE: It is important to call the routine below to avoid memory leaks
! unless you disable MKL Memory Manager
!---------------------------------------------------------------------------
999 WRITE( *,'(A,A)') 'This example FAILED as the solver has',
1 ' returned the ERROR code', RCI_request
CALL MKL_FREEBUFFERS
STOP 1
END


