Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] VampirTrace and MPI_Init_thread()
From: Matthias Jurenz (matthias.jurenz_at_[hidden])
Date: 2010-08-16 05:10:33


On Saturday 14 August 2010 00:10:49 Lisandro Dalcin wrote:
> On 13 August 2010 05:22, Matthias Jurenz <matthias.jurenz_at_[hidden]>
wrote:
> > On Wednesday 11 August 2010 23:16:50 Lisandro Dalcin wrote:
> >> On 11 August 2010 03:12, Matthias Jurenz <matthias.jurenz_at_[hidden]>
> >
> > wrote:
> >> > Hello Lisandro,
> >> >
> >> > this problem will be fixed in the next Open MPI release. There was an
> >> > obsolete preprocessor condition around the MPI_Init_thread wrapper, so
> >> > the source code could never be compiled :-(
> >> >
> >> > Thanks for the hint.
> >> >
> >> > Matthias
> >>
> >> OK. Many thanks for you clarification.
> >>
> >> BTW, I have and additional issue. I'm trying to build as shared
> >> library from libvt*.a using by passing -whole-archive to the linker.
> >> The idea behind this is to use that library with LD_PRELOAD to get MPI
> >> tracing of a binary compiled with plain mpicc (i.e, not mpicc-vt). For
> >> example, I managed to get this trick working with MPE. Moreover, I can
> >> enable MPI profiling at runtime in a Python script using mpi4pt by
> >> dlopen'ing the shared lib with profiling symbols before loading the
> >> mpi4py.MPI Python extension module. Being able to profile without a
> >> recompile is nice ;-)
> >>
> >> However, see this:
> >>
> >> $ pwd
> >> /usr/local/openmpi/1.4.2/lib
> >>
> >> $ ll libvt*
> >> -rw-r--r--. 1 root root 410784 2010-05-05 20:40 libvt.a
> >> -rw-r--r--. 1 root root 197618 2010-05-05 20:40 libvt.fmpi.a
> >> -rw-r--r--. 1 root root 569128 2010-05-05 20:40 libvt.mpi.a
> >> -rw-r--r--. 1 root root 503514 2010-05-05 20:40 libvt.omp.a
> >> -rw-r--r--. 1 root root 661466 2010-05-05 20:40 libvt.ompi.a
> >>
> >> $ nm libvt* | grep pomp_rd_table
> >> U pomp_rd_table
> >> U pomp_rd_table
> >> U pomp_rd_table
> >> U pomp_rd_table
> >> U pomp_rd_table
> >> U pomp_rd_table
> >> U pomp_rd_table
> >> U pomp_rd_table
> >> U pomp_rd_table
> >> U pomp_rd_table
> >>
> >> That symbol (and possibly others) are undefined and I cannot found
> >> them elsewhere. Is there any easy way to build a shared lib with the
> >> MPI_xxx symbols?
> >
> > Actually, the symbols above will be defined at compile/link time of the
> > application by the OpenMP instrumentor "OPARI".
> > However, while your application doesn't use OpenMP it should work to
> > define the missing symbols in a separate source file (see attachment)
> > when building the shared library:
> >
> > gcc -fPIC -I<mpi-includedir>/vampirtrace -shared missing_syms.c -o
> > libvt.mpi.so -Wl,--whole-archive <mpi-libdir>/libvt.mpi.a <mpi-
> > libdir>/libotf.a -Wl,--no-whole-archive -ldl -lz -L<mpi-libdir> -lmpi
>
> OK. Many thanks for the hint.
>
> I was able to build a shared lib, dlopen() it at runtime and get MPI
> traces from Python scripts without need of recompiles with mpicc-vt.
> Sweet!
>
> > FYI, the next Open MPI 1.5 will come with a newer VampirTrace which
> > provides shared libraries by default.
>
> Nice! ... Perhaps Open MPI mpiexec's could gain a -vt flag to enable
> traces at runtime (should be easy to implement with LD_PRELOAD,
> right?)...

We plan to provide the script "vtpreload.sh" in future releases of VampirTrace
which can be prepended to the application executable, like:

        mpirun -np 2 vtpreload.sh <binary>

In addition to preloading the VT library to get the MPI functions, the
script will be capable to instrument almost each other function by using
binary instrumentation. Furthermore, it will do some nm/ldd magic to determine
the suitable VT library to preload.

An additional '-vt' flag for mpirun sounds good. This flags could also receive
some options for the vtpreload script.

>
> BTW, I understand Open MPI 1.5 VT will have the MPI_Init_thread()
> issue fixed. Any chance for v1.4 series?
>

Yes, it will be fixed in Open MPI 1.4.3, too.

Matthias



  • application/pkcs7-signature attachment: smime.p7s