Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit c890ad4

Browse files
authored
Run parallel examples during CI. (#1063)
1 parent 66ce7a5 commit c890ad4

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

.github/run_examples.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,10 @@ fi
1616
for f in "${examples_dir}"/*_bin
1717
do
1818
echo "-- ${f}"
19-
"${f}"
19+
if [[ "${f}" == *"parallel_"* ]]
20+
then
21+
mpiexec -np 2 "${f}"
22+
else
23+
"${f}"
24+
fi
2025
done

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ jobs:
9292
run: |
9393
! ctest --verbose -C $BUILD_TYPE | grep HDF5-DIAG
9494
95+
- name: Examples
96+
working-directory: ${{github.workspace}}/build/src/examples
97+
run: $GITHUB_WORKSPACE/.github/run_examples.sh
9598

9699
# Job testing several versions of hdf5
97100
# ===================================================
@@ -136,7 +139,6 @@ jobs:
136139
run: |
137140
! ctest --verbose -C $BUILD_TYPE | grep HDF5-DIAG
138141
139-
140142
- name: Examples
141143
working-directory: ${{github.workspace}}/build/src/examples
142144
run: $GITHUB_WORKSPACE/.github/run_examples.sh

src/examples/parallel_hdf5_collective_io.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ int main(int argc, char** argv) {
9292
std::vector<size_t> offset{std::size_t(mpi_rank), 0ul};
9393
std::vector<size_t> count{1ul, 2ul};
9494

95-
dataset.select(offset, count).write(data, xfer_props);
95+
dataset.select(offset, count).squeezeMemSpace({0}).write(data, xfer_props);
9696
check_collective_io(xfer_props);
9797

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

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

110110
} catch (Exception& err) {

0 commit comments

Comments
 (0)