Skip to content

Commit

Permalink
MPI hook: adjusted verbosity levels for library replacement/injection…
Browse files Browse the repository at this point in the history
… log messages
  • Loading branch information
Madeeks committed Feb 26, 2024
1 parent cfef387 commit 69da301
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

### Changed

- MPI hook: verbosity levels for log messages about ABI compatibility and library replacements have been slightly adjusted.
In particular, a warning about adding libraries into the container has been moved to a higher verbosity level
(i.e. it will only be displayed when using the `--verbose` or `--debug` global command-line options).

### Fixed

- Glibc hook: fixed detection of the container's glibc version, which was causing a shell-init error on some systems
Expand Down
12 changes: 6 additions & 6 deletions src/hooks/mpi/MpiHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,22 +272,22 @@ void MpiHook::injectHostLibrary(const SharedLibrary& hostLib,

if (bestCandidateLib.isFullAbiCompatible(hostLib)){
// safe replacement, all good.
log(boost::format{"abi-compatible => bind mount host lib (%s) on top of container lib (%s) (i.e. override)"} % hostLib.getPath() % bestCandidateLib.getPath(), sarus::common::LogLevel::DEBUG);
log(boost::format{"abi-compatible => bind mounting host lib (%s) on top of container lib (%s) (i.e. override)"} % hostLib.getPath() % bestCandidateLib.getPath(), sarus::common::LogLevel::DEBUG);
sarus::runtime::validatedBindMount(hostLib.getPath(), bestCandidateLib.getPath(), userIdentity, rootfsDir);
createSymlinksInDynamicLinkerDefaultSearchDirs(bestCandidateLib.getPath(), hostLib.getPath().filename(), containerHasLibsWithIncompatibleVersion);
}
else if (bestCandidateLib.isMajorAbiCompatible(hostLib)){
// risky replacement, issue warning.
log(boost::format{"WARNING: container lib (%s) is major-only-abi-compatible => bind mount host lib (%s) into /lib"} % bestCandidateLib.getPath() % hostLib.getPath(), sarus::common::LogLevel::DEBUG);
// risky replacement, issue notice.
log(boost::format{"Container lib (%s) is major-only-abi-compatible => bind mounting host lib (%s) into /lib"} % bestCandidateLib.getPath() % hostLib.getPath(), sarus::common::LogLevel::INFO);
auto containerLib = "/lib" / hostLib.getPath().filename();
sarus::runtime::validatedBindMount(hostLib.getPath(), containerLib, userIdentity, rootfsDir);
createSymlinksInDynamicLinkerDefaultSearchDirs(containerLib, hostLib.getPath().filename(), containerHasLibsWithIncompatibleVersion);
}
else {
// inject with warning
// inject with notice
// NOTE: This branch is only for MPI dependency libraries. MPI libraries compatibility was already checked before at checkHostContainerAbiCompatibility. Hint for future refactoring.
log(boost::format{"WARNING: could not find ABI-compatible counterpart for host lib (%s) inside container (best candidate found: %s) => adding host lib (%s) into container's /lib via bind mount "}
% hostLib.getPath() % bestCandidateLib.getPath() % hostLib.getPath(), sarus::common::LogLevel::WARN);
log(boost::format{"Could not find ABI-compatible counterpart for host lib (%s) inside container (best candidate found: %s) => adding host lib (%s) into container's /lib via bind mount "}
% hostLib.getPath() % bestCandidateLib.getPath() % hostLib.getPath(), sarus::common::LogLevel::INFO);
auto containerLib = "/lib" / hostLib.getPath().filename();
sarus::runtime::validatedBindMount(hostLib.getPath(), containerLib, userIdentity, rootfsDir);
createSymlinksInDynamicLinkerDefaultSearchDirs(containerLib, hostLib.getPath().filename(), true);
Expand Down

0 comments on commit 69da301

Please sign in to comment.