From d607ca257ac4f2361fb58262324e8b2cc84a6eae Mon Sep 17 00:00:00 2001 From: Slaven Peles Date: Sun, 31 Dec 2023 20:05:29 -0500 Subject: [PATCH] Add an example of a script for running rocprof. --- docs/sphinx/developer_guide/profiling.rst | 31 ++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/docs/sphinx/developer_guide/profiling.rst b/docs/sphinx/developer_guide/profiling.rst index 7ef4b734..fcfd4686 100644 --- a/docs/sphinx/developer_guide/profiling.rst +++ b/docs/sphinx/developer_guide/profiling.rst @@ -159,7 +159,32 @@ In this example * Flag ``--hip-trace`` includes HIP API timelines in profiling data. * Flag ``--roctx-trace`` enables rocTX application code annotation trace. -The profiler will create JSON output file ``out.json`` (note the extension is -different than in the file specified in the call). To visualize output, one -can upload the JSON file to `Perfetto `_. +The profiler will create several files with name ``out`` but with different +extensions. To visualize output, one can upload the ``out.json`` file to +`Perfetto `_. + +When running ROCProfiler on a machine with a scheduler, it is a good idea +to write a profiling script. Here is an example for a SLURM scheduler: + +.. code:: shell + + #!/bin/bash + + #SBATCH -A CSC359 + #SBATCH -J resolve_test + #SBATCH -o %x-%j.out + #SBATCH -t 00:30:00 + #SBATCH -N 1 + + EXE=build/examples/klu_rocsolverrf_fgmres.exe + OUT=rocprof-resolve25k + ARGS="" + + echo "`date` Starting run" + srun -N 1 -n 1 -c 1 -G 1 \ + rocprof --stats --hip-trace --roctx-trace -o ${OUT}.csv \ + ${EXE} ${ARGS} + echo "`date` Finished run" + +