Developer Guide

  • 2021.2
  • 06/11/2021
  • Public
Contents

Run the Sample

You can run the sample to see how it behaves. In this scenario, the sample runs both workloads (matrix multiplication and 2/pi approximation) and takes measurements.
To run this example:
  1. From your host system, connect to the target system:
    ssh <user>@<target>
  2. In the SSH session
    , run the sample:
    tcc_multiple_measurements_sample --approximation 10000 --multiplication 100 --iterations 10
    where:
    Option
    Description
    --approximation 10000
    Calculate the 10000th approximation of 2/pi.
    --multiplication 100
    Execute the matrix multiplication workload with matrix size 100.
    --iterations 10
    Execute 10 iterations of the main loop.
Output Example
Running with arguments: approximation = 10000, multiplication = 100, iterations = 10 Running workloads. This may take a while, depending on iteration values. Workloads were run successfully.
The sample outputs the arguments with which it was launched and shows the status for running workloads.
The latency data is not displayed. To see the latency data and ways in which the measurements can be analyzed, you can run the sample with the Measurement Analysis Sample. Alternatively, the next section provides instructions for obtaining the full measurement log.

Accessing Full Measurement Log

To get access to the full measurement results, you can enable measurement buffers for the measurement instances and dump the data to a file.
To run this example:
  1. Run the following command to enable a measurement buffer for each measurement instance and a dump file:
    INTEL_LIBITTNOTIFY64=libtcc_collector.so TCC_MEASUREMENTS_BUFFERS=Approximation:10,Multiplication:10,Cycle:10 TCC_MEASUREMENTS_DUMP_FILE=log.txt TCC_MEASUREMENTS_TIME_UNIT=ns tcc_multiple_measurements_sample --approximation 10000 --multiplication 100 --iterations 10
    where:
    Environment Variable
    Description
    INTEL_LIBITTNOTIFY64=libtcc_collector.so
    Enable the measurement library collector.
    TCC_MEASUREMENTS_BUFFERS=Approximation:10,Multiplication:10,Cycle:10
    Enable measurement buffers for the
    Approximation
    ,
    Multiplication
    , and
    Cycle
    measurement instances to hold 10 measurements (same as the number of
    tcc_multiple_measurements_sample
    iterations).
    TCC_MEASUREMENTS_DUMP_FILE=log.txt
    Store the measurement buffers in
    log.txt
    after the program finishes.
    TCC_MEASUREMENTS_TIME_UNIT=ns
    Use nanoseconds as the time unit for stored measurements.
  2. View the full measurement results after the sample finishes execution. Example dump file
    log.txt
    :
    # cat log.txt Cycle: 3364473, 3312614, 3257750, 3245355, 3242705, 3246255, 3253702, 3243363, 3231469, 3229901 Approximation: 137256, 137205, 137217, 137115, 137215, 137203, 137144, 137186, 137182, 137124 Multiplication: 3225525, 3174715, 3119836, 3107700, 3104821, 3108388, 3115980, 3105529, 3093617, 3092151
    where:
    • Cycle – total execution time of the multiplication and approximation workloads and overhead contributed by measuring each of them separately.
    • Multiplication – execution time of the multiplication workload.
    • Approximation – execution time of the approximation workload.

Buffer Size Influence

When
TCC_MEASUREMENTS_BUFFERS
and
TCC_MEASUREMENTS_DUMP_FILE
are used, data is stored in a ring buffer and dumped to the specified file.
If the buffer size specified in
TCC_MEASUREMENTS_BUFFERS
is bigger than or equal to the number of iterations, all measured values will be stored and printed to the dump file.
If the buffer size specified in
TCC_MEASUREMENTS_BUFFERS
is smaller than the number of iterations, old values in the buffer will be overwritten, and only the last measured values equal to
TCC_MEASUREMENTS_BUFFERS
will be printed to the dump file. For example, if the number of iterations is 25 and
TCC_MEASUREMENTS_BUFFERS
is 3, only the last 3 measured values will be printed to the dump file.

Learn More

To learn more about the environment variables used in this sample, see Control Data Collection.
To further analyze the measurements, you can use the Measurement Analysis Sample.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.