Intel® MPI Library
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.
2292 Discussions

LNK2019 Unresolved External Symbol Error when using MPI_Bcast in Abaqus Subroutine

hldgc
Beginner
366 Views

Hello everyone,

I am currently working on compiling a Fortran user subroutine (VDFLUX) for Abaqus/Explicit. My goal is to share the same array across multiple CPU cores and subroutines during the analysis.

To achieve this, I included the mpif.h statement in my subroutine to call the MPI_Bcast function. Here is a simplified snippet of my code:

    SUBROUTINE VDFLUX (
C Read only (unmodifiable)variables -
     1 nblock, ndim, kStep, kIncr, stepTime, totalTime, jUid,
     2 amplitude, temp, curCoords, velocity, dirCos, jltyp, sname,
C Write only (modifiable) variable -
     1 value )
      use ktransfer
      include 'vaba_param.inc'
      include 'mpif.h'
      ......
      PARAMS(1) = T_avg
      PARAMS(2) = T_TARGET
      PARAMS(4) = P_PREHEAT
      PARAMS(5) = kIncr
      PARAMS(11+KPROCESSNUM) = T_avg
      ABA_COMM_WORLD = GETCOMMUNICATOR()
      
      if (ABA_COMM_WORLD .ne. 0) then
        call MPI_Bcast(PARAMS, 24, MPI_DOUBLE_PRECISION, 0, 
     1    ABA_COMM_WORLD, ierr)
      end if

However, during the linking phase, I received the following error message:

    End Compiling Double Precision Abaqus/Explicit User Subroutines
    Begin Linking Double Precision Abaqus/Explicit User Subroutines
       Creating library explicitU-D.lib and object explicitU-D.exp 
    subroutines.obj : error LNK2019: unresolved external symbol mpi_bcast referenced in function vdflux.R
    subroutines.obj : error LNK2001: unresolved external symbol mpi_dup_fn 
    subroutines.obj : error LNK2001: unresolved external symbol mpi_null_delete_fn
    subroutines.obj : error LNK2001: unresolved external symbol mpi_null_copy_fn
    subroutines.obj : error LNK2001: unresolved external symbol mpi_comm_dup_fn 
    subroutines.obj : error LNK2001: unresolved external symbol mpi_comm_null_delete_fn
    subroutines.obj : error LNK2001: unresolved external symbol mpi_comm_null_copy_fn
    subroutines.obj : error LNK2001: unresolved external symbol mpi_win_dup_fn 
    subroutines.obj : error LNK2001: unresolved external symbol mpi_win_null_delete_fn
    subroutines.obj : error LNK2001: unresolved external symbol mpi_win_null_copy_fn
    subroutines.obj : error LNK2001: unresolved external symbol mpi_type_dup_fn
    subroutines.obj : error LNK2001: unresolved external symbol mpi_type_null_delete_fn 
    subroutines.obj : error LNK2001: unresolved external symbol mpi_type_null_copy_fn
    subroutines.obj : error LNK2001: unresolved external symbol mpi_conversion_fn_null
    explicitU-D.dll : fatal error LNK1120: 14 unresolved externals 
    Abaqus Error: Problem during linking - Double Precision Abaqus/Explicit 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

I have tried my best to search for a solution on Google and various forums, but I haven't been able to find a clear answer on how to resolve this linking issue within the Abaqus environment.

Has anyone successfully linked MPI commands inside an Abaqus Explicit subroutine? Any guidance on how to modify the environment file or link the correct libraries would be greatly appreciated!

Thank you very much for your time and help.

0 Kudos
0 Replies
Reply