Skip to content

Commit

Permalink
Run parallel examples during CI. (#1063)
Browse files Browse the repository at this point in the history
  • Loading branch information
1uc authored Dec 2, 2024
1 parent 66ce7a5 commit c890ad4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .github/run_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@ fi
for f in "${examples_dir}"/*_bin
do
echo "-- ${f}"
"${f}"
if [[ "${f}" == *"parallel_"* ]]
then
mpiexec -np 2 "${f}"
else
"${f}"
fi
done
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ jobs:
run: |
! ctest --verbose -C $BUILD_TYPE | grep HDF5-DIAG
- name: Examples
working-directory: ${{github.workspace}}/build/src/examples
run: $GITHUB_WORKSPACE/.github/run_examples.sh

# Job testing several versions of hdf5
# ===================================================
Expand Down Expand Up @@ -136,7 +139,6 @@ jobs:
run: |
! ctest --verbose -C $BUILD_TYPE | grep HDF5-DIAG
- name: Examples
working-directory: ${{github.workspace}}/build/src/examples
run: $GITHUB_WORKSPACE/.github/run_examples.sh
Expand Down
4 changes: 2 additions & 2 deletions src/examples/parallel_hdf5_collective_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ int main(int argc, char** argv) {
std::vector<size_t> offset{std::size_t(mpi_rank), 0ul};
std::vector<size_t> count{1ul, 2ul};

dataset.select(offset, count).write(data, xfer_props);
dataset.select(offset, count).squeezeMemSpace({0}).write(data, xfer_props);
check_collective_io(xfer_props);

// Let's ensure that everything has been written do disk.
Expand All @@ -104,7 +104,7 @@ int main(int argc, char** argv) {

// MPI ranks don't have to read non-overlapping parts, but in this
// example they happen to. Again all rank participate in this call.
dataset.select(offset, count).read(data, xfer_props);
dataset.select(offset, count).squeezeMemSpace({0}).read(data, xfer_props);
check_collective_io(xfer_props);

} catch (Exception& err) {
Expand Down

0 comments on commit c890ad4

Please sign in to comment.