Intel® Math Kernel Library for Linux* Developer Guide Intel® MKL2020 - Linux* Revision: 068 Legal Information Intel® Math Kernel Libraryfor Linux* Developer Guide Contents Notices and Disclaimers....................................................................... 6 Getting Help and Support..................................................................... 7 Introducing the Intel® Math Kernel Library .......................................... 8 What's New ....................................................................................... 10 Notational Conventions...................................................................... 11 Related Information .......................................................................... 12 Chapter 1: Getting Started Checking Your Installation ........................................................................ 13 Setting Environment Variables................................................................... 13 Scripts to Set Environment Variables ................................................. 14 Modulefiles to Set Environment Variables ........................................... 15 Automating the Process ................................................................... 15 Compiler Support .................................................................................... 16 Using Code Examples............................................................................... 16 Before You Begin Using the Intel(R) Math Kernel Library ............................... 16 Chapter 2: Structure of the Intel(R) Math Kernel Library Architecture Support................................................................................ 19 High-level Directory Structure ................................................................... 19 Layered Model Concept ............................................................................ 20 Chapter 3: Linking Your Application with the Intel(R) Math Kernel Library Linking Quick Start .................................................................................. 22 Using the -mkl Compiler Option ........................................................ 22 Using the Single Dynamic Library ...................................................... 23 Selecting Libraries to Link with.......................................................... 23 Using the Link-line Advisor ............................................................... 24 Using the Command-line Link Tool..................................................... 24 Linking Examples .................................................................................... 25 Linking on IA-32 Architecture Systems............................................... 26 Linking on Intel(R) 64 Architecture Systems ....................................... 27 Linking in Detail ...................................................................................... 28 Listing Libraries on a Link Line .......................................................... 28 Dynamically Selecting the Interface and Threading Layer...................... 29 Linking with Interface Libraries ......................................................... 30 Using the ILP64 Interface vs. LP64 Interface .............................. 30 Linking with Fortran 95 Interface Libraries.................................. 32 Linking with Threading Libraries ........................................................ 32 Linking with Computational Libraries.................................................. 34 Linking with Compiler Run-time Libraries............................................ 35 Linking with System Libraries............................................................ 35 Building Custom Shared Objects................................................................ 36 Using the Custom Shared Object Builder ............................................ 36 Composing a List of Functions .......................................................... 38 Specifying Function Names............................................................... 38 Distributing Your Custom Shared Object ............................................. 39 2 Contents Chapter 4: Managing Performance and Memory Improving Performance with Threading ...................................................... 40 OpenMP* Threaded Functions and Problems ....................................... 40 Functions Threaded with Intel® Threading Building Blocks ..................... 42 Avoiding Conflicts in the Execution Environment .................................. 43 Techniques to Set the Number of Threads........................................... 44 Setting the Number of Threads Using an OpenMP* Environment Variable ..................................................................................... 44 Changing the Number of OpenMP* Threads at Run Time....................... 45 Using Additional Threading Control .................................................... 47 Intel® MKL-specific Environment Variables for OpenMP Threading Control .............................................................................. 47 MKL_DYNAMIC ....................................................................... 48 MKL_DOMAIN_NUM_THREADS.................................................. 49 MKL_NUM_STRIPES .................................................................... 50 Setting the Environment Variables for Threading Control .............. 51 Calling Intel® MKL Functions from Multi-threaded Applications ............... 52 Using Intel® Hyper-Threading Technology ........................................... 53 Managing Multi-core Performance...................................................... 54 Improving Performance for Small Size Problems ......................................... 55 Using MKL_DIRECT_CALL in C Applications ......................................... 55 Using MKL_DIRECT_CALL in Fortran Applications ................................. 56 Limitations of the Direct Call ............................................................ 57 Other Tips and Techniques to Improve Performance ..................................... 57 Coding Techniques .......................................................................... 57 Improving Intel(R) MKL Performance on Specific Processors.................. 58 Operating on Denormals .................................................................. 58 Using Memory Functions........................................................................... 59 Memory Leaks in Intel® MKL ............................................................. 59 Using High-bandwidth Memory with Intel® MKL ................................... 59 Redefining Memory Functions ........................................................... 60 Chapter 5: Language-specific Usage Options Using Language-Specific Interfaces with Intel(R) Math Kernel Library ............. 61 Interface Libraries and Modules......................................................... 61 Fortran 95 Interfaces to LAPACK and BLAS ......................................... 63 Compiler-dependent Functions and Fortran 90 Modules ........................ 63 Mixed-language Programming with the Intel Math Kernel Library ................... 64 Calling LAPACK, BLAS, and CBLAS Routines from C/C++ Language Environments ............................................................................. 64 Using Complex Types in C/C++......................................................... 65 Calling BLAS Functions that Return the Complex Values in C/C++ Code.. 66 Chapter 6: Obtaining Numerically Reproducible Results Getting Started with Conditional Numerical Reproducibility ........................... 70 Specifying Code Branches......................................................................... 71 Reproducibility Conditions......................................................................... 73 Setting the Environment Variable for Conditional Numerical Reproducibility ..... 73 Code Examples ....................................................................................... 74 Chapter 7: Coding Tips Example of Data Alignment....................................................................... 77 Using Predefined Preprocessor Symbols for Intel® MKL Version-Dependent Compilation ........................................................................................ 78 3 Intel® Math Kernel Libraryfor Linux* Developer Guide Chapter 8: Managing Output Using Intel® MKL Verbose Mode ................................................................. 80 Version Information Line .................................................................. 80 Call Description Line ........................................................................ 81 Chapter 9: Working with the Intel® Math Kernel Library Cluster Software Linking with Intel® MKL Cluster Software .................................................... 84 Setting the Number of OpenMP* Threads.................................................... 85 Using Shared Libraries ............................................................................. 86 Setting Environment Variables on a Cluster................................................. 86 Interaction with the Message-passing Interface ........................................... 87 Using a Custom Message-Passing Interface ................................................. 88 Examples of Linking for Clusters................................................................ 88 Examples for Linking a C Application.................................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages127 Page
-
File Size-