Skip to content

Commit 169122c

Browse files
committed
Documentation improvements
1 parent 45a5401 commit 169122c

File tree

6 files changed

+185
-119
lines changed

6 files changed

+185
-119
lines changed

sphinx/source/install_usage/install.rst

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
Installation
33
************
44

5-
For x86 systems we provide pre-built docker images users can quickly start with their own TAU instrumented applications (See `Chimbuko docker <https://codarcode.github.io/Chimbuko/installation/docker.html>`_). Otherwise, we recommend that Chimbuko be installed via the `Spack package manager <https://spack.io/>`_. Below we provide instructions for installing Chimbuko on a typical Ubuntu desktop and also on the Summit computer. Some details on installing Chimbuko in absence of Spack can be found in the :ref:`Appendix <manual_installation_of_chimbuko>`.
5+
For x86 systems we provide pre-built docker images users can quickly start with their own TAU instrumented applications (See `Chimbuko docker <https://codarcode.github.io/Chimbuko/installation/docker.html>`_). Otherwise, we recommend that Chimbuko be installed via the `Spack package manager <https://spack.io/>`_. Below we provide instructions for installing Chimbuko on a typical Ubuntu desktop and also on the Summit and Crusher computers. Some details on installing Chimbuko in absence of Spack can be found in the :ref:`Appendix <manual_installation_of_chimbuko>`.
66

7-
In all cases, the first step is to download and install Spack following the instructions `here <https://github.com/spack/spack>`_ . Note that installing Spack requires Python.
7+
The first step is to download and install Spack following the instructions `here <https://github.com/spack/spack>`_ . Note that installing Spack requires Python.
88

99
We require Spack repositories for Chimbuko and for the Mochi stack:
1010

@@ -24,9 +24,10 @@ A basic installation of Chimbuko can be achieved very easily:
2424

2525
.. code:: bash
2626
27-
spack install chimbuko^py-setuptools-scm+toml
27+
spack install chimbuko
2828
29-
Note that the dependency on :code:`py-setuptools-scm+toml` resolves a dependency conflict likely resulting from a bug in Spack's current dependency resolution.
29+
..
30+
^py-setuptools-scm+toml Note that the dependency on :code:`py-setuptools-scm+toml` resolves a dependency conflict likely resulting from a bug in Spack's current dependency resolution.
3031
3132
A Dockerfile (instructions for building a Docker image) that installs Chimbuko on top of a basic Ubuntu 18.04 image following the above steps can be found `here <https://github.com/CODARcode/PerformanceAnalysis/blob/master/docker/ubuntu18.04/openmpi4.0.4/Dockerfile.chimbuko.spack>`_ .
3233

@@ -71,7 +72,10 @@ Chimbuko can be built without MPI by disabling the **mpi** Spack variant as foll
7172

7273
.. code:: bash
7374
74-
spack install chimbuko~mpi ^py-setuptools-scm+toml
75+
spack install chimbuko~mpi
76+
77+
..
78+
^py-setuptools-scm+toml
7579
7680
When used in this mode the user is responsible for manually assigning a "rank" index to each instance of the online AD module, and also for ensuring that an instance of this module is created alongside each instance or rank of the target application (e.g. using a wrapper script that is launched via mpirun). We discuss how this can be achieved :ref:`here <non_mpi_run>`.
7781

@@ -117,10 +121,10 @@ Once installed, simply
117121
after loading the modules above.
118122

119123

120-
Spock
124+
Crusher
121125
~~~~~~
122126

123-
In the PerformanceAnalysis source we also provide a Spack environment yaml for use on Spock, :code:`spack/environments/spock.yaml`. This environment is designed for the AMD compiler suite with Rocm 4.3.0. Installation instructions follow:
127+
In the PerformanceAnalysis source we also provide a Spack environment yaml for use on Crusher, :code:`spack/environments/crusher_rocm5.2_PrgEnv-amd.yaml`. This environment is designed for the AMD programming environment with Rocm 5.2.0. Installation instructions follow:
124128

125129
First download the Chimbuko and Mochi repositories:
126130

@@ -129,7 +133,7 @@ First download the Chimbuko and Mochi repositories:
129133
git clone https://github.com/mochi-hpc/mochi-spack-packages.git
130134
git clone https://github.com/CODARcode/PerformanceAnalysis.git
131135
132-
Copy the file :code:`spack/environments/spock.yaml` from the PerformanceAnalysis git repository to a convenient location and edit the paths in the :code:`repos` section to point to the paths at which you downloaded the repositories:
136+
Copy the file :code:`spack/environments/crusher_rocm5.2_PrgEnv-amd.yaml` from the PerformanceAnalysis git repository to a convenient location and edit the paths in the :code:`repos` section to point to the paths at which you downloaded the repositories:
133137

