Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buildspec tutorial documentation fix #1538

Merged
merged 10 commits into from
Jul 14, 2023
16 changes: 8 additions & 8 deletions docs/buildspecs/compiler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Shown below is an example build for this test.

The generated test for test name **hello_f** is the following:

.. dropdown:: ``buildtest inspect query -t hello_f``
.. dropdown:: ``buildtest inspect query --testpath hello_f``

.. program-output:: cat buildtest_tutorial_examples/compilers/inspect/gnu_hello_fortran.txt

Expand Down Expand Up @@ -126,7 +126,7 @@ Let's build this test, we will see there is one builder instance for each compil
If we inspect the following test, we see each test has its own compiler flags. The default cflag
is ``-O1`` while **gcc_6.5.0** will use ``-O2`` and **gcc_8.3.0** will use ``-O3``.

.. dropdown:: ``buildtest inspect query -t hello_c/``
.. dropdown:: ``buildtest inspect query --testpath hello_c/``

.. program-output:: cat buildtest_tutorial_examples/compilers/inspect/gnu_hello_c.txt

Expand Down Expand Up @@ -172,7 +172,7 @@ Now let's build this test.
We can see the generated test using ``buildtest inspect query`` given the name of test. Take a close
look at the ``export OMP_NUM_THREADS`` in the generated test.

.. dropdown:: ``buildtest inspect query -t openmp_hello_c_example``
.. dropdown:: ``buildtest inspect query --testpath openmp_hello_c_example``

.. program-output:: cat buildtest_tutorial_examples/compilers/inspect/openmp_hello.txt

Expand All @@ -188,11 +188,11 @@ We can build this test by running::

buildtest build -b $BUILDTEST_ROOT/examples/compilers/envvar_override.yml

Next, let's see the generated test by running ``buildtest inspect query -d all -t override_environmentvars``. The
Next, let's see the generated test by running ``buildtest inspect query -d all --testpath override_environmentvars``. The
shahzebsiddiqui marked this conversation as resolved.
Show resolved Hide resolved
``-d all`` will display all test records for ``override_environmentvars``. Take a note that we have
``export OMP_NUM_THREADS=4`` for `gcc_8.3.0` test and ``export OMP_NUM_THREADS=2`` for system gcc.

.. dropdown:: ``buildtest inspect query -t override_environmentvars/``
.. dropdown:: ``buildtest inspect query --testpath override_environmentvars/``

.. program-output:: cat buildtest_tutorial_examples/compilers/inspect/envvar_override.txt

Expand Down Expand Up @@ -254,7 +254,7 @@ You can build this test by running the following::
Once test is complete let's inspect the generated test. We see that buildtest will insert the line specified
by ``run`` property after compilation and run the executable.

.. dropdown:: ``buildtest inspect query -b -t custom_run_by_compilers/``
.. dropdown:: ``buildtest inspect query -b --testpath custom_run_by_compilers/``

.. program-output:: cat buildtest_tutorial_examples/compilers/inspect/custom_run.txt

Expand Down Expand Up @@ -298,7 +298,7 @@ You can run this example by running the following command::
If we inspect the content of test we see that buildtest will insert the shell commands
for ``pre_build``, ``post_build``, ``pre_run`` and ``post_run`` in its corresponding section.

.. dropdown:: ``buildtest inspect query -t pre_post_build_run``
.. dropdown:: ``buildtest inspect query --testpath pre_post_build_run``

.. program-output:: cat buildtest_tutorial_examples/compilers/inspect/pre_post_build_run.txt

Expand Down Expand Up @@ -336,7 +336,7 @@ If we build this test we see one test is created per compiler instance defined i
Next, let's see the generated test using ``buildtest inspect query``, we notice buildtest will set variables ``BUILDTEST_*`` for
each test to map to each compiler.

.. dropdown:: ``buildtest inspect query -t stream_openmp_c/``
.. dropdown:: ``buildtest inspect query --testpath stream_openmp_c/``

.. program-output:: cat buildtest_tutorial_examples/compilers/inspect/stream_example.txt

Expand Down
8 changes: 7 additions & 1 deletion docs/buildspecs/spack.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ If we look at the generated script for both tests, we see that mirror is added f
one can have mirrors defined in their ``spack.yaml`` or one of the `configuration scopes <https://spack.readthedocs.io/en/latest/configuration.html#configuration-scopes>`_
defined by spack.

.. dropdown:: ``buildtest inspect query -o --testpath add_mirror add_mirror_in_spack_env``
.. dropdown:: ``buildtest inspect query -o --testpath add_mirror add_mirror_in_spack_env``

.. program-output:: cat buildtest_tutorial_examples/spack/inspect/mirror_example.txt

Expand Down Expand Up @@ -325,11 +325,16 @@ since we are not using the a slurm executor.

.. literalinclude:: ../../examples/spack/spack_sbatch.yml
:language: yaml
:emphasize-lines: 7

buildtest will generate the shell script with the job directives and set the name, output and error
files based on name of test. If we build this test, and inspect the generated test we see that
**#SBATCH** directives are written based on the **sbatch** field.

.. dropdown:: ``buildtest build -b /home/spack/buildtest/examples/spack/spack_sbatch.yml``

.. program-output:: cat buildtest_tutorial_examples/spack/build/spack_sbatch.txt

.. dropdown:: ``buildtest inspect query --testpath spack_sbatch_example``

.. program-output:: cat buildtest_tutorial_examples/spack/inspect/spack_sbatch.txt
Expand All @@ -344,4 +349,5 @@ Shown below is an example buildspec that will specify ``sbatch`` directives for

