Skip to content

Commit

Permalink
ci: added script to the CI step for comparing parallel run results
Browse files Browse the repository at this point in the history
  • Loading branch information
wiltonloch committed Aug 30, 2024
1 parent fbad594 commit 864a176
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/compare_parallel_results.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#! /bin/bash

for processes in 2 4 8; do
if [ -s "diffs" ]; then
rm diffs
fi

for file in $(ls bin_1/fromfile_sol.zarr/); do
filename=$(ls bin_1/fromfile_sol.zarr/$file)
hexdump bin_1/fromfile_sol.zarr/$file/$filename > original
hexdump bin_${processes}/fromfile_sol.zarr/$file/$filename > new
diff original new >> diffs
done;
rm new original

diff bin_1/fromfile_sol.zarr/.zattrs bin_${processes}/fromfile_sol.zarr/.zattrs >> diffs
diff bin_1/fromfile_sol.zarr/.zgroup bin_${processes}/fromfile_sol.zarr/.zgroup >> diffs
for file in $(ls bin_1/fromfile_sol.zarr/); do
filename=$(ls -la bin_1/fromfile_sol.zarr/$file)
diff bin_1/fromfile_sol.zarr/$file/.zattrs bin_${processes}/fromfile_sol.zarr/$file/.zattrs >> diffs
diff bin_1/fromfile_sol.zarr/$file/.zarray bin_${processes}/fromfile_sol.zarr/$file/.zarray >> diffs
done;

if [ -s "diffs" ]; then
echo "Run with ${processes} processes has different results than sequential run"
exit 1;
fi
done;
exit 0;
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,4 @@ jobs:
mv bin bin_4
mpiexec -n 8 --host localhost:64 ./examples/fromfile/src/fromfile ../examples/fromfile/src/config/fromfile_config.yaml
mv bin bin_8
bash -l ../.github/compare_parallel_results.sh

0 comments on commit 864a176

Please sign in to comment.