User guide
6–SHMEM Description and Configuration
SHMEM Programs
IB0054606-02 A 6-5
-Wl,--export-dynamic,--allow-shlib-undefined
-L $SHMEM_DIR/lib64/default
-lqlogic_shmem
Where $SHMEM_DIR in both of the options denotes the top-level directory of
the SHMEM installation, typically the directory is /usr/shmem/qlogic.
The -L option uses the default version of the SHMEM libraries. The default
is actually a symbolic link to libraries built for a specific MPI implementation.
However, this choice does not constrain the SHMEM binary, and it can be
run over any of the supported MPIs.
The rationale for the -Wl, --export-dynamic,
--allow-shlib-undefined options are to prevent other library and symbol
dependencies in the SHMEM library from percolating up into the application
binaries. These symbols include those from the underlying MPI implementation.
There is no need to couple the application binary to a particular MPI, and these
symbols will be correctly resolved at run-time. The advantage of this approach is
that SHMEM application binaries will be portable across different implementations
of the QLogic SHMEM library, including portability over different underlying MPIs.
Running SHMEM Programs
Using shmemrun
The shmemrun script is a wrapper script for running SHMEM programs using
mpirun. The main purpose of the script is to call mpirun with additional options
to specify the SHMEM library directory so that its dynamic libraries can be
resolved. The script detects which mpirun is being used and remaps some
common mpirun options to present a convenient and consistent interface to
SHMEM users. Additionally, it enables PSM support in the underlying mpirun if
required, and auto-propagates PSM, IPATH and SHMEM environment variables
to the MPI processes. The shmemrun script automatically determines the correct
directories by finding them relative to its own location. The shmemrun script can
only automatically determine the correct directories if the standard directory layout
of the QLogic SHMEM software has not been changed.
NOTE
If the SHMEM RPM is installed with --prefix=usr then the -I option is
not necessary since the header files are in system default locations. All of
the linkage options are still required.