From c299c651123ff2fdb29e1a2caf3a60fc977ec157 Mon Sep 17 00:00:00 2001 From: Nathaniel Morgan <47866137+nathanielmorgan@users.noreply.github.com> Date: Tue, 21 May 2024 15:27:46 -0600 Subject: [PATCH] Update README.md Added documentation to README on running codes in parallel using pthreads and openMP --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 923da44e..1d6e1c00 100644 --- a/README.md +++ b/README.md @@ -186,6 +186,22 @@ Using the main_kokkos.cpp executable as an example, it can be run by typing: ./mtestkokkos ``` +## Running codes in parallel +The openMP and pthread Kokkos backends require the user to specify the number of threads used to run the code in parallel. +To specify the number of threads with the Kokkos pthread backend, add the following command line argument when executing the code, +``` +--kokkos-threads=4 +``` +in otherwords, +``` +./mycode --kokkos-threads=4 +``` +The above command runs the code with fine grained parallelism using 4 threads. For the openMP backend, set the number of threads as an environement variable; this is done by typing the following command in the terminal, +``` +export OMP_NUM_THREADS=4 +``` +The CUDA and HIP backends do not need the number of threads specified. + ## Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.