Skip to content

Commit fb70b46

Browse files
authored
Merge pull request #23 from JuliaPerf/MPI-integration
New paper version
2 parents 8fb7c8b + 38b7582 commit fb70b46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1591
-561
lines changed

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CountFlops = "1db9610d-79e1-487a-8d40-77f3295c7593"
1010
CpuId = "adafc99b-e345-5852-983c-f28acb93d879"
1111
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
1212
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
13+
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
1314
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1415
MLStyle = "d8e11817-5142-5d16-987a-aa16d5891078"
1516
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"

README.md

Lines changed: 89 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,99 @@
1-
# PerfTest
1+
# PerfTest.jl - A performance unit testing framework
2+
3+
NOTE: This package is under active development, bugs may lurk around, if a bug is found please raise an issue so it can be adressed. Thanks :)
24

35
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaPerf.github.io/PerfTest.jl/stable)
46
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaPerf.github.io/PerfTest.jl/dev)
57
[![CI](https://github.com/JuliaPerf/PerfTest.jl/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/JuliaPerf/PerfTest.jl/actions/workflows/CI.yml?query=branch%3Amain)
68
[![Coverage](https://codecov.io/gh/JuliaPerf/PerfTest.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaPerf/PerfTest.jl)
79

8-
> :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: This repository is under construction :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction:
10+
The package PerfTest provides the user with a performance regression unit testing framework. This package is focused on providing a simple and fast way to develop performance suites, with additional features to customise them for more comprehensice use cases.
11+
12+
## Basic performance evaluation
13+
14+
PerfTest.jl provides a set of macros to provide declarative instructions to the performance testing suit generator. A simple case will be shown here.
15+
16+
```julia
17+
module VecOps
18+
function innerProduct(A , B)
19+
@assert length(A) == length(B)
20+
21+
r = 0.
22+
23+
for i in eachindex(A)
24+
r += A[i] * B[i]
25+
end
26+
27+
return r
28+
end
29+
end
30+
```
31+
32+
In this basic example, we are implementing a inner product function as part of a bigger vector operation package. We are interested in evaluating the performance of that product, the following test file is a recipe to do so:
33+
34+
35+
```julia
36+
using Test, PerfTest
37+
38+
# Disable regression enable verbosity to see successful tests
39+
@perftest_config "
40+
[general]
41+
verbose = true
42+
"
43+
44+
@testset "Simple test" begin
45+
46+
N = 1000
47+
A,B = rand(N), rand(N)
48+
49+
@perfcompare :median_time < (0.000005 * N)
50+
@perftest VecOps.innerProduct(A,B)
51+
52+
end
53+
54+
```
55+
56+
Where:
57+
@perftest sets the computation to target for the tests.
58+
@perfcompare sets the testing methodology which is comparing the median time elapsed against a reference that is dependent on the size of the vectors.
59+
@perftest_config sets the configuration in a TOML format, in this case to disable automatic regression testing
60+
61+
62+
PertTest.jl relies on a configuration file written in TOML to refer for settings that are not specified anywhere else. In case no file is present, it will be made with the default configuration enabled. Please see the documentation for more information.
63+
64+
## Dependencies
65+
66+
```
67+
BenchmarkTools
68+
CountFlops
69+
CpuId
70+
JLD2
71+
JSON
72+
MLStyle
73+
MacroTools
74+
STREAMBenchmark
75+
Suppressor
76+
UnicodePlots
77+
Dates
78+
LinearAlgebra
79+
Pkg
80+
Printf
81+
TOML
82+
Test
83+
```
84+
85+
## Installation
86+
ImplicitGlobalGrid may be installed directly with the [Julia package manager](https://docs.julialang.org/en/v1/stdlib/Pkg/index.html) from the REPL:
87+
```julia-repl
88+
julia>]
89+
pkg> add https://github.com/JuliaPerf/PerfTest.jl
90+
pkg> test PerfTest
91+
```
992

93+
## Questions, comments and discussions
1094

11-
This is the source repository of the Julia package `PerfTest.jl`. Please head to the [-> documentation website <-](https://JuliaPerf.github.io/PerfTest.jl) to learn about its usage.
95+
Please email: [email protected] or raise an issue.
1296

97+
## Your contributions
1398

14-
> :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: This repository is under construction :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction:
99+
Help is more than welcome! If you have an idea/contribution that could benefit from this project, please share!

docs/src/api.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ Order = [:function, :macro]
3333
```
3434
#### Documentation
3535
```@autodocs
36-
Modules = [PerfTest, PerfTest.Configuration]
36+
Modules = [PerfTest, PerfTest.Configuration, PerfTest.BencherInterface]
3737
Order = [:function, :macro]
3838
```

examples/example-paper-implicitglobalgrid/EXP_test_halo_thr.jl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ import ImplicitGlobalGrid: @require, longnameof
1313
using ThreadPinning
1414
pinthreads(:compact)
1515
threadinfo()
16-
NTHREADS = 8
16+
NTHREADS = 16
1717

18+
# 256M Elements on STREAM Benchmark (2GB)
19+
@perftest_config "
20+
[machine_benchmarking]
21+
memory_bandwidth_test_buffer_size = 536870912
22+
"
1823

1924
array_types = ["CPU"]
2025
gpu_array_types = []
@@ -31,7 +36,8 @@ MPI.Init();
3136
nprocs = MPI.Comm_size(MPI.COMM_WORLD); # NOTE: these tests can run with any number of processes.
3237
ndims_mpi = GG.NDIMS_MPI;
3338
nneighbors_per_dim = GG.NNEIGHBORS_PER_DIM; # Should be 2 (one left and one right neighbor).
34-
nx = Int(round(sqrt(1024^3/4/16*NTHREADS/nprocs)));
39+
# 256M Elements (2GB)
40+
nx = Int(round(sqrt(536870912/16*NTHREADS/nprocs)));
3541
ny = nx;
3642
nz = 5;
3743
dx = 1.0
@@ -56,7 +62,6 @@ dz = 1.0
5662
ranges = [1:size(P,1), 1:size(P,2), 1:1];
5763

5864
i = 0
59-
@export_vars i nx ny MPI
6065
@define_eff_memory_throughput begin
6166
(nx * ny * 8) * 3 * MPI.Comm_size(MPI.COMM_WORLD) / :median_time
6267
end
@@ -69,7 +74,7 @@ dz = 1.0
6974
for i in 1:1
7075
GG.write_h2h!(buf, P, ranges, 3);
7176
end
72-
@perftest samples=100 begin
77+
@perftest begin
7378
GG.read_h2h!(buf, P2, ranges, 3);
7479
end
7580
finalize_global_grid(finalize_MPI=false);

0 commit comments

Comments
 (0)