Skip to content

Commit 608a7bc

Browse files
author
David Wootton
committed
Update Open MPI FAQ debugging page to describe MPIR shim usage
Resolve review comments Signed-off-by: David Wootton <dwootton@us.ibm.com>
1 parent ff62b05 commit 608a7bc

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed

docs/faq/debugging.rst

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,3 +577,99 @@ line:
577577
More information on suppression-files and how to generate them can be
578578
found in `Valgrind's documentation
579579
<https://valgrind.org/docs/manual/manual-core.html#manual-core.suppress>`_.
580+
581+
/////////////////////////////////////////////////////////////////////////
582+
583+
How to use MPIR-based tools with Open MPI
584+
---------------------------------------------------------------
585+
586+
A shim module is available for use with debuggers and tools which rely on the
587+
`MPIR specification <https://www.mpi-forum.org/docs/mpir-specification-03-01-2018.pdf>`_
588+
to access application process mappings.
589+
590+
The source code for this shim module can be downloaded from
591+
`MPIR to PMIx Shim repository <https://github.com/openpmix/mpir-to-pmix-guide>`_.
592+
593+
Instructions for use of the shim module are available at
594+
`<https://github.com/openpmix/mpir-to-pmix-guide/blob/master/README.md>`_.
595+
596+
/////////////////////////////////////////////////////////////////////////
597+
598+
Verification of MPIR shim functionality using Open MPI
599+
---------------------------------------------------------------
600+
601+
Correct operation of the MPIR shim layer with Open MPI can be verified by
602+
following these instructions.
603+
604+
* Build a current version of Open MPI and install it into a sub-directory of the
605+
test directory, for instance, ``/home/shim_test/ompi``. The build should use the
606+
versions of PMIX and PRRTE included with Open MPI. The configure
607+
``--with-pmix``, ``-with-prrte``, ``--with-pmix-libdir`` and
608+
``--with-prrte-libdir`` flags should not be used.
609+
610+
* Clone the mpir-to-pmix-guide Github repository into the test directory by
611+
running ``git clone git@github.com:openpmix/mpir-to-pmix-guide.git``.
612+
613+
* Change the directory to the directory the MPIR shim code was cloned into,
614+
for instance ``/home/shim_test/mpir-to-pmix-guide``.
615+
616+
* Generate the configuration files by running ``./autogen.sh``.
617+
618+
* Run the configure step, specifying the test shim install directory and the
619+
location of the PMIX runtime. For instance
620+
``./configure --prefix=/home/shim_test --with-pmix=/home/shim_test/ompi
621+
--with-pmix-libdir=/home/shim_test/ompi/lib``.
622+
623+
* Run the ``make`` and ``make install`` commands.
624+
625+
* Change the directory back to the top-level test directory (``/home/shim_test``).
626+
627+
* Set the following environment variables:
628+
629+
.. code-block:: sh
630+
631+
export MPI_ROOT=/home/shim_test/ompi
632+
export PATH=/home/shim_test/bin:$MPI_ROOT/bin:$PATH
633+
export LD_LIBRARY_PATH=/home/shim_test/lib:$MPI_ROOT/lib:$LD_LIBRARY_PATH
634+
635+
* Change the directory to the test directory where the MPIR shim build created
636+
the test driver program. For instance ``/home/shim_test/mpir-to-pmix-guide/test``.
637+
638+
* Create the following test program, ``testprog.c``. The duration of the sleep can
639+
be modified to whatever value suspends the test target program long enough
640+
for you to attach to running mpirun processes:
641+
642+
.. code-block:: sh
643+
644+
#include <mpi.h>
645+
#include <unistd.h>
646+
647+
void main(int argc, char **argv) {
648+
MPI_Init(&argc, &argv);
649+
sleep(60);
650+
MPI_Finalize();
651+
}
652+
653+
* Compile the target test program, for instance ``mpicc -o testprog testprog.c``
654+
655+
* Run the shim test program in Proxy Mode,
656+
``mpirshim_test mpirun -n 2 ./testprog``.
657+
658+
* The test program should display output including one line for each application
659+
task showing task rank, execution node, executable path, and application task
660+
PID.
661+
662+
* To run the test program in Attach Mode, first invoke ``mpirun`` as
663+
``mpirun -n 2 ./testprog`` and note the PID displayed, which is the PID of
664+
the ``mpirun`` process.
665+
666+
* Then run the shim test program as ``mpirshim_test -c <pid>`` where ``<pid>`` is
667+
the PID of the ``mpirun`` program.
668+
669+
* The test program should display output including one line for each application
670+
task showing task rank, execution node, executable path, and application task
671+
PID.
672+
673+
* Note that if you modify the test program to write output to ``stdout`` or ``stderr``,
674+
that output will not be displayed when the program is run in Proxy mode
675+
since the ``mpirshim_test`` program does not forward application ``stdio`` output.

0 commit comments

Comments
 (0)