## Not run: ------------------------------------
# # Set needed environment variables for multithreading. Only single threading
# # is used in the example.
# #
# # Note: The environment variables are usually set by the user before starting
# # the R programming environment; they are set here only to facilitate
# # a working example. See the section on multithreading in the vignette
# # for further details.
# Sys.setenv(R_BENCH_NUM_THREADS_VARIABLE="MKL_NUM_THREADS")
# Sys.setenv(MKL_NUM_THREADS="1")
# #
# # Generate example microbechmarks that can be run in a few minutes; see
# # the vignette for more involved examples. The Cholesky factorization and
# # matrix crossproduct microbenchmarks are performed in the example code
# # below.
# #
# # Note: These microbenchmarks are different than the microbenchmarks
# # generated by \code{\link{GetDenseMatrixDefaultMicrobenchmarks}}.
# # They are chosen for their short run times and suitability for
# # example code.
# exampleMicrobenchmarks <- GetDenseMatrixExampleMicrobenchmarks()
# # Set the output directory of the CSV summary results files
# resultsDirectory <- "./DenseMatrixExampleOutput"
# # Create the output directory
# dir.create(resultsDirectory)
# # Set an appropriate run identifier
# runIdentifier <- "example"
# resultsFrame <- RunDenseMatrixBenchmark(runIdentifier, resultsDirectory,
# microbenchmarks=exampleMicrobenchmarks)
#
# # This example runs all but the matrix transpose microbenchmarks.
# exampleMicrobenchmarks[["transpose"]]$active <- FALSE
# # Set an appropriate run identifier
# runIdentifier <- "no_transpose"
# exTransposeResultsFrame <- RunDenseMatrixBenchmark(runIdentifier,
# resultsDirectory, microbenchmarks=exampleMicrobenchmarks)
#
# # This example runs only the matrix-matrix multiplication microbenchmark,
# # and it adds a larger matrix to test.
# matMatMicrobenchmark <- list()
# matMatMicrobenchmark[["matmat"]] <- GetDenseMatrixExampleMicrobenchmarks()[["matmat"]]
# matMatMicrobenchmark[["matmat"]]$dimensionParameters <- as.integer(c(1000, 2000))
# matMatMicrobenchmark[["matmat"]]$numberOfTrials <- as.integer(c(3, 3))
# matMatMicrobenchmark[["matmat"]]$numberOfWarmupTrials <- as.integer(c(1, 1))
# # Set an appropriate run identifier
# runIdentifier <- "matmat"
# matMatResults <- RunDenseMatrixBenchmark(runIdentifier, resultsDirectory,
# microbenchmarks=matMatMicrobenchmark)
## ---------------------------------------------
Run the code above in your browser using DataLab