PDA

View Full Version : How to compile an ABAQUS vumat double precision shared library


Jorgen
2007-09-04, 04:38
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:

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:

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.

fagmar
2008-05-23, 07:28
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

Jorgen
2008-05-24, 18:56
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

fagmar
2008-05-26, 02:37
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

Jorgen
2008-05-26, 04:05
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