Jeff,

thanks for your answer on this.

> Sorry for the delay.

No problem. Better delayed than never. ;-)

> Which version of Open MPI are you referring to? I'm offline at the
> moment, and I think you're referring to the OMPI 1.6 series -- I'm
> pretty sure we renamed these libraries in the 1.7/1.8 series, to
> something like libmpi_mpifh, libmpi_usmpi (respectively), and
> libmpi_usempif08.

As far as I know, the concrete example where we investigated this was on
a Fujitsu system, and I think they base their MPI on OpenMPI. As I don't
think they re-base frequently, it is very likely that it is based on a
1.6 or earlier OpenMPI.

>> in the Score-P measurement system, we'd like to use the Fortran wrapper
>> libraries provided with Open-MPI rather than our own. When checking the
>> library directory we found:
>>
>> libmpi_f77.so
>> libmpi_f90.so
>>
>> Our questions are:
>> - Does it matter which one of the libraries we link with the application?
> 
> Yes.
> 
>> - Does the first correspond to mpif77 and the second to mpif90?
> 
> No.  Also note that in OMPI 1.7/1.8, we have renamed the Fortran
> wrapper to be mpifort -- mpif77 and mpif90 are sym links to mpifort
> provided simply for backwards compatibility.

Thanks for the heads up. Complicates our configuration a little but good
to know. ;-)

> mpifort acts identically, regardless of whether it is invoked by the
> name "mpif77" or "mpif90" or "mpifort".
>
> In the 1.7/1.8 series, we link in all the Fortran libraries when you
> invoke mpifort, which allows you to use any of the 3 MPI Fortran
> interfaces (mpif.h, the mpi module, and the mpi_f08 module).  This
> is, of course, tempered by what you built and installed -- e.g., if
> you're using an old version of gfortran, the libmpi_usempif08 library
> won't be built, and therefore won't be linked in by mpifort, and "use
> mpi_f08" in applications will fail to compile.

Ok. Is there a required order for those three libraries?

>> - Is there a best practice as to what to put on the link line?
> 
> You don't need to list any MPI libraries on the mpifort (or mpif77 or
> mpif90 -- even back in the v1.6 series) command line.  You can just:
> 
>  mpifort my_awesome_fortran_mpi_app.f90 -o foo
> 
> And OMPI will link in the appropriate libraries for you.  That's why
> we felt comfortable changing the Fortran library names in the
> v1.7/v1.8 series.

Score-P needs to get our C-wrappers inbetween your link line, though.

As far as I understand, the order needs to be:

mpifort user_code.f90 -o foo <ompi_fortran_wrappers> <scorep-c-wrappers>
<ompi_mpi_libs>

Right?

The user code generates unresolved symbols that are satisfied by the
fortran wrappers of OMPI. They in turn generate unresolved symbols to
the C functions, then intercepted by the Score-P wrappers, in turn
generating unresolved symbols to the core MPI functions, which are
satisfied by the rest of the OMPI link line.

Therefore, we need to know which libraries need to go where.

Cheers,
Marc-Andre

-- 
Marc-Andre Hermanns
Jülich Aachen Research Alliance,
High Performance Computing (JARA-HPC)
German Research School for Simulation Sciences GmbH

Schinkelstrasse 2
52062 Aachen
Germany

Phone: +49 241 80 99753
Fax: +49 241 80 6 99753
www.grs-sim.de/parallel
email: m.a.herma...@grs-sim.de

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to