134138
.. code:: yaml
135139
@@ -141,10 +145,18 @@ This environment uses the following modules, which must be loaded prior to insta
141145

142146
.. code:: bash
143147
144-
module reset
145-
module load PrgEnv-amd/8.2.0
146-
module load rocm/4.3.0
147-
module load cray-python/3.9.4.1
148+
module reset
149+
module load PrgEnv-amd/8.3.3
150+
module swap amd amd/5.2.0
151+
module load cray-python/3.9.12.1
152+
module load cray-mpich/8.1.17
153+
module load gmp
154+
module load craype-accel-amd-gfx90a
155+
export LD_LIBRARY_PATH=/opt/gcc/mpfr/3.1.4/lib:$LD_LIBRARY_PATH
156+
157+
# For some reason not set by the cray-mpich module?
158+
export PATH=${CRAY_MPICH_PREFIX}/bin:${PATH}
159+
export PATH=${ROCM_COMPILER_PATH}/bin:${PATH}
148160
149161
To install the environment:
150162

@@ -154,16 +166,13 @@ To install the environment:
154166
spack env activate my_chimbuko_env
155167
spack install
156168
157-
Unfortunately at present there are a few issues with Spack on Spock that require workarounds when loading the environment:
169+
To load the environment:
158170

159171
.. code:: bash
160172
161173
#Looks like spack doesn't pick up cray-xpmem pkg-config loc, put at end so only use as last resort
162174
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/lib64/pkgconfig
163175
164-
#Looks like spack misses an rpath for Chimbuko
165-
export LD_LIBRARY_PATH=/opt/cray/pe/libsci/21.08.1.2/AMD/4.0/x86_64/lib:${LD_LIBRARY_PATH}
166-
167176
spack env activate my_chimbuko_env
168177
spack load tau chimbuko-performance-analysis chimbuko-visualization2
169178

