Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

MPI application portable?

jinliang_w_
Beginner
823 Views

Hi there,

My fortran code uses MPI, with all MPI lines prefixed with !$ for conditional compilation. Compiling the code using ifort on a Linux cluster, with command lines:

ifort -O2 -ip -ipo -inline-factor=100 -unroll-aggressive -openmp -o a.out *.f90

mpif90 -O2 -ip -ipo -inline-factor=100 -unroll-aggressive -openmp -o a-mpi.out *.f90

I got 2 binaries, a.out and a-mpi.out, which both work fine on the cluster. However, when they are tested by my colleague on his Linux machine, he had no problem with a.out, but had an error message

./a.out: error while loading shared libraries: libmpichf90nc.so.2: cannot open shared object file: No such file or directory

with a-mpi.out. It seems the library libmpichf90nc.so.2 is needed for run using MPI. When he tested the binary again with the library libmpichf90nc.so.2 provided by me, he got another different error message

'a_mpi.out: error while loading shared libraries: libmpichf90nc.so.2: invalid ELF header'

Can you kindly help me out of the problem?

 

Thanks a lot!

0 Kudos
4 Replies
TimP
Honored Contributor III
823 Views
A fairly obvious suspect would be a different target 32/64 bit or linux mac. Attempting to support 32 bit mpi is probably more trouble than value.I
0 Kudos
jinliang_w_
Beginner
823 Views

Thnaks for the reply, Tim!

Both machines have 64bit Linux, but of different distro. One is scientific, the other is Ubunto.

0 Kudos
TimP
Honored Contributor III
823 Views

You should check also that ifort Intel64 and gcc [-m64] were in use throughout, both for the mpich build and for the application.

I'm not entirely certain about compatibility of .so built on scientific vs. Ubuntu.  The biggest difference is in the library paths, so if you have any of those in your build, adjustments are needed.

I wondered why you described removing MPI from your build by conditional compilation, if you are linking against MPI in the end.

0 Kudos
jinliang_w_
Beginner
823 Views

Thank you very much, Tim! I will have a check tomorrow as I cannot get access to the Linux machine today.

0 Kudos
Reply