Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: How to compile an ABAQUS vumat double precision shared library

  1. #1
    Join Date
    2000-02
    Location
    Boston, USA
    Posts
    3,280

    How to compile an ABAQUS vumat double precision shared library

    If you are trying to create a double precision ABAQUS vumat shared library and are having trouble since you like to use proper Fortan style which includes using the command implicit none at the beginning of all functions. Then this hint might be of interest.

    By default, ABAQUS requires you to write your Fortran code using the "include 'vaba_param.inc'" command, which is a really bad idea since that allows you to use variables without explicitly defining them. The problem with this approach is that it very easily leads to errors and is generally considered bad practice!

    Fortunately, there is a way to compile your own shared VUMAT library by using a command like the following:
    Code:
    ifort -fPIC -r8 -O2 -c vumat.f90
    
    ifort -cxxlib-gcc -gcc-version=330 -fPIC -threads -shared \
     -Wl,-u,vcosimulation_ -Wl,-u,vcosimulation0_ -Wl,-u,vdload_ \
     -Wl,-u,vfabric_ -Wl,-u,vfric_ -Wl,-u,vuel_ -Wl,-u,vufield_ \
     -Wl,-u,vuinter_ -Wl,-u,vumat_ -Wl,-soname,libexplicitU-D.so \
     -o libexplicitU-D.so vumat.o /opt/abaqus/6.7-1/exec/lbr/explicitU_static.a \
     -L /opt/abaqus/6.7-1/exec/lbr -L /opt/abaqus/6.7-1/External \
     /opt/abaqus/6.7-1/exec/lbr/libexplicitB.so \
     /opt/abaqus/6.7-1/exec/lbr/libABQUTI_CoreUtils.so \
     /opt/abaqus/6.7-1/exec/lbr/libABQUTI_UtiLicensing.so \
     -parallel -Wl,-Bdynamic -i-dynamic -lifport -lifcoremt
    This particular command works for a 64-bit Linux computer running ABAQUS v6.7.

    The way I found out the specific compiler flags was by temporarily modify the link_sl variable in the abaqus_v6.env file to include the echo command:
    Code:
    link_sl = ("echo " + fortCmd +
               " -cxxlib-gcc -gcc-version=%i -fPIC -threads -shared " %verId   +
               "%E -Wl,-soname,%U -o %U %F %A %L %B -parallel -Wl,-Bdynamic " +
               "-i-dynamic -lifport -lifcoremt")
    This way the actual link command is echoed on the screen when running abaqus with a source file using the "user=vumat.f" options. This makes it possible to create shared libraries without running the "abaqus make" command which is not powerful enough.
    Jorgen Bergstrom, Ph.D.
    PolymerFEM Administrator

  2. #2
    Join Date
    2007-09
    Location
    Molndal, Sweden
    Posts
    2

    Not working for thread-based parallelization

    Thank you for this post! It helped me a lot in identifying the reason for the strange error messages that I obtained when trying to use my vumat-routine with double precision accuracy.

    However, this solution is not completely stable for my application. It works well for single CPU-jobs and for multi CPU-jobs with MPI, but not when specifying mp_mode=threads. And since my application involves a 2D-plane strain case with large contact surfaces and finite sliding, it is necessary to use thread-based parallelization.

    For this particular case, the vumat routine produce incorrect results. My suspicion is that some type of memory conflict occurs during execution. But I can't find out what the underlying problem is, i.e. if it is my own coding or if it is Abaqus that behaves in the wrong way.

    Do anyone have a suggestion to what might be the problem?

    Regards,

    Martin

  3. #3
    Join Date
    2000-02
    Location
    Boston, USA
    Posts
    3,280
    Interesting. Have you tried to run your job on another computer architecture? Is the problem related to the number of CPUs that you use? Does the problem go away if you use one of the built-in material models?

    - Jorgen
    Jorgen Bergstrom, Ph.D.
    PolymerFEM Administrator

  4. #4
    Join Date
    2007-09
    Location
    Molndal, Sweden
    Posts
    2
    I tried it on a Linux architecture (OS:Linux 2.6.9-42.ELsmp (x86_64)) with cpus=1, 2, 3 and 4. As I wrote in the initial post, the above strategy only works for cpus=1.

    However, I solved the problem by adding the compiler flag -openmp to the line for compiling the source code (when using Intel Fortran Compiler for Linux). Perhaps rather intuitive but still worth mentioning. Now it works as it should!

    Thank you again for the valuable information.

    /Martin

  5. #5
    Join Date
    2000-02
    Location
    Boston, USA
    Posts
    3,280
    Thanks for the info! Have added the -openmp flag in the past in an effort to use openmp within the VUMAT block loop. So far I have not been able to make it work, however.

    I was able to use openmp with Abaqus/Standard but not Abaqus/Explicit. Do you have any ideas why?

    Thanks,
    Jorgen
    Jorgen Bergstrom, Ph.D.
    PolymerFEM Administrator

  6. #6
    Join Date
    2011-05
    Location
    Toronto
    Posts
    13

    Same Problem for UEL

    Hi Jorgen,

    I'm using User defined elements and I have a same problem. you have said "there is a way to compile your own shared VUMAT library by using a command like the following". where do you use this command? are you changing environmental variables? or do you type them directly in the command window?

    I would greatly appreciate your help. I have Abaqus 6.9, Visual studio 2008 and Intel FORTRAN 10.1 on my computer.

    Thanks,

  7. #7
    Join Date
    2000-02
    Location
    Boston, USA
    Posts
    3,280
    Hello Roshanak,

    For MS Windows: I put the long command in a bat-file, and then run the command by double-clicking the bat-file.
    For Linux: I put the command in a bash script file.

    Just make sure you have the environmental variables right for the compiler.

    -Jorgen
    Jorgen Bergstrom, Ph.D.
    PolymerFEM Administrator

  8. #8
    Quote Originally Posted by Jorgen View Post
    Thanks for the info! Have added the -openmp flag in the past in an effort to use openmp within the VUMAT block loop. So far I have not been able to make it work, however.

    I was able to use openmp with Abaqus/Standard but not Abaqus/Explicit. Do you have any ideas why?

    Thanks,
    Jorgen
    Hi Jorgen,
    Just wondering, did you ever have any success in using openmp with Abaqus/Explicit subroutines since you posted this? Seems like it would be a pretty interesting thing to be able to do...
    Thanks.

  9. #9
    Also I'll add that if you want more info on whats going on in the background when Abaqus is compiling and linking subroutines you can use the commands 'verbose=2' or 'verbose=3' when submitting analysis jobs, should give the same info as including echo statements in the environment file.

  10. #10
    Join Date
    2011-05
    Location
    Toronto
    Posts
    13
    Hi lumpwood:

    where should we put the commands 'verbose=2'? you mean at the submission step? sorry for my simple questions I just recently have started to work on abaqus.

    Thanks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •