Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include accelerator modules in Lmod caches #200

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions scripts/update_lmod_caches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,26 @@ fi
# Find all subtrees of supported CPU targets by looking for "modules" directories, and taking their parent directory
architectures=$(find ${stack_base_dir}/software/ -maxdepth 5 -type d -name modules -exec dirname {} \;)

# Create/update the Lmod cache for all architectures
# Create/update the Lmod cache for all CPU targets
for archdir in ${architectures}
do
lmod_cache_dir="${archdir}/.lmod/cache"
${update_lmod_system_cache_files} -d ${lmod_cache_dir} -t ${lmod_cache_dir}/timestamp ${archdir}/modules/all
modulepath="${archdir}/modules/all"
# Find any accelerator targets for this CPU, and add them to the module path, so they will be included in the cache
if [ -d "${archdir}/accel" ]; then
accelerators=$(find ${archdir}/accel -maxdepth 3 -type d -name modules -exec dirname {} \;)
for acceldir in ${accelerators}; do
modulepath="${acceldir}/modules/all:$modulepath"
done
fi

${update_lmod_system_cache_files} -d ${lmod_cache_dir} -t ${lmod_cache_dir}/timestamp "${modulepath}"
exit_code=$?
if [[ ${exit_code} -eq 0 ]]; then
echo_green "Updated the Lmod cache for ${archdir}."
echo_green "Updated the Lmod cache for ${archdir} using MODULEPATH: ${modulepath}."
ls -lrt ${lmod_cache_dir}
else
echo_red "Updating the Lmod cache failed for ${archdir}."
echo_red "Updating the Lmod cache failed for ${archdir} using MODULEPATH: ${modulepath}."
exit ${exit_code}
fi
done
Loading