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:
- From your host system, connect to the target system:ssh <user>@<target>
- In the SSH session, run the sample:tcc_multiple_measurements_sample --approximation 10000 --multiplication 100 --iterations 10where:OptionDescription--approximation 10000Calculate the 10000th approximation of 2/pi.--multiplication 100Execute the matrix multiplication workload with matrix size 100.--iterations 10Execute 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:
- 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 10where:Environment VariableDescriptionINTEL_LIBITTNOTIFY64=libtcc_collector.soEnable the measurement library collector.TCC_MEASUREMENTS_BUFFERS=Approximation:10,Multiplication:10,Cycle:10Enable measurement buffers for theApproximation,Multiplication, andCyclemeasurement instances to hold 10 measurements (same as the number oftcc_multiple_measurements_sampleiterations).TCC_MEASUREMENTS_DUMP_FILE=log.txtStore the measurement buffers inlog.txtafter the program finishes.TCC_MEASUREMENTS_TIME_UNIT=nsUse nanoseconds as the time unit for stored measurements.
- View the full measurement results after the sample finishes execution. Example dump filelog.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, 3092151where:
- 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.