Skip to content

Commit

Permalink
Merge pull request #2764 from boutproject/dnf5
Browse files Browse the repository at this point in the history
Prefer dnf5 for fedora CI (master)
  • Loading branch information
ZedThree authored Oct 12, 2023
2 parents d3d46e0 + 3184fe1 commit 0ab2353
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
23 changes: 15 additions & 8 deletions .ci_fedora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@ then
# 3. docker start -a mobydick <=> start to run the container (initialized with docker-cp)
if test $1 = podman ; then
cmd=podman
# For the use of testing
git submodule update --init # --recursive
else
cmd="sudo docker"
fi
test . != ".$2" && mpi="$2" || mpi=openmpi
test . != ".$3" && version="$3" || version=latest
test . != ".$3" && version="$3" || version=rawhide
time $cmd pull registry.fedoraproject.org/fedora:$version
time $cmd create --cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
--name mobydick registry.fedoraproject.org/fedora:$version \
/tmp/BOUT-dev/.ci_fedora.sh $mpi
time $cmd cp ${TRAVIS_BUILD_DIR} mobydick:/tmp
time $cmd cp ${TRAVIS_BUILD_DIR:-$(pwd)} mobydick:/tmp/BOUT-dev
time $cmd start -a mobydick
exit 0
fi
Expand All @@ -37,19 +39,19 @@ then
cat /etc/os-release
# Ignore weak depencies
echo "install_weak_deps=False" >> /etc/dnf/dnf.conf
time dnf -y install dnf5-plugins python3-pip cmake
time dnf -y install dnf5
time dnf5 -y install dnf5-plugins cmake python3-zoidberg python3-natsort
# Allow to override packages - see #2073
time dnf copr enable -y davidsch/fixes4bout || :
time dnf -y upgrade
time dnf -y builddep bout++
time dnf5 copr enable -y davidsch/fixes4bout || :
time dnf5 -y upgrade
time dnf5 -y builddep bout++
useradd test
cp -a /tmp/BOUT-dev /home/test/
chown -R test /home/test
chmod u+rwX /home/test -R
sudo -u test ${0/\/tmp/\/home\/test} $mpi
## If we are called as normal user, run test
else
pip install --user zoidberg natsort
. /etc/profile.d/modules.sh
module load mpi/${1}-x86_64
export OMPI_MCA_rmaps_base_oversubscribe=yes
Expand All @@ -58,7 +60,12 @@ else
cd
cd BOUT-dev
echo "starting configure"
time cmake -S . -B build -DBOUT_USE_PETSC=ON
time cmake -S . -B build -DBOUT_USE_PETSC=ON \
-DBOUT_UPDATE_GIT_SUBMODULE=OFF \
-DBOUT_USE_SYSTEM_FMT=ON \
-DBOUT_USE_SYSTEM_MPARK_VARIANT=ON \
-DBOUT_USE_SUNDIALS=ON

time make -C build build-check -j 2
time make -C build check
fi
1 change: 1 addition & 0 deletions src/bout++.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ namespace experimental {
void setupSignalHandler(SignalHandler signal_handler) {
#if BOUT_USE_SIGNAL
std::signal(SIGSEGV, signal_handler);
std::signal(SIGBUS, signal_handler);
#endif
#if BOUT_USE_SIGFPE
std::signal(SIGFPE, signal_handler);
Expand Down
2 changes: 1 addition & 1 deletion src/invert/laplace/impls/petsc/petsc_laplace.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ FieldPerp LaplacePetsc::solve(const FieldPerp& b, const FieldPerp& x0) {
if (reason <= 0) {
throw BoutException(
"petsc_laplace: inversion failed to converge. KSPConvergedReason: {} ({})",
KSPConvergedReasons[reason], reason);
KSPConvergedReasons[reason], static_cast<int>(reason));
}

// Add data to FieldPerp Object
Expand Down
2 changes: 1 addition & 1 deletion src/invert/laplace/impls/petsc3damg/petsc3damg.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ Field3D LaplacePetsc3dAmg::solve(const Field3D& b_in, const Field3D& x0) {
if (reason <= 0) {
throw BoutException(
"Petsc3dAmg: inversion failed to converge. KSPConvergedReason: {} ({})",
KSPConvergedReasons[reason], reason);
KSPConvergedReasons[reason], static_cast<int>(reason));
}

// Create field from result
Expand Down
8 changes: 5 additions & 3 deletions src/solver/impls/imex-bdf2/imex-bdf2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1228,17 +1228,19 @@ PetscErrorCode IMEXBDF2::solve_implicit(BoutReal curtime, BoutReal gamma) {
KSPGetConvergedReason(ksp, &kreason);
if (kreason < 0) {
if (verbose) {
output << "KSP Failed to converge with reason " << kreason << endl;
output << "KSP Failed to converge with reason " << static_cast<int>(kreason)
<< endl;
}
linear_fails++;
} else {
nonlinear_fails++;
if (verbose) {
output << "KSP Succeeded with reason " << kreason << endl;
output << "KSP Succeeded with reason " << static_cast<int>(kreason) << endl;
}
};
if (verbose) {
output << "SNES failed to converge with reason " << reason << endl;
output << "SNES failed to converge with reason " << static_cast<int>(reason)
<< endl;
}
throw PetscLib::SNESFailure(snesUse);
}
Expand Down

0 comments on commit 0ab2353

Please sign in to comment.