.. literalinclude:: ../../examples/spack/spack_multiple_executor_sbatch.yml
:language: yaml
:emphasize-lines: 7-11

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -b -t custom_run_by_compilers/
$ buildtest inspect query -b --testpath custom_run_by_compilers/
────────────────────────────────────────────────────────────────────────────────────── custom_run_by_compilers/00777c4e-fba1-4dab-b197-972a4111470a ───────────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: Customize binary launch based on compiler
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -t override_environmentvars/
$ buildtest inspect query --testpath override_environmentvars/
────────────────────────────────────────────────────────────────────────────────────── override_environmentvars/4512576c-a862-4156-9e90-7b69e22061ae ──────────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: override default environment variables
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -t hello_c/
$ buildtest inspect query --testpath hello_c/
────────────────────────────────────────────────────────────────────────────────────────────── hello_c/5121e6ef-d112-46b8-bdb0-e8abb348301a ───────────────────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: Hello World C Compilation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -t hello_f
$ buildtest inspect query --testpath hello_f
────────────────────────────────────────────────────────────────────────────────────────────── hello_f/f030b521-098d-4d68-8a90-f2738342f68d ───────────────────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: Hello World Fortran Compilation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -t openmp_hello_c_example
$ buildtest inspect query --testpath openmp_hello_c_example
─────────────────────────────────────────────────────────────────────────────────────── openmp_hello_c_example/559c9f80-0ead-48d9-84c5-6ecb2c4c8213 ───────────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: OpenMP Hello World C example
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -t pre_post_build_run
$ buildtest inspect query --testpath pre_post_build_run
───────────────────────────────────────────────────────────────────────────────────────── pre_post_build_run/aee93675-6a3c-4423-9cf1-19a37fddba65 ─────────────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: example using pre_build, post_build, pre_run, post_run example
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -t stream_openmp_c/
$ buildtest inspect query --testpath stream_openmp_c/
────────────────────────────────────────────────────────────────────────────────────────── stream_openmp_c/8f8b6c26-a782-41ef-b004-1313107c6102 ───────────────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: STREAM Microbenchmark C Test with OpenMP
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -o -e -t mpich_e4s_testsuite
$ buildtest inspect query -o -e --testpath mpich_e4s_testsuite
──────────────────────────────────────────────────────────────────────────────────────── mpich_e4s_testsuite/a14380f6-722c-4d81-bc3d-4e051ae6f791 ─────────────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: Run E4S Testsuite mpich test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -o -t spack_env_directory
$ buildtest inspect query -o --testpath spack_env_directory
──────────────────────────────────────────────────────────────────────────────────────── spack_env_directory/c5e078b9-e1a7-44a7-b00c-662e89d196db ─────────────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: create spack environment in directory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -o -t spack_env_create_from_manifest
$ buildtest inspect query -o --testpath spack_env_create_from_manifest
─────────────────────────────────────────────────────────────────────────────────── spack_env_create_from_manifest/28fc5836-60b1-41d2-9b72-677bb011d12f ───────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: Create spack environment from spack.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -t install_in_spack_env
$ buildtest inspect query --testpath install_in_spack_env
──────────────────────────────────────────────────────────────────────────────────────── install_in_spack_env/9f0c2e5d-0974-4881-8066-c79aa2ed352f ────────────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: Install m4 and zlib in a spack environment named m4_zlib
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -o -t install_specs_example clone_spack_and_install_zlib
$ buildtest inspect query -o --testpath install_specs_example clone_spack_and_install_zlib
─────────────────────────────────────────────────────────────────────────────────────── install_specs_example/e19633f1-8ecd-4e30-b931-f2102038942c ────────────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: Install zlib from an existing spack instance
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -o -t add_mirror add_mirror_in_spack_env
$ buildtest inspect query -o --testpath add_mirror add_mirror_in_spack_env
────────────────────────────────────────────────────────────────────────────────────── add_mirror_in_spack_env/a1846e85-149f-4efb-9c20-cab8fd43c5f0 ───────────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: Declare spack mirror in spack environment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -o -t run_pre_post_commands
$ buildtest inspect query -o --testpath run_pre_post_commands
─────────────────────────────────────────────────────────────────────────────────────── run_pre_post_commands/3462c60f-14df-43a3-8729-59b3d12c06a0 ────────────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: Install zlib
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -t remove_environment_automatically remove_environment_explicit
$ buildtest inspect query --testpath remove_environment_automatically remove_environment_explicit
────────────────────────────────────────────────────────────────────────────────── remove_environment_automatically/e9de2b6c-8d1e-4859-b15d-2a3cfc34ad34 ──────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: remove spack environment automatically before creating a new environment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -t spack_sbatch_example
$ buildtest inspect query --testpath spack_sbatch_example
──────────────────────────────────────────────────────────────────────────────────────── spack_sbatch_example/af908912-36f3-4722-a3ff-4c06bd292208 ────────────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: sbatch directives can be defined in spack schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -o -t spack_test_m4
$ buildtest inspect query -o --testpath spack_test_m4
────────────────────────────────────────────────────────────────────────────────────────── spack_test_m4/63314812-fcd6-4aeb-a51e-c6cb3924d171 ──────────────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: Run spack test for m4 package and report results
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ buildtest inspect query -o -t spack_test_results_specs_format
$ buildtest inspect query -o --testpath spack_test_results_specs_format
────────────────────────────────────────────────────────────────────────────────── spack_test_results_specs_format/23f16eff-ed9f-46d9-aabe-46e188eedb01 ───────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: Run spack test results with spec format
Expand Down