https://github.com/thilinarmtb/ctest-mpi
Use CTest to test MPI programs
https://github.com/thilinarmtb/ctest-mpi
Last synced: 6 months ago
JSON representation
Use CTest to test MPI programs
- Host: GitHub
- URL: https://github.com/thilinarmtb/ctest-mpi
- Owner: thilinarmtb
- Created: 2024-09-13T15:13:48.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-16T15:50:09.000Z (about 1 year ago)
- Last Synced: 2025-02-01T09:13:16.420Z (8 months ago)
- Language: Shell
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Introduction
This repo contains an example on how to use `CTest` with MPI. Tests used are
located in `tests/` directory.# Build the tests
You need to have `CMake` and `MPI` installed in your system (in addition to a C
compiler). You can use the `environment.yml` to install `CMake` and `MPI` using
`conda`. Read more about installing `conda` [here](https://conda.io/projects/conda/en/latest/user-guide/install/index.html).```sh
conda env create -f environment.yml
conda activate ctestmpi
```Then you can use the `build.sh` script to build the tests.
```sh
./build.sh
```Do `build.sh --help` to see all the available configuration options.
You can pass additional MPI flags to `CTest` by using the `--custom-mpiflags`
option.
```sh
./build.sh --custom-mpiflags "--oversubscribe"
```# Run the tests
You can build and run the tests in a single go by doing:
```sh
./build.sh --test
```# Common issues
- You might have to set the `OMPI_CC` environment variable in case the MPI
compiler can't find your C compiler.
- Pass `--custom-mpiflags "--use-hwthread-cpus"` or
`--custom-mpiflags "--oversubscribe"` to `build.sh` if you want to use more
MPI processes than the physical cores available in your system.