Community
cancel
Showing results for 
Search instead for 
Did you mean: 
pankaj_p_
Novice
511 Views

how to include intel math kernel library in abaqus subroutine

I am trying to include the in-build subroutines of intel math kernel library in ABAQUS UMAT. I included 'mkl.fi' but it is showing the error as shown below (It is ABAQUS generated job file):

-------------------------------------------------------------------------------------------------------------------------------------------------------

 

Abaqus JOB Job-1 Abaqus 6.13-1

Begin Compiling Abaqus/Standard User Subroutines

3/8/2017 6:14:23 PM

Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.1.143 Build 20161005

Copyright (C) 1985-2016 Intel Corporation. All rights reserved.

C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(29): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE CGEJSV( JOBA, JOBU, JOBV, JOBR, JOBT, JOBP, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(30): error #5082: Syntax error, found '&' when expecting one of: * & M, N, A, LDA, SVA, U, LDU, V, LDV, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(34): error #5082: Syntax error, found '&' when expecting one of: %FILL COMPLEX A( LDA, * ), U( LDU, * ), V( LDV, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(43): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE ZGEJSV( JOBA, JOBU, JOBV, JOBR, JOBT, JOBP, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(44): error #5082: Syntax error, found '&' when expecting one of: * & M, N, A, LDA, SVA, U, LDU, V, LDV, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(48): error #5082: Syntax error, found '&' when expecting one of: %FILL DOUBLE COMPLEX A( LDA, * ), U( LDU, * ), V( LDV, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(57): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE DGESVDX( JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(58): error #5082: Syntax error, found '&' when expecting one of: * & IL, IU, NS, S, U, LDU, VT, LDVT, WORK, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(64): error #5082: Syntax error, found '&' when expecting one of: %FILL DOUBLE PRECISION A( LDA, * ), S( * ), U( LDU, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(70): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE SGESVDX( JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(71): error #5082: Syntax error, found '&' when expecting one of: * & IL, IU, NS, S, U, LDU, VT, LDVT, WORK, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(77): error #5082: Syntax error, found '&' when expecting one of: %FILL REAL A( LDA, * ), S( * ), U( LDU, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(83): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE CGESVDX( JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(84): error #5082: Syntax error, found '&' when expecting one of: * & IL, IU, NS, S, U, LDU, VT, LDVT, WORK, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(91): error #5082: Syntax error, found '&' when expecting one of: %FILL COMPLEX A( LDA, * ), U( LDU, * ), VT( LDVT, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(97): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE ZGESVDX( JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(98): error #5082: Syntax error, found '&' when expecting one of: * & IL, IU, NS, S, U, LDU, VT, LDVT, WORK, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(105): error #5082: Syntax error, found '&' when expecting one of: %FILL COMPLEX*16 A( LDA, * ), U( LDU, * ), VT( LDVT, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(111): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE CGESVJ( JOBA, JOBU, JOBV, M, N, A, LDA, SVA, MV, V, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(121): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE ZGESVJ( JOBA, JOBU, JOBV, M, N, A, LDA, SVA, MV, V, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(131): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE DGGSVD3( JOBU, JOBV, JOBQ, M, N, P, K, L, A, LDA, B, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(132): error #5082: Syntax error, found '&' when expecting one of: * & LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK,& ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(135): error #5082: Syntax error, found '&' when expecting one of: %FILL INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N, P, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(138): error #5082: Syntax error, found '&' when expecting one of: %FILL DOUBLE PRECISION A( LDA, * ), ALPHA( * ), B( LDB, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(139): error #5082: Syntax error, found '&' when expecting one of: %FILL & BETA( * ), Q( LDQ, * ), U( LDU, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(145): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE SGGSVD3( JOBU, JOBV, JOBQ, M, N, P, K, L, A, LDA, B, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(146): error #5082: Syntax error, found '&' when expecting one of: * & LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK,& ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(149): error #5082: Syntax error, found '&' when expecting one of: %FILL INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N, P, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(152): error #5082: Syntax error, found '&' when expecting one of: %FILL REAL A( LDA, * ), ALPHA( * ), B( LDB, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(153): error #5082: Syntax error, found '&' when expecting one of: %FILL & BETA( * ), Q( LDQ, * ), U( LDU, * ), & ------------------------------------------------------------------------^ AFEM.for(170): catastrophic error: Too many errors, exiting compilation aborted for AFEM.for (code 1) Abaqus Error: Problem during compilation - D:\Google Drive\Friday_May_27_2016\Mtech Thesis Job\All new work\TA\AFEM.for Abaqus/Analysis exited with errors

--------------------------------------------------------------------------------------------------------------------------------------------------

In case when mkl library is not included, job file shows the following errors:

--------------------------------------------------------------------------------------------------------------------------------------------------

Abaqus JOB Job-1

Abaqus 6.13-1

Abaqus License Manager checked out the following licenses:

Begin Compiling Abaqus/Standard User Subroutines 3/8/2017 6:18:48 PM

Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.1.143 Build 20161005

Copyright (C) 1985-2016 Intel Corporation. All rights reserved.

End Compiling Abaqus/Standard User Subroutines

Begin Linking Abaqus/Standard User Subroutines

Creating library standardU.lib and object standardU.exp

AFEM.obj : error LNK2019: unresolved external symbol dgemm referenced in function umat.R

standardU.dll : fatal error LNK1120: 1 unresolved externals

Abaqus Error: Problem during linking - Abaqus/Standard User Subroutines.

This error may be due to a mismatch in the Abaqus user subroutine arguments.

These arguments sometimes change from release to release, so user subroutines used with a previous release of Abaqus may need to be adjusted.

Abaqus/Analysis exited with errors

-------------------------------------------------------------------------------------------------------------------------------------------------------

The source code, when compiled outside ABAQUS, works fine with no errors. If I am not able to include this lapack library in ABAQUS UMAT subroutine, I may have to append lapack source code in my code itself. That may invite other problems.

So is there any way to compile these lapack subroutines in ABAQUS successfully. Note that ABAQUS User subroutine (UMAT) is written in '.for' format. I have included the UMAT (ABAQUS subroutine) for reference. It has 'mul_big_mat' (that stands for multiplying big matrices) subroutine that uses lapack 'dgemm' subroutine.

------------------------------------------------------------------------------------------------------------------------------------------------------

C================================================================

          SUBROUTINE UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD,
         1RPL,DDSDDT,DRPLDE,DRPLDT,STRAN,DSTRAN,
         2TIME,DTIME,TEMP,DTEMP,PREDEF,DPRED,MATERL,NDI,NSHR,NTENS,
         3NSTATV,PROPS,NPROPS,COORDS,DROT,PNEWDT,CELENT,
         4DFGRD0,DFGRD1,NOEL,NPT,KSLAY,KSPT,KSTEP,KINC)
    C
          INCLUDE 'ABA_PARAM.INC'
    C
          CHARACTER*80 MATERL
          DIMENSION STRESS(NTENS),STATEV(NSTATV),
         1DDSDDE(NTENS,NTENS),DDSDDT(NTENS),DRPLDE(NTENS),
         2STRAN(NTENS),DSTRAN(NTENS),TIME(2),PREDEF(1),DPRED(1),
         3PROPS(NPROPS),COORDS(3),DROT(3,3),
         4DFGRD0(3,3),DFGRD1(3,3)
    C
          DIMENSION EELAS(6),EPLAS(6),FLOW(6)
          PARAMETER (ONE=1.0D0,TWO=2.0D0,THREE=3.0D0,SIX=6.0D0)
          DATA NEWTON,TOLER/10,1.D-6/
    C
    C ============================================================================
    C     UMAT FOR 1D BAR
    C 

    ============================================================================
        C     Note :- This UMAT can only be used by 1D elements
        C
        C     Number of material properties, nprops = 1
        C     props(1)         Young's modulus in x direction
        C ---------------------------------------------------------------------
        C
              ! --- local variables
              DOUBLE PRECISION E
              DOUBLE PRECISION C(ntens, ntens)
              integer z
        !***********************************************************************

        ! *** Get Elastic properties
              E = props(1)
              write(*,*)''
              write(*,*) z
              write(*,*)''
        ! *** Elastic stiffness Cijkl *** !
              C(1,1) = E
              !call hello_world3
              CALL mul_big_mat

        ! *** calculate the stress *** !
              stress(1) = C(1,1)*(stran(1) + dstran(1))

        !     Updating Jacobian matrix
              ddsdde(1,1) = C(1,1)
              return
              END

              subroutine hello_world3
              implicit none
              character*32 text
        c
              write(*,*)'Hello World'
        c
              END

              subroutine mul_big_mat    
        c
        c
              integer m, n, k, i, j
              parameter (m=100,  k= 200, n=100)
              double precision a(m,k), b(k,n), c(m,n), alpha, beta
              alpha=1.0
              beta=0.0
        c      matrix a declaration       
              do i=1,m
                  do j=1,k
                      a(i,j)=i+j
                  enddo
              enddo
              write(*,*) a(100,200)
        c      matrix b declaration       
              do i=1,k
                  do j=1,n
                      b(i,j)=i-j
                  enddo
              enddo
              write(*,*) b(200,100)
        c      matrix c declaration       
              do i=1,m
                  do j=1,n
                      c(i,j)=0.0
                  enddo
              enddo
              call dgemm('n','n',m,n,k,alpha,a,m,b,k,beta,c,m)
