A comprehensive testing suite for the OpenSHMEM v1.5 specification. This suite provides extensive coverage of the OpenSHMEM API across both C and C11 language bindings.
SHMEMVV tests the correctness and conformance of OpenSHMEM implementations by systematically exercising all aspects of the v1.5 specification, including:
- Memory management
- Communication contexts
- Remote memory access
- Atomic memory operations
- Team-based operations
- Signaling operations
- Point-to-point synchronization
- Collectives
- Distributed locking
- Thread safety
Tests are implemented in both standard C and C11 to verify the correctness across different language standards.
- An implementation of OpenSHMEM v1.5
- CMake 3.10 or greater
- C compiler supporting both standard C and C11 standards
Before building the test suite, ensure your OpenSHMEM environment is properly configured:
-
Setting up OpenSHMEM compiler wrappers:
- The OpenSHMEM implementation must provide the
oshcc
compiler wrapper - This wrapper must be in your PATH
- Verify with:
which oshcc
- The OpenSHMEM implementation must provide the
-
Setting up the OpenSHMEM launcher:
- The OpenSHMEM implementation must provide the
oshrun
launcher - This launcher must be in your PATH
- Verify with:
which oshrun
- Some implementations may use a different launcher name. In that case, you'll need to specify it with the
--launcher
option when running the tests
- The OpenSHMEM implementation must provide the
-
OpenSHMEM runtime configuration:
- Some OpenSHMEM implementations require additional environment variables
- Consult your OpenSHMEM implementation's documentation for specific requirements
- Common variables include:
SHMEM_SYMMETRIC_SIZE
: Size of the symmetric heapSHMEM_DEBUG
: Enable debugging output
-
Clone the repository:
git clone https://github.com/michael-beebe/shmemvv.git cd shmemvv
-
Create a build directory:
mkdir build cd build
-
Configure with CMake:
# Basic configuration using the oshcc in your PATH cmake .. # Or explicitly specify the compiler path cmake \ -DCMAKE_C_COMPILER=$(which oshcc) \ .. # If your OpenSHMEM implementation's compiler is installed in a non-standard location: cmake \ -DCMAKE_C_COMPILER=/path/to/custom/installation/bin/oshcc \ ..
-
Build the test suite:
make
You can customize the build using various CMake options:
-DDISABLE_ALL_C_TESTS=ON
: Skip building all standard C tests-DDISABLE_ALL_C11_TESTS=ON
: Skip building all C11 tests-DDISABLE_C_ATOMICS=ON
: Skip building standard C atomic tests-DDISABLE_C11_ATOMICS=ON
: Skip building C11 atomic tests-DCMAKE_INSTALL_PREFIX=/path/to/install
: Specify installation directory
Example with multiple options:
cmake \
-DCMAKE_C_COMPILER=$(which oshcc) \
-DDISABLE_ALL_C11_TESTS=ON \
..
For a complete list of build options, refer to the CMakeLists.txt
file.
The test suite comes with a versatile test runner script that allows you to selectively run different categories of tests:
./shmemvv.sh --enable_c --enable_c11 # Run both standard C and C11 tests
By default, the test script uses oshrun
as the launcher. If your OpenSHMEM implementation uses a different launcher or if the launcher is in a non-standard location:
# Use a different launcher
./shmemvv.sh --enable_c --launcher mpirun
# Specify the full path to the launcher
./shmemvv.sh --enable_c --launcher /path/to/custom/oshrun
# Add custom arguments to the launcher
./shmemvv.sh --enable_c --launcher mpirun --launcher_args "--oversubscribe --map-by node"
You can run specific test categories using the following options:
./shmemvv.sh --enable_c --test_atomics # Run only atomic tests for standard C
./shmemvv.sh --enable_c11 --test_collectives # Run only collective tests for C11
./shmemvv.sh --enable_c --enable_c11 --test_setup # Run setup tests for both standard C and C11
--enable_c
: Enable standard C tests--enable_c11
: Enable C11 tests
You must enable at least one of these options.
You can override the default number of PEs (Processing Elements) for all tests:
./shmemvv.sh --enable_c --enable_c11 --np 4 # Run all tests with 4 PEs
You can exclude specific test categories:
./shmemvv.sh --enable_c --enable_c11 --exclude_pt2pt_synch # Run everything except point-to-point sync tests
The complete list of available options for the shmemvv.sh
script:
OpenSHMEM Verification and Validation Test Suite
Usage: ./shmemvv.sh [options]
Options:
--test_setup Run setup tests
--test_threads Run thread support tests
--test_mem Run memory management tests
--test_teams Run team management tests
--test_ctx Run communication/context management tests
--test_remote Run remote memory access tests
--test_atomics Run atomic memory operations tests
--test_signaling Run signaling operations tests
--test_collectives Run collective operations tests
--test_pt2pt_synch Run point-to-point synchronization tests
--test_locking Run distributed locking tests
--test_all (default) Run all tests
--exclude_setup Exclude setup tests
--exclude_threads Exclude thread support tests
--exclude_mem Exclude memory management tests
--exclude_teams Exclude team management tests
--exclude_ctx Exclude communication/context management tests
--exclude_remote Exclude remote memory access tests
--exclude_atomics Exclude atomic memory operations tests
--exclude_signaling Exclude signaling operations tests
--exclude_collectives Exclude collective operations tests
--exclude_pt2pt_synch Exclude point-to-point synchronization tests
--exclude_locking Exclude distributed locking tests
--np <N> (default=varies by test) Override default PE count for all tests
--launcher <cmd> (default=/root/sw/linuxkit-aarch64/sos_1.5.2/bin/oshrun) Path to oshrun launcher
--launcher_args <args> Add custom arguments to launcher
--enable_c11 Enable C11 tests
--enable_c Enable C/C++ tests
--verbose Enable verbose output
--no-color Disable colored output
--help Display this help message
Note: You must enable at least one of --enable_c or --enable_c11
Each test reports whether it passed or failed. The script provides a summary at the end of the run. Detailed logs are saved in the logs/
directory.
You can specify a custom launcher for running MPI processes:
./shmemvv.sh --enable_c --launcher mpirun --launcher_args "--oversubscribe"
You can combine multiple test categories in a single run:
./shmemvv.sh --enable_c --test_atomics --test_collectives --test_remote
The test output provides information about each test run, including:
- Test name and category
- Number of PEs used
- Success or failure status
- Error messages for failed tests
Detailed logs for each test are stored in the logs directory for further analysis.
-
Tests taking too long: Some tests, especially point-to-point synchronization tests, may take longer to run. Use the
--exclude_pt2pt_synch
option if needed. -
Build failures: Ensure your compiler supports C11 features if building C11 tests.
-
Launcher not found: Make sure the OpenSHMEM launcher (
oshrun
by default) is in your PATH. Usewhich oshrun
to verify, and consult your OpenSHMEM implementation's documentation for launcher setup instructions. -
Compilation errors: Verify that you're using the OpenSHMEM wrapper compiler (
oshcc
) rather than standard compilers. Check withwhich oshcc
to ensure it's properly installed and in your PATH. -
"Command not found" errors: If you encounter issues with missing commands, ensure your OpenSHMEM implementation is properly installed and its environment is sourced in your current shell.
Contributions to improve the test suite are welcome. Please submit pull requests with test improvements, bug fixes, or new tests for untested features.
See LICENSE