Skip to content

Commit e5e335e

Browse files
authored
Add optional verbose configuration to .bazelrc (#737)
1 parent 948584a commit e5e335e

2 files changed

Lines changed: 39 additions & 9 deletions

File tree

.bazelrc

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# ~~~~ General flags ~~~~
16+
1517
# Common flags
1618
common --announce_rc
1719
common --experimental_repo_remote_exec
@@ -28,8 +30,14 @@ test --test_output=errors
2830
build:cuda --@local_config_cuda//:enable_cuda
2931
build:cuda --define=using_cuda=true --define=using_cuda_nvcc=true
3032

33+
# Configs for verbose builds & tests
34+
common:verbose --announce_rc
35+
common:verbose --auto_output_filter=none
36+
build:verbose --show_progress_rate_limit=1
37+
test:verbose --test_summary=detailed
38+
3139

32-
##### Sanitizers (choose one, or nosan for none) #####
40+
# ~~~~ Sanitizers (choose one, or nosan for none) ~~~~
3341

3442
# Shared config for sanitizers
3543
build:sanitizer --strip=never
@@ -50,7 +58,7 @@ build:msan --linkopt -fsanitize=leak
5058
build:nosan --
5159

5260

53-
##### Instruction set options (choose one) #####
61+
# ~~~~ Instruction set options (choose one) ~~~~
5462

5563
# Build with AVX2 + FMA
5664
build:avx --copt -O3
@@ -65,7 +73,7 @@ build:sse --copt -msse4
6573
build:basic --copt -O3
6674

6775

68-
##### Parallelization (choose one, or nopenmp for none) #####
76+
# ~~~~ Parallelization (choose one, or nopenmp for none) ~~~~
6977

7078
# Build with OpenMP
7179
build:openmp --copt -fopenmp
@@ -74,7 +82,8 @@ build:openmp --linkopt -lgomp
7482
# No OpenMP
7583
build:nopenmp --
7684

77-
##### Memory handler (choose one) #####
85+
86+
# ~~~~ Memory handler (choose one) ~~~~
7887

7988
# Build with tcmalloc
8089
build:tcmalloc --linkopt="-ltcmalloc"

docs/bazel.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ requires the circuit file to be specified both on the command line and in the
1616
bazel run --config=avx --config=openmp apps:qsim_base -- -c circuits/circuit_q24
1717
```
1818

19-
## Build configs
19+
## Build configurations
2020

2121
Depending on the optimizers available on your machine, different config flags
2222
(such as `--config=avx`, above) can be set to control which optimizers are
2323
included in a given build or test run.
2424

25-
Vector arithmetic optimizers (pick one at most):
25+
### Vector arithmetic optimizers
26+
27+
Pick at most one of the following options:
28+
2629
```
2730
# Use AVX instructions for vector arithmetic.
2831
--config=avx
@@ -34,7 +37,10 @@ Vector arithmetic optimizers (pick one at most):
3437
--config=basic
3538
```
3639

37-
Parallelism optimizers (pick one at most):
40+
### Parallelism optimizers
41+
42+
Pick at most one of the following options:
43+
3844
```
3945
# Use OpenMP to run operations in parallel when possible.
4046
--config=openmp
@@ -43,11 +49,26 @@ Parallelism optimizers (pick one at most):
4349
--config=nopenmp
4450
```
4551

46-
Memory allocation (pick one at most):
52+
### Memory allocators
53+
54+
55+
[TCMalloc](https://github.com/google/tcmalloc) is a fast, multithreaded
56+
implementation of C's `malloc()` and C++'s `new` operator. It is an independent
57+
open-source library developd by Google. TCMalloc can be used with qsim as an
58+
alternative to the default `malloc()`. Pick at most one of the following
59+
options:
60+
4761
```
48-
# Use tcmalloc for memory allocation.
62+
# Use TCMalloc for memory allocation.
4963
--config=tcmalloc
5064
5165
# Use malloc for memory allocation (default).
5266
--config=malloc
5367
```
68+
69+
### Additional configuration options
70+
71+
To provide more information when building and testing qsim, you can add the
72+
configuration option `--config=verbose` to any of the `bazel` commands above.
73+
74+
Other configuration options are described elsewhere in the qsim documentation.

0 commit comments

Comments
 (0)