! THIS IS THE SUBROUTINE I WANT TO USE FROM INTEL MKL LIBRARY
! I COULD USE MATMUL (AND THAT WORKS FINE), BUT ITS JUST AN EXAMPLE
! I HAVE TO USE 'DGETRI' AND MANY MORE
              write(*,*) c(1,1)
              do i=1,m
                  do j=1,n
                      write(*,*) ' '
                      write(*,*) c(i,j)
                  enddo
              enddo
              END

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

thanks

0 Kudos
2 Replies
mecej4
Black Belt
511 Views

Your problems are basically quite simple: the source code that you posted is not in conformity with the rules for fixed format Fortran source. Many comment lines contain blanks preceding the  'C', which is supposed to be in the first column position.

You do not need to include 'mkl.fi' if the call to DGEMM has the correct argument list and the implicit interface is correct (which it appears to be). After editing your file to remove the spurious leading blanks, I found that compiling with the command "ifort /LD /Qmkl umat.f" produced a DLL file.

han_s_
Beginner
511 Views

Hi

Try to add '/Qkml' in the moudule of compile_fortran after 'ifort' in the file of abaqus_v6.env locate in C:\SIMULIA\Abaqus\6.13-1\SMA\site.

It works for me and I hope this will help you.

If there still exists problems, please sending me email hanshiwei1987@163.com

Reply