diff --git a/README.md b/README.md index 1d54302ba..44643fc9c 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,38 @@ Note: `Kokkos` must be configured with `Kokkos_ENABLE_LIBDL=ON` to load profilin ## General Usage -To use one of the tools you have to compile it, which will generate a dynamic library. Before executing the Kokkos application you then have to set the environment variable `KOKKOS_TOOLS_LIBS` to point to the dynamic library e.g. in the `bash` shell: -``` -export KOKKOS_TOOLS_LIBS=${HOME}/kokkos-tools/src/tools/memory-events/kp_memory_event.so -``` +To use one of the tools you have to compile it, which will generate a dynamic library. Before executing the Kokkos application you then have to set the environment variable `KOKKOS_TOOLS_LIBS` to point to the dynamic library. + +CMake and Makefiles are supported for building Kokkos Tools. The following provides instructions for both. + +## Using cmake + +### Build + +1. Create a build directory in Kokkos Tools, e.g., type `mkdir myBuild; cd myBuild` +2. To configure, type `cmake .. -DCMAKE_INSTALL_PREFIX=${YOUR_KOKKOS_TOOLS_INSTALL_DIR}`. There are more options but in most cases the defaults are sufficient. +3. To compile, type `make` +4. To install, type `make install` + +### Run + +Given your installed tool shared library `lib.so` and an application executable called yourApplication.exe, type: + +`export KOKKOS_TOOLS_LIBS=${YOUR_KOKKOS_TOOLS_INSTALL_DIR}/lib.so; ./yourApplication.exe` + + +## Using make + +### Build + +To build some library `` with make, simply type `make` within that library's subdirectory `${YOUR_KOKKOS_TOOLS_LIB_SRC_DIR}` of Kokkos Tools. This generates the shared library within that subdirectory. + +### Run + +Given your installed tool shared library `.so` and an application executable called `yourApplication.exe`, type: + +`export KOKKOS_TOOLS_LIBS=${YOUR_KOKKOS_TOOLS_LIB_SRC_DIR}/.so; ./yourApplication.exe` -Many of the tools will produce an output file that uses the hostname as well as the process id as part of the filename. ## Explicit Instrumentation @@ -88,30 +114,6 @@ The following provides an overview of the tools available in the set of Kokkos T accumulate statistics, and utilize various portable function calls for common needs w.r.t. timers, resource usage, etc. -# Building Kokkos Tools - -Use either CMake or Makefile to build Kokkos Tools. - -## Using cmake - -1. create a build directory in Kokkos Tools, e.g., type `mkdir myBuild; cd myBuild` -2. To configure the Type `ccmake ..` for any options you would like to enable/disable. -3. To compile, type `make` -4. To install, type `make install` - -## Using make - -To build with make, simply type `make` within each subdirectory of Kokkos Tools. - - -Building using `make` is currently recommended. Eventually, the preferred method of building will be `cmake`. - -# Running a Kokkos-based Application with a tool - -Given your tool shared library `.so` (which contains kokkos profiling callback functions) and an application executable called yourApplication.exe, type: - -`export KOKKOS_TOOLS_LIBS=${YOUR_KOKKOS_TOOLS_DIR}/; ./yourApplication.exe` - # Tutorial A tutorial on Kokkos Tools can be found here: https://github.com/kokkos/kokkos-tutorials/blob/main/LectureSeries/KokkosTutorial_07_Tools.pdf