Linking with ScaLAPACK and Cluster FFTs

The Intel MKL ScaLAPACK and Cluster FFTs support MPI implementations identified in the Intel MKL Release Notes.

To link a program that calls ScaLAPACK or Cluster FFTs, you need to know how to link a message-passing interface (MPI) application first.

Use mpi scripts to do this. For example, mpicc or mpif77 are C or FORTRAN 77 scripts, respectively, that use the correct MPI header files. The location of these scripts and the MPI library depends on your MPI implementation. For example, for the default installation of MPICH, /opt/mpich/bin/mpicc and /opt/mpich/bin/mpif77 are the compiler scripts and /opt/mpich/lib/libmpich.a is the MPI library.

Check the documentation that comes with your MPI implementation for implementation-specific details of linking.

To link with Intel MKL ScaLAPACK and/or Cluster FFTs, use the following general form :

<<MPI> linker script> <files to link>                          \
-L <MKL path> [-Wl,--start-group] <MKL cluster library>        \
<BLACS> <MKL core libraries> [-Wl,--end-group]

where the placeholders stand for paths and libraries as explained in the following table:

<MKL cluster library>

One of ScaLAPACK or Cluster FFT libraries for the appropriate architecture and programming interface (LP64 or ILP64). Available libraries are listed in Directory Structure in Detail. For example, for the IA-32 architecture, it is either -lmkl_scalapack_core or -lmkl_cdft_core.

<BLACS>

The BLACS library corresponding to your architecture, programming interface (LP64 or ILP64), and MPI version. Available BLACS libraries are listed in Directory Structure in Detail. For example, for the IA-32 architecture, choose one of -lmkl_blacs, -lmkl_blacs_intelmpi, or -lmkl_blacs_openmpi, depending on the MPI version you use; specifically, for Intel MPI 3.x, choose -lmkl_blacs_intelmpi.

<MKL core libraries>

<MKL LAPACK & MKL kernel libraries> for ScaLAPACK, and <MKL kernel libraries> for Cluster FFTs.

<MKL kernel libraries>

Processor optimized kernels, threading library, and system library for threading support, linked as described in Listing Libraries on a Link Line.

<MKL LAPACK & kernel libraries>

The LAPACK library and <MKL kernel libraries>.

<MPI>

One of several MPI implementations (MPICH, Intel MPI, and so on).

<<MPI> linker script>

A linker script that corresponds to the MPI version. For instance, for Intel MPI 3.x, use <Intel MPI 3.x linker script>.

For example, if you are using Intel MPI 3.x, want to statically use the LP64 interface with ScaLAPACK, and have only one MPI process per core (and thus do not use threading), specify the following linker options:

-L$MKLPATH -I$MKLINCLUDE -Wl,--start-group $MKLPATH/libmkl_scalapack_lp64.a $MKLPATH/libmkl_blacs_intelmpi_lp64.a $MKLPATH/libmkl_intel_lp64.a $MKLPATH/libmkl_sequential.a $MKLPATH/libmkl_core.a -static_mpi -Wl,--end-group -lpthread -lm

Note iconNote

Grouping symbols -Wl,--start-group and -Wl,--end-group are required for static linking.

Tip iconTip

Use the Web-based Link Line Advisor to quickly choose the appropriate set of <MKL cluster Library>, <BLACS>, and <MKL core libraries>.

Optimization Notice

Intel® compilers, associated libraries and associated development tools may include or utilize options that optimize for instruction sets that are available in both Intel® and non-Intel microprocessors (for example SIMD instruction sets), but do not optimize equally for non-Intel microprocessors. In addition, certain compiler options for Intel compilers, including some that are not specific to Intel micro-architecture, are reserved for Intel microprocessors. For a detailed description of Intel compiler options, including the instruction sets and specific microprocessors they implicate, please refer to the "Intel® Compiler User and Reference Guides" under "Compiler Options". Many library routines that are part of Intel® compiler products are more highly optimized for Intel microprocessors than for other microprocessors. While the compilers and libraries in Intel® compiler products offer optimizations for both Intel and Intel-compatible microprocessors, depending on the options you select, your code and other factors, you likely will get extra performance on Intel microprocessors.

Intel® compilers, associated libraries and associated development tools may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include Intel® Streaming SIMD Extensions 2 (Intel® SSE2), Intel® Streaming SIMD Extensions 3 (Intel® SSE3), and Supplemental Streaming SIMD Extensions 3 (Intel® SSSE3) instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors.

While Intel believes our compilers and libraries are excellent choices to assist in obtaining the best performance on Intel® and non-Intel microprocessors, Intel recommends that you evaluate other compilers and libraries to determine which best meet your requirements. We hope to win your business by striving to offer the best performance of any compiler or library; please let us know if you find we do not.

Notice revision #20110307

See Also


Submit feedback on this help topic