diff --git a/.bazelrc b/.bazelrc index b2953e0fd..7438b96af 100644 --- a/.bazelrc +++ b/.bazelrc @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +# ~~~~ General flags ~~~~ + # Common flags common --announce_rc common --experimental_repo_remote_exec @@ -28,8 +30,14 @@ test --test_output=errors build:cuda --@local_config_cuda//:enable_cuda build:cuda --define=using_cuda=true --define=using_cuda_nvcc=true +# Configs for verbose builds & tests +common:verbose --announce_rc +common:verbose --auto_output_filter=none +build:verbose --show_progress_rate_limit=1 +test:verbose --test_summary=detailed + -##### Sanitizers (choose one, or nosan for none) ##### +# ~~~~ Sanitizers (choose one, or nosan for none) ~~~~ # Shared config for sanitizers build:sanitizer --strip=never @@ -50,7 +58,7 @@ build:msan --linkopt -fsanitize=leak build:nosan -- -##### Instruction set options (choose one) ##### +# ~~~~ Instruction set options (choose one) ~~~~ # Build with AVX2 + FMA build:avx --copt -O3 @@ -65,7 +73,7 @@ build:sse --copt -msse4 build:basic --copt -O3 -##### Parallelization (choose one, or nopenmp for none) ##### +# ~~~~ Parallelization (choose one, or nopenmp for none) ~~~~ # Build with OpenMP build:openmp --copt -fopenmp @@ -74,7 +82,8 @@ build:openmp --linkopt -lgomp # No OpenMP build:nopenmp -- -##### Memory handler (choose one) ##### + +# ~~~~ Memory handler (choose one) ~~~~ # Build with tcmalloc build:tcmalloc --linkopt="-ltcmalloc" diff --git a/docs/bazel.md b/docs/bazel.md index c62aa48f8..990eb80a4 100644 --- a/docs/bazel.md +++ b/docs/bazel.md @@ -16,13 +16,16 @@ requires the circuit file to be specified both on the command line and in the bazel run --config=avx --config=openmp apps:qsim_base -- -c circuits/circuit_q24 ``` -## Build configs +## Build configurations Depending on the optimizers available on your machine, different config flags (such as `--config=avx`, above) can be set to control which optimizers are included in a given build or test run. -Vector arithmetic optimizers (pick one at most): +### Vector arithmetic optimizers + +Pick at most one of the following options: + ``` # Use AVX instructions for vector arithmetic. --config=avx @@ -34,7 +37,10 @@ Vector arithmetic optimizers (pick one at most): --config=basic ``` -Parallelism optimizers (pick one at most): +### Parallelism optimizers + +Pick at most one of the following options: + ``` # Use OpenMP to run operations in parallel when possible. --config=openmp @@ -43,11 +49,26 @@ Parallelism optimizers (pick one at most): --config=nopenmp ``` -Memory allocation (pick one at most): +### Memory allocators + + +[TCMalloc](https://github.com/google/tcmalloc) is a fast, multithreaded +implementation of C's `malloc()` and C++'s `new` operator. It is an independent +open-source library developd by Google. TCMalloc can be used with qsim as an +alternative to the default `malloc()`. Pick at most one of the following +options: + ``` -# Use tcmalloc for memory allocation. +# Use TCMalloc for memory allocation. --config=tcmalloc # Use malloc for memory allocation (default). --config=malloc ``` + +### Additional configuration options + +To provide more information when building and testing qsim, you can add the +configuration option `--config=verbose` to any of the `bazel` commands above. + +Other configuration options are described elsewhere in the qsim documentation.