Developer Reference

  • 2020.2
  • 07/15/2020
  • Public Content
Contents

Random Number Generators

Intel® MKL
VS provides a set of routines implementing commonly used pseudorandom, quasi-random, or non-deterministic random number generators with continuous and discrete distribution. To improve performance, all these routines were developed using the calls to the highly optimized Basic Random Number Generators (BRNGs) and vector mathematical functions (VM, see "Vector Mathematical Functions" ).
VS provides interfaces both for Fortran and C languages.
For users of the Fortran 90 or Fortran 95 language the
mkl_vsl.f90
header file is provided. The
mkl_vsl.fi
header file available in the previous versions of
Intel® MKL
is retained for backward compatibility.
All header files are found in the following directory:
${MKL}/include
The
mkl_vsl.f90
header is intended for use with the Fortran
include
clause and is compatible with both standard forms of F90/F95 sources - the free and 72-columns fixed forms. If you need to use the VS interface with 80- or 132-columns fixed form sources, you may add a new file to your project. That file is formatted as a 72-columns fixed-form source and consists of a single
include
clause as follows:
include 'mkl_vsl.f90'
This
include
clause causes the compiler to generate the module files
mkl_vsl.mod
and
mkl_vsl_type.mod
, which are used to process the Fortran use clauses referencing to the VS interface:
use mkl_vsl_type
use mkl_vsl
Because of this specific feature, you do not need to include the
mkl_vsl.f90
header into each source of your project. You only need to include the header into some of the sources. In any case, make sure that the sources that depend on the VS interface are compiled after those that include the header so that the module files
mkl_vsl.mod
and
mkl_vsl_type.mod
are generated prior to using them.
For the Fortran interface, VS provides both a subroutine-style interface and a function-style interface. The default interface in this case is a function-style interface. The function-style interface, unlike the subroutine-style interface, allows the user to get error status of each routine. The subroutine-style interface is provided for backward compatibility only. To use the subroutine-style interface, manually include
mkl_vsl_subroutine.fi
file instead of
mkl_vsl.f90
by changing the line
include 'mkl_vsl.f90'
in
include\mkl.fi
with the line
include 'mkl_vsl_subroutine.fi'
.
All VS routines can be classified into three major categories:
  • Transformation routines for different types of statistical distributions, for example, uniform, normal (Gaussian), binomial, etc. These routines indirectly call basic random number generators, which are pseudorandom, quasi-random, or non-deterministic random number generators. Detailed description of the generators can be found in Distribution Generators .
  • Service routines to handle random number streams: create, initialize, delete, copy, save to a binary file, load from a binary file, get the index of a basic generator. The description of these routines can be found in Service Routines .
  • Registration routines for basic pseudorandom generators and routines that obtain properties of the registered generators (see Advanced Service Routines ).
The last two categories are referred to as service routines.
Optimization Notice
Intel's compilers 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 SSE2, SSE3, and 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. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.
Notice revision #20110804
This notice covers the following instruction sets: SSE2, SSE4.2, AVX2, AVX-512.

Product and Performance Information

1

Intel's compilers 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 SSE2, SSE3, and 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. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804