Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Added documentation to README on running codes in parallel using pthreads and openMP
  • Loading branch information
nathanielmorgan authored May 21, 2024
1 parent 513f587 commit c299c65
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c299c65

Please sign in to comment.