sphinx/source/install_usage/install_usage.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ Installation and Usage
66
.. include:: install.rst
77
.. include:: instrumenting.rst
88
.. include:: run_chimbuko.rst
9+
.. include:: post_analysis.rst
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
********************************************
2+
Analysing the results of a run with Chimbuko
3+
********************************************
4+
5+
The output of Chimbuko is stored in the provenance database. The database is sharded over multiple files of the form **provdb.${SHARD}.unqlite** that are by default output into the :file:`chimbuko/provdb` directory in the run path. We provide several tools for analyzing the contents of the provenance database:
6+
7+
1. **provdb_query**, a command-line tool for filtering and querying the database
8+
9+
2. A **Python module** for connecting to the database, filtering and querying, for use in custom analysis tools
10+
11+
3. **provdb-python**, a Python-based command-line tool for analyzing the database.
12+
13+
Using the post-analysis **Python module**
14+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15+
16+
The module
17+
18+
.. code:: bash
19+
20+
scripts/provdb_python/src/provdb_python/provdb_interact.py
21+
22+
in the PerformanceAnalysis source provides an interface for connecting and querying the database. Futher documentation is forthcoming.
23+
24+
25+
Using **provdb-python**
26+
~~~~~~~~~~~~~~~~~~~~~~~
27+
28+
This tool can also be installed via Spack
29+
30+
.. code:: bash
31+
32+
spack repo add /src/develop/PerformanceAnalysis/spack/repo/chimbuko
33+
spack install chimbuko-provdb-python
34+
35+
36+
Or using **pip** from the Chimbuko source (note the **py-mochi-sonata** Spack module is expected to be loaded):
37+
38+
.. code:: bash
39+
40+
git clone -b ckelly_develop https://github.com/CODARcode/PerformanceAnalysis.git && \
41+
python3.6 -m pip install PerformanceAnalysis/scripts/provdb_python/
42+
43+
44+
Once installed the tool can be used as a regular command line function, executed from the directory containing the provenance database UnQLite files:
45+
46+
.. code:: bash
47+
48+
cd chimbuko/provdb
49+
provdb-python
50+
51+
Several components are available, with further documentation forthcoming.
52+
53+
54+
Using **provdb_query**
55+
~~~~~~~~~~~~~~~~~~~~~~
56+
57+
The provenance database is stored in a single file, **provdb.${SHARD}.unqlite** in the job's run directory. From this directory the user can interact with the provenance database via the visualization module. A more general command line interface to the database is also provided via the **provdb_query** tool that allows the user to execute arbitrary jx9 queries on the database.
58+
59+
The **provdb_query** tool has two modes of operation: **filter** and **execute**.
60+
61+
Filter mode
62+
-----------
63+
64+
**filter** mode allows the user to provide a jx9 filter function that is applied to filter out entries in a particular collection. The result is displayed in JSON format and can be piped to disk. It can be used as follows:
65+
66+
.. code:: bash
67+
68+
provdb_query filter ${COLLECTION} ${QUERY}
69+
70+
Where the variables are as follows:
71+
72+
- **COLLECTION** : One of the three collections in the database, **anomalies**, **normalexecs**, **metadata** (cf :ref:`introduction/provdb:Provenance Database`).
73+
- **QUERY**: The query, format described below.
74+
75+
The **QUERY** argument should be a jx9 function returning a bool and enclosed in quotation marks. It should be of the format
76+
77+
.. code:: bash
78+
79+
QUERY="function(\$entry){ return \$entry['some_field'] == ${SOME_VALUE}; }"
80+
81+
82+
Alternatively the query can be set to "DUMP", which will output all entries.
83+
84+
The function is applied sequentially to each element of the collection. Inside the function the entry is described by the variable **$entry**. Note that the backslash-dollar (\\$) is necessary to prevent the shell from trying to expand the variable. Fields of **$entry** can be queried using the square-bracket notation with the field name inside. In the sketch above the field "some_field" is compared to a value **${SOME_VALUE}** (here representing a numerical value or a value expanded by the shell, *not* a jx9 variable!).
85+
86+
Some examples:
87+
88+
- Find every anomaly whose function contains the substring "Kokkos":
89+
90+
.. code:: bash
91+
92+
provdb_query filter anomalies "function(\$a){ return substr_count(\$a['func'],'Kokkos') > 0; }"
93+
94+
- Find all events that occured on a GPU:
95+
96+
.. code:: bash
97+
98+
provdb_query filter anomalies "function(\$a){ return \$a['is_gpu_event']; }"
99+
100+
Filter-global mode
101+
------------------
102+
103+
If the pserver is connected to the provenance database, at the end of the run the aggregated function profile data and global averages of counters will be stored in a "global" database "provdb.global.unqlite". This database can be queried using the **filter-global** mode, which like the above allows the user to provide a jx9 filter function that is applied to filter out entries in a particular collection. The result is displayed in JSON format and can be piped to disk. It can be used as follows:
104+
105+
.. code:: bash
106+
107+
provdb_query filter-global ${COLLECTION} ${QUERY}
108+
109+
Where the variables are as follows:
110+
111+
- **COLLECTION** : One of the two collections in the database, **func_stats**, **counter_stats**.
112+
- **QUERY**: The query, format described below.
113+
114+
The formatting of the **QUERY** argument is described above.
115+
116+
Execute mode
117+
------------
118+
119+
**execute** mode allows running a complete jx9 script on the database as a whole, allowing for more complex queries that collect different outputs and span collections.
120+
121+
.. code:: bash
122+
123+
provdb_query execute ${CODE} ${VARIABLES} ${OPTIONS}
124+
125+
Where the variables are as follows:
126+
127+
- **CODE** : The jx9 script
128+
- **VARIABLES** : a comma-separated list (without spaces) of the variables assigned by the script
129+
130+
The **CODE** argument is a complete jx9 script. As above, backslashes ('\') must be placed before internal '$' and '"' characters to prevent shell expansion.
131+
132+
If the option **-from_file** is specified the **${CODE}** variable above will be treated as a filename from which to obtain the script. Note that in this case the backslashes before the special characters are not necessary.
133+

sphinx/source/install_usage/run_chimbuko.rst

Lines changed: 3 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ which can be used as follows:
172172
<LAUNCH N RANKS OF APP ON BODY NODES> = jsrun -U main.urs
173173
174174
175-
Running on Spock
176-
^^^^^^^^^^^^^^^^
175+
Running on Slurm-based systems
176+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
177177

178-
In this section we provide specifics on launching on the Spock machine.
178+
This section we provide specifics on launching on the Spock machine, but the procedure will also apply to other machines using the Slurm task scheduler.
179179

180180
Spock uses the *slurm* job management system. To control the explicit placement of the ranks we will use the :code:`--nodelist` (:code:`-w`) slurm option to specify the nodes associated with a resource set, the :code:`--nodes` (:code:`-N`) option to specify the number of nodes and the :code:`--overlap` option to allow the AD and application resource sets to coexist on the same node. These options are documented `here <https://slurm.schedmd.com/srun.html>`_.
181181

@@ -350,84 +350,3 @@ To run the image the user must have access to a system with an installation of t
350350
nvidia-docker run -p 5002:5002 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined chimbuko/run_mocu:latest
351351
352352
And connect to this visualization server at **localhost:5002**.
353-
354-
355-
Interacting with the Provenance Database
356-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
357-
358-
The provenance database is stored in a single file, **provdb.${SHARD}.unqlite** in the job's run directory. From this directory the user can interact with the provenance database via the visualization module. A more general command line interface to the database is also provided via the **provdb_query** tool that allows the user to execute arbitrary jx9 queries on the database.
359-
360-
The **provdb_query** tool has two modes of operation: **filter** and **execute**.
361-
362-
Filter mode
363-
-----------
364-
365-
**filter** mode allows the user to provide a jx9 filter function that is applied to filter out entries in a particular collection. The result is displayed in JSON format and can be piped to disk. It can be used as follows:
366-
367-
.. code:: bash
368-
369-
provdb_query filter ${COLLECTION} ${QUERY}
370-
371-
Where the variables are as follows:
372-
373-
- **COLLECTION** : One of the three collections in the database, **anomalies**, **normalexecs**, **metadata** (cf :ref:`introduction/provdb:Provenance Database`).
374-
- **QUERY**: The query, format described below.
375-
376-
The **QUERY** argument should be a jx9 function returning a bool and enclosed in quotation marks. It should be of the format
377-
378-
.. code:: bash
379-
380-
QUERY="function(\$entry){ return \$entry['some_field'] == ${SOME_VALUE}; }"
381-
382-
383-
Alternatively the query can be set to "DUMP", which will output all entries.
384-
385-
The function is applied sequentially to each element of the collection. Inside the function the entry is described by the variable **$entry**. Note that the backslash-dollar (\\$) is necessary to prevent the shell from trying to expand the variable. Fields of **$entry** can be queried using the square-bracket notation with the field name inside. In the sketch above the field "some_field" is compared to a value **${SOME_VALUE}** (here representing a numerical value or a value expanded by the shell, *not* a jx9 variable!).
386-
387-
Some examples:
388-
389-
- Find every anomaly whose function contains the substring "Kokkos":
390-
391-
.. code:: bash
392-
393-
provdb_query filter anomalies "function(\$a){ return substr_count(\$a['func'],'Kokkos') > 0; }"
394-
395-
- Find all events that occured on a GPU:
396-
397-
.. code:: bash
398-
399-
provdb_query filter anomalies "function(\$a){ return \$a['is_gpu_event']; }"
400-
401-
Filter-global mode
402-
------------------
403-
404-
If the pserver is connected to the provenance database, at the end of the run the aggregated function profile data and global averages of counters will be stored in a "global" database "provdb.global.unqlite". This database can be queried using the **filter-global** mode, which like the above allows the user to provide a jx9 filter function that is applied to filter out entries in a particular collection. The result is displayed in JSON format and can be piped to disk. It can be used as follows:
405-
406-
.. code:: bash
407-
408-
provdb_query filter-global ${COLLECTION} ${QUERY}
409-
410-
Where the variables are as follows:
411-
412-
- **COLLECTION** : One of the two collections in the database, **func_stats**, **counter_stats**.
413-
- **QUERY**: The query, format described below.
414-
415-
The formatting of the **QUERY** argument is described above.
416-
417-
Execute mode
418-
------------
419-
420-
**execute** mode allows running a complete jx9 script on the database as a whole, allowing for more complex queries that collect different outputs and span collections.
421-
422-
.. code:: bash
423-
424-
provdb_query execute ${CODE} ${VARIABLES} ${OPTIONS}
425-
426-
Where the variables are as follows:
427-
428-
- **CODE** : The jx9 script
429-
- **VARIABLES** : a comma-separated list (without spaces) of the variables assigned by the script
430-
431-
The **CODE** argument is a complete jx9 script. As above, backslashes ('\') must be placed before internal '$' and '"' characters to prevent shell expansion.
432-
433-
If the option **-from_file** is specified the **${CODE}** variable above will be treated as a filename from which to obtain the script. Note that in this case the backslashes before the special characters are not necessary.

0 commit comments

Comments
 (0)