# peakflops

``````..  peakflops(n; parallel=false)

``peakflops`` computes the peak flop rate of the computer by using double precision :func:`Base.LinAlg.BLAS.gemm!`. By default, if no arguments are specified, it multiplies a matrix of size ``n x n``, where ``n = 2000``. If the underlying BLAS is using multiple threads, higher flop rates are realized. The number of BLAS threads can be set with ``blas_set_num_threads(n)``.

If the keyword argument ``parallel`` is set to ``true``, ``peakflops`` is run in parallel on all the worker processors. The flop rate of the entire parallel computer is returned. When running in parallel, only 1 BLAS thread is used. The argument ``n`` still refers to the size of the problem that is solved on each processor.``````

## Examples

``peakflops(n; parallel=false)``

The `peakflops` function computes the peak flop rate of the computer by using double precision `gemm!` function from `Base.LinAlg.BLAS`. By default, if no arguments are specified, it multiplies a matrix of size `n x n`, where `n = 2000`. If the underlying BLAS is using multiple threads, higher flop rates are realized. The number of BLAS threads can be set with `blas_set_num_threads(n)`.

If the keyword argument `parallel` is set to `true`, `peakflops` is run in parallel on all the worker processors. The flop rate of the entire parallel computer is returned. When running in parallel, only 1 BLAS thread is used. The argument `n` still refers to the size of the problem that is solved on each processor.

Examples:

1. Default usage:

``````julia> peakflops()
1.036e12``````

This example computes the peak flop rate by multiplying a default `2000 x 2000` matrix.

2. Specify custom matrix size:

``````julia> peakflops(1000)
2.321e11``````

It computes the peak flop rate by multiplying a `1000 x 1000` matrix.

3. Run in parallel:
``````julia> peakflops(2000, parallel=true)
4.145e11``````

It runs `peakflops` in parallel on all worker processors and returns the flop rate of the entire parallel computer.

Note: The actual peak flop rate may vary depending on the hardware and system configuration.