Developer Reference

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

vslSkipAheadStreamEx

Initializes a stream using the block-splitting method with partitioned number of skipped elements.

Syntax

status
=
vslskipAheadstreamEx
(
stream
,
n
,
nskip
)
Include Files
  • mkl.fi
    ,
    mkl_vsl.f90
Input Parameters
Name
Type
Description
stream
TYPE(VSL_STREAM_STATE)
,
INTENT(IN)
Pointer to the stream state structure to which block-splitting method is applied
n
INTEGER
,
INTENT(IN)
Number of summands in
nskip
nskip
INTEGER(KIND=8)
,
INTENT(IN)
Partitioned number of skipped elements
Description
The
vslSkipAheadStreamEx
function skips a given number of elements in a random stream. This feature is particularly useful in distributing random numbers from original random stream across different computational nodes. If the largest number of random numbers used by a computational node is
nskip
, then the original random sequence may be split by
vslSkipAheadStreamEx
into non-overlapping blocks of
nskip
size so that each block corresponds to the respective computational node. The number of computational nodes is unlimited. This method is known as the block-splitting method or as the skip-ahead method. See Notes for Intel® MKL Vector Statisticsfor more details.
Use this function when the number of elements to skip in a random stream is greater than 2
63
. Prior calls to the function represent the number of skipped elements with array of size
n
as shown below:
nskip
[0]+
nskip
[1]*2
64
+
nskip
[2]* 2
128
+ … +
nskip
[n-1]*2
(64*(n-1) )
;
When the number of skipped elements is less than 2
63
you can use either
vslSkipAheadtreamEx
or
vslSkipAheadStream
. The following code illustrates how to initialize three independent streams using the
vslSkipAheadStreamEx
function:
... type(VSL_STREAM_STATE) ::stream1 type(VSL_STREAM_STATE) ::stream2 type(VSL_STREAM_STATE) ::stream3 ! Creating the 1st stream status = vslnewstream(stream1, VSL_BRNG_MRG32K3A, 174) ! To skip 2^64 elements in the random stream skipaheadstreamEx(nskip) function should ! be called with nskip represented as nskip = 2^64 = 0 + 1 * 2^64 integer(kind=8) nskip(2) nskip(1) = 0 nskip(2) = 1 ! Skipping ahead by 2^64 elements the 2nd stream status = vslcopystream(stream2, stream1) status = vslskipaheadstreamex (stream2, 2, nskip) ! Skipping ahead by 2^64 elements the 3rd stream status = vslcopystream(stream3, stream2) status = vslskipaheadstreamex (stream3, 2, nskip) ! Generating random numbers ... ! Deleting the streams status = vsldeletestream(stream1) status = vsldeletestream(stream2) status = vsldeletestream(stream3) ...
Return Values
VSL_ERROR_OK
,
VSL_STATUS_OK
Indicates no error, execution is successful.
VSL_ERROR_NULL_PTR
stream
is a
NULL
pointer.
VSL_RNG_ERROR_BAD_STREAM
stream
is not a valid random stream.
VSL_RNG_ERROR_SKIPAHEADEX_UNSUPPORTED
BRNG does not support the advanced Skip-Ahead method.

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